diff --git a/js/apps/system/aardvark/frontend/js/arango/arango.js b/js/apps/system/aardvark/frontend/js/arango/arango.js index e85bad77c1..bdbcd38618 100644 --- a/js/apps/system/aardvark/frontend/js/arango/arango.js +++ b/js/apps/system/aardvark/frontend/js/arango/arango.js @@ -101,49 +101,12 @@ return returnVal; }, - removeNotifications: function () { - $.gritter.removeAll(); - this.lastNotificationMessage = null; + arangoNotification: function (message) { }, - arangoNotification: function (message, time) { - var returnVal = false; - $.gritter.add({ - title: "Notice:", - text: message, - time: time || 3000, - before_open: function(){ - returnVal = true; - } - }); - this.lastNotificationMessage = null; - return returnVal; - }, arangoError: function (message) { - var returnVal = false; - $.gritter.add({ - title: "Error:", - text: message, - sticky: true, - before_open: function(){ - if (this.lastNotificationMessage === message) { - // prevent display the same message over & over - return false; - } - if($('.gritter-item-wrapper').length === 3) { - // not more than 3 messages at once - return false; - } - this.lastNotificationMessage = message; - returnVal = true; - }, - before_close: function(){ - // reset last text when closing a specific message - this.lastNotificationMessage = null; - } - }); - return returnVal; }, + getRandomToken: function () { return Math.round(new Date().getTime()); }, diff --git a/js/apps/system/aardvark/frontend/js/routers/router.js b/js/apps/system/aardvark/frontend/js/routers/router.js index 4835a547c8..26e8e1d6f6 100644 --- a/js/apps/system/aardvark/frontend/js/routers/router.js +++ b/js/apps/system/aardvark/frontend/js/routers/router.js @@ -70,12 +70,8 @@ this.footerView = new window.FooterView(); this.naviView = new window.NavigationView(); -// this.statView = new window.StatisticBarView(); -// this.userBarView = new window.UserBarView(); this.footerView.render(); this.naviView.render(); -// this.statView.render(); -// this.userBarView.render(); this.graphView = new window.GraphView({ graphs: this.graphs, collection: window.arangoCollectionsStore diff --git a/js/apps/system/aardvark/frontend/js/views/collectionView.js b/js/apps/system/aardvark/frontend/js/views/collectionView.js index d84fd03439..35bc23c76e 100644 --- a/js/apps/system/aardvark/frontend/js/views/collectionView.js +++ b/js/apps/system/aardvark/frontend/js/views/collectionView.js @@ -131,10 +131,6 @@ } var changeResult = window.arangoCollectionsStore.changeCollection(collid, wfs, journalSize); - if (result === true) { - arangoHelper.arangoNotification("Collection renamed"); - } - if (result !== true) { if (result !== undefined) { arangoHelper.arangoError("Collection error: " + result); @@ -168,14 +164,12 @@ } }); this.hideModal(); - arangoHelper.arangoNotification("Collection renamed"); } else { arangoHelper.arangoError("Collection error: " + result2); } } else { - //arangoHelper.arangoNotification("No changes."); this.hideModal(); } } @@ -209,10 +203,7 @@ var self = this; var collName = self.myCollection.name; var returnval = window.arangoCollectionsStore.deleteCollection(collName); - if (returnval === true) { - arangoHelper.arangoNotification('Collection deleted successfully.'); - } - else { + if (returnval === false) { arangoHelper.arangoError('Could not delete collection.'); } self.hideModal(); diff --git a/js/apps/system/aardvark/frontend/js/views/databaseView.js b/js/apps/system/aardvark/frontend/js/views/databaseView.js index 27e1d3d4fc..ec138ea7f7 100644 --- a/js/apps/system/aardvark/frontend/js/views/databaseView.js +++ b/js/apps/system/aardvark/frontend/js/views/databaseView.js @@ -105,7 +105,6 @@ self.handleError(err.status, err.statusText, name); }, success: function(data) { - arangoHelper.arangoNotification("Database " + name + " created."); self.hideModal(); self.updateDatabases(); } diff --git a/js/apps/system/aardvark/frontend/js/views/documentSourceView.js b/js/apps/system/aardvark/frontend/js/views/documentSourceView.js index ba35e580c9..75cd2eff54 100644 --- a/js/apps/system/aardvark/frontend/js/views/documentSourceView.js +++ b/js/apps/system/aardvark/frontend/js/views/documentSourceView.js @@ -93,10 +93,7 @@ } result = window.arangoDocumentStore.saveDocument(this.colid, this.docid, model); - if (result === true) { - arangoHelper.arangoNotification('Document saved'); - } - else if (result === false) { + if (result === false) { arangoHelper.arangoError('Document error'); } } @@ -104,10 +101,7 @@ editor = ace.edit("sourceEditor"); model = editor.getValue(); result = window.arangoDocumentStore.saveEdge(this.colid, this.docid, model); - if (result === true) { - arangoHelper.arangoNotification('Edge saved'); - } - else if (result === false) { + if (result === false) { arangoHelper.arangoError('Edge error'); } } diff --git a/js/apps/system/aardvark/frontend/js/views/documentsView.js b/js/apps/system/aardvark/frontend/js/views/documentsView.js index 5ee4b26bf0..b2a80d0123 100644 --- a/js/apps/system/aardvark/frontend/js/views/documentsView.js +++ b/js/apps/system/aardvark/frontend/js/views/documentsView.js @@ -350,7 +350,6 @@ //Success if (result !== false) { window.location.hash = "collection/" + result; - arangoHelper.arangoNotification('Document created'); return; } //Error @@ -424,18 +423,15 @@ result = window.arangoDocumentStore.deleteDocument(this.colid, this.docid); if (result === true) { //on success - arangoHelper.arangoNotification('Document deleted'); deleted = true; } else if (result === false) { - arangoHelper.arangoError('Could not delete document'); } } else if (this.type === 'edge') { result = window.arangoDocumentStore.deleteEdge(this.colid, this.docid); if (result === true) { //on success - arangoHelper.arangoNotification('Edge deleted'); deleted = true; } else if (result === false) { diff --git a/js/apps/system/aardvark/frontend/js/views/footerView.js b/js/apps/system/aardvark/frontend/js/views/footerView.js index f986587322..947426a024 100644 --- a/js/apps/system/aardvark/frontend/js/views/footerView.js +++ b/js/apps/system/aardvark/frontend/js/views/footerView.js @@ -34,7 +34,6 @@ success: function(data) { if (self.isOffline === true) { self.isOffline = false; - arangoHelper.removeNotifications(); if (!self.firstLogin) { window.setTimeout(function(){ arangoHelper.arangoNotification("Server connected"); diff --git a/js/apps/system/aardvark/frontend/js/views/navigationView.js b/js/apps/system/aardvark/frontend/js/views/navigationView.js index 360ada2d4b..756daf7861 100644 --- a/js/apps/system/aardvark/frontend/js/views/navigationView.js +++ b/js/apps/system/aardvark/frontend/js/views/navigationView.js @@ -18,8 +18,8 @@ collection: window.arangoDatabase, current: window.currentDB }); -// this.userBarView = new window.UserBarView({}); -// this.statisticBarView = new window.StatisticBarView({}); + this.userBarView = new window.UserBarView({}); + this.statisticBarView = new window.StatisticBarView({}); }, handleSelectDatabase: function () { @@ -34,8 +34,8 @@ isSystem: window.currentDB.get("isSystem") })); this.dbSelectionView.render($("#dbSelect")); -// this.userBarView.render($("#userBar")); -// this.statisticBarView.render($("#statisticBar")); + this.userBarView.render($("#userBar")); + this.statisticBarView.render($("#statisticBar")); return this; }, diff --git a/js/apps/system/aardvark/frontend/js/views/newCollectionView.js b/js/apps/system/aardvark/frontend/js/views/newCollectionView.js index 8f03b80f3f..cf1f419540 100644 --- a/js/apps/system/aardvark/frontend/js/views/newCollectionView.js +++ b/js/apps/system/aardvark/frontend/js/views/newCollectionView.js @@ -85,7 +85,6 @@ if (returnobj.status === true) { self.hidden(); $("#add-collection").modal('hide'); - arangoHelper.arangoNotification("Collection created"); window.App.navigate("collection/" + collName + "/documents/1", {trigger: true}); } diff --git a/js/apps/system/aardvark/frontend/js/views/userBarView.js b/js/apps/system/aardvark/frontend/js/views/userBarView.js index 0261e1235c..8a24806552 100644 --- a/js/apps/system/aardvark/frontend/js/views/userBarView.js +++ b/js/apps/system/aardvark/frontend/js/views/userBarView.js @@ -54,9 +54,8 @@ } }, - - render: function (el) { + console.log(el); this.$el = el; this.$el.html(this.template.render({ img : "https://s.gravatar.com/avatar/9c53a795affc3c3c03801ffae90e2e11?s=80", @@ -67,4 +66,4 @@ return this.$el; } }); -}()); \ No newline at end of file +}());