Initial commit

This commit is contained in:
2018-09-13 20:49:49 +07:00
commit 32875f828d
82 changed files with 44319 additions and 0 deletions
+300
View File
@@ -0,0 +1,300 @@
/**
* Alpha Color Picker JS
*
* This file includes several helper functions and the core control JS.
*/
/**
* Override the stock color.js toString() method to add support for
* outputting RGBa or Hex.
*/
Color.prototype.toString = function( flag ) {
// If our no-alpha flag has been passed in, output RGBa value with 100% opacity.
// This is used to set the background color on the opacity slider during color changes.
if ( 'no-alpha' == flag ) {
return this.toCSS( 'rgba', '1' ).replace( /\s+/g, '' );
}
// If we have a proper opacity value, output RGBa.
if ( 1 > this._alpha ) {
return this.toCSS( 'rgba', this._alpha ).replace( /\s+/g, '' );
}
// Proceed with stock color.js hex output.
var hex = parseInt( this._color, 10 ).toString( 16 );
if ( this.error ) { return ''; }
if ( hex.length < 6 ) {
for ( var i = 6 - hex.length - 1; i >= 0; i-- ) {
hex = '0' + hex;
}
}
return '#' + hex;
};
/**
* Given an RGBa, RGB, or hex color value, return the alpha channel value.
*/
function acp_get_alpha_value_from_color( value ) {
var alphaVal;
// Remove all spaces from the passed in value to help our RGBa regex.
value = value.replace( / /g, '' );
if ( value.match( /rgba\(\d+\,\d+\,\d+\,([^\)]+)\)/ ) ) {
alphaVal = parseFloat( value.match( /rgba\(\d+\,\d+\,\d+\,([^\)]+)\)/ )[1] ).toFixed(2) * 100;
alphaVal = parseInt( alphaVal );
} else {
alphaVal = 100;
}
return alphaVal;
}
/**
* Force update the alpha value of the color picker object and maybe the alpha slider.
*/
function acp_update_alpha_value_on_color_control( alpha, $control, $alphaSlider, update_slider ) {
var iris, colorPicker, color;
iris = $control.data( 'a8cIris' );
colorPicker = $control.data( 'wpWpColorPicker' );
// Set the alpha value on the Iris object.
iris._color._alpha = alpha;
// Store the new color value.
color = iris._color.toString();
// Set the value of the input.
$control.val( color );
// Update the background color of the color picker.
colorPicker.toggler.css({
'background-color': color
});
// Maybe update the alpha slider itself.
if ( update_slider ) {
acp_update_alpha_value_on_alpha_slider( alpha, $alphaSlider );
}
// Update the color value of the color picker object.
$control.wpColorPicker( 'color', color );
}
/**
* Update the slider handle position and label.
*/
function acp_update_alpha_value_on_alpha_slider( alpha, $alphaSlider ) {
$alphaSlider.slider( 'value', alpha );
$alphaSlider.find( '.ui-slider-handle' ).text( alpha.toString() );
}
/**
* Initialization trigger.
*/
jQuery( document ).ready( function( $ ) {
// Loop over each control and transform it into our color picker.
$( '.alpha-color-control' ).each( function() {
// Scope the vars.
var $control, startingColor, paletteInput, showOpacity, defaultColor, palette,
colorPickerOptions, $container, $alphaSlider, alphaVal, sliderOptions;
// Store the control instance.
$control = $( this );
// Get a clean starting value for the option.
startingColor = $control.val().replace( /\s+/g, '' );
// Get some data off the control.
paletteInput = $control.attr( 'data-palette' );
showOpacity = $control.attr( 'data-show-opacity' );
defaultColor = $control.attr( 'data-default-color' );
// Process the palette.
if ( paletteInput.indexOf( '|' ) !== -1 ) {
palette = paletteInput.split( '|' );
} else if ( 'false' == paletteInput ) {
palette = false;
} else {
palette = true;
}
// Set up the options that we'll pass to wpColorPicker().
colorPickerOptions = {
change: function( event, ui ) {
var key, value, alpha, $transparency;
key = $control.attr( 'data-customize-setting-link' );
value = $control.wpColorPicker( 'color' );
// Set the opacity value on the slider handle when the default color button is clicked.
if ( defaultColor == value ) {
alpha = acp_get_alpha_value_from_color( value );
$alphaSlider.find( '.ui-slider-handle' ).text( alpha );
}
// Send ajax request to wp.customize to trigger the Save action.
wp.customize( key, function( obj ) {
obj.set( value );
});
$transparency = $container.find( '.transparency' );
// Always show the background color of the opacity slider at 100% opacity.
$transparency.css( 'background-color', ui.color.toString( 'no-alpha' ) );
},
palettes: palette // Use the passed in palette.
};
// Create the colorpicker.
$control.wpColorPicker( colorPickerOptions );
$container = $control.parents( '.wp-picker-container:first' );
// Insert our opacity slider.
$( '<div class="alpha-color-picker-container">' +
'<div class="min-click-zone click-zone"></div>' +
'<div class="max-click-zone click-zone"></div>' +
'<div class="alpha-slider"></div>' +
'<div class="transparency"></div>' +
'</div>' ).appendTo( $container.find( '.wp-picker-holder' ) );
$alphaSlider = $container.find( '.alpha-slider' );
// If starting value is in format RGBa, grab the alpha channel.
alphaVal = acp_get_alpha_value_from_color( startingColor );
// Set up jQuery UI slider() options.
sliderOptions = {
create: function( event, ui ) {
var value = $( this ).slider( 'value' );
// Set up initial values.
$( this ).find( '.ui-slider-handle' ).text( value );
$( this ).siblings( '.transparency ').css( 'background-color', startingColor );
},
value: alphaVal,
range: 'max',
step: 1,
min: 0,
max: 100,
animate: 300
};
// Initialize jQuery UI slider with our options.
$alphaSlider.slider( sliderOptions );
// Maybe show the opacity on the handle.
if ( 'true' == showOpacity ) {
$alphaSlider.find( '.ui-slider-handle' ).addClass( 'show-opacity' );
}
// Bind event handlers for the click zones.
$container.find( '.min-click-zone' ).on( 'click', function() {
acp_update_alpha_value_on_color_control( 0, $control, $alphaSlider, true );
});
$container.find( '.max-click-zone' ).on( 'click', function() {
acp_update_alpha_value_on_color_control( 100, $control, $alphaSlider, true );
});
// Bind event handler for clicking on a palette color.
$container.find( '.iris-palette' ).on( 'click', function() {
var color, alpha;
color = $( this ).css( 'background-color' );
alpha = acp_get_alpha_value_from_color( color );
acp_update_alpha_value_on_alpha_slider( alpha, $alphaSlider );
// Sometimes Iris doesn't set a perfect background-color on the palette,
// for example rgba(20, 80, 100, 0.3) becomes rgba(20, 80, 100, 0.298039).
// To compensante for this we round the opacity value on RGBa colors here
// and save it a second time to the color picker object.
if ( alpha != 100 ) {
color = color.replace( /[^,]+(?=\))/, ( alpha / 100 ).toFixed( 2 ) );
}
$control.wpColorPicker( 'color', color );
});
// Bind event handler for clicking on the 'Clear' button.
$container.find( '.button.wp-picker-clear' ).on( 'click', function() {
var key = $control.attr( 'data-customize-setting-link' );
// The #fff color is delibrate here. This sets the color picker to white instead of the
// defult black, which puts the color picker in a better place to visually represent empty.
$control.wpColorPicker( 'color', '#ffffff' );
// Set the actual option value to empty string.
wp.customize( key, function( obj ) {
obj.set( '' );
});
acp_update_alpha_value_on_alpha_slider( 100, $alphaSlider );
});
// Bind event handler for clicking on the 'Default' button.
$container.find( '.button.wp-picker-default' ).on( 'click', function() {
var alpha = acp_get_alpha_value_from_color( defaultColor );
acp_update_alpha_value_on_alpha_slider( alpha, $alphaSlider );
});
// Bind event handler for typing or pasting into the input.
$control.on( 'input', function() {
var value = $( this ).val();
var alpha = acp_get_alpha_value_from_color( value );
acp_update_alpha_value_on_alpha_slider( alpha, $alphaSlider );
});
// Update all the things when the slider is interacted with.
$alphaSlider.slider().on( 'slide', function( event, ui ) {
var alpha = parseFloat( ui.value ) / 100.0;
acp_update_alpha_value_on_color_control( alpha, $control, $alphaSlider, false );
// Change value shown on slider handle.
$( this ).find( '.ui-slider-handle' ).text( ui.value );
});
});
});
/**
* Sortable widget areas.
*/
jQuery( document ).ready( function($) {
/* Make it sortable. */
$( 'ul.my-multicheck-sortable-list' ).sortable({
handle: '.dashicons-menu',
axis: 'y',
update: function( e, ui ){
$('.my-multicheck-sortable-list input').trigger( 'change' );
}
});
/* On changing the value. */
$( "ul.my-multicheck-sortable-list li input" ).on( 'change', function(){
/* Get the value, and convert to string. */
this_checkboxes_values = $( this ).parents( 'ul.my-multicheck-sortable-list' ).find( 'li input' ).map( function(){
var active = '0';
if( $(this).prop("checked") ){
var active = '1';
}
return this.name + ':' + active;
}).get().join( ',' );
/* Add the value to hidden input. */
$( this ).parents( 'ul.my-multicheck-sortable-list' ).find( 'input[type="hidden"]' ).val( this_checkboxes_values ).trigger( 'change' );
});
});
+414
View File
@@ -0,0 +1,414 @@
/**
* This script adds the accessibility-ready responsive menus Genesis Framework child themes.
*
* @author StudioPress
* @link https://github.com/copyblogger/responsive-menus
* @version 1.1.3
* @license GPL-2.0+
*/
( function ( document, $, undefined ) {
'use strict';
var genesisMenuParams = typeof genesis_responsive_menu === 'undefined' ? '' : genesis_responsive_menu,
genesisMenusUnchecked = genesisMenuParams.menuClasses,
genesisMenus = {},
menusToCombine = [];
/**
* Validate the menus passed by the theme with what's being loaded on the page,
* and pass the new and accurate information to our new data.
* @param {genesisMenusUnchecked} Raw data from the localized script in the theme.
* @return {array} genesisMenus array gets populated with updated data.
* @return {array} menusToCombine array gets populated with relevant data.
*/
$.each( genesisMenusUnchecked, function( group ) {
// Mirror our group object to populate.
genesisMenus[group] = [];
// Loop through each instance of the specified menu on the page.
$.each( this, function( key, value ) {
var menuString = value,
$menu = $(value);
// If there is more than one instance, append the index and update array.
if ( $menu.length > 1 ) {
$.each( $menu, function( key, value ) {
var newString = menuString + '-' + key;
$(this).addClass( newString.replace( '.','' ) );
genesisMenus[group].push( newString );
if ( 'combine' === group ) {
menusToCombine.push( newString );
}
});
} else if ( $menu.length == 1 ) {
genesisMenus[group].push( menuString );
if ( 'combine' === group ) {
menusToCombine.push( menuString );
}
}
});
});
// Make sure there is something to use for the 'others' array.
if ( typeof genesisMenus.others == 'undefined' ) {
genesisMenus.others = [];
}
// If there's only one menu on the page for combining, push it to the 'others' array and nullify our 'combine' variable.
if ( menusToCombine.length == 1 ) {
genesisMenus.others.push( menusToCombine[0] );
genesisMenus.combine = null;
menusToCombine = null;
}
var genesisMenu = {},
mainMenuButtonClass = 'menu-toggle',
subMenuButtonClass = 'sub-menu-toggle',
responsiveMenuClass = 'genesis-responsive-menu';
// Initialize.
genesisMenu.init = function() {
// Exit early if there are no menus to do anything.
if ( $( _getAllMenusArray() ).length == 0 ) {
return;
}
var menuIconClass = typeof genesisMenuParams.menuIconClass !== 'undefined' ? genesisMenuParams.menuIconClass : 'dashicons-before dashicons-menu',
subMenuIconClass = typeof genesisMenuParams.subMenuIconClass !== 'undefined' ? genesisMenuParams.subMenuIconClass : 'dashicons-before dashicons-arrow-down-alt2',
toggleButtons = {
menu : $( '<button />', {
'class' : mainMenuButtonClass,
'aria-expanded' : false,
'aria-pressed' : false
} )
.append( genesisMenuParams.mainMenu )
.append( $( '<span />' ) ),
submenu : $( '<button />', {
'class' : subMenuButtonClass,
'aria-expanded' : false,
'aria-pressed' : false
} )
.append( $( '<span />', {
'class' : 'screen-reader-text',
'text' : genesisMenuParams.subMenu
} ) )
};
// Add the responsive menu class to the active menus.
_addResponsiveMenuClass();
// Add the main nav button to the primary menu, or exit the plugin.
_addMenuButtons( toggleButtons );
// Setup additional classes.
$( '.' + mainMenuButtonClass ).addClass( menuIconClass );
$( '.' + subMenuButtonClass ).addClass( subMenuIconClass );
$( '.' + mainMenuButtonClass ).on( 'click.genesisMenu-mainbutton', _mainmenuToggle ).each( _addClassID );
$( '.' + subMenuButtonClass ).on( 'click.genesisMenu-subbutton', _submenuToggle );
$( window ).on( 'resize.genesisMenu', _doResize ).triggerHandler( 'resize.genesisMenu' );
};
/**
* Add menu toggle button to appropriate menus.
* @param {toggleButtons} Object of menu buttons to use for toggles.
*/
function _addMenuButtons( toggleButtons ) {
// Apply sub menu toggle to each sub-menu found in the menuList.
$( _getMenuSelectorString( genesisMenus ) ).find( '.sub-menu' ).before( toggleButtons.submenu );
if ( menusToCombine !== null ) {
var menusToToggle = genesisMenus.others.concat( menusToCombine[0] );
// Only add menu button the primary menu and navs NOT in the combine variable.
$( _getMenuSelectorString( menusToToggle ) ).before( toggleButtons.menu );
} else {
// Apply the main menu toggle to all menus in the list.
$( _getMenuSelectorString( genesisMenus.others ) ).before( toggleButtons.menu );
}
}
/**
* Add the responsive menu class.
*/
function _addResponsiveMenuClass() {
$( _getMenuSelectorString( genesisMenus ) ).addClass( responsiveMenuClass );
}
/**
* Execute our responsive menu functions on window resizing.
*/
function _doResize() {
var buttons = $( 'button[id^="genesis-mobile-"]' ).attr( 'id' );
if ( typeof buttons === 'undefined' ) {
return;
}
_maybeClose( buttons );
_superfishToggle( buttons );
_changeSkipLink( buttons );
_combineMenus( buttons );
}
/**
* Add the nav- class of the related navigation menu as
* an ID to associated button (helps target specific buttons outside of context).
*/
function _addClassID() {
var $this = $( this ),
nav = $this.next( 'nav' ),
id = 'class';
$this.attr( 'id', 'genesis-mobile-' + $( nav ).attr( id ).match( /nav-\w*\b/ ) );
}
/**
* Combine our menus if the mobile menu is visible.
* @params buttons
*/
function _combineMenus( buttons ){
// Exit early if there are no menus to combine.
if ( menusToCombine == null ) {
return;
}
// Split up the menus to combine based on order of appearance in the array.
var primaryMenu = menusToCombine[0],
combinedMenus = $( menusToCombine ).filter( function(index) { if ( index > 0 ) { return index; } });
// If the responsive menu is active, append items in 'combinedMenus' object to the 'primaryMenu' object.
if ( 'none' !== _getDisplayValue( buttons ) ) {
$.each( combinedMenus, function( key, value ) {
$(value).find( '.menu > li' ).addClass( 'moved-item-' + value.replace( '.','' ) ).appendTo( primaryMenu + ' ul.genesis-nav-menu' );
});
$( _getMenuSelectorString( combinedMenus ) ).hide();
} else {
$( _getMenuSelectorString( combinedMenus ) ).show();
$.each( combinedMenus, function( key, value ) {
$( '.moved-item-' + value.replace( '.','' ) ).appendTo( value + ' ul.genesis-nav-menu' ).removeClass( 'moved-item-' + value.replace( '.','' ) );
});
}
}
/**
* Action to happen when the main menu button is clicked.
*/
function _mainmenuToggle() {
var $this = $( this );
_toggleAria( $this, 'aria-pressed' );
_toggleAria( $this, 'aria-expanded' );
$this.toggleClass( 'activated' );
//$this.next( 'nav' ).slideToggle( 'fast' );
$this.next( 'nav' ).toggleClass( 'activated' );
}
/**
* Action for submenu toggles.
*/
function _submenuToggle() {
var $this = $( this ),
others = $this.closest( '.menu-item' ).siblings();
_toggleAria( $this, 'aria-pressed' );
_toggleAria( $this, 'aria-expanded' );
$this.toggleClass( 'activated' );
$this.next( '.sub-menu' ).slideToggle( 'fast' );
others.find( '.' + subMenuButtonClass ).removeClass( 'activated' ).attr( 'aria-pressed', 'false' );
others.find( '.sub-menu' ).slideUp( 'fast' );
}
/**
* Activate/deactivate superfish.
* @params buttons
*/
function _superfishToggle( buttons ) {
var _superfish = $( '.' + responsiveMenuClass + ' .js-superfish' ),
$args = 'destroy';
if ( typeof _superfish.superfish !== 'function' ) {
return;
}
if ( 'none' === _getDisplayValue( buttons ) ) {
$args = {
'delay': 100,
'animation': {'opacity': 'show', 'height': 'show'},
'dropShadows': false,
'speed': 'fast'
};
}
_superfish.superfish( $args );
}
/**
* Modify skip link to match mobile buttons.
* @param buttons
*/
function _changeSkipLink( buttons ) {
// Start with an empty array.
var menuToggleList = _getAllMenusArray();
// Exit out if there are no menu items to update.
if ( ! $( menuToggleList ).length > 0 ) {
return;
}
$.each( menuToggleList, function ( key, value ) {
var newValue = value.replace( '.', '' ),
startLink = 'genesis-' + newValue,
endLink = 'genesis-mobile-' + newValue;
if ( 'none' == _getDisplayValue( buttons ) ) {
startLink = 'genesis-mobile-' + newValue;
endLink = 'genesis-' + newValue;
}
var $item = $( '.genesis-skip-link a[href="#' + startLink + '"]' );
if ( menusToCombine !== null && value !== menusToCombine[0] ) {
$item.toggleClass( 'skip-link-hidden' );
}
if ( $item.length > 0 ) {
var link = $item.attr( 'href' );
link = link.replace( startLink, endLink );
$item.attr( 'href', link );
} else {
return;
}
});
}
/**
* Close all the menu toggles if buttons are hidden.
* @param buttons
*/
function _maybeClose( buttons ) {
if ( 'none' !== _getDisplayValue( buttons ) ) {
return true;
}
$( '.' + mainMenuButtonClass + ', .' + responsiveMenuClass + ' .sub-menu-toggle' )
.removeClass( 'activated' )
.attr( 'aria-expanded', false )
.attr( 'aria-pressed', false );
$( '.' + responsiveMenuClass + ', .' + responsiveMenuClass + ' .sub-menu' )
.attr( 'style', '' );
}
/**
* Generic function to get the display value of an element.
* @param {id} $id ID to check
* @return {string} CSS value of display property
*/
function _getDisplayValue( $id ) {
var element = document.getElementById( $id ),
style = window.getComputedStyle( element );
return style.getPropertyValue( 'display' );
}
/**
* Toggle aria attributes.
* @param {button} $this passed through
* @param {aria-xx} attribute aria attribute to toggle
* @return {bool} from _ariaReturn
*/
function _toggleAria( $this, attribute ) {
$this.attr( attribute, function( index, value ) {
return 'false' === value;
});
}
/**
* Helper function to return a comma separated string of menu selectors.
* @param {itemArray} Array of menu items to loop through.
* @param {ignoreSecondary} boolean of whether to ignore the 'secondary' menu item.
* @return {string} Comma-separated string.
*/
function _getMenuSelectorString( itemArray ) {
var itemString = $.map( itemArray, function( value, key ) {
return value;
});
return itemString.join( ',' );
}
/**
* Helper function to return a group array of all the menus in
* both the 'others' and 'combine' arrays.
* @return {array} Array of all menu items as class selectors.
*/
function _getAllMenusArray() {
// Start with an empty array.
var menuList = [];
// If there are menus in the 'menusToCombine' array, add them to 'menuList'.
if ( menusToCombine !== null ) {
$.each( menusToCombine, function( key, value ) {
menuList.push( value.valueOf() );
});
}
// Add menus in the 'others' array to 'menuList'.
$.each( genesisMenus.others, function( key, value ) {
menuList.push( value.valueOf() );
});
if ( menuList.length > 0 ) {
return menuList;
} else {
return null;
}
}
$(document).ready(function () {
if ( _getAllMenusArray() !== null ) {
genesisMenu.init();
}
});
})( document, jQuery );
+1
View File
@@ -0,0 +1 @@
function acp_get_alpha_value_from_color(a){var t;return(a=a.replace(/ /g,"")).match(/rgba\(\d+\,\d+\,\d+\,([^\)]+)\)/)?(t=100*parseFloat(a.match(/rgba\(\d+\,\d+\,\d+\,([^\)]+)\)/)[1]).toFixed(2),t=parseInt(t)):t=100,t}function acp_update_alpha_value_on_color_control(a,t,e,l){var o,i,r;o=t.data("a8cIris"),i=t.data("wpWpColorPicker"),o._color._alpha=a,r=o._color.toString(),t.val(r),i.toggler.css({"background-color":r}),l&&acp_update_alpha_value_on_alpha_slider(a,e),t.wpColorPicker("color",r)}function acp_update_alpha_value_on_alpha_slider(a,t){t.slider("value",a),t.find(".ui-slider-handle").text(a.toString())}Color.prototype.toString=function(a){if("no-alpha"==a)return this.toCSS("rgba","1").replace(/\s+/g,"");if(1>this._alpha)return this.toCSS("rgba",this._alpha).replace(/\s+/g,"");var t=parseInt(this._color,10).toString(16);if(this.error)return"";if(t.length<6)for(var e=6-t.length-1;e>=0;e--)t="0"+t;return"#"+t},jQuery(document).ready(function(a){a(".alpha-color-control").each(function(){var t,e,l,o,i,r,c,n,p;t=a(this),e=t.val().replace(/\s+/g,""),l=t.attr("data-palette"),o=t.attr("data-show-opacity"),i=t.attr("data-default-color"),r={change:function(a,e){var l,o,r;l=t.attr("data-customize-setting-link"),o=t.wpColorPicker("color"),i==o&&(r=acp_get_alpha_value_from_color(o),n.find(".ui-slider-handle").text(r)),wp.customize(l,function(a){a.set(o)}),c.find(".transparency").css("background-color",e.color.toString("no-alpha"))},palettes:-1!==l.indexOf("|")?l.split("|"):"false"!=l},t.wpColorPicker(r),c=t.parents(".wp-picker-container:first"),a('<div class="alpha-color-picker-container"><div class="min-click-zone click-zone"></div><div class="max-click-zone click-zone"></div><div class="alpha-slider"></div><div class="transparency"></div></div>').appendTo(c.find(".wp-picker-holder")),n=c.find(".alpha-slider"),p={create:function(t,l){var o=a(this).slider("value");a(this).find(".ui-slider-handle").text(o),a(this).siblings(".transparency ").css("background-color",e)},value:acp_get_alpha_value_from_color(e),range:"max",step:1,min:0,max:100,animate:300},n.slider(p),"true"==o&&n.find(".ui-slider-handle").addClass("show-opacity"),c.find(".min-click-zone").on("click",function(){acp_update_alpha_value_on_color_control(0,t,n,!0)}),c.find(".max-click-zone").on("click",function(){acp_update_alpha_value_on_color_control(100,t,n,!0)}),c.find(".iris-palette").on("click",function(){var e,l;acp_update_alpha_value_on_alpha_slider(l=acp_get_alpha_value_from_color(e=a(this).css("background-color")),n),100!=l&&(e=e.replace(/[^,]+(?=\))/,(l/100).toFixed(2))),t.wpColorPicker("color",e)}),c.find(".button.wp-picker-clear").on("click",function(){var a=t.attr("data-customize-setting-link");t.wpColorPicker("color","#ffffff"),wp.customize(a,function(a){a.set("")}),acp_update_alpha_value_on_alpha_slider(100,n)}),c.find(".button.wp-picker-default").on("click",function(){acp_update_alpha_value_on_alpha_slider(acp_get_alpha_value_from_color(i),n)}),t.on("input",function(){acp_update_alpha_value_on_alpha_slider(acp_get_alpha_value_from_color(a(this).val()),n)}),n.slider().on("slide",function(e,l){acp_update_alpha_value_on_color_control(parseFloat(l.value)/100,t,n,!1),a(this).find(".ui-slider-handle").text(l.value)})})}),jQuery(document).ready(function(a){a("ul.my-multicheck-sortable-list").sortable({handle:".dashicons-menu",axis:"y",update:function(t,e){a(".my-multicheck-sortable-list input").trigger("change")}}),a("ul.my-multicheck-sortable-list li input").on("change",function(){this_checkboxes_values=a(this).parents("ul.my-multicheck-sortable-list").find("li input").map(function(){t="0";if(a(this).prop("checked"))var t="1";return this.name+":"+t}).get().join(","),a(this).parents("ul.my-multicheck-sortable-list").find('input[type="hidden"]').val(this_checkboxes_values).trigger("change")})});
+1
View File
@@ -0,0 +1 @@
!function(e,n,s){"use strict";function a(e){if(n(m(C)).find(".sub-menu").before(e.submenu),null!==y){var s=C.others.concat(y[0]);n(m(s)).before(e.menu)}else n(m(C.others)).before(e.menu)}function t(){n(m(C)).addClass(k)}function i(){var e=n('button[id^="genesis-mobile-"]').attr("id");void 0!==e&&(f(e),c(e),d(e),o(e))}function u(){var e=n(this),s=e.next("nav");e.attr("id","genesis-mobile-"+n(s).attr("class").match(/nav-\w*\b/))}function o(e){if(null!=y){var s=y[0],a=n(y).filter(function(e){if(e>0)return e});"none"!==p(e)?(n.each(a,function(e,a){n(a).find(".menu > li").addClass("moved-item-"+a.replace(".","")).appendTo(s+" ul.genesis-nav-menu")}),n(m(a)).hide()):(n(m(a)).show(),n.each(a,function(e,s){n(".moved-item-"+s.replace(".","")).appendTo(s+" ul.genesis-nav-menu").removeClass("moved-item-"+s.replace(".",""))}))}}function r(){var e=n(this);h(e,"aria-pressed"),h(e,"aria-expanded"),e.toggleClass("activated"),e.next("nav").toggleClass("activated")}function l(){var e=n(this),s=e.closest(".menu-item").siblings();h(e,"aria-pressed"),h(e,"aria-expanded"),e.toggleClass("activated"),e.next(".sub-menu").slideToggle("fast"),s.find("."+M).removeClass("activated").attr("aria-pressed","false"),s.find(".sub-menu").slideUp("fast")}function c(e){var s=n("."+k+" .js-superfish"),a="destroy";"function"==typeof s.superfish&&("none"===p(e)&&(a={delay:100,animation:{opacity:"show",height:"show"},dropShadows:!1,speed:"fast"}),s.superfish(a))}function d(e){var s=g();!n(s).length>0||n.each(s,function(s,a){var t=a.replace(".",""),i="genesis-"+t,u="genesis-mobile-"+t;"none"==p(e)&&(i="genesis-mobile-"+t,u="genesis-"+t);var o=n('.genesis-skip-link a[href="#'+i+'"]');if(null!==y&&a!==y[0]&&o.toggleClass("skip-link-hidden"),o.length>0){var r=o.attr("href");r=r.replace(i,u),o.attr("href",r)}})}function f(e){if("none"!==p(e))return!0;n("."+x+", ."+k+" .sub-menu-toggle").removeClass("activated").attr("aria-expanded",!1).attr("aria-pressed",!1),n("."+k+", ."+k+" .sub-menu").attr("style","")}function p(n){var s=e.getElementById(n);return window.getComputedStyle(s).getPropertyValue("display")}function h(e,n){e.attr(n,function(e,n){return"false"===n})}function m(e){return n.map(e,function(e,n){return e}).join(",")}function g(){var e=[];return null!==y&&n.each(y,function(n,s){e.push(s.valueOf())}),n.each(C.others,function(n,s){e.push(s.valueOf())}),e.length>0?e:null}var v="undefined"==typeof genesis_responsive_menu?"":genesis_responsive_menu,b=v.menuClasses,C={},y=[];n.each(b,function(e){C[e]=[],n.each(this,function(s,a){var t=a,i=n(a);i.length>1?n.each(i,function(s,a){var i=t+"-"+s;n(this).addClass(i.replace(".","")),C[e].push(i),"combine"===e&&y.push(i)}):1==i.length&&(C[e].push(t),"combine"===e&&y.push(t))})}),void 0===C.others&&(C.others=[]),1==y.length&&(C.others.push(y[0]),C.combine=null,y=null);var w={},x="menu-toggle",M="sub-menu-toggle",k="genesis-responsive-menu";w.init=function(){if(0!=n(g()).length){var e=void 0!==v.menuIconClass?v.menuIconClass:"dashicons-before dashicons-menu",s=void 0!==v.subMenuIconClass?v.subMenuIconClass:"dashicons-before dashicons-arrow-down-alt2",o={menu:n("<button />",{class:x,"aria-expanded":!1,"aria-pressed":!1}).append(v.mainMenu).append(n("<span />")),submenu:n("<button />",{class:M,"aria-expanded":!1,"aria-pressed":!1}).append(n("<span />",{class:"screen-reader-text",text:v.subMenu}))};t(),a(o),n("."+x).addClass(e),n("."+M).addClass(s),n("."+x).on("click.genesisMenu-mainbutton",r).each(u),n("."+M).on("click.genesisMenu-subbutton",l),n(window).on("resize.genesisMenu",i).triggerHandler("resize.genesisMenu")}},n(e).ready(function(){null!==g()&&w.init()})}(document,jQuery);
+1
View File
@@ -0,0 +1 @@
!function(n,e,s){function o(n,e){return typeof n===e}var a=[],t=[],i={_version:"3.5.0",_config:{classPrefix:"",enableClasses:!0,enableJSClass:!0,usePrefixes:!0},_q:[],on:function(n,e){var s=this;setTimeout(function(){e(s[n])},0)},addTest:function(n,e,s){t.push({name:n,fn:e,options:s})},addAsyncTest:function(n){t.push({name:null,fn:n})}},l=function(){};l.prototype=i,l=new l;var f=e.documentElement,r="svg"===f.nodeName.toLowerCase();(function(){var n,e,s,i,f,r,c;for(var u in t)if(t.hasOwnProperty(u)){if(n=[],(e=t[u]).name&&(n.push(e.name.toLowerCase()),e.options&&e.options.aliases&&e.options.aliases.length))for(s=0;s<e.options.aliases.length;s++)n.push(e.options.aliases[s].toLowerCase());for(i=o(e.fn,"function")?e.fn():e.fn,f=0;f<n.length;f++)r=n[f],1===(c=r.split(".")).length?l[c[0]]=i:(!l[c[0]]||l[c[0]]instanceof Boolean||(l[c[0]]=new Boolean(l[c[0]])),l[c[0]][c[1]]=i),a.push((i?"":"no-")+c.join("-"))}})(),function(n){var e=f.className,s=l._config.classPrefix||"";if(r&&(e=e.baseVal),l._config.enableJSClass){var o=new RegExp("(^|\\s)"+s+"no-js(\\s|$)");e=e.replace(o,"$1"+s+"js$2")}l._config.enableClasses&&(e+=" "+s+n.join(" "+s),r?f.className.baseVal=e:f.className=e)}(a),delete i.addTest,delete i.addAsyncTest;for(var c=0;c<l._q.length;c++)l._q[c]();n.Modernizr=l}(window,document),jQuery(document).ready(function(n){Modernizr.objectfit||n(".slick-slide").each(function(){var e=n(this),s=e.find("img").prop("src");s&&e.css("backgroundImage","url("+s+")").addClass("no-object-fit")})});
+1
View File
File diff suppressed because one or more lines are too long
+158
View File
@@ -0,0 +1,158 @@
/**
* Add any custom theme JavaScript to this file.
*/
( function ( document, $ ) {
/**
* Add shrink class to header on scroll.
*/
$( window ).scroll( function () {
var scroll = $( window ).scrollTop();
var height = $( '.hero-section' ).outerHeight();
var header = $( '.before-header' ).outerHeight();
var siteheader = $( '.site-header' ).outerHeight();
if ( scroll >= 1 ) {
$( '.site-header' ).addClass( 'shrink' );
$('.bumper').removeClass('hidden');
} else {
$( '.site-header' ).removeClass( 'shrink' );
$('.bumper').addClass('hidden');
}
} );
$(".site-header").after('<div class="bumper hidden"></div>');
/*
* Search form toggle.
*/
$( '.site-header .search-form' ).append( '<a href="javascript:document.getElementsByName(\"s\").focus()" class="search-toggle"></a>' );
$( '.site-header .search-toggle' ).on( 'click', function () {
$( this ).toggleClass( 'active' );
$( '.nav-primary .menu-item' ).fadeToggle();
$( '.site-header .search-form input[type="search"]' ).fadeToggle();
} );
/*
* Send icon button enews footer.
*/
$( '.site-footer .enews form' ).append( '<span class="send-icon"></span>' );
/*
* Move before header into nav on mobile.
*/
$( window ).on( "resize", function () {
if ( $( window ).width() < 896 ) {
$( '.before-header' ).appendTo( '.nav-primary .menu' );
} else {
$( '.before-header' ).prependTo( '.site-header' );
$( '.nav-primary .menu .before-header' ).remove();
}
} ).resize();
/*
* Object fit fallback
*/
jQuery( document ).ready( function ( $ ) {
if ( !Modernizr.objectfit ) {
$( '.front-page-9' ).each( function () {
var $container = $( this ),
imgUrl = $container.find( 'img' ).prop( 'src' );
if ( imgUrl ) {
$container.css( 'backgroundImage', 'url(' + imgUrl + ')' ).addClass( 'no-object-fit' );
}
$container.find( 'img' ).css( 'display', 'none' );
} );
}
} );
/*
* Logo slider.
*/
jQuery( document ).ready( function ( $ ) {
$( '.front-page-2 .gallery' ).slick( {
dots: false,
infinite: true,
speed: 1000,
arrows: false,
autoplay: true,
autoplaySpeed: 5000,
fade: false,
slidesToShow: 2,
slidesToScroll: 1,
mobileFirst: true,
responsive: [ {
breakpoint: 384,
settings: {
slidesToShow: 3,
}
}, {
breakpoint: 768,
settings: {
slidesToShow: 4,
}
}, {
breakpoint: 896,
settings: {
slidesToShow: 5,
}
}, {
breakpoint: 1152,
settings: {
slidesToShow: 6,
}
} ]
} )
} );
/**
* Smooth scrolling.
*/
// Select all links with hashes
$( 'a[href*="#"]' )
// Remove links that don't actually link to anything
.not( '[href="#"]' ).not( '[href="#0"]' )
// Remove WooCommerce tabs
.not( '[href*="#tab-"]' ).click( function ( event ) {
// On-page links
if ( location.pathname.replace( /^\//, '' ) == this.pathname.replace( /^\//, '' ) && location.hostname == this.hostname ) {
// Figure out element to scroll to
var target = $( this.hash );
target = target.length ? target : $( '[name=' + this.hash.slice( 1 ) + ']' );
// Does a scroll target exist?
if ( target.length ) {
// Only prevent default if animation is actually gonna happen
event.preventDefault();
$( 'html, body' ).animate( {
scrollTop: target.offset().top
}, 1000, function () {
// Callback after animation, must change focus!
var $target = $( target );
$target.focus();
// Checking if the target was focused
if ( $target.is( ":focus" ) ) {
return false;
} else {
// Adding tabindex for elements not focusable
$target.attr( 'tabindex', '-1' );
// Set focus again
$target.focus();
};
} );
}
}
} );
} )( document, jQuery );
+1
View File
@@ -0,0 +1 @@
!function(e,o){o(window).scroll(function(){var e=o(window).scrollTop();o(".hero-section").outerHeight(),o(".before-header").outerHeight(),o(".site-header").outerHeight();1<=e?(o(".site-header").addClass("shrink"),o(".bumper").removeClass("hidden")):(o(".site-header").removeClass("shrink"),o(".bumper").addClass("hidden"))}),o(".site-header").after('<div class="bumper hidden"></div>'),o(".site-header .search-form").append('<a href="javascript:document.getElementsByName("s").focus()" class="search-toggle"></a>'),o(".site-header .search-toggle").on("click",function(){o(this).toggleClass("active"),o(".nav-primary .menu-item").fadeToggle(),o('.site-header .search-form input[type="search"]').fadeToggle()}),o(".site-footer .enews form").append('<span class="send-icon"></span>'),o(window).on("resize",function(){o(window).width()<896?o(".before-header").appendTo(".nav-primary .menu"):(o(".before-header").prependTo(".site-header"),o(".nav-primary .menu .before-header").remove())}).resize(),jQuery(e).ready(function(o){Modernizr.objectfit||o(".front-page-9").each(function(){var e=o(this),s=e.find("img").prop("src");s&&e.css("backgroundImage","url("+s+")").addClass("no-object-fit"),e.find("img").css("display","none")})}),jQuery(e).ready(function(e){e(".front-page-2 .gallery").slick({dots:!1,infinite:!0,speed:1e3,arrows:!1,autoplay:!0,autoplaySpeed:5e3,fade:!1,slidesToShow:2,slidesToScroll:1,mobileFirst:!0,responsive:[{breakpoint:384,settings:{slidesToShow:3}},{breakpoint:768,settings:{slidesToShow:4}},{breakpoint:896,settings:{slidesToShow:5}},{breakpoint:1152,settings:{slidesToShow:6}}]})}),o('a[href*="#"]').not('[href="#"]').not('[href="#0"]').not('[href*="#tab-"]').click(function(e){if(location.pathname.replace(/^\//,"")==this.pathname.replace(/^\//,"")&&location.hostname==this.hostname){var s=o(this.hash);(s=s.length?s:o("[name="+this.hash.slice(1)+"]")).length&&(e.preventDefault(),o("html, body").animate({scrollTop:s.offset().top},1e3,function(){var e=o(s);if(e.focus(),e.is(":focus"))return!1;e.attr("tabindex","-1"),e.focus()}))}})}(document,jQuery);
+80
View File
@@ -0,0 +1,80 @@
/*! modernizr 3.5.0 (Custom Build) | MIT *
* https://modernizr.com/download/?-setclasses !*/
! function (n, e, s) {
function o(n, e) {
return typeof n === e
}
function a() {
var n, e, s, a, i, l, r;
for (var c in f)
if (f.hasOwnProperty(c)) {
if (n = [], e = f[c], e.name && (n.push(e.name.toLowerCase()), e.options && e.options.aliases && e.options.aliases.length))
for (s = 0; s < e.options.aliases.length; s++) n.push(e.options.aliases[s].toLowerCase());
for (a = o(e.fn, "function") ? e.fn() : e.fn, i = 0; i < n.length; i++) l = n[i], r = l.split("."), 1 === r.length ? Modernizr[r[0]] = a : (!Modernizr[r[0]] || Modernizr[r[0]] instanceof Boolean || (Modernizr[r[0]] = new Boolean(Modernizr[r[0]])), Modernizr[r[0]][r[1]] = a), t.push((a ? "" : "no-") + r.join("-"))
}
}
function i(n) {
var e = r.className,
s = Modernizr._config.classPrefix || "";
if (c && (e = e.baseVal), Modernizr._config.enableJSClass) {
var o = new RegExp("(^|\\s)" + s + "no-js(\\s|$)");
e = e.replace(o, "$1" + s + "js$2")
}
Modernizr._config.enableClasses && (e += " " + s + n.join(" " + s), c ? r.className.baseVal = e : r.className = e)
}
var t = [],
f = [],
l = {
_version: "3.5.0",
_config: {
classPrefix: "",
enableClasses: !0,
enableJSClass: !0,
usePrefixes: !0
},
_q: [],
on: function (n, e) {
var s = this;
setTimeout(function () {
e(s[n])
}, 0)
},
addTest: function (n, e, s) {
f.push({
name: n,
fn: e,
options: s
})
},
addAsyncTest: function (n) {
f.push({
name: null,
fn: n
})
}
},
Modernizr = function () {};
Modernizr.prototype = l, Modernizr = new Modernizr;
var r = e.documentElement,
c = "svg" === r.nodeName.toLowerCase();
a(), i(t), delete l.addTest, delete l.addAsyncTest;
for (var u = 0; u < Modernizr._q.length; u++) Modernizr._q[u]();
n.Modernizr = Modernizr
}(window, document);
/* Object fit fallback */
jQuery(document).ready(function ($) {
if ( ! Modernizr.objectfit ) {
$('.slick-slide').each(function () {
var $container = $(this),
imgUrl = $container.find('img').prop('src');
if (imgUrl) {
$container
.css('backgroundImage', 'url(' + imgUrl + ')').addClass('no-object-fit');
}
});
}
});
+3011
View File
File diff suppressed because it is too large Load Diff
+158
View File
@@ -0,0 +1,158 @@
/**
* Add any custom theme JavaScript to this file.
*/
( function ( document, $ ) {
/**
* Add shrink class to header on scroll.
*/
$( window ).scroll( function () {
var scroll = $( window ).scrollTop();
var height = $( '.hero-section' ).outerHeight();
var header = $( '.before-header' ).outerHeight();
var siteheader = $( '.site-header' ).outerHeight();
if ( scroll >= 1 ) {
$( '.site-header' ).addClass( 'shrink' );
$('.bumper').removeClass('hidden');
} else {
$( '.site-header' ).removeClass( 'shrink' );
$('.bumper').addClass('hidden');
}
} );
$(".site-header").after('<div class="bumper hidden"></div>');
/*
* Search form toggle.
*/
$( '.site-header .search-form' ).append( '<a href="javascript:document.getElementsByName(\"s\").focus()" class="search-toggle"></a>' );
$( '.site-header .search-toggle' ).on( 'click', function () {
$( this ).toggleClass( 'active' );
$( '.nav-primary .menu-item' ).fadeToggle();
$( '.site-header .search-form input[type="search"]' ).fadeToggle();
} );
/*
* Send icon button enews footer.
*/
$( '.site-footer .enews form' ).append( '<span class="send-icon"></span>' );
/*
* Move before header into nav on mobile.
*/
$( window ).on( "resize", function () {
if ( $( window ).width() < 896 ) {
$( '.before-header' ).appendTo( '.nav-primary .menu' );
} else {
$( '.before-header' ).prependTo( '.site-header' );
$( '.nav-primary .menu .before-header' ).remove();
}
} ).resize();
/*
* Object fit fallback
*/
jQuery( document ).ready( function ( $ ) {
if ( !Modernizr.objectfit ) {
$( '.front-page-9' ).each( function () {
var $container = $( this ),
imgUrl = $container.find( 'img' ).prop( 'src' );
if ( imgUrl ) {
$container.css( 'backgroundImage', 'url(' + imgUrl + ')' ).addClass( 'no-object-fit' );
}
$container.find( 'img' ).css( 'display', 'none' );
} );
}
} );
/*
* Logo slider.
*/
jQuery( document ).ready( function ( $ ) {
$( '.front-page-2 .gallery' ).slick( {
dots: false,
infinite: true,
speed: 1000,
arrows: false,
autoplay: true,
autoplaySpeed: 5000,
fade: false,
slidesToShow: 2,
slidesToScroll: 1,
mobileFirst: true,
responsive: [ {
breakpoint: 384,
settings: {
slidesToShow: 3,
}
}, {
breakpoint: 768,
settings: {
slidesToShow: 4,
}
}, {
breakpoint: 896,
settings: {
slidesToShow: 5,
}
}, {
breakpoint: 1152,
settings: {
slidesToShow: 6,
}
} ]
} )
} );
/**
* Smooth scrolling.
*/
// Select all links with hashes
$( 'a[href*="#"]' )
// Remove links that don't actually link to anything
.not( '[href="#"]' ).not( '[href="#0"]' )
// Remove WooCommerce tabs
.not( '[href*="#tab-"]' ).click( function ( event ) {
// On-page links
if ( location.pathname.replace( /^\//, '' ) == this.pathname.replace( /^\//, '' ) && location.hostname == this.hostname ) {
// Figure out element to scroll to
var target = $( this.hash );
target = target.length ? target : $( '[name=' + this.hash.slice( 1 ) + ']' );
// Does a scroll target exist?
if ( target.length ) {
// Only prevent default if animation is actually gonna happen
event.preventDefault();
$( 'html, body' ).animate( {
scrollTop: target.offset().top
}, 1000, function () {
// Callback after animation, must change focus!
var $target = $( target );
$target.focus();
// Checking if the target was focused
if ( $target.is( ":focus" ) ) {
return false;
} else {
// Adding tabindex for elements not focusable
$target.attr( 'tabindex', '-1' );
// Set focus again
$target.focus();
};
} );
}
}
} );
} )( document, jQuery );