diff --git a/ccp/js/methodeditorcontroller.js b/ccp/js/methodeditorcontroller.js index 09c54f4..b315eda 100644 --- a/ccp/js/methodeditorcontroller.js +++ b/ccp/js/methodeditorcontroller.js @@ -379,9 +379,9 @@ class CCPMethodEditorController extends HTMLElement{
${this.renderAuthors()}
-
+
@@ -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 })