1jQuery(document).ready(function ($) { 2 "use strict" 3 4 var filters = $("#grid_filters") 5 var adminForm = $("#adminForm") 6 var selects = $("select") 7 var reset = $("a.reset") 8 var filter_keyword = $("#filter_keyword") 9 var filter_layout = $("#filter_layout") 10 //var filter_day_id = $('#filter_day_id'); 11 var filter_ndr = $("#filter_ndr") 12 var filter_to_hear = $("#filter_to_hear") 13 //var toggleFilters = $("#toggleFilters") 14 var btn_layout = $(".btn-layout") 15 var btn_ndr = $(".btn-ndr") 16 var btn_to_hear = $(".btn-to-hear") 17 var btn_ndr_en = $(".btn-ndr-en") 18 var search_button = $("#search_button") 19 var juri_root = window.Joomla.getOptions("system.paths").root 20 var today = new Date().toJSON().slice(0, 10).replace(/-/g, " ") 21 var component = $("#component") 22 var targetToday 23 var ajax_loader = $(".ajax-loader") 24 //var hreflangEn = $('link[hreflang=en]').prop('href'); 25 26 $(".show-extra-filters").click(function () { 27 $("#grid_filters").addClass("active") 28 $("body").addClass("extra-filters-active") 29 return false 30 }) 31 32 // close 33 $(".hide-extra-filters").click(function () { 34 $("#grid_filters").removeClass("active") 35 $("body").removeClass("extra-filters-active") 36 return false 37 }) 38 39 /* 40 // age reset button inline on top 41 $("#filter_age_ids").on("changed.bs.select", function (event, clickedIndex, newValue, oldValue) { 42 if (clickedIndex === 0) { 43 $("#filter_age_ids").selectpicker("deselectAll") 44 } 45 }) 46 */ 47 48 adminForm.on("submit", function (el) { 49 ajaxPost(el) 50 return false 51 }) 52 53 //today = '2020-10-23'; 54 //scrollToToday(); 55 function scrollToToday() { 56 targetToday = component.find('a[data-date="' + today + '"]').eq(1) 57 if (targetToday.length) { 58 $("html, body").animate( 59 { 60 scrollTop: targetToday.offset().top - header.outerHeight(), 61 }, 62 1000, 63 function () { 64 // Animation complete. 65 } 66 ) 67 } else { 68 scrollToTop() 69 } 70 } 71 72 function scrollToTop() { 73 $("html, body").animate( 74 { 75 scrollTop: 0, 76 }, 77 1000, 78 function () { 79 // Animation complete. 80 } 81 ) 82 } 83 84 function ajaxPost(el) { 85 //console.log(el) 86 if ($("body").hasClass("extra-filters-active") && el.type != "submit") { 87 return 88 } 89 90 window.history.pushState("", "", overview) 91 //window.history.replaceState(data, title, url); is also useful â Pierre Apr 15 '18 at 17:43 92 93 // remove active to collapse it 94 $("body").removeClass("extra-filters-active") 95 filters.removeClass("active") 96 // close open drowdowns 97 $(".bootstrap-select").removeClass("open").find("button").attr("aria-expanded", false) 98 var params = adminForm.serialize() 99 100 if (params.indexOf("age_id") == -1) { 101 params = params + "&filter[age_id]=" 102 } 103 104 var url = juri_root + "/index.php?option=com_db&tmpl=clean&" + params + " #data" 105 //console.log(url) 106 $.ajax({ 107 url: url, 108 context: "#data", 109 //async: true, 110 success: function (data) { 111 component.html(data) 112 if (filter_layout.val() == "grid") { 113 //updateLazy(); 114 scrollToTop() 115 $(".lazy").Lazy() 116 } 117 if (filter_layout.val() == "list") { 118 scrollToToday() 119 showTooltips() 120 } 121 }, 122 }) 123 } 124 125 function showTooltips() { 126 // show tooltips on hovering the rows 127 console.log("show tooltips") 128 $(".grid-item-content.lijst") 129 .mouseenter(function () { 130 var tooltips = $(this).find('[data-popup="tooltip"]') 131 tooltips.tooltip("show") 132 }) 133 .mouseleave(function () { 134 var tooltips = $(this).find('[data-popup="tooltip"]') 135 tooltips.tooltip("hide") 136 }) 137 } 138 139 ajax_loader.hide() 140 141 search_button.on("click", function (el) { 142 ajaxPost(el) 143 return false 144 }) 145 146 selects.on("change", function (el) { 147 //console.log($(this).val()); 148 ajaxPost(el) 149 }) 150 151 showTooltips() 152 153 $(".switch").on("change", function (el) { 154 ajaxPost(el) 155 }) 156 157 btn_layout.on("click", function (el) { 158 // set layout hidden field 159 filter_layout.val($(this).data("layout")) 160 // set correct filter button active 161 $(this).addClass("active").blur().siblings(".btn-layout").removeClass("active") 162 ajaxPost(el) 163 return false 164 }) 165 166 // this is the button 'No Dutch Required (EN)' on programma/overzicht 167 btn_ndr_en.on("click", function () { 168 $(".lang-inline li:last-child a").trigger("click") 169 return false 170 }) 171 172 btn_ndr.on("click", function (el) { 173 var ndr = $(this).data("ndr") 174 filter_ndr.val(ndr) 175 filter_to_hear.val("") 176 177 // set correct filter button active 178 $(".ndr-box a").removeClass("active") 179 $(this).addClass("active").blur() 180 //$(this).addClass('active').blur().siblings('.btn-ndr').removeClass('active'); 181 ajaxPost(el) 182 return false 183 }) 184 185 btn_to_hear.on("click", function (el) { 186 filter_to_hear.val(1) 187 filter_ndr.val("") 188 // set correct filter button active 189 $(".ndr-box a").removeClass("active") 190 $(this).addClass("active").blur() 191 ajaxPost(el) 192 return false 193 }) 194 195 // mobile show / hide filters button 196 const body = $("body") 197 const show_filters = $(".show-filters") 198 show_filters.on("click", function () { 199 filters.addClass("active") 200 body.addClass("filters-active") 201 return false 202 }) 203 204 const hide_filters = $(".hide-filters") 205 hide_filters.on("click", function () { 206 filters.removeClass("active") 207 body.removeClass("filters-active") 208 return false 209 }) 210 211 ajax_loader 212 .bind("ajaxStart", function () { 213 $(this).fadeIn() 214 }) 215 .bind("ajaxStop", function () { 216 $(this).fadeOut() 217 }) 218 219 // reset all inputs 220 reset.on("click", function (el) { 221 // clear keyword 222 filter_keyword.val("") 223 // clear all selects 224 $(".selectpicker").selectpicker("val", "0") 225 // close open drowdowns 226 $(".bootstrap-select").removeClass("open").find("button").attr("aria-expanded", false) 227 // set day_id to default start day 228 //filter_day_id.selectpicker('val', 0); 229 230 // reset ndr to 2? 231 //$(".ndr-box [data-ndr=2]").trigger('click'); 232 233 /* 234 $(".ndr-box a").removeClass("active") 235 $("[data-ndr=2]").addClass("active") 236 237 filter_to_hear.val(2) 238 filter_ndr.val(2) 239 */ 240 241 $("#filter_age_id").selectpicker("val", "") 242 243 $("#filter_ndr").attr("checked", false) 244 $("#filter_visually_impaired").attr("checked", false) 245 $("#filter_hearing_impaired").attr("checked", false) 246 $("#filter_irritable").attr("checked", false) 247 $("#filter_interpreter").attr("checked", false) 248 249 $("#filter_intellectual_disability").attr("checked", false) 250 $("#filter_free").attr("checked", false) 251 252 ajaxPost(el) 253 return false 254 }) 255 256 $(".lijst") 257 .mouseenter(function () { 258 var tooltips = $(this).find('[data-gos="tooltip"]') 259 tooltips.tooltip("show") 260 }) 261 .mouseleave(function () { 262 var tooltips = $(this).find('[data-gos="tooltip"]') 263 tooltips.tooltip("hide") 264 }) 265})
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.