PageSourceSearch

https://rekt.fr/wp-content/themes/Avada-Child-Theme/frontend.js?ver=22

js rekt.fr collected 2026-10-05 18:29:32 UTC 12,911 bytes, 251 lines download raw bytes

1jQuery(document).ready( function() {
2	var rektUsesStoreHeaderFragment = !!window.rektStoreHeaderFragment;
3
4	/*
5	 * 2026-05-13 - Fallback notice WooCommerce sur pages sans script Woo frontend.
6	 * Ancien comportement : sur l'accueil, Woo imprimait la notice en display:none
7	 * mais woocommerce.min.js n'etait pas charge, donc elle restait invisible.
8	 * Nouveau comportement : on reproduit seulement la logique notice/cookie Woo.
9	 * Rollback : supprimer ce bloc et repasser frontend.js a la version precedente.
10	 */
11	function rektEnsureStoreNoticeVisible() {
12		if ( rektUsesStoreHeaderFragment ) {
13			return;
14		}
15
16		var notice = jQuery(".woocommerce-store-notice.demo_store");
17
18		if ( ! notice.length ) {
19			return;
20		}
21
22		var noticeId = notice.data("noticeId") || "";
23		var cookieName = "store_notice" + noticeId;
24		var cookies = document.cookie ? document.cookie.split("; ") : [];
25		var isDismissed = false;
26
27		for ( var i = 0; i < cookies.length; i++ ) {
28			var cookieParts = cookies[i].split("=");
29			var name = decodeURIComponent(cookieParts.shift() || "");
30			var value = decodeURIComponent(cookieParts.join("=") || "");
31
32			if ( cookieName === name && "hidden" === value ) {
33				isDismissed = true;
34				break;
35			}
36		}
37
38		if ( isDismissed ) {
39			notice.hide();
40			return;
41		}
42
43		notice.show();
44		jQuery(".woocommerce-store-notice__dismiss-link")
45			.off("click.rektStoreNotice")
46			.on("click.rektStoreNotice", function(event) {
47				document.cookie = encodeURIComponent(cookieName) + "=hidden; path=/; SameSite=Lax";
48				notice.hide();
49				rektFixStoreNoticeSpacing();
50				event.preventDefault();
51			});
52	}
53
54	/*
55	 * 2026-05-12 - Correctif espace blanc sous la notice WooCommerce.
56	 * Ancien comportement : la notice est d'abord masquee puis WooCommerce
57	 * l'affiche apres le chargement, et Avada peut alors ajouter une marge
58	 * inline ou coller le header mobile derriere la notice.
59	 * Nouveau comportement : on observe l'apparition de la notice, on retire
60	 * les compensations Avada et on decale le header sticky sous la notice.
61	 * Rollback : supprimer ce bloc si la notice repasse en gestion native Avada.
62	 */
63	function rektFixStoreNoticeSpacing() {
64		if ( rektUsesStoreHeaderFragment ) {
65			return;
66		}
67
68		var notice = jQuery(".woocommerce-store-notice.demo_store");
69		var isVisible = notice.length && notice.is(":visible");
70		var isMobileNoticeFix = window.matchMedia("(max-width: 800px)").matches;
71		var noticeHeight = isVisible ? Math.ceil(notice.outerHeight() || 0) : 0;
72		var adminBarHeight = Math.ceil(jQuery("#wpadminbar:visible").outerHeight() || 0);
73		var resetSelectors = "#boxed-wrapper, #wrapper, .fusion-wrapper, .header-wrapper, .sticky-header, #sliders-container";
74
75		jQuery(document.body).toggleClass("rekt-store-notice-visible", isVisible);
76		document.documentElement.style.setProperty("--rekt-store-notice-height", noticeHeight + "px");
77
78		if ( ! isMobileNoticeFix ) {
79			jQuery(".fusion-tb-header .fusion-sticky-container").each(function() {
80				var position = jQuery(this).css("position");
81				var desktopOffset = adminBarHeight + (isVisible ? noticeHeight : 0);
82
83				if ( "fixed" === position || "sticky" === position ) {
84					this.style.setProperty("top", desktopOffset + "px", "important");
85					return;
86				}
87
88				this.style.removeProperty("top");
89			});
90			return;
91		}
92
93		if ( ! isVisible ) {
94			jQuery(".fusion-tb-header .fusion-sticky-container").each(function() {
95				this.style.removeProperty("top");
96			});
97			return;
98		}
99
100		jQuery(resetSelectors).each(function() {
101			this.style.setProperty("margin-top", "0px", "important");
102		});
103
104		jQuery("#boxed-wrapper, #wrapper, .fusion-wrapper").each(function() {
105			this.style.setProperty("padding-top", "0px", "important");
106		});
107
108		jQuery(".fusion-tb-header .fusion-sticky-container").each(function() {
109			var position = jQuery(this).css("position");
110
111			if ( "fixed" === position || "sticky" === position ) {
112				this.style.setProperty("top", noticeHeight + "px", "important");
113			}
114		});
115	}
116
117	if ( ! rektUsesStoreHeaderFragment ) {
118		rektEnsureStoreNoticeVisible();
119		rektFixStoreNoticeSpacing();
120		setTimeout(rektFixStoreNoticeSpacing, 100);
121		setTimeout(rektFixStoreNoticeSpacing, 500);
122		setTimeout(rektFixStoreNoticeSpacing, 1500);
123		jQuery(window).on("load resize orientationchange scroll", rektFixStoreNoticeSpacing);
124	}
125
126	if ( ! rektUsesStoreHeaderFragment && "MutationObserver" in window ) {
127		var rektNoticeObserver = new MutationObserver(rektFixStoreNoticeSpacing);
128		var rektNotice = document.querySelector(".woocommerce-store-notice.demo_store");
129		var rektWrapper = document.getElementById("wrapper");
130
131		if ( rektNotice ) {
132			rektNoticeObserver.observe(rektNotice, { attributes: true, attributeFilter: ["style", "class"] });
133		}
134
135		if ( rektWrapper ) {
136			rektNoticeObserver.observe(rektWrapper, { attributes: true, attributeFilter: ["style", "class"] });
137		}
138	}
139	
140	jQuery("p.wc-apa-button-separator").text("— OU —");
141	jQuery("span.onsale").text('Promo !');
142	
143	// add button in the megamenu header
144	jQuery(".fusion-megamenu .fusion-megamenu-submenu").each( function() {
145		jQuery(this).find(".fusion-megamenu-title").append( jQuery(this).find(".fusion-megamenu-widgets-container .fusion-button-wrapper") );
146	} );
147	
148	/*jQuery("#menu-item-11263 .fusion-megamenu-title").append( jQuery("#menu-item-11263 .fusion-megamenu-widgets-container .fusion-button-wrapper") );
149	jQuery("#menu-item-14197 .fusion-megamenu-title").append( jQuery("#menu-item-14197 .fusion-megamenu-widgets-container .fusion-button-wrapper") );*/
150	
151	
152	
153
154		if ( window.matchMedia('(max-width: 800px)').matches ) {
155			//products listing  force display in two columns
156			
157			/*jQuery(".products li.product").css("float", "left !important");
158			jQuery(".products li.product").css("margin-left", "1% !important");
159			jQuery(".products li.product").css("margin-right", "1% !important");*/
160			
161			//jQuery(".products li.product").attr("style", 'float: left !important;margin-left: 1% !important;margin-right: 1% !important;');
162		} 
163		
164		//jQuery(".in-stock").prepend('<i class="fas fa-battery-full"></i>');
165		
166		if ( window.matchMedia('(max-width: 600px)').matches ) {
167			
168			
169			jQuery(".home .slide-content").hide();
170			jQuery(".home .slide-content").css("display", "none");
171        
172			jQuery(".page-id-201168 .slide-content").hide();
173			jQuery(".page-id-201168 .slide-content").css("display", "none");
174			
175			//jQuery("#fusion-slider-189 .slide-content .caption").hide();
176			jQuery("#fusion-slider-189 .slide-content .caption").css("visibility", "hidden");
177			jQuery(".btn-slider-mobile").show();
178			
179			
180			jQuery(".slide-id-14865 .background-image").css("background-image", "url(/wp-content/themes/Avada-Child-Theme/images/slider_mobile/splash-hp-mobile-ULTIM8-PLUS.jpg)");
181			jQuery(".slide-id-13030 .background-image").css("background-image", "url(/wp-content/themes/Avada-Child-Theme/images/slider_mobile/splash-BG1-S-mobile.png)");
182			jQuery(".slide-id-13037 .background-image").css("background-image", "url(/wp-content/themes/Avada-Child-Theme/images/slider_mobile/splash-bureaux-mobile.png)");
183			jQuery(".slide-id-13041 .background-image").css("background-image", "url(/wp-content/themes/Avada-Child-Theme/images/slider_mobile/splash-rgos-mobile.png)");
184			jQuery(".slide-id-14193 .background-image").css("background-image", "url(/wp-content/themes/Avada-Child-Theme/images/slider_mobile/splash-bureaux-mobile-2.png)");
185			jQuery(".slide-id-14873 .background-image").css("background-image", "url(/wp-content/themes/Avada-Child-Theme/images/slider_mobile/splash-team8-mobile.png)");
186			
187			//splash-hp-RGO-TOUCH-DESK
188			jQuery(".slide-id-113545 .background-image").css("background-image", "url(/wp-content/themes/Avada-Child-Theme/images/slider_mobile/splash-hp-mobile-RGO-TOUCH-DESK.jpg)");
189			
190			// splash-hp-OB-2
191			jQuery(".slide-id-113547 .background-image").css("background-image", "url(/wp-content/themes/Avada-Child-Theme/images/slider_mobile/splash-hp-mobile-OB-2.jpg)");
192			
193			//LEGEND-R BUSINESS
194			jQuery(".slide-id-113555 .background-image").css("background-image", "url(/wp-content/themes/Avada-Child-Theme/images/slider_mobile/ssplash-hp-mobile-LEGEND-R_BUSINESS.jpg)");
195			
196			//COMFORT bUSInESS
197			jQuery(".slide-id-113557 .background-image").css("background-image", "url(/wp-content/themes/Avada-Child-Theme/images/slider_mobile/ssplash-hp-mobile-COMFORT-R_BUSINESS.jpg)");
198			
199			//Splash-hp-RGO-DESK-MAX-140-2023
200			jQuery(".slide-id-154847 .background-image").css("background-image", "url(/wp-content/themes/Avada-Child-Theme/images/slider_mobile/splash-RGO-DESK-MAX-140-m-2023.jpg)");
201			
202			//Splash-hp-RGO-DESK-MAX-160-2023
203			jQuery(".slide-id-154851 .background-image").css("background-image", "url(/wp-content/themes/Avada-Child-Theme/images/slider_mobile/splash-RGO-DESK-MAX-160-m-2023.jpg)");
204			
205			//Splash-hp-RGO-DESK-OFFICE-2023
206			jQuery(".slide-id-154853 .background-image").css("background-image", "url(/wp-content/themes/Avada-Child-Theme/images/slider_mobile/splash-RGO-DESK-OFFICE-m-2023.jpg)");
207			
208			
209			
210			 
211			jQuery(".slide-id-19215 .background-image").css("background-image", "url(/wp-content/themes/Avada-Child-Theme/images/slider_mobile/splash-rdesk-mobile-01-m.png)");
212			jQuery(".slide-id-19212 .background-image").css("background-image", "url(/wp-content/themes/Avada-Child-Theme/images/slider_mobile/splash-r-deskmax-l-160-01-m.png)");
213			
214			jQuery(".slide-id-19476 .background-image").css("background-image", "url(/wp-content/uploads/2021/07/splash-RGO-MAX-BUSINESS-01-m.png)");
215			
216			// 
217			jQuery(".slide-id-54465 .background-image").css("background-image", "url(/wp-content/themes/Avada-Child-Theme/images/slider_mobile/splash-hp-mobile-ULTIM8-RS.jpg)");
218			
219			jQuery(".slide-id-46743 .background-image").css("background-image", "url(/wp-content/themes/Avada-Child-Theme/images/slider_mobile/noel/splash-hp-mobile-noel-2021-bureaux-gaming.jpg)");
220			jQuery(".slide-id-46749 .background-image").css("background-image", "url(/wp-content/themes/Avada-Child-Theme/images/slider_mobile/noel/splash-hp-mobile-noel-2021-chaises-gaming.jpg)");
221			jQuery(".slide-id-46752 .background-image").css("background-image", "url(/wp-content/themes/Avada-Child-Theme/images/slider_mobile/noel/splash-hp-mobile-noel-2021-livraison-tnt.
221jpg)");
222			jQuery(".slide-id-46755 .background-image").css("background-image", "url(/wp-content/themes/Avada-Child-Theme/images/slider_mobile/noel/splash-hp-mobile-noel-2021-paiements.jpg)");
223
224			//sumsung
225			jQuery(".slide-id-169900 .background-image").css("background-image", "url(/wp-content/themes/Avada-Child-Theme//images/slider_mobile/sumsung/monitor-03.jpg)");
226			jQuery(".slide-id-169902 .background-image").css("background-image", "url(/wp-content/themes/Avada-Child-Theme//images/slider_mobile/sumsung/monitor-01.jpg)");
227			
228			
229			
230			
231			// new home slider  
232			jQuery(".slide-id-119508 .background-image").css("background-image", "url(/wp-content/themes/Avada-Child-Theme/images/slider_mobile/newhome/SLIDE-HP-PAIEMENT-PLUSIEURS-FOIS-mobile.jpg)");
233			jQuery(".slide-id-203554 .background-image").css("background-image", "url(/wp-content/themes/Avada-Child-Theme/images/slider_mobile/newhome/SLIDE-HP-POWERSEAT-2-mobile.jpg)");
234			jQuery(".slide-id-203557 .background-image").css("background-image", "url(/wp-content/themes/Avada-Child-Theme/images/slider_mobile/newhome/SLIDE-HP-POWERSEAT-mobile.jpg)");
235			jQuery(".slide-id-203559 .background-image").css("background-image", "url(/wp-content/themes/Avada-Child-Theme/images/slider_mobile/newhome/SLIDE-HP-R-DESK-160-L-2-mobile.jpg)");
236        	jQuery(".slide-id-203561 .background-image").css("background-image", "url(/wp-content/themes/Avada-Child-Theme/images/slider_mobile/newhome/SLIDE-HP-RGO-MAX-FIRST-2-mobile.jpg)");
237			jQuery(".slide-id-203563 .background-image").css("background-image", "url(/wp-content/themes/Avada-Child-Theme/images/slider_mobile/newhome/SLIDE-HP-RGO-MAX-FIRST-mobile.jpg)");
238        	jQuery(".slide-id-203565 .background-image").css("background-image", "url(/wp-content/themes/Avada-Child-Theme/images/slider_mobile/newhome/SLIDE-HP-ULTIM8-BUSINESS-mobile.jpg)");
239        	jQuery(".slide-id-203567 .background-image").css("background-image", "url(/wp-content/themes/Avada-Child-Theme/images/slider_mobile/newhome/SLIDE-HP-ULTIM8-mobile.jpg)");
240        	jQuery(".slide-id-203569 .background-image").css("background-image", "url(/wp-content/themes/Avada-Child-Theme/images/slider_mobile/newhome/SLIDE-HP-ULTIM8-2-mobile.jpg)");
241        	jQuery(".slide-id-203571 .background-image").css("background-image", "url(/wp-content/themes/Avada-Child-Theme/images/slider_mobile/newhome/SLIDE-HP-ULTIM8-3-mobile.jpg)");
242        
243        
244			jQuery(".home #sliders-container .background-image").css("background-size", "contain");
245        	//jQuery(".page-id-201168 #sliders-container .background-image").css("background-size", "contain");
246        
247			
248			 
249		}
250	
251} );

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.