a simple web player for subsonic tinysub.devins.page
subsonic navidrome javascript
11
fork

Configure Feed

Select the types of activity you want to include in your feed.

chore: clean up comments

intergrav 33b07239 c76405f7

+1 -14
-2
src/js/auth.js
··· 46 46 const salt = Math.random().toString(36).substring(2, 8); 47 47 const token = SparkMD5.hash(validPassword + salt); 48 48 49 - // test 50 49 state.api = new SubsonicAPI(validServerUrl, validUsername, token, salt); 51 50 await state.api.ping(); 52 51 ··· 126 125 creds.token, 127 126 creds.salt, 128 127 ); 129 - // test credentials are still valid 130 128 await state.api.ping(); 131 129 await initializeApp(); 132 130 } catch (error) {
-3
src/js/contextmenu.js
··· 48 48 49 49 // display context menu with given items at position 50 50 function showContextMenu(x, y, items) { 51 - // close existing menu 52 51 removeContextMenuDisplay(); 53 52 54 53 contextMenuEl = createElement("div", { ··· 84 83 // NOTE: if we ever add context menus to library items, we'll want to make this dynamic but i think this is ok for now 85 84 getMainEl().appendChild(contextMenuEl); 86 85 87 - // position menu 88 86 const rect = contextMenuEl.getBoundingClientRect(); 89 87 contextMenuEl.style.left = `${Math.max(0, Math.min(x, window.innerWidth - rect.width))}px`; 90 88 contextMenuEl.style.top = `${Math.max(0, Math.min(y, window.innerHeight - rect.height))}px`; ··· 138 136 }; 139 137 document.addEventListener("click", currentClickHandler, { capture: true }); 140 138 141 - // prevent default browser context menu 142 139 currentSystemContextmenuEventHandler = (e) => { 143 140 if ( 144 141 !contextMenuEl?.contains(e.target) &&
-7
src/js/input.js
··· 1 1 // most keyboard and input control 2 2 // TODO: kinda a monolith file, maybe should split into separate modules later? idk :p 3 3 4 - // tab order 5 - 6 4 // selector for all interactive elements that should be non-tabbable 7 5 const INTERACTIVE_SELECTOR = 8 6 "button, a, input, select, textarea, [role='button'], tr, li, ul, .section-toggle"; ··· 59 57 } 60 58 61 59 let tabOrderObserver; 62 - 63 - // queue navigation 64 60 65 61 // navigate queue selection with arrow keys 66 62 const navigateSelection = (offset, extend = false) => { ··· 157 153 }, 158 154 }; 159 155 160 - // keyboard shortcuts 161 - 162 - // setup keyboard shortcuts 163 156 function setupKeyboardShortcuts() { 164 157 // setup keyboard help close button 165 158 const closeKeyboardHelpBtn = document.getElementById(
+1 -1
src/js/library-search.js
··· 1 - // search functionality 1 + // library search functionality 2 2 3 3 let searchTimeout; 4 4
-1
src/js/library.js
··· 49 49 } 50 50 } 51 51 52 - // get handler and execute 53 52 const handler = addNext ? addNextByType[type] : addByType[type]; 54 53 55 54 if (handler) {