dropzone_input 1.0.0 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +20 -0
- data/lib/dropzone_input/helpers.rb +15 -1
- data/lib/dropzone_input/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 978606ea507f025893454aab0a70372440e4c6d8724c45e8b8882a0d9279c650
|
4
|
+
data.tar.gz: 112f9ec11d62e984109d01f2c8c9f266bb2490a19add3dc07252ddb408f9bc06
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 249e454be1bce83fb758b85a75bba173202e49b43ba92f2e33ee7c9fd9d1c6ff2288625a39ee55141927b35cc2d1c0d4ffc4716a3faabf6a3fd72f71b174de61
|
7
|
+
data.tar.gz: 0fced6ac12b6257d9b5bd2a1a6ecf2b8cb0c0eceba80d08153bf7d5397e143c8b84e4304392dbd8ae2dfa8fa99b14b0470b56141d62f4ab94facfcfb399dd9f8
|
data/README.md
CHANGED
@@ -6,6 +6,7 @@ A Rails helper and Stimulus Controller that makes adding dropzone to a Rails for
|
|
6
6
|
<%= form_with(model: User.new) do |form| %>
|
7
7
|
<%= dropzone form, :image,
|
8
8
|
file_success_event: 'USER_FILE_UPLOADED',
|
9
|
+
file_progress_event: 'USER_FILE_PROGRESS',
|
9
10
|
queue_complete_event: 'USER_FILE_UPLOAD_DONE' %>
|
10
11
|
<% end %>
|
11
12
|
```
|
@@ -14,6 +15,25 @@ A Rails helper and Stimulus Controller that makes adding dropzone to a Rails for
|
|
14
15
|
specific styles, etc) will be non-configurable at the moment. We will work to generalize this over
|
15
16
|
time and *pull requests are welcome* and will be reviewed quickly.
|
16
17
|
|
18
|
+
## Options & Events
|
19
|
+
|
20
|
+
| Option Name | Description |
|
21
|
+
| -- | -- |
|
22
|
+
| `max_files` | default: `null` |
|
23
|
+
| `max_file_size` | default: `null` |
|
24
|
+
| `max_thumbnail_file_size` | default: `10` |
|
25
|
+
| `parallel_uploads` | default: `2` |
|
26
|
+
|
27
|
+
Events below receive `file` as first parameter.
|
28
|
+
|
29
|
+
| Event Name | Description |
|
30
|
+
| -- | -- |
|
31
|
+
| `file_added_event` | File added to queue |
|
32
|
+
| `file_progress_event` | Periodically called while file is being uploaded. `progress` in the second parameter, or through the `upload` property: `file.upload.progress`, `file.upload.bytesSent` |
|
33
|
+
| `file_removed_event` | File removed from queue |
|
34
|
+
| `file_start_event` | File will start uploading |
|
35
|
+
| `file_success_event` | File successfully uploaded |
|
36
|
+
|
17
37
|
## Installation
|
18
38
|
|
19
39
|
Add to your Gemfile.
|
@@ -12,7 +12,21 @@ module DropzoneInput
|
|
12
12
|
controller: 'dropzone',
|
13
13
|
dropzone_accepted_files: ActiveStorage.variable_content_types.join(',')
|
14
14
|
}
|
15
|
-
%i(
|
15
|
+
%i(
|
16
|
+
max_files
|
17
|
+
max_file_size
|
18
|
+
max_thumbnail_file_size
|
19
|
+
file_added_event
|
20
|
+
file_drop_event
|
21
|
+
file_drop_id
|
22
|
+
file_drop_over_id
|
23
|
+
file_progress_event
|
24
|
+
file_removed_event
|
25
|
+
file_start_event
|
26
|
+
file_success_event
|
27
|
+
parallel_uploads
|
28
|
+
queue_complete_event
|
29
|
+
).each do |key|
|
16
30
|
data["dropzone_#{key}".to_sym] = options.delete(key) if options.key?(key)
|
17
31
|
end
|
18
32
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dropzone_input
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Trae Robrock
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-02-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|