messengercustom-servicesmacoslinuxwindowsinboxwhatsappicloudtweetdeckhipchattelegramhangoutsslackgmailskypefacebook-workplaceoutlookemailmicrosoft-teamsdiscord
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.
279 lines
6.4 KiB
279 lines
6.4 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'
|
||
|
,'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
|
||
|
,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'
|
||
|
,title: 'Add a new Service'
|
||
|
,margin: '0 5 0 0'
|
||
|
,flex: 1
|
||
|
,header: { height: 50 }
|
||
|
,tools: [
|
||
9 years ago
|
{
|
||
9 years ago
|
xtype: 'checkboxgroup'
|
||
|
,items: [
|
||
9 years ago
|
{
|
||
9 years ago
|
xtype: 'checkbox'
|
||
|
,boxLabel: 'Messaging'
|
||
|
,name: 'messaging'
|
||
|
,checked: true
|
||
|
,uncheckedValue: false
|
||
|
,inputValue: true
|
||
9 years ago
|
}
|
||
9 years ago
|
,{
|
||
9 years ago
|
xtype: 'checkbox'
|
||
|
,boxLabel: 'Email'
|
||
|
,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=".">'
|
||
|
,'<div class="service">'
|
||
|
,'<img src="resources/icons/{logo}" width="48" />'
|
||
|
,'<span>{name}</span>'
|
||
|
,'</div>'
|
||
|
,'</tpl>'
|
||
9 years ago
|
]
|
||
9 years ago
|
,emptyText: '<div style="padding: 20px;">No services found... Try another search.</div>'
|
||
|
,listeners: {
|
||
|
itemclick: 'onNewServiceSelect'
|
||
|
}
|
||
|
}
|
||
|
]
|
||
|
}
|
||
|
,{
|
||
|
xtype: 'grid'
|
||
|
,title: 'Enabled Services'
|
||
|
,store: 'Services'
|
||
|
,hideHeaders: true
|
||
|
,margin: '0 0 0 5'
|
||
|
,flex: 1
|
||
|
,header: { height: 50 }
|
||
9 years ago
|
,tools: [
|
||
|
{
|
||
|
xtype: 'button'
|
||
|
,glyph: 'xf1f8@FontAwesome'
|
||
|
,tooltip: 'Remove all Services'
|
||
|
,handler: 'removeAllServices'
|
||
|
}
|
||
|
]
|
||
9 years ago
|
,columns: [
|
||
|
{
|
||
|
xtype: 'templatecolumn'
|
||
|
,width: 50
|
||
|
,variableRowHeight: true
|
||
9 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" />'
|
||
9 years ago
|
}
|
||
|
,{ text: 'Name', dataIndex: 'name', variableRowHeight: true, flex: 1 }
|
||
|
,{
|
||
|
xtype: 'actioncolumn'
|
||
|
,width: 60
|
||
|
,align: 'right'
|
||
9 years ago
|
,items: [
|
||
|
{
|
||
9 years ago
|
glyph: 0xf1f7
|
||
|
,tooltip: 'Prevent notifications'
|
||
|
,getClass: function( value, metaData, record, rowIndex, colIndex, store, view ){
|
||
|
if ( record.get('notifications') ) return 'x-hidden';
|
||
|
}
|
||
|
}
|
||
|
,{
|
||
|
glyph: 0xf026
|
||
|
,tooltip: 'Muted'
|
||
|
,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
|
||
|
,tooltip: 'Configure'
|
||
|
,handler: 'configureService'
|
||
|
,getClass: function(){ return 'x-hidden-display'; }
|
||
9 years ago
|
}
|
||
9 years ago
|
,{
|
||
|
glyph: 0xf1f8
|
||
|
,tooltip: 'Remove'
|
||
|
,handler: 'removeService'
|
||
|
,getClass: function(){ return 'x-hidden-display'; }
|
||
|
}
|
||
9 years ago
|
]
|
||
|
}
|
||
|
]
|
||
9 years ago
|
,viewConfig: {
|
||
|
emptyText: 'No services added...'
|
||
|
,forceFit: true
|
||
|
}
|
||
9 years ago
|
}
|
||
|
]
|
||
9 years ago
|
,tbar: {
|
||
|
xtype: 'toolbar'
|
||
|
,height: 42
|
||
|
,ui: 'main'
|
||
|
,enableOverflow: true
|
||
|
,overflowHandler: 'menu'
|
||
|
,items: [
|
||
|
{
|
||
|
glyph: 'xf1f7@FontAwesome'
|
||
|
,text: 'Don\'t Disturb: OFF'
|
||
|
,tooltip: 'Lock this app if you will be away for a period of time.'
|
||
|
,enableToggle: true
|
||
|
,handler: 'dontDisturb'
|
||
|
,reference: 'disturbBtn'
|
||
|
}
|
||
|
,{
|
||
|
glyph: 'xf023@FontAwesome'
|
||
|
,text: 'Lock Rambox'
|
||
|
,tooltip: 'Lock this app if you will be away for a period of time.'
|
||
|
,handler: 'lockRambox'
|
||
|
}
|
||
|
,'->'
|
||
|
,{
|
||
|
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: 'Logout'
|
||
|
,glyph: 'xf08b@FontAwesome'
|
||
|
,handler: 'logout'
|
||
|
}
|
||
|
]
|
||
|
}
|
||
|
,{
|
||
|
text: 'Login'
|
||
|
,icon: 'resources/auth0.png'
|
||
|
,id: 'loginBtn'
|
||
9 years ago
|
,tooltip: 'Login to save your configuration (no credentials stored) to sync with all your computers.<br /><br /><i>Powered by Auth0 (http://auth0.com)</i>'
|
||
9 years ago
|
,bind: {
|
||
|
hidden: '{username}'
|
||
|
}
|
||
|
,handler: 'login'
|
||
|
}
|
||
|
]
|
||
|
}
|
||
9 years ago
|
,bbar: [
|
||
9 years ago
|
{
|
||
|
text: 'Donate'
|
||
9 years ago
|
,glyph: 'xf1ed@FontAwesome'
|
||
9 years ago
|
,href: 'https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=WU75QWS7LH2CA'
|
||
|
}
|
||
|
,'->'
|
||
9 years ago
|
,{
|
||
|
xtype: 'label'
|
||
|
,html: '<span class="fa fa-code" style="color:black;"></span> with <span class="fa fa-heart" style="color:red;"></span> from Argentina as an Open Source project.'
|
||
|
}
|
||
|
,'->'
|
||
9 years ago
|
,{
|
||
|
glyph: 'xf082@FontAwesome'
|
||
|
,href: 'https://www.facebook.com/ramboxapp'
|
||
|
}
|
||
|
,{
|
||
|
glyph: 'xf099@FontAwesome'
|
||
|
,href: 'https://www.twitter.com/ramboxapp'
|
||
|
}
|
||
|
,{
|
||
|
glyph: 'xf09b@FontAwesome'
|
||
|
,href: 'https://www.github.com/saenzramiro/rambox'
|
||
|
}
|
||
9 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'
|
||
9 years ago
|
}
|
||
9 years ago
|
});
|