User:Kahusi/monobook.js
From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Mozilla/Safari: hold down Shift while clicking Reload (or press Ctrl-Shift-R), Internet Explorer: press Ctrl-F5, Opera/Konqueror: press F5.
inst_checker=function(){ var f=document.getElementById("editform"); if(f){ f.onsubmit = function(){ var fchars={ "\uFF0C":"\u3001","\uFF0E":"\u3002", "\uFF10":"0","\uFF11":"1","\uFF12":"2","\uFF13":"3","\uFF14":"4","\uFF15":"5", "\uFF16":"6","\uFF17":"7","\uFF18":"8","\uFF19":"9","\uFF21":"A","\uFF22":"B", "\uFF23":"C","\uFF24":"D","\uFF25":"E","\uFF26":"F","\uFF27":"G","\uFF28":"H", "\uFF29":"I","\uFF2A":"J","\uFF2B":"K","\uFF2C":"L","\uFF2D":"M","\uFF2E":"N", "\uFF2F":"O","\uFF30":"P","\uFF31":"Q","\uFF32":"R","\uFF33":"S","\uFF34":"T", "\uFF35":"U","\uFF36":"V","\uFF37":"W","\uFF38":"X","\uFF39":"Y","\uFF3A":"Z", "\uFF41":"a","\uFF42":"b","\uFF43":"c","\uFF44":"d","\uFF45":"e","\uFF46":"f", "\uFF47":"g","\uFF48":"h","\uFF49":"i","\uFF4A":"j","\uFF4B":"k","\uFF4C":"l", "\uFF4D":"m","\uFF4E":"n","\uFF4F":"o","\uFF50":"p","\uFF51":"q","\uFF52":"r", "\uFF53":"s","\uFF54":"t","\uFF55":"u","\uFF56":"v","\uFF57":"w","\uFF58":"x", "\uFF59":"y","\uFF5A":"z", "\uFF61":"\u3002","\uFF62":"\u300C","\uFF63":"\u300D","\uFF64":"\u3001","\uFF65":"\u30FB", "\uFF66":"\u30F2","\uFF67":"\u30A1","\uFF68":"\u30A3","\uFF69":"\u30A5","\uFF6A":"\u30A7", "\uFF6B":"\u30A9","\uFF6C":"\u30E3","\uFF6D":"\u30E5","\uFF6E":"\u30E7","\uFF6F":"\u30C3", "\uFF70":"\u30FC","\uFF71":"\u30A2","\uFF72":"\u30A4","\uFF73":"\u30A6","\uFF74":"\u30A8", "\uFF75":"\u30AA","\uFF76":"\u30AB","\uFF77":"\u30AD","\uFF78":"\u30AF","\uFF79":"\u30B1", "\uFF7A":"\u30B3","\uFF7B":"\u30B5","\uFF7C":"\u30B7","\uFF7D":"\u30B9","\uFF7E":"\u30BB", "\uFF7F":"\u30BD","\uFF80":"\u30BF","\uFF81":"\u30C1","\uFF82":"\u30C4","\uFF83":"\u30C6", "\uFF84":"\u30C8","\uFF85":"\u30CA","\uFF86":"\u30CB","\uFF87":"\u30CC","\uFF88":"\u30CD", "\uFF89":"\u30CE","\uFF8A":"\u30CF","\uFF8B":"\u30D2","\uFF8C":"\u30D5","\uFF8D":"\u30D8", "\uFF8E":"\u30DB","\uFF8F":"\u30DE","\uFF90":"\u30DF","\uFF91":"\u30E0","\uFF92":"\u30E1", "\uFF93":"\u30E2","\uFF94":"\u30E4","\uFF95":"\u30E6","\uFF96":"\u30E8","\uFF97":"\u30E9", "\uFF98":"\u30EA","\uFF99":"\u30EB","\uFF9A":"\u30EC","\uFF9B":"\u30ED","\uFF9C":"\u30EF", "\uFF9D":"\u30F3","\uFF9E":"\u309B","\uFF9F":"\u309C","\u339E":"km","\u3316":"km"}; var textarea=document.getElementById("editform").getElementsByTagName("textarea")[0]; for(var fchar in fchars){ if(textarea.value.match(fchar)){ if(confirm("推奬されない文字を含んでゐます: "+fchar+"\n置換しますか?")){ textarea.value=textarea.value.replace(new RegExp(fchar,"g"),fchars[fchar]); } } } } } } yearTable=function(){ var c=function(s,n,f){ var i,w; for(i=1;i<=f;i++){ w+='<option value="'+(s+i-1)+'">'+n+(i<10?'0':'')+i+'年 - '+(s+i-1)+'年</option>'; } return w; } //b=document.getElementById("toolbar"); try{ document.getElementById("toolbar").innerHTML += ('\ <select id="years" style="height:22px;">'+ c(1868,"明治",44)+c(1912,"大正",14)+c(1926,"昭和",63)+c(1989,"平成",20) +'</select>\ <button style="height:22px;width:23px;" onClick="insertTags(\'[[\'+years.value+\'年|\',\']]\',\'\');">入</button>'); }catch(e){ } } editlink = function(){ try{ document.getElementById("ca-edit").style.marginRight = '0'; document.getElementById("ca-edit").outerHTML = document.getElementById("ca-edit").outerHTML + ('\ <li style="margin-left:0;width:10px"><a title="見出しより上を編輯" href="'+document.getElementById("ca-edit").all[0].href+'§ion=0" style="padding-left:0.4em;padding-right:0.4em;">#</a></li>\ '); }catch(e){ } } window.onload = function(){ addnav(); yearTable(); editlink(); if(document.body.className == "ns-0") inst_checker(); } function morelinks() { var tabs = document.getElementById('p-cactions').cloneNode(true); tabs.id = 'mytabs'; var listitems = tabs.getElementsByTagName('LI'); for (i=0;i<listitems.length;i++) { if(listitems[i].id) listitems[i].id = 'mytabs-' + listitems[i].id; } document.getElementById('column-content').appendChild(tabs); } if (window.addEventListener) window.addEventListener("load",morelinks,false); else if (window.attachEvent) window.attachEvent("onload",morelinks);