欢迎来到纸飞机Wiki !
纸飞机Wiki目前包含43个页面,303次编辑,6个用户。
微件:BilibiliVideo:修订间差异
来自纸飞机Wiki
无编辑摘要 |
无编辑摘要 |
||
| (未显示同一用户的27个中间版本) | |||
| 第10行: | 第10行: | ||
<h2>修改记录</h2> | <h2>修改记录</h2> | ||
'''本站与萌娘百科存在环境差异,为了让该Widget能正常使用,做出了一定的修改''' | |||
*1. 删除了一个和萌娘百科自定义皮肤相关的if分支 | |||
*2. 修复了一个jquery调用异常:将“window.RLQ.push(async ()...)”改为“window.RLQ.push(['jquery',async ()...])”<br>参考自[https://wiki.guildwars2.com/wiki/User:Chieftain%20Alex/MediaWiki 该信息发布页]的mediawiki1.32+/Broken Stuff一节 | |||
*3. 解决了视频无法加载的问题:b站的newplayer只能被[https://s1.hdslb.com/bfs/seed/jinkela/short/player/whitelist.js 白名单]网站使用,因此改用默认player | |||
*4. 解决了默认player播放器点击非按钮区域会弹窗到b站页面的问题:为iframe增加了sandbox相关属性,使全部跳转失效 | |||
*5. 修复并优化了该模板的响应式布局 | |||
</noinclude> | </noinclude> | ||
<includeonly><!--{if !isset($wgBilibili) || !$wgBilibili}--><!--{assign var="wgBilibili" value=true scope="global"}--><style> | <includeonly><!--{if !isset($wgBilibili) || !$wgBilibili}--><!--{assign var="wgBilibili" value=true scope="global"}--><style> | ||
.bilibili-video-container { | .bilibili-video-container { | ||
border: 1px solid rgba(170,170,170,0.37); | border: 1px solid rgba(170,170,170,0.37); | ||
max-width: | max-width: 96vw!important; | ||
} | } | ||
.bilibili-video-container.exec { | .bilibili-video-container.exec { | ||
| 第29行: | 第40行: | ||
.bilibili-video-container .bilibili-widescreen, | .bilibili-video-container .bilibili-widescreen, | ||
.bilibili-video-container iframe { | .bilibili-video-container iframe { | ||
background-color: #fff!important; | background-color: #fff!important; | ||
} | |||
.bilibili-video-container iframe{ | |||
width: 100%!important; | |||
height: 100%!important; | |||
} | } | ||
.bilibili-title { | .bilibili-title { | ||
padding: .2em 6.5em .2em 1em; | padding: .2em 6.5em .2em 1em; | ||
position: relative; | position: relative; | ||
max-width: 100%!important; | |||
} | } | ||
.bilibili-title a { | .bilibili-title a { | ||
| 第52行: | 第67行: | ||
} | } | ||
.onshow .bilibili-widescreen{ | .onshow .bilibili-widescreen{ | ||
display: | color:brown; | ||
display: contents; | |||
} | } | ||
.bilibili-toggle { | .bilibili-toggle { | ||
| 第87行: | 第103行: | ||
border: 0 solid rgba(170,170,170,0.37); | border: 0 solid rgba(170,170,170,0.37); | ||
border-top-width: 1px; | border-top-width: 1px; | ||
box-sizing: border-box; | |||
} | } | ||
.bilibili-video-container:not([data-max-width]) .bilibili-iframe-container { | .bilibili-video-container:not([data-max-width]) .bilibili-iframe-container { | ||
max-width: | max-width: 100%; | ||
} | } | ||
.bilibili-video-container:not([data-max-width]).onshow .bilibili-iframe-container { | .bilibili-video-container:not([data-max-width]).onshow .bilibili-iframe-container { | ||
| 第281行: | 第298行: | ||
}, | }, | ||
setWH = function setWH(ele) { | setWH = function setWH(ele) { | ||
ele.css({ width: "100%", height: "100%" }); | ele.css({ width:"100%", height: "100%" }); | ||
}, | }, | ||
recallWH = function recallWH(ele) { | recallWH = function recallWH(ele) { | ||
| 第336行: | 第353行: | ||
const width = cssLengthUnitValidator(dataset.width, "665px", (isValidated) => isValidated || selfbox.removeAttr("data-width"), "width", selfbox); | const width = cssLengthUnitValidator(dataset.width, "665px", (isValidated) => isValidated || selfbox.removeAttr("data-width"), "width", selfbox); | ||
const maxHeight = cssLengthUnitValidator(dataset.maxHeight, "100vh", (isValidated) => isValidated || selfbox.removeAttr("data-max-height"), "maxHeight", selfbox); | const maxHeight = cssLengthUnitValidator(dataset.maxHeight, "100vh", (isValidated) => isValidated || selfbox.removeAttr("data-max-height"), "maxHeight", selfbox); | ||
const maxWidth = cssLengthUnitValidator(dataset.maxWidth, " | const maxWidth = cssLengthUnitValidator(dataset.maxWidth, "95vw", (isValidated) => isValidated || selfbox.removeAttr("data-max-width"), "maxWidth", selfbox); | ||
const subtitle = dataset.subtitle === "true" ? true : false; | const subtitle = dataset.subtitle === "true" ? true : false; | ||
const t = parseInt(dataset.t); | const t = parseInt(dataset.t); | ||
| 第353行: | 第370行: | ||
"class": "bilibili-iframe", | "class": "bilibili-iframe", | ||
// 纸飞机Wiki: 添加sandbox属性,阻止单击iframe内部时弹出的b站页面 | // 纸飞机Wiki: 添加sandbox属性,阻止单击iframe内部时弹出的b站页面 | ||
"sandbox": "allow-forms allow-pointer-lock allow-same-origin allow-scripts", | "sandbox": "allow-forms allow-pointer-lock allow-same-origin allow-scripts allow-top-navigation", | ||
"max-width": "95vw", | |||
}).css({ | }).css({ | ||
width: width, | width: width, | ||
height: height, | height: height, | ||
}); | }); | ||
if (!tIsInvalid) { | if (!tIsInvalid) { | ||
2023年5月2日 (二) 00:31的最新版本
介绍
该Widget引用自: 萌娘百科
出处&使用说明: https://zh.moegirl.org.cn/Widget:BilibiliVideo
本Widget不能单独使用,请使用Template:BilibiliVideo!
修改记录
本站与萌娘百科存在环境差异,为了让该Widget能正常使用,做出了一定的修改
- 1. 删除了一个和萌娘百科自定义皮肤相关的if分支
- 2. 修复了一个jquery调用异常:将“window.RLQ.push(async ()...)”改为“window.RLQ.push(['jquery',async ()...])”
参考自该信息发布页的mediawiki1.32+/Broken Stuff一节
- 3. 解决了视频无法加载的问题:b站的newplayer只能被白名单网站使用,因此改用默认player
- 4. 解决了默认player播放器点击非按钮区域会弹窗到b站页面的问题:为iframe增加了sandbox相关属性,使全部跳转失效
- 5. 修复并优化了该模板的响应式布局
