Merge remote-tracking branch 'origin/master'

This commit is contained in:
kunfei
2023-05-08 23:09:38 +08:00
5 changed files with 43 additions and 19 deletions
+1 -1
View File
@@ -15,7 +15,7 @@
**2023/05/08** **2023/05/08**
* 更新cronet: 113.0.5672.76 * 更新cronet: 113.0.5672.76
* web: 全新传书页面 [MakeHui](https://github.com/MakeHui);修正源编辑列表多谢编辑逻辑,优化超大源列表多选性能 * web: 全新传书页面 [MakeHui](https://github.com/MakeHui);修正源编辑列表操作逻辑和多选性能
* 优化部分文本提示toast * 优化部分文本提示toast
* webView: 忽略部分网站的证书错误 * webView: 忽略部分网站的证书错误
* 备份恢复webDav: 输入密码后自动验证 * 备份恢复webDav: 输入密码后自动验证
+19 -1
View File
@@ -1,4 +1,5 @@
<template> <template>
<div class="title">{{ title }}</div>
<div v-for="(para, index) in carray" :key="index"> <div v-for="(para, index) in carray" :key="index">
<img <img
class="full" class="full"
@@ -16,7 +17,11 @@ import config from "../plugins/config";
import { getImageFromLegado, isLegadoUrl } from "../plugins/utils"; import { getImageFromLegado, isLegadoUrl } from "../plugins/utils";
const store = useBookStore(); const store = useBookStore();
defineProps(["carray"]); const props = defineProps({
carray: { type: Array, required: true },
title: { type: String, required: true },
spacing: { type: Object, required: true },
});
const fontFamily = computed(() => { const fontFamily = computed(() => {
if (store.config.font >= 0) { if (store.config.font >= 0) {
@@ -49,14 +54,27 @@ watch(fontSize, () => {
store.setShowContent(true); store.setShowContent(true);
}); });
}); });
const letterSpacing = computed(() => props.spacing.letter); //字间距 倍数
const lineSpacing = computed(() => 1 + props.spacing.line); //行距 基础行距1
const paragraphSpacing = computed(() => props.spacing.paragraph); //段距
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.title {
margin-bottom: 57px;
font: 24px / 32px PingFangSC-Regular, HelveticaNeue-Light,
"Helvetica Neue Light", "Microsoft YaHei", sans-serif;
}
p { p {
display: block; display: block;
word-wrap: break-word; word-wrap: break-word;
word-break: break-all; word-break: break-all;
letter-spacing: calc(v-bind("letterSpacing") * 1em);
line-height: v-bind("lineSpacing");
margin: calc(v-bind("paragraphSpacing") * 1em) 0;
:deep(img) { :deep(img) {
height: 1em; height: 1em;
} }
+6 -1
View File
@@ -22,6 +22,11 @@ export const useBookStore = defineStore("book", {
readWidth: 800, readWidth: 800,
infiniteLoading: false, infiniteLoading: false,
customFontName: "", customFontName: "",
spacing: {
paragraph: 1,
line: 0.8,
letter: 0,
},
}, },
miniInterface: false, miniInterface: false,
readSettingsVisible: false, readSettingsVisible: false,
@@ -53,7 +58,7 @@ export const useBookStore = defineStore("book", {
this.readingBook = readingBook; this.readingBook = readingBook;
}, },
setConfig(config) { setConfig(config) {
this.config = config; Object.assign(this.config, config);
}, },
setReadSettingsVisible(visible) { setReadSettingsVisible(visible) {
this.readSettingsVisible = visible; this.readSettingsVisible = visible;
+11 -6
View File
@@ -22,15 +22,19 @@ export const useSourceStore = defineStore("source", {
}, },
getters: { getters: {
sources: (state) => (isBookSource ? state.bookSources : state.rssSources), sources: (state) => (isBookSource ? state.bookSources : state.rssSources),
sourceUrlKey: () => isBookSource ? "bookSourceUrl" : "sourceUrl", sourceUrlKey: () => (isBookSource ? "bookSourceUrl" : "sourceUrl"),
sourcesMap: (state) => { sourcesMap: (state) => {
let map = new Map(); let map = new Map();
state.sources.forEach(source => map.set(source[state.sourceUrlKey], source)); state.sources.forEach((source) =>
map.set(source[state.sourceUrlKey], source)
);
return map; return map;
}, },
savedSourcesMap: (state) => { savedSourcesMap: (state) => {
let map = new Map(); let map = new Map();
state.savedSources.forEach(source => map.set(source[state.sourceUrlKey], source)); state.savedSources.forEach((source) =>
map.set(source[state.sourceUrlKey], source)
);
return map; return map;
}, },
currentSourceUrl: (state) => currentSourceUrl: (state) =>
@@ -73,13 +77,14 @@ export const useSourceStore = defineStore("source", {
}, },
//保存当前编辑源 //保存当前编辑源
saveCurrentSource() { saveCurrentSource() {
let source = this.currentSource, map = this.sourcesMap; let source = this.currentSource,
map = this.sourcesMap;
map.set(source[this.sourceUrlKey], source); map.set(source[this.sourceUrlKey], source);
this.saveSources(Array.from(map.values())); this.saveSources(Array.from(map.values()));
}, },
// 更改当前编辑的源 // 更改当前编辑的源
changeCurrentSource(source) { changeCurrentSource(source) {
this.currentSource = JSON.parse(JSON.stringify((source))); this.currentSource = JSON.parse(JSON.stringify(source));
}, },
// update editTab tabName and editTab info // update editTab tabName and editTab info
changeTabName(tabName) { changeTabName(tabName) {
@@ -87,7 +92,7 @@ export const useSourceStore = defineStore("source", {
localStorage.setItem("tabName", tabName); localStorage.setItem("tabName", tabName);
}, },
changeEditTabSource(source) { changeEditTabSource(source) {
this.editTabSource = JSON.parse(JSON.stringify((source))); this.editTabSource = JSON.parse(JSON.stringify(source));
}, },
editHistory(history) { editHistory(history) {
let historyObj; let historyObj;
+6 -10
View File
@@ -82,10 +82,12 @@
<div class="content"> <div class="content">
<div class="top-bar" ref="top"></div> <div class="top-bar" ref="top"></div>
<div v-for="data in chapterData" :key="data.index" ref="chapter"> <div v-for="data in chapterData" :key="data.index" ref="chapter">
<div class="title" :index="data.index" v-if="showContent"> <chapter-content
{{ data.title }} :carray="data.content"
</div> :title="data.title"
<chapter-content :carray="data.content" v-if="showContent" /> :spacing="store.config.spacing"
v-if="showContent"
/>
</div> </div>
<div class="loading" ref="loading"></div> <div class="loading" ref="loading"></div>
<div class="bottom-bar" ref="bottom"></div> <div class="bottom-bar" ref="bottom"></div>
@@ -667,12 +669,6 @@ onUnmounted(() => {
font-family: "Microsoft YaHei", PingFangSC-Regular, HelveticaNeue-Light, font-family: "Microsoft YaHei", PingFangSC-Regular, HelveticaNeue-Light,
"Helvetica Neue Light", sans-serif; "Helvetica Neue Light", sans-serif;
.title {
margin-bottom: 57px;
font: 24px / 32px PingFangSC-Regular, HelveticaNeue-Light,
"Helvetica Neue Light", "Microsoft YaHei", sans-serif;
}
.bottom-bar, .bottom-bar,
.top-bar { .top-bar {
height: 64px; height: 64px;