diff --git a/annotation/src/main/resources/applicationContext-annotation.xml b/annotation/src/main/resources/applicationContext-annotation.xml index 15b0210a0f2a1c51ff61470057e29fff1c4421ce..985de3164852bc22dd1502cd96b51291dfb33fe8 100644 --- a/annotation/src/main/resources/applicationContext-annotation.xml +++ b/annotation/src/main/resources/applicationContext-annotation.xml @@ -21,6 +21,7 @@ <bean id="EntrezAnnotator" class="lcsb.mapviewer.annotation.services.annotators.EntrezAnnotator"/> <bean id="GoAnnotator" class="lcsb.mapviewer.annotation.services.annotators.GoAnnotator"/> <bean id="HgncAnnotator" class="lcsb.mapviewer.annotation.services.annotators.HgncAnnotator"/> + <bean id="KeggAnnotator" class="lcsb.mapviewer.annotation.services.annotators.KeggAnnotator"/> <bean id="ReconAnnotator" class="lcsb.mapviewer.annotation.services.annotators.ReconAnnotator"/> <bean id="PdbAnnotator" class="lcsb.mapviewer.annotation.services.annotators.PdbAnnotator"/> <bean id="StitchAnnotator" class="lcsb.mapviewer.annotation.services.annotators.StitchAnnotator"/> diff --git a/frontend-js/src/main/css/global.css b/frontend-js/src/main/css/global.css index 83c544eb80ac66a49120ce614307f69fca78a4f8..7d91c173bfbdfb008505e08b85fcf666f617ad75 100644 --- a/frontend-js/src/main/css/global.css +++ b/frontend-js/src/main/css/global.css @@ -519,4 +519,14 @@ h1 { .minerva-datatable-toolbar { float: left; -} \ No newline at end of file +} + +.minerva-annotation-group { + padding-bottom: 10px; +} + +.minerva-annotation-group .minerva-annotation-group-header { + font-weight: bold + +} + diff --git a/frontend-js/src/main/js/gui/leftPanel/GuiUtils.js b/frontend-js/src/main/js/gui/leftPanel/GuiUtils.js index 61cb4dedd0eee1fcc24fa2cc54fa122c864b5bbc..38fbe4ab32b1cb5084dfe5154c6b60f07598be8e 100644 --- a/frontend-js/src/main/js/gui/leftPanel/GuiUtils.js +++ b/frontend-js/src/main/js/gui/leftPanel/GuiUtils.js @@ -183,19 +183,23 @@ GuiUtils.prototype.createAnnotationList = function (annotations, options) { var grouppedAnnotations = {}; for (var i = 0; i < annotations.length; i++) { - var desc = annotations[i].description; + var desc = annotations[i].getDescription(); + if (desc == "") desc = "Annotated by curator" if (!(desc in grouppedAnnotations)) grouppedAnnotations[desc] = []; grouppedAnnotations[desc].push(annotations[i]) } var cntAnnotations = 0; - for (var i = 0; i < grouppedAnnotations.keys().length; i++) { + // for (var i = 0; i < grouppedAnnotations.keys().length; i++) { + Object.keys(grouppedAnnotations).sort().forEach(function(desc){ - var desc = grouppedAnnotations.keys()[i]; + // var desc = grouppedAnnotations.keys()[i]; var groupContainer = (inline ? document.createElement("span") : document.createElement("div")); var descContainer = (inline ? document.createElement("span") : document.createElement("div")); + descContainer.innerHTML = (inline ? desc + ': ' : desc); - if (inline) groupContainer.className = "minerva-annotation-group"; + descContainer.className = "minerva-annotation-group-header"; + if (!inline) groupContainer.className = "minerva-annotation-group"; groupContainer.appendChild(descContainer); if (inline){ @@ -221,7 +225,7 @@ GuiUtils.prototype.createAnnotationList = function (annotations, options) { var row = document.createElement("div"); row.style.height = "26px"; - if (i % 2 === 0) { + if (j % 2 === 0) { row.className = "minerva-annotation-row-odd"; } else { row.className = "minerva-annotation-row-even"; @@ -248,7 +252,7 @@ GuiUtils.prototype.createAnnotationList = function (annotations, options) { } result.appendChild(groupContainer); - } + }); // for (var i = 0; i < annotations.length; i++) { // var element = annotations[i]; diff --git a/frontend-js/src/main/js/map/data/Annotation.js b/frontend-js/src/main/js/map/data/Annotation.js index 3398556e91787a8dc6693329281e7ab9ef5ae2ef..1496051649dedd03440ca4c2b04ade12f7798bca 100644 --- a/frontend-js/src/main/js/map/data/Annotation.js +++ b/frontend-js/src/main/js/map/data/Annotation.js @@ -15,6 +15,7 @@ function Annotation(javaObject) { } this.setType(javaObject.getType()); this.setResource(javaObject.getResource()); + this.setDescription(javaObject.getDescription()); } else { this.setLink(javaObject.link); this.setId(javaObject.id); @@ -23,6 +24,7 @@ function Annotation(javaObject) { } this.setType(javaObject.type); this.setResource(javaObject.resource); + this.setDescription(javaObject.description); } } @@ -72,4 +74,12 @@ Annotation.prototype.getArticle = function() { return this._article; }; +Annotation.prototype.setDescription = function(description) { + this._description = description; +}; + +Annotation.prototype.getDescription = function() { + return this._description; +}; + module.exports = Annotation;