From 6ffd56760c8a4a3817b1bfffcaab6f7d4b0081e7 Mon Sep 17 00:00:00 2001
From: Michael Hackstein
Date: Thu, 30 Jan 2014 23:55:17 +0100
Subject: [PATCH 1/4] Fixed a bug in the WI where it was not possible to
install a foxx in a specific version
---
.../aardvark/frontend/js/routers/router.js | 10 +++---
.../js/templates/foxxInstalledView.ejs | 2 +-
.../frontend/js/templates/foxxMountView.ejs | 2 +-
.../frontend/js/views/foxxInstalledView.js | 2 +-
.../frontend/js/views/foxxMountView.js | 35 +++++++++----------
js/apps/system/aardvark/lib/foxxes.js | 3 ++
6 files changed, 29 insertions(+), 25 deletions(-)
diff --git a/js/apps/system/aardvark/frontend/js/routers/router.js b/js/apps/system/aardvark/frontend/js/routers/router.js
index 13e83a8ac0..95dd10dc87 100644
--- a/js/apps/system/aardvark/frontend/js/routers/router.js
+++ b/js/apps/system/aardvark/frontend/js/routers/router.js
@@ -334,10 +334,12 @@
this.foxxList.fetch({
async: false
});
- var installAppView = new window.foxxMountView({
- model: this.foxxList.findWhere({_key: appkey})
- });
- installAppView.render();
+ if (!this.installAppView) {
+ this.installAppView = new window.foxxMountView({
+ collection: this.foxxList
+ });
+ }
+ this.installAppView.render(appkey);
},
appDocumentation: function(key) {
diff --git a/js/apps/system/aardvark/frontend/js/templates/foxxInstalledView.ejs b/js/apps/system/aardvark/frontend/js/templates/foxxInstalledView.ejs
index 597d60c03d..2a25165516 100644
--- a/js/apps/system/aardvark/frontend/js/templates/foxxInstalledView.ejs
+++ b/js/apps/system/aardvark/frontend/js/templates/foxxInstalledView.ejs
@@ -8,6 +8,6 @@
Version: <%=attributes.version %>
-
+
diff --git a/js/apps/system/aardvark/frontend/js/templates/foxxMountView.ejs b/js/apps/system/aardvark/frontend/js/templates/foxxMountView.ejs
index 11b1adbb6f..77aebd1a7c 100644
--- a/js/apps/system/aardvark/frontend/js/templates/foxxMountView.ejs
+++ b/js/apps/system/aardvark/frontend/js/templates/foxxMountView.ejs
@@ -34,6 +34,6 @@
diff --git a/js/apps/system/aardvark/frontend/js/views/foxxInstalledView.js b/js/apps/system/aardvark/frontend/js/views/foxxInstalledView.js
index 30ebc6f155..cbf19e133a 100644
--- a/js/apps/system/aardvark/frontend/js/views/foxxInstalledView.js
+++ b/js/apps/system/aardvark/frontend/js/views/foxxInstalledView.js
@@ -9,7 +9,7 @@
template: templateEngine.createTemplate("foxxInstalledView.ejs"),
events: {
- 'click #install': 'installFoxx'
+ 'click .install': 'installFoxx'
},
initialize: function(){
diff --git a/js/apps/system/aardvark/frontend/js/views/foxxMountView.js b/js/apps/system/aardvark/frontend/js/views/foxxMountView.js
index 6339473615..7fe1252982 100644
--- a/js/apps/system/aardvark/frontend/js/views/foxxMountView.js
+++ b/js/apps/system/aardvark/frontend/js/views/foxxMountView.js
@@ -2,28 +2,28 @@
/*global alert, Backbone, EJS, $, window, templateEngine */
window.foxxMountView = Backbone.View.extend({
+
el: '#modalPlaceholder',
- m: {},
-
- initialize: function () {
- this.m = this.model.attributes;
- },
+
template: templateEngine.createTemplate("foxxMountView.ejs"),
- render: function() {
- $(this.el).html(this.template.render(this.model));
-
+ events: {
+ "hidden #install-foxx" : "hidden",
+ "click #cancel" : "hideModal",
+ "click .installFoxx" : "install"
+ },
+
+ render: function(key) {
+ var m = this.collection.findWhere({_key: key});
+ this.m = m;
+ $(this.el).html(this.template.render(m));
$('#install-foxx').modal('show');
$('.modalTooltips').tooltip({
placement: "left"
});
return this;
},
- events: {
- "hidden #install-foxx" : "hidden",
- "click #cancel" : "hideModal",
- "click #install" : "install"
- },
+
hidden: function () {
window.App.navigate("applications", {trigger: true});
},
@@ -35,12 +35,10 @@ window.foxxMountView = Backbone.View.extend({
alert("Sorry, you have to give a valid mount point, e.g.: /myPath");
return false;
}
-
- var self = this;
- (new window.FoxxCollection()).create({
+ this.collection.create({
mount: mountPoint,
- name: self.m.name,
- version: self.m.version
+ name: this.m.get("name"),
+ version: this.m.get("version")
});
this.hideModal();
},
@@ -48,4 +46,5 @@ window.foxxMountView = Backbone.View.extend({
hideModal: function () {
$('#install-foxx').modal('hide');
}
+
});
diff --git a/js/apps/system/aardvark/lib/foxxes.js b/js/apps/system/aardvark/lib/foxxes.js
index c4811ded97..a89027a12a 100644
--- a/js/apps/system/aardvark/lib/foxxes.js
+++ b/js/apps/system/aardvark/lib/foxxes.js
@@ -65,6 +65,9 @@ exports.Foxxes = function () {
};
this.install = function (name, mount, version) {
+ if (version) {
+ name = "app:" + name + ":" + version;
+ }
return foxxmanager.mount(name, mount, { setup: true });
};
From e22972578c1f69ad3d1d05aa499b19237d091fdb Mon Sep 17 00:00:00 2001
From: Michael Hackstein
Date: Fri, 31 Jan 2014 01:14:45 +0100
Subject: [PATCH 2/4] Headerbar buttons now have a cursor: pointer
---
js/apps/system/aardvark/frontend/css/buttons.css | 1 +
1 file changed, 1 insertion(+)
diff --git a/js/apps/system/aardvark/frontend/css/buttons.css b/js/apps/system/aardvark/frontend/css/buttons.css
index fcd4a159d6..3ffaa7eddb 100644
--- a/js/apps/system/aardvark/frontend/css/buttons.css
+++ b/js/apps/system/aardvark/frontend/css/buttons.css
@@ -40,6 +40,7 @@ ul.headerButtonList > li {
a.headerButton {
float: left;
+ cursor: pointer;
margin-top: 0px;
margin-left: 5px;
margin-right: 5px;
From a219bc834294a3b10af48ee8cc4d633bd30cfa76 Mon Sep 17 00:00:00 2001
From: Michael Hackstein
Date: Fri, 31 Jan 2014 01:16:38 +0100
Subject: [PATCH 3/4] Changed internal layout of the graphviewer, This fixes
issues with the context menu, click events and display of edges to be
---
.../aardvark/frontend/css/graphView.css | 8 -----
.../aardvark/frontend/css/graphlayout.css | 31 ++++++++++++++-----
.../js/graphViewer/graph/arangoAdapter.js | 1 +
.../js/graphViewer/ui/contextMenuHelper.js | 17 +++++-----
.../js/graphViewer/ui/graphViewerUI.js | 2 +-
5 files changed, 36 insertions(+), 23 deletions(-)
diff --git a/js/apps/system/aardvark/frontend/css/graphView.css b/js/apps/system/aardvark/frontend/css/graphView.css
index b97e1ce853..27df6a926c 100644
--- a/js/apps/system/aardvark/frontend/css/graphView.css
+++ b/js/apps/system/aardvark/frontend/css/graphView.css
@@ -1,11 +1,3 @@
-svg.graphViewer {
- background-color: white;
- border-width: 1px;
- border-style: solid;
- border-color: rgba(0,0,0,0.125);
- margin-left: 74px;
-}
-
.gv_manageButtonContainer {
margin-top: 10px;
}
diff --git a/js/apps/system/aardvark/frontend/css/graphlayout.css b/js/apps/system/aardvark/frontend/css/graphlayout.css
index 4e30f47bc0..a43cf76ff2 100644
--- a/js/apps/system/aardvark/frontend/css/graphlayout.css
+++ b/js/apps/system/aardvark/frontend/css/graphlayout.css
@@ -1,3 +1,18 @@
+svg.graphViewer {
+ position: absolute;
+ left: 74px;
+ background-color: white;
+ border-width: 1px;
+ border-style: solid;
+ border-color: rgba(0,0,0,0.125);
+ z-index: 0;
+}
+
+div.gv_background {
+ position: relative;
+ height: 685px;
+}
+
img.searchSubmit {
height: 16px;
margin-left: -18px;
@@ -22,9 +37,9 @@ img.searchSubmit {
}
.toolbox {
- margin-left: 5px;
+ position: absolute;
+ left: 5px;
margin-right: 5px;
- margin-bottom: -340px;
border-radius: 0px !important;
-webkit-border-radius: 0px !important;
-moz-border-radius: 0px !important;
@@ -177,12 +192,14 @@ button.gv-icon-btn.trash{
background-image:url("../img/gv_trash.png");
}
div.gv_zoom_widget {
- position: relative;
+ position: absolute;
+ z-index: 1;
left: 95px;
+ top: 20px;
width: 40px;
height: 300px;
- margin-bottom: -322px;
}
+
div.gv_zoom_slider {
margin: 0px 17px;
width: 4px;
@@ -343,14 +360,14 @@ span.gv_caret {
}
div.gv_colour_list {
- position: relative;
+ position: absolute;
right: 26px;
top: 20px;
text-align: right;
- height: 680px;
+ max-height: 680px;
overflow: auto;
- margin-bottom: -100%;
float: right;
+ z-index: 1;
}
div.gv_colour_list li {
diff --git a/js/apps/system/aardvark/frontend/js/graphViewer/graph/arangoAdapter.js b/js/apps/system/aardvark/frontend/js/graphViewer/graph/arangoAdapter.js
index f6b7e01c62..6900a0649e 100644
--- a/js/apps/system/aardvark/frontend/js/graphViewer/graph/arangoAdapter.js
+++ b/js/apps/system/aardvark/frontend/js/graphViewer/graph/arangoAdapter.js
@@ -462,6 +462,7 @@ function ArangoAdapter(nodes, edges, viewer, config) {
};
self.createNode = function (nodeToAdd, callback) {
+ console.log("Creating node");
$.ajax({
cache: false,
type: "POST",
diff --git a/js/apps/system/aardvark/frontend/js/graphViewer/ui/contextMenuHelper.js b/js/apps/system/aardvark/frontend/js/graphViewer/ui/contextMenuHelper.js
index 82588a6f11..77df15c96a 100644
--- a/js/apps/system/aardvark/frontend/js/graphViewer/ui/contextMenuHelper.js
+++ b/js/apps/system/aardvark/frontend/js/graphViewer/ui/contextMenuHelper.js
@@ -53,7 +53,9 @@ function ContextMenu(id) {
},
bindMenu = function($objects) {
- menu = $.contextMenu.create(jqId, {shadow: false});
+ menu = $.contextMenu.create(jqId, {
+ shadow: false
+ });
$objects.each(function() {
$(this).bind('contextmenu', function(e){
menu.show(this,e);
@@ -64,13 +66,14 @@ function ContextMenu(id) {
divFactory = function() {
div = document.getElementById(id);
- if (!div) {
- div = document.createElement("div");
- div.id = id;
- ul = document.createElement("ul");
- document.body.appendChild(div);
- div.appendChild(ul);
+ if (div) {
+ div.parentElement.removeChild(div);
}
+ div = document.createElement("div");
+ div.id = id;
+ ul = document.createElement("ul");
+ document.body.appendChild(div);
+ div.appendChild(ul);
ul = div.firstChild;
return div;
};
diff --git a/js/apps/system/aardvark/frontend/js/graphViewer/ui/graphViewerUI.js b/js/apps/system/aardvark/frontend/js/graphViewer/ui/graphViewerUI.js
index b2ac56b1be..b19f7695bc 100644
--- a/js/apps/system/aardvark/frontend/js/graphViewer/ui/graphViewerUI.js
+++ b/js/apps/system/aardvark/frontend/js/graphViewer/ui/graphViewerUI.js
@@ -433,7 +433,7 @@ function GraphViewerUI(container, adapterConfig, optWidth, optHeight, viewerConf
};
container.appendChild(menubar);
container.appendChild(background);
- background.className = "thumbnails";
+ background.className = "thumbnails gv_background ";
background.id = "background";
viewerConfig = viewerConfig || {};
From 817013004baa78852c2bb74fbc3df7d0f85c1845 Mon Sep 17 00:00:00 2001
From: Michael Hackstein
Date: Fri, 31 Jan 2014 09:28:53 +0100
Subject: [PATCH 4/4] Fixed a bug where node creation does not work
determinisiticly
---
.../aardvark/frontend/js/graphViewer/graph/arangoAdapter.js | 4 ++--
.../aardvark/frontend/js/graphViewer/graph/eventDispatcher.js | 1 +
.../aardvark/frontend/js/graphViewer/graph/eventLibrary.js | 3 +--
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/js/apps/system/aardvark/frontend/js/graphViewer/graph/arangoAdapter.js b/js/apps/system/aardvark/frontend/js/graphViewer/graph/arangoAdapter.js
index 6900a0649e..83c9d8e1a3 100644
--- a/js/apps/system/aardvark/frontend/js/graphViewer/graph/arangoAdapter.js
+++ b/js/apps/system/aardvark/frontend/js/graphViewer/graph/arangoAdapter.js
@@ -29,8 +29,9 @@
////////////////////////////////////////////////////////////////////////////////
function ArangoAdapter(nodes, edges, viewer, config) {
+
"use strict";
-
+
if (nodes === undefined) {
throw "The nodes have to be given.";
}
@@ -462,7 +463,6 @@ function ArangoAdapter(nodes, edges, viewer, config) {
};
self.createNode = function (nodeToAdd, callback) {
- console.log("Creating node");
$.ajax({
cache: false,
type: "POST",
diff --git a/js/apps/system/aardvark/frontend/js/graphViewer/graph/eventDispatcher.js b/js/apps/system/aardvark/frontend/js/graphViewer/graph/eventDispatcher.js
index 4344e415b6..388593a6a0 100644
--- a/js/apps/system/aardvark/frontend/js/graphViewer/graph/eventDispatcher.js
+++ b/js/apps/system/aardvark/frontend/js/graphViewer/graph/eventDispatcher.js
@@ -133,6 +133,7 @@ function EventDispatcher(nodeShaper, edgeShaper, config) {
bindSVGEvents = function() {
svgObj = svgObj || $("svg");
+ svgObj.unbind();
_.each(svgBase, function(fs, ev) {
svgObj.bind(ev, function(trigger) {
_.each(fs, function(f) {
diff --git a/js/apps/system/aardvark/frontend/js/graphViewer/graph/eventLibrary.js b/js/apps/system/aardvark/frontend/js/graphViewer/graph/eventLibrary.js
index 8d850c80af..612950fc69 100644
--- a/js/apps/system/aardvark/frontend/js/graphViewer/graph/eventLibrary.js
+++ b/js/apps/system/aardvark/frontend/js/graphViewer/graph/eventLibrary.js
@@ -1,6 +1,5 @@
/*jslint indent: 2, nomen: true, maxlen: 100, sloppy: true, vars: true, white: true, plusplus: true */
/*global _*/
-/* global eventLibrary */
////////////////////////////////////////////////////////////////////////////////
/// @brief Graph functionality
@@ -119,7 +118,7 @@ function EventLibrary() {
this.InsertNode = function (config) {
self.checkNodeEditorConfig(config);
var adapter = config.adapter,
- nodeShaper = config.shaper;
+ nodeShaper = config.shaper;
return function(data, callback, x, y) {
var cb, d;