1// IE console fix 2window.console || (console = {}, console.log=function(){}); 3 4/* =============================== 5 * M O D U L E S 6 * =============================== */ 7 8(function($) { 9 10 /** 11 * Copyright 2012, Digital Fusion 12 * Licensed under the MIT license. 13 * http://teamdf.com/jquery-plugins/license/ 14 * 15 * @author Sam Sehnert 16 * @desc A small plugin that checks whether elements are within 17 * the user visible viewport of a web browser. 18 * only accounts for vertical position, not horizontal. 19 */ 20 21 $.fn.visible = function(partial) { 22 23 let $t = $(this), 24 $w = $(window), 25 viewTop = $w.scrollTop(), 26 viewBottom = viewTop + $w.height(), 27 _top = $t.offset().top, 28 _bottom = _top + $t.height(), 29 compareTop = partial === true ? _bottom : _top, 30 compareBottom = partial === true ? _top : _bottom; 31 32 return ((compareBottom <= viewBottom) && (compareTop >= viewTop)); 33 34 }; 35 36})(jQuery); 37 38/** 39 * scroll to a section and set the hash 40 */ 41function goTo(hash){ 42 let pos = 0; 43 if(hash != '#') { 44 let height = $('#page-header').height(); 45 pos = Math.round($(hash).offset().top) - height +10; // offset 46 } 47 if(pos < 0) pos = 0; 48 $('.rows-wrap').removeClass('highlighted'); 49 $(hash).addClass('highlighted'); 50 $("html,body").animate({ scrollTop: pos }, "slow"); 51} 52 53/** 54 * check for emty string 55 * 56 * @param str 57 * @returns {Boolean} 58 */ 59function isEmpty(str) { 60 return (!str || 0 === str.length); 61} 62 63/** 64 * check if it is mobile view 65 * 66 * @returns {Boolean} 67 */ 68function isMobile() { 69 return $('.navbar-toggler').is(":visible") ; 70} 71 72 73// document ready 74$(function(){ 75 76 // get info 77 let hash = window.location.hash; 78 79 // action 80 if(hash.indexOf("#") > -1) { 81 if(hash != "#") { 82 location.hash = hash; 83 $( hash ).addClass('in').addClass('show'); 84 goTo(hash); 85 // return false; 86 } 87 } 88 $('.carousel-item.initial').addClass('zoom').removeClass('initial'); 89 90 $('[data-bs-toggle="tooltip"]').tooltip() 91 92 //$.datepicker.setDefaults($.datepicker.regional['de']); 93 94 // Navigation toggle 95 /* 96 $(".navbar-toggler").click(function(event){ 97 event.preventDefault(); 98 99 if($("#mainnavigation").is(":visible") ) { 100 $('#page-header').addClass('navbar-fixed-top'); 101 $('.body-bg-top').css('padding-top','70px'); 102 } else { 103 $('#page-header').removeClass('navbar-fixed-top'); 104 $('.body-bg-top').css('padding-top','0px'); 105 } 106 });*/ 107 108 109 110 // gridelements slider 111 $('.rsys-flex-direction-nav .flex-prev').click(function(event){ 112 event.preventDefault(); 113 $(this).parent().parent().parent().flexslider('prev'); 114 }); 115 $('.rsys-flex-direction-nav .flex-next').click(function(event){ 116 event.preventDefault(); 117 $(this).parent().parent().parent().flexslider('next'); 118 }); 119 120 // lightbox text 121 if(jQuery('a.lightbox-text').length > 0){ 122 let jQuerylightboxModal = "\ 123 <div class='modal fade' id='lightbox-text' tabindex='-1' role='dialog' aria-hidden='true'>\ 124 <div class='modal-dialog modal-lightbox modal-dialog-centered\"'>\ 125 <div class='modal-content'>\ 126 <div class='modal-body'></div>\ 127 <div class=\"modal-footer\">\ 128 <button type=\"button\" class=\"btn btn-secondary\" data-bs-dismiss=\"modal\">SchlieÃen</button>\ 129 </div>\ 130 </div>\ 131 </div>\ 132 </div>\ 133 "; 134 jQuery('body').append(jQuerylightboxModal); 135 jQuery('.lightbox-text').click(function(event){ 136 event.preventDefault(); 137 let jQuerylightbox = jQuery('#lightbox-text'); 138 let jQuerymodalBody = jQuerylightbox.find('.modal-body'); 139 let jQuerymodalDialog = jQuerylightbox.find('.modal-dialog'); 140 jQuerymodalBody.empty(); 141 142 let jQuerysrc = jQuery(this).attr("href"); 143 jQuery.get( jQuerysrc, function( data ) { 144 //jQuerymodalDialog.width("80%"); 145 //jQuerymodalDialog.css({ "max-width": '85%' }); 146 jQuerymodalBody.append(data); 147 148 }); 149 const myModal = new bootstrap.Modal('#lightbox-text', { 150 keyboard: true 151 }); 152 myModal.show(); 153 154 return false;
155 }); 156 } 157 158 // accordion icon change 159 $('.panel-collapse').on('show.bs.collapse', function () { 160 toggleIcon = $(this).prev().find('.fas');//console.log(toggleIcon); 161 toggleIcon.addClass('fa-chevron-up').removeClass('fa-chevron-down'); 162 target = $(this).parent(); 163 $(target).addClass('stay-visible'); 164 $(target).removeClass('visible-on-hover'); 165 }); 166 $('.panel-collapse').on('hide.bs.collapse', function () { 167 toggleIcon = $(this).prev().find('.fas');//console.log(toggleIcon); 168 toggleIcon.removeClass('fa-chevron-up').addClass('fa-chevron-down'); 169 target = $(this).parent(); 170 $(target).removeClass('stay-visible'); 171 $(target).addClass('visible-on-hover'); 172 }); 173 174 // accordion icon change 175 $('.shoptext-toggle').click(function () { 176 toggleIcon = $(this).find('.fas'); 177 if ( $(toggleIcon).hasClass('fa-chevron-up') ) { 178 toggleIcon.addClass('fa-chevron-down').removeClass('fa-chevron-up'); 179 } else { 180 toggleIcon.addClass('fa-chevron-up').removeClass('fa-chevron-down'); 181 } 182 target = $(this).parent(); 183 }); 184 185 186 /* ------------------------------- 187 * SCROLL ANIMATION 188 * ------------------------------- */ 189 190 let element = null; 191 192 // Already visible modules 193 $(".content-slide-in").each(function(i, el) { 194 element = $(el); 195 if (element.visible(true)) { 196 element.addClass("already-visible"); 197 } 198 }); 199 200 $(window).scroll(function(event) { 201 $(".content-slide-in").not( ".already-visible" ).each(function(i, el) { 202 element = $(el); 203 if (element.visible(true)) { 204 element.addClass("come-in"); 205 } 206 }); 207 }); 208 209 210 $(window).scroll(function(event) { 211 $(".content-slide-left").not( ".already-visible" ).each(function(i, el) { 212 element = $(el); 213 if (element.visible(true)) { 214 element.addClass("come-in-left"); 215 } 216 }); 217 }); 218 219 $(window).scroll(function(event) { 220 $(".content-slide-right").not( ".already-visible" ).each(function(i, el) { 221 element = $(el); 222 if (element.visible(true)) { 223 element.addClass("come-in-right"); 224 } 225 }); 226 }); 227 228 //-------------------------- 229 // Address Plugin 230 //-------------------------- 231 $('.cat-filter').click(function(event){ 232 event.preventDefault(); 233 let dataAddress = $(this).data('cat-filter'); 234 $(this).parent().parent().children('.rsystemplate_bootstrap-address-list-wrap').hide(); 235 $(this).parent().parent().children('.cat-' + dataAddress).show(); 236 $(this).parent().children('.cat-filter').removeClass('active'); 237 $(this).parent().children('.cat-filter-clear').removeClass('active'); 238 $(this).addClass('active'); 239 }); 240 $('.cat-filter-clear').click(function(event){ 241 event.preventDefault(); 242 $(this).parent().parent().children('.rsystemplate_bootstrap-address-list-wrap').show(); 243 $(this).parent().children('.cat-filter').removeClass('active'); 244 $(this).addClass('active'); 245 }); 246 $('.cat-filter ').each(function( index ) { 247 let dataAddressFilter = $(this).data('cat-filter'); 248 let count = $(this).parent().parent().children('.cat-' + dataAddressFilter).length; 249 if(count == 0) { 250 $(this).hide(); 251 } else { 252 $(this).html( $(this).html() + ' <span class="badge bg-secondary">' + count + '</span>'); 253 } 254 }); 255 256 $('.cat-filter-clear').each(function( index ) { 257 let countClear = $(this).parent().parent().children('.rsystemplate_bootstrap-address-list-wrap').length; 258 $(this).html( $(this).html() + ' <span class="badge bg-secondary">' + countClear + '</span>'); 259 260 }); 261 262 //-------------------------- 263 // Search 264 //-------------------------- 265 $('#tx-indexedsearch-searchbox-button-submit-NO').click(function(event){ 266 267 let srch_term = $(this).parent().prev('#srch-term'); 268 let srch_term_visible = $(srch_term).is(":visible"); 269 if(! srch_term_visible ) { 270 event.preventDefault(); 271 $(srch_term).animate({width:'toggle'},350); 272 $(srch_term).focus(); 273 } 274 }); 275 276 //-------------------------- 277 // Shop 278 //-------------------------- 279 $('.addtocart').keyup(function(event){ 280 event.preventDefault(); 281 let cookie = Cookies.get('cart'); 282 let entries = {}; 283 if(cookie) { 284 entries = JSON.parse(cookie); 285 } 286 let id = $(this).attr('id').substring(5, 100); 287 entries[id] = $(this).val(); // quantity 288 let store = JSON.stringify(entries); 289 Cookies.set('cart', store, { expires: 365, path: '/' }); 290 $(this).parent().parent().parent().next('.feedback').show().html(' <div class="alert alert-small alert-info">Der Warenkorb wurde aktualisiert</div>').delay(3000).fadeOut(); 291 }); 292 293 $('.updatecart').keyup(function(event){ 294 event.preventDefault(); 295 let cookie = Cookies.get('cart'); 296 let entries = {}; 297 if(cookie) { 298 entries = JSON.parse(cookie); 299 } 300 let id = $(this).attr('id').substring(5, 100); 301 entries[id] = $(this).val(); // quantity; 302 let store = JSON.stringify(entries); 303 Cookies.set('cart', store, { expires: 365, path: '/' }); 304 $('.feedback').show().html(' <span class="alert alert-small alert-info">Der Warenkorb wurde aktualisiert</span>').delay(3000).fadeOut(); 305 }); 306 $('.deletecart').click(function(event){ 307 event.preventDefault(); 308 let cookie = Cookies.get('cart'); 309 let entries = {}; 310 if(cookie) { 311 entries = JSON.parse(cookie); 312 } 313 let id = $(this).data('id'); 314 entries[id] = 0; 315 let store = JSON.stringify(entries); 316 Cookies.set('cart', store, { expires: 365, path: '/' }); 317 $(this).closest('.small-row').remove(); 318 $('.feedback').show().html(' <span class="alert alert-small alert-info">Der Artikel wurde aus dem Warenkorb entfernt</span>').delay(3000).fadeOut(); 319 320 }); 321 322 let cookie = Cookies.get('cart'); 323 let entries = null; 324 if(cookie) { 325 entries = JSON.parse(cookie); 326 } 327 if (typeof(entries) != "undefined") { 328 for (key in entries) { 329 let value = entries[key]; 330 $('#item_' + key).val(value); 331 } 332 } 333 334 // ------------------------------- 335 // rwdImageMaps 336 // ------------------------------- 337 // $('img[usemap]').rwdImageMaps(); 338 339 340 // ------------------------- 341 // confirm 342 // ------------------------- 343 $('a[data-confirm]').click(function(ev) { 344 let href = $(this).attr('href'); 345 if (!$('#dataConfirmModal').length) { 346 html = '<div id="dataConfirmModal" class="modal" tabindex="-1"><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><h5 class="modal-title">Datensatz löschen</h5><button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button></div><div class="modal-body"><p>Modal body text goes here.</p></div><div class="modal-footer"><button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Abbrechen</button><button type="button" class="btn btn-danger" id="dataConfirmOK">Löschen</button></div></div></div></div>'; 347 $('body').append(html); 348 }
349 $('#dataConfirmModal').find('.modal-body').html($(this).attr('data-confirm')); 350 $('#dataConfirmModal').find('.modal-title').html($(this).attr('data-title')); 351 $('#dataConfirmOK').attr('href', href); 352 353 let confirmModal = new bootstrap.Modal(document.getElementById('dataConfirmModal'), { 354 keyboard: false 355 }) 356 confirmModal.show() 357 let modalConfirm = function(callback){ 358 $("#dataConfirmOK").on("click", function(){ 359 callback(true); 360 $("#dataConfirmModal").modal('hide'); 361 }); 362 }; 363 modalConfirm(function(confirm){ 364 if(confirm){ 365 location.href = href; 366 } 367 }); 368 return false; 369 }); 370 371 372});
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.