generated at
UserScript:アイコンボタン
あとで再構成する(めんどうくさいなあ、もう)
script.js
$('#editor').click((e) => { const t = e.target; if (t.tagName === 'IMG' && t.classList.contains('icon') && t.title.endsWith('-button')) { e.preventDefault(); e.stopImmediatePropagation(); const title = encodeURIComponent(t.title); (async () => { let res = await fetch(`/api/code/${scrapbox.Project.name}/${title}/button.js`); if (res.ok) { eval(await res.text()); } })(); } });

color-scheme-button
suto3-button
page-info-button

アイコンボタン
アイコン記法を利用したボタン(イベントトリガー)
ページのサフィックスとして、-button が必要。

スクリプト
スクリプト名は、button.js 固定

UserScript