미디어위키:Gadget-Vector.js: 두 판 사이의 차이
식물 vs 좀비 위키
태그: 편집 취소 |
편집 요약 없음 |
||
| 255번째 줄: | 255번째 줄: | ||
'use strict'; | 'use strict'; | ||
function | function removeObsoleteInterface() { | ||
var ids = ['pvz-related-toggle', 'pvz-related-menu']; | var ids = [ | ||
'pvz-related-toggle', | |||
'pvz-related-menu', | |||
'pvz-right-panel', | |||
'pvz-left-panel-toggle', | |||
'pvz-right-panel-toggle' | |||
]; | |||
ids.forEach(function (id) { | ids.forEach(function (id) { | ||
| 267번째 줄: | 273번째 줄: | ||
} | } | ||
function | function restoreLogoToPanel(panel) { | ||
var wrapper = document.getElementById('pvz-sidebar-logo'); | var wrapper = document.getElementById('pvz-sidebar-logo'); | ||
var logo = | |||
(wrapper && wrapper.querySelector('#p-logo')) || | |||
document.querySelector('#p-logo'); | |||
if (! | if (!panel || !logo) { | ||
return; | return; | ||
} | } | ||
if (! | if (logo.parentNode !== panel) { | ||
panel.insertBefore(logo, panel.firstChild); | |||
} | } | ||
if ( | if (wrapper) { | ||
wrapper. | wrapper.remove(); | ||
} | } | ||
} | } | ||
| 310번째 줄: | 316번째 줄: | ||
} | } | ||
function | function installV27Interface() { | ||
var panel = document.querySelector('.skin-vector-legacy #mw-panel'); | var panel = document.querySelector('.skin-vector-legacy #mw-panel'); | ||
removeObsoleteInterface(); | |||
restoreLogoToPanel(panel); | |||
syncPanelTop(); | syncPanelTop(); | ||
syncSearchLeft(); | syncSearchLeft(); | ||
} | } | ||
function | function initV27Interface() { | ||
installV27Interface(); | |||
window.addEventListener('resize', function () { | window.addEventListener('resize', function () { | ||
| 338번째 줄: | 340번째 줄: | ||
if (document.readyState === 'loading') { | if (document.readyState === 'loading') { | ||
document.addEventListener('DOMContentLoaded', | document.addEventListener('DOMContentLoaded', initV27Interface, { once: true }); | ||
} else { | } else { | ||
initV27Interface(); | |||
} | } | ||
}()); | }()); | ||
