(새 문서: function getRootPageName() { var title = mw.config.get("wgTitle"); return title.split("/")[0]; } var tools = document.querySelector(".content-tools"); var namespace = mw.config.get...) |
편집 요약 없음 |
||
(같은 사용자의 중간 판 9개는 보이지 않습니다) | |||
4번째 줄: | 4번째 줄: | ||
} | } | ||
var tools = document.querySelector(". | var tools = document.querySelector(".btn-group"); | ||
var namespace = mw.config.get("wgNamespaceNumber"); | var namespace = mw.config.get("wgNamespaceNumber"); | ||
if (namespace === 2 || namespace === 3) { | if (namespace === 2 || namespace === 3) { | ||
var link = document.createElement("a"); | var link = document.createElement("a"); | ||
link.textContent = "기여"; | link.textContent = "기여"; | ||
link.href = mw.config.get("wgServer") + mw.config.get("wgArticlePath").replace("$1", "Special:Contributions/" + getRootPageName()); | link.href = mw.config.get("wgServer") + mw.config.get("wgArticlePath").replace("$1", "Special:Contributions/" + getRootPageName()); | ||
link.className="btn btn-secondary tools-btn"; | |||
tools.appendChild( | link.style.marginLeft = "10px"; | ||
tools.appendChild(link); | |||
} | } |
2016년 5월 14일 (토) 01:21 기준 최신판
function getRootPageName() {
var title = mw.config.get("wgTitle");
return title.split("/")[0];
}
var tools = document.querySelector(".btn-group");
var namespace = mw.config.get("wgNamespaceNumber");
if (namespace === 2 || namespace === 3) {
var link = document.createElement("a");
link.textContent = "기여";
link.href = mw.config.get("wgServer") + mw.config.get("wgArticlePath").replace("$1", "Special:Contributions/" + getRootPageName());
link.className="btn btn-secondary tools-btn";
link.style.marginLeft = "10px";
tools.appendChild(link);
}