1if ('undefined' === typeof $ || !(window.$ === jQuery)) { 2 jQuery.noConflict(); 3} 4jQuery(document).ready(function ($) { 5 window.maosLfm = { 6 init: function () { 7 this.handleCheckout(); 8 this.trackDownloads(); 9 }, 10 11 dropKickSettings: { 12 mobile: true 13 }, 14 15 trackDownloads: function () { 16 var me = this; 17 $("a.jsTrigger_downloadUrl").on('click keypress', function (event) { 18 var code = event.charCode || event.keyCode, eventType = ''; 19 if (code && code == 13) { 20 eventType = 'Enter'; 21 } else if (!code) { 22 eventType = 'Klick'; 23 } 24 if ('' !== eventType) { 25 var $link = $(this); 26 var label = $link.closest('.item').find('.heading').eq(0).text(); 27 label += ' (' + $link.attr('href').split('/').pop() + ')'; 28 me.trackEvent( 29 'Publikation', 30 'Download via ' + eventType, 31 label, 32 1 33 ); 34 } 35 }); 36 }, 37 38 trackEvent: function (category, action, label, value) { 39 40 // track with Matomo 41 if (typeof _paq === 'object' && _paq.hasOwnProperty('push') && typeof _paq.push === 'function') { 42 _paq.push([ 43 'trackEvent', category, action, label, value 44 ]); 45 } 46 }, 47 48 handleCheckout: function () { 49 var $checkoutContainer = $('.tx_materials-and-ordering-system-checkout'); 50 var me = this; 51 if ($checkoutContainer.length > 0) { 52 53 // remove wrapping overflow so that elements may be sticky 54 $('#outer-wrap').addClass('of-visible'); 55 56 // init dropKicks on selectors 57 var $selects = $checkoutContainer.find('select'); 58 var refreshDropkickSelects = function () { 59 $selects.each(function () { 60 var $select = $(this); 61 try { 62 // refreshing may fail, if basket request changes select while dropkick is initializing its HTML 63 $select.dropkick('refresh'); 64 } catch (e) { 65 // if refresh fails, just init dropKick again 66 $select.dropkick(me.dropKickSettings) 67 } 68 }); 69 }; 70 $selects.each(function () { 71 var $select = $(this); 72 $select.dropkick( 73 me.dropKickSettings 74 ); 75 // needs to refresh on change for "other countries" selectors to get enabled 76 $select.on('change', function () { 77 window.setTimeout( 78 function () { 79 refreshDropkickSelects(); 80 }, 81 1 82 ); 83 }); 84 }); 85 86 // each basket request refreshes dropkicks just to be sure 87 $(document).on('maos.BasketRequestCompleted', function () { 88 refreshDropkickSelects(); 89 }); 90 91 } 92 } 93 }; 94 maosLfm.init(); 95});
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.