注意:在保存之后,您可能需要清除浏览器缓存才能看到所作出的变更的影响。
?_=1来访问最新页面。https://mzh.moegirl.org.cn/User:%E6%98%9F%E6%B5%B7%E5%AD%90/Gadgets-apple-js.js?_=1/* <pre>
为Apple环境 ( Macintosh / iPhone / iPad / iPod ) 修复bug
*apple-js[ResourceLoader|type=general|default|targets=desktop,mobile]|apple-js.js
在桌面端和移动端通用的JS,默认对所有用户(含IP)开启,不需要的登录用户可通过参数设置关闭。
注意:1.iPad部分机型默认请求桌面网站,userAgent和platform均与Mac相同,需通过maxTouchPoints判断;
2.iPod的userAgent包含iPhone OS。
*/
$(function () {
if ( /Macintosh|iPhone|iPad/.test(navigator.userAgent) ) {
//{{彩幕}}无法刮开
mw.hook("wikipage.content").add(function ($content) {
$content.find(".colormu").each(function () {
const $this = $(this);
$this.hover( function () {
const
bg = $this.data("backgroundColor") || $this.css("background-color"),
abg = bg.replace(/\brgba?\((\d+,\s*\d+,\s*\d+).*?\)/, "rgba($1, .17)");
$this.data('backgroundColor', bg).css("background-color", abg);
}, function () {
if (!$this.hasClass("colormu_toggle_on")) {
$this.css("background-color", $this.data("backgroundColor"));
}
});
});
});
// {{文字模糊}}无法刮开
mw.hook('wikipage.content').add(function ($content) {
mw.loader.addStyleTag('.wenzimohu, .wenzimohu * { transition-duration: 0.75s; }');
$content.find(".wenzimohu , .wenzimohu *").filter(function () {
return $(this).css("color") == "rgba(0, 0, 0, 0)";
})
.hover( function () {
$(this).css( "color", ($(this).css("text-shadow").match(/rgb\(.*?\)/) || ["inherit"])[0]);
}, function () {
$(this).css("color", "rgba(0, 0, 0, 0)");
});
});
}
});
//</pre>