From fe2825df8857e424eb64c73aeb864abc8f475db3 Mon Sep 17 00:00:00 2001 From: Michael Hackstein Date: Fri, 24 May 2013 15:54:37 +0200 Subject: [PATCH] GraphViewer: Optmized layout, there was a miss-typing of a class name --- html/admin/css/graphView.css | 10 +++++ .../admin/js/graphViewer/graph/nodeReducer.js | 2 - .../specAdapter/arangoAdapterUISpec.js | 44 +++++++++---------- .../graphViewer/ui/arangoAdapterControls.js | 2 +- .../js/graphViewer/ui/modalDialogHelper.js | 6 +-- 5 files changed, 36 insertions(+), 28 deletions(-) diff --git a/html/admin/css/graphView.css b/html/admin/css/graphView.css index 0d2e22b324..a618f90df5 100644 --- a/html/admin/css/graphView.css +++ b/html/admin/css/graphView.css @@ -27,6 +27,16 @@ margin-right: 10px; } +svg.graphViewer text { + font: 11px Arial; + pointer-events: none; + stroke: #000; +} + +.capitalize { + text-transform:capitalize; +} + svg.graphViewer { border-style: groove; } \ No newline at end of file diff --git a/html/admin/js/graphViewer/graph/nodeReducer.js b/html/admin/js/graphViewer/graph/nodeReducer.js index b254d27bec..0e01d30b7d 100644 --- a/html/admin/js/graphViewer/graph/nodeReducer.js +++ b/html/admin/js/graphViewer/graph/nodeReducer.js @@ -331,8 +331,6 @@ function NodeReducer(nodes, edges) { return res[0]; }; - - self.bucketNodes = function(toSort, numBuckets) { var res = [], threshold = 0.3; diff --git a/html/admin/js/graphViewer/jasmine_test/specAdapter/arangoAdapterUISpec.js b/html/admin/js/graphViewer/jasmine_test/specAdapter/arangoAdapterUISpec.js index aa6a68110d..bc3e3cbb51 100644 --- a/html/admin/js/graphViewer/jasmine_test/specAdapter/arangoAdapterUISpec.js +++ b/html/admin/js/graphViewer/jasmine_test/specAdapter/arangoAdapterUISpec.js @@ -47,7 +47,7 @@ }; list = document.createElement("ul"); document.body.appendChild(list); - list.id = "control_list"; + list.id = "control_adapter_list"; adapterUI = new ArangoAdapterControls(list, adapter); spyOn(adapter, 'changeTo'); this.addMatchers({ @@ -88,17 +88,17 @@ runs(function() { adapterUI.addControlChangeCollections(); - expect($("#control_list #control_collections").length).toEqual(1); - expect($("#control_list #control_collections")[0]).toConformToListCSS(); + expect($("#control_adapter_list #control_adapter_collections").length).toEqual(1); + expect($("#control_adapter_list #control_adapter_collections")[0]).toConformToListCSS(); - helper.simulateMouseEvent("click", "control_collections"); + helper.simulateMouseEvent("click", "control_adapter_collections"); - expect($("#control_collections_modal").length).toEqual(1); + expect($("#control_adapter_collections_modal").length).toEqual(1); - $("#control_collections_nodecollection").attr("value", "newNodes"); - $("#control_collections_edgecollection").attr("value", "newEdges"); + $("#control_adapter_collections_nodecollection").attr("value", "newNodes"); + $("#control_adapter_collections_edgecollection").attr("value", "newEdges"); - helper.simulateMouseEvent("click", "control_collections_submit"); + helper.simulateMouseEvent("click", "control_adapter_collections_submit"); expect(adapter.changeTo).toHaveBeenCalledWith( "newNodes", @@ -109,7 +109,7 @@ }); waitsFor(function() { - return $("#control_collections_modal").length === 0; + return $("#control_adapter_collections_modal").length === 0; }, 2000, "The modal dialog should disappear."); }); @@ -117,13 +117,13 @@ it('should change collections and traversal direction to directed', function() { runs(function() { adapterUI.addControlChangeCollections(); - helper.simulateMouseEvent("click", "control_collections"); + helper.simulateMouseEvent("click", "control_adapter_collections"); - $("#control_collections_nodecollection").attr("value", "newNodes"); - $("#control_collections_edgecollection").attr("value", "newEdges"); - $("#control_collections_undirected").attr("checked", false); + $("#control_adapter_collections_nodecollection").attr("value", "newNodes"); + $("#control_adapter_collections_edgecollection").attr("value", "newEdges"); + $("#control_adapter_collections_undirected").attr("checked", false); - helper.simulateMouseEvent("click", "control_collections_submit"); + helper.simulateMouseEvent("click", "control_adapter_collections_submit"); expect(adapter.changeTo).toHaveBeenCalledWith( "newNodes", @@ -134,7 +134,7 @@ }); waitsFor(function() { - return $("#control_collections_modal").length === 0; + return $("#control_adapter_collections_modal").length === 0; }, 2000, "The modal dialog should disappear."); }); @@ -142,12 +142,12 @@ it('should change collections and traversal direction to undirected', function() { runs(function() { adapterUI.addControlChangeCollections(); - helper.simulateMouseEvent("click", "control_collections"); - $("#control_collections_nodecollection").attr("value", "newNodes"); - $("#control_collections_edgecollection").attr("value", "newEdges"); - $("#control_collections_undirected").attr("checked", true); + helper.simulateMouseEvent("click", "control_adapter_collections"); + $("#control_adapter_collections_nodecollection").attr("value", "newNodes"); + $("#control_adapter_collections_edgecollection").attr("value", "newEdges"); + $("#control_adapter_collections_undirected").attr("checked", true); - helper.simulateMouseEvent("click", "control_collections_submit"); + helper.simulateMouseEvent("click", "control_adapter_collections_submit"); expect(adapter.changeTo).toHaveBeenCalledWith( "newNodes", @@ -158,14 +158,14 @@ }); waitsFor(function() { - return $("#control_collections_modal").length === 0; + return $("#control_adapter_collections_modal").length === 0; }, 2000, "The modal dialog should disappear."); }); it('should be able to add all controls to the list', function() { adapterUI.addAll(); - expect($("#control_list #control_collections").length).toEqual(1); + expect($("#control_adapter_list #control_adapter_collections").length).toEqual(1); }); }); }()); \ No newline at end of file diff --git a/html/admin/js/graphViewer/ui/arangoAdapterControls.js b/html/admin/js/graphViewer/ui/arangoAdapterControls.js index 99e455541e..977c93e714 100644 --- a/html/admin/js/graphViewer/ui/arangoAdapterControls.js +++ b/html/admin/js/graphViewer/ui/arangoAdapterControls.js @@ -41,7 +41,7 @@ function ArangoAdapterControls(list, adapter) { baseClass = "adapter"; this.addControlChangeCollections = function() { - var prefix = "control_collections", + var prefix = "control_adapter_collections", idprefix = prefix + "_"; uiComponentsHelper.createButton(baseClass, list, "Collections", prefix, function() { modalDialogHelper.createModalDialog("Switch Collections", diff --git a/html/admin/js/graphViewer/ui/modalDialogHelper.js b/html/admin/js/graphViewer/ui/modalDialogHelper.js index ef328e654f..58784c1197 100644 --- a/html/admin/js/graphViewer/ui/modalDialogHelper.js +++ b/html/admin/js/graphViewer/ui/modalDialogHelper.js @@ -57,7 +57,7 @@ var modalDialogHelper = modalDialogHelper || {}; document.body.removeChild(div); }; - headerDiv.className = "modal_header"; + headerDiv.className = "modal-header"; buttonDismiss.className = "close"; buttonDismiss.dataDismiss = "modal"; @@ -66,11 +66,11 @@ var modalDialogHelper = modalDialogHelper || {}; header.appendChild(document.createTextNode(title)); - bodyDiv.className = "modal_body"; + bodyDiv.className = "modal-body"; bodyTable.id = idprefix + "table"; - footerDiv.className = "modal_footer"; + footerDiv.className = "modal-footer"; buttonCancel.id = idprefix + "cancel"; buttonCancel.className = "btn btn-danger pull-left";