diff options
-rw-r--r-- | all.json | 9 | ||||
-rw-r--r-- | recipes/stackoverflow/icon.svg | 1 | ||||
-rw-r--r-- | recipes/stackoverflow/index.js | 1 | ||||
-rw-r--r-- | recipes/stackoverflow/package.json | 11 | ||||
-rw-r--r-- | recipes/stackoverflow/service.css | 5 | ||||
-rw-r--r-- | recipes/stackoverflow/webview.js | 20 |
6 files changed, 47 insertions, 0 deletions
@@ -1456,6 +1456,15 @@ | |||
1456 | }, | 1456 | }, |
1457 | { | 1457 | { |
1458 | "featured": false, | 1458 | "featured": false, |
1459 | "id": "stackoverflow", | ||
1460 | "name": "Stackoverflow", | ||
1461 | "version": "0.0.1", | ||
1462 | "icons": { | ||
1463 | "svg": "https://cdn.jsdelivr.net/gh/getferdi/recipes/recipes/stackoverflow/icon.svg" | ||
1464 | } | ||
1465 | }, | ||
1466 | { | ||
1467 | "featured": false, | ||
1459 | "id": "standardnotes", | 1468 | "id": "standardnotes", |
1460 | "name": "StandardNotes", | 1469 | "name": "StandardNotes", |
1461 | "version": "1.1.0", | 1470 | "version": "1.1.0", |
diff --git a/recipes/stackoverflow/icon.svg b/recipes/stackoverflow/icon.svg new file mode 100644 index 0000000..5298d4c --- /dev/null +++ b/recipes/stackoverflow/icon.svg | |||
@@ -0,0 +1 @@ | |||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 120 120"><style>.st0{fill:#bcbbbb}.st1{fill:#f48023}</style><path class="st0" d="M84.4 93.8V70.6h7.7v30.9H22.6V70.6h7.7v23.2z"/><path class="st1" d="M38.8 68.4l37.8 7.9 1.6-7.6-37.8-7.9-1.6 7.6zm5-18l35 16.3 3.2-7-35-16.4-3.2 7.1zm9.7-17.2l29.7 24.7 4.9-5.9-29.7-24.7-4.9 5.9zm19.2-18.3l-6.2 4.6 23 31 6.2-4.6-23-31zM38 86h38.6v-7.7H38V86z"/></svg> \ No newline at end of file | |||
diff --git a/recipes/stackoverflow/index.js b/recipes/stackoverflow/index.js new file mode 100644 index 0000000..23607bd --- /dev/null +++ b/recipes/stackoverflow/index.js | |||
@@ -0,0 +1 @@ | |||
module.exports = Ferdi => Ferdi; | |||
diff --git a/recipes/stackoverflow/package.json b/recipes/stackoverflow/package.json new file mode 100644 index 0000000..6b41dd5 --- /dev/null +++ b/recipes/stackoverflow/package.json | |||
@@ -0,0 +1,11 @@ | |||
1 | { | ||
2 | "id": "stackoverflow", | ||
3 | "name": "Stackoverflow", | ||
4 | "version": "0.0.1", | ||
5 | "license": "MIT", | ||
6 | "repository": "https://github.com/christianascone/franz-recipe-stackoverflow", | ||
7 | "config": { | ||
8 | "serviceURL": "https://stackoverflow.com", | ||
9 | "hasNotificationSound": true | ||
10 | } | ||
11 | } | ||
diff --git a/recipes/stackoverflow/service.css b/recipes/stackoverflow/service.css new file mode 100644 index 0000000..b453fd4 --- /dev/null +++ b/recipes/stackoverflow/service.css | |||
@@ -0,0 +1,5 @@ | |||
1 | .app-wrapper-web .app { | ||
2 | width: 100% !important; | ||
3 | height: 100% !important; | ||
4 | top: 0 !important; | ||
5 | } | ||
diff --git a/recipes/stackoverflow/webview.js b/recipes/stackoverflow/webview.js new file mode 100644 index 0000000..4d20768 --- /dev/null +++ b/recipes/stackoverflow/webview.js | |||
@@ -0,0 +1,20 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
4 | |||
5 | module.exports = (Ferdi) => { | ||
6 | const getMessages = function getMessages() { | ||
7 | const elements = document.querySelectorAll('.CxUIE, .unread'); | ||
8 | let count = 0; | ||
9 | for (let i = 0; i < elements.length; i += 1) { | ||
10 | if (elements[i].querySelectorAll('*[data-icon="muted"]').length === 0) { | ||
11 | count += 1; | ||
12 | } | ||
13 | } | ||
14 | |||
15 | Ferdi.setBadge(count); | ||
16 | }; | ||
17 | |||
18 | Ferdi.loop(getMessages); | ||
19 | Ferdi.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
20 | }; | ||