日期:2014-05-16  浏览次数:20467 次

新年里 把 自己写的 js基础代码 做个了结..... 死机了吧,悲剧了吧 ... 打不开了吧...编辑器bug出现了吧 ff不能黏贴,复制,换组织就不修正么?
新年里 把 自己写的 js基础代码 做个了结..... 死机了吧,悲剧了吧 ... 打不开了吧...编辑器bug出现了吧 ff不能黏贴,复制,换组织就不修正么?

?

?

var __doc=document,__undef="undefined",__proto="prototype";function $C(a){return __doc.createElement(a)}function $TagN(a){return __doc.getElementsByTagName(a)}function $N(a){return __doc.getElementsByName(a)}function $ID(a){return __doc.getElementById(a)}function loadscript(b){var a=$C("script");a.type="text/javascript";a.src=b;$TagN("head")[0].appendChild(a)}function loadcss(b){var a=$C("link");a.rel="stylesheet";a.type="text/css";a.href=b;$TagN("head")[0].appendChild(s)}function $clsN(g,h){var b=[];var f=new RegExp("(^| )"+h+"( |$)");var e=g.getElementsByTagName("*");for(var d=0,c=e.length;d<c;d++){if(e[d]&&(e[d].nodeType==1)&&(f.test(e[d].className))){b.push(e[d])}}return b}(function(){if(typeof Moogens==__undef){Moogens={meta:{author:"kenxu",version:"0.01"}}}if(typeof console==__undef){console={log:function(){}}}if(typeof Object.create!=="function"){Object.create=function(c){function b(){}b[__proto]=c;return new b()}}Object.extend=function(b,d){for(var c in d){b[c]=d[c]}return b};Object.extend(String[__proto],{trim:function(){return this.replace(/^\s+|\s+$/g,"")},nocamelize:function(b){return this.replace(/(?=[A-Z])/g,b||"-").toLowerCase()},camelize:function(){return this.replace(/-([a-z])/g,function(c,b){return b.toUpperCase()})}});Function[__proto].bind=function(c){var b=this;return function(){return b.apply(c,arguments)}};Moogens.Class={create:function(){return function(){this.initialize.apply(this,arguments)}}};Moogens.Utilities={arrayMap:function(f,d){var e=[];for(var c=0;c<f.length;c++){var b=d(f[c],c);if(b!==null){e.push(b)}}return e},each:function(d,c){if(d&&d.length){for(var b=0;b<d.length;b++){if(c.call(d[b],b)=="#end#"){break}}}},toArray:function(d){if(typeof d==__undef){return[]}if(Object[__proto].toString.call(d)==="[object Array]"){return d}var c=[];if(typeof d.length!=__undef){for(var b=0;b<d.length;b++){c.push(d[b])}}else{c.push(d)}return c}};Moogens.Browser=new function(){var c={webkit:/(webkit)[ \/]([\w.]+)/,opera:/(opera)(?:.*version)?[ \/]([\w.]+)/,msie:/(msie) ([\w.]+)/,mozilla:/(mozilla)(?:.*? rv:([\w.]+))?/};this.userAgent=navigator.userAgent;this.uaMatch=function(e){e=e.toLowerCase();var d=c.webkit.exec(e)||c.opera.exec(e)||c.msie.exec(e)||e.indexOf("compatible")<0&&c.mozilla.exec(e)||[];return{browser:d[1]||"",version:d[2]||"0"}};var b=this.uaMatch(this.userAgent);this[b.browser]=true;this.version=b.version;if(this.webkit){this.safari=true}c=null};Moogens.Cookie=new function(){this.get=function(c){var b=document.cookie.match(new RegExp("(^| )"+c+"=([^;]*)(;|$)"));if(b!=null){return decodeURIComponent(b[2])}return null};this.set=function(f,i,g,e,j,d){var h=f+"="+encodeURIComponent(i);if(g){var c=new Date();var b=g*3600*1000;c.setTime(c.getTime()+b);h+=";expires="+c.toGMTString()}if(e){h+=";path="+e}if(j){h+=";domain="+j}if(d){h+=";secure"}document.cookie=h};this.clear=function(e,c,b,d){this.set(e,"",0,c,b,d)}};Moogens.Dom={onReady:function(f,b){var e,g;var d=function(h){if(h&&h.type=="DOMContentLoaded"){c()}else{if(h&&h.type=="load"){c()}else{if(__doc.readyState){if((/loaded|complete/).test(__doc.readyState)){c()}else{if(!!__doc.documentElement.doScroll){try{e||__doc.documentElement.doScroll("left")}catch(h){return}c()}}}}}};var c=function(){if(!e){e=true;f.call(b||window);if(__doc.removeEventListener){__doc.removeEventListener("DOMContentLoaded",d,false)}__doc.onreadystatechange=null;window.onload=null;clearInterval(g);g=null}};if(__doc.addEventListener){__doc.addEventListener("DOMContentLoaded",d,false)}__doc.onreadystatechange=d;g=setInterval(d,5);window.onload=d}};var a=(function(){var t=/(?:[\w\-\\.#]+)+(?:\[\w+?=([\'"])?(?:\\\1|.)+?\1\])?|\*|>/ig,n=/^(?:[\w\-_]+)?\.([\w\-_]+)/,o=/^(?:[\w\-_]+)?#([\w\-_]+)/