From aca361db4fee5a95ef6f005707da582caaa37462 Mon Sep 17 00:00:00 2001 From: "1152958806@qq.com" <17683872107czx> Date: Mon, 28 Aug 2023 13:57:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=A0=87=E7=AD=BE=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E6=87=92=E5=8A=A0=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/assets/js/custom.js | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/templates/assets/js/custom.js b/templates/assets/js/custom.js index c44a0be9..04150b9e 100644 --- a/templates/assets/js/custom.js +++ b/templates/assets/js/custom.js @@ -139,11 +139,10 @@ document.addEventListener("DOMContentLoaded", () => { this.options = { class: this.getAttribute("class") || '', noIcon: this.getAttribute("noIcon") || '', - style: this.getAttribute("style") || '', - content: this.getAttribute("content") || '', + style: this.getAttribute("style") || '' }; let htmlStr = ` -

${this.options.content}

+
${this.innerHTML}
`; this.innerHTML = htmlStr; } @@ -158,12 +157,11 @@ document.addEventListener("DOMContentLoaded", () => { constructor() { super(); this.options = { - class: this.getAttribute("class") || '', - noIcon: this.getAttribute("noIcon") || '', - content: this.getAttribute("content") || '', + class: this.getAttribute("class") || 'info', + noIcon: this.getAttribute("noIcon") || '' }; let htmlStr = ` -

${this.options.content}

+
${this.innerHTML}
`; this.innerHTML = htmlStr; } @@ -196,9 +194,7 @@ document.addEventListener("DOMContentLoaded", () => {
-

${$2 - .trim() - .replace(/^(
)|(
)$/g, "")}

+ ${$2.trim().replace(/^(
)|(
)$/g, "")}
`; @@ -241,7 +237,7 @@ document.addEventListener("DOMContentLoaded", () => { let content = ""; if(this.options.class == 'rounded'){ _innerHTML.replace( - /{btns-item([^}]*)}/g, + /{([^}]*)}/g, function ($0, $1) { var str = $1.split(",", 5); if(str.length==5){ @@ -267,7 +263,7 @@ document.addEventListener("DOMContentLoaded", () => { if(this.options.class == 'circle'){ _innerHTML.replace( - /{btns-item([^}]*)}/g, + /{([^}]*)}/g, function ($0, $1) { var str = $1.split(",", 5); if(str.length==5){ @@ -316,6 +312,7 @@ document.addEventListener("DOMContentLoaded", () => { const id = this.options.id const index = this.options.index const _temp = getChildren(this, "_tpl"); + let _innerHTML = _temp.innerHTML.trim().replace(/^(
)|(
)$/g, ""); let navs = ""; let contents = ""; @@ -368,7 +365,7 @@ document.addEventListener("DOMContentLoaded", () => { let _innerHTML = _temp.innerHTML.trim().replace(/^(
)|(
)$/g, ""); let contents = ""; _innerHTML.replace( - /{gallery-group-item([^}]*)}/g, + /{([^}]*)}/g, function ($0, $1) { var str = $1.split(",",4); contents += `