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.
@@ -19,4 +19,5 @@ Gem::Specification.new do |s|
19
19
  s.require_paths = ["lib"]
20
20
 
21
21
  s.add_dependency 'rack-raw-upload'
22
+ s.add_dependency 'actionpack'
22
23
  end
@@ -6,12 +6,13 @@ module Fg
6
6
  module H5Uploader
7
7
 
8
8
  def uploader_js_content name,options
9
- jss = "var uploader = new qq.FileUploader({"
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} : '#{value}'"
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
- "field-uploader_#{label}"
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
@@ -1,3 +1,3 @@
1
1
  module Uploader
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
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.0
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-06 00:00:00.000000000 +02:00
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: &2153351340 !ruby/object:Gem::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: *2153351340
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: