Methods

(static) deepCopyAA(source) → {object}

Deep copy an associative array (for state tracking)

Parameters:
NameTypeDescription
sourceobject
Returns:
Type: 
object

(static) deleteLibraryFromRegistry(libraryId) → {void}

Delete all settings for a library from registry

Parameters:
NameTypeDescription
libraryIdstring
Returns:
Type: 
void

(static) disableAutoSync() → {void}

Disable automatic syncing (optional, for cleanup or testing)

Returns:
Type: 
void

(static) enableAutoSync() → {void}

Enable automatic syncing of settings changes to registry Call this AFTER loading initial settings from registry/server This starts field observers that write changes back to registry

Returns:
Type: 
void

(static) init() → {void}

Returns:
Type: 
void

(static) observeAllSettings() → {void}

Dynamically set up observers for all user setting fields This automatically handles new fields added to the XML without code changes

Returns:
Type: 
void

(static) onDisplaySettingsChanged() → {void}

Called when displaySettings field changes Only syncs the specific settings that changed, not the entire object

Returns:
Type: 
void

(static) onSettingChanged(event) → {void}

Called when any individual setting field changes Observer is the single source of truth for registry sync IMPORTANT: Only syncs to registry - does NOT modify the node (prevents recursion)

DESIGN: Always save settings to registry, never delete This preserves user intent - if user explicitly sets a value to match the default, that's different from "never touched this setting". This is important for:

  • Future multi-device sync
  • Understanding what users have customized
  • "Reset all settings" feature can delete entire registry section
Parameters:
NameTypeDescription
eventobject
Returns:
Type: 
void

(static) syncChangedLibrarySettings(libraryId, oldSettings, newSettings) → {void}

Sync only changed settings for a library

Parameters:
NameTypeDescription
libraryIdstring
oldSettingsobject
newSettingsobject
Returns:
Type: 
void

(static) syncDisplaySettingsChanges(oldSettings, newSettings) → {void}

Sync only the display settings that changed

Parameters:
NameTypeDescription
oldSettingsobject
newSettingsobject
Returns:
Type: 
void

(static) syncLibrarySettings(libraryId, settings) → {void}

Sync all settings for a library (new library case)

Parameters:
NameTypeDescription
libraryIdstring
settingsobject
Returns:
Type: 
void