1var $j = jQuery.noConflict(); 2$j(document).ready(function($) { 3 4 5 /** 6 * Product sheet v2 7 */ 8 9 var clfc = function() { 10 var nbchild = 0; 11 $j('.spec_stylised-specs').each(function() { 12 nbchild = jQuery(this).children('.spec').length; 13 //console.log(nbchild); 14 if (nbchild % 2 == 0) { 15 //console.log('true'+nbchild); 16 cn = 'nbc-even'; 17 } else { 18 //console.log('false'+nbchild); 19 cn = 'nbc-odd'; 20 } 21 $j(this).addClass(cn); 22 }); 23 24 } 25 if ($j('.imprimante')) { 26 clfc(); 27 } 28 /** 29 * Facet WP 30 * rico, romain 31 */ 32 var adjustfacetwp = function() { 33 $j('.xrw-facetwp-stack .ui-accordion-content').each(function() { 34 if (($(this).children("div, input, span").length) == 0) { 35 $(this).prev('.ui-accordion-header').css("display", "none"); 36 $(this).closest('.ui-accordion-content').css("display", "none"); 37 } 38 }); 39 40 }; 41 42 var filtres_avances = function() { 43 if ($j('#filtres-avances').css('display') == 'block') { 44 $j('.xrw-facetwp-selections,.xrw-facetwp-sort,.xrw-facetwp-reset,.ui-accordion.xrw-facetwp-stack').hide(); 45 $j("#filtres-avances a").click(function() { 46 $j('.xrw-facetwp-selections,.xrw-facetwp-sort,.xrw-facetwp-reset,.ui-accordion.xrw-facetwp-stack').toggle(); 47 }); 48 } 49 }; 50 //$j(window).on("resize", filtres_avances); 51 52 var adjustfacetwplast = function() { 53 var d = $j('.xrw-facetwp-stack').children('h5').length; 54 $j('.xrw-facetwp-stack').children('h5').each(function() { 55 if ($j(this).css('display') == 'block') { 56 $j(this).next('h5').addClass('aff'); 57 $j(this).addClass('aff'); 58 } else { 59 $j(this).next('h5').addClass('masks'); 60 $j(this).addClass('masks'); 61 } 62 }); 63 $j('.xrw-facetwp-stack h5.aff').last('h5').addClass('last'); 64 }; 65 66 var setfacetwp = function() { 67 $j(".xrw-facetwp-stack").accordion({ 68 header: "h5", 69 animate: 200, 70 collapsible: true, 71 heightStyle: "content", 72 icons: { 73 "header": "ui-icon-plus", 74 "activeHeader": "ui-icon-minus" 75 } 76 }); 77 $j(".facetwp-sort,.xrw-currency").addClass("wpsolr_widget_sort_waas"); 78 setTimeout(adjustfacetwp, 10); 79 setTimeout(adjustfacetwplast, 15); 80 setTimeout(filtres_avances, 20); 81 }; 82 setfacetwp(); 83 //$j(window).on("resize", setfacetwp); 84 85 var clearBtFilterSelections = function() { 86 if (0 < $('.facetwp-selections ul').length) { 87 $('.xrw-facetwp-reset').css("display", "block"); 88 } else { 89 $('.xrw-facetwp-reset').css("display", "none"); 90 } 91 }; 92 $j(".facetwp-selections, .xrw-facetwp-stack div").click(function() { 93 $(document).ajaxComplete(function() { 94 clearBtFilterSelections(); 95 }); 96 }); 97 clearBtFilterSelections(); 98 //$j(window).on("resize", clearBtFilterSelections); 99 100 101 /** 102 * Curencies 103 */ 104 function selchang(e) { 105 // stock la Curencies dans le cookie 106 var devce = e.options[e.selectedIndex].value; 107 create_cookie('price', devce, 30, "/"); 108 } 109 var filtres_currency = function() { 110 $j('#devce').change(function() { 111 selchang(this); 112 }); 113 // positionne le menu en fonction du cookie 114 if (get_cookie('price') == false) { 115 $j('#devce').children('option[value="price"]').attr('selected', 'selected'); 116 } else { 117 $j('#devce').children('option[value="' + get_cookie('price') + '"]').attr('selected', 'selected'); 118 } 119 120 // supprime le menu si les prix ne sont pas affiché 121 var cont = $j('.widget_currency').parent('.textwidget').parent('.posts_holder'); 122 if ($j('.prix').length > 0) { 123 cont.css('display', 'block'); 124 } else { 125 cont.css('display', 'none'); 126 } 127 }; 128 filtres_currency(); 129 130 /** 131 * PB avec le sort du facet qui ne reactive pas les radios 132 */ 133 window.onload = function() { 134 135 $j(document).on('change', '.facetwp-sort-select', function() { 136 FWP.fetch_data(); 137 }); 138 139 } 140 141 /** 142 * Page Apps isotopo active class when clicked 143 * Christian ;) 144 */ 145 jQuery(function() { 146 $j(".filter_holder > ul > li").first().addClass("active"); 147 $j(".filter").click(function() { 148 $j(".filter").removeClass("active"); 149 $j(this).addClass("active"); 150 }); 151 }); 152 153}); 154 155function create_cookie(name, value, days2expire, path) { 156 var date = new Date(); 157 date.setTime(date.getTime() + (days2expire * 24 * 60 * 60 * 1000)); 158 var expires = date.toUTCString(); 159 //console.log(expires); 160 document.cookie = name + '=' + value + ';' + 161 'expires=' + expires + ';' + 162 'path=' + path + ';'; 163 location.reload(); 164} 165 166function get_cookie(name) { 167 var value = "; " + document.cookie; 168 var parts = value.split("; " + name + "="); 169 if (parts.length == 2) { 170 return parts.pop().split(";").shift(); 171 } else { 172 return false;
173 } 174} 175 176var $decalage = 50; 177var $root = $j('html, body'); 178 179$j('.progress-tracker a[href*=\\#]').on('click', function(event) { 180 event.preventDefault(); 181 jQuery('html,body').clearQueue(); 182 jQuery('html,body').stop(); 183 184 var href = jQuery.attr(this, 'href'); 185 var targetID = href.substr(href.indexOf("#") + 1); 186 187 $root.animate({ 188 scrollTop: jQuery("#" + targetID).offset().top - $decalage 189 }, 850, function() { 190 //window.location.hash = targetID; 191 }); 192 193 return false; 194}); 195 196/** 197 * romain 198 * ajuste wrapper more_facts pour le formulaire post 199 * sans css height auto qui casse la transition JS 200 * recalcule le height de more_facts_outer 201 */ 202var resizewrapper = function() { 203 $j('.selclick').closest(".more_facts_outer").css('height', $j('.more_facts_inner_holder').css('height')); 204} 205var adjustformwrapper = function() { 206 207 $j('.more_facts_holder .wpcf7-submit').click(function() { 208 $j(this).addClass("selclick"); 209 210 // //dom changed 211 $j('.more_facts_holder form.wpcf7-form').on('DOMSubtreeModified', function() { 212 //console.log('changed'); 213 setTimeout(resizewrapper, 200); 214 }); 215 }); 216 217} 218adjustformwrapper(); 219 220// /** 221// ** modification du comportement de 222// * Init Google Map Addresses 223// * script //wp-content/themes/bridge/js/default.js 224// * ligne 7102 225// * 226// * Ajout du close windows 227// * 228// * romain 229// */ 230// function initializeGoogleAddress(data, pin, map, geocoder) { 231// "use strict";
232// if (data === '') 233// return; 234// var contentString = '<div class="content_map">' + 235// '<div class="site_notice_map">' + 236// '</div>' + 237// '<div class="body_content_map">' + 238// '<p>' + data + '</p>' + 239// '</div>' + 240// '</div>'; 241// var infowindow = new google.maps.InfoWindow({ 242// content: contentString 243// }); 244// geocoder.geocode({ 'address': data }, function(results, status) { 245// if (status === google.maps.GeocoderStatus.OK) { 246// map.setCenter(results[0].geometry.location); 247// var marker = new google.maps.Marker({ 248// map: map, 249// position: results[0].geometry.location, 250// icon: pin, 251// title: data['store_title'] 252// }); 253// google.maps.event.addListener(marker, 'click', function() { 254// infowindow.open(map, marker); 255// }); 256 257// google.maps.event.addListener(marker.map, 'click', function() { 258// infowindow.close(); 259// }); 260 261// google.maps.event.addDomListener(window, 'resize', function() { 262// map.setCenter(results[0].geometry.location); 263// }); 264// } 265// }); 266// };
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.