Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Introduced attribute download for anchor #212

Merged
merged 1 commit into from
Nov 15, 2021

Conversation

catap
Copy link
Contributor

@catap catap commented Sep 20, 2020

No description provided.

catap added a commit to catap/udash-core that referenced this pull request Sep 20, 2020
The usecase of this code is something like this: let image that user is making a
protonmail or any another application that content inside frontend (=browser
storage) some secret user's data that shouldn't be exposed to backend. Secret
key for example or anything like that.

This code allows to developer to save any `Array[Byte]` from frontend without
hacks and question because creating a blob isn't clean.

Unfortunately scalatags doesn't support `download` attribute and I need to make
it by hand. I've opened a PR: com-lihaoyi/scalatags#212 to
introduce it, but it might be a while until it is included to release.
catap added a commit to catap/udash-core that referenced this pull request Sep 20, 2020
The usecase of this code is something like this: let image that user is making a
protonmail or any another application where content inside frontend (=browser
storage) some secret user's data that shouldn't be exposed to backend. Secret
key for example or anything like that.

This code allows to developer to save any `Array[Byte]` from frontend as simple
call `FileService.save()` and load any uploaded file to `Array[Byte]` as
`FileService.load()`.

Unfortunately scalatags doesn't support `download` attribute and I need to make
it by hand. I've opened a PR: com-lihaoyi/scalatags#212 to
introduce it, but it might be a while until it is included to release.
catap added a commit to catap/udash-core that referenced this pull request Sep 28, 2020
The usecase of this code is something like this: let image that user is making a
protonmail or any another application where content inside frontend (=browser
storage) some secret user's data that shouldn't be exposed to backend. Secret
key for example or anything like that.

This code allows to developer to save any `Array[Byte]` from frontend as simple
call `FileService.save()` and load any uploaded file to `Array[Byte]` as
`FileService.load()`.

Unfortunately scalatags doesn't support `download` attribute and I need to make
it by hand. I've opened a PR: com-lihaoyi/scalatags#212 to
introduce it, but it might be a while until it is included to release.
catap added a commit to catap/udash-core that referenced this pull request Sep 28, 2020
The usecase of this code is something like this: let image that user is making a
protonmail or any another application where content inside frontend (=browser
storage) some secret user's data that shouldn't be exposed to backend. Secret
key for example or anything like that.

This code allows to developer to save any `Array[Byte]` from frontend as simple
call `FileService.save()` and load any uploaded file to `Array[Byte]` as
`FileService.load()`.

Unfortunately scalatags doesn't support `download` attribute and I need to make
it by hand. I've opened a PR: com-lihaoyi/scalatags#212 to
introduce it, but it might be a while until it is included to release.
catap added a commit to catap/udash-core that referenced this pull request Sep 28, 2020
The usecase of this code is something like this: let image that user is making a
protonmail or any another application where content inside frontend (=browser
storage) some secret user's data that shouldn't be exposed to backend. Secret
key for example or anything like that.

This code allows to developer to convert any `Array[Byte]` from frontend to URL
as simple call `FileService.bytesAsURL()`, create an anchor to download it as
`FileService.anchor()` and asynchronously convert any uploaded file to
`Array[Byte]` as `FileService.convert()`.

Unfortunately scalatags doesn't support `download` attribute and I need to make
it by hand. I've opened a PR: com-lihaoyi/scalatags#212 to
introduce it, but it might be a while until it is included to release.
catap added a commit to catap/udash-core that referenced this pull request Sep 29, 2020
The usecase of this code is something like this: let image that user is making a
protonmail or any another application where content inside frontend (=browser
storage) some secret user's data that shouldn't be exposed to backend. Secret
key for example or anything like that.

This code allows to developer to convert any `Array[Byte]` from frontend to URL
as simple call `FileService.bytesAsURL()`, create an anchor to download it as
`FileService.anchor()` and asynchronously convert any uploaded `File` to
`Array[Byte]` as `FileService.convert()`.

Unfortunately scalatags doesn't support `download` attribute and I need to make
it by hand. I've opened a PR: com-lihaoyi/scalatags#212 to
introduce it, but it might be a while until it is included to release.
catap added a commit to catap/udash-core that referenced this pull request Sep 29, 2020
The usecase of this code is something like this: let image that user is making a
protonmail or any another application where content inside frontend (=browser
storage) some secret user's data that shouldn't be exposed to backend. Secret
key for example or anything like that.

