Форк Rambox
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.

82 lines
2.0 KiB

// Initialize Firebase
var firebase = require('firebase/app');
require('firebase/database');
require('firebase/auth');
9 years ago
// Firebase Config
var config = {
9 years ago
apiKey: "",
authDomain: "",
databaseURL: "",
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: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); }
}
]
});
});