From 67314a8bc22ea198b8e3de788282a0ca0151cb1e Mon Sep 17 00:00:00 2001 From: Caleb Date: Sun, 4 Sep 2022 00:02:19 -0400 Subject: Several functions moved --- webAO/dom/musicListClick.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 webAO/dom/musicListClick.ts (limited to 'webAO/dom/musicListClick.ts') diff --git a/webAO/dom/musicListClick.ts b/webAO/dom/musicListClick.ts new file mode 100644 index 0000000..1eb6619 --- /dev/null +++ b/webAO/dom/musicListClick.ts @@ -0,0 +1,21 @@ +import { client } from "../client"; +/** + * Triggered when an item on the music list is clicked. + * @param {MouseEvent} event + */ +export function musiclist_click(_event: Event) { + const playtrack = (( + document.getElementById("client_musiclist") + )).value; + client.sendMusicChange(playtrack); + + // This is here so you can't actually select multiple tracks, + // even though the select tag has the multiple option to render differently + const musiclist_elements = (( + document.getElementById("client_musiclist") + )).selectedOptions; + for (let i = 0; i < musiclist_elements.length; i++) { + musiclist_elements[i].selected = false; + } +} +window.musiclist_click = musiclist_click; \ No newline at end of file -- cgit From 1e3fde25b9f6d8adbdf087a51a34dc35cc1907d8 Mon Sep 17 00:00:00 2001 From: stonedDiscord Date: Sun, 4 Sep 2022 22:30:31 +0200 Subject: undo dom stuff --- webAO/dom/musicListClick.ts | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 webAO/dom/musicListClick.ts (limited to 'webAO/dom/musicListClick.ts') diff --git a/webAO/dom/musicListClick.ts b/webAO/dom/musicListClick.ts deleted file mode 100644 index 1eb6619..0000000 --- a/webAO/dom/musicListClick.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { client } from "../client"; -/** - * Triggered when an item on the music list is clicked. - * @param {MouseEvent} event - */ -export function musiclist_click(_event: Event) { - const playtrack = (( - document.getElementById("client_musiclist") - )).value; - client.sendMusicChange(playtrack); - - // This is here so you can't actually select multiple tracks, - // even though the select tag has the multiple option to render differently - const musiclist_elements = (( - document.getElementById("client_musiclist") - )).selectedOptions; - for (let i = 0; i < musiclist_elements.length; i++) { - musiclist_elements[i].selected = false; - } -} -window.musiclist_click = musiclist_click; \ No newline at end of file -- cgit From fb3590ad774a07f45eaaaeb2b443ae264c302f3b Mon Sep 17 00:00:00 2001 From: Caleb Date: Sun, 4 Sep 2022 20:45:52 -0400 Subject: Prep folder with example --- webAO/dom/musicListClick.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 webAO/dom/musicListClick.ts (limited to 'webAO/dom/musicListClick.ts') diff --git a/webAO/dom/musicListClick.ts b/webAO/dom/musicListClick.ts new file mode 100644 index 0000000..8fd3be5 --- /dev/null +++ b/webAO/dom/musicListClick.ts @@ -0,0 +1,21 @@ +import { client } from "../client"; +/** + * Triggered when an item on the music list is clicked. + * @param {MouseEvent} event + */ +export function musiclist_click(_event: Event) { + const playtrack = (( + document.getElementById("client_musiclist") + )).value; + client.sendMusicChange(playtrack); + + // This is here so you can't actually select multiple tracks, + // even though the select tag has the multiple option to render differently + const musiclist_elements = (( + document.getElementById("client_musiclist") + )).selectedOptions; + for (let i = 0; i < musiclist_elements.length; i++) { + musiclist_elements[i].selected = false; + } +} +window.musiclist_click = musiclist_click; -- cgit From 776fe2f4241a67be354908df546f300f413a7d42 Mon Sep 17 00:00:00 2001 From: Caleb Date: Thu, 8 Sep 2022 22:20:32 -0400 Subject: I'm so sorry --- webAO/dom/musicListClick.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'webAO/dom/musicListClick.ts') diff --git a/webAO/dom/musicListClick.ts b/webAO/dom/musicListClick.ts index 8fd3be5..2243553 100644 --- a/webAO/dom/musicListClick.ts +++ b/webAO/dom/musicListClick.ts @@ -7,7 +7,7 @@ export function musiclist_click(_event: Event) { const playtrack = (( document.getElementById("client_musiclist") )).value; - client.sendMusicChange(playtrack); + client.sender.sendMusicChange(playtrack); // This is here so you can't actually select multiple tracks, // even though the select tag has the multiple option to render differently -- cgit