@@ -493,6 +493,16 @@ class CCPMethodEditorController extends HTMLElement{
this.#rootdoc.querySelector("span[name=header]").innerText = this.#current.title
})
+ this.#rootdoc.querySelector("input[name=category]").addEventListener("input", ev=>{
+ const category = ev.currentTarget.value ? ev.currentTarget.value : "Uncategorized"
+ const fields = this.#current.metadata.filter(md=>md.role === "category")
+ if(fields.length === 0){
+ this.#current.metadata.push({ "role" : "category", "title" : category})
+ }else{
+ fields[0].title = category
+ }
+ })
+
this.#rootdoc.querySelector("input[name=version]").addEventListener("input", ev=>{
this.#current.version = ev.currentTarget.value
})