snappymail/vendors/jua/jua.min.js

3 lines
13 KiB
JavaScript
Raw Normal View History

2014-09-11 23:00:05 +08:00
/* RainLoop Webmail (c) RainLoop Team | MIT */
2014-11-13 00:46:05 +08:00
(function(){function a(a){function l(){if(g&&d<a){var b=g,c=b[0],f=Array.prototype.slice.call(b,1),m=b.index;g===h?g=h=null:g=g.next,++d,f.push(function(a,b){--d;if(i)return;a?e&&k(i=a,e=j=g=h=null):(j[m]=b,--e?l():k(null,j))}),c.apply(null,f)}}var c={},d=0,e=0,f=-1,g,h,i=null,j=[],k=b;return arguments.length<1&&(a=Infinity),c.defer=function(){if(!i){var a=arguments;a.index=++f,h?(h.next=a,h=h.next):g=h=a,++e,l()}return c},c.await=function(a){return k=a,e||k(i,j),c},c}function b(){}typeof module=="undefined"?self.queue=a:module.exports=a,a.version="0.0.2"})();
2015-03-31 04:53:53 +08:00
!function(e){function t(o){if(n[o])return n[o].exports;var i=n[o]={exports:{},id:o,loaded:!1};return e[o].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){!function(){"use strict";n(1).Jua=n(7)}()},function(e){e.exports=window},function(e,t,n){!function(){"use strict";var t={};t.iDefLimit=20,t.bIsAjaxUploaderSupported=function(){var e=n(1),t=e.document.createElement("input");return t.type="file",!!("XMLHttpRequest"in e&&"multiple"in t&&"FormData"in e&&(new e.XMLHttpRequest).upload)}(),e.exports=t}()},function(e){e.exports=jQuery},function(e,t,n){!function(){"use strict";var t={},o=n(1),i=n(3),r=n(2);t.isUndefined=function(e){return"undefined"==typeof e},t.extend=function(e,t){if(t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e},t.contains=function(e,t){var n=!1;return e&&t&&(n=e===t?!0:e.contains?e.contains(t):t.compareDocumentPosition?!!(8&t.compareDocumentPosition(e)):!1),n},t.mainClearTimeout=function(e){e>0&&clearTimeout(e),e=0},t.getEvent=function(e){return e=e&&(e.originalEvent?e.originalEvent:e)||o.event,e.dataTransfer?e:null},t.getValue=function(e,n,o){return e&&n&&!t.isUndefined(e[n])?e[n]:o},t.setValue=function(e,t,n){e[t]=n},t.isNonEmptyArray=function(e){return e&&e.length&&0<e.length?!0:!1},t.pInt=function(e){return parseInt(e||0,10)},t.scopeBind=function(e,n){return function(){return e.apply(t.isUndefined(n)?null:n,Array.prototype.slice.call(arguments))}},t.fakeMd5=function(e){var n="",i="0123456789abcdefghijklmnopqrstuvwxyz";for(e=t.isUndefined(e)?32:t.pInt(e);n.length<e;)n+=i.substr(o.Math.round(o.Math.random()*i.length),1);return n},t.getNewUid=function(){return"jua-uid-"+t.fakeMd5(16)+"-"+(new o.Date).getTime().toString()},t.getDataFromFile=function(e){var n=t.isUndefined(e.fileName)?t.isUndefined(e.name)?null:e.name:e.fileName,o=t.isUndefined(e.fileSize)?t.isUndefined(e.size)?null:e.size:e.fileSize,i=t.isUndefined(e.type)?null:e.type;return"/"===n.charAt(0)&&(n=n.substr(1)),""===i&&0===o?null:{FileName:n,Size:o,Type:i,Folder:"",File:e}},t.getDataFromFiles=function(e,n,o,i){var a=0,l=0,u=0,s=null,p=null,d=!1,c=!1;if(o=t.isUndefined(o)?r.iDefLimit:t.pInt(o),a=o,d=o>0,e=e&&0<e.length?e:null)for(u=0,l=e.length;l>u;u++)s=e[u],s&&(!d||0<=--o?(p=t.getDataFromFile(s),p&&n(p)):d&&!c&&0>o&&i&&(c=!0,i(a)))},t.getDataFromInput=function(e,n,o,i){var r=e&&e.files&&0<e.files.length?e.files:null;r?t.getDataFromFiles(r,n,o,i):n({FileName:e.value.split("\\").pop().split("/").pop(),Size:null,Type:null,Folder:"",File:null})},t.eventContainsFiles=function(e){var t=!1;if(e&&e.dataTransfer&&e.dataTransfer.types&&e.dataTransfer.types.length)for(var n=0,o=e.dataTransfer.types.length;o>n;n++)if("files"===e.dataTransfer.types[n].toLowerCase()){t=!0;break}return t},t.getDataFromDragEvent=function(e,n,o,i){var r=null;e=t.getEvent(e),e&&t.eventContainsFiles(e)&&(r=t.getValue(e,"files",null)||(e.dataTransfer?t.getValue(e.dataTransfer,"files",null):null),r&&0<r.length&&t.getDataFromFiles(r,n,o,i))},t.createNextLabel=function(){return i('<label style="position: absolute; background-color:#fff; right: 0px; top: 0px; left: 0px; bottom: 0px; margin: 0px; padding: 0px; cursor: pointer;"></label>').css({opacity:0})},t.createNextInput=function(){return i('<input type="file" tabindex="-1" hidefocus="hidefocus" style="position: absolute; left: -9999px;" />')},t.getNewInput=function(e,n){e=t.isUndefined(e)?"":e.toString();var o=t.createNextInput();return 0<e.length&&o.attr("name",e),(t.isUndefined(n)?!0:n)&&o.prop("multiple",!0),o},t.getStringOrCallFunction=function(e,t){return i.isFunction(e)?e.apply(null,i.isArray(t)?t:[]).toString():e.toString()},e.exports=t}()},function(e,t,n){!function(){"use strict";function t(e,t){this.oXhrs={},this.oUids={},this.oJua=e,this.oOptions=t}var o=n(3),i=n(2),r=n(4);t.prototype.oXhrs={},t.prototype.oUids={},t.prototype.oJua=null,t.prototype.oOptions={},t.prototype.isDragAndDropSupported=function(){return!0},t.prototype.regTaskUid=function(e){this.oUids[e]=!0},t.prototype.uploadTask=function(e,t,n){if(!1===this.oUids[e]||!t||!t.File)return