1window.addEventListener('load', (event) => { 2 if(document.location.pathname.indexOf('/products/') === 0){ 3 if (window.innerWidth > 992) { 4 moveElement('.stl-product-package', '.product-information > .row > .col-md-7:not(.product_page_slider)', '.product_image_price_row > .col-md-5.col-sm-12', 'custom-stl-product'); 5 } 6 } 7}); 8 9const url = window.location.href; 10 11$(window).on('load', function() { 12 if (url.includes('checkout')) { 13 moveElementBeforeParent('.postcode', '.city'); 14 } 15}); 16 17function moveElementBeforeParent(firstClass, secondClass) { 18 19 const firstElement = document.querySelector(firstClass); 20 21 const secondElement = document.querySelector(secondClass); 22 23 const parentElement = secondElement.parentElement; 24 25 parentElement.parentNode.insertBefore(firstElement, parentElement); 26} 27 28/*$(function(){ 29 $('#shippingAddress .listcontenthead:contains("Land")').hide(); 30 $('#shippingAddress .listcontent .success_icon.ui-icon-green.ui-icon-circle-check').hide(); 31 $('.billingcheckbox input#diffShipping').click(); 32 $('#shippingAddress').show(); 33 $('#sencomments').attr('checked', 'checked'); 34 $('#shippingAddress .listcontentleft:contains("Fornavn")').hide(); 35 $('#shippingAddress .listcontentright:contains("Etternavn")').hide(); 36 $('#shippingAddress .onepageBiginput.nameinputs').closest('div.listcontent').hide(); 37 $('#shippingAddress .listcontent:contains("Firma")').text('Firma/kommune'); 38 $('#billingAddress .listcontent:contains("Firma")').text('Firma/kommune'); 39 $('#sencomments').parent().parent().find('.accepttermsinputlink').html('Referansenummer/Kommentar'); 40 setTimeout( function(){ 41 $('.onepagecomment').show(); 42 }, 800); 43 checkShippingMethods(); 44}); 45*/ 46 47// 48$('document').ready( function($){ 49 50 var firstActive = false; 51 52 $('.right_part .panel-default .panel-heading').each( function(i){ 53 54 if ($(this).find('a h4').html() == 'Produsent'){ 55 $(this).find('a h4').html('Tillegg'); 56 } else if ($(this).find('a h4').html().trim() == 'Info'){ 57 58 var target = '#' + $(this).find('a').attr('aria-controls'); 59 $(this).parent().hide(); 60 61 var manObject = $(target).find('.panel-body').detach().removeAttr('id'); 62 $('.product-page.button').parent().parent().append('<div class="clear"></div><div class="panel" id="injector" style="margin: 30px 15px 0 15px;padding: 10px;">'+ manObject.html() +'</div>'); 63 64 } else if ($(this).find('a h4').html().trim() == 'Produktegenskaper'){ 65 $(this).parent().hide(); 66 console.log('FOUND!'); 67 68 var target = '#' + $(this).find('a').attr('aria-controls'); 69 var tabs3 = $(target).find('.panel-body').detach().removeAttr('id').attr('id', 'showMe'); 70 if ($('.product_model').length > 0){ 71 $('.product_model').after(tabs3); 72 } else { 73 $('#add2cart > h1').after(tabs3); 74 } 75 setTimeout( function(){ 76 $('#showMe').show(); 77 }, 150); 78 } 79 80 var that = $(this); 81 setTimeout( function(){ 82 if (that.parent().parent().css('display') == 'block' && !firstActive){ 83 console.log(that); 84 85 var target = '#' + that.find('a').attr('aria-controls'); 86 console.log(target); 87 if ($(target).css('display') != 'block'){ 88 firstActive = true; 89 that.find('a').click(); 90 } 91 } 92 }, 300); 93 }); 94 95 96 97 98 setTimeout( function(){ 99 $('.product-tabs .nav.nav-tabs > li').eq(0).find('a').click(); 100 if ($('.product-package .package > *').length == 0){ 101 $('.product-package').hide(); 102 } 103 }, 150); 104}); 105 106 107$(function(){ 108 if (window.location.pathname == '/blog' || window.location.pathname == '/blog/'){ 109 $('.block-side-category.rbox').each(function(){ 110 $(this).find('.box').contents().filter(function() { 111 return this.nodeType == 1 && $.trim(this.textContent) != ''; 112 }).wrapAll('<blockquote />'); 113 114 }); 115 } 116}); 117 118$(function(){ 119 if (window.location.pathname == '/blog' || window.location.pathname == '/blog/'){ 120 $('article.block-side-category.rbox img').attr('class', 'firstbloggimg'); 121 $('.block-side-category.rbox').each(function(){ 122 $(this).find('.pages-title').prependTo($(this).find('.blog_date')); 123 $(this).find('.blog_read_more.button').appendTo($(this).find('blockquote'));
124 $(this).find('.firstbloggimg').insertBefore($(this).find('blockquote')); 125 $(this).find('.firstbloggimg').css({'width' : '25%', 'height' : '25%'}); 126 $(this).find('blockquote').css({'width' : '100%'}); 127 $('.firstbloggimg').parent().css({'display' : 'flex'}); 128 }); 129 } 130}); 131 132function onlyFreecats(doClick){ 133 if ( $('#shippingMethods input[value*="freecats_freecats"]').length ){ 134 if ( doClick ){ 135 $('#shippingMethods input[value*="freecats_freecats"]').click(); 136 } 137 $('#shippingMethods>div').children().each(function(){ 138 if ( !( $(this).find('input[value*="freecats_freecats"]').length ) ){ 139 $(this).remove(); 140 } 141 }); 142 } 143} 144 145function checkShippingMethods(){ 146 if (window.location.href.indexOf('/checkout') > -1){ 147 onlyFreecats(true); 148 $(document).ajaxComplete(function(){ 149 onlyFreecats(false); 150 }); 151 } 152} 153 154function moveElement(selector1, selector2, selector3, className) { 155 const element1 = document.querySelector(selector1); 156 const element2 = document.querySelector(selector2); 157 const element3 = document.querySelector(selector3); 158 159 160 if (element1 && element2 && element3) { 161 element3.classList.add(className); 162 163 element3.parentNode.insertBefore(element2, element3.nextSibling); 164 } 165} 166 167 168 169 170 171
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.