/usr/share/javascript/yui3/io-base/io-base-min.js is in libjs-yui3-min 3.5.1-1ubuntu3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 | /*
YUI 3.5.1 (build 22)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add("io-base",function(a){var h=["start","complete","end","success","failure","progress"],b=["status","statusText","responseText","responseXML"],f=a.config.win,g=0;function c(j){var k=this;k._uid="io:"+g++;k._init(j);a.io._map[k._uid]=k;}c.prototype={_id:0,_headers:{"X-Requested-With":"XMLHttpRequest"},_timeout:{},_init:function(k){var m=this,l,j;m.cfg=k||{};a.augment(m,a.EventTarget);for(l=0,j=h.length;l<j;++l){m.publish("io:"+h[l],a.merge({broadcast:1},k));m.publish("io-trn:"+h[l],k);}},_create:function(k,p){var o=this,n={id:a.Lang.isNumber(p)?p:o._id++,uid:o._uid},m=k.xdr?k.xdr.use:null,l=k.form&&k.form.upload?"iframe":null,j;if(m==="native"){m=a.UA.ie?"xdr":null;}j=m||l;n=j?a.merge(a.IO.customTransport(j),n):a.merge(a.IO.defaultTransport(),n);if(n.notify){k.notify=function(r,q,s){o.notify(r,q,s);};}if(!j){if(f&&f.FormData&&k.data instanceof FormData){n.c.upload.onprogress=function(q){o.progress(n,q,k);};n.c.onload=function(q){o.load(n,q,k);};n.c.onerror=function(q){o.error(n,q,k);};n.upload=true;}}return n;},_destroy:function(j){if(f&&!j.notify&&!j.xdr){if(d&&!j.upload){j.c.onreadystatechange=null;}else{if(j.upload){j.c.upload.onprogress=null;j.c.onload=null;j.c.onerror=null;}else{if(a.UA.ie&&!j.e){j.c.abort();}}}}j=j.c=null;},_evt:function(n,k,j){var p=this,l,q=j["arguments"],r=p.cfg.emitFacade,m="io:"+n,o="io-trn:"+n;this.detach(o);if(k.e){k.c={status:0,statusText:k.e};}l=[r?{id:k.id,data:k.c,cfg:j,"arguments":q}:k.id];if(!r){if(n===h[0]||n===h[2]){if(q){l.push(q);}}else{if(k.evt){l.push(k.evt);}else{l.push(k.c);}if(q){l.push(q);}}}l.unshift(m);p.fire.apply(p,l);if(j.on){l[0]=o;p.once(o,j.on[n],j.context||a);p.fire.apply(p,l);}},start:function(k,j){this._evt(h[0],k,j);},complete:function(k,j){this._evt(h[1],k,j);},end:function(k,j){this._evt(h[2],k,j);this._destroy(k);},success:function(k,j){this._evt(h[3],k,j);this.end(k,j);},failure:function(k,j){this._evt(h[4],k,j);this.end(k,j);},progress:function(l,k,j){l.evt=k;this._evt(h[5],l,j);},load:function(l,k,j){l.evt=k.target;this._evt(h[1],l,j);},error:function(l,k,j){l.evt=k;this._evt(h[4],l,j);},_retry:function(l,k,j){this._destroy(l);j.xdr.use="flash";return this.send(k,j,l.id);},_concat:function(j,k){j+=(j.indexOf("?")===-1?"?":"&")+k;return j;},setHeader:function(j,k){if(k){this._headers[j]=k;}else{delete this._headers[j];}},_setHeaders:function(k,j){j=a.merge(this._headers,j);a.Object.each(j,function(m,l){if(m!=="disable"){k.setRequestHeader(l,j[l]);}});},_startTimeout:function(k,j){var l=this;l._timeout[k.id]=setTimeout(function(){l._abort(k,"timeout");},j);},_clearTimeout:function(j){clearTimeout(this._timeout[j]);delete this._timeout[j];},_result:function(m,k){var j;try{j=m.c.status;}catch(l){j=0;}if(j>=200&&j<300||j===304||j===1223){this.success(m,k);}else{this.failure(m,k);}},_rS:function(k,j){var l=this;if(k.c.readyState===4){if(j.timeout){l._clearTimeout(k.id);}setTimeout(function(){l.complete(k,j);l._result(k,j);},0);}},_abort:function(k,j){if(k&&k.c){k.e=j;k.c.abort();}},send:function(l,m,k){var n,j,q,r,v,p,t=this,w=l,o={};m=m?a.Object(m):{};n=t._create(m,k);j=m.method?m.method.toUpperCase():"GET";v=m.sync;p=m.data;if((a.Lang.isObject(p)&&!p.nodeType)&&!n.upload){p=a.QueryString.stringify(p);}if(m.form){if(m.form.upload){return t.upload(n,l,m);}else{p=t._serialize(m.form,p);}}if(p){switch(j){case"GET":case"HEAD":case"DELETE":w=t._concat(w,p);p="";break;case"POST":case"PUT":m.headers=a.merge({"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},m.headers);break;}}if(n.xdr){return t.xdr(w,n,m);}else{if(n.notify){return n.c.send(n,l,m);}}if(!v&&!n.upload){n.c.onreadystatechange=function(){t._rS(n,m);};}try{n.c.open(j,w,!v,m.username||null,m.password||null);t._setHeaders(n.c,m.headers||{});t.start(n,m);if(m.xdr&&m.xdr.credentials){if(!a.UA.ie){n.c.withCredentials=true;}}n.c.send(p);if(v){for(q=0,r=b.length;q<r;++q){o[b[q]]=n.c[b[q]];}o.getAllResponseHeaders=function(){return n.c.getAllResponseHeaders();};o.getResponseHeader=function(u){return n.c.getResponseHeader(u);};t.complete(n,m);t._result(n,m);return o;}}catch(s){if(n.xdr){return t._retry(n,l,m);}else{t.complete(n,m);t._result(n,m);}}if(m.timeout){t._startTimeout(n,m.timeout);}return{id:n.id,abort:function(){return n.c?t._abort(n,"abort"):false;},isInProgress:function(){return n.c?(n.c.readyState%4):false;},io:t};}};a.io=function(k,j){var l=a.io._map["io:0"]||new c();return l.send.apply(l,[k,j]);};a.io.header=function(j,k){var l=a.io._map["io:0"]||new c();l.setHeader(j,k);};a.IO=c;a.io._map={};var d=f&&f.XMLHttpRequest,i=f&&f.XDomainRequest,e=f&&f.ActiveXObject;a.mix(a.IO,{_default:"xhr",defaultTransport:function(k){if(k){a.IO._default=k;}else{var j={c:a.IO.transports[a.IO._default](),notify:a.IO._default==="xhr"?false:true};return j;}},transports:{xhr:function(){return d?new XMLHttpRequest():e?new ActiveXObject("Microsoft.XMLHTTP"):null;},xdr:function(){return i?new XDomainRequest():null;},iframe:function(){return{};},flash:null,nodejs:null},customTransport:function(k){var j={c:a.IO.transports[k]()};j[(k==="xdr"||k==="flash")?"xdr":"notify"]=true;return j;}});a.mix(a.IO.prototype,{notify:function(k,l,j){var m=this;switch(k){case"timeout":case"abort":case"transport error":l.c={status:0,statusText:k};k="failure";default:m[k].apply(m,[l,j]);}}});},"3.5.1",{requires:["event-custom-base","querystring-stringify-simple"]});
|