Browse Source

Merge branch 'fix_linting'

pull/3202/head
TheGoddessInari 7 years ago
parent
commit
536b9c9978
  1. 8
      app.js
  2. 6
      app/Application.js
  3. 6
      app/store/Services.js
  4. 2
      app/util/UnreadCounter.js
  5. 11
      app/ux/WebView.js
  6. 18
      app/view/add/Add.js
  7. 4
      app/view/main/Main.js
  8. 2
      app/view/main/MainController.js

8
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();

6
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();
}
}
}
,{

6
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);

2
app/util/UnreadCounter.js

@ -70,6 +70,6 @@ Ext.define('Rambox.util.UnreadCounter', {
unreadCountByService['delete'](id);
updateAppUnreadCounter();
}
};
}
});

11
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) {

18
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') === '___');

4
app/view/main/Main.js

@ -32,7 +32,7 @@ Ext.define('Rambox.view.main.Main', {
,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://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'

2
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) {

Loading…
Cancel
Save