1 line
13 KiB
JavaScript
1 line
13 KiB
JavaScript
|
"function"!=typeof Object.create&&(Object.create=function(e){function t(){}return t.prototype=e,new t});var ua={toString:function(){return navigator.userAgent},test:function(e){return this.toString().toLowerCase().indexOf(e.toLowerCase())>-1}};ua.version=(ua.toString().toLowerCase().match(/[\s\S]+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1],ua.webkit=ua.test("webkit"),ua.gecko=ua.test("gecko")&&!ua.webkit,ua.opera=ua.test("opera"),ua.ie=ua.test("msie")&&!ua.opera,ua.ie6=ua.ie&&document.compatMode&&"undefined"==typeof document.documentElement.style.maxHeight,ua.ie7=ua.ie&&document.documentElement&&"undefined"!=typeof document.documentElement.style.maxHeight&&"undefined"==typeof XDomainRequest,ua.ie8=ua.ie&&"undefined"!=typeof XDomainRequest;var domReady=function(){var e=[],t=function(){if(!arguments.callee.done){arguments.callee.done=!0;for(var t=0;t<e.length;t++)e[t]()}};return document.addEventListener&&document.addEventListener("DOMContentLoaded",t,!1),ua.ie&&(function(){try{document.documentElement.doScroll("left")}catch(e){return setTimeout(arguments.callee,50),void 0}t()}(),document.onreadystatechange=function(){"complete"===document.readyState&&(document.onreadystatechange=null,t())}),ua.webkit&&document.readyState&&function(){"loading"!==document.readyState?t():setTimeout(arguments.callee,10)}(),window.onload=t,function(t){return"function"==typeof t&&(e[e.length]=t),t}}(),cssHelper=function(){var e,t={BLOCKS:/[^\s{][^{]*\{(?:[^{}]*\{[^{}]*\}[^{}]*|[^{}]*)*\}/g,BLOCKS_INSIDE:/[^\s{][^{]*\{[^{}]*\}/g,DECLARATIONS:/[a-zA-Z\-]+[^;]*:[^;]+;/g,RELATIVE_URLS:/url\(['"]?([^\/\)'"][^:\)'"]+)['"]?\)/g,REDUNDANT_COMPONENTS:/(?:\/\*([^*\\\\]|\*(?!\/))+\*\/|@import[^;]+;)/g,REDUNDANT_WHITESPACE:/\s*(,|:|;|\{|\})\s*/g,MORE_WHITESPACE:/\s{2,}/g,FINAL_SEMICOLONS:/;\}/g,NOT_WHITESPACE:/\S+/g},n=!1,r=[],i=function(e){"function"==typeof e&&(r[r.length]=e)},o=function(){for(var t=0;t<r.length;t++)r[t](e)},s={},u=function(e,t){if(s[e]){var n=s[e].listeners;if(n)for(var r=0;r<n.length;r++)n[r](t)}},a=function(e,t,n){if(ua.ie&&!window.XMLHttpRequest&&(window.XMLHttpRequest=function(){return new ActiveXObject("Microsoft.XMLHTTP")}),!XMLHttpRequest)return"";var r=new XMLHttpRequest;try{r.open("get",e,!0),r.setRequestHeader("X_REQUESTED_WITH","XMLHttpRequest")}catch(i){return n(),void 0}var o=!1;setTimeout(function(){o=!0},5e3),document.documentElement.style.cursor="progress",r.onreadystatechange=function(){4!==r.readyState||o||(!r.status&&"file:"===location.protocol||r.status>=200&&r.status<300||304===r.status||navigator.userAgent.indexOf("Safari")>-1&&"undefined"==typeof r.status?t(r.responseText):n(),document.documentElement.style.cursor="",r=null)},r.send("")},l=function(e){return e=e.replace(t.REDUNDANT_COMPONENTS,""),e=e.replace(t.REDUNDANT_WHITESPACE,"$1"),e=e.replace(t.MORE_WHITESPACE," "),e=e.replace(t.FINAL_SEMICOLONS,"}")},c={mediaQueryList:function(e){var n={},r=e.indexOf("{"),i=e.substring(0,r);e=e.substring(r+1,e.length-1);for(var o=[],s=[],u=i.toLowerCase().substring(7).split(","),a=0;a<u.length;a++)o[o.length]=c.mediaQuery(u[a],n);var l=e.match(t.BLOCKS_INSIDE);if(null!==l)for(a=0;a<l.length;a++)s[s.length]=c.rule(l[a],n);return n.getMediaQueries=function(){return o},n.getRules=function(){return s},n.getListText=function(){return i},n.getCssText=function(){return e},n},mediaQuery:function(e,n){e=e||"";for(var r,i=!1,o=[],s=!0,u=e.match(t.NOT_WHITESPACE),a=0;a<u.length;a++){var l=u[a];if(r||"not"!==l&&"only"!==l)if(r){if("("===l.charAt(0)){var c=l.substring(1,l.length-1).split(":");o[o.length]={mediaFeature:c[0],value:c[1]||null}}}else r=l;else"not"===l&&(i=!0)}return{getList:function(){return n||null},getValid:function(){return s},getNot:function(){return i},getMediaType:function(){return r},getExpressions:function(){return o}}},rule:function(e,t){for(var n={},r=e.indexOf("{"),i=e.substring(0,r),o=i.split(","),s=[],u=e.substring(r+1,e.length-1).split(";"),a=0;a<u.length;a++)s[s.length]=c.declaration(u[a],n);return n.getMediaQueryList=function(){return t||null},n.getSelectors=function(){return o},n.getSelectorText=function(){ret
|