LLWiki正在建设中,欢迎加入我们!
“Widget:Sif-song-table”的版本间差异
跳转到导航
跳转到搜索
小 标签:移动版网页编辑 移动版编辑 |
小 |
||
第1行: | 第1行: | ||
<noinclude>{{doc|content=用于[[LoveLive!学园偶像祭歌曲列表]]。}}</noinclude><includeonly><!--{if !isset($wgWidgetSifSongTable) || !$wgWidgetSifSongTable}--><!--{assign var="wgWidgetSifSongTable" value=true scope="global"}--><script> |
<noinclude>{{doc|content=用于[[LoveLive!学园偶像祭歌曲列表]]。}}[[category:混合小部件]]</noinclude><includeonly><!--{if !isset($wgWidgetSifSongTable) || !$wgWidgetSifSongTable}--><!--{assign var="wgWidgetSifSongTable" value=true scope="global"}--><script defer src='/zh?title=</includeonly><noinclude><p>JavaScript脚本:[[</noinclude>User:Bhsd/widget/sif-song-table.js<noinclude>]]</p></noinclude><includeonly>&action=raw&ctype=text/javascript'></script><style> |
||
//</includeonly>JavaScript脚本:<pre lang="js"> |
|||
window.addEventListener('load', function() { |
|||
const skin = mw.config.get('skin'); |
|||
document.querySelectorAll( '.sif-song-table' ).forEach(function(table) { |
|||
if(skin == 'minerva') { |
|||
let ele = table.querySelector('.tabs-content'); |
|||
ele.appendChild(ele.nextSibling); |
|||
} |
|||
table.querySelectorAll( '.tabs-dropdown li' ).forEach(function(ele, i) { |
|||
var attr = ele.textContent.toLowerCase().replace('-', ''); |
|||
if(table.querySelector('td[data-' + attr + ']') !== null) { |
|||
ele.onclick = function() { |
|||
table.querySelector( '.tabs-label' ).textContent = ele.textContent; |
|||
table.querySelectorAll( 'td[data-easy]' ).forEach(function(e) { |
|||
e.textContent = e.dataset[attr] || '/'; |
|||
}); |
|||
}; |
|||
} |
|||
else { ele.remove(); } |
|||
}); |
|||
}); |
|||
}); |
|||
//</pre> |
|||
<includeonly> |
|||
</script><style> |
|||
/* </includeonly>CSS样式表:<pre lang="css"> */ |
/* </includeonly>CSS样式表:<pre lang="css"> */ |
||
.sif-song-table { |
.sif-song-table { |
2020年11月27日 (五) 06:12的版本
JavaScript脚本:User:Bhsd/widget/sif-song-table.js
CSS样式表:
*/
.sif-song-table {
text-align:center;
}
.sif-song-table .tabs-dropdown {
width:auto !important;
}
.sif-song-table .tabs-content {
border-radius:0 0 8px 8px;
}
.sif-song-table .tabs-dropdown ul {
padding:0;
}
.sif-song-table .tabs-dropdown li:last-child {
border-radius:0 0 8px 8px;
}
/*