From 006f850d0edc87c7d96055b3466838b49bb0b430 Mon Sep 17 00:00:00 2001 From: vantezzen Date: Sat, 28 Mar 2020 09:54:31 +0100 Subject: Add Jira --- uncompressed/jira/LICENSE | 21 +++++++++++++++++++++ uncompressed/jira/README.md | 5 +++++ uncompressed/jira/icon.png | Bin 0 -> 32910 bytes uncompressed/jira/icon.svg | 17 +++++++++++++++++ uncompressed/jira/index.js | 8 ++++++++ uncompressed/jira/package.json | 15 +++++++++++++++ uncompressed/jira/webview.js | 16 ++++++++++++++++ 7 files changed, 82 insertions(+) create mode 100644 uncompressed/jira/LICENSE create mode 100644 uncompressed/jira/README.md create mode 100644 uncompressed/jira/icon.png create mode 100644 uncompressed/jira/icon.svg create mode 100644 uncompressed/jira/index.js create mode 100644 uncompressed/jira/package.json create mode 100644 uncompressed/jira/webview.js (limited to 'uncompressed/jira') diff --git a/uncompressed/jira/LICENSE b/uncompressed/jira/LICENSE new file mode 100644 index 0000000..7c394bc --- /dev/null +++ b/uncompressed/jira/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 leobragatti + +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/jira/README.md b/uncompressed/jira/README.md new file mode 100644 index 0000000..e775185 --- /dev/null +++ b/uncompressed/jira/README.md @@ -0,0 +1,5 @@ +# Jira for Franz +This is the unofficial Franz recipe for Jira + +### How to create your own Franz recipes: +* [Read the documentation](https://github.com/meetfranz/plugins) diff --git a/uncompressed/jira/icon.png b/uncompressed/jira/icon.png new file mode 100644 index 0000000..7326ac5 Binary files /dev/null and b/uncompressed/jira/icon.png differ diff --git a/uncompressed/jira/icon.svg b/uncompressed/jira/icon.svg new file mode 100644 index 0000000..4601ddb --- /dev/null +++ b/uncompressed/jira/icon.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/uncompressed/jira/index.js b/uncompressed/jira/index.js new file mode 100644 index 0000000..9edb279 --- /dev/null +++ b/uncompressed/jira/index.js @@ -0,0 +1,8 @@ +"use strict"; + +module.exports = Franz => class Jira extends Franz { + overrideUserAgent() { + return window.navigator.userAgent.replace(/(Franz|Electron)([^\s]+\s)/g, ''); + } + +}; \ No newline at end of file diff --git a/uncompressed/jira/package.json b/uncompressed/jira/package.json new file mode 100644 index 0000000..be90dbb --- /dev/null +++ b/uncompressed/jira/package.json @@ -0,0 +1,15 @@ +{ + "id": "jira", + "name": "Jira", + "version": "1.0.1", + "description": "Jira", + "main": "index.js", + "author": "Leonardo Bragatti and The Ferdi Team ", + "license": "MIT", + "config": { + "serviceURL": "https://{teamId}.atlassian.net", + "urlInputSuffix": ".atlassian.net", + "hasTeamId": true, + "hasNotificationSound": true + } +} diff --git a/uncompressed/jira/webview.js b/uncompressed/jira/webview.js new file mode 100644 index 0000000..42d32e8 --- /dev/null +++ b/uncompressed/jira/webview.js @@ -0,0 +1,16 @@ +"use strict"; + +module.exports = (Franz) => { + const getMessages = function getMessages() { + // get unread messages + let element = document.querySelector('#atlassian-navigation-notification-count span'); + let count = element ? element.innerText : 0; + count = parseInt(count, 10); + + // set Franz badge + Franz.setBadge(count); + }; + + // check for new messages every second and update Franz badge + Franz.loop(getMessages); +}; \ No newline at end of file -- cgit v1.2.3-70-g09d2