diff --git a/CHANGELOG.md b/CHANGELOG.md index 38ee5081..01fc2fd3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,4 @@ TODO: tag conversejs livechat branch, and replace commit ID in build-converse.js -TODO: check that the help url is ok for the emojis configuration page. # Changelog @@ -9,7 +8,7 @@ TODO: check that the help url is ok for the emojis configuration page. * Overhauled configuration page, with more broadly customizable lists of parameters by @Murazaki ([See pull request #352](https://github.com/JohnXLivingston/peertube-plugin-livechat/pull/352)). * #377: new setting to listen C2S connection on non-localhost interfaces. -* #130: custom channel emoticons. +* #130: channel custom emojis. ### Minor changes and fixes diff --git a/assets/styles/configuration.scss b/assets/styles/configuration.scss index 0c777ac5..eb02ed1b 100644 --- a/assets/styles/configuration.scss +++ b/assets/styles/configuration.scss @@ -217,8 +217,8 @@ $small-view: 800px; } } - .peertube-livechat-emojis-thead-file { - min-width: 400px; + .peertube-livechat-emojis-col-file { + width: 150px; } } diff --git a/client/common/configuration/elements/channel-emojis.ts b/client/common/configuration/elements/channel-emojis.ts index c7c46c8d..6fd8774a 100644 --- a/client/common/configuration/elements/channel-emojis.ts +++ b/client/common/configuration/elements/channel-emojis.ts @@ -46,7 +46,7 @@ export class ChannelEmojisElement extends LivechatElement { url: { colName: ptTr(LOC_LIVECHAT_EMOJIS_FILE), description: ptTr(LOC_LIVECHAT_EMOJIS_FILE_DESC), - headerClassList: ['peertube-livechat-emojis-thead-file'] + headerClassList: ['peertube-livechat-emojis-col-file'] } } const tableSchema: DynamicFormSchema = { @@ -56,7 +56,8 @@ export class ChannelEmojisElement extends LivechatElement { }, url: { inputType: 'image-file', - default: '' + default: '', + colClassList: ['peertube-livechat-emojis-col-file'] } } return this._asyncTaskRender.render({ diff --git a/client/common/lib/elements/dynamic-table-form.ts b/client/common/lib/elements/dynamic-table-form.ts index 8214865d..e7aef26e 100644 --- a/client/common/lib/elements/dynamic-table-form.ts +++ b/client/common/lib/elements/dynamic-table-form.ts @@ -70,6 +70,7 @@ interface CellDataSchema { separators?: string[] inputType?: DynamicTableAcceptedInputTypes default?: DynamicTableAcceptedTypes + colClassList?: string[] // CSS classes to add to the element. } interface DynamicTableRowData { @@ -460,7 +461,11 @@ export class DynamicTableFormElement extends LivechatElement { `with field type '${propertySchema.inputType as string}' for form entry '${propertyName.toString()}'.`) } - return html`${formElement}` + const classList = ['form-group'] + if (propertySchema.colClassList) { + classList.push(...propertySchema.colClassList) + } + return html`${formElement}` } _renderInput = (rowId: number, diff --git a/shared/lib/emojis.ts b/shared/lib/emojis.ts index bc6011ab..536a2ca2 100644 --- a/shared/lib/emojis.ts +++ b/shared/lib/emojis.ts @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2024 John Livingston +// +// SPDX-License-Identifier: AGPL-3.0-only + export const maxSize: number = 30 * 1024 export const allowedExtensions = ['png', 'jpg', 'jpeg', 'gif'] export const inputFileAccept = ['image/jpg', 'image/png', 'image/gif']