aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/franz-custom-website
diff options
context:
space:
mode:
authorLibravatar MCMXC <16797721+mcmxcdev@users.noreply.github.com>2023-07-26 06:29:03 -0600
committerLibravatar GitHub <noreply@github.com>2023-07-26 17:59:03 +0530
commit9b8f01716774a960073e944823ab727cc867a8f6 (patch)
tree732b83770baa78f5cf12776aaa33ce65bebfa418 /recipes/franz-custom-website
parentAdd Excalidraw recipe (#393) (diff)
downloadferdium-recipes-9b8f01716774a960073e944823ab727cc867a8f6.tar.gz
ferdium-recipes-9b8f01716774a960073e944823ab727cc867a8f6.tar.zst
ferdium-recipes-9b8f01716774a960073e944823ab727cc867a8f6.zip
chore: improve lint setup (#397)
- update eslint config to closely mirror the ones from ferdium-app - add .eslintignore - opt in to eslint `reportUnusedDisableDirectives` config option - remove `trailingComma: all` from `prettier` config which is default in `prettier` v3 - autofix or disable a lot of lint issues throughout codebase - add `volta` configuration to `package.json` to autoload correct `node` and `pnpm` versions - upgrade all `eslint` and `prettier` related dependencies to latest - update lint:fix npm script - reformat touched files with prettier - bumped up minor version for all recipes that have changes - introduced injection of 'service.css' where it was missing in many recipes --------- Co-authored-by: Vijay A <vraravam@users.noreply.github.com>
Diffstat (limited to 'recipes/franz-custom-website')
-rw-r--r--recipes/franz-custom-website/package.json2
-rw-r--r--recipes/franz-custom-website/webview.js38
2 files changed, 23 insertions, 17 deletions
diff --git a/recipes/franz-custom-website/package.json b/recipes/franz-custom-website/package.json
index d3dcbba..775d9aa 100644
--- a/recipes/franz-custom-website/package.json
+++ b/recipes/franz-custom-website/package.json
@@ -1,7 +1,7 @@
1{ 1{
2 "id": "franz-custom-website", 2 "id": "franz-custom-website",
3 "name": "Custom Website", 3 "name": "Custom Website",
4 "version": "1.3.0", 4 "version": "1.4.0",
5 "license": "MIT", 5 "license": "MIT",
6 "repository": "https://github.com/meetfranz/recipe-custom-website", 6 "repository": "https://github.com/meetfranz/recipe-custom-website",
7 "config": { 7 "config": {
diff --git a/recipes/franz-custom-website/webview.js b/recipes/franz-custom-website/webview.js
index 072fed5..18f16a3 100644
--- a/recipes/franz-custom-website/webview.js
+++ b/recipes/franz-custom-website/webview.js
@@ -1,30 +1,36 @@
1const _path = _interopRequireDefault(require('path'));
2
3function _interopRequireDefault(obj) { 1function _interopRequireDefault(obj) {
4 return obj && obj.__esModule ? obj : { default: obj }; 2 return obj && obj.__esModule ? obj : { default: obj };
5} 3}
6 4
5const _path = _interopRequireDefault(require('path'));
6
7module.exports = (Ferdium, settings) => { 7module.exports = (Ferdium, settings) => {
8 Ferdium.injectCSS(_path.default.join(__dirname, 'style.css')); 8 Ferdium.injectCSS(_path.default.join(__dirname, 'style.css'));
9 9
10 // TODO: See how this can be moved into the main ferdium app and sent as an ipc message for opening with a new window or same Ferdium recipe's webview based on user's preferences 10 // TODO: See how this can be moved into the main ferdium app and sent as an ipc message for opening with a new window or same Ferdium recipe's webview based on user's preferences
11 document.addEventListener('click', event => { 11 document.addEventListener(
12 const link = event.target.closest('a[href^="http"]'); 12 'click',
13 const button = event.target.closest('button[title^="http"]'); 13 event => {
14 const link = event.target.closest('a[href^="http"]');
15 const button = event.target.closest('button[title^="http"]');
14 16
15 if (link || button) { 17 if (link || button) {
16 const url = link ? link.getAttribute('href') : button.getAttribute('title'); 18 const url = link
19 ? link.getAttribute('href')
20 : button.getAttribute('title');
17 21
18 if (!Ferdium.isImage(link)) { 22 if (!Ferdium.isImage(link)) {
19 event.preventDefault(); 23 event.preventDefault();
20 event.stopPropagation(); 24 event.stopPropagation();
21 25
22 if (settings.trapLinkClicks === true) { 26 if (settings.trapLinkClicks === true) {
23 window.location.href = url; 27 window.location.href = url;
24 } else { 28 } else {
25 Ferdium.openNewWindow(url); 29 Ferdium.openNewWindow(url);
30 }
26 } 31 }
27 } 32 }
28 } 33 },
29 }, true); 34 true,
35 );
30}; 36};