effective_assets 1.9.10 → 1.9.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d9f34cc6c231fc5a0e0fd39376ac231dd7f89423
4
- data.tar.gz: 966f600d4f9f57a426436859291b9cfab2507a27
3
+ metadata.gz: 51e3745a945790addff0431348d52cef20252584
4
+ data.tar.gz: 9f4dcb6b9e3a4d8545d4ed1861e18c046c23c8d5
5
5
  SHA512:
6
- metadata.gz: cfcc2942bf0a5160758a2cbd542309ed66ebf8e6f52923efe4e59234977d1664b41f4678f7ee26dccd9dc88bb667e25da2e1767c3decf9c130852164edf5ff3d
7
- data.tar.gz: ea43db44ef5ec857b4890f4608ae43facc1ef212fba8cf4d291c672ed5f5ec77c9149fa1c21e089e67af190b7acb3989184a05bb50529c98ca0b622594e59cb5
6
+ metadata.gz: d7c2274c7cce4e3244576edb1f4156404679784fbcbd26ead0638dbcbe758b8cdd30fdfb5da0baa917d2ae17a924d1abed7d57d62207efb81748e61247b880d3
7
+ data.tar.gz: f6da52fd6574eeecd3d6d419f84d9e6a81a29338cd77374c1fd275bc774e5e68aa2cb5cf4c687ecdaf8ace098cf25003b6c91ba049ec4010343103fe920561c9
data/README.md CHANGED
@@ -266,6 +266,8 @@ Use the custom form input for uploading (direct to S3) and attaching assets to t
266
266
  = f.input :pictures, :as => :asset_box, :limit => 2, :file_types => [:jpg, :gif, :png]
267
267
 
268
268
  = f.input :pictures, :as => :asset_box, :dialog => true, :dialog_url => '/admin/effective_assets' # Use the attach dialog
269
+
270
+ = f.input :pictures, :as => :asset_box, :click_submit => true # Auto click submit button after file uploads
269
271
  ```
270
272
 
271
273
  You may also upload secure (AWS: 'authenticated-read') assets with the same uploader:
@@ -20,6 +20,7 @@ $.fn.S3Uploader = (options) ->
20
20
  create_asset_url: null
21
21
  update_asset_url: null
22
22
  file_types: 'any'
23
+ click_submit: false
23
24
 
24
25
  $.extend settings, options
25
26
 
@@ -247,6 +248,7 @@ $.fn.S3Uploader = (options) ->
247
248
  else
248
249
  $(this).closest('.attachment').show()
249
250
 
251
+ click_submit() if settings.click_submit
250
252
 
251
253
  disable_submit = ->
252
254
  $uploadForm.data('effective-assets-uploading', true)
@@ -271,6 +273,10 @@ $.fn.S3Uploader = (options) ->
271
273
  submit.prop('disabled', false)
272
274
  submit.removeData('effective-assets-original-label')
273
275
 
276
+ return !anyUploading # Returns true if we submitted it
277
+
278
+ click_submit = -> $uploadForm.closest('form').submit()
279
+
274
280
  format_bitrate = (bits) ->
275
281
  if typeof bits != 'number'
276
282
  ''
@@ -14,6 +14,7 @@ module EffectiveAssetsS3Helper
14
14
  file_types: Array(options[:file_types]).flatten.join('|').to_s,
15
15
  create_asset_url: effective_assets.s3_uploads_url,
16
16
  update_asset_url: "#{effective_assets.s3_uploads_url}/:id",
17
+ click_submit: (options[:click_submit] == true)
17
18
  }.to_json()
18
19
  end
19
20
 
@@ -97,6 +97,7 @@ module Inputs
97
97
  :partial => 'asset_box_input/uploader',
98
98
  :locals => {
99
99
  :uid => @options[:uid],
100
+ :click_submit => @options[:click_submit],
100
101
  :limit => @options[:limit],
101
102
  :disabled => @options[:disabled],
102
103
  :required => (@options[:required] == true && attachments.length == 0),
@@ -1,5 +1,5 @@
1
1
  .uploads
2
- .asset-box-uploader{id: "s3_#{uid}", class: ('drop-files' if drop_files), 'data-input-js-options': s3_uploader_input_js_options(limit: limit, file_types: file_types) }
2
+ .asset-box-uploader{id: "s3_#{uid}", class: ('drop-files' if drop_files), 'data-input-js-options': s3_uploader_input_js_options(limit: limit, file_types: file_types, click_submit: click_submit) }
3
3
  = s3_uploader_fields(aws_acl: aws_acl)
4
4
 
5
5
  - if drop_files
@@ -1,3 +1,3 @@
1
1
  module EffectiveAssets
2
- VERSION = '1.9.10'.freeze
2
+ VERSION = '1.9.11'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_assets
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.10
4
+ version: 1.9.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-23 00:00:00.000000000 Z
11
+ date: 2017-11-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails