Browse Source

EOL: Thank you, thank you, thank you, thank you

❤❤❤❤
master 0.8.0
Ramiro Saenz 3 years ago
parent
commit
0669dafde5
  1. 2
      .gitignore
  2. 16
      CONTRIBUTING.md
  3. 2
      README.md
  4. 6
      app.js
  5. 8
      app.json
  6. 108
      app/Application.js
  7. 2
      app/store/ServicesList.js
  8. 298
      app/ux/Auth0.js
  9. 23
      app/ux/WebView.js
  10. 2
      app/view/add/Add.js
  11. 135
      app/view/main/Main.js
  12. 56
      app/view/main/MainController.js
  13. 94
      app/view/preferences/Preferences.js
  14. 2
      app/view/preferences/PreferencesController.js
  15. 4
      electron/main.js
  16. 28
      electron/menu.js
  17. 4
      electron/tray.js
  18. 12
      electron/updater.js
  19. 5
      env-sample.js
  20. 14
      package.json
  21. 5
      packages/local/rambox-default-theme/sass/etc/all.scss
  22. 146
      resources/css/screenselector.css
  23. BIN
      resources/icons/airdroid.png
  24. BIN
      resources/icons/androidmessages.png
  25. BIN
      resources/icons/aol.png
  26. BIN
      resources/icons/awsworkmail.png
  27. BIN
      resources/icons/bearychat.png
  28. BIN
      resources/icons/bip.png
  29. BIN
      resources/icons/calendar.png
  30. BIN
      resources/icons/chatwork.png
  31. BIN
      resources/icons/cliq.png
  32. BIN
      resources/icons/converse.png
  33. BIN
      resources/icons/crisp.png
  34. BIN
      resources/icons/devrant.png
  35. BIN
      resources/icons/dingtalk.png
  36. BIN
      resources/icons/discord.png
  37. BIN
      resources/icons/drift.png
  38. BIN
      resources/icons/duo.png
  39. BIN
      resources/icons/element.png
  40. BIN
      resources/icons/facebook.png
  41. BIN
      resources/icons/fastmail.png
  42. BIN
      resources/icons/fleep.png
  43. BIN
      resources/icons/flock.png
  44. BIN
      resources/icons/flowdock.png
  45. BIN
      resources/icons/freenode.png
  46. BIN
      resources/icons/gadugadu.png
  47. BIN
      resources/icons/gitter.png
  48. BIN
      resources/icons/glip.png
  49. BIN
      resources/icons/glowingbear.png
  50. BIN
      resources/icons/gmail.png
  51. BIN
      resources/icons/googledrive.png
  52. BIN
      resources/icons/googlevoice.png
  53. BIN
      resources/icons/grape.png
  54. BIN
      resources/icons/groupme.png
  55. BIN
      resources/icons/guilded.png
  56. BIN
      resources/icons/hangouts.png
  57. BIN
      resources/icons/hangoutschat.png
  58. BIN
      resources/icons/hibox.png
  59. BIN
      resources/icons/honeypot.png
  60. BIN
      resources/icons/hootsuite.png
  61. BIN
      resources/icons/horde.png
  62. BIN
      resources/icons/hushmail.png
  63. BIN
      resources/icons/icloudmail.png
  64. BIN
      resources/icons/icq.png
  65. BIN
      resources/icons/inbox.png
  66. BIN
      resources/icons/instagramdirect.png
  67. BIN
      resources/icons/intercom.png
  68. BIN
      resources/icons/irccloud.png
  69. BIN
      resources/icons/jandi.png
  70. BIN
      resources/icons/kaiwa.png
  71. BIN
      resources/icons/kezmo.png
  72. BIN
      resources/icons/kiwi.png
  73. BIN
      resources/icons/kune.png
  74. BIN
      resources/icons/linkedin.png
  75. BIN
      resources/icons/lounge.png
  76. BIN
      resources/icons/mailru.png
  77. BIN
      resources/icons/mastodon.png
  78. BIN
      resources/icons/mattermost.png
  79. BIN
      resources/icons/messenger.png
  80. BIN
      resources/icons/messengerpages.png
  81. BIN
      resources/icons/mightytext.png
  82. BIN
      resources/icons/missive.png
  83. BIN
      resources/icons/movim.png
  84. BIN
      resources/icons/mysms.png
  85. BIN
      resources/icons/noysi.png
  86. BIN
      resources/icons/okru.png
  87. BIN
      resources/icons/openmailbox.png
  88. BIN
      resources/icons/outlook.png
  89. BIN
      resources/icons/outlook365.png
  90. BIN
      resources/icons/protonmail.png
  91. BIN
      resources/icons/protonmailch.png
  92. BIN
      resources/icons/pushbullet.png
  93. BIN
      resources/icons/rainloop.png
  94. BIN
      resources/icons/reddit.png
  95. BIN
      resources/icons/riot.png
  96. BIN
      resources/icons/rocketchat.png
  97. BIN
      resources/icons/roundcube.png
  98. BIN
      resources/icons/ryver.png
  99. BIN
      resources/icons/sandstorm.png
  100. BIN
      resources/icons/simplenote.png
  101. Some files were not shown because too many files have changed in this diff Show More

2
.gitignore vendored

@ -34,7 +34,5 @@ npm-debug.log
# Vagrant # Vagrant
.vagrant/ .vagrant/
env.js
rambox_cfg.json
languages.js languages.js
electron/dev-app-update.yml electron/dev-app-update.yml

16
CONTRIBUTING.md

@ -122,22 +122,6 @@ Once you have rambox cloned, before you start the application, you first need to
npm install npm install
``` ```
Then you need to add the private environment variables (API Keys):
```bash
# Copy `env-sample.js` with a name of env.js
# Populate it with Auth0 clientid and domain e.g. test.auth0.com
# You can get these details from one of your "apps" here https://manage.auth0.com/#/clients/
# macOS / Linux
cp env-sample.js env.js
# Windows
copy env-sample.js env.js
```
Then edit the `env.js` file and modify the API keys only for services that you will use.
```bash ```bash
# Compile the files... # Compile the files...
sencha app watch sencha app watch

2
README.md

@ -110,8 +110,6 @@ Fork and work!
```shell ```shell
git clone https://github.com/saenzramiro/rambox.git git clone https://github.com/saenzramiro/rambox.git
cd rambox cd rambox
cp env-sample.js env.js
# update env.js with your auth0 details.
npm install npm install
sencha app watch sencha app watch
npm start npm start

6
app.js

