Merge pull request #134 from Celeter/master

web写源加筛选
pull/141/head
kunfei 5 years ago committed by GitHub
commit 3e90720dbb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      README.md
  2. 1
      app/src/main/assets/web/index.html
  3. 20
      app/src/main/assets/web/index.js

@ -3,7 +3,7 @@
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
## 阅读3.0
书源规则 https://celeter.github.io/?tdsourcetag=s_pctim_aiomsg
书源规则 https://celeter.github.io
## 免责声明
https://gedoor.github.io/MyBookshelf/disclaimer.html

@ -337,6 +337,7 @@
<textarea class="context" id="DebugConsole" placeholder="这里用于输出调试信息"></textarea>
</div>
<div class="tab3">
<input type="text" class="inputbox" id="Filter" placeholder="输入筛选关键词(源名称、源URL或源分组)后按回车筛选源">
<div class="titlebar">
<button id="Import">导入书源文件</button>
<button id="Export">导出书源文件</button>

@ -388,6 +388,26 @@ $('#DebugKey').addEventListener('keydown', e => {
$('#debug').dispatchEvent(clickEvent);
}
});
$('#Filter').addEventListener('keydown', e => {
if (e.keyCode == 13) {
let cashList = [];
$('#RuleList').innerHTML = "";
let sKey = Filter.value ? Filter.value : '';
if (sKey == '') {
cashList = RuleSources;
} else {
let patt = new RegExp(sKey);
RuleSources.forEach(source => {
if (patt.test(source.bookSourceUrl) || patt.test(source.bookSourceName) || patt.test(source.bookSourceGroup)) {
cashList.push(source);
}
})
}
cashList.forEach(source => {
$('#RuleList').innerHTML += newRule(source);
})
}
});
// 列表规则更改事件
$('#RuleList').addEventListener('click', e => {

Loading…
Cancel
Save