📄 kissy-min.js
字号:
a)}var x=document,z=b.DOM,u=" ",e="*",j="getDOMNode",o=j+"s",s=/^#[\w-]+$/,d=/^(?:#([\w-]+))?\s*([\w-]+|\*)?\.?([\w-]+)?$/;(function(){var a=x.createElement("div");a.appendChild(x.createComment(""));if(a.getElementsByTagName(e).length>0)m=function(c,n){n=n.getElementsByTagName(c);if(c===e){c=[];for(var l=0,g=0,t;t=n[l++];)if(t.nodeType===1)c[g++]=t;n=c}return n}})();x.getElementsByClassName||(k=x.querySelectorAll?function(a,c,n){return n.querySelectorAll((c?c:"")+"."+a)}:function(a,c,n){c=n.getElementsByTagName(c||
e);n=[];var l=0,g=0,t=c.length,q,w;for(a=u+a+u;l<t;++l){q=c[l];if((w=q.className)&&(u+w+u).indexOf(a)>-1)n[g++]=q}return n});b.query=p;b.get=function(a,c){return p(a,c)[0]||null};b.mix(z,{query:p,get:b.get,filter:function(a,c){var n=p(a),l,g,t,q=[];if(b.isString(c)&&(l=d.exec(c))&&!l[1]){g=l[2];t=l[3];c=function(w){return!(g&&w.tagName!==g.toUpperCase()||t&&!z.hasClass(w,t))}}if(b.isFunction(c))q=b.filter(n,c);else if(c&&b.ExternalSelector)q=b.ExternalSelector._filter(a,c);else f(c);return q},test:function(a,
c){a=p(a);return z.filter(a,c).length===a.length}})});
KISSY.add("dom-class",function(b,i){function p(k,f,x,z){if(!(f=b.trim(f)))return z?false:i;k=b.query(k);var u=0,e=k.length;f=f.split(h);for(var j;u<e;u++){j=k[u];if(r._isElementNode(j)){j=x(j,f,f.length);if(j!==i)return j}}if(z)return false}var r=b.DOM,h=/[\.\s]\s*\.?/,m=/[\n\t]/g;b.mix(r,{hasClass:function(k,f){return p(k,f,function(x,z,u){if(x=x.className){x=" "+x+" ";for(var e=0,j=true;e<u;e++)if(x.indexOf(" "+z[e]+" ")<0){j=false;break}if(j)return true}},true)},addClass:function(k,f){p(k,f,function(x,
z,u){var e=x.className;if(e){var j=" "+e+" ";e=e;for(var o=0;o<u;o++)if(j.indexOf(" "+z[o]+" ")<0)e+=" "+z[o];x.className=b.trim(e)}else x.className=f})},removeClass:function(k,f){p(k,f,function(x,z,u){var e=x.className;if(e)if(u){e=(" "+e+" ").replace(m," ");for(var j=0,o;j<u;j++)for(o=" "+z[j]+" ";e.indexOf(o)>=0;)e=e.replace(o," ");x.className=b.trim(e)}else x.className=""})},replaceClass:function(k,f,x){r.removeClass(k,f);r.addClass(k,x)},toggleClass:function(k,f,x){var z=b.isBoolean(x),u;p(k,
f,function(e,j,o){for(var s=0,d;s<o;s++){d=j[s];u=z?!x:r.hasClass(e,d);r[u?"removeClass":"addClass"](e,d)}})}})});
KISSY.add("dom-attr",function(b,i){function p(d,a){return a&&a.nodeName.toUpperCase()===d.toUpperCase()}var r=b.UA,h=r.ie,m=h&&h<8,k=document.documentElement.textContent!==i?"textContent":"innerText",f=b.DOM,x=f._isElementNode,z=function(d){return f._nodeTypeIs(d,3)},u=/href|src|style/,e=/href|src|colspan|rowspan/,j=/\r/g,o=/radio|checkbox/,s={readonly:"readOnly"};m&&b.mix(s,{"for":"htmlFor","class":"className"});b.mix(f,{attr:function(d,a,c){if(b.isPlainObject(a))for(var n in a)f.attr(d,n,a[n]);
else if(a=b.trim(a)){a=a.toLowerCase();a=s[a]||a;if(c===i){d=b.get(d);if(!x(d))return i;var l;u.test(a)||(l=d[a]);if(l===i)l=d.getAttribute(a);if(m)if(e.test(a))l=d.getAttribute(a,2);else if(a==="style")l=d.style.cssText;return l===null?i:l}b.each(b.query(d),function(g){if(x(g))if(a==="style")g.style.cssText=c;else{if(a==="checked")g[a]=!!c;g.setAttribute(a,""+c)}})}},removeAttr:function(d,a){b.each(b.query(d),function(c){if(x(c)){f.attr(c,a,"");c.removeAttribute(a)}})},val:function(d,a){if(a===i){var c=
b.get(d);if(!x(c))return i;if(p("option",c))return(c.attributes.value||{}).specified?c.value:c.text;if(p("select",c)){var n=c.selectedIndex;d=c.options;if(n<0)return null;else if(c.type==="select-one")return f.val(d[n]);c=[];for(var l=0,g=d.length;l<g;++l)d[l].selected&&c.push(f.val(d[l]));return c}if(r.webkit&&o.test(c.type))return c.getAttribute("value")===null?"on":c.value;return(c.value||"").replace(j,"")}b.each(b.query(d),function(t){if(p("select",t)){if(b.isNumber(a))a+="";var q=b.makeArray(a),
w=t.options,A;l=0;for(g=w.length;l<g;++l){A=w[l];A.selected=b.inArray(f.val(A),q)}if(!q.length)t.selectedIndex=-1}else if(x(t))t.value=a})},text:function(d,a){if(a===i){d=b.get(d);if(x(d))return d[k]||"";else if(z(d))return d.nodeValue}else b.each(b.query(d),function(c){if(x(c))c[k]=a;else if(z(c))c.nodeValue=a})}})});
KISSY.add("dom-style",function(b,i){function p(a,c){var n=b.get(a),l=c===x?n.offsetWidth:n.offsetHeight;b.each(c===x?["Left","Right"]:["Top","Bottom"],function(g){l-=parseFloat(h._getComputedStyle(n,"padding"+g))||0;l-=parseFloat(h._getComputedStyle(n,"border"+g+"Width"))||0});return l}function r(a,c,n){var l=n;if(n===z&&e.test(c)){l=0;if(h.css(a,"position")==="absolute"){n=a[c==="left"?"offsetLeft":"offsetTop"];if(m.ie===8||m.opera)n-=u(h.css(a.offsetParent,"border-"+c+"-width"))||0;l=n-(u(h.css(a,
"margin-"+c))||0)}}return l}var h=b.DOM,m=b.UA,k=document,f=k.documentElement,x="width",z="auto",u=parseInt,e=/^left|top$/,j=/width|height|top|left|right|bottom|margin|padding/i,o=/-([a-z])/ig,s=function(a,c){return c.toUpperCase()},d={};b.mix(h,{_CUSTOM_STYLES:d,_getComputedStyle:function(a,c){var n="",l=a.ownerDocument;if(a.style)n=l.defaultView.getComputedStyle(a,null)[c];return n},css:function(a,c,n){if(b.isPlainObject(c))for(var l in c)h.css(a,l,c[l]);else{if(c.indexOf("-")>0)c=c.replace(o,s);
c=d[c]||c;if(n===i){a=b.get(a);l="";if(a&&a.style){l=c.get?c.get(a):a.style[c];if(l===""&&!c.get)l=r(a,c,h._getComputedStyle(a,c))}return l===i?"":l}else{if(n===null||n==="")n="";else if(!isNaN(new Number(n))&&j.test(c))n+="px";(c===x||c==="height")&&parseFloat(n)<0||b.each(b.query(a),function(g){if(g&&g.style){c.set?c.set(g,n):(g.style[c]=n);if(n==="")g.style.cssText||g.removeAttribute("style")}})}}},width:function(a,c){if(c===i)return p(a,x);else h.css(a,x,c)},height:function(a,c){if(c===i)return p(a,
"height");else h.css(a,"height",c)},addStyleSheet:function(a,c){var n;if(c)n=b.get("#"+c);if(!n){n=h.create("<style>",{id:c});b.get("head").appendChild(n);if(n.styleSheet)n.styleSheet.cssText=a;else n.appendChild(k.createTextNode(a))}}});if(f.style.cssFloat!==i)d["float"]="cssFloat";else if(f.style.styleFloat!==i)d["float"]="styleFloat"});
KISSY.add("dom-style-ie",function(b,i){if(b.UA.ie){var p=b.DOM;b=document;var r=b.documentElement,h=p._CUSTOM_STYLES,m=/^-?\d+(?:px)?$/i,k=/^-?\d/,f=/^width|height$/;try{if(r.style.opacity===i&&r.filters)h.opacity={get:function(z){var u=100;try{u=z.filters["DXImageTransform.Microsoft.Alpha"].opacity}catch(e){try{u=z.filters("alpha").opacity}catch(j){}}return u/100+""},set:function(z,u){var e=z.style;z=(z.currentStyle||0).filter||"";e.zoom=1;if(z)if(z=z.replace(/alpha\(opacity=.+\)/ig,""))z+=", ";
e.filter=z+"alpha(opacity="+u*100+")"}}}catch(x){}if(!(b.defaultView||{}).getComputedStyle&&r.currentStyle)p._getComputedStyle=function(z,u){var e=z.style,j=z.currentStyle[u];if(f.test(u))j=p[u](z)+"px";else if(!m.test(j)&&k.test(j)){var o=e.left,s=z.runtimeStyle.left;z.runtimeStyle.left=z.currentStyle.left;e.left=u==="fontSize"?"1em":j||0;j=e.pixelLeft+"px";e.left=o;z.runtimeStyle.left=s}return j}}});
KISSY.add("dom-offset",function(b,i){function p(q){var w=0,A=0,v=u(q[a]);if(q[t]){q=q[t]();w=q[c];A=q[n];if(m.mobile!=="apple"){w+=h[l](v);A+=h[g](v)}}return{left:w,top:A}}function r(q,w){if(h.css(q,s)==="static")q.style[s]=d;var A=p(q),v={},y,B;for(B in w){y=o(h.css(q,B),10)||0;v[B]=y+w[B]-A[B]}h.css(q,v)}var h=b.DOM,m=b.UA,k=window,f=document,x=h._isElementNode,z=h._nodeTypeIs,u=h._getWin,e=f.compatMode==="CSS1Compat",j=Math.max,o=parseInt,s="position",d="relative",a="ownerDocument",c="left",n=
"top",l="scrollLeft",g="scrollTop",t="getBoundingClientRect";b.mix(h,{offset:function(q,w){if(!(q=b.get(q))||!q[a])return null;if(w===i)return p(q);r(q,w)},scrollIntoView:function(q,w,A,v){if((q=b.get(q))&&q[a]){v=v===i?true:!!v;A=A===i?true:!!A;if(!w||w===k)return q.scrollIntoView(A);w=b.get(w);if(z(w,9))w=u(w);var y=w&&"scrollTo"in w&&w.document,B=h.offset(q),C=y?{left:h.scrollLeft(w),top:h.scrollTop(w)}:h.offset(w),D={left:B[c]-C[c],top:B[n]-C[n]};B=y?h.viewportHeight(w):w.clientHeight;C=y?h.viewportWidth(w):
w.clientWidth;var G=h[l](w),E=h[g](w),F=G+C,M=E+B,I=q.offsetHeight;q=q.offsetWidth;var H=D.left+G-(o(h.css(w,"borderLeftWidth"))||0);D=D.top+E-(o(h.css(w,"borderTopWidth"))||0);var N=H+q,J=D+I,K,L;if(I>B||D<E||A)K=D;else if(J>M)K=J-B;if(v)if(q>C||H<G||A)L=H;else if(N>F)L=N-C;if(y){if(K!==i||L!==i)w.scrollTo(L,K)}else{if(K!==i)w[g]=K;if(L!==i)w[l]=L}}}});b.each(["Left","Top"],function(q,w){var A="scroll"+q;h[A]=function(v){var y=0,B=u(v),C;if(B&&(C=B.document))y=B[w?"pageYOffset":"pageXOffset"]||C.documentElement[A]||
C.body[A];else if(x(v=b.get(v)))y=v[A];return y}});b.each(["Width","Height"],function(q){h["doc"+q]=function(w){w=w||f;return j(e?w.documentElement["scroll"+q]:w.body["scroll"+q],h["viewport"+q](w))};h["viewport"+q]=function(w){var A="inner"+q;w=u(w);var v=w.document;return A in w?w[A]:e?v.documentElement["client"+q]:v.body["client"+q]}})});
KISSY.add("dom-traversal",function(b,i){function p(k,f,x,z){if(!(k=b.get(k)))return null;if(f===i)f=1;var u=null,e,j;if(b.isNumber(f)&&f>=0){if(f===0)return k;e=0;j=f;f=function(){return++e===j}}for(;k=k[x];)if(m(k)&&(!f||h.test(k,f))&&(!z||z(k))){u=k;break}return u}function r(k,f,x){var z=[];var u=k=b.get(k);if(k&&x)u=k.parentNode;if(u){x=0;for(u=u.firstChild;u;u=u.nextSibling)if(m(u)&&u!==k&&(!f||h.test(u,f)))z[x++]=u}return z}var h=b.DOM,m=h._isElementNode;b.mix(h,{parent:function(k,f){return p(k,
f,"parentNode",function(x){return x.nodeType!=11})},next:function(k,f){return p(k,f,"nextSibling")},prev:function(k,f){return p(k,f,"previousSibling")},siblings:function(k,f){return r(k,f,true)},children:function(k,f){return r(k,f)},contains:function(k,f){var x=false;if((k=b.get(k))&&(f=b.get(f)))if(k.contains)return k.contains(f);else if(k.compareDocumentPosition)return!!(k.compareDocumentPosition(f)&16);else for(;!x&&(f=f.parentNode);)x=f==k;return x}})});
KISSY.add("dom-create",function(b,i){function p(v,y){j(v)&&b.isPlainObject(y)&&x.attr(v,y);return v}function r(v,y){var B=null,C;if(v&&(v.push||v.item)&&v[0]){y=y||v[0].ownerDocument;B=y.createDocumentFragment();if(v.item)v=b.makeArray(v);y=0;for(C=v.length;y<C;y++)B.appendChild(v[y])}return B}function h(v){var y=v.cloneNode(true);if(z.ie<8)y.innerHTML=v.innerHTML;return y}function m(v,y,B,C){if(B){var D=b.guid("ks-tmp-"),G=new RegExp(a);y+='<span id="'+D+'"></span>';b.available(D,function(){var E=
b.get("head"),F,M,I,H,N,J;for(G.lastIndex=0;F=G.exec(y);)if((I=(M=F[1])?M.match(n):false)&&I[2]){F=f.createElement("script");F.src=I[2];if((H=M.match(l))&&H[2])F.charset=H[2];F.async=true;E.appendChild(F)}else if((J=F[2])&&J.length>0)b.globalEval(J);(N=f.getElementById(D))&&x.remove(N);b.isFunction(C)&&C()});k(v,y)}else{k(v,y);b.isFunction(C)&&C()}}function k(v,y){y=(y+"").replace(a,"");try{v.innerHTML=y}catch(B){for(;v.firstChild;)v.removeChild(v.firstChild);y&&v.appendChild(x.create(y))}}var f=
document,x=b.DOM,z=b.UA,u=z.ie,e=x._nodeTypeIs,j=x._isElementNode,o=x._isKSNode,s=f.createElement("div"),d=/<(\w+)/,a=/<script([^>]*)>([\s\S]*?)<\/script>/ig,c=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/\ssrc=(['"])(.*?)\1/i,l=/\scharset=(['"])(.*?)\1/i;b.mix(x,{create:function(v,y,B){if(e(v,1)||e(v,3))return h(v);if(o(v))return h(v[0]);if(!(v=b.trim(v)))return null;var C=null;C=x._creators;var D,G="div",E;if(D=c.exec(v))C=(B||f).createElement(D[1]);else{if((D=d.exec(v))&&(E=D[1])&&b.isFunction(C[E=E.toLowerCase()]))G=
E;v=C[G](v,B).childNodes;C=v.length===1?v[0].parentNode.removeChild(v[0]):r(v,B||f)}return p(C,y)},_creators:{div:function(v,y){y=y?y.createElement("div"):s;y.innerHTML=v;return y}},html:function(v,y,B,C){if(y===i){v=b.get(v);if(j(v))return v.innerHTML}else b.each(b.query(v),function(D){j(D)&&m(D,y,B,C)})},remove:function(v){b.each(b.query(v),function(y){j(y)&&y.parentNode&&y.parentNode.removeChild(y)})}});if(z.gecko||u){var g=x._creators,t=x.create,q=/(?:\/(?:thead|tfoot|caption|col|colgroup)>)+\s*<tbody/,
w={option:"select",td:"tr",tr:"tbody",tbody:"table",col:"colgroup",legend:"fieldset"};for(var A in w)(function(v){g[A]=function(y,B){return t("<"+v+">"+y+"</"+v+">",null,B)}})(w[A]);if(u){g.script=function(v,y){y=y?y.createElement("div"):s;y.innerHTML="-"+v;y.removeChild(y.firstChild);return y};if(u<8)g.tbody=function(v,y){y=t("<table>"+v+"</table>",null,y);var B=y.children.tags("tbody")[0];y.children.length>1&&B&&!q.test(v)&&B.parentNode.removeChild(B);return y}}b.mix(g,{optgroup:g.option,th:g.td,
thead:g.tbody,tfoot:g.tbody,caption:g.tbody,colgroup:g.tbody})}});KISSY.add("dom-insertion",function(b){b.mix(b.DOM,{insertBefore:function(i,p){if((i=b.get(i))&&(p=b.get(p))&&p.parentNode)p.parentNode.insertBefore(i,p);return i},insertAfter:function(i,p){if((i=b.get(i))&&(p=b.get(p))&&p.parentNode)p.nextSibling?p.parentNode.insertBefore(i,p.nextSibling):p.parentNode.appendChild(i);return i}})});
KISSY.add("event",function(b,i){function p(d,a,c,n,l){if(b.isString(a))a=b.query(a);if(b.isArray(a)){b.each(a,function(g){s[d](g,c,n,l)});return true}if((c=b.trim(c))&&c.indexOf(e)>0){b.each(c.split(e),function(g){s[d](a,g,n,l)});return true}}function r(d){return k(d)?d[u]:-1}function h(d,a){if(!k(d))return b.error("Text or comment node is not valid event target.");try{d[u]=a}catch(c){b.error(c)}}function m(d){try{d[u]=i;delete d[u]}catch(a){}}function k(d){return d&&d.nodeType!==3&&d.nodeType!==
8}var f=document,x=f.addEventListener?function(d,a,c,n){d.addEventListener&&d.addEventListener(a,c,!!n)}:function(d,a,c){d.attachEvent&&d.attachEvent("on"+a,c)},z=f.removeEventListener?function(d,a,c,n){d.removeEventListener&&d.removeEventListener(a,c,!!n)}:function(d,a,c){d.detachEvent&&d.detachEvent("on"+a,c)},u="ksEventTargetId",e=" ",j=b.now(),o={},s={EVENT_GUID:u,special:{},add:function(d,a,c,n){if(!p("add",d,a,c,n)){var l=r(d),g,t,q,w,A;if(!(l===-1||!a||!b.isFunction(c))){if(!l){h(d,l=j++);
o[l]={target:d,events:{}}}t=o[l].events;if(!t[a]){g=((l=!d.isCustomEventTarget)||d._supportSpecialEvent)&&s.special[a]||{};q=function(v,y){if(!v||!v.fixed){v=new b.EventObject(d,v,a);b.isPlainObject(y)&&b.mix(v,y)}g.setup&&g.setup(v);return(g.handle||s._handle)(d,v,t[a].listeners)};t[a]={handle:q,listeners:[]};w=g.fix||a;A=g.capture;if(l)x(d,w,q,A);else d._addEvent&&d._addEvent(w,q,A)}t[a].listeners.push({fn:c,scope:n||d})}}},remove:function(d,a,c,n){if(!p("remove",d,a,c,n)){var l=r(d),g,t,q,w,A,
v,y;if(l!==-1)if(l&&(g=o[l]))if(g.target===d){n=n||d;g=g.events||{};if(t=g[a]){q=t.listeners;v=q.length;if(b.isFunction(c)&&v){A=w=0;for(y=[];w<v;++w)if(c!==q[w].fn||n!==q[w].scope)y[A++]=q[w];t.listeners=y;v=y.length}if(c===i||v===0){if(d.isCustomEventTarget)d._addEvent&&d._removeEvent(a,t.handle);else{c=s.special[a]||{};z(d,c.fix||a,t.handle)}delete g[a]}}if(a===i||b.isEmptyObject(g)){for(a in g)s.remove(d,a);delete o[l];m(d)}}}},_handle:function(d,a,c){c=c.slice(0);for(var n,l=0,g=c.length;l<g;++l){n=
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -