From e3fc948a773926bf45bdaaf6fc71a532b15ce6e7 Mon Sep 17 00:00:00 2001 From: Trevor Squillario Date: Sat, 6 Dec 2014 20:26:19 -0500 Subject: [PATCH] lots of nothing --- app/common/directives.js | 27 ++++++++++++++++++--------- app/common/main-controller.js | 5 +++++ app/common/notification-service.js | 6 +----- app/common/utils-service.js | 7 +++++++ app/index.html | 4 +++- app/settings/settings-service.js | 2 ++ app/settings/settings.html | 2 +- app/settings/settings.js | 11 ++++++++++- app/styles/Style.css | 2 +- 9 files changed, 48 insertions(+), 18 deletions(-) diff --git a/app/common/directives.js b/app/common/directives.js index 9184060..227312a 100644 --- a/app/common/directives.js +++ b/app/common/directives.js @@ -11,15 +11,6 @@ angular.module('JamStash').directive('sortable', function () { } }; }) -/* -.directive('split', function () { - return { - link: function (scope, elm, attrs) { - elm.splitPane(); - } - }; -}) -*/ .directive('fancybox', ['$compile', function($compile){ return { restrict: 'A', @@ -123,4 +114,22 @@ angular.module('JamStash').directive('sortable', function () { } }); }; +}) +.directive("ngMsgs", function() { + /* Not Using */ + return { + restrict: 'E', + transclude : false, + scope: { + msgs: "=" + }, + template: '{{ item }}', + link: function (scope, elm, attrs) { + scope.$watch(scope.Messages, function () { + var content = $compile((template)(scope)); + elm.append(content); + $(elm).parent().fadeIn(); + }); + } + }; }); \ No newline at end of file diff --git a/app/common/main-controller.js b/app/common/main-controller.js index 9988d78..5224e84 100644 --- a/app/common/main-controller.js +++ b/app/common/main-controller.js @@ -9,6 +9,7 @@ $rootScope.playingSong = null; $rootScope.MusicFolders = []; $rootScope.Genres = []; + $rootScope.Messages = []; $rootScope.SelectedMusicFolder = ""; $rootScope.unity = null; @@ -301,6 +302,9 @@ $scope.isActive = function (route) { return route === $location.path(); }; + $rootScope.reloadRoute = function (reload) { + utils.reloadRoute(reload); + }; $rootScope.getSplitPosition = function (scope, elm) { window.alert(elm.getBoundingClientRect().left); }; @@ -433,6 +437,7 @@ $scope.toTrusted = function (html) { return $sce.trustAsHtml(html); }; + /* Launch on Startup */ $scope.loadSettings(); diff --git a/app/common/notification-service.js b/app/common/notification-service.js index a3937cd..c895cc6 100644 --- a/app/common/notification-service.js +++ b/app/common/notification-service.js @@ -11,11 +11,8 @@ angular.module('jamstash.notifications', []) var msgIndex = 1; this.updateMessage = function (msg, autohide) { if (msg !== '') { - var id = msgIndex; - $('#messages').append('' + msg + ''); + $rootScope.Messages.push(msg); $('#messages').fadeIn(); - $("#messages").scrollTo('100%'); - var el = '#msg_' + id; if (autohide) { setTimeout(function () { $(el).fadeOut(function () { $(this).remove(); }); @@ -26,7 +23,6 @@ angular.module('jamstash.notifications', []) return false; }); } - msgIndex++; } }; this.requestPermissionIfRequired = function () { diff --git a/app/common/utils-service.js b/app/common/utils-service.js index d4753f9..c10de56 100644 --- a/app/common/utils-service.js +++ b/app/common/utils-service.js @@ -337,6 +337,13 @@ angular.module('jamstash.utils', ['jamstash.settings']) } } }; + this.reloadRoute = function (date) { + if (reload) { + $window.location.reload(); + } else { + $route.reload(); + } + }; this.parseDate = function (date) { // input: "2012-09-23 20:00:00.0" var months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; diff --git a/app/index.html b/app/index.html index 03f2596..4a52a4f 100755 --- a/app/index.html +++ b/app/index.html @@ -23,7 +23,9 @@