1/** 2 * @package WordPress 3 * @subpackage Dance Studio 4 * @version 1.2.7 5 * 6 * Theme Custom Scripts 7 * Created by CMSMasters 8 * 9 */ 10 11 12 13jQuery(document).ready(function() { 14 "use strict"; 15 16 /* Add Class To Row */ 17 (function ($) { 18 $('.cmsmasters_row_margin').each(function () { 19 var cmsmasters_column = $(this).find('.cmsmasters_column').eq(0); 20 21 22 if ( 23 cmsmasters_column.hasClass('one_half') && 24 cmsmasters_column.next().hasClass('one_half') 25 ) { 26 $(this).addClass('cmsmasters_1212'); 27 } else if ( 28 cmsmasters_column.hasClass('one_third') && 29 cmsmasters_column.next().hasClass('two_third') 30 ) { 31 $(this).addClass('cmsmasters_1323'); 32 } else if ( 33 cmsmasters_column.hasClass('two_third') && 34 cmsmasters_column.next().hasClass('one_third') 35 ) { 36 $(this).addClass('cmsmasters_2313'); 37 } else if ( 38 cmsmasters_column.hasClass('one_fourth') && 39 cmsmasters_column.next().hasClass('three_fourth') 40 ) { 41 $(this).addClass('cmsmasters_1434'); 42 } else if ( 43 cmsmasters_column.hasClass('three_fourth') && 44 cmsmasters_column.next().hasClass('one_fourth') 45 ) { 46 $(this).addClass('cmsmasters_3414'); 47 } else if ( 48 cmsmasters_column.hasClass('one_third') && 49 cmsmasters_column.next().hasClass('one_third') && 50 cmsmasters_column.next().next().hasClass('one_third') 51 ) { 52 $(this).addClass('cmsmasters_131313'); 53 } else if ( 54 cmsmasters_column.hasClass('one_half') && 55 cmsmasters_column.next().hasClass('one_fourth') && 56 cmsmasters_column.next().next().hasClass('one_fourth') 57 ) { 58 $(this).addClass('cmsmasters_121414'); 59 } else if ( 60 cmsmasters_column.hasClass('one_fourth') && 61 cmsmasters_column.next().hasClass('one_half') && 62 cmsmasters_column.next().next().hasClass('one_fourth') 63 ) { 64 $(this).addClass('cmsmasters_141214'); 65 } else if ( 66 cmsmasters_column.hasClass('one_fourth') && 67 cmsmasters_column.next().hasClass('one_fourth') && 68 cmsmasters_column.next().next().hasClass('one_half') 69 ) { 70 $(this).addClass('cmsmasters_141412'); 71 } else if ( 72 cmsmasters_column.hasClass('one_fourth') && 73 cmsmasters_column.next().hasClass('one_fourth') && 74 cmsmasters_column.next().next().hasClass('one_fourth') && 75 cmsmasters_column.next().next().next().hasClass('one_fourth') 76 ) { 77 $(this).addClass('cmsmasters_14141414'); 78 } else { 79 $(this).addClass('cmsmasters_11'); 80 } 81 } ); 82 } )(jQuery); 83 84 85 86 /* Scroll Top */ 87 (function ($) { 88 $(window).scroll(function () { 89 if ($(this).scrollTop() > 200) { 90 $('#slide_top').filter(':hidden').fadeIn('fast'); 91 } else { 92 $('#slide_top').filter(':visible').fadeOut('fast'); 93 } 94 } ); 95 96 97 $('.divider a, #slide_top').click(function () { 98 $('html, body').animate( { 99 scrollTop : 0 100 }, 'slow'); 101 102 103 return false; 104 } ); 105 } )(jQuery); 106 107 108 109 /* Lightbox Classes Adding */ 110 (function ($) { 111 $('.widget_custom_flickr_entries').each(function () { 112 var flickrUniqID = uniqID(); 113 114 115 $(this).find('.flickr_badge_image a').each(function () { 116 var src = $(this).find('img').attr('src'), 117 title = $(this).find('img').attr('title'), 118 src_full = src.replace(/_s.jpg/g, '.jpg'); 119 120 121 $(this).removeAttr('href').attr( { 122 href : src_full, 123 title : title, 124 rel : 'ilightbox[flickr_' + flickrUniqID + ']' 125 } ); 126 } ); 127 } ); // Flickr Widget Lightbox 128 129 130 $('.gallery').each(function () { 131 var galUniqID = uniqID(); 132 133 134 $(this).find('a').each(function () { 135 var linkHref = $(this).attr('href'), 136 lastDotPos = linkHref.lastIndexOf('.'), 137 imgFormat = linkHref.slice(lastDotPos + 1); 138 139 140 if (imgFormat.length <= 5) { 141 $(this).attr('rel', 'ilightbox[wp_gal_' + galUniqID + ']'); 142 } 143 } ); 144 } ); // WordPress Default Gallery Shortcode Lightbox 145 } )(jQuery); 146 147 148 149 /* iLightBox Init */ 150 (function ($) { 151 var ilightbox_settings = { 152 skin : cmsmasters_script.ilightbox_skin, 153 path : cmsmasters_script.ilightbox_path, 154 infinite : (cmsmasters_script.ilightbox_infinite == '1') ? true : false, 155 keepAspectRatio : (cmsmasters_script.ilightbox_aspect_ratio == '1') ? true : false, 156 mobileOptimizer : (cmsmasters_script.ilightbox_mobile_optimizer == '1') ? true : false, 157 maxScale : Number(cmsmasters_script.ilightbox_max_scale), 158 minScale : Number(cmsmasters_script.ilightbox_min_scale), 159 innerToolbar : (cmsmasters_script.ilightbox_inner_toolbar == '1') ? true : false, 160 smartRecognition : (cmsmasters_script.ilightbox_mobile_optimizer == '1') ? true : false, 161 fullAlone : (cmsmasters_script.ilightbox_fullscreen_one_slide == '1') ? true : false, 162 fullViewPort : cmsmasters_script.ilightbox_fullscreen_viewport, 163 controls : { 164 toolbar : (cmsmasters_script.ilightbox_controls_toolbar == '1') ? true : false, 165 arrows : (cmsmasters_script.ilightbox_controls_arrows == '1') ? true : false, 166 fullscreen : (cmsmasters_script.ilightbox_controls_fullscreen == '1') ? true : false, 167 thumbnail : (cmsmasters_script.ilightbox_controls_thumbnail == '1') ? true : false, 168 keyboard : (cmsmasters_script.ilightbox_controls_keyboard == '1') ? true : false, 169 mousewheel : (cmsmasters_script.ilightbox_controls_mousewheel == '1') ? true : false, 170 swipe : (cmsmasters_script.ilightbox_controls_swipe == '1') ? true : false, 171 slideshow : (cmsmasters_script.ilightbox_controls_slideshow == '1') ? true : false 172 }, 173 text : { 174 close : cmsmasters_script.ilightbox_close_text, 175 enterFullscreen : cmsmasters_script.ilightbox_enter_fullscreen_text, 176 exitFullscreen : cmsmasters_script.ilightbox_exit_fullscreen_text, 177 slideShow : cmsmasters_script.ilightbox_slideshow_text, 178 next : cmsmasters_script.ilightbox_next_text, 179 previous : cmsmasters_script.ilightbox_previous_text 180 }, 181 errors : { 182 loadImage : cmsmasters_script.ilightbox_load_image_error, 183 loadContents : cmsmasters_script.ilightbox_load_contents_error, 184 missingPlugin : cmsmasters_script.ilightbox_missing_plugin_error 185 } 186 }, 187 gallery_array = [], 188 gallery_id = ''; 189 190 191 $('[rel="ilightbox"]').each(function () { 192 $(this).iLightBox(ilightbox_settings); 193 } ); 194 195 196 $('[rel^="ilightbox["]').each(function () { 197 if ($(this).closest('.cmsmasters_more_items_loader').length === 0) { 198 var item_rel = $(this).attr('rel'); 199 200 if ($.inArray(item_rel, gallery_array) === -1) { 201 gallery_array.push(item_rel); 202 } 203 } 204 } ); 205 206 207 $.each(gallery_array, function (gallery_array, gallery_id) { 208 $('[rel="' + gallery_id + '"]').iLightBox(ilightbox_settings); 209 } ); 210 } )(jQuery); 211 212 213 214 /* Shortcodes Animation Run */ 215 (function ($) { 216 if ( 217 !checker.os.iphone && 218 !checker.os.ipod && 219 !checker.os.ipad && 220 !checker.os.blackberry && 221 !checker.os.android 222 ) { 223 $('[data-animation]').waypoint(function (dir) { 224 if (dir === 'down') { 225 var el = $(this), 226 animation = el.data('animation'),
227 delay = (el.data('delay')) ? el.data('delay') : 0; 228 229 230 setTimeout(function () { 231 el.addClass(animation + ' animated'); 232 }, delay); 233 } 234 }, { 235 offset : '100%' 236 } ).waypoint(function (dir) { 237 if (dir === 'up') { 238 var el = $(this), 239 animation = el.data('animation'), 240 delay = (el.data('delay')) ? el.data('delay') : 0; 241 242 243 setTimeout(function () { 244 el.addClass(animation + ' animated'); 245 }, delay); 246 } 247 }, { 248 offset : '25%' 249 } ); 250 } else { 251 $('[data-animation]').addClass('animated'); 252 } 253 254 255 if ( 256 !checker.os.iphone && 257 !checker.os.ipod && 258 !checker.os.ipad && 259 !checker.os.blackberry && 260 !checker.os.android 261 ) { 262 $('.cmsmasters_icon_box').waypoint(function (dir) { 263 if (dir === 'down') { 264 var el = $(this); 265 266 267 el.addClass('shortcode_animated'); 268 } 269 }, { 270 offset : '100%' 271 } ).waypoint(function (dir) { 272 if (dir === 'up') { 273 var el = $(this); 274 275 276 el.addClass('shortcode_animated'); 277 } 278 }, { 279 offset : '25%' 280 } ); 281 } else { 282 $('.cmsmasters_icon_box').addClass('shortcode_animated'); 283 } 284 285 286 if ( 287 !checker.os.iphone && 288 !checker.os.ipod && 289 !checker.os.ipad && 290 !checker.os.blackberry && 291 !checker.os.android 292 ) { 293 $('.cmsmasters_icon_list_items.cmsmasters_icon_list_type_block').waypoint(function (dir) { 294 if (dir === 'down') { 295 var el = $(this), 296 items = el.find('li'), 297 delay = 500, 298 i = 1; 299 300 301 items.each(function () { 302 var item = $(this); 303 304 305 setTimeout(function () { 306 item.addClass('shortcode_animated'); 307 }, delay * i); 308 309 310 i += 1; 311 } ); 312 } 313 }, { 314 offset : '100%' 315 } ).waypoint(function (dir) { 316 if (dir === 'up') { 317 var el = $(this), 318 items = el.find('li'), 319 delay = 500, 320 i = 1; 321 322 323 items.each(function () { 324 var item = $(this); 325 326 327 setTimeout(function () { 328 item.addClass('shortcode_animated'); 329 }, delay * i); 330 331 332 i += 1; 333 } ); 334 } 335 }, { 336 offset : '25%' 337 } ); 338 } else { 339 $('.cmsmasters_icon_list_items .cmsmasters_icon_list_item').addClass('shortcode_animated'); 340 } 341 342 343 if ( 344 !checker.os.iphone && 345 !checker.os.ipod && 346 !checker.os.ipad && 347 !checker.os.blackberry && 348 !checker.os.android 349 ) { 350 $('.cmsmasters_hover_slider').waypoint(function (dir) { 351 if (dir === 'down') { 352 var el = $(this), 353 items = el.find('li'), 354 delay = 300, 355 i = 1; 356 357 358 items.each(function () { 359 var item = $(this); 360 361 362 setTimeout(function () { 363 item.addClass('shortcode_animated'); 364 }, delay * i); 365 366 367 i += 1; 368 } ); 369 } 370 }, { 371 offset : '100%' 372 } ).waypoint(function (dir) { 373 if (dir === 'up') { 374 var el = $(this), 375 items = el.find('li'), 376 delay = 300, 377 i = 1; 378 379 380 items.each(function () { 381 var item = $(this); 382 383 384 setTimeout(function () { 385 item.addClass('shortcode_animated'); 386 }, delay * i); 387 388 389 i += 1; 390 } ); 391 } 392 }, { 393 offset : '25%' 394 } ); 395 } else { 396 $('.cmsmasters_hover_slider ul li').addClass('shortcode_animated'); 397 } 398 399 400 if ( 401 !checker.os.iphone && 402 !checker.os.ipod && 403 !checker.os.ipad && 404 !checker.os.blackberry && 405 !checker.os.android 406 ) { 407 $('.cmsmasters_profile.vertical').waypoint(function (dir) { 408 if (dir === 'down') { 409 var el = $(this), 410 items = el.find('article'), 411 delay = 500, 412 i = 1; 413 414 415 items.each(function () { 416 var item = $(this); 417 418 419 setTimeout(function () { 420 item.addClass('shortcode_animated'); 421 }, delay * i); 422 423 424 i += 1; 425 } ); 426 } 427 }, { 428 offset : '100%' 429 } ).waypoint(function (dir) { 430 if (dir === 'up') { 431 var el = $(this), 432 items = el.find('article'),
433 delay = 500, 434 i = 1; 435 436 437 items.each(function () { 438 var item = $(this); 439 440 441 setTimeout(function () { 442 item.addClass('shortcode_animated'); 443 }, delay * i); 444 445 446 i += 1; 447 } ); 448 } 449 }, { 450 offset : '25%' 451 } ); 452 } else { 453 $('.cmsmasters_profile.vertical .profile').addClass('shortcode_animated'); 454 } 455 456 457 if ( 458 !checker.os.iphone && 459 !checker.os.ipod && 460 !checker.os.ipad && 461 !checker.os.blackberry && 462 !checker.os.android 463 ) { 464 $('.cmsmasters_clients_grid').waypoint(function (dir) { 465 if (dir === 'down') { 466 var el = $(this), 467 items = el.find('.cmsmasters_clients_item'), 468 delay = 300, 469 i = 1; 470 471 472 items.each(function () { 473 var item = $(this); 474 475 476 setTimeout(function () { 477 item.addClass('shortcode_animated'); 478 }, delay * i); 479 480 481 i += 1; 482 } ); 483 } 484 }, { 485 offset : '100%' 486 } ).waypoint(function (dir) { 487 if (dir === 'up') { 488 var el = $(this), 489 items = el.find('.cmsmasters_clients_item'), 490 delay = 300, 491 i = 1; 492 493 494 items.each(function () { 495 var item = $(this); 496 497 498 setTimeout(function () { 499 item.addClass('shortcode_animated'); 500 }, delay * i); 501 502 503 i += 1; 504 } ); 505 } 506 }, { 507 offset : '25%' 508 } ); 509 } else { 510 $('.cmsmasters_clients_grid').find('.cmsmasters_clients_item').addClass('shortcode_animated'); 511 } 512 513 514 if ( 515 !checker.os.iphone && 516 !checker.os.ipod && 517 !checker.os.ipad && 518 !checker.os.blackberry && 519 !checker.os.android 520 ) { 521 $('.cmsmasters_gallery, .blog.columns, .blog.timeline').waypoint(function (dir) { 522 if (dir === 'down') { 523 var el = $(this), 524 items = el.find('article.post, .cmsmasters_gallery_item'), 525 itemsCount = items.length, 526 delay = 300, 527 i = 1; 528 529 530 var newTime = setInterval(function () { 531 if (el.hasClass('isotope')) { 532 clearInterval(newTime); 533 } else { 534 return false; 535 } 536 537 538 items.each(function () { 539 var item = $(this); 540 541 542 setTimeout(function () { 543 item.addClass('shortcode_animated'); 544 }, delay * i); 545 546 547 i += 1; 548 549 550 if (i === itemsCount) { 551 setTimeout(function () { 552 $(window).trigger('resize'); 553 }, delay * i); 554 } 555 } ); 556 }, 300); 557 } 558 }, { 559 offset : '100%' 560 } ).waypoint(function (dir) { 561 if (dir === 'up') { 562 var el = $(this), 563 items = el.find('article.post, .cmsmasters_gallery_item'), 564 itemsCount = items.length, 565 delay = 300, 566 i = 1; 567 568 569 var newTime = setInterval(function () { 570 if (el.hasClass('isotope')) { 571 clearInterval(newTime); 572 } else { 573 return false; 574 } 575 576 577 items.each(function () { 578 var item = $(this); 579 580 581 setTimeout(function () { 582 item.addClass('shortcode_animated'); 583 }, delay * i); 584 585 586 i += 1; 587 588 589 if (i === itemsCount) { 590 setTimeout(function () { 591 $(window).trigger('resize'); 592 }, delay * i); 593 } 594 } ); 595 }, 300); 596 } 597 }, { 598 offset : '25%' 599 } ); 600 } else { 601 $('.cmsmasters_gallery, .blog.columns, .blog.timeline').find('article.post, .cmsmasters_gallery_item').addClass('shortcode_animated'); 602 } 603 } )(jQuery); 604 605 606 607 /* Stats Run */ 608 (function ($) { 609 if ( 610 !checker.os.iphone && 611 !checker.os.ipod && 612 !checker.os.ipad && 613 !checker.os.blackberry && 614 !checker.os.android && 615 !checker.ua.ie9 616 ) { 617 $('.cmsmasters_stats.stats_mode_circles').waypoint(function () { 618 var i = 1; 619 620 621 $(this).find('.cmsmasters_stat').each(function () { 622 var el = $(this); 623 624 625 setTimeout(function () { 626 el.easyPieChart( { 627 size : 180, 628 lineWidth : 5, 629 lineCap : 'square', 630 animate : 1000, 631 scaleColor : false, 632 trackColor : false, 633 barColor : function () { 634 return ($(this.el).data('bar-color')) ? $(this.el).data('bar-color') : cmsmasters_script.primary_color; 635 }, 636 onStep : function (from, to, val) { 637 $(this.el).find('.cmsmasters_stat_counter').text(~~val); 638 } 639 } ); 640 }, 500 * i); 641 642 643 i += 1; 644 } ); 645 }, { 646 offset : '100%' 647 } ); 648 } else { 649 $('.cmsmasters_stats.stats_mode_circles').find('.cmsmasters_stat').easyPieChart( { 650 size : 180, 651 lineWidth : 5, 652 lineCap : 'square', 653 animate : 1000, 654 scaleColor : false, 655 trackColor : false, 656 barColor : function () { 657 return ($(this.el).data('bar-color')) ? $(this.el).data('bar-color') : cmsmasters_script.primary_color; 658 }, 659 onStep : function (from, to, val) { 660 $(this.el).find('.cmsmasters_stat_counter').text(~~val); 661 } 662 } ); 663 } 664 665 666 if ( 667 !checker.os.iphone && 668 !checker.os.ipod && 669 !checker.os.ipad && 670 !checker.os.blackberry && 671 !checker.os.android && 672 !checker.ua.ie9 673 ) { 674 $('.cmsmasters_counters').waypoint(function () { 675 var i = 1; 676 677 678 $(this).find('.cmsmasters_counter').each(function () { 679 var el = $(this); 680 681 682 setTimeout(function () { 683 el.easyPieChart( { 684 size : 180, 685 lineWidth : 0, 686 lineCap : 'square', 687 animate : 1500, 688 scaleColor : false, 689 trackColor : false, 690 barColor : '#ffffff', 691 onStep : function (from, to, val) { 692 $(this.el).find('.cmsmasters_counter_counter').text(~~val); 693 } 694 } ); 695 }, 500 * i); 696 697 698 i += 1; 699 } ); 700 }, { 701 offset : '100%' 702 } ); 703 } else { 704 $('.cmsmasters_counters').find('.cmsmasters_counter').easyPieChart( { 705 size : 180, 706 lineWidth : 0, 707 lineCap : 'square', 708 animate : 1500, 709 scaleColor : false, 710 trackColor : false, 711 barColor : '#ffffff', 712 onStep : function (from, to, val) { 713 $(this.el).find('.cmsmasters_counter_counter').text(~~val); 714 } 715 } ); 716 } 717 718 719 if ( 720 !checker.os.iphone && 721 !checker.os.ipod && 722 !checker.os.ipad && 723 !checker.os.blackberry && 724 !checker.os.android && 725 !checker.ua.ie9 726 ) { 727 $('.cmsmasters_stats.stats_mode_bars').waypoint(function () { 728 $(this).addClass('shortcode_animated').find('.cmsmasters_stat').each(function () { 729 var el = $(this); 730 731 732 el.easyPieChart( { 733 size : 180, 734 lineWidth : 0, 735 lineCap : 'square', 736 animate : 1500, 737 scaleColor : false, 738 trackColor : false, 739 barColor : '#ffffff', 740 onStep : function (from, to, val) { 741 $(this.el).find('.cmsmasters_stat_counter').text(~~val); 742 } 743 } ); 744 } ); 745 }, { 746 offset : '100%' 747 } ); 748 } else { 749 $('.cmsmasters_stats.stats_mode_bars').addClass('shortcode_animated').find('.cmsmasters_stat').easyPieChart( { 750 size : 180, 751 lineWidth : 0, 752 lineCap : 'square', 753 animate : 1500, 754 scaleColor : false, 755 trackColor : false, 756 barColor : '#ffffff', 757 onStep : function (from, to, val) { 758 $(this.el).find('.cmsmasters_stat_counter').text(~~val); 759 } 760 } ); 761 } 762 } )(jQuery); 763 764 765 766 /* Header Search Toggle */ 767 (function ($) { 768 $('#header .header_mid .search_bar_wrap button').on('click', function () { 769 if ($(window).width() > (768 - 17)) { 770 var searchButton = $(this),
771 searchWrap = searchButton.closest('.search_wrap'); 772 773 774 if (searchWrap.hasClass('search_opened')) { 775 searchWrap.removeClass('search_opened'); 776 777 searchButton.removeClass('cmsmasters_theme_icon_cancel'); 778 779 setTimeout(function () { 780 searchButton.addClass('cmsmasters_theme_icon_search').attr('type', 'submit'); 781 }, 30); 782 } else { 783 searchWrap.addClass('search_opened'); 784 785 searchButton.removeClass('cmsmasters_theme_icon_search'); 786 787 setTimeout(function () { 788 searchButton.addClass('cmsmasters_theme_icon_cancel').attr('type', 'button'); 789 }, 30); 790 } 791 792 793 return false; 794 } 795 } ); 796 797 $(window).on('debouncedresize', function () { 798 if ($(window).width() <= (768 - 17)) { 799 var searchButton = $(this).parents('.header_mid').find('.search_bar_wrap button'), 800 searchWrap = searchButton.closest('.search_wrap'); 801 802 803 if (searchWrap.hasClass('search_opened')) { 804 searchWrap.removeClass('search_opened'); 805 806 searchButton.removeClass('cmsmasters_theme_icon_cancel'); 807 808 setTimeout(function () { 809 searchButton.addClass('cmsmasters_theme_icon_search').attr('type', 'submit'); 810 }, 30); 811 } 812 } 813 } ); 814 } )(jQuery); 815 816 817 /* Header Top Hide Toggle */ 818 (function ($) { 819 $('.header_top_but').on('click', function () { 820 var headerTopBut = $(this), 821 headerTopButArrow = headerTopBut.find('> span'), 822 headerTopOuter = headerTopBut.parents('.header_top').find('.header_top_outer'); 823 824 if (headerTopBut.hasClass('opened')) { 825 headerTopOuter.slideUp(); 826 827 headerTopButArrow.removeClass('cmsmasters-icon-angle-up').addClass('cmsmasters-icon-angle-down'); 828 829 headerTopBut.removeClass('opened').addClass('closed'); 830 } else if (headerTopBut.hasClass('closed')) { 831 headerTopOuter.slideDown(); 832 833 headerTopButArrow.removeClass('cmsmasters-icon-angle-down').addClass('cmsmasters-icon-angle-up'); 834 835 headerTopBut.removeClass('closed').addClass('opened'); 836 } 837 } ); 838 } )(jQuery); 839 840 841 842 /* Fixed Header Function Start */ 843 (function ($) { 844 $('#header').cmsmastersFixedHeaderScroll(); 845 } )(jQuery); 846 847 /* Responsive Navigation Function Start */ 848 (function ($) { 849 jQuery('#navigation').cmsmastersResponsiveNav(); 850 } )(jQuery); 851 852 /* Row Parallax Function Start */ 853 (function ($) { 854 $(window).on('load', function () { 855 if ( 856 !checker.os.iphone && 857 !checker.os.ipad && 858 !checker.os.ipod && 859 !checker.os.android && 860 !checker.os.blackberry 861 ) { 862 if (checker.ua.safari) { 863 if (checker.ua.chrome || checker.os.mac) { 864 setTimeout(function () { 865 $.stellar( { 866 horizontalScrolling : false, 867 verticalOffset : 30, 868 parallaxElements : false 869 } ); 870 }, 1500); 871 872 873 $(window).on('debouncedresize', function () { 874 if ($(window).width() < 1024) { 875 $.stellar('destroy'); 876 } else { 877 $.stellar( { 878 horizontalScrolling : false, 879 verticalOffset : 30, 880 parallaxElements : false 881 } ); 882 } 883 } ); 884 } 885 } else { 886 setTimeout(function () { 887 $.stellar( { 888 horizontalScrolling : false, 889 verticalOffset : 30, 890 parallaxElements : false 891 } ); 892 }, 1500); 893 894 895 $(window).on('debouncedresize', function () { 896 if ($(window).width() < 1024) { 897 $.stellar('destroy'); 898 } else { 899 $.stellar( { 900 horizontalScrolling : false, 901 verticalOffset : 30, 902 parallaxElements : false 903 } ); 904 } 905 } ); 906 } 907 } else { 908 $('div.cmsmasters_row').css('background-attachment', 'scroll'); 909 } 910 } ); 911 } )(jQuery); 912 913 914 915 /* One Page Navigation */ 916 (function ($) { 917 function cmsmasters_get_offset_val() { 918 var cmsmasters_wpAdminBar = $('#wpadminbar').outerHeight(), 919 cmsmasters_offset_val = (cmsmasters_wpAdminBar !== undefined) ? cmsmasters_wpAdminBar : 0; 920 921 922 if ($('#page').hasClass('fixed_header')) { 923 var header_mid_data_height = $('.header_mid').data('height'), 924 header_mid_height = header_mid_data_height - (header_mid_data_height / 3), 925 header_bot_data_height = $('.header_bot').data('height'), 926 header_bot_data_height = (header_bot_data_height !== undefined) ? header_bot_data_height : 0; 927 928 929 cmsmasters_offset_val = cmsmasters_offset_val + header_mid_height + header_bot_data_height - 1; 930 } 931 932 933 return cmsmasters_offset_val; 934 } 935 936 937 var cmsmasters_window_hash = window.location.hash; 938 939 if ($(cmsmasters_window_hash).length > 0) { 940 setTimeout(function () { 941 $('html, body').animate( { 942 scrollTop: $(cmsmasters_window_hash).offset().top - cmsmasters_get_offset_val() + 1 943 }, 800); 944 }, 800); 945 } 946 947 948 $('body').scrollspy({target: '#navigation'}); 949 950 951 $('#navigation a').on('click', function(event) { 952 if (this.hash !== "") { 953 event.preventDefault(); 954 955 956 var hash = this.hash, 957 linkHref = $(this).attr('href'); 958 959 960 if ($(hash).length > 0) { 961 $('html, body').animate( {
962 scrollTop: $(hash).offset().top - cmsmasters_get_offset_val() + 1 963 }, 800, function() { 964 if (history.pushState) { 965 history.pushState(null, null, hash); 966 } 967 } ); 968 } else if (!$('body').hasClass('cmsmasters_custom_page_menu')) { 969 if ( 970 linkHref.indexOf(hash) !== -1 && 971 linkHref.slice(0, linkHref.indexOf(hash)) !== cmsmasters_script.site_url && 972 linkHref !== hash 973 ) { 974 window.location.href = linkHref; 975 } else { 976 window.location.href = cmsmasters_script.site_url + hash; 977 } 978 } 979 } 980 } ); 981 } )(jQuery); 982 983 984 985 /* Notise Close Button */ 986 (function ($) { 987 $('.cmsmasters_notice a.notice_close').on('click', function () { 988 $(this).parents('.cmsmasters_notice').fadeOut(500, function () { 989 $(this).remove(); 990 } ); 991 992 993 return false; 994 } ); 995 } )(jQuery); 996 997 998 999 /* Toggles */ 1000 (function ($) { 1001 $('.cmsmasters_toggles .cmsmasters_toggle_title a').on('click', function (i) { 1002 var active_toggle = $(this).parents('.cmsmasters_toggles').find('.cmsmasters_toggle_wrap.current_toggle .cmsmasters_toggle'), 1003 toggle = $(this).parents('.cmsmasters_toggle_wrap'), 1004 acc = ($(this).parents('.cmsmasters_toggles').hasClass('toggles_mode_accordion')) ? true : false, 1005 dropDown = toggle.find('.cmsmasters_toggle'); 1006 1007 1008 if (toggle.hasClass('current_toggle')) { 1009 dropDown.slideUp('fast', function () { 1010 toggle.removeClass('current_toggle'); 1011 } ); 1012 } else { 1013 if (acc) { 1014 active_toggle.slideUp('fast', function () { 1015 active_toggle.parents('.cmsmasters_toggle_wrap').removeClass('current_toggle'); 1016 } ); 1017 } 1018 1019 dropDown.slideDown('fast', function () { 1020 toggle.addClass('current_toggle'); 1021 } ); 1022 } 1023 1024 1025 i.preventDefault(); 1026 1027 1028 setTimeout(function () { 1029 jQuery('body').trigger('debouncedresize'); 1030 }, 300); 1031 } ); 1032 1033 1034 $('.cmsmasters_toggles .cmsmasters_toggles_filter a').on('click', function (i) { 1035 var filter_wrap = $(this).parents('.cmsmasters_toggles_filter'), 1036 filter = $(this).data('key'), 1037 toggle = $(this).parents('.cmsmasters_toggles').find('.cmsmasters_toggle_wrap'); 1038 1039 1040 if ($(this).is(':not(.current_filter)')) { 1041 filter_wrap.find('a').removeClass('current_filter'); 1042 1043 1044 $(this).addClass('current_filter'); 1045 1046 1047 toggle.filter('[data-tags~="' + filter + '"]').slideDown('fast'); 1048 1049 1050 toggle.filter(':not([data-tags~="' + filter + '"])').slideUp('fast'); 1051 1052 1053 toggle.filter(':not([data-tags~="' + filter + '"])').removeClass('current_toggle').find('.cmsmasters_toggle').removeAttr('style'); 1054 } 1055 1056 1057 i.preventDefault(); 1058 } ); 1059 } )(jQuery); 1060 1061 1062 1063 /* Tabs */ 1064 (function ($) { 1065 $('.cmsmasters_tabs ul.cmsmasters_tabs_list li a').on('click', function (t) { 1066 var tabs_parent = $(this).parents('.cmsmasters_tabs'), 1067 tabs = tabs_parent.find('.cmsmasters_tabs_wrap'), 1068 index = $(this).parents('li').index(); 1069 1070 1071 tabs_parent.find('.cmsmasters_tabs_list > .current_tab').removeClass('current_tab'); 1072 1073 1074 $(this).parents('li').addClass('current_tab'); 1075 1076 1077 tabs.find('.cmsmasters_tab').not(':eq(' + index + ')').slideUp('fast', function () { 1078 $(this).removeClass('active_tab'); 1079 } ); 1080 1081 1082 tabs.find('.cmsmasters_tab:eq(' + index + ')').slideDown('fast', function () { 1083 $(this).addClass('active_tab'); 1084 } ); 1085 1086 1087 t.preventDefault(); 1088 1089 1090 setTimeout(function () { 1091 jQuery('body').trigger('debouncedresize'); 1092 }, 300); 1093 } ); 1094 } )(jQuery); 1095 1096 1097 1098 /* Share Buttons */ 1099 (function ($) { 1100 $('.share_posts a, .share_wrap a:not(.cmsmasters_pinterest_button)').bind('click', function (e) { 1101 var screenSize = { 1102 width : screen.width, 1103 height : screen.height 1104 }, 1105 windowWidth = 650, 1106 windowHeight = 350, 1107 windowTop = (screenSize.height / 2) - (windowHeight / 2), 1108 windowLeft = (screenSize.width / 2) - (windowWidth / 2), 1109 socialHref = $(this).attr('href'), 1110 newWindow = 'width = ' + windowWidth + ', height = ' + windowHeight + ', top = ' + windowTop + ', left = ' + windowLeft + ', resizable = no, status = no, titlebar = no, toolbar = no, location = no'; 1111 1112 1113 e.preventDefault(); 1114 1115 1116 return window.open(socialHref, '_blank', newWindow); 1117 } ); 1118 } )(jQuery); 1119 1120 1121 1122 /* YouTube Iframe Fix */ 1123 (function ($) { 1124 var iframe = $('iframe[src*="youtube.com"]'); 1125 1126 1127 iframe.each(function () { 1128 var current = $(this), 1129 src = current.attr('src'); 1130 1131 1132 if (src) { 1133 if (src.indexOf('?') !== -1) { 1134 src += "&wmode=opaque"; 1135 } else { 1136 src += "?wmode=opaque"; 1137 } 1138 1139 1140 current.attr('src', src); 1141 } 1142 } ); 1143 } )(jQuery); 1144} ); 1145 1146 1147 1148/* Like Button */ 1149function cmsmasters_like(postID) { 1150 "use strict"; 1151 1152 if (postID !== '') { 1153 var likeButton = jQuery('#cmsmastersLike-' + postID), 1154 data = { 1155 action : 'cmsmasters_ajax_like', 1156 id : postID, 1157 nonce : cmsmasters_script.nonce_ajax_like 1158 }; 1159 1160 1161 likeButton.find('> span').text('...'); 1162 1163 1164 jQuery.post(cmsmasters_script.ajaxurl, data, function(response) { 1165 likeButton.find('> span').text(response); 1166 1167 1168 likeButton.addClass('active'); 1169 1170 1171 likeButton.attr( { 1172 onclick : 'return false;' 1173 } ); 1174 } ); 1175 } 1176 1177 1178 return false; 1179} 1180 1181 1182"use strict"; 1183 1184 1185/* Correct OS & Browser Check */ 1186var ua = navigator.userAgent, 1187 checker = { 1188 os : { 1189 iphone : ua.match(/iPhone/), 1190 ipod : ua.match(/iPod/), 1191 ipad : ua.match(/iPad/), 1192 blackberry : ua.match(/BlackBerry/), 1193 android : ua.match(/(Android|Linux armv6l|Linux armv7l)/), 1194 linux : ua.match(/Linux/), 1195 win : ua.match(/Windows/), 1196 mac : ua.match(/Macintosh/) 1197 }, 1198 ua : { 1199 ie : ua.match(/MSIE/), 1200 ie6 : ua.match(/MSIE 6.0/), 1201 ie7 : ua.match(/MSIE 7.0/), 1202 ie8 : ua.match(/MSIE 8.0/), 1203 ie9 : ua.match(/MSIE 9.0/), 1204 ie10 : ua.match(/MSIE 10.0/), 1205 ie11 : ua.match(/MSIE 11.0/), 1206 opera : ua.match(/Opera/), 1207 firefox : ua.match(/Firefox/), 1208 chrome : ua.match(/Chrome/), 1209 safari : ua.match(/(Safari|BlackBerry)/) 1210 } 1211 }; 1212 1213 1214 1215/* Correct Image Load Check */ 1216function isImageOk(img) { 1217 "use strict"; 1218 1219 if (!img.complete) { 1220 return false; 1221 } 1222 1223
1224 if (typeof img.naturalWidth !== undefined && img.naturalWidth === 0) { 1225 return 'stop'; 1226 } 1227 1228 1229 return true; 1230} 1231 1232 1233 1234/* Check Whether the Numbers are Approximately Equal */ 1235function checkN(a, b, x) { 1236 "use strict"; 1237 1238 if ((a > b && a - x <= b) || (b > a && b - x <= a)){ 1239 return true; 1240 } else { 1241 return false; 1242 } 1243} 1244 1245 1246 1247/* Run Pinterest Widget */ 1248if (jQuery('.cmsmasters_pinterest_button').length > 0) { 1249 (function() { 1250 window.PinIt = window.PinIt || { loaded:false }; 1251 1252 if (window.PinIt.loaded) { 1253 return; 1254 } 1255 1256 window.PinIt.loaded = true; 1257 1258 function async_load(){ 1259 var s = document.createElement("script"); 1260 s.type = "text/javascript"; 1261 s.async = true; 1262 s.src = "//assets.pinterest.com/js/pinit.js"; 1263 1264 var x = document.getElementsByTagName("script")[0]; 1265 1266 1267 x.parentNode.insertBefore(s, x); 1268 } 1269 1270 if (window.attachEvent) { 1271 window.attachEvent("onload", async_load); 1272 } else { 1273 window.addEventListener("load", async_load, false); 1274 } 1275 })(); 1276} 1277 1278 1279 1280/* Uniq ID */ 1281function uniqID() { 1282 "use strict"; 1283 1284 return Math.round(new Date().getTime() + (Math.random() * 1000000)); 1285} 1286 1287 1288/* Form Builder Form Animation */ 1289(function($) { 1290 var elems = $('.cmsmasters-form-builder input, .cmsmasters-form-builder textarea'), 1291 fi = $('.cmsmasters-form-builder .form_info'), 1292 reqElems = $('.cmsmasters-form-builder [class^="validate"]'), 1293 button = $('.cmsmasters-form-builder .cmsmasters_button'); 1294 1295 1296 $(window).load(function () { 1297 reqElems.parent().parent().addClass('req'); 1298 } ); 1299 1300 1301 elems.on('focus', function () { 1302 var el = $(this); 1303 1304 1305 if (el.is(':not(.area_opened)')) { 1306 el.parent().parent().addClass('area_opened'); 1307 } 1308 } ); 1309 1310 1311 elems.on('blur', function () { 1312 var el = $(this); 1313 1314 1315 if (el.val().trim() === '') { 1316 el.val(''); 1317 1318 el.parent().parent().removeClass('area_opened'); 1319 1320 el.parent().parent().addClass('req'); 1321 } else if (el.val().trim() !== '' && el.hasClass('validate[required]')) { 1322 1323 el.parent().parent().removeClass('req'); 1324 } 1325 } ); 1326 1327 1328 button.on('click', function () { 1329 var el = $(this), 1330 reqEl = el.closest('.cmsmasters-form-builder').find('[class^="validate"]'); 1331 1332 if (!reqEl.parent().parent().hasClass('req')) { 1333 setTimeout(function () { 1334 fi.removeClass('area_opened'); 1335 1336 reqEl.parent().parent().addClass('req'); 1337 }, 4000); 1338 } 1339 }); 1340 1341} )(jQuery); 1342 1343 1344 1345/* Comment Form Animation */ 1346(function($) { 1347 var elems = $('.comment-respond input, .comment-respond textarea'); 1348 1349 1350 elems.on('focus', function () { 1351 var el = $(this); 1352 1353 1354 if (el.is(':not(.area_opened)')) { 1355 el.parent().addClass('area_opened'); 1356 } 1357 } ); 1358 1359 1360 elems.on('blur', function () { 1361 var el = $(this); 1362 1363 1364 if (el.val().trim() === '') { 1365 el.val(''); 1366 1367 el.parent().removeClass('area_opened'); 1368 } 1369 } ); 1370} )(jQuery); 1371
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.