src/main/webapp/js/corpora.js
/**
	 * Add some calculated properties to the index object (such as if it's a private index) and normalize some optional data to empty strings if missing.
	 *
	 * @param {BLIndex} index the index json object as received from blacklab-server
	 * @param {string} indexId full id of the index, including username portion (if applicable)
	 * @returns {Index}
	 */
Add some calculated properties to the index object (such as if it's a private index) and normalize some optional data to empty strings if missing.
@param {BLIndex} index the index json object as received from blacklab-server
@param {string} indexId full id of the index, including username portion (if applicable)
@returns {Index}
Add some calculated properties to the index object ( such as if it ' s a private index ) and normalize some optional data to empty strings if missing . @param { BLIndex } index the index json object as received from blacklab - server @param { string } indexId full id of the index including username portion ( if applicable ) @returns { Index }
function normalizeIndexData(index, indexId) {
		var shortId = indexId.substr(indexId.indexOf(':')+1);
		return $.extend({}, index, {
			id: indexId,
			shortId: shortId,
			documentFormat: index.documentFormat || '',
			canSearch: index.status === 'available',
			isBusy: index.status !== 'available' && index.status !== 'empty',
			isPrivate: shortId !== indexId,
		});
	}
function normalizeIndexData ( index , indexId ) { var shortId = indexId . substr ( indexId . indexOf ( ':' ) + 1 ) ; return $ . extend ( { } , index , { id : indexId , shortId : shortId , documentFormat : index . documentFormat || '' , canSearch : index . status === 'available' , isBusy : index . status !== 'available' && index . status !== 'empty' , isPrivate : shortId !== indexId , } ) ; }
Add some calculated properties to the index object (such as if it's a private index) and normalize some optional data to empty strings if missing.
Add some calculated properties to the index object ( such as if it ' s a private index ) and normalize some optional data to empty strings if missing .
// displayName always set