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/anydo/LICENSE | 21 +++++++++++++++++++++ recipes/anydo/README.md | 20 ++++++++++++++++++++ recipes/anydo/icon.png | Bin 0 -> 665210 bytes recipes/anydo/icon.svg | 22 ++++++++++++++++++++++ recipes/anydo/index.js | 3 +++ recipes/anydo/package.json | 13 +++++++++++++ recipes/anydo/webview.js | 20 ++++++++++++++++++++ 7 files changed, 99 insertions(+) create mode 100644 recipes/anydo/LICENSE create mode 100644 recipes/anydo/README.md create mode 100644 recipes/anydo/icon.png create mode 100644 recipes/anydo/icon.svg create mode 100644 recipes/anydo/index.js create mode 100644 recipes/anydo/package.json create mode 100644 recipes/anydo/webview.js (limited to 'recipes/anydo') diff --git a/recipes/anydo/LICENSE b/recipes/anydo/LICENSE new file mode 100644 index 0000000..20b7e42 --- /dev/null +++ b/recipes/anydo/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Tom Chapman + +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/anydo/README.md b/recipes/anydo/README.md new file mode 100644 index 0000000..6322491 --- /dev/null +++ b/recipes/anydo/README.md @@ -0,0 +1,20 @@ +# recipe-anydo +Recipe for Any.do integration with Franz 5 + +## Installation +1. To install this plugin, download the zip [here](https://github.com/chappy84/recipe-anydo/archive/master.zip) +2. Open the file, and extract the contents to a folder e.g. `anydo` +3. Open the Franz Plugins folder on your machine (note that this `dev` directory may not exist yet, and you must create it): + * Mac: `~/Library/Application Support/Franz/recipes/dev/` + * Windows: `%appdata%/Franz/recipes/dev/` + * Linux: `~/.config/Franz/recipes/dev` +3. Copy the `anydo` folder created in step 2 into the plugins directory +4. Reload Franz + +### How to create your own Franz recipes: +* [Read the documentation](https://github.com/meetfranz/plugins) + +### Icon +Created by: [alecive](http://www.iconarchive.com/artist/alecive.html) +Sourced from: [Icon Archive](http://www.iconarchive.com/show/flatwoken-icons-by-alecive/apps-anydo-icon.html) +Released under [CC Attribution-Share Alike 4.0](http://creativecommons.org/licenses/by-sa/4.0/) diff --git a/recipes/anydo/icon.png b/recipes/anydo/icon.png new file mode 100644 index 0000000..22bf097 Binary files /dev/null and b/recipes/anydo/icon.png differ diff --git a/recipes/anydo/icon.svg b/recipes/anydo/icon.svg new file mode 100644 index 0000000..77fe087 --- /dev/null +++ b/recipes/anydo/icon.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/recipes/anydo/index.js b/recipes/anydo/index.js new file mode 100644 index 0000000..a028916 --- /dev/null +++ b/recipes/anydo/index.js @@ -0,0 +1,3 @@ +"use strict"; +// just pass through Franz +module.exports = Franz => Franz; diff --git a/recipes/anydo/package.json b/recipes/anydo/package.json new file mode 100644 index 0000000..1a7bebd --- /dev/null +++ b/recipes/anydo/package.json @@ -0,0 +1,13 @@ +{ + "id": "anydo", + "name": "Any.do", + "version": "1.0.1", + "description": "Any.do plugin for Franz 5", + "main": "index.js", + "author": "Tom Chapman and The Ferdi Team ", + "license": "MIT", + "repository": "https://github.com/chappy84/recipe-anydo", + "config": { + "serviceURL": "https://desktop.any.do/" + } +} diff --git a/recipes/anydo/webview.js b/recipes/anydo/webview.js new file mode 100644 index 0000000..aaff6dc --- /dev/null +++ b/recipes/anydo/webview.js @@ -0,0 +1,20 @@ +"use strict"; + +module.exports = (Franz) => { + function getTasks() { + + let incompleteCount = 0; + + const countEls = document.querySelectorAll('.AppSidebarListsItems__itemContainer__sizeContainer:not([hidden]) > .AppSidebarListsItems__itemContainer__size'); + + if (countEls.length) { + Array.from(countEls).forEach((el) => { + incompleteCount += parseInt(el.innerHTML, 10); + }); + } + + Franz.setBadge(incompleteCount); + } + + Franz.loop(getTasks); +}; -- cgit v1.2.3-70-g09d2