diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/comments/src/services/GetComments.js | 14 | ||||
-rw-r--r-- | apps/comments/src/services/NewComment.js | 8 | ||||
-rw-r--r-- | apps/comments/src/utils/decodeHtmlEntities.js | 34 | ||||
-rw-r--r-- | apps/files_sharing/src/components/SharingInput.vue | 92 | ||||
-rw-r--r-- | apps/settings/l10n/cs.js | 2 | ||||
-rw-r--r-- | apps/settings/l10n/cs.json | 2 | ||||
-rw-r--r-- | apps/settings/l10n/de_DE.js | 4 | ||||
-rw-r--r-- | apps/settings/l10n/de_DE.json | 4 | ||||
-rw-r--r-- | apps/settings/l10n/pl.js | 2 | ||||
-rw-r--r-- | apps/settings/l10n/pl.json | 2 | ||||
-rw-r--r-- | apps/settings/l10n/tr.js | 2 | ||||
-rw-r--r-- | apps/settings/l10n/tr.json | 2 | ||||
-rw-r--r-- | apps/settings/l10n/zh_HK.js | 2 | ||||
-rw-r--r-- | apps/settings/l10n/zh_HK.json | 2 | ||||
-rw-r--r-- | apps/settings/l10n/zh_TW.js | 2 | ||||
-rw-r--r-- | apps/settings/l10n/zh_TW.json | 2 |
16 files changed, 122 insertions, 54 deletions
diff --git a/apps/comments/src/services/GetComments.js b/apps/comments/src/services/GetComments.js index 7dffa969a69..bf3dd31b5f1 100644 --- a/apps/comments/src/services/GetComments.js +++ b/apps/comments/src/services/GetComments.js @@ -22,6 +22,7 @@ import { parseXML, prepareFileFromProps } from 'webdav/dist/node/tools/dav' import { processResponsePayload } from 'webdav/dist/node/response' +import { decodeHtmlEntities } from '../utils/decodeHtmlEntities' import client from './DavClient' export const DEFAULT_LIMIT = 20 @@ -89,16 +90,3 @@ function processMultistatus(result, isDetailed = false) { return prepareFileFromProps(decodedProps, decodedProps.id.toString(), isDetailed) }) } - -/** - * @param {any} value - - * @param {any} passes - - */ -function decodeHtmlEntities(value, passes = 1) { - const parser = new DOMParser() - let decoded = value - for (let i = 0; i < passes; i++) { - decoded = parser.parseFromString(decoded, 'text/html').documentElement.textContent - } - return decoded -} diff --git a/apps/comments/src/services/NewComment.js b/apps/comments/src/services/NewComment.js index eaf08cc10b9..27d227ed656 100644 --- a/apps/comments/src/services/NewComment.js +++ b/apps/comments/src/services/NewComment.js @@ -22,6 +22,7 @@ import { getCurrentUser } from '@nextcloud/auth' import { getRootPath } from '../utils/davUtils' +import { decodeHtmlEntities } from '../utils/decodeHtmlEntities' import axios from '@nextcloud/axios' import client from './DavClient' @@ -55,5 +56,12 @@ export default async function(commentsType, ressourceId, message) { details: true, }) + const props = comment.data.props + // Decode twice to handle potentially double-encoded entities + // FIXME Remove this once https://github.com/nextcloud/server/issues/29306 + // is resolved + props.actorDisplayName = decodeHtmlEntities(props.actorDisplayName, 2) + props.message = decodeHtmlEntities(props.message, 2) + return comment.data } diff --git a/apps/comments/src/utils/decodeHtmlEntities.js b/apps/comments/src/utils/decodeHtmlEntities.js new file mode 100644 index 00000000000..60c08163faa --- /dev/null +++ b/apps/comments/src/utils/decodeHtmlEntities.js @@ -0,0 +1,34 @@ +/** + * @copyright Copyright (c) 2021 Christopher Ng <chrng8@gmail.com> + * + * @author Christopher Ng <chrng8@gmail.com> + * + * @license AGPL-3.0-or-later + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ + +/** + * @param {any} value - + * @param {any} passes - + */ +export function decodeHtmlEntities(value, passes = 1) { + const parser = new DOMParser() + let decoded = value + for (let i = 0; i < passes; i++) { + decoded = parser.parseFromString(decoded, 'text/html').documentElement.textContent + } + return decoded +} diff --git a/apps/files_sharing/src/components/SharingInput.vue b/apps/files_sharing/src/components/SharingInput.vue index 6c73180865e..27d08f77a29 100644 --- a/apps/files_sharing/src/components/SharingInput.vue +++ b/apps/files_sharing/src/components/SharingInput.vue @@ -21,31 +21,35 @@ --> <template> - <NcMultiselect ref="multiselect" - class="sharing-input" - :clear-on-select="true" - :disabled="!canReshare" - :hide-selected="true" - :internal-search="false" - :loading="loading" - :options="options" - :placeholder="inputPlaceholder" - :preselect-first="true" - :preserve-search="true" - :searchable="true" - :user-select="true" - open-direction="below" - label="displayName" - track-by="id" - @search-change="asyncFind" - @select="addShare"> - <template #noOptions> - {{ t('files_sharing', 'No recommendations. Start typing.') }} - </template> - <template #noResult> - {{ noResultText }} - </template> - </NcMultiselect> + <div class="sharing-search"> + <label for="sharing-search-input">{{ t('files_sharing', 'Search for share recipients') }}</label> + <NcMultiselect ref="multiselect" + id="sharing-search-input" + class="sharing-search__input" + :clear-on-select="true" + :disabled="!canReshare" + :hide-selected="true" + :internal-search="false" + :loading="loading" + :options="options" + :placeholder="inputPlaceholder" + :preselect-first="true" + :preserve-search="true" + :searchable="true" + :user-select="true" + open-direction="below" + label="displayName" + track-by="id" + @search-change="asyncFind" + @select="addShare"> + <template #noOptions> + {{ t('files_sharing', 'No recommendations. Start typing.') }} + </template> + <template #noResult> + {{ noResultText }} + </template> + </NcMultiselect> + </div> </template> <script> @@ -521,20 +525,30 @@ export default { </script> <style lang="scss"> -.sharing-input { - width: 100%; - margin: 10px 0; - - // properly style the lookup entry - .multiselect__option { - span[lookup] { - .avatardiv { - background-image: var(--icon-search-white); - background-repeat: no-repeat; - background-position: center; - background-color: var(--color-text-maxcontrast) !important; - div { - display: none; +.sharing-search { + display: flex; + flex-direction: column; + margin-bottom: 4px; + + label[for="sharing-search-input"] { + margin-bottom: 2px; + } + + &__input { + width: 100%; + margin: 10px 0; + + // properly style the lookup entry + .multiselect__option { + span[lookup] { + .avatardiv { + background-image: var(--icon-search-white); + background-repeat: no-repeat; + background-position: center; + background-color: var(--color-text-maxcontrast) !important; + div { + display: none; + } } } } diff --git a/apps/settings/l10n/cs.js b/apps/settings/l10n/cs.js index b5bac6f581e..3b521d7e819 100644 --- a/apps/settings/l10n/cs.js +++ b/apps/settings/l10n/cs.js @@ -303,6 +303,7 @@ OC.L10N.register( "Unable to delete additional email address" : "Nepodařilo se smazat další e-mailovou adresu", "No email address set" : "E-mailová adresa není nastavena", "Additional emails" : "Další e-maily", + "Your handle" : "Váš identifikátor (handle)", "Your headline" : "Váš nadpis", "Language" : "Jazyk", "Help translate" : "Pomoci s překladem", @@ -415,6 +416,7 @@ OC.L10N.register( "Phone number" : "Telefonní číslo", "Role" : "Role", "Twitter" : "Twitter", + "Fediverse (e.g. Mastodon)" : "Fediverse (např. Mastodon)", "Website" : "Webová stránka", "Profile visibility" : "Viditelnost profilu", "Not available as this property is required for core functionality including file sharing and calendar invitations" : "Není k dispozici, protože tato vlastnost je vyžadována pro hlavní funkce, včetně sdílení souborů a pozvánek v kalendáři", diff --git a/apps/settings/l10n/cs.json b/apps/settings/l10n/cs.json index 88707795b05..3f21e38b3f8 100644 --- a/apps/settings/l10n/cs.json +++ b/apps/settings/l10n/cs.json @@ -301,6 +301,7 @@ "Unable to delete additional email address" : "Nepodařilo se smazat další e-mailovou adresu", "No email address set" : "E-mailová adresa není nastavena", "Additional emails" : "Další e-maily", + "Your handle" : "Váš identifikátor (handle)", "Your headline" : "Váš nadpis", "Language" : "Jazyk", "Help translate" : "Pomoci s překladem", @@ -413,6 +414,7 @@ "Phone number" : "Telefonní číslo", "Role" : "Role", "Twitter" : "Twitter", + "Fediverse (e.g. Mastodon)" : "Fediverse (např. Mastodon)", "Website" : "Webová stránka", "Profile visibility" : "Viditelnost profilu", "Not available as this property is required for core functionality including file sharing and calendar invitations" : "Není k dispozici, protože tato vlastnost je vyžadována pro hlavní funkce, včetně sdílení souborů a pozvánek v kalendáři", diff --git a/apps/settings/l10n/de_DE.js b/apps/settings/l10n/de_DE.js index 5467db7bdae..92e8167a318 100644 --- a/apps/settings/l10n/de_DE.js +++ b/apps/settings/l10n/de_DE.js @@ -303,6 +303,7 @@ OC.L10N.register( "Unable to delete additional email address" : "Zusätzliche E-Mail-Adresse konnte nicht gelöscht werden", "No email address set" : "Keine E-Mail-Adresse angegeben", "Additional emails" : "Zusätzliche E-Mail-Adressen", + "Your handle" : "Dein Online-Name", "Your headline" : "Ihre Überschrift", "Language" : "Sprache", "Help translate" : "Helfen Sie bei der Übersetzung", @@ -415,10 +416,11 @@ OC.L10N.register( "Phone number" : "Telefonnummer", "Role" : "Funktion", "Twitter" : "Twitter", + "Fediverse (e.g. Mastodon)" : "Fediverse (wie z.B. Mastodon)", "Website" : "Webseite", "Profile visibility" : "Sichtbarkeit des Profils", "Not available as this property is required for core functionality including file sharing and calendar invitations" : "Nicht verfügbar, da diese Eigenschaft für Kernfunktionen wie Dateifreigabe und Kalendereinladungen erforderlich ist.", - "Not available as federation has been disabled for your account, contact your system administrator if you have any questions" : "Nicht verfügbar, das Federation für Ihr Kionto dekativiert ist. Wenden Sie sich an Ihre Administration, wenn Sie Fragen haben", + "Not available as federation has been disabled for your account, contact your system administrator if you have any questions" : "Nicht verfügbar, da Föderation für Ihr Konto deaktiviert ist. Bitte wenden Sie sich an Ihre Administration, wenn Sie Fragen haben", "Not available as publishing user specific data to the lookup server is not allowed, contact your system administrator if you have any questions" : "Nicht verfügbar, da die Veröffentlichung benutzerspezifischer Daten auf dem Lookup-Server nicht zulässig ist. Wenden Sie sich bei Fragen an Ihre Systemadministration.", "Show to everyone" : "Jedem anzeigen", "Show to logged in users only" : "Nur angemeldeten Benutzern anzeigen", diff --git a/apps/settings/l10n/de_DE.json b/apps/settings/l10n/de_DE.json index a59de73f689..70bc0c24cab 100644 --- a/apps/settings/l10n/de_DE.json +++ b/apps/settings/l10n/de_DE.json @@ -301,6 +301,7 @@ "Unable to delete additional email address" : "Zusätzliche E-Mail-Adresse konnte nicht gelöscht werden", "No email address set" : "Keine E-Mail-Adresse angegeben", "Additional emails" : "Zusätzliche E-Mail-Adressen", + "Your handle" : "Dein Online-Name", "Your headline" : "Ihre Überschrift", "Language" : "Sprache", "Help translate" : "Helfen Sie bei der Übersetzung", @@ -413,10 +414,11 @@ "Phone number" : "Telefonnummer", "Role" : "Funktion", "Twitter" : "Twitter", + "Fediverse (e.g. Mastodon)" : "Fediverse (wie z.B. Mastodon)", "Website" : "Webseite", "Profile visibility" : "Sichtbarkeit des Profils", "Not available as this property is required for core functionality including file sharing and calendar invitations" : "Nicht verfügbar, da diese Eigenschaft für Kernfunktionen wie Dateifreigabe und Kalendereinladungen erforderlich ist.", - "Not available as federation has been disabled for your account, contact your system administrator if you have any questions" : "Nicht verfügbar, das Federation für Ihr Kionto dekativiert ist. Wenden Sie sich an Ihre Administration, wenn Sie Fragen haben", + "Not available as federation has been disabled for your account, contact your system administrator if you have any questions" : "Nicht verfügbar, da Föderation für Ihr Konto deaktiviert ist. Bitte wenden Sie sich an Ihre Administration, wenn Sie Fragen haben", "Not available as publishing user specific data to the lookup server is not allowed, contact your system administrator if you have any questions" : "Nicht verfügbar, da die Veröffentlichung benutzerspezifischer Daten auf dem Lookup-Server nicht zulässig ist. Wenden Sie sich bei Fragen an Ihre Systemadministration.", "Show to everyone" : "Jedem anzeigen", "Show to logged in users only" : "Nur angemeldeten Benutzern anzeigen", diff --git a/apps/settings/l10n/pl.js b/apps/settings/l10n/pl.js index b7ac4c3649d..46cbbb194b9 100644 --- a/apps/settings/l10n/pl.js +++ b/apps/settings/l10n/pl.js @@ -303,6 +303,7 @@ OC.L10N.register( "Unable to delete additional email address" : "Nie można usunąć dodatkowego adresu e-mail", "No email address set" : "Brak adresu e-mail", "Additional emails" : "Dodatkowe e-maile", + "Your handle" : "Twoja ksywka", "Your headline" : "Twój nagłówek", "Language" : "Język", "Help translate" : "Pomóż w tłumaczeniu", @@ -415,6 +416,7 @@ OC.L10N.register( "Phone number" : "Numer telefonu", "Role" : "Rola społeczna", "Twitter" : "Twitter", + "Fediverse (e.g. Mastodon)" : "Fediverse (np. Mastodon)", "Website" : "Strona internetowa", "Profile visibility" : "Widoczność profilu", "Not available as this property is required for core functionality including file sharing and calendar invitations" : "Niedostępne, ponieważ ta właściwość jest wymagana do podstawowych funkcji, w tym udostępniania pliku i zaproszeń do kalendarza", diff --git a/apps/settings/l10n/pl.json b/apps/settings/l10n/pl.json index bd5d0702384..5d558aa82f1 100644 --- a/apps/settings/l10n/pl.json +++ b/apps/settings/l10n/pl.json @@ -301,6 +301,7 @@ "Unable to delete additional email address" : "Nie można usunąć dodatkowego adresu e-mail", "No email address set" : "Brak adresu e-mail", "Additional emails" : "Dodatkowe e-maile", + "Your handle" : "Twoja ksywka", "Your headline" : "Twój nagłówek", "Language" : "Język", "Help translate" : "Pomóż w tłumaczeniu", @@ -413,6 +414,7 @@ "Phone number" : "Numer telefonu", "Role" : "Rola społeczna", "Twitter" : "Twitter", + "Fediverse (e.g. Mastodon)" : "Fediverse (np. Mastodon)", "Website" : "Strona internetowa", "Profile visibility" : "Widoczność profilu", "Not available as this property is required for core functionality including file sharing and calendar invitations" : "Niedostępne, ponieważ ta właściwość jest wymagana do podstawowych funkcji, w tym udostępniania pliku i zaproszeń do kalendarza", diff --git a/apps/settings/l10n/tr.js b/apps/settings/l10n/tr.js index b73aa50f499..ccd0931ac5e 100644 --- a/apps/settings/l10n/tr.js +++ b/apps/settings/l10n/tr.js @@ -303,6 +303,7 @@ OC.L10N.register( "Unable to delete additional email address" : "Ek e-posta adresi silinemedi", "No email address set" : "E-posta adresi belirtilmemiş", "Additional emails" : "Ek e-posta adresleri", + "Your handle" : "Kodunuz", "Your headline" : "Başlığınız", "Language" : "Dil", "Help translate" : "Çeviriye yardım edin", @@ -415,6 +416,7 @@ OC.L10N.register( "Phone number" : "Telefon numarası", "Role" : "Pozisyon", "Twitter" : "Twitter", + "Fediverse (e.g. Mastodon)" : "Fediverse (Mastodon gibi)", "Website" : "Web sitesi", "Profile visibility" : "Profil görünürlüğü", "Not available as this property is required for core functionality including file sharing and calendar invitations" : "Bu özellik, dosya paylaşımı ve takvim çağrıları gibi temel işlevler için gerekli olduğundan kullanılamıyor", diff --git a/apps/settings/l10n/tr.json b/apps/settings/l10n/tr.json index bc7051bd102..f37c0b0ff1d 100644 --- a/apps/settings/l10n/tr.json +++ b/apps/settings/l10n/tr.json @@ -301,6 +301,7 @@ "Unable to delete additional email address" : "Ek e-posta adresi silinemedi", "No email address set" : "E-posta adresi belirtilmemiş", "Additional emails" : "Ek e-posta adresleri", + "Your handle" : "Kodunuz", "Your headline" : "Başlığınız", "Language" : "Dil", "Help translate" : "Çeviriye yardım edin", @@ -413,6 +414,7 @@ "Phone number" : "Telefon numarası", "Role" : "Pozisyon", "Twitter" : "Twitter", + "Fediverse (e.g. Mastodon)" : "Fediverse (Mastodon gibi)", "Website" : "Web sitesi", "Profile visibility" : "Profil görünürlüğü", "Not available as this property is required for core functionality including file sharing and calendar invitations" : "Bu özellik, dosya paylaşımı ve takvim çağrıları gibi temel işlevler için gerekli olduğundan kullanılamıyor", diff --git a/apps/settings/l10n/zh_HK.js b/apps/settings/l10n/zh_HK.js index c59a7d4cafa..567259c3489 100644 --- a/apps/settings/l10n/zh_HK.js +++ b/apps/settings/l10n/zh_HK.js @@ -303,6 +303,7 @@ OC.L10N.register( "Unable to delete additional email address" : "無法刪除其他電郵地址", "No email address set" : "未設定電郵地址", "Additional emails" : "其他電郵地址", + "Your handle" : "您的別名", "Your headline" : "您的標題", "Language" : "語言", "Help translate" : "協助翻譯", @@ -415,6 +416,7 @@ OC.L10N.register( "Phone number" : "電話號碼", "Role" : "角色", "Twitter" : "Twitter", + "Fediverse (e.g. Mastodon)" : "Fediverse(如 Mastodon)", "Website" : "網站", "Profile visibility" : "個人檔案能見度", "Not available as this property is required for core functionality including file sharing and calendar invitations" : "無法使用,因為此屬性是核心功能(包括檔案分享和日曆邀請)所必需的。", diff --git a/apps/settings/l10n/zh_HK.json b/apps/settings/l10n/zh_HK.json index c8b4a761d86..b03b02fcbfa 100644 --- a/apps/settings/l10n/zh_HK.json +++ b/apps/settings/l10n/zh_HK.json @@ -301,6 +301,7 @@ "Unable to delete additional email address" : "無法刪除其他電郵地址", "No email address set" : "未設定電郵地址", "Additional emails" : "其他電郵地址", + "Your handle" : "您的別名", "Your headline" : "您的標題", "Language" : "語言", "Help translate" : "協助翻譯", @@ -413,6 +414,7 @@ "Phone number" : "電話號碼", "Role" : "角色", "Twitter" : "Twitter", + "Fediverse (e.g. Mastodon)" : "Fediverse(如 Mastodon)", "Website" : "網站", "Profile visibility" : "個人檔案能見度", "Not available as this property is required for core functionality including file sharing and calendar invitations" : "無法使用,因為此屬性是核心功能(包括檔案分享和日曆邀請)所必需的。", diff --git a/apps/settings/l10n/zh_TW.js b/apps/settings/l10n/zh_TW.js index 5d30c2c75d1..f03d756365d 100644 --- a/apps/settings/l10n/zh_TW.js +++ b/apps/settings/l10n/zh_TW.js @@ -303,6 +303,7 @@ OC.L10N.register( "Unable to delete additional email address" : "無法刪除額外的電子郵件地址", "No email address set" : "未設定電子郵件信箱", "Additional emails" : "額外的電子郵件", + "Your handle" : "您的帳號", "Your headline" : "您的標題", "Language" : "語言", "Help translate" : "協助翻譯", @@ -415,6 +416,7 @@ OC.L10N.register( "Phone number" : "電話號碼", "Role" : "角色", "Twitter" : "Twitter", + "Fediverse (e.g. Mastodon)" : "Fediverse(例如 Mastodon)", "Website" : "網站", "Profile visibility" : "個人資料能見度", "Not available as this property is required for core functionality including file sharing and calendar invitations" : "無法使用,因為此屬性是核心功能(包括檔案分享和日曆邀請)所必需的。", diff --git a/apps/settings/l10n/zh_TW.json b/apps/settings/l10n/zh_TW.json index 8bcef956b3b..b46cf1f88d5 100644 --- a/apps/settings/l10n/zh_TW.json +++ b/apps/settings/l10n/zh_TW.json @@ -301,6 +301,7 @@ "Unable to delete additional email address" : "無法刪除額外的電子郵件地址", "No email address set" : "未設定電子郵件信箱", "Additional emails" : "額外的電子郵件", + "Your handle" : "您的帳號", "Your headline" : "您的標題", "Language" : "語言", "Help translate" : "協助翻譯", @@ -413,6 +414,7 @@ "Phone number" : "電話號碼", "Role" : "角色", "Twitter" : "Twitter", + "Fediverse (e.g. Mastodon)" : "Fediverse(例如 Mastodon)", "Website" : "網站", "Profile visibility" : "個人資料能見度", "Not available as this property is required for core functionality including file sharing and calendar invitations" : "無法使用,因為此屬性是核心功能(包括檔案分享和日曆邀請)所必需的。", |