This code allows to developer to convert any `Array[Byte]` from frontend to URL
as simple call `FileService.bytesAsURL()`, create an anchor to download it as
`FileService.anchor()` and asynchronously convert any uploaded `File` to
`Array[Byte]` as `FileService.convert()`.

Unfortunately scalatags doesn't support `download` attribute and I need to make
it by hand. I've opened a PR: com-lihaoyi/scalatags#212 to
introduce it, but it might be a while until it is included to release.
catap added a commit to catap/udash-core that referenced this pull request Sep 30, 2020
The usecase of this code is something like this: let image that user is making a
protonmail or any another application where content inside frontend (=browser
storage) some secret user's data that shouldn't be exposed to backend. Secret
key for example or anything like that.

This code allows to developer to convert any `Array[Byte]` from frontend to URL
as simple call `FileService.asURL`, create an anchor to download it as
`FileService.asAnchor` and asynchronously convert any uploaded `File` to
`Array[Byte]` as `FileService.asBytesArray`.

Unfortunately scalatags doesn't support `download` attribute and I need to make
it by hand. I've opened a PR: com-lihaoyi/scalatags#212 to
introduce it, but it might be a while until it is included to release.
catap added a commit to catap/udash-core that referenced this pull request Sep 30, 2020
The usecase of this code is something like this: let image that user is making a
protonmail or any another application where content inside frontend (=browser
storage) some secret user's data that shouldn't be exposed to backend. Secret
key for example or anything like that.

This code allows to developer to convert any `Array[Byte]` from frontend to URL
as simple call `FileService.asURL`, create an anchor to download it as
`FileService.asAnchor` and asynchronously convert any uploaded `File` to
`Array[Byte]` as `FileService.asBytesArray`, or to `InputStream` via
`FileService.asInputStream`.

Unfortunately scalatags doesn't support `download` attribute and I need to make
it by hand. I've opened a PR: com-lihaoyi/scalatags#212 to
introduce it, but it might be a while until it is included to release.

`FileService.asInputStream` is using `FileReaderSync` that is also missed inside
scala-js-dom. I've opened a PR:
scala-js/scala-js-dom#424 but it might be a while. Also,
this is draft API but it is supported by majority of modern browsers:
https://developer.mozilla.org/en-US/docs/Web/API/FileReaderSync#Browser_Compatibility
catap added a commit to catap/udash-core that referenced this pull request Oct 1, 2020
The usecase of this code is something like this: let image that user is making a
protonmail or any another application where content inside frontend (=browser
storage) some secret user's data that shouldn't be exposed to backend. Secret
key for example or anything like that.

This code allows to developer to convert any `Seq[Array[Byte]]` from frontend to
URL as simple call `FileService.asURL`, create an anchor to download it as
`FileService.asAnchor` and asynchronously convert any uploaded `File` to
`Array[Byte]` as `FileService.asBytesArray`, or to `InputStream` via
`FileService.asInputStream`.

Unfortunately scalatags doesn't support `download` attribute and I need to make
it by hand. I've opened a PR: com-lihaoyi/scalatags#212 to
introduce it, but it might be a while until it is included to release.

`FileService.asInputStream` is using `FileReaderSync` that is also missed inside
scala-js-dom. I've opened a PR:
scala-js/scala-js-dom#424 but it might be a while. Also,
this is draft API but it is supported by majority of modern browsers:
https://developer.mozilla.org/en-US/docs/Web/API/FileReaderSync#Browser_Compatibility
catap added a commit to catap/udash-core that referenced this pull request Oct 1, 2020
The usecase of this code is something like this: let image that user is making a
protonmail or any another application where content inside frontend (=browser
storage) some secret user's data that shouldn't be exposed to backend. Secret
key for example or anything like that.

This code allows to developer to convert any `Seq[Array[Byte]]` from frontend to
URL as simple call `FileService.asURL`, create an anchor to download it as
`FileService.asAnchor` and asynchronously convert any uploaded `File` to
`Array[Byte]` as `FileService.asBytesArray`, or to `InputStream` via
`FileService.asInputStream`.

Unfortunately scalatags doesn't support `download` attribute and I need to make
it by hand. I've opened a PR: com-lihaoyi/scalatags#212 to
introduce it, but it might be a while until it is included to release.

`FileService.asInputStream` is using `FileReaderSync` that is also missed inside
scala-js-dom. I've opened a PR:
scala-js/scala-js-dom#424 but it might be a while. Also,
this is draft API but it is supported by majority of modern browsers:
https://developer.mozilla.org/en-US/docs/Web/API/FileReaderSync#Browser_Compatibility
catap added a commit to catap/udash-core that referenced this pull request Nov 16, 2020
The usecase of this code is something like this: let image that user is making a
protonmail or any another application where content inside frontend (=browser
storage) some secret user's data that shouldn't be exposed to backend. Secret
key for example or anything like that.

This code allows to developer to convert any `Seq[Array[Byte]]` from frontend to
URL as simple call `FileService.asURL`, create an anchor to download it as
`FileService.asAnchor` and asynchronously convert any uploaded `File` to
`Array[Byte]` as `FileService.asBytesArray`, or to `InputStream` via
`FileService.asInputStream`.

Unfortunately scalatags doesn't support `download` attribute and I need to make
it by hand. I've opened a PR: com-lihaoyi/scalatags#212 to
introduce it, but it might be a while until it is included to release.

`FileService.asInputStream` is using `FileReaderSync` that is also missed inside
scala-js-dom. I've opened a PR:
scala-js/scala-js-dom#424 but it might be a while. Also,
this is draft API but it is supported by majority of modern browsers:
https://developer.mozilla.org/en-US/docs/Web/API/FileReaderSync#Browser_Compatibility
catap added a commit to catap/udash-core that referenced this pull request Dec 2, 2020
The usecase of this code is something like this: let image that user is making a
protonmail or any another application where content inside frontend (=browser
storage) some secret user's data that shouldn't be exposed to backend. Secret
key for example or anything like that.

This code allows to developer to convert any `Seq[Array[Byte]]` from
frontend to URL as simple call `FileService.createURL`, asynchronously
convert any uploaded `File` to `Array[Byte]` as
`FileService.asBytesArray`, or to `InputStream` via
`FileService.asInputStream` inside worker.

Unfortunately scalatags doesn't support `download` attribute and I need
to make it by hand. I've opened a PR[^1] to introduce it, but it might be a
while until it is included to release.

`FileService.asInputStream` is using `FileReaderSync` that is also
missed inside scala-js-dom. I've opened a PR[^2] but it might be a
while. Also, this draft API but it is supported by majority of modern
browsers[^3].

[^1]: com-lihaoyi/scalatags#212

[^2]: scala-js/scala-js-dom#424

[^3]: https://caniuse.com/?search=FileReaderSync
catap added a commit to catap/udash-core that referenced this pull request Dec 2, 2020
The usecase of this code is something like this: let image that user is making a
protonmail or any another application where content inside frontend (=browser
storage) some secret user's data that shouldn't be exposed to backend. Secret
key for example or anything like that.

This code allows to developer to convert any `Seq[Array[Byte]]` from
frontend to URL as simple call `FileService.createURL`, asynchronously
convert any uploaded `File` to `Array[Byte]` as
`FileService.asBytesArray`, or to `InputStream` via
`FileService.asInputStream` inside worker.

Unfortunately scalatags doesn't support `download` attribute and I need
to make it by hand. I've opened a PR[^1] to introduce it, but it might be a
while until it is included to release.

`FileService.asInputStream` is using `FileReaderSync` that is also
missed inside scala-js-dom. I've opened a PR[^2] but it might be a
while. Also, this draft API but it is supported by majority of modern
browsers[^3].

[^1]: com-lihaoyi/scalatags#212

[^2]: scala-js/scala-js-dom#424

[^3]: https://caniuse.com/?search=FileReaderSync
catap added a commit to catap/udash-core that referenced this pull request Dec 2, 2020
The usecase of this code is something like this: let image that user is making a
protonmail or any another application where content inside frontend (=browser
storage) some secret user's data that shouldn't be exposed to backend. Secret
key for example or anything like that.

This code allows to developer to convert any `Seq[Array[Byte]]` from
frontend to URL as simple call `FileService.createURL`, asynchronously
convert any uploaded `File` to `Array[Byte]` as
`FileService.asBytesArray`, or to `InputStream` via
`FileService.asInputStream` inside worker.

Unfortunately scalatags doesn't support `download` attribute and I need
to make it by hand. I've opened a PR[^1] to introduce it, but it might be a
while until it is included to release.

`FileService.asInputStream` is using `FileReaderSync` that is also
missed inside scala-js-dom. I've opened a PR[^2] but it might be a
while. Also, this draft API but it is supported by majority of modern
browsers[^3].

[^1]: com-lihaoyi/scalatags#212

[^2]: scala-js/scala-js-dom#424