@ -61,18 +61,18 @@ ipc.on('autoUpdater:update-downloaded', function(e, info) {
'->' '->'
,{ ,{
xtype: 'label' xtype: 'label'
,html: '<b>New version ready to install ('+info.version+')!</b> It will be installed the next time Rambox is relaunched.' ,html: '<b>New version is ready to be installed ('+info.version+')!</b> Click the following button to install it now.'
} }
,{ ,{
xtype: 'button' xtype: 'button'
,text: 'Relaunch Now' ,text: 'Install now'
,handler: function(btn) { ipc.send('autoUpdater:quit-and-install'); } ,handler: function(btn) { ipc.send('autoUpdater:quit-and-install'); }
} }
,{ ,{
xtype: 'button' xtype: 'button'
,text: 'Changelog' ,text: 'Changelog'
,ui: 'decline' ,ui: 'decline'
,href: 'https://github.com/ramboxapp/community-edition/releases/tag/'+info.version ,href: 'https://github.com/ramboxapp/download/releases/latest'
} }
,'->' ,'->'
,{ ,{

8
app.json

@ -109,10 +109,6 @@
{ {
"path": "resources/js/loadscreen.js" "path": "resources/js/loadscreen.js"
}, },
{
"path": "env.js",
"remote": true
},
{ {
"path": "app.js", "path": "app.js",
"bundle": true "bundle": true
@ -291,10 +287,10 @@
*/ */
"resources": [ "resources": [
"electron", "electron",
"env.js",
"package.json", "package.json",
"package-lock.json", "package-lock.json",
"masterpassword.html" "masterpassword.html",
"screenselector.html"
], ],
/** /**

108
app/Application.js

@ -4,8 +4,7 @@ Ext.define('Rambox.Application', {
,name: 'Rambox' ,name: 'Rambox'
,requires: [ ,requires: [
'Rambox.ux.Auth0' 'Rambox.util.MD5'
,'Rambox.util.MD5'
,'Ext.window.Toast' ,'Ext.window.Toast'
,'Ext.util.Cookies' ,'Ext.util.Cookies'
] ]
@ -134,47 +133,20 @@ Ext.define('Rambox.Application', {
] ]
}); });
} }
// Prevent track if the user have disabled this option (default: false)
if ( !ipc.sendSync('sendStatistics') ) {
ga_storage = {
_enableSSL: Ext.emptyFn
,_disableSSL: Ext.emptyFn
,_setAccount: Ext.emptyFn
,_setDomain: Ext.emptyFn
,_setLocale: Ext.emptyFn
,_setCustomVar: Ext.emptyFn
,_deleteCustomVar: Ext.emptyFn
,_trackPageview: Ext.emptyFn
,_trackEvent: Ext.emptyFn
}
}
// Set Google Analytics events
ga_storage._setAccount('UA-80680424-1');
ga_storage._trackPageview('/index.html', 'main');
ga_storage._trackEvent('Versions', require('electron').remote.app.getVersion());
// Load language for Ext JS library // Load language for Ext JS library
Ext.Loader.loadScript({url: Ext.util.Format.format("ext/packages/ext-locale/build/ext-locale-{0}.js", localStorage.getItem('locale-auth0') || 'en')}); Ext.Loader.loadScript({url: Ext.util.Format.format("ext/packages/ext-locale/build/ext-locale-{0}.js", localStorage.getItem('locale-extjs') || 'en')});
// Initialize Auth0 // Set Google URLs
if ( auth0Cfg.clientID !== '' && auth0Cfg.domain !== '' ) Rambox.ux.Auth0.init(); Rambox.app.config.googleURLs = [
"accounts.google.com/ServiceLogin",
// Set cookies to help Tooltip.io messages segmentation "accounts.google.com/signin",
Ext.util.Cookies.set('version', require('electron').remote.app.getVersion()); "accounts.google.com/_/lookup/accountlookup",
if ( Ext.util.Cookies.get('auth0') === null ) Ext.util.Cookies.set('auth0', false); "accounts.google.com/o/oauth2",
"accounts.google.com/_/signin",
// Check for updates "accounts.google.com/AddSession?",
if ( require('electron').remote.process.argv.indexOf('--without-update') === -1 ) Rambox.app.checkUpdate(true); "accounts.google.com/_/"
];
// Get Google URLs
Ext.Ajax.request({
url: 'https://raw.githubusercontent.com/ramboxapp/community-edition/gh-pages/api/google.json'
,method: 'GET'
,success: function(response) {
Rambox.app.config.googleURLs = Ext.decode(response.responseText);
}
});
// Shortcuts // Shortcuts
const platform = require('electron').remote.process.platform; const platform = require('electron').remote.process.platform;
@ -275,60 +247,6 @@ Ext.define('Rambox.Application', {
} }
,checkUpdate: function(silence) { ,checkUpdate: function(silence) {
console.info('Checking for updates...');
Ext.Ajax.request({
url: 'https://api.github.com/repos/ramboxapp/community-edition/releases/latest'
,method: 'GET'
,success: function(response) {
var json = Ext.decode(response.responseText);
var appVersion = new Ext.Version(require('electron').remote.app.getVersion());
if ( appVersion.isLessThan(json.name) && !json.draft && !json.prerelease ) {
console.info('New version is available', json.version);
Ext.cq1('app-main').addDocked({
xtype: 'toolbar'
,dock: 'top'
,ui: 'newversion'
,items: [
'->'
,{
xtype: 'label'
,html: '<b>'+locale['app.update[0]']+'</b> ('+json.version+')' + ( process.platform === 'win32' ? ' is downloading in the background and you will be notified when it is ready to be installed.' : '' )
}
,{
xtype: 'button'
,text: locale['app.update[1]']
,href: process.platform === 'darwin' ? 'https://getrambox.herokuapp.com/download/'+process.platform+'_'+process.arch : 'https://github.com/ramboxapp/community-edition/releases/latest'
,hidden: process.platform === 'win32'
}
,{
xtype: 'button'
,text: locale['app.update[2]']
,ui: 'decline'
,tooltip: 'Click here to see more information about the new version.'
,href: 'https://github.com/ramboxapp/community-edition/releases/tag/'+json.version
}
,'->'
,{
glyph: 'xf00d@FontAwesome'
,baseCls: ''
,style: 'cursor:pointer;'
,handler: function(btn) { Ext.cq1('app-main').removeDocked(btn.up('toolbar'), true); }
}
]
});
ipc.send('autoUpdater:check-for-updates'); ipc.send('autoUpdater:check-for-updates');
return;
} else if ( !silence ) {
Ext.Msg.show({
title: locale['app.update[3]']
,message: locale['app.update[4]']
,icon: Ext.Msg.INFO
,buttons: Ext.Msg.OK
});
}
console.info('Your version is the latest. No need to update.');
}
});
} }
}); });

2
app/store/ServicesList.js

@ -10,7 +10,7 @@ Ext.define('Rambox.store.ServicesList', {
,proxy: { ,proxy: {
type: 'ajax', type: 'ajax',
url: 'https://raw.githubusercontent.com/ramboxapp/community-edition/gh-pages/api/services.json', url: 'resources/services.json',
reader: { reader: {
type: 'json', type: 'json',
rootProperty: 'responseText' rootProperty: 'responseText'

298
app/ux/Auth0.js

@ -1,298 +0,0 @@
Ext.define('Rambox.ux.Auth0', {
singleton: true
// private
,lock: null
,auth0: null
,authService: null
,backupCurrent: false
,init: function() {
var me = this;
var Auth0 = require('auth0-js');
var _AuthService = require('./resources/js/AuthService');
me.authService = new _AuthService.default({
clientId: auth0Cfg.clientID,
authorizeEndpoint: 'https://'+auth0Cfg.domain+'/authorize',
audience: 'https://'+auth0Cfg.domain+'/userinfo',
scope: 'openid profile offline_access',
redirectUri: 'https://'+auth0Cfg.domain+'/mobile',
tokenEndpoint: 'https://'+auth0Cfg.domain+'/oauth/token'
});
me.auth0 = new Auth0.WebAuth({ clientID: auth0Cfg.clientID, domain : auth0Cfg.domain });
//me.defineEvents();
}
,onLogin: function(token, authWindow) {
var me = this;
authWindow.close();
me.auth0.client.userInfo(token.access_token, function(err, profile) {
if ( err ) {
if ( err.error === 401 || err.error === 'Unauthorized' ) return me.renewToken(me.checkConfiguration);
Ext.Msg.hide();
return Ext.Msg.show({
title: 'Error'
,message: 'There was an error getting the profile: ' + err.error_description
,icon: Ext.Msg.ERROR
,buttons: Ext.Msg.OK
});
}
profile.user_metadata = profile['https://rambox.pro/user_metadata'];
delete profile['https://rambox.pro/user_metadata'];
// Display a spinner while waiting
Ext.Msg.wait(locale['app.window[29]'], locale['app.window[28]']);
// Google Analytics Event
ga_storage._trackEvent('Users', 'loggedIn');
// Set cookies to help Tooltip.io messages segmentation
Ext.util.Cookies.set('auth0', true);
// User is logged in
// Save the profile and JWT.
localStorage.setItem('profile', JSON.stringify(profile));
localStorage.setItem('access_token', token.access_token);
localStorage.setItem('id_token', token.id_token);
localStorage.setItem('refresh_token', token.refresh_token);
if ( !Ext.isEmpty(profile.user_metadata) && !Ext.isEmpty(profile.user_metadata.services) && !me.backupCurrent ) {
Ext.each(profile.user_metadata.services, function(s) {
var service = Ext.create('Rambox.model.Service', s);
service.save();
Ext.getStore('Services').add(service);
});
require('electron').remote.app.relaunch();
require('electron').remote.app.exit();
}
Ext.Msg.hide();
Ext.cq1('app-main').getViewModel().set('username', profile.name);
Ext.cq1('app-main').getViewModel().set('avatar', profile.picture);
});
}
,backupConfiguration: function(callback) {
var me = this;
Ext.Msg.wait('Saving backup...', 'Please wait...');
// Getting all services
var lastupdate = (new Date()).toJSON();
var services = [];
Ext.getStore('Services').each(function(service) {
var s = Ext.clone(service);
delete s.data.id;
delete s.data.zoomLevel;
services.push(s.data);
});
Ext.Ajax.request({
url: 'https://rambox.auth0.com/api/v2/users/'+Ext.decode(localStorage.getItem('profile')).sub
,method: 'PATCH'
,headers: { authorization: "Bearer " + localStorage.getItem('id_token') }
,jsonData: { user_metadata: { services: services, services_lastupdate: lastupdate } }
,success: function(response) {
Ext.Msg.hide();
// Save the last update in localStorage
var profile = Ext.decode(localStorage.getItem('profile'));
if ( !profile.user_metadata ) profile.user_metadata = {};
profile.user_metadata.services_lastupdate = lastupdate;
localStorage.setItem('profile', Ext.encode(profile));
Ext.cq1('app-main').getViewModel().set('last_sync', new Date(lastupdate).toUTCString());
Ext.toast({
html: '<i class="fa fa-check fa-3x fa-pull-left" aria-hidden="true"></i> Your configuration were successfully backed up.'
,title: 'Synchronize Configuration'
,width: 300
,align: 't'
,closable: false
});
if ( Ext.isFunction(callback) ) callback.bind(me)();
}
,failure: function(response) {
if ( response.status === 401 ) return me.renewToken(me.backupConfiguration);
Ext.Msg.hide();
Ext.toast({
html: '<i class="fa fa-times fa-3x fa-pull-left" aria-hidden="true"></i> Error occurred when trying to backup your configuration.'
,title: 'Synchronize Configuration'
,width: 300
,align: 't'
,closable: false
});
if ( Ext.isFunction(callback) ) callback.bind(me)();
console.error(response);
}
});
}
,restoreConfiguration: function() {
var me = this;
me.auth0.client.userInfo(localStorage.getItem('access_token'), function(err, profile) {
if ( err ) {
if ( err.code === 401 ) return me.renewToken(me.restoreConfiguration);
return Ext.Msg.show({
title: 'Error'
,message: 'There was an error getting the profile: ' + err.description
,icon: Ext.Msg.ERROR
,buttons: Ext.Msg.OK
});
}
profile.user_metadata = profile['https://rambox.pro/user_metadata'];
delete profile['https://rambox.pro/user_metadata'];
// First we remove all current services
Ext.cq1('app-main').getController().removeAllServices(false, function() {
if ( !profile.user_metadata || !profile.user_metadata.services ) return;
Ext.each(profile.user_metadata.services, function(s) {
var service = Ext.create('Rambox.model.Service', s);
service.save();
Ext.getStore('Services').add(service);
});
require('electron').remote.getCurrentWindow().reload();
});
});
}
,checkConfiguration: function() {
var me = this;
me.auth0.client.userInfo(localStorage.getItem('access_token'), function(err, profile) {
if ( err ) {
if ( err.code === 401 ) return me.renewToken(me.checkConfiguration);
return Ext.Msg.show({
title: 'Error'
,message: 'There was an error getting the profile: ' + err.description
,icon: Ext.Msg.ERROR
,buttons: Ext.Msg.OK
});
}
profile.user_metadata = profile['https://rambox.pro/user_metadata'];
delete profile['https://rambox.pro/user_metadata'];
if ( !profile.user_metadata ) {
Ext.toast({
html: 'You don\'t have any backup yet.'
,title: 'Synchronize Configuration'
,width: 300
,align: 't'
,closable: false
});
return;
}
if ( Math.floor(new Date(profile.user_metadata.services_lastupdate) / 1000) > Math.floor(new Date(Ext.decode(localStorage.getItem('profile')).user_metadata.services_lastupdate) / 1000) ) {
Ext.toast({
html: 'Your settings are out of date.'
,title: 'Synchronize Configuration'
,width: 300
,align: 't'
,closable: false
});
} else {
Ext.toast({
html: '<i class="fa fa-check fa-3x fa-pull-left" aria-hidden="true"></i> Latest backup is already applied.'
,title: 'Synchronize Configuration'
,width: 300
,align: 't'
,closable: false
});
}
});
}
,renewToken: function(callback) {
var me = this;
Ext.Ajax.request({
url: 'https://rambox.auth0.com/oauth/token'
,method: 'POST'
,jsonData: {
grant_type: 'refresh_token'
,client_id: auth0Cfg.clientID
,client_secret: auth0Cfg.clientSecret
,refresh_token: localStorage.getItem('refresh_token')
,api_type: 'app'
}
,success: function(response) {
var json = Ext.decode(response.responseText);
localStorage.setItem('access_token', json.access_token);
localStorage.setItem('id_token', json.id_token);
if ( Ext.isFunction(callback) ) callback.bind(me)();
}
,failure: function(response) {
console.error(response);
}
});
}
,login: function() {
var me = this;
var electron = require('electron').remote;
var authWindow = new electron.BrowserWindow({
title: 'Rambox - Login'
,width: 400
,height: 600
,maximizable: false
,minimizable: false
,resizable: true
,closable: true
,center: true
,autoHideMenuBar: true
,skipTaskbar: true
,fullscreenable: false
,parent: require('electron').remote.getCurrentWindow()
,webPreferences: {
partition: 'persist:rambox'
}
});
authWindow.on('closed', function() {
authWindow = null;
});
authWindow.loadURL(me.authService.requestAuthCode());
authWindow.webContents.on('did-start-loading', function(e) {
authWindow.webContents.session.webRequest.onBeforeSendHeaders((details, callback) => {
Rambox.app.config.googleURLs.forEach((loginURL) => {
if ( details.url.indexOf(loginURL) > -1 ) details.requestHeaders['User-Agent'] = 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:70.0) Gecko/20100101 Firefox/70.0' })
callback({ cancel: false, requestHeaders: details.requestHeaders });
});
});
authWindow.webContents.on('did-navigate', function(e, url) {
me.authService.requestAccessCode(url, me.onLogin.bind(me), authWindow);
});
}
,logout: function() {
var me = this;
localStorage.removeItem('profile');
localStorage.removeItem('id_token');
localStorage.removeItem('refresh_token');
localStorage.removeItem('access_token');
// Set cookies to help Tooltip.io messages segmentation
Ext.util.Cookies.set('auth0', false);
}
});

23
app/ux/WebView.js

@ -39,7 +39,7 @@ Ext.define('Rambox.ux.WebView',{
Ext.apply(me, { Ext.apply(me, {
items: me.webViewConstructor() items: me.webViewConstructor()
,title: prefConfig.hide_tabbar_labels ? '' : (me.record.get('tabname') ? me.record.get('name') : '') ,title: prefConfig.hide_tabbar_labels ? '' : (me.record.get('tabname') ? me.record.get('name') : '')
,icon: me.record.get('type') === 'custom' ? (me.record.get('logo') === '' ? 'resources/icons/custom.png' : me.record.get('logo')) : 'https://firebasestorage.googleapis.com/v0/b/rambox-d1326.appspot.com/o/services%2F'+me.record.get('logo')+'?alt=media' ,icon: me.record.get('type') === 'custom' ? (me.record.get('logo') === '' ? 'resources/icons/custom.png' : me.record.get('logo')) : 'resources/icons/'+me.record.get('logo')
,src: me.record.get('url') ,src: me.record.get('url')
,type: me.record.get('type') ,type: me.record.get('type')
,align: me.record.get('align') ,align: me.record.get('align')
@ -274,24 +274,23 @@ Ext.define('Rambox.ux.WebView',{
var webview = me.getWebView(); var webview = me.getWebView();
me.errorCodeLog = [] me.errorCodeLog = []
// Google Analytics Event
ga_storage._trackEvent('Services', 'load', me.type, 1, true);
// Notifications in Webview // Notifications in Webview
me.setNotifications(localStorage.getItem('locked') || JSON.parse(localStorage.getItem('dontDisturb')) ? false : me.record.get('notifications')); me.setNotifications(localStorage.getItem('locked') || JSON.parse(localStorage.getItem('dontDisturb')) ? false : me.record.get('notifications'));
require('electron').remote.session.fromPartition('persist:' + me.record.get('type') + '_' + me.id.replace('tab_', '') + (localStorage.getItem('id_token') ? '_' + Ext.decode(localStorage.getItem('profile')).sub : '')).webRequest.onBeforeSendHeaders((details, callback) => {
const change = details.url.match(/^https:\/\/accounts\.google\.com(\/|$)/);
if ( change ) details.requestHeaders['User-Agent'] = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:97.0) Gecko/20100101 Firefox/97.0';
callback({ cancel: false, requestHeaders: details.requestHeaders });
});
// Show and hide spinner when is loading // Show and hide spinner when is loading
webview.addEventListener("did-start-loading", function() { webview.addEventListener("did-start-loading", function() {
console.info('Start loading...', me.src); console.info('Start loading...', me.src);
require('electron').remote.webContents.fromId(webview.getWebContentsId()).session.webRequest.onBeforeSendHeaders((details, callback) => {
Rambox.app.config.googleURLs.forEach((loginURL) => { if ( details.url.indexOf(loginURL) > -1 ) details.requestHeaders['User-Agent'] = 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:70.0) Gecko/20100101 Firefox/70.0'});
callback({ cancel: false, requestHeaders: details.requestHeaders });
});
if ( !me.down('statusbar').closed || !me.down('statusbar').keep ) me.down('statusbar').show(); if ( !me.down('statusbar').closed || !me.down('statusbar').keep ) me.down('statusbar').show();
me.down('statusbar').showBusy(); me.down('statusbar').showBusy();
}); });
webview.addEventListener("did-stop-loading", function() { webview.addEventListener("did-stop-loading", function() {
me.down('statusbar').clearStatus({useDefaults: true}); me.down('statusbar').clearStatus({useDefaults: true});
if ( !me.down('statusbar').keep ) me.down('statusbar').hide(); if ( !me.down('statusbar').keep ) me.down('statusbar').hide();
@ -377,11 +376,13 @@ Ext.define('Rambox.ux.WebView',{
// Open links in default browser // Open links in default browser
webview.addEventListener('new-window', function(e) { webview.addEventListener('new-window', function(e) {
e.preventDefault(); e.preventDefault();
const protocol = require('url').parse(e.url).protocol; const { URL } = require('url');
const url = new URL(e.url);
const protocol = url.protocol;
// Block some Deep links to prevent that open its app (Ex: Slack) // Block some Deep links to prevent that open its app (Ex: Slack)
if ( ['slack:'].includes(protocol) ) return; if ( ['slack:'].includes(protocol) ) return;
// Allow Deep links // Allow Deep links
if ( !['http:', 'https:', 'about:'].includes(protocol) ) return require('electron').shell.openExternal(e.url); if ( !['http:', 'https:', 'about:'].includes(protocol) ) return require('electron').shell.openExternal(url.href);
}); });
webview.addEventListener('will-navigate', function(e, url) { webview.addEventListener('will-navigate', function(e, url) {

2
app/view/add/Add.js

@ -28,7 +28,7 @@ Ext.define('Rambox.view.add.Add',{
var me = this; var me = this;
me.title = (!me.edit ? locale['app.window[0]'] : locale['app.window[1]']) + ' ' + me.record.get('name'); me.title = (!me.edit ? locale['app.window[0]'] : locale['app.window[1]']) + ' ' + me.record.get('name');
me.icon = me.record.get('type') === 'custom' ? (!me.edit ? 'resources/icons/custom.png' : (me.record.get('logo') === '' ? 'resources/icons/custom.png' : me.record.get('logo'))) : 'https://firebasestorage.googleapis.com/v0/b/rambox-d1326.appspot.com/o/services%2F'+me.record.get('logo')+'?alt=media'; me.icon = me.record.get('type') === 'custom' ? (!me.edit ? 'resources/icons/custom.png' : (me.record.get('logo') === '' ? 'resources/icons/custom.png' : me.record.get('logo'))) : 'resources/icons/'+me.record.get('logo');
me.items = [ me.items = [
{ {
xtype: 'form' xtype: 'form'

135
app/view/main/Main.js

@ -28,13 +28,6 @@ Ext.define('Rambox.view.main.Main', {
,tabBar: { ,tabBar: {
id: 'mainTabBar' id: 'mainTabBar'
,cls: JSON.parse(localStorage.getItem('dontDisturb')) ? 'dontdisturb' : '' ,cls: JSON.parse(localStorage.getItem('dontDisturb')) ? 'dontdisturb' : ''
,items: [{
xtype: 'button'
,html: '<span class="fa fa-heart" style="color:red;font-size:16px;cursor:pointer;padding:0 5px;"></span>'
,baseCls: ''
,tooltip: locale['app.main[25]']
,href: 'https://rambox.app/donate.html'
}]
} }
,items: [ ,items: [
{ {
@ -110,7 +103,7 @@ Ext.define('Rambox.view.main.Main', {
,tpl: [ ,tpl: [
'<tpl for=".">' '<tpl for=".">'
,'<div class="service" data-qtip="{description}">' ,'<div class="service" data-qtip="{description}">'
,'<img src="https://firebasestorage.googleapis.com/v0/b/rambox-d1326.appspot.com/o/services%2F{logo}?alt=media&token=49036238-8f37-4f08-a7e5-1563be94c36e" width="48" />' ,'<img src="resources/icons/{logo}" width="48" />'
,'<span>{name}</span>' ,'<span>{name}</span>'
,'</div>' ,'</div>'
,'</tpl>' ,'</tpl>'
@ -158,7 +151,7 @@ Ext.define('Rambox.view.main.Main', {
xtype: 'templatecolumn' xtype: 'templatecolumn'
,width: 52 ,width: 52
,variableRowHeight: true ,variableRowHeight: true
,tpl: '<img src="{[ values.type !== \"custom\" ? \"https://firebasestorage.googleapis.com/v0/b/rambox-d1326.appspot.com/o/services%2F\"+values.logo+\"?alt=media\" : (values.logo == \"\" ? \"https://firebasestorage.googleapis.com/v0/b/rambox-d1326.appspot.com/o/services%2Fcustom.png?alt=media\" : values.logo) ]}" data-qtip="{type:capitalize}" width="32" style="{[ values.enabled ? \"-webkit-filter: grayscale(0)\" : \"-webkit-filter: grayscale(1)\" ]}" />' ,tpl: '<img src="{[ values.type !== \"custom\" ? \"resources/icons/\"+values.logo : (values.logo == \"\" ? \"resources/icons/custom.png\" : values.logo) ]}" data-qtip="{type:capitalize}" width="32" style="{[ values.enabled ? \"-webkit-filter: grayscale(0)\" : \"-webkit-filter: grayscale(1)\" ]}" />'
} }
,{ ,{
dataIndex: 'name' dataIndex: 'name'
@ -256,79 +249,8 @@ Ext.define('Rambox.view.main.Main', {
,tooltip: locale['app.main[20]']+'<br/><b>'+locale['app.main[18]']+(require('electron').remote.process.platform === 'darwin' ? ': Cmd + Alt + L</b>' : ': Alt + Shift + L</b>') ,tooltip: locale['app.main[20]']+'<br/><b>'+locale['app.main[18]']+(require('electron').remote.process.platform === 'darwin' ? ': Cmd + Alt + L</b>' : ': Alt + Shift + L</b>')
,handler: 'lockRambox' ,handler: 'lockRambox'
,id: 'lockRamboxBtn' ,id: 'lockRamboxBtn'
},'-'
,{
html: '<span style="color:#FFF;cursor:pointer;"><span class="fa fa-star" style="color:#F8D64E;font-size:16px;padding:0 5px;"></span> Try Rambox Pro</span>'
,href: 'https://rambox.pro/api/download'
,baseCls: ''
} }
,'->' ,'->'
,{
xtype: 'image'
,id: 'avatar'
,bind: {
src: '{avatar}'
,hidden: '{!avatar}'
}
,width: 30
,height: 30
,style: 'border-radius: 50%;border:2px solid #d8d8d8;'
}
,{
id: 'usernameBtn'
,bind: {
text: '{username}'
,hidden: '{!username}'
}
,menu: [
{
text: 'Synchronize Configuration'
,glyph: 'xf0c2@FontAwesome'
,menu: [
{
xtype: 'label'
,bind: {
html: '<b class="menu-title">Last Sync: {last_sync}</b>'
}
}
,{
text: 'Backup'
,glyph: 'xf0ee@FontAwesome'
,scope: Rambox.ux.Auth0
,handler: Rambox.ux.Auth0.backupConfiguration
}
,{
text: 'Restore'
,glyph: 'xf0ed@FontAwesome'
,scope: Rambox.ux.Auth0
,handler: Rambox.ux.Auth0.restoreConfiguration
}
,{
text: 'Check for updated backup'
,glyph: 'xf021@FontAwesome'
,scope: Rambox.ux.Auth0
,handler: Rambox.ux.Auth0.checkConfiguration
}
]
}
,'-'
,{
text: locale['app.main[21]']
,glyph: 'xf08b@FontAwesome'
,handler: 'logout'
}
]
}
,{
text: locale['app.main[22]']
,icon: 'resources/auth0.png'
,id: 'loginBtn'
,tooltip: locale['app.main[23]']+'<br /><br /><i>'+locale['app.main[24]']+' Auth0 (https://auth0.com)</i>'
,bind: {
hidden: '{username}'
}
,handler: 'login'
}
,{ ,{
tooltip: locale['preferences[0]'] tooltip: locale['preferences[0]']
,glyph: 'xf013@FontAwesome' ,glyph: 'xf013@FontAwesome'
@ -336,56 +258,23 @@ Ext.define('Rambox.view.main.Main', {
} }
] ]
} }
,bbar: [ ,bbar: {
{ xtype: 'toolbar'
xtype: 'segmentedbutton' ,cls: 'deprecation'
,allowToggle: false
,items: [ ,items: [
{ '<i class="fa fa-exclamation-triangle" aria-hidden="true"></i> <b>This version of Rambox is no longer supported.</b> We highly recommend that you update to the new version of Rambox which has a free plan with all the features you already use and much more!'
text: '<b>Help us</b> with'
,pressed: true
}
,{
text: locale['app.main[25]']
,glyph: 'xf21e@FontAwesome'
,href: 'https://rambox.app/donate.html'
}
,{
text: 'Translation'
,glyph: 'xf0ac@FontAwesome'
,href: 'https://crowdin.com/project/rambox/invite'
}
]
}
,'->'
,{
xtype: 'label'
,html: '<span class="fa fa-code" style="color:black;"></span> '+locale['app.main[26]']+' <span class="fa fa-heart" style="color:red;"></span> '+locale['app.main[27]'].replace('Argentina', '<img src="resources/flag.png" alt="Argentina" data-qtip="Argentina" />')
}
,'->' ,'->'
,{ ,{
xtype: 'segmentedbutton' xtype: 'button'
,allowToggle: false ,text: 'Migrate now'
,items: [ ,handler: function(btn) {
{ btn.setText('Downloading...');
text: '<b>Follow us</b>' btn.setDisabled(true);
,pressed: true Rambox.app.checkUpdate();
}
,{
glyph: 'xf082@FontAwesome'
,href: 'https://www.facebook.com/ramboxapp'
}
,{
glyph: 'xf099@FontAwesome'
,href: 'https://www.twitter.com/ramboxapp'
} }
,{
glyph: 'xf09b@FontAwesome'
,href: 'https://github.com/ramboxapp/community-edition'
} }
] ]
} }
]
} }
,{ id: 'tbfill', tabConfig : { xtype : 'tbfill' } } ,{ id: 'tbfill', tabConfig : { xtype : 'tbfill' } }
] ]

56
app/view/main/MainController.js

@ -23,9 +23,6 @@ Ext.define('Rambox.view.main.MainController', {
,onTabChange: function( tabPanel, newTab, oldTab ) { ,onTabChange: function( tabPanel, newTab, oldTab ) {
var me = this; var me = this;
// Set Google Analytics event
ga_storage._trackPageview('/index.html', 'main');
localStorage.setItem('last_active_service', newTab.id); localStorage.setItem('last_active_service', newTab.id);
if ( newTab.id === 'ramboxTab' ) { if ( newTab.id === 'ramboxTab' ) {
@ -300,9 +297,6 @@ Ext.define('Rambox.view.main.MainController', {
,dontDisturb: function(btn, e, called) { ,dontDisturb: function(btn, e, called) {
console.info('Dont Disturb:', btn.pressed ? 'Enabled' : 'Disabled'); console.info('Dont Disturb:', btn.pressed ? 'Enabled' : 'Disabled');
// Google Analytics Event
if ( !called ) ga_storage._trackEvent('Usability', 'dontDisturb', ( btn.pressed ? 'on' : 'off' ));
Ext.Array.each(Ext.getStore('Services').collect('id'), function(serviceId) { Ext.Array.each(Ext.getStore('Services').collect('id'), function(serviceId) {
// Get Tab // Get Tab
var tab = Ext.getCmp('tab_'+serviceId); var tab = Ext.getCmp('tab_'+serviceId);
@ -397,9 +391,6 @@ Ext.define('Rambox.view.main.MainController', {
// Save encrypted password in localStorage to show locked when app is reopen // Save encrypted password in localStorage to show locked when app is reopen
localStorage.setItem('locked', text); localStorage.setItem('locked', text);
// Google Analytics Event
ga_storage._trackEvent('Usability', 'locked');
me.lookupReference('disturbBtn').setPressed(true); me.lookupReference('disturbBtn').setPressed(true);
me.dontDisturb(me.lookupReference('disturbBtn'), false, true); me.dontDisturb(me.lookupReference('disturbBtn'), false, true);
@ -487,53 +478,6 @@ Ext.define('Rambox.view.main.MainController', {
} }
,openPreferences: function( btn ) { ,openPreferences: function( btn ) {
var me = this;
Ext.create('Rambox.view.preferences.Preferences').show(); Ext.create('Rambox.view.preferences.Preferences').show();
} }
,login: function(btn) {
var me = this;
Rambox.ux.Auth0.login();
}
,logout: function(btn) {
var me = this;
var logoutFn = function(callback) {
Ext.Msg.wait(locale['app.window[37]'], locale['app.main[21]']);
// Google Analytics Event
ga_storage._trackEvent('Users', 'loggedOut');
// Logout from Auth0
Rambox.ux.Auth0.logout();
Ext.cq1('app-main').getViewModel().set('username', '');
Ext.cq1('app-main').getViewModel().set('avatar', '');
if ( Ext.isFunction(callback) ) {
callback(false, function() {
Ext.Msg.hide();
});
} else {
Ext.Msg.hide();
}
}
if ( btn ) {
Ext.Msg.confirm(locale['app.main[21]'], locale['app.window[38]'], function(btnId) {
if ( btnId === 'yes' ) {
logoutFn(me.removeAllServices.bind(me));
}
});
} else {
logoutFn();
}
}
,showDonate: function( btn ) {
Signalayer.API.show('tChaoq3PwSG9wswhn');
}
}); });

94
app/view/preferences/Preferences.js

@ -74,50 +74,50 @@ Ext.define('Rambox.view.preferences.Preferences',{
,store: Ext.create('Ext.data.Store', { ,store: Ext.create('Ext.data.Store', {
fields: ['value', 'label'] fields: ['value', 'label']
,data: [ ,data: [
{ 'value': 'af', 'auth0': 'af', 'label': 'Afrikaans' } { 'value': 'af', 'extjs': 'af', 'label': 'Afrikaans' }
,{ 'value': 'ar', 'auth0': 'en', 'label': 'Arabic' } ,{ 'value': 'ar', 'extjs': 'en', 'label': 'Arabic' }
,{ 'value': 'bs2', 'auth0': 'en', 'label': 'Barndutsch, Switzerland' } ,{ 'value': 'bs2', 'extjs': 'en', 'label': 'Barndutsch, Switzerland' }
,{ 'value': 'bn', 'auth0': 'en', 'label': 'Bengali' } ,{ 'value': 'bn', 'extjs': 'en', 'label': 'Bengali' }
,{ 'value': 'bg', 'auth0': 'en', 'label': 'Bulgarian' } ,{ 'value': 'bg', 'extjs': 'en', 'label': 'Bulgarian' }
,{ 'value': 'ca', 'auth0': 'ca', 'label': 'Catalan' } ,{ 'value': 'ca', 'extjs': 'ca', 'label': 'Catalan' }
,{ 'value': 'ceb', 'auth0': 'en', 'label': 'Cebuano' } ,{ 'value': 'ceb', 'extjs': 'en', 'label': 'Cebuano' }
,{ 'value': 'zh-CN', 'auth0': 'zh', 'label': 'Chinese Simplified' } ,{ 'value': 'zh-CN', 'extjs': 'zh', 'label': 'Chinese Simplified' }
,{ 'value': 'zh-TW', 'auth0': 'zh-tw', 'label': 'Chinese Traditional' } ,{ 'value': 'zh-TW', 'extjs': 'zh-tw', 'label': 'Chinese Traditional' }
,{ 'value': 'hr', 'auth0': 'en', 'label': 'Croatian' } ,{ 'value': 'hr', 'extjs': 'en', 'label': 'Croatian' }
,{ 'value': 'cs', 'auth0': 'cs', 'label': 'Czech' } ,{ 'value': 'cs', 'extjs': 'cs', 'label': 'Czech' }
,{ 'value': 'da', 'auth0': 'da', 'label': 'Danish' } ,{ 'value': 'da', 'extjs': 'da', 'label': 'Danish' }
,{ 'value': 'nl', 'auth0': 'nl', 'label': 'Dutch' } ,{ 'value': 'nl', 'extjs': 'nl', 'label': 'Dutch' }
,{ 'value': 'en', 'auth0': 'en', 'label': 'English' } ,{ 'value': 'en', 'extjs': 'en', 'label': 'English' }
,{ 'value': 'fi', 'auth0': 'fi', 'label': 'Finnish' } ,{ 'value': 'fi', 'extjs': 'fi', 'label': 'Finnish' }
,{ 'value': 'fil', 'auth0': 'en', 'label': 'Filipino' } ,{ 'value': 'fil', 'extjs': 'en', 'label': 'Filipino' }
,{ 'value': 'fr', 'auth0': 'fr', 'label': 'French' } ,{ 'value': 'fr', 'extjs': 'fr', 'label': 'French' }
,{ 'value': 'de', 'auth0': 'de', 'label': 'German' } ,{ 'value': 'de', 'extjs': 'de', 'label': 'German' }
,{ 'value': 'de-CH', 'auth0': 'de', 'label': 'German, Switzerland' } ,{ 'value': 'de-CH', 'extjs': 'de', 'label': 'German, Switzerland' }
,{ 'value': 'el', 'auth0': 'el', 'label': 'Greek' } ,{ 'value': 'el', 'extjs': 'el', 'label': 'Greek' }
,{ 'value': 'he', 'auth0': 'en', 'label': 'Hebrew' } ,{ 'value': 'he', 'extjs': 'en', 'label': 'Hebrew' }
,{ 'value': 'hi', 'auth0': 'en', 'label': 'Hindi' } ,{ 'value': 'hi', 'extjs': 'en', 'label': 'Hindi' }
,{ 'value': 'hu', 'auth0': 'hu', 'label': 'Hungarian' } ,{ 'value': 'hu', 'extjs': 'hu', 'label': 'Hungarian' }
,{ 'value': 'id', 'auth0': 'en', 'label': 'Indonesian' } ,{ 'value': 'id', 'extjs': 'en', 'label': 'Indonesian' }
,{ 'value': 'it', 'auth0': 'it', 'label': 'Italian' } ,{ 'value': 'it', 'extjs': 'it', 'label': 'Italian' }
,{ 'value': 'ja', 'auth0': 'ja', 'label': 'Japanese' } ,{ 'value': 'ja', 'extjs': 'ja', 'label': 'Japanese' }
,{ 'value': 'ko', 'auth0': 'ko', 'label': 'Korean' } ,{ 'value': 'ko', 'extjs': 'ko', 'label': 'Korean' }
,{ 'value': 'no', 'auth0': 'no', 'label': 'Norwegian' } ,{ 'value': 'no', 'extjs': 'no', 'label': 'Norwegian' }
,{ 'value': 'fa', 'auth0': 'fa', 'label': 'Persian' } ,{ 'value': 'fa', 'extjs': 'fa', 'label': 'Persian' }
,{ 'value': 'pl', 'auth0': 'pl', 'label': 'Polish' } ,{ 'value': 'pl', 'extjs': 'pl', 'label': 'Polish' }
,{ 'value': 'pt-PT', 'auth0': 'pt-br', 'label': 'Portuguese' } ,{ 'value': 'pt-PT', 'extjs': 'pt-br', 'label': 'Portuguese' }
,{ 'value': 'pt-BR', 'auth0': 'pt-br', 'label': 'Portuguese (Brazilian)' } ,{ 'value': 'pt-BR', 'extjs': 'pt-br', 'label': 'Portuguese (Brazilian)' }
,{ 'value': 'ro', 'auth0': 'ro', 'label': 'Romanian' } ,{ 'value': 'ro', 'extjs': 'ro', 'label': 'Romanian' }
,{ 'value': 'ru', 'auth0': 'ru', 'label': 'Russian' } ,{ 'value': 'ru', 'extjs': 'ru', 'label': 'Russian' }
,{ 'value': 'sr', 'auth0': 'en', 'label': 'Serbian (Cyrillic)' } ,{ 'value': 'sr', 'extjs': 'en', 'label': 'Serbian (Cyrillic)' }
,{ 'value': 'sk', 'auth0': 'sk', 'label': 'Slovak' } ,{ 'value': 'sk', 'extjs': 'sk', 'label': 'Slovak' }
,{ 'value': 'es-ES', 'auth0': 'es', 'label': 'Spanish' } ,{ 'value': 'es-ES', 'extjs': 'es', 'label': 'Spanish' }
,{ 'value': 'sv-SE', 'auth0': 'sv', 'label': 'Swedish' } ,{ 'value': 'sv-SE', 'extjs': 'sv', 'label': 'Swedish' }
,{ 'value': 'tl', 'auth0': 'en', 'label': 'Tagalog' } ,{ 'value': 'tl', 'extjs': 'en', 'label': 'Tagalog' }
,{ 'value': 'th', 'auth0': 'en', 'label': 'Thai' } ,{ 'value': 'th', 'extjs': 'en', 'label': 'Thai' }
,{ 'value': 'tr', 'auth0': 'tr', 'label': 'Turkish' } ,{ 'value': 'tr', 'extjs': 'tr', 'label': 'Turkish' }
,{ 'value': 'uk', 'auth0': 'en', 'label': 'Ukrainian' } ,{ 'value': 'uk', 'extjs': 'en', 'label': 'Ukrainian' }
,{ 'value': 'ur-PK', 'auth0': 'en', 'label': 'Urdu (Pakistan)' } ,{ 'value': 'ur-PK', 'extjs': 'en', 'label': 'Urdu (Pakistan)' }
,{ 'value': 'vi', 'auth0': 'en', 'label': 'Vietnamese' } ,{ 'value': 'vi', 'extjs': 'en', 'label': 'Vietnamese' }
] ]
}) })
} }
@ -361,12 +361,6 @@ Ext.define('Rambox.view.preferences.Preferences',{
} }
] ]
} }
,{
xtype: 'checkbox'
,name: 'sendStatistics'
,boxLabel: locale['preferences[27]']
,value: config.sendStatistics
}
] ]
} }
]; ];

2
app/view/preferences/PreferencesController.js

@ -55,7 +55,7 @@ Ext.define('Rambox.view.preferences.PreferencesController', {
// Locale // Locale
if ( values.locale !== ipc.sendSync('getConfig').locale ) { if ( values.locale !== ipc.sendSync('getConfig').locale ) {
localStorage.setItem('locale', values.locale); localStorage.setItem('locale', values.locale);
localStorage.setItem('locale-auth0', me.getView().down('form').down('combo[name="locale"]').getSelection().get('auth0')); localStorage.setItem('locale-extjs', me.getView().down('form').down('combo[name="locale"]').getSelection().get('extjs'));
Ext.Msg.confirm('Action required', 'To change the language of Rambox, you need to reload the app. Do you want to do it now?', function(btnId) { Ext.Msg.confirm('Action required', 'To change the language of Rambox, you need to reload the app. Do you want to do it now?', function(btnId) {
if ( btnId === 'yes' ) ipc.send('relaunchApp'); if ( btnId === 'yes' ) ipc.send('relaunchApp');
}); });

4
electron/main.js

@ -143,7 +143,7 @@ function createWindow () {
tray.create(mainWindow, config); tray.create(mainWindow, config);
if ( process.argv.indexOf('--without-update') === -1 ) updater.initialize(mainWindow); updater.initialize(mainWindow);
// Open links in default browser // Open links in default browser
mainWindow.webContents.on('new-window', function(e, url, frameName, disposition, options) { mainWindow.webContents.on('new-window', function(e, url, frameName, disposition, options) {
@ -579,6 +579,7 @@ ipcMain.on('toggleWin', function(event, allwaysShow) {
// ScreenShare // ScreenShare
ipcMain.on('screenShare:show', (event, screenList) => { ipcMain.on('screenShare:show', (event, screenList) => {
let tmpWindow = new BrowserWindow({ let tmpWindow = new BrowserWindow({
title: 'Rambox - Select screen',
width: 600, width: 600,
height: 500, height: 500,
icon: __dirname + '/../resources/Icon.ico', icon: __dirname + '/../resources/Icon.ico',
@ -589,6 +590,7 @@ ipcMain.on('screenShare:show', (event, screenList) => {
hasShadow: true, hasShadow: true,
webPreferences: { webPreferences: {
nodeIntegration: true, nodeIntegration: true,
contextIsolation: false,
}, },
}); });

28
electron/menu.js

@ -23,7 +23,7 @@ module.exports = function(config) {
{ {
label: `&`+locale['menu.help[0]'], label: `&`+locale['menu.help[0]'],
click() { click() {
shell.openExternal('https://rambox.pro'); shell.openExternal('https://rambox.app');
} }
}, },
{ {
@ -47,23 +47,6 @@ module.exports = function(config) {
{ {
type: 'separator' type: 'separator'
}, },
{
label: '&'+locale['menu.help[1]'],
click() {
const body = `
<!-- Please describe here your issue and steps to reproduce it. -->
<!-- DON'T REMOVE THE FOLLOWING LINES -->
-
> ${app.getName()} ${app.getVersion()}
> Electron ${process.versions.electron}
> ${process.platform} ${process.arch} ${os.release()}`;
shell.openExternal(`https://github.com/ramboxapp/community-edition/issues/new?body=${encodeURIComponent(body)}`);
}
},
{ {
label: `&Tools`, label: `&Tools`,
submenu: [ submenu: [
@ -92,15 +75,6 @@ module.exports = function(config) {
} }
] ]
}, },
{
type: 'separator'
},
{
label: `&`+locale['menu.help[3]'],
click() {
shell.openExternal('https://rambox.app/donate.html');
}
}
]; ];
let tpl = [ let tpl = [

4
electron/tray.js

@ -44,12 +44,12 @@ exports.create = function(win, config) {
// Double click is not supported and Click its only supported when app indicator is not used. // Double click is not supported and Click its only supported when app indicator is not used.
// Read more here (Platform limitations): https://github.com/electron/electron/blob/master/docs/api/tray.md // Read more here (Platform limitations): https://github.com/electron/electron/blob/master/docs/api/tray.md
appIcon.on('click', function() { appIcon.on('click', function() {
win.webContents.executeJavaScript('ipc.send("toggleWin", true);'); win.webContents.executeJavaScript('ipc.send("toggleWin", false);');
}); });
break; break;
case 'win32': case 'win32':
appIcon.on('double-click', function() { appIcon.on('double-click', function() {
win.webContents.executeJavaScript('ipc.send("toggleWin", true);'); win.webContents.executeJavaScript('ipc.send("toggleWin", false);');
}); });
break; break;
default: default:

12
electron/updater.js

@ -1,12 +1,18 @@
const { app, ipcMain, BrowserWindow } = require('electron'); const { app, ipcMain, BrowserWindow } = require('electron');
const { autoUpdater } = require("electron-updater"); const { autoUpdater } = require("electron-updater");
const path = require('path');
// autoUpdater.logger = require("electron-log"); // autoUpdater.logger = require("electron-log");
// autoUpdater.logger.transports.file.level = "debug"; // autoUpdater.logger.transports.file.level = "debug";
// autoUpdater.currentVersion = '0.6.0'; // autoUpdater.currentVersion = '0.8.0';
// autoUpdater.updateConfigPath = path.join(__dirname, 'dev-app-update.yml'); // autoUpdater.updateConfigPath = path.join(__dirname, 'dev-app-update.yml');
autoUpdater.setFeedURL({
"provider": "github",
"owner": "ramboxapp",
"repo": "download",
"vPrefixedTagName": true
});
const initialize = (window) => { const initialize = (window) => {
const webContents = window.webContents; const webContents = window.webContents;
const send = webContents.send.bind(window.webContents); const send = webContents.send.bind(window.webContents);
@ -15,7 +21,7 @@ const initialize = (window) => {
ipcMain.on('autoUpdater:quit-and-install', (event) => { ipcMain.on('autoUpdater:quit-and-install', (event) => {
app.removeAllListeners('window-all-closed'); app.removeAllListeners('window-all-closed');
BrowserWindow.getAllWindows().forEach((browserWindow) => browserWindow.removeAllListeners('close')); BrowserWindow.getAllWindows().forEach((browserWindow) => browserWindow.removeAllListeners('close'));
autoUpdater.quitAndInstall() autoUpdater.quitAndInstall(true, true);
}); });
ipcMain.on('autoUpdater:check-for-updates', (event) => autoUpdater.checkForUpdates()); ipcMain.on('autoUpdater:check-for-updates', (event) => autoUpdater.checkForUpdates());
}; };

5
env-sample.js

@ -1,5 +0,0 @@
var auth0Cfg = {
clientID: ''
,clientSecret: ''
,domain: ''
};

14
package.json

@ -1,7 +1,7 @@
{ {
"name": "Rambox", "name": "Rambox",
"productName": "Rambox", "productName": "Rambox",
"version": "0.7.9", "version": "0.8.0",
"description": "Free and Open Source messaging and emailing app that combines common web applications into one.", "description": "Free and Open Source messaging and emailing app that combines common web applications into one.",
"main": "electron/main.js", "main": "electron/main.js",
"repository": { "repository": {
@ -78,7 +78,12 @@
"category": "public.app-category.productivity", "category": "public.app-category.productivity",
"artifactName": "Rambox-${version}-mac-${arch}.${ext}", "artifactName": "Rambox-${version}-mac-${arch}.${ext}",
"target": [ "target": [
"default" {
"target": "default",
"arch": [
"universal"
]
}
], ],
"hardenedRuntime": true, "hardenedRuntime": true,
"gatekeeperAssess": false, "gatekeeperAssess": false,
@ -213,7 +218,7 @@
"crowdin": "1.0.0", "crowdin": "1.0.0",
"csvjson": "4.3.3", "csvjson": "4.3.3",
"electron": "13.6.3", "electron": "13.6.3",
"electron-builder": "22.14.5", "electron-builder": "22.14.13",
"electron-notarize": "1.0.0", "electron-notarize": "1.0.0",
"electron-packager": "15.1.0", "electron-packager": "15.1.0",
"mocha": "5.2.0", "mocha": "5.2.0",
@ -221,14 +226,13 @@
}, },
"dependencies": { "dependencies": {
"@exponent/electron-cookies": "2.0.0", "@exponent/electron-cookies": "2.0.0",
"auth0-js": "9.13.2",
"auto-launch-patched": "5.0.2", "auto-launch-patched": "5.0.2",
"crypto": "1.0.1", "crypto": "1.0.1",
"electron-contextmenu-wrapper": "git+https://github.com/ramboxapp/electron-contextmenu-wrapper.git", "electron-contextmenu-wrapper": "git+https://github.com/ramboxapp/electron-contextmenu-wrapper.git",
"electron-is-dev": "1.2.0", "electron-is-dev": "1.2.0",
"electron-log": "4.3.0", "electron-log": "4.3.0",
"electron-store": "6.0.1", "electron-store": "6.0.1",
"electron-updater": "4.3.5", "electron-updater": "4.5.2",
"is-online": "8.2.0", "is-online": "8.2.0",
"mime": "2.3.1", "mime": "2.3.1",
"mousetrap": "1.6.3", "mousetrap": "1.6.3",

5
packages/local/rambox-default-theme/sass/etc/all.scss

@ -279,3 +279,8 @@ body {
background-color: #c3c3c3; background-color: #c3c3c3;
} }
} }
.deprecation {
background-color: #E6A23C !important;
color: #FFF;
}

146
resources/css/screenselector.css

@ -1,146 +0,0 @@
html, body {
width: 100%;
height: 100%;
margin: 0;
overflow: hidden;
}
.screen-selector {
background-color: #fff;
width: 100%;
height: 100%;
border-radius: 5px;
border: solid 1px #cdcdcd;
box-sizing: border-box;
}
.screen-selector ul.type {
display: inline-block;
padding: 0;
margin: 0;
border-bottom: solid 1px #cdcdcd;
width: 100%;
-webkit-app-region: drag;
}
.screen-selector ul.type li {
display: inline-block;
height: 40px;
line-height: 40px;
color: #65696c;
border-bottom: 2px solid transparent;
font-family: sans-serif;
font-weight: bold;
padding: 0 15px;
cursor: pointer;
-webkit-app-region: no-drag;
}
.screen-selector ul.type li.active, .screen-selector ul.type li:hover {
color: #426ba3;
border-color: #426ba3;
}
.screen-selector > .content {
height: calc(100% - 92px);
}
.screen-selector ul.preview {
display: flex;
margin: 0;
padding: 0;
width: 100%;
max-height: calc(100% - 45px);
box-sizing: border-box;
padding: 10px;
overflow-y: auto;
flex-wrap: wrap;
list-style-type: none;
}
.screen-selector ul.preview li {
display: inline-block;
box-sizing: border-box;
width: calc(33% - 1px);
cursor: pointer;
padding: 5px;
}
.screen-selector ul.preview li .content {
display: flex;
box-sizing: border-box;
padding: 10px;
border: solid 2px transparent;
border-radius: 5px;
height: 100%;
flex-direction: column;
}
.screen-selector ul.preview li.active .content,
.screen-selector ul.preview li:hover .content {
border-color: #88abdb;
}
.screen-selector ul.preview li.active .content {
color: #000;
height: 100%;
}
.screen-selector ul.preview li .content .img-wrapper {
display: flex;
height: 100%;
align-items: center;
background: #f0f0f0;
}
.screen-selector ul.preview li .content img {
display: inline-block;
width: 100%;
}
.screen-selector ul.preview li .content span {
display: inline-block;
width: 100%;
font-family: sans-serif;
text-align: center;
font-size: 14px;
margin-top: 10px;
color: #333;
box-sizing: border-box;
}
.screen-selector .footer {
display: inline-block;
width: 100%;
border-top: solid 1px #cdcdcd;
}
.screen-selector .footer button {
float: right;
margin-top: 10px;
margin-right: 10px;
border: none;
border-radius: 5px;
padding: 5px 10px;
font-size: 14px;
cursor: pointer;
font-weight: bold;
}
.screen-selector .footer button#cancel {
border: solid 1px #cdcdcd;
background: #fff;
color: #1c73e4;
}
.screen-selector .footer button#share {
border: solid 1px #186ddd;
background: #1c73e4;
color: #fff;
}
.screen-selector .footer button#share[disabled] {
background: #666;
cursor: default;
}

BIN
resources/icons/airdroid.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

BIN
resources/icons/androidmessages.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

BIN
resources/icons/aol.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
resources/icons/awsworkmail.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

BIN
resources/icons/bearychat.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

BIN
resources/icons/bip.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

BIN
resources/icons/calendar.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

BIN
resources/icons/chatwork.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

BIN
resources/icons/cliq.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

BIN
resources/icons/converse.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
resources/icons/crisp.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
resources/icons/devrant.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
resources/icons/dingtalk.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
resources/icons/discord.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
resources/icons/drift.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
resources/icons/duo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
resources/icons/element.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
resources/icons/facebook.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
resources/icons/fastmail.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
resources/icons/fleep.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
resources/icons/flock.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
resources/icons/flowdock.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

BIN
resources/icons/freenode.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
resources/icons/gadugadu.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

BIN
resources/icons/gitter.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
resources/icons/glip.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
resources/icons/glowingbear.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

BIN
resources/icons/gmail.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

BIN
resources/icons/googledrive.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

BIN
resources/icons/googlevoice.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

BIN
resources/icons/grape.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

BIN
resources/icons/groupme.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

BIN
resources/icons/guilded.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

BIN
resources/icons/hangouts.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

BIN
resources/icons/hangoutschat.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 700 B

BIN
resources/icons/hibox.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

BIN
resources/icons/honeypot.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

BIN
resources/icons/hootsuite.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
resources/icons/horde.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

BIN
resources/icons/hushmail.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

BIN
resources/icons/icloudmail.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

BIN
resources/icons/icq.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

BIN
resources/icons/inbox.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

BIN
resources/icons/instagramdirect.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

BIN
resources/icons/intercom.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
resources/icons/irccloud.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
resources/icons/jandi.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

BIN
resources/icons/kaiwa.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
resources/icons/kezmo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

BIN
resources/icons/kiwi.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

BIN
resources/icons/kune.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

BIN
resources/icons/linkedin.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

BIN
resources/icons/lounge.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
resources/icons/mailru.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

BIN
resources/icons/mastodon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
resources/icons/mattermost.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
resources/icons/messenger.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

BIN
resources/icons/messengerpages.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
resources/icons/mightytext.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

BIN
resources/icons/missive.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

BIN
resources/icons/movim.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

BIN
resources/icons/mysms.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

BIN
resources/icons/noysi.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
resources/icons/okru.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
resources/icons/openmailbox.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
resources/icons/outlook.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

BIN
resources/icons/outlook365.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

BIN
resources/icons/protonmail.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

BIN
resources/icons/protonmailch.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

BIN
resources/icons/pushbullet.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

BIN
resources/icons/rainloop.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
resources/icons/reddit.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
resources/icons/riot.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

BIN
resources/icons/rocketchat.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

BIN
resources/icons/roundcube.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

BIN
resources/icons/ryver.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
resources/icons/sandstorm.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

BIN
resources/icons/simplenote.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save