Added electron support as external page.
This commit is contained in:
parent
fd58ac0a29
commit
64296b645d
5 changed files with 21 additions and 3 deletions
|
@ -0,0 +1,10 @@
|
||||||
|
class Widget
|
||||||
|
constructor: ->
|
||||||
|
return if !window.require
|
||||||
|
ipcRenderer = window.require('electron').ipcRenderer
|
||||||
|
return if !ipcRenderer
|
||||||
|
App.Event.bind('online_notification_counter', (e) ->
|
||||||
|
ipcRenderer.send('set-badge', e)
|
||||||
|
)
|
||||||
|
|
||||||
|
App.Config.set('aaa_electron_events', Widget, 'Navigations')
|
|
@ -114,6 +114,8 @@ class App.OnlineNotificationWidget extends App.Controller
|
||||||
count = '' if count is 0
|
count = '' if count is 0
|
||||||
|
|
||||||
$('.js-notificationsCounter').text(count)
|
$('.js-notificationsCounter').text(count)
|
||||||
|
App.Event.trigger('online_notification_counter', count.toString())
|
||||||
|
|
||||||
@count = count
|
@count = count
|
||||||
|
|
||||||
# show mark all as read if needed
|
# show mark all as read if needed
|
||||||
|
|
|
@ -43,7 +43,9 @@ class App.Run extends App.Controller
|
||||||
App.Event.trigger(event + ':init')
|
App.Event.trigger(event + ':init')
|
||||||
widgets = App.Config.get(config)
|
widgets = App.Config.get(config)
|
||||||
if widgets
|
if widgets
|
||||||
for key, widget of widgets
|
sortedKeys = Object.keys(widgets).sort()
|
||||||
|
for key in sortedKeys
|
||||||
|
widget = widgets[key]
|
||||||
new widget(
|
new widget(
|
||||||
el: el
|
el: el
|
||||||
key: key
|
key: key
|
||||||
|
|
|
@ -945,7 +945,9 @@ function handleOpts(opts, defs) {
|
||||||
parse5322.parseOneAddress = parseOneAddressSimple;
|
parse5322.parseOneAddress = parseOneAddressSimple;
|
||||||
parse5322.parseAddressList = parseAddressListSimple;
|
parse5322.parseAddressList = parseAddressListSimple;
|
||||||
|
|
||||||
if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') {
|
// if electron is used, go back to non CommonJS
|
||||||
|
//if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') {
|
||||||
|
if (typeof module !== 'undefined' && typeof module.exports !== 'undefined' && !(process && process.version && process.versions.electron)) {
|
||||||
module.exports = parse5322;
|
module.exports = parse5322;
|
||||||
} else {
|
} else {
|
||||||
global.emailAddresses = parse5322;
|
global.emailAddresses = parse5322;
|
||||||
|
|
|
@ -14,7 +14,9 @@
|
||||||
|
|
||||||
(function( global, factory ) {
|
(function( global, factory ) {
|
||||||
|
|
||||||
if ( typeof module === "object" && typeof module.exports === "object" ) {
|
// if electron is used, go back to non CommonJS
|
||||||
|
//if ( typeof module === "object" && typeof module.exports === "object" ) {
|
||||||
|
if ( typeof module === "object" && typeof module.exports === "object" && !(process && process.version && process.versions.electron)) {
|
||||||
// For CommonJS and CommonJS-like environments where a proper `window`
|
// For CommonJS and CommonJS-like environments where a proper `window`
|
||||||
// is present, execute the factory and get jQuery.
|
// is present, execute the factory and get jQuery.
|
||||||
// For environments that do not have a `window` with a `document`
|
// For environments that do not have a `window` with a `document`
|
||||||
|
|
Loading…
Reference in a new issue