1// Default 3.0.0 2function email_output(user,domain,tld,text,get,tag){email=user+'@'+domain+'.'+tld;if(!text)text=email;if(tag)tag=' '+tag;document.write('<a href="mailto:'+email+get+'"'+tag+'>'+text+'</a>');} 3function window_open(url,name,features){popup=window.open(url,name,features);popup.focus();} 4 5// Custom 6$(function(){ 7 var $panorama_cycle = $('#panorama .cycle'); 8 if($panorama_cycle.length) { 9 $panorama_cycle.cycle({ 10 log: false, 11 fx: 'scrollHorz', 12 slides: '> div ', 13 speed: 750, 14 timeout: 6500, 15 pager: $('#panorama .cycle_nav') 16 }); 17 } 18 19 $('#panorama .cycle_nav').on('click', function(){ 20 $panorama_cycle.cycle('pause'); 21 }); 22 23 // Dropdown-Menü 24 $('.dropdown').click(function(){ 25 $('.mobile > ul, #salesm_nav > ul').slideToggle(); 26 }); 27 28 var $nav_prodotti = $('#nav_main .box_product, #nav_main .box_shop'), 29 $prodotti_topic = $nav_prodotti.find('.topics'), 30 $prodotti_subnav = $nav_prodotti.find('.sub a'); 31 32 // Wenn kein Subnav die Klasse show besitzt, dem ersten Subnav diese Klasse geben 33 $nav_prodotti.each(function() { 34 if($(this).find('ul li.show').length === 0) { 35 $(this).find('ul li').first().addClass('show'); 36 $(this).find('.topics').children('div').hide(); 37 $(this).find('.topics').children('div').first().show(); 38 } 39 }); 40 41 $prodotti_subnav.on('hover', function(){ 42 var id = $(this).attr('data-id'); 43 44 $prodotti_subnav.parent('li').removeClass('show'); 45 $(this).parent('li').addClass('show'); 46 47 $prodotti_topic.children('div').hide(); 48 $prodotti_topic.find('.topic_' + id).show(); 49 }); 50 51 var $buttons = $('#article .button, #article button'); 52 $buttons.each(function(){ 53 $(this).html('<span>' + $(this).text() + '</span>'); 54 }); 55 $buttons.filter('.prev').prepend('<div class="arrow"></div>'); 56 $buttons.filter('.next').append('<div class="arrow"></div>'); 57 58 var $showcase = $('#article .showcase'), 59 $showcase_nav = $showcase.find('> nav'), 60 $showcase_content = $showcase.find('> .content'); 61 62 var setShowcase = function(id) { 63 var $link = $showcase_nav.find('#nav_'+id); 64 65 $showcase_nav.find('li').removeClass('active'); 66 $link.parent('li').addClass('active'); 67 68 $showcase_content.find('> div').hide(); 69 $showcase_content.find('#content_'+id).show(); 70 71 initCyle($showcase_content.find('#content_'+id).find('.cycle')); 72 73 window.location.hash = $link.attr('href'); 74 }; 75 76 if($showcase.length) { 77 var wHash = window.location.hash; 78 79 if(wHash != '') { 80 var id = $showcase_nav.find('a[href="'+wHash+'"]').attr('id'); 81 setShowcase(id.substr(4)); 82 } else { 83 var $first = $showcase_nav.find('ul li:first-child a'); 84 setShowcase($first.attr('id').substr(4)); 85 } 86 87 $showcase_nav.find('a').on('click', function(event){ 88 event.preventDefault(); 89 setShowcase($(this).attr('id').substr(4)); 90 }); 91 } 92 93 $('.boxpointer').css('cursor', 'pointer').on('click', function(event){ 94 event.preventDefault(); 95 window.location.href = $(this).find('a').attr('href'); 96 }); 97 98 if($.datepicker) { 99 $.datepicker.setDefaults($.datepicker.regional['']); 100 $('.datepicker').datepicker($.datepicker.regional[$('html').attr('lang')]); 101 } 102 103 if($.lightbox) 104 $('.lightbox').lightbox(); 105 106 // Warenkorb 107 // hinzufügen 108 $(document).on('click', '.basket.add', function(e) { 109 var isAllVariantSet = true; 110 if($('#variantsfrom')) { 111 $('#variantsfrom select').each(function(i, e) { 112 if(!$(e).val()) 113 isAllVariantSet = false; 114 }); 115 } 116 if(isAllVariantSet) { 117 e.preventDefault(); 118 var $input = $(this).closest('.amnttop').find('.amnt'), 119 quantity = $input.val(), 120 aId = $(this).attr('data-artikelId'), 121 $discountinput = $(this).closest('.amnttop').find('.discountrow input'), 122 discount = $discountinput.length ? $discountinput.val().replace(',', '.') : 0; 123 if(quantity && quantity !== '') { 124 var res = do_ajaxrequest({ 125 'do': 'add_article', 126 'artikel_id': aId, 127 'quantity': quantity, 128 'discount': discount 129 }); 130 if(res === 1) { 131 $input.val($input.attr('data-default') && $input.attr('data-default') !== undefined ? $input.attr('data-default') : 0); 132 if($discountinput.length) 133 $discountinput.val('0,00'); 134 } 135 } 136 137 if($(this).hasClass('fancycloser')) 138 $.fancybox.close(); 139 } else { 140 $('#varianterror').html(varianterrortext); 141 $('#varianterror').show(); 142 } 143 }); 144 145 // Increment-Decrement 146 $(document).on('click', 'a.valuechanger' ,function() { 147 var $quantityElement = $(this).parent().find('.amnt'), 148 currentValue = parseInt($quantityElement.val()); 149 if(!currentValue || currentValue === undefined || currentValue < 0) 150 currentValue = 0; 151 if($(this).hasClass('decrement')) 152 currentValue -= 1; 153 else if($(this).hasClass('increment')) 154 currentValue += 1; 155 156 if(currentValue < 1) 157 currentValue = 1; 158 159 $quantityElement.val(currentValue); 160 }); 161 // Popup 162 var $popupButton = $('.basket.popup'); 163 $popupButton.click(function() { 164 var html = $(this).next('.forfancybox').html(); 165 $.fancybox({ 166 content: html 167 }); 168 }); 169 // Zur Kasse Button 170 $(document).on('click', '.buyprocessstarter, .viewbasket', function(e){ 171 e.preventDefault(); 172 var $form = $(this).parent().find('form'); 173 if($(this).hasClass('buyprocessstarter')) { 174 $form.append('<input type="hidden" name="initbuy" id="initbuy" value="1">'); 175 $form.find('#step').val(2); 176 $form.find('#direction').val(-1); 177 $form.submit(); 178 } else { 179 window.location.href = $form.attr('action'); 180 } 181 }); 182 183 // Artikel-Suche 184 var $sButton = $('.asearch'); 185 $sButton.click(function(){ 186 var val = $(this).closest('form').find('#q').val(); 187 if(val && val !== '') 188 $(this).closest('form').submit(); 189 }); 190 191 // Login-Showcase 192 var $slider = $('.slidein_managepw'); 193 $slider.click(function() { 194 var $obj = $(this); 195 $obj.closest('form').find('.formrow, .formsubmit').hide(); 196 $obj.parent().hide(); 197 $obj.closest('form').find('.slidein').show(); 198 199 }); 200 201 // Zoom 202 $(document).ready(function(){ 203 $('a.photo').zoom({url: 'photo-big.jpg'}); 204 }); 205}); 206 207function initCyle(element) { 208 var $this = $(element); 209 try { 210 $this.cycle('destroy'); 211 } catch(e) {} 212 $this.cycle({ 213 log: false, 214 fx: 'scrollHorz', 215 slides: '> div ', 216 speed: 750, 217 timeout: 6500, 218 pager: $this.siblings('.cycle_nav') 219 }); 220 221 // Dropdownmenü 222 $('.dropdown').click(function(){ 223 $('#nav_main ul').toggleClass('hide'); 224 }); 225} 226 227var ajaxurl = '/ajax/basket'; 228function reload_basket() { 229 $('#basketcontainer').load('/ajax/includes/basket'); 230} 231 232function do_ajaxrequest(post_data) { 233 var ret = 0; 234 $.ajax({ 235 accepts: 'json', 236 async: false, 237 type: 'POST', 238 url: ajaxurl, 239 data: post_data, 240 success: function(data) { 241 var jonsdata = $.parseJSON(data); 242 if(jonsdata.status === 'ok') { 243 reload_basket(); 244 ret = 1; 245 } else { 246 alert(jonsdata.message); 247 } 248 } 249 }); 250 return ret; 251} 252 253function insertParam(key, value) { 254 key = encodeURIComponent(key); 255 value = encodeURIComponent(value); 256 257 // kvp looks like ['key1=value1', 'key2=value2', ...] 258 var kvp = document.location.search.substr(1).split('&'); 259 let i=0; 260 261 for(; i<kvp.length; i++){ 262 if (kvp[i].startsWith(key + '=')) { 263 let pair = kvp[i].split('='); 264 pair[1] = value; 265 kvp[i] = pair.join('='); 266 break; 267 } 268 } 269 270 if(i >= kvp.length){ 271 kvp[kvp.length] = [key,value].join('='); 272 } 273 274 // can return this or... 275 let params = kvp.join('&'); 276 277 // reload page with new params 278 document.location.search = params; 279}
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.