blob: 9d59af33e1bf7c20126acbb8ac2cd17a69dbda35 [file] [log] [blame]
/*
author, editor title, subTitle textSigle
in corpusAuthor (corpusEditor), corpusTitle, corpusSubTitle, corpusSigle
in docAuthor (docEditor), docTitle, docSubTitle, docSigle
publisher
reference
creationDate
foundries
keywords
textClass
textColumn
textDomain
textType
textTypeArt
textTypeRef
language
license
pages
pubDate
layerInfo
tokenSource
biblEditionStatement
fileEditionStatement
*/
define(function () {
return {
/**
* Create new match object
*/
create : function (match) {
return Object.create(this)._init(match);
},
/**
* Initialize object
*/
_init : function (match) {
this._match = match;
this.opened = false;
return this;
},
/**
* Get match object
*/
match : function () {
return this._match;
},
/**
* Create match reference view.
*/
element : function (metaInfo) {
if (this._element !== undefined)
return this._element;
var metaTable = document.createElement('dl');
metaTable.classList.add('metatable');
this._element = metaTable;
// TODO: Meta fields should be separated
var keys = Object.keys(metaInfo);
for (var i in keys.sort()) {
var k = keys[i];
if (k !== "UID" &&
k !== "corpusID" &&
k !== "docID" &&
k !== "textID" &&
k !== "corpusSigle" &&
k !== "docSigle" &&
k !== "layerInfos") {
var metaL = document.createElement('div');
metaL.appendChild(
document.createElement('dt')
).appendChild(
document.createTextNode(k)
);
metaL.appendChild(
document.createElement('dd')
).appendChild(
document.createTextNode(metaInfo[k])
);
metaTable.appendChild(metaL);
};
};
return this._element;
}
};
});