From 49fb1a393834e89b3352173249e1a2cdac517266 Mon Sep 17 00:00:00 2001 From: kunfei Date: Fri, 11 Nov 2022 23:40:31 +0800 Subject: [PATCH] =?UTF-8?q?rss=20webView=E6=B7=BB=E5=8A=A0=E6=B3=A8?= =?UTF-8?q?=E5=85=A5js?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/legado/app/data/entities/RssSource.kt | 3 +++ .../app/ui/book/source/edit/BookSourceEditActivity.kt | 3 ++- .../app/ui/book/source/edit/BookSourceEditAdapter.kt | 3 ++- .../java/io/legado/app/ui/book/source/edit/EditEntity.kt | 3 --- .../java/io/legado/app/ui/rss/source/edit/EditEntity.kt | 3 --- .../app/ui/rss/source/edit/RssSourceEditActivity.kt | 3 +++ .../app/ui/rss/source/edit/RssSourceEditAdapter.kt | 3 ++- .../main/java/io/legado/app/ui/widget/text/EditEntity.kt | 9 +++++++++ app/src/main/res/values-es-rES/strings.xml | 1 + app/src/main/res/values-ja-rJP/strings.xml | 1 + app/src/main/res/values-pt-rBR/strings.xml | 1 + app/src/main/res/values-zh-rHK/strings.xml | 1 + app/src/main/res/values-zh-rTW/strings.xml | 1 + app/src/main/res/values-zh/strings.xml | 1 + app/src/main/res/values/strings.xml | 1 + 15 files changed, 28 insertions(+), 9 deletions(-) delete mode 100644 app/src/main/java/io/legado/app/ui/book/source/edit/EditEntity.kt delete mode 100644 app/src/main/java/io/legado/app/ui/rss/source/edit/EditEntity.kt create mode 100644 app/src/main/java/io/legado/app/ui/widget/text/EditEntity.kt diff --git a/app/src/main/java/io/legado/app/data/entities/RssSource.kt b/app/src/main/java/io/legado/app/data/entities/RssSource.kt index 83a98d6df..d6e696f72 100644 --- a/app/src/main/java/io/legado/app/data/entities/RssSource.kt +++ b/app/src/main/java/io/legado/app/data/entities/RssSource.kt @@ -111,6 +111,8 @@ data class RssSource( && enableJs == source.enableJs && loadWithBaseUrl == source.loadWithBaseUrl && equal(variableComment, source.variableComment) + && equal(style, source.style) + && equal(injectJs, source.injectJs) } private fun equal(a: String?, b: String?): Boolean { @@ -180,6 +182,7 @@ data class RssSource( ruleLink = doc.readString("$.ruleLink"), ruleContent = doc.readString("$.ruleContent"), style = doc.readString("$.style"), + injectJs = doc.readString("$.injectJs"), enableJs = doc.readBool("$.enableJs") ?: true, loadWithBaseUrl = doc.readBool("$.loadWithBaseUrl") ?: true, enabledCookieJar = doc.readBool("$.enabledCookieJar") ?: false, diff --git a/app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditActivity.kt b/app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditActivity.kt index 9a36908ac..1b19fce05 100644 --- a/app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditActivity.kt @@ -31,6 +31,7 @@ import io.legado.app.ui.qrcode.QrCodeResult import io.legado.app.ui.widget.dialog.TextDialog import io.legado.app.ui.widget.dialog.UrlOptionDialog import io.legado.app.ui.widget.keyboard.KeyboardToolPop +import io.legado.app.ui.widget.text.EditEntity import io.legado.app.utils.* import io.legado.app.utils.viewbindingdelegate.viewBinding import kotlinx.coroutines.Dispatchers.IO @@ -477,7 +478,7 @@ class BookSourceEditActivity : "voteDownUrl" -> reviewRule.voteDownUrl = it.value "postReviewUrl" -> reviewRule.postReviewUrl = it.value "postQuoteUrl" -> reviewRule.postQuoteUrl = it.value - "deleteUrl" -> reviewRule.deleteUrl =it.value + "deleteUrl" -> reviewRule.deleteUrl = it.value } } source.ruleSearch = searchRule diff --git a/app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditAdapter.kt b/app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditAdapter.kt index 15f780961..b5b65be0a 100644 --- a/app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditAdapter.kt @@ -13,6 +13,7 @@ import io.legado.app.help.config.AppConfig import io.legado.app.ui.widget.code.addJsPattern import io.legado.app.ui.widget.code.addJsonPattern import io.legado.app.ui.widget.code.addLegadoPattern +import io.legado.app.ui.widget.text.EditEntity class BookSourceEditAdapter : RecyclerView.Adapter() { @@ -70,7 +71,7 @@ class BookSourceEditAdapter : RecyclerView.Adapter source.ruleContent = viewModel.ruleComplete(it.value, source.ruleArticles) "style" -> source.style = it.value + "injectJs" -> source.injectJs = it.value } } return source diff --git a/app/src/main/java/io/legado/app/ui/rss/source/edit/RssSourceEditAdapter.kt b/app/src/main/java/io/legado/app/ui/rss/source/edit/RssSourceEditAdapter.kt index a1f053bd8..bbe85687f 100644 --- a/app/src/main/java/io/legado/app/ui/rss/source/edit/RssSourceEditAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/rss/source/edit/RssSourceEditAdapter.kt @@ -13,6 +13,7 @@ import io.legado.app.help.config.AppConfig import io.legado.app.ui.widget.code.addJsPattern import io.legado.app.ui.widget.code.addJsonPattern import io.legado.app.ui.widget.code.addLegadoPattern +import io.legado.app.ui.widget.text.EditEntity class RssSourceEditAdapter : RecyclerView.Adapter() { @@ -69,7 +70,7 @@ class RssSourceEditAdapter : RecyclerView.Adapter图片url规则(ruleImage) 内容规则(ruleContent) 样式(style) + 注入Js(injectJs) 链接规则(ruleLink) 校验关键字(checkKeyWord) 操作(actions) diff --git a/app/src/main/res/values-ja-rJP/strings.xml b/app/src/main/res/values-ja-rJP/strings.xml index 62e063a9e..8178362b7 100644 --- a/app/src/main/res/values-ja-rJP/strings.xml +++ b/app/src/main/res/values-ja-rJP/strings.xml @@ -442,6 +442,7 @@ 图片url规则(ruleImage) 内容规则(ruleContent) 样式(style) + 注入Js(injectJs) 链接规则(ruleLink) 校验关键字(checkKeyWord) 操作(actions) diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index a97c47864..3368c085b 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -440,6 +440,7 @@ 图片url规则(regraImagem) 内容规则(regraConteúdo) 样式(formato) + 注入Js(injectJs) 链接规则(regraLink) 校验关键字(checkKeyWord) 操作(actions) diff --git a/app/src/main/res/values-zh-rHK/strings.xml b/app/src/main/res/values-zh-rHK/strings.xml index 96bfdd412..db627e092 100644 --- a/app/src/main/res/values-zh-rHK/strings.xml +++ b/app/src/main/res/values-zh-rHK/strings.xml @@ -434,6 +434,7 @@ 圖片 url 規則 (ruleImage) 內容規則 (ruleContent) 樣式 (style) + 注入Js(injectJs) 鏈接規則 (ruleLink) 校驗關鍵字(checkKeyWord) 操作(actions) diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index a9716f94f..fd34eaad6 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -441,6 +441,7 @@ 圖片url規則(ruleImage) 內容規則(ruleContent) 樣式(style) + 注入Js(injectJs) 連結規則(ruleLink) 校驗關鍵字(checkKeyWord) 操作(actions) diff --git a/app/src/main/res/values-zh/strings.xml b/app/src/main/res/values-zh/strings.xml index 033f0e42d..719dbd9ce 100644 --- a/app/src/main/res/values-zh/strings.xml +++ b/app/src/main/res/values-zh/strings.xml @@ -441,6 +441,7 @@ 图片 URL 规则(ruleImage) 内容规则(ruleContent) 样式(style) + 注入Js(injectJs) 链接规则(ruleLink) 校验关键字(checkKeyWord) 操作(actions) diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 4cc0b2cb8..6dee0bc06 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -443,6 +443,7 @@ 内容规则(ruleContent) 样式(style) 链接规则(ruleLink) + 注入Js(injectJs) 校验关键字(checkKeyWord) 操作(actions) 购买标识(isPay)