Skip to content
Snippets Groups Projects
Commit 4bb4994b authored by Steinwender, Tamara's avatar Steinwender, Tamara
Browse files

Update clipboard

parent b8be9992
No related branches found
No related tags found
No related merge requests found
Pipeline #22673 passed
...@@ -300,16 +300,17 @@ export class FileHandlingClipboard extends ScopedElementsMixin(DBPLitElement) { ...@@ -300,16 +300,17 @@ export class FileHandlingClipboard extends ScopedElementsMixin(DBPLitElement) {
return; return;
} }
send({
"summary": i18n.t('clipboard.file-warning'),
"body": i18n.t('clipboard.file-warning-body', {count: this.clipboardFiles.files.length}),
"type": "warning",
"timeout": 5,
});
// we need to handle custom events ourselves // we need to handle custom events ourselves
if(event.target && event.target.activeElement && event.target.activeElement.nodeName) { if(event.target && event.target.activeElement && event.target.activeElement.nodeName) {
send({
"summary": i18n.t('clipboard.file-warning'),
"body": i18n.t('clipboard.file-warning-body', {count: this.clipboardFiles.files.length}),
"type": "warning",
"timeout": 5,
});
if (!event.isTrusted) { if (!event.isTrusted) {
// note that this only works with custom event since calls of "confirm" are ignored // note that this only works with custom event since calls of "confirm" are ignored
// in the non-custom event, see https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event // in the non-custom event, see https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event
...@@ -540,14 +541,12 @@ export class FileHandlingClipboard extends ScopedElementsMixin(DBPLitElement) { ...@@ -540,14 +541,12 @@ export class FileHandlingClipboard extends ScopedElementsMixin(DBPLitElement) {
<dbp-icon name="warning" class="warning-icon"></dbp-icon> <dbp-icon name="warning" class="warning-icon"></dbp-icon>
<p>${i18n.t('file-sink.save-to-clipboard-warning')}</p> <p>${i18n.t('file-sink.save-to-clipboard-warning')}</p>
</div> </div>
<!-- filesink for clipboard TODO übersetzen-->
<div class="${classMap({"hidden": this.clipboardFiles.files.length === 0})}"> <div class="${classMap({"hidden": this.clipboardFiles.files.length === 0})}">
<button id="clipboard-download-button" <button id="clipboard-download-button"
class="button is-right clipboard-btn" class="button is-right clipboard-btn"
@click="${this.openClipboardFileSink}" @click="${this.openClipboardFileSink}"
>Aktuellen Zwischenablageninhalt speichern</button> >${i18n.t('clipboard.save-from-clipboard-btn')}</button>
</div> </div>
<dbp-file-sink id="file-sink-clipboard" <dbp-file-sink id="file-sink-clipboard"
......
...@@ -102,6 +102,7 @@ ...@@ -102,6 +102,7 @@
"file-warning-body": "Es befindet sich noch eine Datei in der Zwischenablage. Die Zwischenablage wird beim Verlassen der Seite automatisch verworfen.", "file-warning-body": "Es befindet sich noch eine Datei in der Zwischenablage. Die Zwischenablage wird beim Verlassen der Seite automatisch verworfen.",
"file-warning-body_plural": "Es befinden sich noch {{count}} Dateien in der Zwischenablage. Die Zwischenablage wird beim Verlassen der Seite automatisch verworfen.", "file-warning-body_plural": "Es befinden sich noch {{count}} Dateien in der Zwischenablage. Die Zwischenablage wird beim Verlassen der Seite automatisch verworfen.",
"save-files-from-clipboard": "Eine Datei aus der Zwischenablage speichern", "save-files-from-clipboard": "Eine Datei aus der Zwischenablage speichern",
"save-files-from-clipboard_plural": "{{count}} Dateien aus der Zwischenablage speichern" "save-files-from-clipboard_plural": "{{count}} Dateien aus der Zwischenablage speichern",
"save-from-clipboard-btn": "Aktuellen Inhalt aus der Zwischenablage speichern"
} }
} }
...@@ -102,6 +102,7 @@ ...@@ -102,6 +102,7 @@
"file-warning-body": "There is still a file on the clipboard. The clipboard is automatically discarded when you exit the page.", "file-warning-body": "There is still a file on the clipboard. The clipboard is automatically discarded when you exit the page.",
"file-warning-body_plural": "There are still {{count}} files on the clipboard. The clipboard is automatically discarded when you exit the page.", "file-warning-body_plural": "There are still {{count}} files on the clipboard. The clipboard is automatically discarded when you exit the page.",
"save-files-from-clipboard": "Save a file from the clipboard", "save-files-from-clipboard": "Save a file from the clipboard",
"save-files-from-clipboard_plural": "Save {{count}} files from the clipboard" "save-files-from-clipboard_plural": "Save {{count}} files from the clipboard",
"save-from-clipboard-btn": "Save the current content from the clipboard"
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment