Changeset fcd6964 in Klonkt for src/assets
- Timestamp:
- 07/24/2026 08:59:51 PM (7 weeks ago)
- Branches:
- main
- Children:
- c6185fa
- Parents:
- 3ffbedd
- File:
-
- 1 edited
-
src/assets/js/guardian.js (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/assets/js/guardian.js
r3ffbedd rfcd6964 4 4 (function () { 5 5 'use strict'; 6 // A crash here used to fail silently (buttons just do nothing). Surface it on 7 // the page AND the console so the cause is visible instead of "everything hangs". 8 function fatal(msg) { 9 try { 10 var b = document.getElementById('g-fatal') || document.createElement('div'); 11 b.id = 'g-fatal'; b.className = 'g-msg err'; 12 b.style.cssText = 'display:block;margin:12px 0;padding:10px 14px'; 13 b.textContent = 'Guardian: ' + msg; 14 var root = document.querySelector('main') || document.body; 15 if (!b.parentNode && root) root.insertBefore(b, root.firstChild); 16 } catch (e) { /* last resort */ } 17 try { console.error('[guardian]', msg); } catch (e) { /* no console */ } 18 } 19 try { 6 20 var S = JSON.parse(document.getElementById('guardian-state').textContent || '{}'); 7 21 var T = S.strings || {}; … … 14 28 } 15 29 function handleOf(uri, cached) { 16 if (cached ) return cached;30 if (cached && cached.charAt(0) === '@') return cached; // trust only real @handles 17 31 try { var u = new URL(uri); return '@' + u.pathname.split('/').filter(Boolean).pop() + '@' + u.host; } 18 32 catch (e) { return uri; } … … 218 232 renderAll(); pushState(); 219 233 setInterval(refresh, 45000); // live-ish while open 234 } catch (e) { 235 fatal((e && e.message) || String(e)); 236 } 220 237 })();
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)