Skip to content

Commit 319ec3d

Browse files
authored
External Links Enhanced v1.2 (#536)
1 parent 820b096 commit 319ec3d

File tree

8 files changed

+54
-6
lines changed

8 files changed

+54
-6
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# v1.2 (2025-04-21)
2+
3+
## New icons
4+
5+
* Bluesky (bsky.app) ~~ as custom icon
6+
* IMDB (imdb.com)
7+
* Wordpress (wordpress.com)
8+
9+
## Fixes
10+
11+
* Fixed caching issue (thanks feederbox!)

plugins/externalLinksEnhanced/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@ Plugin that adds additional icons for external links.
66

77
The following sites are supported out of the box:
88

9+
* Bluesky (bsky.app) ~~ as custom icon
910
* Facebook (facebook.com)
11+
* IMDB (imdb.com)
1012
* Instagram (instagram.com)
13+
* OnlyFans (onlyfans.com) ~~ as custom icon
1114
* Patreon (patreon.com)
1215
* Reddit (reddit.com)
1316
* Telegram (telegram.com | t.me)
@@ -16,6 +19,7 @@ The following sites are supported out of the box:
1619
* Twitch (twitch.tv)
1720
* Twitter (twitter.com | x.com)
1821
* VK (vk.com)
22+
* Wordpress (wordpress.com)
1923
* YouTube (youtube.com)
2024

2125
Want more icons? It's pretty simple to add your own; however, it's recommended to request an icon to be added the CommunityScripts repository. When you install the plugin from the CommunityScripts repository, it will come bundled with icons that the community has contributed.
Lines changed: 6 additions & 0 deletions
Loading

plugins/externalLinksEnhanced/custom/custom.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
[
2+
{
3+
"name": "bluesky",
4+
"icon": "bluesky.svg",
5+
"addresses": ["bsky.app"],
6+
"regex": "^https?:\/\/(?:www\\.)?bsky.app\/profile\/(.*?)\/"
7+
},
28
{
39
"name": "onlyfans",
410
"icon": "onlyfans.svg",

plugins/externalLinksEnhanced/custom/onlyfans.svg

100644100755
File mode changed.

plugins/externalLinksEnhanced/externalLinksEnhanced.css

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
width: 100%;
66
height: 100%;
77
}
8-
.external-links-button .btn.link.youtube {
9-
color: red;
10-
}
118
.external-links-button .btn.link.facebook {
129
color: #1877f2;
1310
}
11+
.external-links-button .btn.link.imdb {
12+
color: #f5c518;
13+
}
1414
.external-links-button .btn.link.patreon {
1515
color: #f96854;
1616
}
@@ -35,3 +35,9 @@
3535
.external-links-button .btn.link.vk {
3636
color: #4c75a3;
3737
}
38+
.external-links-button .btn.link.wordpress {
39+
color: gray;
40+
}
41+
.external-links-button .btn.link.youtube {
42+
color: red;
43+
}

plugins/externalLinksEnhanced/externalLinksEnhanced.js

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
var { faLink } = libraries.FontAwesomeSolid;
77
var {
88
faFacebook,
9+
faImdb,
910
faInstagram,
1011
faPatreon,
1112
faReddit,
@@ -15,6 +16,7 @@
1516
faTwitch,
1617
faTwitter,
1718
faVk,
19+
faWordpress,
1820
faYoutube
1921
} = libraries.FontAwesomeBrands;
2022
var customAssetPath = "./plugin/externalLinksEnhanced/assets/custom";
@@ -27,6 +29,11 @@
2729
icon: faFacebook,
2830
addresses: ["facebook.com"]
2931
},
32+
{
33+
name: "imdb",
34+
icon: faImdb,
35+
addresses: ["imdb.com"]
36+
},
3037
{
3138
name: "instagram",
3239
icon: faInstagram,
@@ -73,6 +80,12 @@
7380
icon: faVk,
7481
addresses: ["vk.com"]
7582
},
83+
{
84+
name: "wordpress",
85+
icon: faWordpress,
86+
addresses: ["wordpress.com"],
87+
regex: "^https?\\://(.+)wordpress.com/"
88+
},
7689
{
7790
name: "youtube",
7891
icon: faYoutube,
@@ -89,7 +102,9 @@
89102
// src/utils/svg.ts
90103
var loadSvgIcon = async (file) => {
91104
try {
92-
const svg = await fetch(`${customAssetPath}/${file}`).then((response) => response.text()).then((str) => {
105+
const svg = await fetch(`${customAssetPath}/${file}`, {
106+
cache: "no-store"
107+
}).then((response) => response.text()).then((str) => {
93108
const domParser = new DOMParser();
94109
const doc = domParser.parseFromString(str, "image/svg+xml");
95110
const svgElement = doc.querySelector("svg");
@@ -121,7 +136,7 @@
121136
// src/utils/json.ts
122137
var getCustomDefinitions = async () => {
123138
try {
124-
const json = await fetch(customDefinitionsPath).then((response) => response.json()).then((data) => data);
139+
const json = await fetch(customDefinitionsPath, { cache: "no-store" }).then((response) => response.json()).then((data) => data);
125140
return json;
126141
} catch (e) {
127142
console.error(`Error loading custom definitions: ${e}`);

plugins/externalLinksEnhanced/externalLinksEnhanced.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: External Links Enhanced
22
description: Adds additional icons for external links.
3-
version: 1.1
3+
version: 1.2
44
ui:
55
javascript:
66
- externalLinksEnhanced.js

0 commit comments

Comments
 (0)