1
0
Fork 0

Merge branch 'devel' of https://github.com/triAGENS/ArangoDB into devel

This commit is contained in:
Jan Steemann 2013-07-04 15:54:07 +02:00
commit 0f72f2ec33
6 changed files with 238 additions and 45 deletions

View File

@ -288,6 +288,17 @@ function AbstractAdapter(nodes, edges) {
});
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) {
var commId = commNode._id,
@ -296,8 +307,7 @@ function AbstractAdapter(nodes, edges) {
com;
removeNode(commNode);
if (limit < nodes.length + nodesToAdd.length) {
com = reducer.getCommunity(limit);
collapseCommunity(com);
requestCollapse();
}
_.each(nodesToAdd, function(n) {
delete joinedInCommunities[n._id];
@ -336,21 +346,11 @@ function AbstractAdapter(nodes, edges) {
}
},
checkNodeLimit = function (focus) {
if (limit < nodes.length) {
var com = reducer.getCommunity(limit, focus);
collapseCommunity(com);
}
},
setNodeLimit = function (pLimit, callback) {
limit = pLimit;
if (limit < nodes.length) {
var com = reducer.getCommunity(limit);
collapseCommunity(com);
if (callback !== undefined) {
callback();
}
checkNodeLimit();
if (callback !== undefined) {
callback();
}
},

View File

@ -443,7 +443,9 @@
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");
});

View File

@ -166,7 +166,8 @@
expect(com).toContainNodes(["0", "1", "2"]);
});
/* 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;

View File

@ -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
});
};

View File

@ -48,9 +48,43 @@ div.mousepointer {
button.graphViewer-icon-button {
border: medium none;
width: 25px;
height: 25px;
width: 20px;
height: 20px;
margin-top: -8px;
padding: 0px;
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;
}

View File

@ -41,6 +41,8 @@ var modalDialogHelper = modalDialogHelper || {};
table = modalDialogHelper.modalDivTemplate(title, buttonTitle, idprefix, callbackCapsule),
firstRow = document.createElement("tr"),
firstCell = document.createElement("th"),
secondCell = document.createElement("th"),
thirdCell = document.createElement("th"),
addRow = document.createElement("button"),
addImg = document.createElement("img"),
newCounter = 1,
@ -49,8 +51,9 @@ var modalDialogHelper = modalDialogHelper || {};
tableToJSON = function() {
var result = {};
_.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;
});
return result;
@ -59,11 +62,19 @@ var modalDialogHelper = modalDialogHelper || {};
table.appendChild(firstRow);
firstRow.id = "first_row";
firstRow.appendChild(firstCell);
firstCell.colSpan = "3";
firstCell.appendChild(addRow);
firstCell.className = "keyCell";
firstRow.appendChild(secondCell);
secondCell.className = "valueCell";
firstRow.appendChild(thirdCell);
thirdCell.className = "actionCell";
thirdCell.appendChild(addRow);
addRow.id = idprefix + "new";
addRow.className = "pull-right graphViewer-icon-button";
addRow.className = "graphViewer-icon-button";
addRow.appendChild(addImg);
addImg.className = "plusIcon";
@ -85,8 +96,32 @@ var modalDialogHelper = modalDialogHelper || {};
return;
}
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);
actTh.className = "collectionTh";
actTh.className = "actionCell";
deleteInput = document.createElement("button");
deleteInput.id = idprefix + key + "_delete";
deleteInput.className = "graphViewer-icon-button";
@ -104,26 +139,6 @@ var modalDialogHelper = modalDialogHelper || {};
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() {