1$(document).ready(function () { 2 3 var $menu = $('#menu'), 4 menuOffsetTop = $menu[0].offsetTop; 5 6 $(document).bind('ready scroll', function () { 7 8 var docScroll = $(this).scrollTop(); 9 10 if (docScroll >= menuOffsetTop) { 11 $menu.addClass('fixed'); 12 } else { 13 $menu.removeClass('fixed'); 14 } 15 }); 16 17 $('#menulink').click(function(){ 18 $('#dropmenu').toggle(); 19 return false; 20 }); 21 22let cachedLyrics = null; 23 24 async function loadLyrics() { 25 try { 26 if (!cachedLyrics) { 27 const response = await fetch('/inc/xml/lyrics.xml'); 28 const str = await response.text(); 29 const parser = new DOMParser(); 30 cachedLyrics = parser.parseFromString(str, "text/xml"); 31 } 32 33 const verses = cachedLyrics.querySelectorAll('verse'); 34 const index = Math.floor(Math.random() * verses.length); 35 const selected = verses[index]; 36 37 const text = selected.querySelector('text').textContent; 38 const track = selected.querySelector('track').textContent; 39 const album = selected.querySelector('album').textContent; 40 const path = selected.querySelector('path').textContent; 41 42 const html = `${text}<em>- <a href="${path}">${track}</a> (${album})</em>`; 43 44 // You can still use jQuery's .html() here if you like! 45 $("#lyric").html(html); 46 } catch (err) { 47 $("#lyric").html("Error loading lyrics."); 48 console.error(err); 49 } 50 } 51 52 // Initial Load 53 loadLyrics(); 54 55 // The Refresh Click (using your existing jQuery selector) 56 $('.refresh').click(function(e){ 57 e.preventDefault(); 58 $('#lyric').html("Loading ..."); 59 loadLyrics(); 60 }); 61 62 $('.rotator div').each(function(){ 63 $(this).css('display','block'); 64 }); 65 66 $('#tndrop').change(function(){ 67 var sel = $("#tndrop option:selected").val() 68 window.open(sel); 69 }); 70 71 $('#item_name').change(function(){ 72 if ($("#item_name option:selected").val() != '') { 73 $('#dbtn').css('display','block'); 74 } else { 75 $('#dbtn').css('display','none'); 76 } 77 }); 78 79 var current_loc = $("#showloc").val(); 80 81 $("#showlocbox").on("click","#setloc",function(){ 82 var type = $(this).text(); 83 if (type == 'Change') { 84 $("#showloc").attr('disabled',false); 85 $("#showloc").val(''); 86 $("#setloc").text("Cancel"); 87 } else { //cancel 88 $("#showloc").attr('disabled',true); 89 $("#showloc").val(current_loc); 90 $("#setloc").text("Change"); 91 } 92 93 return false; 94 }); 95 96 $( "#showloc" ) 97 // don't navigate away from the field on tab when selecting an item 98 .bind( "keydown", function( event ) { 99 if ( event.keyCode === $.ui.keyCode.TAB && $( this ).autocomplete( "instance" ).menu.active ) { 100 event.preventDefault(); 101 } 102 }) 103 .autocomplete({ 104 105 source: function( request, response ) { 106 $.ajax({ 107 url: "/inc/ajax/livesearch.php", 108 data: { 109 term: request.term, 110 t: 'l' 111 }, 112 success: function( data ) { 113 response( data ); 114 } 115 }); 116 }, 117 118 focus: function() { 119 // prevent value inserted on focus 120 return false; 121 }, 122 select: function( event, ui ) { 123 124 $("#showloc").val(ui.item.value); 125 current_loc = ui.item.value; 126 // submit to upcoming shows 127 // if at least one show, show them 128 // else message 'no shows near x, displaying all locations' 129 $("#showloc").attr('disabled',true); 130 $("#setloc").text("Change"); 131 132 $('#upcoming').html('<div id="spincontainer"><img src="/graphics/starspinner.gif" id="spinner" /></div>'); 133 $.ajax({ 134 url : "/inc/ajax/showsearch.php", 135 type: "POST", 136 data : {l:ui.item.value,a:$("#aidl").val()}, 137 dataType: 'json', 138 success: function(data, textStatus, jqXHR) 139 { 140 141 var html = ''; 142 var pagenav = ''; 143 if (data.error != 'NONE') { 144 html = data.error; 145 } else { 146 pagenav = data.page_nav; 147 html = data.results; 148 } 149 $('#upcoming').html(html); 150 151 }, 152 error: function (jqXHR, textStatus, errorThrown) 153 { 154 $('#upcoming').html('ERROR'); 155 } 156 }); 157 return false;
158 }, 159 open: function(event, ui) { 160 $('.ui-autocomplete').off('menufocus hover mouseover mouseenter'); 161 } 162 }); 163 164 $('.rotator').slick({ 165 dots: true, 166 infinite: true, 167 speed: 500, 168 autoplay: true, 169 autoplaySpeed: 8000 170 }); 171 172 $(".lightbox").fancybox(); 173 $(".lightbox2").fancybox({ 174 fitToView: false 175 }); 176 $(".lbgallery").fancybox(); 177 178}); 179
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.