PageSourceSearch

https://resthill.co.za/wp-content/plugins/designthemes-core-features/shortcodes/js/shortcodes.js?ver=7.1.2

js resthill.co.za collected 2026-09-29 15:36:04 UTC 15,122 bytes, 508 lines download raw bytes

1jQuery(document).ready(function($) {
2	"use strict";
3	/* animate number */
4	$('.dt-sc-counter').each(function(){
5
6	  var $posttext = $(this).find('.dt-sc-counter-number').attr('data-append');
7	  var $append = ''; 
8
9	  if (typeof $posttext === "undefined") {
10		  $append = $.animateNumber.numberStepFactories.append('');
11	  } else {
12		  $append = $.animateNumber.numberStepFactories.append($posttext);
13	  }
14
15	  $(this).one('inview', function (event, visible) {
16		  if(visible === true) {
17			  var val = $(this).find('.dt-sc-counter-number').attr('data-value');
18			  $(this).find('.dt-sc-counter-number').animateNumber({ number: val, numberStep: $append }, 2000);
19		  }
20	  });
21	});
22
23	/* accordion & toggle */
24	$('.dt-sc-toggle').toggleClick(function(){ $(this).addClass('active'); },function(){ $(this).removeClass('active'); });
25	$('.dt-sc-toggle').on('click',function(){ $(this).next('.dt-sc-toggle-content').slideToggle(); });
26	
27	$('.dt-sc-toggle-frame-set').each(function(){
28		var $this = $(this),
29		    $toggle = $this.find('.dt-sc-toggle-accordion');
30			
31			$toggle.on('click',function(){
32				if( $(this).next().is(':hidden') ) {
33					$this.find('.dt-sc-toggle-accordion').removeClass('active').next().slideUp();
34					$(this).toggleClass('active').next().slideDown();
35				}
36				return false;
37			});
38
39			// activate first item always
40			$this.find('.dt-sc-toggle-accordion:first').addClass("active");
41			$this.find('.dt-sc-toggle-accordion:first').next().slideDown();
42  	});
43
44	/* tooltip */
45	if($(".dt-sc-tooltip-bottom").length){
46	   $(".dt-sc-tooltip-bottom").each(function(){	$(this).tipTip({maxWidth: "auto"}); });
47	}
48	
49	if($(".dt-sc-tooltip-top").length){
50	   $(".dt-sc-tooltip-top").each(function(){ $(this).tipTip({maxWidth: "auto",defaultPosition: "top"}); });
51	}
52	
53	if($(".dt-sc-tooltip-left").length){
54	   $(".dt-sc-tooltip-left").each(function(){ $(this).tipTip({maxWidth: "auto",defaultPosition: "left"}); });
55	}
56	
57	if($(".dt-sc-tooltip-right").length){
58	   $(".dt-sc-tooltip-right").each(function(){ $(this).tipTip({maxWidth: "auto",defaultPosition: "right"}); });
59	}
60
61	/* horizontal tabs */
62	if($('ul.dt-sc-tabs-horizontal').length > 0){
63		$('ul.dt-sc-tabs-horizontal').each(function(){
64
65			var $effect = $(this).parent('.dt-sc-tabs-horizontal-container').attr('data-effect');
66			$(this).fpTabs('> .dt-sc-tabs-horizontal-content', {
67				effect: $effect
68			});
69		});
70	}
71	if($('ul.dt-sc-tabs-horizontal-frame').length > 0){
72		$('ul.dt-sc-tabs-horizontal-frame').each(function(){
73
74			var $effect = $(this).parent('.dt-sc-tabs-horizontal-frame-container').attr('data-effect');
75			$(this).fpTabs('> .dt-sc-tabs-horizontal-frame-content', {
76				effect: $effect
77			});
78		});
79	}
80
81	/* vertical tabs */
82	if($('ul.dt-sc-tabs-vertical').length > 0){
83		$('ul.dt-sc-tabs-vertical').each(function(){
84
85			var $effect = $(this).parent('.dt-sc-tabs-vertical-container').attr('data-effect');
86			$(this).fpTabs('> .dt-sc-tabs-vertical-content', {
87				effect: $effect
88			});
89		});
90
91		$('.dt-sc-tabs-vertical').each(function(){
92			$(this).find("li:first").addClass('first').addClass('current');
93			$(this).find("li:last").addClass('last');
94		});
95
96		$('.dt-sc-tabs-vertical li').on('click',function(){
97			$(this).parent().children().removeClass('current');
98			$(this).addClass('current');
99		});
100	}
101	if($('ul.dt-sc-tabs-vertical-frame').length > 0){
102		$('ul.dt-sc-tabs-vertical-frame').each(function(){
103
104			var $effect = $(this).parent('.dt-sc-tabs-vertical-frame-container').attr('data-effect');
105			$(this).fpTabs('> .dt-sc-tabs-vertical-frame-content', {
106				effect: $effect
107			});
108		});
109
110		$('.dt-sc-tabs-vertical-frame').each(function(){
111			$(this).find("li:first").addClass('first').addClass('current');
112			$(this).find("li:last").addClass('last');
113		});
114
115		$('.dt-sc-tabs-vertical-frame li').on('click',function(){
116			$(this).parent().children().removeClass('current');
117			$(this).addClass('current');
118		});
119	}
120
121	/* ajax mailchimp */
122	$('form[name="frmsubscribe"]').each(function(){
123
124		$(this).submit(function(){
125			var $this = $(this);
126			var $mc_fname = $this.find("input[name='dt_mc_fname']").val(),
127				$mc_email = $this.find("input[name='dt_mc_emailid']").val(),
128				$mc_apikey = $this.find("input[name='dt_mc_apikey']").val(),
129				$mc_listid = $this.find("input[name='dt_mc_listid']").val();
130
131			$.ajax({
132				type: "post",
133				dataType : "html",
134				url: dttheme_urls.ajaxurl,
135				data:
136				{
137					action: 'dt_theme_mailchimp_subscribe',
138					mc_fname: $mc_fname,
139					mc_email: $mc_email,
140					mc_apikey: $mc_apikey,
141					mc_listid: $mc_listid
142				},
143				success: function (response) {
144					$this.parent().find('.dt_ajax_subscribe_msg').html(response);
145					if (response.match('success') != null){
146				        $this.find("input[name='mc_submit']").attr('disabled', 'disabled');
147				        $this.find("input[name='mc_submit']").addClass('disabled');
148				    }
149				}
150			});
151			return false;
152		});
153    });
154
155    $(window).on('load',function(){
156
157		/* testimonial carousel */
158		if($(".carousel_items").length) {
159			$(".carousel_items .dt-sc-testimonial-carousel").each(function(){
160	
161			  var $prev = $(this).parents(".carousel_items").find(".testimonial-prev");
162			  var $next = $(this).parents(".carousel_items").find(".testimonial-next");
163			  var $anim = $(this).parents(".carousel_items").attr("data-animation");
164	
165			  $(this).carouFredSel({
166				responsive: true,
167				auto: false,
168				width: '100%',
169				prev: $prev,
170				next: $next,
171				height: 'variable',
172				scroll: { easing: "linear", duration: 500, fx : $anim },
173				items: { width: 1170, height: 'variable',  visible: { min: 1, max: 1 } },
174				swipe: {
175					onMouse: true,
176					onTouch: true
177				}
178			  });
179			});
180		}
181		
182		/* partners carousel */
183		if($(".dt-sc-partners-carousel").length) {
184			$(".dt-sc-partners-carousel").each(function(){
185
186				var $prev = $(this).parents(".dt-sc-partners-carousel-wrapper").find(".partners-prev");
187				var $next = $(this).parents(".dt-sc-partners-carousel-wrapper").find(".partners-next");
188				var $scroll = $(this).parents(".dt-sc-partners-carousel-wrapper").attr('data-scroll');
189				var $visible = $(this).parents(".dt-sc-partners-carousel-wrapper").attr('data-visible');
190				
191				$(this).carouFredSel({
192					responsive: true,
193					auto: false,
194					width: '100%',
195					height: 'variable',
196					prev: $prev,
197					next: $next,
198					scroll: parseInt($scroll), // The number of items to scroll at once
199					items: {
200						visible:{
201							min: 1,
202							max: parseInt($visible) // The number of items to show at once
203						}
204					},
205					swipe: {
206						onMouse: true,
207						onTouch: true
208					}
209				});
210			});
211		}
212
213		/* images carousel */
214		if($(".dt-sc-images-carousel").length) {
215			$(".dt-sc-images-carousel").each(function(){
216
217				var $prev = $(this).parents(".dt-sc-images-wrapper").find(".images-prev");
218				var $next = $(this).parents(".dt-sc-images-wrapper").find(".images-next");
219
220				$(this).carouFredSel({
221					responsive: true,
222					auto: false,
223					width: '100%',
224					height: 'variable',
225					prev: $prev,
226					next: $next,
227					scroll: 1,
228					items: {
229						width:570,
230						height: 'variable',
231						visible: { min: 1, max: 1 }
232					},
233					swipe: {
234						onMouse: true,
235						onTouch: true
236					}
237				});
238			});
239		}
240	
241		/* twitter carousel */
242		if($('.dt-sc-twitter-carousel-wrapper').length > 0) {
243			$('.dt-sc-twitter-carousel-wrapper .dt-sc-twitter-carousel').carouFredSel({
244				width: 'auto',
245				height: 'auto',
246				scroll: 1,
247				direction: 'up',
248				items: {
249					height: 'auto',
250					visible: { min: 1, max: 1 }
251				}
252			});
253		}
254
255		/* special testimonials */
256		if($('.dt-sc-testimonial-special-wrapper').length > 0) {
257			$('.dt-sc-testimonial-special-wrapper .dt-sc-testimonial-special').carouFredSel({
258				responsive: true,
259				auto: false,
260				width: '100%',
261				pagination: {
262					container: ".dt-sc-testimonial-images",
263					anchorBuilder: false
264				},
265				height: 'auto',
266				scroll: { fx: "crossfade" },
267				items: { visible: { min: 1, max: 1 } }
268			});
269		}
270
271		/* donutchart */
272		$(".dt-sc-donutchart").each(function(){
273			var $this = $(this);
274			var $bgColor =  ( $this.data("bgcolor") !== undefined ) ? $this.data("bgcolor") : "#5D18D6";
275			var $fgColor =  ( $this.data("fgcolor") !== undefined ) ? $this.data("fgcolor") : "#000000";
276			var $size = ( $this.data("size") !== undefined ) ? $this.data("size") : "100";
277		 
278			$this.donutchart({'size': $size, 'fgColor': $fgColor, 'bgColor': $bgColor , 'donutwidth' : 5 });
279			$this.donutchart('animate');
280		});
281
282		//Carousel Items...
283		if($(".carousel_items").length) {
284			$(".carousel_items .dt_carousel").each(function(){
285
286			  var $min = parseInt($(this).attr('data-visible'));
287			  var $scroll = parseInt($(this).attr('data-scroll'));
288			  var $auto = false;
289			  if($(this).attr('data-auto') == 'true') {
290				  $auto = true;
291			  }
292			  var $animation = $(this).attr('data-animation');
293
294			  if($(window).width() <= 767) { $min = 1; }
295
296			  var prv = $(this).parent('.carousel_items').find('.prev-arrow'); var nxt = $(this).parent('.carousel_items').find('.next-arrow');
297			  var pager = $(this).parent('.carousel_items').find('.dt-carousel-pagination');
298
299			  $(this).carouFredSel({
300				responsive: true,
301				auto: $auto,
302				width: '100%',
303				prev: prv,
304				next: nxt,
305				pagination: pager,
306				height: 'variable',
307				scroll: { items: $scroll, fx: $animation },
308				items: { width: parseInt( 1170 / $min ),  height: 'variable', visible: { min: $min } },
309				onCreate: function () {
310					$(window).on("resize", function() {
311						$(this).trigger('configuration', ['debug', false, true]);
312					}).trigger('resize');
313				},
314				swipe: {
315					onMouse: true,
316					onTouch: true
317				}
318			  });
319			});
320		}
321
322		$('.dt-sc-special-testimonial').each( function() {
323
324			$(this).find('.testimonial-details-for').slick({
325				slidesToShow: 1,
326				slidesToScroll: 1,
327				arrows: false,
328				fade: true,
329				asNavFor: '.testimonial-details-nav'
330			});
331	
332			var dots = $(this).find('.testimonial-details-nav').attr('data-dots');
333			if(dots == undefined) {
334				dots = false;
335			}
336			dots = Boolean(dots);
337	
338			var itemstoshow = $(this).find('.testimonial-details-nav').attr('data-itemstoshow');
339			if(itemstoshow == undefined) {
340				itemstoshow = 5;
341			}
342	
343			itemstoshow = parseInt(itemstoshow, 10);
344	
345			$(this).find('.testimonial-details-nav').slick({
346				slidesToShow: itemstoshow,
347				slidesToScroll: 1,
348				asNavFor: '.testimonial-details-for',
349				dots: dots,
350				centerMode: true,
351				focusOnSelect: true,
352				responsive: [
353				  {
354					breakpoint: 992,
355					settings: {
356					  slidesToShow: 5,
357					  slidesToScroll: 5,
358					  dots: dots,
359					}
360				  },
361				  {
362					breakpoint: 768,
363					settings: {
364					  slidesToShow: 3,
365					  slidesToScroll: 3
366					}
367				  },
368				  {
369					breakpoint: 480,
370					settings: {
371					  slidesToShow: 1,
372					  slidesToScroll: 1
373					}
374				  }
375				]
376			});
377		});
378	});
379
380	/* parallax section */
381	if($(".dt-sc-parallax-section").length) {
382		$('.dt-sc-parallax-section').each(function(){
383			$(this).on('inview', function (event, visible) {
384				if(visible === true) {
385					$(this).parallax("50%", 0.5);
386				} else {
387					$(this).css('background-position', '');
388				}
389			});
390		});
391	}
392
393	/* video manager */
394	if($(".dt-sc-video-wrapper").length) {
395		
396		if($(".dt-sc-video-item").length) {
397			
398			$(".dt-sc-video-item").each(function(){
399				$(this).on('click',function(){
400					$('.video-overlay-inner a').attr('href', $(this).attr('data-link'));
401					$('.dt-sc-video-wrapper img').attr('src', $(this).find('.dt-sc-vitem-thumb img').attr('data-full'));
402					$('.video-overlay-inner h2').html($(this).find('h2').html());
403					$('.video-overlay-inner p').html($(this).find('p').html());
404					$(this).parent('div').children().removeClass('active');
405					$(this).addClass('active');
406				});
407			});
408		}
409		
410		$(".video-overlay-inner a").prettyPhoto({animation_speed:'normal',theme:'light_square',slideshow:3000, autoplay_slideshow: false,social_tools: false,deeplinking:false});
411		var video_scroll = $(".dt-sc-video-manager-right").niceScroll({ cursorcolor:"#ffffff", cursorwidth: "2px"});
412		video_scroll.rail.addClass('dt-sc-skin');
413	}
414
415	/* Load More Button */
416	$('.dt-sc-infinite-portfolio-load-more').each(function(){
417
418		var $this = $(this),
419			$x = $(this).prev('.dt-sc-infinite-portfolio-container').data('paged'),
420			$xstyle = $(this).data('style');
421
422		if(  $xstyle == 'lazy' ) {
423			$(window).scroll(function(){
424				if($(window).scrollTop() == $(document).height() - $(window).height()){
425
426					var $per_page = $this.data('per-page'),
427						$term = $this.data('term'),
428						$style = $this.data('style'),
429						$paged = $x,
430						$prev = $this.prev();
431
432					$x++;
433
434					$.ajax({
435						type : "post",
436						dataType : "html",
437						url : dttheme_urls.ajaxurl,
438						data : { action: "dt_ajax_infinite_portfolios", per_page : $per_page, term : $term, style: $style , paged: $paged },
439						success: function (data) {
440							if (data.length > 0) {
441								$prev.append( data );
442							} else {
443								$prev.find(".message").removeClass("hidden");
444								//$this.addClass('hidden');
445
446								setTimeout(function(){
447									$prev.find(".message").addClass('hidden');
448									$this.addClass('disable');									
449								}, 5000);								
450							}
451						},
452						error: function (jqXHR, textStatus, errorThrown) {
453						}
454					});				
455				}
456			});
457		} else if( $xstyle == 'load-more') {
458
459			$this.on('click',function(e){
460
461				e.preventDefault();
462
463				var $per_page = $(this).data('per-page'),
464					$term = $(this).data('term'),
465					$style = $(this).data('style'),
466					$paged = $x,
467					$prev = $(this).prev();
468
469				$x++;
470
471				$.ajax({
472					type : "post",
473					dataType : "html",
474					url : dttheme_urls.ajaxurl,
475					data : { action: "dt_ajax_infinite_portfolios", per_page : $per_page, term : $term, style: $style , paged: $paged },
476					success: function (data) {
477
478						if (data.length > 0) {
479							$prev.append( data );
480						} else {
481							$prev.find(".message").removeClass("hidden");
482							//$this.addClass('hidden');
483
484							setTimeout(function(){
485								$prev.find(".message").addClass('hidden');
486								$this.addClass('disable');
487							}, 5000);
488						}
489					},
490					error: function (jqXHR, textStatus, errorThrown) {
491					}
492				});
493			});
494		}
495	});
496});
497
498/* progress bar */
499(function($){
500	$(".dt-sc-progress").one('inview', function (event, visible) {
501		var $this = $(this),
502		pvalue = $this.find('.dt-sc-bar').attr('data-value');
503		
504		if (visible == true) {
505			$this.find('.dt-sc-bar').animate({width: pvalue + "%"},600,function(){ $this.find('.dt-sc-bar-text').fadeIn(400); });
506		}
507	});
508})(jQuery);

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.