snappymail/vendors/jua/jua.min.js

3 lines
12 KiB
JavaScript
Raw Normal View History

2014-09-11 23:00:05 +08:00
/* RainLoop Webmail (c) RainLoop Team | MIT */
!function(){function e(e){function n(){if(o&&a<e){var t=o,r=t[0],u=Array.prototype.slice.call(t,1),d=t.index;o=o===i?i=null:o.next,++a,u.push(function(e,t){--a,s||(e?l&&c(s=e,l=p=o=i=null):(p[d]=t,--l?n():c(null,p)))}),r.apply(null,u)}}var o,i,r={},a=0,l=0,u=-1,s=null,p=[],c=t;return arguments.length<1&&(e=1/0),r.defer=function(){if(!s){var e=arguments;e.index=++u,i?(i.next=e,i=i.next):o=i=e,++l,n()}return r},r.await=function(e){return c=e,l||c(s,p),r},r}function t(){}"undefined"==typeof module?self.queue=e:module.exports=e,e.version="0.0.2"}(),function(e){var t={};function n(o){if(t[o])return t[o].exports;var i=t[o]={exports:{},id:o,loaded:!1};return e[o].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}n.m=e,n.c=t,n.p="",n(0)}([function(e,t,n){!function(){"use strict";n(1).Jua=n(7)}()},function(e,t,n){e.exports=window},function(e,t,n){!function(){"use strict";var t={iDefLimit:20};e.exports=t}()},function(e,t,n){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 void 0===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||(e.contains?e.contains(t):!!t.compareDocumentPosition&&!!(8&t.compareDocumentPosition(e)))),n},t.mainClearTimeout=function(e){0<e&&clearTimeout(e),e=0},t.getEvent=function(e){return(e=e&&(e.originalEvent?e.originalEvent:e)||o.event).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)},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,l,u=0,s=0,p=null,c=null,d=!1;if(a=o=t.isUndefined(o)?r.iDefLimit:t.pInt(o),l=0<o,e=e&&0<e.length?e:null)for(s=0,u=e.length;s<u;s++)(p=e[s])&&(!l||0<=--o?(c=t.getDataFromFile(p))&&n(c):l&&!d&&0>o&&i&&(d=!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;n<o;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))&&t.eventContainsFiles(e)&&(r=t.getValue(e,"files",null)||(e.dataTransfer?t.getValue(e.dataTransfer,"files",null):null))&&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)||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";var t=n(3),o=n(2),i=n(4);function r(e,t){this.oXhrs