From 6f56a026bbbe9b535abecf0e1a9a430a50537f07 Mon Sep 17 00:00:00 2001
From: John Livingston
Date: Mon, 10 Jun 2024 19:07:55 +0200
Subject: [PATCH] Custom emojis: import/export functions.
---
assets/styles/configuration.scss | 4 +
client/@types/global.d.ts | 4 +
.../configuration/elements/channel-emojis.ts | 159 ++++++++++++++++++
.../common/lib/elements/image-file-input.ts | 2 +-
languages/en.yml | 4 +
5 files changed, 172 insertions(+), 1 deletion(-)
diff --git a/assets/styles/configuration.scss b/assets/styles/configuration.scss
index eb02ed1b..3a647c8c 100644
--- a/assets/styles/configuration.scss
+++ b/assets/styles/configuration.scss
@@ -220,6 +220,10 @@ $small-view: 800px;
.peertube-livechat-emojis-col-file {
width: 150px;
}
+
+ .peertube-plugin-livechat-configuration-actions {
+ text-align: right;
+ }
}
livechat-dynamic-table-form {
diff --git a/client/@types/global.d.ts b/client/@types/global.d.ts
index a5fa876e..8cd07a65 100644
--- a/client/@types/global.d.ts
+++ b/client/@types/global.d.ts
@@ -100,3 +100,7 @@ declare const LOC_LIVECHAT_EMOJIS_SHORTNAME: string
declare const LOC_LIVECHAT_EMOJIS_SHORTNAME_DESC: string
declare const LOC_LIVECHAT_EMOJIS_FILE: string
declare const LOC_LIVECHAT_EMOJIS_FILE_DESC: string
+
+declare const LOC_ACTION_IMPORT: string
+declare const LOC_ACTION_EXPORT: string
+declare const LOC_ACTION_IMPORT_EMOJIS_INFO: string
diff --git a/client/common/configuration/elements/channel-emojis.ts b/client/common/configuration/elements/channel-emojis.ts
index 6fd8774a..4421fd0e 100644
--- a/client/common/configuration/elements/channel-emojis.ts
+++ b/client/common/configuration/elements/channel-emojis.ts
@@ -81,6 +81,23 @@ export class ChannelEmojisElement extends LivechatElement {
+
+ ${
+ this._channelEmojisConfiguration?.emojis?.customEmojis?.length
+ ? html``
+ : ''
+ }
+ ${
+ (this._channelEmojisConfiguration?.emojis?.customEmojis?.length ?? 0) < maxEmojisPerChannel
+ ? html``
+ : ''
+ }
+
+