User:Tietew/monobook.js
|
Note: After saving, you have to bypass your browser's cache to see the changes. Mozilla/Safari/Konqueror: hold down Shift while clicking Reload (or press Ctrl-Shift-R), IE: press Ctrl-F5, Opera: press 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;