Permalink
Browse files

Removed support for jquery 1.4.4 and 1.5.x. Added support for jquery …

…1.6.2
  • Loading branch information...
1 parent 0e74268 commit 5433841d01622345f734f22f82394ac035c2f783 @JangoSteve JangoSteve committed Jul 9, 2011
Showing with 9 additions and 19 deletions.
  1. +2 −2 README.md
  2. +2 −7 src/rails.js
  3. +1 −2 test/public/test/call-remote-callbacks.js
  4. +1 −5 test/public/test/call-remote.js
  5. +1 −1 test/server.rb
  6. +2 −2 test/views/index.erb
View
@@ -15,7 +15,7 @@ Full [documentation is on the wiki][wiki], including the [list of published Ajax
Requirements
------------
-- [jQuery 1.4.4][jquery] or later;
+- [jQuery 1.6][jquery] or later;
- HTML5 doctype (optional).
If you don't use HTML5, adding "data" attributes to your HTML4 or XHTML pages might make them fail [W3C markup validation][validator]. However, this shouldn't create any issues for web browsers or other user agents.
@@ -25,7 +25,7 @@ Installation
For automated installation in Rails, use the "jquery-rails" gem. Place this in your Gemfile:
- gem 'jquery-rails', '>= 1.0.3'
+ gem 'jquery-rails', '>= 1.0.12'
And run:
View
@@ -1,7 +1,7 @@
/**
* Unobtrusive scripting adapter for jQuery
*
- * Requires jQuery 1.4.4 or later.
+ * Requires jQuery 1.6.0 or later.
* https://github.com/rails/jquery-ujs
* Uploading file using rails.js
@@ -255,12 +255,7 @@
}
};
- // ajaxPrefilter is a jQuery 1.5 feature
- if ('ajaxPrefilter' in $) {
- $.ajaxPrefilter(function(options, originalOptions, xhr){ if ( !options.crossDomain ) { rails.CSRFProtection(xhr); }});
- } else {
- $(document).ajaxSend(function(e, xhr, options){ if ( !options.crossDomain ) { rails.CSRFProtection(xhr); }});
- }
+ $.ajaxPrefilter(function(options, originalOptions, xhr){ if ( !options.crossDomain ) { rails.CSRFProtection(xhr); }});
$(rails.linkClickSelector).live('click.rails', function(e) {
var link = $(this);
@@ -227,8 +227,7 @@ asyncTest('"ajax:beforeSend", "ajax:error" and "ajax:complete" are triggered on
form.bind('ajax:error', function(e, xhr, status, error) {
ok(xhr.getResponseHeader, 'first argument to "ajax:error" should be an XHR object');
equal(status, 'error', 'second argument to ajax:error should be a status string');
- if (jQuery().jquery.indexOf('1.4') === 0) strictEqual(error, undefined)
- else equal(error, 'Forbidden', 'third argument to ajax:error should be an HTTP status response');
+ equal(error, 'Forbidden', 'third argument to ajax:error should be an HTTP status response');
// Opera returns "0" for HTTP code
equal(xhr.status, window.opera ? 0 : 403, 'status code should be 403');
});
@@ -61,8 +61,6 @@ asyncTest('prefer JS, but accept any format', 1, function() {
submit(function(e, data, status, xhr) {
var accept = data.HTTP_ACCEPT;
- // HACK to normalize header sent by jQuery 1.4.4 and below:
- accept = accept.replace('*/*, */*', '*/*');
ok(accept.indexOf('*/*;q=0.5, text/javascript, application/javascript') === 0, 'Accept: ' + accept);
});
});
@@ -146,9 +144,7 @@ asyncTest('intelligently guesses crossDomain behavior when target URL is a diffe
$('#qunit-fixture').find('form')
.bind('ajax:beforeSend', function(e, xhr, settings) {
- // crossDomain doesn't work with jquery 1.4, because it wasn't added until 1.5
- if (jQuery().jquery.indexOf('1.4') === 0) strictEqual(settings.crossDomain, null)
- else equal(settings.crossDomain, true, 'crossDomain should be set to true');
+ equal(settings.crossDomain, true, 'crossDomain should be set to true');
// prevent request from actually getting sent off-domain
return false;
View
@@ -30,7 +30,7 @@ def script_tag src
end
get '/' do
- params[:version] ||= '1.4.4'
+ params[:version] ||= '1.6.2'
erb :index
end
View
@@ -5,9 +5,9 @@
<h1 id="qunit-header"><%= @title %></h1>
<div id="jquery-version">
jQuery version:
- <%= jquery_link '1.4.4' %>
- <%= jquery_link '1.5' %>
+ <%= jquery_link '1.6' %>
<%= jquery_link '1.6.1' %>
+ <%= jquery_link '1.6.2' %>
<%= jquery_link 'edge' if File.exist?(settings.root + '/public/vendor/jquery.js') %>
</div>
<h2 id="qunit-banner"></h2>

0 comments on commit 5433841

Please sign in to comment.