틀:Exercise: 두 판 사이의 차이

잔글 ("틀:Exercise" 문서를 보호했습니다 ([편집=관리자만 허용] (무기한) [이동=관리자만 허용] (무기한)))
편집 요약 없음
1번째 줄: 1번째 줄:
<html><a href="</html>{{#invoke:Exercise|make}}<html>" class="mw-ui-button">개인 연습장 만들기</a></html>
<html>
<div id="sandbox-button"></div>
<script>
document.addEventListener("DOMContentLoaded", function () {
    const username = mw.config.get("wgUserName");
    if (!username) return;
 
    const now = new Date();
    const pad = n => n.toString().padStart(2, '0');
    const y = now.getFullYear();
    const m = pad(now.getMonth() + 1);
    const d = pad(now.getDate());
    const h = pad(now.getHours());
    const min = pad(now.getMinutes());
 
    const timestamp = `${y}${m}${d}${h}${min}`;
    const page = `연습장:${username}/${timestamp}`;
    const link = `/wiki/index.php?title=${encodeURIComponent(page)}&action=edit&redlink=1&summary=${encodeURIComponent("개인 연습장 생성")}`;
 
    const a = document.createElement("a");
    a.href = link;
    a.className = "mw-ui-button";
    a.textContent = `연습장(${timestamp}) 만들기`;
 
    document.getElementById("sandbox-button").appendChild(a);
});
</script>
</html>

2025년 4월 9일 (수) 14:26 판