PageSourceSearch

https://www.madpaws.com.au/wp-content/themes/soledad-child/js/main.js?ver=6.5.3

js madpaws.com.au collected 2026-09-24 18:10:38 UTC 4,832 bytes, 161 lines download raw bytes

1// Penci Slider allowOneSlide: true
2jQuery(document).ready(function($) {
3	$('.navbar-toggle').click(function() {
4		if ( $($(this).data('target')).hasClass($(this).data('toggle')) ) {
5			$($(this).data('target')).removeClass($(this).data('toggle'))
6		} else {
7			$($(this).data('target')).addClass($(this).data('toggle'))
8		}
9	});
10
11	// Mobile navbar
12	if ( $('#additional-navbar .visible-xs ul').size() > 0 ) {
13		var clonedMenu = $('#additional-navbar .visible-xs ul').clone();
14		$(clonedMenu).find('li > a').each(function(){ if ($(this).html() == 'Find a Sitter') $(this).parent().remove() });
15		var htmlItem = '<li id="menu-item-6666" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-has-children menu-item-6666"><a href="' + window.location.origin + '/about/">About Mad Paws<u class="indicator"><i class="fa fa-angle-down"></i></u></a><ul class="sub-menu">' + clonedMenu.html() + '</ul></li>'
16		$('nav#sidebar-nav #menu-menu-1').append(htmlItem);
17	}
18
19	// css variable --your width for padding calc
20	var width = window.screen.width;
21	width = width + 'px';
22	document.documentElement.style.setProperty('--your-width', width);
23
24	$(window).resize(function (){
25		var width = window.screen.width;
26		width = width + 'px';
27		document.documentElement.style.setProperty('--your-width', width);
28	});
29
30	// WPM PENCI OBJECT allowOneSlide: true
31	'use strict';
32	var WPM_PENCI = {};
33
34	/* Penci Slider
35	 ---------------------------------------------------------------*/
36	WPM_PENCI.flexslider = function () {
37		$('.wpm-featured-area').imagesLoaded( function() {
38			/* Load all slider */
39			$( '.wpm-featured-area .wpm-penci-magazine-slider' ).each( function () {
40				var $this = $( this ),
41					$smooth = false,
42					$control = false,
43					$dir = true;
44				if ( $this.attr( 'data-smooth' ) ) { $smooth = true; }
45				if ( $this.attr( 'data-control' ) ) { $control = true; }
46				if ( $this.attr( 'data-dir' ) ) { $dir = false; }
47
48				$this.flexslider( {
49					allowOneSlide: true,
50					namespace     : "penci-",
51					animation     : 'slide',
52					slideshow     : $this.data( 'auto' ),
53					slideshowSpeed: $this.data( 'autotime' ),
54					animationSpeed: $this.data( 'speed' ),
55					smoothHeight  : $smooth,
56					controlNav    : $control,
57					directionNav  : $dir,
58					pauseOnHover  : true,
59					prevText      : '<i class="fa fa-angle-left"></i>',
60					nextText      : '<i class="fa fa-angle-right"></i>',
61					start         : function ( slider ) {
62						$this.parent().addClass( 'loaded' );
63						WPM_PENCI.fixtop();
64						$this.parent().addClass( 'loaded-wait' );
65					}
66				} );
67			} );
68		} );
69	}
70
71	/* Fix top penci slider
72	 ---------------------------------------------------------------*/
73	WPM_PENCI.fixtop = function () {
74		$('.penci-slider .pencislider-container' ).each( function(){
75			var $this = $(this ),
76				parent_slider = $this.closest('.penci-slider' ),
77				this_height = $this.height(),
78				parent_height = $this.parent().height();
79			if( parent_slider.hasClass('fixed-height') ){
80				parent_height = parent_slider.height();
81			}
82			var top_this = ( parent_height - this_height )/2;
83			$this.css( "top", top_this + 'px' );
84		} );
85	}
86
87	WPM_PENCI.flexslider();
88	$(window ).resize( function(){ WPM_PENCI.fixtop(); } );
89
90	function commentFormValidation() {
91		var $form = $('#commentform');
92
93		if( !$form.length ) {
94			return;
95		}
96
97		var $submit  = $form.find('#submit');
98		var $inputs  = $form.find('textarea, input');
99		var errorMsg = 'This field is required';
100
101		$submit.click( function(e) {
102			var invalidate = false;
103			clearErrorMessages();
104
105			$inputs.each( function( index, input ) {
106				if( !validateCommentInput( $(input) ) ) {
107					invalidate = true;
108				}
109			} );
110
111			if( invalidate ) {
112				e.preventDefault();
113			}
114		});
115
116		function validateCommentInput($input) {
117			if( $input.attr('aria-required') !== 'true' ) {
118				return true;
119			}
120			if( $input.val().length > 0 ) {
121				return true;
122			}
123
124			$input.css('border-color', 'red');
125			$input.before('<span class="comment-error-msg">' + errorMsg +'</span>');
126
127			return false;
128		}
129
130		function clearErrorMessages() {
131			$inputs.removeAttr('style');
132			$form.find('.comment-error-msg').remove();
133		}
134	}
135	commentFormValidation();
136
137
138	$('.fca_eoi_form_button_element').click( function() {
139		setTimeout( function () {
140			$('.tooltipster-base').css('display', 'none');
141			$('.fca_eoi_form_input_element').val('');
142		}, 10000 );
143		$(window).on( 'scroll', function(event){
144			var that = this;
145			$('.tooltipster-base').css('display', 'none');
146			$('.fca_eoi_form_input_element').val('');
147			setTimeout( function () {
148				$(that).off(event);
149			}, 10000 );
150		});
151
152	});
153
154	/*fix search*/
155	$('#top-search a.search-click').on('click', function() {
156		$('.show-search').fadeToggle();
157		$('.show-search input.search-input').focus();
158	});
159
160
161}); /* document.ready end */

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.