KodExplorer/static/js/lib/webuploader/webuploader-min.js

1 line
46 KiB
JavaScript
Raw Normal View History

2014-07-06 18:24:21 +00:00
var dragEnter=dragOver=dragLeave=dragDrop=function(){};(function(C,E){var A=(function(F,K){var L={},G=function(P,Q){var N,M,O;if(typeof P==="string"){return J(P)}else{N=[];for(M=P.length,O=0;O<M;O++){N.push(J(P[O]))}return Q.apply(null,N)}},I=function(O,M,N){if(arguments.length===2){N=M;M=null}if(typeof O!=="string"||!N){throw new Error("Define Error")}G(M||[],function(){H(O,N,arguments)})},H=function(P,O,N){var M={exports:O},Q;if(typeof O==="function"){N.length||(N=[G,M.exports,M]);Q=O.apply(null,N);Q!==K&&(M.exports=Q)}L[P]=M.exports},J=function(N){var M=L[N]||F[N];if(!M){throw new Error("`"+N+"` is undefined")}return M};return{define:I,require:G,modules:L}})(C),B=A.require,D=A.define;D("base",["jQuery"],function(H){var J=function(){},I=Function.call;function F(L){return function(){return I.apply(L,arguments)}}function K(L,M){return function(){return L.apply(M,arguments)}}function G(L){var M;if(Object.create){return Object.create(L)}else{M=function(){};M.prototype=L;return new M()}}return{version:"0.1.0",$:H,Deferred:H.Deferred,isPromise:function(L){return L&&typeof L.then==="function"},when:H.when,browser:(function(Q){var M={},N=Q.match(/WebKit\/([\d.]+)/),P=Q.match(/Chrome\/([\d.]+)/)||Q.match(/CriOS\/([\d.]+)/),O=Q.match(/MSIE\s([\d.]+)/),L=Q.match(/Firefox\/([\d.]+)/),R=Q.match(/Safari\/([\d.]+)/),S=Q.match(/OPR\/([\d.]+)/);N&&(M.webkit=parseFloat(N[1]));P&&(M.chrome=parseFloat(P[1]));O&&(M.ie=parseFloat(O[1]));L&&(M.firefox=parseFloat(L[1]));R&&(M.safari=parseFloat(R[1]));S&&(M.opera=parseFloat(S[1]));return M})(navigator.userAgent),inherits:function(N,L,O){var M;if(typeof L==="function"){M=L;L=null}else{if(L&&L.hasOwnProperty("constructor")){M=L.constructor}else{M=function(){return N.apply(this,arguments)}}}H.extend(true,M,N,O||{});M.__super__=N.prototype;M.prototype=G(N.prototype);L&&H.extend(true,M.prototype,L);return M},noop:J,bindFn:K,log:(function(){if(C.console){return K(console.log,console)}return J})(),nextTick:(function(){return function(L){setTimeout(L,1)}})(),slice:F([].slice),guid:(function(){var L=0;return function(M){var N=(+new Date()).toString(32),O=0;for(;O<5;O++){N+=Math.floor(Math.random()*65535).toString(32)}return(M||"wu_")+N+(L++).toString(32)}})(),formatSize:function(L,O,M){var N;M=M||["B","K","M","G","TB"];while((N=M.shift())&&L>1024){L=L/1024}return(N==="B"?L:L.toFixed(O||2))+N}}});D("mediator",["base"],function(L){var H=L.$,G=[].slice,J=/\s+/,F;function M(O,N,Q,P){return H.grep(O,function(R){return R&&(!N||R.e===N)&&(!Q||R.cb===Q||R.cb._cb===Q)&&(!P||R.ctx===P)})}function K(O,P,N){H.each((O||"").split(J),function(R,Q){N(Q,P)})}function I(Q,O){var S=false,R=-1,N=Q.length,P;while(++R<N){P=Q[R];if(P.cb.apply(P.ctx2,O)===false){S=true;break}}return !S}F={on:function(O,R,P){var N=this,Q;if(!R){return this}Q=this._events||(this._events=[]);K(O,R,function(S,U){var T={e:S};T.cb=U;T.ctx=P;T.ctx2=P||N;T.id=Q.length;Q.push(T)});return this},once:function(O,Q,P){var N=this;if(!Q){return N}K(O,Q,function(S,T){var R=function(){N.off(S,R);return T.apply(P||N,arguments)};R._cb=T;N.on(S,R,P)});return N},off:function(O,N,Q){var P=this._events;if(!P){return this}if(!O&&!N&&!Q){this._events=[];return this}K(O,N,function(S,R){H.each(M(P,S,R,Q),function(){delete P[this.id]})});return this},trigger:function(P){var N,O,Q;if(!this._events||!P){return this}N=G.call(arguments,1);O=M(this._events,P);Q=M(this._events,"all");return I(O,N)&&I(Q,arguments)}};return H.extend({installTo:function(N){return H.extend(N,F)}},F)});D("uploader",["base","mediator"],function(G,I){var H=G.$;function F(J){this.options=H.extend(true,{},F.options,J);this._init(this.options)}F.options={};I.installTo(F.prototype);H.each({upload:"start-upload",stop:"stop-upload",getFile:"get-file",getFiles:"get-files",removeFile:"remove-file",skipFile:"skip-file",retry:"retry",isInProgress:"is-in-progress",makeThumb:"make-thumb",getDimension:"get-dimension",addButton:"add-btn",getRuntimeType:"get-runtime-type",refresh:"refresh",disable:"disable",enable:"enable"},function(J,K){F.prototype[J]=function(){return this.request(K,arguments)}});H.extend(F.pro