芝麻web文件管理V1.00
编辑当前文件:/home/royashxg/www/wp-content/plugins/chaty/admin/assets/js/mailcheck.js
var Mailcheck={domainThreshold:2,secondLevelThreshold:2,topLevelThreshold:2,defaultDomains:["msn.com","bellsouth.net","telus.net","comcast.net","optusnet.com.au","earthlink.net","qq.com","sky.com","icloud.com","mac.com","sympatico.ca","googlemail.com","att.net","xtra.co.nz","web.de","cox.net","gmail.com","ymail.com","aim.com","rogers.com","verizon.net","rocketmail.com","google.com","optonline.net","sbcglobal.net","aol.com","me.com","btinternet.com","charter.net","shaw.ca","premio.io"],defaultSecondLevelDomains:["yahoo","hotmail","mail","live","outlook","gmx"],defaultTopLevelDomains:["com","com.au","com.tw","ca","co.nz","co.uk","de","fr","it","ru","net","org","edu","gov","jp","nl","kr","se","eu","ie","co.il","us","at","be","dk","hk","es","gr","ch","no","cz","in","net","net.au","info","biz","mil","co.jp","sg","hu","uk","io"],run:function(e){e.domains=e.domains||Mailcheck.defaultDomains,e.secondLevelDomains=e.secondLevelDomains||Mailcheck.defaultSecondLevelDomains,e.topLevelDomains=e.topLevelDomains||Mailcheck.defaultTopLevelDomains,e.distanceFunction=e.distanceFunction||Mailcheck.sift4Distance;var t=function(e){return e},i=e.suggested||t,s=e.empty||t,o=Mailcheck.suggest(Mailcheck.encodeEmail(e.email),e.domains,e.secondLevelDomains,e.topLevelDomains,e.distanceFunction);return o?i(o):s()},suggest:function(e,t,i,s,o){e=e.toLowerCase();var n=this.splitEmail(e);if(i&&s&&-1!==i.indexOf(n.secondLevelDomain)&&-1!==s.indexOf(n.topLevelDomain))return!1;var a=this.findClosestDomain(n.domain,t,o,this.domainThreshold);if(a)return a!=n.domain&&{address:n.address,domain:a,full:n.address+"@"+a};var l=this.findClosestDomain(n.secondLevelDomain,i,o,this.secondLevelThreshold),c=this.findClosestDomain(n.topLevelDomain,s,o,this.topLevelThreshold);if(n.domain){a=n.domain;var h=!1;if(l&&l!=n.secondLevelDomain&&(a=a.replace(n.secondLevelDomain,l),h=!0),c&&c!=n.topLevelDomain&&""!==n.secondLevelDomain&&(a=a.replace(new RegExp(n.topLevelDomain+"$"),c),h=!0),h)return{address:n.address,domain:a,full:n.address+"@"+a}}return!1},findClosestDomain:function(e,t,i,s){var o;s=s||this.topLevelThreshold;var n=1/0,a=null;if(!e||!t)return!1;i||(i=this.sift4Distance);for(var l=0;l
=Math.abs(u.c2-u.c1))?h++:u.trans||(u.trans=!0,h++);break}n>u.c2&&a>u.c1?r.splice(f,1):f++}r.push({c1:n,c2:a,trans:d})}else{l+=c,c=0,n!=a&&(n=a=Math.min(n,a));for(var m=0;m
=s||a>=o)&&(l+=c,c=0,n=a=Math.min(n,a))}return l+=c,Math.round(Math.max(s,o)-l+h)},splitEmail:function(e){var t=(e=null!==e?e.replace(/^\s*/,"").replace(/\s*$/,""):null).split("@");if(t.length<2)return!1;for(var i=0;i
").css({display:this.$field.css("display"),position:"static"===this.$field.css("position")?"relative":this.$field.css("position"),fontSize:this.$field.css("fontSize")});this.$field.wrap(t),this.$cval=e("
").css({visibility:"hidden",position:"absolute",display:"inline-block",fontFamily:this.$field.css("fontFamily"),fontWeight:this.$field.css("fontWeight"),letterSpacing:this.$field.css("letterSpacing")}).insertAfter(this.$field);var i=(this.$field.outerHeight(!0)-this.$field.height())/2;this.$suggOverlay=e("
").css({display:"block","box-sizing":"content-box",lineHeight:this.$field.css("lineHeight"),paddingTop:i+"px",paddingBottom:i+"px",fontFamily:this.$field.css("fontFamily"),fontWeight:this.$field.css("fontWeight"),letterSpacing:this.$field.css("letterSpacing"),position:"absolute",top:0,left:0}).insertAfter(this.$field),this.$field.on("keyup.eac",e.proxy(this.displaySuggestion,this)),this.$field.on("blur.eac",e.proxy(this.autocomplete,this)),this.$field.on("keydown.eac",e.proxy((function(e){39!==e.which&&9!==e.which&&32!==e.which&&13!==e.which||this.autocomplete(),9!==e.which||this.$field.hasClass("email-focus")?(32===e.which&&e.preventDefault(),this.$field.removeClass("email-focus")):this.$field.addClass("email-focus")}),this)),this.$field.on("click",e.proxy((function(e){this.autocomplete()}),this)),this.$suggOverlay.on("mousedown.eac touchstart.eac",e.proxy(this.autocomplete,this))},suggest:function(t){var i=(t=e.trim(t.toLowerCase())).split("@");return i.length>1&&(t=i.pop()).length?(this._domains.filter((function(e){return 0===e.indexOf(t)})).shift()||"").replace(t,""):""},autocomplete:function(){if(void 0===this.suggestion||this.suggestion.length<1)return!1;this.$field.val(this.val+this.suggestion),this.$suggOverlay.text(""),this.$cval.text("")},displaySuggestion:function(e){this.val=this.$field.val(),this.suggestion=this.suggest(this.val),this.suggestion.length?e.preventDefault():this.$suggOverlay.text(""),this.$suggOverlay.text(this.suggestion),this.$cval.text(this.val),null===this.fieldLeftOffset&&(this.fieldLeftOffset=(this.$field.outerWidth(!0)-this.$field.width())/2);var t=this.$cval.width();this.$field.outerWidth()>t&&this.$suggOverlay.css("left",this.fieldLeftOffset+t+"px")},doIndexOf:function(){Array.prototype.indexOf=function(e,t){if(null==this)throw new TypeError('"this" is null or not defined');var i=this.length>>>0;for(t=+t||0,Math.abs(t)===1/0&&(t=0),t<0&&(t+=i)<0&&(t=0);t