1
0
mirror of https://github.com/koloml/philomena-tagging-assistant.git synced 2026-06-24 02:32:21 +00:00

Added presets and tag editor handling to the image upload page

This commit is contained in:
2026-03-12 00:57:23 +04:00
parent bda707b5ac
commit 2a2a488592
5 changed files with 47 additions and 17 deletions

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
src/content/upload.ts Normal file
View File

@@ -0,0 +1,3 @@
import { TagsForm } from "$content/components/philomena/TagsForm";
TagsForm.initializeUploadEditor();