Sha256: d3258806636bb147a3c1a12dfc7c7aa034d3aacd792fa2e5c592fd471982eba8
Contents?: true
Size: 725 Bytes
Versions: 1
Compression:
Stored size: 725 Bytes
Contents
(function(w){if(w.FormData)return;function FormData(){this.fake=true;this.boundary="--------FormData"+Math.random();this._fields=[]}FormData.prototype.append=function(key,value){this._fields.push([key,value])}FormData.prototype.toString=function(){var boundary=this.boundary;var body="";this._fields.forEach(function(field){body+="--"+boundary+"\r\n";if(field[1].name){var file=field[1];body+="Content-Disposition: form-data; name=\""+field[0]+"\"; filename=\""+file.name+"\"\r\n";body+="Content-Type: "+file.type+"\r\n\r\n";body+=file.getAsBinary()+"\r\n"}else{body+="Content-Disposition: form-data; name=\""+field[0]+"\";\r\n\r\n";body+=field[1]+"\r\n"}});body+="--"+boundary+"--";return body}w.FormData=FormData})(window);
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
html5forms-rails-0.1.4 | vendor/assets/javascripts/formdata.min.js |