From 947fcd89cbf1637f90d54d37d83c6b8fd1783c25 Mon Sep 17 00:00:00 2001 From: dcore94 Date: Wed, 24 May 2023 14:49:40 +0200 Subject: [PATCH] added button for ccpannotation input --- ccp/js/methodeditorcontroller.js | 40 ++++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/ccp/js/methodeditorcontroller.js b/ccp/js/methodeditorcontroller.js index afd066a..6508459 100644 --- a/ccp/js/methodeditorcontroller.js +++ b/ccp/js/methodeditorcontroller.js @@ -142,6 +142,12 @@ class CCPMethodEditorController extends HTMLElement{ ` + + #annotation_input_icon = ` + + + + ` constructor(){ super(); @@ -443,6 +449,7 @@ class CCPMethodEditorController extends HTMLElement{ Inputs
+ ${this.renderStandardInputButtons()} ${this.renderPlusButton("add-input")}
@@ -653,6 +660,27 @@ class CCPMethodEditorController extends HTMLElement{ this.renderInputs() }) + this.#rootdoc.querySelector("button[name=add-ccpannotation]").addEventListener("click", ev=>{ + ev.preventDefault() + ev.stopPropagation() + this.#tmp_inputs.push( + { + id : "new_input", + title : "New input", + description : "A new input field", + minOccurs : 1, + maxOccurs : 1, + schema : { + type : "string", + format : null, + contentMediaType : "text/plain", + default : "" + } + } + ) + this.renderInputs() + }) + this.#rootdoc.querySelector("div[name=input-list]").addEventListener("click", ev=>{ const evname = ev.target.getAttribute('name') if(evname === "delete-input"){ @@ -840,12 +868,20 @@ class CCPMethodEditorController extends HTMLElement{ ` } + renderStandardInputButtons(){ + return ` + + ` + } + renderStandardOutputButtons(){ return ` - - `