利用者:Moko256/common.js
表示
お知らせ: 保存した後、ブラウザのキャッシュをクリアしてページを再読み込みする必要があります。
多くの Windows や Linux のブラウザ
- Ctrl を押しながら F5 を押す。
Mac における Safari
Mac における Chrome や Firefox
- ⌘ Cmd と ⇧ Shift を押しながら R を押す。
詳細についてはWikipedia:キャッシュを消すをご覧ください。
$(function(){
const textarea = document.getElementById("wpTextbox1");
if(textarea !== null) {
/*Auto resize textarea*/
textarea.style.maxHeight="none";
const defTH = textarea.style.height;
var lastH = textarea.scrollHeight;
textarea.style.height = lastH + "px";
textarea.oninput=function(e) {
const sy = window.scrollY;
e.target.style.height = defTH;
const nowH = e.target.scrollHeight;
e.target.style.height = nowH + "px";
window.scroll(0, sy + nowH - lastH);
lastH = nowH;
};
/*Move to top button*/
const moveToTop = document.body.appendChild(document.createElement("button"));
moveToTop.innerText="↑";
moveToTop.style.position = "fixed";
moveToTop.style.top = "0px";
moveToTop.onclick = function(){ window.scroll(0, 0); };
/*Move to bottom button*/
const moveToBottom = document.body.appendChild(document.createElement("button"));
moveToBottom.innerText = "↓";
moveToBottom.style.position = "fixed";
moveToBottom.style.bottom = "25px";
moveToBottom.onclick = function(){ window.scroll(0, document.body.scrollHeight); };
}
});
/*Linter*/
mw.loader.load("https://en-two.iwiki.icu/w/index.php?title=User:PerfektesChaos/js/lintHint/r.js&action=raw&bcache=1&maxage=86400&ctype=text/javascript");