Widget:BilibiliVideo:修订间差异
跳到导航
跳到搜索
imported>=海豚= 无编辑摘要 |
(fix) |
||
| (未显示1个用户的10个中间版本) | |||
| 第108行: | 第108行: | ||
</style><script> | </style><script> | ||
"use strict"; | "use strict"; | ||
window. | window.addEventListener('jquery-ready', () => { | ||
const errMsg = { | const errMsg = { | ||
id: '此处填写的id有误,请参考<a href="https://zh.moegirl.org.cn/Template:BilibiliVideo#firstHeading" target="_blank">模板文档</a>修正……', | id: '此处填写的id有误,请参考<a href="https://zh.moegirl.org.cn/Template:BilibiliVideo#firstHeading" target="_blank">模板文档</a>修正……', | ||
| 第345行: | 第345行: | ||
} | } | ||
const time = secondsParser(t); | const time = secondsParser(t); | ||
title_text.text(`${(title || prefix.href + id) + (![0, 1].includes(page) ? ` (P${page})` : "") + (tIsInvalid ? "" : `[视频从${time}开始播放]`)} | title_text.text(`${(title || prefix.href + id) + (![0, 1].includes(page) ? ` (P${page})` : "") + (tIsInvalid ? "" : `[视频从${time}开始播放]`)}`); | ||
iframeContainer.css({ | iframeContainer.css({ | ||
width: width, | width: width, | ||
| 第421行: | 第421行: | ||
lazyLoadObserver.observe(iframe[0]); | lazyLoadObserver.observe(iframe[0]); | ||
}, | }, | ||
}); | }); | ||
//toggle | |||
selfbox.find(".bilibili-widescreen").on("click", (_, ele) => { | |||
const self = $(ele); | |||
if (selfbox.is(":not(.onshow)")) { return; } | |||
if (selfbox.is(".widescreen")) { | |||
selfbox.removeClass("widescreen"); | |||
self.text("显示宽屏"); | |||
recallWH(iframeContainer); | |||
recallWH(iframe); | |||
recallWH(selfbox); | |||
} else { | |||
selfbox.addClass("widescreen"); | |||
self.text("退出宽屏"); | |||
rememberWH(selfbox); | |||
selfbox.css("width", selfbox.parent().width() > Math.min(911, global_element.width()) ? "73%" : "100%"); //可以看见按钮的最小宽度 665 的 1/0.73 倍 | |||
setTureHeight(selfbox); | |||
rememberWH(iframe); | |||
rememberWH(iframeContainer); | |||
setWH(iframe); | |||
setWH(iframeContainer); | |||
iframeContainer.height(selfbox.height() - title_text.parent().height()); | |||
setMaxHeight(selfbox, iframeContainer); | |||
} | |||
}); | |||
}); | |||
}; | |||
$(run); | $(run); | ||
mw.hook("wikipage.content").add(run); | mw.hook("wikipage.content").add(run); | ||
2022年11月20日 (日) 17:07的最新版本
| 名称: | Bilibili视频插件 |
| 作者: | 加大号的猫 |
| 修订: | Boxsnake |
| 重修订: | AnnAngela |
| H5版再修订: | |
| 新H5版又修订: | |
| 移动版支持: | XYZ指示物 |
| 版权协定: | MIT |
| 发布日期: | 2012年6月29日第一版发布; |
| 发布地址: | https://zh.moegirl.org.cn/Widget:BilibiliVideo && https://zh.moegirl.org.cn/Template:BilibiliVideo |
| 注意事项: | 如有问题,请联系作者。 |
本Widget不能单独使用,请使用{{BilibiliVideo}}!