Merge branch 'develop' into drawrects

This commit is contained in:
Jörn-Michael Miehe 2023-01-17 14:28:22 +00:00
commit b7f7b05e73
5 changed files with 13 additions and 13 deletions

View file

@ -52,7 +52,7 @@ export default class App extends Vue {
image_modal: ImageModal; image_modal: ImageModal;
}; };
public mounted(): void { public mounted() {
this.$advent22.api_get_string("days/date", (date: string) => { this.$advent22.api_get_string("days/date", (date: string) => {
this.date = date; this.date = date;
}); });
@ -65,7 +65,7 @@ export default class App extends Vue {
); );
} }
private open_calendar_door(image_src: string): void { private open_calendar_door(image_src: string) {
this.$refs.image_modal.show_src(image_src); this.$refs.image_modal.show_src(image_src);
} }
} }

View file

@ -17,7 +17,7 @@ export default class CalendarDoor extends Vue {
return this.$advent22.api_url("days/image/" + this.day); return this.$advent22.api_url("days/image/" + this.day);
} }
private on_click(): void { private on_click() {
this.$advent22.api_get_blob("days/image/" + this.day, (data) => { this.$advent22.api_get_blob("days/image/" + this.day, (data) => {
this.$emit("openDoor", data); this.$emit("openDoor", data);
}); });

View file

@ -17,17 +17,17 @@ export default class ImageModal extends Vue {
private active = false; private active = false;
public image_src = ""; public image_src = "";
public created(): void { public created() {
window.addEventListener("keydown", (e) => { window.addEventListener("keydown", (e) => {
if (e.key == "Escape") this.set_active(false); if (e.key == "Escape") this.set_active(false);
}); });
} }
public set_active(state: boolean): void { public set_active(state: boolean) {
this.active = state; this.active = state;
} }
public show_src(src: string): void { public show_src(src: string) {
this.image_src = src; this.image_src = src;
this.set_active(true); this.set_active(true);
} }

View file

@ -44,20 +44,20 @@ export default class LoginModal extends Vue {
private username = ""; private username = "";
private password = ""; private password = "";
public created(): void { public created() {
window.addEventListener("keydown", (e) => { window.addEventListener("keydown", (e) => {
if (e.key == "Escape") this.set_active(false); if (e.key == "Escape") this.set_active(false);
}); });
} }
public set_active(state: boolean): void { public set_active(state: boolean) {
this.active = state; this.active = state;
this.username = ""; this.username = "";
this.password = ""; this.password = "";
} }
private submit(): void { private submit() {
this.$advent22.set_api_auth(this.username, this.password); this.$advent22.set_api_auth(this.username, this.password);
this.set_active(false); this.set_active(false);
} }

View file

@ -46,7 +46,7 @@ export class Advent22 {
endpoint: string, endpoint: string,
on_success: (data: T) => void, on_success: (data: T) => void,
responseType: ResponseType = "json", responseType: ResponseType = "json",
): void { ) {
const req_data = { const req_data = {
auth: this.api_auth, auth: this.api_auth,
responseType: responseType, responseType: responseType,
@ -60,7 +60,7 @@ export class Advent22 {
public api_get_blob( public api_get_blob(
endpoint: string, endpoint: string,
on_success: (data: string) => void, on_success: (data: string) => void,
): void { ) {
this.api_get<Blob>( this.api_get<Blob>(
endpoint, endpoint,
(data: Blob) => { (data: Blob) => {
@ -81,7 +81,7 @@ export class Advent22 {
public api_get_string( public api_get_string(
endpoint: string, endpoint: string,
on_success: (data: string) => void, on_success: (data: string) => void,
): void { ) {
this.api_get<string>( this.api_get<string>(
endpoint, endpoint,
(data: string) => { (data: string) => {
@ -93,7 +93,7 @@ export class Advent22 {
public api_get_number( public api_get_number(
endpoint: string, endpoint: string,
on_success: (data: number) => void, on_success: (data: number) => void,
): void { ) {
this.api_get<number>( this.api_get<number>(
endpoint, endpoint,
(data: number) => { (data: number) => {