dispatch.to("Foundry/2.1 Core Plugins").at(function($){$.ajaxPrefilter(function(options){return options.iframe?"iframe":void 0}),$.ajaxTransport("iframe",function(options){function cleanUp(){hasFiles&&markers.replaceWith(function(idx){return files.get(idx)}),form.remove(),iframe.attr("src","javascript:false;").remove()}var form=null,iframe=null,name="iframe-"+$.now(),files=$(options.files).filter(":file:enabled"),hasFiles=files.length>0,markers=null;return options.dataTypes.shift(),form=$("<form enctype='multipart/form-data' method='post'></form>").hide().attr({action:options.url,target:name}),"string"==typeof options.data&&options.data.length>0&&$.error("data must not be serialized"),$.each(options.data||{},function(name,value){$.isPlainObject(value)&&(name=value.name,value=value.value),$.isArray(value)||(value=[value]),$.each(value,function(i,value){$("<input type='hidden' />").attr({name:name,value:value}).appendTo(form)
})}),$("<input type='hidden' value='IFrame' name='X-Requested-With' />").appendTo(form),hasFiles&&(markers=files.after(function(){return $(this).clone().prop("disabled",!0)}).next(),files.appendTo(form)),{send:function(headers,completeCallback){iframe=$("<iframe src='javascript:false;' name='"+name+"' id='"+name+"' style='display:none'></iframe>"),iframe.bind("load",function(){iframe.unbind("load").bind("load",function(){var doc=this.contentWindow?this.contentWindow.document:this.contentDocument?this.contentDocument:this.document,root=doc.documentElement?doc.documentElement:doc.body,textarea=root.getElementsByTagName("textarea")[0],type=textarea?textarea.getAttribute("data-type"):null,status=textarea?textarea.getAttribute("data-status"):200,statusText=textarea?textarea.getAttribute("data-statusText"):"OK",content={html:root.innerHTML,text:type?textarea.value:root?root.textContent||root.innerText:null};
cleanUp(),completeCallback(status,statusText,content,type?"Content-Type: "+type:null)}),form[0].submit()}),$("body").append(form,iframe)},abort:function(){null!==iframe&&(iframe.unbind("load").attr("src","javascript:false;"),cleanUp())}}})});