"""Insert the S02 view (s02_mockup_view.js) into the design mockup DOC/01_기획/웹앱디자인시안/시안/index.html (2026-10-15). The original is copied to ../backup first by the caller; the patch is applied once (refuses if already applied).""" from pathlib import Path HERE = Path(__file__).parent P = Path(__file__).resolve().parents[4] / "DOC" / "01_기획" / "웹앱디자인시안" / "시안" / "index.html" s = P.read_text(encoding="utf-8") assert "viewNew" not in s, "already applied" js = (HERE / "s02_mockup_view.js").read_text(encoding="utf-8") pairs = [ (" /* ---------- router ---------- */", js + "\n /* ---------- router ---------- */"), (" else if (h.indexOf('#/candidates') === 0) viewCandidates();", " else if (h.indexOf('#/candidates') === 0) viewCandidates();\n else if (h.indexOf('#/new') === 0) viewNew();"), (" $('#nav-cand').style.fontWeight = h.indexOf('#/candidates') === 0 ? '700' : '500';", " $('#nav-cand').style.fontWeight = h.indexOf('#/candidates') === 0 ? '700' : '500';\n $('#nav-new').style.fontWeight = h.indexOf('#/new') === 0 ? '700' : '500';"), ('
', ' \n '), ("