From 8a0971ff9f41fdaa1af15e88740ce9479e1ec6ea Mon Sep 17 00:00:00 2001 From: Vijay A Date: Sun, 20 Jun 2021 11:08:00 +0530 Subject: Added new services - 'air-droid' - 'basecamp' - 'box' - 'buffer' - 'chatra' - 'easy-redmine' - 'feedbin' - 'iCloud' - 'jollor' - 'nomadlist' - 'paymo' - 'pivotal-tracker' - 'plan' - 'podio' - 'protonet' - 'teamleader' --- recipes/basecamp/css/modal.css | 37 ++++++++++++++++++++++++++ recipes/basecamp/icon.png | Bin 0 -> 471352 bytes recipes/basecamp/icon.svg | 12 +++++++++ recipes/basecamp/index.js | 2 ++ recipes/basecamp/package.json | 24 +++++++++++++++++ recipes/basecamp/webview.js | 59 +++++++++++++++++++++++++++++++++++++++++ 6 files changed, 134 insertions(+) create mode 100644 recipes/basecamp/css/modal.css create mode 100644 recipes/basecamp/icon.png create mode 100644 recipes/basecamp/icon.svg create mode 100644 recipes/basecamp/index.js create mode 100644 recipes/basecamp/package.json create mode 100644 recipes/basecamp/webview.js (limited to 'recipes/basecamp') diff --git a/recipes/basecamp/css/modal.css b/recipes/basecamp/css/modal.css new file mode 100644 index 0000000..47e211e --- /dev/null +++ b/recipes/basecamp/css/modal.css @@ -0,0 +1,37 @@ +#franz-modal { + display: none; + position: fixed; + z-index: 9999; + left: 0; + top: 0; + width: 100%; + height: 100%; + overflow: auto; + background-color: rgba(0, 0, 0, 0.8); +} + +#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/basecamp/icon.png b/recipes/basecamp/icon.png new file mode 100644 index 0000000..960196d Binary files /dev/null and b/recipes/basecamp/icon.png differ diff --git a/recipes/basecamp/icon.svg b/recipes/basecamp/icon.svg new file mode 100644 index 0000000..e5bb15f --- /dev/null +++ b/recipes/basecamp/icon.svg @@ -0,0 +1,12 @@ + + Created by potrace 1.13, written by Peter Selinger 2001-2015 + + + background + + + + Layer 1 + + + \ No newline at end of file diff --git a/recipes/basecamp/index.js b/recipes/basecamp/index.js new file mode 100644 index 0000000..46f936f --- /dev/null +++ b/recipes/basecamp/index.js @@ -0,0 +1,2 @@ +// just pass through Franz +module.exports = Franz => Franz; diff --git a/recipes/basecamp/package.json b/recipes/basecamp/package.json new file mode 100644 index 0000000..21e3d3b --- /dev/null +++ b/recipes/basecamp/package.json @@ -0,0 +1,24 @@ +{ + "id": "basecamp", + "name": "basecamp", + "version": "1.0.0", + "description": "Basecamp plugin for ferdi.", + "main": "index.js", + "author": "", + "license": "MIT", + "config": { + "serviceURL": "https://launchpad.37signals.com/", + "serviceName": "Basecamp", + "message": "Basecamp plugin for ferdi.", + "popup": [], + "hasNotificationSound": false, + "hasIndirectMessages": false, + "hasTeamID": false, + "customURL": false, + "hostedOnly": false, + "webviewOptions": { + "disablewebsecurity": "" + }, + "openDevTools": false + } +} diff --git a/recipes/basecamp/webview.js b/recipes/basecamp/webview.js new file mode 100644 index 0000000..2158d0b --- /dev/null +++ b/recipes/basecamp/webview.js @@ -0,0 +1,59 @@ +const path = require('path'); + +module.exports = (Franz, options) => { + let updates = 0; + const modal = document.createElement('div'); + + function showModal (text) { + show(modal); + modal.querySelector('p').innerHTML = text; + updates += 1; + } + + function hideModal () { + hide(modal); + modal.querySelector('p').innerHTML = ''; + updates -= 1; + } + + // Replace window.alert to hide alerts in Franz + const oldAlert = window.alert; + window.alert = function () { + // when Google Calendar displays an alert notify the user + showModal.apply(oldAlert, arguments); + }; + + function show (element) { + element.style.display = 'inherit'; + } + + function hide (element) { + element.style.display = 'none'; + } + + const getMessages = () => { + // get unread messages + //const updates = document.getElementById('franz').getAttribute('data-unread'); + + // get conversations in 'My Inbox' + //const inbox = document.getElementById('franz').getAttribute('data-inbox'); + + // set Franz badge + // updates => passive unread count + // inbox => active unread count + Franz.setBadge(0, updates); + }; + + modal.id = 'franz-modal'; + modal.innerHTML = ''; + modal.querySelector('.close').addEventListener('click', hideModal); + document.body.appendChild(modal); + + document.addEventListener('keydown', function(e) { if (e.keyCode === 27) { hideModal(); } }) + + // inject franz.css stylesheet + Franz.injectCSS(path.join(__dirname, 'css', 'modal.css')); + + // check for new messages every second and update Franz badge + Franz.loop(getMessages); +}; -- cgit v1.2.3-70-g09d2