s3_direct_upload 0.1.4 → 0.1.5

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
  SHA1:
3
- metadata.gz: 2d7df44d91a8abeebc48b92b35a0d6724f599449
4
- data.tar.gz: 2a792e6395b81ce538463552b3fd7f4a8807c1a5
3
+ metadata.gz: 5ecd749d5710ebfa75a12faf5b68c512799efc48
4
+ data.tar.gz: c21e61580debd3f04b771b811057122a465bab47
5
5
  SHA512:
6
- metadata.gz: 5db1d43f6016f4bead8f4197213a75fdab4178cf55bb25a663d165c7021d3b1094814ab7bb7c29577565aa3720c2950dec02b77784c8a6cc846f6ffa7dd28f3f
7
- data.tar.gz: cf6dcce917f14bd06601e94d78ef75232006345220b044f2027fdab5d6ca7243fdcfd28698d57d6e5f1b20010a0ef9de57a3039a87287513be329127b1c073c0
6
+ metadata.gz: d7a3d672dca001e3ddb3ca8351699678f33d6aa2f443820916ea8895317f2a9605dde035e45447b3138edf96977e638b35f6625026e185d322f37e1e9654c8d6
7
+ data.tar.gz: fa23deec6b1172416a6d224d52b691e32f276d342a39439ae3658e6b3fb5bfbf32cdf964c1738865e3abc464f5af3b4c77fd123654c7734ac6d61afcbed512cd
data/README.md CHANGED
@@ -141,6 +141,29 @@ jQuery ->
141
141
  progress_bar_target: $('.js-progress-bars')
142
142
  click_submit_target: $('.submit-target')
143
143
  ```
144
+ ### Example with single file upload bar without script template
145
+
146
+ This demonstrates how to use progress_bar_target and allow_multiple_files (only works with false option - single file) to show only one progress bar without script template.
147
+
148
+ ```coffeescript
149
+ jQuery ->
150
+ $("#myS3Uploader").S3Uploader
151
+ progress_bar_target: $('.js-progress-bars')
152
+ allow_multiple_files: false
153
+ ```
154
+
155
+ Target for progress bar
156
+
157
+ ```html
158
+ <div class="upload js-progress-bars">
159
+ <div class="progress">
160
+ <div class="bars"> </div>
161
+ </div>
162
+ </div>
163
+ ```
164
+
165
+
166
+
144
167
 
145
168
  ### Public methods
146
169
  You can change the settings on your form later on by accessing the jQuery instance:
@@ -37,14 +37,16 @@ $.fn.S3Uploader = (options) ->
37
37
  $uploadForm.fileupload
38
38
 
39
39
  add: (e, data) ->
40
- $uploadForm.trigger("file_added", [e,data])
41
-
42
40
  file = data.files[0]
43
41
  file.unique_id = Math.random().toString(36).substr(2,16)
44
42
 
45
43
  unless settings.before_add and not settings.before_add(file)
46
- data.context = $($.trim(tmpl("template-upload", file))) if $('#template-upload').length > 0
47
- $(data.context).appendTo(settings.progress_bar_target || $uploadForm)
44
+ current_files.push data
45
+ if $('#template-upload').length > 0
46
+ data.context = $($.trim(tmpl("template-upload", file)))
47
+ $(data.context).appendTo(settings.progress_bar_target || $uploadForm)
48
+ else if !setting.allow_multiple_files
49
+ data.context = settings.progress_bar_target
48
50
  if settings.click_submit_target
49
51
  if settings.allow_multiple_files
50
52
  forms_for_submit.push data
@@ -134,7 +136,6 @@ $.fn.S3Uploader = (options) ->
134
136
  build_relativePath = (file) ->
135
137
  file.relativePath || (file.webkitRelativePath.split("/")[0..-2].join("/") + "/" if file.webkitRelativePath)
136
138
 
137
-
138
139
  #public methods
139
140
  @initialize = ->
140
141
  # Save key for IE9 Fix
@@ -1,3 +1,3 @@
1
1
  module S3DirectUpload
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: s3_direct_upload
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wayne Hoover
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-05-21 00:00:00.000000000 Z
11
+ date: 2013-06-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails