Sha256: f51601f098ebbc56da9d0bce1320212d0df74f1ad63c1f1a1854b3ce7c43ab1b

Contents?: true

Size: 1.88 KB

Versions: 3

Compression:

Stored size: 1.88 KB

Contents

(function(a,b){a.ajaxPrefilter(function(d,c,e){if(d.iframe){d.originalURL=d.url;return"iframe"}});a.ajaxTransport("iframe",function(l,j,k){var f=null,i=null,e="iframe-"+a.now(),d=a(l.files).filter(":file:enabled"),h=null,c=null;function g(){d.each(function(o,n){var m=a(n);m.data("clone").replaceWith(m)});f.remove();i.one("load",function(){i.remove()});i.attr("src","javascript:false;")}l.dataTypes.shift();l.data=j.data;if(d.length){f=a("<form enctype='multipart/form-data' method='post'></form>").hide().attr({action:l.originalURL,target:e});if(typeof(l.data)==="string"&&l.data.length>0){a.error("data must not be serialized")}a.each(l.data||{},function(m,n){if(a.isPlainObject(n)){m=n.name;n=n.value}a("<input type='hidden' />").attr({name:m,value:n}).appendTo(f)});a("<input type='hidden' value='IFrame' name='X-Requested-With' />").appendTo(f);if(l.dataTypes[0]&&l.accepts[l.dataTypes[0]]){c=l.accepts[l.dataTypes[0]]+(l.dataTypes[0]!=="*"?", */*; q=0.01":"")}else{c=l.accepts["*"]}a("<input type='hidden' name='X-HTTP-Accept'>").attr("value",c).appendTo(f);h=d.after(function(m){var o=a(this),n=o.clone().prop("disabled",true);o.data("clone",n);return n}).next();d.appendTo(f);return{send:function(n,m){i=a("<iframe src='javascript:false;' name='"+e+"' id='"+e+"' style='display:none'></iframe>");i.one("load",function(){i.one("load",function(){var u=this.contentWindow?this.contentWindow.document:(this.contentDocument?this.contentDocument:this.document),q=u.documentElement?u.documentElement:u.body,p=q.getElementsByTagName("textarea")[0],r=p&&p.getAttribute("data-type")||null,o=p&&p.getAttribute("data-status")||200,t=p&&p.getAttribute("data-statusText")||"OK",s={html:q.innerHTML,text:r?p.value:q?(q.textContent||q.innerText):null};g();m(o,t,s,r?("Content-Type: "+r):null)});f[0].submit()});a("body").append(f,i)},abort:function(){if(i!==null){i.unbind("load").attr("src","javascript:false;");g()}}}}})})(jQuery);

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
caboose-cms-0.4.52 app/assets/javascripts/caboose/jquery.iframe-transport.js
caboose-cms-0.4.51 app/assets/javascripts/caboose/jquery.iframe-transport.js
caboose-cms-0.4.50 app/assets/javascripts/caboose/jquery.iframe-transport.js