From 1ab1bbef7e48ac0a3e9dec2ae508c7fa99742202 Mon Sep 17 00:00:00 2001 From: dcore94 Date: Thu, 6 Apr 2023 15:20:31 +0200 Subject: [PATCH] add catery input with hints --- ccp/js/methodeditorcontroller.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/ccp/js/methodeditorcontroller.js b/ccp/js/methodeditorcontroller.js index 18e2ea1..265baf1 100644 --- a/ccp/js/methodeditorcontroller.js +++ b/ccp/js/methodeditorcontroller.js @@ -391,6 +391,11 @@ class CCPMethodEditorController extends HTMLElement{ +
+ + + ${this.renderCategoryHints()} +
@@ -739,6 +744,23 @@ class CCPMethodEditorController extends HTMLElement{ ` } + getCurrentCategory(){ + if(this.#current){ + const cats = this.#current.metadata.filter(md=>md.role === "category") + if(cats.length === 0) return "Uncategorized"; + return cats[0].title + }else return "Uncategorized" + } + + renderCategoryHints(){ + const cats = ["Uncategorized", this.getCurrentCategory()] + return ` + + ${cats.map(c=>``} + + ` + } + renderContexts(){ return `