Browse Source

neue Sachen

pull/943/head
phischdev 8 years ago
parent
commit
3c74f5b887
  1. 21
      app/Application.js
  2. 4
      app/model/Service.js
  3. 4
      app/model/ServiceList.js
  4. 1
      app/store/Services.js
  5. 10
      app/store/ServicesList.js
  6. 26
      app/view/add/Add.js
  7. 13
      app/view/main/Main.js
  8. 12
      app/view/main/MainController.js

21
app/Application.js

@ -39,8 +39,8 @@ Ext.define('Rambox.Application', {
const defaults =[ const defaults =[
{ {
"position": 1, "position": 1,
"type": "custom", "type": "info",
"logo": "", "logo": "custom.png",
"name": "Info", "name": "Info",
"url": "https://tools.diehumanisten.de", "url": "https://tools.diehumanisten.de",
"align": "left", "align": "left",
@ -52,13 +52,14 @@ Ext.define('Rambox.Application', {
"enabled": true, "enabled": true,
"js_unread": "", "js_unread": "",
"zoomLevel": 0, "zoomLevel": 0,
"id": 11 "id": 11,
"removable": false
}, },
{ {
"position": 2, "position": 2,
"type": "slack", "type": "slack",
"logo": "slack.png", "logo": "slack.png",
"name": "Chat (Slack)", "name": "Slack",
"url": "https://pgs-diehumanisten.slack.com/", "url": "https://pgs-diehumanisten.slack.com/",
"align": "left", "align": "left",
"notifications": true, "notifications": true,
@ -69,7 +70,8 @@ Ext.define('Rambox.Application', {
"enabled": true, "enabled": true,
"js_unread": "", "js_unread": "",
"zoomLevel": 0, "zoomLevel": 0,
"id": 1 "id": 1,
"removable": false
}, },
{ {
"position": 3, "position": 3,
@ -86,7 +88,8 @@ Ext.define('Rambox.Application', {
"enabled": true, "enabled": true,
"js_unread": "", "js_unread": "",
"zoomLevel": 0, "zoomLevel": 0,
"id": 10 "id": 10,
"removable": false
}, },
{ {
"position": 4, "position": 4,
@ -103,7 +106,8 @@ Ext.define('Rambox.Application', {
"enabled": true, "enabled": true,
"js_unread": "", "js_unread": "",
"zoomLevel": 0, "zoomLevel": 0,
"id": 16 "id": 16,
"removable": false
}, },
{ {
@ -121,7 +125,8 @@ Ext.define('Rambox.Application', {
"enabled": true, "enabled": true,
"js_unread": "", "js_unread": "",
"zoomLevel": 0, "zoomLevel": 0,
"id": 18 "id": 18,
"removable": false
}, { }, {
"position": 6, "position": 6,
"type": "facebook", "type": "facebook",

4
app/model/Service.js

@ -61,5 +61,9 @@ Ext.define('Rambox.model.Service', {
name: 'zoomLevel' name: 'zoomLevel'
, type: 'number' , type: 'number'
, defaultValue: 0 , defaultValue: 0
}, {
name: 'removable'
,type: 'boolean'
,defaultValue: true
}] }]
}); });

4
app/model/ServiceList.js

@ -51,5 +51,9 @@ Ext.define('Rambox.model.ServiceList', {
name: 'dont_update_unread_from_title' name: 'dont_update_unread_from_title'
, type: 'boolean' , type: 'boolean'
, defaultValue: false , defaultValue: false
},{
name: 'removable'
,type: 'boolean'
,defaultValue: true
}] }]
}); });

1
app/store/Services.js

@ -47,6 +47,7 @@ Ext.define('Rambox.store.Services', {
,src: service.get('url') ,src: service.get('url')
,type: service.get('type') ,type: service.get('type')
,muted: service.get('muted') ,muted: service.get('muted')
,removable: service.get('removable')
,includeInGlobalUnreadCounter: service.get('includeInGlobalUnreadCounter') ,includeInGlobalUnreadCounter: service.get('includeInGlobalUnreadCounter')
,displayTabUnreadCounter: service.get('displayTabUnreadCounter') ,displayTabUnreadCounter: service.get('displayTabUnreadCounter')
,enabled: service.get('enabled') ,enabled: service.get('enabled')

10
app/store/ServicesList.js

@ -34,7 +34,7 @@ Ext.define('Rambox.store.ServicesList', {
logo: 'wiki.png' , logo: 'wiki.png' ,
name: 'WikiMedia' , name: 'WikiMedia' ,
url: 'http://___/wiki', url: 'http://___/wiki',
type: 'mitglieder' type: 'mitglieder',
}, },
{ {
id: 'slack' id: 'slack'
@ -92,6 +92,14 @@ Ext.define('Rambox.store.ServicesList', {
,type: 'custom' ,type: 'custom'
,allow_popups: true ,allow_popups: true
}, },
{
id: 'info'
,logo: 'custom.png'
,name: 'Infos'
,description: 'Infoseite zu unseren Plattformen'
,url: '___'
,type: 'mitglied'
},
{ {
id: 'roundcube' id: 'roundcube'
,logo: 'roundcube.png' ,logo: 'roundcube.png'

26
app/view/add/Add.js

@ -26,6 +26,9 @@ Ext.define('Rambox.view.add.Add',{
,initComponent: function() { ,initComponent: function() {
var me = this; var me = this;
const removable = !me.record.get('removable');
console.log("NOT REMOVABLE: ", removable);
me.title = (!me.edit ? 'Add ' : 'Edit ') + me.record.get('name'); me.title = (!me.edit ? 'Add ' : 'Edit ') + me.record.get('name');
me.icon = me.record.get('type') === 'custom' ? (!me.edit ? 'resources/icons/custom.png' : (me.record.get('logo') === '' ? 'resources/icons/custom.png' : me.record.get('logo'))) : 'resources/icons/'+me.record.get('logo'); me.icon = me.record.get('type') === 'custom' ? (!me.edit ? 'resources/icons/custom.png' : (me.record.get('logo') === '' ? 'resources/icons/custom.png' : me.record.get('logo'))) : 'resources/icons/'+me.record.get('logo');
@ -40,6 +43,7 @@ Ext.define('Rambox.view.add.Add',{
,name: 'serviceName' ,name: 'serviceName'
,allowBlank: true ,allowBlank: true
,listeners: { specialkey: 'onEnter' } ,listeners: { specialkey: 'onEnter' }
,disabled: removable
} }
,{ ,{
xtype: 'container' xtype: 'container'
@ -58,6 +62,7 @@ Ext.define('Rambox.view.add.Add',{
,vtype: me.record.get('url') === '___' ? 'url' : '' ,vtype: me.record.get('url') === '___' ? 'url' : ''
,width: 275 ,width: 275
,listeners: { specialkey: 'onEnter' } ,listeners: { specialkey: 'onEnter' }
,disabled: removable
} }
,{ ,{
xtype: 'cycle' xtype: 'cycle'
@ -79,6 +84,7 @@ Ext.define('Rambox.view.add.Add',{
,disabled: me.edit ? !me.service.get('custom_domain') : !me.record.get('custom_domain') ,disabled: me.edit ? !me.service.get('custom_domain') : !me.record.get('custom_domain')
} }
] ]
,disabled: removable
} }
// Fixes bug EXTJS-20094 for version Ext JS 5 // Fixes bug EXTJS-20094 for version Ext JS 5
,arrowHandler: function(cycleBtn, e) { ,arrowHandler: function(cycleBtn, e) {
@ -107,6 +113,8 @@ Ext.define('Rambox.view.add.Add',{
,{ ,{
xtype: 'hiddenfield' xtype: 'hiddenfield'
,name: 'cycleValue' ,name: 'cycleValue'
,disabled: removable
,value: me.edit ? (me.service.get('custom_domain') && me.service.get('url') === me.record.get('url') ? 1 : (!Ext.String.endsWith(me.record.get('url'), me.service.get('url').split('___')[1]) ? 2 : 1)) : 1 ,value: me.edit ? (me.service.get('custom_domain') && me.service.get('url') === me.record.get('url') ? 1 : (!Ext.String.endsWith(me.record.get('url'), me.service.get('url').split('___')[1]) ? 2 : 1)) : 1
} }
] ]
@ -122,23 +130,25 @@ Ext.define('Rambox.view.add.Add',{
,hidden: me.record.get('type') !== 'custom' ,hidden: me.record.get('type') !== 'custom'
,margin: '5 0 0 0' ,margin: '5 0 0 0'
,listeners: { specialkey: 'onEnter' } ,listeners: { specialkey: 'onEnter' }
,disabled: removable
} }
,{ ,{
xtype: 'fieldset' xtype: 'fieldset'
,title: 'Options' ,title: 'Einstellungen'
,margin: '10 0 0 0' ,margin: '10 0 0 0'
,items: [ ,items: [
{ {
xtype: 'checkbox' xtype: 'checkbox'
,boxLabel: 'Align to Right' ,boxLabel: 'Rechts anordnen'
,checked: me.edit ? (me.record.get('align') === 'right' ? true : false) : false ,checked: me.edit ? (me.record.get('align') === 'right' ? true : false) : false
,name: 'align' ,name: 'align'
,uncheckedValue: 'left' ,uncheckedValue: 'left'
,inputValue: 'right' ,inputValue: 'right'
,disabled: removable
} }
,{ ,{
xtype: 'checkbox' xtype: 'checkbox'
,boxLabel: 'Show notifications' ,boxLabel: 'Benachrichtigungen anzeigen'
,name: 'notifications' ,name: 'notifications'
,checked: me.edit ? me.record.get('notifications') : true ,checked: me.edit ? me.record.get('notifications') : true
,uncheckedValue: false ,uncheckedValue: false
@ -146,7 +156,7 @@ Ext.define('Rambox.view.add.Add',{
} }
,{ ,{
xtype: 'checkbox' xtype: 'checkbox'
,boxLabel: 'Mute all sounds' ,boxLabel: 'Stummschalten'
,name: 'muted' ,name: 'muted'
,checked: me.edit ? me.record.get('muted') : false ,checked: me.edit ? me.record.get('muted') : false
,uncheckedValue: false ,uncheckedValue: false
@ -165,12 +175,12 @@ Ext.define('Rambox.view.add.Add',{
}, },
{ {
xtype: 'fieldset', xtype: 'fieldset',
title: 'Unread counter', title: 'Zähler für ungelesene Nachrichten',
margin: '10 0 0 0', margin: '10 0 0 0',
items: [ items: [
{ {
xtype: 'checkbox', xtype: 'checkbox',
boxLabel: 'Display tab unread counter', boxLabel: 'Zähler im Tab anzeigen',
name: 'displayTabUnreadCounter', name: 'displayTabUnreadCounter',
checked: me.edit ? me.record.get('displayTabUnreadCounter') : true, checked: me.edit ? me.record.get('displayTabUnreadCounter') : true,
uncheckedValue: false, uncheckedValue: false,
@ -178,7 +188,7 @@ Ext.define('Rambox.view.add.Add',{
}, },
{ {
xtype: 'checkbox', xtype: 'checkbox',
boxLabel: 'Include in global unread counter', boxLabel: 'Zum allgemeinen Zähler dazurechnen',
name: 'includeInGlobalUnreadCounter', name: 'includeInGlobalUnreadCounter',
checked: me.edit ? me.record.get('includeInGlobalUnreadCounter') : true, checked: me.edit ? me.record.get('includeInGlobalUnreadCounter') : true,
uncheckedValue: false, uncheckedValue: false,
@ -201,7 +211,9 @@ Ext.define('Rambox.view.add.Add',{
,value: me.edit ? me.record.get('js_unread') : '' ,value: me.edit ? me.record.get('js_unread') : ''
,anchor: '100%' ,anchor: '100%'
,height: 120 ,height: 120
,disabled: function(view, rowIndex, colIndex, item, record) {return !record.get('editable'); }
} }
] ]
} }
,{ ,{

13
app/view/main/Main.js

@ -37,7 +37,7 @@ Ext.define('Rambox.view.main.Main', {
,items: [ ,items: [
{ {
xtype: 'panel' xtype: 'panel'
,title: 'Add a new Service' ,title: 'Unsere Plattformen'
,margin: '0 5 0 0' ,margin: '0 5 0 0'
,flex: 1 ,flex: 1
,header: { height: 50 } ,header: { height: 50 }
@ -131,7 +131,7 @@ Ext.define('Rambox.view.main.Main', {
} }
,{ ,{
xtype: 'grid' xtype: 'grid'
,title: 'Enabled Services' ,title: 'Konfigurierte Plattformen'
,store: 'Services' ,store: 'Services'
,hideHeaders: true ,hideHeaders: true
,margin: '0 0 0 5' ,margin: '0 0 0 5'
@ -153,9 +153,9 @@ Ext.define('Rambox.view.main.Main', {
xtype: 'button' xtype: 'button'
,glyph: 'xf1f8@FontAwesome' ,glyph: 'xf1f8@FontAwesome'
,baseCls: '' ,baseCls: ''
,tooltip: 'Zurücksetzen' ,tooltip: 'Alles zurücksetzen'
,handler: 'removeAllServices' ,handler: 'removeAllServices'
,title: 'Zurücksetzen' ,title: 'Alles zurücksetzen'
} }
] ]
,columns: [ ,columns: [
@ -208,6 +208,7 @@ Ext.define('Rambox.view.main.Main', {
} }
,{ ,{
glyph: 0xf1f8 glyph: 0xf1f8
,isDisabled: function(view, rowIndex, colIndex, item, record) { return !record.get('removable')}
,tooltip: 'Remove' ,tooltip: 'Remove'
,handler: 'removeService' ,handler: 'removeService'
,getClass: function(){ return 'x-hidden-display'; } ,getClass: function(){ return 'x-hidden-display'; }
@ -247,7 +248,7 @@ Ext.define('Rambox.view.main.Main', {
,items: [ ,items: [
{ {
glyph: 'xf1f7@FontAwesome' glyph: 'xf1f7@FontAwesome'
,text: 'Don\'t Disturb: '+(JSON.parse(localStorage.getItem('dontDisturb')) ? 'ON' : 'OFF') ,text: 'Nicht stören: '+(JSON.parse(localStorage.getItem('dontDisturb')) ? 'An' : 'Aus')
,tooltip: 'Disable notifications and sounds in all services. Perfect to be concentrated and focused.<br/><b>Shortcut key: F1</b>' ,tooltip: 'Disable notifications and sounds in all services. Perfect to be concentrated and focused.<br/><b>Shortcut key: F1</b>'
,enableToggle: true ,enableToggle: true
,handler: 'dontDisturb' ,handler: 'dontDisturb'
@ -257,7 +258,7 @@ Ext.define('Rambox.view.main.Main', {
} }
,{ ,{
glyph: 'xf023@FontAwesome' glyph: 'xf023@FontAwesome'
,text: 'Lock Rambox' ,text: 'Passwortsperre'
,tooltip: 'Lock this app if you will be away for a period of time.<br/><b>Shortcut key: F2</b>' ,tooltip: 'Lock this app if you will be away for a period of time.<br/><b>Shortcut key: F2</b>'
,handler: 'lockRambox' ,handler: 'lockRambox'
,id: 'lockRamboxBtn' ,id: 'lockRamboxBtn'

12
app/view/main/MainController.js

@ -87,7 +87,7 @@ Ext.define('Rambox.view.main.MainController', {
,removeService: function( gridView, rowIndex, colIndex, col, e, rec, rowEl ) { ,removeService: function( gridView, rowIndex, colIndex, col, e, rec, rowEl ) {
var me = this; var me = this;
Ext.Msg.confirm('Please confirm...', 'Are you sure you want to remove <b>'+rec.get('name')+'</b>?', function(btnId) { Ext.Msg.confirm('Bitte bestätige...', 'Bist du sicher, dass du <b>' + rec.get('name') + '</b> löschen möchtest?', function(btnId) {
if ( btnId === 'yes' ) me.removeServiceFn(rec.get('id')); if ( btnId === 'yes' ) me.removeServiceFn(rec.get('id'));
}); });
} }
@ -99,7 +99,7 @@ Ext.define('Rambox.view.main.MainController', {
document.title = 'HumanistenBox'; document.title = 'HumanistenBox';
if ( btn ) { if ( btn ) {
Ext.Msg.confirm('Please confirm...', 'Are you sure you want to remove all services?', function(btnId) { Ext.Msg.confirm('Bitte bestätige...', 'Bist du sicher, dass du das Programm auf den Ausganszustand zurücksetzen möchtest?', function(btnId) {
if ( btnId === 'yes' ) { if ( btnId === 'yes' ) {
Ext.cq1('app-main').suspendEvent('remove'); Ext.cq1('app-main').suspendEvent('remove');
Ext.Array.each(Ext.getStore('Services').collect('id'), function(serviceId) { Ext.Array.each(Ext.getStore('Services').collect('id'), function(serviceId) {
@ -208,13 +208,13 @@ Ext.define('Rambox.view.main.MainController', {
localStorage.setItem('dontDisturb', btn.pressed); localStorage.setItem('dontDisturb', btn.pressed);
btn.setText('Don\'t Disturb: ' + ( btn.pressed ? 'ON' : 'OFF' )); btn.setText('Nicht stören: ' + ( btn.pressed ? 'An' : 'Aus' ));
// If this method is called from Lock method, prevent showing toast // If this method is called from Lock method, prevent showing toast
if ( !e ) return; if ( !e ) return;
Ext.toast({ Ext.toast({
html: btn.pressed ? 'ENABLED' : 'DISABLED' html: btn.pressed ? 'An' : 'Aus'
,title: 'Don\'t Disturb' ,title: 'Nicht stören'
,width: 200 ,width: 200
,align: 't' ,align: 't'
,closable: false ,closable: false
@ -224,7 +224,7 @@ Ext.define('Rambox.view.main.MainController', {
,lockRambox: function(btn) { ,lockRambox: function(btn) {
var me = this; var me = this;
var msgbox = Ext.Msg.prompt('Lock Rambox', 'Enter a temporal password to unlock it later', function(btnId, text) { var msgbox = Ext.Msg.prompt('Passwortsperre', 'Enter a temporal password to unlock it later', function(btnId, text) {
if ( btnId === 'ok' ) { if ( btnId === 'ok' ) {
var msgbox2 = Ext.Msg.prompt('Lock Rambox', 'Repeat the temporal password', function(btnId, text2) { var msgbox2 = Ext.Msg.prompt('Lock Rambox', 'Repeat the temporal password', function(btnId, text2) {
if ( btnId === 'ok' ) { if ( btnId === 'ok' ) {

Loading…
Cancel
Save