|
|
|
@ -18,7 +18,7 @@ function hashParam(key, val) { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// 创建书源规则容器对象
|
|
|
|
|
const RuleJSON = (() => { |
|
|
|
|
function Container() { |
|
|
|
|
let ruleJson = {}; |
|
|
|
|
let searchJson = {}; |
|
|
|
|
let exploreJson = {}; |
|
|
|
@ -60,7 +60,7 @@ const RuleJSON = (() => { |
|
|
|
|
ruleJson.ruleContent = contentJson; |
|
|
|
|
|
|
|
|
|
return ruleJson; |
|
|
|
|
})(); |
|
|
|
|
} |
|
|
|
|
// 选项卡Tab切换事件处理
|
|
|
|
|
function showTab(tabName) { |
|
|
|
|
$$('.tabtitle>*').forEach(node => { node.className = node.className.replace(' this', ''); }); |
|
|
|
@ -106,6 +106,7 @@ function HttpPost(url, data) { |
|
|
|
|
} |
|
|
|
|
// 将书源表单转化为书源对象
|
|
|
|
|
function rule2json() { |
|
|
|
|
let RuleJSON = Container(); |
|
|
|
|
// 转换base
|
|
|
|
|
Object.keys(RuleJSON).forEach(key => { |
|
|
|
|
if (!key.startsWith("rule")) { |
|
|
|
@ -117,6 +118,7 @@ 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);
|
|
|
|
@ -126,6 +128,7 @@ function rule2json() { |
|
|
|
|
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);
|
|
|
|
@ -135,6 +138,7 @@ function rule2json() { |
|
|
|
|
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);
|
|
|
|
@ -144,6 +148,7 @@ function rule2json() { |
|
|
|
|
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);
|
|
|
|
@ -153,6 +158,7 @@ function rule2json() { |
|
|
|
|
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);
|
|
|
|
@ -168,6 +174,7 @@ function rule2json() { |
|
|
|
|
} |
|
|
|
|
// 将书源对象填充到书源表单
|
|
|
|
|
function json2rule(RuleEditor) { |
|
|
|
|
let RuleJSON = Container(); |
|
|
|
|
// 转换base
|
|
|
|
|
Object.keys(RuleJSON).forEach(key => { |
|
|
|
|
if (!key.startsWith("rule")) { |
|
|
|
|