Browse Source

HumanistenBox

pull/943/head
phischdev 8 years ago
parent
commit
7f1392eb6a
  1. 229
      app/Application.js
  2. 6
      app/package.json
  3. 1409
      app/store/ServicesList.js
  4. 150
      app/view/main/Main.js
  5. 2
      electron/main.js

229
app/Application.js

@ -23,15 +23,236 @@ Ext.define('Rambox.Application', {
totalServicesLoaded: 0
,totalNotifications: 0
}
,getStoredServices: function () {
var stored = Ext.getStore('Services').load();
stored = stored.data.items;
stored = stored.map(g => g.data);
return stored;
}
,defaultServices: function () {
const stored = this.getStoredServices();
console.log("STORED SERVICES", stored);
if (stored.length === 0) {
console.log('KEINE SERVICES');
const defaults =[
{
"position": 1,
"type": "custom",
"logo": "",
"name": "Info",
"url": "https://tools.diehumanisten.de",
"align": "left",
"notifications": true,
"muted": false,
"displayTabUnreadCounter": false,
"includeInGlobalUnreadCounter": false,
"trust": false,
"enabled": true,
"js_unread": "",
"zoomLevel": 0,
"id": 11
},
{
"position": 2,
"type": "slack",
"logo": "slack.png",
"name": "Chat (Slack)",
"url": "https://pgs-diehumanisten.slack.com/",
"align": "left",
"notifications": true,
"muted": false,
"displayTabUnreadCounter": true,
"includeInGlobalUnreadCounter": true,
"trust": true,
"enabled": true,
"js_unread": "",
"zoomLevel": 0,
"id": 1
},
{
"position": 3,
"type": "trello",
"logo": "trello.png",
"name": "Trello",
"url": "https://trello.com/login",
"align": "left",
"notifications": true,
"muted": false,
"displayTabUnreadCounter": true,
"includeInGlobalUnreadCounter": true,
"trust": true,
"enabled": true,
"js_unread": "",
"zoomLevel": 0,
"id": 10
},
{
"position": 4,
"type": "custom",
"logo": "",
"name": "Disk",
"url": "https://disk.diehumanisten.de",
"align": "left",
"notifications": true,
"muted": false,
"displayTabUnreadCounter": true,
"includeInGlobalUnreadCounter": true,
"trust": true,
"enabled": true,
"js_unread": "",
"zoomLevel": 0,
"id": 2
},
{
"position": 5,
"type": "custom",
"logo": "",
"name": "Wiki",
"url": "https://wiki.diehumanisten.de",
"align": "left",
"notifications": true,
"muted": false,
"displayTabUnreadCounter": true,
"includeInGlobalUnreadCounter": true,
"trust": true,
"enabled": true,
"js_unread": "",
"zoomLevel": 0,
"id": 7
},
{
"position": 6,
"type": "custom",
"logo": "",
"name": "Facebook",
"url": "https://facebook.com",
"align": "left",
"notifications": true,
"muted": false,
"displayTabUnreadCounter": true,
"includeInGlobalUnreadCounter": true,
"trust": true,
"enabled": true,
"js_unread": "",
"zoomLevel": 0,
"id": 8
},
{
"position": 7,
"type": "roundcube",
"logo": "roundcube.png",
"name": "Mail",
"url": "https://webmail.diehumanisten.de",
"align": "right",
"notifications": true,
"muted": false,
"displayTabUnreadCounter": true,
"includeInGlobalUnreadCounter": true,
"trust": true,
"enabled": false,
"js_unread": "",
"zoomLevel": 0,
"id": 3
},
{
"position": 8,
"type": "hangouts",
"logo": "hangouts.png",
"name": "Hangouts",
"url": "https://hangouts.google.com/",
"align": "right",
"notifications": true,
"muted": false,
"displayTabUnreadCounter": true,
"includeInGlobalUnreadCounter": true,
"trust": true,
"enabled": false,
"js_unread": "",
"zoomLevel": 0,
"id": 4
},
{
"position": 9,
"type": "tweetdeck",
"logo": "tweetdeck.png",
"name": "Twitter",
"url": "https://tweetdeck.twitter.com/",
"align": "right",
"notifications": true,
"muted": false,
"displayTabUnreadCounter": true,
"includeInGlobalUnreadCounter": true,
"trust": true,
"enabled": false,
"js_unread": "",
"zoomLevel": 0,
"id": 5
},
{
"position": 10,
"type": "custom",
"logo": "",
"name": "Facebook Manager",
"url": "https://facebook.com",
"align": "right",
"notifications": true,
"muted": false,
"displayTabUnreadCounter": true,
"includeInGlobalUnreadCounter": true,
"trust": true,
"enabled": false,
"js_unread": "",
"zoomLevel": 0,
"id": 9
}
];
defaults.forEach( function(s) {
var service = Ext.create('Rambox.model.Service', s);
service.save();
Ext.getStore('Services').add(service);
var tabData = {
xtype: 'webview'
,id: 'tab_'+service.get('id')
,record: service
,tabConfig: {
service: service
}
};
if ( s['align'] === 'left' ) {
var tbfill = Ext.cq1('app-main').getTabBar().down('tbfill');
Ext.cq1('app-main').insert(Ext.cq1('app-main').getTabBar().items.indexOf(tbfill), tabData).show();
} else {
Ext.cq1('app-main').add(tabData).show();
}
});
}
}
,exportDefaultServices: function () {
const stored = this.getStoredServices();
const json = Ext.encode(stored);
console.log("SERVICES:", json);
}
,launch: function () {
// Set Google Analytics events
ga_storage._setAccount('UA-80680424-1');
ga_storage._trackPageview('/index.html', 'main');
ga_storage._trackEvent('Versions', require('electron').remote.app.getVersion());
// ga_storage._setAccount('UA-80680424-1');
// ga_storage._trackPageview('/index.html', 'main');
// ga_storage._trackEvent('Versions', require('electron').remote.app.getVersion());
// Initialize Auth0
Rambox.ux.Auth0.init();
// PHISCH: Deactivated
//Rambox.ux.Auth0.init();
// EXPORT DEFUALT SERVICES
this.defaultServices();
//TestForEmptyServices();
// Check for updates
Rambox.app.checkUpdate(true);

6
app/package.json

@ -1,8 +1,8 @@
{
"name": "Rambox",
"productName": "Rambox",
"name": "HumanistenBox",
"productName": "HumanistenBox",
"version": "0.5.7",
"description": "Rambox",
"description": "HumanistenBox",
"main": "electron/main.js",
"private": true,
"repository": {

1409
app/store/ServicesList.js

File diff suppressed because it is too large Load Diff

150
app/view/main/Main.js

@ -45,19 +45,37 @@ Ext.define('Rambox.view.main.Main', {
{
xtype: 'checkboxgroup'
,items: [
{
xtype: 'checkbox'
,boxLabel: 'Messaging'
,name: 'messaging'
// {
// xtype: 'checkbox'
// ,boxLabel: 'Messaging'
// ,name: 'messaging'
// ,checked: false
// ,uncheckedValue: false
// ,inputValue: true
// }
// ,{
// xtype: 'checkbox'
// ,boxLabel: 'Email'
// ,margin: '0 10 0 10'
// ,name: 'email'
// ,checked: false
// ,uncheckedValue: false
// ,inputValue: true
// }
,{
xtype: 'checkbox'
,boxLabel: 'Mitglieder'
,margin: '0 10 0 10'
,name: 'mitglieder'
,checked: true
,uncheckedValue: false
,inputValue: true
}
,{
xtype: 'checkbox'
,boxLabel: 'Email'
xtype: 'checkbox'
,boxLabel: 'Mitarbeiter'
,margin: '0 10 0 10'
,name: 'email'
,name: 'mitarbeiter'
,checked: true
,uncheckedValue: false
,inputValue: true
@ -135,7 +153,7 @@ Ext.define('Rambox.view.main.Main', {
xtype: 'button'
,glyph: 'xf1f8@FontAwesome'
,baseCls: ''
,tooltip: 'Remove all Services'
,tooltip: 'Zurücksetzen'
,handler: 'removeAllServices'
}
]
@ -300,16 +318,16 @@ Ext.define('Rambox.view.main.Main', {
}
]
}
,{
text: 'Login'
,icon: 'resources/auth0.png'
,id: 'loginBtn'
,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>'
,bind: {
hidden: '{username}'
}
,handler: 'login'
}
// ,{
// text: 'Login'
// ,icon: 'resources/auth0.png'
// ,id: 'loginBtn'
// ,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>'
// ,bind: {
// hidden: '{username}'
// }
// ,handler: 'login'
// }
,{
tooltip: 'Preferences'
,glyph: 'xf013@FontAwesome'
@ -318,54 +336,54 @@ Ext.define('Rambox.view.main.Main', {
]
}
,bbar: [
{
xtype: 'segmentedbutton'
,allowToggle: false
,items: [
{
text: '<b>Help us</b> with'
,pressed: true
}
,{
text: 'Donation'
,glyph: 'xf21e@FontAwesome'
,handler: 'showDonate'
}
,{
text: 'Translation'
,glyph: 'xf0ac@FontAwesome'
,href: 'https://crowdin.com/project/rambox/invite'
}
]
}
,'->'
,{
xtype: 'label'
,html: '<span class="fa fa-code" style="color:black;"></span> with <span class="fa fa-heart" style="color:red;"></span> from <img src="resources/flag.png" alt="Argentina" data-qtip="Argentina" /> as an Open Source project.'
}
,'->'
,{
xtype: 'segmentedbutton'
,allowToggle: false
,items: [
{
text: '<b>Follow us</b>'
,pressed: true
}
,{
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'
}
]
}
// {
// xtype: 'segmentedbutton'
// ,allowToggle: false
// ,items: [
// {
// text: '<b>Help us</b> with'
// ,pressed: true
// }
// ,{
// text: 'Donation'
// ,glyph: 'xf21e@FontAwesome'
// ,handler: 'showDonate'
// }
// ,{
// text: 'Translation'
// ,glyph: 'xf0ac@FontAwesome'
// ,href: 'https://crowdin.com/project/rambox/invite'
// }
// ]
// }
// ,'->'
// ,{
// xtype: 'label'
// ,html: '<span class="fa fa-code" style="color:black;"></span> with <span class="fa fa-heart" style="color:red;"></span> from <img src="resources/flag.png" alt="Argentina" data-qtip="Argentina" /> as an Open Source project.'
// }
// ,'->'
// ,{
// xtype: 'segmentedbutton'
// ,allowToggle: false
// ,items: [
// {
// text: '<b>Follow us</b>'
// ,pressed: true
// }
// ,{
// 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'
// }
// ]
// }
]
}
,{ id: 'tbfill', tabConfig : { xtype : 'tbfill' } }

2
electron/main.js

@ -123,7 +123,7 @@ let isQuitting = false;
function createWindow () {
// Create the browser window using the state information
mainWindow = new BrowserWindow({
title: 'Rambox'
title: 'HumanistenBox'
,icon: __dirname + '/../resources/Icon.ico'
,backgroundColor: '#FFF'
,x: config.get('x')

Loading…
Cancel
Save