미디어위키:Common.js: 두 판 사이의 차이
Resultofunion (토론 | 기여) 편집 요약 없음 |
Resultofunion (토론 | 기여) 편집 요약 없음 |
||
| (같은 사용자의 중간 판 16개는 보이지 않습니다) | |||
| 20번째 줄: | 20번째 줄: | ||
var $duplicates = document.getElementById('mw-imagepage-section-duplicates'); | var $duplicates = document.getElementById('mw-imagepage-section-duplicates'); | ||
if ($duplicates) $duplicates.parentElement.removeChild($duplicates); | if ($duplicates) $duplicates.parentElement.removeChild($duplicates); | ||
// 모든 문서 목록 검색 box 삭제 | |||
var $wrapper = document.querySelector('.mw-htmlform-ooui-wrapper') | |||
if ($wrapper) $wrapper.parentElement.removeChild($wrapper); | |||
} | } | ||
| 94번째 줄: | 98번째 줄: | ||
/* 각주 팝업창 위치 보정 */ | /* 각주 팝업창 위치 보정 */ | ||
// MutationObserver를 사용하여 DOM 변경 사항 감지 | |||
var observer = new MutationObserver(function (mutationList){ | |||
mutationList.forEach(function(mutation){ | |||
mutation.addedNodes.forEach(function (node) { | |||
if (node.classList && node.classList.contains('mwe-popups')) { | |||
requestAnimationFrame(function () { | |||
var bodyLeft = document.body.getBoundingClientRect().left; | |||
var left = parseInt(window.getComputedStyle(node).left); | |||
node.style.left = left - bodyLeft + 'px'; | |||
}); | |||
} | |||
} | }) | ||
}) | |||
}) | |||
) | // 감시할 대상 설정 | ||
observer.observe(document.body, { | |||
childList:true, | |||
subtree:true | |||
}) | |||
/* 우클릭 방지 */ | /* 우클릭 방지 */ | ||
| 119번째 줄: | 127번째 줄: | ||
}; | }; | ||
} | } | ||
/* 존재하지 않는 문서 페이지의 '기록' 링크 삭제 */ | /* 존재하지 않는 문서 페이지의 '기록' 링크 삭제 */ | ||
| 307번째 줄: | 316번째 줄: | ||
} | } | ||
}); | }); | ||
// 데스크탑 언어 | |||
var langDiv = document.getElementById('right-navigation'); | |||
if(langDiv){ | |||
var navHTML = '<nav id="p-cactions" class="mw-portlet mw-portlet-cactions vector-menu-dropdown-noicon vector-menu vector-menu-dropdown" aria-labelledby="p-cactions-label" role="navigation">' + | |||
'<input type="checkbox" id="p-cactions-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-p-cactions" class="vector-menu-checkbox" aria-labelledby="p-cactions-label">' + | |||
'<label id="p-cactions-label" aria-label="" class="vector-menu-heading">' + | |||
'<span class="select-language"></span>' + | |||
'<span class="vector-menu-heading-label">Language</span>' + | |||
'</label>' + | |||
'<div class="vector-menu-content">' + | |||
'<ul class="vector-menu-content-list">' + | |||
'<li class="mw-list-item"><a href="https://watv.kr/en" title="Church of God Knowledge Encyclopedia"><span>English (영어)</span></a></li>' + | |||
'<li class="mw-list-item"><a href="https://watv.kr/es" title="ChurchEnciclopedia de conocimiento de la Iglesia de Dios"><span>Spanish</span></a></li>' + | |||
'<li class="mw-list-item"><a href="https://watv.kr/vi" title="Từ điển tri thức Hội Thánh của Đức Chúa Trời"><span>Vietnamese</span></a></li>' + | |||
'<li class="mw-list-item"><a href="https://watv.kr/ne" title="नेपाली"><span>Nepali</span></a></li>' + | |||
'<li class="mw-list-item"><a href="https://watv.kr/pt" title="ENCICLOPÉDIA DO CONHECIMENTO DA IGREJA DE DEUS"><span>português</span></a></li>' + | |||
'</ul>' + | |||
'</div>' + | |||
'</nav>'; | |||
langDiv.insertAdjacentHTML('afterbegin', navHTML); | |||
} | |||