266
个编辑
imported>=海豚= 无编辑摘要 |
小 (文本替换 - 替换“window.RLQ.push(”为“window.addEventListener('jquery-ready', ”) |
||
| (未显示1个用户的3个中间版本) | |||
| 第1行: | 第1行: | ||
<noinclude>Only for {{tl|Music163}}</noinclude><includeonly><!--{if !isset($wgMusic163) || !$wgMusic163}--><!--{assign var="wgMusic163" value=true scope="global"}--><script> | <noinclude>Only for {{tl|Music163}}</noinclude><includeonly><!--{if !isset($wgMusic163) || !$wgMusic163}--><!--{assign var="wgMusic163" value=true scope="global"}--><script> | ||
"use strict"; | "use strict"; | ||
window. | window.addEventListener('jquery-ready', () => { | ||
try { | try { | ||
const types = ["playlist", "album", "song", "program", "djradio"]; | const types = ["playlist", "album", "song", "program", "djradio"]; | ||
| 第77行: | 第77行: | ||
else { height_type = 430; } | else { height_type = 430; } | ||
if (float !== "none") { self.addClass(`float-${float}`); } | if (float !== "none") { self.addClass(`float-${float}`); } | ||
self.empty().append(`<a rel="nofollow noreferrer noopener" class="external text" href="https://music.163.com/#/${types[+type]}?id=${id}" target="_blank"><img src="https://s1.music.126.net/music.ico"></a><span class="music163CopyrightNotice">[<a href="javascript:void(0);">版权受限</a>]</span>`).attr("title", `${title || that.title || `id ${id}`} - 网易云音乐`); | self.empty().append(`<a rel="nofollow noreferrer noopener" class="external text" href="https://music.163.com/#/${types[+type]}?id=${id}" target="_blank"><img src="https://s1.music.126.net/music.ico"></a><span class="music163CopyrightNotice">[<a href="javascript:void(0);" style="color:#36b!important;">版权受限</a>]</span>`).attr("title", `${title || that.title || `id ${id}`} - 网易云音乐`); | ||
const iframe = $("<iframe/>"); | const iframe = $("<iframe/>"); | ||
iframe.attr("data-src", `//music.163.com/outchain/player?type=${type}&id=${id}&auto=0&height=${height_type}`); | iframe.attr("data-src", `//music.163.com/outchain/player?type=${type}&id=${id}&auto=0&height=${height_type}`); | ||
| 第106行: | 第106行: | ||
}); | }); | ||
self.find(".music163CopyrightNotice a").on("click", () => { | self.find(".music163CopyrightNotice a").on("click", () => { | ||
alert("网易云音乐限制了部分地区版权音乐的站外播放功能,如果您发现播放器无法显示或播放歌曲,则说明该歌曲被限制站 | alert("网易云音乐限制了部分地区版权音乐的站外播放功能,如果您发现播放器无法显示或播放歌曲,则说明该歌曲被限制 在本 站播放。\n我们建议点击播放器右侧网易云音乐图标,跳转到歌曲页面欣赏。"); | ||
}); | }); | ||
self.width(iframe.width() + self.find(".music163CopyrightNotice").width()); | self.width(iframe.width() + self.find(".music163CopyrightNotice").width()); | ||
| 第117行: | 第117行: | ||
} catch (e) { | } catch (e) { | ||
// eslint-disable-next-line prefer-template | // eslint-disable-next-line prefer-template | ||
prompt(" | prompt(" 网易云音乐 模板执行出现问题,请复制以下内容并 前往萌百的 提问求助区处粘贴寻求帮助:", navigator.userAgent + " : " + e + " " + e.stack.split("\n")[1].trim()); | ||
} | } | ||
}); | }); | ||