mirror of https://gitee.com/bigwinds/arangodb
Merge branch 'devel' of https://github.com/triAGENS/ArangoDB into devel
This commit is contained in:
commit
0f72f2ec33
|
@ -289,6 +289,17 @@ function AbstractAdapter(nodes, edges) {
|
||||||
nodes.push(commNode);
|
nodes.push(commNode);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
requestCollapse = function (focus) {
|
||||||
|
var com = reducer.getCommunity(limit, focus);
|
||||||
|
collapseCommunity(com);
|
||||||
|
},
|
||||||
|
|
||||||
|
checkNodeLimit = function (focus) {
|
||||||
|
if (limit < nodes.length) {
|
||||||
|
requestCollapse(focus);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
expandCommunity = function (commNode) {
|
expandCommunity = function (commNode) {
|
||||||
var commId = commNode._id,
|
var commId = commNode._id,
|
||||||
nodesToAdd = cachedCommunities[commId].nodes,
|
nodesToAdd = cachedCommunities[commId].nodes,
|
||||||
|
@ -296,8 +307,7 @@ function AbstractAdapter(nodes, edges) {
|
||||||
com;
|
com;
|
||||||
removeNode(commNode);
|
removeNode(commNode);
|
||||||
if (limit < nodes.length + nodesToAdd.length) {
|
if (limit < nodes.length + nodesToAdd.length) {
|
||||||
com = reducer.getCommunity(limit);
|
requestCollapse();
|
||||||
collapseCommunity(com);
|
|
||||||
}
|
}
|
||||||
_.each(nodesToAdd, function(n) {
|
_.each(nodesToAdd, function(n) {
|
||||||
delete joinedInCommunities[n._id];
|
delete joinedInCommunities[n._id];
|
||||||
|
@ -336,22 +346,12 @@ function AbstractAdapter(nodes, edges) {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
checkNodeLimit = function (focus) {
|
|
||||||
if (limit < nodes.length) {
|
|
||||||
var com = reducer.getCommunity(limit, focus);
|
|
||||||
collapseCommunity(com);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
setNodeLimit = function (pLimit, callback) {
|
setNodeLimit = function (pLimit, callback) {
|
||||||
limit = pLimit;
|
limit = pLimit;
|
||||||
if (limit < nodes.length) {
|
checkNodeLimit();
|
||||||
var com = reducer.getCommunity(limit);
|
|
||||||
collapseCommunity(com);
|
|
||||||
if (callback !== undefined) {
|
if (callback !== undefined) {
|
||||||
callback();
|
callback();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
setChildLimit = function (pLimit) {
|
setChildLimit = function (pLimit) {
|
||||||
|
|
|
@ -443,7 +443,9 @@
|
||||||
|
|
||||||
expect($("#" + nodeId + "_modal").length).toEqual(1);
|
expect($("#" + nodeId + "_modal").length).toEqual(1);
|
||||||
|
|
||||||
expect($("#" + nodeId + "_name_value").val()).toEqual(JSON.stringify(nodes[1]._data.name));
|
expect($("#" + nodeId + "_name_value").val()).toEqual(
|
||||||
|
JSON.stringify(nodes[1]._data.name
|
||||||
|
));
|
||||||
|
|
||||||
helper.simulateMouseEvent("click", nodeId + "_modal_dismiss");
|
helper.simulateMouseEvent("click", nodeId + "_modal_dismiss");
|
||||||
});
|
});
|
||||||
|
|
|
@ -166,7 +166,8 @@
|
||||||
expect(com).toContainNodes(["0", "1", "2"]);
|
expect(com).toContainNodes(["0", "1", "2"]);
|
||||||
});
|
});
|
||||||
/* Will be replaced by WebWorkers!
|
/* Will be replaced by WebWorkers!
|
||||||
it('should wait for a running identification to finish before allowing to start a new one', function() {
|
it('should wait for a running identification'
|
||||||
|
+ ' to finish before allowing to start a new one', function() {
|
||||||
|
|
||||||
var firstRun, secondRun;
|
var firstRun, secondRun;
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,141 @@
|
||||||
|
// Karma configuration
|
||||||
|
// Generated on Thu Jul 04 2013 11:39:34 GMT+0200 (CEST)
|
||||||
|
|
||||||
|
module.exports = function(karma) {
|
||||||
|
karma.configure({
|
||||||
|
|
||||||
|
// base path, that will be used to resolve files and exclude
|
||||||
|
basePath: '../jasmine_test/',
|
||||||
|
|
||||||
|
|
||||||
|
// frameworks to use
|
||||||
|
frameworks: ['jasmine'],
|
||||||
|
|
||||||
|
|
||||||
|
// list of files / patterns to load in the browser
|
||||||
|
files: [
|
||||||
|
'lib/jasmine-1.3.1/jasmine-html.js',
|
||||||
|
'lib/jslint.js',
|
||||||
|
'../../lib/d3.v3.min.js',
|
||||||
|
'../../lib/d3.fisheye.js',
|
||||||
|
'../../lib/underscore.js',
|
||||||
|
'../../lib/jquery-1.8.3.js',
|
||||||
|
'../../lib/bootstrap.js',
|
||||||
|
'../../lib/jquery.livequery.js',
|
||||||
|
|
||||||
|
// Mocks
|
||||||
|
'helper/eventHelper.js',
|
||||||
|
'helper/objectsHelper.js',
|
||||||
|
'helper/mocks.js',
|
||||||
|
'helper/commMock.js',
|
||||||
|
|
||||||
|
// Core Modules
|
||||||
|
'../graphViewer.js',
|
||||||
|
'../graph/colourMapper.js',
|
||||||
|
'../graph/nodeShaper.js',
|
||||||
|
'../graph/abstractAdapter.js',
|
||||||
|
'../graph/jsonAdapter.js',
|
||||||
|
'../graph/arangoAdapter.js',
|
||||||
|
'../graph/foxxAdapter.js',
|
||||||
|
'../graph/previewAdapter.js',
|
||||||
|
'../graph/edgeShaper.js',
|
||||||
|
'../graph/forceLayouter.js',
|
||||||
|
'../graph/eventDispatcher.js',
|
||||||
|
'../graph/eventLibrary.js',
|
||||||
|
'../graph/zoomManager.js',
|
||||||
|
'../graph/nodeReducer.js',
|
||||||
|
'../graph/modularityJoiner.js',
|
||||||
|
// UI Modules
|
||||||
|
'../ui/modalDialogHelper.js',
|
||||||
|
'../ui/nodeShaperControls.js',
|
||||||
|
'../ui/edgeShaperControls.js',
|
||||||
|
'../ui/arangoAdapterControls.js',
|
||||||
|
'../ui/layouterControls.js',
|
||||||
|
'../ui/uiComponentsHelper.js',
|
||||||
|
'../ui/eventDispatcherControls.js',
|
||||||
|
'../ui/graphViewerUI.js',
|
||||||
|
'../ui/graphViewerWidget.js',
|
||||||
|
'../ui/graphViewerPreview.js',
|
||||||
|
|
||||||
|
// Specs
|
||||||
|
|
||||||
|
'specColourMapper/colourMapperSpec.js',
|
||||||
|
'specAdapter/interfaceSpec.js',
|
||||||
|
'specAdapter/abstractAdapterSpec.js',
|
||||||
|
'specAdapter/jsonAdapterSpec.js',
|
||||||
|
'specAdapter/arangoAdapterSpec.js',
|
||||||
|
'specAdapter/foxxAdapterSpec.js',
|
||||||
|
'specAdapter/previewAdapterSpec.js',
|
||||||
|
'specAdapter/arangoAdapterUISpec.js',
|
||||||
|
'specNodeShaper/nodeShaperSpec.js',
|
||||||
|
'specNodeShaper/nodeShaperUISpec.js',
|
||||||
|
'specEdgeShaper/edgeShaperSpec.js',
|
||||||
|
'specEdgeShaper/edgeShaperUISpec.js',
|
||||||
|
'specForceLayouter/forceLayouterSpec.js',
|
||||||
|
'specForceLayouter/forceLayouterUISpec.js',
|
||||||
|
'specEvents/eventLibrarySpec.js',
|
||||||
|
'specEvents/eventDispatcherSpec.js',
|
||||||
|
'specEvents/eventDispatcherUISpec.js',
|
||||||
|
'specZoomManager/zoomManagerSpec.js',
|
||||||
|
'specGraphViewer/graphViewerSpec.js',
|
||||||
|
'specGraphViewer/graphViewerUISpec.js',
|
||||||
|
'specGraphViewer/graphViewerWidgetSpec.js',
|
||||||
|
'specGraphViewer/graphViewerPreviewSpec.js',
|
||||||
|
'specNodeReducer/nodeReducerSpec.js',
|
||||||
|
'specNodeReducer/modularityJoinerSpec.js',
|
||||||
|
'specJSLint/jsLintSpec.js'
|
||||||
|
],
|
||||||
|
|
||||||
|
|
||||||
|
// list of files to exclude
|
||||||
|
exclude: [
|
||||||
|
|
||||||
|
],
|
||||||
|
|
||||||
|
|
||||||
|
// test results reporter to use
|
||||||
|
// possible values: 'dots', 'progress', 'junit', 'growl', 'coverage'
|
||||||
|
reporters: ['progress'],
|
||||||
|
|
||||||
|
|
||||||
|
// web server port
|
||||||
|
port: 9876,
|
||||||
|
|
||||||
|
|
||||||
|
// cli runner port
|
||||||
|
runnerPort: 9100,
|
||||||
|
|
||||||
|
|
||||||
|
// enable / disable colors in the output (reporters and logs)
|
||||||
|
colors: true,
|
||||||
|
|
||||||
|
|
||||||
|
// level of logging
|
||||||
|
// possible values: karma.LOG_DISABLE || karma.LOG_ERROR || karma.LOG_WARN || karma.LOG_INFO || karma.LOG_DEBUG
|
||||||
|
logLevel: karma.LOG_INFO,
|
||||||
|
|
||||||
|
|
||||||
|
// enable / disable watching file and executing tests whenever any file changes
|
||||||
|
autoWatch: true,
|
||||||
|
|
||||||
|
|
||||||
|
// Start these browsers, currently available:
|
||||||
|
// - Chrome
|
||||||
|
// - ChromeCanary
|
||||||
|
// - Firefox
|
||||||
|
// - Opera
|
||||||
|
// - Safari (only Mac)
|
||||||
|
// - PhantomJS
|
||||||
|
// - IE (only Windows)
|
||||||
|
browsers: [],
|
||||||
|
|
||||||
|
|
||||||
|
// If browser does not capture in given timeout [ms], kill it
|
||||||
|
captureTimeout: 60000,
|
||||||
|
|
||||||
|
|
||||||
|
// Continuous Integration mode
|
||||||
|
// if true, it capture browsers, run tests and exit
|
||||||
|
singleRun: false
|
||||||
|
});
|
||||||
|
};
|
|
@ -48,9 +48,43 @@ div.mousepointer {
|
||||||
|
|
||||||
button.graphViewer-icon-button {
|
button.graphViewer-icon-button {
|
||||||
border: medium none;
|
border: medium none;
|
||||||
width: 25px;
|
width: 20px;
|
||||||
height: 25px;
|
height: 20px;
|
||||||
margin-top: -8px;
|
margin-top: -8px;
|
||||||
|
padding: 0px;
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
button.graphViewer-icon-button > img {
|
||||||
|
width:20px;
|
||||||
|
height:20px;
|
||||||
|
padding-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.modal-body th.actionCell {
|
||||||
|
width: 30px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-body th.actionCell > button {
|
||||||
|
margin-top: -12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-body th.keyCell {
|
||||||
|
width: 170px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-body th.valueCell {
|
||||||
|
width: 300px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-body th.keyCell input {
|
||||||
|
width: 150px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-body th.valueCell input {
|
||||||
|
width: 290px;
|
||||||
|
}
|
||||||
|
|
|
@ -41,6 +41,8 @@ var modalDialogHelper = modalDialogHelper || {};
|
||||||
table = modalDialogHelper.modalDivTemplate(title, buttonTitle, idprefix, callbackCapsule),
|
table = modalDialogHelper.modalDivTemplate(title, buttonTitle, idprefix, callbackCapsule),
|
||||||
firstRow = document.createElement("tr"),
|
firstRow = document.createElement("tr"),
|
||||||
firstCell = document.createElement("th"),
|
firstCell = document.createElement("th"),
|
||||||
|
secondCell = document.createElement("th"),
|
||||||
|
thirdCell = document.createElement("th"),
|
||||||
addRow = document.createElement("button"),
|
addRow = document.createElement("button"),
|
||||||
addImg = document.createElement("img"),
|
addImg = document.createElement("img"),
|
||||||
newCounter = 1,
|
newCounter = 1,
|
||||||
|
@ -49,8 +51,9 @@ var modalDialogHelper = modalDialogHelper || {};
|
||||||
tableToJSON = function() {
|
tableToJSON = function() {
|
||||||
var result = {};
|
var result = {};
|
||||||
_.each($("#" + idprefix + "table tr:not(#first_row)"), function(tr) {
|
_.each($("#" + idprefix + "table tr:not(#first_row)"), function(tr) {
|
||||||
var key = tr.children[1].children[0].value,
|
|
||||||
value = tr.children[2].children[0].value;
|
var key = $(".keyCell input", tr).val(),
|
||||||
|
value = $(".valueCell input", tr).val();
|
||||||
result[key] = value;
|
result[key] = value;
|
||||||
});
|
});
|
||||||
return result;
|
return result;
|
||||||
|
@ -59,11 +62,19 @@ var modalDialogHelper = modalDialogHelper || {};
|
||||||
table.appendChild(firstRow);
|
table.appendChild(firstRow);
|
||||||
firstRow.id = "first_row";
|
firstRow.id = "first_row";
|
||||||
firstRow.appendChild(firstCell);
|
firstRow.appendChild(firstCell);
|
||||||
firstCell.colSpan = "3";
|
firstCell.className = "keyCell";
|
||||||
firstCell.appendChild(addRow);
|
|
||||||
|
firstRow.appendChild(secondCell);
|
||||||
|
secondCell.className = "valueCell";
|
||||||
|
|
||||||
|
firstRow.appendChild(thirdCell);
|
||||||
|
|
||||||
|
thirdCell.className = "actionCell";
|
||||||
|
thirdCell.appendChild(addRow);
|
||||||
|
|
||||||
|
|
||||||
addRow.id = idprefix + "new";
|
addRow.id = idprefix + "new";
|
||||||
addRow.className = "pull-right graphViewer-icon-button";
|
addRow.className = "graphViewer-icon-button";
|
||||||
|
|
||||||
addRow.appendChild(addImg);
|
addRow.appendChild(addImg);
|
||||||
addImg.className = "plusIcon";
|
addImg.className = "plusIcon";
|
||||||
|
@ -85,8 +96,32 @@ var modalDialogHelper = modalDialogHelper || {};
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
table.appendChild(tr);
|
table.appendChild(tr);
|
||||||
|
|
||||||
|
tr.appendChild(keyTh);
|
||||||
|
keyTh.className = "keyCell";
|
||||||
|
keyInput = document.createElement("input");
|
||||||
|
keyInput.type = "text";
|
||||||
|
keyInput.id = idprefix + key + "_key";
|
||||||
|
keyInput.value = key;
|
||||||
|
keyTh.appendChild(keyInput);
|
||||||
|
|
||||||
|
|
||||||
|
tr.appendChild(valueTh);
|
||||||
|
valueTh.className = "valueCell";
|
||||||
|
valueInput = document.createElement("input");
|
||||||
|
valueInput.type = "text";
|
||||||
|
valueInput.id = idprefix + key + "_value";
|
||||||
|
if ("object" === typeof value) {
|
||||||
|
valueInput.value = JSON.stringify(value);
|
||||||
|
} else {
|
||||||
|
valueInput.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
valueTh.appendChild(valueInput);
|
||||||
|
|
||||||
|
|
||||||
tr.appendChild(actTh);
|
tr.appendChild(actTh);
|
||||||
actTh.className = "collectionTh";
|
actTh.className = "actionCell";
|
||||||
deleteInput = document.createElement("button");
|
deleteInput = document.createElement("button");
|
||||||
deleteInput.id = idprefix + key + "_delete";
|
deleteInput.id = idprefix + key + "_delete";
|
||||||
deleteInput.className = "graphViewer-icon-button";
|
deleteInput.className = "graphViewer-icon-button";
|
||||||
|
@ -104,26 +139,6 @@ var modalDialogHelper = modalDialogHelper || {};
|
||||||
table.removeChild(tr);
|
table.removeChild(tr);
|
||||||
};
|
};
|
||||||
|
|
||||||
tr.appendChild(keyTh);
|
|
||||||
keyTh.className = "collectionTh";
|
|
||||||
keyInput = document.createElement("input");
|
|
||||||
keyInput.type = "text";
|
|
||||||
keyInput.id = idprefix + key + "_key";
|
|
||||||
keyInput.value = key;
|
|
||||||
keyTh.appendChild(keyInput);
|
|
||||||
|
|
||||||
tr.appendChild(valueTh);
|
|
||||||
valueTh.className = "collectionTh";
|
|
||||||
valueInput = document.createElement("input");
|
|
||||||
valueInput.type = "text";
|
|
||||||
valueInput.id = idprefix + key + "_value";
|
|
||||||
if ("object" === typeof value) {
|
|
||||||
valueInput.value = JSON.stringify(value);
|
|
||||||
} else {
|
|
||||||
valueInput.value = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
valueTh.appendChild(valueInput);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
addRow.onclick = function() {
|
addRow.onclick = function() {
|
||||||
|
|
Loading…
Reference in New Issue