FrnklnWrld commited on
Commit
c23a5ac
Β·
verified Β·
1 Parent(s): 818c3d9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -1517,7 +1517,7 @@ async def root():
1517
 
1518
  function copyCode(btn) {
1519
  const block = btn.parentElement;
1520
- const text = block.innerText.replace(/^copy\n?/, '').trim();
1521
  navigator.clipboard.writeText(text).then(() => {
1522
  btn.textContent = 'βœ“ copied';
1523
  setTimeout(() => btn.textContent = 'copy', 1800);
@@ -1534,7 +1534,7 @@ async def root():
1534
  const statusEl = document.getElementById(statusId);
1535
  area.style.display = 'block';
1536
  statusEl.className = 'status-pill ' + (status === 200 ? 'status-200' : 'status-err');
1537
- statusEl.textContent = status + ' Error';
1538
  document.getElementById(outId).textContent = JSON.stringify(data, null, 2);
1539
  }
1540
 
@@ -1609,8 +1609,11 @@ async def root():
1609
 
1610
  function escHtml(s) {
1611
  if (!s) return '';
1612
- return String(s).replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;');
1613
- }
 
 
 
1614
 
1615
  // ── JOURNEY ──
1616
  async function runJourney() {
 
1517
 
1518
  function copyCode(btn) {
1519
  const block = btn.parentElement;
1520
+ const text = block.innerText.replace(new RegExp('^copy\\n?'), '').trim();
1521
  navigator.clipboard.writeText(text).then(() => {
1522
  btn.textContent = 'βœ“ copied';
1523
  setTimeout(() => btn.textContent = 'copy', 1800);
 
1534
  const statusEl = document.getElementById(statusId);
1535
  area.style.display = 'block';
1536
  statusEl.className = 'status-pill ' + (status === 200 ? 'status-200' : 'status-err');
1537
+ statusEl.textContent = status === 200 ? status + ' OK' : status + ' Error';
1538
  document.getElementById(outId).textContent = JSON.stringify(data, null, 2);
1539
  }
1540
 
 
1609
 
1610
  function escHtml(s) {
1611
  if (!s) return '';
1612
+ return String(s)
1613
+ .replace(new RegExp('&', 'g'), '&amp;')
1614
+ .replace(new RegExp('<', 'g'), '&lt;')
1615
+ .replace(new RegExp('>', 'g'), '&gt;');
1616
+ }
1617
 
1618
  // ── JOURNEY ──
1619
  async function runJourney() {