From: Marc Foley Date: Mon, 14 Jul 2025 15:15:30 +0000 (+0100) Subject: add static tag X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5db013e4afa4d2af4cf6ae404aa424177dbeb2c8;p=thirdparty%2Fgoogle%2Ffonts.git add static tag --- 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() {