From 6f5e4a00588aefdda7a5a1cfe70935870e7e234a Mon Sep 17 00:00:00 2001 From: Bennett Date: Tue, 22 Sep 2020 20:56:48 +0200 Subject: Unpack recipes and update recipes icons (#292) Co-authored-by: Amine Mouafik --- recipes/stride/LICENSE | 21 +++++++++++++++++++++ recipes/stride/README.md | 5 +++++ recipes/stride/icon.png | Bin 0 -> 57924 bytes recipes/stride/icon.svg | 20 ++++++++++++++++++++ recipes/stride/index.js | 4 ++++ recipes/stride/package.json | 16 ++++++++++++++++ recipes/stride/service.css | 3 +++ recipes/stride/webview.js | 36 ++++++++++++++++++++++++++++++++++++ 8 files changed, 105 insertions(+) create mode 100644 recipes/stride/LICENSE create mode 100644 recipes/stride/README.md create mode 100644 recipes/stride/icon.png create mode 100644 recipes/stride/icon.svg create mode 100644 recipes/stride/index.js create mode 100644 recipes/stride/package.json create mode 100644 recipes/stride/service.css create mode 100644 recipes/stride/webview.js (limited to 'recipes/stride') diff --git a/recipes/stride/LICENSE b/recipes/stride/LICENSE new file mode 100644 index 0000000..95dbff7 --- /dev/null +++ b/recipes/stride/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 Tobi042 + +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/recipes/stride/README.md b/recipes/stride/README.md new file mode 100644 index 0000000..e01bcc5 --- /dev/null +++ b/recipes/stride/README.md @@ -0,0 +1,5 @@ +# Stride for Franz +This is the unofficial Franz recipe for Atlassian Stride + +### How to create your own Franz recipes: +* [Read the documentation](https://github.com/meetfranz/plugins) diff --git a/recipes/stride/icon.png b/recipes/stride/icon.png new file mode 100644 index 0000000..baca210 Binary files /dev/null and b/recipes/stride/icon.png differ diff --git a/recipes/stride/icon.svg b/recipes/stride/icon.svg new file mode 100644 index 0000000..e2c9a27 --- /dev/null +++ b/recipes/stride/icon.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/recipes/stride/index.js b/recipes/stride/index.js new file mode 100644 index 0000000..1111509 --- /dev/null +++ b/recipes/stride/index.js @@ -0,0 +1,4 @@ +"use strict"; + +module.exports = Franz => Franz; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0cmlkZS9pbmRleC5qcyJdLCJuYW1lcyI6WyJtb2R1bGUiLCJleHBvcnRzIiwiRnJhbnoiXSwibWFwcGluZ3MiOiI7O0FBQUFBLE9BQU9DLE9BQVAsR0FBaUJDLFNBQVNBLEtBQTFCIiwiZmlsZSI6InN0cmlkZS9pbmRleC5qcyIsInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0gRnJhbnogPT4gRnJhbno7XG4iXX0= \ No newline at end of file diff --git a/recipes/stride/package.json b/recipes/stride/package.json new file mode 100644 index 0000000..527bdd7 --- /dev/null +++ b/recipes/stride/package.json @@ -0,0 +1,16 @@ +{ + "id": "stride", + "name": "Stride", + "version": "1.1.0", + "description": "Atlassian Stride", + "main": "index.js", + "author": "Tobias Theobald ", + "license": "MIT", + "config": { + "serviceURL": "https://app.stride.com", + "hasNotificationSound": true, + "hasDirectMessages": true, + "hasIndirectMessages": true, + "hasTeamId": false + } +} diff --git a/recipes/stride/service.css b/recipes/stride/service.css new file mode 100644 index 0000000..a2d0935 --- /dev/null +++ b/recipes/stride/service.css @@ -0,0 +1,3 @@ +html { + background-color: #FFF !important; +} \ No newline at end of file diff --git a/recipes/stride/webview.js b/recipes/stride/webview.js new file mode 100644 index 0000000..c75b3ad --- /dev/null +++ b/recipes/stride/webview.js @@ -0,0 +1,36 @@ +'use strict'; + +var _path = require('path'); + +var _path2 = _interopRequireDefault(_path); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +module.exports = Franz => { + const getMessages = function getMessages() { + // get all message badges + const allBadges = document.querySelectorAll('.activity-indicator'); + let directCount = 0, + indirectCount = 0; + + // get unread direct messages by tring to read the badge values + allBadges.forEach(item => { + if (item.hasAttribute('data-count')) { + // Count for DMs should be in the data-count attribute + directCount += Math.max(1, +item.getAttribute('data-count')); + } else { + // this will be the case for indirect messages + indirectCount++; + } + }); + + // set Franz badge + Franz.setBadge(directCount, indirectCount); + }; + // check for new messages every second and update Franz badge + Franz.loop(getMessages); + + // inject franz.css stylesheet + Franz.injectCSS(_path2.default.join(__dirname, 'service.css')); +}; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0cmlkZS93ZWJ2aWV3LmpzIl0sIm5hbWVzIjpbIm1vZHVsZSIsImV4cG9ydHMiLCJGcmFueiIsImdldE1lc3NhZ2VzIiwiYWxsQmFkZ2VzIiwiZG9jdW1lbnQiLCJxdWVyeVNlbGVjdG9yQWxsIiwiZGlyZWN0Q291bnQiLCJpbmRpcmVjdENvdW50IiwiZm9yRWFjaCIsIml0ZW0iLCJoYXNBdHRyaWJ1dGUiLCJNYXRoIiwibWF4IiwiZ2V0QXR0cmlidXRlIiwic2V0QmFkZ2UiLCJsb29wIiwiaW5qZWN0Q1NTIiwiam9pbiIsIl9fZGlybmFtZS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