diff --git a/css/styles.css b/css/styles.css index e8f28879..e74c45c0 100644 --- a/css/styles.css +++ b/css/styles.css @@ -1,122 +1,118 @@ .notification { - display: block; - border-bottom: 1px solid rgb(238, 238, 238); - padding: 7px 15px 50px 15px; + display: block; + border-bottom: 1px solid rgb(238, 238, 238); + padding: 7px 15px 50px 15px; } .notification-container { - background-color: white; - display: none; - position: absolute; - right: 50px; - top: 45px; - width: 350px; - min-height: 100px; - max-height: 260px; - border-radius: 0 0 3px 3px; - border: 1px solid rgb(238, 238, 238);; + background-color: white; + display: none; + position: absolute; + right: 50px; + top: 45px; + width: 350px; + min-height: 100px; + max-height: 260px; + border-radius: 0 0 3px 3px; + border: 1px solid rgb(238, 238, 238);; } .notification-container .emptycontent h2 { - font-weight: 300; - font-size: 16px; + font-weight: 300; + font-size: 16px; } /* Fill width on mobile */ @media (max-width: 500px) { - .notification-container { - right: 5%; - width: 90%; - } + .notification-container { + right: 5%; + width: 90%; + } } .notification { - color: black; - position: relative; + color: black; + position: relative; } .notification .notification-empty { - color: #999; + color: #999; } .notification:hover > .notification-delete{ - display: block !important; - position: absolute; - top: 4px; - right: 9px; - opacity: 0.3; + display: block !important; + position: absolute; + top: 4px; + right: 9px; + opacity: 0.3; } .notification:hover { - background-color: #f8f8f8; + background-color: #f8f8f8; } .notification-delete:hover { - opacity: 0.8 !important; - cursor: pointer; + opacity: 0.8 !important; + cursor: pointer; } .notification-delete img, .notifications-button img { - cursor: pointer; + cursor: pointer; } .notifications-button { - position: relative; - float: right; - width: 21px; - height: 21px; - display: block; - border-radius: 50%; - text-align: center; - padding: 10px; - opacity: 0.7; - cursor: pointer; + position: relative; + float: right; + width: 21px; + height: 21px; + display: block; + border-radius: 50%; + text-align: center; + padding: 10px; + opacity: 0.7; + cursor: pointer; } .notifications-button.hasNotifications { - opacity: 1 !important; + opacity: 1 !important; } .notifications-button:hover { - opacity: 1; + opacity: 1; } .notification .button { - border: 1px solid rgba(240,240,240,.9) !important; - padding: 0 10px; + border: 1px solid rgba(240,240,240,.9) !important; + padding: 0 10px; box-shadow: none; margin: 0; float: left; } -.notification .actions { - float:right; - padding: 0; +.notification .notification-actions { + float:right; + padding: 0; } -.notification .action-button { - color: #555; -} - -.notification .actions:first-child { - margin-left: auto; +.notification .notification-actions:first-child { + margin-left: auto; } .notification .notification-subject { - display: inline-block; - margin-right: 10px; + display: inline-block; + margin-right: 10px; } .notification .notification-message { - line-height: 20px; - padding-bottom: 5px; + line-height: 20px; + padding-bottom: 5px; } .notification-container { - box-shadow: 0 1px 10px rgba(50, 50, 50, .7); - overflow: auto; - overflow-x: hidden; + box-shadow: 0 1px 10px rgba(50, 50, 50, .7); + overflow: auto; + overflow-x: hidden; } .notifications .emptycontent { - margin: 50px 0; + margin: 50px 0; } diff --git a/js/app.js b/js/app.js index 7b5e9255..848bb202 100644 --- a/js/app.js +++ b/js/app.js @@ -10,364 +10,371 @@ (function() { - if (!OCA.Notifications) { - OCA.Notifications = {}; - } - - OCA.Notifications = { - - notifications: {}, - - num: 0, - - pollInterval: 30000, // milliseconds - - open: false, - - $button: null, - - $container: null, - - $notifications: null, - - interval: null, - - initialise: function() { - // Go! - - // Setup elements - this.$notifications = $('
'); - this.$button = $(''); - this.$container = $('
'); - var $wrapper = $('
'); - - // Empty content dropdown - var $headLine = $('

'); - $headLine.text(t('notifications', 'No notifications')); - var $emptyContent = $('
'); - $emptyContent.append($headLine); - this.$container.append($emptyContent); - - this.$notifications.append(this.$button); - this.$notifications.append(this.$container); - this.$container.append($wrapper); - - // Add to the UI - $('form.searchbox').before(this.$notifications); - - // Initial call to the notification endpoint - this.initialFetch(); - - // Bind the button click event - OC.registerMenu(this.$button, this.$container); - this.$button.on('click', this._onNotificationsButtonClick); - - this.$container.on('click', '.action-button', _.bind(this._onClickAction, this)); - this.$container.on('click', '.notification-delete', _.bind(this._onClickDismissNotification, this)); - - // Setup the background checker - this.interval = setInterval(_.bind(this.backgroundFetch, this), this.pollInterval); - }, - - _onClickDismissNotification: function(event) { - event.preventDefault(); - var $target = $(event.target); - var $notification = $target.closest('.notification'); - var id = $notification.attr('data-id'); - - $notification.fadeOut(OC.menuSpeed); - - $.ajax({ - url: OC.linkToOCS('apps/notifications/api/v1', 2) + 'notifications/' + id + '?format=json', - type: 'DELETE', - success: function(data) { - self._removeNotification(id); - }, - error: function() { - $notification.fadeIn(OC.menuSpeed); - OC.Notification.showTemporary('Failed to perform action'); - } - }); - - this._removeNotification($notification.attr('data-id')); - }, - - _onClickAction: function(event) { - event.preventDefault(); - var self = this; - var $target = $(event.target); - var $notification = $target.closest('.notification'); - var actionType = $target.attr('data-type') || 'GET'; - var actionUrl = $target.attr('data-href'); - - $notification.fadeOut(OC.menuSpeed); - - $.ajax({ - url: actionUrl, - type: actionType, - success: function(data) { - self._removeNotification($notification.attr('data-id')); - }, - error: function() { - $notification.fadeIn(OC.menuSpeed); - OC.Notification.showTemporary('Failed to perform action'); - } - }); - - }, - - _removeNotification: function(id) { - var $notification = this.$container.find('.notification').filterAttr('id', id); - delete OCA.Notifications.notifications[id]; - - $notification.remove(); - if (_.keys(OCA.Notifications.notifications).length === 0) { - this._onHaveNoNotifications(); - } - }, - - /** - * Handles the notification button click event - */ - _onNotificationsButtonClick: function() { - // Show a popup - OC.showMenu(null, OCA.Notifications.$container); - }, - - initialFetch: function() { - var self = this; - - this.fetch( - function(data) { - // Fill Array - $.each(data, function(index) { - var n = new self.Notif(data[index]); - self.notifications[n.getId()] = n; - self.addToUI(n); - self.num++; - }); - // Check if we have any, and notify the UI - if (self.numNotifications() !== 0) { - self._onHaveNotifications(); - } else { - self._onHaveNoNotifications(); - } - }, - _.bind(self._onFetchError, self) - ); - }, - - /** - * Background fetch handler - */ - backgroundFetch: function() { - var self = this; - - this.fetch( - function(data) { - var inJson = []; - var oldNum = self.numNotifications(); - $.each(data, function(index) { - var n = new self.Notif(data[index]); - inJson.push(n.getId()); - if (!self.getNotification(n.getId())){ - // New notification! - self._onNewNotification(n); - } - }); - - for (var n in self.getNotifications()) { - if (inJson.indexOf(self.getNotifications()[n].getId()) === -1) { - // Not in JSON, remove from UI - self._onRemoveNotification(self.getNotifications()[n]); - } - } - - // Now check if we suddenly have notifs, or now none - if (oldNum == 0 && self.numNotifications() !== 0) { - // We now have some! - self._onHaveNotifications(); - } else if (oldNum != 0 && self.numNotifications() === 0) { - // Now we have none - self._onHaveNoNotifications(); - } - }, - _.bind(self._onFetchError, self) - ); - }, - - /** - * Handles removing the Notification from the UI when no longer in JSON - * @param {XMLHttpRequest} xhr - */ - _onFetchError: function(xhr) { - if (xhr.status === 404) { - // 404 Not Found - stop polling - this._shutDownNotifications(); - } else { - OC.Notification.showTemporary('Failed to perform request for notifications'); - } - }, - - /** - * Handles removing the Notification from the UI when no longer in JSON - * @param {OCA.Notifications.Notification} notification - */ - _onRemoveNotification: function(notification) { - $('div.notification[data-id='+escapeHTML(notification.getId())+']').remove(); - delete OCA.Notifications.notifications[notification.getId()]; - OCA.Notifications.num--; - }, - - /** - * Handle new notification received - * @param {OCA.Notifications.Notification} notification - */ - _onNewNotification: function(notification) { - OCA.Notifications.num++; - // Add it to the array - OCA.Notifications.notifications[notification.getId()] = notification; - // Add to the UI - OCA.Notifications.addToUI(notification); - - // Trigger browsers web notification - // https://github.com/owncloud/notifications/issues/1 - if ("Notification" in window) { - if (Notification.permission === "granted") { - // If it's okay let's create a notification - OCA.Notifications.createWebNotification(notification); - } - - // Otherwise, we need to ask the user for permission - else if (Notification.permission !== 'denied') { - Notification.requestPermission(function (permission) { - // If the user accepts, let's create a notification - if (permission === "granted") { - OCA.Notifications.createWebNotification(notification); - } - }); - } - } - }, - - /** - * Create a browser notification - * - * @see https://developer.mozilla.org/en/docs/Web/API/notification - * @param {OCA.Notifications.Notification} notification - */ - createWebNotification: function (notification) { - var n = new Notification(notification.getSubject(), { - title: notification.getSubject(), - lang: OC.getLocale(), - body: notification.getMessage(), - tag: notification.getId() - }); - setTimeout(n.close.bind(n), 5000); - }, - - _shutDownNotifications: function() { - // The app was disabled or has no notifiers, so we can stop polling - // And hide the UI as well - window.clearInterval(this.interval); - this.$notifications.addClass('hidden'); - }, - - /** - * Adds the notification to the UI - * @param {OCA.Notifications.Notification} notification - */ - addToUI: function(notification) { - $('div.notification-wrapper').prepend(notification.renderElement()); - }, - - /** - * Handle event when we have notifications (and didnt before) - */ - _onHaveNotifications: function() { - // Add the button, title, etc - $('div.notifications-button') - .addClass('hasNotifications') - .animate({opacity: 0.5}) - .animate({opacity: 1}) - .animate({opacity: 0.5}) - .animate({opacity: 1}) - .animate({opacity: 0.7}); - $('div.notifications .emptycontent').addClass('hidden'); - this.$button.find('img').attr('src', OC.imagePath('notifications', 'notifications-new')); - }, - - /** - * Handle when all dismissed - */ - _onHaveNoNotifications: function() { - // Remove the border - $('div.notifications-button').removeClass('hasNotifications'); - $('div.notifications .emptycontent').removeClass('hidden'); - this.$button.find('img').attr('src', OC.imagePath('notifications', 'notifications')); - }, - - /** - * Performs the AJAX request to retrieve the notifications - * @param {Function} success - * @param {Function} failure - */ - fetch: function(success, failure){ - var self = this; - var request = $.ajax({ - url: OC.linkToOCS('apps/notifications/api/v1', 2) + 'notifications?format=json', - type: 'GET' - }); - - - request.done(function(data, statusText, xhr) { - if (xhr.status === 204 || data.ocs.meta.statuscode === 204) { - // 204 No Content - Intercept when no notifiers are there. - self._shutDownNotifications(); - } else { - success(data.ocs.data, statusText, xhr); - } - }); - request.fail(failure); - }, - - /** - * Retrieves a notification object by id - * @param {int} id - */ - getNotification: function(id) { - if(OCA.Notifications.notifications[id] != undefined) { - return OCA.Notifications.notifications[id]; - } else { - return false; - } - }, - - /** - * Returns all notification objects - */ - getNotifications: function() { - return this.notifications; - }, - - /** - * Handles the returned data from the AJAX call - * @param {object} responseData - */ - parseNotifications: function(responseData) { - - }, - - /** - * Returns how many notifications in the UI - */ - numNotifications: function() { - return OCA.Notifications.num; - } - - }; + if (!OCA.Notifications) { + OCA.Notifications = {}; + } + + OCA.Notifications = { + + notifications: {}, + + num: 0, + + pollInterval: 30000, // milliseconds + + open: false, + + $button: null, + + $container: null, + + $notifications: null, + + interval: null, + + initialise: function() { + // Go! + + // Setup elements + this.$notifications = $('
'); + this.$button = $(''); + this.$container = $('
'); + var $wrapper = $('
'); + + // Empty content dropdown + var $headLine = $('

'); + $headLine.text(t('notifications', 'No notifications')); + var $emptyContent = $('
'); + $emptyContent.append($headLine); + this.$container.append($emptyContent); + + this.$notifications.append(this.$button); + this.$notifications.append(this.$container); + this.$container.append($wrapper); + + // Add to the UI + $('form.searchbox').before(this.$notifications); + + // Initial call to the notification endpoint + this.initialFetch(); + + // Bind the button click event + OC.registerMenu(this.$button, this.$container); + this.$button.on('click', this._onNotificationsButtonClick); + + this.$container.on('click', '.action-button', _.bind(this._onClickAction, this)); + this.$container.on('click', '.notification-delete', _.bind(this._onClickDismissNotification, this)); + + // Setup the background checker + this.interval = setInterval(_.bind(this.backgroundFetch, this), this.pollInterval); + }, + + _onClickDismissNotification: function(event) { + event.preventDefault(); + var $target = $(event.target); + var $notification = $target.closest('.notification'); + var id = $notification.attr('data-id'); + + $notification.fadeOut(OC.menuSpeed); + + $.ajax({ + url: OC.linkToOCS('apps/notifications/api/v1', 2) + 'notifications/' + id + '?format=json', + type: 'DELETE', + success: function(data) { + self._removeNotification(id); + }, + error: function() { + $notification.fadeIn(OC.menuSpeed); + OC.Notification.showTemporary('Failed to perform action'); + } + }); + + this._removeNotification($notification.attr('data-id')); + }, + + _onClickAction: function(event) { + event.preventDefault(); + var self = this; + var $target = $(event.target); + var $notification = $target.closest('.notification'); + var actionType = $target.attr('data-type') || 'GET'; + var actionUrl = $target.attr('data-href'); + + $notification.fadeOut(OC.menuSpeed); + + $.ajax({ + url: actionUrl, + type: actionType, + success: function(data) { + $('body').trigger(new $.Event('OCA.Notification.Action', { + notification: self.notifications[$notification.attr('data-id')], + action: { + url: actionUrl, + type: actionType + } + })); + self._removeNotification($notification.attr('data-id')); + }, + error: function() { + $notification.fadeIn(OC.menuSpeed); + OC.Notification.showTemporary('Failed to perform action'); + } + }); + + }, + + _removeNotification: function(id) { + var $notification = this.$container.find('.notification').filterAttr('id', id); + delete OCA.Notifications.notifications[id]; + + $notification.remove(); + if (_.keys(OCA.Notifications.notifications).length === 0) { + this._onHaveNoNotifications(); + } + }, + + /** + * Handles the notification button click event + */ + _onNotificationsButtonClick: function() { + // Show a popup + OC.showMenu(null, OCA.Notifications.$container); + }, + + initialFetch: function() { + var self = this; + + this.fetch( + function(data) { + // Fill Array + $.each(data, function(index) { + var n = new self.Notif(data[index]); + self.notifications[n.getId()] = n; + self.addToUI(n); + self.num++; + }); + // Check if we have any, and notify the UI + if (self.numNotifications() !== 0) { + self._onHaveNotifications(); + } else { + self._onHaveNoNotifications(); + } + }, + _.bind(self._onFetchError, self) + ); + }, + + /** + * Background fetch handler + */ + backgroundFetch: function() { + var self = this; + + this.fetch( + function(data) { + var inJson = []; + var oldNum = self.numNotifications(); + $.each(data, function(index) { + var n = new self.Notif(data[index]); + inJson.push(n.getId()); + if (!self.getNotification(n.getId())){ + // New notification! + self._onNewNotification(n); + } + }); + + for (var n in self.getNotifications()) { + if (inJson.indexOf(self.getNotifications()[n].getId()) === -1) { + // Not in JSON, remove from UI + self._onRemoveNotification(self.getNotifications()[n]); + } + } + + // Now check if we suddenly have notifs, or now none + if (oldNum == 0 && self.numNotifications() !== 0) { + // We now have some! + self._onHaveNotifications(); + } else if (oldNum != 0 && self.numNotifications() === 0) { + // Now we have none + self._onHaveNoNotifications(); + } + }, + _.bind(self._onFetchError, self) + ); + }, + + /** + * Handles removing the Notification from the UI when no longer in JSON + * @param {XMLHttpRequest} xhr + */ + _onFetchError: function(xhr) { + if (xhr.status === 404) { + // 404 Not Found - stop polling + this._shutDownNotifications(); + } else { + OC.Notification.showTemporary('Failed to perform request for notifications'); + } + }, + + /** + * Handles removing the Notification from the UI when no longer in JSON + * @param {OCA.Notifications.Notification} notification + */ + _onRemoveNotification: function(notification) { + $('div.notification[data-id='+escapeHTML(notification.getId())+']').remove(); + delete OCA.Notifications.notifications[notification.getId()]; + OCA.Notifications.num--; + }, + + /** + * Handle new notification received + * @param {OCA.Notifications.Notification} notification + */ + _onNewNotification: function(notification) { + OCA.Notifications.num++; + // Add it to the array + OCA.Notifications.notifications[notification.getId()] = notification; + // Add to the UI + OCA.Notifications.addToUI(notification); + + // Trigger browsers web notification + // https://github.com/owncloud/notifications/issues/1 + if ("Notification" in window) { + if (Notification.permission === "granted") { + // If it's okay let's create a notification + OCA.Notifications.createWebNotification(notification); + } + + // Otherwise, we need to ask the user for permission + else if (Notification.permission !== 'denied') { + Notification.requestPermission(function (permission) { + // If the user accepts, let's create a notification + if (permission === "granted") { + OCA.Notifications.createWebNotification(notification); + } + }); + } + } + }, + + /** + * Create a browser notification + * + * @see https://developer.mozilla.org/en/docs/Web/API/notification + * @param {OCA.Notifications.Notification} notification + */ + createWebNotification: function (notification) { + var n = new Notification(notification.getSubject(), { + title: notification.getSubject(), + lang: OC.getLocale(), + body: notification.getMessage(), + tag: notification.getId() + }); + setTimeout(n.close.bind(n), 5000); + }, + + _shutDownNotifications: function() { + // The app was disabled or has no notifiers, so we can stop polling + // And hide the UI as well + window.clearInterval(this.interval); + this.$notifications.addClass('hidden'); + }, + + /** + * Adds the notification to the UI + * @param {OCA.Notifications.Notification} notification + */ + addToUI: function(notification) { + $('div.notification-wrapper').prepend(notification.renderElement()); + }, + + /** + * Handle event when we have notifications (and didnt before) + */ + _onHaveNotifications: function() { + // Add the button, title, etc + $('div.notifications-button') + .addClass('hasNotifications') + .animate({opacity: 0.5}) + .animate({opacity: 1}) + .animate({opacity: 0.5}) + .animate({opacity: 1}) + .animate({opacity: 0.7}); + $('div.notifications .emptycontent').addClass('hidden'); + this.$button.find('img').attr('src', OC.imagePath('notifications', 'notifications-new')); + }, + + /** + * Handle when all dismissed + */ + _onHaveNoNotifications: function() { + // Remove the border + $('div.notifications-button').removeClass('hasNotifications'); + $('div.notifications .emptycontent').removeClass('hidden'); + this.$button.find('img').attr('src', OC.imagePath('notifications', 'notifications')); + }, + + /** + * Performs the AJAX request to retrieve the notifications + * @param {Function} success + * @param {Function} failure + */ + fetch: function(success, failure){ + var self = this; + var request = $.ajax({ + url: OC.linkToOCS('apps/notifications/api/v1', 2) + 'notifications?format=json', + type: 'GET' + }); + + + request.done(function(data, statusText, xhr) { + if (xhr.status === 204 || data.ocs.meta.statuscode === 204) { + // 204 No Content - Intercept when no notifiers are there. + self._shutDownNotifications(); + } else { + success(data.ocs.data, statusText, xhr); + } + }); + request.fail(failure); + }, + + /** + * Retrieves a notification object by id + * @param {int} id + */ + getNotification: function(id) { + if(OCA.Notifications.notifications[id] != undefined) { + return OCA.Notifications.notifications[id]; + } else { + return false; + } + }, + + /** + * Returns all notification objects + */ + getNotifications: function() { + return this.notifications; + }, + + /** + * Handles the returned data from the AJAX call + * @param {object} responseData + */ + parseNotifications: function(responseData) { + + }, + + /** + * Returns how many notifications in the UI + */ + numNotifications: function() { + return OCA.Notifications.num; + } + + }; })(); $(document).ready(function () { - OCA.Notifications.initialise(); + OCA.Notifications.initialise(); }); diff --git a/js/notification.js b/js/notification.js index b7fca360..d015e2f7 100644 --- a/js/notification.js +++ b/js/notification.js @@ -10,123 +10,121 @@ (function() { - /** - * Initialise the notification - */ - var Notif = function(jsonData){ - // TODO handle defaults - this.app = jsonData.app; - this.user = jsonData.user; - this.timestamp = moment(jsonData.datetime).format('X'); - this.object_type = jsonData.object_type; - this.object_id = jsonData.object_id; - this.subject = jsonData.subject; - this.message = jsonData.message; - this.link = jsonData.link; - this.actions = jsonData.actions; // TODO some parsing here? - this.notification_id = jsonData.notification_id; - }; + /** + * Initialise the notification + */ + var Notif = function(jsonData){ + // TODO handle defaults + this.app = jsonData.app; + this.user = jsonData.user; + this.timestamp = moment(jsonData.datetime).format('X'); + this.object_type = jsonData.object_type; + this.object_id = jsonData.object_id; + this.subject = jsonData.subject; + this.message = jsonData.message; + this.link = jsonData.link; + this.actions = jsonData.actions; // TODO some parsing here? + this.notification_id = jsonData.notification_id; + }; - Notif.prototype = { + Notif.prototype = { - app: null, + app: null, - user: null, + user: null, - timestamp: null, + timestamp: null, - object_type: null, + object_type: null, - object_id: null, + object_id: null, - subject: null, + subject: null, - message: null, + message: null, - link: null, + link: null, - actions: [], + actions: [], - notification_id: null, + notification_id: null, - getSubject: function() { - return this.subject; - }, + getSubject: function() { + return this.subject; + }, - getTimestamp: function() { - return this.timestamp; - }, + getTimestamp: function() { + return this.timestamp; + }, - getObjectId: function() { - return this.object_id; - }, + getObjectId: function() { + return this.object_id; + }, - getLink: function() { - return this.link; - }, + getLink: function() { + return this.link; + }, - getActions: function() { - return this.actions; - }, + getActions: function() { + return this.actions; + }, - getId: function() { - return this.notification_id; - }, + getId: function() { + return this.notification_id; + }, - getMessage: function() { - return this.message; - }, + getMessage: function() { + return this.message; + }, - getEl: function() { - return $('div.notification[data-id='+escapeHTML(this.getId())+']'); - }, + getEl: function() { + return $('div.notification[data-id='+escapeHTML(this.getId())+']'); + }, - getApp: function() { - return this.app; - }, + getApp: function() { + return this.app; + }, - /** - * Generates the HTML for the notification - */ - renderElement: function() { + /** + * Generates the HTML for the notification + */ + renderElement: function() { // FIXME: use handlebars template - var el = $('
'); - el.attr('data-id', escapeHTML(this.getId())); - el.attr('data-timestamp', escapeHTML(this.getTimestamp())); - - if (this.getLink()) { - el.append(' '+escapeHTML(this.getSubject())+''); - } else { - el.append('
'+escapeHTML(this.getSubject())+'
'); - } - el.append('
'+escapeHTML(this.getMessage())+'
'); - // Add actions - var actions = $('
'); - var actionsData = this.getActions(); - _.each(actionsData, function(actionData) { + var el = $('
'); + el.attr('data-id', escapeHTML(this.getId())); + el.attr('data-timestamp', escapeHTML(this.getTimestamp())); + + if (this.getLink()) { + el.append(' '+escapeHTML(this.getSubject())+''); + } else { + el.append('
'+escapeHTML(this.getSubject())+'
'); + } + el.append('
'+escapeHTML(this.getMessage())+'
'); + // Add actions + var actions = $('
'); + var actionsData = this.getActions(); + _.each(actionsData, function(actionData) { // FIXME: use handlebars template - actions.append( - '
' + - ''+escapeHTML(actionData.label)+'' + - '
' + actions.append( + '' ); - // TODO create event handler on click for given action type - }); - el.append(actions); - el.append(''); - return el; - }, + // TODO create event handler on click for given action type + }); + el.append(actions); + el.append(''); + return el; + }, - /** - * Register notification Binds - */ - bindNotificationEvents: function() { + /** + * Register notification Binds + */ + bindNotificationEvents: function() { - } + } - }; + }; - OCA.Notifications.Notif = Notif; + OCA.Notifications.Notif = Notif; })();