PageSourceSearch

https://www.clubesse.it/wp-content/plugins/divi-bars/assets/js/main.js?ver=1.0.4

js clubesse.it collected 2026-10-02 10:04:54 UTC 45,920 bytes, 1,785 lines download raw bytes

1/**
2 * Plugin Name: Divi Bars
3 * Plugin URL: https://divilife.com/
4 * Description: Create slide-in promo bars using the Divi Builder.
5 * Version: 1.0
6 * Author: Divi Life — Tim Strifler
7 * Author URI: https://divilife.com
8*/
9;(function ( $, window, document, undefined ) {
10  'use strict';
11  
12    $.fn.mainDiviBars = function( options ) {
13		
14		var divibar_body
15		, divibar
16		, idx_divibar
17		, divi_divibar_container_selector
18		, $divibar = this
19		, contentLengthcache
20		, divibarHeightCache
21		, diviMobile
22		, diviMobileCache
23		, themesBreakpoint = { Divi:980, Extra:1024 }
24		, styleTagID = 'divi-bars-styles'
25		, vw
26		, fixedElements
27		, scrollCheck;
28		
29		if (typeof options == 'function') {
30			options = { success: options };
31		}
32		else if ( options === undefined ) {
33			options = {};
34		}
35		
36		// Trying to prevent others plugins override Divi Bars styles
37		$( '<style id="' + styleTagID + '"></style>' ).appendTo( 'head' );
38		
39		if ( $('div.divibars-container').length ) {
40			
41			// Viewing from a non-large device?
42			diviMobile = diviMobileCache = isDiviMobile();
43			
44			var divibar_container = $( 'div.divibars-container' )
45			, container = $( 'div#page-container' )
46			, positionTimer = 0
47			, removeMonarchTimer = 0;
48			
49			var cacheHtmlMarginTop = parseInt( $('html').css('margin-top') );
50			if ( cacheHtmlMarginTop <= 0 ) {
51				
52				cacheHtmlMarginTop = 0;
53			}
54			
55			var cacheBodyPaddingTop = parseInt( $('body').css('padding-top') );
56			if ( cacheBodyPaddingTop <= 0 ) {
57				
58				cacheBodyPaddingTop = 0;
59			}
60			
61			var cacheBodyPaddingBottom = parseInt( $('body').css('padding-bottom') );
62			if ( cacheBodyPaddingBottom <= 0 ) {
63				
64				cacheBodyPaddingBottom = 0;
65			}
66			
67			var cacheTopHeaderTop = parseInt( $('#top-header').css('top') );
68			if ( cacheTopHeaderTop <= 0 ) {
69				
70				cacheTopHeaderTop = 0;
71			}
72			
73			var cacheMainHeaderTop = parseInt( $('#main-header').css('top') );
74			if ( cacheMainHeaderTop <= 0 ) {
75				
76				cacheMainHeaderTop = 0;
77			}
78			
79			var bodyHtmlStyleCache = $( "body,html" ).attr('style');
80			
81			// Save ID and Class attrs from fixed/absolute elements
82			fixedElements = getFlyingElements();
83			
84			// Remove any duplicated divibar
85			$( divibar_container ).each(function () {
86				$('[id="' + this.id + '"]:gt(0)').remove();
87			});
88			
89			$('body [id^="divibars_"]').on('click touch tap', function (e) {
90				
91				var divibarArr = $(this).attr('id').split('_')
92				, divibar_id = divibarArr[3]
93				, cookieName = 'divibar' + divibar_id;
94				
95				eraseCookie( cookieName );
96				
97				showDivibar( divibar_id );
98				
99				e.preventDefault();
100			});
101			
102			$('body [rel^="unique_divibars_"]').on('click touch tap', function (e) {
103				
104				var divibarArr = $(this).attr('rel').split('_')
105				, divibar_id = divibarArr[4]
106				, cookieName = 'divibar' + divibar_id;
107				
108				eraseCookie( cookieName );
109				
110				showDivibar( divibar_id );
111				
112				e.preventDefault();
113			});
114			
115			$('body [class*="dividivibar-"], body [class*="divibar-"]').on('click touch tap', function (e) {
116				
117				var divibarArr = $(this).attr('class').split(' ');
118				
119				$( divibarArr ).each(function( index,value ) {
120					
121					idx_divibar = value.indexOf('divibar');
122					
123					if ( idx_divibar !== -1 ) {
124						
125						var idx_divibarArr = value.split('-');
126						
127						if ( idx_divibarArr.length > 1 ) {
128							
129							var divibar_id = idx_divibarArr[1]
130							, cookieName = 'divibar' + divibar_id;
131							
132							eraseCookie( cookieName );
133							
134							showDivibar( divibar_id );
135						}
136					}
137				});
138			});
139			
140			if (typeof divibars_with_css_trigger !== 'undefined') {
141				
142				if ( $( divibars_with_css_trigger ).length > 0 ) {
143					
144					$.each( divibars_with_css_trigger, function( divibar_id, selector ) {
145						
146						$( selector ).on('click touch tap', function (e) {
147							
148							var cookieName = 'divibar' + divibar_id;
149							
150							eraseCookie( cookieName );
151							
152							showDivibar( divibar_id );
153							
154							e.preventDefault();
155						});
156					});
157				}
158			}
159			
160			if (typeof divibars_with_automatic_trigger !== 'undefined') {
161				
162				if ( $( divibars_with_automatic_trigger ).length > 0 ) {
163					
164					$.each( divibars_with_automatic_trigger, function( divibar_id, at_settings ) {
165						
166						var at_settings_parsed = jQuery.parseJSON( at_settings )
167						, at_type_value = at_settings_parsed.at_type
168						, at_onceperload = at_settings_parsed.at_onceperload;
169						
170						if ( at_onceperload == 1 ) {
171							
172							showdivibarOnce( divibar_id );
173						}
174						
175						if ( at_type_value == 'divibar-timed' ) {
176							
177							var time_delayed = at_settings_parsed.at_value * 1000;
178							
179							setTimeout( function() {
180								
181								showDivibar( divibar_id );
182								
183							}, time_delayed);
184						}
185						
186						
187						if ( at_type_value == 'divibar-scroll' ) {
188							
189							var divibarScroll = at_settings_parsed.at_value, refScroll;
190							
191							if ( divibarScroll.indexOf('%') || divibarScroll.indexOf('px') ) {
192								
193								if ( divibarScroll.indexOf('%') ) {
194									
195									divibarScroll = divibarScroll.replace(/%/g, '');
196									refScroll = '%';
197								}
198								
199								if ( divibarScroll.indexOf('px') ) {
200									
201									divibarScroll = divibarScroll.replace(/px/g, '');
202									refScroll = 'px';
203								}
204								
205								divibarScroll = divibarScroll.split(':');
206								
207								var divibarScrollFrom = divibarScroll[0]
208								, divibarScrollTo = divibarScroll[1];
209								
210								$(window).scroll(function(e) {
211								
212									var s = getScrollTop()
213									, d = $(document).height()
214									, c = $(window).height()
215									, wScroll;
216									
217									if ( refScroll == '%' ) {
218										
219										wScroll = (s / (d-c)) * 100;
220									
221									} else if ( refScroll == 'px' ) {
222										
223										wScroll = s;
224										
225									} else {
226										
227										return;
228									}
229									
230									if ( divibarScrollFrom > 0 && divibarScrollTo > 0 ) {
231										
232										if ( divibarScrollFrom <= wScroll && divibarScrollTo >= wScroll ) {
233											
234											if ( !isActiveDivibar( divibar_id ) ) {
235												
236												showDivibar( divibar_id );
237											}
238										}
239										else if ( isActiveDivibar( divibar_id ) ) {
240											
241											closeActiveDivibar( divibar_id );
242										}
243									}
244									
245									if ( divibarScrollFrom > 0 && divibarScrollTo == '' ) {
246										
247										if ( divibarScrollFrom <= wScroll ) {
248											
249											if ( !isActiveDivibar( divibar_id ) ) {
250												
251												showDivibar( divibar_id );
252											}
253										}
254										else if ( isActiveDivibar( divibar_id ) ) {
255											
256											closeActiveDivibar( divibar_id );
257										}
258									}
259									
260									if ( divibarScrollFrom == '' && divibarScrollTo > 0 ) {
261										
262										if ( divibarScrollTo >= wScroll ) {
263											
264											if ( !isActiveDivibar( divibar_id ) ) {
265												
266												showDivibar( divibar_id );
267											}
268										}
269										else if ( isActiveDivibar( divibar_id ) ) {
270										
271											closeActiveDivibar( divibar_id );
272										}
273									}
274								});
275							}
276						}
277						
278						
279						if ( at_type_value == 'divibar-exit' ) {
280							
281							$.exitIntent('enable', { 'sensitivity': 100 });
282							
283							$(document).bind('exitintent',
284								function() {
285									
286									if ( !isActiveDivibar( divibar_id ) ) {
287										
288										showDivibar( divibar_id );
289									}
290								});
291						}
292					});
293				}
294			}
295			
296			
297			$('.nav a, .mobile_nav a').each(function( index,value ) {
298				
299				var href = $( value ).attr('href');
300				
301				if ( href !== undefined ) {
302				
303					idx_divibar = href.indexOf('divibar');
304					
305					if ( idx_divibar !== -1 ) {
306						
307						var idx_divibarArr = href.split('-');
308						
309						if ( idx_divibarArr.length > 1 ) {
310							
311							var divibar_id = idx_divibarArr[1];
312							
313							$(this).attr('data-divibarid', divibar_id);
314							
315							$(this).on('click touch tap', function () {
316								
317								divibar_id = $(this).data('divibarid');
318								
319								showDivibar( divibar_id );
320							});
321						}
322					}
323				}
324			});
325			
326			
327			function getFlyingElements() {
328				
329				var elemData = {}
330				, height
331				, totalHeight = 0
332				, allElems
333				, attr
334				, lastElemHeight = 0
335				, defaultElems = '#wpadminbar,#top-header';
336				
337				if ( $( 'body' ).hasClass('et_extra') ) { /* Extra theme support */
338					
339					defaultElems += ',#main-header-wrapper';
340					
341				} else {
342					
343					defaultElems += ',#main-header';
344				}
345				
346				allElems = defaultElems;
347				
348				// Add custom elements (Divi Bars Settings)
349				if ( divibars_settings  !== undefined && divibars_settings['dib_custom_elems'] !== undefined && divibars_settings['dib_custom_elems'] != '' ) {
350					
351					allElems = allElems + ',' + divibars_settings['dib_custom_elems'];
352				}
353				
354				/*
355				if ( !diviMobile ) {
356					
357					allElems = 'div,header,footer,nav' + allElems;
358				}
359				*/
360				
361				allElems = allElems.split( ',' );
362				
363				fixedElements = [];
364				
365				$.each( allElems, function( index, value ) {
366					
367					if ( $( this ).length > 0 ) {
368						
369						if ( !$( this ).hasClass('divibars') ) {
370							
371							elemData['id'] = ( $( this ).attr('id') !== undefined ) ? $( this ).attr('id') : '';
372							elemData['class'] = ( $( this ).attr('class') !== undefined ) ? $( this ).attr('class') : '';
373							elemData['css_height'] = getElemHeight( $( this ) );
374							elemData['css_top'] = parseInt( $(this).css('top') );
375							elemData['css_position'] = $( this ).css('position');
376							elemData['lastElemHeight'] = lastElemHeight;
377							
378							if ( elemData['css_position'] != 'fixed' && elemData['css_position'] != 'absolute' ) {
379								
380								elemData = fixElementsPositionTop( elemData );
381							}
382							
383							if (
384								(
385									elemData['css_position'] == 'fixed' 
386									&& $( this ).css('display') != 'none' 
387									&& $( this ).css('visibility') != 'hidden' 
388									&& elemData['css_top'] >= 0
389								)
390								|| 
391								(
392									diviMobile
393									&& elemData['css_position'] == 'absolute' 
394									&& $( this ).css('display') != 'none' 
395									&& $( this ).css('visibility') != 'hidden' 
396									&& elemData['css_top'] >= 0
397								)
398								) {
399								
400								if ( diviMobile && elemData['css_position'] == 'absolute' ) {
401									
402									$( this ).attr('data-position', 'absolute');
403								}
404								else if ( !diviMobile && elemData['css_position'] == 'fixed' ) {
405									
406									$( this ).attr('data-position', '');
407								}
408								
409								if ( ( elemData['id'] != '' ) 
410									|| ( elemData['class'] != '' ) ) {
411									
412									fixedElements[ elemData['css_top'] ] = [];
413									fixedElements[ elemData['css_top'] ]['id'] = elemData['id'];
414									fixedElements[ elemData['css_top'] ]['class'] = elemData['class'];
415									fixedElements[ elemData['css_top'] ]['css_top'] = elemData['css_top']
416									fixedElements[ elemData['css_top'] ]['css_height'] = elemData['css_height'];
417									fixedElements[ elemData['css_top'] ]['css_position'] = elemData['css_position'];
418									
419									totalHeight = ( totalHeight + elemData['css_height'] );
420									
421									lastElemHeight = elemData['css_height'];
422								}
423							}
424						}
425					}
426					
427				});
428				
429				fixedElements['totalHeight'] = totalHeight;
430				
431				return fixedElements;
432			}
433			
434			
435			function fixElementsPositionTop( elemData ) {
436				
437				var selector
438				, newCssTop
439				, divibar_id = getActiveDivibar()
440				, divibar_selector = '#divibar-' + divibar_id
441				, divibarHeight = $( divibar_selector ).find('.divibars-body').height()
442				
443				if ( elemData['id'] != '' ) {
444					
445					selector = '#' + elemData['id'];
446				}
447				else if ( elemData['class'] != '' ) {
448					
449					selector = '.' + elemData['class'];
450					
451				}
452				else {
453					
454					return false;
455				}
456				
457				newCssTop = divibarHeight + elemData['lastElemHeight'];
458				
459				addStyles( selector, 'width:100% !important;' );
460				addStyles( selector, 'top:' + newCssTop + 'px !important;' );
461				addStyles( selector, 'position:fixed !important;' );
462				
463				elemData['css_top'] = newCssTop;
464				elemData['css_position'] = 'fixed';
465				
466				return elemData;
467			}
468			
469			
470			var fixedElementsScrollHandler = function( fixedElements ) {
471				
472				if ( ! $( "html,body" ).hasClass('divibar-open') ) {
473					
474					return;
475				}
476				
477				autoPositionFixedElements( fixedElements );
478			}
479			
480			
481			function autoPositionFixedElements( fixedElements ) {
482				
483				var scroll = getScrollTop()
484					, selector
485					, divibar_id = getActiveDivibar()
486					, divibar_selector = '#divibar-' + divibar_id
487					, divibar = $( divibar_selector )
488					, divibarHeight = $( divibar_selector ).find('.divibars-body').height()
489					, currentPosition
490					, currentPositionTop
491					, position
492					, dataPosition
493					, divibarScreenfixed = divibar.data('screenfixed');
494					
495				if ( fixedElements[0]['id'].length ) {
496					
497					if ( fixedElements[0]['id'] != '' ) {
498						
499						selector = '#' + fixedElements[0]['id'];
500						
501					} else if ( fixedElements[0]['class'] != '' ) {
502						
503						selector = '.' + fixedElements[0]['class'];
504						
505					} else {
506						
507						return false;
508					}
509				}
510				
511				dataPosition = $( selector ).attr('data-position');
512				
513				if ( dataPosition != 'absolute' ) {
514					
515					if ( !divibarScreenfixed ) {
516						
517						divibarHeight = divibarHeight - fixedElements['totalHeight'];
518					}
519					
520					if ( dataPosition != 'fixed' 
521						&& scroll > divibarHeight ) {
522						
523						scrollCheck = true;
524						
525						whileScrollingUpdateFixedElementsPosition( 'fixed' );
526						
527						$( selector ).attr('data-position', 'fixed');
528								
529					} else if ( dataPosition == 'fixed' 
530						&& scroll < divibarHeight ) {
531							
532						scrollCheck = false;
533						
534						whileScrollingUpdateFixedElementsPosition( 'absolute' );
535						
536						$( selector ).attr('data-position', '');
537					}
538				}
539			}
540			
541			
542			function whileScrollingUpdateFixedElementsPosition( position ) {
543				
544				var selector
545				, positionTop
546				, divibar_id = getActiveDivibar()
547				, divibar_selector = '#divibar-' + divibar_id
548				, divibar = $( divibar_selector )
549				, divibarHeight = divibar.find('.divibars-body').height()
550				, lastPosition
551				, elemHeight
552				, lastElemHeight = 0
553				, currentPosition
554				, keepElementPosition
555				, screenfixed = divibar.data('screenfixed');
556				
557				lastPosition = divibarHeight;
558				
559				$.each( fixedElements, function( index, value ) {
560					
561					if ( Array.isArray( value ) ) {
562						
563						if ( value['id'] != '' ) {
564							
565							selector = '#' + value['id'];
566							
567						} else if ( value['class'] != '' ) {
568							
569							selector = '.' + value['class'];
570							
571						} else {
572							
573							return true;
574						}
575						
576						keepElementPosition = $( selector ).attr('data-position') == 'absolute' ? true : false;
577						
578						if ( scrollCheck ) {
579							
580							lastPosition = lastPosition + lastElemHeight;
581							
582							positionTop = lastPosition;
583							
584							if ( !keepElementPosition ) {
585								
586								$( selector ).attr('data-position', '');
587							}
588						}
589						else if ( !scrollCheck ) {
590							
591							currentPosition = parseInt( $( selector ).css('top') );
592							
593							lastPosition = lastPosition - lastElemHeight;
594							
595							positionTop = currentPosition - divibarHeight;
596						}
597						
598						addStyles( selector, 'top:' + positionTop + 'px !important;' );
599						
600						if ( !keepElementPosition ) {
601							
602							$( selector ).removeClass( 'divibar-elem-transition-top' );
603							
604							
605							if ( position != null ) {
606								
607								addStyles( selector, 'position:' + position + ' !important;' );
608							}
609						}
610						
611						if ( diviMobile ) {
612							
613							// Except divibar, we don't want other elements position fixed in mobile while divibar is active
614							if ( divibar_selector != selector ) {
615								
616								addStyles( selector, 'position:absolute !important;' );
617							}
618						}
619						
620						elemHeight = value['css_height'];
621						
622						lastElemHeight = elemHeight;
623					}
624					
625				});
626			}
627			
628			
629			function toggleDivibar( divibar_id ) {
630				
631				var divibar_selector = '#divibar-' + divibar_id
632				, divibar_cache_selector = '#divibar-' + divibar_id
633				, divibar_container = '#divi-divibars-container-' + divibar_id
634				, divibar = $('body').find( divibar_cache_selector )
635				, oid = divibar.attr('id')
636				, isMobile = divibar.attr('data-ismobile');
637				
638				var displayonceperload = divibar.data('displayonceperload')
639				, preventOpen = divibar.attr('data-preventopen');
640				
641				var placement = divibar.data('placement')
642				, plSign = '+'
643				, pushpage = divibar.data('pushpage')
644				, screenfixed = divibar.data('screenfixed');
645				
646				var cookieName = 'divibar' + divibar_id
647				, cookieDays = divibar.data('cookie');
648				
649				var topHeader_selector = '#top-header'
650				, topHeaderHeight = $( topHeader_selector ).height();
651				
652				var divibarBody = $( divibar ).find('.divibars-content-inner')
653				, divibarHeight = divibarBody.height()
654				, mainHeaderTop = ( divibarHeight + topHeaderHeight ) + 'px'
655				, bodyPaddingTopDivibar = ( divibarHeight - cacheHtmlMarginTop ) + 'px';
656				
657				var pageContainer = $( '#page-container' );
658				
659				var options = [];
660				options['placement'] = placement;
661				options['screenfixed'] = screenfixed;
662				options['bodyPaddingTopDivibar'] = bodyPaddingTopDivibar;
663				options['divibarHeight'] = divibarHeight;
664					
665				if ( placement == 'top' ) {
666					
667					contentLengthcache = $( divibar_selector ).text().length;
668				}
669				
670				if ( readCookie( cookieName ) ) {
671					
672					return;
673				}
674				
675				if ( !screenfixed ) {
676					
677					$( divibar ).css( 'position', 'fixed' );
678				}
679				
680				if ( screenfixed ) {
681				
682					window.scrollTo(0,0);
683				}
684				
685				
686				if ( $( divibar ).hasClass('open') ) { // Closing divibar
687				
688					setTimeout( function() {
689						
690						$( divibar ).removeClass( 'divibars-opened' );
691						
692						if ( cookieDays > 0 ) {
693							
694							createCookie( cookieName, 'true', cookieDays );
695						}
696						
697						$( divibar ).removeClass('open');
698						$( divibar ).addClass('close');
699						
700						if ( pushpage ) {
701							
702							pushBody( options, 'close' );
703						}
704						
705						$( divibar ).transition({
706							height: 0,
707							easing: 'linear',
708							duration: 400,
709							complete: function() {
710							
711								$( divibar ).removeClass( 'close' );
712								$( "html,body" ).removeClass('divibar-open');
713								
714								if ( displayonceperload ) {
715									
716									$( divibar_container ).remove();
717								}
718								else {
719									
720									dibTogglePlayableTags( '#divibar-' + divibar_id );
721								}
722								
723								// $( divibar ).removeAttr('style');
724								
725								if ( !isActiveDivibar() ) {
726									
727									if ( pageContainer.length ) {
728										
729										$( "#page-container .container" ).css('z-index','1');
730										$( "#page-container #main-header" ).css('z-index','99989');
731									}
732									
733									$( "#sidebar-divibar" ).css('z-index','-15');
734								}
735								
736								$( "#sidebar-divibar" ).removeClass('sidebar-divibar-bottom');
737								
738								if ( screenfixed ) {
739									
740									if ( typeof bodyHtmlStyleCache != 'undefined' && bodyHtmlStyleCache != '' ) {
741										
742										$( "body,html" ).attr( 'style', bodyHtmlStyleCache );
743									}
744									else {
745										
746										$( "body,html" ).removeAttr( 'style' );
747									}
748									
749									$( "#sidebar-divibar" ).css( 'position', 'absolute' );
750									
751									affixFixedElements( divibarHeight, 'close' );
752								}
753								
754								$( divibar ).find( ".divibars-close-container" ).removeClass( 'dibShow' );
755								
756								setTimeout( function() {
757									
758									$( '#' + styleTagID ).empty();
759									
760								}, 200);
761							}
762						 });
763					 
764					 }, 100);
765				}
766				else if( !$( divibar ).hasClass('close') && !preventOpen ) { // Opening divibar
767				
768					if ( !screenfixed ) {
769						
770						if ( placement ) {
771							
772							$( divibar ).css( placement, plSign + '0' );
773						}
774					}
775					
776					if ( displayonceperload ) {
777						
778						divibar.attr('data-preventopen', 1);
779					}
780					
781					divibar.attr('data-scrolltop', getScrollTop() );
782					
783					$( "html,body" ).addClass('divibar-open');
784					
785					if ( pageContainer.length ) {
786						
787						$( "#page-container .container" ).css('z-index','0');
788					}
789					
790					$( divibar ).css('height', 0);
791					
792					setTimeout( function() {
793						
794						$( "#sidebar-divibar" ).css('z-index','16777271');
795						
796						$( divibar ).addClass('open');
797						
798						$( divibar ).transition({
799							height: divibarHeight + 'px',
800							complete: function() {
801								
802								if ( placement == 'top' ) {
803									
804									divibarHeightCache = getElemHeight( $( divibar_selector ) );
805								}
806								
807								$( divibar ).addClass( 'divibars-opened' );
808								$( divibar ).find( ".divibars-close-container" ).addClass( 'dibShow' );
809							}
810						});
811						
812						if ( pushpage ) {
813							
814							pushBody( options, 'open' );
815							
816							$(window).scroll( fixedElementsScrollHandler.bind( null, fixedElements ) );
817							
818							if ( screenfixed ) {
819								
820								$( "body,html" ).attr('style', 'margin:0 !important; padding:0 !important');
821								$( "#sidebar-divibar" ).css( 'position', 'relative' );
822								$( divibar ).css( 'position', 'relative' );
823								
824								affixFixedElements( divibarHeight, 'open' );
825							}
826						}
827						
828						if ( divibar.attr('data-bgcolor') != "") {
829							$( divibar_cache_selector ).css( { 'background-color': divibar.attr('data-bgcolor') } );
830						}
831						
832						if ( divibar.attr('data-fontcolor') != "") {
833							$( divibar_cache_selector ).css( 'color', divibar.attr('data-fontcolor') );
834						}
835						
836					}, 200);
837				}
838			}
839			
840			
841			function getScrollTop() {
842				
843				if ( typeof pageYOffset!= 'undefined' ) {
844					
845					// most browsers except IE before #9
846					return pageYOffset;
847				}
848				else {
849					
850					var B = document.body; // IE 'quirks'
851					var D = document.documentElement; // IE with doctype
852					D = ( D.clientHeight ) ? D: B;
853					
854					return D.scrollTop;
855				}
856			}
857			
858			function showDivibar( divibar_id ) {
859				
860				if ( !isInt( divibar_id ) )
861					return;
862				
863				divi_divibar_container_selector = '#divi-divibars-container-' + divibar_id;
864				
865				if ( $( divi_divibar_container_selector ).length ) {
866				
867					divibar_body = $( divi_divibar_container_selector ).find( '.divibars' );
868					
869					toggleSrcInPlayableTags( divibar_body );
870					
871					toggleDivibar( divibar_id );
872				}
873			}
874			
875			function showdivibarOnce( divibar_id ) {
876				
877				if ( !isInt( divibar_id ) )
878					return;
879				
880				divibar = '#divibar-' + divibar_id;
881				
882				$( divibar ).attr( 'data-displayonceperload', 1 );
883			}
884			
885			function toggleSrcInPlayableTags( str ) {
886				
887				str.find("iframe").each(function() { 
888					var src = $(this).data('src');
889					$(this).attr('src', src);  
890				});
891				
892				return str;
893			}
894			
895			$('body').on('click touch tap', '.divibars-close, .divibars-close span, .close-divibar', function(e) {
896				
897				if ( e.target !== e.currentTarget ) return;
898				
899				closeDivibar(this);
900			});
901			
902			function closeActiveDivibar( divibar_id ) {
903				
904				// find active divibar
905				var divibar = $( 'body' ).find( '.divibars.open' );
906				var displayonceperload = divibar.data('displayonceperload');
907				
908				if ( divibar.length ) {
909					
910					if ( divibar_id == null ) {
911						
912						var divibarArr = divibar.attr('id').split('-');
913						divibar_id = divibarArr[1];
914					}
915					
916					showDivibar( divibar_id );
917				}
918			}
919			
920			function closeDivibar( elem, divibar_id ) {
921				
922				if ( divibar_id == null ) {
923					
924					var divibarArr = $( elem ).parents( '.divibars' ).attr('id').split('-');
925					divibar_id = divibarArr[1];
926				}
927				
928				showDivibar( divibar_id );
929			}
930			
931			function getActiveDivibar() {
932				
933				var divibar = null
934				, divibar_id = null
935				, elemID = null
936				, placement = null;
937				
938				// find active divibar only in top
939				$('.divibars.open').each(function( index, el ) {
940					
941					placement = $(this).data('placement');
942					
943					if ( placement == 'top' ) {
944						
945						elemID = $(this).attr('id');
946						
947						divibar = $( '#' + elemID );
948					}
949					
950				});
951				
952				if ( !divibar ) {
953					
954					divibar = $( 'body' ).find( '.divibars.close' );
955				}
956				
957				if ( divibar.length ) {
958					
959					var divibarArr = divibar.attr('id').split('-');
960					var divibar_id = divibarArr[1];
961				}
962				
963				return divibar_id;
964			}
965			
966			function isOpeningDivibar( divibar_id ) {
967				
968				if ( !divibar_id ) {
969					
970					return null;
971				}
972				
973				var divibar = $( '#divibar-' + divibar_id );
974				
975				if ( $( divibar ).css('opacity') < 1 ) {
976					
977					return true;
978				}
979				
980				return false;
981			}
982			
983			function isClosingdivibar( divibar_id ) {
984				
985				if ( !divibar_id ) {
986					
987					return null;
988				}
989				
990				var divibar = $( '#divibar-' + divibar_id );
991				
992				if ( $( divibar ).hasClass('close') ) {
993					
994					return false;
995				}
996				
997				return true;
998			}
999			
1000			function isActiveDivibar( divibar_id ) {
1001				
1002				if ( !divibar_id ) {
1003					
1004					var divibar = $( '.divibars.open' );
1005				}
1006				else {
1007					
1008					var divibar = $( '#divibar-' + divibar_id );
1009				}
1010				
1011				if ( $( divibar ).hasClass('open') ) {
1012					
1013					return true;
1014				}
1015				
1016				return false;
1017			}
1018			
1019			function isInt(value) {
1020				var x;
1021				return isNaN(value) ? !1 : (x = parseFloat(value), (0 | x) === x);
1022			}
1023			
1024			
1025			function pushBody( options, status, onlyPushBody ) {
1026				
1027				var placement = options['placement']
1028				, screenfixed = options['screenfixed']
1029				, bodyPaddingTopDivibar = options['bodyPaddingTopDivibar']
1030				, divibarHeight = options['divibarHeight'];
1031				
1032				if ( status == 'close' ) {
1033					
1034					$( "#sidebar-divibar" ).css('z-index','1');
1035					
1036					if ( placement == 'bottom' ) {
1037						
1038						if ( !screenfixed ) {
1039						
1040							$( 'body' ).transition({ paddingBottom: cacheBodyPaddingBottom + 'px' });
1041						}
1042					}
1043						
1044					if ( placement == 'top' ) {
1045						
1046						$( 'body' ).transition({ paddingTop: cacheBodyPaddingTop + 'px' });
1047						
1048						$( '#page-container' ).removeAttr('style');
1049						
1050						if ( !onlyPushBody ) {
1051							
1052							updateFixedElementsPosition( 'close' );
1053						}
1054					}
1055					
1056				} else if ( status == 'open' ) {
1057				
1058					if ( placement == 'bottom' ) {
1059						
1060						if ( !screenfixed ) {
1061						
1062							$( 'body' ).transition({ paddingBottom: divibarHeight + 'px' });
1063						}
1064					}
1065					
1066					if ( placement == 'top' ) {
1067						
1068						$( '#page-container' ).transition({ paddingTop: fixedElements['totalHeight'] });
1069						
1070						if ( !screenfixed ) {
1071						
1072							$( 'body' ).transition({ paddingTop: bodyPaddingTopDivibar });
1073						}
1074						
1075						if ( !onlyPushBody ) {
1076							
1077							updateFixedElementsPosition( 'open' );
1078						}
1079					}
1080				}
1081				
1082				return;
1083			}
1084			
1085			
1086			function updateFixedElementsPosition( divibarStatus, transition = true, position, forceHeight = null ) {
1087				
1088				var selector
1089				, positionTop
1090				, divibar_id = getActiveDivibar()
1091				, divibar_selector = '#divibar-' + divibar_id
1092				, divibar = $( divibar_selector )
1093				, divibarHeight = divibar.find('.divibars-body').height()
1094				, lastPosition
1095				, elemHeight
1096				, lastElemHeight = 0
1097				, currentPosition
1098				, keepElementPosition;
1099				
1100				if ( forceHeight ) {
1101					
1102					divibarHeight = forceHeight;
1103				}
1104				
1105				lastPosition = divibarHeight;
1106				
1107				$.each( fixedElements, function( index, value ) {
1108					
1109					if ( Array.isArray( value ) ) {
1110						
1111						if ( value['id'] != '' ) {
1112							
1113							selector = '#' + value['id'];
1114							
1115						} else if ( value['class'] != '' ) {
1116							
1117							selector = '.' + value['class'];
1118							
1119						} else {
1120							
1121							return true;
1122						}
1123						
1124						keepElementPosition = $( selector ).attr('data-position') == 'absolute' ? true : false;
1125						
1126						if ( divibarStatus == 'open' ) {
1127							
1128							lastPosition = lastPosition + lastElemHeight;
1129							
1130							positionTop = lastPosition;
1131							
1132							if ( !keepElementPosition ) {
1133								
1134								$( selector ).attr('data-position', '');
1135							}
1136						}
1137						else if ( divibarStatus == 'close' ) {
1138							
1139							currentPosition = parseInt( $( selector ).css('top') );
1140							
1141							lastPosition = lastPosition - lastElemHeight;
1142							
1143							positionTop = currentPosition - divibarHeight;
1144						}
1145						
1146						if ( transition ) {
1147							
1148							$( selector ).addClass( 'divibar-elem-transition-top' );
1149							
1150							addStyles( selector, 'top:' + positionTop + 'px !important;' );
1151							
1152						} else {
1153							
1154							addStyles( selector, 'top:' + positionTop + 'px !important;' );
1155							
1156							if ( !keepElementPosition ) {
1157								
1158								$( selector ).removeClass( 'divibar-elem-transition-top' );
1159								
1160								
1161								if ( position != null ) {
1162									
1163									addStyles( selector, 'position:' + position + ' !important;' );
1164								}
1165							}
1166							
1167							if ( diviMobile ) {
1168								
1169								// Except divibar, we don't want other elements position fixed in mobile while divibar is active
1170								if ( divibar_selector != selector ) {
1171									
1172									addStyles( selector, 'position:absolute !important;' );
1173								}
1174							}
1175						}
1176						
1177						elemHeight = value['css_height'];
1178						
1179						lastElemHeight = elemHeight;
1180					}
1181					
1182				});
1183			}
1184			
1185			
1186			function affixFixedElements( divibarHeight, divibarStatus ) {
1187				
1188				var selector
1189				, position
1190				, divibarHeight
1191				, keepElementPosition;
1192				
1193				$.each( fixedElements, function( index, value ) {
1194					
1195					if ( Array.isArray( value ) ) {
1196						
1197						if ( value['id'] != '' ) {
1198							
1199							selector = '#' + value['id'];
1200							
1201						} else if ( value['class'] != '' ) {
1202							
1203							selector = '.' + value['class'];
1204							
1205						} else {
1206							
1207							return true;
1208						}
1209						
1210						keepElementPosition = $( selector ).attr('data-position') == 'absolute' ? true : false;
1211						
1212						if ( divibarStatus == 'open' ) {
1213						
1214							position = 'absolute';
1215						}
1216						else if ( divibarStatus == 'close' ) {
1217							
1218							position = 'fixed';
1219						}
1220						
1221						if ( !keepElementPosition ) {
1222							
1223							addStyles( selector, 'position:' + position + ' !important;' );
1224						}
1225					}
1226				});
1227			}
1228			
1229			
1230			function testEvents( obj ) {
1231				
1232				var retVal = false;
1233				
1234				// Get all events bound to object
1235				var windowEvents = $._data(obj, "events");
1236				
1237				return;
1238			}
1239			
1240			
1241			function updateFixedElementsPositionOnly() {
1242				
1243				var selector
1244				, positionTop
1245				, divibar_id = getActiveDivibar()
1246				, divibar_selector = '#divibar-' + divibar_id
1247				, divibar = $( divibar_selector )
1248				, divibarHeight = divibar.find('.divibars-body').height()
1249				, lastPosition
1250				, elemHeight
1251				, currentElemHeight
1252				, lastElemHeight = 0
1253				, currentPosition
1254				, counter = 0
1255				, divibarScreenfixed = divibar.data('screenfixed');
1256				
1257				lastPosition = divibarHeight;
1258				
1259				$.each( fixedElements, function( index, value ) {
1260					
1261					if ( Array.isArray( value ) ) {
1262						
1263						if ( value['id'] != '' ) {
1264							
1265							selector = '#' + value['id'];
1266							
1267						} else if ( value['class'] != '' ) {
1268							
1269							selector = '.' + value['class'];
1270							
1271						} else {
1272							
1273							return true;
1274						}
1275						
1276						// Check only in the first interaction
1277						if ( scrollCheck && counter == 0 && divibarScreenfixed ) {
1278							
1279							lastPosition = 0;
1280							
1281							counter++;
1282						}
1283						
1284						currentElemHeight = getElemHeight( $( selector ) )
1285						elemHeight = value['css_height'];
1286						if ( currentElemHeight != elemHeight ) {
1287							
1288							elemHeight = currentElemHeight;
1289						}
1290						
1291						lastPosition = lastPosition + lastElemHeight;
1292						
1293						positionTop = lastPosition;
1294						
1295						addStyles( selector, 'top:' + positionTop + 'px !important;' );
1296						
1297						lastElemHeight = elemHeight;
1298					}
1299					
1300				});
1301			}
1302			
1303			
1304			function autoPositionAll() {
1305				
1306				var divibar_id = getActiveDivibar();
1307				
1308				diviMobile = isDiviMobile();
1309				
1310				if ( divibar_id ) {
1311					
1312					var divibar_selector = '#divibar-' + divibar_id
1313					, divibar = $( divibar_selector )
1314					, contentLength = divibar.text().length
1315					, divibarHeight = getElemHeight( $( divibar_selector ).find('.divibars-body') );
1316					
1317					if ( divibar.hasClass( 'divibars-opened' ) ) {
1318						
1319						divibar.css( 'height', divibarHeight );
1320						
1321						if ( 
1322							( contentLength != contentLengthcache ) 
1323							|| ( divibarHeight != divibarHeightCache ) ) {
1324							
1325							var placement = divibar.data('placement')
1326							, pushpage = divibar.data('pushpage')
1327							, screenfixed = divibar.data('screenfixed')
1328							, bodyPaddingTopDivibar = ( divibarHeight - cacheHtmlMarginTop ) + 'px'
1329							, options = [];
1330							
1331							options['pushpage'] = pushpage;
1332							options['placement'] = placement;
1333							options['screenfixed'] = screenfixed;
1334							options['divibarHeight'] = divibarHeight;
1335							options['bodyPaddingTopDivibar'] = bodyPaddingTopDivibar;
1336							
1337							$( divibar_selector ).transition({ height: divibarHeight + 'px' });
1338							
1339							// Update global variables when @media breakpoint changes between mobile and desktop
1340							if ( 
1341								( diviMobile === false && diviMobileCache === true ) 
1342								|| ( diviMobile === true && diviMobileCache === false )
1343								) {
1344								
1345								stopAutoPositionTimer();
1346								
1347								updateGlobals( options );
1348							}
1349							else {
1350								
1351								if ( pushpage ) {
1352									
1353									if ( placement == 'top' || screenfixed ) {
1354									
1355										updateFixedElementsPosition( 'open', false, null, divibarHeight );
1356									}
1357									
1358									pushBody( options, 'open', true );
1359								}
1360								
1361								contentLengthcache = contentLength;
1362								
1363								divibarHeightCache = divibarHeight;
1364							}
1365						}
1366						else {
1367							
1368							updateFixedElementsPositionOnly();
1369						}
1370					}
1371				}
1372			}
1373			
1374			positionTimer = setInterval( autoPositionAll, 100 );
1375			
1376			
1377			function updateGlobals( options ) {
1378				
1379				var placement = options['placement']
1380				, pushpage = options['pushpage']
1381				, screenfixed = options['screenfixed']
1382				, divibarHeight = options['divibarHeight']
1383				, selector;
1384				
1385				diviMobile = diviMobileCache = isDiviMobile();
1386				
1387				setTimeout( function() {
1388					
1389					removeStyles();
1390					
1391					setTimeout( function() {
1392						
1393						fixedElements = getFlyingElements();
1394						
1395						setTimeout( function() {
1396							
1397							// Remove data-position in all position fixed elements
1398							$.each( fixedElements, function( index, value ) {
1399								
1400								if ( Array.isArray( value ) ) {
1401									
1402									if ( value['id'] != '' ) {
1403										
1404										selector = '#' + value['id'];
1405										
1406									} else if ( value['class'] != '' ) {
1407										
1408										selector = '.' + value['class'];
1409										
1410									} else {
1411										
1412										return true;
1413									}
1414									
1415									$( selector ).removeAttr('data-position');
1416								}
1417								
1418							});
1419							
1420							setTimeout( function() {
1421							
1422								affixFixedElements( divibarHeight, 'open' );
1423							
1424								setTimeout( function() {
1425										
1426									if ( pushpage ) {
1427										
1428										if ( placement == 'top' || screenfixed ) {
1429										
1430											updateFixedElementsPosition( 'open', false, null, divibarHeight );
1431										}
1432										
1433										pushBody( options, 'open', true );
1434									}
1435									
1436									positionTimer = setInterval( autoPositionAll, 100 );
1437									
1438								}, 1);
1439								
1440							}, 1);
1441							
1442						}, 1);
1443						
1444					}, 1);
1445					
1446				}, 1);
1447			}
1448			
1449			
1450			function removeMonarch() {
1451				
1452				if ( $( '.divibars .et_social_inline' ).length ) {
1453					
1454					$( '.divibars .et_social_inline' ).parents('.et_pb_row').remove();
1455				}
1456				
1457				removeMonarchTimer = setTimeout(removeMonarch, 500);
1458			}
1459			
1460			removeMonarch();
1461			
1462			
1463			function stopAutoPositionTimer() {
1464				
1465				if ( positionTimer ) {
1466					
1467					clearInterval( positionTimer );
1468					positionTimer = 0;
1469				}
1470			}
1471			
1472			
1473			function getElemHeight( elem ) {
1474			
1475				var elemHeight = 0, attr;
1476				
1477				if ( elem.length ) {
1478				
1479					elemHeight = elem.outerHeight();
1480					
1481					if ( elemHeight === 0 ) {
1482						
1483						attr = elem.attr('id');
1484						
1485						if (typeof attr !== typeof undefined && attr !== false) {
1486							
1487							elemHeight = document.getElementById( attr ).offsetHeight;
1488						}
1489					}
1490					
1491					if ( elemHeight === 0 ) {
1492						
1493						elemHeight = elem.delay(100).outerHeight();
1494					}
1495					
1496					elemHeight = parseInt( elemHeight );
1497				
1498				}
1499				
1500				return elemHeight;
1501			}
1502			
1503			
1504			function addStyles( selector, css ) {
1505				
1506				var CSSline
1507				, CSSlines
1508				, regexCSSline
1509				, regex
1510				, divibarStylesTag = $( '#' + styleTagID )
1511				, divibarStylesTagContent = divibarStylesTag.text();
1512				
1513				if ( selector && selector != '#undefined' ) {
1514					
1515					CSSline = 'body.divibar-open ' + selector + ' { ' + css + ' }';
1516					CSSline += 'body.et_fixed_nav.et_secondary_nav_only_menu.admin-bar ' + selector + ' { ' + css + ' }';
1517					regexCSSline = escapeRegExp( CSSline );
1518					
1519					// Remove any duplicates
1520					regex = new RegExp( regexCSSline, 'g' );
1521					divibarStylesTagContent = divibarStylesTagContent.replace( regex, '' );
1522					
1523					// Update style tag
1524					divibarStylesTag.text( divibarStylesTagContent );
1525					
1526					divibarStylesTag.append( CSSline );
1527					
1528					/*
1529					CSSlines = divibarStylesTag.text().split('}');
1530					$( CSSlines ).each(function (idx, line) {
1531						
1532						if ( line.length > 2 ) {
1533							
1534						}
1535					});
1536					
1537					// Remove blank lines
1538					// divibarStylesTag.text( divibarStylesTag.text().replace(/^\s*[\r\n]/gm, '') );
1539					*/
1540				}
1541			}
1542			
1543			
1544			// Belongs to https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions
1545			function escapeRegExp(string) {
1546				return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string
1547			}
1548			
1549			
1550			// This remove styles from Divi Bars styles tag only
1551			function removeStyles( selector ) {
1552				
1553				var CSSline
1554				, regexCSSline
1555				, regex
1556				, divibar_id = getActiveDivibar()
1557				, divibar_selector = '#divibar-' + divibar_id
1558				, divibarStylesTag = $( '#' + styleTagID )
1559				, divibarStylesTagContent = divibarStylesTag.text();
1560				
1561				if ( selector && selector != '#undefined' ) {
1562					
1563					selector = [ selector ];
1564				}
1565				else {
1566					
1567					selector = fixedElements;
1568				}
1569				
1570				$.each( selector, function( index, value ) {
1571					
1572					if ( Array.isArray( value ) ) {
1573						
1574						if ( value['id'] != '' ) {
1575							
1576							selector = '#' + value['id'];
1577							
1578						} else if ( value['class'] != '' ) {
1579							
1580							selector = '.' + value['class'];
1581							
1582						} else {
1583							
1584							return true;
1585						}
1586						
1587						CSSline = 'body.divibar-open ' + selector + ' { position:absolute !important; }';
1588						
1589						regexCSSline = escapeRegExp( CSSline );
1590						regex = new RegExp( regexCSSline, 'g' );
1591						divibarStylesTagContent = divibarStylesTagContent.replace( regex, '' );
1592						
1593						CSSline = 'body.et_fixed_nav.et_secondary_nav_only_menu.admin-bar ' + selector + ' { position:absolute !important; }';
1594						
1595						regexCSSline = escapeRegExp( CSSline );
1596						regex = new RegExp( regexCSSline, 'g' );
1597						divibarStylesTagContent = divibarStylesTagContent.replace( regex, '' );
1598						
1599						CSSline = 'body.divibar-open ' + selector + ' { position:fixed !important; }';
1600						
1601						regexCSSline = escapeRegExp( CSSline );
1602						regex = new RegExp( regexCSSline, 'g' );
1603						divibarStylesTagContent = divibarStylesTagContent.replace( regex, '' );
1604						
1605						CSSline = 'body.et_fixed_nav.et_secondary_nav_only_menu.admin-bar ' + selector + ' { position:fixed !important; }';
1606						
1607						regexCSSline = escapeRegExp( CSSline );
1608						regex = new RegExp( regexCSSline, 'g' );
1609						divibarStylesTagContent = divibarStylesTagContent.replace( regex, '' );
1610					}
1611				});
1612				
1613				// Update style tag
1614				divibarStylesTag.text( divibarStylesTagContent );
1615			}
1616			
1617			
1618			function isDiviMobile() {
1619				
1620				var currentTheme = detectTheme();
1621				
1622				// Get current device width
1623				vw = actual('width', 'px');
1624				
1625				diviMobile = ( vw < themesBreakpoint[ currentTheme ] ) ? true : false;
1626				
1627				return diviMobile;
1628			}
1629			
1630			
1631			function detectTheme() {
1632				
1633				var currentTheme = 'Divi';
1634				
1635				if ( $('body').hasClass('et_extra') ) {
1636					
1637					currentTheme = 'Extra';
1638				}
1639				
1640				return currentTheme;
1641			}
1642			
1643			
1644			function createCookie( name,value,days ) {
1645				
1646				var expires = "";
1647				
1648				if ( days ) {
1649					
1650					var date = new Date();
1651					
1652					date.setTime(date.getTime() + ( days * 24 * 60 * 60 * 1000));
1653					
1654					expires = "; expires=" + date.toUTCString();
1655				}
1656				
1657				document.cookie = name + "=" + value + expires + "; path=/";
1658			}
1659
1660			function readCookie( name ) {
1661				
1662				var nameEQ = name + "=";
1663				var ca = document.cookie.split(';');
1664				
1665				for(var i=0;i < ca.length;i++) {
1666					
1667					var c = ca[i];
1668					
1669					while (c.charAt(0)==' ') c = c.substring(1,c.length);
1670					
1671					if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
1672				}
1673				
1674				return null;
1675			}
1676
1677			function eraseCookie( name ) {
1678				createCookie( name, '', -1 );
1679			}
1680			
1681			// URL Trigger
1682			if ( window.location.hash ) {
1683				
1684				var hash = window.location.hash.substring( 1 );
1685				var idx_divibar = hash.indexOf('divibar'); 
1686				
1687				if ( idx_divibar !== -1 ) {
1688					
1689					var idx_divibarArr = hash.split('-');
1690					
1691					if ( idx_divibarArr.length > 1 ) {
1692						
1693						var divibar_id = idx_divibarArr[1];
1694						
1695						setTimeout(function() {
1696							
1697							showDivibar( divibar_id );
1698							
1699						}, 1);
1700					}
1701				}
1702			}
1703		}
1704		
1705	} // end mainDiviBars
1706	
1707	
1708	// Find all iframes inside the divibars
1709	var $dibiframes = $( "#sidebar-divibar .divibars iframe" );
1710	
1711	setTimeout( function() { 
1712	
1713		$dibiframes.each( function() {
1714			
1715			var iframeHeight = this.height;
1716			
1717			if ( iframeHeight == '' ) {
1718				
1719				iframeHeight = $( this ).height();
1720			}
1721			
1722			iframeWidth = this.width;
1723			
1724			if ( iframeWidth == '' ) {
1725				
1726				iframeWidth = $( this ).width();
1727			}
1728			
1729			iframeHeight = parseInt( iframeHeight );
1730			iframeWidth = parseInt( iframeWidth );
1731			
1732			var ratio = iframeHeight / iframeWidth;
1733			
1734			$( this ).attr( "data-ratio", ratio )
1735			// Remove the hardcoded width & height attributes
1736			.removeAttr( "width" )
1737			.removeAttr( "height" );
1738			
1739			// Get the parent container's width
1740			var width = $( this ).parent().width();
1741			
1742			$( this ).width( width ).height( width * ratio );
1743		});
1744		
1745	}, 200);
1746	
1747	// Resize the iframes when the window is resized
1748	$(window).on('resize orientationchange', function() {
1749		
1750		$dibiframes.each( function() {
1751			// Get the parent container's width
1752			var width = $( this ).parent().width();
1753			$( this ).width( width )
1754			.height( width * $( this ).data( "ratio" ) );
1755		});
1756		
1757		
1758	  
1759	});
1760	
1761	$(window).load(function() {
1762		
1763		// Divi Cascade Fix
1764		if ( $('#et-builder-module-design-cached-inline-styles').length && !$('#cloned-et-builder-module-design-cached-inline-styles').length ) {
1765			
1766			// Divi Cached Inline Styles
1767			var divicachedcss = $( '#et-builder-module-design-cached-inline-styles' );
1768			var divicachedcsscontent = divicachedcss.html();
1769			
1770			// Remove #page-container from Divi Cached Inline Styles tag and cloning it to prevent issues
1771			divicachedcsscontent = divicachedcsscontent.replace(/\#page-container/g, ' ');
1772			
1773			$( divicachedcss ).after( '<style id="cloned-et-builder-module-design-cached-inline-styles">' + divicachedcsscontent + '</style>' );
1774		}
1775		
1776		$('body').prepend( $( "#sidebar-divibar" ) );
1777		
1778		setTimeout(function() {
1779			
1780			$('#sidebar-divibar .divibars').mainDiviBars();
1781			
1782		}, 1);
1783	});
1784	
1785})( jQuery, window, document );

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.