From bf3168460b50fad844c06cde673c8223644b9f12 Mon Sep 17 00:00:00 2001 From: Jake Date: Sun, 15 Jan 2023 09:24:40 +0100 Subject: [PATCH] fix(dashboard): fix twemoji CDN --- dashboard/src/components/common/CardsHeader.svelte | 2 +- dashboard/src/components/group/Body.svelte | 4 ++-- dashboard/src/components/group/CardView.svelte | 6 +++--- dashboard/src/components/group/MemberEdit.svelte | 2 +- dashboard/src/components/member/Body.svelte | 6 +++--- dashboard/src/components/member/CardView.svelte | 8 ++++---- dashboard/src/components/member/GroupEdit.svelte | 2 +- dashboard/src/components/system/Body.svelte | 8 ++++---- dashboard/src/routes/Home.svelte | 2 +- 9 files changed, 20 insertions(+), 20 deletions(-) diff --git a/dashboard/src/components/common/CardsHeader.svelte b/dashboard/src/components/common/CardsHeader.svelte index a29d3899..5d029633 100644 --- a/dashboard/src/components/common/CardsHeader.svelte +++ b/dashboard/src/components/common/CardsHeader.svelte @@ -20,7 +20,7 @@ } else htmlName = ""; $: if (settings && settings.appearance.twemoji) { - if (nameElement) twemoji.parse(nameElement); + if (nameElement) twemoji.parse(nameElement, { base: 'https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/' }); } $: icon_url = item.avatar_url ? item.avatar_url : item.icon ? item.icon : default_avatar; diff --git a/dashboard/src/components/group/Body.svelte b/dashboard/src/components/group/Body.svelte index c3f9f43d..6bd744ff 100644 --- a/dashboard/src/components/group/Body.svelte +++ b/dashboard/src/components/group/Body.svelte @@ -35,8 +35,8 @@ let displayNameElement: any; $: if (settings && settings.appearance.twemoji) { - if (descriptionElement) twemoji.parse(descriptionElement); - if (displayNameElement) twemoji.parse(displayNameElement); + if (descriptionElement) twemoji.parse(descriptionElement, { base: 'https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/' }); + if (displayNameElement) twemoji.parse(displayNameElement, { base: 'https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/' }); }; let created = moment(group.created).format("MMM D, YYYY"); diff --git a/dashboard/src/components/group/CardView.svelte b/dashboard/src/components/group/CardView.svelte index 4c908dcd..e6ab5df3 100644 --- a/dashboard/src/components/group/CardView.svelte +++ b/dashboard/src/components/group/CardView.svelte @@ -46,9 +46,9 @@ else htmlName = toHTML(group.name); } if (settings && settings.appearance.twemoji) { - if (nameElement) twemoji.parse(nameElement); - if (descElement) twemoji.parse(descElement); - if (dnElement) twemoji.parse(dnElement); + if (nameElement) twemoji.parse(nameElement, { base: 'https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/' }); + if (descElement) twemoji.parse(descElement, { base: 'https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/' }); + if (dnElement) twemoji.parse(dnElement, { base: 'https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/' }); } let avatarOpen = false; diff --git a/dashboard/src/components/group/MemberEdit.svelte b/dashboard/src/components/group/MemberEdit.svelte index 9625c3b5..c8dd3729 100644 --- a/dashboard/src/components/group/MemberEdit.svelte +++ b/dashboard/src/components/group/MemberEdit.svelte @@ -51,7 +51,7 @@ let listGroupElements: any[] = []; $: if (settings && settings.appearance.twemoji) { if (listGroupElements && listGroupElements.length > 0) { - listGroupElements.forEach(element => element && twemoji.parse(element)); + listGroupElements.forEach(element => element && twemoji.parse(element), { base: 'https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/' }); }; } diff --git a/dashboard/src/components/member/Body.svelte b/dashboard/src/components/member/Body.svelte index e5b4fb98..962a5f19 100644 --- a/dashboard/src/components/member/Body.svelte +++ b/dashboard/src/components/member/Body.svelte @@ -42,9 +42,9 @@ let pronounElement: any; $: if (settings && settings.appearance.twemoji) { - if (descriptionElement) twemoji.parse(descriptionElement); - if (displayNameElement) twemoji.parse(displayNameElement); - if (pronounElement) twemoji.parse(pronounElement); + if (descriptionElement) twemoji.parse(descriptionElement, { base: 'https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/' }); + if (displayNameElement) twemoji.parse(displayNameElement, { base: 'https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/' }); + if (pronounElement) twemoji.parse(pronounElement, { base: 'https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/' }); }; let bannerOpen = false; diff --git a/dashboard/src/components/member/CardView.svelte b/dashboard/src/components/member/CardView.svelte index cec2724b..b238047c 100644 --- a/dashboard/src/components/member/CardView.svelte +++ b/dashboard/src/components/member/CardView.svelte @@ -49,10 +49,10 @@ else htmlName = toHTML(member.name); } if (settings && settings.appearance.twemoji) { - if (nameElement) twemoji.parse(nameElement); - if (descElement) twemoji.parse(descElement); - if (dnElement) twemoji.parse(dnElement); - if (prnsElement) twemoji.parse(prnsElement); + if (nameElement) twemoji.parse(nameElement, { base: 'https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/' }); + if (descElement) twemoji.parse(descElement, { base: 'https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/' }); + if (dnElement) twemoji.parse(dnElement, { base: 'https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/' }); + if (prnsElement) twemoji.parse(prnsElement, { base: 'https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/' }); } let avatarOpen = false; diff --git a/dashboard/src/components/member/GroupEdit.svelte b/dashboard/src/components/member/GroupEdit.svelte index e5cc6abc..de9af96d 100644 --- a/dashboard/src/components/member/GroupEdit.svelte +++ b/dashboard/src/components/member/GroupEdit.svelte @@ -52,7 +52,7 @@ let listGroupElements: any[] = []; $: if (settings && settings.appearance.twemoji) { if (listGroupElements && listGroupElements.length > 0) { - listGroupElements.forEach(element => element && twemoji.parse(element)); + listGroupElements.forEach(element => element && twemoji.parse(element), { base: 'https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/' }); }; } diff --git a/dashboard/src/components/system/Body.svelte b/dashboard/src/components/system/Body.svelte index 2efb69c4..116a1635 100644 --- a/dashboard/src/components/system/Body.svelte +++ b/dashboard/src/components/system/Body.svelte @@ -42,10 +42,10 @@ let pronounElement: any; $: if (settings && settings.appearance.twemoji) { - if (descriptionElement) twemoji.parse(descriptionElement); - if (nameElement) twemoji.parse(nameElement); - if (tagElement) twemoji.parse(tagElement); - if (pronounElement) twemoji.parse(pronounElement); + if (descriptionElement) twemoji.parse(descriptionElement, { base: 'https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/' }); + if (nameElement) twemoji.parse(nameElement, { base: 'https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/' }); + if (tagElement) twemoji.parse(tagElement, { base: 'https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/' }); + if (pronounElement) twemoji.parse(pronounElement, { base: 'https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/' }); } diff --git a/dashboard/src/routes/Home.svelte b/dashboard/src/routes/Home.svelte index 168db1f1..b675eaeb 100644 --- a/dashboard/src/routes/Home.svelte +++ b/dashboard/src/routes/Home.svelte @@ -75,7 +75,7 @@ htmlName = toHTML(user.name); } $: if (settings && settings.appearance.twemoji) { - if (welcomeElement) twemoji.parse(welcomeElement); + if (welcomeElement) twemoji.parse(welcomeElement, { base: 'https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/' }); }