User:ToePeu/modern.js

/* Add "Show Wikipedia" link for MediaWiki namespace */ /* Add "Show Other language" link for MediaWiki namespace */ addOnloadHook(function {  if (wgCanonicalNamespace != "MediaWiki") return;  var body = document.getElementById ('contentSub');

if (wgPageName.indexOf('/')>0) { body.innerHTML += ' Show this message in Wikipedia '

function linkLang(lang) { return ' Show this message in '+lang+' '; }

if (wgPageName.substring(wgPageName.indexOf('/')+1, wgPageName.length)==wgUserLanguage) { body.innerHTML += linkLang('ja'); } else body.innerHTML += linkLang(wgUserLanguage); } });

// 위로 버튼 추가 시작 var editbtnname = '편집'; // section 0 버튼 때문에 변경한 부분 주석처리 function getElementsByCondition(condition,container) {  container = container||document; var all = container.all||container.getElementsByTagName('*'); var arr = []; for(var k=0;k편집] ';   var secn = ' [편집] '; //   if(body.innerHTML.match('class="editsection"')){     body.innerHTML = sec0 + body.innerHTML + secn; //   } //section 0 section new 편집 버튼 맨아래로 버튼 추가 끝   editpage = '[ * ]';   totop = '[ ↑ ]';   tobottom = '[ ↓ ]'; var ed = getElementsByCondition(function(el){return el.className=="editsection"}); //for(var i=0; i<ed.length;i++) ed[0].innerHTML += tobottom; for(var i=1; i<ed.length;i++) { ed[i].innerHTML += totop; }  for(i=0; i<ed.length; i++) { ed[i].innerHTML = editpage + ed[i].innerHTML.replace('>'+editbtnname+'<', '>&plusmn;<'); } }); // 위로 버튼 추가 끝