📄 kissy-min.js
字号:
/*Copyright 2010, KISSY UI Library v1.1.3MIT Licensedbuild time: Sep 9 13:08*/(function(b,i,p){if(b[i]===p)b[i]={};i=b[i];var r=b.document,h=location,m=function(e,j,o,s){if(!j||!e)return e;if(o===p)o=true;var d,a,c;if(s&&(c=s.length))for(d=0;d<c;d++){a=s[d];if(a in j)if(o||!(a in e))e[a]=j[a]}else for(a in j)if(o||!(a in e))e[a]=j[a];return e},k=false,f=[],x=false,z=/^#?([\w-]+)$/,u=0;m(i,{version:"1.1.3",__init:function(){this.Env={mods:{},_loadQueue:{}};var e=r.getElementsByTagName("script");this.Config={debug:"",base:e[e.length-1].src.replace(/^(.*)(seed|kissy).*$/i,
"$1"),timeout:10}},ready:function(e){x||this._bindReady();k?e.call(b,this):f.push(e);return this},_bindReady:function(){var e=this,j=r.documentElement.doScroll,o=j?"onreadystatechange":"DOMContentLoaded",s=function(){e._fireReady()};x=true;if(r.readyState==="complete")return s();if(r.addEventListener){var d=function(){r.removeEventListener(o,d,false);s()};r.addEventListener(o,d,false);b.addEventListener("load",s,false)}else{var a=function(){if(r.readyState==="complete"){r.detachEvent(o,a);s()}};r.attachEvent(o,
a);b.attachEvent("onload",s);if(b==b.top){var c=function(){try{j("left");s()}catch(n){setTimeout(c,1)}};c()}}},_fireReady:function(){if(!k){k=true;if(f){for(var e,j=0;e=f[j++];)e.call(b,this);f=null}}},available:function(e,j){if((e=(e+"").match(z)[1])&&i.isFunction(j))var o=1,s=i.later(function(){if(r.getElementById(e)&&(j()||1)||++o>500)s.cancel()},40,true)},mix:m,merge:function(){var e={},j,o=arguments.length;for(j=0;j<o;++j)m(e,arguments[j]);return e},augment:function(){var e=arguments,j=e.length-
2,o=e[0],s=e[j],d=e[j+1],a=1;if(!i.isArray(d)){s=d;d=p;j++}if(!i.isBoolean(s)){s=p;j++}for(;a<j;a++)m(o.prototype,e[a].prototype||e[a],s,d);return o},extend:function(e,j,o,s){if(!j||!e)return e;var d=Object.prototype,a=j.prototype,c=function(n){function l(){}l.prototype=n;return new l}(a);e.prototype=c;c.constructor=e;e.superclass=a;if(j!==Object&&a.constructor===d.constructor)a.constructor=j;o&&m(c,o);s&&m(e,s);return e},namespace:function(){var e=arguments.length,j=null,o,s,d;for(o=0;o<e;++o){d=
(""+arguments[o]).split(".");j=this;for(s=b[d[0]]===j?1:0;s<d.length;++s)j=j[d[s]]=j[d[s]]||{}}return j},app:function(e,j){var o=i.isString(e),s=o?b[e]||{}:e;m(s,this,true,i.__APP_MEMBERS);s.__init();m(s,i.isFunction(j)?j():j);o&&(b[e]=s);return s},log:function(e,j,o){if(i.Config.debug){if(o)e=o+": "+e;if(b.console!==p&&console.log)console[j&&console[j]?j:"log"](e)}},error:function(e){if(i.Config.debug)throw e;},guid:function(e){var j=u++ +"";return e?e+j:j}});i.__init();i.__APP_MEMBERS=["__init",
"namespace"];if(h&&(h.search||"").indexOf("ks-debug")!==-1)i.Config.debug=true})(window,"KISSY");
(function(b,i,p){function r(g){var t=typeof g;return g===null||t!=="object"&&t!=="function"}function h(g){return f.slice.call(g)}var m=document,k=m.documentElement,f=Array.prototype,x=f.indexOf,z=f.lastIndexOf,u=f.filter,e=String.prototype.trim,j=Object.prototype.toString,o=encodeURIComponent,s=decodeURIComponent,d=o("[]"),a=/^\s+|\s+$/g,c=/^(\w+)\[\]$/,n=/\S/;i.mix(i,{isUndefined:function(g){return g===p},isBoolean:function(g){return j.call(g)==="[object Boolean]"},isString:function(g){return j.call(g)===
"[object String]"},isNumber:function(g){return j.call(g)==="[object Number]"&&isFinite(g)},isPlainObject:function(g){return g&&j.call(g)==="[object Object]"&&!g.nodeType&&!g.setInterval},isEmptyObject:function(g){for(var t in g)return false;return true},isFunction:function(g){return j.call(g)==="[object Function]"},isArray:function(g){return j.call(g)==="[object Array]"},trim:e?function(g){return g==p?"":e.call(g)}:function(g){return g==p?"":g.toString().replace(a,"")},substitute:function(g,t,q){if(!i.isString(g)||
!i.isPlainObject(t))return g;return g.replace(q||/\\?\{([^{}]+)\}/g,function(w,A){if(w.charAt(0)==="\\")return w.slice(1);return t[A]!==p?t[A]:""})},each:function(g,t,q){var w,A=0,v=g.length,y=v===p||i.isFunction(g);q=q||b;if(y)for(w in g){if(t.call(q,g[w],w,g)===false)break}else for(w=g[0];A<v&&t.call(q,w,A,g)!==false;w=g[++A]);return g},indexOf:x?function(g,t){return x.call(t,g)}:function(g,t){for(var q=0,w=t.length;q<w;++q)if(t[q]===g)return q;return-1},lastIndexOf:z?function(g,t){return z.call(t,
g)}:function(g,t){for(var q=t.length-1;q>=0;q--)if(t[q]===g)break;return q},unique:function(g,t){t&&g.reverse();g=g.slice();for(var q=0,w,A;q<g.length;){for(A=g[q];(w=i.lastIndexOf(A,g))!==q;)g.splice(w,1);q+=1}t&&g.reverse();return g},inArray:function(g,t){return i.indexOf(g,t)>-1},makeArray:function(g){if(g===null||g===p)return[];if(i.isArray(g))return g;if(typeof g.length!=="number"||i.isString(g)||i.isFunction(g))return[g];return h(g)},filter:u?function(g,t,q){return u.call(g,t,q)}:function(g,
t,q){var w=[];i.each(g,function(A,v,y){t.call(q,A,v,y)&&w.push(A)});return w},param:function(g,t){if(!i.isPlainObject(g))return"";t=t||"&";var q=[],w,A;for(w in g){A=g[w];w=o(w);if(r(A))q.push(w,"=",o(A+""),t);else if(i.isArray(A)&&A.length)for(var v=0,y=A.length;v<y;++v)r(A[v])&&q.push(w,d+"=",o(A[v]+""),t)}q.pop();return q.join("")},unparam:function(g,t){if(typeof g!=="string"||(g=i.trim(g)).length===0)return{};var q={};g=g.split(t||"&");for(var w,A,v,y=0,B=g.length;y<B;++y){t=g[y].split("=");w=
s(t[0]);try{A=s(t[1]||"")}catch(C){A=t[1]||""}if((v=w.match(c))&&v[1]){q[v[1]]=q[v[1]]||[];q[v[1]].push(A)}else q[w]=A}return q},later:function(g,t,q,w,A){t=t||0;w=w||{};var v=g,y=i.makeArray(A),B;if(i.isString(g))v=w[g];v||i.error("method undefined");g=function(){v.apply(w,y)};B=q?setInterval(g,t):setTimeout(g,t);return{id:B,interval:q,cancel:function(){this.interval?clearInterval(B):clearTimeout(B)}}},clone:function(g){var t=g,q,w;if(g&&((q=i.isArray(g))||i.isPlainObject(g))){t=q?[]:{};for(w in g)if(g.hasOwnProperty(w))t[w]=
i.clone(g[w])}return t},now:function(){return(new Date).getTime()},globalEval:function(g){if(g&&n.test(g)){var t=m.getElementsByTagName("head")[0]||k,q=m.createElement("script");q.text=g;t.insertBefore(q,t.firstChild);t.removeChild(q)}}});try{h(k.childNodes)}catch(l){h=function(g){for(var t=[],q=g.length-1;q>=0;q--)t[q]=g[q];return t}}})(window,KISSY);
(function(b,i,p){var r=b.document,h=r.getElementsByTagName("head")[0]||r.documentElement,m=2,k=3,f=4,x=i.mix,z=r.createElement("script").readyState?function(e,j){var o=e.onreadystatechange;e.onreadystatechange=function(){var s=e.readyState;if(s==="loaded"||s==="complete"){e.onreadystatechange=null;o&&o();j.call(this)}}}:function(e,j){e.addEventListener("load",j,false)},u=/\.css(?:\?|$)/i;b={add:function(e,j,o){var s=this.Env.mods,d;if(i.isString(e)&&!o&&i.isPlainObject(j)){d={};d[e]=j;e=d}if(i.isPlainObject(e)){i.each(e,
function(a,c){a.name=c;s[c]&&x(a,s[c],false)});x(s,e)}else{o=o||{};d=s[e]||{};e=o.host||d.host||e;d=s[e]||{};x(d,{name:e,status:m});if(!d.fns)d.fns=[];j&&d.fns.push(j);x(s[e]=d,o);d.attach!==false&&this.__isAttached(d.requires)&&this.__attachMod(d)}return this},use:function(e,j,o){e=e.replace(/\s+/g,"").split(",");o=o||{};var s=this,d=s.Env.mods,a=(o||0).global,c,n=e.length,l,g,t;a&&s.__mixMods(a);if(s.__isAttached(e))j&&j(s);else{for(c=0;c<n&&(l=d[e[c]]);c++)if(l.status!==f){if(o.order&&c>0){if(!l.requires)l.requires=
[];l._requires=l.requires.concat();g=e[c-1];if(!i.inArray(g,l.requires)&&!i.inArray(l.name,d[g].requires||[]))l.requires.push(g)}s.__attach(l,function(){if(!t&&s.__isAttached(e)){t=true;if(l._requires)l.requires=l._requires;j&&j(s)}},a)}return s}},__attach:function(e,j,o){function s(){if(d.__isAttached(a)){e.status===m&&d.__attachMod(e);e.status===f&&j()}}for(var d=this,a=e.requires||[],c=0,n=a.length;c<n;c++)d.__attach(d.Env.mods[a[c]],s,o);d.__buildPath(e);d.__load(e,s,o)},__mixMods:function(e){var j=
this.Env.mods,o=e.Env.mods,s;for(s in o)this.__mixMod(j,o,s,e)},__mixMod:function(e,j,o,s){var d=e[o]||{},a=d.status;i.mix(d,i.clone(j[o]));if(a)d.status=a;s&&this.__buildPath(d,s.Config.base);e[o]=d},__attachMod:function(e){var j=this;if(e.fns){i.each(e.fns,function(o){o&&o(j)});e.fns=p}e.status=f},__isAttached:function(e){for(var j=this.Env.mods,o,s=(e=i.makeArray(e)).length-1;s>=0&&(o=j[e[s]]);s--)if(o.status!==f)return false;return true},__load:function(e,j,o){function s(){d();if(e.status!==k){o&&
a.__mixMod(a.Env.mods,o.Env.mods,e.name,o);if(e.status!==f)e.status=m;j()}}function d(){n[c]=m}var a=this,c=e.fullpath,n=i.Env._loadQueue,l=n[c];e.status=e.status||0;if(e.status<1&&l)e.status=l.nodeName?1:m;if(i.isString(e.cssfullpath)){a.getScript(e.cssfullpath);e.cssfullpath=m}if(e.status<1&&c){e.status=1;l=a.getScript(c,{success:function(){KISSY.log(e.name+" is loaded.","info");s()},error:function(){e.status=k;d()},charset:e.charset});u.test(c)||(n[c]=l)}else e.status===1?z(l,s):j()},__buildPath:function(e,
j){function o(d,a){if(!e[a]&&e[d])e[a]=(j||s.base)+e[d];if(e[a]&&s.debug)e[a]=e[a].replace(/-min/g,"")}var s=this.Config;o("path","fullpath");e.cssfullpath!==m&&o("csspath","cssfullpath")},getScript:function(e,j,o){var s=u.test(e),d=r.createElement(s?"link":"script"),a=j,c,n,l;if(i.isPlainObject(a)){j=a.success;c=a.error;n=a.timeout;o=a.charset}if(s){d.href=e;d.rel="stylesheet"}else{d.src=e;d.async=true}if(o)d.charset=o;if(i.isFunction(j))s?j.call(d):z(d,function(){if(l){l.cancel();l=p}j.call(d)});
if(i.isFunction(c))l=i.later(function(){l=p;c()},(n||this.Config.timeout)*1E3);h.insertBefore(d,h.firstChild);return d}};x(i,b);i.each(b,function(e,j){i.__APP_MEMBERS.push(j)})})(window,KISSY);(function(b){var i={core:{path:"packages/core-min.js",charset:"utf-8"}};b.each(["sizzle","datalazyload","flash","switchable","suggest","overlay"],function(p){i[p]={path:p+"/"+p+"-pkg-min.js",requires:["core"],charset:"utf-8"}});b.add(i)})(KISSY);
KISSY.add("ua",function(b){var i=navigator.userAgent,p="",r="",h,m={},k=function(f){var x=0;return parseFloat(f.replace(/\./g,function(){return x++===0?".":""}))};if((h=i.match(/AppleWebKit\/([\d.]*)/))&&h[1]){m[p="webkit"]=k(h[1]);if((h=i.match(/Chrome\/([\d.]*)/))&&h[1])m[r="chrome"]=k(h[1]);else if((h=i.match(/\/([\d.]*) Safari/))&&h[1])m[r="safari"]=k(h[1]);if(/ Mobile\//.test(i))m.mobile="apple";else if(h=i.match(/NokiaN[^\/]*|Android \d\.\d|webOS\/\d\.\d/))m.mobile=h[0].toLowerCase()}else if((h=
i.match(/Presto\/([\d.]*)/))&&h[1]){m[p="presto"]=k(h[1]);if((h=i.match(/Opera\/([\d.]*)/))&&h[1]){m[r="opera"]=k(h[1]);if((h=i.match(/Opera\/.* Version\/([\d.]*)/))&&h[1])m[r]=k(h[1]);if((h=i.match(/Opera Mini[^;]*/))&&h)m.mobile=h[0].toLowerCase();else if((h=i.match(/Opera Mobi[^;]*/))&&h)m.mobile=h[0]}}else if((h=i.match(/MSIE\s([^;]*)/))&&h[1]){m[p="trident"]=0.1;m[r="ie"]=k(h[1]);if((h=i.match(/Trident\/([\d.]*)/))&&h[1])m[p]=k(h[1])}else if(h=i.match(/Gecko/)){m[p="gecko"]=0.1;if((h=i.match(/rv:([\d.]*)/))&&
h[1])m[p]=k(h[1]);if((h=i.match(/Firefox\/([\d.]*)/))&&h[1])m[r="firefox"]=k(h[1])}m.core=p;m.shell=r;m._numberify=k;b.UA=m});
KISSY.add("ua-extra",function(b){var i=b.UA,p=navigator.userAgent,r,h,m={},k=i._numberify;if(p.match(/360SE/))m[h="se360"]=3;else if(p.match(/Maxthon/)&&(r=window.external)){h="maxthon";try{m[h]=k(r.max_version)}catch(f){m[h]=0.1}}else if(r=p.match(/TencentTraveler\s([\d.]*)/))m[h="tt"]=r[1]?k(r[1]):0.1;else if(p.match(/TheWorld/))m[h="theworld"]=3;else if(r=p.match(/SE\s([\d.]*)/))m[h="sougou"]=r[1]?k(r[1]):0.1;h&&(m.shell=h);b.mix(i,m)});
KISSY.add("dom",function(b,i){function p(r,h){return r&&r.nodeType===h}b.DOM={_isElementNode:function(r){return p(r,1)},_isKSNode:function(r){return b.Node&&p(r,b.Node.TYPE)},_getWin:function(r){return r&&"scrollTo"in r&&r.document?r:p(r,9)?r.defaultView||r.parentWindow:r===i?window:false},_nodeTypeIs:p}});
KISSY.add("selector",function(b,i){function p(a,c){var n,l=[],g,t;c=r(c);if(b.isString(a)){a=b.trim(a);if(s.test(a)){if(a=h(a.slice(1),c))l=[a]}else if(n=d.exec(a)){g=n[1];t=n[2];n=n[3];if(c=g?h(g,c):c)if(n)if(!g||a.indexOf(u)!==-1)l=k(n,t,c);else{if((a=h(g,c))&&z.hasClass(a,n))l=[a]}else if(t)l=m(t,c)}else if(b.ExternalSelector)return b.ExternalSelector(a,c);else f(a)}else if(a&&(a[j]||a[o]))l=a[j]?[a[j]()]:a[o]();else if(a&&(b.isArray(a)||a.item&&!a.nodeType))l=a;else if(a)l=[a];if(l.item)l=b.makeArray(l);
l.each=function(q,w){return b.each(l,q,w)};return l}function r(a){if(a===i)a=x;else if(b.isString(a)&&s.test(a))a=h(a.slice(1),x);else if(a&&a.nodeType!==1&&a.nodeType!==9)a=null;return a}function h(a,c){if(c.nodeType!==9)c=c.ownerDocument;return c.getElementById(a)}function m(a,c){return c.getElementsByTagName(a)}function k(a,c,n){n=a=n.getElementsByClassName(a);var l=0,g=0,t=a.length,q;if(c&&c!==e){n=[];for(c=c.toUpperCase();l<t;++l){q=a[l];if(q.tagName===c)n[g++]=q}}return n}function f(a){b.error("Unsupported selector: "+
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -