remotipart 1.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/History.rdoc +6 -0
- data/Rakefile +2 -2
- data/lib/remotipart/rails/version.rb +1 -1
- data/lib/remotipart/render_overrides.rb +2 -1
- data/remotipart.gemspec +29 -38
- data/vendor/assets/javascripts/jquery.iframe-transport.js +6 -6
- data/vendor/assets/javascripts/jquery.remotipart.js +1 -1
- metadata +38 -58
- data/.gitignore +0 -21
data/History.rdoc
CHANGED
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::
|
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
|
|
@@ -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
|
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 =
|
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 =
|
13
|
-
s.description =
|
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
|
-
|
17
|
+
"README.rdoc"
|
20
18
|
]
|
21
19
|
s.files = [
|
22
20
|
".document",
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
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
|
-
|
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
|
-
|
5
|
-
prerelease:
|
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
|
-
|
19
|
-
|
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
|
-
|
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
|
-
|
30
|
-
segments:
|
31
|
-
- 0
|
32
|
-
version: "0"
|
19
|
+
requirements:
|
20
|
+
- - ! '>='
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '0'
|
33
23
|
type: :development
|
34
|
-
|
35
|
-
|
36
|
-
|
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
|
-
|
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
|
-
|
84
|
-
|
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
|
-
|
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.
|
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
|
103
|
-
|
104
|
-
|
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: []
|