From 76d1e051fd515725c512c845a0cfbfd68105bae0 Mon Sep 17 00:00:00 2001 From: Sander Bol Date: Thu, 19 Jul 2018 12:03:52 +0200 Subject: [PATCH 1/3] Fix donation link Fixes #1749. --- app/view/main/Main.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/view/main/Main.js b/app/view/main/Main.js index cb6e10e4..27dd3703 100644 --- a/app/view/main/Main.js +++ b/app/view/main/Main.js @@ -31,7 +31,7 @@ Ext.define('Rambox.view.main.Main', { ,html: '' ,baseCls: '' ,tooltip: locale['app.main[25]'] - ,href: 'https://fundraiseup.com/widget/FUNSGXPIJWQ/donate?key=KPCFEZKZ' + ,href: 'https://rambox.pro/#donate' }] } ,items: [ @@ -338,7 +338,7 @@ Ext.define('Rambox.view.main.Main', { ,{ text: locale['app.main[25]'] ,glyph: 'xf21e@FontAwesome' - ,href: 'https://fundraiseup.com/widget/FUNSGXPIJWQ/donate?key=KPCFEZKZ' + ,href: 'https://rambox.pro/#donate' } ,{ text: 'Translation' From 13b3b1049b2fb16f07cc9e293ab5d916ce3cc53d Mon Sep 17 00:00:00 2001 From: TheGoddessInari Date: Sat, 21 Jul 2018 23:14:53 -0700 Subject: [PATCH 2/3] Please don't abuse ternary operator for operations without a value. It makes the linters angry. --- app.js | 14 +++++++++++--- app/Application.js | 6 +++++- app/store/Services.js | 6 +++++- app/ux/WebView.js | 8 +++++++- app/view/add/Add.js | 18 +++++++++++++++--- 5 files changed, 43 insertions(+), 9 deletions(-) diff --git a/app.js b/app.js index 920844bd..7dea5c7f 100644 --- a/app.js +++ b/app.js @@ -19,10 +19,14 @@ const ipc = require('electron').ipcRenderer; require('electron-context-menu')(); ipc.on('showAbout', function(event, message) { - !Ext.cq1('about') ? Ext.create('Rambox.view.main.About') : ''; + if(!Ext.cq1('about')) { + Ext.create('Rambox.view.main.About'); + } }); ipc.on('showPreferences', function(event, message) { - !Ext.cq1('preferences') ? Ext.create('Rambox.view.preferences.Preferences').show() : ''; + if (!Ext.cq1('preferences')) { + Ext.create('Rambox.view.preferences.Preferences').show(); + } }); ipc.on('autoUpdater:check-update', function() { Rambox.app.checkUpdate(); @@ -135,7 +139,11 @@ ipc.on('toggleStatusBar', function() { var tab = Ext.cq1('app-main').getActiveTab(); if ( tab.id !== 'ramboxTab' ) { - tab.down('statusbar').closed ? tab.setStatusBar(tab.record.get('statusbar')) : tab.closeStatusBar(); + if (tab.down('statusbar').closed) { + tab.setStatusBar(tab.record.get('statusbar')); + } else { + tab.closeStatusBar(); + } } }); // Focus the current service when Alt + Tab or click in webviews textfields diff --git a/app/Application.js b/app/Application.js index 5039e032..41fb940b 100644 --- a/app/Application.js +++ b/app/Application.js @@ -123,7 +123,11 @@ Ext.define('Rambox.Application', { var tabPanel = Ext.cq1('app-main'); if ( tabPanel.items.indexOf(tabPanel.getActiveTab()) === 0 ) return false; - key === Ext.event.Event.NUM_PLUS || key === 187 ? tabPanel.getActiveTab().zoomIn() : tabPanel.getActiveTab().zoomOut(); + if (key === Ext.event.Event.NUM_PLUS || key === 187) { + tabPanel.getActiveTab().zoomIn(); + } else { + tabPanel.getActiveTab().zoomOut(); + } } } ,{ diff --git a/app/store/Services.js b/app/store/Services.js index 506f9a4b..d20af23a 100644 --- a/app/store/Services.js +++ b/app/store/Services.js @@ -46,7 +46,11 @@ Ext.define('Rambox.store.Services', { } }; - service.get('align') === 'left' ? servicesLeft.push(cfg) : servicesRight.push(cfg); + if (service.get('align') === 'left') { + servicesLeft.push(cfg); + } else { + servicesRight.push(cfg); + } }); if ( !Ext.isEmpty(servicesLeft) ) Ext.cq1('app-main').insert(1, servicesLeft); diff --git a/app/ux/WebView.js b/app/ux/WebView.js index 51af59cf..f7e165c0 100644 --- a/app/ux/WebView.js +++ b/app/ux/WebView.js @@ -598,7 +598,13 @@ Ext.define('Rambox.ux.WebView',{ var me = this; var webview = me.down('component').el.dom; - if ( me.record.get('enabled') ) webview.isDevToolsOpened() ? webview.closeDevTools() : webview.openDevTools(); + if ( me.record.get('enabled')) { + if (webview.isDevToolsOpened()) { + webview.closeDevTools(); + } else { + webview.openDevTools(); + } + } } ,setURL: function(url) { diff --git a/app/view/add/Add.js b/app/view/add/Add.js index 9c9730cc..a0f13ad0 100644 --- a/app/view/add/Add.js +++ b/app/view/add/Add.js @@ -104,11 +104,23 @@ Ext.define('Rambox.view.add.Add',{ cycleBtn.previousSibling().reset(); if ( me.edit && cycleBtn.nextSibling().originalValue !== '2' ) { - me.service.get('custom_domain') && !activeItem.custom ? cycleBtn.previousSibling().reset() : cycleBtn.previousSibling().setValue(''); + if (me.service.get('custom_domain') && !activeItem.custom) { + cycleBtn.previousSibling().reset(); + } else { + cycleBtn.previousSibling().setValue(''); + } } else if ( me.edit && cycleBtn.nextSibling().originalValue === '2' ) { - me.service.get('custom_domain') && !activeItem.custom ? cycleBtn.previousSibling().setValue( me.service.get('url').indexOf('___') === -1 && me.service.get('custom_domain') ? me.service.get('url') : '') : cycleBtn.previousSibling().reset(); + if (me.service.get('custom_domain') && !activeItem.custom) { + cycleBtn.previousSibling().setValue( me.service.get('url').indexOf('___') === -1 && me.service.get('custom_domain') ? me.service.get('url') : ''); + } else { + cycleBtn.previousSibling().reset(); + } } else if ( !me.edit && cycleBtn.nextSibling().originalValue === '1' ) { - activeItem.custom ? cycleBtn.previousSibling().setValue('') : cycleBtn.previousSibling().reset(); + if (activeItem.custom) { + cycleBtn.previousSibling().setValue(''); + } else { + cycleBtn.previousSibling().reset(); + } } cycleBtn.previousSibling().previousSibling().setHidden(activeItem.custom ? true : me.edit ? me.service.get('url').indexOf('___') === -1 ? true : me.service.get('type') === 'custom' || me.service.get('url') === '___' : me.record.get('url').indexOf('___') === -1 ? true : me.record.get('type') === 'custom' || me.record.get('url') === '___'); From 9b9ab1e8e194e0c367bf0b51b669032a04b3640d Mon Sep 17 00:00:00 2001 From: TheGoddessInari Date: Sat, 21 Jul 2018 23:34:36 -0700 Subject: [PATCH 3/3] Fix other linting errors. No lint makes for easier development. --- app/util/UnreadCounter.js | 2 +- app/ux/WebView.js | 3 +-- app/view/main/MainController.js | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/util/UnreadCounter.js b/app/util/UnreadCounter.js index 46617b0f..3b5df545 100644 --- a/app/util/UnreadCounter.js +++ b/app/util/UnreadCounter.js @@ -70,6 +70,6 @@ Ext.define('Rambox.util.UnreadCounter', { unreadCountByService['delete'](id); updateAppUnreadCounter(); - } + }; } }); diff --git a/app/ux/WebView.js b/app/ux/WebView.js index f7e165c0..dcc24146 100644 --- a/app/ux/WebView.js +++ b/app/ux/WebView.js @@ -31,7 +31,7 @@ Ext.define('Rambox.ux.WebView',{ pathname: match[5], search: match[6], hash: match[7] - } + }; } // Allow Custom sites with self certificates @@ -386,7 +386,6 @@ Ext.define('Rambox.ux.WebView',{ require('electron').shell.openExternal(e.url); } return; - break; default: break; } diff --git a/app/view/main/MainController.js b/app/view/main/MainController.js index 25d2e7c7..ca82cfdd 100644 --- a/app/view/main/MainController.js +++ b/app/view/main/MainController.js @@ -486,7 +486,7 @@ Ext.define('Rambox.view.main.MainController', { Ext.cq1('app-main').getViewModel().set('avatar', ''); if ( Ext.isFunction(callback) ) callback(); - } + }; if ( btn ) { Ext.Msg.confirm(locale['app.main[21]'], locale['app.window[38]'], function(btnId) {