From d4f55d22ff67eed3c711bb5fdf5d336510726705 Mon Sep 17 00:00:00 2001 From: maru21 Date: Mon, 13 Nov 2023 18:16:34 +0100 Subject: [PATCH] fixed set form button and list not been parsed with pell content --- css/pell.css | 2 +- js/2.0.3/form.js | 3 ++- js/2.0.3/scripts.js | 5 +---- js/2.0.3/storage.js | 10 ++++++++++ 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/css/pell.css b/css/pell.css index f3c2e71..ea7ec8f 100644 --- a/css/pell.css +++ b/css/pell.css @@ -24,4 +24,4 @@ vertical-align: bottom; } .pell-button-selected { - background-color: #F0F0F0; } + background-color: #9e9e9e; } diff --git a/js/2.0.3/form.js b/js/2.0.3/form.js index e39780c..5cd1187 100644 --- a/js/2.0.3/form.js +++ b/js/2.0.3/form.js @@ -249,7 +249,8 @@ function formEvts() { createStorageObj("setform"); let dataArray = retrieveData("userInput"); let lT = activeState.loadedTemplate; - setTemplatePreset(lT, dataArray); + console.log(lT, dataArray); + //setTemplatePreset(lT, dataArray); modalNotifier("Input saved as preset", activeState.settings.notifierPause); } if (e.target.id == "sb-item") { diff --git a/js/2.0.3/scripts.js b/js/2.0.3/scripts.js index 31505c0..8ee502e 100644 --- a/js/2.0.3/scripts.js +++ b/js/2.0.3/scripts.js @@ -109,8 +109,6 @@ export function logout() { document.getElementById("login").style.display = "block"; } - - export function sanitize(string) { const map = { '&': '_', @@ -160,9 +158,8 @@ export const inputRead = { let key = (event.key !=undefined) ? event.key : ""; let contentElement = document.getElementById(this.source); this.inputContent = (contentElement != undefined) ? contentElement.value + key : ""; - if (this.inputContent == "" || key == "") return; - if (key.length > 1) return; + if (key.length > 1 && key != "Backspace" && key != "Delete" && key != "Enter") return; if (event.ctrlKey) return; if (this.inputContent == previousContent) return; diff --git a/js/2.0.3/storage.js b/js/2.0.3/storage.js index 7d4b82a..b03af2a 100644 --- a/js/2.0.3/storage.js +++ b/js/2.0.3/storage.js @@ -64,6 +64,16 @@ function createStorageObj(ref = "none") { for (let i = 0; i < x.length; i++) { if (x.elements[i].name == "") continue; + let parsedContent = x.elements[i].value; + parsedContent = parsedContent.replace(/
/g, ""); + parsedContent = parsedContent.replace(/<\/div>/g, "\n"); + if (ref == "setform") { + //parse pell content remove html tags + parsedContent = parsedContent.replace(/<.{1,4}>/g, ""); + } + + x.elements[i].value = parsedContent; + dataArray.push({ value: x.elements[i].value, name: x.elements[i].name,