diff --git a/packages/file-handling/src/clipboard.js b/packages/file-handling/src/clipboard.js index 14a1f9936d2c3545a79de589e0995c7abc2f07aa..bfc71ffc0bcb29d48892f5bcad0e08340734bb62 100644 --- a/packages/file-handling/src/clipboard.js +++ b/packages/file-handling/src/clipboard.js @@ -228,10 +228,8 @@ export class Clipboard extends ScopedElementsMixin(AdapterLitElement) { * */ selectAllFiles() { - let maxSelected = this.tabulatorTable.getRows().filter(row => row.getData().type != 'directory' && this.checkFileType(row.getData(), this.allowedMimeTypes)).length; - let selected = this.tabulatorTable.getSelectedRows().length; - - if (selected === maxSelected) { + let allSelected = this.checkAllSelected(); + if (allSelected) { this.tabulatorTable.getSelectedRows().forEach(row => row.deselect()); this.numberOfSelectedFiles = 0; } else { @@ -240,6 +238,17 @@ export class Clipboard extends ScopedElementsMixin(AdapterLitElement) { } } + checkAllSelected() { + if (this.tabulatorTable) { + let maxSelected = this.tabulatorTable.getRows().filter(row => row.getData().type != 'directory' && this.checkFileType(row.getData(), this.allowedMimeTypes)).length; + let selected = this.tabulatorTable.getSelectedRows().length; + if (selected === maxSelected) { + return true; + } + } + return false; + } + checkFileType(file) { @@ -464,14 +473,9 @@ export class Clipboard extends ScopedElementsMixin(AdapterLitElement) { } } - //TODO - // FIX closing modal dialog when deleting or adding files in modal dialogue - // FIX missing nextcloud in second hierarchy - - getAdditionalButtons() { return html` - <div class="flex-container"> + <div class="flex-container additional-button-container"> <div class="btn-flex-container-mobile"> <button @click="${() => { this.openFilesource(); }}" class="button" title="${i18n.t('clipboard.add-files')}"> @@ -532,18 +536,17 @@ export class Clipboard extends ScopedElementsMixin(AdapterLitElement) { <div class="wrapper"> <div class="content"> <h3>${i18n.t('clipboard.sink-title')}</h3> - <p>${i18n.t('clipboard.sink-body')}<br><br></p> <div class="warning-container"> <dbp-icon name="warning" class="warning-icon"></dbp-icon> <p>${i18n.t('clipboard.warning')}</p> </div> - <div class="container"> + <div> ${additionalButtons} <link rel="stylesheet" href="${tabulatorCss}"> <div class="table-wrapper"> <label class="button-container select-all-icon"> <input type="checkbox" id="select_all" name="select_all" value="select_all" @click="${() => {this.selectAllFiles();}}"> - <span class="checkmark"></span> + <span class="checkmark" title="${this.checkAllSelected() ? i18n.t("clipboard.select-nothing") : i18n.t("clipboard.select-all")}"></span> </label> <table id="clipboard-content-table" class="force-no-select"></table> </div> @@ -567,18 +570,17 @@ export class Clipboard extends ScopedElementsMixin(AdapterLitElement) { <div class="wrapper"> <div class="content"> <h3>${i18n.t('clipboard.source-title')}</h3> - <p>${i18n.t('clipboard.source-body')}</p> <div class="warning-container"> <dbp-icon name="warning" class="warning-icon"></dbp-icon> <p>${i18n.t('clipboard.warning')}</p> </div> - <div class="container"> + <div> ${additionalButtons} <link rel="stylesheet" href="${tabulatorCss}"> <div class="table-wrapper"> <label class="button-container select-all-icon"> <input type="checkbox" id="select_all" name="select_all" value="select_all" @click="${() => {this.selectAllFiles();}}"> - <span class="checkmark"></span> + <span class="checkmark" title="${this.checkAllSelected() ? i18n.t("clipboard.select-nothing") : i18n.t("clipboard.select-all")}"></span> </label> <table id="clipboard-content-table" class="force-no-select"></table> </div> @@ -586,7 +588,7 @@ export class Clipboard extends ScopedElementsMixin(AdapterLitElement) { </div> <div class="clipboard-footer"> <button class="button select-button is-primary" ?disabled="${this.clipboardSelectBtnDisabled}" - @click="${() => {this.sendClipboardFiles(this.tabulatorTable.getSelectedData());}}"> ${i18n.t('clipboard.source-btn')} + @click="${() => {this.sendClipboardFiles(this.tabulatorTable.getSelectedData());}}"> ${i18n.t('clipboard.source-btn', {count: this.tabulatorTable ? this.tabulatorTable.getSelectedRows().length : 0})} </button> </div> </div> @@ -631,7 +633,6 @@ export class Clipboard extends ScopedElementsMixin(AdapterLitElement) { display: flex; flex-direction: inherit; align-items: center; - margin-bottom: 1.5rem; } .warning-icon{ @@ -667,6 +668,7 @@ export class Clipboard extends ScopedElementsMixin(AdapterLitElement) { .checkmark{ height: 20px; width:20px; + left: 5px; } .button-container .checkmark::after{ @@ -703,7 +705,7 @@ export class Clipboard extends ScopedElementsMixin(AdapterLitElement) { display: flex; flex-direction: column; justify-content: center; - position: relative; + /* position: relative; */ } .content{ @@ -712,6 +714,10 @@ export class Clipboard extends ScopedElementsMixin(AdapterLitElement) { overflow-y: auto; -webkit-overflow-scrolling: touch; } + + .additional-button-container{ + margin-top: 0.5rem; + } @media only screen and (orientation: portrait) @@ -781,7 +787,7 @@ export class Clipboard extends ScopedElementsMixin(AdapterLitElement) { return this.getClipboardSource(); return html` - <div class="container"> + <div> ${additionalButtons} @@ -790,7 +796,7 @@ export class Clipboard extends ScopedElementsMixin(AdapterLitElement) { <div class="table-wrapper"> <label class="button-container select-all-icon"> <input type="checkbox" id="select_all" name="select_all" value="select_all" @click="${() => {this.selectAllFiles();}}"> - <span class="checkmark"></span> + <span class="checkmark" title="${this.checkAllSelected() ? i18n.t("clipboard.select-nothing") : i18n.t("clipboard.select-all")}"></span> </label> <table id="clipboard-content-table" class="force-no-select"></table> </div> diff --git a/packages/file-handling/src/i18n/de/translation.json b/packages/file-handling/src/i18n/de/translation.json index bfbffb765c1dbab72f2875d8beb979d3cf9872d0..841966ab36df968eece71cd3bf77f4ddac59922f 100644 --- a/packages/file-handling/src/i18n/de/translation.json +++ b/packages/file-handling/src/i18n/de/translation.json @@ -87,16 +87,16 @@ "clipboard": { "add-files": "Dateien der Zwischenablage hinzufügen", "add-files-btn": "Dateien hinzufügen", - "remove-all": "Alle Dateien aus der Zwischenablage entfernen.", + "remove-all": "Alle Dateien aus der Zwischenablage entfernen", "remove-all-btn": "Alle entfernen", - "remove-count": "Eine Datei aus der Zwischenablage entfernen.", - "remove-count_plural": "{{count}} Dateien aus der Zwischenablage entfernen.", + "remove-count": "Eine Datei aus der Zwischenablage entfernen", + "remove-count_plural": "{{count}} Dateien aus der Zwischenablage entfernen", "remove-count-btn": "Datei entfernen", "remove-count-btn_plural": "{{count}} Dateien entfernen", "save-all": "Alle Dateien aus der Zwischenablage speichern", "save-all-btn": "Alle sichern", - "save-count-btn": "Datei speichern", - "save-count-btn_plural": "{{count}} Dateien speichern", + "save-count-btn": "Datei sichern", + "save-count-btn_plural": "{{count}} Dateien sichern", "save-count": "Eine Datei aus der Zwischenablage speichern", "save-count_plural": "{{count}} Dateien aus der Zwischenablage speichern", "file-name": "Name", @@ -104,7 +104,6 @@ "file-type": "Art", "file-mod": "Geändert", "no-data": "Aktuell befinden sich keine Dateien in der Zwischenablage.", - "saved-files-title": "Datei erfolgreich abgelegt", "saved-files-title_plural": "Dateien erfolgreich abgelegt", "saved-files-body": "Eine Datei wurde erfolgreich temporär in der Zwischenablage abgelegt und kann jetzt innerhalb dieser Applikation verwendet werden.", @@ -118,50 +117,18 @@ "file-warning": "Achtung!", "file-warning-body": "Es befindet sich noch eine Datei in der Zwischenablage. Die Zwischenablage wird beim Verlassen der Seite verworfen.", "file-warning-body_plural": "Es befinden sich noch {{count}} Dateien in der Zwischenablage. Die Zwischenablage wird beim Verlassen der Seite verworfen.", - "upload-area-text": "Sie können in diesem Bereich Dokumente per Drag & Drop oder per Direktauswahl hochladen.", "upload-button-label": "Dateien auswählen", - - "warning": "Vorsicht! Wenn Sie den Browser schließen, die Seite neu laden oder neue Dateien hinzufügen, wird die bestehende Zwischenablage automatisch verworfen!", - + "warning": "Vorsicht! Wenn Sie den Browser schließen oder die Seite neu laden wird die bestehende Zwischenablage automatisch verworfen!", "source-title": "Von der Zwischenablage auswählen", "source-body": "Hier können Sie zuvor temporär abgelegte Dateien auswählen.", - "source-btn": "Dateien auswählen", + "source-btn": "Datei auswählen", + "source-btn_plural": "{{count}} Dateien auswählen", "sink-title": "Dateien in der Zwischenablage ablegen", "sink-body": "Hier können Sie Dateien temporär in der Zwischenablage ablegen.", "sink-btn": "{{count}} Datei ablegen", - "sink-btn_plural": "{{count}} Dateien ablegen" - }, - "clipboard2": { - - "save-files-from-clipboard": "Eine Datei aus der Zwischenablage speichern", - "save-files-from-clipboard_plurafile-sinkl": "{{count}} Dateien aus der Zwischenablage speichern", - "save-from-clipboard": "Aktuellen Inhalt aus der Zwischenablage speichern:", - "save-from-clipboard-btn": "Zwischenablage sichern", - - - "upload-area-text": "Sie können in diesem Bereich Dokumente mit einer Maximalgröße von bis zu 32MB pro Dokument per Drag & Drop oder per Direktauswahl hochladen.", - "upload-button-label": "Dateien auswählen", - - - - + "sink-btn_plural": "{{count}} Dateien ablegen", "select-all": "Alle auswählen", - "select-all-title": "Alle verfügbaren Dateien in diesem Ordner auswählen", - "select-nothing": "Nichts auswählen", - "select-nothing-title": "Alle gewählten Dateien nicht mehr selektieren", - - - "success-save-to-clipboard-title": "Erfolgreich abgelegt", - "success-save-to-clipboard-body": "Sie haben {{count}} Datei in der Zwischenablage temporär abgelegt. Vergessen Sie nicht diese dauerhaft zu speichern.", - "success-save-to-clipboard-body_plural": "Sie haben {{count}} Dateien in der Zwischenablage temporär abgelegt. Vergessen Sie nicht diese dauerhaft zu speichern.", - - - "clipboard-files": "Aktuell ist eine Datei in der Zwischenablage vorhanden", - "clipboard-files_plural": "Aktuell sind {{count}} Dateien in der Zwischenablage vorhanden", - "clipboard-files-overwrite": "Folgende Dateien werden verworfen, wenn Sie neue Dateien ins Zwischenablage legen:", - "clipboard": "Zwischenablage", - "clipboard-no-files": "Aktuell befinden sich keine Dateien in der Zwischenablage." + "select-nothing": "Nichts auswählen" } - } diff --git a/packages/file-handling/src/i18n/en/translation.json b/packages/file-handling/src/i18n/en/translation.json index 264d964f1a78d2a6c4d43f2f5a0d805afc286b73..5de26a882b55987c2e07e2a0b1d2d8a20a624bf2 100644 --- a/packages/file-handling/src/i18n/en/translation.json +++ b/packages/file-handling/src/i18n/en/translation.json @@ -98,37 +98,17 @@ "abort": "Cancel process", "abort-message": "The process was canceled." }, - "clipboard2": { - "file-warning": "Attention!", - "file-warning-body": "There is still a file on the clipboard. The clipboard is discarded when you exit the page.", - "file-warning-body_plural": "There are still {{count}} files on the clipboard. The clipboard is discarded when you exit the page.", - "save-files-from-clipboard": "Save a file from the clipboard", - "save-files-from-clipboard_plural": "Save {{count}} files from the clipboard", - "save-from-clipboard": "Save the current content from the clipboard:", - "save-from-clipboard-btn": "Save the clipboard", - "save-to-clipboard-title": "Cached files in the clipboard ", + "clipboard": { "add-files": "Add files to clipboard", "add-files-btn": "Add files", - "remove-all": "Remove all files from the clipboard.", + "remove-all": "Remove all files from the clipboard", "remove-all-btn": "Remove all", - "remove-count": "Remove file from the clipboard.", - "remove-count_plural": "Remove {{count}} files from the clipboard.", + "remove-count": "Remove file from the clipboard", + "remove-count_plural": "Remove {{count}} files from the clipboard", "remove-count-btn": "Remove file", "remove-count-btn_plural": "Remove {{count}} files", "save-all": "Save all files from the clipboard", "save-all-btn": "Save all", - "upload-area-text": "In this area you can upload documents up to a size of 32MB via Drag & Drop or by selecting them directly. ", - "upload-button-label": "Load to clipboard", - "clear-clipboard-title": "Clipboard cleared", - "clear-clipboard-body": "The clipboard was successfully cleared.", - "clear-count-clipboard-title": "File removed", - "clear-count-clipboard-title_plural": "Files removed", - "clear-count-clipboard-body": "One file was successfully removed from clipboard.", - "clear-count-clipboard-body_plural": "{{count}} files were successfully removed from clipboard.", - "saved-files-title": "File successfully filed", - "saved-files-title_plural": "Files successfully filed", - "saved-files-body": "A file was successfully stored temporarily in the clipboard and can now be used within this application.", - "saved-files-body_plural": "{{count}} files were successfully stored temporarily in the clipboard and can now be used within this application.", "save-count-btn": "Save file", "save-count-btn_plural": "Save {{count}} files", "save-count": "Save one file from the clipboard", @@ -137,10 +117,32 @@ "file-size": "Size", "file-type": "Type", "file-mod": "Last modified", - "select-all": "Alle auswählen", - "select-all-title": "Alle verfügbaren Dateien in diesem Ordner auswählen", - "select-nothing": "Nichts auswählen", - "select-nothing-title": "Alle gewählten Dateien nicht mehr selektieren", - "no-data": "There are no files" + "no-data": "There are no files", + "saved-files-title": "File successfully filed", + "saved-files-title_plural": "Files successfully filed", + "saved-files-body": "A file was successfully stored temporarily in the clipboard and can now be used within this application.", + "saved-files-body_plural": "{{count}} files were successfully stored temporarily in the clipboard and can now be used within this application.", + "clear-clipboard-title": "Clipboard cleared", + "clear-clipboard-body": "The clipboard was successfully cleared.", + "clear-count-clipboard-title": "File removed", + "clear-count-clipboard-title_plural": "Files removed", + "clear-count-clipboard-body": "One file was successfully removed from clipboard.", + "clear-count-clipboard-body_plural": "{{count}} files were successfully removed from clipboard.", + "file-warning": "Attention!", + "file-warning-body": "There is still a file on the clipboard. The clipboard is discarded when you exit the page.", + "file-warning-body_plural": "There are still {{count}} files on the clipboard. The clipboard is discarded when you exit the page.", + "upload-area-text": "In this area you can upload documents up to a size of 32MB via Drag & Drop or by selecting them directly. ", + "upload-button-label": "Load to clipboard", + "warning": "Attention! If you close the browser or reload the page the existing clipboard is automatically discarded!", + "source-title": "Select files from clipboard", + "source-body": "Here you can select files which were previously stored temporarily.", + "source-btn": "Select file", + "source-btn_plural": "Select {{count}} files", + "sink-title": "Store files on the clipboard", + "sink-body": "Here you can temporarily store files on the clipboard.", + "sink-btn": "Store {{count}} file", + "sink-btn_plural": "Store {{count}} files", + "select-all": "Select all", + "select-nothing": "Select nothing" } }