hangoutsslackgmailskypefacebook-workplaceoutlookemailmicrosoft-teamsdiscordmessengercustom-servicesmacoslinuxwindowsinboxwhatsappicloudtweetdeckhipchattelegram
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
84 lines
2.2 KiB
84 lines
2.2 KiB
// Initialize Firebase |
|
var firebase = require('firebase/app'); |
|
require('firebase/database'); |
|
require('firebase/auth'); |
|
|
|
// Firebase Config |
|
var config = { |
|
apiKey: firebaseCfg.apiKey |
|
,authDomain: firebaseCfg.authDomain |
|
,databaseURL: firebaseCfg.databaseURL |
|
,storageBucket: firebaseCfg.storageBucket |
|
}; |
|
var fireRef = firebase.initializeApp(config); // Firebase Ref |
|
var FirebaseTokenGenerator = require('firebase-token-generator'); |
|
var auth0, lock; // Auth0 vars |
|
|
|
// Sencha App |
|
Ext.setGlyphFontFamily('FontAwesome'); |
|
Ext.application({ |
|
name: 'Rambox' |
|
|
|
,extend: 'Rambox.Application' |
|
|
|
,autoCreateViewport: 'Rambox.view.main.Main' |
|
}); |
|
|
|
// auto update logic |
|
const ipc = require('electron').ipcRenderer; |
|
ipc.on('showAbout', function(event, message) { |
|
!Ext.cq1('about') ? Ext.create('Rambox.view.main.About') : ''; |
|
}); |
|
ipc.on('autoUpdater:checking-for-update:', function() { |
|
Ext.Msg.wait('Please wait...', 'Checking for update'); |
|
}); |
|
ipc.on('autoUpdater:check-update', function() { |
|
Rambox.app.checkUpdate(); |
|
}); |
|
ipc.on('autoUpdater:update-not-available', function() { |
|
Ext.Msg.show({ |
|
title: 'You are up to date!' |
|
,message: 'You have the latest version of Rambox.' |
|
,icon: Ext.Msg.INFO |
|
,buttons: Ext.Msg.OK |
|
}); |
|
}); |
|
ipc.on('autoUpdater:update-available', function() { |
|
Ext.Msg.show({ |
|
title: 'New Version available!' |
|
,message: 'Please wait until Rambox download the new version and ask you for install it.' |
|
,icon: Ext.Msg.INFO |
|
,buttons: Ext.Msg.OK |
|
}); |
|
}); |
|
ipc.on('autoUpdater:update-downloaded', function(e, releaseNotes, releaseName, releaseDate, updateURL) { |
|
Ext.cq1('app-main').addDocked({ |
|
xtype: 'toolbar' |
|
,dock: 'top' |
|
,ui: 'newversion' |
|
,items: [ |
|
'->' |
|
,{ |
|
xtype: 'label' |
|
,html: '<b>New version is available!</b> ('+releaseName+')' |
|
} |
|
,{ |
|
xtype: 'button' |
|
,text: 'Install' |
|
,handler: function(btn) { ipc.send('autoUpdater:quit-and-install'); } |
|
} |
|
,{ |
|
xtype: 'button' |
|
,text: 'Changelog' |
|
,href: 'https://github.com/saenzramiro/rambox/releases/tag/'+releaseName |
|
} |
|
,'->' |
|
,{ |
|
glyph: 'xf00d@FontAwesome' |
|
,baseCls: '' |
|
,style: 'cursor:pointer;' |
|
,handler: function(btn) { Ext.cq1('app-main').removeDocked(btn.up('toolbar'), true); } |
|
} |
|
] |
|
}); |
|
});
|
|
|