Browse Source

facebook

pull/943/head
phischdev 8 years ago
parent
commit
528535b1de
  1. 21
      app/Application.js
  2. 8
      app/store/ServicesList.js
  3. 1
      app/view/main/Main.js
  4. 8
      electron/main.js

21
app/Application.js

@ -108,10 +108,10 @@ Ext.define('Rambox.Application', {
{
"position": 5,
"type": "custom",
"logo": "",
"type": "wiki",
"logo": "wiki.png",
"name": "Wiki",
"url": "https://wiki.diehumanisten.de",
"url": "http://wiki.diehumanisten.de/wiki",
"align": "left",
"notifications": true,
"muted": false,
@ -121,14 +121,13 @@ Ext.define('Rambox.Application', {
"enabled": true,
"js_unread": "",
"zoomLevel": 0,
"id": 7
},
{
"id": 18
}, {
"position": 6,
"type": "custom",
"logo": "",
"type": "facebook",
"logo": "facebook.png",
"name": "Facebook",
"url": "https://facebook.com",
"url": "https://www.facebook.com/parteiderhumanisten",
"align": "left",
"notifications": true,
"muted": false,
@ -138,7 +137,7 @@ Ext.define('Rambox.Application', {
"enabled": true,
"js_unread": "",
"zoomLevel": 0,
"id": 8
"id": 20
},
{
"position": 7,
@ -151,7 +150,7 @@ Ext.define('Rambox.Application', {
"muted": false,
"displayTabUnreadCounter": true,
"includeInGlobalUnreadCounter": true,
"trust": true,
"trust": false,
"enabled": false,
"js_unread": "",
"zoomLevel": 0,

8
app/store/ServicesList.js

@ -55,6 +55,14 @@ Ext.define('Rambox.store.ServicesList', {
,url: "https://___"
,js_unread: 'function checkUnread(){var a=0,b=0;document.querySelector(".widget-link.badge-notification.unread-private-messages")&&(a=parseInt(document.querySelector(".widget-link.badge-notification.unread-private-messages").title,10)),document.querySelector(".widget-link.badge-notification.unread-notifications")&&(b=parseInt(document.querySelector(".widget-link.badge-notification.unread-notifications").title,10)),updateBadge(a+b)}function updateBadge(a){document.title=a>=1?"("+a+") "+originalTitle:originalTitle}var originalTitle=document.title;setInterval(checkUnread,3e3);'
},
{
id: 'facebook'
,logo: 'facebook.png'
,name: 'Facebook'
,type: 'mitglieder'
,url: "https://www.facebook.com/___"
//,js_unread: 'function checkUnread(){var a=0,b=0;document.querySelector(".widget-link.badge-notification.unread-private-messages")&&(a=parseInt(document.querySelector(".widget-link.badge-notification.unread-private-messages").title,10)),document.querySelector(".widget-link.badge-notification.unread-notifications")&&(b=parseInt(document.querySelector(".widget-link.badge-notification.unread-notifications").title,10)),updateBadge(a+b)}function updateBadge(a){document.title=a>=1?"("+a+") "+originalTitle:originalTitle}var originalTitle=document.title;setInterval(checkUnread,3e3);'
},
{
id: 'hangouts'
,logo: 'hangouts.png'

1
app/view/main/Main.js

@ -155,6 +155,7 @@ Ext.define('Rambox.view.main.Main', {
,baseCls: ''
,tooltip: 'Zurücksetzen'
,handler: 'removeAllServices'
,title: 'Zurücksetzen'
}
]
,columns: [

8
electron/main.js

@ -159,16 +159,22 @@ function createWindow () {
if ( fs.existsSync(path.resolve(path.dirname(process.execPath), '..', 'Update.exe')) ) updater.initialize(mainWindow);
// Open links in default browser
//TODO: link services
mainWindow.webContents.on('new-window', function(e, url, frameName, disposition, options) {
if ( disposition !== 'foreground-tab' ) return;
const protocol = require('url').parse(url).protocol;
if (protocol === 'http:' || protocol === 'https:' || protocol === 'mailto:') {
if (protocol === 'mailto:') {
e.preventDefault();
shell.openExternal(url);
} else if (protocol === 'http:' || protocol === 'https:') {
console.log("NEW_WINDOW: ", url, frameName, disposition, options);
e.preventDefault();
shell.openExternal(url);
}
});
mainWindow.webContents.on('will-navigate', function(event, url) {
console.log("SAME_WINDOW: ", url, frameName, disposition, options);
event.preventDefault();
});

Loading…
Cancel
Save