first commit

This commit is contained in:
DESKTOP-GBA0BK8\Admin
2023-04-08 12:19:53 -04:00
commit 7c8c8b1c76
4586 changed files with 2050693 additions and 0 deletions
@@ -0,0 +1,19 @@
var $j = jQuery.noConflict();
$j( document ).ready( function() {
"use strict";
// Custom select
oceanwpCustomSelects();
} );
/* ==============================================
CUSTOM SELECT
============================================== */
function oceanwpCustomSelects() {
"use strict"
$j( oceanwpLocalize.customSelects ).customSelect( {
customClass: 'theme-select'
} );
}
@@ -0,0 +1,142 @@
var $j = jQuery.noConflict(),
$window = $j( window );
$j( document ).ready( function() {
"use strict";
// Drop down mobile menu
oceanwpDropDownMobile();
} );
/* ==============================================
DROPDOWN MOBILE SCRIPT
============================================== */
function oceanwpDropDownMobile() {
"use strict"
if ( $j( 'body' ).hasClass( 'dropdown-mobile' ) ) {
// Open drop down menu
$j( '.mobile-menu' ).on( 'click', function() {
$j( '#mobile-dropdown' ).slideToggle( 500 );
$j( this ).toggleClass( 'opened' );
$j( '.mobile-menu > .hamburger' ).toggleClass( 'is-active' );
return false;
} );
// Close menu function
var oceanwpDropDownMobileClose = function( e ) {
$j( '#mobile-dropdown' ).slideUp( 200 );
$j( '.mobile-menu' ).removeClass( 'opened' );
$j( '.mobile-menu > .hamburger' ).removeClass( 'is-active' );
}
var $owpmenu = $j( '.mobile-menu > .hamburger' );
var isMenuOpen = false;
$owpmenu.on('click', function () {
isMenuOpen = !isMenuOpen;
$owpmenu.attr('aria-expanded', isMenuOpen);
});
// Declare useful vars
var $hasChildren = $j( '#mobile-dropdown .menu-item-has-children' );
// Add dropdown toggle (plus)
$hasChildren.children( 'a' ).append( '<span class="dropdown-toggle"></span>' );
// Toggle dropdowns
var $dropdownTarget = $j( '.dropdown-toggle' );
// Check localization
if ( oceanwpLocalize.sidrDropdownTarget == 'link' ) {
$dropdownTarget = $j( '#mobile-dropdown li.menu-item-has-children > a' );
}
// Add toggle click event
$dropdownTarget.on( 'tap click', function() {
// Define toggle vars
if ( oceanwpLocalize.sidrDropdownTarget == 'link' ) {
var $toggleParentLi = $j( this ).parent( 'li' );
} else {
var $toggleParentLink = $j( this ).parent( 'a' ),
$toggleParentLi = $toggleParentLink.parent( 'li' );
}
// Get parent items and dropdown
var $allParentLis = $toggleParentLi.parents( 'li' ),
$dropdown = $toggleParentLi.children( 'ul' );
// Toogle items
if ( ! $toggleParentLi.hasClass( 'active' ) ) {
$hasChildren.not( $allParentLis ).removeClass( 'active' ).children( 'ul' ).slideUp( 'fast' );
$toggleParentLi.addClass( 'active' ).children( 'ul' ).slideDown( 'fast' );
} else {
$toggleParentLi.removeClass( 'active' ).children( 'ul' ).slideUp( 'fast' );
}
// Return false
return false;
} );
// Close menu
$j( document ).on( 'click', function() {
oceanwpDropDownMobileClose();
} ).on( 'click', '#mobile-dropdown', function( e ) {
e.stopPropagation();
} );
// Close on resize
$window.resize( function() {
if ( $window.width() >= 960 ) {
oceanwpDropDownMobileClose();
}
} );
// Close menu if anchor link
$j( '#mobile-dropdown li a[href*="#"]:not([href="#"])' ).on( 'click', function() {
oceanwpDropDownMobileClose();
} );
}
}
( function() {
var owpHeader = document.getElementById('site-header'),
navWarap = document.querySelectorAll( '#mobile-dropdown nav' )[0];
if ( ! owpHeader || ! navWarap ) {
return;
}
document.addEventListener( 'keydown', function( event ) {
var selectors = 'input, a, button',
elements = navWarap.querySelectorAll( selectors ),
closMenu = document.querySelector( '.mobile-menu.opened' ),
lastEl = elements[ elements.length - 1 ],
firstEl = elements[0],
activeEl = document.activeElement,
tabKey = event.keyCode === 9,
shiftKey = event.shiftKey;
if ( ! shiftKey && tabKey && lastEl === activeEl ) {
event.preventDefault();
closMenu.focus();
}
if ( shiftKey && tabKey && firstEl === activeEl ) {
event.preventDefault();
closMenu.focus();
}
if ( shiftKey && tabKey && closMenu === activeEl ) {
event.preventDefault();
lastEl.focus();
}
});
}() );
@@ -0,0 +1,48 @@
var $j = jQuery.noConflict();
$j( document ).ready( function() {
"use strict";
// Drop down search
oceanwpDropDownSearch();
} );
/* ==============================================
DROP DOWN SEARCH
============================================== */
function oceanwpDropDownSearch() {
"use strict"
// Return if is the not this search style
if ( 'drop_down' != oceanwpLocalize.menuSearchStyle ) {
return;
}
var $searchDropdownToggle = $j( 'a.search-dropdown-toggle' ),
$searchDropdownForm = $j( '#searchform-dropdown' );
$searchDropdownToggle.click( function( event ) {
// Display search form
$searchDropdownForm.toggleClass( 'show' );
// Active menu item
$j( this ).parent( 'li' ).toggleClass( 'active' );
// Focus
var $transitionDuration = $searchDropdownForm.css( 'transition-duration' );
$transitionDuration = $transitionDuration.replace( 's', '' ) * 1000;
if ( $transitionDuration ) {
setTimeout( function() {
$searchDropdownForm.find( 'input.field' ).focus();
}, $transitionDuration );
}
// Return false
return false;
} );
// Close on doc click
$j( document ).on( 'click', function( event ) {
if ( ! $j( event.target ).closest( '#searchform-dropdown.show' ).length ) {
$searchDropdownToggle.parent( 'li' ).removeClass( 'active' );
$searchDropdownForm.removeClass( 'show' );
}
} );
}
@@ -0,0 +1,17 @@
var $j = jQuery.noConflict();
$j( document ).ready( function() {
"use strict";
// Responsive Video
oceanwpInitFitVids();
} );
/* ==============================================
RESPONSIVE VIDEOS
============================================== */
function oceanwpInitFitVids( $context ) {
"use strict"
$j( '.responsive-video-wrap, .responsive-audio-wrap', $context ).fitVids();
}
@@ -0,0 +1,50 @@
var $j = jQuery.noConflict(),
$window = $j( window ),
$lastWindowWidth = $window.width(),
$lastWindowHeight = $window.height();
$window.on( 'load', function() {
"use strict";
// Fixed footer
oceanwpFixedFooter();
} );
$window.resize( function() {
"use strict";
var $windowWidth = $window.width(),
$windowHeight = $window.height();
if ( $lastWindowWidth !== $windowWidth
|| $lastWindowHeight !== $windowHeight ) {
oceanwpFixedFooter();
}
} );
/* ==============================================
FIXED FOOTER
============================================== */
function oceanwpFixedFooter() {
"use strict"
if ( ! $j( 'body' ).hasClass( 'has-fixed-footer' ) ) {
return;
}
// Set main vars
var $mainHeight = $j( '#main' ).outerHeight(),
$htmlHeight = $j( 'html' ).height(),
$offset = 0,
$adminBar = $j( '#wpadminbar' );
if ( $adminBar.length ) {
$offset = $adminBar.outerHeight();
}
var $minHeight = $mainHeight + ( $window.height() - $htmlHeight - $offset );
// Add min height
$j( '#main' ).css( 'min-height', $minHeight );
}
@@ -0,0 +1,85 @@
var $j = jQuery.noConflict();
$j( document ).ready( function() {
"use strict";
// Full Screen header menu
oceanwpFullScreenMenu();
} );
/* ==============================================
FULL SCREEN MENU
============================================== */
function oceanwpFullScreenMenu() {
"use strict"
var $siteHeader = $j( '#site-header.full_screen-header' ),
$menuWrap = $j( '#site-header.full_screen-header #full-screen-menu' ),
$menuBar = $j( '#site-header.full_screen-header .menu-bar' ),
$customLogo = $j( '#site-logo.has-full-screen-logo' );
if ( $menuBar.length ) {
// Open menu function
var oceanwpFullScreenMenuOpen = function() {
$siteHeader.addClass( 'nav-open' );
$menuBar.addClass( 'exit' );
$customLogo.addClass( 'opened' );
$menuWrap.addClass( 'active' );
$menuWrap.fadeIn( 200 );
var innerWidth = $j( 'html' ).innerWidth();
$j( 'html' ).css( 'overflow', 'hidden' );
var hiddenInnerWidth = $j( 'html' ).innerWidth();
$j( 'html' ).css( 'margin-right', hiddenInnerWidth - innerWidth );
}
// Close menu function
var oceanwpFullScreenMenuClose = function() {
$siteHeader.removeClass( 'nav-open' );
$menuBar.removeClass( 'exit' );
$customLogo.removeClass( 'opened' );
$menuWrap.removeClass( 'active' );
$menuWrap.fadeOut( 200 );
$j( 'html' ).css( {
'overflow': '',
'margin-right': ''
} );
$j( '#full-screen-menu #site-navigation ul > li.dropdown' ).removeClass( 'open-sub' );
$j( '#full-screen-menu #site-navigation ul.sub-menu' ).slideUp( 200 );
}
$menuBar.on( 'click', function( e ) {
e.preventDefault();
if ( ! $j( this ).hasClass( 'exit' ) ) {
oceanwpFullScreenMenuOpen();
} else {
oceanwpFullScreenMenuClose();
}
} );
// Logic for open sub menus
$j( '#full-screen-menu #site-navigation ul > li.dropdown > a > .text-wrap > span.nav-arrow, #full-screen-menu #site-navigation ul > li.dropdown > a[href="#"]' ).on( 'tap click', function() {
if ( $j( this ).closest( 'li.dropdown' ).find( '> ul.sub-menu' ).is( ':visible' ) ) {
$j( this ).closest( 'li.dropdown' ).removeClass( 'open-sub' );
$j( this ).closest( 'li.dropdown' ).find( '> ul.sub-menu' ).slideUp( 200 );
} else {
$j( this ).closest( 'li.dropdown' ).addClass( 'open-sub' );
$j( this ).closest( 'li.dropdown' ).find( '> ul.sub-menu' ).slideDown( 200 );
}
return false;
} );
// Close menu if anchor link
$j( '#full-screen-menu #site-navigation a.menu-link[href*="#"]:not([href="#"])' ).on( 'click', function() {
oceanwpFullScreenMenuClose();
} );
}
}
@@ -0,0 +1,85 @@
var $j = jQuery.noConflict(),
$window = $j( window );
$j( document ).ready( function() {
"use strict";
// Full Screen mobile menu
oceanwpFullScreenMobile();
} );
/* ==============================================
FULL SCREEN MOBILE
============================================== */
function oceanwpFullScreenMobile() {
"use strict"
if ( $j( 'body' ).hasClass( 'fullscreen-mobile' ) ) {
var $mobileMenu = $j( '#mobile-fullscreen' ),
$mobileLink = $j( '.mobile-menu' );
// Close menu function
var oceanwpFullScreenMobileClose = function( e ) {
$mobileLink.removeClass( 'exit' );
$mobileMenu.removeClass( 'active' ).fadeOut( 200 );
$j( 'html' ).css( {
'overflow': '',
'margin-right': ''
} );
$j( '#mobile-fullscreen nav ul > li.dropdown' ).removeClass( 'open-sub' );
$j( '#mobile-fullscreen nav ul.sub-menu' ).slideUp( 200 );
$j( '.mobile-menu > .hamburger' ).removeClass( 'is-active' );
}
// Open full screen menu
$mobileLink.on( 'click', function() {
$j( this ).addClass( 'exit' );
$mobileMenu.addClass( 'active' ).fadeIn( 200 );
$j( '.mobile-menu > .hamburger' ).addClass( 'is-active' );
var innerWidth = $j( 'html' ).innerWidth();
$j( 'html' ).css( 'overflow', 'hidden' );
var hiddenInnerWidth = $j( 'html' ).innerWidth();
$j( 'html' ).css( 'margin-right', hiddenInnerWidth - innerWidth );
return false;
} );
// Add dropdown toggle (plus)
$j( '#mobile-fullscreen .menu-item-has-children' ).children( 'a' ).append( '<span class="dropdown-toggle"></span>' );
// Add toggle click event
$j( '#mobile-fullscreen nav ul > li.menu-item-has-children > a > span.dropdown-toggle, #mobile-fullscreen nav ul > li.menu-item-has-children > a[href="#"]' ).on( 'tap click', function() {
if ( $j( this ).closest( 'li.menu-item-has-children' ).find( '> ul.sub-menu' ).is( ':visible' ) ) {
$j( this ).closest( 'li.menu-item-has-children' ).removeClass( 'open-sub' );
$j( this ).closest( 'li.menu-item-has-children' ).find( '> ul.sub-menu' ).slideUp( 200 );
} else {
$j( this ).closest( 'li.menu-item-has-children' ).addClass( 'open-sub' );
$j( this ).closest( 'li.menu-item-has-children' ).find( '> ul.sub-menu' ).slideDown( 200 );
}
return false;
} );
// Close menu
$j( '#mobile-fullscreen a.close' ).on( 'click', function( e ) {
e.preventDefault();
oceanwpFullScreenMobileClose();
} );
// Close menu if anchor link
$j( '#mobile-fullscreen .fs-dropdown-menu li a[href*="#"]:not([href="#"]), #mobile-fullscreen #mobile-nav li a[href*="#"]:not([href="#"])' ).on( 'click', function() {
oceanwpFullScreenMobileClose();
} );
// Close on resize
$window.resize( function() {
if ( $window.width() >= 960 ) {
oceanwpFullScreenMobileClose();
}
} );
}
}
@@ -0,0 +1,106 @@
var $j = jQuery.noConflict();
$j( document ).ready( function() {
"use strict";
// Header replace search
oceanwpHeaderReplaceSearch();
} );
/* ==============================================
HEADER REPLACE SEARCH
============================================== */
function oceanwpHeaderReplaceSearch() {
"use strict"
// Return if is the not this search style
if ( 'header_replace' != oceanwpLocalize.menuSearchStyle ) {
return;
}
// Header
var $header = $j( '#site-header' );
// If is top menu header style
if ( $header.hasClass( 'top-header' ) ) {
// Show
var $headerReplace = $j( '#searchform-header-replace' ),
$siteLeft = $j( '#site-header.top-header .header-top .left' ),
$siteRight = $j( '#site-header.top-header .header-top .right' );
$j( 'a.search-header-replace-toggle' ).click( function( event ) {
// Display search form
$headerReplace.toggleClass( 'show' );
$siteLeft.toggleClass( 'hide' );
$siteRight.toggleClass( 'hide' );
// Focus
var $transitionDuration = $headerReplace.css( 'transition-duration' );
$transitionDuration = $transitionDuration.replace( 's', '' ) * 1000;
if ( $transitionDuration ) {
setTimeout( function() {
$headerReplace.find( 'input[type="search"]' ).focus();
}, $transitionDuration );
}
// Return false
return false;
} );
// Close on click
$j( '#searchform-header-replace-close' ).click( function() {
$headerReplace.removeClass( 'show' );
$siteLeft.removeClass( 'hide' );
$siteRight.removeClass( 'hide' );
return false;
} );
// Close on doc click
$j( document ).on( 'click', function( event ) {
if ( ! $j( event.target ).closest( $j( '#searchform-header-replace.show' ) ).length ) {
$headerReplace.removeClass( 'show' );
$siteLeft.removeClass( 'hide' );
$siteRight.removeClass( 'hide' );
}
} );
} else {
// Show
var $headerReplace = $j( '#searchform-header-replace' ),
$siteNavigation = $j( '#site-header.header-replace #site-navigation' );
$j( 'a.search-header-replace-toggle' ).click( function( event ) {
// Display search form
$headerReplace.toggleClass( 'show' );
$siteNavigation.toggleClass( 'hide' );
var menu_width = $j( '#site-navigation > ul.dropdown-menu' ).width();
$headerReplace.css( 'max-width', menu_width + 60 );
// Focus
var $transitionDuration = $headerReplace.css( 'transition-duration' );
$transitionDuration = $transitionDuration.replace( 's', '' ) * 1000;
if ( $transitionDuration ) {
setTimeout( function() {
$headerReplace.find( 'input[type="search"]' ).focus();
}, $transitionDuration );
}
// Return false
return false;
} );
// Close on click
$j( '#searchform-header-replace-close' ).click( function() {
$headerReplace.removeClass( 'show' );
$siteNavigation.removeClass( 'hide' );
return false;
} );
// Close on doc click
$j( document ).on( 'click', function( event ) {
if ( ! $j( event.target ).closest( $j( '#searchform-header-replace.show' ) ).length ) {
$headerReplace.removeClass( 'show' );
$siteNavigation.removeClass( 'hide' );
}
} );
}
}
@@ -0,0 +1,36 @@
var $j = jQuery.noConflict();
$j( document ).ready( function() {
"use strict";
// Header search form label
oceanwpHeaderSearchForm();
} );
/* ==============================================
HEADER SEARCH FORM LABEL
============================================== */
function oceanwpHeaderSearchForm() {
"use strict"
// Add class when the search input is not empty
$j( 'form.header-searchform' ).each( function() {
var form = $j( this ),
listener = form.find( 'input' ),
$label = form.find( 'label' );
if ( listener.val().length ) {
form.addClass( 'search-filled' );
}
listener.on( 'keyup blur', function() {
if ( listener.val().length > 0 ) {
form.addClass( 'search-filled' );
} else {
form.removeClass( 'search-filled' );
}
} );
} );
}
@@ -0,0 +1,81 @@
var $j = jQuery.noConflict(),
$window = $j( window );
$window.on( 'load', function() {
"use strict";
if ( $j.fn.infiniteScroll !== undefined && $j( 'div.infinite-scroll-nav' ).length ) {
// Infinite scroll
oceanwpInfiniteScrollInit();
}
} );
/* ==============================================
INFINITE SCROLL
============================================== */
function oceanwpInfiniteScrollInit() {
"use strict"
// Get infinite scroll container
var $container = $j( '.infinite-scroll-wrap' );
// Start infinite sccroll
$container.infiniteScroll( {
path : '.older-posts a',
append : '.item-entry',
status : '.scroller-status',
hideNav : '.infinite-scroll-nav',
history : false,
} );
$container.on( 'load.infiniteScroll', function( event, response, path, items ) {
var $items = $j( response ).find( '.item-entry' );
$items.imagesLoaded( function() {
// Animate new Items
$items.animate( {
opacity : 1
} );
// Force the images to be parsed to fix Safari issue
$items.find( 'img' ).each( function( index, img ) {
img.outerHTML = img.outerHTML;
} );
// Isotope
if ( $container.hasClass( 'blog-masonry-grid' ) ) {
$container.isotope( 'appended', $items );
$items.css( 'opacity', 0 );
}
// Re-run functions
if ( ! $j( 'body' ).hasClass( 'no-carousel' ) ) {
oceanwpInitCarousel( $items );
}
if ( ! $j( 'body' ).hasClass( 'no-lightbox' ) ) {
oceanwpInitLightbox( $items );
}
if ( ! $j( 'body' ).hasClass( 'no-fitvids' ) ) {
oceanwpInitFitVids( $items );
}
// Match heights
if ( ! $j( 'body' ).hasClass( 'no-matchheight' ) ) {
$j( '.blog-equal-heights .blog-entry-inner' ).matchHeight({ property: 'min-height' });
}
// Gallery posts
if ( $j( '.gallery-format' ).parent( '.thumbnail' ) && $j( '.blog-masonry-grid' ).length ) {
setTimeout( function() {
$j( '.blog-masonry-grid' ).isotope( 'layout' );
}, 600 + 1 );
}
} );
} );
}
@@ -0,0 +1,39 @@
var $j = jQuery.noConflict();
$j( document ).ready( function() {
"use strict";
// Masonry grids
oceanwpMasonryGrids();
} );
$j( window ).on( 'orientationchange', function() {
"use strict";
// Masonry grids
oceanwpMasonryGrids();
} );
/* ==============================================
MASONRY
============================================== */
function oceanwpMasonryGrids() {
"use strict"
$j( '.blog-masonry-grid' ).each( function() {
var $this = $j( this ),
$transitionDuration = '0.0',
$layoutMode = 'masonry';
// Load isotope after images loaded
$this.imagesLoaded( function() {
$this.isotope( {
itemSelector : '.isotope-entry',
transformsEnabled : true,
isOriginLeft : oceanwpLocalize.isRTL ? false : true,
transitionDuration : $transitionDuration + 's'
} );
} );
} );
}
@@ -0,0 +1,21 @@
var $j = jQuery.noConflict();
$j( document ).ready( function() {
"use strict";
// Match height elements
oceanwpInitMatchHeight();
} );
/* ==============================================
MATCH HEIGHTS
============================================== */
function oceanwpInitMatchHeight() {
"use strict"
// Add match heights grid
$j( '.match-height-grid .match-height-content' ).matchHeight({ property: 'min-height' });
// Blog entries
$j( '.blog-equal-heights .blog-entry-inner' ).matchHeight({ property: 'min-height' });
}
@@ -0,0 +1,96 @@
var $j = jQuery.noConflict(),
$window = $j( window );
$j( document ).ready( function() {
"use strict";
// Mega menu
oceanwpMegaMenu();
} );
/* ==============================================
MEGA MENU
============================================== */
function oceanwpMegaMenu() {
"use strict"
// Mega menu in top bar menu
$j( '#top-bar-nav .megamenu-li.full-mega' ).hover( function() {
var $topBar = $j( '#top-bar' ),
$menuWidth = $topBar.width(),
$menuPosition = $topBar.offset(),
$menuItemPosition = $j( this ).offset(),
$positionLeft = $menuItemPosition.left-$menuPosition.left+1;
if ( $j( 'body' ).hasClass( 'boxed-layout' ) ) {
$positionLeft = $menuItemPosition.left-$menuPosition.left+1;
$positionLeft = $positionLeft-30;
}
$j( this ).find( '.megamenu' ).css( { 'left': '-'+$positionLeft+'px', 'width': $menuWidth } );
} );
// Mega menu in principal menu
$j( '#site-navigation .megamenu-li.full-mega' ).hover( function() {
var $siteHeader = $j( '#site-header-inner' ),
$menuWidth = $siteHeader.width(),
$menuPosition = $siteHeader.offset(),
$menuItemPosition = $j( this ).offset(),
$positionLeft = $menuItemPosition.left-$menuPosition.left+1;
if ( $j( '#site-header' ).hasClass( 'medium-header' ) ) {
$siteHeader = $j( '#site-navigation-wrap > .container' ),
$menuWidth = $siteHeader.width(),
$menuPosition = $siteHeader.offset(),
$positionLeft = $menuItemPosition.left-$menuPosition.left+1;
}
if ( $j( 'body' ).hasClass( 'boxed-layout' ) ) {
$positionLeft = $menuItemPosition.left-$menuPosition.left+1;
$positionLeft = $positionLeft-30;
}
$j( this ).find( '.megamenu' ).css( { 'left': '-'+$positionLeft+'px', 'width': $menuWidth } );
} );
// Megamenu auto width
$j( '.navigation .megamenu-li.auto-mega .megamenu' ).each( function() {
var $li = $j( this ).parent(),
$liOffset = $li.offset().left,
$liOffsetTop = $li.offset().top,
$liWidth = $j( this ).parent().width(),
$dropdowntMarginLeft = $liWidth/2,
$dropdownWidth = $j( this ).outerWidth(),
$dropdowntLeft = $liOffset - $dropdownWidth/2;
if ( $dropdowntLeft < 0 ) {
var $left = $liOffset - 10;
$dropdowntMarginLeft = 0;
} else {
var $left = $dropdownWidth/2;
}
if ( oceanwpLocalize.isRTL ) {
$j( this ).css( {
'right': - $left,
'marginRight': $dropdowntMarginLeft
} );
} else {
$j( this ).css( {
'left': - $left,
'marginLeft': $dropdowntMarginLeft
} );
}
var $dropdownRight = ( $window.width() ) - ( $liOffset - $left + $dropdownWidth + $dropdowntMarginLeft );
if ( $dropdownRight < 0 ) {
$j( this ).css( {
'left': 'auto',
'right': - ( $window.width() - $liOffset - $liWidth - 10 )
} );
}
} );
}
@@ -0,0 +1,19 @@
var $j = jQuery.noConflict();
$j( document ).ready( function() {
"use strict";
// Nav no click
oceanwpNavNoClick();
} );
/* ==============================================
NAV NO CLICK
============================================== */
function oceanwpNavNoClick() {
"use strict"
$j( 'li.nav-no-click > a' ).on( 'click', function() {
return false;
} );
}
@@ -0,0 +1,56 @@
var $j = jQuery.noConflict();
$j( document ).ready( function() {
"use strict";
// Overlay search
oceanwpOverlaySearch();
} );
/* ==============================================
OVERLAY SEARCH
============================================== */
function oceanwpOverlaySearch() {
"use strict"
// Return if is the not this search style
if ( 'overlay' != oceanwpLocalize.menuSearchStyle ) {
return;
}
var $searchOverlayToggle = $j( 'a.search-overlay-toggle' ),
$searchOverlayClose = $j( 'a.search-overlay-close' ),
$searchOverlay = $j( '#searchform-overlay' );
if ( $searchOverlayToggle.length ) {
$searchOverlayToggle.on( 'click', function( e ) {
e.preventDefault();
$searchOverlay.addClass( 'active' );
$searchOverlay.fadeIn( 200 );
setTimeout( function() {
$j( 'html' ).css( 'overflow', 'hidden' );
}, 400);
} );
}
$searchOverlayClose.on( 'click', function( e ) {
e.preventDefault();
$searchOverlay.removeClass( 'active' );
$searchOverlay.fadeOut( 200 );
setTimeout( function() {
$j( 'html' ).css( 'overflow', 'visible' );
}, 400);
} );
$searchOverlayToggle.on( 'click', function() {
$j( '#searchform-overlay input' ).focus();
} );
}
@@ -0,0 +1,30 @@
var $j = jQuery.noConflict();
$j( document ).ready( function() {
"use strict";
// Parallax footer
oceanwpParallaxFooter();
} );
$j( window ).on( 'resize', function() {
"use strict";
// Parallax footer
oceanwpParallaxFooter();
} );
/* ==============================================
PARALLAX FOOTER
============================================== */
function oceanwpParallaxFooter() {
"use strict"
// Needed timeout for dynamic parallax content
if ( $j( 'body' ).hasClass( 'has-parallax-footer' ) ) {
setTimeout( function() {
$j( '#main' ).css( 'margin-bottom', $j( '.parallax-footer' ).outerHeight() );
}, 1 );
}
}
@@ -0,0 +1,116 @@
var $j = jQuery.noConflict(),
$window = $j( window );
$j( document ).ready( function() {
"use strict";
// Scroll effect
oceanwpScrollEffect();
} );
/* ==============================================
SCROLL EFFECT
============================================== */
function oceanwpScrollEffect() {
"use strict"
if ( ! $j( 'body' ).hasClass( 'single-product' )
&& ! $j( 'body' ).hasClass( 'no-local-scroll' ) ) {
$j( 'a.local[href*="#"]:not([href="#"]), .local a[href*="#"]:not([href="#"]), a.menu-link[href*="#"]:not([href="#"]), a.sidr-class-menu-link[href*="#"]:not([href="#"])' ).on( 'click', function() {
if ( ! $j( this ).hasClass( 'omw-open-modal' )
&& ! $j( this ).parent().hasClass( 'omw-open-modal' )
&& ! $j( this ).parent().parent().parent().hasClass( 'omw-open-modal' )
&& ! $j( this ).parent().hasClass( 'opl-link' ) ) {
var $href = $j( this ).attr( 'href' ),
$hrefHash = $href.substr( $href.indexOf( '#' ) ).slice( 1 ),
$target = $j( '#' + $hrefHash ),
$adminbarHeight = oceanwpGetAdminbarHeight(),
$topbarHeight = oceanwpGetTopbarHeight(),
$stickyHeaderHeight = oceanwpGetStickyHeaderHeight(),
$offset = $adminbarHeight + $topbarHeight + $stickyHeaderHeight,
$scrollPosition;
if ( $target.length && '' !== $hrefHash ) {
$scrollPosition = $target.offset().top - $offset;
$j( 'html, body' ).stop().animate( {
scrollTop: Math.round( $scrollPosition )
}, 1000 );
return false;
}
}
} );
}
}
// Admin bar height
function oceanwpGetAdminbarHeight() {
"use strict"
var $offset = 0,
$adminBar = $j( '#wpadminbar' );
if ( $adminBar.length ) {
$offset = $adminBar.outerHeight();
}
return $offset;
}
// Top bar height
function oceanwpGetTopbarHeight() {
"use strict"
var $offset = 0,
$stickyTopBar = $j( '#top-bar-wrap' );
if ( $stickyTopBar.hasClass( 'top-bar-sticky' )
&& $stickyTopBar.length ) {
$offset = $stickyTopBar.outerHeight();
}
return $offset;
}
// Header height
function oceanwpGetStickyHeaderHeight() {
"use strict"
var $offset = 0,
$stickyHeader = $j( '#site-header' );
if ( ! $stickyHeader.length ) {
return;
}
if ( $stickyHeader.hasClass( 'fixed-scroll' ) ) {
$offset = $stickyHeader.data( 'height' );
}
if ( $window.width() <= 960
&& ! $stickyHeader.hasClass( 'has-sticky-mobile' ) ) {
$offset = $offset;
}
if ( $stickyHeader.hasClass( 'medium-header' ) ) {
if ( $j( '#site-header .bottom-header-wrap' ).hasClass( 'fixed-scroll' ) ) {
$offset = $j( '#site-header .bottom-header-wrap' ).outerHeight();
} else {
$offset = $j( '.is-sticky #site-header-inner' ).outerHeight();
}
}
if ( $stickyHeader.hasClass( 'vertical-header' ) ) {
$offset = $offset;
}
return $offset;
}
@@ -0,0 +1,38 @@
var $j = jQuery.noConflict(),
$window = $j( window );
$j( document ).ready( function() {
"use strict";
// Scroll top
oceanwpScrollTop();
} );
/* ==============================================
SCROLL TOP
============================================== */
function oceanwpScrollTop() {
"use strict"
var selectors = {
scrollTop : '#scroll-top',
topLink : 'a[href="#go-top"]',
slashTopLink : 'body.home a[href="/#go-top"]'
}
$window.on( 'scroll', function() {
if ( $j( this ).scrollTop() > 100 ) {
$j( '#scroll-top' ).fadeIn();
} else {
$j( '#scroll-top' ).fadeOut();
}
});
$j.each( selectors, function( key, value ){
$j( value ).on( 'click', function(e){
e.preventDefault();
$j( 'html, body' ).animate( { scrollTop: 0 }, 400 );
$j( this ).parent().removeClass( 'sfHover' );
});
});
}
@@ -0,0 +1,227 @@
var $j = jQuery.noConflict(),
$window = $j( window );
$j( document ).ready( function() {
"use strict";
// Mobile menu
oceanwpMobileMenu();
} );
/* ==============================================
MOBILE SCRIPT
============================================== */
function oceanwpMobileMenu( event ) {
"use strict"
if ( typeof oceanwpLocalize.sidrSource !== 'undefined'
&& $j( 'body' ).hasClass( 'sidebar-mobile' ) ) {
var $first = true;
// Add sidr
$j( '.mobile-menu' ).sidr( {
name : 'sidr',
source : oceanwpLocalize.sidrSource,
side : oceanwpLocalize.sidrSide,
displace : oceanwpLocalize.sidrDisplace,
speed : 300,
renaming : true,
bind : 'click',
onOpen : function onOpen() {
// Class of the custom opening button
$j( '.mobile-menu > .hamburger' ).addClass( 'is-active' );
if ( $first == true ) {
// Declare useful vars
var $hasChildren = $j( '.sidr-class-menu-item-has-children' );
var $sidrmenu = $j( '.mobile-menu > .hamburger' );
var isMenuOpen = false;
$sidrmenu.on('click', function () {
isMenuOpen = !isMenuOpen;
$sidrmenu.attr('aria-expanded', isMenuOpen);
});
// Add dropdown toggle (plus)
$hasChildren.children( 'a' ).append( '<span class="sidr-class-dropdown-toggle"></span>' );
// Toggle dropdowns
var $sidrDropdownTarget = $j( '.sidr-class-dropdown-toggle' );
// Check localization
if ( oceanwpLocalize.sidrDropdownTarget == 'link' ) {
$sidrDropdownTarget = $j( 'li.sidr-class-menu-item-has-children > a' );
}
// Add toggle click event
$sidrDropdownTarget.on( 'click', function( event ) {
// Define toggle vars
if ( oceanwpLocalize.sidrDropdownTarget == 'link' ) {
var $toggleParentLi = $j( this ).parent( 'li' );
} else {
var $toggleParentLink = $j( this ).parent( 'a' ),
$toggleParentLi = $toggleParentLink.parent( 'li' );
}
// Get parent items and dropdown
var $allParentLis = $toggleParentLi.parents( 'li' ),
$dropdown = $toggleParentLi.children( 'ul' );
// Toogle items
if ( ! $toggleParentLi.hasClass( 'active' ) ) {
$hasChildren.not( $allParentLis ).removeClass( 'active' ).children( 'ul' ).slideUp( 'fast' );
$toggleParentLi.addClass( 'active' ).children( 'ul' ).slideDown( 'fast' );
} else {
$toggleParentLi.removeClass( 'active' ).children( 'ul' ).slideUp( 'fast' );
}
// Return false
return false;
} );
$first = false;
}
// Add light overlay to content
$j( '#site-header' ).after( '<div class="oceanwp-sidr-overlay"></div>' );
$j( '.oceanwp-sidr-overlay' ).fadeIn( 300 );
// Close sidr when clicking overlay
$j( '.oceanwp-sidr-overlay' ).on( 'click', function() {
$j.sidr( 'close', 'sidr' );
return false;
} );
// Close on resize
$window.resize( function() {
if ( $window.width() >= 960 ) {
$j.sidr( 'close', 'sidr' );
$j( '.mobile-menu > .hamburger' ).removeClass( 'is-active' );
}
} );
},
onClose : function onClose() {
// Remove class of the custom opening button
$j( '.mobile-menu > .hamburger' ).removeClass( 'is-active' );
// Remove active dropdowns
$j( '.sidr-class-menu-item-has-children.active' ).removeClass( 'active' ).children( 'ul' ).hide();
// FadeOut overlay
$j( '.oceanwp-sidr-overlay' ).fadeOut( 300, function() {
$j( this ).remove();
} );
}
} );
// Replace Font Awesome icons class
$j( '#sidr [class*="sidr-class-fa"]' ).attr( 'class', function( i, c ) {
c = c.replace( 'sidr-class-fa', 'fa' );
c = c.replace( 'sidr-class-fa-', 'fa-' );
return c;
} );
// Replace Simple Line Icons class
$j( '#sidr [class*="sidr-class-icon"]' ).attr( 'class', function( i, c ) {
c = c.replace( 'sidr-class-icon-', 'icon-' );
return c;
} );
// Close sidr when clicking on close button
$j( 'a.sidr-class-toggle-sidr-close' ).on( 'click', function() {
$j.sidr( 'close', 'sidr' );
$j( '.mobile-menu > .hamburger' ).removeClass( 'is-active' );
return false;
} );
// Close when clicking local scroll link
$j( '.sidr-class-dropdown-menu a[href*="#"]:not([href="#"]), .sidr-class-menu-item > a[href*="#"]:not([href="#"])' ).on( 'click', function() {
$j.sidr( 'close', 'sidr' );
$j( '.mobile-menu > .hamburger' ).removeClass( 'is-active' );
} );
// If disable link
$j( 'li.sidr-class-nav-no-click > a' ).on( 'click', function() {
return false;
} );
}
}
function owpSidrDropdown() {
var owpHeader = document.getElementById('site-header'),
navWarap = document.querySelectorAll( '#sidr' )[0],
sidrClose = document.querySelector( '.sidr-class-toggle-sidr-close' );
if ( ! owpHeader || ! navWarap ) {
return;
}
var mobileIcon = document.querySelector( '.mobile-menu' );
mobileIcon.addEventListener( 'click', function() {
if ( ! sidrClose.classList.contains( 'opened' ) ) {
sidrClose.classList.toggle( 'opened' );
} else {
sidrClose.classList.remove( 'opened' );
}
});
sidrClose.addEventListener( 'click', function() {
sidrClose.classList.remove( 'opened' );
});
document.addEventListener( 'keydown', function( event ) {
var selectors = 'input, a, button',
elements = navWarap.querySelectorAll( selectors ),
closMenu = document.querySelector( '.sidr-class-toggle-sidr-close.opened' ),
lastEl = elements[ elements.length - 1 ],
firstEl = elements[0],
activeEl = document.activeElement,
tabKey = event.keyCode === 9,
shiftKey = event.shiftKey;
if ( ! closMenu ) {
return;
}
if ( ! shiftKey && tabKey && lastEl === activeEl ) {
event.preventDefault();
closMenu.focus();
}
if ( shiftKey && tabKey && firstEl === activeEl ) {
event.preventDefault();
closMenu.focus();
}
if ( shiftKey && tabKey && closMenu === activeEl ) {
event.preventDefault();
lastEl.focus();
}
closMenu.addEventListener( 'click', function() {
mobileIcon.focus();
} );
});
}
document.addEventListener(
'DOMContentLoaded',
function() {
owpSidrDropdown();
}
);
@@ -0,0 +1,45 @@
var $j = jQuery.noConflict();
$j( document ).ready( function() {
"use strict";
// Carousel
oceanwpInitCarousel();
} );
/* ==============================================
CAROUSEL
============================================== */
function oceanwpInitCarousel( $context ) {
"use strict"
var $carousel = $j( '.gallery-format, .product-entry-slider', $context );
// If RTL
if ( $j( 'body' ).hasClass( 'rtl' ) ) {
var rtl = true;
} else {
var rtl = false;
}
// Return autoplay to false if woo slider
if ( $carousel.hasClass( 'woo-entry-image' ) ) {
var autoplay = false;
} else {
var autoplay = true;
}
// Slide speed
var speed = 7000;
// Gallery slider
$carousel.imagesLoaded( function() {
$carousel.slick( {
autoplay: autoplay,
autoplaySpeed: speed,
prevArrow: '<button type="button" class="slick-prev"><span class="fa fa-angle-left"></span></button>',
nextArrow: '<button type="button" class="slick-next"><span class="fa fa-angle-right"></span></button>',
rtl: rtl,
} );
} );
}
@@ -0,0 +1,34 @@
var $j = jQuery.noConflict();
$j( document ).ready( function() {
"use strict";
// Superfish menus
oceanwpSuperFish();
} );
/* ==============================================
SUPERFISH MENUS
============================================== */
function oceanwpSuperFish() {
"use strict"
// Return if vertical header style
if ( $j( '#site-header' ).hasClass( 'vertical-header' ) ) {
return;
}
$j( 'ul.sf-menu' ).superfish( {
delay: 600,
animation: {
opacity: 'show'
},
animationOut: {
opacity: 'hide'
},
speed: 'fast',
speedOut: 'fast',
cssArrows: false,
disableHI: false,
} );
}
@@ -0,0 +1,103 @@
var $j = jQuery.noConflict();
// On ready
$j( document ).ready( function() {
"use strict";
// Vertical header style
oceanwpVerticalHeader();
} );
/* ==============================================
VERTICAL HEADER STYLE
============================================== */
function oceanwpVerticalHeader() {
"use strict"
// Return if no vertical header style
if ( ! $j( '#site-header' ).hasClass( 'vertical-header' ) ) {
return;
}
// Vars
var $siteHeader = $j( '#site-header.vertical-header #site-header-inner' ),
$hasChildren = $j( '#site-header.vertical-header li.menu-item-has-children' );
// Add dropdown toggle (plus)
$hasChildren.children( 'a' ).append( '<span class="dropdown-toggle"></span>' );
// Toggle dropdowns
var $dropdownTarget = $j( '.dropdown-toggle' );
// Check localization
if ( oceanwpLocalize.verticalHeaderTarget == 'link' ) {
$dropdownTarget = $j( '#site-header.vertical-header li.menu-item-has-children > a' );
}
// Add toggle click event
$dropdownTarget.on( 'tap click', function() {
// Define toggle vars
if ( oceanwpLocalize.verticalHeaderTarget == 'link' ) {
var $toggleParentLi = $j( this ).parent( 'li' );
} else {
var $toggleParentLink = $j( this ).parent( 'a' ),
$toggleParentLi = $toggleParentLink.parent( 'li' );
}
// Get parent items and dropdown
var $allParentLis = $toggleParentLi.parents( 'li' ),
$dropdown = $toggleParentLi.children( 'ul' );
// Toogle items
if ( ! $toggleParentLi.hasClass( 'active' ) ) {
$hasChildren.not( $allParentLis ).removeClass( 'active' ).children( 'ul' ).slideUp( 'fast' );
$toggleParentLi.addClass( 'active' ).children( 'ul' ).slideDown( 'fast', function() {
$siteHeader.getNiceScroll().resize();
} );
} else {
$toggleParentLi.removeClass( 'active' ).children( 'ul' ).slideUp( 'fast', function() {
$siteHeader.getNiceScroll().resize();
} );
}
// Return false
return false;
} );
// Scrollbar
if ( $siteHeader.length
&& ! navigator.userAgent.match( /(Android|iPod|iPhone|iPad|IEMobile|Opera Mini)/ ) ) {
$siteHeader.niceScroll( {
autohidemode : false,
cursorborder : 0,
cursorborderradius : 0,
cursorcolor : 'transparent',
cursorwidth : 0,
horizrailenabled : false,
mousescrollstep : 40,
scrollspeed : 60,
zindex : 100005,
} );
}
// Open/Close header
$j( 'a.vertical-toggle' ).on( 'click', function( e ) {
e.preventDefault();
if ( ! $j( 'body' ).hasClass( 'vh-opened' ) ) {
$j( 'body' ).addClass( 'vh-opened' );
$j( this ).find( '.hamburger' ).addClass( 'is-active' );
} else {
$j( 'body' ).removeClass( 'vh-opened' );
$j( this ).find( '.hamburger' ).removeClass( 'is-active' );
}
} );
}
@@ -0,0 +1,150 @@
/*!
* To enable the support for Woocommerce Grid-List button
*
* Javascript Cookie v1.5.1
* https://github.com/js-cookie/js-cookie
*
* Copyright 2006, 2014 Klaus Hartl
* Released under the MIT license
*
*/
(function (factory) {
var jQuery;
if (typeof define === 'function' && define.amd) {
// AMD (Register as an anonymous module)
define(['jquery'], factory);
} else if (typeof exports === 'object') {
// Node/CommonJS
try {
jQuery = require('jquery');
} catch(e) {}
module.exports = factory(jQuery);
} else {
// Browser globals
var _OldCookies = window.Cookies;
var api = window.Cookies = factory(window.jQuery);
api.noConflict = function() {
window.Cookies = _OldCookies;
return api;
};
}
}(function ($) {
var pluses = /\+/g;
function encode(s) {
return api.raw ? s : encodeURIComponent(s);
}
function decode(s) {
return api.raw ? s : decodeURIComponent(s);
}
function stringifyCookieValue(value) {
return encode(api.json ? JSON.stringify(value) : String(value));
}
function parseCookieValue(s) {
if (s.indexOf('"') === 0) {
// This is a quoted cookie as according to RFC2068, unescape...
s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
}
try {
// Replace server-side written pluses with spaces.
// If we can't decode the cookie, ignore it, it's unusable.
// If we can't parse the cookie, ignore it, it's unusable.
s = decodeURIComponent(s.replace(pluses, ' '));
return api.json ? JSON.parse(s) : s;
} catch(e) {}
}
function read(s, converter) {
var value = api.raw ? s : parseCookieValue(s);
return isFunction(converter) ? converter(value) : value;
}
function extend() {
var key, options;
var i = 0;
var result = {};
for (; i < arguments.length; i++) {
options = arguments[ i ];
for (key in options) {
result[key] = options[key];
}
}
return result;
}
function isFunction(obj) {
return Object.prototype.toString.call(obj) === '[object Function]';
}
var api = function (key, value, options) {
// Write
if (arguments.length > 1 && !isFunction(value)) {
options = extend(api.defaults, options);
if (typeof options.expires === 'number') {
var days = options.expires, t = options.expires = new Date();
t.setMilliseconds(t.getMilliseconds() + days * 864e+5);
}
return (document.cookie = [
encode(key), '=', stringifyCookieValue(value),
options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
options.path ? '; path=' + options.path : '',
options.domain ? '; domain=' + options.domain : '',
options.secure ? '; secure' : ''
].join(''));
}
// Read
var result = key ? undefined : {},
// To prevent the for loop in the first place assign an empty array
// in case there are no cookies at all. Also prevents odd result when
// calling "get()".
cookies = document.cookie ? document.cookie.split('; ') : [],
i = 0,
l = cookies.length;
for (; i < l; i++) {
var parts = cookies[i].split('='),
name = decode(parts.shift()),
cookie = parts.join('=');
if (key === name) {
// If second argument (value) is a function it's a converter...
result = read(cookie, value);
break;
}
// Prevent storing a cookie that we couldn't decode.
if (!key && (cookie = read(cookie)) !== undefined) {
result[name] = cookie;
}
}
return result;
};
api.get = api.set = api;
api.defaults = {};
api.remove = function (key, options) {
// Must not alter options, thus extending a fresh object...
api(key, '', extend(options, { expires: -1 }));
return !api(key);
};
if ( $ ) {
$.cookie = api;
$.removeCookie = api.remove;
}
return api;
}));
@@ -0,0 +1,152 @@
/*!
* jquery.customSelect() - v0.5.1
* http://adam.co/lab/jquery/customselect/
* 2014-03-19
*
* Copyright 2013 Adam Coulombe
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @license http://www.gnu.org/licenses/gpl.html GPL2 License
*/
(function ($) {
'use strict';
$.fn.extend({
customSelect: function (options) {
// filter out <= IE6
if (typeof document.body.style.maxHeight === 'undefined') {
return this;
}
var defaults = {
customClass: 'customSelect',
mapClass: true,
mapStyle: true
},
options = $.extend(defaults, options),
prefix = options.customClass,
changed = function ($select,customSelectSpan) {
var currentSelected = $select.find(':selected'),
customSelectSpanInner = customSelectSpan.children(':first'),
html = currentSelected.html() || '&nbsp;';
customSelectSpanInner.html(html);
if (currentSelected.attr('disabled')) {
customSelectSpan.addClass(getClass('DisabledOption'));
} else {
customSelectSpan.removeClass(getClass('DisabledOption'));
}
setTimeout(function () {
customSelectSpan.removeClass(getClass('Open'));
$(document).off('mouseup.customSelect');
}, 60);
},
getClass = function(suffix){
return prefix + suffix;
};
return this.each(function () {
var $select = $(this),
customSelectInnerSpan = $('<span />').addClass(getClass('Inner')),
customSelectSpan = $('<span />');
$select.after(customSelectSpan.append(customSelectInnerSpan));
customSelectSpan.addClass(prefix);
if (options.mapClass) {
customSelectSpan.addClass($select.attr('class'));
}
if (options.mapStyle) {
customSelectSpan.attr('style', $select.attr('style'));
}
$select
.addClass('hasCustomSelect')
.on('render.customSelect', function () {
changed($select,customSelectSpan);
$select.css('width','');
var selectBoxWidth = parseInt($select.outerWidth(), 10) -
(parseInt(customSelectSpan.outerWidth(), 10) -
parseInt(customSelectSpan.width(), 10));
// Set to inline-block before calculating outerHeight
customSelectSpan.css({
display: 'inline-block'
});
var selectBoxHeight = customSelectSpan.outerHeight();
if ($select.attr('disabled')) {
customSelectSpan.addClass(getClass('Disabled'));
} else {
customSelectSpan.removeClass(getClass('Disabled'));
}
customSelectInnerSpan.css({
display: 'inline-block'
});
$select.css({
'-webkit-appearance': 'menulist-button',
width: customSelectSpan.outerWidth(),
position: 'absolute',
opacity: 0,
height: selectBoxHeight,
fontSize: customSelectSpan.css('font-size')
});
})
.on('change.customSelect', function () {
customSelectSpan.addClass(getClass('Changed'));
changed($select,customSelectSpan);
})
.on('keyup.customSelect', function (e) {
if(!customSelectSpan.hasClass(getClass('Open'))){
$select.trigger('blur.customSelect');
$select.trigger('focus.customSelect');
}else{
if(e.which==13||e.which==27){
changed($select,customSelectSpan);
}
}
})
.on('mousedown.customSelect', function () {
customSelectSpan.removeClass(getClass('Changed'));
})
.on('mouseup.customSelect', function (e) {
if( !customSelectSpan.hasClass(getClass('Open'))){
// if FF and there are other selects open, just apply focus
if($('.'+getClass('Open')).not(customSelectSpan).length>0 && typeof InstallTrigger !== 'undefined'){
$select.trigger('focus.customSelect');
}else{
customSelectSpan.addClass(getClass('Open'));
e.stopPropagation();
$(document).one('mouseup.customSelect', function (e) {
if( e.target != $select.get(0) && $.inArray(e.target,$select.find('*').get()) < 0 ){
$select.trigger('blur.customSelect');
}else{
changed($select,customSelectSpan);
}
});
}
}
})
.on('focus.customSelect', function () {
customSelectSpan.removeClass(getClass('Changed')).addClass(getClass('Focus'));
})
.on('blur.customSelect', function () {
customSelectSpan.removeClass(getClass('Focus')+' '+getClass('Open'));
})
.on('mouseenter.customSelect', function () {
customSelectSpan.addClass(getClass('Hover'));
})
.on('mouseleave.customSelect', function () {
customSelectSpan.removeClass(getClass('Hover'));
})
.trigger('render.customSelect');
});
}
});
})(jQuery);
@@ -0,0 +1,87 @@
/*jshint browser:true */
/*!
* FitVids 1.1
*
* Copyright 2013, Chris Coyier - http://css-tricks.com + Dave Rupert - http://daverupert.com
* Credit to Thierry Koblentz - http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/
* Released under the WTFPL license - http://sam.zoy.org/wtfpl/
*
*/
;(function( $ ){
'use strict';
$.fn.fitVids = function( options ) {
var settings = {
customSelector: null,
ignore: null
};
if(!document.getElementById('fit-vids-style')) {
// appendStyles: https://github.com/toddmotto/fluidvids/blob/master/dist/fluidvids.js
var head = document.head || document.getElementsByTagName('head')[0];
var css = '.fluid-width-video-wrapper{width:100%;position:relative;padding:0;}.fluid-width-video-wrapper iframe,.fluid-width-video-wrapper object,.fluid-width-video-wrapper embed {position:absolute;top:0;left:0;width:100%;height:100%;}';
var div = document.createElement("div");
div.innerHTML = '<p>x</p><style id="fit-vids-style">' + css + '</style>';
head.appendChild(div.childNodes[1]);
}
if ( options ) {
$.extend( settings, options );
}
return this.each(function(){
var selectors = [
'iframe[src*="player.vimeo.com"]',
'iframe[src*="youtube.com"]',
'iframe[src*="youtube-nocookie.com"]',
'iframe[src*="kickstarter.com"][src*="video.html"]',
'object',
'embed'
];
if (settings.customSelector) {
selectors.push(settings.customSelector);
}
var ignoreList = '.fitvidsignore';
if(settings.ignore) {
ignoreList = ignoreList + ', ' + settings.ignore;
}
var $allVideos = $(this).find(selectors.join(','));
$allVideos = $allVideos.not('object object'); // SwfObj conflict patch
$allVideos = $allVideos.not(ignoreList); // Disable FitVids on this video.
$allVideos.each(function(){
var $this = $(this);
if($this.parents(ignoreList).length > 0) {
return; // Disable FitVids on this video.
}
if (this.tagName.toLowerCase() === 'embed' && $this.parent('object').length || $this.parent('.fluid-width-video-wrapper').length) { return; }
if ((!$this.css('height') && !$this.css('width')) && (isNaN($this.attr('height')) || isNaN($this.attr('width'))))
{
$this.attr('height', 9);
$this.attr('width', 16);
}
var height = ( this.tagName.toLowerCase() === 'object' || ($this.attr('height') && !isNaN(parseInt($this.attr('height'), 10))) ) ? parseInt($this.attr('height'), 10) : $this.height(),
width = !isNaN(parseInt($this.attr('width'), 10)) ? parseInt($this.attr('width'), 10) : $this.width(),
aspectRatio = height / width;
if(!$this.attr('name')){
var videoName = 'fitvid' + $.fn.fitVids._count;
$this.attr('name', videoName);
$.fn.fitVids._count++;
}
$this.wrap('<div class="fluid-width-video-wrapper"></div>').parent('.fluid-width-video-wrapper').css('padding-top', (aspectRatio * 100)+'%');
$this.removeAttr('height').removeAttr('width');
});
});
};
// Internal counter for unique video names.
$.fn.fitVids._count = 0;
// Works with either jQuery or Zepto
})( window.jQuery || window.Zepto );
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,388 @@
/**
* jquery-match-height 0.7.2 by @liabru
* http://brm.io/jquery-match-height/
* License: MIT
*/
;(function(factory) { // eslint-disable-line no-extra-semi
'use strict';
if (typeof define === 'function' && define.amd) {
// AMD
define(['jquery'], factory);
} else if (typeof module !== 'undefined' && module.exports) {
// CommonJS
module.exports = factory(require('jquery'));
} else {
// Global
factory(jQuery);
}
})(function($) {
/*
* internal
*/
var _previousResizeWidth = -1,
_updateTimeout = -1;
/*
* _parse
* value parse utility function
*/
var _parse = function(value) {
// parse value and convert NaN to 0
return parseFloat(value) || 0;
};
/*
* _rows
* utility function returns array of jQuery selections representing each row
* (as displayed after float wrapping applied by browser)
*/
var _rows = function(elements) {
var tolerance = 1,
$elements = $(elements),
lastTop = null,
rows = [];
// group elements by their top position
$elements.each(function(){
var $that = $(this),
top = $that.offset().top - _parse($that.css('margin-top')),
lastRow = rows.length > 0 ? rows[rows.length - 1] : null;
if (lastRow === null) {
// first item on the row, so just push it
rows.push($that);
} else {
// if the row top is the same, add to the row group
if (Math.floor(Math.abs(lastTop - top)) <= tolerance) {
rows[rows.length - 1] = lastRow.add($that);
} else {
// otherwise start a new row group
rows.push($that);
}
}
// keep track of the last row top
lastTop = top;
});
return rows;
};
/*
* _parseOptions
* handle plugin options
*/
var _parseOptions = function(options) {
var opts = {
byRow: true,
property: 'height',
target: null,
remove: false
};
if (typeof options === 'object') {
return $.extend(opts, options);
}
if (typeof options === 'boolean') {
opts.byRow = options;
} else if (options === 'remove') {
opts.remove = true;
}
return opts;
};
/*
* matchHeight
* plugin definition
*/
var matchHeight = $.fn.matchHeight = function(options) {
var opts = _parseOptions(options);
// handle remove
if (opts.remove) {
var that = this;
// remove fixed height from all selected elements
this.css(opts.property, '');
// remove selected elements from all groups
$.each(matchHeight._groups, function(key, group) {
group.elements = group.elements.not(that);
});
// TODO: cleanup empty groups
return this;
}
if (this.length <= 1 && !opts.target) {
return this;
}
// keep track of this group so we can re-apply later on load and resize events
matchHeight._groups.push({
elements: this,
options: opts
});
// match each element's height to the tallest element in the selection
matchHeight._apply(this, opts);
return this;
};
/*
* plugin global options
*/
matchHeight.version = '0.7.2';
matchHeight._groups = [];
matchHeight._throttle = 80;
matchHeight._maintainScroll = false;
matchHeight._beforeUpdate = null;
matchHeight._afterUpdate = null;
matchHeight._rows = _rows;
matchHeight._parse = _parse;
matchHeight._parseOptions = _parseOptions;
/*
* matchHeight._apply
* apply matchHeight to given elements
*/
matchHeight._apply = function(elements, options) {
var opts = _parseOptions(options),
$elements = $(elements),
rows = [$elements];
// take note of scroll position
var scrollTop = $(window).scrollTop(),
htmlHeight = $('html').outerHeight(true);
// get hidden parents
var $hiddenParents = $elements.parents().filter(':hidden');
// cache the original inline style
$hiddenParents.each(function() {
var $that = $(this);
$that.data('style-cache', $that.attr('style'));
});
// temporarily must force hidden parents visible
$hiddenParents.css('display', 'block');
// get rows if using byRow, otherwise assume one row
if (opts.byRow && !opts.target) {
// must first force an arbitrary equal height so floating elements break evenly
$elements.each(function() {
var $that = $(this),
display = $that.css('display');
// temporarily force a usable display value
if (display !== 'inline-block' && display !== 'flex' && display !== 'inline-flex') {
display = 'block';
}
// cache the original inline style
$that.data('style-cache', $that.attr('style'));
$that.css({
'display': display,
'padding-top': '0',
'padding-bottom': '0',
'margin-top': '0',
'margin-bottom': '0',
'border-top-width': '0',
'border-bottom-width': '0',
'height': '100px',
'overflow': 'hidden'
});
});
// get the array of rows (based on element top position)
rows = _rows($elements);
// revert original inline styles
$elements.each(function() {
var $that = $(this);
$that.attr('style', $that.data('style-cache') || '');
});
}
$.each(rows, function(key, row) {
var $row = $(row),
targetHeight = 0;
if (!opts.target) {
// skip apply to rows with only one item
if (opts.byRow && $row.length <= 1) {
$row.css(opts.property, '');
return;
}
// iterate the row and find the max height
$row.each(function(){
var $that = $(this),
style = $that.attr('style'),
display = $that.css('display');
// temporarily force a usable display value
if (display !== 'inline-block' && display !== 'flex' && display !== 'inline-flex') {
display = 'block';
}
// ensure we get the correct actual height (and not a previously set height value)
var css = { 'display': display };
css[opts.property] = '';
$that.css(css);
// find the max height (including padding, but not margin)
if ($that.outerHeight(false) > targetHeight) {
targetHeight = $that.outerHeight(false);
}
// revert styles
if (style) {
$that.attr('style', style);
} else {
$that.css('display', '');
}
});
} else {
// if target set, use the height of the target element
targetHeight = opts.target.outerHeight(false);
}
// iterate the row and apply the height to all elements
$row.each(function(){
var $that = $(this),
verticalPadding = 0;
// don't apply to a target
if (opts.target && $that.is(opts.target)) {
return;
}
// handle padding and border correctly (required when not using border-box)
if ($that.css('box-sizing') !== 'border-box') {
verticalPadding += _parse($that.css('border-top-width')) + _parse($that.css('border-bottom-width'));
verticalPadding += _parse($that.css('padding-top')) + _parse($that.css('padding-bottom'));
}
// set the height (accounting for padding and border)
$that.css(opts.property, (targetHeight - verticalPadding) + 'px');
});
});
// revert hidden parents
$hiddenParents.each(function() {
var $that = $(this);
$that.attr('style', $that.data('style-cache') || null);
});
// restore scroll position if enabled
if (matchHeight._maintainScroll) {
$(window).scrollTop((scrollTop / htmlHeight) * $('html').outerHeight(true));
}
return this;
};
/*
* matchHeight._applyDataApi
* applies matchHeight to all elements with a data-match-height attribute
*/
matchHeight._applyDataApi = function() {
var groups = {};
// generate groups by their groupId set by elements using data-match-height
$('[data-match-height], [data-mh]').each(function() {
var $this = $(this),
groupId = $this.attr('data-mh') || $this.attr('data-match-height');
if (groupId in groups) {
groups[groupId] = groups[groupId].add($this);
} else {
groups[groupId] = $this;
}
});
// apply matchHeight to each group
$.each(groups, function() {
this.matchHeight(true);
});
};
/*
* matchHeight._update
* updates matchHeight on all current groups with their correct options
*/
var _update = function(event) {
if (matchHeight._beforeUpdate) {
matchHeight._beforeUpdate(event, matchHeight._groups);
}
$.each(matchHeight._groups, function() {
matchHeight._apply(this.elements, this.options);
});
if (matchHeight._afterUpdate) {
matchHeight._afterUpdate(event, matchHeight._groups);
}
};
matchHeight._update = function(throttle, event) {
// prevent update if fired from a resize event
// where the viewport width hasn't actually changed
// fixes an event looping bug in IE8
if (event && event.type === 'resize') {
var windowWidth = $(window).width();
if (windowWidth === _previousResizeWidth) {
return;
}
_previousResizeWidth = windowWidth;
}
// throttle updates
if (!throttle) {
_update(event);
} else if (_updateTimeout === -1) {
_updateTimeout = setTimeout(function() {
_update(event);
_updateTimeout = -1;
}, matchHeight._throttle);
}
};
/*
* bind events
*/
// apply on DOM ready event
$(matchHeight._applyDataApi);
// use on or bind where supported
var on = $.fn.on ? 'on' : 'bind';
// update heights on load and resize events
$(window)[on]('load', function(event) {
matchHeight._update(false, event);
});
// throttled update heights on resize events
$(window)[on]('resize orientationchange', function(event) {
matchHeight._update(true, event);
});
});
@@ -0,0 +1,579 @@
/*! sidr - v2.2.1 - 2016-02-17
* http://www.berriart.com/sidr/
* Copyright (c) 2013-2016 Alberto Varela; Licensed MIT */
(function () {
'use strict';
var babelHelpers = {};
babelHelpers.classCallCheck = function (instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
};
babelHelpers.createClass = function () {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function (Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
}();
babelHelpers;
var sidrStatus = {
moving: false,
opened: false
};
var helper = {
// Check for valids urls
// From : http://stackoverflow.com/questions/5717093/check-if-a-javascript-string-is-an-url
isUrl: function isUrl(str) {
var pattern = new RegExp('^(https?:\\/\\/)?' + // protocol
'((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.?)+[a-z]{2,}|' + // domain name
'((\\d{1,3}\\.){3}\\d{1,3}))' + // OR ip (v4) address
'(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*' + // port and path
'(\\?[;&a-z\\d%_.~+=-]*)?' + // query string
'(\\#[-a-z\\d_]*)?$', 'i'); // fragment locator
if (pattern.test(str)) {
return true;
} else {
return false;
}
},
// Add sidr prefixes
addPrefixes: function addPrefixes($element) {
this.addPrefix($element, 'id');
this.addPrefix($element, 'class');
$element.removeAttr('style');
},
addPrefix: function addPrefix($element, attribute) {
var toReplace = $element.attr(attribute);
if (typeof toReplace === 'string' && toReplace !== '' && toReplace !== 'sidr-inner') {
$element.attr(attribute, toReplace.replace(/([A-Za-z0-9_.\-]+)/g, 'sidr-' + attribute + '-$1'));
}
},
// Check if transitions is supported
transitions: function () {
var body = document.body || document.documentElement,
style = body.style,
supported = false,
property = 'transition';
if (property in style) {
supported = true;
} else {
(function () {
var prefixes = ['moz', 'webkit', 'o', 'ms'],
prefix = undefined,
i = undefined;
property = property.charAt(0).toUpperCase() + property.substr(1);
supported = function () {
for (i = 0; i < prefixes.length; i++) {
prefix = prefixes[i];
if (prefix + property in style) {
return true;
}
}
return false;
}();
property = supported ? '-' + prefix.toLowerCase() + '-' + property.toLowerCase() : null;
})();
}
return {
supported: supported,
property: property
};
}()
};
var $$2 = jQuery;
var bodyAnimationClass = 'sidr-animating';
var openAction = 'open';
var closeAction = 'close';
var transitionEndEvent = 'webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend';
var Menu = function () {
function Menu(name) {
babelHelpers.classCallCheck(this, Menu);
this.name = name;
this.item = $$2('#' + name);
this.openClass = name === 'sidr' ? 'sidr-open' : 'sidr-open ' + name + '-open';
this.menuWidth = this.item.outerWidth(true);
this.speed = this.item.data('speed');
this.side = this.item.data('side');
this.displace = this.item.data('displace');
this.timing = this.item.data('timing');
this.method = this.item.data('method');
this.onOpenCallback = this.item.data('onOpen');
this.onCloseCallback = this.item.data('onClose');
this.onOpenEndCallback = this.item.data('onOpenEnd');
this.onCloseEndCallback = this.item.data('onCloseEnd');
this.body = $$2(this.item.data('body'));
}
babelHelpers.createClass(Menu, [{
key: 'getAnimation',
value: function getAnimation(action, element) {
var animation = {},
prop = this.side;
if (action === 'open' && element === 'body') {
animation[prop] = this.menuWidth + 'px';
} else if (action === 'close' && element === 'menu') {
animation[prop] = '-' + this.menuWidth + 'px';
} else {
animation[prop] = 0;
}
return animation;
}
}, {
key: 'prepareBody',
value: function prepareBody(action) {
var prop = action === 'open' ? 'hidden' : '';
// Prepare page if container is body
if (this.body.is('body')) {
var $html = $$2('html'),
scrollTop = $html.scrollTop();
$html.css('overflow-x', prop).scrollTop(scrollTop);
}
}
}, {
key: 'openBody',
value: function openBody() {
if (this.displace) {
var transitions = helper.transitions,
$body = this.body;
if (transitions.supported) {
$body.css(transitions.property, this.side + ' ' + this.speed / 1000 + 's ' + this.timing).css(this.side, 0).css({
width: $body.width(),
position: 'absolute'
});
$body.css(this.side, this.menuWidth + 'px');
} else {
var bodyAnimation = this.getAnimation(openAction, 'body');
$body.css({
width: $body.width(),
position: 'absolute'
}).animate(bodyAnimation, {
queue: false,
duration: this.speed
});
}
}
}
}, {
key: 'onCloseBody',
value: function onCloseBody() {
var transitions = helper.transitions,
resetStyles = {
width: '',
position: '',
right: '',
left: ''
};
if (transitions.supported) {
resetStyles[transitions.property] = '';
}
this.body.css(resetStyles).unbind(transitionEndEvent);
}
}, {
key: 'closeBody',
value: function closeBody() {
var _this = this;
if (this.displace) {
if (helper.transitions.supported) {
this.body.css(this.side, 0).one(transitionEndEvent, function () {
_this.onCloseBody();
});
} else {
var bodyAnimation = this.getAnimation(closeAction, 'body');
this.body.animate(bodyAnimation, {
queue: false,
duration: this.speed,
complete: function complete() {
_this.onCloseBody();
}
});
}
}
}
}, {
key: 'moveBody',
value: function moveBody(action) {
if (action === openAction) {
this.openBody();
} else {
this.closeBody();
}
}
}, {
key: 'onOpenMenu',
value: function onOpenMenu(callback) {
var name = this.name;
sidrStatus.moving = false;
sidrStatus.opened = name;
this.item.unbind(transitionEndEvent);
this.body.removeClass(bodyAnimationClass).addClass(this.openClass);
this.onOpenEndCallback();
if (typeof callback === 'function') {
callback(name);
}
}
}, {
key: 'openMenu',
value: function openMenu(callback) {
var _this2 = this;
var $item = this.item;
if (helper.transitions.supported) {
$item.css(this.side, 0).one(transitionEndEvent, function () {
_this2.onOpenMenu(callback);
});
} else {
var menuAnimation = this.getAnimation(openAction, 'menu');
$item.css('display', 'block').animate(menuAnimation, {
queue: false,
duration: this.speed,
complete: function complete() {
_this2.onOpenMenu(callback);
}
});
}
}
}, {
key: 'onCloseMenu',
value: function onCloseMenu(callback) {
this.item.css({
left: '',
right: ''
}).unbind(transitionEndEvent);
$$2('html').css('overflow-x', '');
sidrStatus.moving = false;
sidrStatus.opened = false;
this.body.removeClass(bodyAnimationClass).removeClass(this.openClass);
this.onCloseEndCallback();
// Callback
if (typeof callback === 'function') {
callback(name);
}
}
}, {
key: 'closeMenu',
value: function closeMenu(callback) {
var _this3 = this;
var item = this.item;
if (helper.transitions.supported) {
item.css(this.side, '').one(transitionEndEvent, function () {
_this3.onCloseMenu(callback);
});
} else {
var menuAnimation = this.getAnimation(closeAction, 'menu');
item.animate(menuAnimation, {
queue: false,
duration: this.speed,
complete: function complete() {
_this3.onCloseMenu();
}
});
}
}
}, {
key: 'moveMenu',
value: function moveMenu(action, callback) {
this.body.addClass(bodyAnimationClass);
if (action === openAction) {
this.openMenu(callback);
} else {
this.closeMenu(callback);
}
}
}, {
key: 'move',
value: function move(action, callback) {
// Lock sidr
sidrStatus.moving = true;
this.prepareBody(action);
this.moveBody(action);
this.moveMenu(action, callback);
}
}, {
key: 'open',
value: function open(callback) {
var _this4 = this;
// Check if is already opened or moving
if (sidrStatus.opened === this.name || sidrStatus.moving) {
return;
}
// If another menu opened close first
if (sidrStatus.opened !== false) {
var alreadyOpenedMenu = new Menu(sidrStatus.opened);
alreadyOpenedMenu.close(function () {
_this4.open(callback);
});
return;
}
this.move('open', callback);
// onOpen callback
this.onOpenCallback();
}
}, {
key: 'close',
value: function close(callback) {
// Check if is already closed or moving
if (sidrStatus.opened !== this.name || sidrStatus.moving) {
return;
}
this.move('close', callback);
// onClose callback
this.onCloseCallback();
}
}, {
key: 'toggle',
value: function toggle(callback) {
if (sidrStatus.opened === this.name) {
this.close(callback);
} else {
this.open(callback);
}
}
}]);
return Menu;
}();
var $$1 = jQuery;
function execute(action, name, callback) {
var sidr = new Menu(name);
switch (action) {
case 'open':
sidr.open(callback);
break;
case 'close':
sidr.close(callback);
break;
case 'toggle':
sidr.toggle(callback);
break;
default:
$$1.error('Method ' + action + ' does not exist on jQuery.sidr');
break;
}
}
var i;
var $ = jQuery;
var publicMethods = ['open', 'close', 'toggle'];
var methodName;
var methods = {};
var getMethod = function getMethod(methodName) {
return function (name, callback) {
// Check arguments
if (typeof name === 'function') {
callback = name;
name = 'sidr';
} else if (!name) {
name = 'sidr';
}
execute(methodName, name, callback);
};
};
for (i = 0; i < publicMethods.length; i++) {
methodName = publicMethods[i];
methods[methodName] = getMethod(methodName);
}
function sidr(method) {
if (method === 'status') {
return sidrStatus;
} else if (methods[method]) {
return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
} else if (typeof method === 'function' || typeof method === 'string' || !method) {
return methods.toggle.apply(this, arguments);
} else {
$.error('Method ' + method + ' does not exist on jQuery.sidr');
}
}
var $$3 = jQuery;
function fillContent($sideMenu, settings) {
// The menu content
if (typeof settings.source === 'function') {
var newContent = settings.source(name);
$sideMenu.html(newContent);
} else if (typeof settings.source === 'string' && helper.isUrl(settings.source)) {
$$3.get(settings.source, function (data) {
$sideMenu.html(data);
});
} else if (typeof settings.source === 'string') {
var htmlContent = '',
selectors = settings.source.split(',');
$$3.each(selectors, function (index, element) {
htmlContent += '<div class="sidr-inner">' + $$3(element).html() + '</div>';
});
// Renaming ids and classes
if (settings.renaming) {
var $htmlContent = $$3('<div />').html(htmlContent);
$htmlContent.find('*').each(function (index, element) {
var $element = $$3(element);
helper.addPrefixes($element);
});
htmlContent = $htmlContent.html();
}
$sideMenu.html(htmlContent);
} else if (settings.source !== null) {
$$3.error('Invalid Sidr Source');
}
return $sideMenu;
}
function fnSidr(options) {
var transitions = helper.transitions,
settings = $$3.extend({
name: 'sidr', // Name for the 'sidr'
speed: 200, // Accepts standard jQuery effects speeds (i.e. fast, normal or milliseconds)
side: 'left', // Accepts 'left' or 'right'
source: null, // Override the source of the content.
renaming: true, // The ids and classes will be prepended with a prefix when loading existent content
body: 'body', // Page container selector,
displace: true, // Displace the body content or not
timing: 'ease', // Timing function for CSS transitions
method: 'toggle', // The method to call when element is clicked
bind: 'touchstart click', // The event(s) to trigger the menu
onOpen: function onOpen() {},
// Callback when sidr start opening
onClose: function onClose() {},
// Callback when sidr start closing
onOpenEnd: function onOpenEnd() {},
// Callback when sidr end opening
onCloseEnd: function onCloseEnd() {} // Callback when sidr end closing
}, options),
name = settings.name,
$sideMenu = $$3('#' + name);
// If the side menu do not exist create it
if ($sideMenu.length === 0) {
$sideMenu = $$3('<div />').attr('id', name).insertAfter($$3('#site-header'));
}
// Add transition to menu if are supported
if (transitions.supported) {
$sideMenu.css(transitions.property, settings.side + ' ' + settings.speed / 1000 + 's ' + settings.timing);
}
// Adding styles and options
$sideMenu.addClass('sidr').addClass(settings.side).data({
speed: settings.speed,
side: settings.side,
body: settings.body,
displace: settings.displace,
timing: settings.timing,
method: settings.method,
onOpen: settings.onOpen,
onClose: settings.onClose,
onOpenEnd: settings.onOpenEnd,
onCloseEnd: settings.onCloseEnd
});
$sideMenu = fillContent($sideMenu, settings);
return this.each(function () {
var $this = $$3(this),
data = $this.data('sidr'),
flag = false;
// If the plugin hasn't been initialized yet
if (!data) {
sidrStatus.moving = false;
sidrStatus.opened = false;
$this.data('sidr', name);
$this.bind(settings.bind, function (event) {
event.preventDefault();
if (!flag) {
flag = true;
sidr(settings.method, name);
setTimeout(function () {
flag = false;
}, 100);
}
});
}
});
}
jQuery.sidr = sidr;
jQuery.fn.sidr = fnSidr;
}());
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,788 @@
//
// SmoothScroll for websites v1.4.9 (Balazs Galambosi)
// http://www.smoothscroll.net/
//
// Licensed under the terms of the MIT license.
//
// You may use it in your theme if you credit me.
// It is also free to use on any individual website.
//
// Exception:
// The only restriction is to not publish any
// extension for browsers or native application
// without getting a written permission first.
//
(function () {
// Scroll Variables (tweakable)
var defaultOptions = {
// Scrolling Core
frameRate : 150, // [Hz]
animationTime : 400, // [ms]
stepSize : 100, // [px]
// Pulse (less tweakable)
// ratio of "tail" to "acceleration"
pulseAlgorithm : true,
pulseScale : 4,
pulseNormalize : 1,
// Acceleration
accelerationDelta : 50, // 50
accelerationMax : 3, // 3
// Keyboard Settings
keyboardSupport : true, // option
arrowScroll : 50, // [px]
// Other
fixedBackground : true,
excluded : ''
};
var options = defaultOptions;
// Other Variables
var isExcluded = false;
var isFrame = false;
var direction = { x: 0, y: 0 };
var initDone = false;
var root = document.documentElement;
var activeElement;
var observer;
var refreshSize;
var deltaBuffer = [];
var deltaBufferTimer;
var isMac = /^Mac/.test(navigator.platform);
var key = { left: 37, up: 38, right: 39, down: 40, spacebar: 32,
pageup: 33, pagedown: 34, end: 35, home: 36 };
var arrowKeys = { 37: 1, 38: 1, 39: 1, 40: 1 };
/***********************************************
* INITIALIZE
***********************************************/
/**
* Tests if smooth scrolling is allowed. Shuts down everything if not.
*/
function initTest() {
if (options.keyboardSupport) {
addEvent('keydown', keydown);
}
}
/**
* Sets up scrolls array, determines if frames are involved.
*/
function init() {
if (initDone || !document.body) return;
initDone = true;
var body = document.body;
var html = document.documentElement;
var windowHeight = window.innerHeight;
var scrollHeight = body.scrollHeight;
// check compat mode for root element
root = (document.compatMode.indexOf('CSS') >= 0) ? html : body;
activeElement = body;
initTest();
// Checks if this script is running in a frame
if (top != self) {
isFrame = true;
}
/**
* Safari 10 fixed it, Chrome fixed it in v45:
* This fixes a bug where the areas left and right to
* the content does not trigger the onmousewheel event
* on some pages. e.g.: html, body { height: 100% }
*/
else if (isOldSafari &&
scrollHeight > windowHeight &&
(body.offsetHeight <= windowHeight ||
html.offsetHeight <= windowHeight)) {
var fullPageElem = document.createElement('div');
fullPageElem.style.cssText = 'position:absolute; z-index:-10000; ' +
'top:0; left:0; right:0; height:' +
root.scrollHeight + 'px';
document.body.appendChild(fullPageElem);
// DOM changed (throttled) to fix height
var pendingRefresh;
refreshSize = function () {
if (pendingRefresh) return; // could also be: clearTimeout(pendingRefresh);
pendingRefresh = setTimeout(function () {
if (isExcluded) return; // could be running after cleanup
fullPageElem.style.height = '0';
fullPageElem.style.height = root.scrollHeight + 'px';
pendingRefresh = null;
}, 500); // act rarely to stay fast
};
setTimeout(refreshSize, 10);
addEvent('resize', refreshSize);
// TODO: attributeFilter?
var config = {
attributes: true,
childList: true,
characterData: false
// subtree: true
};
observer = new MutationObserver(refreshSize);
observer.observe(body, config);
if (root.offsetHeight <= windowHeight) {
var clearfix = document.createElement('div');
clearfix.style.clear = 'both';
body.appendChild(clearfix);
}
}
// disable fixed background
if (!options.fixedBackground && !isExcluded) {
body.style.backgroundAttachment = 'scroll';
html.style.backgroundAttachment = 'scroll';
}
}
/**
* Removes event listeners and other traces left on the page.
*/
function cleanup() {
observer && observer.disconnect();
removeEvent(wheelEvent, wheel);
removeEvent('mousedown', mousedown);
removeEvent('keydown', keydown);
removeEvent('resize', refreshSize);
removeEvent('load', init);
}
/************************************************
* SCROLLING
************************************************/
var que = [];
var pending = false;
var lastScroll = Date.now();
/**
* Pushes scroll actions to the scrolling queue.
*/
function scrollArray(elem, left, top) {
directionCheck(left, top);
if (options.accelerationMax != 1) {
var now = Date.now();
var elapsed = now - lastScroll;
if (elapsed < options.accelerationDelta) {
var factor = (1 + (50 / elapsed)) / 2;
if (factor > 1) {
factor = Math.min(factor, options.accelerationMax);
left *= factor;
top *= factor;
}
}
lastScroll = Date.now();
}
// push a scroll command
que.push({
x: left,
y: top,
lastX: (left < 0) ? 0.99 : -0.99,
lastY: (top < 0) ? 0.99 : -0.99,
start: Date.now()
});
// don't act if there's a pending queue
if (pending) {
return;
}
var scrollRoot = getScrollRoot();
var isWindowScroll = (elem === scrollRoot || elem === document.body);
// if we haven't already fixed the behavior,
// and it needs fixing for this sesh
if (elem.$scrollBehavior == null && isScrollBehaviorSmooth(elem)) {
elem.$scrollBehavior = elem.style.scrollBehavior;
elem.style.scrollBehavior = 'auto';
}
var step = function (time) {
var now = Date.now();
var scrollX = 0;
var scrollY = 0;
for (var i = 0; i < que.length; i++) {
var item = que[i];
var elapsed = now - item.start;
var finished = (elapsed >= options.animationTime);
// scroll position: [0, 1]
var position = (finished) ? 1 : elapsed / options.animationTime;
// easing [optional]
if (options.pulseAlgorithm) {
position = pulse(position);
}
// only need the difference
var x = (item.x * position - item.lastX) >> 0;
var y = (item.y * position - item.lastY) >> 0;
// add this to the total scrolling
scrollX += x;
scrollY += y;
// update last values
item.lastX += x;
item.lastY += y;
// delete and step back if it's over
if (finished) {
que.splice(i, 1); i--;
}
}
// scroll left and top
if (isWindowScroll) {
window.scrollBy(scrollX, scrollY);
}
else {
if (scrollX) elem.scrollLeft += scrollX;
if (scrollY) elem.scrollTop += scrollY;
}
// clean up if there's nothing left to do
if (!left && !top) {
que = [];
}
if (que.length) {
requestFrame(step, elem, (1000 / options.frameRate + 1));
} else {
pending = false;
// restore default behavior at the end of scrolling sesh
if (elem.$scrollBehavior != null) {
elem.style.scrollBehavior = elem.$scrollBehavior;
elem.$scrollBehavior = null;
}
}
};
// start a new queue of actions
requestFrame(step, elem, 0);
pending = true;
}
/***********************************************
* EVENTS
***********************************************/
/**
* Mouse wheel handler.
* @param {Object} event
*/
function wheel(event) {
if (!initDone) {
init();
}
var target = event.target;
// leave early if default action is prevented
// or it's a zooming event with CTRL
if (event.defaultPrevented || event.ctrlKey) {
return true;
}
// leave embedded content alone (flash & pdf)
if (isNodeName(activeElement, 'embed') ||
(isNodeName(target, 'embed') && /\.pdf/i.test(target.src)) ||
isNodeName(activeElement, 'object') ||
target.shadowRoot) {
return true;
}
var deltaX = -event.wheelDeltaX || event.deltaX || 0;
var deltaY = -event.wheelDeltaY || event.deltaY || 0;
if (isMac) {
if (event.wheelDeltaX && isDivisible(event.wheelDeltaX, 120)) {
deltaX = -120 * (event.wheelDeltaX / Math.abs(event.wheelDeltaX));
}
if (event.wheelDeltaY && isDivisible(event.wheelDeltaY, 120)) {
deltaY = -120 * (event.wheelDeltaY / Math.abs(event.wheelDeltaY));
}
}
// use wheelDelta if deltaX/Y is not available
if (!deltaX && !deltaY) {
deltaY = -event.wheelDelta || 0;
}
// line based scrolling (Firefox mostly)
if (event.deltaMode === 1) {
deltaX *= 40;
deltaY *= 40;
}
var overflowing = overflowingAncestor(target);
// nothing to do if there's no element that's scrollable
if (!overflowing) {
// except Chrome iframes seem to eat wheel events, which we need to
// propagate up, if the iframe has nothing overflowing to scroll
if (isFrame && isChrome) {
// change target to iframe element itself for the parent frame
Object.defineProperty(event, "target", {value: window.frameElement});
return parent.wheel(event);
}
return true;
}
// check if it's a touchpad scroll that should be ignored
if (isTouchpad(deltaY)) {
return true;
}
// scale by step size
// delta is 120 most of the time
// synaptics seems to send 1 sometimes
if (Math.abs(deltaX) > 1.2) {
deltaX *= options.stepSize / 120;
}
if (Math.abs(deltaY) > 1.2) {
deltaY *= options.stepSize / 120;
}
scrollArray(overflowing, deltaX, deltaY);
event.preventDefault();
scheduleClearCache();
}
/**
* Keydown event handler.
* @param {Object} event
*/
function keydown(event) {
var target = event.target;
var modifier = event.ctrlKey || event.altKey || event.metaKey ||
(event.shiftKey && event.keyCode !== key.spacebar);
// our own tracked active element could've been removed from the DOM
if (!document.body.contains(activeElement)) {
activeElement = document.activeElement;
}
// do nothing if user is editing text
// or using a modifier key (except shift)
// or in a dropdown
// or inside interactive elements
var inputNodeNames = /^(textarea|select|embed|object)$/i;
var buttonTypes = /^(button|submit|radio|checkbox|file|color|image)$/i;
if ( event.defaultPrevented ||
inputNodeNames.test(target.nodeName) ||
isNodeName(target, 'input') && !buttonTypes.test(target.type) ||
isNodeName(activeElement, 'video') ||
isInsideYoutubeVideo(event) ||
target.isContentEditable ||
modifier ) {
return true;
}
// [spacebar] should trigger button press, leave it alone
if ((isNodeName(target, 'button') ||
isNodeName(target, 'input') && buttonTypes.test(target.type)) &&
event.keyCode === key.spacebar) {
return true;
}
// [arrwow keys] on radio buttons should be left alone
if (isNodeName(target, 'input') && target.type == 'radio' &&
arrowKeys[event.keyCode]) {
return true;
}
var shift, x = 0, y = 0;
var overflowing = overflowingAncestor(activeElement);
if (!overflowing) {
// Chrome iframes seem to eat key events, which we need to
// propagate up, if the iframe has nothing overflowing to scroll
return (isFrame && isChrome) ? parent.keydown(event) : true;
}
var clientHeight = overflowing.clientHeight;
if (overflowing == document.body) {
clientHeight = window.innerHeight;
}
switch (event.keyCode) {
case key.up:
y = -options.arrowScroll;
break;
case key.down:
y = options.arrowScroll;
break;
case key.spacebar: // (+ shift)
shift = event.shiftKey ? 1 : -1;
y = -shift * clientHeight * 0.9;
break;
case key.pageup:
y = -clientHeight * 0.9;
break;
case key.pagedown:
y = clientHeight * 0.9;
break;
case key.home:
if (overflowing == document.body && document.scrollingElement)
overflowing = document.scrollingElement;
y = -overflowing.scrollTop;
break;
case key.end:
var scroll = overflowing.scrollHeight - overflowing.scrollTop;
var scrollRemaining = scroll - clientHeight;
y = (scrollRemaining > 0) ? scrollRemaining + 10 : 0;
break;
case key.left:
x = -options.arrowScroll;
break;
case key.right:
x = options.arrowScroll;
break;
default:
return true; // a key we don't care about
}
scrollArray(overflowing, x, y);
event.preventDefault();
scheduleClearCache();
}
/**
* Mousedown event only for updating activeElement
*/
function mousedown(event) {
activeElement = event.target;
}
/***********************************************
* OVERFLOW
***********************************************/
var uniqueID = (function () {
var i = 0;
return function (el) {
return el.uniqueID || (el.uniqueID = i++);
};
})();
var cacheX = {}; // cleared out after a scrolling session
var cacheY = {}; // cleared out after a scrolling session
var clearCacheTimer;
var smoothBehaviorForElement = {};
//setInterval(function () { cache = {}; }, 10 * 1000);
function scheduleClearCache() {
clearTimeout(clearCacheTimer);
clearCacheTimer = setInterval(function () {
cacheX = cacheY = smoothBehaviorForElement = {};
}, 1*1000);
}
function setCache(elems, overflowing, x) {
var cache = x ? cacheX : cacheY;
for (var i = elems.length; i--;)
cache[uniqueID(elems[i])] = overflowing;
return overflowing;
}
function getCache(el, x) {
return (x ? cacheX : cacheY)[uniqueID(el)];
}
// (body) (root)
// | hidden | visible | scroll | auto |
// hidden | no | no | YES | YES |
// visible | no | YES | YES | YES |
// scroll | no | YES | YES | YES |
// auto | no | YES | YES | YES |
function overflowingAncestor(el) {
var elems = [];
var body = document.body;
var rootScrollHeight = root.scrollHeight;
do {
var cached = getCache(el, false);
if (cached) {
return setCache(elems, cached);
}
elems.push(el);
if (rootScrollHeight === el.scrollHeight) {
var topOverflowsNotHidden = overflowNotHidden(root) && overflowNotHidden(body);
var isOverflowCSS = topOverflowsNotHidden || overflowAutoOrScroll(root);
if (isFrame && isContentOverflowing(root) ||
!isFrame && isOverflowCSS) {
return setCache(elems, getScrollRoot());
}
} else if (isContentOverflowing(el) && overflowAutoOrScroll(el)) {
return setCache(elems, el);
}
} while ((el = el.parentElement));
}
function isContentOverflowing(el) {
return (el.clientHeight + 10 < el.scrollHeight);
}
// typically for <body> and <html>
function overflowNotHidden(el) {
var overflow = getComputedStyle(el, '').getPropertyValue('overflow-y');
return (overflow !== 'hidden');
}
// for all other elements
function overflowAutoOrScroll(el) {
var overflow = getComputedStyle(el, '').getPropertyValue('overflow-y');
return (overflow === 'scroll' || overflow === 'auto');
}
// for all other elements
function isScrollBehaviorSmooth(el) {
var id = uniqueID(el);
if (smoothBehaviorForElement[id] == null) {
var scrollBehavior = getComputedStyle(el, '')['scroll-behavior'];
smoothBehaviorForElement[id] = ('smooth' == scrollBehavior);
}
return smoothBehaviorForElement[id];
}
/***********************************************
* HELPERS
***********************************************/
function addEvent(type, fn, arg) {
window.addEventListener(type, fn, arg || false);
}
function removeEvent(type, fn, arg) {
window.removeEventListener(type, fn, arg || false);
}
function isNodeName(el, tag) {
return el && (el.nodeName||'').toLowerCase() === tag.toLowerCase();
}
function directionCheck(x, y) {
x = (x > 0) ? 1 : -1;
y = (y > 0) ? 1 : -1;
if (direction.x !== x || direction.y !== y) {
direction.x = x;
direction.y = y;
que = [];
lastScroll = 0;
}
}
if (window.localStorage && localStorage.SS_deltaBuffer) {
try { // #46 Safari throws in private browsing for localStorage
deltaBuffer = localStorage.SS_deltaBuffer.split(',');
} catch (e) { }
}
function isTouchpad(deltaY) {
if (!deltaY) return;
if (!deltaBuffer.length) {
deltaBuffer = [deltaY, deltaY, deltaY];
}
deltaY = Math.abs(deltaY);
deltaBuffer.push(deltaY);
deltaBuffer.shift();
clearTimeout(deltaBufferTimer);
deltaBufferTimer = setTimeout(function () {
try { // #46 Safari throws in private browsing for localStorage
localStorage.SS_deltaBuffer = deltaBuffer.join(',');
} catch (e) { }
}, 1000);
var dpiScaledWheelDelta = deltaY > 120 && allDeltasDivisableBy(deltaY); // win64
return !allDeltasDivisableBy(120) && !allDeltasDivisableBy(100) && !dpiScaledWheelDelta;
}
function isDivisible(n, divisor) {
return (Math.floor(n / divisor) == n / divisor);
}
function allDeltasDivisableBy(divisor) {
return (isDivisible(deltaBuffer[0], divisor) &&
isDivisible(deltaBuffer[1], divisor) &&
isDivisible(deltaBuffer[2], divisor));
}
function isInsideYoutubeVideo(event) {
var elem = event.target;
var isControl = false;
if (document.URL.indexOf ('www.youtube.com/watch') != -1) {
do {
isControl = (elem.classList &&
elem.classList.contains('html5-video-controls'));
if (isControl) break;
} while ((elem = elem.parentNode));
}
return isControl;
}
var requestFrame = (function () {
return (window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
function (callback, element, delay) {
window.setTimeout(callback, delay || (1000/60));
});
})();
var MutationObserver = (window.MutationObserver ||
window.WebKitMutationObserver ||
window.MozMutationObserver);
var getScrollRoot = (function() {
var SCROLL_ROOT = document.scrollingElement;
return function() {
if (!SCROLL_ROOT) {
var dummy = document.createElement('div');
dummy.style.cssText = 'height:10000px;width:1px;';
document.body.appendChild(dummy);
var bodyScrollTop = document.body.scrollTop;
var docElScrollTop = document.documentElement.scrollTop;
window.scrollBy(0, 3);
if (document.body.scrollTop != bodyScrollTop)
(SCROLL_ROOT = document.body);
else
(SCROLL_ROOT = document.documentElement);
window.scrollBy(0, -3);
document.body.removeChild(dummy);
}
return SCROLL_ROOT;
};
})();
/***********************************************
* PULSE (by Michael Herf)
***********************************************/
/**
* Viscous fluid with a pulse for part and decay for the rest.
* - Applies a fixed force over an interval (a damped acceleration), and
* - Lets the exponential bleed away the velocity over a longer interval
* - Michael Herf, http://stereopsis.com/stopping/
*/
function pulse_(x) {
var val, start, expx;
// test
x = x * options.pulseScale;
if (x < 1) { // acceleartion
val = x - (1 - Math.exp(-x));
} else { // tail
// the previous animation ended here:
start = Math.exp(-1);
// simple viscous drag
x -= 1;
expx = 1 - Math.exp(-x);
val = start + (expx * (1 - start));
}
return val * options.pulseNormalize;
}
function pulse(x) {
if (x >= 1) return 1;
if (x <= 0) return 0;
if (options.pulseNormalize == 1) {
options.pulseNormalize /= pulse_(1);
}
return pulse_(x);
}
/***********************************************
* FIRST RUN
***********************************************/
var userAgent = window.navigator.userAgent;
var isEdge = /Edge/.test(userAgent); // thank you MS
var isChrome = /chrome/i.test(userAgent) && !isEdge;
var isSafari = /safari/i.test(userAgent) && !isEdge;
var isMobile = /mobile/i.test(userAgent);
var isIEWin7 = /Windows NT 6.1/i.test(userAgent) && /rv:11/i.test(userAgent);
var isOldSafari = isSafari && (/Version\/8/i.test(userAgent) || /Version\/9/i.test(userAgent));
var isEnabledForBrowser = (isChrome || isSafari || isIEWin7) && !isMobile;
var supportsPassive = false;
try {
window.addEventListener("test", null, Object.defineProperty({}, 'passive', {
get: function () {
supportsPassive = true;
}
}));
} catch(e) {}
var wheelOpt = supportsPassive ? { passive: false } : false;
var wheelEvent = 'onwheel' in document.createElement('div') ? 'wheel' : 'mousewheel';
if (wheelEvent && isEnabledForBrowser) {
addEvent(wheelEvent, wheel, wheelOpt);
addEvent('mousedown', mousedown);
addEvent('load', init);
}
/***********************************************
* PUBLIC INTERFACE
***********************************************/
function SmoothScroll(optionsToSet) {
for (var key in optionsToSet)
if (defaultOptions.hasOwnProperty(key))
options[key] = optionsToSet[key];
}
SmoothScroll.destroy = cleanup;
if (window.SmoothScrollOptions) // async API
SmoothScroll(window.SmoothScrollOptions);
if (typeof define === 'function' && define.amd)
define(function() {
return SmoothScroll;
});
else if ('object' == typeof exports)
module.exports = SmoothScroll;
else
window.SmoothScroll = SmoothScroll;
})();
@@ -0,0 +1,276 @@
/*
* jQuery Superfish Menu Plugin
* Copyright (c) 2013 Joel Birch
*
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*/
(function ($, w) {
"use strict";
var methods = (function () {
// private properties and methods go here
var c = {
bcClass: 'sf-breadcrumb',
menuClass: 'sf-js-enabled',
anchorClass: 'sf-with-ul',
menuArrowClass: 'sf-arrows'
},
ios = (function () {
var ios = /^(?![\w\W]*Windows Phone)[\w\W]*(iPhone|iPad|iPod)/i.test(navigator.userAgent);
if (ios) {
// tap anywhere on iOS to unfocus a submenu
$('html').css('cursor', 'pointer').on('click', $.noop);
}
return ios;
})(),
wp7 = (function () {
var style = document.documentElement.style;
return ('behavior' in style && 'fill' in style && /iemobile/i.test(navigator.userAgent));
})(),
unprefixedPointerEvents = (function () {
return (!!w.PointerEvent);
})(),
toggleMenuClasses = function ($menu, o, add) {
var classes = c.menuClass,
method;
if (o.cssArrows) {
classes += ' ' + c.menuArrowClass;
}
method = (add) ? 'addClass' : 'removeClass';
$menu[method](classes);
},
setPathToCurrent = function ($menu, o) {
return $menu.find('li.' + o.pathClass).slice(0, o.pathLevels)
.addClass(o.hoverClass + ' ' + c.bcClass)
.filter(function () {
return ($(this).children(o.popUpSelector).hide().show().length);
}).removeClass(o.pathClass);
},
toggleAnchorClass = function ($li, add) {
var method = (add) ? 'addClass' : 'removeClass';
$li.children('a')[method](c.anchorClass);
},
toggleTouchAction = function ($menu) {
var msTouchAction = $menu.css('ms-touch-action');
var touchAction = $menu.css('touch-action');
touchAction = touchAction || msTouchAction;
touchAction = (touchAction === 'pan-y') ? 'auto' : 'pan-y';
$menu.css({
'ms-touch-action': touchAction,
'touch-action': touchAction
});
},
getMenu = function ($el) {
return $el.closest('.' + c.menuClass);
},
getOptions = function ($el) {
return getMenu($el).data('sfOptions');
},
over = function () {
var $this = $(this),
o = getOptions($this);
clearTimeout(o.sfTimer);
$this.siblings().superfish('hide').end().superfish('show');
},
close = function (o) {
o.retainPath = ($.inArray(this[0], o.$path) > -1);
this.superfish('hide');
if (!this.parents('.' + o.hoverClass).length) {
o.onIdle.call(getMenu(this));
if (o.$path.length) {
$.proxy(over, o.$path)();
}
}
},
out = function () {
var $this = $(this),
o = getOptions($this);
if (ios) {
$.proxy(close, $this, o)();
}
else {
clearTimeout(o.sfTimer);
o.sfTimer = setTimeout($.proxy(close, $this, o), o.delay);
}
},
touchHandler = function (e) {
var $this = $(this),
o = getOptions($this),
$ul = $this.siblings(e.data.popUpSelector);
if (o.onHandleTouch.call($ul) === false) {
return this;
}
if ($ul.length > 0 && $ul.is(':hidden')) {
$this.one('click.superfish', false);
if (e.type === 'MSPointerDown' || e.type === 'pointerdown') {
$this.trigger('focus');
} else {
$.proxy(over, $this.parent('li'))();
}
}
},
applyHandlers = function ($menu, o) {
var targets = 'li:has(' + o.popUpSelector + ')';
if ($.fn.hoverIntent && !o.disableHI) {
$menu.hoverIntent(over, out, targets);
}
else {
$menu
.on('mouseenter.superfish', targets, over)
.on('mouseleave.superfish', targets, out);
}
var touchevent = 'MSPointerDown.superfish';
if (unprefixedPointerEvents) {
touchevent = 'pointerdown.superfish';
}
if (!ios) {
touchevent += ' touchend.superfish';
}
if (wp7) {
touchevent += ' mousedown.superfish';
}
$menu
.on('focusin.superfish', 'li', over)
.on('focusout.superfish', 'li', out)
.on(touchevent, 'a', o, touchHandler);
};
return {
// public methods
hide: function (instant) {
if (this.length) {
var $this = this,
o = getOptions($this);
if (!o) {
return this;
}
var not = (o.retainPath === true) ? o.$path : '',
$ul = $this.find('li.' + o.hoverClass).add(this).not(not).removeClass(o.hoverClass).children(o.popUpSelector),
speed = o.speedOut;
if (instant) {
$ul.show();
speed = 0;
}
o.retainPath = false;
if (o.onBeforeHide.call($ul) === false) {
return this;
}
$ul.stop(true, true).animate(o.animationOut, speed, function () {
var $this = $(this);
o.onHide.call($this);
});
}
return this;
},
show: function () {
var o = getOptions(this);
if (!o) {
return this;
}
var $this = this.addClass(o.hoverClass),
$ul = $this.children(o.popUpSelector);
if (o.onBeforeShow.call($ul) === false) {
return this;
}
$ul.stop(true, true).animate(o.animation, o.speed, function () {
o.onShow.call($ul);
});
return this;
},
destroy: function () {
return this.each(function () {
var $this = $(this),
o = $this.data('sfOptions'),
$hasPopUp;
if (!o) {
return false;
}
$hasPopUp = $this.find(o.popUpSelector).parent('li');
clearTimeout(o.sfTimer);
toggleMenuClasses($this, o);
toggleAnchorClass($hasPopUp);
toggleTouchAction($this);
// remove event handlers
$this.off('.superfish').off('.hoverIntent');
// clear animation's inline display style
$hasPopUp.children(o.popUpSelector).attr('style', function (i, style) {
return style.replace(/display[^;]+;?/g, '');
});
// reset 'current' path classes
o.$path.removeClass(o.hoverClass + ' ' + c.bcClass).addClass(o.pathClass);
$this.find('.' + o.hoverClass).removeClass(o.hoverClass);
o.onDestroy.call($this);
$this.removeData('sfOptions');
});
},
init: function (op) {
return this.each(function () {
var $this = $(this);
if ($this.data('sfOptions')) {
return false;
}
var o = $.extend({}, $.fn.superfish.defaults, op),
$hasPopUp = $this.find(o.popUpSelector).parent('li');
o.$path = setPathToCurrent($this, o);
$this.data('sfOptions', o);
toggleMenuClasses($this, o, true);
toggleAnchorClass($hasPopUp, true);
toggleTouchAction($this);
applyHandlers($this, o);
$hasPopUp.not('.' + c.bcClass).superfish('hide', true);
o.onInit.call(this);
});
}
};
})();
$.fn.superfish = function (method, args) {
if (methods[method]) {
return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
}
else if (typeof method === 'object' || ! method) {
return methods.init.apply(this, arguments);
}
else {
return $.error('Method ' + method + ' does not exist on jQuery.fn.superfish');
}
};
$.fn.superfish.defaults = {
popUpSelector: 'ul,.sf-mega', // within menu context
hoverClass: 'sfHover',
pathClass: 'overrideThisToUse',
pathLevels: 1,
delay: 800,
animation: {opacity: 'show'},
animationOut: {opacity: 'hide'},
speed: 'normal',
speedOut: 'fast',
cssArrows: true,
disableHI: false,
onInit: $.noop,
onBeforeShow: $.noop,
onShow: $.noop,
onBeforeHide: $.noop,
onHide: $.noop,
onIdle: $.noop,
onDestroy: $.noop,
onHandleTouch: $.noop
};
})(jQuery, window);
File diff suppressed because one or more lines are too long
@@ -0,0 +1,32 @@
var $j = jQuery.noConflict();
$j( document ).ready( function() {
"use strict";
// Edd display cart
oceanwpEDDCartDetails();
} );
/* ==============================================
Easy Digital Downloads Cart Details
============================================== */
function oceanwpEDDCartDetails() {
"use strict"
/**
* EDD cart information in the header
*/
var cartTotalAmount = $j('.eddmenucart-details.total');
$j('body').on('edd_cart_item_added', function( event, response ) {
$j( '.edd-menu-icon' ).removeClass('edd-cart-empty');
cartTotalAmount.html( response.total );
});
$j('body').on('edd_cart_item_removed', function( event, response ) {
cartTotalAmount.html( response.total );
});
}
@@ -0,0 +1 @@
var $j=jQuery.noConflict();function oceanwpEDDCartDetails(){"use strict";var a=$j(".eddmenucart-details.total");$j("body").on("edd_cart_item_added",function(t,e){$j(".edd-menu-icon").removeClass("edd-cart-empty"),a.html(e.total)}),$j("body").on("edd_cart_item_removed",function(t,e){a.html(e.total)})}$j(document).ready(function(){"use strict";oceanwpEDDCartDetails()});
@@ -0,0 +1,53 @@
var $j = jQuery.noConflict();
$j( document ).ready( function() {
"use strict";
// Edd display cart
oceanwpEddDisplayCart();
} );
/* ==============================================
EddCOMMERCE DISPLAY CART
============================================== */
function oceanwpEddDisplayCart() {
"use strict"
var $overlay = $j( '.owp-cart-overlay' );
$j( 'body' ).on( 'edd_cart_item_added', function() {
$overlay.fadeIn();
$j( 'body' ).addClass( 'show-cart' );
// Close quick view modal if enabled
var qv_modal = $j( '#owp-qv-wrap' ),
qv_content = $j( '#owp-qv-content' );
if ( qv_modal.length ) {
$j( 'html' ).css( {
'overflow': '',
'margin-right': ''
} );
$j( 'html' ).removeClass( 'owp-qv-open' );
qv_modal.fadeOut();
qv_modal.removeClass( 'is-visible' );
setTimeout( function() {
qv_content.html( '' );
}, 600);
}
} );
$overlay.on( 'click', function() {
console.log("clicked");
$j( this ).fadeOut();
$j( 'body' ).removeClass( 'show-cart' );
} );
// Close on resize to avoid conflict
$j( window ).resize( function() {
$overlay.fadeOut();
$j( 'body' ).removeClass( 'show-cart' );
} );
}
@@ -0,0 +1 @@
var $j=jQuery.noConflict();function oceanwpEddDisplayCart(){"use strict";var t=$j(".owp-cart-overlay");$j("body").on("edd_cart_item_added",function(){t.fadeIn(),$j("body").addClass("show-cart");var o=$j("#owp-qv-wrap"),e=$j("#owp-qv-content");o.length&&($j("html").css({overflow:"","margin-right":""}),$j("html").removeClass("owp-qv-open"),o.fadeOut(),o.removeClass("is-visible"),setTimeout(function(){e.html("")},600))}),t.on("click",function(){console.log("clicked"),$j(this).fadeOut(),$j("body").removeClass("show-cart")}),$j(window).resize(function(){t.fadeOut(),$j("body").removeClass("show-cart")})}$j(document).ready(function(){"use strict";oceanwpEddDisplayCart()});
@@ -0,0 +1,326 @@
/**
* @preserve HTML5 Shiv 3.7.3 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
*/
;(function(window, document) {
/*jshint evil:true */
/** version */
var version = '3.7.3';
/** Preset options */
var options = window.html5 || {};
/** Used to skip problem elements */
var reSkip = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i;
/** Not all elements can be cloned in IE **/
var saveClones = /^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i;
/** Detect whether the browser supports default html5 styles */
var supportsHtml5Styles;
/** Name of the expando, to work with multiple documents or to re-shiv one document */
var expando = '_html5shiv';
/** The id for the the documents expando */
var expanID = 0;
/** Cached data for each document */
var expandoData = {};
/** Detect whether the browser supports unknown elements */
var supportsUnknownElements;
(function() {
try {
var a = document.createElement('a');
a.innerHTML = '<xyz></xyz>';
//if the hidden property is implemented we can assume, that the browser supports basic HTML5 Styles
supportsHtml5Styles = ('hidden' in a);
supportsUnknownElements = a.childNodes.length == 1 || (function() {
// assign a false positive if unable to shiv
(document.createElement)('a');
var frag = document.createDocumentFragment();
return (
typeof frag.cloneNode == 'undefined' ||
typeof frag.createDocumentFragment == 'undefined' ||
typeof frag.createElement == 'undefined'
);
}());
} catch(e) {
// assign a false positive if detection fails => unable to shiv
supportsHtml5Styles = true;
supportsUnknownElements = true;
}
}());
/*--------------------------------------------------------------------------*/
/**
* Creates a style sheet with the given CSS text and adds it to the document.
* @private
* @param {Document} ownerDocument The document.
* @param {String} cssText The CSS text.
* @returns {StyleSheet} The style element.
*/
function addStyleSheet(ownerDocument, cssText) {
var p = ownerDocument.createElement('p'),
parent = ownerDocument.getElementsByTagName('head')[0] || ownerDocument.documentElement;
p.innerHTML = 'x<style>' + cssText + '</style>';
return parent.insertBefore(p.lastChild, parent.firstChild);
}
/**
* Returns the value of `html5.elements` as an array.
* @private
* @returns {Array} An array of shived element node names.
*/
function getElements() {
var elements = html5.elements;
return typeof elements == 'string' ? elements.split(' ') : elements;
}
/**
* Extends the built-in list of html5 elements
* @memberOf html5
* @param {String|Array} newElements whitespace separated list or array of new element names to shiv
* @param {Document} ownerDocument The context document.
*/
function addElements(newElements, ownerDocument) {
var elements = html5.elements;
if(typeof elements != 'string'){
elements = elements.join(' ');
}
if(typeof newElements != 'string'){
newElements = newElements.join(' ');
}
html5.elements = elements +' '+ newElements;
shivDocument(ownerDocument);
}
/**
* Returns the data associated to the given document
* @private
* @param {Document} ownerDocument The document.
* @returns {Object} An object of data.
*/
function getExpandoData(ownerDocument) {
var data = expandoData[ownerDocument[expando]];
if (!data) {
data = {};
expanID++;
ownerDocument[expando] = expanID;
expandoData[expanID] = data;
}
return data;
}
/**
* returns a shived element for the given nodeName and document
* @memberOf html5
* @param {String} nodeName name of the element
* @param {Document|DocumentFragment} ownerDocument The context document.
* @returns {Object} The shived element.
*/
function createElement(nodeName, ownerDocument, data){
if (!ownerDocument) {
ownerDocument = document;
}
if(supportsUnknownElements){
return ownerDocument.createElement(nodeName);
}
if (!data) {
data = getExpandoData(ownerDocument);
}
var node;
if (data.cache[nodeName]) {
node = data.cache[nodeName].cloneNode();
} else if (saveClones.test(nodeName)) {
node = (data.cache[nodeName] = data.createElem(nodeName)).cloneNode();
} else {
node = data.createElem(nodeName);
}
// Avoid adding some elements to fragments in IE < 9 because
// * Attributes like `name` or `type` cannot be set/changed once an element
// is inserted into a document/fragment
// * Link elements with `src` attributes that are inaccessible, as with
// a 403 response, will cause the tab/window to crash
// * Script elements appended to fragments will execute when their `src`
// or `text` property is set
return node.canHaveChildren && !reSkip.test(nodeName) && !node.tagUrn ? data.frag.appendChild(node) : node;
}
/**
* returns a shived DocumentFragment for the given document
* @memberOf html5
* @param {Document} ownerDocument The context document.
* @returns {Object} The shived DocumentFragment.
*/
function createDocumentFragment(ownerDocument, data){
if (!ownerDocument) {
ownerDocument = document;
}
if(supportsUnknownElements){
return ownerDocument.createDocumentFragment();
}
data = data || getExpandoData(ownerDocument);
var clone = data.frag.cloneNode(),
i = 0,
elems = getElements(),
l = elems.length;
for(;i<l;i++){
clone.createElement(elems[i]);
}
return clone;
}
/**
* Shivs the `createElement` and `createDocumentFragment` methods of the document.
* @private
* @param {Document|DocumentFragment} ownerDocument The document.
* @param {Object} data of the document.
*/
function shivMethods(ownerDocument, data) {
if (!data.cache) {
data.cache = {};
data.createElem = ownerDocument.createElement;
data.createFrag = ownerDocument.createDocumentFragment;
data.frag = data.createFrag();
}
ownerDocument.createElement = function(nodeName) {
//abort shiv
if (!html5.shivMethods) {
return data.createElem(nodeName);
}
return createElement(nodeName, ownerDocument, data);
};
ownerDocument.createDocumentFragment = Function('h,f', 'return function(){' +
'var n=f.cloneNode(),c=n.createElement;' +
'h.shivMethods&&(' +
// unroll the `createElement` calls
getElements().join().replace(/[\w\-:]+/g, function(nodeName) {
data.createElem(nodeName);
data.frag.createElement(nodeName);
return 'c("' + nodeName + '")';
}) +
');return n}'
)(html5, data.frag);
}
/*--------------------------------------------------------------------------*/
/**
* Shivs the given document.
* @memberOf html5
* @param {Document} ownerDocument The document to shiv.
* @returns {Document} The shived document.
*/
function shivDocument(ownerDocument) {
if (!ownerDocument) {
ownerDocument = document;
}
var data = getExpandoData(ownerDocument);
if (html5.shivCSS && !supportsHtml5Styles && !data.hasCSS) {
data.hasCSS = !!addStyleSheet(ownerDocument,
// corrects block display not defined in IE6/7/8/9
'article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}' +
// adds styling not present in IE6/7/8/9
'mark{background:#FF0;color:#000}' +
// hides non-rendered elements
'template{display:none}'
);
}
if (!supportsUnknownElements) {
shivMethods(ownerDocument, data);
}
return ownerDocument;
}
/*--------------------------------------------------------------------------*/
/**
* The `html5` object is exposed so that more elements can be shived and
* existing shiving can be detected on iframes.
* @type Object
* @example
*
* // options can be changed before the script is included
* html5 = { 'elements': 'mark section', 'shivCSS': false, 'shivMethods': false };
*/
var html5 = {
/**
* An array or space separated string of node names of the elements to shiv.
* @memberOf html5
* @type Array|String
*/
'elements': options.elements || 'abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video',
/**
* current version of html5shiv
*/
'version': version,
/**
* A flag to indicate that the HTML5 style sheet should be inserted.
* @memberOf html5
* @type Boolean
*/
'shivCSS': (options.shivCSS !== false),
/**
* Is equal to true if a browser supports creating unknown/HTML5 elements
* @memberOf html5
* @type boolean
*/
'supportsUnknownElements': supportsUnknownElements,
/**
* A flag to indicate that the document's `createElement` and `createDocumentFragment`
* methods should be overwritten.
* @memberOf html5
* @type Boolean
*/
'shivMethods': (options.shivMethods !== false),
/**
* A string to describe the type of `html5` object ("default" or "default print").
* @memberOf html5
* @type String
*/
'type': 'default',
// shivs the document according to the specified `html5` object options
'shivDocument': shivDocument,
//creates a shived element
createElement: createElement,
//creates a shived documentFragment
createDocumentFragment: createDocumentFragment,
//extends list of elements
addElements: addElements
};
/*--------------------------------------------------------------------------*/
// expose html5
window.html5 = html5;
// shiv the document
shivDocument(document);
if(typeof module == 'object' && module.exports){
module.exports = html5;
}
}(typeof window !== "undefined" ? window : this, document));
@@ -0,0 +1 @@
!function(e,l){var m,s,t=e.html5||{},a=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,o=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,n="_html5shiv",r=0,c={};function d(){var e=f.elements;return"string"==typeof e?e.split(" "):e}function u(e){var t=c[e[n]];return t||(t={},r++,e[n]=r,c[r]=t),t}function h(e,t,n){return t=t||l,s?t.createElement(e):!(r=(n=n||u(t)).cache[e]?n.cache[e].cloneNode():o.test(e)?(n.cache[e]=n.createElem(e)).cloneNode():n.createElem(e)).canHaveChildren||a.test(e)||r.tagUrn?r:n.frag.appendChild(r);var r}function i(e){var t,n,r,a,o,c,i=u(e=e||l);return!f.shivCSS||m||i.hasCSS||(i.hasCSS=(n="article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}",r=(t=e).createElement("p"),a=t.getElementsByTagName("head")[0]||t.documentElement,r.innerHTML="x<style>"+n+"</style>",!!a.insertBefore(r.lastChild,a.firstChild))),s||(o=e,(c=i).cache||(c.cache={},c.createElem=o.createElement,c.createFrag=o.createDocumentFragment,c.frag=c.createFrag()),o.createElement=function(e){return f.shivMethods?h(e,o,c):c.createElem(e)},o.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+d().join().replace(/[\w\-:]+/g,function(e){return c.createElem(e),c.frag.createElement(e),'c("'+e+'")'})+");return n}")(f,c.frag)),e}!function(){try{var e=l.createElement("a");e.innerHTML="<xyz></xyz>",m="hidden"in e,s=1==e.childNodes.length||function(){l.createElement("a");var e=l.createDocumentFragment();return void 0===e.cloneNode||void 0===e.createDocumentFragment||void 0===e.createElement}()}catch(e){s=m=!0}}();var f={elements:t.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:"3.7.3",shivCSS:!1!==t.shivCSS,supportsUnknownElements:s,shivMethods:!1!==t.shivMethods,type:"default",shivDocument:i,createElement:h,createDocumentFragment:function(e,t){if(e=e||l,s)return e.createDocumentFragment();for(var n=(t=t||u(e)).frag.cloneNode(),r=0,a=d(),o=a.length;r<o;r++)n.createElement(a[r]);return n},addElements:function(e,t){var n=f.elements;"string"!=typeof n&&(n=n.join(" ")),"string"!=typeof e&&(e=e.join(" ")),f.elements=n+" "+e,i(t)}};e.html5=f,i(l),"object"==typeof module&&module.exports&&(module.exports=f)}("undefined"!=typeof window?window:this,document);
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
@@ -0,0 +1,86 @@
var $j = jQuery.noConflict();
$j( document ).ready( function() {
"use strict";
// Auto lightbox
oceanwpAutoLightbox();
// Lightbox
oceanwpInitLightbox();
} );
/* ==============================================
AUTO LIGHTBOX
============================================== */
function oceanwpAutoLightbox() {
"use strict"
$j( 'body .entry-content a:has(img), body .entry a:has(img)' ).each( function() {
// Make sure the lightbox is only used for image links and not for links to external pages
var $image_formats = ['bmp', 'gif', 'jpeg', 'jpg', 'png', 'tiff', 'tif', 'jfif', 'jpe', 'svg', 'mp4', 'ogg', 'webm'],
$image_formats_mask = 0;
// Loop through the image extensions array to see if we have an image link
for ( var $i = 0; $i < $image_formats.length; $i++ ) {
$image_formats_mask += String( $j( this ).attr( 'href' ) ).indexOf( '.' + $image_formats[$i] );
}
// If no image extension was found add the no lightbox class
if ( $image_formats_mask == -13 ) {
$j( this ).addClass( 'no-lightbox' );
}
if ( ! $j( this ).hasClass( 'no-lightbox' )
&& ! $j( this ).hasClass( 'gallery-lightbox' )
&& ! $j( this ).parent().hasClass( 'gallery-icon' )
&& ! $j( this ).hasClass( 'woo-lightbox' )
&& ! $j( this ).hasClass( 'woo-thumbnail' )
&& ! $j( this ).parent().hasClass( 'woocommerce-product-gallery__image' ) ) {
$j( this ).addClass( 'oceanwp-lightbox' );
}
if ( ! $j( this ).hasClass( 'no-lightbox' )
&& $j( this ).parent().hasClass( 'gallery-icon' ) ) {
$j( this ).addClass( 'gallery-lightbox' );
}
} );
}
/* ==============================================
LIGHTBOX
============================================== */
function oceanwpInitLightbox( $context ) {
"use strict"
// Lightbox
$j( '.oceanwp-lightbox' ).magnificPopup( {
type: 'image',
mainClass: 'mfp-with-zoom',
zoom: {
enabled: true,
duration: 300,
easing: 'ease-in-out',
opener: function(openerElement) {
return openerElement.is('img') ? openerElement : openerElement.find('img');
}
}
} );
// Gallery lightbox
$j( '.gallery-format, .gallery', $context ).magnificPopup( {
delegate: '.gallery-lightbox:not(.slick-cloned)',
type: 'image',
mainClass: 'mfp-fade',
gallery: {
enabled: true,
},
} );
}
@@ -0,0 +1 @@
var $j=jQuery.noConflict();function oceanwpAutoLightbox(){"use strict";$j("body .entry-content a:has(img), body .entry a:has(img)").each(function(){for(var a=["bmp","gif","jpeg","jpg","png","tiff","tif","jfif","jpe","svg","mp4","ogg","webm"],t=0,i=0;i<a.length;i++)t+=String($j(this).attr("href")).indexOf("."+a[i]);-13==t&&$j(this).addClass("no-lightbox"),$j(this).hasClass("no-lightbox")||$j(this).hasClass("gallery-lightbox")||$j(this).parent().hasClass("gallery-icon")||$j(this).hasClass("woo-lightbox")||$j(this).hasClass("woo-thumbnail")||$j(this).parent().hasClass("woocommerce-product-gallery__image")||$j(this).addClass("oceanwp-lightbox"),!$j(this).hasClass("no-lightbox")&&$j(this).parent().hasClass("gallery-icon")&&$j(this).addClass("gallery-lightbox")})}function oceanwpInitLightbox(a){"use strict";$j(".oceanwp-lightbox").magnificPopup({type:"image",mainClass:"mfp-with-zoom",zoom:{enabled:!0,duration:300,easing:"ease-in-out",opener:function(a){return a.is("img")?a:a.find("img")}}}),$j(".gallery-format, .gallery",a).magnificPopup({delegate:".gallery-lightbox:not(.slick-cloned)",type:"image",mainClass:"mfp-fade",gallery:{enabled:!0}})}$j(document).ready(function(){"use strict";oceanwpAutoLightbox(),oceanwpInitLightbox()});
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
@@ -0,0 +1,52 @@
var $j = jQuery.noConflict();
$j( document ).ready( function() {
"use strict";
// Woo account Login/Register links
oceanwpWooAccountLinks();
} );
/* ==============================================
WOOCOMMERCE ACCOUNT LOGIN/REGISTER LINKS
============================================== */
function oceanwpWooAccountLinks() {
"use strict"
// Return if registration disabled
if ( $j( '.owp-account-links' ).hasClass( 'registration-disabled' ) ) {
return;
}
// Vars
var $login = $j( '.owp-account-links .login a' ),
$register = $j( '.owp-account-links .register a' ),
$col_1 = $j( '#customer_login .col-1' ),
$col_2 = $j( '#customer_login .col-2' );
// Display login form
$login.on( 'click', function() {
$j( this ).addClass( 'current' );
$register.removeClass( 'current' );
$col_1.siblings().stop().fadeOut( function() {
$col_1.fadeIn();
} );
return false;
} );
// Display register form
$register.on( 'click', function() {
$j( this ).addClass( 'current' );
$login.removeClass( 'current' );
$col_2.siblings().stop().fadeOut( function() {
$col_2.fadeIn();
} );
return false;
} );
}
@@ -0,0 +1,70 @@
var $j = jQuery.noConflict();
$j( document ).ready( function() {
"use strict";
// Woo catalog view
oceanwpWooGridList();
} );
/* ==============================================
WOOCOMMERCE GRID LIST VIEW
============================================== */
function oceanwpWooGridList() {
"use strict"
if ( $j( 'body' ).hasClass( 'has-grid-list' ) ) {
// Re-run function
var oceanwpProductSlider = function() {
if ( ! $j( 'body' ).hasClass( 'no-carousel' )
&& $j( '.woo-entry-image.product-entry-slider' ).length) {
setTimeout( function() {
$j( '.woo-entry-image.product-entry-slider' ).slick( 'unslick' );
oceanwpInitCarousel();
}, 350 );
}
}
$j( '#oceanwp-grid' ).on( 'click', function() {
oceanwpProductSlider();
$j( this ).addClass( 'active' );
$j( '#oceanwp-list' ).removeClass( 'active' );
Cookies.set( 'gridcookie', 'grid', { path: '' } );
$j( '.woocommerce ul.products' ).fadeOut( 300, function() {
$j( this ).addClass( 'grid' ).removeClass( 'list' ).fadeIn( 300 );
} );
return false;
} );
$j( '#oceanwp-list' ).on( 'click', function() {
oceanwpProductSlider();
$j( this ).addClass( 'active' );
$j( '#oceanwp-grid' ).removeClass( 'active' );
Cookies.set( 'gridcookie', 'list', { path: '' } );
$j( '.woocommerce ul.products' ).fadeOut( 300, function() {
$j( this ).addClass( 'list' ).removeClass( 'grid' ).fadeIn( 300 );
} );
return false;
} );
if ( Cookies.get( 'gridcookie' ) == 'grid' ) {
$j( '.oceanwp-grid-list #oceanwp-grid' ).addClass( 'active' );
$j( '.oceanwp-grid-list #oceanwp-list' ).removeClass( 'active' );
$j( '.woocommerce ul.products' ).addClass( 'grid' ).removeClass( 'list' );
}
if ( Cookies.get( 'gridcookie' ) == 'list' ) {
$j( '.oceanwp-grid-list #oceanwp-list' ).addClass( 'active' );
$j( '.oceanwp-grid-list #oceanwp-grid' ).removeClass( 'active' );
$j( '.woocommerce ul.products' ).addClass( 'list' ).removeClass( 'grid' );
}
} else {
Cookies.remove( 'gridcookie', { path: '' } );
}
}
@@ -0,0 +1,118 @@
var $j = jQuery.noConflict();
$j( window ).ready( function() {
"use strict";
// Woo quantity buttons
oceanwpWooQuantityButtons();
} );
$j( document ).ajaxComplete( function() {
"use strict";
// Woo quantity buttons
oceanwpWooQuantityButtons();
} );
/* ==============================================
WOOCOMMERCE QUANTITY BUTTONS
============================================== */
function oceanwpWooQuantityButtons( $quantitySelector ) {
var $quantityBoxes
$cart = $j( '.woocommerce div.product form.cart' );
if ( ! $quantitySelector ) {
$quantitySelector = '.qty';
}
$quantityBoxes = $j( 'div.quantity:not(.buttons_added), td.quantity:not(.buttons_added)' ).find( $quantitySelector );
if ( $quantityBoxes && 'date' !== $quantityBoxes.prop( 'type' ) && 'hidden' !== $quantityBoxes.prop( 'type' ) ) {
// Add plus and minus icons
$quantityBoxes.parent().addClass( 'buttons_added' ).prepend('<a href="javascript:void(0)" class="minus">-</a>');
$quantityBoxes.after('<a href="javascript:void(0)" class="plus">+</a>');
// Target quantity inputs on product pages
$j( 'input' + $quantitySelector + ':not(.product-quantity input' + $quantitySelector + ')' ).each( function() {
var $min = parseFloat( $j( this ).attr( 'min' ) );
if ( $min && $min > 0 && parseFloat( $j( this ).val() ) < $min ) {
$j( this ).val( $min );
}
});
// Quantity input
if ( $j( 'body' ).hasClass( 'single-product' )
&& 'on' == oceanwpLocalize.floating_bar
&& ! $cart.hasClass( 'grouped_form' )
&& ! $cart.hasClass( 'cart_group' ) ) {
var $quantityInput = $j( '.woocommerce form input[type=number].qty' );
$quantityInput.on( 'keyup', function() {
var qty_val = $j( this ).val();
$quantityInput.val( qty_val );
});
}
$j( '.plus, .minus' ).unbind( 'click' );
$j( '.plus, .minus' ).on( 'click', function() {
// Quantity
var $quantityBox;
// If floating bar is enabled
if ( $j( 'body' ).hasClass( 'single-product' )
&& 'on' == oceanwpLocalize.floating_bar
&& ! $cart.hasClass( 'grouped_form' )
&& ! $cart.hasClass( 'cart_group' ) ) {
$quantityBox = $j( '.plus, .minus' ).closest( '.quantity' ).find( $quantitySelector );
} else {
$quantityBox = $j( this ).closest( '.quantity' ).find( $quantitySelector );
}
// Get values
var $currentQuantity = parseFloat( $quantityBox.val() ),
$maxQuantity = parseFloat( $quantityBox.attr( 'max' ) ),
$minQuantity = parseFloat( $quantityBox.attr( 'min' ) ),
$step = $quantityBox.attr( 'step' );
// Fallback default values
if ( ! $currentQuantity || '' === $currentQuantity || 'NaN' === $currentQuantity ) {
$currentQuantity = 0;
}
if ( '' === $maxQuantity || 'NaN' === $maxQuantity ) {
$maxQuantity = '';
}
if ( '' === $minQuantity || 'NaN' === $minQuantity ) {
$minQuantity = 0;
}
if ( 'any' === $step || '' === $step || undefined === $step || 'NaN' === parseFloat( $step ) ) {
$step = 1;
}
// Change the value
if ( $j( this ).is( '.plus' ) ) {
if ( $maxQuantity && ( $maxQuantity == $currentQuantity || $currentQuantity > $maxQuantity ) ) {
$quantityBox.val( $maxQuantity );
} else {
$quantityBox.val( $currentQuantity + parseFloat( $step ) );
}
} else {
if ( $minQuantity && ( $minQuantity == $currentQuantity || $currentQuantity < $minQuantity ) ) {
$quantityBox.val( $minQuantity );
} else if ( $currentQuantity > 0 ) {
$quantityBox.val( $currentQuantity - parseFloat( $step ) );
}
}
// Trigger change event
$quantityBox.trigger( 'change' );
} );
}
}
@@ -0,0 +1,27 @@
var $j = jQuery.noConflict();
$j( document ).ready( function() {
"use strict";
// Woo reviews scroll
oceanwpWooReviewsScroll();
} );
/* ==============================================
WOOCOMMERCE REVIEWS SCROLL
============================================== */
function oceanwpWooReviewsScroll() {
"use strict"
$j( '.woocommerce div.product .woocommerce-review-link' ).click( function( event ) {
$j( '.woocommerce-tabs .description_tab' ).removeClass( 'active' );
$j( '.woocommerce-tabs .reviews_tab' ).addClass( 'active' );
$j( '.woocommerce-tabs #tab-description' ).css( 'display', 'none' );
$j( '.woocommerce-tabs #tab-reviews' ).css( 'display', 'block' );
$j( 'html, body' ).stop(true,true).animate( {
scrollTop: $j( this.hash ).offset().top -120
}, 'normal' );
return false;
} );
}
@@ -0,0 +1,21 @@
var $j = jQuery.noConflict();
$j( document ).ready( function() {
"use strict";
// Woo remove brackets from categories and filter widgets
oceanwpWooRemoveBrackets();
} );
/* ==============================================
WOOCOMMERCE REMOVE BRACKETS
============================================== */
function oceanwpWooRemoveBrackets() {
"use strict"
$j( '.widget_layered_nav span.count, .widget_product_categories span.count' ).each( function() {
var count = $j( this ).html();
count = count.substring( 1, count.length-1 );
$j( this ).html( count );
} );
}
@@ -0,0 +1,119 @@
jQuery( function( $ ) {
if ( typeof oceanwpLocalize === 'undefined'
|| $( '.woocommerce div.product' ).hasClass( 'product-type-grouped' ) ) {
return false;
}
$.fn.serializeArrayAll = function () {
var rCRLF = /\r?\n/g;
return this.map(function () {
return this.elements ? jQuery.makeArray(this.elements) : this;
}).map(function (i, elem) {
var val = jQuery(this).val();
if (val == null) {
return val == null
//If checkbox is unchecked
} else if (this.type == "checkbox" && this.checked == false) {
return {name: this.name, value: this.checked ? this.value : ''}
} else if (this.type == "radio" && this.checked == false) {
return {name: this.name, value: this.checked ? this.value : ''}
//default: all checkboxes = on
} else {
return jQuery.isArray(val) ?
jQuery.map(val, function (val, i) {
return {name: elem.name, value: val.replace(rCRLF, "\r\n")};
}) :
{name: elem.name, value: val.replace(rCRLF, "\r\n")};
}
}).get();
};
/**
* AddToCartHandler class.
*/
var owpAddToCartHandler = function() {
$( document.body )
.on( 'click', '.product:not(.product-type-external) .single_add_to_cart_button:not(.disabled)', this.onAddToCart )
.on( 'added_to_cart', this.updateButton );
};
/**
* Handle the add to cart event.
*/
owpAddToCartHandler.prototype.onAddToCart = function(e) {
e.preventDefault();
var button = $( this ),
$form = $( this ).closest('form.cart'),
data = $form.serializeArrayAll();
var is_valid = false;
$.each(data, function (i, item) {
if (item.name === 'add-to-cart') {
is_valid = true;
return false;
}
})
if( is_valid ){
e.preventDefault();
}
else{
return;
}
$(document.body).trigger('adding_to_cart', [button, data]);
button.removeClass( 'added' );
button.addClass( 'loading' );
// Ajax action.
$.ajax ({
url: oceanwpLocalize.wc_ajax_url,
type: 'POST',
data : data,
success:function(results) {
$( document.body ).trigger( 'wc_fragment_refresh' );
$( document.body ).trigger( 'added_to_cart', [ results.fragments, results.cart_hash, button ] );
// Redirect to cart option
if ( oceanwpLocalize.cart_redirect_after_add === 'yes' ) {
window.location = oceanwpLocalize.cart_url;
return;
}
}
});
};
/**
* Update cart page elements after add to cart events.
*/
owpAddToCartHandler.prototype.updateButton = function( e, fragments, cart_hash, $button ) {
$button = typeof $button === 'undefined' ? false : $button;
if ( $button ) {
$button.removeClass( 'loading' );
$button.addClass( 'added' );
// View cart text.
if ( ! oceanwpLocalize.is_cart && $button.parent().find( '.added_to_cart' ).length === 0 ) {
$button.after( ' <a href="' + oceanwpLocalize.cart_url + '" class="added_to_cart wc-forward" title="' +
oceanwpLocalize.view_cart + '">' + oceanwpLocalize.view_cart + '</a>' );
}
}
};
/**
* Init owpAddToCartHandler.
*/
new owpAddToCartHandler();
});
@@ -0,0 +1 @@
jQuery(function(n){if("undefined"==typeof oceanwpLocalize||n(".woocommerce div.product").hasClass("product-type-grouped"))return!1;n.fn.serializeArrayAll=function(){var r=/\r?\n/g;return this.map(function(){return this.elements?jQuery.makeArray(this.elements):this}).map(function(e,a){var t=jQuery(this).val();return null==t?null==t:"checkbox"==this.type&&0==this.checked||"radio"==this.type&&0==this.checked?{name:this.name,value:this.checked?this.value:""}:jQuery.isArray(t)?jQuery.map(t,function(e,t){return{name:a.name,value:e.replace(r,"\r\n")}}):{name:a.name,value:t.replace(r,"\r\n")}}).get()};function e(){n(document.body).on("click",".product:not(.product-type-external) .single_add_to_cart_button:not(.disabled)",this.onAddToCart).on("added_to_cart",this.updateButton)}e.prototype.onAddToCart=function(e){e.preventDefault();var t=n(this),a=n(this).closest("form.cart").serializeArrayAll(),r=!1;n.each(a,function(e,t){if("add-to-cart"===t.name)return!(r=!0)}),r&&(e.preventDefault(),n(document.body).trigger("adding_to_cart",[t,a]),t.removeClass("added"),t.addClass("loading"),n.ajax({url:oceanwpLocalize.wc_ajax_url,type:"POST",data:a,success:function(e){n(document.body).trigger("wc_fragment_refresh"),n(document.body).trigger("added_to_cart",[e.fragments,e.cart_hash,t]),"yes"!==oceanwpLocalize.cart_redirect_after_add||(window.location=oceanwpLocalize.cart_url)}}))},e.prototype.updateButton=function(e,t,a,r){(r=void 0!==r&&r)&&(r.removeClass("loading"),r.addClass("added"),oceanwpLocalize.is_cart||0!==r.parent().find(".added_to_cart").length||r.after(' <a href="'+oceanwpLocalize.cart_url+'" class="added_to_cart wc-forward" title="'+oceanwpLocalize.view_cart+'">'+oceanwpLocalize.view_cart+"</a>"))},new e});
@@ -0,0 +1,32 @@
var $j = jQuery.noConflict();
$j( document ).ready( function() {
"use strict";
// Woo categories widget
oceanwpWooCategoriesWidget();
} );
/* ==============================================
WOOCOMMERCE CATEGORIES WIDGET
============================================== */
function oceanwpWooCategoriesWidget() {
"use strict"
$j( '.woo-dropdown-cat .product-categories' ).each( function() {
var IconDown = '<i class="fa fa-angle-down"></i>',
IconUp = '<i class="fa fa-angle-up"></i>';
$j( this ).find( 'li' ).has( '.children' ).has( 'li' ).prepend( '<div class="open-this">'+ IconDown +'</div>' );
$j( this ).find( '.open-this' ).on( 'click', function(){
if ( $j( this ).parent().hasClass( 'opened' ) ) {
$j( this ).html( IconDown ).parent().removeClass( 'opened' ).find( '> ul' ).slideUp( 200 );
} else {
$j( this ).html( IconUp ).parent().addClass( 'opened' ).find( '> ul' ).slideDown( 200 );
}
} );
} );
}
@@ -0,0 +1 @@
var $j=jQuery.noConflict();function oceanwpWooCategoriesWidget(){"use strict";$j(".woo-dropdown-cat .product-categories").each(function(){var e='<i class="fa fa-angle-down"></i>';$j(this).find("li").has(".children").has("li").prepend('<div class="open-this">'+e+"</div>"),$j(this).find(".open-this").on("click",function(){$j(this).parent().hasClass("opened")?$j(this).html(e).parent().removeClass("opened").find("> ul").slideUp(200):$j(this).html('<i class="fa fa-angle-up"></i>').parent().addClass("opened").find("> ul").slideDown(200)})})}$j(document).ready(function(){"use strict";oceanwpWooCategoriesWidget()});
@@ -0,0 +1,58 @@
var $j = jQuery.noConflict();
$j( document ).ready( function() {
"use strict";
// Woo display cart
oceanwpWooDisplayCart();
} );
/* ==============================================
WOOCOMMERCE DISPLAY CART
============================================== */
function oceanwpWooDisplayCart() {
"use strict"
var $overlay = $j( '.owp-cart-overlay' );
$j( 'body' ).on( 'added_to_cart', function() {
$overlay.fadeIn();
$j( 'body' ).addClass( 'show-cart' );
// Close quick view modal if enabled
var qv_modal = $j( '#owp-qv-wrap' ),
qv_content = $j( '#owp-qv-content' ),
header = $j( '#site-header' );
if ( qv_modal.length ) {
$j( 'html' ).css( {
'overflow': '',
'margin-right': ''
} );
$j( 'html' ).removeClass( 'owp-qv-open' );
qv_modal.fadeOut();
qv_modal.removeClass( 'is-visible' );
setTimeout( function() {
qv_content.html( '' );
}, 600);
}
if ( header.length
&& ! header.hasClass( 'fixed-scroll' ) ) {
$j( 'html, body' ).animate( { scrollTop: 0 }, 400 );
}
} );
$overlay.on( 'click', function() {
$j( this ).fadeOut();
$j( 'body' ).removeClass( 'show-cart' );
} );
// Close on resize to avoid conflict
$j( window ).resize( function() {
$overlay.fadeOut();
$j( 'body' ).removeClass( 'show-cart' );
} );
}
@@ -0,0 +1 @@
var $j=jQuery.noConflict();function oceanwpWooDisplayCart(){"use strict";var a=$j(".owp-cart-overlay");$j("body").on("added_to_cart",function(){a.fadeIn(),$j("body").addClass("show-cart");var o=$j("#owp-qv-wrap"),t=$j("#owp-qv-content"),e=$j("#site-header");o.length&&($j("html").css({overflow:"","margin-right":""}),$j("html").removeClass("owp-qv-open"),o.fadeOut(),o.removeClass("is-visible"),setTimeout(function(){t.html("")},600)),e.length&&!e.hasClass("fixed-scroll")&&$j("html, body").animate({scrollTop:0},400)}),a.on("click",function(){$j(this).fadeOut(),$j("body").removeClass("show-cart")}),$j(window).resize(function(){a.fadeOut(),$j("body").removeClass("show-cart")})}$j(document).ready(function(){"use strict";oceanwpWooDisplayCart()});
@@ -0,0 +1,149 @@
( function( $ ) {
$( document ).scroll( function() {
// Vars
var $tabs = $( '.woocommerce div.product .woocommerce-tabs' ),
$bottom = $tabs.offset().top,
$bar = $( '.owp-floating-bar' ),
$offset = 0,
$adminBar = $( '#wpadminbar' ),
$hasStickyTopBar = $( '#top-bar-sticky-wrapper' ),
$stickyTopBar = $( '#top-bar-wrap' ),
$stickyHeader = $( '#site-header' );
// Return if no tabs and from 960px
if ( ! $tabs.length ) {
return;
}
// Offset adminbar
if ( $adminBar.length
&& $( window ).width() > 600 ) {
$offset = $offset + $adminBar.outerHeight();
}
// Offset sticky topbar
if ( $hasStickyTopBar.length ) {
$offset = $offset + $stickyTopBar.outerHeight();
}
// If header
if ( $stickyHeader.length ) {
// Offset header styles
if ( $stickyHeader.hasClass( 'top-header' ) ) {
$offset = $offset + $stickyHeader.find( '.header-top' ).outerHeight();
} else if ( $stickyHeader.hasClass( 'medium-header' ) ) {
if ( $( '#site-header .bottom-header-wrap' ).hasClass( 'fixed-scroll' ) ) {
$offset = $offset + $stickyHeader.find( '.bottom-header-wrap' ).outerHeight();
} else {
$offset = $offset + $( '.is-sticky #site-header-inner' ).outerHeight();
}
} else if ( $stickyHeader.hasClass( 'center-header' )
|| $stickyHeader.hasClass( 'custom-header' ) ) {
$offset = $offset + $stickyHeader.outerHeight();
} else if ( $stickyHeader.hasClass( 'vertical-header' ) ) {
$offset = $offset;
} else if ( $stickyHeader.hasClass( 'fixed-scroll' ) ) {
$offset = $offset + $stickyHeader.data( 'height' );
}
}
// Add offset to the $bottom variable
$bottom = $bottom - $offset;
// Offset
$bar.css( 'top', $offset );
// Display floating bar
$( window ).scroll( function() {
if ( $( this ).scrollTop() > $bottom ) {
$bar.addClass( 'show' );
} else {
$bar.removeClass( 'show' );
}
} );
// If variation or grouped product
$( '.owp-floating-bar button.button.top' ).on( 'click', function( e ) {
e.preventDefault();
var $target = $( '.woocommerce div.product .cart' ),
$scrollPosition;
if ( $target.length ) {
$scrollPosition = $target.offset().top - $offset;
$( 'html, body' ).stop().animate( {
scrollTop: Math.round( $scrollPosition )
}, 1000 );
}
} );
} );
/**
* AddToCartHandler class.
*/
var owpFBAddToCartHandler = function() {
$( document.body )
.on( 'click', '.owp-floating-bar .floating_add_to_cart_button', this.onAddToCart )
.on( 'added_to_cart', this.updateButton );
};
/**
* Handle the add to cart event.
*/
owpFBAddToCartHandler.prototype.onAddToCart = function( e ) {
e.preventDefault();
var button = $( this ),
product_id = $( this ).val(),
quantity = $('input[name="quantity"]').val();
button.removeClass( 'added' );
button.addClass( 'loading' );
// Ajax action.
$.ajax ({
url: oceanwpLocalize.ajax_url,
type:'POST',
data:'action=oceanwp_add_cart_floating_bar&product_id=' + product_id + '&quantity=' + quantity,
success:function(results) {
$( document.body ).trigger( 'wc_fragment_refresh' );
$( document.body ).trigger( 'added_to_cart', [ results.fragments, results.cart_hash, button ] );
// Redirect to cart option
if ( oceanwpLocalize.cart_redirect_after_add === 'yes' ) {
window.location = oceanwpLocalize.cart_url;
return;
}
}
});
};
/**
* Update cart page elements after add to cart events.
*/
owpFBAddToCartHandler.prototype.updateButton = function( e, fragments, cart_hash, $button ) {
$button = typeof $button === 'undefined' ? false : $button;
if ( $button ) {
$button.removeClass( 'loading' );
$button.addClass( 'added' );
// View cart text.
if ( ! oceanwpLocalize.is_cart && $button.parent().find( '.added_to_cart' ).length === 0 ) {
$button.after( ' <a href="' + oceanwpLocalize.cart_url + '" class="added_to_cart wc-forward" title="' +
oceanwpLocalize.view_cart + '">' + oceanwpLocalize.view_cart + '</a>' );
}
}
};
/**
* Init owpFBAddToCartHandler.
*/
new owpFBAddToCartHandler();
})( jQuery );
@@ -0,0 +1 @@
!function(i){i(document).scroll(function(){var t=i(".woocommerce div.product .woocommerce-tabs"),a=t.offset().top,e=i(".owp-floating-bar"),o=0,r=i("#wpadminbar"),d=i("#top-bar-sticky-wrapper"),n=i("#top-bar-wrap"),c=i("#site-header");t.length&&(r.length&&600<i(window).width()&&(o+=r.outerHeight()),d.length&&(o+=n.outerHeight()),c.length&&(c.hasClass("top-header")?o+=c.find(".header-top").outerHeight():c.hasClass("medium-header")?i("#site-header .bottom-header-wrap").hasClass("fixed-scroll")?o+=c.find(".bottom-header-wrap").outerHeight():o+=i(".is-sticky #site-header-inner").outerHeight():c.hasClass("center-header")||c.hasClass("custom-header")?o+=c.outerHeight():c.hasClass("vertical-header")||c.hasClass("fixed-scroll")&&(o+=c.data("height"))),a-=o,e.css("top",o),i(window).scroll(function(){i(this).scrollTop()>a?e.addClass("show"):e.removeClass("show")}),i(".owp-floating-bar button.button.top").on("click",function(t){t.preventDefault();var a,e=i(".woocommerce div.product .cart");e.length&&(a=e.offset().top-o,i("html, body").stop().animate({scrollTop:Math.round(a)},1e3))}))});function t(){i(document.body).on("click",".owp-floating-bar .floating_add_to_cart_button",this.onAddToCart).on("added_to_cart",this.updateButton)}t.prototype.onAddToCart=function(t){t.preventDefault();var a=i(this),e=i(this).val(),o=i('input[name="quantity"]').val();a.removeClass("added"),a.addClass("loading"),i.ajax({url:oceanwpLocalize.ajax_url,type:"POST",data:"action=oceanwp_add_cart_floating_bar&product_id="+e+"&quantity="+o,success:function(t){i(document.body).trigger("wc_fragment_refresh"),i(document.body).trigger("added_to_cart",[t.fragments,t.cart_hash,a]),"yes"!==oceanwpLocalize.cart_redirect_after_add||(window.location=oceanwpLocalize.cart_url)}})},t.prototype.updateButton=function(t,a,e,o){(o=void 0!==o&&o)&&(o.removeClass("loading"),o.addClass("added"),oceanwpLocalize.is_cart||0!==o.parent().find(".added_to_cart").length||o.after(' <a href="'+oceanwpLocalize.cart_url+'" class="added_to_cart wc-forward" title="'+oceanwpLocalize.view_cart+'">'+oceanwpLocalize.view_cart+"</a>"))},new t}(jQuery);
@@ -0,0 +1,71 @@
var $j = jQuery.noConflict();
$j( document ).ready( function() {
// Wishlist button
if ( $j( '.woocommerce ul.products li.product .woo-entry-buttons li.woo-wishlist-btn' ).length ) {
$j( document ).on( 'click', '.tinvwl_add_to_wishlist_button', function() {
var $this = $j( this );
$this.parent().parent().addClass( 'loading' );
window.setTimeout( function() {
$this.parent().parent().removeClass( 'loading' );
}, 1000 );
} );
}
// Thumbnails
$j( document ).on( 'click', '.woo-product-gallery a.woo-product-gallery-link', function( e ) {
e.preventDefault();
var $this = $j( this ),
$img = $this.attr( 'href' ),
$main_img = $this.closest( '.product-inner' ).find( '.woo-entry-image-main' );
if ( $main_img ) {
$main_img.parent().addClass( 'loading' );
$main_img.attr( 'src', $img ).attr( 'srcset', $img );
$main_img.css( {
'-webkit-transform': 'scale(0.5)',
'-moz-transform': 'scale(0.5)',
'-ms-transform': 'scale(0.5)',
'-o-transform': 'scale(0.5)',
'transform': 'scale(0.5)',
'opacity': '0',
'-webkit-transition': 'all 0.3s ease',
'-moz-transition': 'all 0.3s ease',
'-ms-transition': 'all 0.3s ease',
'-o-transition': 'all 0.3s ease',
'transition': 'all 0.3s ease',
} ).load( function() {
var $image = $j( this );
setTimeout( function() {
$image.css( {
'-webkit-transform': 'scale(1)',
'-moz-transform': 'scale(1)',
'-ms-transform': 'scale(1)',
'-o-transform': 'scale(1)',
'transform': 'scale(1)',
'opacity': '1',
'-webkit-transition': 'all 0.3s ease',
'-moz-transition': 'all 0.3s ease',
'-ms-transition': 'all 0.3s ease',
'-o-transition': 'all 0.3s ease',
'transition': 'all 0.3s ease',
} );
$image.parent().removeClass( 'loading' );
}, 300 );
} );
$j( this ).parent().addClass( 'active' ).siblings().removeClass( 'active' );
}
} );
});
@@ -0,0 +1 @@
var $j=jQuery.noConflict();$j(document).ready(function(){$j(".woocommerce ul.products li.product .woo-entry-buttons li.woo-wishlist-btn").length&&$j(document).on("click",".tinvwl_add_to_wishlist_button",function(){var a=$j(this);a.parent().parent().addClass("loading"),window.setTimeout(function(){a.parent().parent().removeClass("loading")},1e3)}),$j(document).on("click",".woo-product-gallery a.woo-product-gallery-link",function(a){a.preventDefault();var t=$j(this),s=t.attr("href"),o=t.closest(".product-inner").find(".woo-entry-image-main");o&&(o.parent().addClass("loading"),o.attr("src",s).attr("srcset",s),o.css({"-webkit-transform":"scale(0.5)","-moz-transform":"scale(0.5)","-ms-transform":"scale(0.5)","-o-transform":"scale(0.5)",transform:"scale(0.5)",opacity:"0","-webkit-transition":"all 0.3s ease","-moz-transition":"all 0.3s ease","-ms-transition":"all 0.3s ease","-o-transition":"all 0.3s ease",transition:"all 0.3s ease"}).load(function(){var a=$j(this);setTimeout(function(){a.css({"-webkit-transform":"scale(1)","-moz-transform":"scale(1)","-ms-transform":"scale(1)","-o-transform":"scale(1)",transform:"scale(1)",opacity:"1","-webkit-transition":"all 0.3s ease","-moz-transition":"all 0.3s ease","-ms-transition":"all 0.3s ease","-o-transition":"all 0.3s ease",transition:"all 0.3s ease"}),a.parent().removeClass("loading")},300)}),$j(this).parent().addClass("active").siblings().removeClass("active"))})});
@@ -0,0 +1,54 @@
var $j = jQuery.noConflict();
$j( document ).ready( function() {
"use strict";
// Woo mobile cart sidebar
oceanwpWooMobileCart();
} );
/* ==============================================
WOOCOMMERCE MOBILE CART SIDEBAR
============================================== */
function oceanwpWooMobileCart() {
"use strict"
if ( $j( 'body' ).hasClass( 'woocommerce-cart' )
|| $j( 'body' ).hasClass( 'woocommerce-checkout' ) ) {
return;
}
var oceanwp_cart_filter_close = function() {
$j( 'html' ).css( {
'overflow': '',
'margin-right': ''
} );
$j( 'body' ).removeClass( 'show-cart-sidebar' );
};
$j( document ).on( 'click', '.oceanwp-mobile-menu-icon a.wcmenucart', function( e ) {
e.preventDefault();
var innerWidth = $j( 'html' ).innerWidth();
$j( 'html' ).css( 'overflow', 'hidden' );
var hiddenInnerWidth = $j( 'html' ).innerWidth();
$j( 'html' ).css( 'margin-right', hiddenInnerWidth - innerWidth );
$j( 'body' ).addClass( 'show-cart-sidebar' );
} );
$j( '.oceanwp-cart-sidebar-overlay, .oceanwp-cart-close').on( 'click', function( e ) {
e.preventDefault();
oceanwp_cart_filter_close();
// Remove show-cart here to let the header mini cart working
$j( 'body' ).removeClass( 'show-cart' );
} );
// Close on resize to avoid conflict
$j( window ).resize( function() {
oceanwp_cart_filter_close();
} );
}
@@ -0,0 +1 @@
var $j=jQuery.noConflict();function oceanwpWooMobileCart(){"use strict";var e;$j("body").hasClass("woocommerce-cart")||$j("body").hasClass("woocommerce-checkout")||(e=function(){$j("html").css({overflow:"","margin-right":""}),$j("body").removeClass("show-cart-sidebar")},$j(document).on("click",".oceanwp-mobile-menu-icon a.wcmenucart",function(o){o.preventDefault();var e=$j("html").innerWidth();$j("html").css("overflow","hidden");var c=$j("html").innerWidth();$j("html").css("margin-right",c-e),$j("body").addClass("show-cart-sidebar")}),$j(".oceanwp-cart-sidebar-overlay, .oceanwp-cart-close").on("click",function(o){o.preventDefault(),e(),$j("body").removeClass("show-cart")}),$j(window).resize(function(){e()}))}$j(document).ready(function(){"use strict";oceanwpWooMobileCart()});
@@ -0,0 +1,223 @@
var $j = jQuery.noConflict();
$j( document ).ready( function() {
"use strict";
// Woo multi-step checkout
oceanwpWooMultiStepCheckout();
} );
/* ==============================================
WOOCOMMERCE MULTI-STEP CHECKOUT
============================================== */
function oceanwpWooMultiStepCheckout() {
"use strict"
var body = $j( 'body' ),
login = $j( '#checkout_login' ),
billing = $j( '#customer_billing_details' ),
shipping = $j( '#customer_shipping_details' ),
order = $j( '#order_review' ),
payment = $j( '#order_checkout_payment' ),
form_actions = $j( '#form_actions' ),
coupon = $j( '#checkout_coupon' ),
steps = new Array( login, billing, shipping, order, payment ),
payment_method = function () {
$j( '#place_order' ).on( 'click', function () {
var $this = $j( '#order_checkout_payment' ).find( 'input[name=payment_method]:checked' ),
current_gateway = $this.val(),
order_button_text = $this.data( 'order_button_text' );
order.find( 'input[name="payment_method"]' ).val( current_gateway ).data( 'order_button_text', order_button_text ).attr( 'checked', 'checked' );
} );
};
body.on( 'updated_checkout', function( e ) {
steps[4] = $j( '#order_checkout_payment' );
if ( e.type == 'updated_checkout' ) {
steps[4] = $j( '#order_checkout_payment' );
}
$j( '#order_checkout_payment' ).find( 'input[name=payment_method]' ).on( 'click', function() {
if ( $j( '.payment_methods input.input-radio' ).length > 1 ) {
var target_payment_box = $j( 'div.payment_box.' + $j( this ).attr( 'ID' ) );
if ( $j( this ).is( ':checked' ) && ! target_payment_box.is( ':visible' ) ) {
$j( 'div.payment_box' ).filter( ':visible' ).slideUp( 250 );
if ( $j( this ).is( ':checked' ) ) {
$j( 'div.payment_box.' + $j( this ).attr( 'ID' )).slideDown( 250 );
}
}
} else {
$j( 'div.payment_box' ).show();
}
if ( $j( this ).data( 'order_button_text' )) {
$j( '#place_order' ).val( $j( this ).data( 'order_button_text' ) );
} else {
$j( '#place_order' ).val( $j( '#place_order' ).data( 'value' ) );
}
} );
} );
form_actions.find( '.button.prev' ).add( '.button.next' ).on( 'click', function( e ) {
var $this = $j( this ),
timeline = $j( '#owp-checkout-timeline' ),
action = $this.data( 'action' ),
current_step = form_actions.data( 'step' ),
next_step = current_step + 1,
prev_step = current_step - 1,
prev = form_actions.find( '.button.prev' ),
next = form_actions.find( '.button.next' ),
checkout_form = $j( 'form.woocommerce-checkout' ),
is_logged_in = oceanwpLocalize.is_logged_in,
button_title,
valid = false,
current_step_item = steps[current_step],
selector = current_step_item.selector,
posted_data = {},
type = '',
$offset = 30,
$adminBar = $j( '#wpadminbar' ),
$stickyTopBar = $j( '#top-bar-wrap' ),
$stickyHeader = $j( '#site-header' );
// Offset adminbar
if ( $adminBar.length
&& $j( window ).width() > 600 ) {
$offset = $offset + $adminBar.outerHeight();
}
// Offset sticky topbar
if ( true == oceanwpLocalize.hasStickyTopBar ) {
$offset = $offset + $stickyTopBar.outerHeight();
}
// Offset sticky header
if ( $j( '#site-header' ).hasClass( 'fixed-scroll' )
&& ! $j( '#site-header' ).hasClass( 'vertical-header' ) ) {
$offset = $offset + $stickyHeader.outerHeight();
}
$j( 'form.woocommerce-checkout .woocommerce-NoticeGroup.woocommerce-NoticeGroup-checkout' ).remove();
type = (selector.indexOf( 'billing' ) >= 0) ? 'billing' : type;
type = (selector.indexOf( 'shipping' ) >= 0) ? 'shipping' : type;
if ( type == 'billing' || type == 'shipping' ) {
$j( selector ).find( '.validate-required input' ).each( function() {
posted_data[ $j( this ).attr( 'name' ) ] = $j( this ).val();
} );
$j( selector ).find( '.validate-required select' ).each( function() {
posted_data[ $j( this ).attr( 'name' ) ] = $j( this ).val();
} );
$j( selector ).find( '.input-checkbox' ).each( function() {
if ( $j( this ).is( ':checked' ) ) {
posted_data[ $j( this ).attr( 'name' ) ] = $j( this ).val();
}
} );
var data = {
action: 'oceanwp_validate_checkout',
type: type,
posted_data: posted_data
};
$j.ajax( {
type: 'POST',
url: oceanwpLocalize.ajax_url,
data: data,
success: function( response ) {
valid = response.valid;
if ( ! response.valid ) {
$j( 'form.woocommerce-checkout' ).prepend( response.html );
$j( 'html, body' ).animate( {
scrollTop: $j( 'form.woocommerce-checkout' ).offset().top - $offset },
'slow' );
}
else{
after_validation(timeline,form_actions,checkout_form,checkout_form,steps,action,next_step,current_step,prev_step,prev,next,$offset,is_logged_in,coupon); }
},
complete: function() {}
} );
} else {
valid = true;
after_validation(timeline,form_actions,checkout_form,checkout_form,steps,action,next_step,current_step,prev_step,prev,next,$offset,is_logged_in,coupon); }
} );
}
function after_validation(timeline,form_actions,checkout_form,checkout_form,steps,action,next_step,current_step,prev_step,prev,next,$offset,is_logged_in,coupon)
{
timeline.find( '.active' ).removeClass( 'active' );
if ( action == 'next' ) {
form_actions.data( 'step', next_step );
steps[current_step].fadeOut( 120, function() {
steps[next_step].fadeIn( 120 );
} );
$j( '#timeline-' + next_step ).toggleClass( 'active' );
$j( 'html, body' ).animate( {
scrollTop: $j( '#owp-checkout-timeline' ).offset().top - $offset },
'slow' );
} else if ( action == 'prev' ) {
form_actions.data( 'step', prev_step );
steps[current_step].fadeOut( 120, function() {
steps[prev_step].fadeIn( 120 );
} );
$j( '#timeline-' + prev_step ).toggleClass( 'active' );
$j( 'html, body' ).animate( {
scrollTop: $j( '#owp-checkout-timeline' ).offset().top - $offset },
'slow' );
}
current_step = form_actions.data( 'step' );
if ( ( current_step == 1
&& is_logged_in == true ) ||
( is_logged_in == false
&& ( ( current_step == 0
&& oceanwpLocalize.login_reminder_enabled == 1 )
|| ( current_step == 1
&& oceanwpLocalize.login_reminder_enabled == 0 ) ) ) ) {
prev.fadeOut( 120 );
} else {
prev.fadeIn( 120 );
}
// Next title
if ( is_logged_in == false
&& ( ( current_step == 0
&& oceanwpLocalize.login_reminder_enabled == 1 )
|| ( current_step == 1
&& oceanwpLocalize.login_reminder_enabled == 0 ) ) ) {
next.val( oceanwpLocalize.no_account_btn );
} else {
next.val( oceanwpLocalize.next );
}
// Last step
if ( current_step == 3 ) {
checkout_form.removeClass( 'processing' );
coupon.fadeIn( 80 );
next.fadeOut( 120 );
} else {
checkout_form.addClass( 'processing' );
coupon.fadeOut( 80 );
next.fadeIn( 120 );
}
}
@@ -0,0 +1 @@
var $j=jQuery.noConflict();function oceanwpWooMultiStepCheckout(){"use strict";var e=$j("body"),t=$j("#checkout_login"),o=$j("#customer_billing_details"),a=$j("#customer_shipping_details"),i=$j("#order_review"),n=$j("#order_checkout_payment"),v=$j("#form_actions"),w=$j("#checkout_coupon"),b=new Array(t,o,a,i,n);e.on("updated_checkout",function(e){b[4]=$j("#order_checkout_payment"),"updated_checkout"==e.type&&(b[4]=$j("#order_checkout_payment")),$j("#order_checkout_payment").find("input[name=payment_method]").on("click",function(){var e;1<$j(".payment_methods input.input-radio").length?(e=$j("div.payment_box."+$j(this).attr("ID")),$j(this).is(":checked")&&!e.is(":visible")&&($j("div.payment_box").filter(":visible").slideUp(250),$j(this).is(":checked")&&$j("div.payment_box."+$j(this).attr("ID")).slideDown(250))):$j("div.payment_box").show(),$j(this).data("order_button_text")?$j("#place_order").val($j(this).data("order_button_text")):$j("#place_order").val($j("#place_order").data("value"))})}),v.find(".button.prev").add(".button.next").on("click",function(e){var t,o=$j(this),a=$j("#owp-checkout-timeline"),i=o.data("action"),n=v.data("step"),c=n+1,d=n-1,r=v.find(".button.prev"),l=v.find(".button.next"),s=$j("form.woocommerce-checkout"),p=oceanwpLocalize.is_logged_in,u=b[n].selector,h={},j="",m=30,$=$j("#wpadminbar"),f=$j("#top-bar-wrap"),_=$j("#site-header");$.length&&600<$j(window).width()&&(m+=$.outerHeight()),1==oceanwpLocalize.hasStickyTopBar&&(m+=f.outerHeight()),$j("#site-header").hasClass("fixed-scroll")&&!$j("#site-header").hasClass("vertical-header")&&(m+=_.outerHeight()),$j("form.woocommerce-checkout .woocommerce-NoticeGroup.woocommerce-NoticeGroup-checkout").remove(),j=0<=u.indexOf("billing")?"billing":j,"billing"==(j=0<=u.indexOf("shipping")?"shipping":j)||"shipping"==j?($j(u).find(".validate-required input").each(function(){h[$j(this).attr("name")]=$j(this).val()}),$j(u).find(".validate-required select").each(function(){h[$j(this).attr("name")]=$j(this).val()}),$j(u).find(".input-checkbox").each(function(){$j(this).is(":checked")&&(h[$j(this).attr("name")]=$j(this).val())}),t={action:"oceanwp_validate_checkout",type:j,posted_data:h},$j.ajax({type:"POST",url:oceanwpLocalize.ajax_url,data:t,success:function(e){e.valid,e.valid?after_validation(a,v,s,s,b,i,c,n,d,r,l,m,p,w):($j("form.woocommerce-checkout").prepend(e.html),$j("html, body").animate({scrollTop:$j("form.woocommerce-checkout").offset().top-m},"slow"))},complete:function(){}})):after_validation(a,v,s,s,b,i,c,n,d,r,l,m,p,w)})}function after_validation(e,t,o,o,a,i,n,c,d,r,l,s,p,u){e.find(".active").removeClass("active"),"next"==i?(t.data("step",n),a[c].fadeOut(120,function(){a[n].fadeIn(120)}),$j("#timeline-"+n).toggleClass("active"),$j("html, body").animate({scrollTop:$j("#owp-checkout-timeline").offset().top-s},"slow")):"prev"==i&&(t.data("step",d),a[c].fadeOut(120,function(){a[d].fadeIn(120)}),$j("#timeline-"+d).toggleClass("active"),$j("html, body").animate({scrollTop:$j("#owp-checkout-timeline").offset().top-s},"slow")),1==(c=t.data("step"))&&1==p||0==p&&(0==c&&1==oceanwpLocalize.login_reminder_enabled||1==c&&0==oceanwpLocalize.login_reminder_enabled)?r.fadeOut(120):r.fadeIn(120),0==p&&(0==c&&1==oceanwpLocalize.login_reminder_enabled||1==c&&0==oceanwpLocalize.login_reminder_enabled)?l.val(oceanwpLocalize.no_account_btn):l.val(oceanwpLocalize.next),3==c?(o.removeClass("processing"),u.fadeIn(80),l.fadeOut(120)):(o.addClass("processing"),u.fadeOut(80),l.fadeIn(120))}$j(document).ready(function(){"use strict";oceanwpWooMultiStepCheckout()});
@@ -0,0 +1,35 @@
var $j = jQuery.noConflict();
$j( document ).ready( function() {
"use strict";
// Woo off canvas
oceanwpWooOffCanvas();
} );
/* ==============================================
WOOCOMMERCE OFF CANVAS
============================================== */
function oceanwpWooOffCanvas() {
"use strict"
$j( document ).on( 'click', '.oceanwp-off-canvas-filter', function( e ) {
e.preventDefault();
var innerWidth = $j( 'html' ).innerWidth();
$j( 'html' ).css( 'overflow', 'hidden' );
var hiddenInnerWidth = $j( 'html' ).innerWidth();
$j( 'html' ).css( 'margin-right', hiddenInnerWidth - innerWidth );
$j( 'body' ).addClass( 'off-canvas-enabled' );
} );
$j( '.oceanwp-off-canvas-overlay, .oceanwp-off-canvas-close' ).on( 'click', function() {
$j( 'html' ).css( {
'overflow': '',
'margin-right': ''
} );
$j( 'body' ).removeClass( 'off-canvas-enabled' );
} );
}
@@ -0,0 +1 @@
var $j=jQuery.noConflict();function oceanwpWooOffCanvas(){"use strict";$j(document).on("click",".oceanwp-off-canvas-filter",function(n){n.preventDefault();var o=$j("html").innerWidth();$j("html").css("overflow","hidden");var a=$j("html").innerWidth();$j("html").css("margin-right",a-o),$j("body").addClass("off-canvas-enabled")}),$j(".oceanwp-off-canvas-overlay, .oceanwp-off-canvas-close").on("click",function(){$j("html").css({overflow:"","margin-right":""}),$j("body").removeClass("off-canvas-enabled")})}$j(document).ready(function(){"use strict";oceanwpWooOffCanvas()});
@@ -0,0 +1,224 @@
var $j = jQuery.noConflict();
$j( document ).ready( function() {
if ( typeof oceanwpLocalize === 'undefined' ) {
return false;
}
// Vars
var qv_modal = $j( '#owp-qv-wrap' ),
qv_content = $j( '#owp-qv-content' );
/**
* Open quick view.
*/
$j( document ).on( 'click', '.owp-quick-view', function( e ) {
e.preventDefault();
var $this = $j( this ),
product_id = $j( this ).data( 'product_id' );
$this.parent().addClass( 'loading' );
$j.ajax( {
url: oceanwpLocalize.ajax_url,
data: {
action : 'oceanwp_product_quick_view',
product_id : product_id
},
success: function( results ) {
var innerWidth = $j( 'html' ).innerWidth();
$j( 'html' ).css( 'overflow', 'hidden' );
var hiddenInnerWidth = $j( 'html' ).innerWidth();
$j( 'html' ).css( 'margin-right', hiddenInnerWidth - innerWidth );
$j( 'html' ).addClass( 'owp-qv-open' );
qv_content.html( results );
// Display modal
qv_modal.fadeIn();
qv_modal.addClass( 'is-visible' );
// Variation Form
var form_variation = qv_content.find( '.variations_form' );
form_variation.trigger( 'check_variations' );
form_variation.trigger( 'reset_image' );
var var_form = qv_content.find( '.variations_form' );
if ( var_form.length > 0 ) {
var_form.wc_variation_form();
var_form.find( 'select' ).change();
}
var image_slider_wrap = qv_content.find( '.owp-qv-image' );
if ( image_slider_wrap.find( 'li' ).length > 1 ) {
image_slider_wrap.flexslider();
}
// If grouped product
var grouped = qv_content.find( 'form.grouped_form' );
if ( grouped ) {
var grouped_product_url = qv_content.find( 'form.grouped_form' ).attr( 'action' );
grouped.find( '.group_table, button.single_add_to_cart_button' ).hide();
grouped.append( ' <a href="' + grouped_product_url + '" class="button">' + oceanwpLocalize.grouped_text + '</a>' );
}
}
} ).done( function() {
$this.parent().removeClass( 'loading' );
} );
} );
/**
* Close quick view function.
*/
var owpCloseQuickView = function() {
$j( 'html' ).css( {
'overflow': '',
'margin-right': ''
} );
$j( 'html' ).removeClass( 'owp-qv-open' );
qv_modal.fadeOut();
qv_modal.removeClass( 'is-visible' );
setTimeout( function() {
qv_content.html( '' );
}, 600);
};
/**
* Close quick view.
*/
$j( '.owp-qv-overlay, .owp-qv-close' ).on( 'click', function( e ) {
e.preventDefault();
owpCloseQuickView();
} );
/**
* Check if user has pressed 'Esc'.
*/
$j( document ).keyup( function( e ) {
if ( e.keyCode == 27 ) {
owpCloseQuickView();
}
} );
$j.fn.serializeArrayAll = function () {
var rCRLF = /\r?\n/g;
return this.map(function () {
return this.elements ? jQuery.makeArray(this.elements) : this;
}).map(function (i, elem) {
var val = jQuery(this).val();
if (val == null) {
return val == null
//If checkbox is unchecked
} else if (this.type == "checkbox" && this.checked == false) {
return {name: this.name, value: this.checked ? this.value : ''}
} else if (this.type == "radio" && this.checked == false) {
return {name: this.name, value: this.checked ? this.value : ''}
//default: all checkboxes = on
} else {
return jQuery.isArray(val) ?
jQuery.map(val, function (val, i) {
return {name: elem.name, value: val.replace(rCRLF, "\r\n")};
}) :
{name: elem.name, value: val.replace(rCRLF, "\r\n")};
}
}).get();
};
/**
* AddToCartHandler class.
*/
var owpQVAddToCartHandler = function() {
$j( document.body )
.on( 'click', '#owp-qv-content .product:not(.product-type-external) .single_add_to_cart_button', this.onAddToCart )
.on( 'added_to_cart', this.updateButton );
};
/**
* Handle the add to cart event.
*/
owpQVAddToCartHandler.prototype.onAddToCart = function( e ) {
e.preventDefault();
var button = $j( this ),
$form = $j( this ).closest('form.cart'),
data = $form.serializeArrayAll();
var is_valid = false;
$j.each(data, function (i, item) {
if (item.name === 'add-to-cart') {
is_valid = true;
return false;
}
})
if( is_valid ){
e.preventDefault();
}
else{
return;
}
$j(document.body).trigger('adding_to_cart', [button, data]);
button.removeClass( 'added' );
button.addClass( 'loading' );
// Ajax action.
$j.ajax ({
url: oceanwpLocalize.wc_ajax_url,
type: 'POST',
data : data,
success:function(results) {
$j( document.body ).trigger( 'wc_fragment_refresh' );
$j( document.body ).trigger( 'added_to_cart', [ results.fragments, results.cart_hash, button ] );
// Redirect to cart option
if ( oceanwpLocalize.cart_redirect_after_add === 'yes' ) {
window.location = oceanwpLocalize.cart_url;
return;
}
}
});
};
/**
* Update cart page elements after add to cart events.
*/
owpQVAddToCartHandler.prototype.updateButton = function( e, fragments, cart_hash, $button ) {
$button = typeof $button === 'undefined' ? false : $button;
if ( $button ) {
$button.removeClass( 'loading' );
$button.addClass( 'added' );
// View cart text.
if ( ! oceanwpLocalize.is_cart && $button.parent().find( '.added_to_cart' ).length === 0 ) {
$button.after( ' <a href="' + oceanwpLocalize.cart_url + '" class="added_to_cart wc-forward" title="' +
oceanwpLocalize.view_cart + '">' + oceanwpLocalize.view_cart + '</a>' );
}
}
};
/**
* Init owpAddToCartHandler.
*/
new owpQVAddToCartHandler();
});
@@ -0,0 +1 @@
var $j=jQuery.noConflict();$j(document).ready(function(){if("undefined"==typeof oceanwpLocalize)return!1;var d=$j("#owp-qv-wrap"),l=$j("#owp-qv-content");$j(document).on("click",".owp-quick-view",function(e){e.preventDefault();var t=$j(this),a=$j(this).data("product_id");t.parent().addClass("loading"),$j.ajax({url:oceanwpLocalize.ajax_url,data:{action:"oceanwp_product_quick_view",product_id:a},success:function(e){var t=$j("html").innerWidth();$j("html").css("overflow","hidden");var a=$j("html").innerWidth();$j("html").css("margin-right",a-t),$j("html").addClass("owp-qv-open"),l.html(e),d.fadeIn(),d.addClass("is-visible");var n=l.find(".variations_form");n.trigger("check_variations"),n.trigger("reset_image");var o=l.find(".variations_form");0<o.length&&(o.wc_variation_form(),o.find("select").change());var r=l.find(".owp-qv-image");1<r.find("li").length&&r.flexslider();var i,c=l.find("form.grouped_form");c&&(i=l.find("form.grouped_form").attr("action"),c.find(".group_table, button.single_add_to_cart_button").hide(),c.append(' <a href="'+i+'" class="button">'+oceanwpLocalize.grouped_text+"</a>"))}}).done(function(){t.parent().removeClass("loading")})});function t(){$j("html").css({overflow:"","margin-right":""}),$j("html").removeClass("owp-qv-open"),d.fadeOut(),d.removeClass("is-visible"),setTimeout(function(){l.html("")},600)}$j(".owp-qv-overlay, .owp-qv-close").on("click",function(e){e.preventDefault(),t()}),$j(document).keyup(function(e){27==e.keyCode&&t()}),$j.fn.serializeArrayAll=function(){var n=/\r?\n/g;return this.map(function(){return this.elements?jQuery.makeArray(this.elements):this}).map(function(e,a){var t=jQuery(this).val();return null==t?null==t:"checkbox"==this.type&&0==this.checked||"radio"==this.type&&0==this.checked?{name:this.name,value:this.checked?this.value:""}:jQuery.isArray(t)?jQuery.map(t,function(e,t){return{name:a.name,value:e.replace(n,"\r\n")}}):{name:a.name,value:t.replace(n,"\r\n")}}).get()};function e(){$j(document.body).on("click","#owp-qv-content .product:not(.product-type-external) .single_add_to_cart_button",this.onAddToCart).on("added_to_cart",this.updateButton)}e.prototype.onAddToCart=function(e){e.preventDefault();var t=$j(this),a=$j(this).closest("form.cart").serializeArrayAll(),n=!1;$j.each(a,function(e,t){if("add-to-cart"===t.name)return!(n=!0)}),n&&(e.preventDefault(),$j(document.body).trigger("adding_to_cart",[t,a]),t.removeClass("added"),t.addClass("loading"),$j.ajax({url:oceanwpLocalize.wc_ajax_url,type:"POST",data:a,success:function(e){$j(document.body).trigger("wc_fragment_refresh"),$j(document.body).trigger("added_to_cart",[e.fragments,e.cart_hash,t]),"yes"!==oceanwpLocalize.cart_redirect_after_add||(window.location=oceanwpLocalize.cart_url)}}))},e.prototype.updateButton=function(e,t,a,n){(n=void 0!==n&&n)&&(n.removeClass("loading"),n.addClass("added"),oceanwpLocalize.is_cart||0!==n.parent().find(".added_to_cart").length||n.after(' <a href="'+oceanwpLocalize.cart_url+'" class="added_to_cart wc-forward" title="'+oceanwpLocalize.view_cart+'">'+oceanwpLocalize.view_cart+"</a>"))},new e});
@@ -0,0 +1 @@
var $j=jQuery.noConflict();function oceanwpWooAccountLinks(){"use strict";var o,t,e,a;$j(".owp-account-links").hasClass("registration-disabled")||(o=$j(".owp-account-links .login a"),t=$j(".owp-account-links .register a"),e=$j("#customer_login .col-1"),a=$j("#customer_login .col-2"),o.on("click",function(){return $j(this).addClass("current"),t.removeClass("current"),e.siblings().stop().fadeOut(function(){e.fadeIn()}),!1}),t.on("click",function(){return $j(this).addClass("current"),o.removeClass("current"),a.siblings().stop().fadeOut(function(){a.fadeIn()}),!1}))}function oceanwpWooGridList(){"use strict";var o;$j("body").hasClass("has-grid-list")?(o=function(){!$j("body").hasClass("no-carousel")&&$j(".woo-entry-image.product-entry-slider").length&&setTimeout(function(){$j(".woo-entry-image.product-entry-slider").slick("unslick"),oceanwpInitCarousel()},350)},$j("#oceanwp-grid").on("click",function(){return o(),$j(this).addClass("active"),$j("#oceanwp-list").removeClass("active"),Cookies.set("gridcookie","grid",{path:""}),$j(".woocommerce ul.products").fadeOut(300,function(){$j(this).addClass("grid").removeClass("list").fadeIn(300)}),!1}),$j("#oceanwp-list").on("click",function(){return o(),$j(this).addClass("active"),$j("#oceanwp-grid").removeClass("active"),Cookies.set("gridcookie","list",{path:""}),$j(".woocommerce ul.products").fadeOut(300,function(){$j(this).addClass("list").removeClass("grid").fadeIn(300)}),!1}),"grid"==Cookies.get("gridcookie")&&($j(".oceanwp-grid-list #oceanwp-grid").addClass("active"),$j(".oceanwp-grid-list #oceanwp-list").removeClass("active"),$j(".woocommerce ul.products").addClass("grid").removeClass("list")),"list"==Cookies.get("gridcookie")&&($j(".oceanwp-grid-list #oceanwp-list").addClass("active"),$j(".oceanwp-grid-list #oceanwp-grid").removeClass("active"),$j(".woocommerce ul.products").addClass("list").removeClass("grid"))):Cookies.remove("gridcookie",{path:""})}function oceanwpWooQuantityButtons(i){var o,t;$cart=$j(".woocommerce div.product form.cart"),i=i||".qty",(o=$j("div.quantity:not(.buttons_added), td.quantity:not(.buttons_added)").find(i))&&"date"!==o.prop("type")&&"hidden"!==o.prop("type")&&(o.parent().addClass("buttons_added").prepend('<a href="javascript:void(0)" class="minus">-</a>'),o.after('<a href="javascript:void(0)" class="plus">+</a>'),$j("input"+i+":not(.product-quantity input"+i+")").each(function(){var o=parseFloat($j(this).attr("min"));o&&0<o&&parseFloat($j(this).val())<o&&$j(this).val(o)}),!$j("body").hasClass("single-product")||"on"!=oceanwpLocalize.floating_bar||$cart.hasClass("grouped_form")||$cart.hasClass("cart_group")||(t=$j(".woocommerce form input[type=number].qty")).on("keyup",function(){var o=$j(this).val();t.val(o)}),$j(".plus, .minus").unbind("click"),$j(".plus, .minus").on("click",function(){var o=!$j("body").hasClass("single-product")||"on"!=oceanwpLocalize.floating_bar||$cart.hasClass("grouped_form")||$cart.hasClass("cart_group")?$j(this).closest(".quantity").find(i):$j(".plus, .minus").closest(".quantity").find(i),t=parseFloat(o.val()),e=parseFloat(o.attr("max")),a=parseFloat(o.attr("min")),s=o.attr("step");t&&""!==t&&"NaN"!==t||(t=0),""!==e&&"NaN"!==e||(e=""),""!==a&&"NaN"!==a||(a=0),"any"!==s&&""!==s&&void 0!==s&&"NaN"!==parseFloat(s)||(s=1),$j(this).is(".plus")?e&&(e==t||e<t)?o.val(e):o.val(t+parseFloat(s)):a&&(a==t||t<a)?o.val(a):0<t&&o.val(t-parseFloat(s)),o.trigger("change")}))}function oceanwpWooReviewsScroll(){"use strict";$j(".woocommerce div.product .woocommerce-review-link").click(function(o){return $j(".woocommerce-tabs .description_tab").removeClass("active"),$j(".woocommerce-tabs .reviews_tab").addClass("active"),$j(".woocommerce-tabs #tab-description").css("display","none"),$j(".woocommerce-tabs #tab-reviews").css("display","block"),$j("html, body").stop(!0,!0).animate({scrollTop:$j(this.hash).offset().top-120},"normal"),!1})}function oceanwpWooRemoveBrackets(){"use strict";$j(".widget_layered_nav span.count, .widget_product_categories span.count").each(function(){var o=(o=$j(this).html()).substring(1,o.length-1);$j(this).html(o)})}$j(document).ready(function(){"use strict";oceanwpWooAccountLinks()}),($j=jQuery.noConflict())(document).ready(function(){"use strict";oceanwpWooGridList()}),($j=jQuery.noConflict())(window).ready(function(){"use strict";oceanwpWooQuantityButtons()}),$j(document).ajaxComplete(function(){"use strict";oceanwpWooQuantityButtons()}),($j=jQuery.noConflict())(document).ready(function(){"use strict";oceanwpWooReviewsScroll()}),($j=jQuery.noConflict())(document).ready(function(){"use strict";oceanwpWooRemoveBrackets()});
@@ -0,0 +1,53 @@
var $j = jQuery.noConflict();
$j( document ).ready( function() {
"use strict";
// Woo vertical thumbnails
oceanwpWooThumbnails();
} );
// On load
$j( window ).on( 'load', function() {
"use strict";
// Woo vertical thumbnails
oceanwpWooThumbnails();
} );
// On resize
$j( window ).on( 'resize', function() {
"use strict";
// Woo vertical thumbnails
oceanwpWooThumbnails();
} );
/* ==============================================
WOOCOMMERCE VERTICAL THUMBNAILS
============================================== */
function oceanwpWooThumbnails() {
"use strict"
var $thumbnails = $j( '.owp-thumbs-layout-vertical' ),
$nav = $thumbnails.find( '.flex-control-nav' );
if ( $nav.length > 0 ) {
if ( $j( window ).width() > 768 ) {
var $image_height = $thumbnails.find( '.flex-viewport' ).height(),
$nav_height = $thumbnails.find('.flex-control-nav').height();
if ( $nav_height > ( $image_height + 50 ) ) {
$nav.css( {
'max-height' : $image_height + 'px',
} );
}
} else {
$nav.css( {
'max-height' : '',
} );
}
}
}
@@ -0,0 +1 @@
var $j=jQuery.noConflict();function oceanwpWooThumbnails(){"use strict";var n,o=$j(".owp-thumbs-layout-vertical"),i=o.find(".flex-control-nav");0<i.length&&(768<$j(window).width()?(n=o.find(".flex-viewport").height())+50<o.find(".flex-control-nav").height()&&i.css({"max-height":n+"px"}):i.css({"max-height":""}))}$j(document).ready(function(){"use strict";oceanwpWooThumbnails()}),$j(window).on("load",function(){"use strict";oceanwpWooThumbnails()}),$j(window).on("resize",function(){"use strict";oceanwpWooThumbnails()});