remotipart 1.1.1 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,53 @@
1
+ ## Note on Patches/Pull Requests
2
+
3
+ * Fork the project.
4
+ * Make your feature addition or bug fix.
5
+ * Add tests for it. This is important so I don't break it in a
6
+ future version unintentionally.
7
+ * Commit, do not mess with rakefile, version, or history.
8
+ (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
9
+ * Send me a pull request. Bonus points for topic branches.
10
+
11
+ ## Tests
12
+
13
+ Because of the nature of AJAX file uploads and certain browser restrictions, we could not simply create unit tests (using qunit or jasmine)
14
+ to test the file upload functionality of remotipart (since the browsers running those test suites won't allow us to set the target of a file
15
+ upload input using javascript). So, instead we created a demo Rails app using remotipart with all remotipart functionality tested using RSpec and Capybara.
16
+
17
+ * [Demo Rails App with
18
+ Tests](https://github.com/JangoSteve/Rails-jQuery-Demo/tree/remotipart)
19
+ * [Tests](https://github.com/JangoSteve/Rails-jQuery-Demo/blob/remotipart/spec/features/comments_spec.rb)
20
+
21
+ To run tests:
22
+
23
+ Clone the remotipart branch of the demo app
24
+
25
+ ```
26
+ git clone -b remotipart git://github.com/JangoSteve/Rails-jQuery-Demo.git
27
+ ```
28
+
29
+ Install the dependencies
30
+
31
+ ```
32
+ bundle install
33
+ ```
34
+
35
+ Run the tests
36
+
37
+ ```
38
+ bundle exec rspec spec/
39
+ ```
40
+
41
+ If you need to test your own changes to remotipart, just update the Gemfile with your own fork/branch of remotipart:
42
+
43
+ ```
44
+ gem 'remotipart', :git => 'git://github.com/MY_FORK/remotipart.git', :branch => 'MY_BRANCH'
45
+ ```
46
+
47
+ To save time, you can also just bundle remotipart from your current
48
+ local machine / filesystem without having to commit your changes
49
+ or push them remotely:
50
+
51
+ ```
52
+ gem 'remotipart', :path => '../remotipart'
53
+ ```
@@ -1,5 +1,10 @@
1
1
  = History
2
2
 
3
+ === 1.2.0 / 2013-07-06
4
+
5
+ * Removed support for older jquery-ujs and jquery < 1.7.
6
+ * Fixed json (and other type) parsing issues, only html_escape HTML responses.
7
+
3
8
  === 1.1.1 / 2013-07-05
4
9
 
5
10
  * Fixed issue with GET params not being available in middleware.
@@ -13,7 +13,7 @@ This gem augments the native Rails jQuery remote form functionality enabling asy
13
13
 
14
14
  == Installation
15
15
 
16
- <b>Your app should be using jquery-rails gem v1.0.12 or above (except jquery-rails v2.0.3 and v2.1.0; there was a {bug in jquery-rails}[https://github.com/rails/jquery-ujs/issues/271] which causes remotiarpt to not work for those versions).</b>
16
+ <b>Your app should be using jquery-rails gem v2.3.0 or above.</b>
17
17
 
18
18
  If you're using an old version of the jquery-rails gem,
19
19
  make sure you have a supported jquery-ujs (rails.js or jquery_ujs.js) version from {VERSION_COMPATIBILITY}[https://github.com/JangoSteve/remotipart/blob/master/VERSION_COMPATIBILITY.rdoc].
@@ -23,7 +23,7 @@ make sure you have a supported jquery-ujs (rails.js or jquery_ujs.js) version fr
23
23
 
24
24
  * Add this line to your GEMFILE (use the appropriate version from the compatibilty chart if needed)
25
25
 
26
- gem 'remotipart', '~> 1.0'
26
+ gem 'remotipart', '~> 1.1'
27
27
 
28
28
  * And run
29
29
 
@@ -139,4 +139,4 @@ Thank you to {Adam Kerr}[https://github.com/ajrkerr] for helping move over to th
139
139
 
140
140
  == Copyright
141
141
 
142
- Copyright (c) 2011 {Steve Schwartz}[https://github.com/JangoSteve], {Greg Leppert}[https://github.com/leppert]. See LICENSE for details.
142
+ Copyright (c) 2013 {Steve Schwartz}[https://github.com/JangoSteve], {Greg Leppert}[https://github.com/leppert]. See LICENSE for details.
@@ -1,6 +1,6 @@
1
1
  module Remotipart
2
2
  module Rails
3
- VERSION = "1.1.1"
3
+ VERSION = "1.2.0"
4
4
  IFRAMETRANSPORT_VERSION = "02.06.2013"
5
5
  end
6
6
  end
@@ -13,7 +13,8 @@ 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}\">#{html_escape(response.body)}</textarea>}
16
+ textarea_body = response.content_type == 'text/html' ? html_escape(response.body) : response.body
17
+ response.body = %{<textarea data-type=\"#{response.content_type}\" data-status=\"#{response.response_code}\" data-statusText=\"#{response.message}\">#{textarea_body}</textarea>}
17
18
  response.content_type = Mime::HTML
18
19
  end
19
20
  response_body
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "remotipart"
8
- s.version = "1.1.1"
8
+ s.version = "1.2.0"
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 = "2013-07-05"
12
+ s.date = "2013-07-06"
13
13
  s.description = "Remotipart is a Ruby on Rails gem enabling remote multipart forms (AJAX style file uploads) with jquery-rails.\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 "
14
14
  s.email = ["greg@formasfunction.com", "steve@alfajango.com"]
15
15
  s.extra_rdoc_files = [
@@ -18,6 +18,7 @@ Gem::Specification.new do |s|
18
18
  ]
19
19
  s.files = [
20
20
  ".document",
21
+ "CONTRIBUTING.md",
21
22
  "Gemfile",
22
23
  "Gemfile.lock",
23
24
  "History.rdoc",
@@ -73,10 +73,6 @@
73
73
 
74
74
  remotipart.setup(form);
75
75
 
76
- // If browser does not support submit bubbling, then this live-binding will be called before direct
77
- // bindings. Therefore, we should directly call any direct bindings before remotely submitting form.
78
- if (!$.support.submitBubbles && $().jquery < '1.7' && $.rails.callFormSubmitBindings(form) === false) return $.rails.stopEverything(e);
79
-
80
76
  // Manually call jquery-ujs remote call so that it can setup form and settings as usual,
81
77
  // and trigger the `ajax:beforeSend` callback to which remotipart binds functionality.
82
78
  $.rails.handleRemote(form);
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.1
4
+ version: 1.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,11 +10,11 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-07-05 00:00:00.000000000Z
13
+ date: 2013-07-06 00:00:00.000000000Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rake
17
- requirement: &70145637696380 !ruby/object:Gem::Requirement
17
+ requirement: &70282875330640 !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: *70145637696380
25
+ version_requirements: *70282875330640
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: jeweler
28
- requirement: &70145637694700 !ruby/object:Gem::Requirement
28
+ requirement: &70282875329180 !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: *70145637694700
36
+ version_requirements: *70282875329180
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
@@ -48,6 +48,7 @@ extra_rdoc_files:
48
48
  - README.rdoc
49
49
  files:
50
50
  - .document
51
+ - CONTRIBUTING.md
51
52
  - Gemfile
52
53
  - Gemfile.lock
53
54
  - History.rdoc
@@ -82,7 +83,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
82
83
  version: '0'
83
84
  segments:
84
85
  - 0
85
- hash: 803845486888652544
86
+ hash: -3656035227424558239
86
87
  required_rubygems_version: !ruby/object:Gem::Requirement
87
88
  none: false
88
89
  requirements: