Changeset 9eb6e1b in Klonkt for src/assets/js/mod/authorize-interaction.js
- Timestamp:
- 09/30/2026 06:41:45 AM (2 hours ago)
- Branches:
- main
- Children:
- 86cfa1a
- Parents:
- 3ceaef6
- File:
-
- 1 edited
-
src/assets/js/mod/authorize-interaction.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/assets/js/mod/authorize-interaction.js
r3ceaef6 r9eb6e1b 41 41 // ── volgend blok ── 42 42 43 /* Like/Boost toggle in place — POST via fetch, flip the button, stay on the page. */ 44 (function(){ 45 if (window.__fediReactWired) return; window.__fediReactWired = true; 46 document.addEventListener('submit', function(e){ 47 var f = e.target.closest && e.target.closest('.fedi-react-form'); 48 if (!f) return; 49 e.preventDefault(); 50 var btn = f.querySelector('button'); if (!btn || btn.disabled) return; 51 btn.disabled = true; 52 var body = new URLSearchParams(); 53 new FormData(f).forEach(function(v, k){ body.append(k, v); }); 54 fetch(f.action, { method: 'POST', body: body, headers: { 'X-Requested-With': 'fetch' }, credentials: 'same-origin' }) 55 .then(function(r){ return r.ok ? r.json() : null; }) 56 .then(function(j){ 57 if (j) { 58 var on = !!j.on; 59 btn.classList.toggle('is-on', on); 60 var lbl = btn.querySelector('.fedi-bigact-label'); 61 if (lbl) lbl.textContent = on ? (btn.getAttribute('data-on') || lbl.textContent) : (btn.getAttribute('data-off') || lbl.textContent); 62 } 63 }) 64 .catch(function(){}) 65 .then(function(){ btn.disabled = false; }); 66 }); 67 })(); 43 /* Waarderen en boosten ter plekke staat sinds de herbouw van de kaart in 44 chrome.js: de kaart staat nu ook in de zoekbalk, op elke pagina. */ 68 45 }
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)