windowsinboxwhatsappicloudtweetdeckhipchattelegramhangoutsslackgmailskypefacebook-workplaceoutlookemailmicrosoft-teamsdiscordmessengercustom-servicesmacoslinux
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
290 lines
7.5 KiB
290 lines
7.5 KiB
9 years ago
|
Ext.define('Rambox.view.main.Main', {
|
||
|
extend: 'Ext.tab.Panel'
|
||
|
,requires: [
|
||
|
'Rambox.view.main.MainController'
|
||
|
,'Rambox.view.main.MainModel'
|
||
|
,'Rambox.ux.WebView'
|
||
|
,'Rambox.ux.mixin.Badge'
|
||
9 years ago
|
,'Rambox.view.add.Add'
|
||
9 years ago
|
,'Ext.ux.TabReorderer'
|
||
|
]
|
||
|
|
||
|
,xtype: 'app-main'
|
||
|
|
||
|
,controller: 'main'
|
||
|
,viewModel: {
|
||
|
type: 'main'
|
||
|
}
|
||
|
|
||
|
,plugins: [
|
||
|
{
|
||
9 years ago
|
ptype: 'tabreorderer'
|
||
9 years ago
|
}
|
||
|
]
|
||
9 years ago
|
|
||
9 years ago
|
,autoRender: true
|
||
|
,autoShow: true
|
||
|
,deferredRender: false
|
||
7 years ago
|
,tabBar: {
|
||
6 years ago
|
id: 'mainTabBar'
|
||
|
,cls: JSON.parse(localStorage.getItem('dontDisturb')) ? 'dontdisturb' : ''
|
||
7 years ago
|
}
|
||
9 years ago
|
,items: [
|
||
|
{
|
||
9 years ago
|
icon: 'resources/[email protected]'
|
||
9 years ago
|
,id: 'ramboxTab'
|
||
9 years ago
|
,closable: false
|
||
9 years ago
|
,reorderable: false
|
||
9 years ago
|
,autoScroll: true
|
||
9 years ago
|
,layout: 'hbox'
|
||
9 years ago
|
,tabConfig: {} // Created empty for Keyboard Shortcuts
|
||
9 years ago
|
,items: [
|
||
|
{
|
||
9 years ago
|
xtype: 'panel'
|
||
8 years ago
|
,title: locale['app.main[0]']
|
||
9 years ago
|
,margin: '0 5 0 0'
|
||
8 years ago
|
,flex: 2
|
||
9 years ago
|
,header: { height: 50 }
|
||
|
,tools: [
|
||
9 years ago
|
{
|
||
9 years ago
|
xtype: 'checkboxgroup'
|
||
|
,items: [
|
||
9 years ago
|
{
|
||
9 years ago
|
xtype: 'checkbox'
|
||
8 years ago
|
,boxLabel: locale['app.main[1]']
|
||
9 years ago
|
,name: 'messaging'
|
||
|
,checked: true
|
||
|
,uncheckedValue: false
|
||
|
,inputValue: true
|
||
9 years ago
|
}
|
||
9 years ago
|
,{
|
||
9 years ago
|
xtype: 'checkbox'
|
||
8 years ago
|
,boxLabel: locale['app.main[2]']
|
||
9 years ago
|
,margin: '0 10 0 10'
|
||
|
,name: 'email'
|
||
|
,checked: true
|
||
|
,uncheckedValue: false
|
||
|
,inputValue: true
|
||
9 years ago
|
}
|
||
|
]
|
||
9 years ago
|
,listeners: {
|
||
|
change: 'doTypeFilter'
|
||
9 years ago
|
}
|
||
|
}
|
||
|
,{
|
||
9 years ago
|
xtype: 'textfield'
|
||
|
,grow: true
|
||
|
,growMin: 120
|
||
|
,growMax: 170
|
||
|
,triggers: {
|
||
|
clear: {
|
||
|
weight: 0
|
||
|
,cls: Ext.baseCSSPrefix + 'form-clear-trigger'
|
||
|
,hidden: true
|
||
|
,handler: 'onClearClick'
|
||
9 years ago
|
}
|
||
9 years ago
|
,search: {
|
||
|
weight: 1
|
||
|
,cls: Ext.baseCSSPrefix + 'form-search-trigger search-trigger'
|
||
9 years ago
|
}
|
||
9 years ago
|
}
|
||
|
,listeners: {
|
||
|
change: 'onSearchServiceChange'
|
||
|
,afterrender: 'onSearchRender'
|
||
|
,specialkey: 'onSearchEnter'
|
||
|
}
|
||
|
}
|
||
|
]
|
||
|
,items: [
|
||
|
{
|
||
|
xtype: 'dataview'
|
||
|
,store: 'ServicesList'
|
||
|
,itemSelector: 'div.service'
|
||
|
,tpl: [
|
||
|
'<tpl for=".">'
|
||
9 years ago
|
,'<div class="service" data-qtip="{description}">'
|
||
3 years ago
|
,'<img src="resources/icons/{logo}" width="48" />'
|
||
9 years ago
|
,'<span>{name}</span>'
|
||
|
,'</div>'
|
||
|
,'</tpl>'
|
||
9 years ago
|
]
|
||
8 years ago
|
,emptyText: '<div style="padding: 20px;">'+locale['app.main[3]']+'</div>'
|
||
9 years ago
|
,listeners: {
|
||
|
itemclick: 'onNewServiceSelect'
|
||
|
}
|
||
|
}
|
||
|
]
|
||
|
}
|
||
|
,{
|
||
|
xtype: 'grid'
|
||
8 years ago
|
,title: locale['app.main[4]']
|
||
9 years ago
|
,store: 'Services'
|
||
|
,hideHeaders: true
|
||
|
,margin: '0 0 0 5'
|
||
|
,flex: 1
|
||
|
,header: { height: 50 }
|
||
9 years ago
|
,features: [
|
||
|
{
|
||
|
ftype:'grouping'
|
||
9 years ago
|
,collapsible: false
|
||
8 years ago
|
,groupHeaderTpl: '{columnName:uppercase}: {name:capitalize} ({rows.length} {[values.rows.length > 1 ? "'+locale['app.main[9]']+'" : "'+locale['app.main[8]']+'"]})'
|
||
9 years ago
|
}
|
||
|
]
|
||
|
,plugins: {
|
||
|
ptype: 'cellediting'
|
||
|
,clicksToEdit: 2
|
||
|
}
|
||
9 years ago
|
,tools: [
|
||
|
{
|
||
|
xtype: 'button'
|
||
|
,glyph: 'xf1f8@FontAwesome'
|
||
9 years ago
|
,baseCls: ''
|
||
8 years ago
|
,tooltip: locale['app.main[10]']
|
||
9 years ago
|
,handler: 'removeAllServices'
|
||
6 years ago
|
,bind: {
|
||
|
disabled: '{emptyServices}'
|
||
|
}
|
||
9 years ago
|
}
|
||
|
]
|
||
9 years ago
|
,columns: [
|
||
|
{
|
||
|
xtype: 'templatecolumn'
|
||
6 years ago
|
,width: 52
|
||
9 years ago
|
,variableRowHeight: true
|
||
3 years ago
|
,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)\" ]}" />'
|
||
9 years ago
|
}
|
||
9 years ago
|
,{
|
||
9 years ago
|
dataIndex: 'name'
|
||
9 years ago
|
,variableRowHeight: true
|
||
|
,flex: 1
|
||
|
,editor: {
|
||
|
xtype: 'textfield'
|
||
|
,allowBlank: true
|
||
|
}
|
||
|
}
|
||
9 years ago
|
,{
|
||
|
xtype: 'actioncolumn'
|
||
|
,width: 60
|
||
|
,align: 'right'
|
||
9 years ago
|
,items: [
|
||
|
{
|
||
9 years ago
|
glyph: 0xf1f7
|
||
8 years ago
|
,tooltip: locale['app.main[11]']
|
||
9 years ago
|
,getClass: function( value, metaData, record, rowIndex, colIndex, store, view ){
|
||
|
if ( record.get('notifications') ) return 'x-hidden';
|
||
|
}
|
||
|
}
|
||
|
,{
|
||
|
glyph: 0xf026
|
||
8 years ago
|
,tooltip: locale['app.main[12]']
|
||
9 years ago
|
,getClass: function( value, metaData, record, rowIndex, colIndex, store, view ){
|
||
|
if ( !record.get('muted') ) return 'x-hidden';
|
||
9 years ago
|
}
|
||
|
}
|
||
|
]
|
||
|
}
|
||
|
,{
|
||
9 years ago
|
xtype: 'actioncolumn'
|
||
|
,width: 60
|
||
|
,align: 'center'
|
||
9 years ago
|
,items: [
|
||
|
{
|
||
9 years ago
|
glyph: 0xf013
|
||
8 years ago
|
,tooltip: locale['app.main[13]']
|
||
9 years ago
|
,handler: 'configureService'
|
||
|
,getClass: function(){ return 'x-hidden-display'; }
|
||
9 years ago
|
}
|
||
9 years ago
|
,{
|
||
|
glyph: 0xf1f8
|
||
8 years ago
|
,tooltip: locale['app.main[14]']
|
||
9 years ago
|
,handler: 'removeService'
|
||
|
,getClass: function(){ return 'x-hidden-display'; }
|
||
|
}
|
||
9 years ago
|
]
|
||
|
}
|
||
9 years ago
|
,{
|
||
|
xtype: 'checkcolumn'
|
||
|
,width: 40
|
||
|
,dataIndex: 'enabled'
|
||
|
,renderer: function(value, metaData) {
|
||
|
metaData.tdAttr = 'data-qtip="Service '+(value ? 'Enabled' : 'Disabled')+'"';
|
||
|
return this.defaultRenderer(value, metaData);
|
||
|
}
|
||
|
,listeners: {
|
||
|
checkchange: 'onEnableDisableService'
|
||
|
}
|
||
|
}
|
||
9 years ago
|
]
|
||
9 years ago
|
,viewConfig: {
|
||
8 years ago
|
emptyText: locale['app.main[15]']
|
||
9 years ago
|
,forceFit: true
|
||
9 years ago
|
,stripeRows: true
|
||
|
}
|
||
|
,listeners: {
|
||
8 years ago
|
edit: 'onRenameService'
|
||
|
,rowdblclick: 'showServiceTab'
|
||
9 years ago
|
}
|
||
9 years ago
|
}
|
||
|
]
|
||
9 years ago
|
,tbar: {
|
||
|
xtype: 'toolbar'
|
||
|
,height: 42
|
||
|
,ui: 'main'
|
||
|
,enableOverflow: true
|
||
|
,overflowHandler: 'menu'
|
||
|
,items: [
|
||
|
{
|
||
6 years ago
|
glyph: JSON.parse(localStorage.getItem('dontDisturb')) ? 'xf1f7@FontAwesome' : 'xf0f3@FontAwesome'
|
||
8 years ago
|
,text: locale['app.main[16]']+': '+(JSON.parse(localStorage.getItem('dontDisturb')) ? locale['app.window[20]'] : locale['app.window[21]'])
|
||
5 years ago
|
,tooltip: locale['app.main[17]']+'<br/><b>'+locale['app.main[18]']+(require('electron').remote.process.platform === 'darwin' ? ': Cmd + Alt + D</b>' : ': Alt + Shift + D</b>')
|
||
9 years ago
|
,enableToggle: true
|
||
|
,handler: 'dontDisturb'
|
||
|
,reference: 'disturbBtn'
|
||
9 years ago
|
,id: 'disturbBtn'
|
||
9 years ago
|
,pressed: JSON.parse(localStorage.getItem('dontDisturb'))
|
||
9 years ago
|
}
|
||
|
,{
|
||
|
glyph: 'xf023@FontAwesome'
|
||
8 years ago
|
,text: locale['app.main[19]']
|
||
6 years ago
|
,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>')
|
||
9 years ago
|
,handler: 'lockRambox'
|
||
9 years ago
|
,id: 'lockRamboxBtn'
|
||
9 years ago
|
}
|
||
|
,'->'
|
||
9 years ago
|
,{
|
||
8 years ago
|
tooltip: locale['preferences[0]']
|
||
9 years ago
|
,glyph: 'xf013@FontAwesome'
|
||
|
,handler: 'openPreferences'
|
||
|
}
|
||
9 years ago
|
]
|
||
|
}
|
||
3 years ago
|
,bbar: {
|
||
|
xtype: 'toolbar'
|
||
|
,cls: 'deprecation'
|
||
|
,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!'
|
||
|
,'->'
|
||
|
,{
|
||
|
xtype: 'button'
|
||
|
,text: 'Migrate now'
|
||
|
,handler: function(btn) {
|
||
|
btn.setText('Downloading...');
|
||
|
btn.setDisabled(true);
|
||
|
Rambox.app.checkUpdate();
|
||
9 years ago
|
}
|
||
3 years ago
|
}
|
||
|
]
|
||
|
}
|
||
9 years ago
|
}
|
||
9 years ago
|
,{ id: 'tbfill', tabConfig : { xtype : 'tbfill' } }
|
||
9 years ago
|
]
|
||
9 years ago
|
|
||
|
,listeners: {
|
||
9 years ago
|
tabchange: 'onTabChange'
|
||
|
,add: 'updatePositions'
|
||
|
,remove: 'updatePositions'
|
||
|
,childmove: 'updatePositions'
|
||
7 years ago
|
,boxready: 'initialize'
|
||
9 years ago
|
}
|
||
9 years ago
|
});
|