Commit b9bf81e1 authored by David Hoksza's avatar David Hoksza
Browse files

rename and update of package.json

parent 49a6376a
......@@ -17,7 +17,7 @@
},
"author": "Piotr Gawron",
"devDependencies": {
"molstar": "1.0.0",
"molart": "1.0.3",
"assert": "1.4.1",
"bluebird": "^3.4.6",
"bootstrap": "^3.3.7",
......
......@@ -625,7 +625,7 @@ table.dataTable tbody td.no_padding, table.dataTable thead th.no_padding {
color: darkgrey;
}
.minerva-molstar-container {
.minerva-molart-container {
position: absolute;
left: 0;
top: 0;
......@@ -640,7 +640,7 @@ table.dataTable tbody td.no_padding, table.dataTable thead th.no_padding {
display: none;
}
.minerva-molstar-close-button {
.minerva-molart-close-button {
position: absolute;
left: 3px;
top: 3px;
......@@ -655,7 +655,7 @@ table.dataTable tbody td.no_padding, table.dataTable thead th.no_padding {
z-index: 101
}
.minerva-molstar-close-button:hover {
.minerva-molart-close-button:hover {
background: rgba(0, 0, 0, 0.4);
}
......
......@@ -11,7 +11,7 @@ function MapContextMenu(params) {
var self = this;
self._createMapContextMenuGui();
self.setMolStar(params.molStar);
self.setMolArt(params.molArt);
}
MapContextMenu.prototype = Object.create(ContextMenu.prototype);
......@@ -38,12 +38,12 @@ MapContextMenu.prototype.init = function() {
});
};
MapContextMenu.prototype.setMolStar = function(molStar){
this._molStar = molStar;
MapContextMenu.prototype.setMolArt = function(molArt){
this._molArt = molArt;
};
MapContextMenu.prototype.getMolStar = function(){
return this._molStar;
MapContextMenu.prototype.getMolArt = function(){
return this._molArt;
};
module.exports = MapContextMenu;
......@@ -172,7 +172,7 @@ AbstractCustomMap.prototype.registerMapClickEvents = function () {
this.getMapCanvas().addListener('rightclick', function (event) {
customMap.setActiveSubmapId(self.getId());
customMap.setActiveSubmapClickCoordinates(event.arg.point);
return activateMolStarLink(event.arg.point, self);
return activateMolArtLink(event.arg.point, self);
});
// prepare for image export
......@@ -237,7 +237,7 @@ AbstractCustomMap.prototype.registerMapClickEvents = function () {
* @param {AbstractCustomMap} map
* @returns {Promise}
*/
function activateMolStarLink(coordinates, map) {
function activateMolArtLink(coordinates, map) {
return map.getServerConnector().getClosestElementsByCoordinates({
modelId: map.getId(),
......@@ -264,10 +264,10 @@ function activateMolStarLink(coordinates, map) {
uniprotIds.push(ref.getResource());
}
}
if (uniprotIds.length > 0) map.getTopMap().getContextMenu().getMolStar().activateInContextMenu(uniprotIds);
else map.getTopMap().getContextMenu().getMolStar().deactivateInContextMenu();
if (uniprotIds.length > 0) map.getTopMap().getContextMenu().getMolArt().activateInContextMenu(uniprotIds);
else map.getTopMap().getContextMenu().getMolArt().deactivateInContextMenu();
}).catch(function () {
return map.getTopMap().getContextMenu().getMolStar().deactivateInContextMenu();
return map.getTopMap().getContextMenu().getMolArt().deactivateInContextMenu();
});
}
......
......@@ -2,32 +2,32 @@ var Functions = require('../../Functions');
var SubMenu = require('../../gui/SubMenu');
function MolStar(containerParentElement, customMap) {
function MolArt(containerParentElement, customMap) {
var molstarDiv = Functions.createElement({
var molartDiv = Functions.createElement({
type: "div",
id: "minervaMolStarContainer",
className: "minerva-molstar-container"
id: "minervaMolArtContainer",
className: "minerva-molart-container"
});
containerParentElement.appendChild(molstarDiv);
containerParentElement.appendChild(molartDiv);
this.setContainerElement(molstarDiv);
this.setContainerElement(molartDiv);
this._customMap = customMap;
}
MolStar.prototype.setContainerElement = function (containerElement) {
MolArt.prototype.setContainerElement = function (containerElement) {
this._containerElement = containerElement;
};
MolStar.prototype.getContainerElement = function () {
MolArt.prototype.getContainerElement = function () {
return this._containerElement;
};
function removeFromContextMenu(menu) {
$(menu.getElement()).find('li:contains("MolStar")').remove();
$(menu.getElement()).find('li:contains("MolArt")').remove();
}
MolStar.prototype.activateInContextMenu = function (uniprotIds) {
MolArt.prototype.activateInContextMenu = function (uniprotIds) {
var self = this;
var menu = this._customMap.getContextMenu();
......@@ -35,7 +35,7 @@ MolStar.prototype.activateInContextMenu = function (uniprotIds) {
var submenu = new SubMenu({
element: Functions.createElement({type: "li"}),
name: "Open MolStar",
name: "Open MolArt",
customMap: self._customMap
});
uniprotIds.forEach(function (uniprotId) {
......@@ -47,22 +47,22 @@ MolStar.prototype.activateInContextMenu = function (uniprotIds) {
};
MolStar.prototype.deactivateInContextMenu = function () {
MolArt.prototype.deactivateInContextMenu = function () {
var menu = this._customMap.getContextMenu();
removeFromContextMenu(menu);
menu.addOption("Open MolStar (no UniProt ID available)", function () {
menu.addOption("Open MolArt (no UniProt ID available)", function () {
}, true);
};
MolStar.prototype._deactivate = function () {
MolArt.prototype._deactivate = function () {
var container = this.getContainerElement();
container.style.display = 'none';
$(container).empty();
this.molStar.destroy();
this.molStar = undefined;
this.molArt.destroy();
this.molArt = undefined;
};
MolStar.prototype._activate = function (uniprotId) {
MolArt.prototype._activate = function (uniprotId) {
var self = this;
......@@ -78,20 +78,20 @@ MolStar.prototype._activate = function (uniprotId) {
$(container).css('z-index', maxZIndex + 1);
var molStarCloseButton = Functions.createElement({
var molArtCloseButton = Functions.createElement({
type: "div",
className: "minerva-molstar-close-button",
className: "minerva-molart-close-button",
content: 'x'
});
molStarCloseButton.addEventListener('click', function () {
molArtCloseButton.addEventListener('click', function () {
self._deactivate();
return false;
});
container.appendChild(molStarCloseButton);
container.appendChild(molArtCloseButton);
var MolStarPlugin = require('molstar');
var MolArtPlugin = require('molart');
this.molStar = new MolStarPlugin({
this.molArt = new MolArtPlugin({
uniprotId: uniprotId,
containerId: container.id
});
......@@ -99,4 +99,4 @@ MolStar.prototype._activate = function (uniprotId) {
};
module.exports = MolStar;
module.exports = MolArt;
......@@ -23,7 +23,7 @@ var SelectionContextMenu = require('./gui/SelectionContextMenu');
var GuiConnector = require('./GuiConnector');
var ServerConnector = require('./ServerConnector');
var MolStar = require('./map/structure/MolStar');
var MolArt = require('./map/structure/MolArt');
var Promise = require("bluebird");
......@@ -366,7 +366,7 @@ function create(params) {
mapContextMenu = new MapContextMenu({
element: functions.getElementByName(element, "contextMenu"),
customMap: customMap,
molStar: new MolStar(element, customMap)
molArt: new MolArt(element, customMap)
});
customMap.setContextMenu(mapContextMenu);
......
......@@ -11,7 +11,7 @@ var ControlType = require('../../../main/js/map/ControlType');
var CustomMap = require('../../../main/js/map/CustomMap');
var IdentifiedElement = require('../../../main/js/map/data/IdentifiedElement');
var MapContextMenu = require('../../../main/js/gui/MapContextMenu');
var MolStar = require('../../../main/js/map/structure/MolStar');
var MolArt = require('../../../main/js/map/structure/MolArt');
var Point = require('../../../main/js/map/canvas/Point');
var PointData = require('../../../main/js/map/data/PointData');
var PointMarker = require('../../../main/js/map/marker/PointMarker');
......@@ -552,7 +552,7 @@ describe('CustomMap', function () {
map.setContextMenu(new MapContextMenu({
customMap: map,
element: testDiv,
molStar: new MolStar(map.getElement(), map)
molArt: new MolArt(map.getElement(), map)
}));
return map.getContextMenu().init().then(function () {
......
......@@ -172,8 +172,8 @@ before(function () {
return {};
};
// ---
// MolStar is inproperly packed
global.MolStar = function () {
// MolArt is inproperly packed
global.MolArt = function () {
};
// ---
......
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