snappymail/vendors/jua/jua.min.js

3 lines
14 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"})();
2014-09-11 23:00:05 +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,n){var o=t.isUndefined(e.fileName)?t.isUndefined(e.name)?null:e.name:e.fileName,i=t.isUndefined(e.fileSize)?t.isUndefined(e.size)?null:e.size:e.fileSize,r=t.isUndefined(e.type)?null:e.type;return{FileName:o,Size:i,Type:r,Folder:t.isUndefined(n)?"":n,File:e}},t.getDataFromFiles=function(e,n,o,i,a,l){var u=0,s=0,p=0,d=null,c=null,f=!1,g=!1,m=function(e,n,o,r){if(e&&!t.isUndefined(e.name))if(n=n||"",e.isFile)e.file(function(e){!f||0<=--a?o(t.getDataFromFile(e,n)):f&&!g&&0>a&&l&&(g=!0,l(u))});else if(i&&e.isDirectory&&e.createReader){var s=e.createReader(),p=0,d=0;s&&s.readEntries&&s.readEntries(function(i){if(i&&t.isNonEmptyArray(i))for(p=0,d=i.length;d>p;p++)m(i[p],n+e.name+"/",o,r)})}};if(i=t.isUndefined(i)?!0:!!i,o=t.isUndefined(o)?!1:!!o,a=t.isUndefined(a)?r.iDefLimit:t.pInt(a),u=a,f=a>0,e=e&&0<e.length?e:null)for(p=0,s=e.length;s>p;p++)d=e[p],d&&(o?"file"===d.kind&&d.webkitGetAsEntry&&(c=d.webkitGetAsEntry(),c&&m(c,"",n,l)):!f||0<=--a?n(t.getDataFromFile(d)):f&&!g&&0>a&&l&&(g=!0,l(u)))},t.getDataFromInput=function(e,n,o,i){var r=e&&e.files&&0<e.files.length?e.files:null;r?t.getDataFromFiles(r,n,!1,!1,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,r){var a=null,l=null;e=t.getEvent(e),e&&(a=(e.dataTransfer?t.getValue(e.dataTransfer,"items",null):null)||t.getValue(e,"items",null),a&&0<a.length&&a[0]&&a[0].webkitGetAsEntry?t.getDataFromFiles(a,n,!0,r,o,i):t.eventContainsFiles(e)&&(l=t.getValue(e,"files",null)||(e.dataTransfer?t.getValue(e.dataTransfer,"files",null):null),l&&0<l.length&&t.getDataFromFiles(l,n,!1,!1,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();