diff --git a/notification.js b/notification.js index 7a2a969..7c4d943 100644 --- a/notification.js +++ b/notification.js @@ -3,7 +3,7 @@ angular.module('notifications', []). factory('$notification', ['$timeout',function($timeout){ - console.log('notification service online'); +// console.log('notification service online'); var notifications = JSON.parse(localStorage.getItem('$notifications')) || [], queue = []; @@ -75,7 +75,7 @@ angular.module('notifications', []). requestHtml5ModePermissions: function(){ if (window.webkitNotifications){ - console.log('notifications are available'); +// console.log('notifications are available'); if (window.webkitNotifications.checkPermission() === 0) { return true; } @@ -97,6 +97,11 @@ angular.module('notifications', []). } }, + setSetting: function (key, value) { + settings[key] = value; + return settings; + }, + /* ============ QUERYING RELATED METHODS ============*/ @@ -112,7 +117,7 @@ angular.module('notifications', []). /* ============== NOTIFICATION METHODS ==============*/ info: function(title, content, userData){ - console.log(title, content); +// console.log(title, content); return this.awesomeNotify('info','info', title, content, userData); }, @@ -142,13 +147,13 @@ angular.module('notifications', []). return this.makeNotification(type, false, icon, title, content, userData); }, - notify: function(image, title, content, userData){ + notify: function(image, title, content, userData, notificationClass){ // Wraps the makeNotification method for displaying notifications with images // rather than icons - return this.makeNotification('custom', image, true, title, content, userData); + return this.makeNotification('custom', image, true, title, content, userData, notificationClass); }, - makeNotification: function(type, image, icon, title, content, userData){ + makeNotification: function(type, image, icon, title, content, userData, notificationClass){ var notification = { 'type': type, 'image': image, @@ -156,15 +161,16 @@ angular.module('notifications', []). 'title': title, 'content': content, 'timestamp': +new Date(), - 'userData': userData + 'userData': userData, + 'notificationClass': notificationClass }; notifications.push(notification); if(settings.html5Mode){ html5Notify(image, title, content, function(){ - console.log("inner on display function"); +// console.log("inner on display function"); }, function(){ - console.log("inner on close function"); +// console.log("inner on close function"); }); } else{ @@ -212,9 +218,8 @@ angular.module('notifications', []). * Finally, the directive should have its own controller for * handling all of the notifications from the notification service */ - console.log('this is a new directive'); var html = - '
' + + '
' + '
' + '' + '
' +