File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -290,17 +290,18 @@ function updateTime() {
290290uptime ( ) ;
291291updateTime ( ) ;
292292// 降低改值,可以减少cpu占用
293- setInterval ( uptime , 1000 ) ;
294- setInterval ( updateTime , 1000 ) ;
293+ setInterval ( uptime , 2000 ) ;
294+ setInterval ( updateTime , 2000 ) ;
295295
296296// styleswitcher.js
297- function setActiveStyleSheet ( title , cookie = false ) {
298- Array . from ( document . getElementsByTagName ( "link" ) ) . forEach ( a => {
299- if ( a . getAttribute ( "rel" ) . includes ( "style" ) && a . getAttribute ( "title" ) ) {
300- a . disabled = a . getAttribute ( "title" ) !== title ;
297+ function setActiveStyleSheet ( title ) {
298+ var i , a , main ;
299+ for ( i = 0 ; ( a = document . getElementsByTagName ( "link" ) [ i ] ) ; i ++ ) {
300+ if ( a . getAttribute ( "rel" ) . indexOf ( "stylesheet" ) != - 1 && a . getAttribute ( "title" ) ) {
301+ a . disabled = true ;
302+ if ( a . getAttribute ( "title" ) == title ) a . disabled = false ;
301303 }
302- } ) ;
303- if ( cookie ) createCookie ( "style" , title , 365 ) ;
304+ }
304305}
305306
306307function getActiveStyleSheet ( ) {
You can’t perform that action at this time.
0 commit comments