mirror of
https://github.com/koloml/philomena-tagging-assistant.git
synced 2026-05-09 07:12:19 +00:00
And even more renaming of popup across multiple files
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import type { MaintenancePopupEventsMap } from "$content/components/events/tagging-profile-popup-events";
|
||||
import type { TaggingProfilePopupEventsMap } from "$content/components/events/tagging-profile-popup-events";
|
||||
import { BaseComponent } from "$content/components/base/BaseComponent";
|
||||
import type { FullscreenViewerEventsMap } from "$content/components/events/fullscreen-viewer-events";
|
||||
import type { BooruEventsMap } from "$content/components/events/booru-events";
|
||||
@@ -7,7 +7,7 @@ import type { TagDropdownEvents } from "$content/components/events/tag-dropdown-
|
||||
import type { PresetBlockEventsMap } from "$content/components/events/preset-block-events";
|
||||
|
||||
type EventsMapping =
|
||||
MaintenancePopupEventsMap
|
||||
TaggingProfilePopupEventsMap
|
||||
& FullscreenViewerEventsMap
|
||||
& BooruEventsMap
|
||||
& TagsFormEventsMap
|
||||
|
||||
@@ -6,7 +6,7 @@ export const EVENT_TAGS_UPDATED = 'tags-updated';
|
||||
|
||||
export type ProfilePopupState = 'ready' | 'processing' | 'failed' | 'complete' | 'waiting';
|
||||
|
||||
export interface MaintenancePopupEventsMap {
|
||||
export interface TaggingProfilePopupEventsMap {
|
||||
[EVENT_ACTIVE_PROFILE_CHANGED]: TaggingProfile | null;
|
||||
[EVENT_PROFILE_POPUP_STATE_CHANGED]: ProfilePopupState;
|
||||
[EVENT_TAGS_UPDATED]: Map<string, string> | null;
|
||||
|
||||
@@ -8,7 +8,7 @@ import type TaggingProfile from "$entities/TaggingProfile";
|
||||
|
||||
export class MediaBoxTools extends BaseComponent {
|
||||
#mediaBox: MediaBox | null = null;
|
||||
#maintenancePopup: TaggingProfilePopup | null = null;
|
||||
#popup: TaggingProfilePopup | null = null;
|
||||
|
||||
init() {
|
||||
const mediaBoxElement = this.container.closest<HTMLElement>('.media-box');
|
||||
@@ -34,8 +34,8 @@ export class MediaBoxTools extends BaseComponent {
|
||||
component.initialize();
|
||||
}
|
||||
|
||||
if (!this.#maintenancePopup && component instanceof TaggingProfilePopup) {
|
||||
this.#maintenancePopup = component;
|
||||
if (!this.#popup && component instanceof TaggingProfilePopup) {
|
||||
this.#popup = component;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,10 +46,6 @@ export class MediaBoxTools extends BaseComponent {
|
||||
this.container.classList.toggle('has-active-profile', profileChangedEvent.detail !== null);
|
||||
}
|
||||
|
||||
get maintenancePopup(): TaggingProfilePopup | null {
|
||||
return this.#maintenancePopup;
|
||||
}
|
||||
|
||||
get mediaBox(): MediaBox | null {
|
||||
return this.#mediaBox;
|
||||
}
|
||||
|
||||
@@ -373,7 +373,7 @@ export class TaggingProfilePopup extends BaseComponent {
|
||||
}
|
||||
});
|
||||
|
||||
const unsubscribeFromMaintenanceSettings = this.#preferences.subscribe(settings => {
|
||||
const unsubscribeFromPreferences = this.#preferences.subscribe(settings => {
|
||||
if (settings.activeProfile === lastActiveProfileId) {
|
||||
return;
|
||||
}
|
||||
@@ -395,7 +395,7 @@ export class TaggingProfilePopup extends BaseComponent {
|
||||
|
||||
return () => {
|
||||
unsubscribeFromProfilesChanges();
|
||||
unsubscribeFromMaintenanceSettings();
|
||||
unsubscribeFromPreferences();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,10 +25,10 @@ export class TaggingProfileStatusIcon extends BaseComponent {
|
||||
throw new Error('Status icon element initialized outside of the media box!');
|
||||
}
|
||||
|
||||
on(this.#mediaBoxTools, EVENT_PROFILE_POPUP_STATE_CHANGED, this.#onMaintenanceStateChanged.bind(this));
|
||||
on(this.#mediaBoxTools, EVENT_PROFILE_POPUP_STATE_CHANGED, this.#onPopupStateChanged.bind(this));
|
||||
}
|
||||
|
||||
#onMaintenanceStateChanged(stateChangeEvent: CustomEvent<ProfilePopupState>) {
|
||||
#onPopupStateChanged(stateChangeEvent: CustomEvent<ProfilePopupState>) {
|
||||
// TODO Replace those with FontAwesome icons later. Those icons can probably be sourced from the website itself.
|
||||
switch (stateChangeEvent.detail) {
|
||||
case "ready":
|
||||
|
||||
Reference in New Issue
Block a user