-
-
Save nora-tetsu/bac49dbc95d7c6e8366c5867b7d36275 to your computer and use it in GitHub Desktop.
Page Menuからclassの付け外しをするUserScript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
scrapbox.PageMenu.addMenu({ | |
title: 'フォント変更', | |
image: 'https://i.gyazo.com/7057219f5b20ca8afd122945b72453d3.png', // Scrapboxアイコン | |
onClick: () => { | |
const className = 'changefont'; // 適当なクラス名を用意する | |
const editor = document.getElementById('editor'); // 本文部分の親要素 | |
// クラスが既に付与されていれば外す、付与されていなければ付与する | |
editor.classList.contains(className) ? editor.classList.remove(className) : editor.classList.add(className); | |
}, | |
}) | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Page Menuからclassの付け外しをするUserScript用CSSとセットです。
新書モード - daiizを元にしております。