From ddba34339a3ce0032e56eebd99b97a506bf27e91 Mon Sep 17 00:00:00 2001 From: Celeter <48249130+Celeter@users.noreply.github.com> Date: Tue, 9 Feb 2021 10:17:11 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/assets/web/index.js | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/app/src/main/assets/web/index.js b/app/src/main/assets/web/index.js index f74fcb549..86f19a138 100644 --- a/app/src/main/assets/web/index.js +++ b/app/src/main/assets/web/index.js @@ -36,27 +36,22 @@ function Container() { // 搜索规则 $$('.rules .ruleSearch').forEach(item => searchJson[item.title] = ''); - //ruleJson.ruleSearch = JSON.stringify(searchJson); ruleJson.ruleSearch = searchJson; // 发现规则 $$('.rules .ruleExplore').forEach(item => exploreJson[item.title] = ''); - //ruleJson.ruleExplore = JSON.stringify(exploreJson); ruleJson.ruleExplore = exploreJson; // 详情页规则 $$('.rules .ruleBookInfo').forEach(item => bookInfoJson[item.title] = ''); - //ruleJson.ruleBookInfo = JSON.stringify(bookInfoJson); ruleJson.ruleBookInfo = bookInfoJson; // 目录规则 $$('.rules .ruleToc').forEach(item => tocJson[item.title] = ''); - //ruleJson.ruleToc = JSON.stringify(tocJson); ruleJson.ruleToc = tocJson; // 正文规则 $$('.rules .ruleContent').forEach(item => contentJson[item.title] = ''); - //ruleJson.ruleContent = JSON.stringify(contentJson); ruleJson.ruleContent = contentJson; return ruleJson; @@ -116,55 +111,45 @@ function rule2json() { // 转换搜索规则 let searchJson = {}; - //Object.keys(JSON.parse(RuleJSON.ruleSearch)).forEach(key => { Object.keys(RuleJSON.ruleSearch).forEach(key => { if ($('#' + 'ruleSearch_' + key).value) searchJson[key] = $('#' + 'ruleSearch_' + key).value; }); - //RuleJSON.ruleSearch = JSON.stringify(searchJson); RuleJSON.ruleSearch = searchJson; // 转换发现规则 let exploreJson = {}; - //Object.keys(JSON.parse(RuleJSON.ruleExplore)).forEach(key => { Object.keys(RuleJSON.ruleExplore).forEach(key => { if ($('#' + 'ruleExplore_' + key).value) exploreJson[key] = $('#' + 'ruleExplore_' + key).value; }); - //RuleJSON.ruleExplore = JSON.stringify(exploreJson); RuleJSON.ruleExplore = exploreJson; // 转换详情页规则 let bookInfoJson = {}; - //Object.keys(JSON.parse(RuleJSON.ruleBookInfo)).forEach(key => { Object.keys(RuleJSON.ruleBookInfo).forEach(key => { if ($('#' + 'ruleBookInfo_' + key).value) bookInfoJson[key] = $('#' + 'ruleBookInfo_' + key).value; }); - //RuleJSON.ruleBookInfo = JSON.stringify(bookInfoJson); RuleJSON.ruleBookInfo = bookInfoJson; // 转换目录规则 let tocJson = {}; - //Object.keys(JSON.parse(RuleJSON.ruleToc)).forEach(key => { Object.keys(RuleJSON.ruleToc).forEach(key => { if ($('#' + 'ruleToc_' + key).value) tocJson[key] = $('#' + 'ruleToc_' + key).value; }); - //RuleJSON.ruleToc = JSON.stringify(tocJson); RuleJSON.ruleToc = tocJson; // 转换正文规则 let contentJson = {}; - //Object.keys(JSON.parse(RuleJSON.ruleContent)).forEach(key => { Object.keys(RuleJSON.ruleContent).forEach(key => { if ($('#' + 'ruleContent_' + key).value) contentJson[key] = $('#' + 'ruleContent_' + key).value; }); - //RuleJSON.ruleContent = JSON.stringify(contentJson); RuleJSON.ruleContent = contentJson; - RuleJSON.lastUpdateTime = new Date().getTime();//RuleJSON.lastUpdateTime == '' ? 0 : parseInt(RuleJSON.lastUpdateTime); + RuleJSON.lastUpdateTime = new Date().getTime(); RuleJSON.customOrder = RuleJSON.customOrder == '' ? 0 : parseInt(RuleJSON.customOrder); RuleJSON.weight = RuleJSON.weight == '' ? 0 : parseInt(RuleJSON.weight); RuleJSON.bookSourceType == RuleJSON.bookSourceType == '' ? 0 : parseInt(RuleJSON.weight); @@ -193,9 +178,7 @@ function json2rule(RuleEditor) { // 转换搜索规则 if (RuleEditor.ruleSearch) { - //let searchJson = JSON.parse(RuleEditor.ruleSearch); let searchJson = RuleEditor.ruleSearch; - //Object.keys(JSON.parse(RuleJSON.ruleSearch)).forEach(key => { Object.keys(RuleJSON.ruleSearch).forEach(key => { $('#' + 'ruleSearch_' + key).value = searchJson[key] ? searchJson[key] : ''; }); @@ -203,8 +186,6 @@ function json2rule(RuleEditor) { // 转换发现规则 if (RuleEditor.ruleExplore) { - //let exploreJson = JSON.parse(RuleEditor.ruleExplore); - //Object.keys(JSON.parse(RuleJSON.ruleExplore)).forEach(key => { let exploreJson = RuleEditor.ruleExplore; Object.keys(RuleJSON.ruleExplore).forEach(key => { $('#' + 'ruleExplore_' + key).value = exploreJson[key] ? exploreJson[key] : ''; @@ -213,8 +194,6 @@ function json2rule(RuleEditor) { // 转换详情页规则 if (RuleEditor.ruleBookInfo) { - //let bookInfoJson = JSON.parse(RuleEditor.ruleBookInfo); - //Object.keys(JSON.parse(RuleJSON.ruleBookInfo)).forEach(key => { let bookInfoJson = RuleEditor.ruleBookInfo; Object.keys(RuleJSON.ruleBookInfo).forEach(key => { $('#' + 'ruleBookInfo_' + key).value = bookInfoJson[key] ? bookInfoJson[key] : ''; @@ -223,8 +202,6 @@ function json2rule(RuleEditor) { // 转换目录规则 if (RuleEditor.ruleToc) { - //let tocJson = JSON.parse(RuleEditor.ruleToc); - //Object.keys(JSON.parse(RuleJSON.ruleToc)).forEach(key => { let tocJson = RuleEditor.ruleToc; Object.keys(RuleJSON.ruleToc).forEach(key => { $('#' + 'ruleToc_' + key).value = tocJson[key] ? tocJson[key] : ''; @@ -233,8 +210,6 @@ function json2rule(RuleEditor) { // 转换正文规则 if (RuleEditor.ruleContent) { - //let contentJson = JSON.parse(RuleEditor.ruleContent); - //Object.keys(JSON.parse(RuleJSON.ruleContent)).forEach(key => { let contentJson = RuleEditor.ruleContent; Object.keys(RuleJSON.ruleContent).forEach(key => { $('#' + 'ruleContent_' + key).value = contentJson[key] ? contentJson[key] : ''; From 10c1beffce4198104cf67e20db56a4491caefc37 Mon Sep 17 00:00:00 2001 From: Celeter <48249130+Celeter@users.noreply.github.com> Date: Tue, 9 Feb 2021 10:17:48 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E9=9A=90=E8=97=8F=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E6=A0=8F=EF=BC=8C=E8=BD=AC=E5=8C=96=E4=B9=A6?= =?UTF-8?q?=E6=BA=90=E6=97=B6=E8=87=AA=E5=8A=A8=E7=94=9F=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/assets/web/index.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/assets/web/index.html b/app/src/main/assets/web/index.html index 45edf04e6..ecb09e654 100644 --- a/app/src/main/assets/web/index.html +++ b/app/src/main/assets/web/index.html @@ -290,10 +290,10 @@ -