generated at
task-maker-button
タスクページを作成するボタン

動作
createTask.js がないページ
task-page-makerを実行する
createTask.js があるページ
それを実行する

button2.js
const defaultSource = 'task-page-maker'; const project = 'takker'; export async function execute() { const source = `/api/code/${scrapbox.Project.Name}/${encodeURIComponent(scrapbox.Page.title)}/createTask.js`; import(source) .then(({createTask}) => createTask()) .catch(() => {
こっちにfallbackされたとき、どうしてもService Workerでerrorが発生してしまう
実行は出来ているけど、なんか気持ち悪いなtakker
button2.js
console.log('No createTask.js found. Loading the default script...'); import(`/api/code/${project}/${defaultSource}/createTask.js`) .then(({createTask}) => createTask()) .catch(e => console.error(`Failed to load ${source}. Error: %o`, e)); }); }

ボタン用アイコン
普段dark theme UserCSS@0.1.0を使っているので、白色にしています

#2020-12-08 20:30:10