1/** 2 * @package WordPress 3 * @subpackage Galicia 4 * @version 1.0.0 5 * 6 * Theme Custom Scripts 7 * Created by Seasidetms 8 * 9 */ 10 11 12jQuery(document).ready(function() { 13 "use strict"; 14 15 /* Run Blog */ 16 (function ($) { 17 var blogs = $('.seasidetms_wrap_blog'); 18 19 20 blogs.each(function () { 21 var blog = $(this), 22 params = {}; 23 24 25 params.id = '#' + blog.attr('id'); 26 27 if (blog.data('layout') !== undefined) { 28 params.layout = blog.data('layout'); 29 } 30 31 if (blog.data('layoutMode') !== undefined) { 32 params.layoutMode = blog.data('layoutMode'); 33 } 34 35 if (blog.data('url') !== undefined) { 36 params.url = blog.data('url'); 37 } 38 39 if (blog.data('orderby') !== undefined) { 40 params.orderby = blog.data('orderby'); 41 } 42 43 if (blog.data('order') !== undefined) { 44 params.order = blog.data('order'); 45 } 46 47 if (blog.data('count') !== undefined) { 48 params.count = Number(blog.data('count')); 49 } 50 51 if (blog.data('categories') !== undefined) { 52 params.categories = blog.data('categories'); 53 } 54 55 if (blog.data('metadata') !== undefined) { 56 params.metadata = blog.data('metadata'); 57 } 58 59 if (blog.data('pagination') !== undefined) { 60 params.pagination = blog.data('pagination'); 61 } 62 63 64 if ( 65 params.layout !== 'standard' || 66 (params.layout === 'standard' && params.pagination === 'more') 67 ) { 68 startBlog(params.id, params.layout, params.layoutMode, params.url, params.orderby, params.order, params.count, params.categories, params.metadata); 69 } 70 } ); 71 } )(jQuery); 72 73 74 75 /* Run Portfolio */ 76 (function ($) { 77 var portfolios = $('.seasidetms_wrap_portfolio'); 78 79 80 portfolios.each(function () { 81 var portfolio = $(this), 82 params = {}; 83 84 85 params.id = '#' + portfolio.attr('id'); 86 87 if (portfolio.data('layout') !== undefined) { 88 params.layout = portfolio.data('layout'); 89 } 90 91 if (portfolio.data('layoutMode') !== undefined) { 92 params.layoutMode = portfolio.data('layoutMode'); 93 } 94 95 if (portfolio.data('url') !== undefined) { 96 params.url = portfolio.data('url'); 97 } 98 99 if (portfolio.data('orderby') !== undefined) { 100 params.orderby = portfolio.data('orderby'); 101 } 102 103 if (portfolio.data('order') !== undefined) { 104 params.order = portfolio.data('order'); 105 } 106 107 if (portfolio.data('count') !== undefined) { 108 params.count = Number(portfolio.data('count')); 109 } 110 111 if (portfolio.data('categories') !== undefined) { 112 params.categories = portfolio.data('categories'); 113 } 114 115 if (portfolio.data('metadata') !== undefined) { 116 params.metadata = portfolio.data('metadata'); 117 } 118 119 120 startPortfolio(params.id, params.layout, params.layoutMode, params.url, params.orderby, params.order, params.count, params.categories, params.metadata); 121 } ); 122 } )(jQuery); 123 124 125 126 /* Run Gallery */ 127 (function ($) { 128 var galleries = $('.seasidetms_gallery_wrap'); 129 130 131 galleries.each(function () { 132 var gallery = $(this), 133 params = {}; 134 135 136 params.id = '#' + gallery.attr('id'); 137 138 if (gallery.data('type') !== undefined) { 139 params.type = gallery.data('type'); 140 } 141 142 if (gallery.data('count') !== undefined) { 143 params.count = Number(gallery.data('count')); 144 } 145 146 147 startGallery(params.id, params.type, params.count); 148 } ); 149 } )(jQuery); 150 151 152 153 /* Run Google Map */ 154 (function ($) { 155 var gmaps = $('.seasidetms_google_map'); 156 157 158 gmaps.each(function () { 159 var gmap = $(this), 160 params = {}, 161 controls = {}; 162 163 164 params.id = '#' + gmap.attr('id'); 165 166 if (gmap.data('address') !== undefined) { 167 params.address = gmap.data('address'); 168 } 169 170 if (gmap.data('latitude') !== undefined) { 171 params.latitude = gmap.data('latitude'); 172 } 173 174 if (gmap.data('longitude') !== undefined) { 175 params.longitude = gmap.data('longitude'); 176 } 177 178 if (gmap.data('maptype') !== undefined) { 179 params.maptype = gmap.data('maptype'); 180 } 181 182 if (gmap.data('zoom') !== undefined) { 183 params.zoom = gmap.data('zoom'); 184 } 185 186 if (gmap.data('scrollwheel') !== undefined) { 187 params.scrollwheel = Boolean(gmap.data('scrollwheel')); 188 } 189 190 if (gmap.data('doubleclickzoom') !== undefined) { 191 params.doubleclickzoom = Boolean(gmap.data('doubleclickzoom')); 192 } 193 194 if (gmap.data('markers') !== undefined) { 195 var markers_str = gmap.data('markers'), 196 markers_arr = markers_str.split('|||'), 197 markers = []; 198 199 for (var i = 0; i < markers_arr.length; i++) { 200 if (markers_arr[i] !== '') { 201 var marker_str = markers_arr[i], 202 marker_arr = marker_str.split('///'), 203 marker_obj = {}; 204 205 for (var j = 0; j < marker_arr.length; j++) { 206 if (marker_arr[j] !== '') { 207 var marker_attr = marker_arr[j].split(': '); 208 209 marker_obj[marker_attr[0]] = marker_attr[1]; 210 } 211 } 212 213 markers.push(marker_obj); 214 } 215 } 216 217 218 params.markers = markers; 219 } 220 221 222 if (gmap.data('panControl') !== undefined) { 223 controls.panControl = Boolean(gmap.data('panControl')); 224 } 225 226 if (gmap.data('zoomControl') !== undefined) { 227 controls.zoomControl = Boolean(gmap.data('zoomControl')); 228 } 229 230 if (gmap.data('mapTypeControl') !== undefined) { 231 controls.mapTypeControl = Boolean(gmap.data('mapTypeControl')); 232 } 233 234 if (gmap.data('scaleControl') !== undefined) { 235 controls.scaleControl = Boolean(gmap.data('scaleControl')); 236 } 237 238 if (gmap.data('streetViewControl') !== undefined) { 239 controls.streetViewControl = Boolean(gmap.data('streetViewControl')); 240 } 241 242 if (gmap.data('overviewMapControl') !== undefined) { 243 controls.overviewMapControl = Boolean(gmap.data('overviewMapControl')); 244 } 245 246 params.controls = controls; 247 248 249 if (seasidetms_script.gmap_api_key === '') { 250 $(params.id).append('<div class="seasidetms_notice seasidetms_notice_error seasidetms_theme_icon_cancel">' + 251 '<div class="notice_content">' + 252 '<p>' + seasidetms_script.gmap_api_key_notice + ', ' + '<a target="_blank" href="http://seaside-themes.com/google-maps-api-key/">' + seasidetms_script.gmap_api_key_notice_link + '</a></p>' + 253 '</div>' + 254 '</div>'); 255 } else { 256 $(params.id).gMap(params); 257 } 258 } ); 259 } )(jQuery); 260 261 262 263 /* Run Hover Slider */ 264 (function ($) { 265 var hover_sliders = $('.seasidetms_hover_slider'); 266 267 268 hover_sliders.each(function () { 269 var slider = $(this), 270 params = {}; 271 272 273 params.sliderBlock = '#' + slider.attr('id'); 274 275 if (slider.data('thumbWidth') !== undefined) { 276 params.thumbWidth = Number(slider.data('thumbWidth')); 277 } 278
279 if (slider.data('thumbHeight') !== undefined) { 280 params.thumbHeight = Number(slider.data('thumbHeight')); 281 } 282 283 if (slider.data('activeSlide') !== undefined) { 284 params.activeSlide = Number(slider.data('activeSlide')); 285 } 286 287 if (slider.data('pauseTime') !== undefined) { 288 params.pauseTime = Number(slider.data('pauseTime')); 289 } 290 291 if (slider.data('pauseOnHover') !== undefined) { 292 params.pauseOnHover = Boolean(slider.data('pauseOnHover')); 293 } 294 295 296 $(params.sliderBlock).seasidetmsHoverSlider(params); 297 } ); 298 } )(jQuery); 299 300 301 302 /* Run Owl Sliders */ 303 seasidetms_owl_sliders_run(); 304 305 jQuery(window).on('debouncedresize', function () { 306 seasidetms_owl_sliders_run(); 307 } ); 308 309 310 311 /* Touch events on ipad, iphone etc */ 312 jQuery('body').bind('touchstart', function() {}); 313 314 315 316 /* Add Class To Row */ 317 (function ($) { 318 $('.seasidetms_row_margin').each(function () { 319 var seasidetms_column = $(this).find('.seasidetms_column').eq(0); 320 321 322 if ( 323 seasidetms_column.hasClass('one_half') && 324 seasidetms_column.next().hasClass('one_half') 325 ) { 326 $(this).addClass('seasidetms_1212'); 327 } else if ( 328 seasidetms_column.hasClass('one_third') && 329 seasidetms_column.next().hasClass('two_third') 330 ) { 331 $(this).addClass('seasidetms_1323'); 332 } else if ( 333 seasidetms_column.hasClass('two_third') && 334 seasidetms_column.next().hasClass('one_third') 335 ) { 336 $(this).addClass('seasidetms_2313'); 337 } else if ( 338 seasidetms_column.hasClass('one_fourth') && 339 seasidetms_column.next().hasClass('three_fourth') 340 ) { 341 $(this).addClass('seasidetms_1434'); 342 } else if ( 343 seasidetms_column.hasClass('three_fourth') && 344 seasidetms_column.next().hasClass('one_fourth') 345 ) { 346 $(this).addClass('seasidetms_3414'); 347 } else if ( 348 seasidetms_column.hasClass('one_third') && 349 seasidetms_column.next().hasClass('one_third') && 350 seasidetms_column.next().next().hasClass('one_third') 351 ) { 352 $(this).addClass('seasidetms_131313'); 353 } else if ( 354 seasidetms_column.hasClass('one_half') && 355 seasidetms_column.next().hasClass('one_fourth') && 356 seasidetms_column.next().next().hasClass('one_fourth') 357 ) { 358 $(this).addClass('seasidetms_121414'); 359 } else if ( 360 seasidetms_column.hasClass('one_fourth') && 361 seasidetms_column.next().hasClass('one_half') && 362 seasidetms_column.next().next().hasClass('one_fourth') 363 ) { 364 $(this).addClass('seasidetms_141214'); 365 } else if ( 366 seasidetms_column.hasClass('one_fourth') && 367 seasidetms_column.next().hasClass('one_fourth') && 368 seasidetms_column.next().next().hasClass('one_half') 369 ) { 370 $(this).addClass('seasidetms_141412'); 371 } else if ( 372 seasidetms_column.hasClass('one_fourth') && 373 seasidetms_column.next().hasClass('one_fourth') && 374 seasidetms_column.next().next().hasClass('one_fourth') && 375 seasidetms_column.next().next().next().hasClass('one_fourth') 376 ) { 377 $(this).addClass('seasidetms_14141414'); 378 } else { 379 $(this).addClass('seasidetms_11'); 380 } 381 } ); 382 } )(jQuery); 383 384 385 386 /* Scroll Top */ 387 (function ($) { 388 $(window).scroll(function () { 389 if ($(this).scrollTop() > 200) { 390 $('#slide_top').filter(':hidden').fadeIn('fast'); 391 } else { 392 $('#slide_top').filter(':visible').fadeOut('fast'); 393 } 394 } ); 395 396 397 $('.divider a, #slide_top').on('click', function () { 398 $('html, body').animate( { 399 scrollTop : 0 400 }, 'slow'); 401 402 403 return false; 404 } ); 405 } )(jQuery); 406 407 408 409 /* Lightbox Classes Adding */ 410 (function ($) { 411 $('.widget_custom_flickr_entries').each(function () { 412 var flickrUniqID = uniqID(); 413 414 415 $(this).find('.flickr_badge_image a').each(function () { 416 var src = $(this).find('img').attr('src'), 417 title = $(this).find('img').attr('title'), 418 src_full = src.replace(/_s.jpg/g, '.jpg'); 419 420 421 $(this).removeAttr('href').attr( { 422 href : src_full, 423 title : title, 424 rel : 'ilightbox[flickr_' + flickrUniqID + ']' 425 } ); 426 } ); 427 } ); // Flickr Widget Lightbox 428 429 430 $('.gallery').each(function () { 431 var galUniqID = uniqID(); 432 433 434 $(this).find('a').each(function () { 435 var linkHref = $(this).attr('href'), 436 lastDotPos = linkHref.lastIndexOf('.'), 437 imgFormat = linkHref.slice(lastDotPos + 1); 438 439 440 if (imgFormat.length <= 5) { 441 $(this).attr('rel', 'ilightbox[wp_gal_' + galUniqID + ']'); 442 } 443 } ); 444 } ); // WordPress Default Gallery Shortcode Lightbox 445 } )(jQuery); 446 447 448 449 /* iLightBox Init */ 450 (function ($) { 451 var ilightbox_settings = { 452 skin : seasidetms_script.ilightbox_skin, 453 path : seasidetms_script.ilightbox_path, 454 infinite : (seasidetms_script.ilightbox_infinite == '1') ? true : false, 455 keepAspectRatio : (seasidetms_script.ilightbox_aspect_ratio == '1') ? true : false, 456 mobileOptimizer : (seasidetms_script.ilightbox_mobile_optimizer == '1') ? true : false, 457 maxScale : Number(seasidetms_script.ilightbox_max_scale), 458 minScale : Number(seasidetms_script.ilightbox_min_scale), 459 innerToolbar : (seasidetms_script.ilightbox_inner_toolbar == '1') ? true : false, 460 smartRecognition : (seasidetms_script.ilightbox_mobile_optimizer == '1') ? true : false, 461 fullAlone : (seasidetms_script.ilightbox_fullscreen_one_slide == '1') ? true : false, 462 fullViewPort : seasidetms_script.ilightbox_fullscreen_viewport, 463 controls : { 464 toolbar : (seasidetms_script.ilightbox_controls_toolbar == '1') ? true : false, 465 arrows : (seasidetms_script.ilightbox_controls_arrows == '1') ? true : false, 466 fullscreen : (seasidetms_script.ilightbox_controls_fullscreen == '1') ? true : false, 467 thumbnail : (seasidetms_script.ilightbox_controls_thumbnail == '1') ? true : false, 468 keyboard : (seasidetms_script.ilightbox_controls_keyboard == '1') ? true : false, 469 mousewheel : (seasidetms_script.ilightbox_controls_mousewheel == '1') ? true : false, 470 swipe : (seasidetms_script.ilightbox_controls_swipe == '1') ? true : false, 471 slideshow : (seasidetms_script.ilightbox_controls_slideshow == '1') ? true : false 472 }, 473 text : { 474 close : seasidetms_script.ilightbox_close_text, 475 enterFullscreen : seasidetms_script.ilightbox_enter_fullscreen_text, 476 exitFullscreen : seasidetms_script.ilightbox_exit_fullscreen_text, 477 slideShow : seasidetms_script.ilightbox_slideshow_text, 478 next : seasidetms_script.ilightbox_next_text, 479 previous : seasidetms_script.ilightbox_previous_text 480 }, 481 errors : { 482 loadImage : seasidetms_script.ilightbox_load_image_error, 483 loadContents : seasidetms_script.ilightbox_load_contents_error, 484 missingPlugin : seasidetms_script.ilightbox_missing_plugin_error 485 } 486 }, 487 gallery_array = [], 488 gallery_id = ''; 489 490 491 $('[rel="ilightbox"]').each(function () { 492 $(this).iLightBox(ilightbox_settings); 493 } ); 494 495 496 $('[rel^="ilightbox["]').each(function () { 497 if ($(this).closest('.seasidetms_more_items_loader').length === 0) { 498 var item_rel = $(this).attr('rel'); 499 500 501 if ($.inArray(item_rel, gallery_array) === -1) { 502 gallery_array.push(item_rel); 503 } 504 } 505 } ); 506 507 508 $.each(gallery_array, function (gallery_array, gallery_id) { 509 $('[rel="' + gallery_id + '"]').iLightBox(ilightbox_settings); 510 } ); 511 } )(jQuery); 512 513 514 515 /* Shortcodes Animation Run */ 516 (function ($) { 517 if ( 518 !checker.os.iphone && 519 !checker.os.ipod && 520 !checker.os.ipad && 521 !checker.os.blackberry && 522 !checker.os.android 523 ) { 524 $('[data-animation]').waypoint(function (dir) { 525 if (dir === 'down') { 526 var el = $(this), 527 animation = el.data('animation'),
528 delay = (el.data('delay')) ? el.data('delay') : 0; 529 530 531 setTimeout(function () { 532 el.addClass(animation + ' animated'); 533 }, delay); 534 } 535 }, { 536 offset : '100%' 537 } ).waypoint(function (dir) { 538 if (dir === 'up') { 539 var el = $(this), 540 animation = el.data('animation'), 541 delay = (el.data('delay')) ? el.data('delay') : 0; 542 543 544 setTimeout(function () { 545 el.addClass(animation + ' animated'); 546 }, delay); 547 } 548 }, { 549 offset : '25%' 550 } ); 551 } else { 552 $('[data-animation]').addClass('animated'); 553 } 554 555 556 if ( 557 !checker.os.iphone && 558 !checker.os.ipod && 559 !checker.os.ipad && 560 !checker.os.blackberry && 561 !checker.os.android 562 ) { 563 $('.seasidetms_icon_box').waypoint(function (dir) { 564 if (dir === 'down') { 565 var el = $(this); 566 567 568 el.addClass('shortcode_animated'); 569 } 570 }, { 571 offset : '100%' 572 } ).waypoint(function (dir) { 573 if (dir === 'up') { 574 var el = $(this); 575 576 577 el.addClass('shortcode_animated'); 578 } 579 }, { 580 offset : '25%' 581 } ); 582 } else { 583 $('.seasidetms_icon_box').addClass('shortcode_animated'); 584 } 585 586 587 if ( 588 !checker.os.iphone && 589 !checker.os.ipod && 590 !checker.os.ipad && 591 !checker.os.blackberry && 592 !checker.os.android 593 ) { 594 $('.seasidetms_icon_list_items.seasidetms_icon_list_type_block').waypoint(function (dir) { 595 if (dir === 'down') { 596 var el = $(this), 597 items = el.find('li'), 598 delay = 500, 599 i = 1; 600 601 602 items.each(function () { 603 var item = $(this); 604 605 606 setTimeout(function () { 607 item.addClass('shortcode_animated'); 608 }, delay * i); 609 610 611 i += 1; 612 } ); 613 } 614 }, { 615 offset : '100%' 616 } ).waypoint(function (dir) { 617 if (dir === 'up') { 618 var el = $(this), 619 items = el.find('li'), 620 delay = 500, 621 i = 1; 622 623 624 items.each(function () { 625 var item = $(this); 626 627 628 setTimeout(function () { 629 item.addClass('shortcode_animated'); 630 }, delay * i); 631 632 633 i += 1; 634 } ); 635 } 636 }, { 637 offset : '25%' 638 } ); 639 } else { 640 $('.seasidetms_icon_list_items .seasidetms_icon_list_item').addClass('shortcode_animated'); 641 } 642 643 644 if ( 645 !checker.os.iphone && 646 !checker.os.ipod && 647 !checker.os.ipad && 648 !checker.os.blackberry && 649 !checker.os.android 650 ) { 651 $('.seasidetms_hover_slider').waypoint(function (dir) { 652 if (dir === 'down') { 653 var el = $(this), 654 items = el.find('li'), 655 delay = 300, 656 i = 1; 657 658 659 items.each(function () { 660 var item = $(this); 661 662 663 setTimeout(function () { 664 item.addClass('shortcode_animated'); 665 }, delay * i); 666 667 668 i += 1; 669 } ); 670 } 671 }, { 672 offset : '100%' 673 } ).waypoint(function (dir) { 674 if (dir === 'up') { 675 var el = $(this), 676 items = el.find('li'), 677 delay = 300, 678 i = 1; 679 680 681 items.each(function () { 682 var item = $(this); 683 684 685 setTimeout(function () { 686 item.addClass('shortcode_animated'); 687 }, delay * i); 688 689 690 i += 1; 691 } ); 692 } 693 }, { 694 offset : '25%' 695 } ); 696 } else { 697 $('.seasidetms_hover_slider ul li').addClass('shortcode_animated'); 698 } 699 700 701 if ( 702 !checker.os.iphone && 703 !checker.os.ipod && 704 !checker.os.ipad && 705 !checker.os.blackberry && 706 !checker.os.android 707 ) { 708 $('.seasidetms_profile.vertical').waypoint(function (dir) { 709 if (dir === 'down') { 710 var el = $(this), 711 items = el.find('article'), 712 delay = 500, 713 i = 1; 714 715 716 items.each(function () { 717 var item = $(this); 718 719 720 setTimeout(function () { 721 item.addClass('shortcode_animated'); 722 }, delay * i); 723 724 725 i += 1; 726 } ); 727 } 728 }, { 729 offset : '100%' 730 } ).waypoint(function (dir) { 731 if (dir === 'up') { 732 var el = $(this), 733 items = el.find('article'),
734 delay = 500, 735 i = 1; 736 737 738 items.each(function () { 739 var item = $(this); 740 741 742 setTimeout(function () { 743 item.addClass('shortcode_animated'); 744 }, delay * i); 745 746 747 i += 1; 748 } ); 749 } 750 }, { 751 offset : '25%' 752 } ); 753 } else { 754 $('.seasidetms_profile.vertical .profile').addClass('shortcode_animated'); 755 } 756 757 758 if ( 759 !checker.os.iphone && 760 !checker.os.ipod && 761 !checker.os.ipad && 762 !checker.os.blackberry && 763 !checker.os.android 764 ) { 765 $('.seasidetms_clients_grid').waypoint(function (dir) { 766 if (dir === 'down') { 767 var el = $(this), 768 items = el.find('.seasidetms_clients_item'), 769 delay = 300, 770 i = 1; 771 772 773 items.each(function () { 774 var item = $(this); 775 776 777 setTimeout(function () { 778 item.addClass('shortcode_animated'); 779 }, delay * i); 780 781 782 i += 1; 783 } ); 784 } 785 }, { 786 offset : '100%' 787 } ).waypoint(function (dir) { 788 if (dir === 'up') { 789 var el = $(this), 790 items = el.find('.seasidetms_clients_item'), 791 delay = 300, 792 i = 1; 793 794 795 items.each(function () { 796 var item = $(this); 797 798 799 setTimeout(function () { 800 item.addClass('shortcode_animated'); 801 }, delay * i); 802 803 804 i += 1; 805 } ); 806 } 807 }, { 808 offset : '25%' 809 } ); 810 } else { 811 $('.seasidetms_clients_grid').find('.seasidetms_clients_item').addClass('shortcode_animated'); 812 } 813 814 815 if ( 816 !checker.os.iphone && 817 !checker.os.ipod && 818 !checker.os.ipad && 819 !checker.os.blackberry && 820 !checker.os.android 821 ) { 822 $('.seasidetms_gallery, .blog.columns, .blog.timeline').waypoint(function (dir) { 823 if (dir === 'down') { 824 var el = $(this), 825 items = el.find('article.post, .seasidetms_gallery_item'), 826 itemsCount = items.length, 827 delay = 300, 828 i = 1; 829 830 831 var newTime = setInterval(function () { 832 if (el.hasClass('isotope')) { 833 clearInterval(newTime); 834 } else { 835 return false; 836 } 837 838 839 items.each(function () { 840 var item = $(this); 841 842 843 setTimeout(function () { 844 item.addClass('shortcode_animated'); 845 }, delay * i); 846 847 848 i += 1; 849 850 851 if (i === itemsCount) { 852 setTimeout(function () { 853 $(window).trigger('resize'); 854 }, delay * i); 855 } 856 } ); 857 }, 300); 858 } 859 }, { 860 offset : '100%' 861 } ).waypoint(function (dir) { 862 if (dir === 'up') { 863 var el = $(this), 864 items = el.find('article.post, .seasidetms_gallery_item'), 865 itemsCount = items.length, 866 delay = 300, 867 i = 1; 868 869 870 var newTime = setInterval(function () { 871 if (el.hasClass('isotope')) { 872 clearInterval(newTime); 873 } else { 874 return false; 875 } 876 877 878 items.each(function () { 879 var item = $(this); 880 881 882 setTimeout(function () { 883 item.addClass('shortcode_animated'); 884 }, delay * i); 885 886 887 i += 1; 888 889 890 if (i === itemsCount) { 891 setTimeout(function () { 892 $(window).trigger('resize'); 893 }, delay * i); 894 } 895 } ); 896 }, 300); 897 } 898 }, { 899 offset : '25%' 900 } ); 901 } else { 902 $('.seasidetms_gallery, .blog.columns, .blog.timeline').find('article.post, .seasidetms_gallery_item').addClass('shortcode_animated'); 903 } 904 } )(jQuery); 905 906 907 908 /* Fixed Header Function Start */ 909 (function ($) { 910 $('#header').seasidetmsFixedHeaderScroll(); 911 } )(jQuery); 912 913 914 915 /* Responsive Navigation Function Start */ 916 (function ($) { 917 $('#navigation').seasidetmsResponsiveNav(); 918 } )(jQuery); 919 920 921 922 /* Row Parallax Function Start */ 923 (function ($) { 924 $(window).load(function () { 925 if ( 926 !checker.os.iphone && 927 !checker.os.ipad && 928 !checker.os.ipod && 929 !checker.os.android && 930 !checker.os.blackberry 931 ) { 932 if (checker.ua.safari) { 933 if (checker.ua.chrome || checker.os.mac) { 934 setTimeout(function () { 935 $.stellar( { 936 horizontalScrolling : false, 937 verticalOffset : 30, 938 parallaxElements : false 939 } ); 940 }, 1500); 941 942 943 $(window).on('debouncedresize', function () { 944 if ($(window).width() < 1024) { 945 $.stellar('destroy'); 946 } else { 947 $.stellar( { 948 horizontalScrolling : false, 949 verticalOffset : 30, 950 parallaxElements : false 951 } ); 952 } 953 } ); 954 } 955 } else { 956 setTimeout(function () { 957 $.stellar( { 958 horizontalScrolling : false, 959 verticalOffset : 30, 960 parallaxElements : false 961 } ); 962 }, 1500); 963 964 965 $(window).on('debouncedresize', function () { 966 if ($(window).width() < 1024) { 967 $.stellar('destroy'); 968 } else { 969 $.stellar( { 970 horizontalScrolling : false, 971 verticalOffset : 30, 972 parallaxElements : false 973 } ); 974 } 975 } ); 976 } 977 } else { 978 $('div.seasidetms_row').css('background-attachment', 'scroll'); 979 } 980 } ); 981 } )(jQuery); 982 983 984 985 /* One Page Navigation */ 986 (function ($) { 987 function seasidetms_get_offset_val() { 988 var seasidetms_wpAdminBar = $('#wpadminbar').outerHeight(), 989 seasidetms_offset_val = (seasidetms_wpAdminBar !== undefined) ? seasidetms_wpAdminBar : 0; 990 991 992 if ($('#page').hasClass('fixed_header')) { 993 var header_mid_data_height = $('.header_mid').data('height'), 994 header_mid_height = header_mid_data_height - (header_mid_data_height / 3), 995 header_bot_data_height = $('.header_bot').data('height'), 996 header_bot_data_height = (header_bot_data_height !== undefined) ? header_bot_data_height : 0; 997 998 999 seasidetms_offset_val = seasidetms_offset_val + header_mid_height + header_bot_data_height - 1; 1000 } 1001 1002 1003 return seasidetms_offset_val; 1004 } 1005 1006 1007 var seasidetms_window_hash = window.location.hash; 1008 1009 if ($(seasidetms_window_hash).length > 0) { 1010 setTimeout(function () { 1011 $('html, body').animate( { 1012 scrollTop: $(seasidetms_window_hash).offset().top - seasidetms_get_offset_val() + 1 1013 }, 800); 1014 }, 800); 1015 } 1016 1017 1018 $('body').scrollspy({target: '#navigation'}); 1019 1020 1021 $('#navigation a').on('click', function(event) { 1022 if (this.hash !== "") { 1023 event.preventDefault(); 1024 1025 1026 var hash = this.hash, 1027 linkHref = $(this).attr('href'); 1028 1029 1030 if ($(hash).length > 0) { 1031 $('html, body').animate( {
1032 scrollTop: $(hash).offset().top - seasidetms_get_offset_val() + 1 1033 }, 800, function() { 1034 if (history.pushState) { 1035 history.pushState(null, null, hash); 1036 } 1037 } ); 1038 } else if (!$('body').hasClass('seasidetms_custom_page_menu')) { 1039 if ( 1040 linkHref.indexOf(hash) !== -1 && 1041 linkHref.slice(0, linkHref.indexOf(hash)) !== seasidetms_script.site_url && 1042 linkHref !== hash 1043 ) { 1044 window.location.href = linkHref; 1045 } else { 1046 window.location.href = seasidetms_script.site_url + hash; 1047 } 1048 } 1049 } 1050 } ); 1051 } )(jQuery); 1052 1053 1054 1055 /* Notise Close Button */ 1056 (function ($) { 1057 $('.seasidetms_notice a.notice_close').on('click', function () { 1058 $(this).parents('.seasidetms_notice').fadeOut(500, function () { 1059 $(this).remove(); 1060 } ); 1061 1062 1063 return false; 1064 } ); 1065 } )(jQuery); 1066 1067 1068 1069 /* Toggles */ 1070 (function ($) { 1071 $('.seasidetms_toggles .seasidetms_toggle_title a').on('click', function (i) { 1072 var active_toggle = $(this).parents('.seasidetms_toggles').find('.seasidetms_toggle_wrap.current_toggle .seasidetms_toggle'), 1073 toggle = $(this).parents('.seasidetms_toggle_wrap'), 1074 acc = ($(this).parents('.seasidetms_toggles').hasClass('toggles_mode_accordion')) ? true : false, 1075 dropDown = toggle.find('.seasidetms_toggle'); 1076 1077 1078 if (toggle.hasClass('current_toggle')) { 1079 dropDown.slideUp('fast', function () { 1080 toggle.removeClass('current_toggle'); 1081 } ); 1082 } else { 1083 if (acc) { 1084 active_toggle.slideUp('fast', function () { 1085 active_toggle.parents('.seasidetms_toggle_wrap').removeClass('current_toggle'); 1086 } ); 1087 } 1088 1089 dropDown.slideDown('fast', function () { 1090 toggle.addClass('current_toggle'); 1091 } ); 1092 } 1093 1094 1095 i.preventDefault(); 1096 1097 1098 setTimeout(function () { 1099 jQuery('body').trigger('debouncedresize'); 1100 }, 300); 1101 } ); 1102 1103 1104 $('.seasidetms_toggles .seasidetms_toggles_filter a').on('click', function (i) { 1105 var filter_wrap = $(this).parents('.seasidetms_toggles_filter'), 1106 filter = $(this).data('key'), 1107 toggle = $(this).parents('.seasidetms_toggles').find('.seasidetms_toggle_wrap'); 1108 1109 1110 if ($(this).is(':not(.current_filter)')) { 1111 filter_wrap.find('a').removeClass('current_filter'); 1112 1113 1114 $(this).addClass('current_filter'); 1115 1116 1117 toggle.filter('[data-tags~="' + filter + '"]').slideDown('fast'); 1118 1119 1120 toggle.filter(':not([data-tags~="' + filter + '"])').slideUp('fast'); 1121 1122 1123 toggle.filter(':not([data-tags~="' + filter + '"])').removeClass('current_toggle').find('.seasidetms_toggle').removeAttr('style'); 1124 } 1125 1126 1127 i.preventDefault(); 1128 } ); 1129 } )(jQuery); 1130 1131 1132 1133 /* Tabs */ 1134 (function ($) { 1135 $('.seasidetms_tabs ul.seasidetms_tabs_list li a').on('click', function (t) { 1136 var tabs_parent = $(this).parents('.seasidetms_tabs'), 1137 tabs = tabs_parent.find('.seasidetms_tabs_wrap'), 1138 index = $(this).parents('li').index(); 1139 1140 1141 tabs_parent.find('.seasidetms_tabs_list > .current_tab').removeClass('current_tab'); 1142 1143 1144 $(this).parents('li').addClass('current_tab'); 1145 1146 1147 tabs.find('.seasidetms_tab').not(':eq(' + index + ')').slideUp('fast', function () { 1148 $(this).removeClass('active_tab'); 1149 } ); 1150 1151 1152 tabs.find('.seasidetms_tab:eq(' + index + ')').slideDown('fast', function () { 1153 $(this).addClass('active_tab'); 1154 } ); 1155 1156 1157 t.preventDefault(); 1158 1159 1160 setTimeout(function () { 1161 jQuery('body').trigger('debouncedresize'); 1162 }, 300); 1163 } ); 1164 } )(jQuery); 1165 1166 1167 1168 /* Share Buttons */ 1169 (function ($) { 1170 $('.share_posts a, .share_wrap a').bind('click', function (e) { 1171 var screenSize = { 1172 width : screen.width, 1173 height : screen.height 1174 }, 1175 windowWidth = 650, 1176 windowHeight = 350, 1177 windowTop = (screenSize.height / 2) - (windowHeight / 2), 1178 windowLeft = (screenSize.width / 2) - (windowWidth / 2), 1179 socialHref = $(this).attr('href'), 1180 newWindow = 'width = ' + windowWidth + ', height = ' + windowHeight + ', top = ' + windowTop + ', left = ' + windowLeft + ', resizable = no, status = no, titlebar = no, toolbar = no, location = no'; 1181 1182 1183 e.preventDefault(); 1184 1185 1186 return window.open(socialHref, '_blank', newWindow); 1187 } ); 1188 } )(jQuery); 1189 1190 1191 1192 /* YouTube Iframe Fix */ 1193 (function ($) { 1194 var iframe = $('iframe[src*="youtube.com"]'); 1195 1196 1197 iframe.each(function () { 1198 var current = $(this), 1199 src = current.attr('src'); 1200 1201 1202 if (src) { 1203 if (src.indexOf('?') !== -1) { 1204 src += "&wmode=opaque"; 1205 } else { 1206 src += "?wmode=opaque"; 1207 } 1208 1209 1210 current.attr('src', src); 1211 } 1212 } ); 1213 } )(jQuery); 1214 1215 1216 1217 /* View Button */ 1218 function seasidetmsView() { 1219 var viewButton = jQuery('.seasidetmsView'); 1220 1221 if (viewButton.hasClass('no_active')) { 1222 var postID = viewButton.attr('id').replace(/seasidetmsView-/g, ''), 1223 data = { 1224 action : 'seasidetms_ajax_view', 1225 id : postID, 1226 nonce : seasidetms_script.nonce_ajax_view 1227 }; 1228 1229 1230 if (postID !== '') { 1231 viewButton.find('> span').text('...'); 1232 1233 1234 jQuery.post(seasidetms_script.ajaxurl, data, function(response) { 1235 viewButton.find('> span').text(response); 1236 1237 1238 viewButton.removeClass('no_active'); 1239 1240 viewButton.addClass('active'); 1241 } ); 1242 } 1243 } 1244 1245 1246 return false; 1247 } 1248 1249 seasidetmsView(); 1250} ); 1251 1252 1253 1254/* Seasidetms Media Width */ 1255function seasidetms_media_width() {
1256 var media_width = parseInt(jQuery('.seasidetms_responsive_width').css('width')); 1257 1258 return media_width; 1259} 1260 1261 1262 1263/* Like Button */ 1264function seasidetmsLike(postID, add_html) { 1265 "use strict"; 1266 1267 if (postID !== '') { 1268 var likeButton = jQuery('#seasidetmsLike-' + postID), 1269 data = { 1270 action : 'seasidetms_ajax_like', 1271 id : postID, 1272 add_html : add_html, 1273 nonce : seasidetms_script.nonce_ajax_like 1274 }; 1275 1276 1277 likeButton.find('> span').text('...'); 1278 1279 1280 jQuery.post(seasidetms_script.ajaxurl, data, function(response) { 1281 likeButton.find('> span').text(response); 1282 1283 1284 likeButton.addClass('active'); 1285 1286 1287 likeButton.attr( { 1288 onclick : 'return false;' 1289 } ); 1290 } ); 1291 } 1292 1293 1294 return false; 1295} 1296 1297 1298 1299/* Run Owl Slider */ 1300function seasidetms_owl_sliders_run() { 1301 var owl_sliders = jQuery('.seasidetms_owl_slider'); 1302 1303 1304 owl_sliders.each(function () { 1305 var slider = jQuery(this), 1306 data = []; 1307 1308 1309 data['data_id'] = slider.attr('id'); 1310 data['data_items'] = slider.data('items'), 1311 data['data_singleItem'] = slider.data('singleItem'), 1312 data['data_autoPlay'] = slider.data('autoPlay'), 1313 data['data_stopOnHover'] = slider.data('stopOnHover'), 1314 data['data_rewindNav'] = slider.data('rewindNav'), 1315 data['data_slideSpeed'] = slider.data('slideSpeed'), 1316 data['data_paginationSpeed'] = slider.data('paginationSpeed'), 1317 data['data_rewindSpeed'] = slider.data('rewindSpeed'), 1318 data['data_autoHeight'] = slider.data('autoHeight'), 1319 data['data_transitionStyle'] = slider.data('transitionStyle'), 1320 data['data_pagination'] = slider.data('pagination'), 1321 data['data_navigation'] = slider.data('navigation'), 1322 data['data_navigationPrev'] = slider.data('navigationPrev'), 1323 data['data_navigationNext'] = slider.data('navigationNext'); 1324 1325 1326 seasidetms_owl_slider_run(data); 1327 } ); 1328} 1329 1330 1331 1332/* Owl Slider run */ 1333function seasidetms_owl_slider_run(data) { 1334 var data_id = data['data_id'], 1335 container = jQuery('#' + data_id), 1336 data_items = false, 1337 data_singleItem = true, 1338 data_autoPlay = false, 1339 data_stopOnHover = true, 1340 data_rewindNav = true, 1341 data_slideSpeed = 200, 1342 data_paginationSpeed = 800, 1343 data_rewindSpeed = 1000, 1344 data_autoHeight = (checker.ua.safari && checker.os.mac && !checker.ua.chrome) ? false : true, 1345 data_transitionStyle = false, 1346 data_pagination = true, 1347 data_navigation = true, 1348 data_navigationPrev = '<span class="seasidetms_prev_arrow"><span></span></span>', 1349 data_navigationNext = '<span class="seasidetms_next_arrow"><span></span></span>', 1350 params = {}; 1351 1352 1353 if (data['data_items'] !== undefined) { 1354 data_items = Number(data['data_items']); 1355 } 1356 1357 1358 if (data['data_singleItem'] !== undefined) { 1359 data_singleItem = Boolean(data['data_singleItem']); 1360 } 1361 1362 1363 if (data['data_autoPlay'] !== undefined) { 1364 data_autoPlay = (data['data_autoPlay'] === false) ? false : Number(data['data_autoPlay']); 1365 } 1366 1367 1368 if (data['data_stopOnHover'] !== undefined) { 1369 data_stopOnHover = Boolean(data['data_stopOnHover']); 1370 } 1371 1372 1373 if (data['data_rewindNav'] !== undefined) { 1374 data_rewindNav = Boolean(data['data_rewindNav']); 1375 } 1376 1377 1378 if (data['data_slideSpeed'] !== undefined) { 1379 data_slideSpeed = Number(data['data_slideSpeed']); 1380 } 1381 1382 1383 if (data['data_paginationSpeed'] !== undefined) { 1384 data_paginationSpeed = Number(data['data_paginationSpeed']); 1385 } 1386 1387 1388 if (data['data_rewindSpeed'] !== undefined) { 1389 data_rewindSpeed = Number(data['data_rewindSpeed']); 1390 } 1391 1392 1393 if (data['data_autoHeight'] !== undefined) { 1394 data_autoHeight = Boolean(data['data_autoHeight']); 1395 } 1396 1397 1398 if (data['data_transitionStyle'] !== undefined) { 1399 data_transitionStyle = (data['data_transitionStyle'] === 'fade') ? data['data_transitionStyle'] : false; 1400 } 1401 1402 1403 if (data['data_pagination'] !== undefined) { 1404 data_pagination = Boolean(data['data_pagination']); 1405 } 1406 1407 1408 if (data['data_navigation'] !== undefined) { 1409 data_navigation = Boolean(data['data_navigation']); 1410 } 1411 1412 1413 if (data['data_navigationPrev'] !== undefined) { 1414 data_navigationPrev = data['data_navigationPrev']; 1415 } 1416 1417 1418 if (data['data_navigationNext'] !== undefined) { 1419 data_navigationNext = data['data_navigationNext']; 1420 } 1421 1422 1423 params = { 1424 singleItem : data_singleItem, 1425 autoPlay : data_autoPlay, 1426 stopOnHover : data_stopOnHover, 1427 rewindNav : data_rewindNav, 1428 slideSpeed : data_slideSpeed, 1429 paginationSpeed : data_paginationSpeed, 1430 rewindSpeed : data_rewindSpeed, 1431 autoHeight : data_autoHeight, 1432 addClassActive : true, 1433 transitionStyle : data_transitionStyle, 1434 responsiveBaseWidth : '#' + data_id, 1435 pagination : data_pagination, 1436 navigation : data_navigation, 1437 navigationText : [data_navigationPrev, data_navigationNext] 1438 }; 1439 1440 1441 if (data_singleItem === false) { 1442 if (data_items === false) { 1443 var contentWrap = container.closest('.content_wrap'), 1444 itemsNumber = 2; 1445 1446 1447 if (contentWrap.hasClass('fullwidth')) { 1448 itemsNumber = 4; 1449 } else if (contentWrap.hasClass('r_sidebar') || contentWrap.hasClass('l_sidebar')) { 1450 itemsNumber = 3; 1451 } 1452 } else { 1453 itemsNumber = data_items; 1454 } 1455 1456 1457 var firstPost = container.find('.seasidetms_owl_slider_item'), 1458 postMinWidth = Number(firstPost.css('minWidth').replace('px', '')), 1459 postDesktopSmallWidth = (postMinWidth * 4) - 1, 1460 postTabletWidth = (postMinWidth * 3) - 1, 1461 postMobileWidth = (postMinWidth * 2) - 1, 1462 postThreeColumns = (itemsNumber > 3 ? 3 : itemsNumber), 1463 postTwoColumns = (itemsNumber > 2 ? 2 : itemsNumber), 1464 postOneColumns = 1; 1465 1466 1467 params.items = itemsNumber; 1468 params.itemsDesktop = false; 1469 params.itemsDesktopSmall = [postDesktopSmallWidth, postThreeColumns]; 1470 params.itemsTablet = [postTabletWidth, postTwoColumns]; 1471 params.itemsMobile = [postMobileWidth, postOneColumns]; 1472 } 1473 1474 1475 container.owlCarousel(params); 1476} 1477 1478 1479 1480"use strict"; 1481 1482/* Correct OS & Browser Check */ 1483var ua = navigator.userAgent, 1484 checker = { 1485 os : { 1486 iphone : ua.match(/iPhone/), 1487 ipod : ua.match(/iPod/), 1488 ipad : ua.match(/iPad/), 1489 blackberry : ua.match(/BlackBerry/), 1490 android : ua.match(/(Android|Linux armv6l|Linux armv7l)/), 1491 linux : ua.match(/Linux/), 1492 win : ua.match(/Windows/), 1493 mac : ua.match(/Macintosh/) 1494 }, 1495 ua : { 1496 ie : ua.match(/MSIE/), 1497 ie6 : ua.match(/MSIE 6.0/), 1498 ie7 : ua.match(/MSIE 7.0/), 1499 ie8 : ua.match(/MSIE 8.0/), 1500 ie9 : ua.match(/MSIE 9.0/), 1501 ie10 : ua.match(/MSIE 10.0/), 1502 ie11 : ua.match(/MSIE 11.0/), 1503 opera : ua.match(/Opera/), 1504 firefox : ua.match(/Firefox/), 1505 chrome : ua.match(/Chrome/), 1506 safari : ua.match(/(Safari|BlackBerry)/) 1507 } 1508 }; 1509 1510 1511 1512/* Correct Image Load Check */ 1513function isImageOk(img) { 1514 "use strict"; 1515 1516 if (!img.complete) { 1517 return false; 1518 } 1519 1520
1521 if (typeof img.naturalWidth !== undefined && img.naturalWidth === 0) { 1522 return 'stop'; 1523 } 1524 1525 1526 return true; 1527} 1528 1529 1530 1531/* Check Whether the Numbers are Approximately Equal */ 1532function checkN(a, b, x) { 1533 "use strict"; 1534 1535 if ((a > b && a - x <= b) || (b > a && b - x <= a)){ 1536 return true; 1537 } else { 1538 return false; 1539 } 1540} 1541 1542 1543 1544/* Run Facebook Widget */ 1545if (jQuery('#fb-root').length > 0) { 1546 (function(d, s, id) { 1547 var js, fjs = d.getElementsByTagName(s)[0]; 1548 if (d.getElementById(id)) return; 1549 js = d.createElement(s); js.id = id; 1550 js.src = "//connect.facebook.net/en_GB/sdk.js#xfbml=1&version=v2.4"; 1551 fjs.parentNode.insertBefore(js, fjs); 1552 }(document, "script", "facebook-jssdk")); 1553} 1554 1555 1556 1557/* Uniq ID */ 1558function uniqID() { 1559 "use strict"; 1560 1561 return Math.round(new Date().getTime() + (Math.random() * 1000000)); 1562} 1563
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.