From 4698200a2353e63e1f29960f8d1695933229d7e3 Mon Sep 17 00:00:00 2001 From: Rihards Gailums Date: Sun, 11 Oct 2026 06:04:29 +0000 Subject: [PATCH] =?UTF-8?q?P=C4=81rl=C5=ABks:=20darbojas=20ar=C4=AB=20iegu?= =?UTF-8?q?lt=C4=81=20(sandbox)=20iframe?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit history.replaceState un location.hash piekļuve aizsargāta ar try/catch, jo iegultā srcdoc lapā (piem., priekšskatījumā) URL maiņa nav atļauta. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_016679RwmHsuTFfxt26wP6rk --- editor/Budget-as-Code.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/editor/Budget-as-Code.html b/editor/Budget-as-Code.html index ce0b229..be9284a 100644 --- a/editor/Budget-as-Code.html +++ b/editor/Budget-as-Code.html @@ -16193,8 +16193,8 @@ const srcLabel = (M, a) => { const s = M.src[a.src]; if (!s) return ""; return ( /* ============================================================ stāvoklis */ const S = {v: "problema", y: null, sub: "kopsavilkums", fund: "all", grp: "resori", open: new Set(), q: "", rfund: "basic", cflow: "expenditure", sel: null, sort: "code"}; const cur = () => MODELS[S.y]; -function setHash(){ const h = "#/" + S.v + (["budzets"].includes(S.v) ? "/" + S.y + "/" + S.sub : (["salidz", "saderiba", "modelis"].includes(S.v) ? "/" + S.y : "")); if (location.hash !== h) history.replaceState(null, "", h); } -function readHash(){ const p = location.hash.replace(/^#\/?/, "").split("/"); if (p[0]) S.v = p[0]; if (p[1] && MODELS[p[1]]) S.y = p[1]; if (p[2]) S.sub = p[2]; } +function setHash(){ const h = "#/" + S.v + (["budzets"].includes(S.v) ? "/" + S.y + "/" + S.sub : (["salidz", "saderiba", "modelis"].includes(S.v) ? "/" + S.y : "")); if (setHash.off || location.hash === h) return; try { history.replaceState(null, "", h); } catch (e) { setHash.off = true; } } +function readHash(){ let lh = ""; try { lh = location.hash || ""; } catch (e) {} const p = lh.replace(/^#\/?/, "").split("/"); if (p[0]) S.v = p[0]; if (p[1] && MODELS[p[1]]) S.y = p[1]; if (p[2]) S.sub = p[2]; } /* ============================================================ karkass */ function renderYearSeg(){