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 totalServicesLoaded: 0
,totalNotifications: 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 () { ,launch: function () {
// Set Google Analytics events // Set Google Analytics events
ga_storage._setAccount('UA-80680424-1'); // ga_storage._setAccount('UA-80680424-1');
ga_storage._trackPageview('/index.html', 'main'); // ga_storage._trackPageview('/index.html', 'main');
ga_storage._trackEvent('Versions', require('electron').remote.app.getVersion()); // ga_storage._trackEvent('Versions', require('electron').remote.app.getVersion());
// Initialize Auth0 // Initialize Auth0
Rambox.ux.Auth0.init(); // PHISCH: Deactivated
//Rambox.ux.Auth0.init();
// EXPORT DEFUALT SERVICES
this.defaultServices();
//TestForEmptyServices();
// Check for updates // Check for updates
Rambox.app.checkUpdate(true); Rambox.app.checkUpdate(true);

6
app/package.json

@ -1,8 +1,8 @@
{ {
"name": "Rambox", "name": "HumanistenBox",
"productName": "Rambox", "productName": "HumanistenBox",
"version": "0.5.7", "version": "0.5.7",
"description": "Rambox", "description": "HumanistenBox",
"main": "electron/main.js", "main": "electron/main.js",
"private": true, "private": true,
"repository": { "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' xtype: 'checkboxgroup'
,items: [ ,items: [
{ // {
xtype: 'checkbox' // xtype: 'checkbox'
,boxLabel: 'Messaging' // ,boxLabel: 'Messaging'
,name: '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 ,checked: true
,uncheckedValue: false ,uncheckedValue: false
,inputValue: true ,inputValue: true
} }
,{ ,{
xtype: 'checkbox' xtype: 'checkbox'
,boxLabel: 'Email' ,boxLabel: 'Mitarbeiter'
,margin: '0 10 0 10' ,margin: '0 10 0 10'
,name: 'email' ,name: 'mitarbeiter'
,checked: true ,checked: true
,uncheckedValue: false ,uncheckedValue: false
,inputValue: true ,inputValue: true
@ -135,7 +153,7 @@ Ext.define('Rambox.view.main.Main', {
xtype: 'button' xtype: 'button'
,glyph: 'xf1f8@FontAwesome' ,glyph: 'xf1f8@FontAwesome'
,baseCls: '' ,baseCls: ''
,tooltip: 'Remove all Services' ,tooltip: 'Zurücksetzen'
,handler: 'removeAllServices' ,handler: 'removeAllServices'
} }
] ]
@ -300,16 +318,16 @@ Ext.define('Rambox.view.main.Main', {
} }
] ]
} }
,{ // ,{
text: 'Login' // text: 'Login'
,icon: 'resources/auth0.png' // ,icon: 'resources/auth0.png'
,id: 'loginBtn' // ,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>' // ,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: { // ,bind: {
hidden: '{username}' // hidden: '{username}'
} // }
,handler: 'login' // ,handler: 'login'
} // }
,{ ,{
tooltip: 'Preferences' tooltip: 'Preferences'
,glyph: 'xf013@FontAwesome' ,glyph: 'xf013@FontAwesome'
@ -318,54 +336,54 @@ Ext.define('Rambox.view.main.Main', {
] ]
} }
,bbar: [ ,bbar: [
{ // {
xtype: 'segmentedbutton' // xtype: 'segmentedbutton'
,allowToggle: false // ,allowToggle: false
,items: [ // ,items: [
{ // {
text: '<b>Help us</b> with' // text: '<b>Help us</b> with'
,pressed: true // ,pressed: true
} // }
,{ // ,{
text: 'Donation' // text: 'Donation'
,glyph: 'xf21e@FontAwesome' // ,glyph: 'xf21e@FontAwesome'
,handler: 'showDonate' // ,handler: 'showDonate'
} // }
,{ // ,{
text: 'Translation' // text: 'Translation'
,glyph: 'xf0ac@FontAwesome' // ,glyph: 'xf0ac@FontAwesome'
,href: 'https://crowdin.com/project/rambox/invite' // ,href: 'https://crowdin.com/project/rambox/invite'
} // }
] // ]
} // }
,'->' // ,'->'
,{ // ,{
xtype: 'label' // 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.' // ,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' // xtype: 'segmentedbutton'
,allowToggle: false // ,allowToggle: false
,items: [ // ,items: [
{ // {
text: '<b>Follow us</b>' // text: '<b>Follow us</b>'
,pressed: true // ,pressed: true
} // }
,{ // ,{
glyph: 'xf082@FontAwesome' // glyph: 'xf082@FontAwesome'
,href: 'https://www.facebook.com/ramboxapp' // ,href: 'https://www.facebook.com/ramboxapp'
} // }
,{ // ,{
glyph: 'xf099@FontAwesome' // glyph: 'xf099@FontAwesome'
,href: 'https://www.twitter.com/ramboxapp' // ,href: 'https://www.twitter.com/ramboxapp'
} // }
,{ // ,{
glyph: 'xf09b@FontAwesome' // glyph: 'xf09b@FontAwesome'
,href: 'https://www.github.com/saenzramiro/rambox' // ,href: 'https://www.github.com/saenzramiro/rambox'
} // }
] // ]
} // }
] ]
} }
,{ id: 'tbfill', tabConfig : { xtype : 'tbfill' } } ,{ id: 'tbfill', tabConfig : { xtype : 'tbfill' } }

2
electron/main.js

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

Loading…
Cancel
Save