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

Method initFullCallbacks

static/sharing.ts:176–203  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

174 }
175
176 private initFullCallbacks(): void {
177 this.layout.eventHub.on('displaySharingPopover', () => {
178 this.openShareModalForType(LinkType.Short);
179 });
180 this.layout.eventHub.on('copyShortLinkToClip', () => {
181 this.copyLinkTypeToClipboard(LinkType.Short);
182 });
183
184 this.shareLinkDialog.addEventListener('show.bs.modal', this.onOpenModalPane.bind(this));
185 this.shareLinkDialog.addEventListener('hidden.bs.modal', this.onCloseModalPane.bind(this));
186
187 this.layout.eventHub.on('settingsChange', (newSettings: SiteSettings) => {
188 this.settings = newSettings;
189 });
190
191 $(window).on('blur', async () => {
192 sessionThenLocalStorage.set('gl', JSON.stringify(this.layout.toConfig()));
193 if (this.settings.keepMultipleTabs) {
194 try {
195 const link = await this.getLinkOfType(LinkType.Full);
196 window.history.replaceState(null, '', link);
197 } catch (e) {
198 // This is probably caused by a link that is too long
199 SentryCapture(e, 'url update');
200 }
201 }
202 });
203 }
204
205 private static bindToLinkType(bind: string): LinkType {
206 switch (bind) {

Callers 1

constructorMethod · 0.95

Calls 6

openShareModalForTypeMethod · 0.95
getLinkOfTypeMethod · 0.95
SentryCaptureFunction · 0.70
setMethod · 0.65
onMethod · 0.45

Tested by

no test coverage detected