⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 util.js

📁 google gdata API 很好用的API
💻 JS
📖 第 1 页 / 共 3 页
字号:
Function.prototype.bind=function(a){if(typeof this!="function"){throw new Error("Bind must be called as a method of a function object.");}var b=this;var c=Array.prototype.splice.call(arguments,1,arguments.length);return function(){var d=c.concat();for(var e=0;e<arguments.length;e++){d.push(arguments[e])}return b.apply(a,d)}};var Ta;var Ya;(function(){var a={};var b=0;function c(f){if(!f.Da){f.Da=++b}return f.Da}function d(f,h,l,n){var k=c(f);var q=c(l);n=!(!n);var s=k+"_"+h+"_"+q+"_"+n;return s}Ta=function(f,h,l,n){var k=d(f,h,l,n);if(k in a){return k}var q=e.bind(null,k);a[k]={listener:l,proxy:q};if(f.addEventListener){f.addEventListener(h,q,n)}else if(f.attachEvent){f.attachEvent("on"+h,q)}else{throw new Error("Node {"+f+"} does not support event listeners.");}return k};Ya=function(f,h,l,n){var k=d(f,h,l,n);if(!(k in a)){return false}var q=a[k].proxy;if(f.removeEventListener){f.removeEventListener(h,q,n)}else if(f.detachEvent){f.detachEvent("on"+h,q)}delete a[k];return true};function e(f){var h=Array.prototype.splice.call(arguments,1,arguments.length);return a[f].listener.apply(null,h)}})();var oa=["Su","M","Tu","W","Th","F","Sa"];var Z=[,"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];var aa=[,"January","February","March","April","May","June","July","August","September","October","November","December"];var Aa;var Qa;var Ba;var Ca;var W;var Sa;var Ra;(function(){var a=navigator.userAgent.toLowerCase();Aa=a.indexOf("msie")!=-1;Qa=a.indexOf("msie 5")!=-1&&document.all;Ba=a.indexOf("konqueror")!=-1;Ca=a.indexOf("safari")!=-1||Ba;W=!Aa&&!Ca&&a.indexOf("mozilla")!=-1;Sa=a.indexOf("win")!=-1;Ra=!(!window.opera)})();function na(a,b){};function ca(a){if(!a)return"";return a.replace(/&#(\d+);/g,function(b,c){return String.fromCharCode(parseInt(c,10))}).replace(/&#x([a-f0-9]+);/gi,function(b,c){return String.fromCharCode(parseInt(c,16))}).replace(/&(\w+);/g,function(b,c){c=c.toLowerCase();return c in ca.unesc?ca.unesc[c]:"?"})}ca.unesc={lt:"<",gt:">",quot:'"',nbsp:" ",amp:"&"};function Y(a){return Y.Ba[a]}function ma(a){if(!Y.Ba){var b={};b["\\"]="\\\\";b["'"]="\\047";b["\u0008"]="\\b";b['"']="\\042";b["<"]="\\074";b[">"]="\\076";b["&"]="\\046";b["\n"]="\\n";b["\r"]="\\r";b["\u0085"]="\\205";b["\u2028"]="\\u2028";b["\u2029"]="\\u2029";Y.Ba=b}return"'"+a.toString().replace(/[\'\\\r\n\b\"<>&\u0085\u2028\u2029]/g,Y)+"'"}function Ea(a){var b={};b.clientX=a.clientX;b.clientY=a.clientY;b.pageX=a.pageX;b.pageY=a.pageY;b.type=a.type;b.srcElement=a.srcElement;b.target=a.target;b.cancelBubble=a.cancelBubble;b.explicitOriginalTarget=a.explicitOriginalTarget;return b}function Oa(a){return document.getElementById(a)}function Pa(a){return document.all[a]}var z=document.getElementById?Oa:Pa;function ba(a){var b;if(!("name" in a)){var c=/\W*function\s+([\w\$]+)\(/.exec(a);if(!c){throw new Error("Cannot extract name from function: "+a);}b=c[1];a.name=b}else{b=a.name}if(!b||b=="anonymous"){throw new Error("Anonymous function has no name: "+a);}return a.name}function _showLogWindow(){}function N(a){return a<0?-1:1}function X(a){return a|0}function ta(a){DumpError(a);throw a;}function p(a,b){var c=a.toString();while(c.length<b){c="0"+c}return c}var ea=[undefined,31,undefined,31,30,31,30,31,31,30,31,30,31];function H(a,b){if(2!==b){return ea[b]}var c=a<<4;var d=ea[c];if(!d){d=Math.round((Date.UTC(a,2,1)-Date.UTC(a,1,1))/86400000);ea[c]=d}return d}var ua=new Object;function Ka(a,b){var c=a<<4|b;var d=ua[c];if(!d){d=(new Date(a,b-1,1,0,0,0,0)).getDay();ua[c]=d}return d}function fa(a){return(a.date-1+Ka(a.year,a.month))%7}function ra(a,b,c,d,e,f){var h;if(a===d){if((h=b-e)===0){return c-f}else if(h<0){h=c-f;do{h-=H(a,b++)}while(b<e);return h}else{h=c-f;do{h+=H(d,e++)}while(e<b);return h}}else{return Math.round((Date.UTC(a,b-1,c)-Date.UTC(d,e-1,f))/86400000)}}function sa(a,b){return ra(a.year,a.month,a.date,b.year,b.month,b.date)}function y(a,b,c,d,e,f){if(!isNaN(a)){this.year=a}if(!isNaN(b)){this.month=b}if(!isNaN(c)){this.date=c}if(!isNaN(d)){this.hour=d}if(!isNaN(e)){this.minute=e}if(!isNaN(f)){this.second=f}}y.prototype.year=NaN;y.prototype.month=NaN;y.prototype.date=NaN;y.prototype.hour=NaN;y.prototype.minute=NaN;y.prototype.second=NaN;y.prototype.Ya=function(){return fa(this)};y.prototype.toString=function(){if(this.l!==undefined)return this.l;this.l=this.D();return this.l};function K(){}K.prototype=new y;K.prototype.constructor=K;function j(a,b,c){y.call(this,a,b,c,NaN,NaN,NaN)}j.prototype=new K;j.prototype.constructor=j;j.now=function(){var a=new Date;return j.create(a.getFullYear(),a.getMonth()+1,a.getDate())};j.prototype.type="Date";j.prototype.i=function(){return this};j.prototype.P=function(){return new t(this.year,this.month,this.date,0,0,0)};j.prototype.a=function(){if(undefined===this.e){this.e=j.wa(this.year,this.month,this.date)}return this.e};j.wa=function(a,b,c){return this.e=(((a-1970)*12+b<<5)+c)*86400};j.prototype.da=function(){return true};j.prototype.D=function(){return p(this.year,4)+p(this.month,2)+p(this.date,2)};j.prototype.equals=function(a){return this.constructor===a.constructor&&this.date===a.date&&this.month===a.month&&this.year===a.year};j.V={};j.Ra=0;j.Ma=200;j.create=function(a,b,c){var d=j.wa(a,b,c);if(d in j.V){return j.V[d]}else{var e=new j(a,b,c);e.e=d;if(j.Ra<j.Ma){j.V[d]=e}return e}};function t(a,b,c,d,e,f){y.call(this,a,b,c,d,e,f)}t.prototype=new K;t.prototype.constructor=t;t.now=function(){var a=new Date;return new t(a.getFullYear(),a.getMonth()+1,a.getDate(),a.getHours(),a.getMinutes(),a.getSeconds())};t.prototype.type="DateTime";t.prototype.i=function(){return j.create(this.year,this.month,this.date)};t.prototype.P=function(){return this};t.prototype.La=function(){return new F(this.hour,this.minute,this.second)};t.prototype.a=function(){if(undefined===this.e){this.e=(((((this.year-1970)*12+this.month<<5)+this.date)*24+this.hour)*60+this.minute)*60+this.second}return this.e};t.prototype.da=function(){return true};t.prototype.D=function(){return p(this.year,4)+p(this.month,2)+p(this.date,2)+"T"+p(this.hour,2)+p(this.minute,2)+p(this.second,2)};t.prototype.equals=function(a){return this.constructor===a.constructor&&this.date===a.date&&this.month===a.month&&this.year===a.year&&this.hour===a.hour&&this.minute===a.minute&&this.second===a.second};t.prototype.clone=function(){var a=new t(this.year,this.month,this.date,this.hour,this.minute,this.second);if(this.l!==undefined)a.l=this.l;return a};function F(a,b,c){y.call(this,NaN,NaN,NaN,a,b,c)}F.prototype=new y;F.prototype.constructor=F;F.prototype.type="Time";F.prototype.La=function(){return this};F.prototype.D=function(){return"T"+p(this.hour,2)+p(this.minute,2)+p(this.second,2)};F.prototype.equals=function(a){return this.constructor===a.constructor&&this.hour===a.hour&&this.minute===a.minute&&this.second===a.second};F.prototype.a=function(){return(this.hour*60+this.minute)*60+this.second};function E(a,b,c,d){var e=d+60*(c+60*(b+24*a));var f=X(e/86400);e-=f*86400;var h=X(e/3600);e-=h*3600;var l=X(e/60);e-=l*60;var n=X(e);y.call(this,NaN,NaN,f,h,l,n)}E.prototype=new y;E.prototype.constructor=E;E.prototype.type="Duration";E.prototype.Wb=function(){return this.date};E.prototype.Xb=function(){return this.date*24+this.hour};E.prototype.Yb=function(){return 1440*this.date+this.hour*60+this.minute};E.prototype.Zb=function(){return this.second+this.minute*60+this.hour*3600+86400*this.date};E.prototype.a=function(){if(undefined===this.e){this.e=((this.date*24+this.hour)*60+this.minute)*60+this.second}return this.e};E.prototype.D=function(){var a=this.year?N(this.year):(this.month?N(this.month):(this.date?N(this.date):(this.hour?N(this.hour):(this.minute?N(this.minute):(this.second?N(this.second):0)))));var b=a<0?"-P":"P";if(this.year){b+=a*this.year+"Y"}if(this.month){b+=a*this.month+"N"}if(this.date){b+=this.date%7?a*this.date+"D":a*this.date/7+"W"}if(this.hour||this.minute||this.second){b+="T"}if(this.hour){b+=a*this.hour+"H"}if(this.minute){b+=a*this.minute+"M"}if(this.second){b+=a*this.second+"S"}if(!a){b+="0D"}return b};E.prototype.equals=function(a){return this.constructor===a.constructor&&this.date===a.date&&this.hour===a.hour&&this.minute===a.minute&&this.second===a.second};function Q(a){var b=new o;b.year=a.year||0;b.month=a.month||0;b.date=a.date||0;b.hour=a.hour||0;b.minute=a.minute||0;b.second=a.second||0;return b}function $(a,b,c){na(!(isNaN(a)|isNaN(b)|isNaN(c)));var d=new o;d.year=a||0;d.month=b||0;d.date=c||0;return d}function o(){}o.prototype=new y;o.prototype.constructor=o;o.prototype.type="DTBuilder";o.prototype.year=(o.prototype.month=(o.prototype.date=(o.prototype.hour=(o.prototype.minute=(o.prototype.second=0)))));o.prototype.a=function(){this.normalize()};o.prototype.advance=function(a){if(a.date){this.date+=a.date}if(a.hour){this.hour+=a.hour}if(a.minute){this.minute+=a.minute}if(a.second){this.second+=a.second}};o.prototype.normalize=function(){this.ib();this.ia();var a=H(this.year,this.month);while(this.date<1){this.month-=1;this.ia();a=H(this.year,this.month);this.date+=a}while(this.date>a){this.date-=a;this.month+=1;this.ia();a=H(this.year,this.month)}};o.prototype.ib=function(){var a;if(this.second<0){a=Math.ceil(this.second/-60);this.second+=60*a;this.minute-=a}else if(this.second>=60){a=Math.floor(this.second/60);this.second-=60*a;this.minute+=a}if(this.minute<0){a=Math.ceil(this.minute/-60);this.minute+=60*a;this.hour-=a}else if(this.minute>=60){a=Math.floor(this.minute/60);this.minute-=60*a;this.hour+=a}if(this.hour<0){a=Math.ceil(this.hour/-24);this.hour+=24*a;this.date-=a}else if(this.hour>=24){a=Math.floor(this.hour/24);this.hour-=24*a;this.date+=a}};o.prototype.ia=function(){var a;if(this.month<1){a=Math.ceil((this.month-1)/-12);this.month+=12*a;this.year-=a}else if(this.month>12){a=Math.floor((this.month-1)/12);this.month-=12*a;this.year+=a}};o.prototype.i=function(){this.normalize();return j.create(this.year,this.month,this.date)};o.prototype.P=function(){this.normalize();return new t(this.year,this.month,this.date,this.hour,this.minute,this.second)};o.prototype.Ja=function(){this.normalize();return new B(isFinite(this.year)?this.year:undefined,isFinite(this.month)?this.month:undefined,isFinite(this.date)?this.date:undefined)};o.prototype.Ka=function(){this.normalize();return new C(isFinite(this.year)?this.year:undefined,isFinite(this.month)?this.month:undefined,isFinite(this.date)?this.date:undefined,isFinite(this.hour)?this.hour:undefined,isFinite(this.minute)?this.minute:undefined,isFinite(this.second)?this.second:undefined)};o.prototype.La=function(){this.normalize();return new F(this.hour,this.minute,this.second)};o.prototype.rb=function(){if(this.year||this.month){ta("Can't convert months or years to ICAL_Duration");return undefined}else{return new E(this.date,this.hour,this.minute,this.second)}};o.prototype.sb=function(){return"number"==typeof this.year&&1+this.year%1===1&&"number"==typeof this.month&&1+this.month%1===1&&"number"==typeof this.date&&1+this.date%1===1};o.prototype.$b=function(){return this.sb()&&this.tb()};o.prototype.tb=function(){return"number"==typeof this.hour&&1+this.hour%1===1&&"number"==typeof this.minute&&1+this.minute%1===1&&"number"==typeof this.second&&1+this.second%1===1}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -