미디어위키:Gadget-CreatePageUw.js

식물 vs 좀비 위키
Brokey (토론 | 기여)님의 2026년 7월 25일 (토) 00:43 판
둘러보기로 이동 검색으로 이동

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

  • 파이어폭스 / 사파리: Shift 키를 누르면서 새로 고침을 클릭하거나, Ctrl-F5 또는 Ctrl-R을 입력 (Mac에서는 ⌘-R)
  • 구글 크롬: Ctrl-Shift-R키를 입력 (Mac에서는 ⌘-Shift-R)
  • 엣지: Ctrl 키를 누르면서 새로 고침을 클릭하거나, Ctrl-F5를 입력.
( function () {
	'use strict';

	if (
		mw.config.get( 'wgCanonicalSpecialPageName' ) !==
		'CreatePage'
	) {
		return;
	}

	function initializeCreatePageUw() {
		var input = document.getElementById(
			'mw-input-wptitle'
		);

		if ( !input ) {
			return;
		}

		input.placeholder =
			'새로 재배할 문서의 제목을 입력하세요';

		input.setAttribute(
			'aria-label',
			'새로 재배할 문서의 제목을 입력하세요'
		);

		if (
			document.querySelector(
				'.pvz-createpage-sprout'
			)
		) {
			return;
		}

		var imageBox =
			document.createElement( 'div' );

		imageBox.className =
			'pvz-createpage-sprout';

		var image =
			document.createElement( 'img' );

		image.src = mw.util.getUrl(
			'Special:Redirect/file/Sprout_PvZ2.png'
		);

		image.alt = '';
		image.className = 'pvz-design-critical';

		imageBox.appendChild( image );

		var fieldLayout = input.closest(
			'.oo-ui-fieldLayout'
		);

		var insertionTarget =
			fieldLayout || input.parentElement;

		if (
			insertionTarget &&
			insertionTarget.parentNode
		) {
			insertionTarget.parentNode.insertBefore(
				imageBox,
				insertionTarget
			);
		}
	}

	if ( document.readyState === 'loading' ) {
		document.addEventListener(
			'DOMContentLoaded',
			initializeCreatePageUw,
			{ once: true }
		);
	} else {
		initializeCreatePageUw();
	}
}() );