Index: openacs-4/packages/xowf-monaco-plugin/tcl/form-field-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowf-monaco-plugin/tcl/form-field-procs.tcl,v diff -u -r1.1.1.1.2.7 -r1.1.1.1.2.8 --- openacs-4/packages/xowf-monaco-plugin/tcl/form-field-procs.tcl 5 Jul 2021 15:57:35 -0000 1.1.1.1.2.7 +++ openacs-4/packages/xowf-monaco-plugin/tcl/form-field-procs.tcl 8 Jul 2021 00:10:24 -0000 1.1.1.1.2.8 @@ -192,15 +192,18 @@ var srcDoc = document.getElementById('${:id}-srcdoc'); var page = xowf.monaco.b64_to_utf8(srcDoc.innerHTML); - // When clicking on the fullscreen button, open a new window and - // copy the current code inside of its document + // When clicking on the fullscreen button, open a new window + // insert an iframe and set its content as our markup var fullscreenWindowHandle; + var fullscreenIframe; var fullscreenBtn = document.getElementById('${:id}-fullscreen-btn'); if (fullscreenBtn) { fullscreenBtn.addEventListener("click", function(e) { if ((!fullscreenWindowHandle || fullscreenWindowHandle.closed) && page) { fullscreenWindowHandle = window.open(); - fullscreenWindowHandle.document.write(page); + fullscreenWindowHandle.document.write(''); + fullscreenIframe = fullscreenWindowHandle.document.querySelector('iframe'); + fullscreenIframe.srcdoc = page; } }); } @@ -223,9 +226,7 @@ iframe.srcdoc = page; } if (fullscreenWindowHandle && !fullscreenWindowHandle.closed) { - fullscreenWindowHandle.document.open(); - fullscreenWindowHandle.document.write(page); - fullscreenWindowHandle.document.close(); + fullscreenIframe.srcdoc = page; } }); }