PageSourceSearch

https://panonika.ba/wp-content/themes/panonika/framework/js/public/custom.js?ver=4.9.26

js panonika.ba collected 2026-10-02 13:53:09 UTC 14,122 bytes, 474 lines download raw bytes

1jQuery.noConflict();
2jQuery(document).ready(function($){
3
4	"use strict";
5	if( mytheme_urls.loadingbar === "enable") {
6		Pace.on("done", function(){
7			$(".cover").fadeOut(500);
8			$(".pace").remove();
9		});
10	}
11
12	var isMobile = (navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) || (navigator.userAgent.match(/iPad/i)) || (navigator.userAgent.match(/Android/i)) || (navigator.userAgent.match(/Blackberry/i)) || (navigator.userAgent.match(/Windows Phone/i)) ? true : false;
13	var $px, currentWidth;
14
15	//Menu Start
16	megaMenu();
17	function megaMenu() {
18		var screenWidth = $(document).width(),
19		containerWidth = $("#header .container").width(),
20		containerMinuScreen = (screenWidth - containerWidth)/2;
21		if( containerWidth == screenWidth ){
22
23			$px = 45;
24			
25			$("li.menu-item-megamenu-parent .megamenu-child-container").each(function(){
26
27				var ParentLeftPosition = $(this).parent("li.menu-item-megamenu-parent").offset().left,
28				MegaMenuChildContainerWidth = $(this).width();
29
30				if( (ParentLeftPosition + MegaMenuChildContainerWidth) > screenWidth ){
31					var SwMinuOffset = screenWidth - ParentLeftPosition;
32					var marginFromLeft = MegaMenuChildContainerWidth - SwMinuOffset;
33					var marginFromLeftActual = (marginFromLeft) + $px;
34					var marginLeftFromScreen = "-"+marginFromLeftActual+"px";
35					$(this).css('left',marginLeftFromScreen);
36				}
37
38			});
39		} else {
40		
41			$px = 40;
42
43			$("li.menu-item-megamenu-parent .megamenu-child-container").each(function(){
44				var ParentLeftPosition = $(this).parent("li.menu-item-megamenu-parent").offset().left,
45				MegaMenuChildContainerWidth = $(this).width();
46
47				if( (ParentLeftPosition + MegaMenuChildContainerWidth) > containerWidth ){
48					var marginFromLeft = ( ParentLeftPosition + MegaMenuChildContainerWidth ) - screenWidth;
49					var marginLeftFromContainer = containerMinuScreen + marginFromLeft + $px;
50
51					if( MegaMenuChildContainerWidth > containerWidth ){
52						var MegaMinuContainer	= ( (MegaMenuChildContainerWidth - containerWidth)/2 ) + 10;
53						var marginLeftFromContainerVal = marginLeftFromContainer - MegaMinuContainer;
54						marginLeftFromContainerVal = "-"+marginLeftFromContainerVal+"px";
55						$(this).css('left',marginLeftFromContainerVal);
56					} else {
57						marginLeftFromContainer = "-"+marginLeftFromContainer+"px";
58						$(this).css('left',marginLeftFromContainer);
59					}
60				}
61
62			});
63		}
64	}
65	
66	//Menu Hover Start
67	function menuHover() {
68		$("li.menu-item-depth-0,li.menu-item-simple-parent ul li" ).hover(
69			function(){
70				if( $(this).find(".megamenu-child-container").length  ){
71					$(this).find(".megamenu-child-container").stop().fadeIn('fast');
72				} else {
73					$(this).find("> ul.sub-menu").stop().fadeIn('fast');
74				}
75			},
76			function(){
77				if( $(this).find(".megamenu-child-container").length ){
78					$(this).find(".megamenu-child-container").stop(true, true).hide();
79				} else {
80					$(this).find('> ul.sub-menu').stop(true, true).hide(); 
81				}
82			}
83		);
84	}//Menu Hover End
85
86	//OnePage Navigation
87	if( $(".onepage_menu").length) {
88	    $('.onepage_menu').onePageNav({
89			currentClass: 'current_page_item',
90    	    filter: ':not(.external)',
91	        scrollSpeed: 750,
92    	    scrollOffset: 90
93	    });
94	}
95	
96	//Sticky Navigation
97	if( navigator.platform.match(/(Mac|iPhone|iPod|iPad)/i) || 
98		navigator.userAgent.match(/Android/i)||
99		navigator.userAgent.match(/webOS/i) || 
100		navigator.userAgent.match(/iPhone/i) || 
101		navigator.userAgent.match(/iPod/i)) {
102			if( mytheme_urls.stickynav === "enable") {
103				$("#header-wrapper").sticky({ topSpacing: 0 });
104			}
105	} else {
106		if( mytheme_urls.stickynav === "enable") {
107			$("#header-wrapper").sticky({ topSpacing: 0 });
108		}
109	}	
110	//Sticky Navigation End
111	
112	//Mobile Menu
113	$("#dt-menu-toggle").click(function( event ){
114		event.preventDefault();
115		var $menu = $("nav#main-menu").find("ul.menu:first");
116		$menu.slideToggle(function(){
117			$menu.css('overflow' , 'visible');
118			$menu.toggleClass('menu-toggle-open');
119		});
120	});
121
122	$(".dt-menu-expand").click(function(){
123		if( $(this).hasClass("dt-mean-clicked") ){
124			$(this).text("+");
125			if( $(this).prev('ul').length ) {
126				$(this).prev('ul').slideUp(300);
127			} else {
128				$(this).prev('.megamenu-child-container').find('ul:first').slideUp(300);
129			}
130		} else {
131			$(this).text("-");
132			if( $(this).prev('ul').length ) {
133				$(this).prev('ul').slideDown(300);
134			} else{
135				$(this).prev('.megamenu-child-container').find('ul:first').slideDown(300);
136			}
137		}
138		
139		$(this).toggleClass("dt-mean-clicked");
140		return false;
141	});
142
143	if( !isMobile ){
144		currentWidth = window.innerWidth || document.documentElement.clientWidth;
145		if( currentWidth > 767 ){
146			menuHover();
147		}
148	}
149	//Mobile Menu End
150//Menu End
151	
152	//NICE SCROLL...
153	$("html").niceScroll({ zindex: 999999, cursorborder: "1px solid #424242" });
154	
155	//TEXTBOX CLEAR...
156	$('input.Textbox, textarea.Textbox').focus(function() {
157      if (this.value === this.title) {
158        $(this).val("");
159      }}).blur(function() {
160      if (this.value === "") {
161        $(this).val(this.title);
162      }
163    });
164	
165	//UI TO TOP PLUGIN...
166	$().UItoTop({ easingType: 'easeOutQuart' });
167	
168	//Portfolio Tooltip...
169	if($(".portfolio .fig-overlay a.likeThis").length){
170		$(".portfolio .fig-overlay a.likeThis").each(function(){
171			$(this).tooltipster({
172                content: $(this).html()
173			});
174		});
175	}
176	
177	$("select").each(function(){
178		if($(this).css('display') != 'none') {
179			$(this).wrap( '<div class="selection-box"></div>' );
180		}
181	});
182	
183	//DONUT CHART...
184	$('.donutChart').each(function(){
185		$(this).one('inview', function (event, visible) {
186			if(visible === true) {
187				var bgcolor, fgcolor = "";
188				
189				if($(this).attr('data-bgcolor') !== "") bgcolor = $(this).attr('data-bgcolor'); else bgcolor = '#f5f5f5';
190				if($(this).attr('data-fgcolor') !== "") fgcolor = $(this).attr('data-fgcolor'); else fgcolor = '#E74D3C';
191				
192				$(this).donutchart({'size': 140, 'donutwidth': 10, 'fgColor': fgcolor, 'bgColor': bgcolor, 'textsize': 45 });
193				$(this).donutchart('animate');
194			}
195		});
196	});
197	
198	//All Query Block...
199	$(window).load(function(){
200		dt_smartresize_block();
201		
202		if($(".carousel_items").length) {
203			$(".carousel_items .dt_carousel").each(function(){
204			  $(this).carouFredSel({
205				responsive: true,
206				auto: false,
207				width: '100%',
208				prev: $(this).next('.carousel-arrows').find('.prev-arrow'),
209				next: $(this).next('.carousel-arrows').find('.next-arrow'),
210				height: 'auto',
211				scroll: 1,
212				items: { width: $(this).find('.column').width(),  visible: { min: 1, max: parseInt($(this).attr('data-items')) } }
213			  });
214			});
215		}
216	});
217	$(window).smartresize(function(){
218		
219		megaMenu();
220		
221		//Mobile Menu
222		currentWidth = window.innerWidth || document.documentElement.clientWidth;
223		if( !isMobile && (currentWidth > 767)  ){
224			menuHover();
225		}
226		
227		dt_smartresize_block();
228	});
229
230    //PrettyPhoto...
231    var $pphoto = $('a[data-gal^="prettyPhoto[gallery]"]');
232    if ($pphoto.length) {
233        //PRETTYPHOTO...
234        $("a[data-gal^='prettyPhoto[gallery]']").prettyPhoto({
235			hook:'data-gal',
236            show_title: false,
237            social_tools: false,
238            deeplinking: false
239        });
240    }
241	
242    //Gallery CarouFredSel...
243	if( ($(".gallery-bx-wrapper").length) && ($(".gallery-bx-wrapper li").length > 1) ) {
244		$('.gallery-bx-wrapper').bxSlider({ auto:false, video:true, useCSS:false, pager:'', autoHover:true, adaptiveHeight:true });
245	}
246	
247	//Fitvids...
248	$("div.dt-video-wrap").fitVids();
249	$('.wp-video').css('width', '100%');
250	
251	//Gallery Blog Slider...
252    if( ($("ul.entry-gallery-post-slider").length) && ( $("ul.entry-gallery-post-slider li").length > 1 ) ){
253     $("ul.entry-gallery-post-slider").bxSlider({ auto:false, video:true, useCSS:false, autoHover:true, adaptiveHeight:true, pagerCustom: '#entry-gallery-pager' });
254    }
255	
256	//Parallax Sections...
257	$('.dt-sc-parallax-section').bind('inview', function (event, visible) {
258		if(visible === true) {
259			$(this).parallax("50%", 0.5);
260		} else {
261			$(this).css('background-position', '');
262		}
263	});
264	
265	//Animate Number...
266	$('.dt-sc-num-count').each(function(){
267	  $(this).one('inview', function (event, visible) {
268		  if(visible === true) {
269			  var val = $(this).attr('data-value');
270			  $(this).animateNumber({ number: val	}, 2000);
271		  }
272	  });
273	});
274	
275	//Ajax Load Gallery Items...
276	var $page = 0;
277	var $data = "", $el = $('#ajax_load_gallery_container'), $content = $('.dt-sc-portfolio-container', $el);
278	
279	$('#ajax_load_gallery').click(function(){
280
281      var $noPosts = $(this).attr('data-per-page');
282	  var $tax = $(this).attr('data-taxonomy');
283	  var $liClass = $(this).attr('data-li-class');
284	  
285	  $(this).addClass('loading');
286	  $page++;
287	  
288	  //Perform ajax loads...
289      $.ajax({
290         type : "post",
291         dataType : "html",
292         url : mytheme_urls.ajaxurl,
293         data : { action: "dt_ajax_load_gallery_posts", numPosts : $noPosts, tax : $tax, pageNumber: $page, liClass: $liClass },
294         success: function (data) {
295			$data = $(data);
296			if ($data.length > 0) {
297                $content.append($data);
298				$('.dt-sc-portfolio-container').isotope( 'reloadItems' ).isotope();
299				$(window).trigger( 'resize' );				
300				
301				$("a[data-gal^='prettyPhoto[gallery]']").prettyPhoto({
302					show_title: false,
303					social_tools: false,
304					deeplinking: false
305				});
306				$(".portfolio .fig-overlay a.likeThis").each(function(){
307					$(this).tooltipster({
308						content: $(this).html()
309					});
310				});
311			} else {
312				$('#ajax_load_gallery').html('<span></span>No More Posts to Show');
313				$('#ajax_load_gallery').attr('disabled', 'disabled');
314			}
315			$('#ajax_load_gallery').removeClass('loading');
316         },
317		 error: function (jqXHR, textStatus, errorThrown) {
318			$('#ajax_load_gallery').html('<span></span>No More Posts to Show');
319		 }
320      });
321	  return false;
322	});
323	
324	//Rating Script...
325	$("#dt-rating").hide().before('<p class="stars"><span><a class="star-1" href="#">1</a><a class="star-2" href="#">2</a><a class="star-3" href="#">3</a><a class="star-4" href="#">4</a><a class="star-5" href="#">5</a></span></p>');
326	$("body").on("click", "#commentform p.stars a", function () {
327        var b = $(this),
328            c = $(this).closest("#commentform").find("#dt-rating");
329        return c.val(b.text()), b.siblings("a").removeClass("active"), b.addClass("active"), !1
330    });
331	
332	//Hotel Map...
333	$('.list-hotel-map').each(function(){
334		if($(this).length) {
335			$(this).gMap({
336				address: $(this).attr('data-add'),
337				latitude: $(this).attr('data-lt'),
338				longitude: $(this).attr('data-lg'),
339				zoom: 16,
340				markers: [
341					{ 'address' : $(this).attr('data-add'), 'popup' : true, 'html' : $(this).attr('data-add') }
342				],
343				scrollwheel: false
344			});
345		}
346	});
347	
348	//Lightbox map...
349	if($(".btn-place-review").length) {
350		$('#respond').wrap('<div id="dt-sc-respond-wrapper" class="hide"></div>');
351		$('.btn-place-review').colorbox({ inline:true, width:"auto" });
352	}
353	
354	//Events overlay insert...
355	$('.tribe-events-event-image').each(function(){
356		$(this).find('a').append('<div class="image-overlay"><span class="image-overlay-inside"></span></div>');
357	});
358	
359	//Image Map Pointer...
360	if($(".dt-sc-map-tooltip").length){
361		$(".dt-sc-map-tooltip").each(function(){ $(this).tipTip({maxWidth: "auto", defaultPosition: "bottom"}); });
362	}
363	if($(".dt-map-pointer").length) {
364		$(".dt-map-pointer").fancybox({
365			scrolling: 'no',
366			width: 'auto',
367			height: 'auto'
368		});
369	}
370});
371
372// ANUMATE CSS + JQUERY INVIEW CONFIGURATION
373(function ($) {
374    "use strict";
375    $(".animate").each(function () {
376        $(this).bind('inview', function (event, visible) {
377            var $delay = "";
378            var $this = $(this),
379                $animation = ($this.data("animation") !== undefined) ? $this.data("animation") : "slideUp";
380            $delay = ($this.data("delay") !== undefined) ? $this.data("delay") : 300;
381
382            if (visible === true) {
383                setTimeout(function () {
384                    $this.addClass($animation);
385                }, $delay);
386            } else {
387                setTimeout(function () {
388                    $this.removeClass($animation);
389                }, $delay);
390            }
391        });
392    });
393})(jQuery);
394
395//Responsive Purpose...
396function dt_smartresize_block() {
397	"use strict";
398	
399	var $container = jQuery('.dt-sc-portfolio-container');
400	var $gw;
401
402	if (jQuery('.dt-sc-portfolio-container .portfolio').hasClass('no-space')) { $gw = 0; }
403
404	jQuery('.dt-sc-sorting-container a').click(function () {
405		jQuery('.dt-sc-sorting-container').find('a').removeClass('active-sort');
406		jQuery(this).addClass('active-sort');
407
408		var selector = jQuery(this).attr('data-filter');
409		$container.isotope({
410			filter: selector,
411			animationOptions: {
412				duration: 750,
413				easing: 'linear',
414				queue: false
415			},
416			itemSelector: '.dt-sc-portfolio-container .portfolio',
417			masonry: {
418				gutterWidth: 0					
419			}
420		});
421		return false;
422	});
423
424	jQuery('.dt-sc-entry-sorting a').click(function () {
425		jQuery('.dt-sc-entry-sorting').find('a').removeClass('active_sort');
426		jQuery(this).addClass('active_sort');
427
428		var selector = jQuery(this).attr('data-filter');
429		jQuery('.dt-sc-hotels-container').isotope({
430			filter: selector,
431			animationOptions: {
432				duration: 750,
433				easing: 'linear',
434				queue: false
435			},
436			itemSelector: '.dt-sc-hotels-container .column',
437			masonry: {
438				gutterWidth: 0
439			}
440		});
441		return false;
442	});	
443	
444	if ($container.length) {
445		$container.isotope({
446			filter: '*',
447			itemSelector: '.dt-sc-portfolio-container .portfolio',
448			masonry: {
449				gutterWidth: 0
450			}
451		});
452	}
453	
454	if( jQuery(".blog-isotope-wrapper").length ){
455		$gw = 20; if(jQuery(".container").width() == 710) { $gw = 15; }
456		jQuery(".blog-isotope-wrapper").isotope({
457			itemSelector : '.column',
458			transformsEnabled: false,
459			masonry: {
460				gutterWidth: $gw
461			}
462		});
463	}
464	
465	if( jQuery('.dt-sc-hotels-container').length ) {
466		jQuery('.dt-sc-hotels-container').isotope({
467			filter: '*',
468			itemSelector : '.dt-sc-hotels-container .dt-sc-one-column',
469			masonry: {
470				gutterWidth: 0
471			}
472		});
473	}
474}

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.