@ -627,6 +627,8 @@ export class settingsList {
private _saveNoRestart = document . getElementById ( "settings-apply-no-restart" ) as HTMLSpanElement ;
private _saveNoRestart = document . getElementById ( "settings-apply-no-restart" ) as HTMLSpanElement ;
private _saveRestart = document . getElementById ( "settings-apply-restart" ) as HTMLSpanElement ;
private _saveRestart = document . getElementById ( "settings-apply-restart" ) as HTMLSpanElement ;
private _loader = document . getElementById ( "settings-loader" ) as HTMLDivElement ;
private _panel = document . getElementById ( "settings-panel" ) as HTMLDivElement ;
private _panel = document . getElementById ( "settings-panel" ) as HTMLDivElement ;
private _sidebar = document . getElementById ( "settings-sidebar" ) as HTMLDivElement ;
private _sidebar = document . getElementById ( "settings-sidebar" ) as HTMLDivElement ;
private _visibleSection : string ;
private _visibleSection : string ;
@ -650,7 +652,7 @@ export class settingsList {
this . _sections [ name ] = section ;
this . _sections [ name ] = section ;
this . _panel . appendChild ( this . _sections [ name ] . asElement ( ) ) ;
this . _panel . appendChild ( this . _sections [ name ] . asElement ( ) ) ;
const button = document . createElement ( "span" ) as HTMLSpanElement ;
const button = document . createElement ( "span" ) as HTMLSpanElement ;
button . classList . add ( "button" , "~neutral" , "@low" , "settings-section-button" , "justify-between" , "mb-2" );
button . classList . add ( "button" , "~neutral" , "@low" , "settings-section-button" , "justify-between" );
button . textContent = s . meta . name ;
button . textContent = s . meta . name ;
if ( subButton ) { button . appendChild ( subButton ) ; }
if ( subButton ) { button . appendChild ( subButton ) ; }
button . onclick = ( ) = > { this . _showPanel ( name ) ; } ;
button . onclick = ( ) = > { this . _showPanel ( name ) ; } ;
@ -905,7 +907,12 @@ export class settingsList {
window . modals . matrix . show ( ) ;
window . modals . matrix . show ( ) ;
}
}
reload = ( ) = > _get ( "/config" , null , ( req : XMLHttpRequest ) = > {
reload = ( ) = > {
for ( let i = 0 ; i < this . _loader . children . length ; i ++ ) {
this . _loader . children [ i ] . classList . add ( "invisible" ) ;
}
addLoader ( this . _loader , false , true ) ;
_get ( "/config" , null , ( req : XMLHttpRequest ) = > {
if ( req . readyState == 4 ) {
if ( req . readyState == 4 ) {
if ( req . status != 200 ) {
if ( req . status != 200 ) {
window . notifications . customError ( "settingsLoadError" , window . lang . notif ( "errorLoadSettings" ) ) ;
window . notifications . customError ( "settingsLoadError" , window . lang . notif ( "errorLoadSettings" ) ) ;
@ -955,6 +962,10 @@ export class settingsList {
}
}
}
}
}
}
removeLoader ( this . _loader ) ;
for ( let i = 0 ; i < this . _loader . children . length ; i ++ ) {
this . _loader . children [ i ] . classList . remove ( "invisible" ) ;
}
this . _showPanel ( this . _settings . order [ 0 ] ) ;
this . _showPanel ( this . _settings . order [ 0 ] ) ;
document . dispatchEvent ( new CustomEvent ( "settings-loaded" ) ) ;
document . dispatchEvent ( new CustomEvent ( "settings-loaded" ) ) ;
document . dispatchEvent ( new CustomEvent ( "settings-advancedState" , { detail : false } ) ) ;
document . dispatchEvent ( new CustomEvent ( "settings-advancedState" , { detail : false } ) ) ;
@ -962,6 +973,7 @@ export class settingsList {
this . _needsRestart = false ;
this . _needsRestart = false ;
}
}
} )
} )
} ;
// FIXME: Search "About" & "User profiles", pseudo-search "User profiles" for things like "Ombi", "Referrals", etc.
// FIXME: Search "About" & "User profiles", pseudo-search "User profiles" for things like "Ombi", "Referrals", etc.
search = ( query : string ) = > {
search = ( query : string ) = > {