Merge branch 'preview' of https://github.com/the1812/Bilibili-Evolved into preview

This commit is contained in:
the1812 2021-01-16 16:40:43 +08:00
commit da7d49458c
11 changed files with 167 additions and 77 deletions

View File

@ -612,83 +612,117 @@
@include foreground-color();
}
}
.home-page {
.publish-panel {
.core-style {
@include background-color();
.publish-panel {
.core-style {
@include background-color();
@include color("e");
@include border-color();
&:hover,
&:focus-within,
&:active {
@include theme-border-color();
}
}
.editor .placeholder-shown::before {
@include color("8");
}
.schedule-bar {
@include background-color("3");
.s-label,
.dp-label {
@include color("e");
}
.scroll-input .s-input {
@include background-color("2");
@include color("e");
@include border-color();
&:hover,
&:focus-within,
&:active {
@include theme-border-color();
}
}
.editor .placeholder-shown::before {
@include color("8");
}
.schedule-bar {
@include background-color("3");
.s-label,
.dp-label {
.s-panel {
@include background-color("2");
@include border-color();
.s-item {
@include color("e");
}
.scroll-input .s-input {
@include background-color("2");
@include color("e");
@include border-color();
}
.s-panel {
@include background-color("2");
@include border-color();
.s-item {
@include color("e");
&:hover {
@include theme-color();
}
&:hover {
@include theme-color();
}
}
}
.toolbar {
.static-popup {
}
.toolbar {
.static-popup {
@include background-color("2");
@include border-color();
.title {
@include color("e");
}
.upload-image .upload-btn:hover {
@include theme-color();
@include theme-border-color();
}
}
.bp-vote-container {
.create-vote {
@include background-color("2");
@include color("e");
@include border-color();
.title {
@include color("e");
}
.upload-image .upload-btn:hover {
@include theme-color();
@include theme-border-color();
.bp-button:nth-child(2) {
@include theme-background();
@include foreground-color();
}
}
.bp-vote-container {
.create-vote {
}
.publish-launcher {
.indicator {
@include color("a");
&::after {
@include color("a");
}
}
.publish-btn {
@include theme-background-color();
@include foreground-color();
&.disabled {
@include background-color("2");
@include color("e");
@include border-color();
.title {
@include color("e");
}
.bp-button:nth-child(2) {
@include theme-background();
@include foreground-color();
}
}
}
.publish-launcher {
.indicator {
@include color("a");
&::after {
@include color("a");
}
}
.hash-popup {
@include background-color("2");
@include border-color();
.hint {
@include color("a");
}
.topic-container .item {
@include color("e");
&.is-selected {
@include background-color("3");
}
.publish-btn {
@include theme-background-color();
@include foreground-color();
&.disabled {
@include background-color("2");
@include color("e");
}
}
}
.bili-at-popup {
@include background-color("2");
@include border-color();
&__hint {
@include color("a");
}
&__group {
&-name {
@include color("e");
}
}
&__user {
&--selected {
@include background-color("3");
}
&-name {
@include color("e");
}
&-fans {
@include color("a");
}
}
}

View File

@ -173,7 +173,7 @@
@include color("e");
}
&__tabs {
@include background-color("5");
@include background-color("2");
.album-list__tab {
&-name {
@include color("e");
@ -910,7 +910,7 @@ html {
}
}
#control-panel-ctnr-box {
@include no-image
@include no-image;
}
.live-web-player-controller {
.vertical-slider-wrap,
@ -926,7 +926,7 @@ html {
.quality-wrap .quality-it.selected {
@include theme-color();
}
input[type='radio']:checked+label::before {
input[type="radio"]:checked + label::before {
@include theme-background-color();
@include theme-border-color();
}
@ -954,9 +954,6 @@ html {
@include theme-background-color();
}
}
.error-body .error-msg .error-img {
@include to-theme("blue");
}
.article-action .more .more-ops-list ul li:hover {
@include theme-color();
}
@ -969,3 +966,29 @@ html {
@include to-theme("blue");
}
}
.international-home .rcmd-box-wrap .change-btn {
@include border-color();
@include color("e");
@include background-color("4");
&:hover {
@include theme-background-color();
}
}
.bangumi-options .opt-list li {
@include background-color("3");
@include color("e");
&:hover {
@include theme-color();
@include background-color("4");
}
&.disabled {
@include color("a");
@include background-color();
}
}
.emoji-tab-slider {
.prev,
.next {
filter: invert(1);
}
}

View File

@ -515,8 +515,6 @@ body>div.to-top.on,
.evaluate .situation span,
.bilibili-live-player .bilibili-live-player-enter-tips,
.nav-header-wrapper .nav-header .nav-header-search-bar-wrapper .suggestion-list,
.publish-panel .hash-popup,
.hash-popup .topic-container .item.is-selected,
.article-holder .bangumi-card a .container,
.article-action .ops .share-container .weixin-holder,
.coin-wrap .coin-sure,
@ -655,7 +653,7 @@ i.settings-category-arrow::after,
.mainmenu ul.grid li.hover a.lbzx,
.carousel .indicator .indicator-btn-holder .indicator-btn.on,
#page-channel-detail .watch-later-btn:hover,
.error-container .error-panel img,
.error-body .error-msg .error-img,
.leaveMsgUpload .btnarea .btnareaIcon,
.coin-operated-m .like-checkbox input[type=checkbox]:checked+i,
.video-list .vl-hd .display-tab li.on,
@ -743,7 +741,6 @@ body>.player #bilibiliPlayer
.mainBox .leaveMsg,
.js-evaluateArea .evaluateDialog,
.project-list .project-list-item:hover,
.publish-panel .hash-popup,
#app .toolbar-wrapper,
.article-action .ops .share-container .weixin-holder,
#article-list-index,

View File

@ -922,7 +922,6 @@ body #app .marquee,
.nav-bar .nav-wrapper .slide-block,
ul.navigation li:after,
.link-panigation .panigation.selected,
.bangumi-item .cover-wrapper .corner-tag.badge_0,
.comment-manage-wrap .content .check-box.checked,
.btn-sponsor-wrapper a.sponsor-btn,
.main-container .sponsor-wrapper .sponsor-right-area .sponsor-btn,

View File

@ -13,7 +13,6 @@
.comment-list-item .ci-action a:hover,
.comment-manage-wrap .content .action-bar .dropdown .action-menu li:hover,
.comment-manage-wrap .content .action-bar .dropdown .sort-menu li:hover,
.hash-popup .topic-container .item.is-selected,
.fjw-kpi-wrap,
.mobile-kpi-head h2,
.mini-progress,

View File

@ -1031,7 +1031,6 @@ input[type="radio"]:checked + .custom-radio,
.main-container .entry-old .feedback .btn,
.main-container .entry-old .feedback .btn:hover,
.main-container .entry-old .btn-old:hover,
.main-container .season-list .ss-list-wrapper .ss-item .ss-cover .ss-badge.pink,
.main-container .pay-bar .sponsor .btn-pay:hover,
.main-container .sponsor-module .sponsor-info .btn-sponsor,
.bilibili-player-feedback-content

View File

@ -63,7 +63,6 @@
.news-dialog-Wrapper,
.box .record-wrap,
.box .content-wrap,
.bangumi-options .opt-list li:hover,
.bui-collapse .bui-collapse-header,
.bpui-selecting > span,
.bpui-unselecting,
@ -307,8 +306,6 @@ li.danmaku-info-row.bpui-selecting,
.empty-wrap .empty-text,
.fjw-point .point-wrap .user-point .face .unfocus-btn,
.sub-tabs .filter-content,
.bangumi-options .opt-list li:hover,
.bangumi-options .opt-list li,
.h5share-container .text-area .text-content,
.navbar-container .logo-part,
.navbar-container .size-ruler .app-title,

View File

@ -157,7 +157,8 @@ export const toolTips = new Map<keyof BilibiliEvolvedSettings, string>([
- <kbd>Shift + w</kbd>
- <kbd>Shift + s</kbd>
- <kbd>Shift + /</kbd> / <kbd>Shift + ,/.</kbd>
- <kbd>Shift + /</kbd> `],
- <kbd>Shift + /</kbd>
- <kbd>0</kbd> `],
['doubleClickFullscreen', /*html*/`允许双击播放器切换全屏, 请注意不能与<span>播放器触摸支持-启用双击控制</span>一同使用.`],
['ajaxHook', /*html*/`是否启用 Ajax Hook API, 其他插件或附加功能能够通过此 API 获取 Ajax 请求的信息.`],
['scriptLoadingMode', /*html*/`脚本功能的加载模式:

View File

@ -31,6 +31,13 @@ abstract class Batch {
itemList: BatchItem[] = []
abstract async getItemList(): Promise<BatchItem[]>
abstract async collectData(quality: number | string): Promise<string>
/**
* Returns formated Title.
*
* @param parameters - TYPE: BatchTitleParameter
* @returns escapeFilename
*
*/
static formatTitle(parameters: BatchTitleParameter | undefined) {
const format = settings.batchFilenameFormat
const title = formatTitle(format, true, parameters)
@ -216,6 +223,12 @@ class BangumiBatch extends Batch {
static async test() {
return document.URL.includes('/www.bilibili.com/bangumi')
}
/**
* Get bangumi from api
*
* @returns a json list of multiple part bangumi
*
*/
async getItemList() {
if (this.itemList.length > 0) {
return this.itemList
@ -245,7 +258,7 @@ class BangumiBatch extends Batch {
title: `${n} - ${title}`,
// title: it.long_title ? `${it.title} - ${it.long_title}` : `${index + 1} - ${it.title}`,
titleParameters: {
n: getNumber(parseInt(n), this.itemList.length),
n: getNumber(parseFloat(n), this.itemList.length, it.title),
ep: title,
},
} as BatchItem

View File

@ -1,5 +1,19 @@
export const getNumber = (n: number, count: number) => {
/**
* count item
*
* @param n - current index
* @param count - the end of the count
* @param raw - default title
* @returns expected number
*/
export const getNumber = (n: number, count: number, raw?: string) => {
const finalCount = Math.max(2, Math.trunc(Math.log10(count) + 1))
// n is not a Number
if (Number.isNaN(n) && raw) {
return raw
}
return n.toString().padStart(finalCount, '0')
}
export default {

View File

@ -235,6 +235,19 @@ if (supportedUrls.some(url => document.URL.startsWith(url))) {
takeScreenshot: clickElement('.video-take-screenshot'),
previousFrame: clickElement('.prev-frame'),
nextFrame: clickElement('.next-frame'),
seekBegin: () => {
if (!unsafeWindow.player) {
return
}
unsafeWindow.player.play()
setTimeout(() => {
unsafeWindow.player.seek(0)
const toastText = dq(".bilibili-player-video-toast-bottom .bilibili-player-video-toast-item:first-child .bilibili-player-video-toast-item-text span:nth-child(2)")
if (toastText) {
toastText.textContent = " 00:00"
}
})
},
}
const defaultBindings: { [action in keyof typeof actions]: string } = {
fullscreen: 'f',
@ -262,6 +275,7 @@ if (supportedUrls.some(url => document.URL.startsWith(url))) {
takeScreenshot: 'ctrl alt c',
previousFrame: 'shift arrowLeft',
nextFrame: 'shift arrowRight',
seekBegin: '0',
}
const parseBindings = (bindings: { [action: string]: string }) => {
return Object.entries(bindings).map(([actionName, keyString]) => {