1/** 2 * constants.js â Named constants used across the firetable application. 3 * 4 * Replaces magic numbers and hardcoded strings scattered throughout the 5 * codebase with a single, documented source of truth. 6 */ 7 8// âââ Media Types âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ 9/** YouTube video */ 10var MEDIA_YOUTUBE = 1; 11/** SoundCloud track */ 12var MEDIA_SOUNDCLOUD = 2; 13 14// âââ Defaults ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ 15/** Default player volume (0â100) */ 16var DEFAULT_VOLUME = 80; 17/** How long before a user is marked idle (ms) â 5 minutes */ 18var IDLE_TIMEOUT = 5 * 60000; 19/** How long a track preview plays before auto-stopping (ms) â 30 seconds */ 20var PREVIEW_DURATION = 30 * 1000; 21/** 16:9 aspect ratio used for the YouTube player sizing */ 22var ASPECT_RATIO = 16 / 9; 23/** Default brand colour (firetable orange) */ 24var COLOR_ORANGE = "#cc9933"; 25 26// âââ localStorage Keys ââââââââââââââââââââââââââââââââââââââââââââââââââââââ 27/** 28 * All localStorage key strings in one place. 29 * Usage: localStorage[STORAGE.volume] instead of localStorage["firetableVol"] 30 */ 31var STORAGE = { 32 volume: "firetableVol", 33 mute: "firetableMute", 34 disableMedia: "firetableDisableMedia", 35 showImages: "firetableShowImages", 36 showAvatars: "firetableShowAvatars", 37 showSongAnnouncements: "firetableShowSongAnnouncements", 38 badoop: "firetableBadoop", 39 desktopNotify: "firetableDTNM", 40 screenControl: "firetableScreenControl", 41 avatarStyle: "firetableAvatarStyle", 42 lastfmSession: "ftLastfmSession", 43 navView: "firetableNavView", 44 navSide: "firetableNavSide", 45 navMobile: "firetableNavMobile" 46}; 47
48// âââ External Service URLs ââââââââââââââââââââââââââââââââââââââââââââââââââ 49/** Avatar / Robohash image base URL */ 50var AVATAR_BASE_URL = "https://indiediscotheque.com/robots/"; 51/** SoundCloud link resolver proxy */ 52var SC_RESOLVE_URL = "https://thompsn.com/resolvesc/"; 53/** SoundCloud general proxy */ 54var SC_PROXY_URL = "https://thompsn.com/soundcloud/"; 55/** SoundCloud API track base URL */ 56var SC_API_TRACK_URL = "https://api.soundcloud.com/tracks/"; 57/** Last.fm API base URL */ 58var LASTFM_API_URL = "https://ws.audioscrobbler.com/2.0/"; 59 60// âââ Emoji Data Sources âââââââââââââââââââââââââââââââââââââââââââââââââââââ 61var EMOJI_URLS = [ 62 "https://unpkg.com/[email protected]/data-by-group.json", 63 "https://unpkg.com/[email protected]/emojis.json", 64 "https://unpkg.com/[email protected]/dist/emoji-en-US.json" 65]; 66 67// âââ Search Result Limits âââââââââââââââââââââââââââââââââââââââââââââââââââ 68/** Max results returned from YouTube / SoundCloud searches */ 69var SEARCH_MAX_RESULTS = 15; 70/** Max results per page for YouTube playlist import pagination */ 71var IMPORT_PAGE_SIZE = 50; 72 73// âââ Preview Bar Update Interval ââââââââââââââââââââââââââââââââââââââââââââ 74/** How often the preview progress bar updates (ms) */ 75var PREVIEW_BAR_INTERVAL = 200; 76/** How often the song progress bar updates (ms) */ 77var PROGRESS_BAR_INTERVAL = 500; 78 79// âââ Platform Logo SVGs ââââââââââââââââââââââââââââââââââââââââââââââââââââââ 80var YT_LOGO_SVG = '<svg aria-hidden="true" focusable="false" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512" width="1em" height="1em"><path fill="currentColor" d="M549.655 124.083c-6.281-23.65-24.787-42.276-48.284-48.597C458.781 64 288 64 288 64S117.22 64 74.629 75.486c-23.497 6.322-42.003 24.947-48.284 48.597-11.412 42.867-11.412 132.305-11.412 132.305s0 89.438 11.412 132.305c6.281 23.65 24.787 41.5 48.284 47.821C117.22 448 288 448 288 448s170.78 0 213.371-11.486c23.497-6.321 42.003-24.171 48.284-47.821 11.412-42.867 11.412-132.305 11.412-132.305s0-89.438-11.412-132.305zm-317.51 213.508V175.185l142.739 81.205-142.739 81.201z"/></svg>'; 81var SC_LOGO_SVG = '<svg aria-hidden="true" focusable="false" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512" width="1em" height="1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-3.9-177.5c-.4-3-2-5.8-4.5-7.2zm-26.7 15.3c-1.4-.8-2.8-1.4-4.4-1.4s-3.1.6-4.4 1.4c-2.2 1.4-3.6 3.9-3.6 6.7l-.3 1.7-2.8 160.8s0 .3 3.1 65.6v.3c0 1.7.6 3.3 1.7 4.7 1.7 1.9 3.9 3.1 6.4 3.1 2.2 0 4.2-1.1 5.6-2.5 1.7-1.4 2.5-3.3 2.5-5.6l.3-6.7 3.1-58.6-3.3-162.8c-.3-2.8-1.7-5.3-3.9-6.7zm-111.4 22.5c-3.1 0-5.8 2.8-5.8 6.1l-4.4 140.6 4.4 67.2c.3 3.3 2.8 5.8 5.8 5.8 3.3 0 5.8-2.5 6.1-5.8l5-67.2-5-140.6c-.2-3.3-2.7-6.1-6.1-6.1zm376.7 62.8c-10.8 0-21.1 2.2-30.6 6.1-6.4-70.8-65.8-126.4-138.3-126.4-17.8 0-35 3.3-50.3 9.4-6.1 2.2-7.8 4.4-7.8 9.2v249.7c0 5 3.9 8.6 8.6 9.2h218.3c43.3 0 78.6-35 78.6-78.3.1-43.6-35.2-78.9-78.5-78.9zm-296.7-60.3c-4.2 0-7.5 3.3-7.8 7.8l-3.3 136.7 3.3 65.6c.3 4.4 3.6 7.8 7.8 7.8 4.4 0 7.8-3.3 7.8-7.8l3.6-65.6-3.6-136.7c0-4.4-3.3-7.8-7.8-7.8z"/></svg>';
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.