Commit 145d39af authored by Piotr Gawron's avatar Piotr Gawron
Browse files

css is generated via build process (it also includes dependeent css)

parent 6ffbd459
......@@ -4,9 +4,13 @@
"description": "frontentd for minerva google maps interface",
"main": "minerva.js",
"scripts": {
"build": "rm -rf dist & rmdir /q /s dist & mkdir dist & browserify --debug --standalone minerva src/main/js/minerva.js | exorcist dist/minerva.js.map > dist/minerva.js ",
"build:css": "cleancss -o dist/minerva.css src/main/css/*.css node_modules/dual-listbox/dist/*.css ",
"build:js": "browserify --debug --standalone minerva src/main/js/minerva.js | exorcist dist/minerva.js.map > dist/minerva.js ",
"//": "rm -rf dist & rmdir /q /s dist & mkdir dist & browserify --debug --standalone minerva src/main/js/minerva.js | exorcist dist/minerva.js.map > dist/minerva.js & uglifyjs --compress --mangle --in-source-map dist/minerva.js.map --source-map-include-sources --source-map dist/minerva.min.js.map -o dist/minerva.min.js dist/minerva.js",
"build-deploy": "rm -rf dist & rmdir /q /s dist & mkdir dist & browserify --debug --standalone minerva src/main/js/minerva.js | exorcist dist/minerva.js.map > dist/minerva.js & copy /Y \"dist\\*\" \"C:/Program Files/apache-tomcat-7.0.72/webapps/minerva/resources/js\" ",
"build-deploy": "npm run build && npm run deploy",
"build": "npm run clean && npm run build:css && npm run build:js",
"clean": "rm -rf dist & rmdir /q /s dist & mkdir dist",
"deploy": "copy /Y \"dist\\*.js*\" \"C:/Program Files/apache-tomcat-7.0.72/webapps/minerva/resources/js\" && copy /Y \"dist\\*.css\" \"C:/Program Files/apache-tomcat-7.0.72/webapps/minerva/resources/css\" ",
"lint": "jshint src/.",
"test": "istanbul cover node_modules/mocha/bin/_mocha -- --recursive src/test/js"
},
......@@ -17,6 +21,7 @@
"bootstrap": "^3.3.7",
"browserify": "^13.1.1",
"chai": "^3.5.0",
"clean-css-cli": "^4.1.6",
"datatables.net": "^1.10.13",
"exorcist": "^0.4.0",
"file-url": "^2.0.0",
......
......@@ -4,6 +4,7 @@
var Panel = require('../Panel');
var DualListbox = require('dual-listbox').DualListbox;
var GuiConnector = require('../../GuiConnector');
var logger = require('../../logger');
var Functions = require('../../Functions');
......@@ -29,10 +30,18 @@ ElementExportPanel.prototype._createGui = function() {
ElementExportPanel.prototype.init = function() {
var self = this;
var element = self.getElement();
return ServerConnector.getConfiguration().then(function(configuration) {
var configuration;
return ServerConnector.getConfiguration().then(function(result) {
configuration = result;
var typeDiv = self._createSelectTypeDiv(configuration.getElementTypes());
element.appendChild(typeDiv);
element.appendChild(self._createSelectColumnDiv());
return ServerConnector.getProjectStatistics(self.getProject().getProjectId());
}).then(function(statistics) {
var miriamDiv = self._createMiriamTypeDiv(statistics);
element.appendChild(miriamDiv);
new DualListbox(".minerva-multi-select");
$(window).trigger('resize');
});
}
......@@ -66,6 +75,33 @@ ElementExportPanel.prototype._createSelectTypeDiv = function(elementTypes) {
return typeDiv;
}
ElementExportPanel.prototype._createMiriamTypeDiv = function(statistics) {
var typeDiv = Functions.createElement({
type : "div",
name : "miriamSelectDiv",
});
var annotations = statistics.getElementAnnotations();
var selectElement = Functions.createElement({
type : "select",
className : "minerva-multi-select"
});
typeDiv.appendChild(selectElement);
for (var i = 0; i < annotations.length; i++) {
var miriamType = annotations[i].miriamType;
var count = annotations[i].count;
var option = new Option();
option.value = miriamType.getName();
option.text = miriamType.getName() + " " + count;
selectElement.appendChild(option);
}
logger.debug(DualListbox);
return typeDiv;
};
ElementExportPanel.prototype._createSelectColumnDiv = function() {
var self = this;
var columnDiv = Functions.createElement({
......
......@@ -8,8 +8,6 @@ function ProjectStatistics(data, configuration) {
// call super constructor
ObjectWithListeners.call(this);
logger.debug(data);
this.setReactionAnnotations(data.reactionAnnotations, configuration);
this.setElementAnnotations(data.elementAnnotations, configuration);
}
......@@ -45,4 +43,8 @@ ProjectStatistics.prototype.setElementAnnotations = function(elementAnnotations,
}
};
ProjectStatistics.prototype.getElementAnnotations = function() {
return this._elementAnnotations;
};
module.exports = ProjectStatistics;
......@@ -585,6 +585,7 @@ var minerva = {
createExport : createExport,
ServerConnector : OriginalServerConnector,
GuiConnector : OriginalGuiConnector,
DualListbox : require('dual-listbox').DualListbox,
};
module.exports = minerva;
......@@ -24,6 +24,17 @@ global.window.$ = $;
// additions to jsdom implementations:
global.Option = window.Option;
var originalCreateElement = document.createElement;
document.createElement = function(arg) {
var result = originalCreateElement.call(this, arg);
//woraround for: https://github.com/tmpvar/jsdom/issues/961
if ("li" === arg) {
result.dataset = [];
}
return result;
};
window.open = function() {
var result = {};
result.focus = function() {
......
......@@ -4,7 +4,7 @@
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui">
<h:outputStylesheet library="css" name="global.css" />
<h:outputStylesheet library="css" name="minerva.css" />
<div class="minerva-header">
<a href="#{request.contextPath}/?id=#{mapMB.currentMapId}" class="mainTitle"><i class="fa fa-home" style="font-size:17px"></i> #{mapMB.currentProject.name}</a>
......
......@@ -45,7 +45,7 @@ function initMap(){
</h:head>
<h:body onload="initMap();" >
<h:outputStylesheet library="css" name="style.css"/>
<h:outputStylesheet library="css" name="global.css" />
<h:outputStylesheet library="css" name="minerva.css" />
<h:outputStylesheet library="css" name="pileup.css"/>
<h:outputStylesheet library="css" name="bootstrap.min.css"/>
......
......@@ -48,7 +48,7 @@ function initMap(){
</h:head>
<h:body onload="initMap();" >
<h:outputStylesheet library="css" name="style.css"/>
<h:outputStylesheet library="css" name="global.css" />
<h:outputStylesheet library="css" name="minerva.css" />
<h:outputStylesheet library="css" name="pileup.css"/>
<h:outputStylesheet library="css" name="bootstrap.min.css"/>
......
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