jquery-rails 1.0.10 → 1.0.11

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of jquery-rails might be problematic. Click here for more details.

@@ -1,3 +1,9 @@
1
+ ## 1.0.11 (15 June 2011)
2
+
3
+ - Updated to latest jqueyr-ujs with cross-domain support
4
+
5
+ [See jquery-ujs issue 167](https://github.com/rails/jquery-ujs/pull/167) for relevant discussion
6
+
1
7
  ## 1.0.10 (13 June 2011)
2
8
 
3
9
  - Updated to latest jqueyr-ujs with bug fixes
@@ -1,8 +1,8 @@
1
1
  module Jquery
2
2
  module Rails
3
- VERSION = "1.0.10"
3
+ VERSION = "1.0.11"
4
4
  JQUERY_VERSION = "1.6.1"
5
5
  JQUERY_UI_VERSION = "1.8.12"
6
- JQUERY_UJS_VERSION = "3c360e34fac79a951108842529f6a48f287734f5"
6
+ JQUERY_UJS_VERSION = "616e4fe354ce0ae5137636f9b5475782a7c9e896"
7
7
  end
8
8
  end
@@ -95,6 +95,7 @@
95
95
  // Submits "remote" forms and links with ajax
96
96
  handleRemote: function(element) {
97
97
  var method, url, data,
98
+ crossDomain = element.data('cross-domain') || null,
98
99
  dataType = element.data('type') || ($.ajaxSettings && $.ajaxSettings.dataType);
99
100
 
100
101
  if (rails.fire(element, 'ajax:before')) {
@@ -116,7 +117,7 @@
116
117
  }
117
118
 
118
119
  rails.ajax({
119
- url: url, type: method || 'GET', data: data, dataType: dataType,
120
+ url: url, type: method || 'GET', data: data, dataType: dataType, crossDomain: crossDomain,
120
121
  // stopping the "ajax:beforeSend" event will cancel the ajax request
121
122
  beforeSend: function(xhr, settings) {
122
123
  if (settings.dataType === undefined) {
@@ -244,9 +245,9 @@
244
245
 
245
246
  // ajaxPrefilter is a jQuery 1.5 feature
246
247
  if ('ajaxPrefilter' in $) {
247
- $.ajaxPrefilter(function(options, originalOptions, xhr){ rails.CSRFProtection(xhr); });
248
+ $.ajaxPrefilter(function(options, originalOptions, xhr){ if ( !options.crossDomain ) { rails.CSRFProtection(xhr); }});
248
249
  } else {
249
- $(document).ajaxSend(function(e, xhr){ rails.CSRFProtection(xhr); });
250
+ $(document).ajaxSend(function(e, xhr, options){ if ( !options.crossDomain ) { rails.CSRFProtection(xhr); }});
250
251
  }
251
252
 
252
253
  $(rails.linkClickSelector).live('click.rails', function(e) {
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: jquery-rails
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.0.10
5
+ version: 1.0.11
6
6
  platform: ruby
7
7
  authors:
8
8
  - "Andr\xC3\xA9 Arko"
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-06-14 00:00:00 Z
13
+ date: 2011-06-15 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: railties