aboutsummaryrefslogtreecommitdiffstats
path: root/recipes
diff options
context:
space:
mode:
authorLibravatar Cromefire_ <tim.langhorst@outlook.de>2021-01-05 22:59:23 +0100
committerLibravatar GitHub <noreply@github.com>2021-01-05 22:59:23 +0100
commit822c5680c0461c90468cd8a69a37e3354376c73c (patch)
tree3b303387bb6f6270d92b82a703df802800a6626c /recipes
parentAdd recipe for Infomaniak Mail (#373) (diff)
downloadferdium-recipes-822c5680c0461c90468cd8a69a37e3354376c73c.tar.gz
ferdium-recipes-822c5680c0461c90468cd8a69a37e3354376c73c.tar.zst
ferdium-recipes-822c5680c0461c90468cd8a69a37e3354376c73c.zip
Synchronize Outlook services and correct message count (#398)
Diffstat (limited to 'recipes')
-rw-r--r--recipes/office365-owa/README.md8
-rw-r--r--recipes/office365-owa/index.js4
-rw-r--r--recipes/office365-owa/package.json2
-rw-r--r--recipes/office365-owa/webview.js15
-rw-r--r--recipes/outlook/README.md8
-rw-r--r--recipes/outlook/index.js4
-rw-r--r--recipes/outlook/package.json23
-rw-r--r--recipes/outlook/webview.js38
8 files changed, 64 insertions, 38 deletions
diff --git a/recipes/office365-owa/README.md b/recipes/office365-owa/README.md
index a35ef46..0aca27b 100644
--- a/recipes/office365-owa/README.md
+++ b/recipes/office365-owa/README.md
@@ -1,5 +1,5 @@
1# Office 365 Outlook Web App for Franz 1# Office 365 Outlook Web App for Ferdi
2This is the Franz 5 Recipe for Office 365 Outlook Web App 2This is the Ferdi 5 Recipe for Office 365 Outlook Web App
3 3
4### How to create your own Franz recipes: 4### How to create your own Ferdi recipes:
5* [Read the documentation](https://github.com/meetfranz/plugins) 5* [Read the documentation](https://github.com/getferdi/recipes/blob/master/docs/integration.md.)
diff --git a/recipes/office365-owa/index.js b/recipes/office365-owa/index.js
index ce5229a..12994ff 100644
--- a/recipes/office365-owa/index.js
+++ b/recipes/office365-owa/index.js
@@ -1,7 +1,7 @@
1var os = require('os') 1var os = require('os')
2 2
3module.exports = Franz => 3module.exports = Ferdi =>
4 class Owa extends Franz { 4 class Outlook extends Ferdi {
5 overrideUserAgent() { 5 overrideUserAgent() {
6 return window.navigator.userAgent.replace(/(Ferdi|Electron)\/\S+ \([^)]+\)/g,"").trim(); 6 return window.navigator.userAgent.replace(/(Ferdi|Electron)\/\S+ \([^)]+\)/g,"").trim();
7 } 7 }
diff --git a/recipes/office365-owa/package.json b/recipes/office365-owa/package.json
index 1ffb2ee..35c4647 100644
--- a/recipes/office365-owa/package.json
+++ b/recipes/office365-owa/package.json
@@ -10,7 +10,7 @@
10 ], 10 ],
11 "license": "MIT", 11 "license": "MIT",
12 "config": { 12 "config": {
13 "serviceURL": "https://outlook.office365.com/owa", 13 "serviceURL": "https://outlook.office365.com/mail/",
14 "hasNotificationSound": true, 14 "hasNotificationSound": true,
15 "hasTeamId": false 15 "hasTeamId": false
16 } 16 }
diff --git a/recipes/office365-owa/webview.js b/recipes/office365-owa/webview.js
index ae21e19..6d4edf2 100644
--- a/recipes/office365-owa/webview.js
+++ b/recipes/office365-owa/webview.js
@@ -1,7 +1,7 @@
1'use strict'; 1'use strict';
2 2
3module.exports = Franz => { 3module.exports = Ferdi => {
4 const getMessages = function getMessages() { 4 function getMessages() {
5 let unreadMail = 0; 5 let unreadMail = 0;
6 6
7 if (location.pathname.match(/\/owa/)) { 7 if (location.pathname.match(/\/owa/)) {
@@ -14,12 +14,13 @@ module.exports = Franz => {
14 ); 14 );
15 } else { 15 } else {
16 // new app 16 // new app
17 const folders = document.querySelector('div[title="Folders"]'); 17 const favorites = document.querySelector('div[title="Favorites"]');
18 if (!folders) { 18 if (!favorites) {
19 return; 19 return;
20 } 20 }
21 const folders = Array.from(favorites.nextSibling.childNodes);
21 22
22 unreadMail = [...folders.parentNode.parentNode.children].reduce((count, child) => { 23 unreadMail = folders.reduce((count, child) => {
23 const unread = child.querySelector('.screenReaderOnly'); 24 const unread = child.querySelector('.screenReaderOnly');
24 return unread && unread.textContent === 'unread' 25 return unread && unread.textContent === 'unread'
25 ? count + parseInt(unread.previousSibling.textContent, 10) 26 ? count + parseInt(unread.previousSibling.textContent, 10)
@@ -27,7 +28,7 @@ module.exports = Franz => {
27 }, 0); 28 }, 0);
28 } 29 }
29 30
30 Franz.setBadge(unreadMail); 31 Ferdi.setBadge(unreadMail);
31 }; 32 };
32 Franz.loop(getMessages); 33 Ferdi.loop(getMessages);
33}; 34};
diff --git a/recipes/outlook/README.md b/recipes/outlook/README.md
index 8d68fd4..47dbb00 100644
--- a/recipes/outlook/README.md
+++ b/recipes/outlook/README.md
@@ -1,5 +1,5 @@
1# Outlook Web App for Franz 1# Outlook Web App for Ferdi
2This is the Franz 5 Recipe for Outlook Web App 2This is the Ferdi 5 Recipe for Outlook Web App
3 3
4### How to create your own Franz recipes: 4### How to create your own Ferdi recipes:
5* [Read the documentation](https://github.com/meetfranz/plugins) 5* [Read the documentation](https://github.com/getferdi/recipes/blob/master/docs/integration.md.)
diff --git a/recipes/outlook/index.js b/recipes/outlook/index.js
index 5d96b3e..12994ff 100644
--- a/recipes/outlook/index.js
+++ b/recipes/outlook/index.js
@@ -1,7 +1,7 @@
1var os = require('os') 1var os = require('os')
2 2
3module.exports = Franz => 3module.exports = Ferdi =>
4 class Outlook extends Franz { 4 class Outlook extends Ferdi {
5 overrideUserAgent() { 5 overrideUserAgent() {
6 return window.navigator.userAgent.replace(/(Ferdi|Electron)\/\S+ \([^)]+\)/g,"").trim(); 6 return window.navigator.userAgent.replace(/(Ferdi|Electron)\/\S+ \([^)]+\)/g,"").trim();
7 } 7 }
diff --git a/recipes/outlook/package.json b/recipes/outlook/package.json
index 79f3b4b..7594b71 100644
--- a/recipes/outlook/package.json
+++ b/recipes/outlook/package.json
@@ -1,13 +1,14 @@
1{ 1{
2 "id": "outlook", 2 "id": "outlook",
3 "name": "Outlook", 3 "name": "Outlook Web App",
4 "version": "1.0.1", 4 "version": "1.1.0",
5 "description": "Outlook Web App", 5 "description": "Outlook Web App",
6 "main": "index.js", 6 "main": "index.js",
7 "author": "Wouter Van Speybroeck <wouter.van.speybroeck@gmail.com>", 7 "author": "Wouter Van Speybroeck <wouter.van.speybroeck@gmail.com>",
8 "repository": "", 8 "license": "MIT",
9 "license": "MIT", 9 "config": {
10 "config": { 10 "serviceURL": "https://outlook.live.com/mail/",
11 "serviceURL": "https://outlook.live.com/owa/" 11 "hasNotificationSound": true,
12 } 12 "hasTeamId": false
13 }
13} 14}
diff --git a/recipes/outlook/webview.js b/recipes/outlook/webview.js
index 7e30fe4..6d4edf2 100644
--- a/recipes/outlook/webview.js
+++ b/recipes/outlook/webview.js
@@ -1,10 +1,34 @@
1"use strict"; 1'use strict';
2 2
3module.exports = Franz => { 3module.exports = Ferdi => {
4 const getMessages = function getMessages() { 4 function getMessages() {
5 const unreadMail = parseInt(jQuery("i[data-icon-name='Inbox'] + span + span > span").first().text(), 10); 5 let unreadMail = 0;
6 Franz.setBadge(unreadMail); 6
7 if (location.pathname.match(/\/owa/)) {
8 // classic app
9 unreadMail = parseInt(
10 jQuery("span[title*='Inbox'] + div > span")
11 .first()
12 .text(),
13 10
14 );
15 } else {
16 // new app
17 const favorites = document.querySelector('div[title="Favorites"]');
18 if (!favorites) {
19 return;
20 }
21 const folders = Array.from(favorites.nextSibling.childNodes);
22
23 unreadMail = folders.reduce((count, child) => {
24 const unread = child.querySelector('.screenReaderOnly');
25 return unread && unread.textContent === 'unread'
26 ? count + parseInt(unread.previousSibling.textContent, 10)
27 : count;
28 }, 0);
29 }
30
31 Ferdi.setBadge(unreadMail);
7 }; 32 };
8 Franz.loop(getMessages); 33 Ferdi.loop(getMessages);
9}; 34};
10//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm9mZmljZTM2NS1vd2Evd2Vidmlldy5qcyJdLCJuYW1lcyI6WyJtb2R1bGUiLCJleHBvcnRzIiwiRnJhbnoiLCJnZXRNZXNzYWdlcyIsInVucmVhZE1haWwiLCJwYXJzZUludCIsImpRdWVyeSIsImZpcnN0IiwidGV4dCIsInNldEJhZGdlIiwibG9vcCJdLCJtYXBwaW5ncyI6Ijs7QUFBQSxPQUFPLEFBQVAsVUFBa0IsQUFBRCxTQUFXLEFBQzFCO1FBQU0sY0FBYyxTQUFTLEFBQVQsY0FBdUIsQUFDekM7VUFBTSxhQUFhLFNBQVMsT0FBTyxBQUFQLEFBQTRDLEFBQTVDLEFBQW9ELEFBQXBELGtEQUFULEFBQXFFLEFBQXJFLEFBQW5CLGdCQUNBO1VBQU0sQUFBTixTQUFlLEFBQWYsQUFDRDtBQUhELEFBSUE7UUFBTSxBQUFOLEtBQVcsQUFBWCxBQUNEO0FBTkQiLCJmaWxlIjoib2ZmaWNlMzY1LW93YS93ZWJ2aWV3LmpzIiwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSAoRnJhbnopID0+IHtcbiAgY29uc3QgZ2V0TWVzc2FnZXMgPSBmdW5jdGlvbiBnZXRNZXNzYWdlcygpIHtcbiAgICBjb25zdCB1bnJlYWRNYWlsID0gcGFyc2VJbnQoalF1ZXJ5KFwic3Bhblt0aXRsZSo9J0luYm94J10gKyBkaXYgPiBzcGFuXCIpLmZpcnN0KCkudGV4dCgpLCAxMCk7XG4gICAgRnJhbnouc2V0QmFkZ2UodW5yZWFkTWFpbCk7XG4gIH07XG4gIEZyYW56Lmxvb3AoZ2V0TWVzc2FnZXMpO1xufTtcbiJdfQ== \ No newline at end of file