MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / callback

Function callback

src/settings/appSettings.js:357–522  ·  view source on GitHub ↗
(key, value)

Source from the content-addressed store, hash-verified

355 });
356
357 async function callback(key, value) {
358 switch (key) {
359 case "keybindings": {
360 value = await select(strings["key bindings"], [
361 ["edit", strings.edit],
362 ["reset", strings.reset],
363 ]);
364 if (!value) return;
365
366 if (value === "edit") {
367 actionStack.pop(2);
368 openFile(KEYBINDING_FILE);
369 } else {
370 resetKeyBindings();
371 }
372 return;
373 }
374
375 case "quickToolsSettings":
376 QuickToolsSettings();
377 return;
378
379 case "fontManager":
380 FontManager();
381 return;
382
383 case "appFont":
384 await fonts.setAppFont(value);
385 break;
386
387 case "console": {
388 if (value !== "eruda") {
389 break;
390 }
391
392 const fs = fsOperation(Url.join(DATA_STORAGE, "eruda.js"));
393 if (await fs.exists()) {
394 break;
395 }
396
397 loader.create(
398 strings["downloading file"].replace("{file}", "eruda.js"),
399 strings["downloading..."],
400 );
401 try {
402 const erudaScript = await fsOperation(config.ERUDA_CDN).readFile(
403 "utf-8",
404 );
405 await fsOperation(DATA_STORAGE).createFile("eruda.js", erudaScript);
406 loader.destroy();
407 } catch (error) {
408 helpers.error(error);
409 }
410 break;
411 }
412
413 case "developerMode": {
414 if (value) {

Callers

nothing calls this directly

Calls 15

resetKeyBindingsFunction · 0.90
QuickToolsSettingsFunction · 0.85
fsOperationFunction · 0.85
actionsFunction · 0.85
addMethod · 0.80
setInputTypeMethod · 0.80
selectFunction · 0.70
existsMethod · 0.65
createMethod · 0.65
createFileMethod · 0.65
deleteMethod · 0.65
execMethod · 0.65

Tested by

no test coverage detected