]> BookStack Code Mirror - bookstack/blobdiff - resources/assets/js/global.js
Added auto-suggestions to tag names and values
[bookstack] / resources / assets / js / global.js
index aa5e60ce450fa2a91864d0ca17dabc9a72895dfd..d4fe7020bcac72e697a1bb7970225afbf08e3cbf 100644 (file)
@@ -5,9 +5,9 @@ var angular = require('angular');
 var ngResource = require('angular-resource');
 var ngAnimate = require('angular-animate');
 var ngSanitize = require('angular-sanitize');
+require('angular-ui-sortable');
 
-var ngApp = angular.module('bookStack', ['ngResource', 'ngAnimate', 'ngSanitize']);
-
+var ngApp = angular.module('bookStack', ['ngResource', 'ngAnimate', 'ngSanitize', 'ui.sortable']);
 
 // Global Event System
 var Events = {
@@ -54,10 +54,10 @@ $.expr[":"].contains = $.expr.createPseudo(function (arg) {
 // Global jQuery Elements
 $(function () {
 
-
     var notifications = $('.notification');
     var successNotification = notifications.filter('.pos');
     var errorNotification = notifications.filter('.neg');
+    var warningNotification = notifications.filter('.warning');
     // Notification Events
     window.Events.listen('success', function (text) {
         successNotification.hide();
@@ -66,6 +66,10 @@ $(function () {
             successNotification.show();
         }, 1);
     });
+    window.Events.listen('warning', function (text) {
+        warningNotification.find('span').text(text);
+        warningNotification.show();
+    });
     window.Events.listen('error', function (text) {
         errorNotification.find('span').text(text);
         errorNotification.show();