diff options
Diffstat (limited to 'recipes/simplenote')
-rw-r--r-- | recipes/simplenote/LICENSE | 21 | ||||
-rw-r--r-- | recipes/simplenote/README.md | 2 | ||||
-rw-r--r-- | recipes/simplenote/icon.png | bin | 0 -> 41781 bytes | |||
-rw-r--r-- | recipes/simplenote/icon.svg | 1 | ||||
-rw-r--r-- | recipes/simplenote/index.js | 2 | ||||
-rw-r--r-- | recipes/simplenote/package.json | 12 | ||||
-rw-r--r-- | recipes/simplenote/webview.js | 25 |
7 files changed, 63 insertions, 0 deletions
diff --git a/recipes/simplenote/LICENSE b/recipes/simplenote/LICENSE new file mode 100644 index 0000000..088c4dc --- /dev/null +++ b/recipes/simplenote/LICENSE | |||
@@ -0,0 +1,21 @@ | |||
1 | MIT License | ||
2 | |||
3 | Copyright (c) 2020 Yoga Setiawan | ||
4 | |||
5 | Permission is hereby granted, free of charge, to any person obtaining a copy | ||
6 | of this software and associated documentation files (the "Software"), to deal | ||
7 | in the Software without restriction, including without limitation the rights | ||
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
9 | copies of the Software, and to permit persons to whom the Software is | ||
10 | furnished to do so, subject to the following conditions: | ||
11 | |||
12 | The above copyright notice and this permission notice shall be included in all | ||
13 | copies or substantial portions of the Software. | ||
14 | |||
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
21 | SOFTWARE. | ||
diff --git a/recipes/simplenote/README.md b/recipes/simplenote/README.md new file mode 100644 index 0000000..d4f727b --- /dev/null +++ b/recipes/simplenote/README.md | |||
@@ -0,0 +1,2 @@ | |||
1 | # Simplenote for Ferdi | ||
2 | This is a Ferdi recipe for Simplenote | ||
diff --git a/recipes/simplenote/icon.png b/recipes/simplenote/icon.png new file mode 100644 index 0000000..a3251e2 --- /dev/null +++ b/recipes/simplenote/icon.png | |||
Binary files differ | |||
diff --git a/recipes/simplenote/icon.svg b/recipes/simplenote/icon.svg new file mode 100644 index 0000000..df839f4 --- /dev/null +++ b/recipes/simplenote/icon.svg | |||
@@ -0,0 +1 @@ | |||
<?xml version="1.0" ?><svg height="512" id="Layer_1" version="1.1" viewBox="0 0 512 512" width="512" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:svg="http://www.w3.org/2000/svg"><defs id="defs12"/><g id="g3547"><rect height="512" id="rect2987" rx="64" ry="64" style="fill:#448ac8;fill-opacity:1;fill-rule:nonzero;stroke:none" width="512" x="0" y="0"/><path d="M 112.2576,395.069 C 82.559803,362.7579 59.053103,320.8245 55.999803,264.5978 c 0,-5.4622 0,-10.9378 0,-16.4 1.2,-23.7467 7.2578,-45.2667 14.8444,-64.849 9.8356,-25.3822 25.026695,-49.6489 42.977897,-64.8401 0,12.1423 0.3022,23.7423 1.5555,31.249 3.8,22.7911 16.5023,47.7511 32.0401,63.28 12.5866,12.5867 29.4622,21.2312 46.8756,30.4623 34.7467,18.44 67.7956,34.7245 102.3423,53.12 22.2222,11.8489 45.0934,26.4845 51.5556,50.0045 9.1422,33.2623 -10.2533,64.1112 -25.7822,80.4668 -14.3156,15.08 -33.089,25.4178 -55.4668,28.9067 -8.8533,0 -17.7067,0 -26.5644,0 -54.8623,-6.1333 -98.3024,-28.4889 -128.1202,-60.929 z M 244.28,194.291 c 32.0311,16.7867 65.1023,33.8179 97.6668,50.7779 16.7778,8.7467 32.04,17.7867 43.7422,30.4667 21.3112,23.0889 34.609,53.2089 32.0312,96.8756 5.2711,-5.1066 10.0622,-12.2133 14.0533,-19.5333 11.6134,-21.2534 21.0178,-48.3334 23.4534,-79.689 -0.1289,-0.9155 0.1555,-1.3911 0.7733,-1.5644 0,-10.4178 0,-20.8356 0,-31.249 -13.76,-109.9068 -88.5423,-175.902402 -193.7513,-184.373502 -3.3867,0 -6.7689,0 -10.1556,0 -20.5555,3.44 -40.5822,9.3111 -52.3378,22.6667 -8.2622,9.3644 -14.7645,26.000002 -15.6356,36.715602 -3.6933,45.9556 29.2489,62.6934 60.1601,78.9067 z" id="Simplenote" style="fill:#ffffff;fill-opacity:1"/></g></svg> \ No newline at end of file | |||
diff --git a/recipes/simplenote/index.js b/recipes/simplenote/index.js new file mode 100644 index 0000000..18db071 --- /dev/null +++ b/recipes/simplenote/index.js | |||
@@ -0,0 +1,2 @@ | |||
1 | module.exports = Ferdi => class simplenote extends Ferdi { | ||
2 | }; | ||
diff --git a/recipes/simplenote/package.json b/recipes/simplenote/package.json new file mode 100644 index 0000000..ee3bc4b --- /dev/null +++ b/recipes/simplenote/package.json | |||
@@ -0,0 +1,12 @@ | |||
1 | { | ||
2 | "id": "simplenote", | ||
3 | "name": "Simplenote", | ||
4 | "version": "1.0.0", | ||
5 | "description": "simplenote", | ||
6 | "main": "index.js", | ||
7 | "author": "Ferdi <hello@getferdi.com>", | ||
8 | "license": "MIT", | ||
9 | "config": { | ||
10 | "serviceURL": "https://app.simplenote.com/" | ||
11 | } | ||
12 | } | ||
diff --git a/recipes/simplenote/webview.js b/recipes/simplenote/webview.js new file mode 100644 index 0000000..87b1192 --- /dev/null +++ b/recipes/simplenote/webview.js | |||
@@ -0,0 +1,25 @@ | |||
1 | "use strict"; | ||
2 | |||
3 | var _path = _interopRequireDefault(require("path")); | ||
4 | |||
5 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
6 | |||
7 | module.exports = Ferdi => { | ||
8 | const getMessages = function getMessages() { | ||
9 | let count = 0; | ||
10 | |||
11 | if (window.location.pathname.includes('messaging')) { | ||
12 | count = document.querySelectorAll('.msg-conversation-card__unread-count').length; | ||
13 | } else { | ||
14 | const element = document.querySelector('.nav-item--messaging .nav-item__badge-count'); | ||
15 | |||
16 | if (element) { | ||
17 | count = parseInt(element.innerHTML, 10); | ||
18 | } | ||
19 | } | ||
20 | |||
21 | Ferdi.setBadge(count); | ||
22 | }; | ||
23 | |||
24 | Ferdi.loop(getMessages); | ||
25 | }; | ||