MCPcopy
hub / github.com/compiler-explorer/compiler-explorer / constructor

Method constructor

static/settings.ts:219–242  ·  view source on GitHub ↗
(
        hub: Hub,
        private root: JQuery,
        private settings: SiteSettings,
        private onChange: (siteSettings: SiteSettings) => void,
        private subLangId: string | undefined,
    )

Source from the content-addressed store, hash-verified

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', '{}'));

Callers

nothing calls this directly

Calls 11

addCheckboxesMethod · 0.95
addSelectorsMethod · 0.95
addSlidersMethod · 0.95
addNumericsMethod · 0.95
addTextBoxesMethod · 0.95
setSettingsMethod · 0.95
handleThemesMethod · 0.95
createEventHubMethod · 0.80
findMethod · 0.80
onMethod · 0.45

Tested by

no test coverage detected