From ffa2c49ea34093ce8c633720ee91a9d5be440f9f Mon Sep 17 00:00:00 2001 From: Niccolo Borgioli Date: Wed, 1 Nov 2023 15:26:45 +0100 Subject: [PATCH] don't insert html anymore, use separate link section --- packages/frontend/locales/de.json | 3 +- packages/frontend/locales/en.json | 11 +++--- packages/frontend/locales/es.json | 7 ++-- packages/frontend/locales/fr.json | 3 +- packages/frontend/locales/it.json | 3 +- packages/frontend/locales/ja.json | 3 +- packages/frontend/locales/ru.json | 9 +++-- packages/frontend/locales/zh.json | 3 +- packages/frontend/src/lib/ui/ShowNote.svelte | 40 +++++++++++++++----- 9 files changed, 56 insertions(+), 26 deletions(-) diff --git a/packages/frontend/locales/de.json b/packages/frontend/locales/de.json index 8afe4fc..646714c 100644 --- a/packages/frontend/locales/de.json +++ b/packages/frontend/locales/de.json @@ -47,7 +47,8 @@ "explanation": "Klicken Sie unten, um die Notiz anzuzeigen und zu löschen, wenn der Zähler sein Limit erreicht hat", "show_note": "Notiz anzeigen", "warning_will_not_see_again": "haben Sie keine Gelegenheit, die Notiz noch einmal zu sehen.", - "download_all": "alle herunterladen" + "download_all": "alle herunterladen", + "links_found": "Links in der Notiz:" }, "file_upload": { "selected_files": "Ausgewählte Dateien", diff --git a/packages/frontend/locales/en.json b/packages/frontend/locales/en.json index 30fd087..9882afb 100644 --- a/packages/frontend/locales/en.json +++ b/packages/frontend/locales/en.json @@ -23,9 +23,9 @@ "intro": "Easily send fully encrypted, secure notes or files with one click. Just create a note and share the link.", "explanation": "the note will expire and be destroyed after {type}.", "new_note": "new note", - "new_note_notice": "availability:
the note is not guaranteed to be stored, as everything is kept in ram. if it fills up, the oldest notes will be removed.
(you probably will be fine, but just be warned.)", + "new_note_notice": "availability:
the note is not guaranteed to be stored as everything is kept in ram, if it fills up the oldest notes will be removed.
(you probably will be fine, just be warned.)", "errors": { - "note_to_big": "could not create note. note is too big.", + "note_to_big": "could not create note. note is to big", "note_error": "could not create note. please try again.", "max": "max: {n}", "empty_content": "note is empty." @@ -34,7 +34,7 @@ "note_created": "note created." }, "advanced": { - "explanation": "By default, a securely generated password is used for each note. You can, however, also choose your own password, which is not included in the link.", + "explanation": "By default, a securely generated password is used for each note. You can however also choose your own password, which is not included in the link.", "custom_password": "custom password" } }, @@ -44,10 +44,11 @@ "decryption_failed": "wrong password. could not decipher. probably a broken link. note was destroyed.", "unsupported_type": "unsupported note type." }, - "explanation": "click below to show and delete the note if the counter has reached its limit.", + "explanation": "click below to show and delete the note if the counter has reached it's limit", "show_note": "show note", "warning_will_not_see_again": "you will not get the chance to see the note again.", - "download_all": "download all" + "download_all": "download all", + "links_found": "links found inside the note:" }, "file_upload": { "selected_files": "Selected Files", diff --git a/packages/frontend/locales/es.json b/packages/frontend/locales/es.json index 5bb90c4..5a6c3ba 100644 --- a/packages/frontend/locales/es.json +++ b/packages/frontend/locales/es.json @@ -23,7 +23,7 @@ "intro": "Envía fácilmente notas o archivos totalmente encriptados y seguros con un solo clic. Solo tienes que crear una nota y compartir el enlace.", "explanation": "la nota expirará y se destruirá después de {type}.", "new_note": "nueva nota", - "new_note_notice": "disponibilidad:
no se garantiza que la nota se almacene, ya que todo se guarda en la memoria RAM, si se llena se eliminarán las notas más antiguas.
(probablemente estará bien, sólo está advertido.)", + "new_note_notice": "disponibilidad:
no se garantiza que la nota se almacene, ya que todo se guarda en la memoria RAM, si se llena se eliminarán las notas más antiguas.
(probablemente estará bien, solo está advertido.)", "errors": { "note_to_big": "no se pudo crear la nota. la nota es demasiado grande", "note_error": "No se ha podido crear la nota. Por favor, inténtelo de nuevo.", @@ -34,7 +34,7 @@ "note_created": "nota creada." }, "advanced": { - "explanation": "Por defecto, se utiliza una contraseña generada de forma segura para cada nota. No obstante, también puede elegir su propia contraseña, que no se incluye en el enlace.", + "explanation": "Por defecto, se utiliza una contraseña generada de forma segura para cada nota. No obstante, también puede elegir su propia contraseña, la cual no se incluye en el enlace.", "custom_password": "contraseña personalizada" } }, @@ -47,7 +47,8 @@ "explanation": "pulse abajo para mostrar y borrar la nota si el contador ha llegado a su límite", "show_note": "mostrar nota", "warning_will_not_see_again": "no tendrás la oportunidad de volver a ver la nota.", - "download_all": "descargar todo" + "download_all": "descargar todo", + "links_found": "enlaces que se encuentran dentro de la nota:" }, "file_upload": { "selected_files": "Archivos seleccionados", diff --git a/packages/frontend/locales/fr.json b/packages/frontend/locales/fr.json index 90bd345..516bd7c 100644 --- a/packages/frontend/locales/fr.json +++ b/packages/frontend/locales/fr.json @@ -47,7 +47,8 @@ "explanation": "Cliquez ci-dessous pour afficher et supprimer la note si le compteur a atteint sa limite.", "show_note": "note de présentation", "warning_will_not_see_again": "vous n'aurez pas la chance de revoir la note.", - "download_all": "télécharger tout" + "download_all": "télécharger tout", + "links_found": "liens trouvés à l’intérieur de la note :" }, "file_upload": { "selected_files": "Fichiers sélectionnés", diff --git a/packages/frontend/locales/it.json b/packages/frontend/locales/it.json index a31a302..baacb64 100644 --- a/packages/frontend/locales/it.json +++ b/packages/frontend/locales/it.json @@ -47,7 +47,8 @@ "explanation": "clicca sotto per mostrare e cancellare la nota se il contatore ha raggiunto il suo limite", "show_note": "mostra la nota", "warning_will_not_see_again": "non avrete la possibilità di rivedere la nota.", - "download_all": "scarica tutti" + "download_all": "scarica tutti", + "links_found": "link presenti all'interno della nota:" }, "file_upload": { "selected_files": "File selezionati", diff --git a/packages/frontend/locales/ja.json b/packages/frontend/locales/ja.json index b971a09..931f4ac 100644 --- a/packages/frontend/locales/ja.json +++ b/packages/frontend/locales/ja.json @@ -47,7 +47,8 @@ "explanation": "カウンターが上限に達した場合、ノートの表示と削除を行うには、以下をクリックします。", "show_note": "メモを表示", "warning_will_not_see_again": "あなた できません このノートをもう一度見る", - "download_all": "すべてダウンロード" + "download_all": "すべてダウンロード", + "links_found": "メモ内にあるリンク:" }, "file_upload": { "selected_files": "選択したファイル", diff --git a/packages/frontend/locales/ru.json b/packages/frontend/locales/ru.json index 703a40c..fb182e2 100644 --- a/packages/frontend/locales/ru.json +++ b/packages/frontend/locales/ru.json @@ -23,10 +23,10 @@ "intro": "Легко отправляйте полностью зашифрованные защищенные заметки или файлы одним щелчком мыши. Просто создайте заметку и поделитесь ссылкой.", "explanation": "заметка истечет и будет уничтожена после {type}.", "new_note": "новая заметка", - "new_note_notice": "предупреждение:
не гарантируется, что заметка будет сохранена, так как все хранится в оперативной памяти, если она заполнится, самые старые заметки будут удалены..
(вероятно всё будет хорошо, просто будьте осторожны.)", + "new_note_notice": "availability:
the note is not guaranteed to be stored as everything is kept in ram, if it fills up the oldest notes will be removed.
(you probably will be fine, just be warned.)", "errors": { "note_to_big": "нельзя создать новую заметку. заметка слишком большая", - "note_error": "нельзя создать новую заметку. пожалуйста попробуйте позднее.", + "note_error": "нельзя создать новую заметку. пожалйста попробуйте позднее.", "max": "макс: {n}", "empty_content": "пустая заметка." }, @@ -44,10 +44,11 @@ "decryption_failed": "неправильный пароль. не смог расшифровать. возможно ссылка битая. записка уничтожена.", "unsupported_type": "неподдерживаемый тип заметки." }, - "explanation": "щелкните ниже, чтобы показать и удалить заметку, если счетчик достиг предела", + "explanation": "щелкните ниже, чтобы показать и удалить примечание, если счетчик достиг предела", "show_note": "показать заметку", "warning_will_not_see_again": "вы не сможете больше просмотреть заметку.", - "download_all": "скачать всё" + "download_all": "скачать всё", + "links_found": "ссылки внутри заметки:" }, "file_upload": { "selected_files": "Выбранные файлы", diff --git a/packages/frontend/locales/zh.json b/packages/frontend/locales/zh.json index 2a78b10..5bdab56 100644 --- a/packages/frontend/locales/zh.json +++ b/packages/frontend/locales/zh.json @@ -47,7 +47,8 @@ "explanation": "点击下方按钮即可查看密信,阅后即焚。", "show_note": "查看密信", "warning_will_not_see_again": "你将无法再次查看该密信,请尽快复制到粘贴板。", - "download_all": "下载全部" + "download_all": "下载全部", + "links_found": "注释中找到的链接:" }, "file_upload": { "selected_files": "已选中的文件", diff --git a/packages/frontend/src/lib/ui/ShowNote.svelte b/packages/frontend/src/lib/ui/ShowNote.svelte index f5fda15..05250f3 100644 --- a/packages/frontend/src/lib/ui/ShowNote.svelte +++ b/packages/frontend/src/lib/ui/ShowNote.svelte @@ -3,7 +3,6 @@

{@html $t('show.warning_will_not_see_again')}

{#if note.meta.type === 'text'}
- {@html contentWithLinks(note.contents)} + {note.contents}
+ + {#if links && links.length} + + {/if} {:else} {#each files as file}
@@ -92,4 +98,20 @@ .note.file small { padding-left: 1rem; } + + .links { + margin-top: 2rem; + } + .links ul { + margin: 0; + padding: 0; + margin-top: 0.5rem; + padding-left: 1rem; + list-style: square; + } + + .links ul li { + margin-bottom: 0.5rem; + word-wrap: break-word; + }