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;
};
public mounted(): void {
public mounted() {
this.$advent22.api_get_string("days/date", (date: string) => {
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);
}
}

View file

@ -17,7 +17,7 @@ export default class CalendarDoor extends Vue {
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.$emit("openDoor", data);
});

View file

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

View file

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

View file

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