remotipart 1.1.0 → 1.1.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 +8 -0
- data/lib/remotipart/middleware.rb +2 -7
- data/lib/remotipart/rails.rb +1 -1
- data/lib/remotipart/rails/version.rb +1 -1
- data/lib/remotipart/render_overrides.rb +2 -2
- data/remotipart.gemspec +1 -1
- data/vendor/assets/javascripts/jquery.iframe-transport.js +3 -0
- data/vendor/assets/javascripts/jquery.remotipart.js +7 -0
- metadata +6 -6
data/History.rdoc
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
= History
|
2
2
|
|
3
|
+
=== 1.1.1 / 2013-07-05
|
4
|
+
|
5
|
+
* Fixed issue with GET params not being available in middleware.
|
6
|
+
* Fixed issue with clicked submit button not being submitted via remotipart ajax.
|
7
|
+
* Fixed issue with HTML not being escaped correctly.
|
8
|
+
* Fixed issue with iframe-transport on jQuery 1.10.x.
|
9
|
+
* Fixed compatibility issue with Rails 4.
|
10
|
+
|
3
11
|
=== 1.1.0 / 2013-07-04
|
4
12
|
|
5
13
|
* Updated to latest iframe-transport.
|
@@ -8,13 +8,8 @@ module Remotipart
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def call env
|
11
|
-
#
|
12
|
-
|
13
|
-
# and call the `POST` method on it
|
14
|
-
if ::Rails.version < "3.1"
|
15
|
-
Rack::Request.new(env).POST
|
16
|
-
end
|
17
|
-
params = env['rack.request.form_hash']
|
11
|
+
# Get request params
|
12
|
+
params = Rack::Request.new(env).params
|
18
13
|
|
19
14
|
# This was using an iframe transport, and is therefore an XHR
|
20
15
|
# This is required if we're going to override the http_accept
|
data/lib/remotipart/rails.rb
CHANGED
@@ -2,7 +2,7 @@ module Remotipart
|
|
2
2
|
# Responder used to automagically wrap any non-xml replies in a text-area
|
3
3
|
# as expected by iframe-transport.
|
4
4
|
module RenderOverrides
|
5
|
-
include
|
5
|
+
include ERB::Util
|
6
6
|
|
7
7
|
def self.included(base)
|
8
8
|
base.class_eval do
|
@@ -13,7 +13,7 @@ module Remotipart
|
|
13
13
|
def render_with_remotipart *args
|
14
14
|
render_without_remotipart *args
|
15
15
|
if remotipart_submitted?
|
16
|
-
response.body = %{<textarea data-type=\"#{response.content_type}\" data-status=\"#{response.response_code}\" data-statusText=\"#{response.message}\">#{response.body}</textarea>}
|
16
|
+
response.body = %{<textarea data-type=\"#{response.content_type}\" data-status=\"#{response.response_code}\" data-statusText=\"#{response.message}\">#{html_escape(response.body)}</textarea>}
|
17
17
|
response.content_type = Mime::HTML
|
18
18
|
end
|
19
19
|
response_body
|
data/remotipart.gemspec
CHANGED
@@ -201,6 +201,9 @@
|
|
201
201
|
root ? (root.textContent || root.innerText) : null
|
202
202
|
};
|
203
203
|
cleanUp();
|
204
|
+
if (!jqXHR.responseText) {
|
205
|
+
jqXHR.responseText = content.text;
|
206
|
+
}
|
204
207
|
completeCallback(status, statusText, content, type ?
|
205
208
|
("Content-Type: " + type) :
|
206
209
|
null);
|
@@ -8,6 +8,9 @@
|
|
8
8
|
$.remotipart = remotipart = {
|
9
9
|
|
10
10
|
setup: function(form) {
|
11
|
+
// Preserve form.data('ujs:submit-button') before it gets nulled by $.ajax.handleRemote
|
12
|
+
var button = form.data('ujs:submit-button');
|
13
|
+
|
11
14
|
form
|
12
15
|
// Allow setup part of $.rails.handleRemote to setup remote settings before canceling default remote handler
|
13
16
|
// This is required in order to change the remote settings using the form details
|
@@ -21,6 +24,10 @@
|
|
21
24
|
settings.files = $($.rails.fileInputSelector, form);
|
22
25
|
settings.data = form.serializeArray();
|
23
26
|
|
27
|
+
// Insert the name/value of the clicked submit button, if any
|
28
|
+
if (button)
|
29
|
+
settings.data.push(button);
|
30
|
+
|
24
31
|
// jQuery 1.9 serializeArray() contains input:file entries
|
25
32
|
// so exclude them from settings.data, otherwise files will not be sent
|
26
33
|
settings.files.each(function(i, file){
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: remotipart
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -14,7 +14,7 @@ date: 2013-07-05 00:00:00.000000000Z
|
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rake
|
17
|
-
requirement: &
|
17
|
+
requirement: &70145637696380 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ! '>='
|
@@ -22,10 +22,10 @@ dependencies:
|
|
22
22
|
version: '0'
|
23
23
|
type: :development
|
24
24
|
prerelease: false
|
25
|
-
version_requirements: *
|
25
|
+
version_requirements: *70145637696380
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: jeweler
|
28
|
-
requirement: &
|
28
|
+
requirement: &70145637694700 !ruby/object:Gem::Requirement
|
29
29
|
none: false
|
30
30
|
requirements:
|
31
31
|
- - ! '>='
|
@@ -33,7 +33,7 @@ dependencies:
|
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
|
-
version_requirements: *
|
36
|
+
version_requirements: *70145637694700
|
37
37
|
description: ! "Remotipart is a Ruby on Rails gem enabling remote multipart forms
|
38
38
|
(AJAX style file uploads) with jquery-rails.\n This gem augments the native Rails
|
39
39
|
3 jQuery-UJS remote form function enabling asynchronous file uploads with little
|
@@ -82,7 +82,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
82
82
|
version: '0'
|
83
83
|
segments:
|
84
84
|
- 0
|
85
|
-
hash:
|
85
|
+
hash: 803845486888652544
|
86
86
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
87
87
|
none: false
|
88
88
|
requirements:
|