/* jQuery Easing v1.3: Copyright (c) 2008 George McGinley Smith | BSD License: http://www.opensource.org/licenses/bsd-license.php jQuery JSONP Core Plugin 2.1.2: Copyright (c) 2010 Julian Aubourg | MIT License: http://www.opensource.org/licenses/mit-license.php json2: Douglas Crockford | Public domain jquery.transloadit2.js: Copyright (c) 2010 Felix Geisendörfer | MIT License: http://www.opensource.org/licenses/mit-license.php Fork this on Github: http://github.com/transloadit/jquery-sdk Transloadit servers allow browsers to cache jquery.transloadit2.js for 1 hour. keep this in mind when rolling out fixes. jQuery Tools 1.2.3: Tero Piirainen | Public domain */ jQuery.easing.jswing=jQuery.easing.swing; jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(c,a,g,e,b){return jQuery.easing[jQuery.easing.def](c,a,g,e,b)},easeInQuad:function(c,a,g,e,b){return e*(a/=b)*a+g},easeOutQuad:function(c,a,g,e,b){return-e*(a/=b)*(a-2)+g},easeInOutQuad:function(c,a,g,e,b){return 1>(a/=b/2)?e/2*a*a+g:-e/2*(--a*(a-2)-1)+g},easeInCubic:function(c,a,g,e,b){return e*(a/=b)*a*a+g},easeOutCubic:function(c,a,g,e,b){return e*((a=a/b-1)*a*a+1)+g},easeInOutCubic:function(c,a,g,e,b){return 1>(a/=b/2)?e/2*a*a*a+g: e/2*((a-=2)*a*a+2)+g},easeInQuart:function(c,a,g,e,b){return e*(a/=b)*a*a*a+g},easeOutQuart:function(c,a,g,e,b){return-e*((a=a/b-1)*a*a*a-1)+g},easeInOutQuart:function(c,a,g,e,b){return 1>(a/=b/2)?e/2*a*a*a*a+g:-e/2*((a-=2)*a*a*a-2)+g},easeInQuint:function(c,a,g,e,b){return e*(a/=b)*a*a*a*a+g},easeOutQuint:function(c,a,g,e,b){return e*((a=a/b-1)*a*a*a*a+1)+g},easeInOutQuint:function(c,a,g,e,b){return 1>(a/=b/2)?e/2*a*a*a*a*a+g:e/2*((a-=2)*a*a*a*a+2)+g},easeInSine:function(c,a,g,e,b){return-e*Math.cos(a/ b*(Math.PI/2))+e+g},easeOutSine:function(c,a,g,e,b){return e*Math.sin(a/b*(Math.PI/2))+g},easeInOutSine:function(c,a,g,e,b){return-e/2*(Math.cos(Math.PI*a/b)-1)+g},easeInExpo:function(c,a,g,e,b){return 0==a?g:e*Math.pow(2,10*(a/b-1))+g},easeOutExpo:function(c,a,g,e,b){return a==b?g+e:e*(-Math.pow(2,-10*a/b)+1)+g},easeInOutExpo:function(c,a,g,e,b){return 0==a?g:a==b?g+e:1>(a/=b/2)?e/2*Math.pow(2,10*(a-1))+g:e/2*(-Math.pow(2,-10*--a)+2)+g},easeInCirc:function(c,a,g,e,b){return-e*(Math.sqrt(1-(a/=b)* a)-1)+g},easeOutCirc:function(c,a,g,e,b){return e*Math.sqrt(1-(a=a/b-1)*a)+g},easeInOutCirc:function(c,a,g,e,b){return 1>(a/=b/2)?-e/2*(Math.sqrt(1-a*a)-1)+g:e/2*(Math.sqrt(1-(a-=2)*a)+1)+g},easeInElastic:function(c,a,g,e,b){var c=1.70158,d=0,f=e;if(0==a)return g;if(1==(a/=b))return g+e;d||(d=0.3*b);fa?-0.5*f*Math.pow(2,10*(a-=1))*Math.sin((a*b-c)*2*Math.PI/d)+g:0.5*f*Math.pow(2,-10*(a-=1))*Math.sin((a*b-c)*2*Math.PI/d)+e+g},easeInBack:function(c,a,g,e,b,d){void 0== d&&(d=1.70158);return e*(a/=b)*a*((d+1)*a-d)+g},easeOutBack:function(c,a,g,e,b,d){void 0==d&&(d=1.70158);return e*((a=a/b-1)*a*((d+1)*a+d)+1)+g},easeInOutBack:function(c,a,g,e,b,d){void 0==d&&(d=1.70158);return 1>(a/=b/2)?e/2*a*a*(((d*=1.525)+1)*a-d)+g:e/2*((a-=2)*a*(((d*=1.525)+1)*a+d)+2)+g},easeInBounce:function(c,a,g,e,b){return e-jQuery.easing.easeOutBounce(c,b-a,0,e,b)+g},easeOutBounce:function(c,a,g,e,b){return(a/=b)<1/2.75?e*7.5625*a*a+g:a<2/2.75?e*(7.5625*(a-=1.5/2.75)*a+0.75)+g:a<2.5/2.75? e*(7.5625*(a-=2.25/2.75)*a+0.9375)+g:e*(7.5625*(a-=2.625/2.75)*a+0.984375)+g},easeInOutBounce:function(c,a,g,e,b){return aa?"0"+a:a}function a(a){b.lastIndex=0;return b.test(a)?'"'+a.replace(b,function(a){var d=k[a];return"string"===typeof d?d:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+a+'"'}function g(c,b){var e,k,n,q,r=d,m,h=b[c];h&&"object"===typeof h&&"function"===typeof h.toJSON&&(h=h.toJSON(c));"function"===typeof j&&(h=j.call(b,c,h));switch(typeof h){case "string":return a(h);case "number":return isFinite(h)?""+h:"null";case "boolean":case "null":return""+ h;case "object":if(!h)return"null";d+=f;m=[];if("[object Array]"===Object.prototype.toString.apply(h)){q=h.length;for(e=0;ea-d?d:a]}return[c(document).width(),c(document).height()]}function g(a){if(a)return a.call(c.mask)}c.tools=c.tools||{version:"1.2.3"};var e;e=c.tools.expose={conf:{maskId:"exposeMask",loadSpeed:"slow",closeSpeed:"fast",closeOnClick:!0,closeOnEsc:!0,zIndex:9998,opacity:0.8,startOpacity:0,color:"#fff",onLoad:null,onClose:null}}; var b,d,f,k,j;c.mask={load:function(i,o){if(f)return this;"string"==typeof i&&(i={color:i});i=i||k;k=i=c.extend(c.extend({},e.conf),i);b=c("#"+i.maskId);b.length||(b=c("
").attr("id",i.maskId),c("body").append(b));var s=a();b.css({position:"absolute",top:0,left:0,width:s[0],height:s[1],display:"none",opacity:i.startOpacity,zIndex:i.zIndex});i.color&&b.css("backgroundColor",i.color);if(!1===g(i.onBeforeLoad))return this;i.closeOnEsc&&c(document).bind("keydown.mask",function(a){27==a.keyCode&& c.mask.close(a)});i.closeOnClick&&b.bind("click.mask",function(a){c.mask.close(a)});c(window).bind("resize.mask",function(){c.mask.fit()});o&&o.length&&(j=o.eq(0).css("zIndex"),c.each(o,function(){var a=c(this);/relative|absolute|fixed/i.test(a.css("position"))||a.css("position","relative")}),d=o.css({zIndex:Math.max(i.zIndex+1,"auto"==j?0:j)}));b.css({display:"block"}).fadeTo(i.loadSpeed,i.opacity,function(){c.mask.fit();g(i.onLoad)});f=!0;return this},close:function(){if(f){if(!1===g(k.onBeforeClose))return this; b.fadeOut(k.closeSpeed,function(){g(k.onClose);d&&d.css({zIndex:j})});c(document).unbind("keydown.mask");b.unbind("click.mask");c(window).unbind("resize.mask");f=!1}return this},fit:function(){if(f){var d=a();b.css({width:d[0],height:d[1]})}},getMask:function(){return b},isLoaded:function(){return f},getConf:function(){return k},getExposed:function(){return d}};c.fn.mask=function(a){c.mask.load(a);return this};c.fn.expose=function(a){c.mask.load(a,this);return this}})(jQuery); (function(c){function a(){this.timer=this.documentTitle=this.instance=this.assemblyId=null;this._options={};this.uploads=[];this.results={};this.pollStarted=this.ended=null;this.seq=this.pollRetries=0;this.started=!1;this.params=this.assembly=null;this.lastPoll=this.bytesReceivedBefore=0;this.$modal=this.$iframe=this.$fileClones=this.$files=this.$form=this.$params=null}var g="https:"==document.location.protocol?"https://":"http://",e={service:g+"api2.transloadit.com/",assets:g+"assets.transloadit.com/", onStart:function(){},onProgress:function(){},onUpload:function(){},onResult:function(){},onCancel:function(){},onError:function(){},onSuccess:function(){},interval:2500,pollTimeout:8E3,poll404Retries:15,pollConnectionRetries:3,wait:!1,processZeroFiles:!0,autoSubmit:!0,modal:!0,exclude:"",fields:!1,debug:!0},b=!1;c.fn.transloadit=function(){var d=Array.prototype.slice.call(arguments),f,c;(1==d.length&&"object"==typeof d[0]||void 0===d[0])&&d.unshift("init");f=d.shift();"init"==f?(c=new a,d.unshift(this), this.data("transloadit.uploader",c)):c=this.data("transloadit.uploader");if(!c)throw Error("Element is not initialized for transloadit!");d=c[f].apply(c,d);return void 0===d?this:d};a.prototype.init=function(a,f){this.$form=a;this.options(c.extend({},e,f||{}));var b=this;a.bind("submit.transloadit",function(){b.validate();b.detectFileInputs();!b._options.processZeroFiles&&0===b.$files.length?b.submitForm():b.getBoredInstance();return!1});this.includeCss()};a.prototype.getBoredInstance=function(){var a= this;this.instance=null;c.jsonp({url:this._options.service+"instances/bored",timeout:a._options.pollTimeout,callbackParameter:"callback",success:function(f){f.error?(a.ended=!0,a.renderError(f),a._options.onError(f)):(a.instance=f.api2_host,a.start())},error:function(f,c){a.ended=!0;var e={error:"CONNECTION_ERROR",message:"There was a problem connecting to the upload server",reason:"JSONP request status: "+c};a.renderError(e);a._options.onError(e)}});this._options.modal&&this.showModal()};a.prototype.start= function(){var a=this;this.ended=this.started=!1;this.seq=this.pollRetries=this.bytesReceivedBefore=0;this.uploads=[];this.results={};this.assemblyId=this.uuid();this.$fileClones=c().not(document);this.$files.each(function(){var f=c(this).clone(!0);a.$fileClones=a.$fileClones.add(f);f.insertAfter(this)});this.$iframe=c('