jquery-migrate-rails 1.0.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -25,7 +25,7 @@ Include it after the jquery as below
25
25
  //= require jquery-migrate-min
26
26
 
27
27
 
28
- ===Reference
28
+ ###Reference
29
29
  * jQuery upgrade: http://jquery.com/upgrade-guide/1.9/
30
30
  * jQuery migrate: https://github.com/jquery/jquery-migrate
31
31
 
@@ -1,7 +1,7 @@
1
1
  module Jquery
2
2
  module Migrate
3
3
  module Rails
4
- VERSION = "1.0.0"
4
+ VERSION = "1.1.1"
5
5
  end
6
6
  end
7
7
  end
@@ -1,3 +1,3 @@
1
- /*! jQuery Migrate v1.0.0 | (c) 2005, 2013 jQuery Foundation, Inc. and other contributors | jquery.org/license */
2
- jQuery.migrateMute===void 0&&(jQuery.migrateMute=!0),function(e,t,n){"use strict";function r(n){o[n]||(o[n]=!0,e.migrateWarnings.push(n),t.console&&console.warn&&!e.migrateMute&&console.warn("JQMIGRATE: "+n))}function a(t,a,o,i){if(Object.defineProperty)try{return Object.defineProperty(t,a,{configurable:!0,enumerable:!0,get:function(){return r(i),o},set:function(e){r(i),o=e}}),n}catch(u){}e._definePropertyBroken=!0,t[a]=o}var o={};e.migrateWarnings=[],e.migrateReset=function(){o={},e.migrateWarnings.length=0},"BackCompat"===document.compatMode&&r("jQuery is not compatible with Quirks Mode");var i={},u=e.attr,s=e.attrHooks.value&&e.attrHooks.value.get||function(){return null},c=e.attrHooks.value&&e.attrHooks.value.set||function(){return n},d=/^(?:input|button)$/i,l=/^[238]$/,p=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,f=/^(?:checked|selected)$/i;a(e,"attrFn",i,"jQuery.attrFn is deprecated"),e.attr=function(t,a,o,i){var s=a.toLowerCase(),c=t&&t.nodeType;return i&&(r("jQuery.fn.attr( props, pass ) is deprecated"),t&&!l.test(c)&&e.isFunction(e.fn[a]))?e(t)[a](o):("type"===a&&o!==n&&d.test(t.nodeName)&&r("Can't change the 'type' of an input or button in IE 6/7/8"),!e.attrHooks[s]&&p.test(s)&&(e.attrHooks[s]={get:function(t,r){var a,o=e.prop(t,r);return o===!0||"boolean"!=typeof o&&(a=t.getAttributeNode(r))&&a.nodeValue!==!1?r.toLowerCase():n},set:function(t,n,r){var a;return n===!1?e.removeAttr(t,r):(a=e.propFix[r]||r,a in t&&(t[a]=!0),t.setAttribute(r,r.toLowerCase())),r}},f.test(s)&&r("jQuery.fn.attr("+s+") may use property instead of attribute")),u.call(e,t,a,o))},e.attrHooks.value={get:function(e,t){var n=(e.nodeName||"").toLowerCase();return"button"===n?s.apply(this,arguments):("input"!==n&&"option"!==n&&r("property-based jQuery.fn.attr('value') is deprecated"),t in e?e.value:null)},set:function(e,t){var a=(e.nodeName||"").toLowerCase();return"button"===a?c.apply(this,arguments):("input"!==a&&"option"!==a&&r("property-based jQuery.fn.attr('value', val) is deprecated"),e.value=t,n)}};var g,h,m=e.fn.init,v=/^(?:.*(<[\w\W]+>)[^>]*|#([\w\-]*))$/;e.fn.init=function(t,n,a){var o;return t&&"string"==typeof t&&!e.isPlainObject(n)&&(o=v.exec(t))&&o[1]&&("<"!==t.charAt(0)&&r("$(html) HTML strings must start with '<' character"),n&&n.context&&(n=n.context),e.parseHTML)?m.call(this,e.parseHTML(e.trim(t),n,!0),n,a):m.apply(this,arguments)},e.fn.init.prototype=e.fn,e.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||0>e.indexOf("compatible")&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},g=e.uaMatch(navigator.userAgent),h={},g.browser&&(h[g.browser]=!0,h.version=g.version),h.chrome?h.webkit=!0:h.webkit&&(h.safari=!0),e.browser=h,a(e,"browser",h,"jQuery.browser is deprecated"),e.sub=function(){function t(e,n){return new t.fn.init(e,n)}e.extend(!0,t,this),t.superclass=this,t.fn=t.prototype=this(),t.fn.constructor=t,t.sub=this.sub,t.fn.init=function(r,a){return a&&a instanceof e&&!(a instanceof t)&&(a=t(a)),e.fn.init.call(this,r,a,n)},t.fn.init.prototype=t.fn;var n=t(document);return r("jQuery.sub() is deprecated"),t};var y=e.fn.data;e.fn.data=function(t){var a,o,i=this[0];return!i||"events"!==t||1!==arguments.length||(a=e.data(i,t),o=e._data(i,t),a!==n&&a!==o||o===n)?y.apply(this,arguments):(r("Use of jQuery.fn.data('events') is deprecated"),o)};var b=/\/(java|ecma)script/i,w=e.fn.andSelf||e.fn.addBack,j=e.buildFragment;e.fn.andSelf=function(){return r("jQuery.fn.andSelf() replaced by jQuery.fn.addBack()"),w.apply(this,arguments)},e.clean||(e.clean=function(t,a,o,i){a=a||document,a=!a.nodeType&&a[0]||a,a=a.ownerDocument||a,r("jQuery.clean() is deprecated");var u,s,c,d,l=[];if(e.merge(l,e.buildFragment(t,a).childNodes),o)for(c=function(e){return!e.type||b.test(e.type)?i?i.push(e.parentNode?e.parentNode.removeChild(e):e):o.appendChild(e):n},u=0;null!=(s=l[u]);u++)e.nodeName(s,"script")&&c(s)||(o.appendChild(s),s.getElementsByTagName!==n&&(d=e.grep(e.merge([],s.getElementsByTagName("script")),c),l.splice.apply(l,[u+1,0].concat(d)),u+=d.length));return l}),e.buildFragment=function(t,n,o,i){var u,s="jQuery.buildFragment() is deprecated";n=n||document,n=!n.nodeType&&n[0]||n,n=n.ownerDocument||n;try{u=j.call(e,t,n,o,i)}catch(c){u=j.call(e,t,n.nodeType?[n]:n[0],o,i),r(s)}return u.fragment||(a(u,"fragment",u,s),a(u,"cacheable",!1,s)),u};var Q=e.event.add,x=e.event.remove,k=e.event.trigger,C=e.fn.toggle,N=e.fn.live,T=e.fn.die,H="ajaxStart|ajaxStop|ajaxSend|ajaxComplete|ajaxError|ajaxSuccess",M=RegExp("\\b(?:"+H+")\\b"),F=/(?:^|\s)hover(\.\S+|)\b/,A=function(t){return"string"!=typeof t||e.event.special.hover?t:(F.test(t)&&r("'hover' pseudo-event is deprecated, use 'mouseenter mouseleave'"),t&&t.replace(F,"mouseenter$1 mouseleave$1"))};e.event.props&&"attrChange"!==e.event.props[0]&&e.event.props.unshift("attrChange","attrName","relatedNode","srcElement"),a(e.event,"handle",e.event.dispatch,"jQuery.event.handle is undocumented and deprecated"),e.event.add=function(e,t,n,a,o){e!==document&&M.test(t)&&r("AJAX events should be attached to document: "+t),Q.call(this,e,A(t||""),n,a,o)},e.event.remove=function(e,t,n,r,a){x.call(this,e,A(t)||"",n,r,a)},e.fn.error=function(){var e=Array.prototype.slice.call(arguments,0);return r("jQuery.fn.error() is deprecated"),e.splice(0,0,"error"),arguments.length?this.bind.apply(this,e):(this.triggerHandler.apply(this,e),this)},e.fn.toggle=function(t,n){if(!e.isFunction(t)||!e.isFunction(n))return C.apply(this,arguments);r("jQuery.fn.toggle(handler, handler...) is deprecated");var a=arguments,o=t.guid||e.guid++,i=0,u=function(n){var r=(e._data(this,"lastToggle"+t.guid)||0)%i;return e._data(this,"lastToggle"+t.guid,r+1),n.preventDefault(),a[r].apply(this,arguments)||!1};for(u.guid=o;a.length>i;)a[i++].guid=o;return this.click(u)},e.fn.live=function(t,n,a){return r("jQuery.fn.live() is deprecated"),N?N.apply(this,arguments):(e(this.context).on(t,this.selector,n,a),this)},e.fn.die=function(t,n){return r("jQuery.fn.die() is deprecated"),T?T.apply(this,arguments):(e(this.context).off(t,this.selector||"**",n),this)},e.event.trigger=function(e,t,n,a){return!n&!M.test(e)&&r("Global events are undocumented and deprecated"),k.call(this,e,t,n||document,a)},e.each(H.split("|"),function(t,n){e.event.special[n]={setup:function(){var t=this;return t!==document&&(e.event.add(document,n+"."+e.guid,function(){e.event.trigger(n,null,t,!0)}),e._data(this,n,e.guid++)),!1},teardown:function(){return this!==document&&e.event.remove(document,n+"."+e._data(this,n)),!1}}})}(jQuery,window);
3
- //@ sourceMappingURL=dist/jquery-migrate.min.map
1
+ /*! jQuery Migrate v1.1.1 | (c) 2005, 2013 jQuery Foundation, Inc. and other contributors | jquery.org/license */
2
+ jQuery.migrateMute===void 0&&(jQuery.migrateMute=!0),function(e,t,n){function r(n){o[n]||(o[n]=!0,e.migrateWarnings.push(n),t.console&&console.warn&&!e.migrateMute&&(console.warn("JQMIGRATE: "+n),e.migrateTrace&&console.trace&&console.trace()))}function a(t,a,o,i){if(Object.defineProperty)try{return Object.defineProperty(t,a,{configurable:!0,enumerable:!0,get:function(){return r(i),o},set:function(e){r(i),o=e}}),n}catch(s){}e._definePropertyBroken=!0,t[a]=o}var o={};e.migrateWarnings=[],!e.migrateMute&&t.console&&console.log&&console.log("JQMIGRATE: Logging is active"),e.migrateTrace===n&&(e.migrateTrace=!0),e.migrateReset=function(){o={},e.migrateWarnings.length=0},"BackCompat"===document.compatMode&&r("jQuery is not compatible with Quirks Mode");var i=e("<input/>",{size:1}).attr("size")&&e.attrFn,s=e.attr,u=e.attrHooks.value&&e.attrHooks.value.get||function(){return null},c=e.attrHooks.value&&e.attrHooks.value.set||function(){return n},l=/^(?:input|button)$/i,d=/^[238]$/,p=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,f=/^(?:checked|selected)$/i;a(e,"attrFn",i||{},"jQuery.attrFn is deprecated"),e.attr=function(t,a,o,u){var c=a.toLowerCase(),g=t&&t.nodeType;return u&&(4>s.length&&r("jQuery.fn.attr( props, pass ) is deprecated"),t&&!d.test(g)&&(i?a in i:e.isFunction(e.fn[a])))?e(t)[a](o):("type"===a&&o!==n&&l.test(t.nodeName)&&t.parentNode&&r("Can't change the 'type' of an input or button in IE 6/7/8"),!e.attrHooks[c]&&p.test(c)&&(e.attrHooks[c]={get:function(t,r){var a,o=e.prop(t,r);return o===!0||"boolean"!=typeof o&&(a=t.getAttributeNode(r))&&a.nodeValue!==!1?r.toLowerCase():n},set:function(t,n,r){var a;return n===!1?e.removeAttr(t,r):(a=e.propFix[r]||r,a in t&&(t[a]=!0),t.setAttribute(r,r.toLowerCase())),r}},f.test(c)&&r("jQuery.fn.attr('"+c+"') may use property instead of attribute")),s.call(e,t,a,o))},e.attrHooks.value={get:function(e,t){var n=(e.nodeName||"").toLowerCase();return"button"===n?u.apply(this,arguments):("input"!==n&&"option"!==n&&r("jQuery.fn.attr('value') no longer gets properties"),t in e?e.value:null)},set:function(e,t){var a=(e.nodeName||"").toLowerCase();return"button"===a?c.apply(this,arguments):("input"!==a&&"option"!==a&&r("jQuery.fn.attr('value', val) no longer sets properties"),e.value=t,n)}};var g,h,v=e.fn.init,m=e.parseJSON,y=/^(?:[^<]*(<[\w\W]+>)[^>]*|#([\w\-]*))$/;e.fn.init=function(t,n,a){var o;return t&&"string"==typeof t&&!e.isPlainObject(n)&&(o=y.exec(t))&&o[1]&&("<"!==t.charAt(0)&&r("$(html) HTML strings must start with '<' character"),n&&n.context&&(n=n.context),e.parseHTML)?v.call(this,e.parseHTML(e.trim(t),n,!0),n,a):v.apply(this,arguments)},e.fn.init.prototype=e.fn,e.parseJSON=function(e){return e||null===e?m.apply(this,arguments):(r("jQuery.parseJSON requires a valid JSON string"),null)},e.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||0>e.indexOf("compatible")&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e.browser||(g=e.uaMatch(navigator.userAgent),h={},g.browser&&(h[g.browser]=!0,h.version=g.version),h.chrome?h.webkit=!0:h.webkit&&(h.safari=!0),e.browser=h),a(e,"browser",e.browser,"jQuery.browser is deprecated"),e.sub=function(){function t(e,n){return new t.fn.init(e,n)}e.extend(!0,t,this),t.superclass=this,t.fn=t.prototype=this(),t.fn.constructor=t,t.sub=this.sub,t.fn.init=function(r,a){return a&&a instanceof e&&!(a instanceof t)&&(a=t(a)),e.fn.init.call(this,r,a,n)},t.fn.init.prototype=t.fn;var n=t(document);return r("jQuery.sub() is deprecated"),t},e.ajaxSetup({converters:{"text json":e.parseJSON}});var b=e.fn.data;e.fn.data=function(t){var a,o,i=this[0];return!i||"events"!==t||1!==arguments.length||(a=e.data(i,t),o=e._data(i,t),a!==n&&a!==o||o===n)?b.apply(this,arguments):(r("Use of jQuery.fn.data('events') is deprecated"),o)};var j=/\/(java|ecma)script/i,w=e.fn.andSelf||e.fn.addBack;e.fn.andSelf=function(){return r("jQuery.fn.andSelf() replaced by jQuery.fn.addBack()"),w.apply(this,arguments)},e.clean||(e.clean=function(t,a,o,i){a=a||document,a=!a.nodeType&&a[0]||a,a=a.ownerDocument||a,r("jQuery.clean() is deprecated");var s,u,c,l,d=[];if(e.merge(d,e.buildFragment(t,a).childNodes),o)for(c=function(e){return!e.type||j.test(e.type)?i?i.push(e.parentNode?e.parentNode.removeChild(e):e):o.appendChild(e):n},s=0;null!=(u=d[s]);s++)e.nodeName(u,"script")&&c(u)||(o.appendChild(u),u.getElementsByTagName!==n&&(l=e.grep(e.merge([],u.getElementsByTagName("script")),c),d.splice.apply(d,[s+1,0].concat(l)),s+=l.length));return d});var Q=e.event.add,x=e.event.remove,k=e.event.trigger,N=e.fn.toggle,C=e.fn.live,S=e.fn.die,T="ajaxStart|ajaxStop|ajaxSend|ajaxComplete|ajaxError|ajaxSuccess",M=RegExp("\\b(?:"+T+")\\b"),H=/(?:^|\s)hover(\.\S+|)\b/,A=function(t){return"string"!=typeof t||e.event.special.hover?t:(H.test(t)&&r("'hover' pseudo-event is deprecated, use 'mouseenter mouseleave'"),t&&t.replace(H,"mouseenter$1 mouseleave$1"))};e.event.props&&"attrChange"!==e.event.props[0]&&e.event.props.unshift("attrChange","attrName","relatedNode","srcElement"),e.event.dispatch&&a(e.event,"handle",e.event.dispatch,"jQuery.event.handle is undocumented and deprecated"),e.event.add=function(e,t,n,a,o){e!==document&&M.test(t)&&r("AJAX events should be attached to document: "+t),Q.call(this,e,A(t||""),n,a,o)},e.event.remove=function(e,t,n,r,a){x.call(this,e,A(t)||"",n,r,a)},e.fn.error=function(){var e=Array.prototype.slice.call(arguments,0);return r("jQuery.fn.error() is deprecated"),e.splice(0,0,"error"),arguments.length?this.bind.apply(this,e):(this.triggerHandler.apply(this,e),this)},e.fn.toggle=function(t,n){if(!e.isFunction(t)||!e.isFunction(n))return N.apply(this,arguments);r("jQuery.fn.toggle(handler, handler...) is deprecated");var a=arguments,o=t.guid||e.guid++,i=0,s=function(n){var r=(e._data(this,"lastToggle"+t.guid)||0)%i;return e._data(this,"lastToggle"+t.guid,r+1),n.preventDefault(),a[r].apply(this,arguments)||!1};for(s.guid=o;a.length>i;)a[i++].guid=o;return this.click(s)},e.fn.live=function(t,n,a){return r("jQuery.fn.live() is deprecated"),C?C.apply(this,arguments):(e(this.context).on(t,this.selector,n,a),this)},e.fn.die=function(t,n){return r("jQuery.fn.die() is deprecated"),S?S.apply(this,arguments):(e(this.context).off(t,this.selector||"**",n),this)},e.event.trigger=function(e,t,n,a){return n||M.test(e)||r("Global events are undocumented and deprecated"),k.call(this,e,t,n||document,a)},e.each(T.split("|"),function(t,n){e.event.special[n]={setup:function(){var t=this;return t!==document&&(e.event.add(document,n+"."+e.guid,function(){e.event.trigger(n,null,t,!0)}),e._data(this,n,e.guid++)),!1},teardown:function(){return this!==document&&e.event.remove(document,n+"."+e._data(this,n)),!1}}})}(jQuery,window);
3
+ //@ sourceMappingURL=dist/jquery-migrate.min.mapt
@@ -1,10 +1,11 @@
1
1
  /*!
2
- * jQuery Migrate - v1.0.0 - 2013-01-14
2
+ * jQuery Migrate - v1.1.1 - 2013-02-16
3
3
  * https://github.com/jquery/jquery-migrate
4
4
  * Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors; Licensed MIT
5
5
  */
6
6
  (function( jQuery, window, undefined ) {
7
- "use strict";
7
+ // See http://bugs.jquery.com/ticket/13335
8
+ // "use strict";
8
9
 
9
10
 
10
11
  var warnedAbout = {};
@@ -15,6 +16,16 @@ jQuery.migrateWarnings = [];
15
16
  // Set to true to prevent console output; migrateWarnings still maintained
16
17
  // jQuery.migrateMute = false;
17
18
 
19
+ // Show a message on the console so devs know we're active
20
+ if ( !jQuery.migrateMute && window.console && console.log ) {
21
+ console.log("JQMIGRATE: Logging is active");
22
+ }
23
+
24
+ // Set to false to disable traces that appear with warnings
25
+ if ( jQuery.migrateTrace === undefined ) {
26
+ jQuery.migrateTrace = true;
27
+ }
28
+
18
29
  // Forget any warnings we've already given; public
19
30
  jQuery.migrateReset = function() {
20
31
  warnedAbout = {};
@@ -27,6 +38,9 @@ function migrateWarn( msg) {
27
38
  jQuery.migrateWarnings.push( msg );
28
39
  if ( window.console && console.warn && !jQuery.migrateMute ) {
29
40
  console.warn( "JQMIGRATE: " + msg );
41
+ if ( jQuery.migrateTrace && console.trace ) {
42
+ console.trace();
43
+ }
30
44
  }
31
45
  }
32
46
  }
@@ -65,8 +79,8 @@ if ( document.compatMode === "BackCompat" ) {
65
79
  }
66
80
 
67
81
 
68
- var attrFn = {},
69
- attr = jQuery.attr,
82
+ var attrFn = jQuery( "<input/>", { size: 1 } ).attr("size") && jQuery.attrFn,
83
+ oldAttr = jQuery.attr,
70
84
  valueAttrGet = jQuery.attrHooks.value && jQuery.attrHooks.value.get ||
71
85
  function() { return null; },
72
86
  valueAttrSet = jQuery.attrHooks.value && jQuery.attrHooks.value.set ||
@@ -77,21 +91,27 @@ var attrFn = {},
77
91
  ruseDefault = /^(?:checked|selected)$/i;
78
92
 
79
93
  // jQuery.attrFn
80
- migrateWarnProp( jQuery, "attrFn", attrFn, "jQuery.attrFn is deprecated" );
94
+ migrateWarnProp( jQuery, "attrFn", attrFn || {}, "jQuery.attrFn is deprecated" );
81
95
 
82
96
  jQuery.attr = function( elem, name, value, pass ) {
83
97
  var lowerName = name.toLowerCase(),
84
98
  nType = elem && elem.nodeType;
85
99
 
86
100
  if ( pass ) {
87
- migrateWarn("jQuery.fn.attr( props, pass ) is deprecated");
88
- if ( elem && !rnoAttrNodeType.test( nType ) && jQuery.isFunction( jQuery.fn[ name ] ) ) {
101
+ // Since pass is used internally, we only warn for new jQuery
102
+ // versions where there isn't a pass arg in the formal params
103
+ if ( oldAttr.length < 4 ) {
104
+ migrateWarn("jQuery.fn.attr( props, pass ) is deprecated");
105
+ }
106
+ if ( elem && !rnoAttrNodeType.test( nType ) &&
107
+ (attrFn ? name in attrFn : jQuery.isFunction(jQuery.fn[name])) ) {
89
108
  return jQuery( elem )[ name ]( value );
90
109
  }
91
110
  }
92
111
 
93
- // Warn if user tries to set `type` since it breaks on IE 6/7/8
94
- if ( name === "type" && value !== undefined && rnoType.test( elem.nodeName ) ) {
112
+ // Warn if user tries to set `type`, since it breaks on IE 6/7/8; by checking
113
+ // for disconnected elements we don't warn on $( "<button>", { type: "button" } ).
114
+ if ( name === "type" && value !== undefined && rnoType.test( elem.nodeName ) && elem.parentNode ) {
95
115
  migrateWarn("Can't change the 'type' of an input or button in IE 6/7/8");
96
116
  }
97
117
 
@@ -131,11 +151,11 @@ jQuery.attr = function( elem, name, value, pass ) {
131
151
 
132
152
  // Warn only for attributes that can remain distinct from their properties post-1.9
133
153
  if ( ruseDefault.test( lowerName ) ) {
134
- migrateWarn( "jQuery.fn.attr(" + lowerName + ") may use property instead of attribute" );
154
+ migrateWarn( "jQuery.fn.attr('" + lowerName + "') may use property instead of attribute" );
135
155
  }
136
156
  }
137
157
 
138
- return attr.call( jQuery, elem, name, value );
158
+ return oldAttr.call( jQuery, elem, name, value );
139
159
  };
140
160
 
141
161
  // attrHooks: value
@@ -146,7 +166,7 @@ jQuery.attrHooks.value = {
146
166
  return valueAttrGet.apply( this, arguments );
147
167
  }
148
168
  if ( nodeName !== "input" && nodeName !== "option" ) {
149
- migrateWarn("property-based jQuery.fn.attr('value') is deprecated");
169
+ migrateWarn("jQuery.fn.attr('value') no longer gets properties");
150
170
  }
151
171
  return name in elem ?
152
172
  elem.value :
@@ -158,7 +178,7 @@ jQuery.attrHooks.value = {
158
178
  return valueAttrSet.apply( this, arguments );
159
179
  }
160
180
  if ( nodeName !== "input" && nodeName !== "option" ) {
161
- migrateWarn("property-based jQuery.fn.attr('value', val) is deprecated");
181
+ migrateWarn("jQuery.fn.attr('value', val) no longer sets properties");
162
182
  }
163
183
  // Does not return so that setAttribute is also used
164
184
  elem.value = value;
@@ -168,8 +188,9 @@ jQuery.attrHooks.value = {
168
188
 
169
189
  var matched, browser,
170
190
  oldInit = jQuery.fn.init,
171
- // Note this does NOT include the # XSS fix from 1.7!
172
- rquickExpr = /^(?:.*(<[\w\W]+>)[^>]*|#([\w\-]*))$/;
191
+ oldParseJSON = jQuery.parseJSON,
192
+ // Note this does NOT include the #9521 XSS fix from 1.7!
193
+ rquickExpr = /^(?:[^<]*(<[\w\W]+>)[^>]*|#([\w\-]*))$/;
173
194
 
174
195
  // $(html) "looks like html" rule change
175
196
  jQuery.fn.init = function( selector, context, rootjQuery ) {
@@ -195,6 +216,15 @@ jQuery.fn.init = function( selector, context, rootjQuery ) {
195
216
  };
196
217
  jQuery.fn.init.prototype = jQuery.fn;
197
218
 
219
+ // Let $.parseJSON(falsy_value) return null
220
+ jQuery.parseJSON = function( json ) {
221
+ if ( !json && json !== null ) {
222
+ migrateWarn("jQuery.parseJSON requires a valid JSON string");
223
+ return null;
224
+ }
225
+ return oldParseJSON.apply( this, arguments );
226
+ };
227
+
198
228
  jQuery.uaMatch = function( ua ) {
199
229
  ua = ua.toLowerCase();
200
230
 
@@ -211,25 +241,28 @@ jQuery.uaMatch = function( ua ) {
211
241
  };
212
242
  };
213
243
 
214
- matched = jQuery.uaMatch( navigator.userAgent );
215
- browser = {};
244
+ // Don't clobber any existing jQuery.browser in case it's different
245
+ if ( !jQuery.browser ) {
246
+ matched = jQuery.uaMatch( navigator.userAgent );
247
+ browser = {};
216
248
 
217
- if ( matched.browser ) {
218
- browser[ matched.browser ] = true;
219
- browser.version = matched.version;
220
- }
249
+ if ( matched.browser ) {
250
+ browser[ matched.browser ] = true;
251
+ browser.version = matched.version;
252
+ }
221
253
 
222
- // Chrome is Webkit, but Webkit is also Safari.
223
- if ( browser.chrome ) {
224
- browser.webkit = true;
225
- } else if ( browser.webkit ) {
226
- browser.safari = true;
227
- }
254
+ // Chrome is Webkit, but Webkit is also Safari.
255
+ if ( browser.chrome ) {
256
+ browser.webkit = true;
257
+ } else if ( browser.webkit ) {
258
+ browser.safari = true;
259
+ }
228
260
 
229
- jQuery.browser = browser;
261
+ jQuery.browser = browser;
262
+ }
230
263
 
231
264
  // Warn if the code tries to get jQuery.browser
232
- migrateWarnProp( jQuery, "browser", browser, "jQuery.browser is deprecated" );
265
+ migrateWarnProp( jQuery, "browser", jQuery.browser, "jQuery.browser is deprecated" );
233
266
 
234
267
  jQuery.sub = function() {
235
268
  function jQuerySub( selector, context ) {
@@ -254,6 +287,14 @@ jQuery.sub = function() {
254
287
  };
255
288
 
256
289
 
290
+ // Ensure that $.ajax gets the new parseJSON defined in core.js
291
+ jQuery.ajaxSetup({
292
+ converters: {
293
+ "text json": jQuery.parseJSON
294
+ }
295
+ });
296
+
297
+
257
298
  var oldFnData = jQuery.fn.data;
258
299
 
259
300
  jQuery.fn.data = function( name ) {
@@ -274,8 +315,7 @@ jQuery.fn.data = function( name ) {
274
315
 
275
316
 
276
317
  var rscriptType = /\/(java|ecma)script/i,
277
- oldSelf = jQuery.fn.andSelf || jQuery.fn.addBack,
278
- oldFragment = jQuery.buildFragment;
318
+ oldSelf = jQuery.fn.andSelf || jQuery.fn.addBack;
279
319
 
280
320
  jQuery.fn.andSelf = function() {
281
321
  migrateWarn("jQuery.fn.andSelf() replaced by jQuery.fn.addBack()");
@@ -332,35 +372,6 @@ if ( !jQuery.clean ) {
332
372
  };
333
373
  }
334
374
 
335
- jQuery.buildFragment = function( elems, context, scripts, selection ) {
336
- var ret,
337
- warning = "jQuery.buildFragment() is deprecated";
338
-
339
- // Set context per 1.8 logic
340
- context = context || document;
341
- context = !context.nodeType && context[0] || context;
342
- context = context.ownerDocument || context;
343
-
344
- try {
345
- ret = oldFragment.call( jQuery, elems, context, scripts, selection );
346
-
347
- // jQuery < 1.8 required arrayish context; jQuery 1.9 fails on it
348
- } catch( x ) {
349
- ret = oldFragment.call( jQuery, elems, context.nodeType ? [ context ] : context[ 0 ], scripts, selection );
350
-
351
- // Success from tweaking context means buildFragment was called by the user
352
- migrateWarn( warning );
353
- }
354
-
355
- // jQuery < 1.9 returned an object instead of the fragment itself
356
- if ( !ret.fragment ) {
357
- migrateWarnProp( ret, "fragment", ret, warning );
358
- migrateWarnProp( ret, "cacheable", false, warning );
359
- }
360
-
361
- return ret;
362
- };
363
-
364
375
  var eventAdd = jQuery.event.add,
365
376
  eventRemove = jQuery.event.remove,
366
377
  eventTrigger = jQuery.event.trigger,
@@ -371,7 +382,7 @@ var eventAdd = jQuery.event.add,
371
382
  rajaxEvent = new RegExp( "\\b(?:" + ajaxEvents + ")\\b" ),
372
383
  rhoverHack = /(?:^|\s)hover(\.\S+|)\b/,
373
384
  hoverHack = function( events ) {
374
- if ( typeof( events ) != "string" || jQuery.event.special.hover ) {
385
+ if ( typeof( events ) !== "string" || jQuery.event.special.hover ) {
375
386
  return events;
376
387
  }
377
388
  if ( rhoverHack.test( events ) ) {
@@ -386,7 +397,9 @@ if ( jQuery.event.props && jQuery.event.props[ 0 ] !== "attrChange" ) {
386
397
  }
387
398
 
388
399
  // Undocumented jQuery.event.handle was "deprecated" in jQuery 1.7
389
- migrateWarnProp( jQuery.event, "handle", jQuery.event.dispatch, "jQuery.event.handle is undocumented and deprecated" );
400
+ if ( jQuery.event.dispatch ) {
401
+ migrateWarnProp( jQuery.event, "handle", jQuery.event.dispatch, "jQuery.event.handle is undocumented and deprecated" );
402
+ }
390
403
 
391
404
  // Support for 'hover' pseudo-event and ajax event warnings
392
405
  jQuery.event.add = function( elem, types, handler, data, selector ){
@@ -464,7 +477,7 @@ jQuery.fn.die = function( types, fn ) {
464
477
 
465
478
  // Turn global events into document-triggered events
466
479
  jQuery.event.trigger = function( event, data, elem, onlyHandlers ){
467
- if ( !elem & !rajaxEvent.test( event ) ) {
480
+ if ( !elem && !rajaxEvent.test( event ) ) {
468
481
  migrateWarn( "Global events are undocumented and deprecated" );
469
482
  }
470
483
  return eventTrigger.call( this, event, data, elem || document, onlyHandlers );
@@ -495,4 +508,4 @@ jQuery.each( ajaxEvents.split("|"),
495
508
  );
496
509
 
497
510
 
498
- })( jQuery, window );
511
+ })( jQuery, window );
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jquery-migrate-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-29 00:00:00.000000000 Z
12
+ date: 2013-04-16 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: jQuery migrate for rails application
15
15
  email: