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/googlecalendar/LICENSE | 19 +++++++++++++++++ recipes/googlecalendar/README.md | 4 ++++ recipes/googlecalendar/calendar.css | 41 ++++++++++++++++++++++++++++++++++++ recipes/googlecalendar/icon.png | Bin 0 -> 31377 bytes recipes/googlecalendar/icon.svg | 1 + recipes/googlecalendar/index.js | 11 ++++++++++ recipes/googlecalendar/package.json | 15 +++++++++++++ recipes/googlecalendar/webview.js | 41 ++++++++++++++++++++++++++++++++++++ 8 files changed, 132 insertions(+) create mode 100644 recipes/googlecalendar/LICENSE create mode 100644 recipes/googlecalendar/README.md create mode 100644 recipes/googlecalendar/calendar.css create mode 100644 recipes/googlecalendar/icon.png create mode 100644 recipes/googlecalendar/icon.svg create mode 100644 recipes/googlecalendar/index.js create mode 100644 recipes/googlecalendar/package.json create mode 100644 recipes/googlecalendar/webview.js (limited to 'recipes/googlecalendar') diff --git a/recipes/googlecalendar/LICENSE b/recipes/googlecalendar/LICENSE new file mode 100644 index 0000000..4608c00 --- /dev/null +++ b/recipes/googlecalendar/LICENSE @@ -0,0 +1,19 @@ +Copyright 2017 Rico Herwig + +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/googlecalendar/README.md b/recipes/googlecalendar/README.md new file mode 100644 index 0000000..f540101 --- /dev/null +++ b/recipes/googlecalendar/README.md @@ -0,0 +1,4 @@ +# Franz 5 Recipe: Google Calendar +This recipe integrates the Google Calendar into Franz. + +You can get the latest version of Franz [here](https://meetfranz.com/). \ No newline at end of file diff --git a/recipes/googlecalendar/calendar.css b/recipes/googlecalendar/calendar.css new file mode 100644 index 0000000..7cd726b --- /dev/null +++ b/recipes/googlecalendar/calendar.css @@ -0,0 +1,41 @@ +#franz-modal { + display: none; + position: fixed; + z-index: 9999; + left: 0; + top: 0; + right: 0; + bottom: 0; + overflow: auto; + background-color: rgba(0, 0, 0, 0.8); +} + +#franz-modal.open { + display: block; +} + +#franz-modal .modal-content { + background-color: #fefefe; + margin: 15% auto; + padding: 20px; + border: 1px solid #888; + width: 30%; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; +} + +#franz-modal .close { + color: #aaa; + float: right; + margin-top: -10px; + font-size: 20px; + font-weight: bold; +} + +#franz-modal .close:hover, +#franz-modal .close:focus { + color: black; + text-decoration: none; + cursor: pointer; +} diff --git a/recipes/googlecalendar/icon.png b/recipes/googlecalendar/icon.png new file mode 100644 index 0000000..421388a Binary files /dev/null and b/recipes/googlecalendar/icon.png differ diff --git a/recipes/googlecalendar/icon.svg b/recipes/googlecalendar/icon.svg new file mode 100644 index 0000000..9c7a5f1 --- /dev/null +++ b/recipes/googlecalendar/icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/recipes/googlecalendar/index.js b/recipes/googlecalendar/index.js new file mode 100644 index 0000000..401a28f --- /dev/null +++ b/recipes/googlecalendar/index.js @@ -0,0 +1,11 @@ +var os = require('os') + +module.exports = Franz => + class googlecalendar extends Franz { + overrideUserAgent() { + if (os.platform() == 'linux') + return "Mozilla/5.0 (X11; Linux x86_64; rv:72.0) Gecko/20100101 Firefox/72.0" + else + return "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:72.0) Gecko/20100101 Firefox/72.0"; + } + }; diff --git a/recipes/googlecalendar/package.json b/recipes/googlecalendar/package.json new file mode 100644 index 0000000..95d4e1c --- /dev/null +++ b/recipes/googlecalendar/package.json @@ -0,0 +1,15 @@ +{ + "id": "googlecalendar", + "name": "Google Calendar", + "version": "1.0.3", + "description": "Google Calendar", + "main": "index.js", + "author": "Rico Herwig ", + "license": "MIT", + "config": { + "serviceURL": "https://calendar.google.com/calendar", + "hasNotificationSound": true, + "hasDirectMessages": true, + "openDevTools": true + } + } diff --git a/recipes/googlecalendar/webview.js b/recipes/googlecalendar/webview.js new file mode 100644 index 0000000..3d2b6f6 --- /dev/null +++ b/recipes/googlecalendar/webview.js @@ -0,0 +1,41 @@ +'use strict'; + +const path = require('path'); + +module.exports = Franz => { + let modal; + let updates = 0; + + const createModal = () => { + const franzModal = document.createElement('div'); + franzModal.setAttribute('id', 'franz-modal'); + franzModal.innerHTML = ''; + franzModal.querySelector('.close').addEventListener('click', hideModal); + + return franzModal; + }; + + const showModal = text => { + modal.querySelector('p').innerHTML = text; + updates++; + modal.classList.add('open'); + }; + + const hideModal = () => { + modal.querySelector('p').innerHTML = ''; + updates--; + modal.classList.remove('open'); + }; + + window.alert = showModal; + + const getMessages = () => Franz.setBadge(updates); + + modal = createModal(); + document.body.appendChild(modal); + document.addEventListener('keydown', event => event.keyCode === 27 && hideModal()); + + Franz.injectCSS(path.join(__dirname, 'calendar.css')); + Franz.loop(getMessages); +}; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdvb2dsZWNhbGVuZGFyL3dlYnZpZXcuanMiXSwibmFtZXMiOlsicGF0aCI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