Commit a1765783 authored by Arnaud Fontaine's avatar Arnaud Fontaine

Fix legacy jQuery.ajax() success function being called but HTTP connection is refused.

http://bugs.jquery.com/attachment/ticket/5968/0001-Fix-jQuery.ajax-success-function-being-called-when-H.patch
parent 61074e32
......@@ -12,7 +12,7 @@
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts77895639.22</string> </value>
<value> <string>ts74199327.37</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
......@@ -20,7 +20,7 @@
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/x-javascript</string> </value>
<value> <string>application/javascript</string> </value>
</item>
<item>
<key> <string>data</string> </key>
......@@ -34,7 +34,7 @@
</item>
<item>
<key> <string>size</string> </key>
<value> <int>163855</int> </value>
<value> <int>163907</int> </value>
</item>
<item>
<key> <string>title</string> </key>
......@@ -45,10 +45,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="Pdata" module="OFS.Image"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
......@@ -3877,7 +3874,8 @@ jQuery.fn.extend({\n
\t\tif ( !elem || typeof elem === "string" ) {\n
\t\t\treturn jQuery.inArray( this[0],\n
\t\t\t\t// If it receives a string, the selector is used\n
\t\t\t\t// If it r
\t\t\t\t// If it receives nothing, the siblings are used\n
\t\t\t\telem ? jQ
]]></string> </value>
</item>
......@@ -3892,10 +3890,7 @@ jQuery.fn.extend({\n
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<tuple>
<global name="Pdata" module="OFS.Image"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
......@@ -3903,8 +3898,7 @@ jQuery.fn.extend({\n
<key> <string>data</string> </key>
<value> <string encoding="cdata"><![CDATA[
eceives nothing, the siblings are used\n
\t\t\t\telem ? jQuery( elem ) : this.parent().children() );\n
uery( elem ) : this.parent().children() );\n
\t\t}\n
\t\t// Locate the position of the desired element\n
\t\treturn jQuery.inArray(\n
......@@ -5404,7 +5398,7 @@ jQuery.extend({\n
\t\t\treturn !xhr.status && location.protocol === "file:" ||\n
\t\t\t\t// Opera returns 0 when status is 304\n
\t\t\t\t( xhr.status >= 200 && xhr.status < 300 ) ||\n
\t\t\t\txhr.status === 304 || xhr.status === 1223 || xhr.status === 0;\n
\t\t\t\txhr.status === 304 || xhr.status === 1223 || (jQuery.browser.opera && xhr.status === 0);\n
\t\t} catch(e) {}\n
\n
\t\treturn false;\n
......@@ -5424,7 +5418,7 @@ jQuery.extend({\n
\t\t}\n
\n
\t\t// Opera returns 0 when status is 304\n
\t\treturn xhr.status === 304 || xhr.status === 0;\n
\t\treturn xhr.status === 304 || (jQuery.browser.opera && xhr.status === 0);\n
\t},\n
\n
\thttpData: function( xhr, type, s ) {\n
......
......@@ -12,7 +12,7 @@
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts77895660.45</string> </value>
<value> <string>ts74199279.36</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
......@@ -20,7 +20,7 @@
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/x-javascript</string> </value>
<value> <string>application/javascript</string> </value>
</item>
<item>
<key> <string>data</string> </key>
......@@ -34,7 +34,7 @@
</item>
<item>
<key> <string>size</string> </key>
<value> <int>72174</int> </value>
<value> <int>72212</int> </value>
</item>
<item>
<key> <string>title</string> </key>
......@@ -45,10 +45,7 @@
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="Pdata" module="OFS.Image"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
......@@ -186,7 +183,7 @@ false;C.onload=C.onreadystatechange=function(){if(!B&&(!this.readyState||this.re
c.lastModified[e.url]);c.etag[e.url]&&x.setRequestHeader("If-None-Match",c.etag[e.url])}r||x.setRequestHeader("X-Requested-With","XMLHttpRequest");x.setRequestHeader("Accept",e.dataType&&e.accepts[e.dataType]?e.accepts[e.dataType]+", */*":e.accepts._default)}catch(ga){}if(e.beforeSend&&e.beforeSend.call(k,x,e)===false){e.global&&!--c.active&&c.event.trigger("ajaxStop");x.abort();return false}e.global&&f("ajaxSend",[x,e]);var g=x.onreadystatechange=function(q){if(!x||x.readyState===0||q==="abort"){E||\n
d();E=true;if(x)x.onreadystatechange=c.noop}else if(!E&&x&&(x.readyState===4||q==="timeout")){E=true;x.onreadystatechange=c.noop;i=q==="timeout"?"timeout":!c.httpSuccess(x)?"error":e.ifModified&&c.httpNotModified(x,e.url)?"notmodified":"success";var p;if(i==="success")try{o=c.httpData(x,e.dataType,e)}catch(v){i="parsererror";p=v}if(i==="success"||i==="notmodified")j||b();else c.handleError(e,x,i,p);d();q==="timeout"&&x.abort();if(e.async)x=null}};try{var h=x.abort;x.abort=function(){x&&h.call(x);\n
g("abort")}}catch(l){}e.async&&e.timeout>0&&setTimeout(function(){x&&!E&&g("timeout")},e.timeout);try{x.send(n==="POST"||n==="PUT"||n==="DELETE"?e.data:null)}catch(m){c.handleError(e,x,null,m);d()}e.async||g();return x}},handleError:function(a,b,d,f){if(a.error)a.error.call(a.context||a,b,d,f);if(a.global)(a.context?c(a.context):c.event).trigger("ajaxError",[b,a,f])},active:0,httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status===\n
1223||a.status===0}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]=f;return a.status===304||a.status===0},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;e&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b===\n
1223||(c.browser.opera&&a.status===0)}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]=f;return a.status===304||(c.browser.opera&&a.status===0)},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;e&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b===\n
"json"||!b&&f.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&f.indexOf("javascript")>=0)c.globalEval(a);return a},param:function(a,b){function d(i,o){if(c.isArray(o))c.each(o,function(k,n){b||/\\[\\]$/.test(i)?f(i,n):d(i+"["+(typeof n==="object"||c.isArray(n)?k:"")+"]",n)});else!b&&o!=null&&typeof o==="object"?c.each(o,function(k,n){d(i+"["+k+"]",n)}):f(i,o)}function f(i,o){o=c.isFunction(o)?o():o;e[e.length]=encodeURIComponent(i)+"="+encodeURIComponent(o)}var e=[];if(b===w)b=c.ajaxSettings.traditional;\n
if(c.isArray(a)||a.jquery)c.each(a,function(){f(this.name,this.value)});else for(var j in a)d(j,a[j]);return e.join("&").replace(yb,"+")}});var la={},Ab=/toggle|show|hide/,Bb=/^([+-]=)?([\\d+-.]+)(.*)$/,W,va=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b){if(a||a===0)return this.animate(K("show",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");\n
this[a].style.display=d||"";if(c.css(this[a],"display")==="none"){d=this[a].nodeName;var f;if(la[d])f=la[d];else{var e=c("<"+d+" />").appendTo("body");f=e.css("display");if(f==="none")f="block";e.remove();la[d]=f}c.data(this[a],"olddisplay",f)}}a=0;for(b=this.length;a<b;a++)this[a].style.display=c.data(this[a],"olddisplay")||"";return this}},hide:function(a,b){if(a||a===0)return this.animate(K("hide",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");!d&&d!=="none"&&c.data(this[a],\n
......
2013-07-19 arnaud.fontaine
* Fix legacy jQuery.ajax() success function being called when HTTP connection refused.
2010-11-01 kazuhiko
* Rename from erp5_jquery.
......
19
\ No newline at end of file
20
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment