1 2var isInAnim = false; 3var mainSlider = null; 4 5jQuery(document).ready(function($) { 6 7 $(document).ajaxComplete(function(e, xhr, settings) { 8 if (settings.data && settings.data.indexOf("_wpcf7")>-1 && xhr && xhr.responseJSON) { 9 var response = xhr.responseJSON; 10 var params = {}; 11 var regex = /-f(\d+).*-p(\d+)/; 12 var matches = response.into.match(regex); 13 14 if (matches) { 15 params['formId'] = matches[1]; 16 params['pageId'] = matches[2]; 17 } 18 19 params['mailSent'] = response.mailSent; 20 21 if (settings.type === 'POST') { 22 params['data'] = {}; 23 var submittedData = settings.data; 24 var params1 = new URLSearchParams(submittedData); 25 for (var key of params1.keys()) { 26 params['data'][key] = params1.get(key); 27 } 28 } 29 30 params['_action'] = 'handletrcode'; 31 params['ajaxload'] = 'true'; 32 33 $.ajax({ 34 url: '/', 35 method: 'post', 36 data: params, 37 success: function(result) { 38 try { 39 var scriptElement = document.createElement('script'); 40 scriptElement.text = result; 41 document.body.appendChild(scriptElement); 42 document.body.removeChild(scriptElement); 43 //console.log(result); 44 } catch (e) { 45 console.error('Error executing script:', e); 46 } 47 } 48 }); 49 50 } 51 }); 52 53 if ($("body").hasClass("single")) { 54 var gint = setInterval(function() { 55 if (typeof(ga) !== 'undefined') { 56 $.scrollDepth({gtmOverride:true}); 57 clearInterval(gint); 58 } 59 }, 100); 60 } 61 62 var captureOutboundLink = function(url,newWin) { 63 ga_iprom_event('send', 'event', 'Article links', 'Outbound', url, { 64 'transport': 'beacon', 65 'hitCallback': function(){ 66 if (!newWin) { 67 document.location = url; 68 } 69 } 70 }); 71 if (!newWin) { 72 setTimeout(function() { 73 document.location = url; 74 },200); 75 } 76 } 77 var captureInboundLink = function(url,newWin) { 78 ga_iprom_event('send', 'event', 'Article links', 'Inbound', url, { 79 'transport': 'beacon', 80 'hitCallback': function(){ 81 if (!newWin) { 82 document.location = url; 83 }} 84 }); 85 if (!newWin) { 86 setTimeout(function() { 87 document.location = url; 88 },200); 89 } 90 } 91 92 $("body.single #main.article .article-content a").click(function() { 93 var currentDomain = document.location.protocol + '//' + document.location.hostname; 94 var target = $(this).attr("href"); 95 if (target.indexOf(currentDomain) <= -1) { 96 captureOutboundLink(target, ($(this).attr('target') == '_blank')); 97 } else { 98 captureInboundLink(target, ($(this).attr('target') == '_blank')); 99 } 100 if ($(this).attr('target') == '_blank') { 101 return true; 102 } 103 return false; 104 }); 105 106 magicLine($('#mainmenu ul')); 107 $(window).resize(function() { 108 setTimeout(function() {handleScroll(true);}, 500); 109 }); 110 111 112 $("#mainmenu ul li.magic-line").prev().addClass("last"); 113 114 if ($("#subnav .rightnav ul").length > 0) { 115 mobileNav($("#subnav .rightnav ul")); 116 } else if ($("#subnav ul").length > 0) { 117 mobileNav($("#subnav ul")); 118 } 119 120 if ($('.default-slideshow').length > 0) { 121 $('.default-slideshow').each(function() { 122 if ($(".slideshow_item",$(this)).length > 1) { 123 showControls = false; 124 if ($(this).hasClass("prevnext")) { 125 showControls = true; 126 } 127 var adaptiveHeight = false; 128 if ($(this).hasClass("adaptiveheight")) { 129 adaptiveHeight = true; 130 } 131 132 if ($(this).attr("id") == 'slideshow') { 133 // main slider 134 $(window).resize(function() { 135 initMainSlider(); 136 }); 137 initMainSlider(); 138 } else { 139 var slider = $(this).bxSlider({ 140 mode: 'fade', 141 controls:showControls, 142 captions: false, 143 adaptiveHeight: adaptiveHeight, 144 auto:true, 145 speed:1000, 146 pause: 7000, 147 autoHover: true, 148 pager: true, 149 nextText: '', 150 prevText: '', 151 onSlideBefore: function (el, oldIndex, newIndex) { 152 //console.log(el); 153 } 154 }); 155 156 } 157 } 158 }); 159 } 160 161 if ($(".logo_slider").length > 0) { 162 $(".logo_slider").each(function() { 163 var vp = getViewportSize(); 164 var slideMargin = 45; 165 if (vp == 'xs') { 166 slideMargin = 30; 167 } 168 169 $(this).bxSlider({ 170 controls:false, 171 captions: false, 172 auto:true, 173 speed: 500, 174 pause: 2000, 175 slideWidth: 150, 176 slideMargin: slideMargin, 177 moveSlides: 1, 178 autoHover: true, 179 pager: false, 180 minSlides: 1, 181 maxSlides: 6 182 }); 183 }); 184 } 185 186 $("#login_btn").click(function() { 187 showLoading($("html")); 188 $.ajax({ 189 url: "/login/", 190 success: function(html) { 191 $.magnificPopup.open({ 192 removalDelay: 500, 193 callbacks: { 194 beforeOpen: function() { 195 this.st.mainClass = 'mfp-zoom-in'; 196 } 197 }, 198 items: { 199 src: html, 200 type: 'inline' 201 }, 202 closeBtnInside: true 203 }); 204 hideLoading(); 205 } 206 }); 207 return false;
208 }); 209 210 211 function splitByFirstOccurrence(str, separator) { 212 var index = str.indexOf(separator); 213 if (index === -1) { 214 return [str]; // Separator not found, return the original string as the only element of an array 215 } 216 217 var firstPart = str.substring(0, index); 218 var secondPart = str.substring(index + 1); 219 return [firstPart, secondPart]; 220 } 221 222 var lastNewsletterForm; 223 $("#newsletter_form,.newsletter_forma").submit(function(){ 224 lastNewsletterForm = $(this); 225 lastNewsletterForm.find(".alert").remove(); 226 $(this).css("opacity",0.5); 227 var req = $(this).serialize()+"&ajaxload=true&_action=newsletter"; 228 $.ajax({ 229 url: '/', 230 method: 'post', 231 data: req, 232 success: function(result) { 233 data = splitByFirstOccurrence(result, "|"); 234 lastNewsletterForm.css("opacity",1); 235 if (data[0] == 'true') { 236 lastNewsletterForm.html(getAlert(data[1],'success')).hide().slideDown(); 237 ga_iprom_event('send', 'event', 'Prijava', 'Spletna patrola'); 238 } else { 239 lastNewsletterForm.prepend(getAlert(data[1],'danger')); 240 } 241 } 242 }); 243 return false; 244 }); 245 246 $("#formatgallery select").change(function(){ 247 var req = $(this).closest("form").serialize()+"&ajaxload=true&_action=gallery"; 248 showLoading($("#formatgallery_content")); 249 $.ajax({ 250 url: '/', 251 method: 'post', 252 data: req, 253 success: function(result) { 254 $("#formatgallery_content").hide().html(result).slideDown(); 255 handleGalleryLinks(); 256 if ($(".adgallery_item").length >= 10) { 257 $("#gallery_more").show(); 258 } else { 259 $("#gallery_more").hide(); 260 } 261 } 262 }); 263 }); 264 265 $("#gallery_more").click(function() { 266 var req = $("#formatgallery form").serialize()+"&ajaxload=true&_action=gallery"; 267 var offset = $(".adgallery_item").length; 268 req += '&offset='+offset; 269 270 showLoading($("#formatgallery_content")); 271 $.ajax({ 272 url: '/', 273 method: 'post', 274 data: req, 275 success: function(result) { 276 result = $.trim(result); 277 if (result) { 278 $("#formatgallery_content").append('<div class="appended" style="display:none">'+result+'</div>'); 279 $("#formatgallery_content .appended").slideDown(); 280 handleGalleryLinks(); 281 } else { 282 $("#gallery_more").hide(); 283 } 284 hideLoading(); 285 } 286 }); 287 return false; 288 }); 289 290 handleGalleryLinks(); 291 292 $('.slovar_input').autocomplete({ 293 serviceUrl: '/slovar-autocomplete/', 294 onSelect: function (suggestion) { 295 window.top.location = suggestion.data; 296 } 297 }); 298 299 $(".slovar_form").submit(function() { window.location='/slovar/?q='+encodeURI($(this).find(".slovar_input").val()); return false; }); 300 301 $(".subpagecontent a.showmore").click(function() { 302 $(this).hide(); 303 $(".subpagecontent_more", $(this).parent()).slideDown(); 304 return false; 305 }); 306 307 $(".btnreadmore").click(function() { 308 $(this).parent().find(".morecontent").slideDown(); 309 $(this).hide(); 310 return false; 311 }); 312 313 $("a.innernav").click(function() { 314 var element = $($(this).attr("href")); 315 window.location.hash = 'nav-'+element.attr("id"); 316 return false; 317 }); 318 319 320 $("#selectnav select").change(function() { 321 var targ = $(this).val(); 322 if (targ) { 323 var element = $("#"+targ); 324 window.location.hash = 'nav-'+element.attr("id"); 325 } 326 return false; 327 }); 328 329 noScroll = false; 330 $("a.refquote").click(function() { return false }); 331 $("a.refquote").mouseover(function() { 332 $("a.refquote").removeClass("active"); 333 $(this).addClass("active"); 334 $("#customer_quote").html($("span.customer_quote", $(this)).html()); 335/* if (($(window).scrollTop() < ($("#izjave-narocnikov").offset().top - 250)) && !noScroll) { 336 noScroll = true; 337 setTimeout(function() { 338 noScroll = false; 339 }, 2000); 340 scrollToElement($("#izjave-narocnikov")); 341 }*/ 342 }); 343 344 $(".gal_nav a").click(function() { 345 var src = $(this).attr("data-original"); 346 var gal = $(this).closest(".gallery"); 347 $(".currimg img",gal).attr("src",src); 348 $(".gal_nav a").removeClass("active"); 349 $(this).addClass("active"); 350 return false; 351 }); 352 353 $(".faq_q").click(function() { 354 if ($(this).closest(".faq").hasClass("expanded")) { 355 $(this).closest(".faq").removeClass("expanded"); 356 $(".answer", $(this).closest(".faq")).slideUp(); 357 } else { 358 $(".faq").removeClass("expanded"); 359 $(".faq .answer").slideUp(); 360 $(this).closest(".faq").addClass("expanded"); 361 $(".answer", $(this).closest(".faq")).slideDown(); 362 } 363 return false;
364 }); 365 366 $("#archive-year-picker, #archive-author-picker, #archive-category-picker").change(function() { 367 window.location.href = $(this).val(); 368 }); 369 370 if ($(".masonryposts").length > 0) { 371 $(".masonryposts").imagesLoaded(function() { 372 $(".masonryposts").masonry({ 373 itemSelector : '.article', 374 columnWidth : '.article', 375 transitionDuration : 0 376 }); 377 }); 378 } 379 380 $(".openblock").click(function() { 381 $(this).parent().nextAll(".closedblock").slideDown(); 382 $(this).slideUp(); 383 return false; 384 }); 385 386 $(".event_show, .event .preview").click(function() { 387 var el = $(this).parent(); 388 el.find(".event_hide").show(); 389 el.find(".preview").slideUp(); 390 el.find(".detail").slideDown(); 391 el.find(".event_show").hide(); 392 el.addClass("expanded"); 393 return false; 394 }); 395 $(".event_hide").click(function() { 396 var el = $(this).parent(); 397 el.find(".event_show").show(); 398 el.find(".preview").slideDown(); 399 el.find(".detail").slideUp(); 400 el.find(".event_hide").hide(); 401 el.removeClass("expanded"); 402 return false; 403 }); 404 405 $(".blocklink").click(function() { 406 window.location = $(this).attr("data-href") 407 }); 408 409 $("#share_controls a, #share_controls_bottom a").click(function() { 410 if (!$(this).hasClass('share_email_btn')) { 411 popup = window.open ($(this).attr("href"), "share-popup", "width=500, height=600, top=0, left=0"); 412 popup.focus(); 413 return false; 414 } 415 }); 416 417 $(".share_email_btn").click(function() { 418 $("#share_email").slideDown(); 419 scrollToElement($("#share_email")); 420 return false; 421 }); 422 423 /* cookies */ 424 $("#optout").submit(function() { 425 if ($("#checkbox").is(":checked")) { 426 _iprom_cookieOptout() 427 $("#message").html('Prvoosebni nenujni piÅ¡kotki so bili odstranjeni in jih na tem spletnem mestu ne boste veÄ prejeli v naslednjih 30 dneh.').slideDown(); 428 $("form").slideUp(); 429 } else { 430 $("#message").html('Za odstranitev prvoosebnih nenujnih piÅ¡kotkov izpolnite obrazec.').slideDown(); 431 } 432 return false; 433 }); 434 435 /* slovar */ 436 437 $(".slovar_term .show_more, .slovar_term .show_more_link").click(function() { 438 var parent = $(this).closest(".slovar_term"); 439 if (parent.hasClass("term_selected")) { 440 parent.find(".block_content").slideUp(function() { 441 parent.removeClass("term_selected"); 442 }); 443 } else { 444 parent.find(".block_content").slideDown(function() { 445 parent.addClass("term_selected"); 446 }); 447 } 448 return false; 449 }); 450 451 452 453 $('.event_photo_gallery').each(function() { 454 $(this).find("a").magnificPopup({ 455 type: 'image', 456 gallery:{ 457 enabled:true 458 } 459 }); 460 }); 461 462 $("#top_btn").click(function() { 463 $(window).scrollTo(0,1000); 464 return false; 465 }); 466 467 $('#navbarCollapse').on('shown.bs.collapse', function () { 468 handleScroll(true); 469 }); 470 471 $(window).scroll(function() { 472 handleScroll(false); 473 }); 474 $(window).resize(function() { 475 handleScroll(true); 476 477 $(".match-height").matchHeight({property: 'min-height'}); 478 }); 479 handleScroll(true); 480 481 /*$("[data-toggle]").click(function() { 482 setTimeout(function() { $(".match-height").matchHeight(); }, 100 483 });*/ 484 $(".match-height").matchHeight({property: 'min-height'}); 485 486 $(window).hashchange( function(){ 487 var hash = location.hash.replace("#nav-","").replace("#",""); 488 if ($("#"+hash).length > 0) { 489 scrollToElement($("#"+hash)); 490 } else if (hash.match(/^faq-/)) { 491 hash = hash.replace(/^faq-/,""); 492 var el = $("#"+hash); 493 if (el.length > 0) { 494 scrollToElement(el); 495 el.addClass("expanded"); 496 $(".answer", el).slideDown(); 497 } 498 } 499 500 }); 501 $("section#content").imagesLoaded(function() { 502 $(window).hashchange(); 503 }); 504 505 $(".file_attach:eq(0)").show(); 506 $(".add_file_attach").click(function() { 507 $('.file_attach:not(:visible):first').show('slow'); 508 if ($('.file_attach:not(:visible)').length == 0) { 509 $(".add_file_attach").hide(); 510 } 511 return false; 512 }); 513 514 if (typeof(readyFunc) != 'undefined') { 515 for (var i=0; i<readyFunc.length; i++) { 516 readyFunc[i]() 517 } 518 } 519 520 521 if ($(".slovar_term.term_selected").length > 0) { 522 setTimeout(function() { 523 scrollToElement($(".slovar_term.term_selected")); 524 }, 1000); 525 } 526 527 $("#main iframe").each(function() { 528 if ($(this).attr("src").indexOf("youtu") >= 0) { 529 $(this).wrap('<div class="embed-container"></div>'); 530 } 531 }); 532 533 534 535 $("div.gallery").each(function() { 536 537 if ($(this).closest(".reference_single").length == 0) { 538 $(this).find("dl.gallery-item").matchHeight(); 539 $(this).find("a").magnificPopup({ 540 type: 'image', 541 gallery:{ 542 enabled:true 543 } 544 }); 545 546 } 547 548 }); 549 550 if ($("#floatcta.collapsed").length > 0) { 551 $(window).scroll(function() { 552 console.log($(window).scrollTop()); 553 if ($(window).scrollTop() > 100) { 554 $("#floatcta").each(function() { 555 if (!$(this).hasClass("ready")) { 556 $(this).removeClass("collapsed").addClass("ready").css("right","-200px").show().animate({'right':'0px'},{queue:false, duration: 300}); 557 setTimeout(function() { 558 $("#floatcta.ready").animate({'right':'-250px'}
558,{queue:true, duration: 300, complete: function() { 559 $("#floatcta").addClass("collapsed").show().animate({'right':'0px'},{queue:true, duration: 1000}); 560 }}); 561 }, 1500); 562 } 563 }); 564 } 565 }); 566 $("#floatcta").on('mouseenter mouseover click', function() { 567 if ($(this).hasClass("collapsed")) { 568 $(this).removeClass("collapsed").css("right","-200px").animate({'right':'0px'},{queue:true, duration: 1000}); 569 } 570 }); 571 $("#floatcta_close").click(function() { 572 $("#floatcta").animate({'right':'-250px'},{queue:true, duration: 300, complete: function() { 573 $("#floatcta").addClass("collapsed").show().animate({'right':'0px'},{queue:true, duration: 1000}); 574 }}); 575 return false; 576 }); 577 } 578 579 $(".block_people.people2017 .row").each(function() { 580 var els = $(this).find(".eqh"); 581 $(this).imagesLoaded(function() { 582 els.matchHeight({byRow:true}); 583 }); 584 }); 585 586 $("#main.article table").addClass("table-bordered").addClass("table-condensed").addClass("table-responsive"); 587 588 $(".embediframe-wrapper iframe").each(function() { 589 $(this).iFrameResize(); 590 }); 591 592 $("iframe.crossFrame").iFrameResize({ 593 checkOrigin: false, 594 sizeHeight: true, 595 autoResize: true, 596 log: false, 597 heightCalculationMethod:'documentElementOffset', 598 enablePublicMethods : true, 599 onResize : function(messageData){ // Callback fn when resize is received 600 //console.log(messageData); 601 }, 602 onMessage : function(messageData){ // Callback fn when message is received 603 if (messageData.message == 'completed') { 604 window.location.hash='nav-prijava'; 605 $(window).trigger("hashchange"); 606 } 607 }, 608 }); 609 610 611 $('[data-toggle="tooltip"]').tooltip({html:true}); 612 613}); 614 615function handleGalleryLinks() { 616 $("a.iframeOverlay").unbind('click').magnificPopup({type:'iframe'}); 617} 618 619function scrollToElement(element) { 620 var targetPos = element.offset().top; 621 var vp = getViewportSize(); 622 /*if (vp == 'xs') { 623 targetPos -= $("header").height(); 624 } else {*/ 625 targetPos -= ($("header").height() + $("#subnav_wrapper").height() + $(".fixit_wrapper").height() + 30); 626 //} 627 $(window).scrollTo(targetPos,1000,{ 628 onAfter: function () { 629 //createMask(element); 630 //setTimeout("removeMasks()",500); 631 } 632 }); 633} 634 635function getAlert(message,type) { 636 _html = '<div class="row"><div class="alert alert-'+type+'" role="alert">'; 637 _html += '<a href="#" class="close" data-dismiss="alert">×</a>'; 638 _html += ''+message+'</div></div>'; 639 return _html; 640} 641 642function handleScroll(isResize) { 643 644 $("#subnav").height($("#subnav_wrapper").outerHeight(true)); 645 if (typeof(isResize) != 'undefined' && isResize) { 646 $(".imgcontent_inner .desc").matchHeight(); 647 } 648 649 if ($(window).scrollTop() > 100) { 650 $("#top_btn").fadeIn(); 651 } else { 652 $("#top_btn").fadeOut(); 653 } 654 655 if ($(".fixit").length > 0) { 656 if (($("header").outerHeight() + $("#subnav_wrapper.fixed").outerHeight() + $(window).scrollTop()) > $(".fixit_wrapper").offset().top) { 657 $(".fixit").addClass("fixed"); 658 $(".fixit.fixed").css("top",($("header").outerHeight()+ $("#subnav_wrapper.fixed").outerHeight())+"px"); 659 } else { 660 $(".fixit").removeClass("fixed"); 661 } 662 } 663 if ($("#subnav").length > 0) { 664 if (($("header").outerHeight() + $(window).scrollTop()) > $("#subnav").offset().top) { 665 $("#subnav_wrapper").addClass("fixed"); 666 $("#subnav_wrapper.fixed").css("top",$("header").outerHeight()+"px"); 667 } else { 668 $("#subnav_wrapper").removeClass("fixed"); 669 } 670 671 if ($("#subnav ul li").length > 0) { 672 $(".subpageblock").each(function() { 673 var topPos = $(this).offset().top; 674 var visible = $(window).scrollTop() + $("header").outerHeight() - 50; 675 if ($("#subnav_wrapper").hasClass("fixed")) { 676 visible += $("#subnav_wrapper").outerHeight(); 677 } 678 var bottom = visible + $(window).height(); 679 if (topPos >= visible && topPos < bottom) { 680 $("#subnav a.innernav").removeClass("active"); 681 $("#sc_"+$(this).attr("id")).addClass("active"); 682 scrollMobileSubmenu(); 683 /* 684 var i = 0; 685 var selected = 0; 686 $("#subnav a").each(function() { 687 if ($(this).hasClass("active")) { 688 selected = i; 689 } 690 i++; 691 }); 692 var selval = $('#subnav select option:eq('+selected+')').val(); 693 $('#subnav select').val(selval); 694 console.log('#subnav select option:eq('+selected+')'); 695 */ 696 return false;
697 } 698 }); 699 } 700 } 701 702 var vp = getViewportSize(); 703 704 if (vp == 'xs' || vp == 'sm') { 705 $('header,#logo img,#mainmenu ul,#login_btn,#int_button,#subnav_wrapper').attr('style', ''); 706 $("#magic-line").css("bottom",""); 707 } else { 708 if (($(window).scrollTop() >= 90) && !$("header").hasClass("smaller")) { 709 $("header").addClass("smaller").stop().animate({'height':'70px'},{queue:false, duration: 500}); 710 $("#logo img").stop().animate({'height':'50px'},{queue:false, duration: 100}); 711 $("#mainmenu ul").stop().animate({'margin-top':'0px'},{queue:false, duration: 500}); 712 if (vp == 'lg' || vp == 'md') { 713 $("#login_btn,#int_button").stop().animate({'margin-top':'9px'},{queue:false, duration: 200}); 714 } else if (vp == 'sm') { 715 $("#login_btn,#int_button").stop().animate({'margin-top':'13px'},{queue:false, duration: 200}); 716 } 717 $("#magic-line").stop().animate({'bottom':'-2px'},{queue:false, duration: 200}); 718 setTimeout(function() { 719 if ($("#subnav_wrapper.fixed").length > 0) 720 $("#subnav_wrapper.fixed").css("top",$("header").outerHeight()+"px"); 721 },500); 722 } else if ($(window).scrollTop() < 90) { 723 $("header").removeClass("smaller").stop().animate({'height':'101px'},{queue:false, duration: 50}); 724 $("#logo img").stop().animate({'height':'81px'},{queue:false, duration: 50}); 725 $("#mainmenu ul").stop().animate({'margin-top':'20px'},{queue:false, duration: 400}); 726 if (vp == 'lg' || vp == 'md') { 727 $("#login_btn,#int_button").stop().animate({'margin-top':'29px'},{queue:false, duration: 50}); 728 } else if (vp == 'sm') { 729 $("#login_btn,#int_button").stop().animate({'margin-top':'-15px'},{queue:false, duration: 50}); 730 } 731 $("#magic-line").stop().animate({'bottom':'-13px'},{queue:false, duration: 50}); 732 } 733 } 734 735 if ($(".collapse.in").length > 0) { 736 $(".collapse.in").css("max-height", ($(window).height() - $("header").outerHeight()) + "px"); 737 $("#govorci .collapse.in").css("max-height", "9999px"); 738 $("#program .collapse.in").css("max-height", "9999px"); 739 } 740 741 $("#mobilesub .mobilesub-container a").width($("#mobilesub .mobilesub-container").width()); 742 $("#mobilesub .nav-left, #mobilesub .nav-right").unbind("click").click(function() { 743 var elements = $(this).parent().find("a"); 744 var selectedElement = 0; 745 if ($(this).parent().find("a.active").length > 0) { 746 var i=0; 747 elements.each(function() { 748 if ($(this).hasClass("active")) { 749 selectedElement = i; 750 } 751 i++; 752 }); 753 } 754 if ($(this).hasClass("nav-right")) { 755 selectedElement++; 756 } else { 757 selectedElement--; 758 } 759 760 if (selectedElement < 0) { 761 selectedElement = elements.length-1; 762 } else if (selectedElement > (elements.length-1)) { 763 selectedElement = 0; 764 } 765 //console.log("selected: "+selectedElement); 766 var newPos = 0; 767 newPos = $(this).parent().find("a").width() * selectedElement * -1; 768 $(this).parent().find("a").removeClass("active"); 769 isInAnim = true; 770 $(this).parent().find(".mobilesub-innercontainer").animate({left: newPos+"px"}, 1000); 771 setTimeout(function() { 772 isInAnim = false; 773 }, 1000); 774 $(this).parent().find("a:eq("+selectedElement+")").addClass("active"); 775 //console.log($(this).parent().find("a:eq("+selectedElement+")")); 776 var target = $(this).parent().find("a.active").attr("href"); 777 if (target.match(/^#/)) { 778 var element = $(target); 779 window.location.hash = 'nav-'+element.attr("id"); 780 } else { 781 window.location.href = target; 782 } 783 784 return false; 785 }); 786 787 setTimeout(function() { 788 magicLine($('#mainmenu ul')); 789 }, 100); 790 791 792} 793 794function scrollMobileSubmenu() { 795 var selectedElement = 0; 796 var mainEl = $("#subnav ul"); 797 if ($("#subnav .rightnav ul").length > 0) { 798 mainEl = $("#subnav .rightnav ul"); 799 } 800 if (mainEl.find("a.active").length > 0) { 801 var i=0; 802 mainEl.find("a").each(function() { 803 if ($(this).hasClass("active")) { 804 selectedElement = i; 805 } 806 i++; 807 }); 808 } 809 //console.log(selectedElement); 810 var newPos = 0; 811 newPos = $("#mobilesub").find("a").width() * selectedElement * -1; 812 $("#mobilesub").find("a").removeClass("active"); 813 if (!isInAnim) { 814 $("#mobilesub").find(".mobilesub-innercontainer").stop(true).animate({left: newPos+"px"}, 100); 815 } 816 $("#mobilesub").find("a:eq("+selectedElement+")").addClass("active"); 817} 818 819function openScript(url, width, height, scroll) { 820 if (!scroll) { 821 var Win = window.open('http://www.iprom.si'+url,"MIGalerija",'width=' + width + ',height=' + height + ',resizable=0,scrollbars=no,menubar=no,status=no' ); 822 } else { 823 var Win = window.open('http://www.iprom.si'+url,"MIGalerija",'width=' + width + ',height=' + height + ',resizable=0,scrollbars=yes,menubar=no,status=no' ); 824 } 825 Win.focus(); 826} 827 828function openDemo(url) { 829 window.open(url); 830} 831 832function showLoading(el) { 833 if (typeof(el) == 'undefined') { 834 el = $("body"); 835 } 836 el.prepend('<div class="spinner_wrapper"><div class="spinner"><div class="double-bounce1"></div><div class="double-bounce2"></div></div></div>'); 837 el.css("position","relative"); 838} 839 840function hideLoading() { 841 $(".spinner_wrapper").remove(); 842} 843 844function createMask(el) { 845 var topMask = $('<div class="tmpmask" style="top:0px; height: '+el.offset().top+'px"></div>').appendTo("body").fadeIn("fast"); 846 var bot_top = el.offset().top + el.outerHeight(true); 847 var bot_h = $( document ).height() - bot_top; 848 var bottomMask = $('<div class="tmpmask" style="top:'+bot_top+'px; height: '+bot_h+'px"></div>').appendTo("body").fadeIn("fast"); 849} 850 851function removeMasks() { 852 $(".tmpmask").fadeOut(function() { 853 $(this).remove(); 854 }); 855} 856 857function _iprom_getCookies() { 858 var c = document.cookie, v = 0, cookies = {}; 859 if (document.cookie.match(/^\s*\$Version=(?:"1"|1);\s*(.*)/)) { 860 c = RegExp.$1; 861 v = 1; 862 } 863 if (v === 0) { 864 c.split(/[,;]/).map(function(cookie) { 865 var parts = cookie.split(/=/, 2), 866 name = decodeURIComponent(parts[0].trimLeft()), 867 value = parts.length > 1 ? decodeURIComponent(parts[1].trimRight()) : null; 868 cookies[name] = value; 869 }); 870 } else { 871 c.match(/(?:^|\s+)([!#$%&'*+\-.0-9A-Z^`a-z|~]+)=([!#$%&'*+\-.0-9A-Z^`a-z|~]*|"(?:[\x20-\x7E\x80\x
871FF]|\\[\x00-\x7F])*")(?=\s*[,;]|$)/g).map(function($0, $1) { 872 var name = $0, 873 value = $1.charAt(0) === '"' 874 ? $1.substr(1, -1).replace(/\\(.)/g, "$1") 875 : $1; 876 cookies[name] = value; 877 }); 878 } 879 return cookies; 880} 881 882function _iprom_cookieOptout() { 883 for (var cookie in _iprom_getCookies()) { 884 var date = new Date(); 885 document.cookie = cookie + '=null; path=/; expires='+date.toGMTString(); 886 document.cookie = cookie + '=null; path=/; domain='+document.domain+'; expires='+date.toGMTString(); 887 document.cookie = cookie + '=null; path=/; domain=.'+document.domain+'; expires='+date.toGMTString(); 888 try { 889 var _tld = document.domain.split("."); 890 var _tlddomain = _tld[_tld.length-2]+"."+_tld[_tld.length-1]; 891 document.cookie = cookie + '=null; path=/; domain='+_tlddomain+'; expires='+date.toGMTString(); 892 document.cookie = cookie + '=null; path=/; domain=.'+_tlddomain+'; expires='+date.toGMTString(); 893 } catch(e) {}; 894 } 895 var cookiestr = '__cookie_optout=true; path=/;'; 896 var date = new Date(); 897 date.setTime(date.getTime()+(86400 * 30 * 1000)); 898 cookiestr += 'expires='+date.toGMTString(); 899 document.cookie = cookiestr; 900} 901 902function loginForm() { 903 $("#loginform").submit(function() { 904 showLoading($(this)); 905 $.ajax({ 906 url: '/api/login/', 907 method: 'post', 908 data: $(this).serialize(), 909 success: function(result) { 910 //console.log(result); 911 hideLoading(); 912 if (result == 'false') { 913 $("#login_message").slideDown(); 914 } else { 915 $("#loginform").hide().html(result).slideDown(); 916 } 917 } 918 }); 919 return false; 920 }); 921 922 $("#mediapicker a").click(function() { 923 $.magnificPopup.close(); 924 }); 925} 926 927function getViewportSize() { 928 return ResponsiveBootstrapToolkit.current(); 929} 930 931function mobileNav(el) { 932 var elements = []; 933 el.find("li a").each(function() { 934 elements.push({ 935 'href' : $(this).attr("href"), 936 'txt' : $(this).html(), 937 'active': $(this).hasClass("active") 938 }); 939 }); 940 var html = '<nav id="mobilesub"><div class="nav-left"><span class="icon-angle-left"></span></div>'; 941 html += '<div class="mobilesub-container">'; 942 html += '<div class="mobilesub-innercontainer">'; 943 var selectedIndex = 0; 944 for (var i=0; i<elements.length; i++) { 945 html += '<a href="'+elements[i].href+'"'; 946 if (elements[i].active) { 947 html += ' class="active"'; 948 selectedIndex = i; 949 } 950 html += '>'+elements[i].txt+'</a>'; 951 } 952 html += '</div>'; 953 html += '</div>'; 954 html += '<div class="nav-right"><span class="icon-angle-right"></span></div></nav>'; 955 el.after(html); 956 957 $("#mobilesub .mobilesub-container a").width($("#mobilesub .mobilesub-container").width()); 958 if (selectedIndex > 0) { 959 newPos = $("#mobilesub .mobilesub-container a").width() * selectedIndex * -1; 960 $("#mobilesub .mobilesub-innercontainer").css("left", newPos+"px"); 961 } 962 963 if ($("#mobilesub").length > 0) { 964 if (typeof(Hammer) != 'undefined') { 965 var hammertime = new Hammer($("#mobilesub")[0]); 966 hammertime.on('swipeleft', function(ev) { 967 $("#mobilesub .nav-right").click(); 968 }); 969 hammertime.on('swiperight', function(ev) { 970 $("#mobilesub .nav-left").click(); 971 }); 972 } 973 } 974} 975 976$.fn.equalHeight = function () { 977 var height = 0; 978 var maxHeight = 0; 979 980 // Store the tallest element's height 981 this.each(function () { 982 height = $(this).outerHeight(); 983 maxHeight = (height > maxHeight) ? height : maxHeight; 984 }); 985 986 // Set element's min-height to tallest element's height 987 return this.each(function () { 988 var t = $(this); 989 var minHeight = maxHeight - (t.outerHeight() - t.height()); 990 var property = 'min-height'; 991 992 t.css(property, minHeight + 'px'); 993 }); 994}; 995 996function magicLine(el) { 997 el.find("a").unbind('mouseenter').unbind('mouseleave'); 998 999 var isTouchDevice = 'ontouchstart' in document.documentElement; 1000 1001 var ml = $("#ml-inner"); 1002 ml.attr("data-lw","0").attr("data-ll","0px").width(0).css("left","0px;"); 1003 1004 var selectedElement = el.find(".active a,.current-page-ancestor a"); 1005 if (selectedElement.length > 0) { 1006 var left = selectedElement.offset().left - $("#magic-line").offset().left; 1007 ml.width(selectedElement.outerWidth()).css("left",left+"px"); 1008 ml.attr("data-lw",selectedElement.outerWidth()+"px").attr("data-ll",left+"px"); 1009 } 1010 1011 if (!isTouchDevice) { 1012 el.find("a").bind("mouseenter", function() { 1013 var selected = $(this); 1014 var left = selected.offset().left - $("#magic-line").offset().left; 1015 var width = selected.outerWidth(); 1016 ml.stop().animate({ 1017 left: left+"px", 1018 width: width+"px" 1019 }, { duration: 400 }); 1020 }).bind("mouseleave", function() { 1021 ml.stop().animate({ 1022 left: ml.attr("data-ll"), 1023 width: ml.attr("data-lw") 1024 }, { duration: 400 }); 1025 }); 1026 } 1027} 1028 1029function initMainSlider() { 1030 // glavni keyvisual slider 1031 1032 var vp = getViewportSize(); 1033 if (vp == 'xs') { 1034 // odstranim person slide 1035 $("#slideshow .slideshow_item_person").remove(); 1036 } 1037 1038 // preload bg images 1039 $("#slideshow .slideshow_item").each(function() { 1040 if ($(this).attr("data-bgimage")) { 1041 $('<img/>')[0].src = $(this).attr("data-bgimage"); 1042 } 1043 }); 1044 1045 1046 if ($("#slideshow .slideshow_item").first().attr("data-bgimage")) { 1047 $("#keyvisual_bg_custom").css("background-image","url("+$("#slideshow .slideshow_item").first().attr("data-bgimage")+")").show(); 1048 $("#keyvisual_bg").hide(); 1049 } 1050 1051 if (mainSlider) { 1052 mainSlider.reloadSlider(); 1053 } else { 1054 1055 var slider_pause = 7000; 1056 if ($("html").attr("lang") == 'en-US') { 1057 slider_pause = 3000; 1058 } 1059 1060 mainSlider = $("#slideshow").bxSlider({ 1061 mode: 'fade', 1062 controls:true, 1063 captions: false, 1064 adaptiveHeight: false, 1065 auto:true, 1066 speed:1000, 1067 pause: slider_pause, 1068 autoHover: true, 1069 pager: true, 1070 nextText: '', 1071 prevText: '', 1072 onSlideBefore: function (el, oldIndex, newIndex) { 1073 if (el.attr("data-bgimage")) { 1074 if ($("#keyvisual_bg_custom").is(":visible")) { 1075 $("#keyvisual_bg_custom, #keyvisual_bg").fadeOut(1000); 1076 $("#keyvisual_bg_custom2").css("background-image","url("+el.attr("data-bgimage")+")").fadeIn(1000); 1077 } else { 1078 $("#keyvisual_bg_custom2, #keyvisual_bg").fadeOut(1000); 1079 $("#keyvisual_bg_custom").css("background-image","url("+el.attr("data-bgimage")+")").fadeIn(1000); 1080 } 1081 } else { 1082 $("#keyvisual_bg").fadeIn(1000); 1083 $("#keyvisual_bg_custom,#keyvisual_bg_custom2").fadeOut(1000); 1084 } 1085 } 1086 }); 1087 } 1088 1089 $("#slideshow a").unbind("click").click(function(e) { 1090 e.stopPropagation(); 1091 }); 1092 $("#slideshow").unbind("click").click(function() { 1093 if ($("#slideshow .slideshow_item:visible .slide_container").attr("data-sli
vendor: 12,379 bytes, lines 1093-1502
1093delink")) { 1094 window.location = $("#slideshow .slideshow_item:visible .slide_container").attr("data-slidelink"); 1095 } 1096 return false; 1097 }); 1098 1099} 1100 1101/** 1102* jquery-match-height master by @liabru 1103* http://brm.io/jquery-match-height/ 1104* License: MIT 1105*/ 1106 1107;(function(factory) { // eslint-disable-line no-extra-semi 1108 'use strict'; 1109 if (typeof define === 'function' && define.amd) { 1110 // AMD 1111 define(['jquery'], factory); 1112 } else if (typeof module !== 'undefined' && module.exports) { 1113 // CommonJS 1114 module.exports = factory(require('jquery')); 1115 } else { 1116 // Global 1117 factory(jQuery); 1118 } 1119})(function($) { 1120 /* 1121 * internal 1122 */ 1123 1124 var _previousResizeWidth = -1, 1125 _updateTimeout = -1; 1126 1127 /* 1128 * _parse 1129 * value parse utility function 1130 */ 1131 1132 var _parse = function(value) { 1133 // parse value and convert NaN to 0 1134 return parseFloat(value) || 0; 1135 }; 1136 1137 /* 1138 * _rows 1139 * utility function returns array of jQuery selections representing each row 1140 * (as displayed after float wrapping applied by browser) 1141 */ 1142 1143 var _rows = function(elements) { 1144 var tolerance = 1, 1145 $elements = $(elements), 1146 lastTop = null, 1147 rows = []; 1148 1149 // group elements by their top position 1150 $elements.each(function(){ 1151 var $that = $(this), 1152 top = $that.offset().top - _parse($that.css('margin-top')), 1153 lastRow = rows.length > 0 ? rows[rows.length - 1] : null; 1154 1155 if (lastRow === null) { 1156 // first item on the row, so just push it 1157 rows.push($that); 1158 } else { 1159 // if the row top is the same, add to the row group 1160 if (Math.floor(Math.abs(lastTop - top)) <= tolerance) { 1161 rows[rows.length - 1] = lastRow.add($that); 1162 } else { 1163 // otherwise start a new row group 1164 rows.push($that); 1165 } 1166 } 1167 1168 // keep track of the last row top 1169 lastTop = top; 1170 }); 1171 1172 return rows; 1173 }; 1174 1175 /* 1176 * _parseOptions 1177 * handle plugin options 1178 */ 1179 1180 var _parseOptions = function(options) { 1181 var opts = { 1182 byRow: true, 1183 property: 'height', 1184 target: null, 1185 remove: false 1186 }; 1187 1188 if (typeof options === 'object') { 1189 return $.extend(opts, options); 1190 } 1191 1192 if (typeof options === 'boolean') { 1193 opts.byRow = options; 1194 } else if (options === 'remove') { 1195 opts.remove = true; 1196 } 1197 1198 return opts; 1199 }; 1200 1201 /* 1202 * matchHeight 1203 * plugin definition 1204 */ 1205 1206 var matchHeight = $.fn.matchHeight = function(options) { 1207 var opts = _parseOptions(options); 1208 1209 // handle remove 1210 if (opts.remove) { 1211 var that = this; 1212 1213 // remove fixed height from all selected elements 1214 this.css(opts.property, ''); 1215 1216 // remove selected elements from all groups 1217 $.each(matchHeight._groups, function(key, group) { 1218 group.elements = group.elements.not(that); 1219 }); 1220 1221 // TODO: cleanup empty groups 1222 1223 return this; 1224 } 1225 1226 if (this.length <= 1 && !opts.target) { 1227 return this; 1228 } 1229 1230 // keep track of this group so we can re-apply later on load and resize events 1231 matchHeight._groups.push({ 1232 elements: this, 1233 options: opts 1234 }); 1235 1236 // match each element's height to the tallest element in the selection 1237 matchHeight._apply(this, opts); 1238 1239 return this; 1240 }; 1241 1242 /* 1243 * plugin global options 1244 */ 1245 1246 matchHeight.version = 'master'; 1247 matchHeight._groups = []; 1248 matchHeight._throttle = 80; 1249 matchHeight._maintainScroll = false; 1250 matchHeight._beforeUpdate = null; 1251 matchHeight._afterUpdate = null; 1252 matchHeight._rows = _rows; 1253 matchHeight._parse = _parse; 1254 matchHeight._parseOptions = _parseOptions; 1255 1256 /* 1257 * matchHeight._apply 1258 * apply matchHeight to given elements 1259 */ 1260 1261 matchHeight._apply = function(elements, options) { 1262 var opts = _parseOptions(options), 1263 $elements = $(elements), 1264 rows = [$elements]; 1265 1266 // take note of scroll position 1267 var scrollTop = $(window).scrollTop(), 1268 htmlHeight = $('html').outerHeight(true); 1269 1270 // get hidden parents 1271 var $hiddenParents = $elements.parents().filter(':hidden'); 1272 1273 // cache the original inline style 1274 $hiddenParents.each(function() { 1275 var $that = $(this); 1276 $that.data('style-cache', $that.attr('style')); 1277 }); 1278 1279 // temporarily must force hidden parents visible 1280 $hiddenParents.css('display', 'block'); 1281 1282 // get rows if using byRow, otherwise assume one row 1283 if (opts.byRow && !opts.target) { 1284 1285 // must first force an arbitrary equal height so floating elements break evenly 1286 $elements.each(function() { 1287 var $that = $(this), 1288 display = $that.css('display'); 1289 1290 // temporarily force a usable display value 1291 if (display !== 'inline-block' && display !== 'flex' && display !== 'inline-flex') { 1292 display = 'block'; 1293 } 1294 1295 // cache the original inline style 1296 $that.data('style-cache', $that.attr('style')); 1297 1298 $that.css({ 1299 'display': display, 1300 'padding-top': '0', 1301 'padding-bottom': '0', 1302 'margin-top': '0', 1303 'margin-bottom': '0', 1304 'border-top-width': '0', 1305 'border-bottom-width': '0', 1306 'height': '100px', 1307 'overflow': 'hidden' 1308 }); 1309 }); 1310 1311 // get the array of rows (based on element top position) 1312 rows = _rows($elements); 1313 1314 // revert original inline styles 1315 $elements.each(function() { 1316 var $that = $(this); 1317 $that.attr('style', $that.data('style-cache') || ''); 1318 }); 1319 } 1320 1321 $.each(rows, function(key, row) { 1322 var $row = $(row), 1323 targetHeight = 0; 1324 1325 if (!opts.target) { 1326 // skip apply to rows with only one item 1327 if (opts.byRow && $row.length <= 1) { 1328 $row.css(opts.property, ''); 1329 return; 1330 } 1331 1332 // iterate the row and find the max height 1333 $row.each(function(){ 1334 var $that = $(this), 1335 style = $that.attr('style'), 1336 display = $that.css('display'); 1337 1338 // temporarily force a usable display value 1339 if (display !== 'inline-block' && display !== 'flex' && display !== 'inline-flex') { 1340 display = 'block'; 1341 } 1342 1343 // ensure we get the correct actual height (and not a previously set height value) 1344 var css = { 'display': display }; 1345 css[opts.property] = ''; 1346 $that.css(css); 1347 1348 // find the max height (including padding, but not margin) 1349 if ($that.outerHeight(false) > targetHeight) { 1350 targetHeight = $that.outerHeight(false); 1351 } 1352 1353 // revert styles 1354 if (style) { 1355 $that.attr('style', style); 1356 } else { 1357 $that.css('display', ''); 1358 } 1359 }); 1360 } else { 1361 // if target set, use the height of the target element 1362 targetHeight = opts.target.outerHeight(false); 1363 } 1364 1365 // iterate the row and apply the height to all elements 1366 $row.each(function(){ 1367 var $that = $(this), 1368 verticalPadding = 0; 1369 1370 // don't apply to a target 1371 if (opts.target && $that.is(opts.target)) { 1372 return; 1373 } 1374 1375 // handle padding and border correctly (required when not using border-box) 1376 if ($that.css('box-sizing') !== 'border-box') { 1377 verticalPadding += _parse($that.css('border-top-width')) + _parse($that.css('border-bottom-width')); 1378 verticalPadding += _parse($that.css('padding-top')) + _parse($that.css('padding-bottom')); 1379 } 1380 1381 // set the height (accounting for padding and border) 1382 $that.css(opts.property, (targetHeight - verticalPadding) + 'px'); 1383 }); 1384 }); 1385 1386 // revert hidden parents 1387 $hiddenParents.each(function() { 1388 var $that = $(this); 1389 $that.attr('style', $that.data('style-cache') || null); 1390 }); 1391 1392 // restore scroll position if enabled 1393 if (matchHeight._maintainScroll) { 1394 $(window).scrollTop((scrollTop / htmlHeight) * $('html').outerHeight(true)); 1395 } 1396 1397 return this; 1398 }; 1399 1400 /* 1401 * matchHeight._applyDataApi 1402 * applies matchHeight to all elements with a data-match-height attribute 1403 */ 1404 1405 matchHeight._applyDataApi = function() { 1406 var groups = {}; 1407 1408 // generate groups by their groupId set by elements using data-match-height 1409 $('[data-match-height], [data-mh]').each(function() { 1410 var $this = $(this), 1411 groupId = $this.attr('data-mh') || $this.attr('data-match-height'); 1412 1413 if (groupId in groups) { 1414 groups[groupId] = groups[groupId].add($this); 1415 } else { 1416 groups[groupId] = $this; 1417 } 1418 }); 1419 1420 // apply matchHeight to each group 1421 $.each(groups, function() { 1422 this.matchHeight(true); 1423 }); 1424 }; 1425 1426 /* 1427 * matchHeight._update 1428 * updates matchHeight on all current groups with their correct options 1429 */ 1430 1431 var _update = function(event) { 1432 if (matchHeight._beforeUpdate) { 1433 matchHeight._beforeUpdate(event, matchHeight._groups); 1434 } 1435 1436 $.each(matchHeight._groups, function() { 1437 matchHeight._apply(this.elements, this.options); 1438 }); 1439 1440 if (matchHeight._afterUpdate) { 1441 matchHeight._afterUpdate(event, matchHeight._groups); 1442 } 1443 }; 1444 1445 matchHeight._update = function(throttle, event) { 1446 // prevent update if fired from a resize event 1447 // where the viewport width hasn't actually changed 1448 // fixes an event looping bug in IE8 1449 if (event && event.type === 'resize') { 1450 var windowWidth = $(window).width(); 1451 if (windowWidth === _previousResizeWidth) { 1452 return; 1453 } 1454 _previousResizeWidth = windowWidth; 1455 } 1456 1457 // throttle updates 1458 if (!throttle) { 1459 _update(event); 1460 } else if (_updateTimeout === -1) { 1461 _updateTimeout = setTimeout(function() { 1462 _update(event); 1463 _updateTimeout = -1; 1464 }, matchHeight._throttle); 1465 } 1466 }; 1467 1468 /* 1469 * bind events 1470 */ 1471 1472 // apply on DOM ready event 1473 $(matchHeight._applyDataApi); 1474 1475 // use on or bind where supported 1476 var on = $.fn.on ? 'on' : 'bind'; 1477 1478 // update heights on load and resize events 1479 $(window)[on]('load', function(event) { 1480 matchHeight._update(false, event); 1481 }); 1482 1483 // throttled update heights on resize events 1484 $(window)[on]('resize orientationchange', function(event) { 1485 matchHeight._update(true, event); 1486 }); 1487 1488}); 1489 1490 1491 1492$(".wpcf7").on('mailsent.wpcf7', function(event){ 1493 var formId = $(event.target).attr("id"); 1494 1495 if (formId.indexOf("21602") > 0) { 1496 1497 var email = $(event.target).find("[name=email]").val(); 1498 var firstname = $(event.target).find("[name=ime]").val(); 1499 var lastname = $(event.target).find("[name=priimek]").val(); 1500 1501 var xhr = new XMLHttpRequest(); 1502 var url = 'https://api.hsforms.com/submissions/v3/integration/submit/3970630/4e5aad04-deab-4e82-a9fb-a9a
1502784a0cdd3?field' 1503 var data = { 1504 "submittedAt": Date.now(), 1505 "fields": [ 1506 { 1507 "name": "email", 1508 "value": email 1509 }, 1510 { 1511 "name": "firstname", 1512 "value": firstname 1513 }, 1514 { 1515 "name": "lastname", 1516 "value": lastname 1517 } 1518 ], 1519 "context": { 1520 "pageUri": location.href 1521 }, 1522 "legalConsentOptions":{ 1523 "consent":{ 1524 "consentToProcess":true, 1525 "text":"Strinjam se, da iPROM, d.o.o. moje osebne podatke (ime, priimek, podjetje in elektronski naslov) uporabi za obveÅ¡Äanje o dogodku in za posredovanje dodatnih informacij o povezanih storitvah podjetja iPROM, d.o.o.", 1526 "communications":[ 1527 /*{ 1528 "value":true, 1529 "subscriptionTypeId":999, 1530 "text":"I agree to receive marketing communications from Example Company." 1531 }*/ 1532 ] 1533 } 1534 } 1535 } 1536 var final_data = JSON.stringify(data) 1537 xhr.open('POST', url); 1538 xhr.setRequestHeader('Content-Type', 'application/json'); 1539 xhr.onreadystatechange = function() { 1540 if(xhr.readyState == 4 && xhr.status == 200) { 1541 // Returns a 200 response if the submission is successful. 1542 // Prikaži 'Thank you' screen 1543 } else { 1544 // napaka 1545 } 1546 } 1547 xhr.send(final_data) 1548 1549 } 1550 1551}); 1552 1553 1554function applyNewsletter(field, consent) { 1555 if (typeof(field) === 'undefined') { field = 'email'}; 1556 if (typeof(consent) === 'undefined') { consent = 'newsletter'}; 1557 1558 var agree = $("input[name="+consent+"]").is(":checked"); 1559 var email = $("input[name="+field+"]").val(); 1560 1561 console.log("agree: "+agree+" & email + "+email); 1562 1563 var nl_name = $("input[name=ime]").val()+" "+$("input[name=priimek]").val(); 1564 1565 $.ajax({ 1566 url: '/', 1567 method: 'post', 1568 data: { 1569 '_action': 'newsletter', 1570 'ajaxload': 'true', 1571 'newsletter_name': nl_name, 1572 'newsletter_email': email, 1573 }, 1574 success: function(result) { 1575 data = result.split("|",2); 1576 if (data[0] == 'true') { 1577 ga_iprom_event('send', 'event', 'Prijava', 'Spletna patrola'); 1578 } 1579 } 1580 }); 1581 1582} 1583 1584 1585function ga_iprom_event(param1, param2, category, action, label, value) { 1586 if (typeof ipromFormSubmit == 'function') { 1587 ipromFormSubmit( category, action, label, value ); 1588 } else if (typeof ga == 'function') { 1589 ga( param1, param2, category, action, label, value ); 1590 } 1591}
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.