diff --git a/frontend/css/documentsView.css b/frontend/css/documentsView.css
index 8d918cca15..ee87d52e39 100644
--- a/frontend/css/documentsView.css
+++ b/frontend/css/documentsView.css
@@ -234,12 +234,16 @@ table.dataTable thead th {
color:#666666;
}
-.icon-backward, .icon-forward {
+.icon-backward, .icon-forward, .icon-step-backward, .icon-step-forward {
position: absolute;
top: 3px;
left:10px;
}
+.prePagi {
+ margin-right: -5px !important;
+}
+
.badge {
border-radius:0;
}
diff --git a/frontend/js/shell/shell2.js b/frontend/js/shell/shell2.js
index 9ae8df53bf..68da4ef72c 100644
--- a/frontend/js/shell/shell2.js
+++ b/frontend/js/shell/shell2.js
@@ -471,9 +471,10 @@ ModuleCache["/internal"] = new Module("/internal");
internal.printShell.apply(internal.printShell, arguments);
// flush buffer
- $('#shellContent').append('
'
- + internal.browserOutputBuffer
- + '
');
+ //$('#shellContent').append(''
+ // + internal.browserOutputBuffer
+ // + '
');
+ jqconsole.Write('==> ' + internal.browserOutputBuffer + '\n', 'jssuccess');
internal.browserOutputBuffer = "";
};
diff --git a/frontend/js/templates/documentsView.ejs b/frontend/js/templates/documentsView.ejs
index 419fbf8631..5c694d298e 100644
--- a/frontend/js/templates/documentsView.ejs
+++ b/frontend/js/templates/documentsView.ejs
@@ -20,8 +20,10 @@
-
-
+
diff --git a/frontend/js/views/collectionView.js b/frontend/js/views/collectionView.js
index 44408e9f29..2fe36d2f8a 100644
--- a/frontend/js/views/collectionView.js
+++ b/frontend/js/views/collectionView.js
@@ -22,7 +22,13 @@ var collectionView = Backbone.View.extend({
"hidden #change-collection" : "hidden",
"click #delete-modified-collection" : "deleteCollection",
"click #load-modified-collection" : "loadCollection",
- "click #unload-modified-collection" : "unloadCollection"
+ "click #unload-modified-collection" : "unloadCollection",
+ "keydown" : "listenKey"
+ },
+ listenKey: function(e) {
+ if (e.keyCode == 13) {
+ this.saveModifiedCollection();
+ }
},
hidden: function () {
window.location.hash = "#collection/";
diff --git a/frontend/js/views/documentView.js b/frontend/js/views/documentView.js
index e2b8573342..a982798986 100644
--- a/frontend/js/views/documentView.js
+++ b/frontend/js/views/documentView.js
@@ -3,6 +3,7 @@ var documentView = Backbone.View.extend({
table: '#documentTableID',
colid: 0,
docid: 0,
+ currentKey: 0,
init: function () {
this.initTable();
@@ -16,8 +17,27 @@ var documentView = Backbone.View.extend({
"click #editFirstRow" : "editFirst",
"click #documentTableID tr" : "clicked",
"click #editSecondRow" : "editSecond",
- "click .cancelButton" : "checkIfEmpty",
- "keyup .sorting_1" : "listenKey"
+ "keydown .sorting_1" : "listenKey",
+ "keydown" : "listenGlobalKey",
+ "focusout textarea" : "checkFocus"
+ },
+
+ checkFocus: function(e) {
+ //check if new row has to be saved
+ var self = this;
+ var data = $(this.table).dataTable().fnGetData();
+ $.each(data, function(key, val) {
+ if (val[0] === self.currentKey) {
+ $(self.table).dataTable().fnDeleteRow( key );
+ }
+ });
+
+ },
+
+ listenGlobalKey: function(e) {
+ if (e.keyCode === 27) {
+ this.checkFocus();
+ }
},
listenKey: function(e) {
@@ -156,9 +176,11 @@ var documentView = Backbone.View.extend({
addLine: function () {
var randomKey = arangoHelper.getRandomToken();
+ var self = this;
+ self.currentKey = "zkey"+randomKey;
$(this.table).dataTable().fnAddData(
[
- "zkey"+randomKey,
+ self.currentKey,
'
',
this.value2html("editme"),
JSON.stringify("editme"),
@@ -169,7 +191,7 @@ var documentView = Backbone.View.extend({
this.makeEditable();
var tableContent = $('table').find('td');
$.each(tableContent, function(key, val) {
- if ($(val).text() === "zkey"+randomKey) {
+ if ($(val).text() === self.currentKey) {
$(val).click();
$('.jediTextarea textarea').val("");
return;
@@ -268,9 +290,9 @@ var documentView = Backbone.View.extend({
$('.writeable', documentEditTable.fnGetNodes()).editable(function(value, settings) {
var aPos = documentEditTable.fnGetPosition(this);
if (aPos[1] == 0) {
- documentEditTable.fnUpdate(self.escaped(value), aPos[0], aPos[1]);
- self.updateLocalDocumentStorage();
- return value;
+ documentEditTable.fnUpdate(self.escaped(value), aPos[0], aPos[1]);
+ self.updateLocalDocumentStorage();
+ return value;
}
if (aPos[1] == 2) {
var oldContent = JSON.parse(documentEditTable.fnGetData(aPos[0], aPos[1] + 1));
@@ -292,6 +314,10 @@ var documentView = Backbone.View.extend({
var aPos = documentEditTable.fnGetPosition(this);
var value = documentEditTable.fnGetData(aPos[0], aPos[1]);
if (aPos[1] == 0) {
+ //check if this row was newly created
+ if (value === self.currentKey) {
+ return value;
+ }
return value;
}
if (aPos[1] == 2) {
@@ -318,11 +344,6 @@ var documentView = Backbone.View.extend({
//style: 'display: inline',
});
},
- checkIfEmpty: function (e) {
- console.log(e);
- console.log("TEST");
- var test = $('.jediTextarea button');
- },
getTypedValue: function (value) {
value = value.replace(/(^\s+|\s+$)/g, '');
if (value == 'true') {
diff --git a/frontend/js/views/documentsView.js b/frontend/js/views/documentsView.js
index f0538de07b..98e3d94157 100644
--- a/frontend/js/views/documentsView.js
+++ b/frontend/js/views/documentsView.js
@@ -274,7 +274,9 @@ var documentsView = Backbone.View.extend({
}
};
target.pagination(options);
- $('#documentsToolbarF2').append('
Total: ' + this.documentsCount + ' documents');
+ $('#documentsToolbarF').prepend('
');
+ $('#documentsToolbarF').append('
');
+ //$('#documentsToolbarF2').append('
Total: ' + this.documentsCount + ' documents');
},
breadcrumb: function () {
var name = window.location.hash.split("/")[1];
diff --git a/frontend/js/views/logsView.js b/frontend/js/views/logsView.js
index 605f035e53..92e156d210 100644
--- a/frontend/js/views/logsView.js
+++ b/frontend/js/views/logsView.js
@@ -161,6 +161,8 @@ var logsView = Backbone.View.extend({
}
};
target.pagination(options);
+ $('#logtestdiv').prepend('
');
+ $('#logtestdiv').append('
');
},
drawTable: function () {
var self = this;
diff --git a/frontend/js/views/newCollectionView.js b/frontend/js/views/newCollectionView.js
index 8c92d14f71..25bb9540b4 100644
--- a/frontend/js/views/newCollectionView.js
+++ b/frontend/js/views/newCollectionView.js
@@ -23,6 +23,13 @@ var newCollectionView = Backbone.View.extend({
events: {
"click #save-new-collection" : "saveNewCollection",
+ "keydown" : "listenKey"
+ },
+
+ listenKey: function(e) {
+ if (e.keyCode == 13) {
+ this.saveNewCollection();
+ }
},
hidden: function () {
diff --git a/frontend/js/views/queryView.js b/frontend/js/views/queryView.js
index 56f9db2c8f..7e855b27ae 100644
--- a/frontend/js/views/queryView.js
+++ b/frontend/js/views/queryView.js
@@ -1,6 +1,8 @@
var queryView = Backbone.View.extend({
el: '#content',
- init: function () {
+ initialize: function () {
+ localStorage.setItem("queryContent", "");
+ localStorage.setItem("queryOutput", "");
},
events: {
'click #submitQueryIcon' : 'submitQuery',
@@ -14,6 +16,7 @@ var queryView = Backbone.View.extend({
template: new EJS({url: '/_admin/html/js/templates/queryView.ejs'}),
render: function() {
+
$(this.el).html(this.template.text);
var editor = ace.edit("aqlEditor");
var editor2 = ace.edit("queryOutput");
@@ -48,6 +51,14 @@ var queryView = Backbone.View.extend({
$('#aqlEditor .ace_text-input').focus();
$.gritter.removeAll();
+
+ if(typeof(Storage)!=="undefined") {
+ var queryContent = localStorage.getItem("queryContent");
+ var queryOutput = localStorage.getItem("queryOutput");
+ editor.setValue(queryContent);
+ console.log(queryOutput);
+ editor2.setValue(queryOutput);
+ }
return this;
},
submitQuery: function() {
@@ -76,6 +87,11 @@ var queryView = Backbone.View.extend({
}
}
});
+
+ if(typeof(Storage) !== "undefined") {
+ localStorage.setItem("queryContent", editor.getValue());
+ localStorage.setItem("queryOutput", editor2.getValue());
+ }
},
FormatJSON: function(oData, sIndent) {
var self = this;
diff --git a/frontend/js/views/shellView.js b/frontend/js/views/shellView.js
index 9eac0f2041..2658925a6b 100644
--- a/frontend/js/views/shellView.js
+++ b/frontend/js/views/shellView.js
@@ -96,13 +96,14 @@ var shellView = Backbone.View.extend({
},
evaloutput: function (data) {
try {
- var result = eval(data);
+ var result = eval(data);
if (result !== undefined) {
print(result);
}
}
catch(e) {
- $('#shellContent').append('
Error:' + e + '
');
+ //$('#shellContent').append('
Error:' + e + '
');
+ jqconsole.Write('ReferenceError: ' + e + '\n', 'jserror');
}
}