Changeset e62f65d in Klonkt for src/assets/js/guardian2.js
- Timestamp:
- 07/25/2026 08:01:21 AM (7 weeks ago)
- Branches:
- main
- Children:
- ad6f62a
- Parents:
- 5c373b8
- File:
-
- 1 edited
-
src/assets/js/guardian2.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/assets/js/guardian2.js
r5c373b8 re62f65d 114 114 row.appendChild(el('span', 'who grow', handleOf(w.other_uri, w.other_handle))); 115 115 row.appendChild(el('span', 'tag ok', T.active)); 116 var wave = el('button', 'small', T.wave || '👋 Wave'); 117 wave.addEventListener('click', function () { sendWave(w.other_uri, wave); }); 118 row.appendChild(wave); 116 119 var btn = el('button', 'quiet small', T.release); 117 120 btn.addEventListener('click', function () { remove(w.other_uri, btn); }); … … 121 124 }); 122 125 show('wards-empty', wards.length === 0); 126 } 127 128 function sendWave(uri, btn) { 129 btn.disabled = true; 130 fetch('/guardian2/api/wave', { 131 method: 'POST', headers: { 'Content-Type': 'application/json' }, 132 body: JSON.stringify({ ward: uri, site: S.site }), 133 }).then(function (r) { return r.json(); }) 134 .then(function (j) { btn.disabled = false; btn.textContent = (j && j.ok) ? (T.waved || '👋 sent') : (T.wave || '👋 Wave'); }) 135 .catch(function () { btn.disabled = false; }); 123 136 } 124 137
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)