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 +4 -4
- data/README.md +23 -0
- data/app/assets/javascripts/s3_direct_upload.js.coffee +6 -5
- data/lib/s3_direct_upload/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5ecd749d5710ebfa75a12faf5b68c512799efc48
|
4
|
+
data.tar.gz: c21e61580debd3f04b771b811057122a465bab47
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
47
|
-
$(
|
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
|
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
|
+
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-
|
11
|
+
date: 2013-06-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|