textarea で TAB おしたときにTABとか入力するようにする。
たまに生で code block 書くときにめんどかった。TAB で移動はつかわないし
$X("//textarea").forEach(function (t) {
t.addEventListener("keypress", function (e) {
if (e.keyCode == 9) {
e.stopPropagation();
e.preventDefault();
var s = t.selectionStart;
var content = t.value;
var str = "\t";
var newstr = content.substring(0, s) + str + content.substring(s, content.length);
t.value = newstr;
var pos = s + str.length;
t.setSelectionRange(pos, pos);
}
}, true);
});