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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 79a73c081de8aecbec8eed02b344914bb476f96bc8e0c5ef642ebd585c2e9fb0
4
- data.tar.gz: 00b5c31b12ad6b2b1399572d62ea28777d269cd7b7e94204759064ab4e75541d
3
+ metadata.gz: 978606ea507f025893454aab0a70372440e4c6d8724c45e8b8882a0d9279c650
4
+ data.tar.gz: 112f9ec11d62e984109d01f2c8c9f266bb2490a19add3dc07252ddb408f9bc06
5
5
  SHA512:
6
- metadata.gz: 16c3bbb17f48a414e2376170542d67408934155fd030ef33bfe8dcc39d2382ec6a4ab3e09692effc7a6de8b76fc91c65ec2f2a9f4b2bb6afa5c13c1c7c1fe6ea
7
- data.tar.gz: 0eabe09a33563b8b91621cf1cf3ed4e636afdf267b9134425dbc8820dbc4df5a5d429ee948df31688fb0eebc038c38f35ab06e1e77b62bea90223b78690ab09f
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( max_files max_file_size file_drop_event file_success_event queue_complete_event file_drop_id file_drop_over_id ).each do |key|
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
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DropzoneInput
4
- VERSION = '1.0.0'
4
+ VERSION = '1.3.0'
5
5
  end
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.0.0
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-01-13 00:00:00.000000000 Z
11
+ date: 2021-02-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails