Handle items that don't exist in embedded mode; fix iframe generation (#7605)

Checked locally. Have no idea how the heck the quotes got changed....
This commit is contained in:
Matt Godbolt
2025-04-24 14:09:02 -05:00
committed by GitHub
parent 9e5fd3d377
commit 82eff66c49
4 changed files with 6 additions and 4 deletions

View File

@@ -20,6 +20,8 @@ major UI changes, framework updates, or when implementing significant new featur
- Test the copy button
- Check that social sharing buttons display correctly
- Verify proper styling in both light and dark themes
- Check the `<iframe>` of embed is correct HTML
- Check the inner link of the iframe for embed works still (that is, embed mode)
- Test "Copied to clipboard" tooltip functionality
### Load/Save Modal

View File

@@ -779,7 +779,7 @@ function start() {
History.trackHistory(layout);
setupSiteTemplateWidgetButton(siteTemplateScreenshots, layout);
new Sharing(layout);
if (!options.embedded) new Sharing(layout);
new Printerinator(hub, themer);
}

View File

@@ -429,7 +429,7 @@ export class Sharing {
): string {
const embedUrl = Sharing.getEmbeddedUrl(config, root, isReadOnly, extraOptions);
// The attributes must be double quoted, the full url's rison contains single quotes
return `<iframe width='800px' height='200px' src='${embedUrl}'></iframe>`;
return `<iframe width="800px" height="200px" src="${embedUrl}"></iframe>`;
}
private static getEmbeddedUrl(config: any, root: string, readOnly: boolean, extraOptions: object): string {

View File

@@ -90,8 +90,8 @@ function reallySetCompilerVersionPopover(
const existingPopover = BootstrapUtils.getPopoverInstance(pane.fullCompilerName);
if (existingPopover) existingPopover.dispose();
// Initialize new popover
BootstrapUtils.initPopover(pane.fullCompilerName, {
// Initialize a new popover; may not exist in embedded links.
BootstrapUtils.initPopoverIfExists(pane.fullCompilerName, {
html: true,
title: notification
? ($.parseHTML('<span>Compiler Version: ' + notification + '</span>')[0] as Element)