미디어위키:Vector.js

L위키, 시민들이 참여하여 가꾸는 리버럴 위키

참고: 설정을 저장한 후에 바뀐 점을 확인하기 위해서는 브라우저의 캐시를 새로 고쳐야 합니다.

  • 파이어폭스 / 사파리: Shift 키를 누르면서 새로 고침을 클릭하거나, Ctrl-F5 또는 Ctrl-R을 입력 (Mac에서는 ⌘-R)
  • 구글 크롬: Ctrl-Shift-R키를 입력 (Mac에서는 ⌘-Shift-R)
  • 인터넷 익스플로러 / 엣지: Ctrl 키를 누르면서 새로 고침을 클릭하거나, Ctrl-F5를 입력.
  • 오페라: Ctrl-F5를 입력.
/* 이 자바스크립트 설정은 벡터 스킨을 사용하는 사용자에게 적용됩니다 */

mw.loader.using( ['mediawiki.user', 'mediawiki.util'] ).done( function () {

/* 메타 로고 및 검색 조정 */
if ( metans === true ) {
	$('.mw-logo-wordmark').replaceWith('<strong class="mw-logo-wordmark" style = "color:black;">메타</strong>');
	$("[class='mw-logo']").attr('href',mw.util.getUrl( '메타:대문' ));
	document.querySelector('.mw-logo .mw-logo-tagline').remove();
	$("[name='search']").attr('placeholder','메타(메타검색시 \'메타:\'입력할 것) 및 L위키 통합검색');
	$("[name='search']").val('메타:');
}

/* 메타 대문 탭 이름 대문으로 */
if ( mw.config.get('wgPageName') === '메타:대문' ) {
	document.getElementById('ca-nstab-메타').innerHTML = '<a href="' + mw.util.getUrl(  mw.config.get('wgPageName') ) + '">대문</a>';
}

/* {{로고 바꾸기}} 구현 */
if (typeof disablerewriteLogo === 'undefined') {
	var tempDiv = document.createElement('div');
	var originalL, replaceL, parent;

	//아이콘 부분
	if (!!document.getElementById('noneIcon')) {
		 document.querySelector('.mw-logo .mw-logo-icon').parentNode.removeChild(document.querySelector('.mw-logo .mw-logo-icon'));
	} else if (!!document.getElementById('replaceIcon')) {
		originalL = document.querySelector('.mw-logo .mw-logo-icon');
		parent = originalL.parentNode;
		tempDiv.innerHTML = document.getElementById('replaceIcon').innerHTML;
		replaceL = tempDiv.childNodes[0];
		parent.replaceChild(replaceL, originalL);
	}

	// 워드마트 부분
	if (!!document.getElementById('noWordmark')) {
		document.querySelector('.mw-logo .mw-logo-wordmark').parentNode.removeChild(document.querySelector('.mw-logo .mw-logo-wordmark'));
	} else if (!!document.getElementById('replaceWordmark')) {
		originalL = document.querySelector('.mw-logo .mw-logo-wordmark');
		parent = originalL.parentNode;
		tempDiv.innerHTML = document.getElementById('replaceWordmark').innerHTML;
		replaceL = tempDiv.childNodes[0];
		parent.replaceChild(replaceL, originalL);
	}

	/* 태그라인 로고 부분 */
	if (!!document.getElementById('noTaglinelogo')) {
		document.querySelector('.mw-logo .mw-logo-tagline').parentNode.removeChild(document.querySelector('.mw-logo .mw-logo-tagline'));
	} else if (!!document.getElementById('replaceTaglinelogo')) {
		originalL = document.querySelector('.mw-logo .mw-logo-tagline');
		parent = originalL.parentNode;
		tempDiv.innerHTML = document.getElementById('replaceTaglinelogo').innerHTML;
		replaceL = tempDiv.childNodes[0];
		parent.replaceChild(replaceL, originalL);
	}

	else if (!!document.getElementById('replaceLgacyIcon')) {
		document.getElementById('p-logo').innerHTML = document.getElementById('replaceLegacyIcon').innerHTML;
	}
}

} );