From 7dc76e4e2f82889db0d87fb4694e8af0156f6f28 Mon Sep 17 00:00:00 2001 From: michaelsboost Date: Sun, 8 Sep 2024 14:35:38 -0500 Subject: [PATCH] backup app.js --- .DS_Store | Bin 10244 -> 10244 bytes app/.DS_Store | Bin 14340 -> 14340 bytes app/src/App-backup.js | 14 +++++++++++--- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.DS_Store b/.DS_Store index 7acc8e16b124b99fa6ee1bbd4f3d1aafd37ef633..89c1562015d3e8bd6fb63ccca1768e7d22ad2963 100644 GIT binary patch delta 36 mcmZn(XbISGQGk(sa)3}YBgf=5LcWu$1+T#Po7V_MhynoNGz)70 delta 32 ncmZn(XbISGQDAbsaPnkJ8TZN6f>(g-l*y)oZkvA!af<=~)-nt# diff --git a/app/.DS_Store b/app/.DS_Store index 5fa93efbc148198b139891f3ef951e28ae139d24..73092ad215acf3462c5f26935f82251323f58c38 100644 GIT binary patch delta 131 zcmZoEXepTBFDlN!z`)GFAi%(o&yZIZT$GoSpO-%IqVi+|6Bb!Updbj`0f`x%pl%=GZeUR*~qmGU{o3m=_!y*}d zXrWE@m`e51Lu6}4gnd2qVo^dAL`7s-PeIU&fzjFRiyl^_Xok6W&bjBD`=8%E)9dN= z43wKwiO4`?BB~>aYN>@(svDfL=y?TUYruNJ<)R8@sWuT@7U zMTHL4r_)wP8F$ynF4bKrcS*V@quy3)GPP;a4oPu%<#wsm;gz&nQ*65|b(DL&vg+2V zrB;n+OGzGA=1U)4YW7d2*Fp?r>)9(;_!h-|U-&hGA}N_N$xbCyMfI$@hx%!V#%O|W z(L;Jlujnm(q*?kxbMzGk7-2>{5|D^=Sdf8Ces z3cJ`Kwuo|3p@(N!;zK~z^D>xR*}szev`p5O%yWMUZi=4MYx+Q+X%^v#f(a?eLM{pz z(?)E@R+M2IqpHCk>l#|2!(Wn951 zuHq&pa2t1U7xyrUCwPfBnARVxviL&aAjRk;zF?_NPLYGDR$lV( zZRKs}leYbbw2(3L<+oS1x)s&kz%jnSzZkHA|+ z(C?p#HAEoJZ%mzx9MsKzqbXV>hCBn^l$ESMGr1z|MO(MSKI% CQZR4; diff --git a/app/src/App-backup.js b/app/src/App-backup.js index f0b657d..83a4d57 100644 --- a/app/src/App-backup.js +++ b/app/src/App-backup.js @@ -52,7 +52,7 @@ let app = { href: 'https://michaelsboost.com/', src: 'imgs/author.jpg' }, - version: '1.0.2', + version: '1.0.3', url: 'https://github.com/michaelsboost/Polyrise/', license: 'https://github.com/michaelsboost/Polyrise/blob/gh-pages/LICENSE' } @@ -1027,7 +1027,7 @@ window.project = createProxy(p, (property, oldValue, newValue) => { if (!App.initialRender) { // List of properties that should not trigger App.render - const noRenderProps = ['lang', 'title', 'description', 'author', 'url', 'meta', 'previewDark']; + const noRenderProps = ['lang', 'title', 'description', 'author', 'url', 'meta']; // Check if the change is within project.html and is a text property if (propertyParts[0] === 'html' && propertyParts.includes('text')) { @@ -7662,6 +7662,9 @@ window.importJSON = (obj, callback = null) => { project.url = obj.url; project.logo = obj.logo; project.dark = obj.dark; + project['previewDark'] = ('previewDark' in obj && typeof obj.previewDark === 'boolean') + ? obj.previewDark + : true; project.pwa = obj.pwa; project.activePanel = obj.activePanel; @@ -8942,6 +8945,10 @@ window.screenshot = async () => { removeScript("../libraries/jszip/FileSaver.min.js"); } } +window.createBlobURL = (content, type) => { + const blob = new Blob([content], { type }); + return URL.createObjectURL(blob); +} window.renderPreview = (forceRun = false) => { const iframe = document.getElementById('iframe'); if (!iframe) return; @@ -8995,6 +9002,7 @@ ${json2html(project.html)} `; +const newHtmlBlobURL = createBlobURL(iframeSrc, 'text/html'); // Create a new temporary iframe to compare const parser = new DOMParser(); @@ -9002,7 +9010,7 @@ ${json2html(project.html)} const idoc = iframe.contentDocument || iframe.contentWindow.document; if (forceRun) { - iframe.setAttribute('srcdoc', iframeSrc); + iframe.setAttribute('src', newHtmlBlobURL); } else { diffNodes(idoc.documentElement, doc.documentElement); }