1/** 2 * @description æ¾ç¤ºå½åæ¶é´ 3 * @param {String} o htmlå®¹å¨ 4 * @param {String} type æ¶é´ç±»å 5 * @return {Null} null null 6 */ 7function showTime(o,type){ 8 var time=setInterval( 9 function(){ 10 var d=new Date(); 11 var weekday=new Array(7); 12 weekday[0]="æææ¥"; 13 weekday[1]="ææä¸"; 14 weekday[2]="ææäº"; 15 weekday[3]="ææä¸"; 16 weekday[4]="ææå"; 17 weekday[5]="ææäº"; 18 weekday[6]="ææå "; 19 var year=testLen(d.getFullYear()) ,month=testLen(d.getMonth()+1) ,day=testLen(d.getDate()) ,hours=testLen(d.getHours()) , 20 minutes=testLen(d.getMinutes()),seconds=testLen(d.getSeconds()),milliseconds=testLen(d.getMilliseconds()); 21 if(type=='short'){ 22 $(o).html(title+ year +'å¹´'+ month +'æ'+ day +'æ¥'); 23 }else if(type=='normal'){ 24 $(o).html( year +'å¹´'+ month +'æ'+ day +'æ¥'+' '+weekday[d.getDay()]); 25 }else{ 26 $(o).html(title+ year +'å¹´'+ month +'æ'+ day +'æ¥'+' '+weekday[d.getDay()]+' '+ hours +' : '+ minutes+' : '+ seconds); 27 } 28 } 29 ,1000 30 ); 31 function testLen(s){ 32 return (s.toString().length)<2?('0'+s):s; 33 } 34} 35 36/** 37 * @description è·åCookie 38 * @param {String} name Cookieåç§° 39 * @return {String} Result è¿åCookieå¼ 40 */ 41function getCookie( name ) { 42 var start = document.cookie.indexOf( name + "=" ); 43 var len = start + name.length + 1; 44 if ( ( !start ) && ( name != document.cookie.substring( 0, name.length ) ) ) { 45 return null; 46 } 47 if ( start == -1 ) return null; 48 var end = document.cookie.indexOf( ";", len ); 49 if ( end == -1 ) end = document.cookie.length; 50 return unescape( document.cookie.substring( len, end ) ); 51} 52/** 53 * @description 设置Cookie 54 * @param {String} name Cookieåç§° 55 * @param {String} value Cookieå¼ 56 * @param {Number} expires çå卿 57 * @param {String} path Cookieå°å 58 * @param {String} domain Cookieå 59 * @param {Boolen} secure Cookieå®å ¨éå¶ 60 * @return {Null} null null 61 */ 62function setCookie( name, value, expires, path, domain, secure ) { 63 var today = new Date(); 64 today.setTime( today.getTime() ); 65 if ( expires ) { 66 expires = expires * 1000 * 60 * 60 * 24; 67 } 68 var expires_date = new Date( today.getTime() + (expires) ); 69 document.cookie = name+"="+escape( value ) + 70 ( ( expires ) ? ";expires="+expires_date.toGMTString() : "" ) + 71 ( ( path ) ? ";path=" + path : "" ) + 72 ( ( domain ) ? ";domain=" + domain : "" ) + 73 ( ( secure ) ? ";secure" : "" ); 74} 75/** 76 * @description å é¤Cookie 77 * @param {String} name Cookieåç§° 78 * @param {String} path Cookieå°å 79 * @param {String} domain Cookieå 80 * @return {Null} null null 81 */ 82function deleteCookie( name, path, domain ) { 83 if ( getCookie( name ) ) document.cookie = name + "=" + 84 ( ( path ) ? ";path=" + path : "") + 85 ( ( domain ) ? ";domain=" + domain : "" ) + 86 ";expires=Thu, 01-Jan-1970 00:00:01 GMT"; 87} 88 89/** 90 * @description è·åæå®çjsåæ° 91 * @param {String} name æå®çjsåç§° 92 * @return {Array} result åæ°å¼çæ°ç» 93 */ 94function getJsSrc(name,paras){ 95 var scripts=document.getElementsByTagName('script'),i,n,slen=scripts.length,plen=paras.length,returns=[]; 96 for(i=0;i<slen;i++){ 97 var src=scripts[i].src; 98 if(src.indexOf(name)>-1){ 99 for(n=0;n<plen;n++){ 100 returns.push(src.getjsparas(paras[n])) 101 } 102 return returns; 103 } 104 } 105} 106 107/** 108 * @description è·å*.js?åçåæ° 109 * @param {String} name åæ°åç§° 110 * @return {String} result åæ°å¼ 111 */ 112String.prototype.getjsparas=function (name){ 113 var paraString = this.substring(this.indexOf("?")+1,this.length).split("&"); 114 var paraObj = {} 115 for (i=0; j=paraString[i]; i++){ 116 paraObj[j.substring(0,j.indexOf("=")).toLowerCase()] = j.substring(j.indexOf("=")+1,j.length); 117 } 118 var returnValue = paraObj[name.toLowerCase()]; 119 if(typeof(returnValue)=="undefined"){ 120 return ""; 121 }else{ 122 return returnValue; 123 } 124} 125 126/** 127 * @description å å ¥æ¶è 128 * @param {Null} 129 * @return {Null} null null 130 */ 131function saveHomepage() 132{ 133 if (document.all) 134 { 135 window.external.addFavorite(document.location.href,document.title) 136 } 137 else if (window.sidebar) 138 {
139 window.sidebar.addPanel(document.title, document.location.href, ""); 140 } 141} 142 143/** 144 * @description 设置为é¦é¡µ 145 * @param {Null} 146 * @return {Null} null null 147 */ 148function setHomepage() 149{ 150 if (document.all) 151 { 152 document.body.style.behavior='url(#default#homepage)'; 153 document.body.setHomePage(document.location.host); 154 155 } 156 else if (window.sidebar) 157 { 158 if(window.netscape) 159 { 160 try 161 { 162 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); 163 } 164 catch (e) 165 { 166 alert( "该æä½è¢«æµè§å¨æç»ï¼å¦ææ³å¯ç¨è¯¥åè½ï¼è¯·å¨å°åæ å è¾å ¥ about:config,ç¶åå°é¡¹ signed.applets.codebase_principal_support å¼è¯¥ä¸ºtrue" ); 167 } 168 } 169 var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components. interfaces.nsIPrefBranch); 170 prefs.setCharPref('browser.startup.homepage',document.location.host); 171 } 172} 173/** 174 * @description 设置å¾çæé®åæ¢ææ 175 * @param {String} key å ç´ é©å 176 * @return {Null} null null 177 */ 178function bindImgButtonEvents(key){ 179 $(key).each(function(){ 180 var src=$(this).attr('src'); 181 $(this).data('p',src.replace(src.split('/')[src.split('/').length-1],'')).data('i',src.split('/')[src.split('/').length-1]); 182 $(this).hover(function(){ 183 $(this).attr('src',$(this).data('p')+'o.'+$(this).data('i')); 184 },function(){ 185 $(this).attr('src',$(this).data('p')+$(this).data('i')); 186 }); 187 }); 188}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.