1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
Commit graph

17 commits

Author SHA1 Message Date
David Heinemeier Hansson
6c96e1cd7b
Move Active Storage JS to ESM and drop Babel transpiling (#42895)
* Move to ESM and drop Babel transpiling

* Make the activestorage JS directly available through the asset pipeline as a precompiled asset

* Use example with direct attachment

* Explain that direct reference is possible

* Active Storage JS is a module

* Retain umd asset for backwards compatibility, add ESM file in addition

* Explain how to use activestorage.esm with importmap

* Use untranspiled activestorage inclusion

* Don't repeat terser options
2021-07-28 15:17:13 -04:00
Sean Doyle
e75b0094d0 ActiveStorage: Pass useCapture to UJS listener
Closes [@hotwired/turbo#243][].

Set the `useCapture` parameter of [addEventListener][] to `true` so that
cancelling the event occurs early enough in the process so that the
resulting upload is cancelled.

[@hotwired/turbo#243]: https://github.com/hotwired/turbo/issues/243#issuecomment-818792129
[addEventListener]: https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#parameters

Co-authored-by: Javan Makhmali <javan@basecamp.com>
2021-04-13 11:56:01 -04:00
Jonathan Hefner
fd3fd618f4 Add gitattributes for vendored and generated files [ci-skip]
The `linguist-vendored` attribute excludes the specified file from the
project's language stats on GitHub.  The `linguist-generated` attribute
does the same, and also suppresses that file in diffs on GitHub.

See https://github.com/github/linguist for more information.
2020-10-04 16:44:37 -05:00
Nick Weiland
1d133e8a47 Defaults content_type to application/octet-stream
Defaults content_type to application/octet-stream in blob_record.js

[direct_upload_xls_in_chrome]
2020-01-07 10:30:56 -08:00
Cameron Bothner
372dda2a29 Don’t include an undefined X-CSRF-Token header
If there is not a `csrf-token` meta tag in the document, the blob record
XHR was including an `X-CSRF-Token` header set to the string
"undefined." Instead of setting it to undefined, it should not be
included in the absence of a meta tag.
2018-12-27 12:44:19 -05:00
Tasos Maschalidis
d6fcc419fe ASt direct uploads: account for <button type="submit"> elements 2018-11-24 14:54:05 -05:00
bogdanvlviv
0e77706dc5
activestorage: yarn build
Context https://github.com/rails/rails/pull/33413#issuecomment-414137587
2018-08-19 19:33:16 +03:00
Chris Seelus
880f977925 Enable multiple submit buttons for Active Storage forms 2018-08-18 19:31:39 +02:00
George Claghorn
195463736c Fix directly uploading zero-byte files
Closes #33450.
2018-07-27 00:11:22 -04:00
Javan Makhmali
56fc1f812a Unminify activestorage.js 2018-04-25 08:46:56 -05:00
kylekeesling
a7cdad8d26
fixes a bug in IE11 that broke direct uploads 2018-04-06 10:20:25 -04:00
George Claghorn
f008562dd3 Rebuild activestorage.js 2018-02-28 14:10:51 -05:00
George Claghorn
e0867b3672 Clear Blob's type before sending it
Prevent older versions of Chrome from appending a Content-Type header containing the Blob type, rendering the request invalid if we intend not to provide a Content-Type. This behavior was observed in Chrome 58.
2018-02-26 17:20:55 -05:00
Javan Makhmali
f17137b0a1 Rebuild activestorage.js
To pick up 21417e02e9
2018-01-08 17:13:18 -05:00
Javan Makhmali
1a5bf01fe0 Active Storage: Fix direct uploads in IE 11
Fixes #31531
Closes #31540
2017-12-23 11:21:54 -05:00
_N_I_X_O_N_
c06b614c12 Fix activestorage direct upload on firefox
Direct upload on firefox is not working because it can’t handle click
events on “input[type=submit]”.
After a successful upload we can see on console a xml parse error, it
happens because AWS S3 success body response is empty, so changing the
reponseType suppress this error.
2017-09-12 18:45:23 +00:00
Rafael Mendonça França
9330d01ada Add 'activestorage/' from commit '3f4a7218a4a4923a0e7ce1b2eb0d2888ce30da58'
git-subtree-dir: activestorage
git-subtree-mainline: 0d58e7e478
git-subtree-split: 3f4a7218a4
2017-07-31 15:21:22 -04:00