Added presets and tag editor handling to the image upload page

This commit is contained in:
koloml committed 2026-03-12 00:57:23 +04:00
1 parent bda707b5ac
commit 2a2a488592
5 files changed
+47 -17

No files matched your search

+11 -1
View File
@@ -24,7 +24,7 @@ export class TagsForm extends BaseComponent {
this.#togglePresetsButton.textContent = 'Presets';
this.container
.querySelector('.fancy-tag-edit ~ button:last-of-type')
.querySelector(':is(.fancy-tag-edit, .fancy-tag-upload) ~ button:last-of-type')
?.after(this.#togglePresetsButton, this.#presetsList.container);
this.#plainEditorTextarea = this.container.querySelector('textarea.tagsinput');
@@ -243,4 +243,14 @@ export class TagsForm extends BaseComponent {
(tagEditor as TagsForm).refreshTagColors();
});
}
static initializeUploadEditor() {
const uploadEditorContainer = document.querySelector<HTMLElement>('.field:has(.fancy-tag-upload)');
if (!uploadEditorContainer) {
return;
}
new TagsForm(uploadEditorContainer).initialize();
}
}
+3
View File
@@ -0,0 +1,3 @@
import { TagsForm } from "$content/components/philomena/TagsForm";
TagsForm.initializeUploadEditor();
+16
View File
@@ -0,0 +1,16 @@
@use '$styles/booru-vars';
.block.tag-presets {
.tag {
cursor: pointer;
&.is-missing {
opacity: 0.5;
}
&:hover {
color: booru-vars.$resolved-tag-background;
background: booru-vars.$resolved-tag-color;
}
}
}
-15
View File
@@ -11,18 +11,3 @@ h2.tag-category-headline {
bottom: calc(#{$base-margin-bottom} - #{booru-vars.$padding-small});
}
}
.block.tag-presets {
.tag {
cursor: pointer;
&.is-missing {
opacity: 0.5;
}
&:hover {
color: booru-vars.$resolved-tag-background;
background: booru-vars.$resolved-tag-color;
}
}
}