/loggerhead/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/loggerhead/trunk

« back to all changes in this revision

Viewing changes to loggerhead/static/javascript/yui/build/io/io-upload-iframe-min.js

  • Committer: Jelmer Vernooij
  • Date: 2020-06-04 19:43:36 UTC
  • mto: This revision was merged to the branch mainline in revision 500.
  • Revision ID: jelmer@jelmer.uk-20200604194336-ahskrf4rmy1qaxzs
Port loggerhead from YUI to jQuery.

YUI has been deprecated since 2014 and is due to be removed from Debian.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
Copyright (c) 2008, Yahoo! Inc. All rights reserved.
3
 
Code licensed under the BSD License:
4
 
http://developer.yahoo.net/yui/license.txt
5
 
version: 3.0.0pr2
6
 
*/
7
 
YUI.add("io-upload-iframe",function(B){var H=B.config.win;function D(K,M){var L=[],J;for(p in M){if(M.hasOwnProperty(M,p)){L[J]=document.createElement("input");L[J].type="hidden";L[J].name=p;L[J].value=M[p].f.appendChild(L[J]);}}return L;}function E(L,M){var K,J;if(M&&M.length>0){for(K=0,J=M.length;K<J;K++){L.removeChild(M[K]);}}}function I(M,N){var K='<iframe id="ioupload'+M.id+'" name="ioupload'+M.id+'" />',J={position:"absolute",top:"-1000",left:"-1000"},L=B.Node.create(K);L.setStyles(J);B.get("body").appendChild(L);B.on("load",function(){A(M,N);},"#ioupload"+M.id);}function A(M,N){if(N.timeout){G(M.id);}var K,L=B.get("#ioupload"+M.id).get("contentWindow.document"),L=B.get("#ioupload"+M.id).get("contentWindow"),J=L.get("body");if(J){K=J.getElementsByTagName("pre");M.c.responseText=(K)?K.item(0).get("innerHTML"):J.get("innerHTML");}B.io.complete(M,N);setTimeout(function(){F(M.id);},100);}function C(J,K){B.io._timeout[J.id]=H.setTimeout(function(){B.io.abort(J,K);},K.timeout);}function G(J){H.clearTimeout(B.io._timeout[J]);delete B.io._timeout[J];}function F(J){B.Event.purgeElement("#ioupload"+J,false,"load");B.get("body").removeChild(B.get("#ioupload"+J));}B.mix(B.io,{_upload:function(K,L,R){var O=(typeof R.form.id==="string")?document.getElementById(R.form.id):R.form.id,Q,N,M,J,P;I(K,R);P={action:O.getAttribute("action"),target:O.getAttribute("target")};O.setAttribute("action",L);O.setAttribute("method","POST");O.setAttribute("target","ioupload"+K.id);O.setAttribute((B.UA.ie)?"encoding":"enctype","multipart/form-data");if(R.data){N=D(O,R.data);}if(R.timeout){C(K,R);}O.submit();B.io.start(K.id,R);if(R.data){E(O,N);}for(J in P){if(P.hasOwnProperty(P,J)){if(P[J]){O.setAttribute(J,O[prop]);}else{O.removeAttribute(J);}}}}});},"3.0.0pr2",{requires:["io-base"]});
 
 
b'\\ No newline at end of file'