User:Tietew/monobook.js
Appearance
Note: After publishing, you may have to bypass your browser's cache to see the changes.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
- Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5.
// このスクリプトはうっかり投稿(要約欄でEnter押しちゃった)を防止するものです。
// 自分の利用者ページのサブページとして作成することで有効になります。
// This script is under public domain, and comes with ABSOLUTELY NO WARRANTY.
// You can use/modify/redistribute without any permission.
var submitchecker_buttonclicked = false;
function install_submitchecker() {
var f = document.getElementById("editform");
if(f) {
var inputs = f.getElementsByTagName("input");
for(var i = 0; i < inputs.length; ++i)
if(inputs[i].type == "submit")
inputs[i].onclick = submitchecker_nocheck;
f.onsubmit = submitchecker;
}
}
function submitchecker() {
if(submitchecker_buttonclicked) return true;
return confirm("Are you sure you want to submit your changes?");
}
function submitchecker_nocheck() {
submitchecker_buttonclicked = true;
return true;
}
window.onload = install_submitchecker;