Browse Source

Merge pull request #1 from saenzramiro/master

Merge changes from saenzramiro
pull/60/head
Tim Sedlmeyer 9 years ago committed by GitHub
parent
commit
d00af9dac8
  1. 2
      README.md
  2. 4
      app.js
  3. 10
      app.json
  4. 3
      app/Application.js
  5. 3
      app/model/Service.js
  6. 1
      app/package.json
  7. 3
      app/store/Services.js
  8. 49
      app/store/ServicesList.js
  9. 49
      app/ux/WebView.js
  10. 28
      app/view/main/About.js
  11. 19
      app/view/main/Main.js
  12. 203
      app/view/main/MainController.js
  13. 4
      electron/autoupdater.js
  14. 22
      electron/main.js
  15. 10
      electron/menu.js
  16. 3
      package.json
  17. 14
      packages/local/rambox-default-theme/sass/src/LoadMask.scss
  18. BIN
      resources/icons/custom.png
  19. BIN
      resources/icons/freenode.png
  20. BIN
      resources/icons/icq.png
  21. BIN
      resources/icons/mysms.png
  22. BIN
      resources/icons/outlook365.png
  23. BIN
      resources/icons/tweetdeck.png
  24. BIN
      resources/icons/zinc.png

2
README.md

@ -7,7 +7,7 @@
[![Gitter](https://badges.gitter.im/saenzramiro/rambox.svg)](https://gitter.im/saenzramiro/rambox?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
[![license:mit](https://img.shields.io/badge/license-mit-blue.svg)](https://opensource.org/licenses/MIT)
Free and Open Source messaging app that combines chat and messaging common services into one application.
Free and Open Source messaging and emailing app that combines common web applications into one.
Available for Windows, Mac and Linux.

4
app.js

@ -35,3 +35,7 @@ function sync() {
services: services
});
}
require('electron').ipcRenderer.on('showAbout', function(event, message) {
!Ext.cq1('about') ? Ext.create('Rambox.view.main.About') : '';
});

10
app.json

@ -248,7 +248,10 @@
*
*/
"output": {
"base": "${workspace.build.dir}/${build.environment}/${app.name}"
"base": "${workspace.build.dir}/${build.environment}/${app.name}",
"appCache": {
"enable": true
}
},
/**
@ -259,7 +262,10 @@
* List of items in the CACHE MANIFEST section
*/
"cache": [
"index.html"
"index.html",
"app.js",
"resources/Rambox-all.css",
"resources/Icon.png"
],
/**
* List of items in the NETWORK section

3
app/Application.js

@ -26,6 +26,9 @@ Ext.define('Rambox.Application', {
Ext.cq1('app-main').setActiveTab(key - 48);
}
});
// Remove spinner after 3 secs
Ext.defer(function() { Ext.get('spinner').destroy(); }, 3000);
}
,updateTotalNotifications: function( newValue, oldValue ) {

3
app/model/Service.js

@ -22,9 +22,6 @@ Ext.define('Rambox.model.Service', {
},{
name: 'logo'
,type: 'string'
,convert: function( value, record ) {
return value ? value : record.get('type') + '.png';
}
},{
name: 'name'
,type: 'string'

1
app/package.json

@ -25,6 +25,7 @@
"author": "Ramiro Saenz",
"license": "MIT",
"dependencies": {
"electron-window-state": "^3.0.3",
"firebase": "^3.0.5",
"firebase-token-generator": "^2.0.0"
}

3
app/store/Services.js

@ -21,7 +21,6 @@ Ext.define('Rambox.store.Services', {
,listeners: {
load: function( store, records, successful ) {
if ( Ext.isEmpty(records) ) {
Ext.get('spinner').destroy();
Ext.cq1('app-main').add({ tabConfig : { xtype : 'tbfill' } });
return;
}
@ -33,7 +32,7 @@ Ext.define('Rambox.store.Services', {
xtype: 'webview'
,id: 'tab_'+service.get('id')
,title: service.get('name')
,icon: service.get('type') !== 'custom' ? 'resources/icons/'+service.get('logo') : service.get('logo')
,icon: service.get('type') !== 'custom' ? 'resources/icons/'+service.get('logo') : ( service.get('logo') === '' ? 'resources/icons/custom.png' : service.get('logo'))
,src: service.get('url')
,type: service.get('type')
,muted: service.get('muted')

49
app/store/ServicesList.js

@ -151,9 +151,9 @@ Ext.define('Rambox.store.ServicesList', {
,type: 'email'
},
{
id: 'office365'
,logo: 'office365.png'
,name: 'Office 365'
id: 'outlook365'
,logo: 'outlook365.png'
,name: 'Outlook 365'
,url: 'https://outlook.office.com/owa/'
,type: 'email'
},
@ -262,6 +262,49 @@ Ext.define('Rambox.store.ServicesList', {
,name: 'DingTalk'
,url: 'https://im.dingtalk.com/'
,type: 'messaging'
},
{
id: 'mysms'
,logo: 'mysms.png'
,name: 'mysms'
,url: 'https://app.mysms.com/'
,type: 'messaging'
,js_unread: 'function checkUnread(){var e=document.getElementsByClassName("unread"),t=0;for(i=0;i<e.length;i++)t+=parseInt(e[i].firstChild.innerHTML.trim());updateBadge(t)}function updateBadge(e){e>=1?document.title="("+e+") "+originalTitle:document.title=originalTitle}var originalTitle=document.title;setInterval(checkUnread,3000);'
},
{
id: 'icq'
,logo: 'icq.png'
,name: 'ICQ'
,url: 'https://web.icq.com/'
,type: 'messaging'
,js_unread: 'function checkUnread(){updateBadge(parseInt(document.getElementsByClassName("nwa-msg-counter")[0].style.display==="block"?document.getElementsByClassName("nwa-msg-counter")[0].innerHTML.trim():0))}function updateBadge(e){e>=1?document.title="("+e+") "+originalTitle:document.title=originalTitle}var originalTitle=document.title;setInterval(checkUnread,3000);'
},
{
id: 'tweetdeck'
,logo: 'tweetdeck.png'
,name: 'TweetDeck'
,url: 'https://tweetdeck.twitter.com/'
,type: 'messaging'
},
{
id: 'custom'
,logo: 'custom.png'
,name: '_Custom Service'
,type: 'custom'
},
{
id: 'zinc'
,logo: 'zinc.png'
,name: 'Zinc'
,url: 'https://zinc-app.com/'
,type: 'messaging'
},
{
id: 'freenode'
,logo: 'freenode.png'
,name: 'FreeNode'
,url: 'https://webchat.freenode.net/'
,type: 'messaging'
}
]
});

49
app/ux/WebView.js

@ -38,12 +38,23 @@ Ext.define('Rambox.ux.WebView',{
,plugins: 'true'
,allowtransparency: 'on'
,autosize: 'on'
,blinkfeatures: 'ApplicationCache,GlobalCacheStorage'
,useragent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Safari/537.36 Edge/13.10586' // Used to enable video and audio calls in Skype
}
}]
,tabConfig: {
listeners: {
badgetextchange: me.onBadgeTextChange
}
,clickEvent: 'dblclick'
,menu: [
{
text: 'Reload'
,glyph: 'xf021@FontAwesome'
,scope: me
,handler: me.reloadService
}
]
}
,listeners: {
afterrender: me.onAfterRender
@ -66,7 +77,9 @@ Ext.define('Rambox.ux.WebView',{
// Show and hide spinner when is loading
webview.addEventListener("did-start-loading", function() {
console.info('Start loading...', me.src);
me.mask('Loading...');
me.mask('Loading...', 'bottomMask');
// Manually remove modal from mask
Ext.cq1('#'+me.id).el.dom.getElementsByClassName('bottomMask')[0].parentElement.className = '';
});
webview.addEventListener("did-stop-loading", function() {
me.unmask();
@ -74,28 +87,25 @@ Ext.define('Rambox.ux.WebView',{
webview.addEventListener("did-finish-load", function(e) {
Rambox.app.setTotalServicesLoaded( Rambox.app.getTotalServicesLoaded() + 1 );
if ( Rambox.app.getTotalServicesLoaded() === Ext.getStore('Services').getCount() && Ext.get('spinner') !== null ) {
Ext.get('spinner').destroy();
});
// Open links in default browser
webview.addEventListener('new-window', function(e) {
const protocol = require('url').parse(e.url).protocol;
if (protocol === 'http:' || protocol === 'https:' || protocol === 'mailto:') {
e.preventDefault();
require('electron').shell.openExternal(e.url);
}
});
webview.addEventListener('will-navigate', function(e, url) {
e.preventDefault();
});
webview.addEventListener("dom-ready", function(e) {
// Mute Webview
if ( !webview.isAudioMuted() && me.muted ) webview.setAudioMuted(me.muted);
// Open links in default browser
webview.addEventListener('new-window', function(e) {
const protocol = require('url').parse(e.url).protocol;
if (protocol === 'http:' || protocol === 'https:') {
e.preventDefault();
require('electron').shell.openExternal(e.url);
}
});
webview.addEventListener('will-navigate', function(e, url) {
e.preventDefault();
});
// Injected code to detect new messages
if ( me.record && me.record.get('js_unread') !== '' ) {
console.info('JS Injected', me.src);
@ -139,4 +149,11 @@ Ext.define('Rambox.ux.WebView',{
}
});
}
,reloadService: function(btn) {
var me = this;
var webview = me.down('component').el.dom;
webview.reload();
}
});

28
app/view/main/About.js

@ -0,0 +1,28 @@
Ext.define('Rambox.view.main.About', {
extend: 'Ext.window.Window'
,xtype: 'about'
,title: 'About Rambox'
,autoShow: true
,modal: true
,width: 300
,bodyPadding: 10
,data: {
version: require('electron').remote.app.getVersion()
,platform: process.platform
,arch: process.arch
,electron: process.versions.electron
,chromium: process.versions.chrome
,node: process.versions.node
}
,tpl: [
'<div style="text-align:center;"><img src="resources/Icon.png" width="100" /></div>'
,'<h3>Free and Open Source messaging and emailing app that combines common web applications into one.</h3>'
,'<div><b>Version:</b> {version}</div>'
,'<div><b>Platform:</b> {platform} ({arch})</div>'
,'<div><b>Electron:</b> {electron}</div>'
,'<div><b>Chromium:</b> {chromium}</div>'
,'<div><b>Node:</b> {node}</div>'
,'<br />'
,'<div style="text-align:center;"><a href="https://github.com/saenzramiro/rambox" target="_blank">GitHub</a> - <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=WU75QWS7LH2CA" target="_blank">Donate</a> - <a href="http://rambox.pro" target="_blank">rambox.pro</a></div>'
]
});

19
app/view/main/Main.js

@ -101,11 +101,6 @@ Ext.define('Rambox.view.main.Main', {
,specialkey: 'onSearchEnter'
}
}
,{
type: 'plus'
,tooltip: 'Add a custom service'
,handler: 'addCustomService'
}
]
,items: [
{
@ -148,7 +143,7 @@ Ext.define('Rambox.view.main.Main', {
xtype: 'templatecolumn'
,width: 50
,variableRowHeight: true
,tpl: '<img src="{[ values.type !== \"custom\" ? \"resources/icons/\" : \"\" ]}{logo}" data-qtip="{type:capitalize}" width="32" />'
,tpl: '<img src="{[ values.type !== \"custom\" ? \"resources/icons/\"+values.logo : (values.logo == \"\" ? \"resources/icons/custom.png\" : values.logo) ]}" data-qtip="{type:capitalize}" width="32" />'
}
,{ text: 'Name', dataIndex: 'name', variableRowHeight: true, flex: 1 }
,{
@ -178,17 +173,17 @@ Ext.define('Rambox.view.main.Main', {
,align: 'center'
,items: [
{
glyph: 0xf1f8
,tooltip: 'Remove'
,handler: 'removeService'
,getClass: function(){ return 'x-hidden-display'; }
}
,{
glyph: 0xf013
,tooltip: 'Configure'
,handler: 'configureService'
,getClass: function(){ return 'x-hidden-display'; }
}
,{
glyph: 0xf1f8
,tooltip: 'Remove'
,handler: 'removeService'
,getClass: function(){ return 'x-hidden-display'; }
}
]
}
]

203
app/view/main/MainController.js

@ -105,6 +105,7 @@ Ext.define('Rambox.view.main.MainController', {
} else {
var service = Ext.create('Rambox.model.Service', {
type: record.get('id')
,logo: record.get('logo')
,name: formValues.serviceName
,url: record.get('url')
,align: formValues.align
@ -149,11 +150,11 @@ Ext.define('Rambox.view.main.MainController', {
win.down('textfield[name="serviceName"]').focus(true, 100);
}
,showCustomModal: function(record) {
,showCustomModal: function(record, edit) {
var me = this;
var win = Ext.create('Ext.window.Window', {
title: 'Add '+record.get('name')
title: (edit ? 'Edit ' : 'Add ') + record.get('name')
,modal: true
,width: 400
,resizable: false
@ -210,7 +211,7 @@ Ext.define('Rambox.view.main.MainController', {
{
xtype: 'checkbox'
,boxLabel: 'Align to Right'
,checked: false
,checked: edit ? (record.get('align') === 'right' ? true : false) : false
,name: 'align'
,uncheckedValue: 'left'
,inputValue: 'right'
@ -219,7 +220,7 @@ Ext.define('Rambox.view.main.MainController', {
xtype: 'checkbox'
,boxLabel: 'Show notifications'
,name: 'notifications'
,checked: true
,checked: edit ? record.get('notifications') : true
,uncheckedValue: false
,inputValue: true
}
@ -227,7 +228,7 @@ Ext.define('Rambox.view.main.MainController', {
xtype: 'checkbox'
,boxLabel: 'Mute all sounds'
,name: 'muted'
,checked: false
,checked: edit ? record.get('muted') : false
,uncheckedValue: false
,inputValue: true
}
@ -253,39 +254,50 @@ Ext.define('Rambox.view.main.MainController', {
var formValues = win.down('form').getValues();
var service = Ext.create('Rambox.model.Service', {
type: record.get('id')
,name: formValues.serviceName
,url: record.get('url').replace('___', formValues.url)
,align: formValues.align
,notifications: formValues.notifications
,muted: formValues.muted
,js_unread: record.get('js_unread')
});
service.save();
Ext.getStore('Services').add(service);
var tabData = {
xtype: 'webview'
,id: 'tab_'+service.get('id')
,title: service.get('name')
,icon: 'resources/icons/'+record.get('logo')
,src: service.get('url')
,type: service.get('type')
,align: formValues.align
,notifications: formValues.notifications
,muted: formValues.muted
,record: service
,tabConfig: {
service: service
}
};
if ( formValues.align === 'left' ) {
var tbfill = me.getView().getTabBar().down('tbfill');
me.getView().insert(me.getView().getTabBar().items.indexOf(tbfill), tabData).show();
if ( edit ) {
record.set({
name: formValues.serviceName
,align: formValues.align
,notifications: formValues.notifications
,muted: formValues.muted
});
Ext.getCmp('tab_'+record.get('id')).setTitle(formValues.serviceName);
} else {
me.getView().add(tabData).show();
var service = Ext.create('Rambox.model.Service', {
type: record.get('id')
,logo: record.get('logo')
,name: formValues.serviceName
,url: record.get('url').replace('___', formValues.url)
,align: formValues.align
,notifications: formValues.notifications
,muted: formValues.muted
,js_unread: record.get('js_unread')
});
service.save();
Ext.getStore('Services').add(service);
var tabData = {
xtype: 'webview'
,id: 'tab_'+service.get('id')
,title: service.get('name')
,icon: 'resources/icons/'+record.get('logo')
,src: service.get('url')
,type: service.get('type')
,align: formValues.align
,notifications: formValues.notifications
,muted: formValues.muted
,record: service
,tabConfig: {
service: service
}
};
if ( formValues.align === 'left' ) {
var tbfill = me.getView().getTabBar().down('tbfill');
me.getView().insert(me.getView().getTabBar().items.indexOf(tbfill), tabData).show();
} else {
me.getView().add(tabData).show();
}
}
win.close();
@ -301,6 +313,8 @@ Ext.define('Rambox.view.main.MainController', {
,onNewServiceSelect: function( view, record, item, index, e ) {
if ( record.get('url').indexOf('___') >= 0 ) {
this.showCustomModal(record);
} else if ( record.get('type') === 'custom' ) {
this.addCustomService(record, false);
} else {
this.showSimpleModal(record, false);
}
@ -355,14 +369,18 @@ Ext.define('Rambox.view.main.MainController', {
}
,configureService: function( gridView, rowIndex, colIndex, col, e, rec, rowEl ) {
this.showSimpleModal(rec, true);
if ( rec.get('type') === 'custom' ) {
this.addCustomService(rec, true);
} else {
this.showSimpleModal(rec, true);
}
}
,addCustomService: function( event, toolEl, owner, tool ) {
,addCustomService: function( record, edit ) {
var me = this;
var win = Ext.create('Ext.window.Window', {
title: 'Add Custom Service'
title: (edit ? 'Edit ' : 'Add ') + 'Custom Service'
,modal: true
,width: 400
,resizable: false
@ -376,6 +394,7 @@ Ext.define('Rambox.view.main.MainController', {
xtype: 'textfield'
,fieldLabel: 'Name'
,name: 'serviceName'
,value: (edit ? record.get('name') : '')
,allowBlank: true
,listeners: {
specialkey: function(field, e) {
@ -391,6 +410,7 @@ Ext.define('Rambox.view.main.MainController', {
,emptyText: 'http://service.url.com'
,name: 'url'
,vtype: 'url'
,value: (edit ? record.get('url') : '')
,allowBlank: false
,listeners: {
specialkey: function(field, e) {
@ -406,6 +426,7 @@ Ext.define('Rambox.view.main.MainController', {
,emptyText: 'http://image.url.com/image.png'
,name: 'logo'
,vtype: 'url'
,value: (edit ? record.get('logo') : '')
,allowBlank: true
,listeners: {
specialkey: function(field, e) {
@ -423,7 +444,7 @@ Ext.define('Rambox.view.main.MainController', {
{
xtype: 'checkbox'
,boxLabel: 'Align to Right'
,checked: false
,checked: edit ? (record.get('align') === 'right' ? true : false) : false
,name: 'align'
,uncheckedValue: 'left'
,inputValue: 'right'
@ -432,7 +453,7 @@ Ext.define('Rambox.view.main.MainController', {
xtype: 'checkbox'
,boxLabel: 'Show notifications'
,name: 'notifications'
,checked: true
,checked: edit ? record.get('notifications') : true
,uncheckedValue: false
,inputValue: true
}
@ -440,7 +461,7 @@ Ext.define('Rambox.view.main.MainController', {
xtype: 'checkbox'
,boxLabel: 'Mute all sounds'
,name: 'muted'
,checked: false
,checked: edit ? record.get('muted') : false
,uncheckedValue: false
,inputValue: true
}
@ -455,11 +476,11 @@ Ext.define('Rambox.view.main.MainController', {
,items: [
{
xtype: 'textarea'
,fieldLabel: 'Unread Code'
,fieldLabel: 'Unread Code (<a href="https://github.com/saenzramiro/rambox/wiki/Add-a-Custom-Service" target="_blank">read more</a>)'
,allowBlank: true
,name: 'js_unread'
,value: (edit ? record.get('js_unread') : '')
,anchor: '100%'
,emptyText: 'Write code here if the service don\'t update the page title when have new activity. The code needs to return an integer, for example: document.body.getElementsByClassName("ee").length;'
,height: 120
}
]
@ -477,47 +498,68 @@ Ext.define('Rambox.view.main.MainController', {
}
,'->'
,{
text: 'Add service'
text: (edit ? 'Edit ' : 'Add ') + ' Service'
,itemId: 'submit'
,handler: function() {
if ( !win.down('form').isValid() ) return false;
var formValues = win.down('form').getValues();
var service = Ext.create('Rambox.model.Service', {
type: 'custom'
,logo: formValues.logo
,name: formValues.serviceName
,url: formValues.url
,align: formValues.align
,notifications: formValues.notifications
,muted: formValues.muted
,js_unread: 'function checkUnread(){updateBadge(' + formValues.js_unread + ')}function updateBadge(e){e>=1?document.title="("+e+") "+originalTitle:document.title=originalTitle}var originalTitle=document.title;setInterval(checkUnread,3000);'
});
service.save();
Ext.getStore('Services').add(service);
var tabData = {
xtype: 'webview'
,id: 'tab_'+service.get('id')
,title: service.get('name')
,icon: formValues.logo
,src: service.get('url')
,type: service.get('type')
,align: formValues.align
,notifications: formValues.notifications
,muted: formValues.muted
,record: service
,tabConfig: {
service: service
}
};
if ( edit ) {
// If users change the URL, we change the URL of the Webview
if ( record.get('url') !== formValues.url ) Ext.getCmp('tab_'+record.get('id')).down('component').el.dom.loadURL(formValues.url);
// Save the service
record.set({
name: formValues.serviceName
,url: formValues.url
,logo: formValues.logo
,align: formValues.align
,notifications: formValues.notifications
,muted: formValues.muted
,js_unread: formValues.js_unread
});
if ( formValues.align === 'left' ) {
var tbfill = me.getView().getTabBar().down('tbfill');
me.getView().insert(me.getView().getTabBar().items.indexOf(tbfill), tabData).show();
// Change the title of the Tab
Ext.getCmp('tab_'+record.get('id')).setTitle(formValues.serviceName);
// Change the icon of the Tab
Ext.getCmp('tab_'+record.get('id')).setIcon(record.get('logo') === '' ? 'resources/icons/custom.png' : record.get('logo'));
} else {
me.getView().add(tabData).show();
var service = Ext.create('Rambox.model.Service', {
type: 'custom'
,logo: formValues.logo
,name: formValues.serviceName
,url: formValues.url
,align: formValues.align
,notifications: formValues.notifications
,muted: formValues.muted
,js_unread: formValues.js_unread !== '' ? 'function checkUnread(){updateBadge(' + formValues.js_unread + ')}function updateBadge(e){e>=1?document.title="("+e+") "+originalTitle:document.title=originalTitle}var originalTitle=document.title;setInterval(checkUnread,3000);' : ''
});
service.save();
Ext.getStore('Services').add(service);
var tabData = {
xtype: 'webview'
,id: 'tab_'+service.get('id')
,title: service.get('name')
,icon: formValues.logo
,src: service.get('url')
,type: service.get('type')
,align: formValues.align
,notifications: formValues.notifications
,muted: formValues.muted
,record: service
,tabConfig: {
service: service
}
};
if ( formValues.align === 'left' ) {
var tbfill = me.getView().getTabBar().down('tbfill');
me.getView().insert(me.getView().getTabBar().items.indexOf(tbfill), tabData).show();
} else {
me.getView().add(tabData).show();
}
}
win.close();
@ -537,7 +579,7 @@ Ext.define('Rambox.view.main.MainController', {
,onSearchEnter: function( field, e ) {
var me = this;
if ( e.getKey() == e.ENTER && Ext.getStore('ServicesList').getCount() === 1 ) {
if ( e.getKey() == e.ENTER && Ext.getStore('ServicesList').getCount() === 2 ) { // Two because we always shows Custom Service option
me.onNewServiceSelect(field.up().down('dataview'), Ext.getStore('ServicesList').getAt(0));
me.onClearClick(field);
}
@ -548,7 +590,7 @@ Ext.define('Rambox.view.main.MainController', {
Ext.getStore('ServicesList').getFilters().replaceAll({
fn: function(record) {
return Ext.Array.contains(Ext.Object.getKeys(cg.getValue()), record.get('type'));
return Ext.Array.contains(Ext.Object.getKeys(cg.getValue()), record.get('type')) || record.get('type') === 'custom';
}
});
}
@ -562,6 +604,7 @@ Ext.define('Rambox.view.main.MainController', {
Ext.getStore('ServicesList').getFilters().replaceAll({
fn: function(record) {
if ( record.get('type') === 'custom' ) return true;
if ( !Ext.Array.contains(Ext.Object.getKeys(cg.getValue()), record.get('type')) ) return false;
return record.get('name').toLowerCase().indexOf(newValue.toLowerCase()) > -1 ? true : false;
}

4
electron/autoupdater.js

@ -13,7 +13,7 @@ const feedUrl = `https://getrambox.herokuapp.com/update/${process.platform}/${ap
exports.check = win => {
if ( isDev ) return;
/*
autoUpdater.on('update-available', function() {
dialog.showMessageBox({
message: 'New version'
@ -21,7 +21,7 @@ exports.check = win => {
,buttons: ['Ok']
});
});
*/
autoUpdater.on('update-downloaded', function(e, releaseNotes, releaseName, releaseDate, updateURL) {
var index = dialog.showMessageBox({
message: 'A new update is ready to install'

22
electron/main.js

@ -13,6 +13,8 @@ const appMenu = require('./menu');
const tray = require('./tray');
// Require for autpUpdate file
const autoupdater = require('./autoupdater');
// Window State Plugin
const windowStateKeeper = require('electron-window-state');
const MenuItem = electron.MenuItem;
@ -91,11 +93,21 @@ let mainWindow;
let isQuitting = false;
function createWindow () {
// Create the browser window.
// Load the previous state with fallback to defaults
let mainWindowState = windowStateKeeper({
defaultWidth: 1000
,defaultHeight: 800
,maximize: true
});
// Create the browser window using the state information
mainWindow = new BrowserWindow({
title: 'Rambox'
,skipTaskbar: false
,icon: __dirname + '/../resources/Icon.png'
,x: mainWindowState.x
,y: mainWindowState.y
,width: mainWindowState.width
,height: mainWindowState.height
,webPreferences: {
webSecurity: false
,nodeIntegration: true
@ -104,10 +116,12 @@ function createWindow () {
}
});
process.setMaxListeners(100);
// Let us register listeners on the window, so we can update the state
// automatically (the listeners will be removed when the window is closed)
// and restore the maximized or full screen state
mainWindowState.manage(mainWindow);
// Start maximize
mainWindow.maximize();
process.setMaxListeners(100);
// and load the index.html of the app.
mainWindow.loadURL('file://' + __dirname + '/../index.html');

10
electron/menu.js

@ -122,7 +122,7 @@ let tpl = [
label: 'Close',
accelerator: 'CmdOrCtrl+W',
role: 'close'
},
}
]
},
{
@ -137,7 +137,9 @@ if (process.platform === 'darwin') {
submenu: [
{
label: `About ${appName}`,
role: 'about'
click() {
sendAction('showAbout')
}
},
{
type: 'separator'
@ -194,7 +196,9 @@ if (process.platform === 'darwin') {
});
helpSubmenu.push({
label: `About ${appName}`,
role: 'about'
click() {
sendAction('showAbout')
}
});
}

3
package.json

@ -101,7 +101,6 @@
}
},
"dependencies": {
"firebase": "^3.0.5",
"firebase-token-generator": "^2.0.0"
}
}

14
packages/local/rambox-default-theme/sass/src/LoadMask.scss

@ -0,0 +1,14 @@
.bottomMask {
bottom: 0;
height: 32px;
position: fixed;
top: auto !important;
left: 0 !important;
width: 120px;
.x-mask-msg-text {
padding: 0 0 0 24px;
background-image: url(images/loadmask/loading.gif);
background-repeat: no-repeat;
background-position: 0 0;
}
}

BIN
resources/icons/custom.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

BIN
resources/icons/freenode.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

BIN
resources/icons/icq.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
resources/icons/mysms.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

BIN
resources/icons/outlook365.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

BIN
resources/icons/tweetdeck.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

BIN
resources/icons/zinc.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Loading…
Cancel
Save