mirror of https://gitee.com/bigwinds/arangodb
Merge branch 'devel' of https://github.com/triAGENS/ArangoDB into devel
This commit is contained in:
commit
38c3e5c6fa
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -471,9 +471,10 @@ ModuleCache["/internal"] = new Module("/internal");
|
|||
internal.printShell.apply(internal.printShell, arguments);
|
||||
|
||||
// flush buffer
|
||||
$('#shellContent').append('<p class="shellSuccess">'
|
||||
+ internal.browserOutputBuffer
|
||||
+ '</p>');
|
||||
//$('#shellContent').append('<p class="shellSuccess">'
|
||||
// + internal.browserOutputBuffer
|
||||
// + '</p>');
|
||||
jqconsole.Write('==> ' + internal.browserOutputBuffer + '\n', 'jssuccess');
|
||||
internal.browserOutputBuffer = "";
|
||||
};
|
||||
|
||||
|
|
|
@ -20,8 +20,10 @@
|
|||
</thead>
|
||||
</table>
|
||||
|
||||
<div id="documentsToolbarF" class="pagination pagination-small pagination-centered"></div>
|
||||
|
||||
<div id="documentsToolbarFL">
|
||||
<div id="documentsToolbarF" class="pagination pagination-small pagination-centered">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Delete Modal -->
|
||||
<div id="docDeleteModal" style="display:none" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
||||
|
|
|
@ -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/";
|
||||
|
|
|
@ -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,
|
||||
'<i class="icon-edit" id="editFirstRow"></i>',
|
||||
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') {
|
||||
|
|
|
@ -274,7 +274,9 @@ var documentsView = Backbone.View.extend({
|
|||
}
|
||||
};
|
||||
target.pagination(options);
|
||||
$('#documentsToolbarF2').append('<a>Total: ' + this.documentsCount + ' documents</a>');
|
||||
$('#documentsToolbarF').prepend('<ul class="prePagi"><li><a id="documents_first"><i class="icon icon-step-backward"></i></a></li></ul>');
|
||||
$('#documentsToolbarF').append('<ul class="lasPagi"><li><a id="documents_last"><i class="icon icon-step-forward"></i></a></li></ul>');
|
||||
//$('#documentsToolbarF2').append('<a>Total: ' + this.documentsCount + ' documents</a>');
|
||||
},
|
||||
breadcrumb: function () {
|
||||
var name = window.location.hash.split("/")[1];
|
||||
|
|
|
@ -161,6 +161,8 @@ var logsView = Backbone.View.extend({
|
|||
}
|
||||
};
|
||||
target.pagination(options);
|
||||
$('#logtestdiv').prepend('<ul class="prePagi"><li><a id="logTableID_first"><i class="icon icon-step-backward"></i></a></li></ul>');
|
||||
$('#logtestdiv').append('<ul class="lasPagi"><li><a id="logTableID_last"><i class="icon icon-step-forward"></i></a></li></ul>');
|
||||
},
|
||||
drawTable: function () {
|
||||
var self = this;
|
||||
|
|
|
@ -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 () {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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('<p class="shellError">Error:' + e + '</p>');
|
||||
//$('#shellContent').append('<p class="shellError">Error:' + e + '</p>');
|
||||
jqconsole.Write('ReferenceError: ' + e + '\n', 'jserror');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue