Changeset View
Changeset View
Standalone View
Standalone View
webroot/rsrc/js/core/Notification.js
| Show All 21 Lines | JX.install('Notification', { | ||||
| events : ['activate', 'close'], | events : ['activate', 'close'], | ||||
| members : { | members : { | ||||
| _container : null, | _container : null, | ||||
| _visible : false, | _visible : false, | ||||
| _hideTimer : null, | _hideTimer : null, | ||||
| _duration : 12000, | _duration : 12000, | ||||
| _desktopReady : false, | _desktopReady : false, | ||||
| _webReady : false, | |||||
| _key : null, | _key : null, | ||||
| _title : null, | _title : null, | ||||
| _body : null, | _body : null, | ||||
| _href : null, | _href : null, | ||||
| _icon : null, | _icon : null, | ||||
| show : function() { | show : function() { | ||||
| var self = JX.Notification; | var self = JX.Notification; | ||||
| // This person doesn't like any real-time notification | |||||
| if (!this._desktopReady && !this._webReady) { | |||||
| return; | |||||
| } | |||||
| if (!this._visible) { | if (!this._visible) { | ||||
| this._visible = true; | this._visible = true; | ||||
| self._show(this); | self._show(this); | ||||
| this._updateTimer(); | this._updateTimer(); | ||||
| } | } | ||||
| if (self.supportsDesktopNotifications() && | if (self.supportsDesktopNotifications() && | ||||
| ▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | setContent : function(content) { | ||||
| return this; | return this; | ||||
| }, | }, | ||||
| setDesktopReady : function(ready) { | setDesktopReady : function(ready) { | ||||
| this._desktopReady = ready; | this._desktopReady = ready; | ||||
| return this; | return this; | ||||
| }, | }, | ||||
| setWebReady : function(ready) { | |||||
| this._webReady = ready; | |||||
| return this; | |||||
| }, | |||||
| setTitle : function(title) { | setTitle : function(title) { | ||||
| this._title = title; | this._title = title; | ||||
| return this; | return this; | ||||
| }, | }, | ||||
| setBody : function(body) { | setBody : function(body) { | ||||
| this._body = body; | this._body = body; | ||||
| return this; | return this; | ||||
| ▲ Show 20 Lines • Show All 152 Lines • Show Last 20 Lines | |||||