From 155c4b832281348c16be1f4ef667e6e23dbf1bd8 Mon Sep 17 00:00:00 2001 From: Vijay Raghavan Aravamudhan Date: Fri, 27 Aug 2021 18:13:24 +0530 Subject: chore: normalized all recipes to ensure compatibility with es6 (#639) - Removed some calls to set badge with '0' all the time. - Removed all 'sourceMaps' since they are all outdated atm. --- recipes/basecamp/index.js | 3 +-- recipes/basecamp/package.json | 2 +- recipes/basecamp/webview.js | 27 ++++++--------------------- 3 files changed, 8 insertions(+), 24 deletions(-) (limited to 'recipes/basecamp') diff --git a/recipes/basecamp/index.js b/recipes/basecamp/index.js index 46f936f..23607bd 100644 --- a/recipes/basecamp/index.js +++ b/recipes/basecamp/index.js @@ -1,2 +1 @@ -// just pass through Franz -module.exports = Franz => Franz; +module.exports = Ferdi => Ferdi; diff --git a/recipes/basecamp/package.json b/recipes/basecamp/package.json index 8a22226..d6b3275 100644 --- a/recipes/basecamp/package.json +++ b/recipes/basecamp/package.json @@ -1,7 +1,7 @@ { "id": "basecamp", "name": "basecamp", - "version": "1.0.3", + "version": "1.1.0", "license": "MIT", "config": { "serviceURL": "https://launchpad.37signals.com/" diff --git a/recipes/basecamp/webview.js b/recipes/basecamp/webview.js index 85f78ee..e7b7dde 100644 --- a/recipes/basecamp/webview.js +++ b/recipes/basecamp/webview.js @@ -1,6 +1,8 @@ -const path = require('path'); +const _path = _interopRequireDefault(require('path')); -module.exports = (Franz, options) => { +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +module.exports = (Ferdi) => { let updates = 0; const modal = document.createElement('div'); @@ -23,7 +25,7 @@ module.exports = (Franz, options) => { updates -= 1; } - // Replace window.alert to hide alerts in Franz + // Replace window.alert to hide alerts in Ferdi const oldAlert = window.alert; window.alert = function () { // when Google Calendar displays an alert notify the user @@ -38,19 +40,6 @@ module.exports = (Franz, options) => { 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); @@ -58,9 +47,5 @@ module.exports = (Franz, options) => { document.addEventListener('keydown', (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); + Ferdi.injectCSS(_path.default.join(__dirname, 'css', 'modal.css')); }; -- cgit v1.2.3-54-g00ecf