diff --git a/multi.html b/multi.html index 4b557e3f..90819de6 100644 --- a/multi.html +++ b/multi.html @@ -1167,13 +1167,7 @@ var formation = new Formation(teamsCount,5);
"); //换行 //str = str.replace(/ /ig," "); //换行 - str = str.replace(/\^([a-fA-F0-9]+?)\^([^\^]+?)\^p/igm,'$2'); //文字颜色 - str = str.replace(/\%\{m([0-9]{1,4})\}/g,function (str, p1, offset, s){return cardN(parseInt(p1,10)).outerHTML;}); //怪物头像 - return str; + //str = str.replace(/\^([a-fA-F0-9]+?)\^([^\^]+?)\^p/igm,'$2'); //文字颜色 + //str = str.replace(/\%\{m([0-9]{1,4})\}/g,function (str, p1, offset, s){return cardN(parseInt(p1,10)).outerHTML;}); //怪物头像 + return nodeArr.nodeJoin(); } //默认的技能解释的显示行为 function parseSkillDescription(skill) { - const span = document.createElement("span"); - span.innerHTML = descriptionToHTML(skill.description); - return span; + //const span = document.createElement("span"); + //span.innerHTML = descriptionToHTML(skill.description); + + return descriptionToHTML(skill.description); } //大数字缩短长度,默认返回本地定义字符串 function parseBigNumber(number) { diff --git a/script.js b/script.js index cf451571..cac85e5d 100644 --- a/script.js +++ b/script.js @@ -1973,7 +1973,9 @@ function initialize(event) { const txtDetailDisplay = detailBox.querySelector(".detail-display"); txtTitle.onchange = function() { formation.title = this.value; - txtTitleDisplay.innerHTML = descriptionToHTML(this.value); + //txtTitleDisplay.innerHTML = descriptionToHTML(this.value); + txtTitleDisplay.innerHTML = ''; + txtTitleDisplay.appendChild(descriptionToHTML(this.value)); let titleStr = txtTitleDisplay.textContent.trim(); document.title = titleStr.length > 0 ? `${titleStr.trim()} - ${localTranslating.webpage_title}` : localTranslating.webpage_title; creatNewUrl(); @@ -1984,7 +1986,9 @@ function initialize(event) { }; txtDetail.onchange = function() { formation.detail = this.value; - txtDetailDisplay.innerHTML = descriptionToHTML(this.value); + //txtDetailDisplay.innerHTML = descriptionToHTML(this.value); + txtDetailDisplay.innerHTML = ''; + txtDetailDisplay.appendChild(descriptionToHTML(this.value)); creatNewUrl(); }; txtDetail.onblur = function() { @@ -3165,7 +3169,7 @@ function initialize(event) { const monEditAwokens = Array.from(monEditAwokensRow.querySelectorAll(".awoken-ul input[name='awoken-number']")); function checkAwoken() { - const card = Cards[editBox.mid]; + const card = Cards[editBox.mid ?? 0]; const value = parseInt(this.value, 10); awokenCountLabel.setAttribute(dataAttrName, value); toggleDomClassName(value > 0 && value == card.awakenings.length, "full-awoken", awokenCountLabel); @@ -4152,10 +4156,14 @@ function refreshAll(formationData) { txtDetail.value = formationData.detail || ""; const txtTitleDisplay = titleBox.querySelector(".title-display"); const txtDetailDisplay = detailBox.querySelector(".detail-display"); - txtTitleDisplay.innerHTML = descriptionToHTML(txtTitle.value); + //txtTitleDisplay.innerHTML = descriptionToHTML(txtTitle.value); + txtTitleDisplay.innerHTML = ''; + txtTitleDisplay.appendChild(descriptionToHTML(txtTitle.value)); let titleStr = txtTitleDisplay.textContent.trim(); document.title = titleStr.length > 0 ? `${titleStr.trim()} - ${localTranslating.webpage_title}` : localTranslating.webpage_title; - txtDetailDisplay.innerHTML = descriptionToHTML(txtDetail.value); + //txtDetailDisplay.innerHTML = descriptionToHTML(txtDetail.value); + txtDetailDisplay.innerHTML = ''; + txtDetailDisplay.appendChild(descriptionToHTML(txtDetail.value)); toggleDomClassName(!txtTitle.value.length, "edit", titleBox); toggleDomClassName(!txtDetail.value.length, "edit", detailBox); diff --git a/solo.html b/solo.html index 4d7de785..f8935a2d 100644 --- a/solo.html +++ b/solo.html @@ -1025,13 +1025,7 @@ var formation = new Formation(teamsCount,6);
-
-
-
-
- +