diff --git a/app.js b/app.js index 02e2f79d..ffde576d 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(); diff --git a/app/Application.js b/app/Application.js index 345ce104..bf0e07ff 100644 --- a/app/Application.js +++ b/app/Application.js @@ -118,7 +118,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 f48e5fb9..ae5872a8 100644 --- a/app/store/Services.js +++ b/app/store/Services.js @@ -47,7 +47,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/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 ca4e6908..06aa7b97 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 @@ -377,7 +377,6 @@ Ext.define('Rambox.ux.WebView',{ require('electron').shell.openExternal(e.url); } return; - break; default: break; } @@ -629,7 +628,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 4d22522a..40e21a4e 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') === '___'); diff --git a/app/view/main/Main.js b/app/view/main/Main.js index dcad2f8b..4b577345 100644 --- a/app/view/main/Main.js +++ b/app/view/main/Main.js @@ -32,7 +32,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' }] */ } @@ -341,7 +341,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' diff --git a/app/view/main/MainController.js b/app/view/main/MainController.js index d8f9bb3f..d78df95b 100644 --- a/app/view/main/MainController.js +++ b/app/view/main/MainController.js @@ -475,7 +475,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) {