LLWiki正在建设中,欢迎加入我们!
“Widget:Sif-song-table”的版本间差异
跳转到导航
跳转到搜索
小 |
小 |
||
第11行: | 第11行: | ||
ele.onclick = function() { |
ele.onclick = function() { |
||
table.querySelector( '.tabs-label' ).textContent = ele.textContent; |
table.querySelector( '.tabs-label' ).textContent = ele.textContent; |
||
table.querySelectorAll( 'td |
table.querySelectorAll( 'td[data-easy]' ).forEach(function(e) { |
||
e. |
e.textContent = e.dataset[ ele.textContent.toLowerCase() ] || '/'; |
||
}); |
|||
table.querySelectorAll( 'td:nth-last-child(-n+2)' ).forEach(function(e) { |
|||
let level = e.querySelector( ':scope > span:nth-child(' + (i+1) + ')' ); |
|||
level.style.display = 'initial'; |
|||
e.dataset.sortValue = level.textContent; |
|||
}); |
}); |
||
}; |
}; |
||
第29行: | 第24行: | ||
.sif-song-table { |
.sif-song-table { |
||
text-align:center; |
text-align:center; |
||
⚫ | |||
.sif-song-table .tabs-dropdown { |
|||
width:auto !important; |
|||
} |
} |
||
.sif-song-table .tabs-content { |
.sif-song-table .tabs-content { |
||
第38行: | 第36行: | ||
.sif-song-table .tabs-dropdown li:last-child { |
.sif-song-table .tabs-dropdown li:last-child { |
||
border-radius:0 0 8px 8px; |
border-radius:0 0 8px 8px; |
||
⚫ | |||
.sif-song-table td:nth-last-child(-n+2) > span { |
|||
display:none; |
|||
} |
} |
||
/* </pre><includeonly> */ |
/* </pre><includeonly> */ |
2020年10月15日 (四) 23:22的版本
JavaScript脚本:
window.addEventListener('load', function() {
var 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) {
ele.onclick = function() {
table.querySelector( '.tabs-label' ).textContent = ele.textContent;
table.querySelectorAll( 'td[data-easy]' ).forEach(function(e) {
e.textContent = e.dataset[ ele.textContent.toLowerCase() ] || '/';
});
};
});
});
});
//
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;
}
/*