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

Method setupPrintView

static/print-view.ts:69–81  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

67 }
68
69 setupPrintView() {
70 this.printview.empty();
71 this.printview[0].innerHTML = `<style>${this.getThemeStyles()}</style>`;
72 this.itemsAdded = 0;
73 // It's important that any highlighting is done under the default theme (simply applying the default css
74 // to tokens from another theme doesn't quite work)
75 const theme = this.themer.getCurrentTheme();
76 this.themer.setTheme(themes.default);
77 // Request print data from everyone
78 this.eventHub.emit('printrequest');
79 // Restore theme
80 this.themer.setTheme(unwrap(theme));
81 }
82
83 addPrintData(data: string) {
84 if (this.itemsAdded++ !== 0) {

Callers

nothing calls this directly

Calls 5

getThemeStylesMethod · 0.95
setThemeMethod · 0.80
unwrapFunction · 0.50
getCurrentThemeMethod · 0.45
emitMethod · 0.45

Tested by

no test coverage detected