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/franz-custom-website/README.md | 5 +++++ recipes/franz-custom-website/icon.png | Bin 0 -> 31835 bytes recipes/franz-custom-website/icon.svg | 11 +++++++++++ recipes/franz-custom-website/index.js | 17 +++++++++++++++++ recipes/franz-custom-website/package.json | 15 +++++++++++++++ recipes/franz-custom-website/style.css | 3 +++ recipes/franz-custom-website/webview.js | 7 +++++++ 7 files changed, 58 insertions(+) create mode 100644 recipes/franz-custom-website/README.md create mode 100644 recipes/franz-custom-website/icon.png create mode 100644 recipes/franz-custom-website/icon.svg create mode 100644 recipes/franz-custom-website/index.js create mode 100644 recipes/franz-custom-website/package.json create mode 100644 recipes/franz-custom-website/style.css create mode 100644 recipes/franz-custom-website/webview.js (limited to 'recipes/franz-custom-website') diff --git a/recipes/franz-custom-website/README.md b/recipes/franz-custom-website/README.md new file mode 100644 index 0000000..0b02305 --- /dev/null +++ b/recipes/franz-custom-website/README.md @@ -0,0 +1,5 @@ +# Custom Websites for Franz +This is the official Franz recipe for adding custom websites to Franz + +### How to create your own Franz recipes: +* [Read the documentation](https://github.com/meetfranz/plugins) diff --git a/recipes/franz-custom-website/icon.png b/recipes/franz-custom-website/icon.png new file mode 100644 index 0000000..3f10918 Binary files /dev/null and b/recipes/franz-custom-website/icon.png differ diff --git a/recipes/franz-custom-website/icon.svg b/recipes/franz-custom-website/icon.svg new file mode 100644 index 0000000..ae9e6d9 --- /dev/null +++ b/recipes/franz-custom-website/icon.svg @@ -0,0 +1,11 @@ + + + + franz-custom-website + Created with Sketch. + + + + + + \ No newline at end of file diff --git a/recipes/franz-custom-website/index.js b/recipes/franz-custom-website/index.js new file mode 100644 index 0000000..62f4218 --- /dev/null +++ b/recipes/franz-custom-website/index.js @@ -0,0 +1,17 @@ +"use strict"; + +module.exports = Franz => class CustomWebsite extends Franz { + async validateUrl(url) { + try { + const resp = await window.fetch(url, { + method: 'GET' + }); + return !resp.status.toString().startsWith('4'); + } catch (err) { + console.error(err); + } + + return false; + } + +}; \ No newline at end of file diff --git a/recipes/franz-custom-website/package.json b/recipes/franz-custom-website/package.json new file mode 100644 index 0000000..457a8a1 --- /dev/null +++ b/recipes/franz-custom-website/package.json @@ -0,0 +1,15 @@ +{ + "id": "franz-custom-website", + "name": "Custom Website", + "version": "1.0.2", + "description": "Add a custom website to Franz", + "main": "index.js", + "author": "Stefan Malzner ", + "license": "MIT", + "repository": "https://github.com/meetfranz/recipe-custom-website", + "config": { + "hasNotificationSound": false, + "hasIndirectMessages": false, + "hasCustomUrl": true + } +} diff --git a/recipes/franz-custom-website/style.css b/recipes/franz-custom-website/style.css new file mode 100644 index 0000000..f2760a9 --- /dev/null +++ b/recipes/franz-custom-website/style.css @@ -0,0 +1,3 @@ +html { + background: #FFFFFF; +} \ No newline at end of file diff --git a/recipes/franz-custom-website/webview.js b/recipes/franz-custom-website/webview.js new file mode 100644 index 0000000..ed1c3a6 --- /dev/null +++ b/recipes/franz-custom-website/webview.js @@ -0,0 +1,7 @@ +"use strict"; + +const path = require('path'); + +module.exports = Franz => { + Franz.injectCSS(path.join(__dirname, 'style.css')); +}; \ No newline at end of file -- cgit v1.2.3-54-g00ecf