MediaWiki:Common.js:修订间差异
小无编辑摘要 标签:手工回退 |
小无编辑摘要 |
||
| 第27行: | 第27行: | ||
} | } | ||
} | } | ||
}); | |||
// logo 切换逻辑 | |||
$(function () { | |||
function updateCopyrightIcon() { | |||
var $icon = $('#footer-copyrightico img'); | |||
if ($icon.length === 0) return; | |||
if (document.documentElement.classList.contains('skin-theme-clientpref-night')) { | |||
$icon.attr('src', '/resources/assets/cc-by-nc-sa-dark.svg'); | |||
} else { | |||
$icon.attr('src', '/resources/assets/cc-by-nc-sa.svg'); | |||
} | |||
} | |||
// 页面加载时执行一次 | |||
updateCopyrightIcon(); | |||
// 监听深浅模式切换 | |||
var observer = new MutationObserver(updateCopyrightIcon); | |||
observer.observe(document.documentElement, { attributes: true, attributeFilter: ['class'] }); | |||
}); | }); | ||