mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
45 lines
1.4 KiB
JavaScript
45 lines
1.4 KiB
JavaScript
(() =>
|
|
{
|
|
return (settings, resources) =>
|
|
{
|
|
new SpinQuery(
|
|
() => $(".head-content.bili-wrapper>div.search:not(.filter-item)"),
|
|
it => it.length > 0 && $(".nav-con.fr").filter((_, it) => it.innerText).length > 0,
|
|
textBox =>
|
|
{
|
|
const rightNav = $(".nav-con.fr").filter((_, it) => it.innerText);
|
|
textBox.detach()
|
|
// insert after only the "real" right-nav. There will be 2 in Edge...
|
|
.insertAfter(rightNav);
|
|
}
|
|
).start();
|
|
|
|
if (settings.preserveRank)
|
|
{
|
|
SpinQuery.any(
|
|
() => $(".head-content.bili-wrapper>div.search:not(.filter-item) .searchform,.nav-con #nav_searchform"),
|
|
searchForm =>
|
|
{
|
|
searchForm.addClass("preserve-rank");
|
|
searchForm.prepend(`
|
|
<a title="排行榜"
|
|
class="icons-enabled"
|
|
href="https://www.bilibili.com/ranking"
|
|
target="_blank">
|
|
<i class="icon-rank"></i>
|
|
</a>
|
|
`);
|
|
}
|
|
);
|
|
}
|
|
|
|
if (!settings.showBanner)
|
|
{
|
|
resources.applyStyle("noBannerStyle");
|
|
}
|
|
else
|
|
{
|
|
resources.removeStyle("noBannerStyle");
|
|
}
|
|
};
|
|
})(); |