remotipart 1.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/History.rdoc CHANGED
@@ -1,5 +1,11 @@
1
1
  = History
2
2
 
3
+ === 1.0.1 / 2011-11-27
4
+
5
+ * Minor Enhancements
6
+ * Added support for non-post methods from Rails's `_method` hidden input.
7
+ * Fixed IE form submit-bubbling support for jquery 1.7
8
+
3
9
  === 1.0 / 2011-08-26
4
10
 
5
11
  * New Features
data/Rakefile CHANGED
@@ -17,7 +17,7 @@ begin
17
17
  gem.version = Remotipart::Rails::VERSION
18
18
  # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
19
19
  end
20
- Jeweler::GemcutterTasks.new
20
+ Jeweler::RubygemsDotOrgTasks.new
21
21
  rescue LoadError
22
22
  puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
23
23
  end
@@ -47,7 +47,7 @@ task :test => :check_dependencies
47
47
  task :default => :test
48
48
 
49
49
  require 'rake/rdoctask'
50
- require 'lib/remotipart/rails/version'
50
+ require File.expand_path('../lib/remotipart/rails/version', __FILE__)
51
51
  Rake::RDocTask.new do |rdoc|
52
52
  version = Remotipart::Rails::VERSION
53
53
 
@@ -1,6 +1,6 @@
1
1
  module Remotipart
2
2
  module Rails
3
- VERSION = "1.0"
3
+ VERSION = "1.0.1"
4
4
  IFRAMETRANSPORT_VERSION = "07.05.2011"
5
5
  end
6
6
  end
@@ -6,10 +6,11 @@ module Remotipart
6
6
  def render *args
7
7
  super
8
8
  if remotipart_submitted?
