미디어위키:Gadget-Vector.js: 두 판 사이의 차이

식물 vs 좀비 위키
편집 요약 없음
편집 요약 없음
75번째 줄: 75번째 줄:
spin();
spin();
}
}
}
function shortenHistoryLabel() {
var historyLink = document.querySelector('#ca-history > a');
if (!historyLink) {
return;
}
Array.prototype.forEach.call(historyLink.childNodes, function (node) {
if (node.nodeType === Node.TEXT_NODE) {
node.nodeValue = node.nodeValue.replace(/역사 보기/g, '역사');
}
});
if (historyLink.textContent.trim() === '역사 보기') {
historyLink.textContent = '역사';
}
historyLink.setAttribute('title', '역사');
}
}


80번째 줄: 101번째 줄:
var observer;
var observer;


shortenHistoryLabel();
syncFromMarkup();
syncFromMarkup();
document.addEventListener('click', handleClick, true);
document.addEventListener('click', handleClick, true);


observer = new MutationObserver(function () {
observer = new MutationObserver(function () {
shortenHistoryLabel();
syncFromMarkup();
syncFromMarkup();
});
});