Commit 246fd3d6 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

lint issues

parent d5fa842e
......@@ -4,10 +4,9 @@
var Promise = require("bluebird");
var Alias = require('../map/data/Alias');
var GuiConnector= require('../GuiConnector');
var ObjectWithListeners = require('../ObjectWithListeners');
var Reaction = require('../map/data/Reaction');
var logger = require('../logger');
......@@ -72,14 +71,14 @@ AbstractPanel.prototype. createLabel=function(value) {
result.innerHTML = value;
result.className = "searchDescriptionLabel";
return result;
}
};
AbstractPanel.prototype.createPostTranslationalModifications = function(label, value) {
var result = document.createElement("div");
if (value !== undefined) {
throw new Error("Not implemented");
}
return result;
}
};
AbstractPanel.prototype.createCandidates=function(label, value) {
var result = document.createElement("div");
......@@ -87,7 +86,7 @@ AbstractPanel.prototype.createCandidates=function(label, value) {
throw new Error("Not implemented");
}
return result;
}
};
AbstractPanel.prototype.createChebiTree=function(label, value) {
var result = document.createElement("div");
......@@ -95,11 +94,11 @@ AbstractPanel.prototype.createChebiTree=function(label, value) {
throw new Error("Not implemented");
}
return result;
}
};
AbstractPanel.prototype.createSeparator=function() {
var result = document.createElement("hr");
return result;
}
};
AbstractPanel.prototype.createNewLine=function(count) {
var result = document.createElement("p");
......@@ -107,18 +106,16 @@ AbstractPanel.prototype.createNewLine=function(count) {
result.style.height = ((count-1) * 10) + "px";
}
return result;
}
};
AbstractPanel.prototype.createAnnotationLink=function(element, showType) {
var name, type, link, hint;
var name, type, hint;
if (element.title!==undefined) {
hint = element.title+" "+element.authors.join(", ")+", "+element.year+", "+ element.journal;
link = element.link;
type = "PUBMED";
name = element.id;
} else {
name = element.name;
link = element.link;
type = element.type;
}
var link = document.createElement("a");
......@@ -191,7 +188,7 @@ AbstractPanel.prototype.createAnnotations=function(label, value, options) {
}
}
return result;
}
};
AbstractPanel.prototype.setMap = function(map) {
this._map = map;
......@@ -270,7 +267,7 @@ AbstractPanel.prototype.getElementByName = function(element, name) {
}
}
return undefined;
}
};
AbstractPanel.prototype.getSearchButton = function() {
return this.getElementByName(this.getSearchQueryElement(),"searchButton");
......@@ -384,13 +381,13 @@ AbstractPanel.prototype.createSubMapLink = function(label, element) {
button.onclick = function() {
return self.getMap().openSubmodel(element.getModelId());
};
result.appendChild(createLabel("Submodel: "));
result.appendChild(this.createLabel("Submodel: "));
result.appendChild(button);
}
return result;
};
AbstractPanel.prototype.getAutocomplete = function(query) {
AbstractPanel.prototype.getAutocomplete = function() {
logger.warn("Get autocomplete not implemented");
};
......
......@@ -3,12 +3,7 @@
/* exported logger */
var logger = require('../logger');
var Promise = require("bluebird");
var AbstractPanel = require('./AbstractPanel');
var Alias = require('../map/data/Alias');
var GuiConnector = require('../GuiConnector');
var Reaction = require('../map/data/Reaction');
function DrugPanel(params) {
params.panelName = "drug";
......@@ -55,7 +50,7 @@ DrugPanel.prototype.createTargetElement = function(target, icon) {
var descColumn = document.createElement("td");
result.appendChild(descColumn);
descColumn.appendChild(self.createParamLine("Name: ", target.getName()))
descColumn.appendChild(self.createParamLine("Name: ", target.getName()));
descColumn.appendChild(self.createAnnotations("Elements: ", target.getTargetParticipants(), {
showType : false,
inline : true
......@@ -113,7 +108,7 @@ DrugPanel.prototype.addResultTab = function(query, elements) {
var tableDiv = document.createElement("table");
tableDiv.className = "table table-bordered";
contentDiv.appendChild(tableDiv);
var tableBody = document.createElement("tbody")
var tableBody = document.createElement("tbody");
tableDiv.appendChild(tableBody);
for (var i = 0; i < elements.length; i++) {
......
"use strict";
/* exported logger */
var Promise = require("bluebird");
/* exported logger*/
var AbstractPanel = require('./AbstractPanel');
var Alias = require('../map/data/Alias');
var GuiConnector = require('../GuiConnector');
var Reaction = require('../map/data/Reaction');
var logger = require('../logger');
......
......@@ -156,7 +156,7 @@ Submap.prototype.setCustomMap = function(customMap) {
this._customMap = customMap;
};
Submap.prototype.getProject = function(customMap) {
Submap.prototype.getProject = function() {
return this.getCustomMap().getProject();
};
......
......@@ -11,7 +11,7 @@ function Drug(javaObject) {
this.setDescription(javaObject.description);
this.setTargets(javaObject.targets);
this.setBloodBrainBarrier(javaObject.bloodBrainBarrier);
};
}
Drug.prototype.setBrandNames = function(brandNames) {
this._brandNames = brandNames;
......
......@@ -160,6 +160,6 @@ IdentifiedElement.prototype.equals = function(argument) {
} else {
return false;
}
}
};
module.exports = IdentifiedElement;
"use strict";
/* exported logger */
var IdentifiedElement = require('./IdentifiedElement');
var logger = require('../../logger');
......@@ -9,7 +11,7 @@ function Target(javaObject) {
this.setTargetElements(javaObject.targetElements);
this.setTargetParticipants(javaObject.targetParticipants);
this.setReferences(javaObject.references);
};
}
Target.prototype.setTargetElements = function(targetElements) {
this._targetElements = [];
......@@ -17,42 +19,42 @@ Target.prototype.setTargetElements = function(targetElements) {
this._targetElements.push(new IdentifiedElement(targetElements[i]));
}
this.setIsVisible(this._targetElements.length > 0);
}
};
Target.prototype.getTargetElements = function() {
return this._targetElements;
}
};
Target.prototype.setTargetParticipants = function(targetParticipants) {
this._targetParticipants = targetParticipants;
}
};
Target.prototype.getTargetParticipants = function() {
return this._targetParticipants;
}
};
Target.prototype.setName = function(name) {
this._name = name;
}
};
Target.prototype.getName = function() {
return this._name;
}
};
Target.prototype.setIsVisible = function(visible) {
this._isVisible = visible;
}
};
Target.prototype.isVisible = function() {
return this._isVisible;
}
};
Target.prototype.setReferences = function(references) {
this._references = references;
}
};
Target.prototype.getReferences = function() {
return this._references;
}
};
module.exports = Target;
......@@ -69,7 +69,7 @@ AbstractMarker.prototype.getCustomMap = function() {
};
AbstractMarker.prototype.setCustomMap = function(map) {
this._map = map;;
this._map = map;
};
/**
......
......@@ -4,10 +4,8 @@ var logger = require('../../logger');
var Promise = require("bluebird");
var Alias = require('../data/Alias');
var IdentifiedElement = require('../data/IdentifiedElement');
var OverlayCollection = require('./OverlayCollection');
var Reaction = require('../data/Reaction');
var ServerConnector = require('../../ServerConnector');
......@@ -58,7 +56,7 @@ DrugDbOverlay.prototype.decodeQuery= function (query){
DrugDbOverlay.prototype.getElementsByQuery = function(query) {
var self = this;
return new Promise(function(resolve, reject){
return new Promise(function(resolve){
var i;
var queryId = null;
var queries =self.getQueries();
......@@ -202,7 +200,7 @@ DrugDbOverlay.prototype.createIdentifiedElementsForDrug = function(drug, colourI
iconCounter++;
}
return result;
}
};
DrugDbOverlay.prototype.getIdentifiedElements = function(){
......@@ -254,7 +252,7 @@ DrugDbOverlay.prototype.getDetailDataByIdentifiedElement = function(element, gen
if (general) {
return self.searchNamesByTarget(element);
} else {
return new Promise(function(resolve, reject){
return new Promise(function(resolve){
var result =[];
var queries =self.getQueries();
for (var i=0;i<queries.length;i++) {
......@@ -275,5 +273,6 @@ DrugDbOverlay.prototype.getDetailDataByIdentifiedElement = function(element, gen
resolve(result);
});
}
}
};
module.exports = DrugDbOverlay;
......@@ -4,7 +4,6 @@ var Helper = require('../helper');
require("../mocha-config.js");
var Alias = require('../../../main/js/map/data/Alias');
var DrugPanel = require('../../../main/js/gui/DrugPanel');
var chai = require('chai');
......@@ -52,7 +51,7 @@ describe('DrugPanel', function() {
var div = helper.createDrugTab();
var map = helper.createCustomMap();
map.getModel().setId(15781);
var drugDbOverlay = helper.createDrugDbOverlay(map);
helper.createDrugDbOverlay(map);
var panel = new DrugPanel({
element : div,
......
......@@ -211,7 +211,7 @@ describe('AliasInfoWindow', function() {
var alias = helper.createAlias();
alias.setId(329170);
alias.setModelId(map.getId())
alias.setModelId(map.getId());
map.getModel().addAlias(alias);
var aliasWindow = new AliasInfoWindow(alias, map);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment