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/yammer/LICENSE | 21 +++++++++++++++++++++ uncompressed/yammer/README.md | 3 +++ uncompressed/yammer/icon.svg | 6 ++++++ uncompressed/yammer/index.js | 3 +++ uncompressed/yammer/package.json | 15 +++++++++++++++ uncompressed/yammer/webview.js | 22 ++++++++++++++++++++++ 6 files changed, 70 insertions(+) create mode 100644 uncompressed/yammer/LICENSE create mode 100644 uncompressed/yammer/README.md create mode 100644 uncompressed/yammer/icon.svg create mode 100644 uncompressed/yammer/index.js create mode 100644 uncompressed/yammer/package.json create mode 100644 uncompressed/yammer/webview.js (limited to 'uncompressed/yammer') diff --git a/uncompressed/yammer/LICENSE b/uncompressed/yammer/LICENSE new file mode 100644 index 0000000..dcde793 --- /dev/null +++ b/uncompressed/yammer/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 Dave Reid + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/uncompressed/yammer/README.md b/uncompressed/yammer/README.md new file mode 100644 index 0000000..05fbe7d --- /dev/null +++ b/uncompressed/yammer/README.md @@ -0,0 +1,3 @@ +# Franz Recipe for Yammer + +This is the unofficial [Franz 5](https://meetfranz.com/) recipe for [Yammer](https://www.yammer.com/). diff --git a/uncompressed/yammer/icon.svg b/uncompressed/yammer/icon.svg new file mode 100644 index 0000000..76fad28 --- /dev/null +++ b/uncompressed/yammer/icon.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/uncompressed/yammer/index.js b/uncompressed/yammer/index.js new file mode 100644 index 0000000..e8243fb --- /dev/null +++ b/uncompressed/yammer/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = Franz => Franz; \ No newline at end of file diff --git a/uncompressed/yammer/package.json b/uncompressed/yammer/package.json new file mode 100644 index 0000000..16b68b7 --- /dev/null +++ b/uncompressed/yammer/package.json @@ -0,0 +1,15 @@ +{ + "id": "yammer", + "name": "Yammer", + "version": "1.0.0", + "description": "Yammer plugin for Franz 5", + "main": "index.js", + "author": "Dave Reid ", + "license": "MIT", + "config": { + "serviceURL": "https://www.yammer.com/login", + "hasDirectMessages": true, + "hasIndirectMessages": true, + "hasNotificationSound": false + } +} diff --git a/uncompressed/yammer/webview.js b/uncompressed/yammer/webview.js new file mode 100644 index 0000000..8f80675 --- /dev/null +++ b/uncompressed/yammer/webview.js @@ -0,0 +1,22 @@ +"use strict"; + +module.exports = Franz => { + const getMessages = function getMessages() { + let directMessages = 0; + let indirectMessages = 0; + const notificationElement = document.querySelector(".yj-notifications-indicator-count"); + const newMessagesElement = document.querySelector(".yj-thread-list--new-messages-notice:not(.is-hidden) .yj-thread-list--new-message-text"); + + if (notificationElement && notificationElement.innerHTML.length) { + directMessages = parseInt(notificationElement.innerHTML, 10); + } + + if (newMessagesElement && newMessagesElement.innerHTML.length) { + indirectMessages = parseInt(newMessagesElement.innerHTML.match(/\d+/)[0], 10); + } + + Franz.setBadge(directMessages, indirectMessages); + }; + + Franz.loop(getMessages); +}; \ No newline at end of file -- cgit v1.2.3-70-g09d2