Browse Source

added KIX

pull/943/head
phischdev 8 years ago
parent
commit
da6c4bbeb1
  1. 19
      app/Application.js
  2. 285
      electron/menu.js

19
app/Application.js

@ -206,6 +206,23 @@ Ext.define('Rambox.Application', {
"js_unread": "", "js_unread": "",
"zoomLevel": 0, "zoomLevel": 0,
"id": 9 "id": 9
},
{
"position": 11,
"type": "custom",
"logo": "",
"name": "KIX",
"url": "https://kix.diehumanisten.de",
"align": "right",
"notifications": true,
"muted": false,
"displayTabUnreadCounter": true,
"includeInGlobalUnreadCounter": true,
"trust": true,
"enabled": false,
"js_unread": "",
"zoomLevel": 0,
"id": 13
} }
]; ];
@ -249,7 +266,7 @@ Ext.define('Rambox.Application', {
//Rambox.ux.Auth0.init(); //Rambox.ux.Auth0.init();
// EXPORT DEFUALT SERVICES // EXPORT DEFUALT SERVICES
// this.exportDefaultServices();
this.defaultServices(); this.defaultServices();
//TestForEmptyServices(); //TestForEmptyServices();

285
electron/menu.js

@ -17,123 +17,101 @@ function sendAction(action) {
} }
const helpSubmenu = [ const helpSubmenu = [
{ // {
label: `&Visit ${appName} Website`, // label: `&Visit ${appName} Website`,
click() { // click() {
shell.openExternal('http://rambox.pro'); // shell.openExternal('http://rambox.pro');
} // }
}, // },
{ // {
label: `&Facebook`, // label: `&Facebook`,
click() { // click() {
shell.openExternal('https://www.facebook.com/ramboxapp'); // shell.openExternal('https://www.facebook.com/ramboxapp');
} // }
}, // },
{ // {
label: `&Twitter`, // label: `&Twitter`,
click() { // click() {
shell.openExternal('https://www.twitter.com/ramboxapp'); // shell.openExternal('https://www.twitter.com/ramboxapp');
} // }
}, // },
{ // {
label: `&GitHub`, // label: `&GitHub`,
click() { // click() {
shell.openExternal('https://www.github.com/saenzramiro/rambox'); // shell.openExternal('https://www.github.com/saenzramiro/rambox');
} // }
}, // },
{ // {
type: 'separator' // type: 'separator'
}, // },
{ // {
label: '&Report an Issue...', // label: '&Report an Issue...',
click() { // click() {
const body = ` // const body = `
<!-- Please describe here your issue and steps to reproduce it. --> // <!-- Please describe here your issue and steps to reproduce it. -->
//
//
//
// <!-- DON'T REMOVE THE FOLLOWING LINES -->
// -
// > ${app.getName()} ${app.getVersion()}
// > Electron ${process.versions.electron}
// > ${process.platform} ${process.arch} ${os.release()}`;
//
// shell.openExternal(`https://github.com/saenzramiro/rambox/issues/new?body=${encodeURIComponent(body)}`);
// }
// },
// {
// label: `&Ask for Help`,
// click() {
// shell.openExternal('https://gitter.im/saenzramiro/rambox');
// }
// },
<!-- DON'T REMOVE THE FOLLOWING LINES --> // {
- // type: 'separator'
> ${app.getName()} ${app.getVersion()} // },
> Electron ${process.versions.electron} // {
> ${process.platform} ${process.arch} ${os.release()}`; // label: `&Donate`,
// click() {
shell.openExternal(`https://github.com/saenzramiro/rambox/issues/new?body=${encodeURIComponent(body)}`); // shell.openExternal('https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=WU75QWS7LH2CA');
} // }
}, // }
{
label: `&Ask for Help`,
click() {
shell.openExternal('https://gitter.im/saenzramiro/rambox');
}
},
{
label: `&Tools`,
submenu: [
{
label: `&Clear Cache`,
click(item, win) {
win.webContents.session.clearCache(function() {
win.reload();
});
}
},
{
label: `&Clear Local Storage`,
click(item, win) {
win.webContents.session.clearStorageData({
storages: ['localstorage']
}, function() {
win.reload();
});
}
}
]
},
{
type: 'separator'
},
{
label: `&Donate`,
click() {
shell.openExternal('https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=WU75QWS7LH2CA');
}
}
]; ];
let tpl = [ let tpl = [
{ // {
label: '&Edit', // label: '&Edit',
submenu: [ // submenu: [
{ // {
role: 'undo' // role: 'undo'
}, // },
{ // {
role: 'redo' // role: 'redo'
}, // },
{ // {
type: 'separator' // type: 'separator'
}, // },
{ // {
role: 'cut' // role: 'cut'
}, // },
{ // {
role: 'copy' // role: 'copy'
}, // },
{ // {
role: 'paste' // role: 'paste'
}, // },
{ // {
role: 'pasteandmatchstyle' // role: 'pasteandmatchstyle'
}, // },
{ // {
role: 'selectall' // role: 'selectall'
}, // },
{ // {
role: 'delete' // role: 'delete'
} // }
] // ]
}, // },
{ {
label: '&View', label: '&View',
submenu: [ submenu: [
@ -162,6 +140,27 @@ let tpl = [
}, },
{ {
role: 'resetzoom' role: 'resetzoom'
},
{
type: 'separator'
},
{
label: `&Clear Cache`,
click(item, win) {
win.webContents.session.clearCache(function() {
win.reload();
});
}
},
{
label: `&Clear Local Storage`,
click(item, win) {
win.webContents.session.clearStorageData({
storages: ['localstorage']
}, function() {
win.reload();
});
}
} }
] ]
}, },
@ -194,10 +193,10 @@ let tpl = [
} }
] ]
}, },
{ // {
label: '&Help', // label: '&Help',
role: 'help' // role: 'help'
} // }
]; ];
if (process.platform === 'darwin') { if (process.platform === 'darwin') {
@ -252,34 +251,34 @@ if (process.platform === 'darwin') {
] ]
}); });
} else { } else {
tpl.unshift({ // tpl.unshift({
label: '&File', // label: '&File',
submenu: [ // submenu: [
{ // {
role: 'quit' // role: 'quit'
} // }
] // ]
}); // });
helpSubmenu.push({ // helpSubmenu.push({
type: 'separator' // type: 'separator'
}); // });
helpSubmenu.push({ // helpSubmenu.push({
label: `&Check for updates...`, // label: `&Check for updates...`,
click(item, win) { // click(item, win) {
const webContents = win.webContents; // const webContents = win.webContents;
const send = webContents.send.bind(win.webContents); // const send = webContents.send.bind(win.webContents);
send('autoUpdater:check-update'); // send('autoUpdater:check-update');
} // }
}); // });
helpSubmenu.push({ // helpSubmenu.push({
label: `&About ${appName}`, // label: `&About ${appName}`,
click() { // click() {
sendAction('showAbout') // sendAction('showAbout')
} // }
}); // });
} }
tpl[tpl.length - 1].submenu = helpSubmenu; // tpl[tpl.length - 1].submenu = helpSubmenu;
var menu = electron.Menu.buildFromTemplate(tpl); var menu = electron.Menu.buildFromTemplate(tpl);
module.exports = menu; module.exports = menu;

Loading…
Cancel
Save