From 92221ca704aee21048c86904702b42074a633a32 Mon Sep 17 00:00:00 2001 From: Tamara Steinwender <tamara.steinwender@tugraz.at> Date: Wed, 10 Feb 2021 14:26:49 +0100 Subject: [PATCH] Update Readme --- README.md | 17 +++++++++-------- packages/file-handling/README.md | 9 +++++++++ packages/file-handling/src/file-sink.js | 2 -- packages/file-handling/src/file-source.js | 2 -- 4 files changed, 18 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 81b30f66..f813be40 100644 --- a/README.md +++ b/README.md @@ -29,14 +29,15 @@ the version number in its `package.json` is higher than the version number on np ## Reserved attributes -| Attribute | Description | -| ------------------------ | ------------------------------------------------------------------- | -| `subscribe` | Used in all components to subscribe to attributes set by a provider | -| `unsubscribe` | Reserved for future use | -| `auth` | Authentication information, set by the authentication component | -| `lang` | Currently selected language, set by the language selector | -| `entry-point-url` | Entry point url for all api requests | -| `requested-login-status` | Used by the login buttons to trigger a login in auth components | +| Attribute | Description | +| ----------------------------- | --------------------------------------------------------------------------------- | +| `subscribe` | Used in all components to subscribe to attributes set by a provider | +| `unsubscribe` | Reserved for future use | +| `auth` | Authentication information, set by the authentication component | +| `lang` | Currently selected language, set by the language selector | +| `entry-point-url` | Entry point url for all api requests | +| `requested-login-status` | Used by the login buttons to trigger a login in auth components | +| `initial-file-handling-state` | Used by the file-handling component to sync file source/sink at first time open | ## Reserved events diff --git a/packages/file-handling/README.md b/packages/file-handling/README.md index cbf85261..2cc9224b 100644 --- a/packages/file-handling/README.md +++ b/packages/file-handling/README.md @@ -79,6 +79,10 @@ files from a [Nextcloud](https://nextcloud.com/) instance. - 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. + This is supported by the provider! Use this object to sync file source and file sink on one page at first time open. + - example `<dbp-file-source initial-file-handling-state="{target: 'local', path:'nextcloudpath'}"></dbp-file-source>` + - example provider `<dbp-file-source subscribe="initial-file-handling-state:initial-file-handling-state"></dbp-file-source>` ### Outgoing Events @@ -120,6 +124,11 @@ files to a [Nextcloud](https://nextcloud.com/) instance. - 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. + This is supported by the provider! Use this object to sync file source and file sink on one page at first time open. + - example `<dbp-file-source initial-file-handling-state="{target: 'local', path:'nextcloudpath'}"></dbp-file-source>` + - example provider `<dbp-file-source subscribe="initial-file-handling-state:initial-file-handling-state"></dbp-file-source>` + ### Properties diff --git a/packages/file-handling/src/file-sink.js b/packages/file-handling/src/file-sink.js index d0b8bdf0..af96a92f 100644 --- a/packages/file-handling/src/file-sink.js +++ b/packages/file-handling/src/file-sink.js @@ -178,8 +178,6 @@ export class FileSink extends ScopedElementsMixin(DBPLitElement) { data = {"target": this.activeTarget}; } this.sendSetPropertyEvent('initial-file-handling-state', data); - //const event = new CustomEvent("dbp-file-sink-switched", { "detail": data, bubbles: true, composed: true }); - //this.dispatchEvent(event); } diff --git a/packages/file-handling/src/file-source.js b/packages/file-handling/src/file-source.js index 6fda9a3f..63e6e228 100644 --- a/packages/file-handling/src/file-source.js +++ b/packages/file-handling/src/file-source.js @@ -241,8 +241,6 @@ export class FileSource extends ScopedElementsMixin(DBPLitElement) { } this.sendSetPropertyEvent('initial-file-handling-state', data); - //const event = new CustomEvent("initial-file-handling-state", { "detail": data, bubbles: true, composed: true }); - //this.dispatchEvent(event); } checkFileType(file) { -- GitLab