h5_uploader 0.3.2 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
data/lib/h5_uploader.rb CHANGED
@@ -5,7 +5,7 @@ module Fg
5
5
 
6
6
  module H5Uploader
7
7
 
8
- def uploader_js_content name,options
8
+ def self.uploader_js_content name,options
9
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}"
@@ -20,11 +20,11 @@ module Fg
20
20
 
21
21
  end
22
22
 
23
- def uploader_field_id(label)
23
+ def self.uploader_field_id(label)
24
24
  "field_uploader_#{label}"
25
25
  end
26
26
 
27
- def parse_uploader_options options,name
27
+ def self.parse_uploader_options options,name
28
28
  options[:id] = uploader_field_id(name)
29
29
  options[:action] ||= '/public/system/'
30
30
  options[:allowedExtensions] ||= []
@@ -40,15 +40,13 @@ module ActionView
40
40
  module Helpers
41
41
 
42
42
  class FormBuilder
43
-
44
- include Fg::H5Uploader
45
-
43
+
46
44
  def uploader(method,*args)
47
45
  options = args.extract_options!
48
- parse_uploader_options options,method
46
+ Fg::H5Uploader.parse_uploader_options options,method
49
47
 
50
48
  js_tag = @template.javascript_tag do
51
- uploader_js_content method,options
49
+ Fg::H5Uploader.uploader_js_content method,options
52
50
  end
53
51
 
54
52
  @template.content_tag(:div,:id => options[:id]) do
@@ -62,14 +60,12 @@ module ActionView
62
60
  end
63
61
 
64
62
  module FormTagHelper
65
-
66
- include Fg::H5Uploader
67
63
 
68
64
  def uploader_field_tag(name, *args)
69
65
  options = args.extract_options!
70
- parse_uploader_options options,name
66
+ Fg::H5Uploader.parse_uploader_options options,name
71
67
 
72
- js_tag = javascript_tag(uploader_js_content(name,options))
68
+ js_tag = javascript_tag(Fg::H5Uploader.uploader_js_content(name,options))
73
69
  div_tag = content_tag(:div,content_tag(:noscript,file_field_tag(name)),:id => options[:id])
74
70
  div_tag << js_tag
75
71
 
@@ -1,3 +1,3 @@
1
1
  module Uploader
2
- VERSION = "0.3.2"
2
+ VERSION = "0.4.0"
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.2
4
+ version: 0.4.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,12 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-07-08 00:00:00.000000000 +02:00
13
- default_executable:
12
+ date: 2012-01-27 00:00:00.000000000Z
14
13
  dependencies:
15
14
  - !ruby/object:Gem::Dependency
16
15
  name: rack-raw-upload
17
- requirement: &2154180720 !ruby/object:Gem::Requirement
16
+ requirement: &70286006752900 !ruby/object:Gem::Requirement
18
17
  none: false
19
18
  requirements:
20
19
  - - ! '>='
@@ -22,10 +21,10 @@ dependencies:
22
21
  version: '0'
23
22
  type: :runtime
24
23
  prerelease: false
25
- version_requirements: *2154180720
24
+ version_requirements: *70286006752900
26
25
  - !ruby/object:Gem::Dependency
27
26
  name: actionpack
28
- requirement: &2154180300 !ruby/object:Gem::Requirement
27
+ requirement: &70286006752480 !ruby/object:Gem::Requirement
29
28
  none: false
30
29
  requirements:
31
30
  - - ! '>='
@@ -33,7 +32,7 @@ dependencies:
33
32
  version: '0'
34
33
  type: :runtime
35
34
  prerelease: false
36
- version_requirements: *2154180300
35
+ version_requirements: *70286006752480
37
36
  description: Gem add a form builder called uploader that shows a button for multiple
38
37
  file uploads usign html5 techniques
39
38
  email:
@@ -53,7 +52,6 @@ files:
53
52
  - lib/h5_uploader/railtie.rb
54
53
  - lib/h5_uploader/version.rb
55
54
  - lib/task/rake.task.rb
56
- has_rdoc: true
57
55
  homepage: ''
58
56
  licenses: []
59
57
  post_install_message:
@@ -74,8 +72,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
74
72
  version: '0'
75
73
  requirements: []
76
74
  rubyforge_project: h5_uploader
77
- rubygems_version: 1.6.2
75
+ rubygems_version: 1.8.10
78
76
  signing_key:
79
77
  specification_version: 3
80
78
  summary: Multiple file uploads usign html5 techniques
81
79
  test_files: []
80
+ has_rdoc: