hina
#member
https://lh3.googleusercontent.com/a-/AOh14GggKKGtHt1Dqzwd2D8ynVtg6J7HlpU4FpHht03jVg=s96-c#.png
Hello~
interest
AtCoder (HomePage)
project page
入門的な?
written by me
hina (this page)
UserCSS触ってみた
history
2021/07/12
合流
ブラケット(こいつら → [ ])を表示させる文字装飾記法を追加した
リンクを外すPopupMenuを追加した
ここのコメントアウトのせいで2時間くらい溶けた…
.cssのコメントアウトは/*comment */!!!
↓ 参考 ↓
001.リンクを外すUserScript
2021/07/13
Scrapboxのリンクを外部リンク風に書き換えるPopupMenuを作成した...
↓ 参考 ↓
001.ScrapboxのUserScriptテンプレートまとめ
002.Scrapbox用UserScriptの作成例
003.JavaScriptでreplaceメソッドを使って指定した文字列を削除する方法を現役エンジニアが解説【初心者向け】
004.JavaScriptで特定文字以降を削除 (substring,indexOf)
005.【JavaScript入門】文字列の分割と切り出し(substr/substring/slice)
code:style.css
/* textで[]を表示 */
.line:not(.cursor-line) .deco-\!:before{content:"["}
.line:not(.cursor-line) .deco-\!:after{content:"]"}
code:script.js
/* リンクを外す */
scrapbox.PopupMenu.addButton({
title: 'unlink',
onClick: text => {
const result = text.split(/\n/)
.map(line => line.replace(/\[([^\!"#%&'()\*\+,\-\.\/\{\|\}<>_~[^\\]*)\]/g,'$1')).join('\n');
// テロメアが無駄に更新されるのを防ぐ
if(text == result) return;
return result;
}
});
/* Scrapboxのリンクを外部リンク張った時の表示にする */
scrapbox.PopupMenu.addButton({
title: 'createScrapboxLink',
onClick: text => {
const pure_text = text.replace(""").replace("", "");
const title_start_index = pure_text.lastIndexOf('/');
const title_name = pure_text.substr(title_start_index + 1);
return '+ title_name + ' ' + 'https://scrapbox.io' + pure_text + '';
}
});