settings
code:script.js
scrapbox.PopupMenu.addButton({
title: 'wikipedia',
onClick: text => {
if( text.match(/^\[\S*\]$/g) ){ text = text.replace(/\[/g, '');
} else {
text = text.replace(/\[\S*/g, ''); }
text = text.replace(/\]/g, '').replace(/^\s+/, '');
const uri = encodeURI(text.replace(' ', '+'));
const regexp = /^[a-zA-Z0-9!-/:-@\-`{-~\s*$/gm if (regexp.test(text)) {
window.open(https://en.wikipedia.org/w/index.php?search=${uri});
} else {
window.open(https://ja.wikipedia.org/w/index.php?search=${uri});
}
}
})
code:style.css
.daily-log-buttons {
height: 42px;
padding-top: 15px;
}
.daily-log-buttons a {
margin: 10px;
}
.daily-log-buttons a:hover,a:active {
}
/* テーブルのセルをわかりやすくする */
.table-block table { background-color: transparent; border-collapse: separate; border-spacing: 2px }
.table-block table tr td:nth-child(odd) { padding: .1em; background-color: rgba(0,0,0,0.04) }
.table-block table tr:nth-child(even) td { background-color: rgba(0,0,0,0.06) } /* 偶数行を濃くする */
.table-block table tr:first-child td { font-weight: bolder; text-align: center } /* 1行目だけ太字&中央揃え */
.table-block table tr td:first-child { padding: 0; background-color: transparent; border-width: 0 }