From 528535b1de8b9cd87b703f121ca75ef268d40868 Mon Sep 17 00:00:00 2001 From: phischdev Date: Wed, 17 May 2017 04:03:33 +0200 Subject: [PATCH] facebook --- app/Application.js | 21 ++++++++++----------- app/store/ServicesList.js | 8 ++++++++ app/view/main/Main.js | 1 + electron/main.js | 8 +++++++- 4 files changed, 26 insertions(+), 12 deletions(-) diff --git a/app/Application.js b/app/Application.js index 69dc708f..d2b0f888 100644 --- a/app/Application.js +++ b/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, diff --git a/app/store/ServicesList.js b/app/store/ServicesList.js index 330d4318..8f21e373 100644 --- a/app/store/ServicesList.js +++ b/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' diff --git a/app/view/main/Main.js b/app/view/main/Main.js index cda33493..0afb4420 100644 --- a/app/view/main/Main.js +++ b/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: [ diff --git a/electron/main.js b/electron/main.js index 1c45271e..a37f4ce2 100644 --- a/electron/main.js +++ b/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(); });