From 728d339739b63e9bb59e457e4a84fe9a65b93fc9 Mon Sep 17 00:00:00 2001 From: vantezzen Date: Sat, 28 Sep 2019 12:10:25 +0200 Subject: Add uncompressed recipes --- uncompressed/gmail/README.md | 5 ++++ uncompressed/gmail/icon.svg | 56 +++++++++++++++++++++++++++++++++++++++++ uncompressed/gmail/index.js | 3 +++ uncompressed/gmail/package.json | 12 +++++++++ uncompressed/gmail/webview.js | 23 +++++++++++++++++ 5 files changed, 99 insertions(+) create mode 100644 uncompressed/gmail/README.md create mode 100644 uncompressed/gmail/icon.svg create mode 100644 uncompressed/gmail/index.js create mode 100644 uncompressed/gmail/package.json create mode 100644 uncompressed/gmail/webview.js (limited to 'uncompressed/gmail') diff --git a/uncompressed/gmail/README.md b/uncompressed/gmail/README.md new file mode 100644 index 0000000..907f13c --- /dev/null +++ b/uncompressed/gmail/README.md @@ -0,0 +1,5 @@ +# Gmail for Franz +This is the official Franz recipe for Gmail + +### How to create your own Franz recipes: +* [Read the documentation](https://github.com/meetfranz/plugins) diff --git a/uncompressed/gmail/icon.svg b/uncompressed/gmail/icon.svg new file mode 100644 index 0000000..bb75f1e --- /dev/null +++ b/uncompressed/gmail/icon.svg @@ -0,0 +1,56 @@ + + + + Layer 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/uncompressed/gmail/index.js b/uncompressed/gmail/index.js new file mode 100644 index 0000000..e8243fb --- /dev/null +++ b/uncompressed/gmail/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = Franz => Franz; \ No newline at end of file diff --git a/uncompressed/gmail/package.json b/uncompressed/gmail/package.json new file mode 100644 index 0000000..9af00ed --- /dev/null +++ b/uncompressed/gmail/package.json @@ -0,0 +1,12 @@ +{ + "id": "gmail", + "name": "Gmail", + "version": "1.1.1", + "description": "Gmail", + "main": "index.js", + "author": "Stefan Malzner ", + "license": "MIT", + "config": { + "serviceURL": "https://mail.google.com" + } +} diff --git a/uncompressed/gmail/webview.js b/uncompressed/gmail/webview.js new file mode 100644 index 0000000..521d4ad --- /dev/null +++ b/uncompressed/gmail/webview.js @@ -0,0 +1,23 @@ +"use strict"; + +module.exports = Franz => { + const getMessages = function getMessages() { + let count = 0; + + if (document.getElementsByClassName('J-Ke n0').length > 0) { + if (document.getElementsByClassName('J-Ke n0')[0].getAttribute('aria-label') != null) { + count = parseInt(document.getElementsByClassName('J-Ke n0')[0].getAttribute('aria-label').replace(/[^0-9.]/g, ''), 10); + } + } + + count = parseInt(count, 10); + + if (isNaN(count)) { + count = 0; + } + + Franz.setBadge(count); + }; + + Franz.loop(getMessages); +}; \ No newline at end of file -- cgit v1.2.3-70-g09d2