“Widget:Bgimage”的版本间差异

删除473字节 、​ 2022年5月17日 (二) 19:50
//使用页面/文本对比查看器快速编辑
(撤销Bhsd讨论)的版本11193)
标签撤销
(//使用页面/文本对比查看器快速编辑)
 
(未显示同一用户的8个中间版本)
<noinclude>{{doc|content=用于在桌面版添加背景图片,请使用{{tl|背景图片}}调用。}}</noinclude><includeonly><!--{if !isset($wgBgimage) || !$wgBgimage}--><!--{assign var="wgBgimage" value=true scope="global"}--><script>
 
//</includeonly>JavaScript脚本:<pre lang=js>
==外部链接==
window.addEventListener('load', function () {
{{CCnotice|MGP=widget:sideBarPic}}}}[[category:混合小部件]]
if(mw.config.get('skin') == 'vector') {
<p>JavaScript脚本:[[User:Bhsd/widget/bgimage.js]]</p></noinclude><includeonly><!--{if !isset($wgBgimage) || !$wgBgimage}--><!--{assign var="wgBgimage" value=true scope="global"}--><script defer src="/zh?title=user:bhsd/widget/bgimage.js&action=raw&ctype=text/javascript"></script><style>
var ele = document.querySelector('.bgimage'),
url = ele.dataset.url,
logo = document.querySelector('#p-logo');
if (/^(?:(?:https:)?\/\/llwiki\.org)?\/mediawiki\//.test( url )) {
var img = document.createElement('img');
img.src = url;
img.style.objectPosition = ele.dataset.position;
ele.appendChild(img);
ele.style.opacity = ele.dataset.opacity;
document.body.appendChild(ele);
}
if (ele.dataset.logo == 'off') { logo.style.visibility = 'hidden'; }
}
});
//</pre>
<includeonly>
</script><style>
/* </includeonly>CSS样式表:<pre lang="css"> */
.bgimage {
display: none;
position: fixed;
left: 0;
16,874

个编辑