9
- response.body = %{<textarea data-type=\"#{content_type}\">#{response.body}</textarea>}
9
+ response.body = %{<textarea data-type=\"#{content_type}\" response-code=\"#{response.response_code}\">#{response.body}</textarea>}
10
10
  response.content_type = Mime::HTML
11
11
  end
12
12
  response_body
13
13
  end
14
14
  end
15
15
  end
16
+
data/remotipart.gemspec CHANGED
@@ -1,59 +1,50 @@
1
1
  # Generated by jeweler
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
- s.name = %q{remotipart}
8
- s.version = "1.0"
7
+ s.name = "remotipart"
8
+ s.version = "1.0.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Greg Leppert", "Steve Schwartz"]
12
- s.date = %q{2011-08-26}
13
- s.description = %q{Remotipart is a Ruby on Rails gem enabling remote multipart forms (AJAX style file uploads) with jQuery.
14
- This gem augments the native Rails 3 jQuery-UJS remote form function enabling asynchronous file uploads with little to no modification to your application.
15
- }
12
+ s.date = "2011-11-27"
13
+ s.description = "Remotipart is a Ruby on Rails gem enabling remote multipart forms (AJAX style file uploads) with jQuery.\n This gem augments the native Rails 3 jQuery-UJS remote form function enabling asynchronous file uploads with little to no modification to your application.\n "
16
14
  s.email = ["greg@formasfunction.com", "steve@alfajango.com"]
17
15
  s.extra_rdoc_files = [
18
16
  "LICENSE",
19
- "README.rdoc"
17
+ "README.rdoc"
20
18
  ]
21
19
  s.files = [
22
20
  ".document",
23
- ".gitignore",
24
- "History.rdoc",
25
- "LICENSE",
26
- "README.rdoc",
27
- "Rakefile",
28
- "VERSION_COMPATIBILITY.rdoc",
29
- "lib/generators/remotipart/install/install_generator.rb",
30
- "lib/remotipart.rb",
31
- "lib/remotipart/middleware.rb",
32
- "lib/remotipart/rails.rb",
33
- "lib/remotipart/rails/engine.rb",
34
- "lib/remotipart/rails/railtie.rb",
35
- "lib/remotipart/rails/version.rb",
36
- "lib/remotipart/render_overrides.rb",
37
- "lib/remotipart/request_helper.rb",
38
- "lib/remotipart/view_helper.rb",
39
- "remotipart.gemspec",
40
- "test/helper.rb",
41
- "test/test_remotipart.rb",
42
- "vendor/assets/javascripts/jquery.iframe-transport.js",
43
- "vendor/assets/javascripts/jquery.remotipart.js"
44
- ]
45
- s.homepage = %q{http://www.alfajango.com/blog/remotipart-rails-gem/}
46
- s.rdoc_options = ["--charset=UTF-8"]
47
- s.require_paths = ["lib"]
48
- s.rubygems_version = %q{1.3.7}
49
- s.summary = %q{Remotipart is a Ruby on Rails gem enabling remote multipart forms (AJAX style file uploads) with jQuery.}
50
- s.test_files = [
21
+ "History.rdoc",
22
+ "LICENSE",
23
+ "README.rdoc",
24
+ "Rakefile",
25
+ "VERSION_COMPATIBILITY.rdoc",
26
+ "lib/generators/remotipart/install/install_generator.rb",
27
+ "lib/remotipart.rb",
28
+ "lib/remotipart/middleware.rb",
29
+ "lib/remotipart/rails.rb",
30
+ "lib/remotipart/rails/engine.rb",
31
+ "lib/remotipart/rails/railtie.rb",
32
+ "lib/remotipart/rails/version.rb",
33
+ "lib/remotipart/render_overrides.rb",
34
+ "lib/remotipart/request_helper.rb",
35
+ "lib/remotipart/view_helper.rb",
36
+ "remotipart.gemspec",
51
37
  "test/helper.rb",
52
- "test/test_remotipart.rb"
38
+ "test/test_remotipart.rb",
39
+ "vendor/assets/javascripts/jquery.iframe-transport.js",
40
+ "vendor/assets/javascripts/jquery.remotipart.js"
53
41
  ]
42
+ s.homepage = "http://www.alfajango.com/blog/remotipart-rails-gem/"
43
+ s.require_paths = ["lib"]
44
+ s.rubygems_version = "1.8.11"
45
+ s.summary = "Remotipart is a Ruby on Rails gem enabling remote multipart forms (AJAX style file uploads) with jQuery."
54
46
 
55
47
  if s.respond_to? :specification_version then
56
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
57
48
  s.specification_version = 3
58
49
 
59
50
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
@@ -113,7 +113,7 @@
113
113
  // based on the content type returned by the server, without attempting an
114
114
  // (unsupported) conversion from "iframe" to the actual type.
115
115
  options.dataTypes.shift();
116
-
116
+
117
117
  if (files.length) {
118
118
  // Determine the form the file fields belong to, and make sure they all
119
119
  // actually belong to the same form.
@@ -177,7 +177,7 @@
177
177
  send: function(headers, completeCallback) {
178
178
  iframe = $("<iframe src='javascript:false;' name='iframe-" + $.now()
179
179
  + "' style='display:none'></iframe>");
180
-
180
+
181
181
  // The first load event gets fired after the iframe has been injected
182
182
  // into the DOM, and is used to prepare the actual submission.
183
183
  iframe.bind("load", function() {
@@ -187,14 +187,14 @@
187
187
  // actual payload is embedded in a `<textarea>` element, and
188
188
  // prepares the required conversions to be made in that case.
189
189
  iframe.unbind("load").bind("load", function() {
190
-
190
+
191
191
  var doc = this.contentWindow ? this.contentWindow.document :
192
192
  (this.contentDocument ? this.contentDocument : this.document),
193
193
  root = doc.documentElement ? doc.documentElement : doc.body,
194
194
  textarea = root.getElementsByTagName("textarea")[0],
195
195
  type = textarea ? textarea.getAttribute("data-type") : null;
196
-
197
- var status = 200,
196
+
197
+ var status = textarea ? parseInt(textarea.getAttribute("response-code")) : 200,
198
198
  statusText = "OK",
199
199
  responses = { text: type ? textarea.value : root ? root.innerHTML : null },
200
200
  headers = "Content-Type: " + (type || "text/html")
@@ -203,7 +203,7 @@
203
203
 
204
204
  setTimeout(cleanUp, 50);
205
205
  });
206
-
206
+
207
207
  // Now that the load handler has been set up, reconfigure and
208
208
  // submit the form.
209
209
  form.attr("action", options.url)
@@ -58,7 +58,7 @@
58
58
 
59
59
  // If browser does not support submit bubbling, then this live-binding will be called before direct
60
60
  // bindings. Therefore, we should directly call any direct bindings before remotely submitting form.
61
- if (!$.support.submitBubbles && $.rails.callFormSubmitBindings(form) === false) return $.rails.stopEverything(e);
61
+ if (!$.support.submitBubbles && $().jquery < '1.7' && $.rails.callFormSubmitBindings(form) === false) return $.rails.stopEverything(e);
62
62
 
63
63
  // Manually call jquery-ujs remote call so that it can setup form and settings as usual,
64
64
  // and trigger the `ajax:beforeSend` callback to which remotipart binds functionality.
metadata CHANGED
@@ -1,51 +1,42 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: remotipart
3
- version: !ruby/object:Gem::Version
4
- hash: 15
5
- prerelease: false
6
- segments:
7
- - 1
8
- - 0
9
- version: "1.0"
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.1
5
+ prerelease:
10
6
  platform: ruby
11
- authors:
7
+ authors:
12
8
  - Greg Leppert
13
9
  - Steve Schwartz
14
10
  autorequire:
15
11
  bindir: bin
16
12
  cert_chain: []
17
-
18
- date: 2011-08-26 00:00:00 -04:00
19
- default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
13
+ date: 2011-11-27 00:00:00.000000000Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
22
16
  name: thoughtbot-shoulda
23
- prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
17
+ requirement: &2152392700 !ruby/object:Gem::Requirement
25
18
  none: false
26
- requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- hash: 3
30
- segments:
31
- - 0
32
- version: "0"
19
+ requirements:
20
+ - - ! '>='
21
+ - !ruby/object:Gem::Version
22
+ version: '0'
33
23
  type: :development
34
- version_requirements: *id001
35
- description: "Remotipart is a Ruby on Rails gem enabling remote multipart forms (AJAX style file uploads) with jQuery.\n This gem augments the native Rails 3 jQuery-UJS remote form function enabling asynchronous file uploads with little to no modification to your application.\n "
36
- email:
24
+ prerelease: false
25
+ version_requirements: *2152392700
26
+ description: ! "Remotipart is a Ruby on Rails gem enabling remote multipart forms
27
+ (AJAX style file uploads) with jQuery.\n This gem augments the native Rails 3
28
+ jQuery-UJS remote form function enabling asynchronous file uploads with little to
29
+ no modification to your application.\n "
30
+ email:
37
31
  - greg@formasfunction.com
38
32
  - steve@alfajango.com
39
33
  executables: []
40
-
41
34
  extensions: []
42
-
43
- extra_rdoc_files:
35
+ extra_rdoc_files:
44
36
  - LICENSE
45
37
  - README.rdoc
46
- files:
38
+ files:
47
39
  - .document
48
- - .gitignore
49
40
  - History.rdoc
50
41
  - LICENSE
51
42
  - README.rdoc
@@ -66,40 +57,29 @@ files:
66
57
  - test/test_remotipart.rb
67
58
  - vendor/assets/javascripts/jquery.iframe-transport.js
68
59
  - vendor/assets/javascripts/jquery.remotipart.js
69
- has_rdoc: true
70
60
  homepage: http://www.alfajango.com/blog/remotipart-rails-gem/
71
61
  licenses: []
72
-
73
62
  post_install_message:
74
- rdoc_options:
75
- - --charset=UTF-8
76
- require_paths:
63
+ rdoc_options: []
64
+ require_paths:
77
65
  - lib
78
- required_ruby_version: !ruby/object:Gem::Requirement
66
+ required_ruby_version: !ruby/object:Gem::Requirement
79
67
  none: false
80
- requirements:
81
- - - ">="
82
- - !ruby/object:Gem::Version
83
- hash: 3
84
- segments:
85
- - 0
86
- version: "0"
87
- required_rubygems_version: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - ! '>='
70
+ - !ruby/object:Gem::Version
71
+ version: '0'
72
+ required_rubygems_version: !ruby/object:Gem::Requirement
88
73
  none: false
89
- requirements:
90
- - - ">="
91
- - !ruby/object:Gem::Version
92
- hash: 3
93
- segments:
94
- - 0
95
- version: "0"
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
96
78
  requirements: []
97
-
98
79
  rubyforge_project:
99
- rubygems_version: 1.3.7
80
+ rubygems_version: 1.8.11
100
81
  signing_key:
101
82
  specification_version: 3
102
- summary: Remotipart is a Ruby on Rails gem enabling remote multipart forms (AJAX style file uploads) with jQuery.
103
- test_files:
104
- - test/helper.rb
105
- - test/test_remotipart.rb
83
+ summary: Remotipart is a Ruby on Rails gem enabling remote multipart forms (AJAX style
84
+ file uploads) with jQuery.
85
+ test_files: []
data/.gitignore DELETED
@@ -1,21 +0,0 @@
1
- ## MAC OS
2
- .DS_Store
3
-
4
- ## TEXTMATE
5
- *.tmproj
6
- tmtags
7
-
8
- ## EMACS
9
- *~
10
- \#*
11
- .\#*
12
-
13
- ## VIM
14
- *.swp
15
-
16
- ## PROJECT::GENERAL
17
- coverage
18
- rdoc
19
- pkg
20
-
21
- ## PROJECT::SPECIFIC