Methods
(static) deepCopyAA(source) → {object}
Deep copy an associative array (for state tracking)
| Name | Type | Description |
|---|---|---|
source | object |
- Type:
- object
(static) deleteLibraryFromRegistry(libraryId) → {void}
Delete all settings for a library from registry
| Name | Type | Description |
|---|---|---|
libraryId | string |
- Type:
- void
(static) disableAutoSync() → {void}
Disable automatic syncing (optional, for cleanup or testing)
- 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
- Type:
- void
(static) init() → {void}
- 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
- Type:
- void
(static) onDisplaySettingsChanged() → {void}
Called when displaySettings field changes Only syncs the specific settings that changed, not the entire object
- 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
| Name | Type | Description |
|---|---|---|
event | object |
- Type:
- void
(static) syncChangedLibrarySettings(libraryId, oldSettings, newSettings) → {void}
Sync only changed settings for a library
| Name | Type | Description |
|---|---|---|
libraryId | string | |
oldSettings | object | |
newSettings | object |
- Type:
- void
(static) syncDisplaySettingsChanges(oldSettings, newSettings) → {void}
Sync only the display settings that changed
| Name | Type | Description |
|---|---|---|
oldSettings | object | |
newSettings | object |
- Type:
- void
(static) syncLibrarySettings(libraryId, settings) → {void}
Sync all settings for a library (new library case)
| Name | Type | Description |
|---|---|---|
libraryId | string | |
settings | object |
- Type:
- void