diff --git a/packages/file-handling/src/demo.js b/packages/file-handling/src/demo.js index e1a9d850a911aef866de26b7c779de8c5d3b7068..0e084c81cdc29e7a48e379ff34ff747d43ed48d4 100644 --- a/packages/file-handling/src/demo.js +++ b/packages/file-handling/src/demo.js @@ -81,44 +81,63 @@ export class FileSourceDemo extends ScopedElementsMixin(LitElement) { </div> <div class="content"> <h2 class="subtitle">Send files via event</h2> + <p>There is no restriction for a specific file type:</p> <button @click="${() => { this._("#file-source1").setAttribute("dialog-open", ""); }}" class="button is-primary"> Open dialog </button> <dbp-file-source id="file-source1" + allowed-mime-types="*/*" subscribe="nextcloud-auth-url:nextcloud-auth-url,nextcloud-web-dav-url:nextcloud-web-dav-url,nextcloud-name:nextcloud-name,nextcloud-file-url:nextcloud-file-url" lang="en" - enabled-sources="local,nextcloud" - allowed-mime-types="*/*"></dbp-file-source> + enabled-sources="local,nextcloud"></dbp-file-source> + <p>Only images are allowed here (JPG, PNG, GIF, TIF, ...):</p> <button @click="${() => { this._("#file-source2").setAttribute("dialog-open", ""); }}" class="button is-primary"> Open dialog </button> - <dbp-file-source id="file-source2" lang="en" url="${this.url}" allowed-mime-types="image/*" + <dbp-file-source id="file-source2" lang="en" url="${this.url}" + allowed-mime-types="image/*" subscribe="nextcloud-auth-url:nextcloud-auth-url,nextcloud-web-dav-url:nextcloud-web-dav-url,nextcloud-name:nextcloud-name,nextcloud-file-url:nextcloud-file-url" enabled-sources="local,nextcloud" text="Please select images"></dbp-file-source> + <p>This is for PDF only:</p> <button @click="${() => { this._("#file-source3").setAttribute("dialog-open", ""); }}" class="button is-primary"> Open dialog </button> - <dbp-file-source id="file-source3" lang="en" url="${this.url}" allowed-mime-types="application/pdf" + <dbp-file-source id="file-source3" lang="en" url="${this.url}" + allowed-mime-types="application/pdf" subscribe="nextcloud-auth-url:nextcloud-auth-url,nextcloud-web-dav-url:nextcloud-web-dav-url,nextcloud-name:nextcloud-name,nextcloud-file-url:nextcloud-file-url" enabled-sources="local,nextcloud" - text="Einreichung als PDF" button-label="PDF auswählen"></dbp-file-source> - <p>Text and images (JPG, PNG, GIF, TIF, ...) :</p> + text="Submit only PDF files" button-label="PDF auswählen"></dbp-file-source> + + <p>Text and images (JPG, PNG, GIF, TIF, ...) :</p> <button @click="${() => { this._("#file-source4").setAttribute("dialog-open", ""); }}" class="button is-primary"> Open dialog </button> - <dbp-file-source id="file-source4" lang="en" url="${this.url}" allowed-mime-types="text/plain,image/*" + <dbp-file-source id="file-source4" lang="en" url="${this.url}" + allowed-mime-types="text/plain,image/*" subscribe="nextcloud-auth-url:nextcloud-auth-url,nextcloud-web-dav-url:nextcloud-web-dav-url,nextcloud-name:nextcloud-name,nextcloud-file-url:nextcloud-file-url" enabled-sources="local,nextcloud" text="Please select text or images"></dbp-file-source> + <p>PDFs also in ZIPS :</p> + <button @click="${() => { this._("#file-source5").setAttribute("dialog-open", ""); }}" + class="button is-primary"> + Open dialog + </button> + <dbp-file-source id="file-source5" lang="en" url="${this.url}" + allowed-mime-types="application/pdf" + decompress-zip + subscribe="nextcloud-auth-url:nextcloud-auth-url,nextcloud-web-dav-url:nextcloud-web-dav-url,nextcloud-name:nextcloud-name,nextcloud-file-url:nextcloud-file-url" + enabled-sources="local,nextcloud" + text="Please select PDF(s) or ZIP(s) with PDF(s)"></dbp-file-source> + <dbp-file-sink lang="en"></dbp-file-sink> </div> </section>