From 3b9774b72df36286f51dc97f186038a13904b2df Mon Sep 17 00:00:00 2001 From: Tamara Steinwender <tamara.steinwender@tugraz.at> Date: Mon, 14 Jun 2021 13:13:02 +0200 Subject: [PATCH] Remove text attribute of file-sink and file-source --- packages/file-handling/README.md | 4 ---- packages/file-handling/src/file-sink.js | 6 ++---- packages/file-handling/src/file-source.js | 4 +--- packages/file-handling/src/i18n/de/translation.json | 2 +- 4 files changed, 4 insertions(+), 12 deletions(-) diff --git a/packages/file-handling/README.md b/packages/file-handling/README.md index 50a9811e..85882f0c 100644 --- a/packages/file-handling/README.md +++ b/packages/file-handling/README.md @@ -77,8 +77,6 @@ files from a [Nextcloud](https://nextcloud.com/) instance. - example `<dbp-file-source nextcloud-auth-info="You need special permissions for this function"></dbp-file-source>` - `dialog-open` (optional): if this attribute is set at runtime the dialog for selecting local or Nextcloud files will open - example `document.querySelector("dbp-file-source").setAttribute("dialog-open", "")` -- `text` (optional): the text that is shown above the button to select files - - example `<dbp-file-source text="Please select some files"></dbp-file-source>` - `button-label` (optional): the text that is shown on the button to select files - example `<dbp-file-source button-label="Select files"></dbp-file-source>` - `initial-file-handling-state` (optional): An object: `initial-file-handling-state' = {target: "", path: ""}` for initial opening behaviour. @@ -144,8 +142,6 @@ files to a [Nextcloud](https://nextcloud.com/) instance. - example `<dbp-file-sink nextcloud-file-url="http://localhost:8081/apps/files/?dir="></dbp-file-sink>` - `nextcloud-auth-info` (optional): Additional authentication information text that is shown in the Nextcloud file picker - example `<dbp-file-sink nextcloud-auth-info="You need special permissions for this function"></dbp-file-sink>` -- `text` (optional): the text that is shown above the button to download the zip file - - example `<dbp-file-sink text="Download files as ZIP-file"></dbp-file-sink>` - `button-label` (optional): the text that is shown on the button to download the zip file - example `<dbp-file-sink button-label="Download files"></dbp-file-sink>` - `initial-file-handling-state` (optional): An object: `initial-file-handling-state' = {target: "", path: ""}` for initial opening behaviour. diff --git a/packages/file-handling/src/file-sink.js b/packages/file-handling/src/file-sink.js index 79b17dc0..1dfff2d7 100644 --- a/packages/file-handling/src/file-sink.js +++ b/packages/file-handling/src/file-sink.js @@ -27,7 +27,6 @@ export class FileSink extends ScopedElementsMixin(DBPLitElement) { this.nextcloudName ='Nextcloud'; this.nextcloudPath = ''; this.nextcloudFileURL = ''; - this.text = ''; this.buttonLabel = ''; this.filename = "files.zip"; this.files = []; @@ -66,7 +65,6 @@ export class FileSink extends ScopedElementsMixin(DBPLitElement) { nextcloudName: {type: String, attribute: 'nextcloud-name'}, nextcloudFileURL: {type: String, attribute: 'nextcloud-file-url'}, nextcloudAuthInfo: {type: String, attribute: 'nextcloud-auth-info'}, - text: {type: String}, buttonLabel: {type: String, attribute: 'button-label'}, isDialogOpen: {type: Boolean, attribute: false}, activeTarget: {type: String, attribute: 'active-target'}, @@ -361,12 +359,12 @@ export class FileSink extends ScopedElementsMixin(DBPLitElement) { <div class="source-main ${classMap({"hidden": this.activeTarget !== "local"})}"> <div id="zip-download-block"> <div class="block"> - ${this.text || i18n.t('file-sink.local-intro', {'count': this.files.length})} + ${i18n.t('file-sink.local-intro', {'count': this.files.length})} </div> <button class="button is-primary" ?disabled="${this.disabled}" @click="${() => { this.downloadCompressedFiles(); }}"> - ${this.buttonLabel || i18n.t('file-sink.local-button', {'count': this.files.length})} + ${i18n.t('file-sink.local-button', {'count': this.files.length})} </button> </div> </div> diff --git a/packages/file-handling/src/file-source.js b/packages/file-handling/src/file-source.js index d3210484..798cfd34 100644 --- a/packages/file-handling/src/file-source.js +++ b/packages/file-handling/src/file-source.js @@ -46,7 +46,6 @@ export class FileSource extends ScopedElementsMixin(DBPLitElement) { this.dropArea = null; this.allowedMimeTypes = '*/*'; this.enabledTargets = 'local'; - this.text = ''; this.buttonLabel = ''; this.disabled = false; this.decompressZip = false; @@ -83,7 +82,6 @@ export class FileSource extends ScopedElementsMixin(DBPLitElement) { nextcloudName: { type: String, attribute: 'nextcloud-name' }, nextcloudFileURL: { type: String, attribute: 'nextcloud-file-url' }, nextcloudAuthInfo: {type: String, attribute: 'nextcloud-auth-info'}, - text: { type: String }, buttonLabel: { type: String, attribute: 'button-label' }, disabled: { type: Boolean }, decompressZip: { type: Boolean, attribute: 'decompress-zip' }, @@ -566,7 +564,7 @@ export class FileSource extends ScopedElementsMixin(DBPLitElement) { <div class="source-main ${classMap({"hidden": this.activeTarget !== "local"})}"> <div id="dropArea"> <div class="block"> - <p>${this.text || i18n.t('intro')}</p> + <p>${i18n.t('intro')}</p> </div> <input ?disabled="${this.disabled}" type="file" diff --git a/packages/file-handling/src/i18n/de/translation.json b/packages/file-handling/src/i18n/de/translation.json index f2be8041..3ceae22b 100644 --- a/packages/file-handling/src/i18n/de/translation.json +++ b/packages/file-handling/src/i18n/de/translation.json @@ -7,7 +7,7 @@ "demo-title": "Datei Abgabe Demo", "server-required": "Es wird unter der URL <a href=\"{{- url}}\"><tt>{{- url}}</tt></a> ein Server benötigt um die Dateien zu empfangen.", - "intro": "Laden Sie mehrere Dateien mit dem Auswahldialog oder durch Ziehen und Fallenlassen in diesem Bereich hoch.", + "intro": "Sie können in diesem Bereich Dateien per Drag & Drop oder per Direktauswahl hochladen. Die Dateien dürfen sich auch in ZIP-Archiven befinden.", "upload-label": "Dateiauswahl", "upload-disabled-title": "Die Dateiauswahl ist während dem Hochladvorgang gesperrt!", "page-leaving-warn-dialogue": "Vorsicht! Es befinden sich noch ungenutzte Dateien in der Zwischenablage. Wenn Sie auf 'OK' klicken, wird die bestehende Zwischenablage automatisch verworfen!", -- GitLab