From 5db013e4afa4d2af4cf6ae404aa424177dbeb2c8 Mon Sep 17 00:00:00 2001 From: Marc Foley Date: Mon, 14 Jul 2025 16:15:30 +0100 Subject: [PATCH] add static tag --- tagger2/index.html | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tagger2/index.html b/tagger2/index.html index b662b2ebc..478e40414 100644 --- a/tagger2/index.html +++ b/tagger2/index.html @@ -10,6 +10,7 @@ +
@@ -22,11 +23,13 @@ import TagsByCategories from "./TagsByCategories.js"; import Panel from "./Panel.js"; import TagView from "./TagView.js"; + import AddTag from "./AddTag.js"; Vue.component('tags-by-font', TagsByFont); Vue.component('tags-by-categories', TagsByCategories); Vue.component('panel', Panel); Vue.component('tag-view', TagView); + Vue.component('add-tag', AddTag); var app = new Vue({ el: '#app', @@ -38,6 +41,15 @@ { type: 'categories', categories: ['/Expressive/Loud', '/Expressive/Childlike'] } ], }, + + computed: { + sortedCategories() { + const res = this.tags.items.map(tag => tag.tagName) + .filter((value, index, self) => self.indexOf(value) === index) + .sort(); + return res; + } + }, methods: { addFontPanel(font) { this.panels.push({ type: 'font', font }); @@ -54,6 +66,11 @@ if (index !== -1) { this.tags.items.splice(index, 1); } + }, + addTag(tag) { + const family = this.gf.families.find(f => f.name === tag.family); + tag.family = family + this.tags.items.push(tag); } }, async created() { -- 2.47.3