h5_uploader 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/h5_uploader.gemspec +1 -0
- data/lib/h5_uploader.rb +7 -5
- data/lib/h5_uploader/version.rb +1 -1
- metadata +15 -4
data/h5_uploader.gemspec
CHANGED
data/lib/h5_uploader.rb
CHANGED
@@ -6,12 +6,13 @@ module Fg
|
|
6
6
|
module H5Uploader
|
7
7
|
|
8
8
|
def uploader_js_content name,options
|
9
|
-
jss = "var
|
9
|
+
jss = "var uploader_#{options[:id]} = new qq.FileUploader({"
|
10
10
|
jss = jss << "element: document.getElementById('#{options[:id]}'),"
|
11
11
|
jss = jss << "allowedExtensions: #{options[:allowedExtensions].to_s}"
|
12
|
+
jss = jss << ",params: #{options[:params].to_json}" unless options[:params].nil?
|
12
13
|
|
13
|
-
options.each do |key,value| next if [:id,:allowedExtensions].include?(key)
|
14
|
-
jss = jss << ",#{key}
|
14
|
+
options.each do |key,value| next if [:id,:allowedExtensions,:params].include?(key)
|
15
|
+
jss = jss << ",#{key}: '#{value}'"
|
15
16
|
end
|
16
17
|
|
17
18
|
jss = jss << "});"
|
@@ -19,13 +20,14 @@ module Fg
|
|
19
20
|
end
|
20
21
|
|
21
22
|
def uploader_field_id(label)
|
22
|
-
"
|
23
|
+
"field_uploader_#{label}"
|
23
24
|
end
|
24
25
|
|
25
26
|
def parse_uploader_options options,name
|
26
27
|
options[:id] = uploader_field_id(name)
|
27
28
|
options[:action] ||= '/public/system/'
|
28
|
-
options[:allowedExtensions] ||= []
|
29
|
+
options[:allowedExtensions] ||= []
|
30
|
+
options[:params] ||= {}
|
29
31
|
end
|
30
32
|
|
31
33
|
end
|
data/lib/h5_uploader/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: h5_uploader
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,12 +9,12 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-07-
|
12
|
+
date: 2011-07-07 00:00:00.000000000 +02:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rack-raw-upload
|
17
|
-
requirement: &
|
17
|
+
requirement: &2157964420 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ! '>='
|
@@ -22,7 +22,18 @@ dependencies:
|
|
22
22
|
version: '0'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
|
-
version_requirements: *
|
25
|
+
version_requirements: *2157964420
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: actionpack
|
28
|
+
requirement: &2157964000 !ruby/object:Gem::Requirement
|
29
|
+
none: false
|
30
|
+
requirements:
|
31
|
+
- - ! '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: *2157964000
|
26
37
|
description: Gem add a form builder called uploader that shows a button for multiple
|
27
38
|
file uploads usign html5 techniques
|
28
39
|
email:
|