PageSourceSearch

https://ijf.hr/js/script.js

js ijf.hr collected 2026-10-02 03:45:37 UTC 16,693 bytes, 696 lines download raw bytes

1//CMS class
2var CMS = {
3
4	init: function () {
5		this.search();
6		$("HEADER .logo").css({ "cursor": "pointer" }).click(function () { window.location = '/'; });
7
8		//scrollup
9		if ($.fn.scrollUp) {
10			$.scrollUp({
11				scrollName: 'scrollUp', // Element ID
12				scrollDistance: 200, // Distance from top/bottom before showing element (px)
13				scrollFrom: 'top', // 'top' or 'bottom'
14				scrollSpeed: 300, // Speed back to top (ms)
15				easingType: 'linear', // Scroll to top easing (see http://easings.net/)
16				animation: 'fade', // Fade, slide, none
17				animationSpeed: 200, // Animation in speed (ms)
18				scrollTrigger: false, // Set a custom triggering element. Can be an HTML string or jQuery object
19				//scrollTarget: false, // Set a custom target element for scrolling to the top
20				scrollText: '<b>Scroll to top</b>', // Text for element, can contain HTML
21				scrollTitle: false, // Set a custom <a> title if required.
22				scrollImg: false, // Set true to use image
23				activeOverlay: false, // Set CSS color to display scrollUp active point, e.g '#00FFFF'
24				zIndex: 2147483647 // Z-Index for the overlay
25			});
26		}
27
28		//set img.alt to description
29		//$("ARTICLE img").each(function () {
30		//    var $t = $(this);
31		//    var alt = $t.attr("alt");
32		//    if (alt!=undefined) {
33		//        $t.wrap("<div class='slika' style='position:relative;'>");
34		//        $t.after("<div class='potpis-pod-sliku'>" + alt + "</div>");
35		//    }
36		//});
37	},
38
39	doSearch: function (q, $input) {
40		if (q.length > 2) {
41			var qs = "?q=" + encodeURIComponent(q);
42			if (window.location.href.indexOf("/hr") > -1) {
43				window.location.href = "/hr/trazi/" + qs;
44			}
45			else if (window.location.href.indexOf("/en") > -1) {
46				window.location.href = "/en/search/" + qs;
47			} else {
48				window.location.href = "/hr/trazi/" + qs;
49			}
50		} else {
51			alert("Potrebno je upisati više od dva znaka!");
52    }
53	},
54
55	search: function () {
56		$(".search INPUT").keypress(function (e) {
57			if (e.which === 13) {
58				CMS.doSearch($(this).val(), $(this));
59				return false;
60			}
61		});
62
63		$(".search A").click(function (e) {
64			$inp = $(this).parent().find("INPUT").eq(0);
65			CMS.doSearch($inp.val(), $inp);
66            $inp.val('');
67			return false;
68		});
69
70        $(".search A").click(function() {
71					$(".search-field").show("slow");
72          $(".lupa").css("opacity", 0.8);
73
74        });
75
76        $(".close").click(function () {
77					$(".search-field").hide("slow");
78					$(".search-field").find("INPUT").eq(0).val('');
79          $(".lupa").css("opacity", 1);
80        });
81    },
82
83	mobiledesktop: function () {
84
85		/* --Responsive-- */
86		var scrollBreakPoint;
87		var scrolled = false;
88		var submenu = $(".uk-navbar-nav > li").has("ul");
89		var breakpoint = {};
90		breakpoint.refreshValue = function () {
91			this.value = window.getComputedStyle(document.querySelector('body'), ':before').getPropertyValue('content').replace(/'/g, "").replace(/"/g, "");
92		};
93
94		$(window).resize(function () {
95			breakpoint.refreshValue();
96		}).resize();
97		console.log(breakpoint.value);
98		if (breakpoint.value === 'smartphone') {
99		}
100
101		if (breakpoint.value === 'smartphone' || breakpoint.value === 'tablet') {
102
103			submenu.children('a').click(function (e) {
104				e.preventDefault();
105			});
106		}
107
108
109
110	}
111};
112
113
114
115
116$(function () {
117	CMS.init();
118
119	$(".slick-main").slick({
120		arrows: true,
121		dots: true,
122		autoplay: false,
123		//autoplaySpeed: 4000,
124		prevArrow: document.getElementsByClassName('prev'),
125		nextArrow: document.getElementsByClassName('next'),
126		appendDots: '.dots-holder'
127	});
128
129	$(".casopis-slider-carina").slick({
130		arrows: true,
131		dots: true,
132		autoplay: false,
133		// autoplaySpeed: 4000,
134		slidesToShow: 1,
135		slidesToScroll: 1,
136		prevArrow: document.getElementsByClassName('casopis-prev-carina'),
137		nextArrow: document.getElementsByClassName('casopis-next-carina'),
138		appendDots: '.casopis-dots-holder-carina',
139		responsive: [
140			{
141				breakpoint: 768,
142				settings: {
143					slidesToShow: 1,
144					slidesToScroll: 1
145				}
146			}
147		]
148	});
149
150	$(".casopis-slider").slick({
151		arrows: true,
152		dots: true,
153		autoplay: false,
154   // autoplaySpeed: 4000,
155    slidesToShow:1,
156    slidesToScroll:1,
157		prevArrow: document.getElementsByClassName('casopis-prev'),
158		nextArrow: document.getElementsByClassName('casopis-next'),
159		appendDots: '.casopis-dots-holder',
160		responsive: [
161			{
162				breakpoint: 768,
163				settings: {
164					slidesToShow: 1,
165					slidesToScroll: 1
166				}
167			}
168		]
169	});
170
171	$(".books-slider").slick({
172		arrows: true,
173		dots: true,
174		autoplay: false,
175		//autoplaySpeed: 4000,
176		prevArrow: document.getElementsByClassName('book-prev'),
177		nextArrow: document.getElementsByClassName('book-next'),
178		appendDots: '.books-dots-holder'
179	});
180
181	$(".manual-slider").slick({
182		arrows: true,
183		dots: true,
184		autoplay: false,
185		autoplaySpeed: 4000,
186		prevArrow: document.getElementsByClassName('manual-prev'),
187		nextArrow: document.getElementsByClassName('manual-next'),
188		appendDots: '.manual-dots-holder'
189	});
190
191	//var hamburger = {
192	//	navToggle: document.querySelector('.nav-toggle'),
193	//	nav: document.querySelector('nav'),
194
195	//	doToggle: function (e) {
196	//		e.preventDefault();
197	//		this.navToggle.classList.toggle('expanded');
198	//		this.nav.classList.toggle('expanded');
199	//		$("BODY").toggleClass('menu-opened');
200	//	}
201	//};
202
203	//hamburger.navToggle.addEventListener('click', function (e) {
204	//	hamburger.doToggle(e);
205	//});
206
207	//hamburger.nav.addEventListener('click', function (e) {
208	//    if (!$(e.target).closest('a').length) {
209	//        hamburger.doToggle(e);
210	//    }
211	//});
212
213	$(document).keyup(function (e) {
214		if (e.key === "Escape" && $('nav').hasClass('expanded')) { // escape key maps to keycode `27`
215			$('nav').removeClass('expanded');
216			$('.nav-toggle').removeClass('expanded');
217		}
218	});
219
220	//	if (jQuery().colorbox) {
221	//		$(".colorbox").colorbox();
222	//	}
223
224	//TABLICA
225	//$("#wrap .main-column .inner TABLE TR:odd").addClass("odd");
226
227	//TABOVI
228	//$('#tab-container').easytabs(
229	//	{ "animate": false }
230	//);
231
232	//if (jQuery().bxSlider) {
233	//    $('.slider').bxSlider({
234	//        slideWidth: 750,
235	//        minSlides: 1,
236	//        maxSlides: 1,
237	//        slideMargin: 10,
238	//        controls: false,
239	//        moveSlides: 1,
240	//        auto: true
241	//    });
242	//}
243
244
245	var footerHeight = $("footer").outerHeight();
246	$(window).scroll(function () {
247		if ($(window).scrollTop() + $(window).height() > $(document).height() - footerHeight) {
248			$("#scrollUp").css("height", "0");
249		} else {
250			$("#scrollUp").css("height", "40px");
251		}
252	});
253
254	//google maps
255	$(".google-map").each(function () {
256		var $t = $(this);
257		var pos = new google.maps.LatLng($t.attr("data-lat"), $t.attr("data-long"));
258		var data = $t.html();
259
260		var mapOptions = {
261			zoom: 16,
262			disableDefaultUI: true,
263			center: pos,
264			mapTypeId: google.maps.MapTypeId.ROADMAP,
265			panControl: false,
266			streetViewControl: true
267		};
268
269		map = new google.maps.Map(this, mapOptions);
270
271		var styledMapOptions = {};
272
273		var usRoadMapType = new google.maps.StyledMapType(roadAtlasStyles, styledMapOptions);
274
275		map.mapTypes.set('usroadatlas', usRoadMapType);
276		map.setMapTypeId('usroadatlas');
277
278		var marker = new google.maps.Marker({ position: pos });
279		marker.setTitle($t.attr("data-title"));
280
281		google.maps.event.addListener(marker, 'click', function () {
282			window.open("http://maps.google.com/maps?ll=" + $t.attr("data-lat") + "," + $t.attr("data-long"));
283		});
284
285		marker.setMap(map);
286	});
287
288	$(".location").click(function () {
289		var $mh = $(this).find(".map-holder");
290		if (!$mh.hasClass("hover")) {
291			$mh.addClass("hover");
292			$(".index-overlay").fadeIn(1000, function () {
293				$(".location").append("<div class='close'></div>");
294			});
295		}
296	});
297
298	//$(document).on("click", ".close", function (e) {
299	//	e.preventDefault();
300	//	$(".map-holder").removeClass("hover");
301	//	$(".index-overlay").fadeOut(1000);
302	//	$(this).remove();
303	//});
304
305	//animacije
306	$('.strip').each(function () {
307		var $t = $(this),
308			rows = $.trim($t.html()).split('<br>');
309
310		$t.html("");
311
312		$.each(rows, function (i, val) {
313			$('<span class="row"></span>').appendTo($t);
314			var letters = $.trim(val).split("");
315			$.each(letters, function (j, v) {
316				v = (v === " ") ? "&nbsp;" : v;
317				$("<span>" + $.trim(v) + '</span>').appendTo($('.row:last', $t));
318			});
319
320		});
321	});
322
323	$('body').click(function () {
324		for (i = 0; i < $('.strip span').length; i++) {
325			(function (ind) {
326				setTimeout(function () {
327					$('.strip span:not(".row")').eq(ind).toggleClass('animate');
328				}, ind * 15);
329			})(i);
330		}
331	}).click();
332});
333
334
335
336// document ready START
337$(document).ready(function () {
338
339
340		$("a").attr('target', '_self');		
341	
342	$(".doc-external-links a").attr('target', '_blank');
343
344	//TREBAA RASPISATI OVO LIJEPSE
345
346	//var sidebarItem = $("#nav li a");
347
348	//if ((sidebarItem).is(":focus")) {
349
350	//	$(this).parent("li").css("background-color", "#BF2E1B");
351
352	//}
353	//else {
354	//	$(this).parent("li").css("background-color", "#F68475");
355 // }
356
357	//$("#button-to-top").on("click", function () {
358	//	$("body").scrollTop(0);
359	//});
360
361
362
363
364	var scrollToTopBtn = document.getElementById("button-to-top");
365
366	var rootElement = document.documentElement;
367
368	function scrollToTop() {
369		rootElement.scrollTo({
370			top: 0,
371			behavior: "smooth"
372		})
373	}
374
375	scrollToTopBtn.addEventListener("click", scrollToTop)
376
377
378
379
380	$("#nav li a").focusin(function () {
381
382		$(this).parent("li").css("background-color", "#BF2E1B");
383
384	});
385
386	$("#nav li a").focusout(function () {
387
388		$(this).parent("li").css("background-color", "#F68475");
389
390	});
391
392
393	$(".accordion").accordion({
394		header: " > li > a",
395		collapsible: true,
396		heightStyle: "content",
397		active: false,
398		icons: false
399		//icons: {
400		//	header: "url('/images/_theme/arrow-right.png')",
401		//	activeHeader: "url('/images/_theme/arrow-right.png')"
402		//  }
403	});
404
405	$(".rb-osoba").click(function () {
406
407		if ($(this).is(":checked")) {
408
409			$(".rb-osoba").siblings("label").removeClass("checked");
410
411			$(this).siblings("label").addClass("checked");
412		}
413
414		else {
415			$(this).siblings("label").removeClass("checked");
416		}
417
418	});
419
420	$(".rb-upit").click(function () {
421
422		if ($(this).is(":checked")) {
423
424			$(".rb-upit").siblings("label").removeClass("checked");
425
426			$(this).siblings("label").addClass("checked");
427		}
428
429		else {
430			$(this).siblings("label").removeClass("checked");
431		}
432
433	});
434
435	$(".rb-dostava").click(function () {
436
437		if ($(this).is(":checked")) {
438
439			$(".rb-dostava").siblings("label").removeClass("checked");
440
441			$(this).siblings("label").addClass("checked");
442		}
443
444		else {
445			$(this).siblings("label").removeClass("checked");
446		}
447
448	});
449
450	$(".rb-tip-osoba").click(function () {
451
452		if ($(this).is(":checked")) {
453
454			$(".rb-tip-osoba").siblings("label").removeClass("checked");
455
456			$(this).siblings("label").addClass("checked");
457		}
458
459		else {
460			$(this).siblings("label").removeClass("checked");
461		}
462	});
463
464	
465
466	//$(".narudzba-accordion").accordion({
467	//	header: "> li > a",
468	//	collapsible: true,
469	//	heightStyle: "content",
470	//	active: false
471	//});
472		
473    bigSlickInit = function()
474    {
475        $(".slick-big").slick({
476        infinite: true,
477        dots: false,
478        slidesToShow: 1,
479        slidesToScroll: 1,
480        autoplay: true,
481        autoplaySpeed: 6000,
482        adaptiveHeight: true,
483        arrows: false,
484        fade: true
485		});
486	}
487
488    bigSlickInit();
489
490	$(window).on("orientationchange", function () {
491		//$('.slick-big').slick('unslick');
492		bigSlickInit();
493    });
494
495
496	/*AOS.init();*/
497
498	$('[data-fancybox="gallery"').fancybox({
499
500		thumbs: {
501			autoStart: true
502		},
503		buttons: [
504			'zoom',
505			'close'
506		]
507	});
508
509	$('a.fancybox').fancybox({
510		margin: [20, 60, 20, 60],
511		cyclic: true
512	});
513
514	$('.plus_photos').click(function () {
515		console.log("clicked");
516		$(this).prev().trigger("click");
517		$(this).parent().find('ul li:first-child a').trigger("click");
518	});
519
520
521	var num = 56; //number of pixels before modifying styles
522
523	$(window).bind('scroll', function () {
524		if ($(window).scrollTop() > num) {
525			$('header').addClass('fixed');
526		} else {
527			$('header').removeClass('fixed');
528		}
529	});
530
531	$(".tabs h4").click(function () {
532		var rel = $(this).attr('rel');
533
534		$(".tabs h4").removeClass("selected");
535		$(this).addClass("selected");
536
537		$('.tab_content').hide();
538
539		$('#' + rel).show();
540		$('.tab#' + rel).css("display", "flex");
541	});
542
543	$(".tabs .tab").click(function () {
544		var rel = $(this).attr('rel');
545
546		$(this).parent().children().removeClass("selected");
547		$(this).addClass("selected");
548
549		$(this).parent().parent().parent().find('.tab_content').hide();
550
551		$('#' + rel).css("display", "flex");
552	});
553
554
555	//var submenu = $(".uk-navbar-nav > li").has("ul");
556
557	//submenu.children('a').click(function (e) {
558	//    e.preventDefault();
559	//});
560
561	$('.opener').click(function () {
562		var sibling = $(this).siblings('div');
563
564		$('.accordion > div').not(sibling).hide("fast");
565		sibling.toggle("fast");
566		$('.opener').not(this).parent().removeClass("expanded");
567		$(this).parent().toggleClass("expanded");
568	});
569
570
571
572	/* --Responsive-- */
573	var scrollBreakPoint;
574	var scrolled = false;
575	var submenu = $(".uk-navbar-nav > li").has("ul");
576	var undersubmenu = $('.secondary_menu > li').has("ul");
577	var breakpoint = {};
578	breakpoint.refreshValue = function () {
579		this.value = window.getComputedStyle(document.querySelector('body'), ':before').getPropertyValue('content').replace(/'/g, "").replace(/"/g, "");
580	};
581
582	$(window).resize(function () {
583		breakpoint.refreshValue();
584	}).resize();
585	console.log(breakpoint.value);
586
587	if (breakpoint.value === 'smartphone') {
588
589		$('#team_details .researcher img').detach().insertAfter('#team_details .researcher .info h2');
590
591		$('#sixtyyears').detach().prependTo('footer .upper .constraint');
592	}
593
594	if (breakpoint.value === 'tablet') {
595
596	}
597
598	if (breakpoint.value === 'desktop') {
599
600		$('.search i').click(function () {
601			if ($('#tbSearching').css('display') === 'none') {
602				$('#tbSearching').show();
603				$('.nav-right').addClass('opened');
604				$('.search-field').addClass('active');
605			} else {
606				$('#tbSearching').hide();
607				$('.nav-right').removeClass('opened');
608				$('.search-field').removeClass('active');
609			}
610		});
611	}
612
613	if (breakpoint.value === 'smartphone' || breakpoint.value === 'tablet') {
614
615		submenu.children('a').click(function (e) {
616			var $parent = $(this).parent();
617
618			e.preventDefault();
619			//if ($(this).hasClass('opened')) {
620			//	$(this).find('.tertiary_menu').parent().removeClass('opened');
621			//}
622
623			$('.opened').not($parent).removeClass('opened');
624			$parent.toggleClass('opened');
625		});
626
627        undersubmenu.children('a').click(function(e) {
628            e.preventDefault();
629            $(this).parent().toggleClass('opened');
630        });
631	}
632
633	
634
635});
636
637
638function show1() {
639  document.getElementById('desc').style.display = 'none'; 
640  document.getElementById('pravnoIme').style.display = 'none';
641	$(".swap-name").html("Ime i prezime*:");
642}
643
644function show2() {
645  document.getElementById('desc').style.display = 'block';
646  document.getElementById('pravnoIme').style.display = 'block';
647  $(".swap-name").html("Naziv*:");
648}
649
650
651
652function showPlatitelj1() {
653	document.getElementById('platitelj-form').style.display = 'none';
654}
655
656function showPlatitelj2() {
657	document.getElementById('platitelj-form').style.display = 'block';
658}
659
660
661
662function platiteljOsoba1() {
663	document.getElementById('oib-show').style.display = 'none';
664}
665
666function platiteljOsoba2() {
667	document.getElementById('oib-show').style.display = 'block';
668}
669
670
671function showDostava1() {
672	document.getElementById('dostava-form').style.display = 'none';
673}
674
675function showDostava2() {
676	document.getElementById('dostava-form').style.display = 'none';
677}
678
679function showDostava3() {
680	document.getElementById('dostava-form').style.display = 'block';
681}
682
683function showDostava4() {
684	document.getElementById('dostava-form').style.display = 'none';
685}
686function numberFormatter(x) {
687  var parts = x.toString().split(",");
688  parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ".");
689  return parts.join(",");
690}
691
692//$(document).ready(function (){
693//	$("#ChangeData").click(function () {
694
695// document ready END
696

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.