yuyasurarin-button-script
単発ボタン系を詰め込んだyuyasurarin用UserScripts
2024/6/7 行数の表示も入れた
https://gyazo.com/a94c8ba1f90b72601df48620bb095846
yuyasurarin.icon
/discordwiki/brand-icon.icon
code:script.js
import { breadcrumb_toggle } from "/api/code/yuyasurarin/view-breadcrumb-trail-script/script.js";
import { scrapcalc_toggle } from "/api/code/yuyasurarin/ScrapCalc-script/script.js";
// import { emoji_fetch } from "/api/code/yuyasurarin/emoji-selector-script/script.js";
scrapbox.PageMenu.addMenu({
title: 'Buttons',
})
scrapbox.PageMenu('Buttons').addItem({
title: 'Zen mode',
image: null,
onClick: e => {
var style = document.getElementById('__zen__')
if (style) { style.remove(); e.currentTarget.innerText = 'Zen mode'; return }
else {e.currentTarget.innerText = String.fromCharCode(0x02713) + ' Zen mode'}
var css = '.navbar:not(:hover), .line .telomere:not(:hover), .page-menu:not(:hover) { opacity:0 }'
style = document.createElement('style')
style.setAttribute('id', '__zen__')
style.appendChild(document.createTextNode(css))
document.head.appendChild(style)
}
})
scrapbox.PageMenu('Buttons').addItem({
title: "Show Sepalate",
onClick: e => {
var style = document.getElementById('__sepalate__')
if (style) { style.remove(); e.currentTarget.innerText = 'Show Sepalate'; return }
else {e.currentTarget.innerText = String.fromCharCode(0x02713) + ' Show Sepalate'}
var css = .app:not(.presentation) .line.section-title:not(.line-title) span.text { border-top: 1px dashed rgba(173,173,173,.5) }
style = document.createElement('style')
style.setAttribute('id', '__sepalate__')
style.appendChild(document.createTextNode(css))
document.head.appendChild(style)
}
})
scrapbox.PageMenu('Buttons').addItem({
title: 'Show RowNum',
image: null,
onClick: e => {
var style = document.getElementById('__RowNum__')
if (style) { style.remove(); e.currentTarget.innerText = 'Show RowNum'; return }
else {e.currentTarget.innerText = String.fromCharCode(0x02713) + ' Show RowNum'}
var css = @media screen and (min-width:768px){.editor .lines{counter-reset:line}.editor .line:not(.line-title){counter-increment:line}.app:not(.presentation) .editor .line:not(.line-title)::before{content:counter(line);position:absolute;display:inline-block;left:-110px;z-index:10;min-width:50px;text-align:right;vertical-align:middle;font-family:monospace;color:grey}.editor .line:not(.line-title)::before{opacity:.5}.editor .line.cursor-line:not(.line-title)::before{opacity:1;font-weight:bolder}}
style = document.createElement('style')
style.setAttribute('id', '__RowNum__')
style.appendChild(document.createTextNode(css))
document.head.appendChild(style)
}
})
scrapbox.PageMenu('Buttons').addItem({
title: "Dark Mode",
onClick: e => {
var style = document.getElementById('__dark_mode__')
if (style) { style.remove(); e.currentTarget.innerText = 'Dark Mode'; return }
else {e.currentTarget.innerText = String.fromCharCode(0x02713) + ' Dark Mode'}
var css = html{--body-bg:#202228;--navbar-bg:rgba(55,59,68,0.5);--navbar-icon-color:#fff;--navbar-icon-active-color:#338c46;--navbar-icon-hovered-color:#338c46;--search-form-bg:rgba(255,255,255,0.13);--search-form-icon-color:#fff;--search-form-icon-focus-color:#4a4a4a;--card-title-color:#f0f0f0;--card-title-bg:#2b2e38;--card-bg:#373b44;--card-hover-bg:rgba(0,0,0,0.1);--card-active-bg:rgba(229,229,229,0.1);--card-backside:#545860;--card-description-color:#c4c4c4;--card-description-link-color:#80c9fe;--card-description-code-color:#ccc;--card-box-shadow-color:#000;--card-box-shadow:02px0var(--card-box-shadow-color);--card-box-hover-shadow:02px0rgba(0,0,0,0.23);--card-title-bg-pinned:#2b2e38;--relation-label-bg:#2b2e38;--relation-label-text:#dddede;--relation-label-links-bg:#80c9fe;--relation-label-links-text:#202228;--relation-label-empty-bg:#fb7476;--relation-label-empty-text:#fff;--tool-color:#535863;--tool-light-color:#353b48;--tool-badge-bg:#2b2e38;--tool-bg:#2b2e38;--tool-text-color:#dddede;--new-button-vertical-color:#fff;--new-button-horizontal-color:#fff;--new-button-bg:#46af5d;--new-button-hover-bg:#338c46;--new-button-active-bg:#346447;--telomere-border:#545863;--telomere-unread:#659270;--telomere-updated:#55b56a;--page-text-color:rgba(255,255,255,0.87);--page-link-color:#80c9fe;--page-link-hover-color:#6a9ec6;--page-link-color-cursor-line:#a985e4;--page-bg:#373b44;--empty-page-link-color:#fb7476;--empty-page-link-hover-color:#b47576;--line-title-color:rgba(255,255,255,0.87);--line-permalink-color:rgba(234,218,74,0.35);--code-color:#ccc;--code-bg:rgba(0,0,0,0.18);--quote-bg-color:rgba(0,0,0,0.2);--cursor-color:#fff}
style = document.createElement('style')
style.setAttribute('id', '__dark_mode__')
style.appendChild(document.createTextNode(css))
document.head.appendChild(style)
}
})
scrapbox.PageMenu("Buttons").addItem({
title: "ScrapCalc (Ctrl+Q)",
onClick: () => scrapcalc_toggle(),
})
scrapbox.PageMenu('Buttons').addItem({
title: "Breadcrumb trail",
onClick: e => {
breadcrumb_toggle()
var style = document.getElementById('__Breadcrumb_trail__')
if (style) { style.remove(); e.currentTarget.innerText = 'Breadcrumb trail'; return }
else {e.currentTarget.innerText = String.fromCharCode(0x02713) + ' Breadcrumb trail'}
var css = .quick-launch #history-box{display:none;}
style = document.createElement('style')
style.setAttribute('id', '__Breadcrumb_trail__')
style.appendChild(document.createTextNode(css))
document.head.appendChild(style)
}
})
//scrapbox.PageMenu('Buttons').addItem({
// title: "load emojis from /discordwiki",
// image: null,
// onClick: () => {
// emoji_fetch()
// }
//})
import { copy_month_page, copy_month_page_for_test } from "/api/code/yuyasurarin/ページ作成のショートカットを作る/month.js"
import { copy_week_page } from "/api/code/yuyasurarin/ページ作成のショートカットを作る/week.js"
scrapbox.PageMenu("Buttons").addItem({
title: "Copy Month Template",
image: null,
onClick: () => copy_month_page()
})
scrapbox.PageMenu("Buttons").addItem({
title: "Copy Month Study Template",
image: null,
onClick: () => copy_month_page_for_test()
})
scrapbox.PageMenu("Buttons").addItem({
title: "Copy Week Template",
image: null,
onClick: async () => await copy_week_page()
})
2022/12/3
線が入力しているところの下に表示されるのを修正
https://gyazo.com/38774a4db8b8e180e5ae79131f714fc9
dark mode導入
scrapcalc導入
16**2
https://gyazo.com/70db911461d54a222021233dc8a70f53
https://i.gyazo.com/e6d6b72c5a6fd8523a790e13b1d8e7bf.png