미디어위키:Common.js: 두 판 사이의 차이

잔글
rev.
(update)
잔글 (rev.)
}
/* 끝: Edittool Bars */
 
/* 시작: 편집창 위의 단추 추가 */
function addCustomButton(imageFile, speedTip, tagOpen, tagClose, sampleText) {
mwCustomEditButtons[mwCustomEditButtons.length] =
{"imageFile": imageFile, "speedTip": speedTip, "tagOpen": tagOpen, "tagClose": tagClose, "sampleText": sampleText};
}
addCustomButton('//upload.wikimedia.org/wikipedia/commons/2/2a/Button_category_plus.png',
'카테고리', '\[\[Category:', '\]\]', ' ');
/* 끝: addCustomButton */
 
/* 시작: Edittool-bar 옮기기 */
 
function chooseCharSubset(ss) {
s = parseInt( ss );
if ( isNaN(s) ) s = 0;
if (SpecCharsAccesskeys.length==0) {
if (is_opera) SpecCharsAccesskeys = new Array("!","\"","§","$","%","&","/","(",")","=");
else SpecCharsAccesskeys = new Array("1","2","3","4","5","6","7","8","9","0","!","\"","§","$","%","&","/","(",")","=");
}
if (s>=0) {
var l = document.getElementById('specialchars').getElementsByTagName('p');
for (var i = 0; i < l.length ; i++) {
if (i==s) {
l[i].style.display = 'inline';
SetArrayAccessKeys(l[i].getElementsByTagName('a'),SpecCharsAccesskeys);
} else l[i].style.display = 'none';
}
$.cookie('CharSubset', s);
}
}
// Accesskeys
function SetArrayAccessKeys(elements, keys) {
for (var i =0; i < elements.length;i++) {
if (i < keys.length) {
elements[i].setAttribute("accessKey",keys[i]);
elements[i].setAttribute("title","alt-"+keys[i]);
} else {
elements[i].setAttribute("accessKey","");
elements[i].setAttribute("title","");
}
}
}
SpecCharsAccesskeys = new Array();
function addCharSubsetMenu() {
var SpecCharsMove = true;
var edittools = document.getElementById('specialchars');
if (edittools) {
var name;
var menu=document.createElement("select");
menu.style.display="inline";
var line = edittools.getElementsByTagName('p');
for (var i = 0; i < line.length ; i++) {
if (line[i].className == "specialbasic" || line[i].className == "speciallang") {
if (line[i].title) name=line[i].title;
else name = line[i].id;
menu.options[menu.options.length]=new Option(name);
}
}
menu.onchange=function() {chooseCharSubset(this.selectedIndex);} ;
if (SpecCharsMove) {
edittools.insertBefore(menu,edittools.firstChild);
} else {
edittools.insertAfter(menu,edittools.firstChild);
}
var stdsubset = 0;
if ($.cookie("CharSubset")) stdsubset = parseInt( $.cookie("CharSubset") );
if ( isNaN(stdsubset) ) stdsubset = 0;
menu.options[stdsubset].selected = true;
chooseCharSubset(stdsubset);
var charlinks = document.getElementById('toolbar').getElementsByTagName('a');
for (var i=0; i < charlinks.length; i++) {
charlinks[i].setAttribute("tabindex",8);
}
}
}
$(document).ready(addCharSubsetMenu);
// Toolbar 옮기기
function elementMoveto(node, refNode, pos) {
if(node && refNode) {
var parent = refNode.parentNode;
if (pos && pos == 'after') refNode=refNode.nextSibling;
try {
parent.insertBefore(node, refNode);
} catch (DOMException) {};
}
}
// Toolbar 고정
function fixToolbar(){
var wpEditToolbar = document.getElementById("toolbar");
var dropdownListEditTools = document.getElementById("dropdownListEditTools");
elementMoveto(dropdownListEditTools , wpEditToolbar , 'after' );
if (dropdownListEditTools) dropdownListEditTools.style.display="block";
var editspecialchars = document.getElementById("specialchars");
elementMoveto( editspecialchars, wpEditToolbar, 'after' );
}
$(document).ready(fixToolbar);
/* 끝: Edittool-bar 옮기기 */
 
/* 시작: 말고 펴는 살피기칸: Dynamic Navigation Bars */
$(document).ready(WiktionaryTalkpage);
/* 끝: change namespace of certain pages */
 
/* 시작: 로그인 / 사용자 등록 */
// 따옴: [[de:MediaWiki:Common.js]]
function signUp() {
if (document.getElementById("pt-login")) {
var signUp = document.createElement("span");
signUp.setAttribute("style", "padding-right: 2px");
signUp.innerHTML = ' \| <a href="/wiki/Special:Userlogin?type=signup" title="한국어 위키책에 사용자 등록하기"><span class="BGImage-e">사용자 등록<W/span><\/a>';
document.getElementById("pt-login").appendChild(signUp);
}
}
$(document).ready(signUp);
/* 끝: Userlogin / Signup */
 
/* 위키 프로젝트 링크: Interprojekt-Links */

편집

5,628