MCPcopy Index your code
hub / github.com/compiler-explorer/compiler-explorer / initButtons

Method initButtons

static/panes/executor.ts:792–858  ·  view source on GitHub ↗
(state: PaneState & ExecutorState)

Source from the content-addressed store, hash-verified

790 }
791
792 initButtons(state: PaneState & ExecutorState): void {
793 this.outputContentRoot = this.domRoot.find('pre.content');
794 this.executionStatusSection = this.outputContentRoot.find('.execution-status');
795 this.compilerOutputSection = this.outputContentRoot.find('.compiler-output');
796 this.executionOutputSection = this.outputContentRoot.find('.execution-output');
797 this.toggleWrapButton = new Toggles(this.domRoot.find('.options'), state as unknown as Record<string, boolean>);
798
799 this.optionsField = this.domRoot.find('.compilation-options');
800 this.execArgsField = this.domRoot.find('.execution-arguments');
801 this.execStdinField = this.domRoot.find('.execution-stdin');
802 this.prependOptions = this.domRoot.find('.prepend-options');
803 this.fullCompilerName = this.domRoot.find('.full-compiler-name');
804 this.fullTimingInfo = this.domRoot.find('.full-timing-info');
805 this.setCompilationOptionsPopover(this.compiler?.options ?? null);
806
807 this.compileTimeLabel = this.domRoot.find('.compile-time');
808 this.libsButton = this.domRoot.find('.btn.show-libs');
809
810 // Dismiss on any click that isn't either in the opening element, inside
811 // the popover or on any alert
812 $(document).on('mouseup', e => {
813 const target = $(e.target);
814 if (
815 !target.is(this.prependOptions) &&
816 this.prependOptions.has(target as any).length === 0 &&
817 target.closest('.popover').length === 0
818 ) {
819 const popover = BootstrapUtils.getPopoverInstance(this.prependOptions);
820 if (popover) popover.hide();
821 }
822
823 if (
824 !target.is(this.fullCompilerName) &&
825 this.fullCompilerName.has(target as any).length === 0 &&
826 target.closest('.popover').length === 0
827 ) {
828 const popover = BootstrapUtils.getPopoverInstance(this.fullCompilerName);
829 if (popover) popover.hide();
830 }
831 });
832
833 this.optionsField.val(this.options);
834 this.execArgsField.val(this.executionArguments);
835 this.execStdinField.val(this.executionStdin);
836
837 this.shortCompilerName = this.domRoot.find('.short-compiler-name');
838 this.setCompilerVersionPopover();
839
840 this.topBar = this.domRoot.find('.top-bar');
841 this.bottomBar = this.domRoot.find('.bottom-bar');
842 this.statusLabel = this.domRoot.find('.status-text');
843
844 this.hideable = this.domRoot.find('.hideable');
845 this.statusIcon = this.domRoot.find('.status-icon');
846
847 this.panelCompilation = this.domRoot.find('.panel-compilation');
848 this.panelArgs = this.domRoot.find('.panel-args');
849 this.panelStdin = this.domRoot.find('.panel-stdin');

Callers 1

constructorMethod · 0.95

Calls 7

initToggleButtonsMethod · 0.95
findMethod · 0.80
valMethod · 0.80
onMethod · 0.45
hideMethod · 0.45

Tested by

no test coverage detected