Advent22.name_door

This commit is contained in:
Jörn-Michael Miehe 2023-09-12 17:46:09 +00:00
parent db5b056866
commit 05f5bed4d0
3 changed files with 17 additions and 11 deletions

View file

@ -51,7 +51,7 @@ export default class extends Vue {
}; };
public door_hover(day: number) { public door_hover(day: number) {
this.figure_caption = `Türchen ${day}`; this.figure_caption = this.$advent22.name_door(day);
} }
public door_unhover() { public door_unhover() {
@ -63,7 +63,7 @@ export default class extends Vue {
} }
public door_success(day: number, image_src: string) { public door_success(day: number, image_src: string) {
this.$refs.multi_modal.show_image(image_src, `Türchen ${day}`); this.$refs.multi_modal.show_image(image_src, this.$advent22.name_door(day));
} }
public door_failure(msg: string) { public door_failure(msg: string) {

View file

@ -91,7 +91,9 @@ export default class extends Vue {
this.$advent22 this.$advent22
.api_get_blob(`images/${day}`) .api_get_blob(`images/${day}`)
.then((data) => this.$refs.multi_modal.show_image(data, `Türchen ${day}`)) .then((data) =>
this.$refs.multi_modal.show_image(data, this.$advent22.name_door(day)),
)
.catch(() => this.$refs.multi_modal.set_active(false)); .catch(() => this.$refs.multi_modal.set_active(false));
} }
} }

View file

@ -24,6 +24,18 @@ export class Advent22 {
return `//${window.location.hostname}:8000/api`; return `//${window.location.hostname}:8000/api`;
} }
public name_door(day: number): string {
return `Türchen ${day}`;
}
public set_api_auth(username: string, password: string) {
this.api_auth = { username: username, password: password };
}
public clear_api_auth() {
this.api_auth = { username: "", password: "" };
}
public api_url(): string; public api_url(): string;
public api_url(endpoint: string): string; public api_url(endpoint: string): string;
public api_url(endpoint?: string): string { public api_url(endpoint?: string): string {
@ -38,14 +50,6 @@ export class Advent22 {
return `${this.api_baseurl}/${endpoint}`; return `${this.api_baseurl}/${endpoint}`;
} }
public clear_api_auth() {
this.api_auth = { username: "", password: "" };
}
public set_api_auth(username: string, password: string) {
this.api_auth = { username: username, password: password };
}
private _api_get<T>(endpoint: string): Promise<T>; private _api_get<T>(endpoint: string): Promise<T>;
private _api_get<T>(endpoint: string, responseType: ResponseType): Promise<T>; private _api_get<T>(endpoint: string, responseType: ResponseType): Promise<T>;
private _api_get<T>( private _api_get<T>(