(
hub: Hub,
private root: JQuery,
private settings: SiteSettings,
private onChange: (siteSettings: SiteSettings) => void,
private subLangId: string | undefined,
)
| 217 | private defaultDelayAfterChange = 2000; |
| 218 | |
| 219 | constructor( |
| 220 | hub: Hub, |
| 221 | private root: JQuery, |
| 222 | private settings: SiteSettings, |
| 223 | private onChange: (siteSettings: SiteSettings) => void, |
| 224 | private subLangId: string | undefined, |
| 225 | ) { |
| 226 | this.eventHub = hub.createEventHub(); |
| 227 | this.settings = settings; |
| 228 | this.settingsObjs = []; |
| 229 | |
| 230 | this.addCheckboxes(); |
| 231 | this.addSelectors(); |
| 232 | this.addSliders(); |
| 233 | this.addNumerics(); |
| 234 | this.addTextBoxes(); |
| 235 | |
| 236 | // The color scheme dropdown needs to be populated otherwise the .val won't stick and it'll default |
| 237 | this.fillColourSchemeSelector(this.root.find('.colourScheme'), this.settings.theme); |
| 238 | this.setSettings(this.settings); |
| 239 | this.handleThemes(); |
| 240 | |
| 241 | this.eventHub.on('settingsChange', this.onSettingsChange.bind(this)); |
| 242 | } |
| 243 | |
| 244 | public static getStoredSettings(): SiteSettings { |
| 245 | return JSON.parse(localStorage.get('settings', '{}')); |
nothing calls this directly
no test coverage detected