@@ -26,25 +26,24 @@ export function initCommitStatuses() {
2626 } ) ;
2727}
2828
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+ } ) ;
3332
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' ) ;
3635 let url = location . toString ( ) ;
3736
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 ) ;
4140 }
42- if ( url . includes ( "?" ) ) {
43- url += "&" ;
41+ if ( url . includes ( '?' ) ) {
42+ url += '&' ;
4443 } else {
45- url += "?" ;
44+ url += '?' ;
4645 }
4746
4847 url += `history_follow_rename=${ checked } ` ;
4948 window . location . href = url ;
50- } )
49+ } ) ;
0 commit comments