1jQuery(document).ready (function ($) { 2"use strict"; 3 // remove empty p 4 $('p') 5 .filter(function() { 6 return $.trim($(this).text()) === '' && $(this).children().length == 0 7 }) 8 .remove(); 9 10//place holder 11 $('input').each(function() { 12 $(this).data('holder',$(this).attr('placeholder')); 13 14 $('input').focusin(function(){ 15 $(this).attr('placeholder',''); 16 }); 17 $('input').focusout(function(){ 18 $(this).attr('placeholder',$(this).data('holder')); 19 }); 20 }); 21 $('textarea').each(function() { 22 $(this).data('holder',$(this).attr('placeholder')); 23 24 $(this).focusin(function(){ 25 $(this).attr('placeholder',''); 26 }); 27 $(this).focusout(function(){ 28 $(this).attr('placeholder',$(this).data('holder')); 29 }); 30 }); 31//alert-bar 32if (jQuery(".alert-bar").length) { 33 $('.alert-bar').slideDown('600'); 34 35 setTimeout(function() { 36 $('.alert-bar').slideUp('800', function() { 37 $('.alert-bar').remove(); 38 }) 39 }, 5000); 40} 41// search 42$('#navigation .nav-button').click(function(e) { 43 if (!$(this).hasClass('active')) { 44 $('#navigation .nav-button').removeClass('active'); 45 $(this).addClass('active'); 46 $('.nb-inner-wrap').removeClass('sw-show'); 47 $(this).next('.nb-inner-wrap').addClass('sw-show'); 48 } else { 49 $(this).removeClass('active'); 50 $('.nb-inner-wrap').removeClass('sw-show'); 51 } 52 e.stopPropagation(); 53 54}); 55$('.nb-inner-wrap').click(function(e) { 56 e.stopPropagation(); 57}); 58 59$('body').click(function(e) { 60 $('#navigation .nav-button').removeClass('active'); 61 $('.nb-inner-wrap').removeClass('sw-show'); 62}); 63 64//Sticky navigation 65if ($(window).width() > 1000) { 66 if ($('body').hasClass('sticky_navigation_on')) { 67 var aboveHeight = $('#header-wrapper').outerHeight(); 68 $(window).scroll(function(){ 69 //if scrolled down more than the headerÃs height 70 if ($(window).scrollTop() > aboveHeight){ 71 // if yes, add Ãfixedà class to the <nav> 72 // add padding top to the #content 73 if ( $('#wpadminbar').length ) { 74 $('#navigation').addClass('sticky-nav').css('top','28px').next().css('padding-top','52px'); 75 } else { 76 $('#navigation').addClass('sticky-nav').css('top','0').next().css('padding-top','52px'); 77 } 78 } else { 79 80 // when scroll up or less than aboveHeight, 81 $('#navigation').removeClass('sticky-nav').css('top', 0).next().css('padding-top','0'); 82 } 83 }); 84 } 85} 86//tabbed widget 87 jQuery(".widget_momizattabber").each(function(){ 88 var ul = jQuery(this).find(".main_tabs ul.tabs"); 89 90 jQuery(this).find(".tab-content").each(function() { 91 jQuery(this).find('a.mom-tw-title').wrap('<li></li>').parent().detach().appendTo(ul); 92 }); 93 }); 94 95// secondary sidebar in all devices 96if (! $('body').hasClass('responsive_disabled')) { 97if ($(window).width() < 1210) { 98 $('.secondary-sidebar').show(); 99 $('.secondary-sidebar').insertBefore('.main-sidebar'); 100 $('.secondary-sidebar').removeClass('secondary-sidebar vc_sec_sidebar alignlefti alignrighti').addClass('main-sidebar moded'); 101 if($(window).width() > 1000) { 102 $('.vc_column_container.main-sidebar.moded').css('margin-right', '15px'); 103 } 104} 105 106$(window).resize(function() { 107if ($(window).width() < 1210) { 108 $('.secondary-sidebar').show(); 109 $('.secondary-sidebar').insertBefore('.main-sidebar'); 110 $('.secondary-sidebar').removeClass('secondary-sidebar vc_sec_sidebar alignlefti alignrighti').addClass('main-sidebar moded'); 111 if($(window).width() > 1000) { 112 $('.vc_column_container.main-sidebar.moded').css('margin-right', '15px'); 113 } 114} 115}); 116} 117// Main Tabs 118 if ($(".main_tabs ul.tabs").length) { $("ul.tabs").momtabs("div.tabs-content-wrap > .tab-content", { effect: 'fade'}); } 119 120//HIDPI Images 121 var hidpi = window.devicePixelRatio > 1 ? true : false; 122 if (hidpi) { 123 // Replace img src with data-hidpi 124 $('img[data-hidpi]').each(function() { 125 // If width x height hasn't been set, fill it in 126 if ($(this).parents('.tab-content').length === 0) { 127 /* 128 if ($(this).attr('width') === undefined) { 129 $(this).attr('width', $(this).width()); 130 } 131 if ($(this).attr('height') === undefined) { 132 $(this).attr('height', $(this).height()); 133 } 134 */ 135 } 136 $(this).attr('src', $(this).data('hidpi')); 137 }); 138 } 139// weather widget 140 $('.weather-widget').on('click', '.day-summary',function() { 141 var $this = $(this); 142 if ($this.hasClass('active')) {
143 $(this).next('.day-details').slideToggle(250, function() { 144 $this.toggleClass('active'); 145 }); 146 } else { 147 $this.toggleClass('active'); 148 $(this).next('.day-details').slideToggle(250); 149 } 150 }); 151 152//time line 153 if ($('.mom-timeline').length) { 154 $('.tl-month:first-child').removeClass('closed').addClass('opened'); 155 $('.tl-month').each(function() { 156 if ($(this).hasClass('opened')) { 157 $(this).find('.tl-days').show(); 158 $(this).find('.tlm-title .handle').removeClass('brankic-icon-add'); 159 $(this).find('.tlm-title .handle').addClass('brankic-icon-minus3'); 160 } 161 }); 162 $('.tl-month .tlm-title .handle').click(function() { 163 var $this = $(this); 164 var month = $(this).parent().parent(); 165 if (month.hasClass('closed')) { 166 month.removeClass('closed'); 167 month.addClass('opened'); 168 month.find('.tl-days').slideDown(); 169 $this.removeClass('brankic-icon-add'); 170 $this.addClass('brankic-icon-minus3'); 171 } else { 172 month.removeClass('opened'); 173 month.find('.tl-days').slideUp('normal', function() { 174 month.addClass('closed'); 175 $this.removeClass('brankic-icon-minus3'); 176 $this.addClass('brankic-icon-add'); 177 }); 178 } 179 }); 180 } 181 182//social icons 183if ($('.mom-social-icons').length) { 184 $('.mom-social-icons li').each(function () { 185 var dataHover = $('a',this).attr('data-bghover'); 186 if (typeof dataHover !== 'undefined' && dataHover !== false) { 187 var origBg = $('a',this).css('background'); 188 var hoverBg = $('a',this).data('bghover'); 189 $('a', this).hover(function() { 190 $(this).css('background', hoverBg) 191 }, function() { 192 $(this).css('background', origBg) 193 }); 194 } 195 }); 196} 197 198//images 199if(!( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) )) { 200 // fade images on appear 201 $('body.fade-imgs-in-appear .main_container img, body.fade-imgs-in-appear .sidebar img, body.fade-imgs-in-appear #footer img, body.fade-imgs-in-appear .wpb_row img').addClass('disappear'); 202 $('body.fade-imgs-in-appear .main_container img, body.fade-imgs-in-appear .sidebar img, body.fade-imgs-in-appear #footer img, body.fade-imgs-in-appear .wpb_row img').one('inview', function() {$(this).addClass('appear');}); 203 204 //body background link 205 $('body.use_bg_as_ad.layout-boxed').click(function(e){ 206 if (e.target === this) { 207 208 window.open( 209 momAjaxL.bodyad, 210 '_blank' // <- This is what makes it open in a new window. 211 ); 212 213 } 214 }); 215} 216 217//Submenu auto align 218 $('ul.main-menu > li').each(function(e){ 219 var t = $(this), 220 submenu = t.find('.cats-mega-wrap'); 221 if( submenu.length > 0 ) { 222 var offset = submenu.offset(), 223 w = submenu.width(); 224 if( offset.left + w > $(window).width() ) { 225 t.addClass('sub-menu-left'); 226 } else { 227 t.removeClass('sub-menu-left'); 228 } 229 } 230 }); 231//category mega menu 232 $('.cats-mega-wrap ul.sub-menu li').mouseenter(function() { 233 var id = $(this).attr('id'); 234 var id = id.split('-'); 235 //console.log(id[2]); 236 $(this).parent().find('li').removeClass('active'); 237 $(this).addClass('active'); 238 $(this).parent().next('.subcat').find('.mom-cat-latest').hide(); 239 $(this).parent().next('.subcat').find('#mn-latest-'+id[2]).show(); 240 }); 241 242//breaking news 243if ($('.news-ticker').length) { 244 var timeout = $('.news-ticker').data('timeout'); 245 $('body:not(.rtl) .news-ticker:not(.custom-animation) > ul').liScroll(); 246 $('body.rtl .news-ticker:not(.custom-animation) > ul').liScrollRight(); 247 $('.news-ticker.animation-updown ul').newsTicker({ 248 row_height: 39, 249 max_rows: 1, 250 speed: 600, 251 direction: 'up', 252 duration: timeout, 253 autostart: 1, 254 pauseOnHover: 1 255}
255); 256 257if ($('body').hasClass('ticker_has_live_time')) { 258$.startTime = function () { 259 var today=new Date(); 260 var h=today.getHours(); 261 var m=today.getMinutes(); 262 var s=today.getSeconds(); 263 m = $.checkTime(m); 264 s = $.checkTime(s); 265 if ($('body').hasClass('time_in_twelve_format')) { 266 h = ((h+11) % 12) +1; 267 } 268 //document.getElementById('txt').innerHTML = h+":"+m+":"+s; 269 $('span.current_time span').html(h+":"+m+":"+s); 270 var t = setTimeout(function(){$.startTime()},500); 271} 272$.checkTime = function(i) { 273 if (i<10) {i = "0" + i}; // add zero in front of numbers < 10 274 return i; 275} 276$.startTime(); 277} 278 279} 280 281// smooth scroll 282if ($('body').hasClass('smooth_scroll_enable')) { 283 $("html").niceScroll(); 284} 285//social share 286$('.mom-social-share a').click(function(e) { e.preventDefault(); }); 287 288//twitter widget buttons 289$('.twiter-list ul.twiter-buttons li a').click( function(e) { 290 e.preventDefault(); 291}); 292 293//Porfolio filter 294$('ul.portfolio-filter').each( function() { 295 var $this = $(this); 296 $this.find('li a').click(function() { 297 $this.find('li').removeClass('current'); 298 $(this).parent().addClass('current'); 299 }); 300}); 301 302// Avanced search form Validate 303$('.advanced-search-form [type="submit"]').click(function(e) { 304 var s = $(this).parent().find('input[name="s"]'); 305 if (s.val() === '' ) { 306 e.preventDefault() 307 s.addClass('invalid'); 308 s.attr('placeholder', s.data('nokeyword')); 309 } 310}); 311 312// videos 313$('.mom-video-widget').fitVids(); 314//scroll to top 315$('.scrollToTop').hide(); 316 $(window).scroll(function () { 317 if( $(this).scrollTop() > 100 ) { 318 $('.scrollToTop').fadeIn(300); 319 } 320 else { 321 $('.scrollToTop').fadeOut(300); 322 } 323 }); 324 325 $('.scrollToTop').click(function(){ 326 $('html, body').animate({scrollTop:0}, 500 ); 327 return false; 328 }); 329// sidebars categories 330$('.sidebar li.cat-item, .sidebar .widget_archive li').each(function(){ 331 var $contents = $(this).contents(); 332 if ($contents.length > 1) { 333 $contents.eq(1).wrap('<span class="cat_num"></span>'); 334 335 $contents.eq(1).each(function(){ 336 }); 337 } 338 }).contents(); 339 $('.sidebar li.cat-item .cat_num, .sidebar .widget_archive li .cat_num').each(function () { 340 $(this).html($(this).text().substring(2)); 341 $(this).html( $(this).text().replace(/\)/gi, "") ); 342 }); 343 344if ($('.sidebar li.cat-item').length) { 345 $('.sidebar li.cat-item .cat_num .line').each( function() { 346 if ($(this).is(':empty')){ 347 $(this).parent().hide(); 348 } 349 350}); 351} 352// footer Categories 353$('#footer li.cat-item').parent().addClass('two_columns_categoreis clearfix'); 354/*----------------------------------------- 355* Shortcode 356*-----------------------------------------*/ 357 358//Accordion 359$('.accordion.mom_accordion').each( function() { 360 var acc = $(this); 361 if (acc.hasClass('toggle_acc')) { 362 acc.find('li:first .acc_title').addClass('active'); 363 acc.find('.acc_toggle_open').addClass('active'); 364 acc.find('.acc_toggle_open').next('.acc_content').show(); 365 acc.find('.acc_toggle_close').removeClass('active'); 366 acc.find('.acc_toggle_close').next('.acc_content').hide(); 367 acc.find('.acc_title').click(function() { 368 $(this).toggleClass('active'); 369 $(this).next('.acc_content').slideToggle(); 370 }); 371 } else { 372 acc.find('li:first .acc_title').addClass('active'); 373 acc.find('.acc_title').click(function() { 374 if(!$(this).hasClass('active')) { 375 acc.find('.acc_title').removeClass('active'); 376 acc.find('.acc_content').slideUp(); 377 $(this).addClass('active'); 378 $(this).next('.acc_content').slideDown(); 379 } 380 }); 381 } 382}); 383$(".accordion").each(function () { 384 $(this).find('.acc_title').each(function(i) { 385 $(this).find('.acch_numbers').text(i+1); 386 }); 387}); 388 389// lists 390if ($('.mom_list').length) { 391 $('.mom_list li').each(function() { 392 var i = $(this).children('i'); 393 var cl = i.data('color'); 394 var clh = i.data('color_hover'); 395 var bg = i.data('bg'); 396 var bgh = i.data('bg_hover'); 397 if (clh !== '') { 398 $(this).hover(function() { 399 i.css('color', clh); 400 }, function() { 401 i.css('color', cl); 402 }); 403 } 404 if (bgh !== '') { 405 $(this).hover(function() { 406 i.css('background', bgh); 407 }, function() { 408 i.css('background', bg); 409 }); 410 } 411 412 413 }); 414} 415//callitout 416if ($('.mom_callout').length) { 417 $('.mom_callout').each( function () { 418 if ($(this).find('.cobtr').length) { 419 var btwidth = parseFloat($(this).find('.cobtr').css('width'))+30; 420 var btheight = parseFloat($(this).find('.cobtr').css('height'))/2; 421 $(this).find('.callout_content').css('margin-right',btwidth+'px'); 422 $(this).find('.cobtr').css('margin-top', '-'+btheight+'px'); 423 } 424 if ($(this).find('.cobtl').length) { 425 var btwidth = parseFloat($(this).find('.cobtl').css('width'))+30; 426 var btheight = parseFloat($(this).find('.cobtl').css('height'))/2; 427 $(this).find('.callout_content').css('margin-left',btwidth+'px'); 428 $(this).find('.cobtl').css('margin-top', '-'+btheight+'px'); 429 } 430 }); 431} 432 jQuery('.mom_button').hover( 433 function(){ 434 var $hoverbg = jQuery(this).attr('data-hoverbg'); 435 var $texthcolor = jQuery(this).attr('data-texthover'); 436 var $borderhover = jQuery(this).attr('data-borderhover'); 437 jQuery(this).css("background-color",$hoverbg); 438 jQuery(this).css("color",$texthcolor); 439 jQuery(this).css("border-color",$borderhover); 440 },function() { 441 var $bgcolor = jQuery(this).attr('data-bg'); 442 var $textColor = jQuery(this).attr('data-text'); 443 var $bordercolor = jQuery(this).attr('data-border'); 444 if($bgcolor!==undefined){ 445 jQuery(this).css("background-color",$bgcolor); 446 }else { 447 jQuery(this).css("background-color",''); 448 } 449 if($textColor!==undefined){ 450 jQuery(this).css("color",$textColor); 451 }else { 452 jQuery(this).css("color",''); 453 } 454 if($bordercolor !== undefined){ 455 jQuery(this).css("border-color",$bordercolor); 456 }else { 457 jQuery(this).css("border-color",''); 458 } 459 }); 460// Tab Current icon 461if (('.main_tabs ul.tabs li a i').length) { 462 $('.main_tabs').each(function () { 463 var $this = $(this);
464 var current_tab = $this.find('.tabs li a.current i[class*="-icon-"]'); 465 current_tab.css('color', current_tab.attr('data-current')); 466 $this.find('.tabs li a').click(function () { 467 if ($(this).hasClass('current')) { 468 var $current = $(this).find('[class*="-icon-"]').attr('data-current'); 469 var $orig = $(this).find('[class*="-icon-"]').attr('data-color'); 470 471 $this.find('.tabs li a i[class*="-icon-"]').css('color',$orig); 472 $('[class*="-icon-"]', this).css('color', $current); 473 } 474 }); 475 }); 476} 477// Accordion Current icon 478if (('h2.acc_title i').length) { 479 $('.accordion').each(function () { 480 var $this = $(this); 481 var current_acc = $this.find('h2.active i[class*="-icon-"]'); 482 current_acc.css('color', current_acc.attr('data-current')); 483 $this.find('h2.acc_title').click(function () { 484 if ($(this).hasClass('active')) { 485 var $current = $(this).find('[class*="-icon-"]').attr('data-current'); 486 var $orig = $(this).find('[class*="-icon-"]').attr('data-color'); 487 488 $this.find('h2.acc_title i[class*="-icon-"]').css('color',$orig); 489 $('[class*="-icon-"]', this).css('color', $current); 490 } 491 }); 492 }); 493} 494 495//team members 496 var tm_cols = 2; 497 var tm_2_i = 0; 498 $(".team_member2").each(function(){ 499 tm_2_i++; 500 tm_cols = 2; 501 if (tm_2_i % tm_cols === 0) {$(this).addClass("last");} 502 }); 503 var tm_3_i = 0; 504 $(".team_member3").each(function(){ 505 tm_3_i++; 506 tm_cols = 3; 507 if (tm_3_i % tm_cols === 0) {$(this).addClass("last");} 508 }); 509 var tm_4_i = 0; 510 $(".team_member4").each(function(){ 511 tm_4_i++; 512 tm_cols = 4; 513 if (tm_4_i % tm_cols === 0) {$(this).addClass("last");} 514 }); 515 var tm_5_i = 0; 516 $(".team_member5").each(function(){ 517 tm_5_i++; 518 tm_cols = 5; 519 if (tm_5_i % tm_cols === 0) {$(this).addClass("last");} 520 }); 521$('.team_member').each( function () { 522 var socials = $(this).find('.member_social ul li'); 523 var width = 100/socials.length; 524 socials.css('width',width+'%'); 525}); 526 527//Icon Colors in hover 528jQuery('.mom_iconbox').hover( 529 function(){ 530 var icon = $(this).find('[class*="-icon-"]'); 531 var icon_wrap = $(this).find('.iconb_wrap'); 532 533 var $hover = icon.attr('data-hover'); 534 var $bghover = icon_wrap.attr('data-hover'); 535 var $bdhover = icon_wrap.attr('data-border_hover'); 536 537 if ($hover !== '') { 538 icon.css("color",$hover); 539 } 540 if ($bghover !== '') { 541 icon_wrap.css("background",$bghover); 542 } 543 if ($bdhover !== '') { 544 icon_wrap.css("border-color",$bdhover); 545 } 546},function() { 547 var icon = $(this).find('[class*="-icon-"]'); 548 var icon_wrap = $(this).find('.iconb_wrap'); 549 550 var $color = icon.attr('data-color'); 551 var $origcolor = icon.css('color'); 552 var $bgcolor = icon_wrap.attr('data-color'); 553 var $origbg = icon_wrap.css('background-color'); 554 var $bdcolor = icon_wrap.attr('data-border_color'); 555 var $origbd = icon_wrap.css('border-color'); 556 if($color!==undefined){ 557 icon.css("color",$color); 558 }else { 559 icon.css("color",$origcolor); 560 } 561 if($bgcolor!==undefined){ 562 icon_wrap.css("background",$bgcolor); 563 }else { 564 icon_wrap.css("background",$origbg); 565 } 566 if($bdcolor!==undefined){ 567 icon_wrap.css("border-color",$bdcolor); 568 }else { 569 } 570}); 571 572//icona 573jQuery('.mom_icona').hover( 574 function(){ 575 var icon = $(this).find('[class*="-icon-"]'); 576 var icon_wrap = $(this); 577 var $hover = icon.attr('data-hover'); 578 var $bghover = icon_wrap.attr('data-hover'); 579 var $bdhover = icon_wrap.attr('data-border_hover'); 580 icon.css("color",$hover); 581 icon_wrap.css("background",$bghover); 582 icon_wrap.css("border-color",$bdhover); 583},function() { 584 var icon = $(this).find('[class*="-icon-"]'); 585 var icon_wrap = $(this); 586 var $color = icon.attr('data-color'); 587 var $origcolor = icon.css('color'); 588 var $bgcolor = icon_wrap.attr('data-color'); 589 var $origbg = icon_wrap.css('background-color'); 590 var $bdcolor = icon_wrap.attr('data-border_color'); 591 var $origbd = icon_wrap.css('border-color'); 592 if($color!==undefined){ 593 icon.css("color",$color); 594 }else { 595 icon.css("color",$origcolor); 596 } 597 if($bgcolor!==undefined){ 598 icon_wrap.css("background",$bgcolor); 599 }else { 600 icon_wrap.css("background",$origbg); 601 } 602 if($bdcolor!==undefined){ 603 icon_wrap.css("border-color",$bdcolor); 604 }else { 605 } 606}); 607//Porfolio filter 608$('.protfolio_filter ul').each( function() { 609 var $this = $(this); 610 $this.find('li a').click(function() { 611 $this.find('li').removeClass('current'); 612 $(this).parent().addClass('current'); 613 }); 614}); 615 616//heighest col 617/* 618var highestCol = Math.max($('.bothsides_content').height(),$('.sideb').height()); 619$('.bothsides_content, .sideb').height(highestCol); 620*/ 621 622// comment form 623if($('#commentform').length) { 624$('#commentform input').each(function() { 625$(this).data('holder',$(this).attr('placeholder')); 626 627$('#commentform input').focusin(function(){ 628 $(this).attr('placeholder',''); 629}); 630$('#commentform input').focusout(function(){ 631 $(this).attr('placeholder',$(this).data('holder')); 632}); 633 }); 634$('#commentform #comment').data('holder',$('#commentform #comment').attr('placeholder')); 635 636$('#commentform #comment').focusin(function(){ 637 $(this).attr('placeholder',''); 638}); 639$('#commentform #comment').focusout(function(){ 640 $(this).attr('placeholder',$(this).data('holder')); 641}); 642} 643 644// Contact form 645if($('.mom_contact_form').length) { 646$('.mom_contact_form input').each(function() { 647 $(this).data('holder',$(this).attr('placeholder')); 648 649 $('.mom_contact_form input').focusin(function(){ 650 $(this).attr('placeholder',''); 651 }); 652 $('.mom_contact_form input').focusout(function(){ 653 $(this).attr('placeholder',$(this).data('holder')); 654 }); 655}); 656 657$('.mom_contact_form textarea').each(function() { 658 $(this).data('holder',$(this).attr('placeholder')); 659 $('.mom_contact_form textarea').focusin(function(){ 660$(this).attr('placeholder',''); 661 }); 662 $('.mom_contact_form textarea').focusout(function(){ 663$(this).attr('placeholder',$(this).data('holder')); 664 }); 665}); 666 667}
668//share 669if ($('.mom_share_buttons').length) { 670 $('.mom_share_buttons').data('height',$('.mom_share_buttons').css('height')); 671 var curHeight = $('.mom_share_buttons').height(); 672 $('.mom_share_buttons').css('height', 'auto'); 673 var autoHeight = $('.mom_share_buttons').height(); 674 $('.mom_share_buttons').css('height', curHeight); 675 $('.mom_share_it .sh_arrow').toggle(function () { 676 $('.mom_share_buttons').stop().animate({height: autoHeight}, 300); 677 $(this).find('i').removeClass(); 678 $(this).find('i').addClass('momizat-icon-193'); 679 }, function () { 680 $('.mom_share_buttons').stop().animate({height: $('.mom_share_buttons').data('height')}, 300); 681 $(this).find('i').removeClass(); 682 $(this).find('i').addClass('momizat-icon-194'); 683 }); 684} 685 686//toggles 687jQuery("h4.toggle_title").click(function () { 688 $(this).next(".toggle_content").slideToggle(); 689 $(this).toggleClass("active_toggle"); 690 $(this).parent().toggleClass("toggle_active"); 691}); 692 693$("h4.toggle_min").click(function () { 694 $(this).next(".toggle_content_min").slideToggle(); 695 $(this).toggleClass("active_toggle_min"); 696}); 697 698//scroll to top 699$('.scrollTo_top').hide(); 700 $(window).scroll(function () { 701 if( $(this).scrollTop() > 100 ) { 702 $('.scrollTo_top').fadeIn(300); 703 } 704 else { 705 $('.scrollTo_top').fadeOut(300); 706 } 707 }); 708 709 $('.scrollTo_top').click(function(){ 710 $('html, body').animate({scrollTop:0}, 500 ); 711 return false; 712 }); 713 714//lightbox 715if ($('.mom_lightbox').length) { 716$(".mom_lightbox > a").prettyPhoto({animation_speed:'fast',slideshow:10000, deeplinking: false}); 717} 718 719 $('body.open_images_in_lightbox a').each(function() { 720 if(/\.(?:jpg|jpeg|gif|png)$/i.test($(this).attr('href'))){ 721 $(this).prettyPhoto(); 722 } 723 }); 724// Mobile 725if ($('.top_menu_handle').length) { 726 $('.top_menu_handle').toggle( function () { 727 $(this).next('.mobile_top_nav').show(); 728 $(this).addClass('tmh_close'); 729 }, function () { 730 $(this).next('.mobile_top_nav').hide(); 731 $(this).removeClass('tmh_close'); 732 }); 733} 734 735if ($('.mobile_main_nav_handle').length) { 736 $('.mobile_main_nav_handle').toggle( function () { 737 $(this).next('.mom_mobile_main_nav .nav').slideDown(); 738 }, function () { 739 $(this).next('.mom_mobile_main_nav .nav').slideUp(); 740 }); 741 742} 743 744$(window).resize(function() { 745 if ($(window).width() < 978) { 746 $('.video_wrap').fitVids(); 747 } 748}); 749 750 if ($(window).width() < 978) { 751 $('.video_wrap').fitVids(); 752 } 753//$('.video_frame').fitVids(); 754$(window).resize(function() { 755 if ($(window).width() < 460) { 756 $('.topbar .mom-social-icons li').hide(); 757 $(".topbar .mom-social-icons li:lt(7)").show(); 758 } 759}); 760 761 if ($(window).width() < 460) { 762 $('.topbar .mom-social-icons li').hide(); 763 $(".topbar .mom-social-icons li:lt(7)").show(); 764 } 765//$("html").niceScroll(); 766 767/* 768 $('a').click(function(){ 769 $('html, body').animate({ 770 scrollTop: $('[name="' + $.attr(this, 'href').substr(1) + '"]').offset().top 771 }, 500); 772 return false; 773 }); 774 */ 775$('.animator.animated, .iconb_wrap.animated').each( function() { 776 var $this = $(this); 777 var animation = $(this).attr('data-animate'); 778 779$this.bind('inview', function(event, isInView, visiblePartX, visiblePartY) { 780 if (isInView) { 781 $(this).addClass(animation); 782 $(this).css('visibility', 'visible'); 783 if(animation.indexOf('fade') === -1) 784 { 785 $(this).css('opacity', '1'); 786 } 787 if (visiblePartY == 'top') { 788 // top part of element is visible 789 } else if (visiblePartY == 'bottom') { 790 // bottom part of element is visible 791 } else { 792 // whole part of element is visible 793 } 794 } else { 795 // element has gone out of viewport 796 } 797}); 798 799}); 800if ($('.progress_outer').length) { 801 $('.progress_outer').each( function() { 802 var $this = $(this); 803 $this.bind('inview', function(event, isInView, visiblePartX, visiblePartY) { 804 if (isInView) { 805 $(this).find('.parograss_inner').show(); 806 $(this).find('.parograss_inner').addClass('ani-bar'); 807 if (visiblePartY == 'top') { 808 // top part of element is visible 809 } else if (visiblePartY == 'bottom') { 810 // bottom part of element is visible 811 } else { 812 // whole part of element is visible 813 } 814 } else { 815 // element has gone out of viewport 816 } 817 }); 818 819 }); 820} 821//responsive headings 822 if ($(window).width() < 767) { 823 $('h1,h2,h3,h4,h5,h6, span, .mom_google_font').each(function() { 824 if ($(this).attr('font-size')) { 825 var fs = parseFloat($(this).css('font-size')); 826 if (fs > 24) { 827 $(this).css('font-size','23px'); 828 } 829 } 830 }); 831 } 832 833if ($('.mom_custom_background').length) { 834 $('.mom_custom_background').each(function() { 835 var $this = $(this); 836 $(window).scroll(function () { 837 var speed = 8.0; 838 $this.css({backgroundPosition:(-window.pageXOffset / speed) + "px " + (-window.pageYOffset / speed) + "px"}); 839 //document.body.style.backgroundPosition = (-window.pageXOffset / speed) + "px " + (-window.pageYOffset / speed) + "px"; 840 }); 841 }); 842} 843//Default Gallery 844if ($('.gallery .gallery-item').length) { 845 $(".gallery .gallery-item a").attr('rel', 'prettyPhoto[pp_gal]'); 846 $(".gallery .gallery-item a").prettyPhoto(); 847} 848 849//lightbox 850if ($('img.lightbox').length) { 851 $('img.lightbox').each(function() { 852 $(this).parent('a').prettyPhoto(); 853 }) 854} 855 856/*---------------------------- 857 Ads 858 ----------------------------*/ 859if ($('.mca-fixed').length) { 860 var mca_top = $('.mca-fixed').offset().top; 861 var mca = $('.mca-fixed'); 862 $(window).scroll(function(){ 863 if ($(window).scrollTop() > mca_top){ 864 if ( $('#wpadminbar').length ) { 865 mca.css({ top:'28px', position: 'fixed' }); 866 mca.addClass('mca_touch_top'); 867 } else { 868 mca.css({ top:'0', position: 'fixed' }); 869 mca.addClass('mca_touch_top'); 870 } 871 } else { 872 mca.css({ top:'auto', position: 'absolute' }); 873 mca.removeClass('mca_touch_top'); 874 } 875 }); 876} 877 878 879/* ========================================================================== 880 * Responsive mode 881 ========================================================================== */ 882 883// double tab on navigation 884if(( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) )) { 885 $('#navigation .main-menu > li.menu-item-has-children').doubleTapToGo(); 886} 887 888// Responsive menus 889$('.top-menu-holder').click(function(e) { 890 e.stopPropagation(); 891 $('.device-top-nav').slideToggle(); 892 $(this).toggleClass('active'); 893}); 894$('.device-top-nav, .device-menu').click(function(e) { 895 e.stopPropagation(); 896}); 897$('body').click(function() { 898 $('.device-top-nav').slideUp(); 899 $('.device-menu').slideUp(); 900}); 901 902$('.device-menu-holder').click(function(e) { 903 e.stopPropagation(); 904 if ($(this).hasClass('active')) { 905 $('.device-menu li').each(function() { 906 if ($(this).find('.mom_mega_wrap').length !== 0) { 907 } else { 908 $(this).find('.sub-menu').slideUp(); 909 } 910 }); 911 $('.device-menu').find('.dm-active').removeClass('dm-active');
912 $('.device-menu').find('.mom_custom_mega').slideUp(); 913 } 914 $('.device-menu').slideToggle(); 915 $(this).toggleClass('active'); 916 $('#navigation .nav-buttons').toggleClass('mh-active'); 917 918}); 919$('.responsive-caret').click(function() { 920 var li = $(this).parents('li'); 921 if (li.hasClass('dm-active') || li.find('.dm-active').length !== 0 || li.find('.sub-menu').is(':visible') || li.find('.mom_custom_mega').is(':visible') ) { 922 li.removeClass('dm-active'); 923 li.children('.sub-menu').slideUp(); 924 if (li.find('.mom_mega_wrap').length === 0) { 925 li.find('.sub-menu').slideUp(); 926 } 927 if (li.hasClass('mom_default_menu_item') || li.find('.cats-mega-wrap').length !== 0) { 928 li.find('.sub-menu').slideUp(); 929 } 930 li.find('.dm-active').removeClass('dm-active'); 931 if (li.find('.mom_custom_mega').length !== 0) { 932 li.find('.mom_custom_mega').slideUp(); 933 } 934 935 } else { 936 $('.device-menu').find('.dm-active').removeClass('dm-active'); 937 li.addClass('dm-active'); 938 li.children('.sub-menu').slideDown(); 939 if (li.find('.cats-mega-wrap').length !== 0) { 940 li.find('.sub-menu').slideDown(); 941 } 942 if (li.find('.mom_custom_mega').length !== 0) { 943 li.find('.mom_custom_mega').slideDown(); 944 } 945 946 } 947}) 948$('.the_menu_holder_area').html($('.device-menu').find('.current-menu-item').children('a').html()); 949 950var nbts = $('.nav-buttons .nav-button'); 951var rnp = 0; 952nbts.each(function () { 953 var w = $(this).outerWidth()-1; 954 rnp += w; 955}); 956 if (nbts.length === 3) { 957 rnp = rnp+2; 958 } 959 960$('body:not(.rtl) .device-menu-wrap').css('padding-right',rnp+'px'); 961$('body.rtl .device-menu-wrap').css('padding-left',rnp+'px'); 962 963// scrolling box 964$(window).resize(function() { 965 if ($(window).width() < 670) { 966 $('.scrolling-box .sb-item .sb-item-img').each( function(e) { 967 var img = $(this).find('img'); 968 img.attr('src', img.data('hidpi')); 969 }); 970 } 971 if ($(window).width() < 480) { 972 $('.recent-news .news-image, .news-list .news-image, .blog-post .bp-detail
972s .post-img').each( function(e) { 973 var img = $(this).find('img'); 974 var attr = img.attr('data-hidpi'); 975 if (typeof attr !== 'undefined' && attr !== false) { 976 img.attr('src', img.data('hidpi')); 977 } 978 }); 979 } 980}); 981 if ($(window).width() < 670) { 982 $('.scrolling-box .sb-item .sb-item-img').each( function(e) { 983 var img = $(this).find('img'); 984 img.attr('src', img.data('hidpi')); 985 }); 986 } 987 if ($(window).width() < 480) { 988 $('.recent-news .news-image, .news-list .news-image, .blog-post .bp-details .post-img').each( function(e) { 989 var img = $(this).find('img'); 990 var attr = img.attr('data-hidpi'); 991 if (typeof attr !== 'undefined' && attr !== false) { 992 img.attr('src', img.data('hidpi')); 993 } 994 }); 995 } 996 //buddypress 997 $('.widget:not(.bos_searchbox_widget_class) select, select#notifications-sort-order-list, select#members-friends, select#groups-sort-by, #members-order-by, #message-type-select, #activity-filter-by').wrap('<div class="mom-select"></div>'); 998 $('#buddypress div#object-nav.item-list-tabs ul li.last.filter').prev().addClass('mom_last_child'); 999 1000 //top banner 1001 $('.top_banner').show(); 1002 $('a.tob_banner_close').on('click', function(e) { 1003 $('.top_banner').slideUp(400); 1004 var exp = $(this).date('exp'); 1005 if (exp === '') { 1006 exp = 7; 1007 } 1008 if (typeof($.cookie) == "function") { 1009 $.cookie('tb_clase', 'yes', { expires: exp, path: '/' }); 1010 } 1011 e.preventDefault(); 1012 }); 1013 1014 if (typeof($.cookie) == "function") { 1015 /* if (!$('a.tob_banner_close').hasClass('tb_save_close')) { 1016 $('body').css('background', 'green'); 1017 $.cookie("tb_clase", null); 1018 $.removeCookie('tb_clase'); 1019 }*/ 1020 if ($.cookie('tb_clase') === 'yes') { 1021 $('.top_banner').hide(); 1022 } 1023 } 1024 1025 1026//alert($.cookie('tb_clase')); 1027 1028 $('.mom_mega_cats .cats-mega-inner > ul > li').on('mouseenter', function(e) { 1029 e.preventDefault(); 1030 var t = $(this); 1031 var tid = t.attr('id'); 1032 tid = tid.split('-'); 1033 tid = tid[2]; 1034 var d = t.parent().next('.subcat').find('#mn-latest-'+tid); 1035 var dest = t.parent().next('.subcat').find('#mn-latest-'+tid+' > ul'); 1036 var id = d.data('id'); 1037 var object = d.data('object'); 1038 var layout = d.data('layout'); 1039 if (dest.children().length === 0) { 1040 jQuery.ajax({ 1041 type: "post", 1042 url: momAjaxL.url, 1043 dataType: 'html', 1044 data: "action=mmcl&nonce="+momAjaxL.nonce+"&id="+id+"&object="+object+"&layout="+layout, 1045 beforeSend: function() { 1046 dest.addClass('loading'); 1047 }, 1048 success: function(data){ 1049 dest.removeClass('loading'); 1050 dest.html(data); 1051 } 1052 }); 1053 } 1054 }); 1055 1056/*------------------------------------------------ 1057 login widget 1058-------------------------------------------------*/ 1059$('.mom-login-widget .button.user-submit').click(function () { 1060 var p = $(this).parents('.mom-login-form'); 1061 var user = p.find('input[name="log"]'); 1062 var pwd = p.find('input[name="pwd"]'); 1063 if (user.val() === '' || pwd.val() === '') { 1064 user.addClass('error'); 1065 pwd.addClass('error'); 1066 return false; 1067 } 1068}); 1069/*------------------------------------------------ 1070 Feature Slider 1071-------------------------------------------------*/ 1072if ($('.feature-slider').length) { 1073 $('.feature-slider').each(function() { 1074 var t = $(this); 1075 if (!t.hasClass('gallery-post-slider')) { 1076 var animation = t.data('sanimation'); 1077 var speed = t.data('speed'); 1078 var timeout = t.data('timeout'); 1079 var easing = t.data('easing'); 1080 var rndn = t.data('rndn'); 1081 var rtl = false; 1082 var autoplay = t.data('autoplay'); 1083 var items = t.data('items'); 1084 1085 var animation_new = t.data('animation_new'); 1086 var animation_in = t.data('animation_in'); 1087 var animation_out = t.data('animation_out'); 1088 var margin = 10; 1089 var auto_height = 0; 1090 var thumbs_event = t.data('thumbs_event'); 1091 if(typeof thumbs_event === 'undefined'){ 1092 thumbs_event = 'click'; 1093 } 1094 if (t.hasClass('no_spaces')) { 1095 margin = 5; 1096 auto_height = 1; 1097 } 1098 1099 t.find('.fs-image-nav .fs-thumb').each(function(i) { 1100 $(this).addClass( 'item'+i ); 1101 if (t.hasClass('old-style')) { 1102 $(this).click(function() { 1103 t.find('.fslides').trigger( 'slideTo', [i, 0, true] ); 1104 return false;
1105 }); 1106 } 1107 }); 1108 1109 t.find('.fs-image-nav .fs-thumb.item0').addClass( 'active' ); 1110 1111 var carou_items = 6; 1112 if ($(window).width() < 768) { 1113 carou_items = 5; 1114 } 1115 if ($(window).width() < 568) { 1116 carou_items = 4; 1117 } 1118 1119 if ($(window).width() < 480 ) { 1120 carou_items = 2; 1121 } 1122 1123 if ($('body').hasClass('rtl')) { 1124 rtl = true; 1125 } 1126 1127 if (!t.hasClass('old-style')) { 1128 var owl = t.find('.fslides'); 1129 var slides_count = owl.children('.fslide').length; 1130 if (slides_count == 1) { 1131 t.addClass('fs-with-one-slide'); 1132 } 1133 if (slides_count > 1) { 1134 owl.owlCarousel({ 1135 items: 1, 1136 baseClass: 'mom-carousel', 1137 rtl: rtl, 1138 autoplay:autoplay, 1139 autoplayTimeout:timeout, 1140 autoplayHoverPause : true, 1141 loop: true, 1142 animateOut: animation_out, 1143 animateIn: animation_in, 1144 smartSpeed:1000, 1145 //autoHeight: true, 1146 }); 1147 t.find('.fslides').imagesLoaded( function() { 1148 t.find('.fs-image-nav .fs-thumbs').owlCarousel({ 1149 items: items, 1150 baseClass: 'mom-carousel', 1151 rtl: rtl, 1152 loop: true, 1153 margin : margin, 1154 }); 1155 //var thumb_height = t.find('.fs-image-nav .fs-thumbs .fs-thumb').eq(0).css('height'); 1156 //t.find('.fs-image-nav .fs-thumbs').css('max-height', thumb_height); 1157 1158 1159 owl.on('changed.owl.carousel', function(event) { 1160 var pos = $(event.target).find(".fslide").eq(event.item.index).data('i'); 1161 //console.log(pos); 1162 $('.fc-nav-'+rndn+' .fs-thumb').removeClass( 'active' ); 1163 $('.fc-nav-'+rndn+' .fs-thumb.item'+pos).addClass( 'active' ); 1164 var page = Math.floor( pos / items ); 1165 t.find('.fs-image-nav .fs-thumbs').trigger( 'to.owl.carousel', page ); 1166 }); 1167 1168 1169 t.find('.fs-image-nav .fs-thumb').on(thumbs_event, function() { 1170 var i = $(this).data('i'); 1171 owl.trigger('to.owl.carousel', [i]); 1172 }); 1173 1174 t.find('.fs-image-nav .fs-prev, .fsd-prev').click(function() { 1175 owl.trigger('prev.owl.carousel'); 1176 }); 1177 1178 t.find('.fs-image-nav .fs-next, .fsd-next').click(function() { 1179 owl.trigger('next.owl.carousel'); 1180 }); 1181 }); 1182 } 1183 } else { 1184 t.find('.fslides').carouFredSel({ 1185 circular: true, 1186 responsive: true, 1187 swipe: { 1188 onTouch: true, 1189 fx : 'scroll' 1190 }, 1191 items: 1, 1192 auto: { 1193 play: autoplay, 1194 duration: speed, 1195 timeoutDuration: timeout, 1196 }, 1197 prev: '.fc-nav-'+rndn+' .fs-prev, .fs-dnav-'+rndn+' span.fsd-prev', 1198 next: '.fc-nav-'+rndn+' .fs-next, .fs-dnav-'+rndn+' span.fsd-next', 1199 pagination: '.fs-nav-'+rndn, 1200 scroll: { 1201 fx: animation, 1202 duration : speed, 1203 easing : easing, 1204 pauseOnHover : true, 1205 onBefore: function() { 1206 var pos = $(this).triggerHandler( 'currentPosition' ); 1207 $('.fc-nav-'+rndn+' div').removeClass( 'active' ); 1208 $('.fc-nav-'+rndn+' div.item'+pos).addClass( 'active' ); 1209 var page = Math.floor( pos / carou_items ); 1210 $('.fc-nav-'+rndn+' .fs-thumbs').trigger( 'slideToPage', page ); 1211 1212 }, 1213 onAfter: function() { 1214 } 1215 1216 } 1217 }); 1218 1219 t.find('.fs-image-nav .fs-thumbs').carouFredSel({ 1220 auto: false, 1221 circular:true, 1222 responsive: true, 1223 swipe: { 1224 onTouch: true 1225 }, 1226 items: carou_items, 1227 scroll: { 1228 items:carou_items, 1229 } 1230 }); 1231 } 1232 1233 } //if not the post gallery 1234 1235 }); 1236}
1237// Delete share caches on click 1238 jQuery(".php-share .ss-icon a").click( function(e){ 1239 var t = jQuery(this); 1240 var id = t.parent().parent().data('id'); 1241 jQuery.ajax({ 1242 type: "post", 1243 url: momAjaxL.url, 1244 dataType: 'html', 1245 data: "action=mcscoc&nonce="+momAjaxL.nonce+"&id="+id, 1246 beforeSend: function() {}, 1247 success: function(){} 1248 }); 1249 }); 1250 1251}); // end of the file 1252 1253// ad clicks 1254jQuery(document).ready(function($) { 1255 1256 jQuery(".mom-e3lan").click( function(e){ 1257 t = jQuery(this); 1258 id = t.data('id'); 1259 jQuery.ajax({ 1260 type: "post", 1261 url: momAjaxL.url, 1262 dataType: 'html', 1263 data: "action=mom_mom_adclicks&nonce="+momAjaxL.nonce+"&id="+id, 1264 beforeSend: function() {}, 1265 success: function(){} 1266 }); 1267 }); 1268}); 1269 1270 1271// Momizat User rate 1272jQuery(document).ready(function(e){e(".mom_user_rate").mousemove(function(t){var r=e(this).data("style"),s=e(this).offset(),a=t.pageX-s.left;if(t.pageY-s.top,!e(this).hasClass("rated")){var o=a/parseFloat(e(this).width())*100;i=Math.round(o),i>100&&(i=100),n=(i/20).toFixed(1),"bars"===r?(e(this).find(".ub-inner").css({width:i+"%"}),e(this).find(".ub-inner").find("span").text(i+"%")):"circles"===r||e(this).children("span").css({width:i+1+"%"}),e(this).hasClass("star-rating")&&e(this).parent().find(".yr").text(n+"/5")}}),e(".mom_user_rate, .mom_user_rate_cr").hover(function(){e(this).hasClass("rated")||(e(".review-footer .mom_user_rate_title").find(".user_rate").hide(),e(".review-footer .mom_user_rate_title").find(".your_rate").show())},function(){e(this).hasClass("rated")||(e(".mom_user_rate_title").find(".user_rate").show(),e(".mom_user_rate_title").find(".your_rate").hide())}),e(".mom_user_rate").click(function(){stars=jQuery(this),post_id=stars.data("post_id"),style=stars.data("style"),score=0,"stars"===style&&(score=parseFloat(stars.children("span").width())/parseFloat(e(this).width())*100),"bars"===style&&(score=parseFloat(stars.children(".ub-inner").width())/parseFloat(e(this).width())*100),score=Math.round(score),vc=stars.data("votes_count"),e(this).hasClass("rated")||jQuery.ajax({type:"post",url:momAjaxL.url,data:"action=user-rate&nonce="+momAjaxL.nonce+"&user_rate=&post_id="+post_id+"&user_rate_score="+score,success:function(t){"already"!=t&&(stars.addClass("rated"),e(".review-footer .mom_user_rate_title").find(".user_rate").hide(),e(".review-footer .mom_user_rate_title").find(".your_rate").show(),e(".review-footer .total-votes").find(".tv-count").text(vc+1))}})}),e(".mom-reveiw-system").length&&e(".urc-value").knob({displayInput:!1,change:function(t){e(".user-rate-circle").find(".cru-num").text(t)},release:function(t){circle=jQuery(".user-rate-circle .mom_user_rate_cr"),post_id=circle.data("post_id"),style=circle.data("style"),score=t,vc=circle.data("votes_count"),jQuery.ajax({type:"post",url:momAjaxL.url,data:"action=user-rate&nonce="+momAjaxL.nonce+"&user_rate=&post_id="+post_id+"&user_rate_score="+score,success:function(t){"already"!=t&&(circle.addClass("rated"),e(".review-footer .mom_user_rate_title").find(".user_rate").hide(),e(".review-footer .mom_user_rate_title").find(".your_rate").show(),e(".review-footer .total-votes").find(".tv-count").text(vc+1))}})}})}); 1273 1274 1275// Momizat ajax 1276jQuery(document).ready(function() { 1277 jQuery(".mom-search-form input.sf").on("keyup", function() { 1278 return sf = jQuery(this), term = sf.val(), term.length > 2 ? setTimeout(function() { 1279 jQuery.ajax({ 1280 type: "post", 1281 url: momAjaxL.url, 1282 dataType: "html", 1283 data: "action=mom_ajaxsearch&nonce=" + momAjaxL.nonce + "&term=" + term, 1284 beforeSend: function() { 1285 sf.parent().parent().find(".sf-loading").fadeIn() 1286 }, 1287 success: function(e) { 1288 "" !== sf.val() ? (sf.parent().parent().next(".ajax_search_results").html(e), "" !== e ? sf.parent().parent().next(".ajax_search_results").append('<footer class="show_all_results"><a href="' + momAjaxL.homeUrl + "/?s=" + term + '">' + momAjaxL.viewAll + '<i class="fa-icon-long-arrow-right"></i></a></footer>') : (sf.parent().parent().next(".ajax_search_results").find("show_all_results").remove(), sf.parent().parent().next(".ajax_search_results").html('<span class="sw-not_found">' + momAjaxL.noResults + "</span>"))) : sf.parent().parent().next(".ajax_search_results").html(""), sf.parent().parent().find(".sf-loading").fadeOut() 1289 } 1290 }) 1291 }, 300) : setTimeout(function() { 1292 jQuery.ajax({ 1293 type: "post", 1294 url: momAjaxL.url, 1295 dataType: "html",
1296 data: "action=mom_ajaxsearch&nonce=" + momAjaxL.nonce + "&term=" + term, 1297 success: function() { 1298 "" === sf.val() && sf.parent().parent().next(".ajax_search_results").html("") 1299 } 1300 }) 1301 }, 300), !1 1302 }) 1303}), jQuery(document).ready(function(e) { 1304 offset = "", jQuery("a.show-more-posts").click(function(a) { 1305 a.preventDefault(); 1306 var t = e(this); 1307 style = t.data("style"), share = t.data("share"), count = t.data("count"), offset = t.data("offset"), display = t.data("display"), category = t.data("category"), tag = t.data("tag"), sort = t.data("sort"), orderby = t.data("orderby"), format = t.data("format"), excerpt_length = t.data("excerpt_length"), load_more_count = t.data("load_more_count"), exclude_cats = t.data("exclude_cats"), jQuery.ajax({ 1308 type: "post", 1309 url: momAjaxL.url, 1310 dataType: "html", 1311 data: "action=mom_loadMore&nonce=" + momAjaxL.nonce + "&display=" + display + "&category=" + category + "&tag=" + tag + "&number_of_posts=" + count + "&sort=" + sort + "&orderby=" + orderby + "&offset=" + offset + "&format=" + format + "&excerpt_length=" + excerpt_length + "&style=" + style + "&share=" + share + "&load_more_count=" + load_more_count+ "&exclude_cats=" + exclude_cats, 1312 beforeSend: function() { 1313 t.find("i").addClass("fa-spin") 1314 }, 1315 success: function(e) { 1316 t.before(e), t.find("i").removeClass("fa-spin"), "" === e && t.text(momAjaxL.nomore) 1317 } 1318 }), t.data("offset", offset + load_more_count), console.log(offset) 1319 }) 1320}), jQuery(document).ready(function(e) { 1321 jQuery(".mom_mailchimp_subscribe").submit(function() { 1322 return sf = jQuery(this), email = sf.find(".mms-email").val(), list = sf.data("list_id"), e(".message-box").fadeOut(), "" === email ? sf.before('<span class="message-box error">' + momAjaxL.error2 + '<i class="brankic-icon-error"></i></span>') : mom_isValidEmailAddress(email) ? jQuery.ajax({ 1323 type: "post", 1324 url: momAjaxL.url, 1325 dataType: "html", 1326 data: "action=mom_mailchimp&nonce=" + momAjaxL.nonce + "&email=" + email + "&list_id=" + list, 1327 beforeSend: function() { 1328 sf.find(".sf-loading").fadeIn() 1329 }, 1330 success: function(a) { 1331 "success" === a ? (sf.find(".email").val(""), sf.before('<span class="message-box success">' + momAjaxL.success + '<i class="brankic-icon-error"></i></span>').hide().fadeIn()) : sf.before('<span class="message-box error">' + momAjaxL.error + '<i class="brankic-icon-error"></i></span>').hide().fadeIn(), sf.find(".sf-loading").fadeOut(), e(".message-box i").on("click", function() { 1332 e(this).parent().fadeOut() 1333 }) 1334 } 1335 }) : sf.before('<span class="message-box error">' + momAjaxL.error2 + '<i class="brankic-icon-error"></i></span>'), !1 1336 }) 1337}), jQuery(document).ready(function() { 1338 offset = "", offset_rest = "", jQuery(".nb-footer a.show-more-ajax").click(function(e) { 1339 e.preventDefault(), bt = jQuery(this), where = bt.parent().prev(), nbs = bt.data("nbs"), nop = bt.data("number_of_posts"), offset = bt.data("offset"), offset_rest = offset + 1, post_type = bt.data("post_type"), display = bt.data("display"), category = bt.data("category"), tag = bt.data("tag"), sort = bt.data("sort"), orderby = bt.data("orderby"), exclude_cats = bt.data("exclude_cats"), format = "", image_size = "", excerpt_length = "", "news_list" === nbs && (format = bt.data("format"), image_size = bt.data("image_size"), excerpt_length = bt.data("excerpt_length")), jQuery.ajax({ 1340 type: "post", 1341 url: momAjaxL.url, 1342 dataType: "html", 1343 data: "action=nbsm&nonce=" + momAjaxL.nonce + "&display=" + display + "&category=" + category + "&tag=" + tag + "&nbs=" + nbs + "&number_of_posts=" + nop + "&sort=" + sort + "&orderby=" + orderby + "&offset=" + offset + "&offset_all=" + offset_rest + "&format=" + format + "&image_size=" + image_size + "&excerpt_length=" + excerpt_length + "&post_type=" + post_type+ "&exclude_cats=" + exclude_cats, 1344 beforeSend: function() { 1345 where.append('<i class="nb-load"></i>') 1346 }, 1347 success: function(e) { 1348 "" == e && bt.parent().append('<a class="nomoreposts">' + momAjaxL.nomore + "</a>").hide().fadeIn(), "" !== e && where.html(e), where.find(".nb-load").remove() 1349 }, 1350 complete: function() {} 1351 }), bt.data("offset", offset + (nop + 1)) 1352 }) 1353}), jQuery(document).ready(function(e) { 1354 jQuery(".weather-form").submit(function() { 1355 return form = jQuery(this), city = form.find("input").val(), lang = form.find("input").data("lang"), units = form.find("input").data("units"), jQuery.ajax({ 1356 type: "post", 1357 url: momAjaxL.url, 1358 dataType: "html",
1359 data: "action=mom_ajaxweather&nonce=" + momAjaxL.nonce + "&city=" + city + "&lang=" + lang + "&units=" + units, 1360 beforeSend: function() { 1361 form.find(".sf-loading").fadeIn() 1362 }, 1363 success: function(a) { 1364 "" !== city && ("" !== a ? (form.nextAll(".weather-widget").html(a).hide().fadeIn(), form.next(".message-box").fadeOut()) : (form.next(".message-box").remove(), form.after('<span class="message-box error">' + momAjaxL.werror + '<i class="brankic-icon-error"></i></span>'))), form.find(".sf-loading").fadeOut(), e(".message-box i").on("click", function() { 1365 e(this).parent().fadeOut() 1366 }) 1367 } 1368 }), !1 1369 }) 1370}); 1371 1372// email valid 1373function mom_isValidEmailAddress(emailAddress) { 1374 var pattern = new RegExp(/^(("[\w-+\s]+")|([\w-+]+(?:\.[\w-+]+)*)|("[\w-+\s]+")([\w-+]+(?:\.[\w-+]+)*))(@((?:[\w-+]+\.)*\w[\w-+]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][\d]\.|1[\d]{2}\.|[\d]{1,2}\.))((25[0-5]|2[0-4][\d]|1[\d]{2}|[\d]{1,2})\.){2}(25[0-5]|2[0-4][\d]|1[\d]{2}|[\d]{1,2})\]?$)/i); 1375 return pattern.test(emailAddress); 1376}; 1377 1378/*! 1379 * imagesLoaded PACKAGED v3.1.8 1380 * JavaScript is all like "You images are done yet or what?" 1381 * MIT License 1382 */ 1383 1384(function(){function e(){}function t(e,t){for(var n=e.length;n--;)if(e[n].listener===t)return n;return-1}function n(e){return function(){return this[e].apply(this,arguments)}}var i=e.prototype,r=this,o=r.EventEmitter;i.getListeners=function(e){var t,n,i=this._getEvents();if("object"==typeof e){t={};for(n in i)i.hasOwnProperty(n)&&e.test(n)&&(t[n]=i[n])}else t=i[e]||(i[e]=[]);return t},i.flattenListeners=function(e){var t,n=[];for(t=0;e.length>t;t+=1)n.push(e[t].listener);return n},i.getListenersAsObject=function(e){var t,n=this.getListeners(e);return n instanceof Array&&(t={},t[e]=n),t||n},i.addListener=function(e,n){var i,r=this.getListenersAsObject(e),o="object"==typeof n;for(i in r)r.hasOwnProperty(i)&&-1===t(r[i],n)&&r[i].push(o?n:{listener:n,once:!1});return this},i.on=n("addListener"),i.addOnceListener=function(e,t){return this.addListener(e,{listener:t,once:!0})},i.once=n("addOnceListener"),i.defineEvent=function(e){return this.getListeners(e),this},i.defineEvents=function(e){for(var t=0;e.length>t;t+=1)this.defineEvent(e[t]);return this},i.removeListener=function(e,n){var i,r,o=this.getListenersAsObject(e);for(r in o)o.hasOwnProperty(r)&&(i=t(o[r],n),-1!==i&&o[r].splice(i,1));return this},i.off=n("removeListener"),i.addListeners=function(e,t){return this.manipulateListeners(!1,e,t)},i.removeListeners=function(e,t){return this.manipulateListeners(!0,e,t)},i.manipulateListeners=function(e,t,n){var i,r,o=e?this.removeListener:this.addListener,s=e?this.removeListeners:this.addListeners;if("object"!=typeof t||t instanceof RegExp)for(i=n.length;i--;)o.call(this,t,n[i]);else for(i in t)t.hasOwnProperty(i)&&(r=t[i])&&("function"==typeof r?o.call(this,i,r):s.call(this,i,r));return this},i.removeEvent=function(e){var t,n=typeof e,i=this._getEvents();if("string"===n)delete i[e];else if("object"===n)for(t in i)i.hasOwnProperty(t)&&e.test(t)&&delete i[t];else delete this._events;return this},i.removeAllListeners=n("removeEvent"),i.emitEvent=function(e,t){var n,i,r,o,s=this.getListenersAsObject(e);for(r in s)if(s.hasOwnProperty(r))for(i=s[r].length;i--;)n=s[r][i],n.once===!0&&this.removeListener(e,n.listener),o=n.listener.apply(this,t||[]),o===this._getOnceReturnValue()&&this.removeListener(e,n.listener);return this},i.trigger=n("emitEvent"),i.emit=function(e){var t=Array.prototype.slice.call(arguments,1);return this.emitEvent(e,t)},i.setOnceReturnValue=function(e){return this._onceReturnValue=e,this},i._getOnceReturnValue=function(){return this.hasOwnProperty("_onceReturnValue")?this._onceReturnValue:!0},i._getEvents=function(){return this._events||(this._events={})},e.noConflict=function(){return r.EventEmitter=o,e},"function"==typeof define&&define.amd?define("eventEmitter/EventEmitter",[],function(){return e}):"object"==typeof module&&module.exports?module.exports=e:this.EventEmitter=e}).call(this),function(e){function t(t){var n=e.event;return n.target=n.target||n.srcElement||t,n}var n=document.documentElement,i=function(){};n.addEventListener?i=function(e,t,n){e.addEventListener(t,n,!1)}:n.attachEvent&&(i=function(e,n,i){e[n+i]=i.handleEvent?function(){var n=t(e);i.handleEvent.call(i,n)}:function(){var n=t(e);i.call(e,n)},e.attachEvent("on"+n,e[n+i])});var r=function(){};n.removeEventListener?r=function(e,t,n){e.removeEventListener(t,n,!1)}:n.detachEvent&&(r=function(e,t,n){e.detachEvent("on"+t,e[t+n]);try{delete e[t+n]}catch(i){e[t+n]=void 0}});var o={bind:i,unbind:r};"function"==typeof define&&define.amd?define("eventie/eventie",o):e.eventie=o}(this),function(e,t){"function"==typeof define&&define.amd?define(["eventEmitter/EventEmitter","eventie/eventie"],function(n,i){return t(e,n,i)}):"object"==typeof exports?module.exports=t(e,require("wolfy87-eventemitter"),require("eventie")):e.imagesLoaded=t(e,e.EventEmitter,e.eventie)}(window,function(e,t,n){function i(e,t){for(var n in t)e[n]=t[n];return e}function r(e){return"[object Array]"===d.call(e)}function o(e){var t=[];if(r(e))t=e;else if("number"==typeof e.length)for(var n=0,i=e.length;i>n;n++)t.push(e[n]);else t.push(e);return t}function s(e,t,n){if(!(this instanceof s))return new s(e,t);"string"==typeof e&&(e=document.querySelectorAll(e)),this.elements=o(e),this.options=i({},this.options),"function"==typeof t?n=t:i(this.options,t),n&&this.on("always",n),this.getImages(),a&&(this.jqDeferred=new a.Deferred);var r=this;setTimeout(function(){r.check()})}function f(e){this.img=e}function c(e){this.src=e,v[e]=this}var a=e.jQuery,u=e.console,h=u!==void 0,d=Object.prototype.toString;s.prototype=new t,s.prototype.options={},s.prototype.getImages=function(){this.images=[];for(var e=0,t=this.elements.length;t>e;e++){var n=this.elements[e];"IMG"===n.nodeName&&this.addImage(n);var i=n.nodeType;if(i&&(1===i||9===i||11===i))for(var r=n.querySelectorAll("img"),o=0,s=r.length;s>o;o++){var f=r[o];this.addImage(f)}}},s.prototype.addImage=function(e){var t=new f(e);this.images.push(t)},s.prototype.check=function(){function e(e,r){return t.options.debug&&h&&u.log("confirm",e,r),t.progress(e),n++,n===i&&t.complete(),!0}var t=this,n=0,i=this.images.length;if(this.hasAnyBroken=!1,!i)return this.complete(),void 0;for(var r=0;i>r;r++){var o=this.images[r];o.on("confirm",e),o.check()}},s.prototype.progress=function(e){this.hasAnyBroken=this.hasAnyBroken||!e.isLoaded;var t=this;setTimeout(function(){t.emit("progress",t,e),t.jqDeferred&&t.jqDeferred.notify&&t.jqDeferred.notify(t,e)})},s.prototype.complete=function(){var e=this.hasAnyBroken?"fail":"done";this.isComplete=!0;var t=this;setTimeout(function(){if(t.emit(e,t),t.emit("always",t),t.jqDeferred){var n=t.hasAnyBroken?"reject":"resolve";t.jqDeferred[n](t)}})},a&&(a.fn.imagesLoaded=function(e,t){var n=new s(this,e,t);return n.jqDeferred.promise(a(this))}),f.prototype=new t,f.prototype.check=function(){var e=v[this.img.src]||new c(this.img.src);if(e.isConfirmed)return this.confirm(e.isLoaded,"cached was confirmed"),void 0;
1384if(this.img.complete&&void 0!==this.img.naturalWidth)return this.confirm(0!==this.img.naturalWidth,"naturalWidth"),void 0;var t=this;e.on("confirm",function(e,n){return t.confirm(e.isLoaded,n),!0}),e.check()},f.prototype.confirm=function(e,t){this.isLoaded=e,this.emit("confirm",this,t)};var v={};return c.prototype=new t,c.prototype.check=function(){if(!this.isChecked){var e=new Image;n.bind(e,"load",this),n.bind(e,"error",this),e.src=this.src,this.isChecked=!0}},c.prototype.handleEvent=function(e){var t="on"+e.type;this[t]&&this[t](e)},c.prototype.onload=function(e){this.confirm(!0,"onload"),this.unbindProxyEvents(e)},c.prototype.onerror=function(e){this.confirm(!1,"onerror"),this.unbindProxyEvents(e)},c.prototype.confirm=function(e,t){this.isConfirmed=!0,this.isLoaded=e,this.emit("confirm",this,t)},c.prototype.unbindProxyEvents=function(e){n.unbind(e.target,"load",this),n.unbind(e.target,"error",this)},s}); 1385 1386/* 1387 JQuery Advanced News Ticker 1.0.11 (20/02/14) 1388 created by risq 1389 website (docs & demos) : http://risq.github.io/jquery-advanced-news-ticker/ 1390*/ 1391(function(b,k,l,m){function g(a,f){this.element=a;this.$el=b(a);this.options=b.extend({},c,f);this._defaults=c;this._name=d;this.moveInterval;this.moving=this.paused=this.state=0;(this.$el.is("ul")||this.$el.is("ol"))&&this.init()}var d="newsTicker",c={row_height:20,max_rows:3,speed:400,duration:2500,direction:"up",autostart:1,pauseOnHover:1,nextButton:null,prevButton:null,startButton:null,stopButton:null,hasMoved:function(){},movingUp:function(){},movingDown:function(){},start:function(){},stop:function(){}, 1392pause:function(){},unpause:function(){}};g.prototype={init:function(){this.$el.height(this.options.row_height*this.options.max_rows).css({overflow:"hidden"});this.checkSpeed();this.options.nextButton&&"undefined"!==typeof this.options.nextButton[0]&&this.options.nextButton.click(function(a){this.moveNext();this.resetInterval()}.bind(this));this.options.prevButton&&"undefined"!==typeof this.options.prevButton[0]&&this.options.prevButton.click(function(a){this.movePrev();this.resetInterval()}.bind(this)); 1393this.options.stopButton&&"undefined"!==typeof this.options.stopButton[0]&&this.options.stopButton.click(function(a){this.stop()}.bind(this));this.options.startButton&&"undefined"!==typeof this.options.startButton[0]&&this.options.startButton.click(function(a){this.start()}.bind(this));this.options.pauseOnHover&&this.$el.hover(function(){this.state&&this.pause()}.bind(this),function(){this.state&&this.unpause()}.bind(this));this.options.autostart&&this.start()},start:function(){this.state||(this.state= 13941,this.resetInterval(),this.options.start())},stop:function(){this.state&&(clearInterval(this.moveInterval),this.state=0,this.options.stop())},resetInterval:function(){this.state&&(clearInterval(this.moveInterval),this.moveInterval=setInterval(function(){this.move()}.bind(this),this.options.duration))},move:function(){this.paused||this.moveNext()},moveNext:function(){"down"===this.options.direction?this.moveDown():"up"===this.options.direction&&this.moveUp()},movePrev:function(){"down"===this.options.direction? 1395this.moveUp():"up"===this.options.direction&&this.moveDown()},pause:function(){this.paused||(this.paused=1);this.options.pause()},unpause:function(){this.paused&&(this.paused=0);this.options.unpause()},moveDown:function(){this.moving||(this.moving=1,this.options.movingDown(),this.$el.children("li:last").detach().prependTo(this.$el).css("marginTop","-"+this.options.row_height+"px").animate({marginTop:"0px"},this.options.speed,function(){this.moving=0;this.options.hasMoved()}.bind(this)))},moveUp:function(){if(!this.moving){this.moving= 13961;this.options.movingUp();var a=this.$el.children("li:first");a.animate({marginTop:"-"+this.options.row_height+"px"},this.options.speed,function(){a.detach().css("marginTop","0").appendTo(this.$el);this.moving=0;this.options.hasMoved()}.bind(this))}},updateOption:function(a,b){"undefined"!==typeof this.options[a]&&(this.options[a]=b,"duration"==a||"speed"==a)&&(this.checkSpeed(),this.resetInterval())},add:function(a){this.$el.append(b("<li>").html(a))},getState:function(){return paused?2:this.state}, 1397checkSpeed:function(){this.options.duration<this.options.speed+25&&(this.options.speed=this.options.duration-25)},destroy:function(){this._destroy()}};b.fn[d]=function(a){var f=arguments;return this.each(function(){var c=b(this),e=b.data(this,"plugin_"+d),h="object"===typeof a&&a;e||c.data("plugin_"+d,e=new g(this,h));"string"===typeof a&&e[a].apply(e,Array.prototype.slice.call(f,1)
1397)})}})(jQuery,window,document);
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.