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

Method initCallbacks

static/panes/executor.ts:964–1036  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

962 }
963
964 initCallbacks(): void {
965 this.initListeners();
966
967 const optionsChange = _.debounce(e => {
968 this.onOptionsChange($(e.target).val() as string);
969 }, 800);
970
971 const execArgsChange = _.debounce(e => {
972 this.onExecArgsChange($(e.target).val() as string);
973 }, 800);
974
975 const execStdinChange = _.debounce(e => {
976 this.onExecStdinChange($(e.target).val() as string);
977 }, 800);
978
979 this.optionsField.on('change', optionsChange).on('keyup', optionsChange);
980
981 this.execArgsField.on('change', execArgsChange).on('keyup', execArgsChange);
982
983 this.execStdinField.on('change', execStdinChange).on('keyup', execStdinChange);
984
985 // Dismiss the popover on escape.
986 $(document).on('keyup.editable', e => {
987 if (e.which === 27) {
988 const popover = BootstrapUtils.getPopoverInstance(this.libsButton);
989 if (popover) popover.hide();
990 }
991 });
992
993 this.toggleCompilation.on('click', () => {
994 this.togglePanel(this.toggleCompilation, this.panelCompilation);
995 });
996
997 this.toggleArgs.on('click', () => {
998 this.togglePanel(this.toggleArgs, this.panelArgs);
999 });
1000
1001 this.toggleStdin.on('click', () => {
1002 this.togglePanel(this.toggleStdin, this.panelStdin);
1003 });
1004
1005 this.toggleCompilerOut.on('click', () => {
1006 this.togglePanel(this.toggleCompilerOut, this.compilerOutputSection);
1007 });
1008
1009 this.rerunButton.on('click', () => {
1010 this.compile(BypassCache.Execution);
1011 });
1012
1013 this.compileClearCache.on('click', () => {
1014 this.compile(BypassCache.Compilation);
1015 });
1016
1017 // Dismiss on any click that isn't either in the opening element, inside
1018 // the popover or on any alert
1019 $(document).on('click', e => {
1020 const elem = this.libsButton;
1021 const target = $(e.target);

Callers 1

constructorMethod · 0.95

Calls 9

initListenersMethod · 0.95
onOptionsChangeMethod · 0.95
onExecArgsChangeMethod · 0.95
onExecStdinChangeMethod · 0.95
togglePanelMethod · 0.95
compileMethod · 0.95
valMethod · 0.80
onMethod · 0.45
hideMethod · 0.45

Tested by

no test coverage detected