[^3]: https://caniuse.com/?search=FileReaderSync
catap added a commit to catap/udash-core that referenced this pull request Dec 6, 2020
The usecase of this code is something like this: let image that user is making a
protonmail or any another application where content inside frontend (=browser
storage) some secret user's data that shouldn't be exposed to backend. Secret
key for example or anything like that.

This code allows to developer to convert any `Seq[Array[Byte]]` from
frontend to URL as simple call `FileService.createURL`, asynchronously
convert any uploaded `File` to `Array[Byte]` as
`FileService.asBytesArray`, or to `InputStream` via
`FileService.asInputStream` inside worker.

Unfortunately scalatags doesn't support `download` attribute and I need
to make it by hand. I've opened a PR[^1] to introduce it, but it might be a
while until it is included to release.

`FileService.asInputStream` is using `FileReaderSync` that is also
missed inside scala-js-dom. I've opened a PR[^2] but it might be a
while. Also, this draft API but it is supported by majority of modern
browsers[^3].

[^1]: com-lihaoyi/scalatags#212

[^2]: scala-js/scala-js-dom#424

[^3]: https://caniuse.com/?search=FileReaderSync
catap added a commit to catap/udash-core that referenced this pull request Dec 6, 2020
The usecase of this code is something like this: let image that user is making a
protonmail or any another application where content inside frontend (=browser
storage) some secret user's data that shouldn't be exposed to backend. Secret
key for example or anything like that.

This code allows to developer to convert any `Seq[Array[Byte]]` from
frontend to URL as simple call `FileService.createURL`, asynchronously
convert any uploaded `File` to `Future[Array[Byte]]` as
`FileService.asBytesArray`, or to `Array[Byte]` via
`FileService.asSyncBytesArray` inside worker.

Unfortunately scalatags doesn't support `download` attribute and I need
to make it by hand. I've opened a PR[^1] to introduce it, but it might be a
while until it is included to release.

`FileService.asSyncBytesArray` is using `FileReaderSync` that is also
missed inside scala-js-dom. I've opened a PR[^2] but it might be a
while. Also, this draft API but it is supported by majority of modern
browsers[^3].

[^1]: com-lihaoyi/scalatags#212

[^2]: scala-js/scala-js-dom#424

[^3]: https://caniuse.com/?search=FileReaderSync
catap added a commit to catap/udash-core that referenced this pull request Dec 6, 2020
The usecase of this code is something like this: let image that user is making a
protonmail or any another application where content inside frontend (=browser
storage) some secret user's data that shouldn't be exposed to backend. Secret
key for example or anything like that.

This code allows to developer to convert any `Seq[Array[Byte]]` from
frontend to URL as simple call `FileService.createURL`, asynchronously
convert any uploaded `File` to `Future[Array[Byte]]` as
`FileService.asBytesArray`, or to `Array[Byte]` via
`FileService.asSyncBytesArray` inside worker.

Unfortunately scalatags doesn't support `download` attribute and I need
to make it by hand. I've opened a PR[^1] to introduce it, but it might be a
while until it is included to release.

`FileService.asSyncBytesArray` is using `FileReaderSync` that is also
missed inside scala-js-dom. I've opened a PR[^2] but it might be a
while. Also, this draft API but it is supported by majority of modern
browsers[^3].

[^1]: com-lihaoyi/scalatags#212

[^2]: scala-js/scala-js-dom#424

[^3]: https://caniuse.com/?search=FileReaderSync
catap added a commit to catap/udash-core that referenced this pull request Dec 7, 2020
The usecase of this code is something like this: let image that user is making a
protonmail or any another application where content inside frontend (=browser
storage) some secret user's data that shouldn't be exposed to backend. Secret
key for example or anything like that.

This code allows to developer to convert any `Seq[Array[Byte]]` from
frontend to URL as simple call `FileService.createURL`, asynchronously
convert any uploaded `File` to `Future[Array[Byte]]` as
`FileService.asBytesArray`, or to `Array[Byte]` via
`FileService.asSyncBytesArray` inside worker.

Unfortunately scalatags doesn't support `download` attribute and I need
to make it by hand. I've opened a PR[^1] to introduce it, but it might be a
while until it is included to release.

`FileService.asSyncBytesArray` is using `FileReaderSync` that is also
missed inside scala-js-dom. I've opened a PR[^2] but it might be a
while. Also, this draft API but it is supported by majority of modern
browsers[^3].

[^1]: com-lihaoyi/scalatags#212

[^2]: scala-js/scala-js-dom#424

[^3]: https://caniuse.com/?search=FileReaderSync
@lihaoyi lihaoyi merged commit 263e6bc into com-lihaoyi:master Nov 15, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants