From 1a083dd39c67cc28ca69af9e63632ebaead18059 Mon Sep 17 00:00:00 2001 From: djshadowxm82 Date: Sun, 20 Oct 2019 18:15:03 -0400 Subject: Add files via upload --- uncompressed/redditchat/README.md | 5 ++ uncompressed/redditchat/icon.png | Bin 0 -> 14976 bytes uncompressed/redditchat/icon.svg | 94 +++++++++++++++++++++++++++++++++++ uncompressed/redditchat/index.js | 2 + uncompressed/redditchat/package.json | 13 +++++ uncompressed/redditchat/webview.js | 23 +++++++++ 6 files changed, 137 insertions(+) create mode 100644 uncompressed/redditchat/README.md create mode 100644 uncompressed/redditchat/icon.png create mode 100644 uncompressed/redditchat/icon.svg create mode 100644 uncompressed/redditchat/index.js create mode 100644 uncompressed/redditchat/package.json create mode 100644 uncompressed/redditchat/webview.js (limited to 'uncompressed') diff --git a/uncompressed/redditchat/README.md b/uncompressed/redditchat/README.md new file mode 100644 index 0000000..4a55681 --- /dev/null +++ b/uncompressed/redditchat/README.md @@ -0,0 +1,5 @@ +# Reddit Chat for Franz +This is the unofficial Franz recipe for Reddit Chat. Still In Development + +### How to create your own Franz recipes: +* [Read the documentation](https://github.com/meetfranz/plugins) diff --git a/uncompressed/redditchat/icon.png b/uncompressed/redditchat/icon.png new file mode 100644 index 0000000..123268c Binary files /dev/null and b/uncompressed/redditchat/icon.png differ diff --git a/uncompressed/redditchat/icon.svg b/uncompressed/redditchat/icon.svg new file mode 100644 index 0000000..f8b7eda --- /dev/null +++ b/uncompressed/redditchat/icon.svg @@ -0,0 +1,94 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + diff --git a/uncompressed/redditchat/index.js b/uncompressed/redditchat/index.js new file mode 100644 index 0000000..bff9333 --- /dev/null +++ b/uncompressed/redditchat/index.js @@ -0,0 +1,2 @@ +// just pass through Franz +module.exports = Franz => Franz; \ No newline at end of file diff --git a/uncompressed/redditchat/package.json b/uncompressed/redditchat/package.json new file mode 100644 index 0000000..f691800 --- /dev/null +++ b/uncompressed/redditchat/package.json @@ -0,0 +1,13 @@ +{ + "id": "redditchat", + "name": "Reddit Chat", + "version": "1.0.0", + "description": "Reddit Chat", + "main": "index.js", + "author": "Alex Bloom { + // Regular expression for (*) or (1), will extract the asterisk or the number + const titleRegEx = /^\(([\*\d])\)/; + const getMessages = function unreadCount() { + var directCount = 0; + var indirectCount = 0; + + var matchArr = document.title.match(titleRegEx); + if (matchArr) { + if (matchArr[1] === '*') { + indirectCount = 1; + } else { + directCount = Number(matchArr[1]); + } + } + + Franz.setBadge(directCount, indirectCount); + } + + Franz.loop(getMessages); +}; -- cgit v1.2.3-70-g09d2