From: 2weiEmu Date: Thu, 9 Apr 2026 14:49:29 +0000 (+0200) Subject: updated: wanna add some scripts, that and better unfocusing on popup element X-Git-Url: https://git.saalbach.dev/?a=commitdiff_plain;h=fb42412c8321d22615b7bead167ca17d806327b5;p=binbsis50-sm.git updated: wanna add some scripts, that and better unfocusing on popup element --- diff --git a/public/js/index.js b/public/js/index.js index 8e57e09..d87845c 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -4,6 +4,7 @@ let currentEditSong = null let dbSongList = document.getElementById("db_status_song_list") let editElement = document.getElementById("editElement") + let songFileList = document.getElementById("song_file_list") @@ -44,8 +45,11 @@ function openEditElement(song) { editDisplayTrackName.value = song.DisplayTrackName updateSongFile.className = song.Key + + editArtistName.focus() } + function closeEditElement() { editElement.style.display = "none" } @@ -246,3 +250,20 @@ async function renameFileItself(event) { get_updated_status() } + +function closeIfNotInEditor(event) { + console.log("Focus has changd") + if (!editElement.contains(event.relatedTarget)) { + console.log("Closing Element") + closeEditElement() + } +} + +editElement.addEventListener("focusout", closeIfNotInEditor) +editArtistName.addEventListener("focusout", closeIfNotInEditor) +editTrackName.addEventListener("focusout", closeIfNotInEditor) +editTrackViewUrl.addEventListener("focusout", closeIfNotInEditor) +editPreviewUrl.addEventListener("focusout", closeIfNotInEditor) +editArtworkUrl60.addEventListener("focusout", closeIfNotInEditor) +editArtworkUrl100.addEventListener("focusout", closeIfNotInEditor) +editDisplayArtistNames.addEventListener("focusout", closeIfNotInEditor) diff --git a/scripts/get_from_redis.py b/scripts/get_from_redis.py new file mode 100644 index 0000000..8c97162 --- /dev/null +++ b/scripts/get_from_redis.py @@ -0,0 +1,19 @@ +import sys + +def main(): + args = sys.argv + + if len(args) < 2: + print("Please provide an output filename") + exit() + + # get all the songs + + + # get all the rooms + + # get all the user data + + +if __name__ == "__main__": + main() diff --git a/songmanager b/songmanager index 45ee3df..9a48265 100755 Binary files a/songmanager and b/songmanager differ diff --git a/testing/dummy_testing_data.py b/testing/dummy_testing_data.py index 6df1017..2bde741 100644 --- a/testing/dummy_testing_data.py +++ b/testing/dummy_testing_data.py @@ -2,7 +2,7 @@ import redis def main(): - r = redis.Redis(host="localhost", port="6379", decode_responses=True) + r = redis.Redis(host="localhost", port=6379, decode_responses=True) with open("song-map.csv", "r") as mapcsv: all = mapcsv.readlines()