File tree 1 file changed +9
-8
lines changed
1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -290,17 +290,18 @@ function updateTime() {
290
290
uptime ( ) ;
291
291
updateTime ( ) ;
292
292
// 降低改值,可以减少cpu占用
293
- setInterval ( uptime , 1000 ) ;
294
- setInterval ( updateTime , 1000 ) ;
293
+ setInterval ( uptime , 2000 ) ;
294
+ setInterval ( updateTime , 2000 ) ;
295
295
296
296
// 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 ;
301
303
}
302
- } ) ;
303
- if ( cookie ) createCookie ( "style" , title , 365 ) ;
304
+ }
304
305
}
305
306
306
307
function getActiveStyleSheet ( ) {
You can’t perform that action at this time.
0 commit comments