From 45ab5dccca9dd78af0fe0aa8cc894ff5f320dfda Mon Sep 17 00:00:00 2001 From: dcore94 Date: Wed, 13 Dec 2023 18:29:44 +0100 Subject: [PATCH 1/7] encode to base64 before setting as attirbute to fix descriptions containing quotes --- ccp/js/executionformcontroller.js | 4 ++-- ccp/js/inputwidgetcontroller.js | 2 +- ccp/js/outputwidgetcontroller.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ccp/js/executionformcontroller.js b/ccp/js/executionformcontroller.js index 8ad3358..d164464 100644 --- a/ccp/js/executionformcontroller.js +++ b/ccp/js/executionformcontroller.js @@ -341,7 +341,7 @@ class CCPExecutionForm extends HTMLElement{ "in" : (e,d)=>{ return Object.values(d.inputs) }, target : "div", apply : (e,d)=>{ - e.innerHTML = `` + e.innerHTML = `` } } ] @@ -354,7 +354,7 @@ class CCPExecutionForm extends HTMLElement{ "in" : (e,d)=>{ return Object.values(d.outputs) }, target : "div", apply : (e,d)=>{ - e.innerHTML = `` + e.innerHTML = `` } } ] diff --git a/ccp/js/inputwidgetcontroller.js b/ccp/js/inputwidgetcontroller.js index c4c5285..41eb7db 100644 --- a/ccp/js/inputwidgetcontroller.js +++ b/ccp/js/inputwidgetcontroller.js @@ -7,7 +7,7 @@ class CCPInputWidgetController extends HTMLElement { } connectedCallback(){ - this.#data = JSON.parse(this.getAttribute("input")) + this.#data = JSON.parse(atob(this.getAttribute("input"))) if(this.isChecklist()){ diff --git a/ccp/js/outputwidgetcontroller.js b/ccp/js/outputwidgetcontroller.js index ab904ea..64ae654 100644 --- a/ccp/js/outputwidgetcontroller.js +++ b/ccp/js/outputwidgetcontroller.js @@ -4,7 +4,7 @@ class CCPOutputWidgetController extends HTMLElement { constructor(){ super() - this.#output = JSON.parse(this.getAttribute("output")) + this.#output = JSON.parse(atob(this.getAttribute("output"))) } connectedCallback(){ -- 2.17.1 From ccd75c7e6e7c27afec46081d2f44ff2658cb2f2e Mon Sep 17 00:00:00 2001 From: dcore94 Date: Wed, 13 Dec 2023 19:07:56 +0100 Subject: [PATCH 2/7] changed description to textarea and show it without trigger --- ccp/js/inputwidgetcontroller.js | 5 ++++- ccp/js/inputwidgeteditorcontroller.js | 4 +++- ccp/js/outputwidgeteditorcontroller.js | 3 ++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ccp/js/inputwidgetcontroller.js b/ccp/js/inputwidgetcontroller.js index 41eb7db..87a027d 100644 --- a/ccp/js/inputwidgetcontroller.js +++ b/ccp/js/inputwidgetcontroller.js @@ -246,13 +246,16 @@ class CCPBaseInputWidgetController extends HTMLElement{
${this.required ? `*` : ``} ${this.title} - ? +
+
+
diff --git a/ccp/js/inputwidgeteditorcontroller.js b/ccp/js/inputwidgeteditorcontroller.js index 26a79e8..5994641 100644 --- a/ccp/js/inputwidgeteditorcontroller.js +++ b/ccp/js/inputwidgeteditorcontroller.js @@ -78,7 +78,9 @@ class CCPInputWidgetEditorController extends HTMLElement{
- +
-- 2.17.1 From 125f5492c5620235fba6648942c7c2b371b24153 Mon Sep 17 00:00:00 2001 From: dcore94 Date: Wed, 13 Dec 2023 19:10:11 +0100 Subject: [PATCH 3/7] fixed typo --- ccp/js/inputwidgetcontroller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccp/js/inputwidgetcontroller.js b/ccp/js/inputwidgetcontroller.js index 87a027d..e4353dc 100644 --- a/ccp/js/inputwidgetcontroller.js +++ b/ccp/js/inputwidgetcontroller.js @@ -254,7 +254,7 @@ class CCPBaseInputWidgetController extends HTMLElement{
- ${this.#description}
-- 2.17.1 From a9ec7218925564a5af55d069ce155719a532146d Mon Sep 17 00:00:00 2001 From: dcore94 Date: Wed, 13 Dec 2023 19:17:04 +0100 Subject: [PATCH 4/7] removed spaces --- ccp/js/inputwidgetcontroller.js | 2 +- ccp/js/inputwidgeteditorcontroller.js | 4 +--- ccp/js/outputwidgeteditorcontroller.js | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/ccp/js/inputwidgetcontroller.js b/ccp/js/inputwidgetcontroller.js index e4353dc..6a9dcc8 100644 --- a/ccp/js/inputwidgetcontroller.js +++ b/ccp/js/inputwidgetcontroller.js @@ -253,7 +253,7 @@ class CCPBaseInputWidgetController extends HTMLElement{ -
+
${this.#description}
diff --git a/ccp/js/inputwidgeteditorcontroller.js b/ccp/js/inputwidgeteditorcontroller.js index 5994641..b2749b2 100644 --- a/ccp/js/inputwidgeteditorcontroller.js +++ b/ccp/js/inputwidgeteditorcontroller.js @@ -78,9 +78,7 @@ class CCPInputWidgetEditorController extends HTMLElement{
- +
-- 2.17.1 From 1381140c494260ae67fd1aa1a5a308817186e44b Mon Sep 17 00:00:00 2001 From: dcore94 Date: Wed, 13 Dec 2023 19:19:36 +0100 Subject: [PATCH 5/7] fixed typo --- ccp/js/inputwidgeteditorcontroller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccp/js/inputwidgeteditorcontroller.js b/ccp/js/inputwidgeteditorcontroller.js index b2749b2..d1bfd85 100644 --- a/ccp/js/inputwidgeteditorcontroller.js +++ b/ccp/js/inputwidgeteditorcontroller.js @@ -78,7 +78,7 @@ class CCPInputWidgetEditorController extends HTMLElement{
-
-- 2.17.1 From a4bbbc0ccf58f00583a6bab599351bd8d846a20b Mon Sep 17 00:00:00 2001 From: dcore94 Date: Wed, 13 Dec 2023 19:24:58 +0100 Subject: [PATCH 6/7] pass encoded description as attribute --- ccp/js/inputwidgetcontroller.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/ccp/js/inputwidgetcontroller.js b/ccp/js/inputwidgetcontroller.js index 6a9dcc8..038f18b 100644 --- a/ccp/js/inputwidgetcontroller.js +++ b/ccp/js/inputwidgetcontroller.js @@ -12,37 +12,37 @@ class CCPInputWidgetController extends HTMLElement { if(this.isChecklist()){ const opts = this.#data.schema.enum.join(",") - this.innerHTML += `` + this.innerHTML += `` } else if(this.isEnum()){ const opts = this.#data.schema.enum.join(",") - this.innerHTML += `` + this.innerHTML += `` }else if(this.isCode()){ - this.innerHTML += `` + this.innerHTML += `` }else if(this.isDateTime()){ const t = this.#data.schema.format.toLowerCase() === "datetime" ? "datetime-local" : this.#data.schema.format.toLowerCase() - this.innerHTML += `` + this.innerHTML += `` }else if(this.isFile()){ - this.innerHTML += `` + this.innerHTML += `` }else if(this.isRemoteFile()){ - this.innerHTML += `` + this.innerHTML += `` }else if(this.isSecret()){ - this.innerHTML += `` + this.innerHTML += `` }else if(this.isBoolean()){ - this.innerHTML += `` + this.innerHTML += `` }else if(this.isNumber()){ - this.innerHTML += `` + this.innerHTML += `` }else{ - this.innerHTML += `` + this.innerHTML += `` } } @@ -254,7 +254,7 @@ class CCPBaseInputWidgetController extends HTMLElement{
- ${this.#description} + ${atob(this.#description)}
-- 2.17.1 From ab0731025200992b829c1bff818c931591668db6 Mon Sep 17 00:00:00 2001 From: dcore94 Date: Thu, 14 Dec 2023 10:46:54 +0100 Subject: [PATCH 7/7] removed commented code --- ccp/js/inputwidgetcontroller.js | 1 - 1 file changed, 1 deletion(-) diff --git a/ccp/js/inputwidgetcontroller.js b/ccp/js/inputwidgetcontroller.js index 038f18b..f4f09c9 100644 --- a/ccp/js/inputwidgetcontroller.js +++ b/ccp/js/inputwidgetcontroller.js @@ -246,7 +246,6 @@ class CCPBaseInputWidgetController extends HTMLElement{
${this.required ? `*` : ``} ${this.title} -
-- 2.17.1