Merge remote-tracking branch 'origin/master'

This commit is contained in:
kunfei
2023-05-20 23:42:19 +08:00
15 changed files with 111 additions and 67 deletions
+1 -1
View File
@@ -214,7 +214,7 @@ dependencies {
//网络
implementation('com.squareup.okhttp3:okhttp:4.11.0')
appImplementation(fileTree(dir: 'cronetlib', include: ['*.jar', '*.aar']))
appImplementation 'com.google.protobuf:protobuf-javalite:3.23.0'
appImplementation 'com.google.protobuf:protobuf-javalite:3.23.1'
//Glide
def glideVersion = "4.15.1"
@@ -1 +1 @@
import{A as f,u as i}from"./index-a856ee26.js";import"./vendor-b9134af1.js";f.getReadConfig().then(e=>{var t=e.data.data;if(t){const a=i();let o=JSON.parse(t),s=a.config;o=Object.assign(s,o),a.setConfig(o)}});
import{A as f,u as i}from"./index-8ff7a1b1.js";import"./vendor-b9134af1.js";f.getReadConfig().then(e=>{var t=e.data.data;if(t){const a=i();let o=JSON.parse(t),s=a.config;o=Object.assign(s,o),a.setConfig(o)}});
@@ -1 +1 @@
.el-link[data-v-aee57c78]{padding:4px}.el-text[data-v-aee57c78]{padding-top:20px}[data-v-830cee5a] .el-checkbox__label{flex:1;display:flex;justify-content:space-between;align-items:center}.error[data-v-830cee5a]{border-color:var(--el-color-error)!important;color:var(--el-color-error)!important;--el-checkbox-checked-text-color: var(--el-color-error);--el-checkbox-checked-bg-color: var(--el-color-error);--el-checkbox-checked-input-border-color: var(--el-color-error)}.edit[data-v-830cee5a]{border-color:var(--el-color-dark)!important}.tool[data-v-cd1572ca]{display:flex;margin:4px 0;justify-content:center}#source-list[data-v-cd1572ca]{margin-top:6px;height:calc(100vh - 119px)}#source-list[data-v-cd1572ca] .el-checkbox{margin-bottom:4px;width:100%}[data-v-372e8d43] #debug-text{height:calc(100vh - 86px)}[data-v-7e91a802] .el-input{width:100%}[data-v-7e91a802] #source-json{height:calc(100vh - 50px)}[data-v-dcce2457] .el-tabs__header{margin-bottom:5px}.flex-space-between[data-v-e3b61f1f]{display:flex;justify-content:space-between;align-items:baseline}.flex-column-center[data-v-e3b61f1f]{display:flex;flex-direction:column;justify-content:center}.menu>.el-button[data-v-e3b61f1f]{margin:4px;padding:1em;width:6em}.hotkeys-item .title[data-v-e3b61f1f]{width:5em;display:flex;justify-content:flex-end;margin-right:1em}.hotkeys-item__content[data-v-e3b61f1f]{display:flex;flex-wrap:wrap;flex:1}.hotkeys-item__content div[data-v-e3b61f1f]{margin-bottom:1em}.hotkeys-item__content span[data-v-e3b61f1f]{margin:.5em}[data-v-2cfb5302] .el-tab-pane{height:calc(100vh - 55px);padding-top:15px;padding-right:5px;overflow-y:auto}[data-v-2cfb5302] .el-tabs__header{margin:0}kbd{background-color:#fcfcfc;border-radius:3px;border:1px solid hsl(0deg,0%,80%);padding:4px 5px;font-weight:700}code{background-color:#f2f1f1;padding:.125rem .25rem;border-radius:.25rem;font-size:.835rem}body{padding:0;margin:0}.el-tabs__header{position:sticky;top:0px;z-index:2;background-color:#fff}.editor[data-v-5fe2b79d]{display:flex;height:100vh;overflow:hidden}.editor .left[data-v-5fe2b79d]{flex:1;margin-left:20px}.editor .right[data-v-5fe2b79d]{flex:1;width:360px;margin-right:20px}
.el-link[data-v-aee57c78]{padding:4px}.el-text[data-v-aee57c78]{padding-top:20px}[data-v-830cee5a] .el-checkbox__label{flex:1;display:flex;justify-content:space-between;align-items:center}.error[data-v-830cee5a]{border-color:var(--el-color-error)!important;color:var(--el-color-error)!important;--el-checkbox-checked-text-color: var(--el-color-error);--el-checkbox-checked-bg-color: var(--el-color-error);--el-checkbox-checked-input-border-color: var(--el-color-error)}.edit[data-v-830cee5a]{border-color:var(--el-color-dark)!important}.tool[data-v-cd1572ca]{display:flex;margin:4px 0;justify-content:center}#source-list[data-v-cd1572ca]{margin-top:6px;height:calc(100vh - 119px)}#source-list[data-v-cd1572ca] .el-checkbox{margin-bottom:4px;width:100%}[data-v-372e8d43] #debug-text{height:calc(100vh - 86px)}[data-v-7e91a802] .el-input{width:100%}[data-v-7e91a802] #source-json{height:calc(100vh - 50px)}[data-v-dcce2457] .el-tabs__header{margin-bottom:5px}.flex-space-between[data-v-921779dc]{display:flex;justify-content:space-between;align-items:baseline}.flex-column-center[data-v-921779dc]{display:flex;flex-direction:column;justify-content:center}.menu>.el-button[data-v-921779dc]{margin:4px;padding:1em;width:6em}.hotkeys-item .title[data-v-921779dc]{width:5em;display:flex;justify-content:flex-end;margin-right:1em}.hotkeys-item__content[data-v-921779dc]{display:flex;flex-wrap:wrap;flex:1}.hotkeys-item__content div[data-v-921779dc]{margin-bottom:1em}.hotkeys-item__content span[data-v-921779dc]{margin:.5em}[data-v-2cfb5302] .el-tab-pane{height:calc(100vh - 55px);padding-top:15px;padding-right:5px;overflow-y:auto}[data-v-2cfb5302] .el-tabs__header{margin:0}kbd{background-color:#fcfcfc;border-radius:3px;border:1px solid hsl(0deg,0%,80%);padding:4px 5px;font-weight:700}code{background-color:#f2f1f1;padding:.125rem .25rem;border-radius:.25rem;font-size:.835rem}body{padding:0;margin:0}.el-tabs__header{position:sticky;top:0px;z-index:2;background-color:#fff}.editor[data-v-5fe2b79d]{display:flex;height:100vh;overflow:hidden}.editor .left[data-v-5fe2b79d]{flex:1;margin-left:20px}.editor .right[data-v-5fe2b79d]{flex:1;width:360px;margin-right:20px}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
import{u as S}from"./index-a856ee26.js";import{z as L,K as p,a5 as w,ae as D,u as v}from"./vendor-b9134af1.js";const Y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a{1,2}|A{1,2}|m{1,2}|s{1,2}|Z{1,2}|SSS/g;function y(t,i,e,a){let o=t<12?"AM":"PM";return a&&(o=o.split("").reduce((n,l)=>n+=`${l}.`,"")),e?o.toLowerCase():o}function z(t,i,e={}){var a;const o=t.getFullYear(),n=t.getMonth(),l=t.getDate(),s=t.getHours(),r=t.getMinutes(),g=t.getSeconds(),f=t.getMilliseconds(),h=t.getDay(),c=(a=e.customMeridiem)!=null?a:y,d={YY:()=>String(o).slice(-2),YYYY:()=>o,M:()=>n+1,MM:()=>`${n+1}`.padStart(2,"0"),MMM:()=>t.toLocaleDateString(e.locales,{month:"short"}),MMMM:()=>t.toLocaleDateString(e.locales,{month:"long"}),D:()=>String(l),DD:()=>`${l}`.padStart(2,"0"),H:()=>String(s),HH:()=>`${s}`.padStart(2,"0"),h:()=>`${s%12||12}`.padStart(1,"0"),hh:()=>`${s%12||12}`.padStart(2,"0"),m:()=>String(r),mm:()=>`${r}`.padStart(2,"0"),s:()=>String(g),ss:()=>`${g}`.padStart(2,"0"),SSS:()=>`${f}`.padStart(3,"0"),d:()=>h,dd:()=>t.toLocaleDateString(e.locales,{weekday:"narrow"}),ddd:()=>t.toLocaleDateString(e.locales,{weekday:"short"}),dddd:()=>t.toLocaleDateString(e.locales,{weekday:"long"}),A:()=>c(s,r),AA:()=>c(s,r,!1,!0),a:()=>c(s,r,!0),aa:()=>c(s,r,!0,!0)};return i.replace(Y,(m,M)=>{var u;return M||((u=d[m])==null?void 0:u.call(d))||m})}const b=t=>/,\s*\{/.test(t)||!(t.startsWith("http")||t.startsWith("data:")||t.startsWith("blob:"));function A(t){return location.origin+"/image?path="+encodeURIComponent(t)+"&url="+encodeURIComponent(sessionStorage.getItem("bookUrl"))+"&width="+S().config.readWidth}const W=t=>{let i=new Date().getTime(),e=Math.floor((i-t)/1e3),a="";return e<=30?a="":e<60?a=e+"":e<3600?a=Math.floor(e/60)+"":e<86400?a=Math.floor(e/3600)+"":e<2592e3?a=Math.floor(e/86400)+"":a=z(new Date(t),"YYYY-MM-DD"),a},$='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024"><path fill="currentColor" d="M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32zm0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32zm448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32zm-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32zM195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0zm-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z"/></svg>';const U=(t,i,e=$)=>{const a=L(!1);let o=null;const n=()=>a.value=!1,l=()=>a.value=!0;p(a,r=>{if(!r)return o==null?void 0:o.close();o=D.service({target:v(t),spinner:e,text:i,lock:!0,background:"rgba(0, 0, 0, 0)"})});const s=r=>{if(!(r instanceof Promise))throw TypeError("loadingWrapper argument must be Promise");return l(),r.finally(n)};return w(()=>{n()}),{isLoading:a,showLoading:l,closeLoading:n,loadingWrapper:s}};export{W as d,A as g,b as i,U as u};
import{u as S}from"./index-8ff7a1b1.js";import{z as L,K as p,a5 as w,ae as D,u as v}from"./vendor-b9134af1.js";const Y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a{1,2}|A{1,2}|m{1,2}|s{1,2}|Z{1,2}|SSS/g;function y(t,i,e,a){let o=t<12?"AM":"PM";return a&&(o=o.split("").reduce((n,l)=>n+=`${l}.`,"")),e?o.toLowerCase():o}function z(t,i,e={}){var a;const o=t.getFullYear(),n=t.getMonth(),l=t.getDate(),s=t.getHours(),r=t.getMinutes(),g=t.getSeconds(),f=t.getMilliseconds(),h=t.getDay(),c=(a=e.customMeridiem)!=null?a:y,d={YY:()=>String(o).slice(-2),YYYY:()=>o,M:()=>n+1,MM:()=>`${n+1}`.padStart(2,"0"),MMM:()=>t.toLocaleDateString(e.locales,{month:"short"}),MMMM:()=>t.toLocaleDateString(e.locales,{month:"long"}),D:()=>String(l),DD:()=>`${l}`.padStart(2,"0"),H:()=>String(s),HH:()=>`${s}`.padStart(2,"0"),h:()=>`${s%12||12}`.padStart(1,"0"),hh:()=>`${s%12||12}`.padStart(2,"0"),m:()=>String(r),mm:()=>`${r}`.padStart(2,"0"),s:()=>String(g),ss:()=>`${g}`.padStart(2,"0"),SSS:()=>`${f}`.padStart(3,"0"),d:()=>h,dd:()=>t.toLocaleDateString(e.locales,{weekday:"narrow"}),ddd:()=>t.toLocaleDateString(e.locales,{weekday:"short"}),dddd:()=>t.toLocaleDateString(e.locales,{weekday:"long"}),A:()=>c(s,r),AA:()=>c(s,r,!1,!0),a:()=>c(s,r,!0),aa:()=>c(s,r,!0,!0)};return i.replace(Y,(m,M)=>{var u;return M||((u=d[m])==null?void 0:u.call(d))||m})}const b=t=>/,\s*\{/.test(t)||!(t.startsWith("http")||t.startsWith("data:")||t.startsWith("blob:"));function A(t){return location.origin+"/image?path="+encodeURIComponent(t)+"&url="+encodeURIComponent(sessionStorage.getItem("bookUrl"))+"&width="+S().config.readWidth}const W=t=>{let i=new Date().getTime(),e=Math.floor((i-t)/1e3),a="";return e<=30?a="":e<60?a=e+"":e<3600?a=Math.floor(e/60)+"":e<86400?a=Math.floor(e/3600)+"":e<2592e3?a=Math.floor(e/86400)+"":a=z(new Date(t),"YYYY-MM-DD"),a},$='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024"><path fill="currentColor" d="M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32zm0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32zm448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32zm-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32zM195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0zm-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z"/></svg>';const U=(t,i,e=$)=>{const a=L(!1);let o=null;const n=()=>a.value=!1,l=()=>a.value=!0;p(a,r=>{if(!r)return o==null?void 0:o.close();o=D.service({target:v(t),spinner:e,text:i,lock:!0,background:"rgba(0, 0, 0, 0)"})});const s=r=>{if(!(r instanceof Promise))throw TypeError("loadingWrapper argument must be Promise");return l(),r.finally(n)};return w(()=>{n()}),{isLoading:a,showLoading:l,closeLoading:n,loadingWrapper:s}};export{W as d,A as g,b as i,U as u};
+2 -2
View File
@@ -4,10 +4,10 @@
<meta charset="UTF-8" />
<link rel="icon" href="./favicon.ico" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<script type="module" crossorigin src="./assets/index-a856ee26.js"></script>
<script type="module" crossorigin src="./assets/index-8ff7a1b1.js"></script>
<link rel="modulepreload" crossorigin href="./assets/vendor-b9134af1.js">
<link rel="stylesheet" href="./assets/vendor-5578283d.css">
<link rel="stylesheet" href="./assets/index-f0744ec1.css">
<link rel="stylesheet" href="./assets/index-38115393.css">
</head>
<body>
@@ -182,7 +182,7 @@ object ChapterProvider {
}
durY = setTypeImage(
book, matcher.group(1)!!,
absStartX, durY, textPages, book.getImageStyle()
absStartX, durY, textPages, stringBuilder, book.getImageStyle()
)
start = matcher.end()
}
@@ -232,13 +232,17 @@ object ChapterProvider {
x: Int,
y: Float,
textPages: ArrayList<TextPage>,
stringBuilder: StringBuilder,
imageStyle: String?,
): Float {
var durY = y
val size = ImageProvider.getImageSize(book, src, ReadBook.bookSource)
if (size.width > 0 && size.height > 0) {
if (durY > visibleHeight) {
textPages.last().height = durY
val textPage = textPages.last()
textPage.height = durY
textPage.text = stringBuilder.toString()
stringBuilder.clear()
textPages.add(TextPage())
durY = 0f
}
@@ -249,6 +253,7 @@ object ChapterProvider {
width = visibleWidth
height = size.height * visibleWidth / size.width
}
else -> {
if (size.width > visibleWidth) {
height = size.height * visibleWidth / size.width
@@ -259,7 +264,10 @@ object ChapterProvider {
height = visibleHeight
}
if (durY + height > visibleHeight) {
textPages.last().height = durY
val textPage = textPages.last()
textPage.height = durY
textPage.text = stringBuilder.toString()
stringBuilder.clear()
textPages.add(TextPage())
durY = 0f
}
@@ -326,8 +334,10 @@ object ChapterProvider {
y - textLayoutHeight
}
}
isTitle && textPages.size == 1 && textPages.last().lines.isEmpty() ->
y + titleTopSpacing
else -> y
}
for (lineIndex in 0 until layout.lineCount) {
@@ -363,6 +373,7 @@ object ChapterProvider {
textPaint, desiredWidth, srcList
)
}
lineIndex == layout.lineCount - 1 -> {
//最后一行
textLine.text = words
@@ -381,6 +392,7 @@ object ChapterProvider {
startX, !isTitle && lineIndex == 0, srcList
)
}
else -> {
if (
isTitle &&
@@ -566,6 +578,7 @@ object ChapterProvider {
src = src
)
}
isLineEnd && char == reviewChar -> {
ReviewColumn(
start = absStartX + xStart,
@@ -573,6 +586,7 @@ object ChapterProvider {
count = 100
)
}
else -> {
TextColumn(
start = absStartX + xStart,
@@ -632,9 +646,11 @@ object ChapterProvider {
Typeface.Builder(it.fileDescriptor).build()
}
}
fontPath.isContentScheme() -> {
Typeface.createFromFile(RealPathUtil.getPath(appCtx, Uri.parse(fontPath)))
}
fontPath.isNotEmpty() -> Typeface.createFromFile(fontPath)
else -> when (AppConfig.systemTypefaces) {
1 -> Typeface.SERIF
@@ -660,12 +676,14 @@ object ChapterProvider {
else
Pair(bold, bold)
}
2 -> {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P)
Pair(normal, Typeface.create(typeface, 300, false))
else
Pair(normal, normal)
}
else -> Pair(bold, normal)
}
@@ -709,6 +727,7 @@ object ChapterProvider {
doublePage = (viewWidth > viewHeight)
&& ReadBook.pageAnim() != 3
}
"3" -> {
doublePage = (viewWidth > viewHeight || appCtx.isPad)
&& ReadBook.pageAnim() != 3
+1 -1
View File
@@ -7,7 +7,7 @@ buildscript {
kotlin_version = '1.8.21'
agp_version = '8.0.1'
//exoplayer_version = '2.18.6'
media3_version = "1.0.1"
media3_version = "1.0.2"
splitties_version = '3.0.0'
room_version = '2.5.1'
}
+1 -1
View File
@@ -33,7 +33,7 @@
"eslint-plugin-vue": "^9.12.0",
"prettier": "^2.8.8",
"sass": "^1.62.1",
"unplugin-auto-import": "^0.15.3",
"unplugin-auto-import": "^0.16.0",
"unplugin-icons": "^0.16.1",
"unplugin-vue-components": "^0.24.1",
"vite": "^4.3.5"
+35 -23
View File
@@ -1,28 +1,40 @@
import { URL } from "node:url";
import fs from "node:fs";
const LEGADO_ASSETS_WEB_VUE_DIR = new URL("../../../app/src/main/assets/web/vue", import.meta.url)
const VUE_DIST_DIR = new URL("../dist", import.meta.url)
const LEGADO_ASSETS_WEB_VUE_DIR = new URL(
"../../../app/src/main/assets/web/vue",
import.meta.url
);
const VUE_DIST_DIR = new URL("../dist", import.meta.url);
console.log("> delete", LEGADO_ASSETS_WEB_VUE_DIR.pathname)
console.log("> delete", LEGADO_ASSETS_WEB_VUE_DIR.pathname);
// 删除
fs.rm(LEGADO_ASSETS_WEB_VUE_DIR, {
force: true,
recursive: true
}, (error) => {
if (error) console.log(error);
console.log("> mkdir", LEGADO_ASSETS_WEB_VUE_DIR.pathname);
fs.mkdir(LEGADO_ASSETS_WEB_VUE_DIR, error => {
if (error) return console.error(error)
console.log("> cp dist files")
fs.cp(VUE_DIST_DIR, LEGADO_ASSETS_WEB_VUE_DIR, {
recursive: true
}, (error) => {
if (error) {
console.warn("> cp error, you may copy files yourshelf");
throw error;
}
console.log("> cp success")
})
})
});
fs.rm(
LEGADO_ASSETS_WEB_VUE_DIR,
{
force: true,
recursive: true,
},
(error) => {
if (error) console.log(error);
console.log("> mkdir", LEGADO_ASSETS_WEB_VUE_DIR.pathname);
fs.mkdir(LEGADO_ASSETS_WEB_VUE_DIR, (error) => {
if (error) return console.error(error);
console.log("> cp dist files");
fs.cp(
VUE_DIST_DIR,
LEGADO_ASSETS_WEB_VUE_DIR,
{
recursive: true,
},
(error) => {
if (error) {
console.warn("> cp error, you may copy files yourshelf");
throw error;
}
console.log("> cp success");
}
);
});
}
);
+30 -13
View File
@@ -27,7 +27,7 @@
</div>
<el-button
:disabled="recordKeyDowning"
@click="bindHotKeys"
@click="saveHotKeys"
:icon="CircleCheckFilled"
>保存</el-button
>
@@ -230,7 +230,13 @@ const stopRecordKeyDown = () => {
watch(
hotkeysDialogVisible,
(visibale) => {
if (!visibale) return hotkeys.unbind("*");
if (!visibale) {
hotkeys.unbind("*");
readHotkeysConfig();
bindHotKeys();
return;
}
readHotkeysConfig();
hotkeys.unbind();
/**监听按键 */
hotkeys("*", (event) => {
@@ -257,39 +263,50 @@ const recordKeyDown = (index) => {
recordKeyDownIndex.value = index;
};
const bindHotKeys = () => {
hotkeysDialogVisible.value = false;
const saveHotKeys = () => {
const hotKeysConfig = [];
buttons.value.forEach(({ hotKeys }) => {
hotKeysConfig.push(hotKeys);
});
saveHotkeysConfig(hotKeysConfig);
hotkeysDialogVisible.value = false;
};
const bindHotKeys = () => {
buttons.value.forEach(({ hotKeys, action }) => {
if (hotKeys.length == 0) return;
hotkeys(hotKeys.join("+"), (event) => {
event.preventDefault();
action.call(null);
});
hotKeysConfig.push(hotKeys);
});
saveHotkeysConfig(hotKeysConfig);
};
const saveHotkeysConfig = (config) => {
localStorage.setItem("legado_web_hotkeys", JSON.stringify(config));
};
const readHotkeysConfig = () => {
/**
* 读取快捷键配置
* @return 是否成功读取配置
*/
function readHotkeysConfig() {
try {
const config = JSON.parse(localStorage.getItem("legado_web_hotkeys"));
if (!Array.isArray(config) || config.length == 0) return;
if (!Array.isArray(config) || config.length == 0) return false;
buttons.value.forEach((button, index) => (button.hotKeys = config[index]));
hotkeysDialogVisible.value = false;
bindHotKeys();
return true;
} catch {
ElMessage({ message: "快捷键配置错误", type: "error" });
localStorage.removeItem("legado_web_hotkeys");
}
};
return false;
}
onMounted(() => {
/**读取热键配置 */
readHotkeysConfig();
if (readHotkeysConfig()) {
hotkeysDialogVisible.value = false;
}
});
</script>
@@ -69,13 +69,13 @@ export default {
title: "并发率",
id: "concurrentRate",
type: "String",
hint: "并发率",
hint: "并发率,如1000(访问间隔1000ms)或者1/1000(1000ms内访问1次)",
},
{
title: "js库",
id: "jsLib",
type: "String",
hint: "js库",
hint: "js库, 可填写js或者key-value object获取在线js文件",
},
{
title: "请求头",
@@ -105,7 +105,7 @@ export default {
namespace: "ruleSearch",
id: "checkKeyWord",
type: "String",
hint: "校验关键字",
hint: "校验关键字,强烈建议填写",
},
{
title: "列表规则",
@@ -179,7 +179,7 @@ export default {
title: "发现地址",
id: "exploreUrl",
type: "String",
hint: "内容能显示在发现菜单\n每行一条发现分类(网址域名可省略),例:\n名称1::网址(Url)1\n名称2::网址(Url)2\n...",
hint: "单个发现格式<name>::<url>或者{url:<url>,title:<name>,style:...};前者用换行符或者&&连接,后者放在数组内;可用js动态生成",
},
{
title: "发现筛选",
@@ -370,7 +370,7 @@ export default {
namespace: "ruleToc",
id: "formatJs",
type: "String",
hint: "直接填写js 提供index和tittle变量",
hint: "遍历去重后的章节列表的回调,提供index(章节序号从1开始)、title(章节标题)变量,额外提供gInt(初始值0),返回值作为新的标题",
},
{
title: "卷名标识",