미디어위키:Gadget-CreatePageUw.js: 두 판 사이의 차이
둘러보기로 이동
검색으로 이동
편집 요약 없음 |
편집 요약 없음 |
||
| 9번째 줄: | 9번째 줄: | ||
} | } | ||
function initializeCreatePageUw() { | |||
var input = document.getElementById( | |||
'mw-input-wptitle' | |||
function | |||
' | |||
); | ); | ||
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 | |||
); | ); | ||
} | } | ||
2026년 7월 25일 (토) 00:43 판
( 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();
}
}() );