1jQuery( document ).ready( function( $ ) { 2 if ($("[data-wott-calendar]").length){ 3 var style = "list"; 4 5 if ($("[data-wott-calendar]").data("wott-calendar") == "tiles"){ 6 style = "tiles"; 7 } else if ($("[data-wott-calendar]").data("wott-calendar") == "blocks"){ 8 style = "blocks"; 9 } 10 11 // 12 // do we have a specific tile count ? 13 var largeTileCount = 3; 14 var mediumTileCount = 2; 15 var smallTileCount = 1; 16 if ($("[data-wott-calendar]").data("wott-calendar-block-count")){ 17 tileCounts = $("[data-wott-calendar-block-count]").data("wott-calendar-block-count"); 18 var tileCountPieces = tileCounts.split(","); 19 if (tileCountPieces[0]){ smallTileCount = tileCountPieces[0]; } 20 if (tileCountPieces[1]){ mediumTileCount = tileCountPieces[1]; } 21 if (tileCountPieces[2]){ largeTileCount = tileCountPieces[2]; } 22 } 23 24 // poweredby do615! 25 // 2021: maybe not for long, starting to block automated calls. 26 var showsURL = "/api/do615.php?callback=?"; 27 jQuery.getJSON(showsURL, function(data){ 28 var items = []; 29 var date = ""; 30 var firstpass = true; 31 var theclass = ""; 32 var thehtml = ""; 33 var tileCounter = 0; 34 35 $.each(data, function(key, val) { 36 37 if (val.date != date){ 38 if (!firstpass){ 39 // ending a group - should we add extra blocks for tile style? 40 if (style == "tiles" && tileCounter <3){ 41 // add chunks 42 for($i=0;$i<=2-tileCounter;$i++){ 43 thehtml += '<div class="column event-card event-card-tile hide-for-small-only"><div class="very-light-grey-bg event-image"> </div></div>'; 44 } 45 } 46 tileCounter = 0; 47 thehtml += "</div>"; // ended a row chunk of dates 48 } 49 // new date present, output date header first 50 theclass="date"; 51 date = val.date; 52 thehtml += '<h3 class="thedate margin-bottom-small style-'+style+'"><span class="icon">📅</span> ' + val.displayDate + '</h3>'; 53 54 if (style =='list' || style =='blocks'){ 55 thehtml += '<div class="row small-up-'+smallTileCount+' medium-up-'+mediumTileCount+' large-up-'+largeTileCount+'">'; 56 } else if (style == 'tiles'){ 57 thehtml += '<div class="row small-up-1 medium-up-'+tileCount+'">'; 58 } 59 60 } 61 62 // set some other helper values 63 var cardDestination = "#"; 64 if (val.buyUrl){ 65 cardDestination = val.buyUrl; 66 } 67 68 // then output the actual event 69 if (style == "list" ){ 70 thehtml += ' <div class="column event-card event-card-list">'; 71 thehtml += ' <hgroup>'; 72 if (val.presentedBy != "" && val.presentedBy != null){ 73 thehtml += ' <h5 class="event-presented-by">'+val.presentedBy+'</h5>'; 74 } 75 thehtml += ' <h3 class="event-title"><a href="'+cardDestination+'" target="_blank">' + val.title + '</a></h3>'; 76 thehtml += ' <h4 class="event-venue grey">' + val.venue + '</h4>'; 77 thehtml += ' </hgroup>'; 78 thehtml += ' </div>'; 79 80 81 } else if (style == "tiles"){ 82 thehtml += '<div class="column event-card event-card-tile">'; 83 thehtml += ' <div class="event-image margin-bottom-xsmall"><a href="'+cardDestination+'" target="_blank" style="background-image: url('+val.image+')"></a></div>'; 84 thehtml += ' <hgroup>'; 85 if (val.presentedBy != "" && val.presentedBy != null){ 86 thehtml += ' <h5 class="event-presented-by">'+val.presentedBy+'</h5>'; 87 } 88 thehtml += ' <h3 class="event-title"><a href="'+cardDestination+'" target="_blank">' + val.title + '</a></h3>'; 89 thehtml += ' <h4 class="event-venue grey">' + val.venue + '</h4>'; 90 thehtml += ' </hgroup>'; 91 thehtml += '</div>'; 92 tileCounter++; 93 94 } else if (style == "blocks"){ 95 thehtml += '<div class="column event-card event-card-block">'; 96 thehtml += '<div class="event-card-block-container">'; 97 thehtml += ' <a href="'+cardDestination+'" target="_blank">'; 98 if (val.image){ 99 thehtml += ' <div class="event-image-bg">'; 100 thehtml += ' <img src="'+val.image+'" loading="lazy" class="event-image-src" />';
101 thehtml += ' </div>'; 102 } else { 103 thehtml += ' <div class="event-image-bg event-image-bg-empty"></div>'; 104 } 105 thehtml += ' <hgroup class="event-title-container">'; 106 if (val.presentedBy != "" && val.presentedBy != null){ 107 thehtml += ' <h5 class="event-presented-by white">'+val.presentedBy+'</h5>'; 108 } 109 thehtml += ' <h3 class="event-title white strong">' + val.title + '</h3>'; 110 thehtml += ' <h4 class="event-venue white">' + val.venue + '</h4>'; 111 thehtml += ' </hgroup>'; 112 thehtml += ' </a>'; 113 thehtml += '</div>'; 114 thehtml += '</div>'; 115 tileCounter++; 116 } 117 118 firstpass = false; 119 }); 120 // end the list 121 thehtml += "</div>"; 122 123 //console.log(thehtml); 124 $("[data-wott-calendar]").html(thehtml); 125 if ($("[data-wott-calendar]").data("equalizer")){ 126 var equaltarg = $("[data-wott-calendar]").data("equalizer"); 127 var equalheight = $("#"+equaltarg).outerHeight(); 128 if ($("[data-equalizer-subtract*='wott-calendar']").length){ 129 var minusheight = $("[data-equalizer-subtract='wott-calendar']").outerHeight(); 130 equalheight = equalheight - minusheight; 131 } 132 $("[data-wott-calendar]").addClass("overflow-scroll").height(equalheight); 133 } 134 }); 135 } 136}); 137 138 139 140/* 141 // version 1 142 // poweredby songkick! 143 var showsURL = "http://weownthistown.net/api/rest/?method=syndicate.getCalendar&format=json&callback=?"; 144 $.getJSON(showsURL, function(data){ 145 var items = []; 146 var date = ""; 147 var theclass = ""; 148 var thehtml = "<ul>"; 149 150 $.each(data.data, function(key, val) { 151 152 153 if (val.date != date){ 154 theclass="date"; 155 date = val.date; 156 thehtml += '<li class="thedate"><span class="icon">📅</span> ' + val.displayDate + '</li>' 157 } 158 thehtml += '<li><hgroup><h3>' + val.title + '</h3><h4>' + val.venue + '</h4></hgroup></li>'; 159 }); 160 thehtml += "</ul>"; 161 162 //console.log(thehtml); 163 $("#right").html(thehtml); 164 if ($("#right").height() > $("#center").height()){ 165 $("#center").css("height",$("#right").height()); 166 } 167 }); 168*/
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.