1/* 2 * Egovenz Theme Js 3 */ 4 5(function( $ ) { 6 7 "use strict"; 8 9 var egovenz_body_atts = $("body").data("egovenz"); 10 var responsive_width = egovenz_body_atts && egovenz_body_atts.res_width ? egovenz_body_atts.res_width : 360; 11 12 /* Page Loader */ 13 $( window ).load(function() { 14 15 /* Header Bar Center Item Margin Fun */ 16 setTimeout( egovenzCenterMenuMargin, 300 ); 17 18 /* Set Sticky Height for Menu Bars */ 19 egovenzSetStickyOuterHeight(); 20 21 /* Sticky Menu */ 22 if($('.header-inner .sticky-head').length){ 23 egovenzStickyPart( '.header-inner' ); 24 } 25 26 /* Scroll Sticky */ 27 if($('.header-inner .sticky-scroll').length){ 28 egovenzStickyScrollUpPart( '.header-inner', 'header' ); 29 } 30 31 /* Mobile Header Sticky Menu */ 32 if($('.mobile-header-inner .sticky-head').length){ 33 egovenzStickyPart( '.mobile-header-inner' ); 34 } 35 36 /* Mobile Header Scroll Sticky */ 37 if($('.mobile-header-inner .sticky-scroll').length){ 38 egovenzStickyScrollUpPart( '.mobile-header-inner', '.mobile-header' ); 39 } 40 41 if( $(".page-loader").length ){ 42 $(".page-loader").fadeOut("slow"); 43 }else if( $("body.opacity-zero").length ){ 44 $("body").removeClass("opacity-zero"); 45 $("body").addClass("opacity-one"); 46 } 47 48 }); 49 50 $( document ).ready(function() { 51 52 /* Set Header Height */ 53 var $window = $(window); 54 var $header_cont = $('.portfolio-single-wrapper .portfolio-single-slide .item'); 55 $header_cont.height( $window.height() ); 56 $window.resize(function() { 57 $header_cont.height( $window.height() ); 58 }); 59 60 /* Shortcode CSS Append */ 61 var css_out = ''; 62 $( ".egovenz-inline-css" ).each(function() { 63 var shortcode = $( this ); 64 var shortcode_css = shortcode.attr("data-css"); 65 css_out += ($).parseJSON( shortcode_css ); 66 shortcode.removeAttr("data-css"); 67 }); 68 69 /* VC Row Custom Style */ 70 $( ".egovenz-vc-row" ).each(function() { 71 var shortcode = $( this ); 72 var row_class = shortcode.attr("data-class"); 73 if( shortcode.attr("data-color") ){ 74 var row_color = shortcode.attr("data-color"); 75 css_out += "." + row_class + "{ color:" + row_color + ";}"; 76 shortcode.removeAttr("data-color"); 77 } 78 if( shortcode.attr("data-bg-overlay") ){ 79 var row_overlay = shortcode.attr("data-bg-overlay"); 80 css_out += "." + row_class + "{ position: relative; }"; 81 css_out += "." + row_class + " > span.row-overlay { background-color:" + row_overlay + ";}"; 82 shortcode.removeAttr("data-bg-overlay"); 83 } 84 shortcode.removeAttr("data-class"); 85 }); 86 if( css_out != '' ){ 87 $('head').append( '<style id="egovenz-shortcode-styles">'+ css_out +'</style>' ); 88 } 89 90 /* VC Fullwidth Row RTL */ 91 if( $("body.rtl").length ){ 92 // Fixes rows in RTL 93 $(document).on('vc-full-width-row', function () { 94 egovenz_fix_vc_full_width_row(); 95 }); 96 97 // Fixes rows in RTL 98 jQuery(document).on('vc-full-width-row', function () { 99 egovenz_fix_vc_full_width_row(); 100 }); 101 102 // Run one time because it was not firing in Mac/Firefox and Windows/Edge some times 103 egovenz_fix_vc_full_width_row(); 104 } 105 106 /* Secondary Toggle */ 107 $( document ).on( "click", ".secondary-space-toggle", function() { 108 $('.secondary-space-toggle').toggleClass('active'); 109 $('body').toggleClass('secondary-active'); 110 var sec_width = $( ".secondary-menu-area" ).width(); 111 var sec_pos = $( ".secondary-menu-area" ).data('pos') ? $( ".secondary-menu-area" ).data('pos') : 'left'; 112 113 if( sec_pos == 'overlay' ){ 114 $( ".secondary-menu-area" ).fadeToggle(500); 115 }else if( $('body').hasClass('secondary-active') ){ 116 if( sec_pos == 'left' ){ 117 if( $( ".secondary-menu-area" ).hasClass('left-overlay') ){ 118 $( ".secondary-menu-area" ).animate( { left : "0" }, { duration: 500, specialEasing: { left: "easeInOutExpo" } } ); 119 }else{ 120 $('body').toggleClass('secondary-push-actived'); 121 $( ".secondary-menu-area" ).animate( { left : "0" }, { duration: 500 } ); 122 $( "body" ).css('overflow','hidden'); 123 $( "body .egovenz-wrapper" ).animate( { left : sec_width +"px" }, 500 ); 124 if( $( ".sticky-outer" ).length ) { 125 $( ".sticky-outer .header-sticky, .sticky-outer .show-menu" ).animate( { left : sec_width +"px", right: "-" + sec_width +"px" }, 500 ); 126 } 127 } 128 }else{ 129 if( $( ".secondary-menu-area" ).hasClass('right-overlay') ){ 130 $( ".secondary-menu-area" ).animate( { right : "0" }, { duration: 500, specialEasing: { right: "easeInOutExpo" } } ); 131 }else{ 132 $('body').toggleClass('secondary-push-actived'); 133 $( ".secondary-menu-area" ).animate( { right : "0" }, { duration: 500 } ); 134 $( "body" ).css('overflow','hidden'); 135 $( "body .egovenz-wrapper" ).animate( { right : sec_width +"px" }, 500 ); 136 if( $( ".sticky-outer" ).length ){ 137 $( ".sticky-outer .header-sticky, .sticky-outer .show-menu" ).animate( { right : sec_width +"px", left : "-" + sec_width +"px" }, 500 ); 138 } 139 } 140 } 141 }else{ 142 if( sec_pos == 'left' ){ 143 if( $( ".secondary-menu-area" ).hasClass('left-overlay') ){ 144 $( ".secondary-menu-area" ).animate( { left : "-"+ sec_width +"px" }, { duration: 500, specialEasing: { left: "easeInOutExpo" } } ); 145 }else{ 146 $('body').toggleClass('secondary-push-actived'); 147 $( ".secondary-menu-area" ).animate( { left : "-"+ sec_width +"px" }, { duration: 500 } ); 148 $( "body .egovenz-wrapper" ).animate( { left : 0 }, 500, function(){ $( "body" ).css('overflow-y','scroll'); } ); 149 if( $( ".sticky-outer" ).length ){ 150 $( ".sticky-outer .header-sticky, .sticky-outer .show-menu" ).animate( { left : 0, right: 0 }, 500 ); 151 } 152 } 153 }else{ 154 if( $( ".secondary-menu-area" ).hasClass('right-overlay') ){ 155 $( ".secondary-menu-area" ).animate( { right : "-"+ sec_width +"px" }, { duration: 500, specialEasing: { right: "easeInOutExpo" } } ); 156 }else{ 157 $('body').toggleClass('secondary-push-actived'); 158 $( ".secondary-menu-area" ).animate( { right : "-"+ sec_width +"px" }, { duration: 500 } ); 159 $( "body .egovenz-wrapper" ).animate( { right : 0 }, 500, function(){ $( "body" ).css('overflow-y','scroll'); } ); 160 if( $( ".sticky-outer" ).length ){ 161 $( ".sticky-outer .header-sticky, .sticky-outer .show-menu" ).animate( { right: 0, left : 0 }, 500 ); 162 } 163 } 164 } 165 } 166 167 /* Slider Revolution Issue Fixed */ 168 if( $(".rev_slider_wrapper").length ){ 169 $(".rev_slider_wrapper").css("left" , "inherit"); 170 } 171 172 return false; 173 }); 174 175 /* Sticky Header Space Menu to Modern Toggle Menu Convert */ 176 if( $('.sticky-header-space').length ){ 177 178 //Add toggle dropdown icon 179 $( ".sticky-header-space .egovenz-main-menu" ).find('.menu-item-has-children').append( '<span class="zmm-dropdown-toggle ti-plus"></span>' ); 180 $( ".sticky-header-space .egovenz-main-menu" ).find('.sub-menu').slideToggle(); 181 182 //zmm dropdown toggle 183 $( ".sticky-header-space .zmm-dropdown-toggle" ).on( "click", function() { 184 var parent = $( this ).parent('li').children('.sub-menu'); 185 $( this ).parent('li').children('.sub-menu').slideToggle(); 186 $( this ).toggleClass('ti-minus'); 187 if( $( parent ).find('.sub-menu').length ){ 188 $( parent ).find('.sub-menu').slideUp(); 189 $( parent ).find('.zmm-dropdown-toggle').removeClass('ti-minus'); 190 } 191 }); 192 193 } 194 195 //Custom Responsive Width 196 var win_width = $(window).width(); 197 if( responsive_width ){ 198 egovenzSetCustomHiddenElements( win_width, responsive_width ); 199 } 200 201 /* Full Search Toggle */ 202 $( document ).on( "click", ".full-search-toggle", function() { 203 $('.full-search-wrapper').toggleClass("search-wrapper-opened"); 204 $('.full-search-wrapper').fadeToggle(500); 205 var search_in = $('.search-wrapper-opened').find("input.form-control"); 206 search_in.focus(); 207 return false; 208 }); 209 210 /* Mobile Bar Animate Toggle */ 211 $( document ).on( "click", ".mobile-bar-toggle", function() { 212 $( ".mobile-bar" ).toggleClass('active'); 213 $( "body" ).toggleClass('mobile-bar-active'); 214 if( $( ".mobile-bar" ).hasClass('animate-from-left') ){ 215 if( $( ".mobile-bar" ).hasClass('active') ) 216 $( ".mobile-bar" ).animate( { left : 0 }, { duration: 500, specialEasing: { left: "easeInOutExpo" } } ); 217 else 218 $( ".mobile-bar" ).animate( { left : "-100%" }, { duration: 500, specialEasing: { left: "easeInOutExpo" } } ); 219 } 220 if( $( ".mobile-bar" ).hasClass('animate-from-right') ){ 221 if( $( ".mobile-bar" ).hasClass('active') ) 222 $( ".mobile-bar" ).animate( { right : 0 }, { duration: 500, specialEasing: { right: "easeInOutExpo" } } ); 223 else 224 $( ".mobile-bar" ).animate( { right : "-100%" }, { duration: 500, specialEasing: { right: "easeInOutExpo" } } ); 225 } 226 if( $( ".mobile-bar" ).hasClass('animate-from-top') ){ 227 if( $( ".mobile-bar" ).hasClass('active') ) 228 $( ".mobile-bar" ).animate( { top : 0 }, { duration: 500, specialEasing: { top: "easeInOutExpo" } } ); 229 else 230 $( ".mobile-bar" ).animate( { top : "-100%" }, { duration: 500, specialEasing: { top: "easeInOutExpo" } } ); 231 } 232 if( $( ".mobile-bar" ).hasClass('animate-from-bottom') ){ 233 if( $( ".mobile-bar" ).hasClass('active') ) 234 $( ".mobile-bar" ).animate( { bottom : 0 }, { duration: 500, specialEasing: { bottom: "easeInOutExpo" } } ); 235 else 236 $( ".mobile-bar" ).animate( { bottom : "-100%" }, { duration: 500, specialEasing: { bottom: "easeInOutExpo" } } ); 237 } 238 return false; 239 }); 240 241 /* Mobile Bar Menu to Modern Toggle Menu Convert */ 242 if( $('.mobile-bar').length ){ 243 244 if( $( ".egovenz-main-menu" ).length || $( ".secondary-menu-area-inner ul.menu" ).length ){ 245 246 var main_menu = ".egovenz-main-menu"; 247 if( !$( ".egovenz-main-menu" ).length ){ 248 $( ".secondary-menu-area-inner ul.menu" ).addClass( "egovenz-main-menu" ); 249 } 250 251 var mobile_menu = ".mobile-bar .egovenz-mobile-main-menu"; 252 var find_classes = ".dropdown, .mega-dropdown, .dropdown-toggle, .dropdown-menu, .mega-dropdown-menu, .mega-child-heading, .mega-child-dropdown, .mega-child-dropdown-menu, .hidden-xs-up, .row, .mega-sub-dropdown, .mega-sub-dropdown-menu, .mega-sub-child, .mega-sub-child-inner, .left-side"; 253 var removable_classes = "dropdown mega-dropdown dropdown-toggle dropdown-menu mega-dropdown-menu mega-child-heading mega-child-dropdown mega-child-dropdown-menu hidden-xs-up row mega-sub-dropdown mega-sub-dropdown-menu mega-sub-child mega-sub-child-inner left-side"; 254 255 //Mobile menu copy from main menu 256 if( $(mobile_menu).html() == '' ) $(main_menu).clone().appendTo( mobile_menu ); 257 258 //Add main class name 259 $( mobile_menu + " " + main_menu ).addClass( "flex-column" ); 260 261 //Remove unwanted item from mobile menu 262 $( mobile_menu + " .mega-child-widget" ).parent( "li.menu-item" ).remove(); 263 $( mobile_menu + " .mega-child-divider" ).remove(); 264 $( mobile_menu + " .menu-item-logo" ).remove(); 265 $( mobile_menu + " li.menu-item" ).removeClass (function (index, css) { 266 return ( css.match (/\bcol-\S+/g) || [] ).join(' '); 267 268 }); 269 $( mobile_menu + " li.menu-item" ).removeClass (function (index, css) { 270 return ( css.match (/\bmax-col-\S+/g) || [] ).join(' '); 271 }); 272 273 //Change class name 274 $( mobile_menu ).find( ".dropdown-menu, .mega-child-dropdown-menu, .mega-sub-child-inner" ).toggleClass( "sub-menu" ); 275 276 //Content reform 277 $( mobile_menu + " .mega-child-item-disabled" ).replaceWith( "<a class='nav-link' href='#'>" + $( mobile_menu + " .mega-child-item-disabled" ).html() + "</a>" ); 278 279 //Remove unwanted classes 280 $( mobile_menu ).find( find_classes ).removeClass( removable_classes ); 281
282 //Remove Background 283 $( mobile_menu + " .sub-menu" ).css('background','none'); 284 285 //Add toggle dropdown icon 286 $( ".mobile-bar " + main_menu ).find('.menu-item-has-children').append( '<span class="zmm-dropdown-toggle ti-plus"></span>' ); 287 $( ".mobile-bar " + main_menu ).find('.sub-menu').slideToggle(); 288 289 $( ".mobile-bar " + main_menu ).removeClass('egovenz-main-menu').addClass('egovenz-mobile-menu'); 290 291 //dropdown toggle 292 $( ".mobile-bar .zmm-dropdown-toggle" ).on( "click", function() { 293 var parent = $( this ).parent('li').children('.sub-menu'); 294 $( this ).parent('li').children('.sub-menu').slideToggle(); 295 $( this ).toggleClass('ti-minus'); 296 if( $( parent ).find('.sub-menu').length ){ 297 $( parent ).find('.sub-menu').slideUp(); 298 $( parent ).find('.zmm-dropdown-toggle').removeClass('ti-minus'); 299 } 300 }); 301 }// check page have main menu or not 302 303 } 304 305 /* Mobile Bar Menu to Modern Toggle Menu Convert */ 306 if( $('.secondary-menu-area-inner ul.menu').length ){ 307 308 var sec_menu = ".secondary-menu-area-inner ul.menu"; 309 //Add main class name 310 $( sec_menu ).addClass( "flex-column" ); 311 312 //Add toggle dropdown icon 313 $( sec_menu ).find('.menu-item-has-children').append( '<span class="zmm-dropdown-toggle ti-plus"></span>' ); 314 $( sec_menu ).find('.sub-menu').slideToggle(); 315 316 //dropdown toggle 317 $( sec_menu + " .zmm-dropdown-toggle" ).on( "click", function() { 318 var parent = $( this ).parent('li').children('.sub-menu'); 319 $( this ).parent('li').children('.sub-menu').slideToggle(); 320 $( this ).toggleClass('ti-minus'); 321 if( $( parent ).find('.sub-menu').length ){ 322 $( parent ).find('.sub-menu').slideUp(); 323 $( parent ).find('.zmm-dropdown-toggle').removeClass('ti-minus'); 324 } 325 }); 326 327 } 328 329 /* Twitter Widget Slider(newsticker) */ 330 if( $( ".twitter-slider" ).length ){ 331 $( ".twitter-slider" ).each(function() { 332 var twit_slider = $(this); 333 var slide = twit_slider.attr( "data-show" ); 334 twit_slider.easyTicker({ 335 direction: 'up', 336 visible: parseInt(slide), 337 easing: 'swing', 338 interval: 4000 339 }); 340 }); 341 } 342 343 /* Menu Scroll */ 344 var cur_offset = 0; 345 346 var o_stat = 0; // One Page Menu Status 347 $( '.egovenz-main-menu li.menu-item, .egovenz-mobile-menu li.menu-item' ).each(function( index ) { 348 var cur_item = this; 349 var target = $(cur_item).children("a").attr("href"); 350 if( target && target.indexOf("#section-") != -1 ){ 351 o_stat = 1; 352 var res = target.split("#"); 353 if( res.length == 2 ){ 354 $(cur_item).children("a").attr("data-target", res[0]); 355 $(cur_item).children("a").attr("href", "#"+res[1]); 356 } 357 } 358 }); 359 360 if( o_stat ){ 361 362 if( $('.egovenz-main-menu .menu-item').find('a[href="#section-top"]').length ){ 363 $("body").attr("id","section-top"); 364 } 365 366 $( '.egovenz-main-menu li.menu-item, .egovenz-mobile-menu li.menu-item' ).removeClass("current-menu-item"); 367 368 $(window).on('scroll', function () { 369 var minus_height = $("#wpadminbar").length ? $("#wpadminbar").outerHeight() : 0; 370 minus_height += win_width >= egovenz_body_atts.res_width ? parseInt( egovenz_body_atts.menu_offset ) + 1 : parseInt( egovenz_body_atts.mobile_menu_offset ); 371 $('section.elementor-section[id*="section-"], body').each(function () { 372 var anchored = $(this).attr("id"), 373 targetOffset = $(this).offset().top - minus_height; 374 375 if ($(window).scrollTop() > targetOffset) { 376 $('.egovenz-main-menu .menu-item').find("a").removeClass("active"); 377 $('.egovenz-main-menu .menu-item').find('a[href="#'+ anchored +'"]').addClass("active"); 378 379 //Mobile menu scroll spy active 380 $('.egovenz-mobile-menu .menu-item').find("a").removeClass("active"); 381 $('.egovenz-mobile-menu .menu-item').find('a[href="#'+ anchored +'"]').addClass("active"); 382 } 383 }); 384 }); 385 386 $( '.egovenz-main-menu .menu-item > a[href^="#section-"], .egovenz-mobile-main-menu .menu-item > a[href^="#section-"]' ).on('click',function (e) { 387 388 var cur_item = this; 389 var target = $(cur_item).attr("href"); 390 391 if( $(cur_item).parents(".egovenz-mobile-main-menu").length ) { 392 $(".mobile-bar-toggle.close").trigger( "click" ); 393 } 394 if( $( ".secondary-menu-area" ) ){ 395 $( ".secondary-menu-area .secondary-space-toggle.active" ).trigger( "click" ); 396 } 397 398 var target_id = target.slice( target.indexOf("#"), ( target.length ) ); 399 var cur_url = location.protocol + '//' + location.host + location.pathname; //window.location.href; 400 var data_targ = $(cur_item).attr("data-target"); 401 var another_page = false; 402 if( target_id == '#section-top' && data_targ != '' ){ 403 if( cur_url != data_targ ){ 404 another_page = true; 405 } 406 } 407 408 if( $( target_id ).length && !another_page ){ 409 410 var minus_height = $("#wpadminbar").length ? $("#wpadminbar").outerHeight() : 0; 411 minus_height += win_width >= egovenz_body_atts.res_width ? parseInt( egovenz_body_atts.menu_offset ) : parseInt( egovenz_body_atts.mobile_menu_offset );
412 var offs = $(target_id).offset().top - minus_height; 413 var sec_ani_call = 1; 414 if( target_id == '#section-top' ){ 415 sec_ani_call = 1; 416 offs = 0; 417 } 418 $('html,body').animate({ 'scrollTop': offs }, 1000, 'easeInOutExpo' ); 419 420 return false; 421 }else{ 422 423 if( target_id == '#section-top' && cur_url == data_targ ){ 424 $('html,body').animate({ 'scrollTop': 0 }, 1000, 'easeInOutExpo' ); 425 return false; 426 }else{ 427 if( cur_url != data_targ && target_id != '#' ){ 428 window.location.href = data_targ + target; 429 }else{ 430 window.location.href = target; 431 } 432 } 433 434 } 435 436 }); 437 438 } 439 440 /*Back to top*/ 441 if( $( ".back-to-top" ).length ){ 442 $( document ).on('click', '#back-to-top', function(){ 443 $('html,body').animate({ 'scrollTop': 0 }, 1000, 'easeInOutExpo' ); 444 return false; 445 }); 446 $( document ).scroll(function() { 447 var y = $( this ).scrollTop(); 448 if ( y > 300 ) 449 $( '#back-to-top' ).addClass("back-to-top-on"); 450 else 451 $( '#back-to-top' ).removeClass("back-to-top-on"); 452 }); 453 } 454 455 /* Top Sliding Bar */ 456 if( $( ".top-sliding-bar" ).length ){ 457 $( document ).on('click', '.top-sliding-toggle', function(){ 458 $( ".top-sliding-bar-inner" ).slideToggle(); 459 $( ".top-sliding-toggle" ).toggleClass( "fa-minus" ); 460 return false; 461 }); 462 } 463 464 /* Sticky Header Space */ 465 if( $('.sticky-header-space').length ){ 466 var elem_pos = $('.sticky-header-space').hasClass('left-sticky') ? 'left' : 'right'; 467 var elem_width = $('.sticky-header-space').outerWidth(); 468 469 egovenzStickyHeaderAdjust(elem_pos, elem_width); 470 $( window ).resize(function() { 471 egovenzStickyHeaderAdjust(elem_pos, elem_width); 472 }); 473 } 474 475 /* Toggle Search Modal Triggers */ 476 if( $( ".textbox-search-toggle" ).length ){ 477 $( document ).on('click', '.textbox-search-toggle', function(){ 478 $(this).parents('.search-toggle-wrap').toggleClass('active'); 479 setTimeout(function(){ $('.search-toggle-wrap').find("input.form-control").focus(); }, 500 ); 480 return false; 481 }); 482 }else if( $( ".full-bar-search-toggle" ).length ){ 483 $( document ).on('click', '.full-bar-search-toggle', function(){ 484 $('.full-bar-search-wrap').toggleClass('active'); 485 setTimeout(function(){ $('.full-bar-search-wrap').find("input.form-control").focus(); }, 500 ); 486 return false; 487 }); 488 }else if( $( ".bottom-search-toggle" ).length ){ 489 $( document ).on('click', '.bottom-search-toggle', function(){ 490 $(this).parents('.search-toggle-wrap').toggleClass('active'); 491 setTimeout(function(){ $('.search-toggle-wrap').find("input.form-control").focus(); }, 500 ); 492 return false; 493 }); 494 } 495 496 /* Sticky Footer */ 497 if( $( ".footer-fixed" ).length ){ 498 if( $( window ).width() > 1023 ){ 499 $( ".egovenz-wrapper" ).css({ 'margin-bottom' : $( ".footer-fixed" ).outerHeight() + 'px' }); 500 }else{ 501 $( ".egovenz-wrapper" ).css({ 'margin-bottom' : '0' }); 502 } 503 }else if( $( ".footer-bottom-fixed" ).length ){ 504 if( $( window ).width() > 1023 ){ 505 $( ".egovenz-wrapper" ).css({ 'margin-bottom' : $( ".footer-bottom-fixed" ).outerHeight() + 'px' }); 506 }else{ 507 $( ".egovenz-wrapper" ).css({ 'margin-bottom' : '0' }); 508 } 509 } 510 $( window ).resize(function() { 511 if( $( ".footer-fixed" ).length ){ 512 if( $( window ).width() > 1023 ){ 513 $( ".egovenz-wrapper" ).css({ 'margin-bottom' : $( ".footer-fixed" ).outerHeight() + 'px' }); 514 }else{ 515 $( ".egovenz-wrapper" ).css({ 'margin-bottom' : '0' }); 516 } 517 }else if( $( ".footer-bottom-fixed" ).length ){ 518 if( $( window ).width() > 1023 ){ 519 $( ".egovenz-wrapper" ).css({ 'margin-bottom' : $( ".footer-bottom-fixed" ).outerHeight() + 'px' }); 520 }else{ 521 $( ".egovenz-wrapper" ).css({ 'margin-bottom' : '0' }); 522 } 523 } 524 }); 525 526 /* Stellar Parallax */ 527 if( $(".parallax-item").length ){ 528 $.stellar({ 529 horizontalScrolling: false, 530 verticalOffset: 40 531 }); 532 } 533 534 /* Post Like */ 535 $( document ).on( 'click', ".post-like, .post-dislike", function( event) { 536 537 var current = $(this); 538 var like_stat = current.data("stat"); 539 var post_id = current.data("id"); 540 var parent = current.parents('.post-like-wrap'); 541 542 //return false; 543 if( like_stat != '' ){ 544 545 if( like_stat == '1' ){ 546 parent.find('.post-disliked').removeClass('fa-thumbs-down post-disliked').addClass('fa-thumbs-o-down post-dislike'); 547 current.removeClass('fa-thumbs-o-up post-like').addClass('fa-thumbs-up post-liked'); 548 }else{ 549 parent.find('.post-liked').removeClass('fa-thumbs-up post-liked').addClass('fa-thumbs-o-up post-like'); 550 current.removeClass('fa-thumbs-o-down post-dislike').addClass('fa-thumbs-down post-disliked'); 551 } 552 553 // Ajax call 554 $.ajax({
555 type: "post", 556 url: egovenz_ajax_var.admin_ajax_url, 557 data: "action=post_like_act&nonce="+egovenz_ajax_var.like_nonce+"&like_stat="+like_stat+"&post_id="+post_id, 558 success: function(res){ 559 $( parent ).html(res); 560 $('body').tooltip({ 561 container: 'body', 562 trigger: 'hover', 563 html: true, 564 animation: false, 565 selector: '[data-toggle="tooltip"]' 566 }); 567 }, 568 error: function (jqXHR, exception) { 569 console.log(jqXHR); 570 } 571 }); 572 } 573 return false; 574 }); 575 $( document ).on( 'click', ".post-liked, .post-disliked, .post-fav-done", function( event) { 576 return false; 577 }); 578 579 580 /* Post Favourite */ 581 $( document ).on( 'click', ".post-favourite", function( event) { 582 583 var current = $(this); 584 var post_id = current.data("id"); 585 var parent = current.parents('.post-fav-wrap'); 586 587 if( post_id != '' ){ 588 // Ajax call 589 $.ajax({ 590 type: "post", 591 url: egovenz_ajax_var.admin_ajax_url, 592 data: "action=post_fav_act&nonce="+egovenz_ajax_var.fav_nonce+"&post_id="+post_id, 593 success: function(res){ 594 $( parent ).html(res); 595 $('body').tooltip({ 596 container: 'body', 597 trigger: 'hover', 598 html: true, 599 animation: false, 600 selector: '[data-toggle="tooltip"]' 601 }); 602 }, 603 error: function (jqXHR, exception) { 604 console.log(jqXHR); 605 } 606 }); 607 } 608 return false; 609 }); 610 611 /* Magnific Zoom Gallery Code */ 612 if( $('.zoom-gallery').length ){ 613 $('.zoom-gallery').magnificPopup({ 614 delegate: 'a', 615 type: 'image', 616 closeOnContentClick: false, 617 closeBtnInside: false, 618 mainClass: 'mfp-with-zoom mfp-img-mobile', 619 gallery: { 620 enabled: true 621 }, 622 zoom: { 623 enabled: true, 624 duration: 300, // don't foget to change the duration also in CSS 625 opener: function(element) { 626 return element.find('img'); 627 } 628 } 629 }); 630 } 631 632 if( $('.image-gallery .image-gallery-link').length ){ 633 $('.image-gallery').magnificPopup({ 634 delegate: '.image-gallery-link', 635 type: 'image', 636 closeOnContentClick: false, 637 closeBtnInside: false, 638 mainClass: 'mfp-with-zoom mfp-img-mobile', 639 gallery: { 640 enabled: true 641 }, 642 }); 643 } 644 645 if( $('.popup-video-post').length ){ 646 /* Magnific Popup Code */ 647 $('.popup-video-post').magnificPopup({ 648 disableOn: 700, 649 type: 'iframe', 650 mainClass: 'mfp-fade', 651 removalDelay: 160, 652 preloader: false, 653 fixedContentPos: false 654 }); 655 } 656 657 if( $('.popup-with-zoom-anim').length ){ 658 $('.popup-with-zoom-anim').magnificPopup({ 659 disableOn: 700, 660 type: 'inline', 661 mainClass: 'mfp-fade', 662 removalDelay: 160, 663 preloader: false, 664 fixedContentPos: false, 665 callbacks: { 666 open: function() { 667 // Play video on open: 668 if( !$( this.content ).find('video').length ){ 669 var parent = $( this.content ).parent( "post-video-wrap" ); 670 var url = $( this.content ).find('span').data( "url" ); 671 var video = '<video width="100%" height="450" preload="true" style="max-width:100%;" autoplay="true"><source src="'+ url +'" type="video/mp4"></video>'; 672 $( this.content ).find('span').replaceWith( video ); 673 }else{ 674 $(this.content).find('video')[0].load(); 675 } 676 }, 677 close: function() { 678 // Reset video on close: 679 $(this.content).find('video')[0].pause(); 680 681 } 682 } 683 }); 684 } 685 686 //Modal popup 687 if( $('.modal-popup-content').length ){ 688 /* Magnific Popup Code */ 689 $('.modal-box-trigger').magnificPopup({ 690 type: 'inline', 691 preloader: false, 692 focus: '#username', 693 modal: true, 694 mainClass: 'mfp-fade', 695 removalDelay: 300 696 }); 697 $(document).on('click', '.popup-modal-dismiss', function (e) { 698 e.preventDefault(); 699 $.magnificPopup.close(); 700 }); 701 } 702 703 //Egovenz Popup 704 if( $('.egovenz-popup-wrapper').length ){ 705 $('.egovenz-popup-trigger').magnificPopup({ 706 type: 'inline', 707 preloader: false, 708 //focus: '#username', 709 modal: true, 710 mainClass: 'mfp-fade', 711 removalDelay: 300 712 }); 713 $(document).on('click', '.egovenz-popup-dismiss', function (e) { 714 e.preventDefault(); 715 $.magnificPopup.close(); 716 }); 717 } 718
719 /* Set Blockquote Background */ 720 if( $( ".post-quote-wrap, .post-link-wrap" ).length ){ 721 $( ".post-quote-wrap, .post-link-wrap" ).each(function() { 722 var img_url = $(this).data('url'); 723 if( img_url ){ 724 $(this).css( 'background-image','url('+ img_url +')' ); 725 } 726 }); 727 } 728 729 /* Set Background Image */ 730 if( $( ".set-bg-img" ).length ){ 731 $( ".set-bg-img" ).each(function() { 732 var img_url = $(this).data('src'); 733 if( img_url ){ 734 $(this).css( 'background-image','url('+ img_url +')' ); 735 } 736 }); 737 } 738 739 /* Sticky Element */ 740 if( $( ".egovenz-sticky-wrapper" ).length ){ 741 $("a.egovenz-sticky-trigger").on( "click", function(e){ 742 $(this).parent(".egovenz-sticky-wrapper").toggleClass("active"); 743 return false; 744 }); 745 } 746 747 if( $('a.onclick-video-post').length ){ 748 $(document).on( "click", "a.onclick-video-post", function(){ 749 750 var parent = $(this).parent('.post-video-wrap'); 751 var frame = '<iframe src="'+ $(this).attr("href") +'?autoplay=1" width="100%" height="'+ parent.height() +'" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>'; 752 $(this).fadeOut(300); 753 $(this).replaceWith( frame ); 754 return false; 755 }); 756 } 757 758 if( $('a.onclick-custom-video').length ){ 759 $(document).on( "click", ".onclick-custom-video", function(){ 760 761 var parent = $(this).parent('.post-video-wrap'); 762 var video = '<video width="100%" height="'+ parent.height() +'" preload="true" style="max-width:100%;" autoplay="true"><source src="'+ $(this).data("url") +'" type="video/mp4"></video>'; 763 $(this).fadeOut(300); 764 $(this).replaceWith( video ); 765 return false; 766 }); 767 } 768 769 /* Page Title Background Video */ 770 if( $( "#page-title-bg .page-title-wrap-inner" ).length ){ 771 $( "#page-title-bg .page-title-wrap-inner" ).YTPlayer(); 772 } 773 774 /* Comments Like/Dislike */ 775 if( $(".comment-like-wrapper").length ){ 776 $( document ).on( 'click', ".comment-like", function( event) { 777 778 var cmt_cur = $(this); 779 var cmt_meta = cmt_cur.data('id'); 780 var cmt_id = cmt_cur.data('cmt-id'); 781 var parent = cmt_cur.parents('.comment-like-wrapper'); 782 if( cmt_meta == '1' ){ 783 cmt_cur.parents('.list-inline').find('.comment-liked').removeClass('theme-color comment-liked').addClass('comment-like'); 784 cmt_cur.removeClass('comment-like').addClass('theme-color comment-liked'); 785 }else{ 786 cmt_cur.parents('.list-inline').find('.comment-liked').removeClass('theme-color comment-liked').addClass('comment-like'); 787 cmt_cur.removeClass('comment-like').addClass('theme-color comment-liked'); 788 } 789 790 if( cmt_id != '' && cmt_meta != '' ){ 791 // Ajax call 792 (jQuery).ajax({ 793 type: "post", 794 url: egovenz_ajax_var.admin_ajax_url, 795 data: "action=comment_like&nonce="+egovenz_ajax_var.cmt_nonce+"&cmt_id="+cmt_id+"&cmt_meta="+cmt_meta, 796 success: function(res){ 797 $( parent ).html(res); 798 }, 799 error: function (jqXHR, exception) { 800 console.log(jqXHR); 801 } 802 }); 803 } 804 return false; 805 }); 806 } 807 808 /*Mailchimp Code*/ 809 if( $('.zozo-mc').length ){ 810 $('.zozo-mc').on( "click", function () { 811 812 var c_btn = $(this); 813 var mc_wrap = $( this ).parents('.mailchimp-wrapper'); 814 var mc_form = $( this ).parents('.zozo-mc-form'); 815 816 if( mc_form.find('input[name="zozo_mc_email"]').val() == '' ){ 817 mc_wrap.find('.mc-notice-msg').text( zoacres_ajax_var.must_fill ); 818 }else{ 819 c_btn.attr( "disabled", "disabled" ); 820 $.ajax({
821 type: "POST", 822 url: egovenz_ajax_var.admin_ajax_url, 823 data: 'action=zozo-mc&nonce='+egovenz_ajax_var.mc_nounce+'&'+mc_form.serialize(), 824 success: function (data) { 825 //Success 826 c_btn.removeAttr( "disabled" ); 827 if( data == 'success' ){ 828 mc_wrap.find('.mc-notice-msg').text( mc_wrap.find('.mc-notice-group').attr('data-success') ); 829 }else{ 830 mc_wrap.find('.mc-notice-msg').text( mc_wrap.find('.mc-notice-group').attr('data-fail') ); 831 } 832 },error: function(xhr, status, error) { 833 c_btn.removeAttr( "disabled" ); 834 mc_wrap.find('.mc-notice-msg').text( mc_wrap.find('.mc-notice-group').attr('data-fail') ); 835 } 836 }); 837 } 838 }); 839 } // if mailchimp exists 840 841 /* Facbook Comment Width Resize */ 842 if( $( '.fb-comments-wrapper' ).length ){ 843 $( window ).resize(function() { 844 setTimeout(function(){ 845 if($( window ).width() <= 768 ){ 846 $( ".fb-comments-wrapper iframe" ).width( $( ".content-area" ).width() ); 847 }else{ 848 $( ".fb-comments-wrapper iframe" ).width( $( ".content-area .fb-comments" ).data('width') ); 849 } 850 }, 200); 851 }); 852 } 853 854 /*Timeline Slide*/ 855 /*if( $('.cd-horizontal-timeline').length ){ 856 $('.cd-horizontal-timeline').each(function( index ) { 857 var cur_ele = $(this); 858 var line_dist = cur_ele.data("distance"); 859 cur_ele.zozotimeline({ 860 distance: line_dist 861 }); 862 }); 863 }*/ 864 865 if( $('.popover-wrapper .popover-trigger').length ){ 866 $(".popover-trigger").each(function( index ) { 867 var evnt_name = $(this).attr("data-event") ? $(this).attr("data-event") : 'hover'; 868 $(this).on( evnt_name, function ( e ) { 869 e.preventDefault(); 870 $(this).parents(".popover-wrapper").toggleClass("popover-active"); 871 }); 872 }); 873 } 874 875 $(window).scroll(function(){ 876 egovenz_scroll_animation(); 877 }); 878 879 }); // doc ready end 880 881 882 $( window ).load(function() { 883 884 if( $( ".header-slider-wrapper" ).length ){ 885 $( ".header-slider-wrapper" ).css({ 'height' : 'auto' }); 886 } 887 888 /* Grid Layout Set Width for Owl and Isotope */ 889 if( $( ".grid-layout.grid-normal" ).length ){ 890 891 $( ".grid-layout.grid-normal" ).each(function() { 892 893 var c_elem = $( this ); 894 var parent_width = c_elem.width(); 895 var gutter_size = c_elem.data( "gutter" ); 896 var grid_cols = c_elem.data( "cols" ); 897 898 var net_width = Math.floor( ( parent_width - ( gutter_size * ( grid_cols - 1 ) ) ) / grid_cols ); 899 var gn_ele = 1; // grid normal element variable 900 c_elem.children("article").each(function() { 901 if( gn_ele % grid_cols == 0 ){ 902 $( this ).css({'width':net_width+'px', 'margin-right': '0', 'margin-bottom': gutter_size+'px'}); 903 }else{ 904 $( this ).css({'width':net_width+'px', 'margin-right': gutter_size+'px', 'margin-bottom': gutter_size+'px'}); 905 } 906 gn_ele++; 907 }); 908 909 c_elem.children("article").addClass("grid-dyno-visible"); 910 911 $( window ).resize(function() { 912 setTimeout(function(){ 913 parent_width = c_elem.width(); 914 var mgrid_cols = 1; 915 if( $(window).width() < 768 ){ 916 mgrid_cols = 1; 917 }else{ 918 mgrid_cols = grid_cols; 919 } 920 var net_width = Math.floor( ( parent_width - ( gutter_size * ( mgrid_cols - 1 ) ) ) / mgrid_cols ); 921 var gn_ele = 1; // grid normal element variable 922 c_elem.children("article").each(function() { 923 if( gn_ele % mgrid_cols == 0 ){ 924 $( this ).css({'width':net_width+'px', 'margin-right': '0', 'margin-bottom': gutter_size+'px'}); 925 }else{ 926 $( this ).css({'width':net_width+'px', 'margin-right': gutter_size+'px', 'margin-bottom': gutter_size+'px'}); 927 } 928 gn_ele++; 929 }); 930 }, 200); 931 }); 932 933 c_elem.find( ".top-standard-post article" ).css({'width':'auto'}); 934 935 }); // each end 936 } // .grid-layout 937 938 /* Theme Owl Carousel Code */ 939 $( ".owl-carousel" ).each(function() { 940 if( !$( this ).parents( ".isotope" ).length ){ 941 egovenzOwlSettings( $( this ) ); 942 } 943 }); 944 945 /* Isotope Grid Layout */ 946 if( $( ".grid-layout > .isotope" ).length ){ 947 $( ".grid-layout > .isotope" ).each(function() { 948 949 var c_elem = $( this ); 950 var parent_width = c_elem.width(); 951 var gutter_size = c_elem.data( "gutter" ); 952 var grid_cols = c_elem.data( "cols" ); 953 954 var layoutmode = c_elem.is('[data-layout]') ? c_elem.data( "layout" ) : ''; 955 956 layoutmode = layoutmode ? layoutmode : 'masonry'; 957 958 if( $(window).width() < 768 ) grid_cols = 1; 959 960 var net_width = Math.floor( ( parent_width - ( gutter_size * ( grid_cols - 1 ) ) ) / grid_cols ); 961 c_elem.find( "article" ).css({'width':net_width+'px', 'margin-bottom':gutter_size+'px'}); 962 if( $( ".top-standard-post" ).length ){ 963 $( ".top-standard-post article" ).css({'margin-bottom':gutter_size+'px'}); 964 } 965 966 c_elem.find( ".owl-carousel" ).each(function() { 967 egovenzOwlSettings( $( this ) ); 968 }); 969 970 c_elem.find( "video" ).each(function( index ) { 971 $( this ).attr( "src", $( this ).find( "source" ).attr( "src" ) ); 972 $( this ).css({ 'height':'200px' }); 973 }); 974 975 var filter = "*"; 976 var isot_parent = c_elem.parent(".grid-layout"); 977 if( $( isot_parent ).attr("data-filter-stat") == 0 ){ 978 filter = $( isot_parent ).attr("data-first-cat") ? "." + $( isot_parent ).attr("data-first-cat") : '*'; 979 } 980 981 c_elem.imagesLoaded( function(){ 982 c_elem.isotope({ 983 itemSelector: 'article', 984 layoutMode: layoutmode, 985 filter: filter, 986 masonry: { 987 gutter: gutter_size 988 }, 989 fitRows: { 990 gutter: gutter_size 991 } 992 });
993 }); 994 995 c_elem.children("article").addClass("grid-dyno-visible"); 996 997 /* Portfolio Filter Item */ 998 if( $(".portfolio-filter").length ){ 999 $( ".portfolio-filter-item" ).on( 'click', function() { 1000 $( this ).parents("ul.nav").find("li").removeClass("active"); 1001 $( this ).parent("li").addClass("active"); 1002 var filterValue = $( this ).attr( "data-filter" ); 1003 c_elem = $( this ).parents( ".portfolio-wrapper" ).find( ".grid-layout .isotope" ); 1004 c_elem.isotope({ 1005 filter: filterValue 1006 }); 1007 return false; 1008 }); 1009 } 1010 1011 $( window ).resize(function() { 1012 1013 setTimeout(function(){ 1014 grid_cols = c_elem.data( "cols" ); 1015 if( $(window).width() < 768 ) grid_cols = 1; 1016 1017 var parent_width = c_elem.width(); 1018 net_width = Math.floor( ( parent_width - ( gutter_size * ( grid_cols - 1 ) ) ) / grid_cols ); 1019 c_elem.find( "article" ).css({'width':net_width+'px'}); 1020 c_elem.imagesLoaded( function(){ 1021 var $isot = c_elem.isotope({ 1022 itemSelector: 'article', 1023 masonry: { 1024 gutter: gutter_size 1025 } 1026 }); 1027 $isot.on( 'arrangeComplete', isotopeArrange ); 1028 }); 1029 1030 }, 200); 1031 1032 }); 1033 1034 // Isotope Grid Infinite 1035 if( c_elem.data( "infinite" ) == 1 && $(".post-pagination").length ){ 1036 1037 c_elem.infinitescroll({ 1038 navSelector : '.post-pagination',//'#page_nav', // selector for the paged navigation 1039 nextSelector : 'a.next-page',//'#page_nav a', // selector for the NEXT link (to page 2) 1040 itemSelector : 'article', // selector for all items you'll retrieve 1041 loading: { 1042 msgText : egovenz_ajax_var.load_posts, 1043 finishedMsg: egovenz_ajax_var.no_posts, 1044 img: egovenz_ajax_var.infinite_loader 1045 } 1046 }, 1047 // call Isotope as a callback 1048 function( newElements ) { 1049 1050 var elems = $(newElements); 1051 1052 var net_width = Math.floor( ( parent_width - ( gutter_size * ( grid_cols - 1 ) ) ) / grid_cols ); 1053 c_elem.find( "article" ).css({'width':net_width+'px', 'margin-bottom':gutter_size+'px'}); 1054 if( $( ".top-standard-post" ).length ){ 1055 $( ".top-standard-post article" ).css({'margin-bottom':gutter_size+'px'}); 1056 } 1057 1058 c_elem.find( ".owl-carousel" ).each(function() { 1059 egovenzOwlSettings( $( this ) ); 1060 }); 1061 1062 elems.find( "video" ).each(function( index ) { 1063 $( this ).attr( "src", $( this ).find( "source" ).attr( "src" ) ); 1064 $( this ).css({ 'height':'200px' }); 1065 }); 1066 1067 elems.imagesLoaded( function(){ 1068 c_elem.isotope( 'appended', elems ); 1069 elems.addClass("grid-dyno-visible"); 1070 }); 1071 1072 if( c_elem.find( "article" ).hasClass( "egovenz-animate" ) ){ 1073 egovenz_scroll_animation(); 1074 } 1075 1076 }); 1077 } 1078 }); // each end 1079 } 1080 1081 /* Related Slider Empty Post Image Height Set */ 1082 if( $( ".related-slider .empty-post-image" ).length ){ 1083 if( $( ".related-slider .item .wp-post-image" ).length ){ 1084 $( ".related-slider .item .empty-post-image" ).height( $( ".related-slider .item .wp-post-image" ).height() ); 1085 } 1086 } 1087 1088 /* Featured Slider Empty Post Image Height Set */ 1089 if( $( ".featured-slider .empty-post-image" ).length ){ 1090 if( $( ".featured-slider .item .wp-post-image" ).length ){ 1091 $( ".featured-slider .item .empty-post-image" ).height( $( ".featured-slider .item .wp-post-image" ).height() ); 1092 } 1093 } 1094 1095 /* Sticky Sidebar */ 1096 if( $( ".egovenz-sticky-obj" ).length ){ 1097 var $sticky_sidebars = $( ".egovenz-sticky-obj" ); 1098 if( $( window ).width() > 767 ) { 1099 $sticky_sidebars.stick_in_parent(); 1100 } 1101 $( window ).resize(function() { 1102 if( $( window ).width() > 767 ) { 1103 $sticky_sidebars.trigger( "sticky_kit:detach" ); 1104 $sticky_sidebars.stick_in_parent(); 1105 $sticky_sidebars.trigger( "sticky_kit:recalc" ); 1106 }else{ 1107 $sticky_sidebars.trigger( "sticky_kit:detach" ); 1108 } 1109 }); 1110 } 1111 1112 /* Circle Counter Shortcode Script */ 1113 if( $( '.circle-progress-circle' ).length ){ 1114 var circle = $( '.circle-progress-circle' ); 1115 circle.appear(function() { 1116 1117 var c_circle = $( this ); 1118 var c_value = c_circle.attr( "data-value" ); 1119 var c_size = c_circle.attr( "data-size" ); 1120 var c_thickness = c_circle.attr( "data-thickness" ); 1121 var c_duration = c_circle.attr( "data-duration" ); 1122 var c_empty = c_circle.attr( "data-empty" ) != '' ? c_circle.attr( "data-empty" ) : 'transparent'; 1123 var c_scolor = c_circle.attr( "data-scolor" ); 1124 var c_ecolor = c_circle.attr( "data-ecolor" ) != '' ? c_circle.attr( "data-ecolor" ) : c_scolor; 1125 1126 c_circle.circleProgress({ 1127 value: Math.floor( c_value ) / 100, 1128 size: Math.floor( c_size ), 1129 thickness: Math.floor( c_thickness ), 1130 emptyFill: c_empty, 1131 animation: { 1132 duration: Math.floor( c_duration ) 1133 }, 1134 lineCap: 'round', 1135 fill: { 1136 gradient: [c_scolor, c_ecolor] 1137 } 1138 }).on( 'circle-animation-progress', function( event, progress ) { 1139 $( this ).find( '.progress-value' ).html( Math.round( c_value * progress ) + '%' ); 1140 }); 1141 }); 1142 } 1143 1144 /* Day Counter Shortcode Script */ 1145 if( $( '.day-counter' ).length ){ 1146 $( '.day-counter' ).each(function() { 1147 var day_counter = $( this ); 1148 var dprogress = $(day_counter).hasClass("day-counter-progress") ? true : false; 1149 var c_date = day_counter.attr('data-date'); 1150 day_counter.countdown( c_date, function(event) { 1151 if( day_counter.find('.counter-day').length ){ 1152 day_counter.find('.counter-day h3').text( event.strftime('%D') ); 1153 if( dprogress ){ 1154 var yr = parseInt( event.strftime('%D') ); 1155 yr = yr ? parseInt( yr / 365 * 100 ) : 100; 1156 egovenzDayCircle( day_counter.find('.counter-day'), yr ); 1157 } 1158 } 1159 if( day_counter.find('.counter-hour').length ){ 1160 day_counter.find('.counter-hour h3').text( event.strftime('%H') ); 1161 if( dprogress ){ 1162 var hur = parseInt( event.strftime('%H') ); 1163 hur = hur ? parseInt( hur / 24 * 100 ) : 100; 1164 egovenzDayCircle( day_counter.find('.counter-hour'), hur ); 1165 } 1166 } 1167 if( day_counter.find('.counter-min').length ){ 1168 day_counter.find('.counter-min h3').text( event.strftime('%M') ); 1169 if( dprogress ){ 1170 var mnth = parseInt( event.strftime('%M') ); 1171 mnth = mnth ? parseInt( mnth / 60 * 100 ) : 100; 1172 egovenzDayCircle( day_counter.find('.counter-min'), mnth ); 1173 } 1174 } 1175 if( day_counter.find('.counter-sec').length ){ 1176 day_counter.find('.counter-sec h3').text( event.strftime('%S') ); 1177 if( dprogress ){ 1178 var tme = parseInt( event.strftime('%S') ); 1179 tme = tme ? parseInt( tme / 60 * 100 ) : 100; 1180 egovenzDayCircle( day_counter.find('.counter-sec'), tme ); 1181 } 1182 } 1183 if( day_counter.find('.counter-week').length ){ 1184 day_counter.find('.counter-week h3').text( event.strftime('%w') ); 1185 if( dprogress ){ 1186 var wk = parseInt( event.strftime('%S') ); 1187 wk = wk ? parseInt( wk / 60 * 100 ) : 100; 1188 egovenzDayCircle( day_counter.find('.counter-week'), wk ); 1189 } 1190 } 1191 }); 1192 }); 1193 } 1194 1195 /* Canvas Shapes */ 1196 if( $(".canvas_agon").length ){ 1197 $( '.canvas_agon' ).each(function() { 1198 egovenzAgon( $(this) ); 1199 }); 1200 } 1201 1202 if( $(".vc_chart").length ){ 1203 $(".vc_chart").trigger( "resize" ); 1204 } 1205 1206 }); 1207 1208 // Using window smartresize instead of resize function 1209 $( window ).smartresize(function() { 1210 1211 /* Custom Responsive Width */ 1212 var win_width = $(window).width(); 1213 if( responsive_width ){ 1214 egovenzSetCustomHiddenElements( win_width, responsive_width ); 1215 } 1216 1217 /* Mobile Bar Toggle */ 1218 setTimeout( function(){ $(".mobile-bar.active").length ? $( ".mobile-header .mobile-bar-toggle" ).trigger( "click" ) : ''; }, 100 ); 1219 1220 /* Pull Center Reset */ 1221 setTimeout( egovenzCenterMenuMargin, 300 ); 1222 1223 /* Sticky Menu */ 1224 if($('.header-inner .sticky-head').length){ 1225 setTimeout( egovenzStickyPart( '.header-inner' ), 100 ); 1226 } 1227 1228 /* Scroll Sticky */ 1229 if($('.header-inner .sticky-scroll').length){ 1230 setTimeout( egovenzStickyScrollUpPart( '.header-inner', 'header' ), 100 ); 1231 } 1232 1233 /* Mobile Header Sticky Menu */ 1234 if($('.mobile-header-inner .sticky-head').length){ 1235 setTimeout( egovenzStickyPart( '.mobile-header-inner' ), 100 ); 1236 } 1237 1238 /* Mobile Header Scroll Sticky */ 1239 if($('.mobile-header-inner .sticky-scroll').length){ 1240 setTimeout( egovenzStickyScrollUpPart( '.mobile-header-inner', '.mobile-header' ), 100 ); 1241 } 1242 1243 egovenz_scroll_animation(); 1244 1245 }); 1246 1247 $( window ).load(function() { 1248 if( $( ".egovenzgmap" ).length ){ 1249 initEgovenzGmap(); 1250 } 1251 1252 egovenz_scroll_animation(); 1253 }); 1254 1255 //Day Counter Progress 1256 function egovenzDayCircle( ele, value ){ 1257 var c_circle = $( ele ); 1258 var parent_ele = $( ele ).parent( ".day-counter-progress" ); 1259 var c_value = value; 1260 var c_size = $( parent_ele ).attr("data-size") ? $( parent_ele ).attr("data-size") : 100; 1261 var c_thickness = $( parent_ele ).attr("data-thick") ? $( parent_ele ).attr("data-thick") : 10; 1262 var c_duration = 0; 1263 var c_empty = $( parent_ele ).attr("data-empty-color") ? $( parent_ele ).attr("data-empty-color") : '#eee'; 1264 var c_scolor = $( parent_ele ).attr("data-fill-color") ? $( parent_ele ).attr("data-fill-color") : '#333'; 1265 var c_ecolor = c_scolor; 1266
1267 c_circle.circleProgress({ 1268 value: Math.floor( c_value ) / 100, 1269 size: Math.floor( c_size ), 1270 thickness: Math.floor( c_thickness ), 1271 emptyFill: c_empty, 1272 animation: { 1273 duration: Math.floor( c_duration ) 1274 }, 1275 lineCap: 'round', 1276 fill: { 1277 gradient: [c_scolor, c_ecolor] 1278 } 1279 }); 1280 } 1281 1282 1283 function egovenz_fix_vc_full_width_row(){ 1284 var $elements = $('*[data-vc-full-width="true"]'); 1285 ($).each($elements, function () { 1286 var $el = $(this); 1287 if( $el.parent(".vc_section").length ){ 1288 var $vc_sec_parent = $el.parent(".vc_section"); 1289 var $row_right = $vc_sec_parent.css('right'); 1290 var $row_padding_right = $vc_sec_parent.css('padding-right'); 1291 var $row_padding_left = $vc_sec_parent.css('padding-left'); 1292 $el.css({'right':$row_right, 'padding-right':$row_padding_right, 'padding-left':$row_padding_left, 'left':''}); 1293 }else{ 1294 $el.css('right', $el.css('left')).css({'left':''}); 1295 } 1296 }); 1297 } 1298 1299 function isotopeArrange() { 1300 $( ".grid-layout > .isotope" ).find( "audio, video" ).each(function( index ) { 1301 $( this )[0].play(); 1302 $( this )[0].pause(); 1303 }); 1304 } 1305 1306 function egovenzSetCustomHiddenElements( win_width, responsive_width ){ 1307 if( win_width > responsive_width ){ 1308 $(".header-inner").show(); 1309 $(".mobile-header-inner, .mobile-topbar-wrap").hide(); 1310 }else{ 1311 $(".header-inner").hide(); 1312 $(".mobile-header-inner, .mobile-topbar-wrap").show(); 1313 } 1314 } 1315 1316 function egovenzStickyHeaderAdjust(elem_pos, elem_width){ 1317 var win_width = $(window).width(); 1318 var compare_wdth; 1319 if( $('.egovenz-header .header-inner.hidden-md-land-down' ).length ){ 1320 compare_wdth = 1024; 1321 }else{ 1322 compare_wdth = 991; 1323 } 1324 if( win_width <= compare_wdth ){ 1325 if( elem_pos == 'left' ){ 1326 $('.sticky-header-space').css( 'left', '-'+ elem_width +'px' ); 1327 $('body, .top-sliding-bar').css( 'padding-left', '0' ); 1328 }else{ 1329 $('.sticky-header-space').css( 'right', '-'+ elem_width +'px' ); 1330 $('body, .top-sliding-bar').css( 'padding-right', '0' ); 1331 } 1332 }else{ 1333 if( elem_pos == 'left' ){ 1334 $('.sticky-header-space').css( 'left', 0 ); 1335 $('body, .top-sliding-bar').css( 'padding-left', elem_width +'px' ); 1336 }else{ 1337 $('.sticky-header-space').css( 'right', 0 ); 1338 $('body, .top-sliding-bar').css( 'padding-right', elem_width +'px' ); 1339 } 1340 } 1341 } 1342 1343 function egovenzCenterMenuMargin(){ 1344 //Center item margin fixing 1345 $.each([ 'topbar', 'logobar', 'navbar', 'mobile-header', 'footer-bottom' ], function( index, margin_key ) { 1346 1347 var left_width = 0, 1348 right_width = 0, 1349 center_width = 0, 1350 margin_left = 0, 1351 parent_width = 0; 1352 1353 if( $('.'+ margin_key +' .'+ margin_key +'-inner').length ){ 1354 1355 if( margin_key == 'mobile-header' ) 1356 parent_width = $('.'+ margin_key +' .'+ margin_key +'-inner .container').width(); 1357 else 1358 parent_width = $('.'+ margin_key +' .'+ margin_key +'-inner').width(); 1359 1360 if( $('.'+ margin_key +' .'+ margin_key +'-inner .'+ margin_key +'-items.pull-left').length ){ 1361 left_width = $('.'+ margin_key +' .'+ margin_key +'-inner .'+ margin_key +'-items.pull-left').width(); 1362 } 1363 if( $('.'+ margin_key +' .'+ margin_key +'-inner .'+ margin_key +'-items.pull-right').length ){ 1364 right_width = $('.'+ margin_key +' .'+ margin_key +'-inner .'+ margin_key +'-items.pull-right').width(); 1365 } 1366 if( $('.'+ margin_key +' .'+ margin_key +'-inner .'+ margin_key +'-items.pull-center').length ){ 1367 center_width = $('.'+ margin_key +' .'+ margin_key +'-inner .'+ margin_key +'-items.pull-center').width(); 1368 } 1369 1370 if( left_width + center_width + right_width ){ 1371 1372 if( margin_key == 'mobile-header' ){ 1373 parent_width -= ( left_width + center_width + right_width ); 1374 margin_left = parent_width / 2; 1375 }else{ 1376 parent_width = ( parent_width / 2 ) - ( center_width / 2 ); 1377 margin_left = Math.floor( parent_width - left_width ); 1378 } 1379 1380 if( !$( "body.rtl" ).length ){ 1381 $('.'+ margin_key +' .'+ margin_key +'-inner .'+ margin_key +'-items.pull-center').css( 'margin-left', margin_left+'px' ); 1382 }else{ 1383 $('.'+ margin_key +' .'+ margin_key +'-inner .'+ margin_key +'-items.pull-center').css( 'margin-right', margin_left+'px' ); 1384 } 1385 1386 $('.'+ margin_key +' .'+ margin_key +'-inner .'+ margin_key +'-items.pull-center').addClass("show-opacity"); 1387 1388 } 1389 } 1390 }); 1391 } 1392 1393 function egovenzStickyPart( main_class ){ 1394 1395 var outer_class = '.sticky-outer'; 1396 var lastScrollTop = 0; 1397 var header_top = 0; 1398 1399 var t_header_h = $(main_class + ' ' + outer_class).data( "height" ); 1400 $(main_class + ' ' + outer_class).css( 'height', t_header_h ); 1401 header_top = $(main_class + ' ' + outer_class).offset().top; 1402 header_top += t_header_h; 1403 1404 $(window).scroll(function(event){ 1405 1406 var st = $(this).scrollTop(); 1407 if( st > header_top ){ 1408 $(main_class + ' .sticky-head').addClass('header-sticky'); 1409 }else{ 1410 $(main_class + ' .sticky-head').removeClass('header-sticky'); 1411 } 1412 1413 if( st == 0 ){ 1414 $(main_class + ' .sticky-head').removeClass('header-sticky'); 1415 } 1416 1417 lastScrollTop = st; 1418 }); 1419 } 1420 1421 function egovenzStickyScrollUpPart( main_class, sticky_div ){ 1422 1423 var outer_class = '.sticky-outer'; 1424 var out_height = ''; 1425 var lastScrollTop = 0; 1426 var header_top = 0; 1427 1428 $(main_class + ' ' + outer_class).css( 'height', $(main_class + ' ' + outer_class).data( "height" ) ); 1429 out_height = '-' + $(main_class + ' ' + outer_class).outerHeight() + 'px'; 1430 header_top = $(main_class + ' ' + outer_class).offset().top; 1431 sticky_div = $(sticky_div).height(); 1432 1433 $(window).scroll(function(event){ 1434 1435 var st = $(this).scrollTop(); 1436 1437 if( st < lastScrollTop && header_top < lastScrollTop ){ 1438 // upscroll code 1439 $(main_class + ' .sticky-scroll').addClass('show-menu'); 1440 $(main_class + ' .sticky-scroll.show-menu').css({'transform': 'translate3d(0px, 0px, 0px)'}); 1441 }else{ 1442 // downscroll code 1443 if( st < sticky_div ){ 1444 $(main_class + ' .sticky-scroll').css({'transform': ''}); 1445 $(main_class + ' .sticky-scroll.show-menu').removeClass('show-menu'); 1446 }else{ 1447 $(main_class + ' .sticky-scroll').css({'transform': 'translate3d(0px, '+ out_height +', 0px)'}); 1448 } 1449 } 1450 1451 if( st == 0 ){ 1452 $(main_class + ' .sticky-scroll').css({'transform': ''}); 1453 $(main_class + ' .sticky-scroll.show-menu').removeClass('show-menu'); 1454 } 1455 1456 lastScrollTop = st; 1457 }); 1458 1459 } 1460 1461 function egovenzSetStickyOuterHeight(){ 1462 $( ".sticky-outer" ).each(function() { 1463 1464 var class_name = ''; 1465 var sticky_parent = $( this ).parent( "div" ); 1466 1467 if( $( sticky_parent ).is('[class*=hidden-]') ){ 1468 class_name = $( sticky_parent ).attr("class"); 1469 var t_stat = ''; 1470 if( $( sticky_parent ).hasClass( "mobile-header-inner" ) ){
1471 class_name = class_name.replace( "mobile-header-inner", "" ); 1472 t_stat = 'm'; 1473 } 1474 if( $( sticky_parent ).hasClass( "header-inner" ) ){ 1475 class_name = class_name.replace( "header-inner", "" ); 1476 t_stat = 'd'; 1477 } 1478 $( sticky_parent ).attr("class", ""); 1479 if( t_stat == 'm' ){ 1480 $( sticky_parent ).attr("class", "mobile-header-inner"); 1481 } 1482 if( t_stat == 'd' ){ 1483 $( sticky_parent ).attr("class", "header-inner"); 1484 } 1485 } 1486 1487 $( this ).css({ 'position':'absolute', 'visibility':'hidden', 'display':'block', 'height':'auto' }); 1488 $( this ).attr( "data-height", $( this ).outerHeight() ); 1489 1490 if( class_name != '' ){ 1491 $( sticky_parent ).addClass(class_name); 1492 } 1493 1494 $( this ).css({ 'position':'', 'visibility':'', 'display':'', 'height': $( this ).data( "height" ) }); 1495 1496 }); 1497 } 1498 1499 function egovenzAgon( canvas_ele ){ 1500 var canvas = document.getElementById("canvas_agon"); 1501 var cxt = canvas.getContext("2d"); 1502 var agon_size = canvas_ele.attr( "data-size" ); 1503 var agon_side = canvas_ele.attr( "data-side" ); 1504 var agon_color = canvas_ele.attr( "data-color" ); 1505 var div_val = 1; 1506 1507 switch( parseInt( agon_side ) ){ 1508 case 3: 1509 div_val = 6; 1510 break; 1511 case 4: 1512 div_val = 4; 1513 break; 1514 case 5: 1515 div_val = 3.3; 1516 break; 1517 case 6: 1518 div_val = 3; 1519 break; 1520 case 7: 1521 div_val = 2.8; 1522 break; 1523 case 8: 1524 div_val = 2.7; 1525 break; 1526 case 9: 1527 div_val = 2.6; 1528 break; 1529 case 10: 1530 div_val = 2.5; 1531 break; 1532 } 1533 1534 // hexagon 1535 var numberOfSides = parseInt( agon_side ), 1536 size = parseInt( agon_size ), 1537 Xcenter = parseInt( agon_size ), 1538 Ycenter = parseInt( agon_size ), 1539 step = 2 * Math.PI / numberOfSides,//Precalculate step value 1540 shift = (Math.PI / div_val);//(Math.PI / 180.0);// * 44;//Quick fix ;) 1541 1542 cxt.beginPath(); 1543 1544 for (var i = 0; i <= numberOfSides;i++) { 1545 var curStep = i * step + shift; 1546 cxt.lineTo (Xcenter + size * Math.cos(curStep), Ycenter + size * Math.sin(curStep)); 1547 } 1548 1549 /* Direct Output */ 1550 cxt.fillStyle = agon_color; 1551 cxt.fill(); 1552 } 1553 1554 function egovenztesipagecallback(event){ 1555 var current = event.item.index; 1556 $( event.target ).find(".owl-item.active").eq(0).addClass("current"); 1557 } 1558 1559 function egovenzOwlSettings(c_owlCarousel){ 1560 1561 var page_slide = false; 1562 var pagi_slide = false; 1563 if( c_owlCarousel.hasClass("egovenz-page-carousel") ){ page_slide = true; } 1564 if( c_owlCarousel.hasClass("egovenz-pagination-carousel") ){ pagi_slide = true; } 1565 1566 // Data Properties 1567 var loop = c_owlCarousel.data( "loop" ); 1568 var margin = c_owlCarousel.data( "margin" ); 1569 var center = c_owlCarousel.data( "center" ); 1570 var nav = c_owlCarousel.data( "nav" ); 1571 var dots_ = c_owlCarousel.data( "dots" ); 1572 var items = c_owlCarousel.data( "items" ); 1573 var items_tab = c_owlCarousel.data( "items-tab" ); 1574 var items_mob = c_owlCarousel.data( "items-mob" ); 1575 var duration = c_owlCarousel.data( "duration" ); 1576 var smartspeed = c_owlCarousel.data( "smartspeed" ); 1577 var scrollby = c_owlCarousel.data( "scrollby" ); 1578 var autoheight = c_owlCarousel.data( "autoheight" ); 1579 var autoplay = c_owlCarousel.data( "autoplay" ); 1580 var rtl = $( "body.rtl" ).length ? true : false; 1581 1582 $( c_owlCarousel ).owlCarousel({ 1583 rtl : rtl, 1584 loop : loop, 1585 autoplayTimeout : duration, 1586 smartSpeed : smartspeed, 1587 center: center, 1588 margin : margin, 1589 nav : nav, 1590 dots : dots_, 1591 autoplay : autoplay, 1592 autoheight : autoheight, 1593 slideBy : scrollby, 1594 responsive:{ 1595 0:{ 1596 items: items_mob 1597 }, 1598 544:{ 1599 items: items_tab 1600 }, 1601 992:{ 1602 items: items 1603 } 1604 }, 1605 onInitialized: pagi_slide ? egovenztesipagecallback : '' 1606 }); 1607 1608 if( pagi_slide ){ 1609 var cur_testi_slide = $( c_owlCarousel ).parent("div").children(".egovenz-page-carousel"); 1610 var cur_pagination_slide = $( c_owlCarousel ); 1611 $( c_owlCarousel ).on('click', '.owl-item', function(event) { 1612 var current = $(this).index(); 1613 $(cur_testi_slide).trigger("to.owl.carousel", [current, 500]); 1614 }); 1615 $( c_owlCarousel ).on('dragged.owl.carousel', function(event) { 1616 var current = event.item.index; 1617 $(cur_testi_slide).trigger("to.owl.carousel", [current, 500]); 1618 cur_pagination_slide.find(".owl-item.current").removeClass("current"); 1619 cur_pagination_slide.find(".owl-item").eq(current).addClass("current"); 1620 }); 1621 } 1622 if( page_slide ){ 1623 var cur_pagination_slide = $( c_owlCarousel ).parent("div").children(".egovenz-pagination-carousel"); 1624 $( c_owlCarousel ).on('changed.owl.carousel', function(event) { 1625 var current = event.item.index; 1626 $(cur_pagination_slide).trigger("to.owl.carousel", [current, 500]); 1627 $(cur_pagination_slide).find(".owl-item.current").removeClass("current"); 1628 $(cur_pagination_slide).find(".owl-item").eq(current).addClass("current"); 1629 }); 1630 } 1631 1632 } 1633 1634 function convert_time(duration) { 1635 var a = duration.match(/\d+/g); 1636 1637 if (duration.indexOf('M') >= 0 && duration.indexOf('H') == -1 && duration.indexOf('S') == -1) { 1638 a = [0, a[0], 0]; 1639 } 1640 1641 if (duration.indexOf('H') >= 0 && duration.indexOf('M') == -1) { 1642 a = [a[0], 0, a[1]];
1643 } 1644 if (duration.indexOf('H') >= 0 && duration.indexOf('M') == -1 && duration.indexOf('S') == -1) { 1645 a = [a[0], 0, 0]; 1646 } 1647 1648 duration = 0; 1649 1650 if (a.length == 3) { 1651 duration = duration + parseInt(a[0]) * 3600; 1652 duration = duration + parseInt(a[1]) * 60; 1653 duration = duration + parseInt(a[2]); 1654 } 1655 1656 if (a.length == 2) { 1657 duration = duration + parseInt(a[0]) * 60; 1658 duration = duration + parseInt(a[1]); 1659 } 1660 1661 if (a.length == 1) { 1662 duration = duration + parseInt(a[0]); 1663 } 1664 var h = Math.floor(duration / 3600); 1665 var m = Math.floor(duration % 3600 / 60); 1666 var s = Math.floor(duration % 3600 % 60); 1667 return ((h > 0 ? h + ":" + (m < 10 ? "0" : "") : "") + m + ":" + (s < 10 ? "0" : "") + s); 1668 } 1669 1670 function egovenz_scroll_animation(){ 1671 setTimeout( function() { 1672 var anim_time = 300; 1673 $('.egovenz-animate:not(.run-animate)').each( function() { 1674 1675 var elem = $(this); 1676 var bottom_of_object = elem.offset().top; 1677 var bottom_of_window = $(window).scrollTop() + $(window).height(); 1678 1679 if( bottom_of_window > bottom_of_object ){ 1680 setTimeout( function() { 1681 elem.addClass("run-animate"); 1682 }, anim_time ); 1683 } 1684 anim_time += 300; 1685 1686 }); 1687 }, 200 ); 1688 } 1689 1690 function initEgovenzGmap() { 1691 1692 1693 if( egovenz_ajax_var.gmap_stat == '0' ){ 1694 return; 1695 } 1696 1697 var map_styles = '{ "Aubergine" : [ {"elementType":"geometry","stylers":[{"color":"#1d2c4d"}]},{"elementType":"labels.text.fill","stylers":[{"color":"#8ec3b9"}]},{"elementType":"labels.text.stroke","stylers":[{"color":"#1a3646"}]},{"featureType":"administrative.country","elementType":"geometry.stroke","stylers":[{"color":"#4b6878"}]},{"featureType":"administrative.land_parcel","elementType":"labels.text.fill","stylers":[{"color":"#64779e"}]},{"featureType":"administrative.province","elementType":"geometry.stroke","stylers":[{"color":"#4b6878"}]},{"featureType":"landscape.man_made","elementType":"geometry.stroke","stylers":[{"color":"#334e87"}]},{"featureType":"landscape.natural","elementType":"geometry","stylers":[{"color":"#023e58"}]},{"featureType":"poi","elementType":"geometry","stylers":[{"color":"#283d6a"}]},{"featureType":"poi","elementType":"labels.text.fill","stylers":[{"color":"#6f9ba5"}]},{"featureType":"poi","elementType":"labels.text.stroke","stylers":[{"color":"#1d2c4d"}]},{"featureType":"poi.park","elementType":"geometry.fill","stylers":[{"color":"#023e58"}]},{"featureType":"poi.park","elementType":"labels.text.fill","stylers":[{"color":"#3C7680"}]},{"featureType":"road","elementType":"geometry","stylers":[{"color":"#304a7d"}]},{"featureType":"road","elementType":"labels.text.fill","stylers":[{"color":"#98a5be"}]},{"featureType":"road","elementType":"labels.text.stroke","stylers":[{"color":"#1d2c4d"}]},{"featureType":"road.highway","elementType":"geometry","stylers":[{"color":"#2c6675"}]},{"featureType":"road.highway","elementType":"geometry.stroke","stylers":[{"color":"#255763"}]},{"featureType":"road.highway","elementType":"labels.text.fill","stylers":[{"color":"#b0d5ce"}]},{"featureType":"road.highway","elementType":"labels.text.stroke","stylers":[{"color":"#023e58"}]},{"featureType":"transit","elementType":"labels.text.fill","stylers":[{"color":"#98a5be"}]},{"featureType":"transit","elementType":"labels.text.stroke","stylers":[{"color":"#1d2c4d"}]},{"featureType":"transit.line","elementType":"geometry.fill","stylers":[{"color":"#283d6a"}]},{"featureType":"transit.station","elementType":"geometry","stylers":[{"color":"#3a4762"}]},{"featureType":"water","elementType":"geometry","stylers":[{"color":"#0e1626"}]},{"featureType":"water","elementType":"labels.text.fill","stylers":[{"color":"#4e6d70"}]}], "Silver" : [{"elementType":"geometry","stylers":[{"color":"#f5f5f5"}]},{"elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"elementType":"labels.text.fill","stylers":[{"color":"#616161"}]},{"elementType":"labels.text.stroke","stylers":[{"color":"#f5f5f5"}]},{"featureType":"administrative.land_parcel","elementType":"labels.text.fill","stylers":[{"color":"#bdbdbd"}]},{"featureType":"poi","elementType":"geometry","stylers":[{"color":"#eeeeee"}]},{"featureType":"poi","elementType":"labels.text.fill","stylers":[{"color":"#757575"}]},{"featureType":"poi.park","elementType":"geometry","stylers":[{"color":"#e5e5e5"}]},{"featureType":"poi.park","elementType":"labels.text.fill","stylers":[{"color":"#9e9e9e"}]},{"featureType":"road","elementType":"geometry","stylers":[{"color":"#ffffff"}]},{"featureType":"road.arterial","elementType":"labels.text.fill","stylers":[{"color":"#757575"}]},{"featureType":"road.highway","elementType":"geometry","stylers":[{"color":"#dadada"}]},{"featureType":"road.highway","elementType":"labels.text.fill","stylers":[{"color":"#616161"}]},{"featureType":"road.local","elementType":"labels.text.fill","stylers":[{"color":"#9e9e9e"}]},{"featureType":"transit.line","elementType":"geometry","stylers":[{"color":"#e5e5e5"}]},{"featureType":"transit.station","elementType":"geometry","stylers":[{"color":"#eeeeee"}]},{"featureType":"water","elementType":"geometry","stylers":[{"color":"#c9c9c9"}]},{"featureType":"water","elementType":"labels.text.fill","stylers":[{"color":"#9e9e9e"}]}], "Retro" : [{"elementType":"geometry","stylers":[{"color":"#ebe3cd"}]},{"elementType":"labels.text.fill","stylers":[{"color":"#523735"}]},{"elementType":"labels.text.stroke","stylers":[{"color":"#f5f1e6"}]},{"featureType":"administrative","elementType":"geometry.stroke","stylers":[{"color":"#c9b2a6"}]},{"featureType":"administrative.land_parcel","elementType":"geometry.stroke","stylers":[{"color":"#dcd2be"}]},{"featureType":"administrative.land_parcel","elementType":"labels.text.fill","stylers":[{"color":"#ae9e90"}]},{"featureType":"landscape.natural","elementType":"geometry","stylers":[{"color":"#dfd2ae"}]},{"featureType":"poi","elementType":"geometry","stylers":[{"color":"#dfd2ae"}]},{"featureType":"poi","elementType":"labels.text.fill","stylers":[{"color":"#93817c"}]},{"featureType":"poi.park","elementType":"geometry.fill","stylers":[{"color":"#a5b076"}]},{"featureType":"poi.park","elementType":"labels.text.fill","stylers":[{"color":"#447530"}]},{"featureType":"road","elementType":"geometry","stylers":[{"color":"#f5f1e6"}]},{"featureType":"road.arterial","elementType":"geometry","stylers":[{"color":"#fdfcf8"}]},{"featureType":"road.highway","elementType":"geometry","stylers":[{"color":"#f8c967"}]},{"featureType":"road.highway","elementType":"geometry.stroke","stylers":[{"color":"#e9bc62"}]},{"featureType":"road.highway.controlled_access","elementType":"geometry","stylers":[{"color":"#e98d58"}]},{"featureType":"road.highway.controlled_access","elementType":"geometry.stroke","stylers":[{"color":"#db8555"}]},{"featureType":"road.local","elementType":"labels.text.fill","stylers":[{"color":"#806b63"}]},{"featureType":"transit.line","elementType":"geometry","stylers":[{"color":"#dfd2ae"}]},{"featureType":"transit.line","elementType":"labels.text.fill","stylers":[{"color":"#8f7d77"}]},{"featureType":"transit.line","elementType":"labels.text.stroke","stylers":[{"color":"#ebe3cd"}]},{"featureType":"transit.station","elementType":"geometry","stylers":[{"color":"#dfd2ae"}]},{"featureType":"water","elementType":"geometry.fill","stylers":[{"color":"#b9d3c2"}]},{"featureType":"water","elementType":"labels.text.fill","stylers":[{"color":"#92998d"}]}], "Dark" : [{"elementType":"geometry","stylers":[{"color":"#212121"}]},{"elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"elementType":"labels.text.fill","stylers":[{"color":"#757575"}]},{"elementType":"labels.text.stroke","stylers":[{"color":"#212121"}]},{"featureType":"administrative","elementType":"geometry","stylers":[{"color":"#757575"}]},{"featureType":"administrative.country","elementType":"labels.text.fill","stylers":[{"color":"#9e9e9e"}]},{"featureType":"administrative.land_parcel","stylers":[{"visibility":"off"}]},{"featureType":"administrative.locality","elementType":"labels.text.fill","stylers":[{"color":"#bdbdbd"}]},{"featureType":"poi","elementType":"labels.text.fill","stylers":[{"color":"#757575"}]},{"featureType":"poi.park","elementType":"geometry","stylers":[{"color":"#181818"}]},{"featureType":"poi.park","elementType":"labels.text.fill","stylers":[{"color":"#616161"}]},{"featureType":"poi.park","elementType":"labels.text.stroke","stylers":[{"color":"#1b1b1b"}]},{"featureType":"road","elementType":"geometry.fill","stylers":[{"color":"#2c2c2c"}]},{"featureType":"road","elementType":"labels.text.fill","stylers":[{"color":"#8a8a8a"}]},{"featureType":"road.arterial","elementType":"geometry","stylers":[{"color":"#373737"}]},{"featureType":"road.highway","elementType":"geometry","stylers":[{"color":"#3c3c3c"}]},{"featureType":"road.highway.controlled_access","elementType":"geometry","stylers":[{"color":"#4e4e4e"}]},{"featureType":"road.local","elementType":"labels.text.fill","stylers":[{"color":"#616161"}]},{"featureType":"transit","elementType":"labels.text.fill","stylers":[{"color":"#757575"}]},{"featureType":"water","elementType":"geometry","stylers":[{"color":"#000000"}]},{"featureType":"water","elementType":"labels.text.fill","stylers":[{"color":"#3d3d3d"}]}], "Night" : [{"elementType":"geometry","stylers":[{"color":"#242f3e"}]},{"elementType":"labels.text.fill","stylers":[{"color":"#746855"}]},{"elementType":"labels.text.stroke","stylers":[{"color":"#242f3e"}]},{"featureType":"administrative.locality","elementType":"labels.text.fill","stylers":[{"color":"#d59563"}]},{"featureType":"poi","elementType":"labels.text.fill","stylers":[{"color":"#d59563"}]},{"featureType":"poi.park","elementType":"geometry","stylers":[{"color":"#263c3f"}]},{"featureType":"poi.park","elementType":"labels.text.fill","stylers":[{"color":"#6b9a76"}]},{"featureType":"road","elementType":"geometry","stylers":[{"color":"#38414e"}]},{"featureType":"road","elementType":"geometry.stroke","stylers":[{"color":"#212a37"}]},{"featureType":"road","elementType":"labels.text.fill","stylers":[{"color":"#9ca5b3"}]},{"featureType":"road.highway","elementType":"geometry","stylers":[{"color":"#746855"}]},{"featureType":"road.highway","elementType":"geometry.stroke","stylers":[{"color":"#1f2835"}]},{"featureType":"road.highway","elementType":"labels.text.fill","stylers":[{"color":"#f3d19c"}]},{"featureType":"transit","elementType":"geometry","stylers":[{"color":"#2f3948"}]},{"featureType":"transit.station","elementType":"labels.text.fill","stylers":[{"color":"#d59563"}]},{"featureType":"water","elementType":"geometry","stylers":[{"color":"#17263c"}]},{"featureType":"water","elementType":"labels.text.fill","stylers":[{"color":"#515c6d"}]},{"featureType":"water","elementType":"labels.text.stroke","stylers":[{"color":"#17263c"}]}] }'; 1698 1699 var map_style_obj = JSON.parse(map_styles); 1700 1701 var map_style_mode = []; 1702 var map_mode = ''; 1703 var map_lang = ''; 1704 var map_lat = ''; 1705 var map_marker = ''; 1706 var map_options = ''; 1707 1708 $( ".egovenzgmap" ).each(function( index ) { 1709 1710 var gmap = this; 1711 1712 if( $( gmap ).attr( "data-map-style" ) ){ 1713 map_mode = $( gmap ).data("map-style"); 1714 map_lang = $( gmap ).data("map-lang"); 1715 map_lat = $( gmap ).data("map-lat"); 1716 map_marker = $( gmap ).data("map-marker"); 1717 if( map_mode === 'aubergine' ) 1718 map_style_mode = map_style_obj.Aubergine; 1719 else if( map_mode === 'silver' ) 1720 map_style_mode = map_style_obj.Silver; 1721 else if( map_mode === 'retro' ) 1722 map_style_mode = map_style_obj.Retro; 1723 else if( map_mode === 'dark' ) 1724 map_style_mode = map_style_obj.Dark; 1725 else if( map_mode === 'night' ) 1726 map_style_mode = map_style_obj.Night; 1727 else if( map_mode === 'custom' ){ 1728 var c_style = $( gmap ).attr( "data-custom-style" ) && $( gmap ).attr( "data-custom-style" ) != '' ? JSON.parse( $( gmap ).attr( "data-custom-style" ) ) : '[]'; 1729 map_style_mode = c_style; 1730 }else{ 1731 map_style_mode = "[]"; 1732 } 1733 } 1734 1735 if( $( gmap ).attr( "data-multi-map" ) && $( gmap ).attr( "data-multi-map" ) == 'true' ){ 1736 1737 var map_values = JSON.parse( $( gmap ).attr( "data-maps" ) ); 1738 var map_wheel = $( gmap ).attr( "data-wheel" ) && $( gmap ).attr( "data-wheel" ) == 'true' ? true : false; 1739 var map_zoom = $( gmap ).attr( "data-zoom" ) && $( gmap ).attr( "data-zoom" ) != '' ? parseInt( $( gmap ).attr( "data-zoom" ) ) : 14; 1740 var map; 1741 1742 var map_stat = 1; 1743
1744 map_values.forEach( function( map_value ) { 1745 map_lat = map_value.map_latitude; 1746 map_lang = map_value.map_longitude; 1747 var LatLng = new google.maps.LatLng( map_lat, map_lang ); 1748 var mapProp= { 1749 center: LatLng, 1750 scrollwheel: map_wheel, 1751 zoom: map_zoom, 1752 styles: map_style_mode 1753 }; 1754 1755 //Create Map 1756 if( map_stat ){ 1757 var t_gmap = $( gmap ); 1758 map = new google.maps.Map( t_gmap[0], mapProp ); 1759 1760 google.maps.event.addDomListener( window, 'resize', function() { 1761 var center = map.getCenter(); 1762 google.maps.event.trigger( map, "resize" ); 1763 map.setCenter( LatLng ); 1764 }); 1765 1766 map_stat = 0; 1767 } 1768 1769 //Map Marker 1770 var marker = new google.maps.Marker({ 1771 position: LatLng, 1772 icon: map_value.map_marker, 1773 map: map 1774 }); 1775 1776 //Info Window 1777 if( map_value.map_info_opt == 'on' ) { 1778 var info_title = map_value.map_info_title; 1779 var info_addr = map_value.map_info_address; 1780 var contentString = '<div class="gmap-info-wrap"><h3>'+ info_title +'</h3><p>'+ info_addr +'</p></div>'; 1781 var infowindow = new google.maps.InfoWindow({ 1782 content: contentString 1783 }); 1784 marker.addListener( 'click', function() { 1785 infowindow.open( map, marker ); 1786 }); 1787 } 1788 }); 1789 1790 }else{ 1791 1792 var LatLng = {lat: parseFloat(map_lat), lng: parseFloat(map_lang)}; 1793 1794 var map_wheel = $( gmap ).attr( "data-wheel" ) && $( gmap ).attr( "data-wheel" ) == 'true' ? true : false; 1795 var map_zoom = $( gmap ).attr( "data-zoom" ) && $( gmap ).attr( "data-zoom" ) != '' ? parseInt( $( gmap ).attr( "data-zoom" ) ) : 14; 1796 1797 var mapProp= { 1798 center: LatLng, 1799 scrollwheel: map_wheel, 1800 zoom: map_zoom, 1801 styles: map_style_mode 1802 }; 1803 var t_gmap = $( gmap ); 1804 var map = new google.maps.Map( t_gmap[0], mapProp ); //document.getElementById("egovenzgmap") 1805 1806 var marker = new google.maps.Marker({ 1807 position: LatLng, 1808 icon: map_marker, 1809 map: map 1810 }); 1811 1812 if( $( gmap ).attr( "data-info" ) == 1 ){ 1813 var info_title = $( gmap ).attr( "data-info-title" ) ? $( gmap ).attr( "data-info-title" ) : ''; 1814 var info_addr = $( gmap ).attr( "data-info-addr" ) ? $( gmap ).attr( "data-info-addr" ) : ''; 1815 var contentString = '<div class="gmap-info-wrap"><h3>'+ info_title +'</h3><p>'+ info_addr +'</p></div>'; 1816 var infowindow = new google.maps.InfoWindow({ 1817 content: contentString 1818 }); 1819 marker.addListener( 'click', function() { 1820 infowindow.open( map, marker ); 1821 }); 1822 } 1823 1824 google.maps.event.addDomListener( window, 'resize', function() { 1825 var center = map.getCenter(); 1826 google.maps.event.trigger(map, "resize"); 1827 map.setCenter(LatLng); 1828 }); 1829 1830 }// data multi map false part end 1831 1832 }); // end map each 1833 1834 } 1835 1836})( 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.