@@ -26,25 +26,24 @@ export function initCommitStatuses() {
26
26
} ) ;
27
27
}
28
28
29
- window . addEventListener ( "DOMContentLoaded" , function ( ) {
30
- console . log ( "hello" ) ;
31
- $ ( "input[name=history-enable-follow-renames]" ) . prop ( "checked" , location . toString ( ) . includes ( "history_follow_rename=true" ) )
32
- } )
29
+ window . addEventListener ( 'DOMContentLoaded' , ( ) => {
30
+ ( $ ( 'input[name=history-enable-follow-renames]' ) [ 0 ] as HTMLInputElement ) . checked = location . toString ( ) . includes ( 'history_follow_rename=true' ) ;
31
+ } ) ;
33
32
34
- $ ( " input[name=history-enable-follow-renames]" ) . on ( " change" , function ( ) {
35
- const checked = $ ( this ) . is ( " :checked" ) ;
33
+ $ ( ' input[name=history-enable-follow-renames]' ) . on ( ' change' , function ( ) {
34
+ const checked = ( $ ( this ) [ 0 ] as HTMLInputElement ) . matches ( ' :checked' ) ;
36
35
let url = location . toString ( ) ;
37
36
38
- url = url . replaceAll ( / h i s t o r y _ f o l l o w _ r e n a m e = ( t r u e | f a l s e ) & * / g, "" ) ;
39
- if ( url . slice ( - 1 ) === '?' ) {
40
- url = url . slice ( 0 , url . length - 1 ) ;
37
+ url = url . replaceAll ( / h i s t o r y _ f o l l o w _ r e n a m e = ( t r u e | f a l s e ) & * / g, '' ) ;
38
+ if ( url . endsWith ( '?' ) ) {
39
+ url = url . slice ( 0 , - 1 ) ;
41
40
}
42
- if ( url . includes ( "?" ) ) {
43
- url += "&" ;
41
+ if ( url . includes ( '?' ) ) {
42
+ url += '&' ;
44
43
} else {
45
- url += "?" ;
44
+ url += '?' ;
46
45
}
47
46
48
47
url += `history_follow_rename=${ checked } ` ;
49
48
window . location . href = url ;
50
- } )
49
+ } ) ;
0 commit comments