NISHIO Hirokazu[Translate]
最近開いてないページ
script.js
const title = 'Least Visited' scrapbox.PageMenu.addMenu({ title, image: 'https://i.gyazo.com/e71773a00dadd7bb6811206df59790c7.png', onClick: () => { if(scrapbox.PageMenu().menus.get(title).items.length === 0) addItems() } }); async function addItems(){ const proj = scrapbox.Project.name const pages = scrapbox.Project.pages.filter(x=>x.exists).length const count = 5 const res = await fetch(`/api/pages/${proj}?sort=accessed&limit=${count}&skip=${pages-count}`).then(x=>x.json()) const menu = scrapbox.PageMenu(title) //menu.removeAllItems() for(const page of res.pages){ const { title } = page menu.addItem({ title, onClick: () => location.href = `/${proj}/${encodeURIComponent(title)}` }) } console.log(`${title} loaded`) }

"Engineer's way of creating knowledge" the English version of my book is now available on [Engineer's way of creating knowledge]

(C)NISHIO Hirokazu / Converted from [Scrapbox] at [Edit]