generated at
scrapbox-icon-button
takker用にコピペした

2021-04-11 23:31:31 refactoring

script.js
const buttonFileName = 'button.'; document.getElementById('editor').addEventListener('click', async e => { const t = e.target; if (!(t.tagName === 'IMG' && t.classList.contains('icon') && t.title.endsWith('-button')))return; e.preventDefault(); e.stopImmediatePropagation(); try { const path = `../${encodeURIComponent(t.title)}/${buttonFileName}` const {execute} = await import(path); execute(); } catch(e) { console.log(e); } });

#2021-04-11 23:33:34
#2021-01-04 18:54:52