updated theme GeneratePress
version 3.5.1
This commit is contained in:
parent
e13bab0b76
commit
7dcace54d3
@ -1021,7 +1021,6 @@ a {
|
||||
.screen-reader-text {
|
||||
border: 0;
|
||||
clip: rect(1px, 1px, 1px, 1px);
|
||||
-webkit-clip-path: inset(50%);
|
||||
clip-path: inset(50%);
|
||||
height: 1px;
|
||||
margin: -1px;
|
||||
@ -1037,7 +1036,6 @@ a {
|
||||
border-radius: 3px;
|
||||
box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
|
||||
clip: auto !important;
|
||||
-webkit-clip-path: none;
|
||||
clip-path: none;
|
||||
color: #21759b;
|
||||
display: block;
|
||||
|
File diff suppressed because one or more lines are too long
@ -485,7 +485,6 @@ a {
|
||||
.screen-reader-text {
|
||||
border: 0;
|
||||
clip: rect(1px, 1px, 1px, 1px);
|
||||
-webkit-clip-path: inset(50%);
|
||||
clip-path: inset(50%);
|
||||
height: 1px;
|
||||
margin: -1px;
|
||||
@ -501,7 +500,6 @@ a {
|
||||
border-radius: 3px;
|
||||
box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
|
||||
clip: auto !important;
|
||||
-webkit-clip-path: none;
|
||||
clip-path: none;
|
||||
color: #21759b;
|
||||
display: block;
|
||||
|
File diff suppressed because one or more lines are too long
@ -567,7 +567,6 @@ a {
|
||||
.screen-reader-text {
|
||||
border: 0;
|
||||
clip: rect(1px, 1px, 1px, 1px);
|
||||
-webkit-clip-path: inset(50%);
|
||||
clip-path: inset(50%);
|
||||
height: 1px;
|
||||
margin: -1px;
|
||||
@ -583,7 +582,6 @@ a {
|
||||
border-radius: 3px;
|
||||
box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
|
||||
clip: auto !important;
|
||||
-webkit-clip-path: none;
|
||||
clip-path: none;
|
||||
color: #21759b;
|
||||
display: block;
|
||||
|
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
<?php return array('dependencies' => array('wp-data', 'wp-dom-ready', 'wp-element', 'wp-plugins'), 'version' => '166c384f313c8f5d9914');
|
||||
<?php return array('dependencies' => array('wp-dom-ready', 'wp-element', 'wp-plugins'), 'version' => '53a6a5a937a68e460003');
|
||||
|
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
<?php return array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-components', 'wp-element', 'wp-hooks', 'wp-i18n'), 'version' => '42a74b551d83e1b85238');
|
||||
<?php return array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-components', 'wp-element', 'wp-hooks', 'wp-i18n'), 'version' => '731b220042b06e3421fb');
|
||||
|
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
<?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-components', 'wp-element', 'wp-hooks', 'wp-i18n'), 'version' => 'dbc22cbe57941af36094');
|
||||
<?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-components', 'wp-element', 'wp-hooks', 'wp-i18n'), 'version' => '4fb4e80889b2568d409a');
|
||||
|
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
<?php return array('dependencies' => array(), 'version' => 'b4d4871691423abff87b');
|
||||
<?php return array('dependencies' => array(), 'version' => '8b4cabf5d14f1f64f94a');
|
||||
|
@ -1 +1 @@
|
||||
!function(){"use strict";function e(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function t(t){return function(t){if(Array.isArray(t))return e(t)}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(t,n){if(t){if("string"==typeof t)return e(t,n);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?e(t,n):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var n=function(e){var n=e.targetModal,r=e.openTrigger,o=e.triggers,a=void 0===o?[]:o,i=document.getElementById(n);if(i){var s={openTrigger:r,closeTrigger:"data-gpmodal-close",openClass:"gp-modal--open"},l="";a.length>0&&function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t.filter(Boolean).forEach((function(e){e.addEventListener("click",(function(e){e.preventDefault(),c()})),e.addEventListener("keydown",(function(e){" "!==e.key&&"Enter"!==e.key&&"Spacebar"!==e.key||(e.preventDefault(),c())}))}))}.apply(void 0,t(a))}function c(){i.classList.add("gp-modal--transition"),l=document.activeElement,i.classList.add(s.openClass),u("disable"),i.addEventListener("touchstart",f),i.addEventListener("click",f),document.addEventListener("keydown",g),function(){var e=v();if(0!==e.length){var t=e.filter((function(e){return!e.hasAttribute(s.closeTrigger)}));t.length>0&&t[0].focus(),0===t.length&&e[0].focus()}}(),setTimeout((function(){return i.classList.remove("gp-modal--transition")}),100)}function d(){i.classList.add("gp-modal--transition"),i.removeEventListener("touchstart",f),i.removeEventListener("click",f),document.removeEventListener("keydown",g),u("enable"),l&&l.focus&&l.focus(),i.classList.remove(s.openClass),setTimeout((function(){return i.classList.remove("gp-modal--transition")}),500)}function u(e){var t=document.querySelector("body");switch(e){case"enable":Object.assign(t.style,{overflow:""});break;case"disable":Object.assign(t.style,{overflow:"hidden"})}}function f(e){(e.target.hasAttribute(s.closeTrigger)||e.target.parentNode.hasAttribute(s.closeTrigger))&&(e.preventDefault(),e.stopPropagation(),d())}function g(e){27===e.keyCode&&d(),9===e.keyCode&&function(e){var t=v();if(0!==t.length){var n=(t=t.filter((function(e){return null!==e.offsetParent}))).indexOf(document.activeElement);e.shiftKey&&0===n&&(t[t.length-1].focus(),e.preventDefault()),!e.shiftKey&&t.length>0&&n===t.length-1&&(t[0].focus(),e.preventDefault())}}(e)}function v(){var e=i.querySelectorAll(["a[href]","area[href]",'input:not([disabled]):not([type="hidden"]):not([aria-hidden])',"select:not([disabled]):not([aria-hidden])","textarea:not([disabled]):not([aria-hidden])","button:not([disabled]):not([aria-hidden])","iframe","object","embed","[contenteditable]",'[tabindex]:not([tabindex^="-"])']);return Array.apply(void 0,t(e))}},r=Object.assign({},{openTrigger:"data-gpmodal-trigger"}),o=t(document.querySelectorAll("[".concat(r.openTrigger,"]"))).reduce((function(e,t){var n=t.attributes[r.openTrigger].value;return e[n]=e[n]||[],e[n].push(t),e}),[]);for(var a in o){var i=o[a];r.targetModal=a,r.triggers=t(i),new n(r)}}();
|
||||
!function(){"use strict";function e(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function t(t){return function(t){if(Array.isArray(t))return e(t)}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(t,n){if(t){if("string"==typeof t)return e(t,n);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?e(t,n):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var n=function(e){var n=e.targetModal,r=e.openTrigger,o=e.triggers,a=void 0===o?[]:o,i=document.getElementById(n);if(i){var s={openTrigger:r,closeTrigger:"data-gpmodal-close",openClass:"gp-modal--open"},l="";a.length>0&&function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t.filter(Boolean).forEach((function(e){e.addEventListener("click",(function(e){e.preventDefault(),c()})),e.addEventListener("keydown",(function(e){" "!==e.key&&"Enter"!==e.key&&"Spacebar"!==e.key||(e.preventDefault(),c())}))}))}.apply(void 0,t(a))}function c(){i.classList.add("gp-modal--transition"),l=document.activeElement,i.classList.add(s.openClass),u("disable"),i.addEventListener("touchstart",f),i.addEventListener("click",f),document.addEventListener("keydown",g),function(){var e=v();if(0!==e.length){var t=e.filter((function(e){return!e.hasAttribute(s.closeTrigger)}));t.length>0&&t[0].focus(),0===t.length&&e[0].focus()}}(),setTimeout((function(){return i.classList.remove("gp-modal--transition")}),100)}function d(){i.classList.add("gp-modal--transition"),i.removeEventListener("touchstart",f),i.removeEventListener("click",f),document.removeEventListener("keydown",g),u("enable"),l&&l.focus&&l.focus(),i.classList.remove(s.openClass),setTimeout((function(){return i.classList.remove("gp-modal--transition")}),500)}function u(e){var t=document.querySelector("body");switch(e){case"enable":Object.assign(t.style,{overflow:""});break;case"disable":Object.assign(t.style,{overflow:"hidden"})}}function f(e){(e.target.hasAttribute(s.closeTrigger)||e.target.parentNode.hasAttribute(s.closeTrigger))&&(e.preventDefault(),e.stopPropagation(),d())}function g(e){27===e.keyCode&&d(),9===e.keyCode&&function(e){var t=v();if(0!==t.length){var n=(t=t.filter((function(e){return null!==e.offsetParent}))).indexOf(document.activeElement);e.shiftKey&&0===n&&(t[t.length-1].focus(),e.preventDefault()),!e.shiftKey&&t.length>0&&n===t.length-1&&(t[0].focus(),e.preventDefault())}}(e)}function v(){var e=i.querySelectorAll(["a[href]","area[href]",'input:not([disabled]):not([type="hidden"]):not([aria-hidden])',"select:not([disabled]):not([aria-hidden])","textarea:not([disabled]):not([aria-hidden])","button:not([disabled]):not([aria-hidden])","iframe","object","embed","[contenteditable]",'[tabindex]:not([tabindex^="-"])']);return Array.apply(void 0,t(e))}},r=Object.assign({},{openTrigger:"data-gpmodal-trigger"}),o=t(document.querySelectorAll("[".concat(r.openTrigger,"]"))).reduce((function(e,t){var n=t.attributes[r.openTrigger].value;return e[n]=e[n]||[],e[n].push(t),e}),[]);for(var a in o){var i=o[a];r.targetModal=a,r.triggers=t(i),new n(r)}}();
|
@ -1,4 +1,4 @@
|
||||
.generate-dashboard-page .wrap{margin-right:0}.generate-dashboard-page #wpcontent{padding-left:0}.generate-dashboard-page .update-nag{margin-bottom:20px;margin-left:22px}.generate-dashboard-page.edit-php #wpbody-content .wrap{margin:0;padding:0 20px}.generatepress-dashboard-header{align-items:center;background:#fff;border-bottom:1px solid #e2e4e7;display:flex;justify-content:space-between;padding:0 20px;text-align:center}.generatepress-dashboard-header h1{align-items:center;display:flex;font-size:17px;font-weight:600;padding-bottom:0}.generatepress-dashboard-header h1 svg{fill:#006eb7;height:1em;padding-right:10px;width:1em}.generatepress-dashboard-header__navigation{background:#fff;display:flex}.generatepress-dashboard-header__navigation a{align-items:center;color:inherit;display:flex;padding:1rem;text-decoration:none}.generatepress-dashboard-header__navigation a.active{box-shadow:inset 0 -3px #007cba;font-weight:600}.generatepress-dashboard{font-size:15px;margin:40px auto;max-width:1000px}.generatepress-dashboard h2{font-size:25px;line-height:1.2em;margin:0}.generatepress-dashboard__placeholder.components-placeholder{background:none;box-shadow:none;margin-bottom:50px;outline:none;padding:0}.generatepress-dashboard__section-title{align-items:center;display:flex;margin-bottom:15px}.generatepress-dashboard__section-title>h2:first-child:not(:last-child){margin-right:10px}.generatepress-dashboard__section-description{margin-bottom:20px;margin-top:-10px}.generatepress-dashboard__section-description p{font-size:15px;margin:0}.generatepress-dashboard__section{color:#555;margin-bottom:50px}.generatepress-dashboard__section-item{align-items:center;background:#fff;display:flex;justify-content:space-between;padding:20px}.generatepress-dashboard__section-item:not(:last-child){border-bottom:1px solid #ddd}.generatepress-dashboard__section-item-title{font-weight:600}.generatepress-dashboard__section-item-action{align-items:center;display:flex;padding-left:20px}.generatepress-dashboard__section-item-action>:not(:last-child){margin-right:10px}.generatepress-dashboard__section-item-action .is-primary .components-spinner{background:rgba(0,0,0,.1);border-radius:100%;margin-top:0}.generatepress-dashboard__section-item-description{color:#80879a;font-size:13px;margin-top:3px}.generatepress-dashboard__section-item-message{background:#fafafa;border-radius:3px;box-shadow:1px 1px 1px rgba(0,0,0,.05);color:#555;display:none;font-size:12px;padding:5px 10px}.generatepress-dashboard__section-item-message__show{color:green;display:inline}.generatepress-dashboard__section-item-message__error{color:red}.generatepress-dashboard__reset-button.is-primary{background-color:#e02a2a}.generatepress-dashboard__reset-button.is-primary:hover:not(:disabled){background-color:darkred}@media(max-width:768px){.generatepress-dashboard-header{flex-direction:column}.generatepress-dashboard{padding-left:20px;padding-right:20px}}
|
||||
.generate-dashboard-page .wrap{margin-right:0}.generate-dashboard-page #wpcontent{padding-left:0}.generate-dashboard-page .update-nag{margin-bottom:20px;margin-left:22px}.generate-dashboard-page.edit-php #wpbody-content .wrap{margin:0;padding:0 20px}.generatepress-dashboard-header{align-items:center;background:#fff;border-bottom:1px solid #e2e4e7;display:flex;justify-content:space-between;padding:0 20px;text-align:center}.generatepress-dashboard-header h1{align-items:center;display:flex;font-size:17px;font-weight:600;padding-bottom:0}.generatepress-dashboard-header h1 svg{fill:#006eb7;height:1em;padding-right:10px;width:1em}.generatepress-dashboard-header__navigation{background:#fff;display:flex}.generatepress-dashboard-header__navigation a{align-items:center;color:inherit;display:flex;padding:1rem;text-decoration:none}.generatepress-dashboard-header__navigation a.active{box-shadow:inset 0 -3px #007cba;font-weight:600}.generatepress-dashboard{font-size:15px;margin:40px auto;max-width:1000px;padding:0 30px}.generatepress-dashboard h2{font-size:25px;line-height:1.2em;margin:0}.generatepress-dashboard__placeholder.components-placeholder{background:none;box-shadow:none;margin-bottom:50px;outline:none;padding:0}.generatepress-dashboard__section-title{align-items:center;display:flex;margin-bottom:15px}.generatepress-dashboard__section-title>h2:first-child:not(:last-child){margin-right:10px}.generatepress-dashboard__section-description{margin-bottom:20px;margin-top:-10px}.generatepress-dashboard__section-description p{font-size:15px;margin:0}.generatepress-dashboard__section{color:#555;margin-bottom:50px}.generatepress-dashboard__section-item{align-items:center;background:#fff;display:flex;justify-content:space-between;padding:20px}.generatepress-dashboard__section-item:not(:last-child){border-bottom:1px solid #ddd}.generatepress-dashboard__section-item-title{font-weight:600}.generatepress-dashboard__section-item-action{align-items:center;display:flex;padding-left:20px}.generatepress-dashboard__section-item-action>:not(:last-child){margin-right:10px}.generatepress-dashboard__section-item-action .is-primary .components-spinner{background:rgba(0,0,0,.1);border-radius:100%;margin-top:0}.generatepress-dashboard__section-item-description{color:#80879a;font-size:13px;margin-top:3px}.generatepress-dashboard__section-item-message{background:#fafafa;border-radius:3px;box-shadow:1px 1px 1px rgba(0,0,0,.05);color:#555;display:none;font-size:12px;padding:5px 10px}.generatepress-dashboard__section-item-message__show{color:green;display:inline}.generatepress-dashboard__section-item-message__error{color:red}.generatepress-dashboard__reset-button.is-primary{background-color:#e02a2a}.generatepress-dashboard__reset-button.is-primary:hover:not(:disabled){background-color:darkred}@media(max-width:768px){.generatepress-dashboard-header{flex-direction:column}.generatepress-dashboard{padding-left:20px;padding-right:20px}}
|
||||
.generatepress-start-customizing{color:#555;display:flex;flex-wrap:wrap;margin-left:-30px}.generatepress-start-customizing__item{background:#fff;box-shadow:0 0 2px rgba(0,0,0,.1);box-sizing:border-box;margin-bottom:30px;margin-left:30px;padding:30px;width:calc(50% - 30px)}.generatepress-start-customizing__icon{align-items:center;background:#1e72bd;border-radius:100%;color:#fff;display:flex;height:50px;justify-content:center;margin-bottom:25px;width:50px}.generatepress-start-customizing__title{font-weight:500;margin-bottom:1em}.generatepress-start-customizing__description{font-weight:300;line-height:1.5em;margin-bottom:1em}.generatepress-start-customizing__action{margin-top:auto}.generatepress-start-customizing__pro{background:#f0544f;border-radius:2px;color:#fff;display:inline-block;font-size:11px;margin-left:5px;padding:0 5px}
|
||||
.generatepress-dashboard__premium{color:#555;display:flex;flex-wrap:wrap;margin-left:-30px}.generatepress-dashboard__premium-item{background:#fff;box-shadow:0 0 2px rgba(0,0,0,.1);box-sizing:border-box;flex-grow:1;margin-bottom:30px;margin-left:30px;padding:30px;width:calc(50% - 30px)}.generatepress-dashboard__premium-item-icon{align-items:center;background:#1e72bd;border-radius:100%;color:#fff;display:flex;height:50px;justify-content:center;margin-bottom:25px;width:50px}.generatepress-dashboard__premium-item-icon svg{height:25px;width:25px}.generatepress-dashboard__premium-item-title{align-items:center;display:flex;font-size:17px;font-weight:500;margin-bottom:10px}.generatepress-dashboard__premium-item-description{font-weight:300;line-height:1.5em;margin-bottom:1em}.generatepress-dashboard__premium-item-action{margin-top:auto}.generatepress-dashboard__premium-item-pro{background:#f0544f;border-radius:2px;color:#fff;display:inline-block;font-size:11px;margin-left:5px;padding:0 5px}
|
||||
.generatepress-dashboard__section-item-modules{margin-top:20px}
|
||||
|
@ -1 +1 @@
|
||||
!function(){"use strict";var c;"querySelector"in document&&"addEventListener"in window&&(c=document.querySelector(".generate-back-to-top"),c)&&(window.addEventListener("scroll",function(){var e=window.pageYOffset,t=c.getAttribute("data-start-scroll");t<e&&c.classList.add("generate-back-to-top__show"),e<t&&c.classList.remove("generate-back-to-top__show")}),c.addEventListener("click",function(e){var t,o,n,a,r;e.preventDefault(),generatepressBackToTop.smooth?(document.body,e=c.getAttribute("data-scroll-speed")||400,t=window.pageYOffset,o=document.body.offsetTop,n=(o-t)/(e/16),a=function(){window.pageYOffset<=(o||0)&&(clearInterval(r),document.activeElement.blur())},r=setInterval(function(){window.scrollBy(0,n),a()},16)):window.scrollTo(0,0)},!1))}();
|
||||
(()=>{var c;"querySelector"in document&&"addEventListener"in window&&(c=document.querySelector(".generate-back-to-top"))&&(window.addEventListener("scroll",function(){var e=window.pageYOffset,t=c.getAttribute("data-start-scroll");t<e&&c.classList.add("generate-back-to-top__show"),e<t&&c.classList.remove("generate-back-to-top__show")}),c.addEventListener("click",function(e){var t,o,n,a,r;e.preventDefault(),generatepressBackToTop.smooth?(document.body,e=c.getAttribute("data-scroll-speed")||400,t=window.pageYOffset,o=document.body.offsetTop,n=(o-t)/(e/16),a=function(){window.pageYOffset<=(o||0)&&(clearInterval(r),document.activeElement.blur())},r=setInterval(function(){window.scrollBy(0,n),a()},16)):window.scrollTo(0,0)},!1))})();
|
@ -4,6 +4,7 @@
|
||||
if ( 'querySelector' in document && 'addEventListener' in window ) {
|
||||
var body = document.body,
|
||||
i;
|
||||
|
||||
/**
|
||||
* Dropdown click
|
||||
*
|
||||
@ -32,6 +33,7 @@
|
||||
// Add sfHover class to parent li
|
||||
closestLi.classList.toggle( 'sfHover' );
|
||||
|
||||
if ( body.classList.contains( 'dropdown-click-arrow' ) ) {
|
||||
// Set aria-expanded on arrow
|
||||
var dropdownToggle = closestLi.querySelector( '.dropdown-menu-toggle' );
|
||||
if ( 'false' === dropdownToggle.getAttribute( 'aria-expanded' ) || ! dropdownToggle.getAttribute( 'aria-expanded' ) ) {
|
||||
@ -39,11 +41,22 @@
|
||||
} else {
|
||||
dropdownToggle.setAttribute( 'aria-expanded', 'false' );
|
||||
}
|
||||
}
|
||||
|
||||
if ( body.classList.contains( 'dropdown-click-menu-item' ) && _this.tagName && 'A' === _this.tagName.toUpperCase() ) {
|
||||
if ( 'false' === _this.getAttribute( 'aria-expanded' ) || ! _this.getAttribute( 'aria-expanded' ) ) {
|
||||
_this.setAttribute( 'aria-expanded', 'true' );
|
||||
_this.setAttribute( 'aria-label', generatepressDropdownClick.closeSubMenuLabel );
|
||||
} else {
|
||||
_this.setAttribute( 'aria-expanded', 'false' );
|
||||
_this.setAttribute( 'aria-label', generatepressDropdownClick.openSubMenuLabel );
|
||||
}
|
||||
}
|
||||
|
||||
var subMenuSelector = '.children';
|
||||
|
||||
if ( closestLi.querySelector( '.sub-menu' ) ) {
|
||||
var subMenuSelector = '.sub-menu';
|
||||
} else {
|
||||
subMenuSelector = '.children';
|
||||
subMenuSelector = '.sub-menu';
|
||||
}
|
||||
|
||||
// Open the sub-menu
|
||||
@ -61,15 +74,24 @@
|
||||
if ( body.classList.contains( 'dropdown-click-menu-item' ) ) {
|
||||
for ( i = 0; i < parentElementLinks.length; i++ ) {
|
||||
parentElementLinks[ i ].addEventListener( 'click', dropdownClick, true );
|
||||
|
||||
parentElementLinks[ i ].addEventListener( 'keydown', function( e ) {
|
||||
var _this = this;
|
||||
|
||||
if ( 'Enter' === e.key || ' ' === e.key ) {
|
||||
e.preventDefault();
|
||||
dropdownClick( e, _this );
|
||||
}
|
||||
}, false );
|
||||
}
|
||||
}
|
||||
|
||||
// Open the sub-menu by clicking on a dropdown arrow
|
||||
if ( body.classList.contains( 'dropdown-click-arrow' ) ) {
|
||||
// Add a class to sub-menu items that are set to #
|
||||
for ( i = 0; i < document.querySelectorAll( '.main-nav .menu-item-has-children > a' ).length; i++ ) {
|
||||
if ( '#' === document.querySelectorAll( '.main-nav .menu-item-has-children > a' )[ i ].getAttribute( 'href' ) ) {
|
||||
document.querySelectorAll( '.main-nav .menu-item-has-children > a' )[ i ].classList.add( 'menu-item-dropdown-click' );
|
||||
for ( i = 0; i < parentElementLinks.length; i++ ) {
|
||||
if ( '#' === parentElementLinks[ i ].getAttribute( 'href' ) ) {
|
||||
parentElementLinks[ i ].classList.add( 'menu-item-dropdown-click' );
|
||||
}
|
||||
}
|
||||
|
||||
@ -80,30 +102,55 @@
|
||||
dropdownToggleLinks[ i ].addEventListener( 'keydown', function( e ) {
|
||||
var _this = this;
|
||||
|
||||
if ( 'Enter' === e.key ) {
|
||||
if ( 'Enter' === e.key || ' ' === e.key ) {
|
||||
e.preventDefault();
|
||||
dropdownClick( e, _this );
|
||||
}
|
||||
}, false );
|
||||
}
|
||||
|
||||
for ( i = 0; i < document.querySelectorAll( '.main-nav .menu-item-has-children > a.menu-item-dropdown-click' ).length; i++ ) {
|
||||
document.querySelectorAll( '.main-nav .menu-item-has-children > a.menu-item-dropdown-click' )[ i ].addEventListener( 'click', dropdownClick, false );
|
||||
const menuItemDropdownClick = document.querySelectorAll( '.main-nav .menu-item-has-children > a.menu-item-dropdown-click' );
|
||||
|
||||
for ( i = 0; i < menuItemDropdownClick.length; i++ ) {
|
||||
menuItemDropdownClick[ i ].addEventListener( 'click', dropdownClick, false );
|
||||
|
||||
menuItemDropdownClick[ i ].addEventListener( 'keydown', function( e ) {
|
||||
var _this = this;
|
||||
|
||||
if ( 'Enter' === e.key || ' ' === e.key ) {
|
||||
e.preventDefault();
|
||||
dropdownClick( e, _this );
|
||||
}
|
||||
}, false );
|
||||
}
|
||||
}
|
||||
|
||||
var closeSubMenus = function() {
|
||||
if ( document.querySelector( 'nav ul .toggled-on' ) ) {
|
||||
var activeSubMenus = document.querySelectorAll( 'nav ul .toggled-on' );
|
||||
var activeDropdownToggles = document.querySelectorAll( 'nav .dropdown-menu-toggle' );
|
||||
|
||||
for ( i = 0; i < activeSubMenus.length; i++ ) {
|
||||
activeSubMenus[ i ].classList.remove( 'toggled-on' );
|
||||
activeSubMenus[ i ].closest( '.sfHover' ).classList.remove( 'sfHover' );
|
||||
}
|
||||
|
||||
if ( body.classList.contains( 'dropdown-click-arrow' ) ) {
|
||||
var activeDropdownToggles = document.querySelectorAll( 'nav .dropdown-menu-toggle' );
|
||||
|
||||
for ( i = 0; i < activeDropdownToggles.length; i++ ) {
|
||||
activeDropdownToggles[ i ].setAttribute( 'aria-expanded', 'false' );
|
||||
}
|
||||
}
|
||||
|
||||
if ( body.classList.contains( 'dropdown-click-menu-item' ) ) {
|
||||
var activeDropdownLinks = document.querySelectorAll( 'nav .menu-item-has-children > a' );
|
||||
|
||||
for ( i = 0; i < activeDropdownLinks.length; i++ ) {
|
||||
activeDropdownLinks[ i ].setAttribute( 'aria-expanded', 'false' );
|
||||
activeDropdownLinks[ i ].setAttribute( 'aria-label', generatepressDropdownClick.openSubMenuLabel );
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Close sub-menus when clicking elsewhere
|
||||
|
@ -1 +1 @@
|
||||
!function(){"use strict";if("querySelector"in document&&"addEventListener"in window){var r=document.body,t=function(e,t){e.preventDefault(),e.stopPropagation();var e=(t=t||this).closest("li"),n=t.closest("nav").querySelectorAll("ul.toggled-on");if(n&&!t.closest("ul").classList.contains("toggled-on")&&!t.closest("li").classList.contains("sfHover"))for(var o=0;o<n.length;o++)n[o].classList.remove("toggled-on"),n[o].closest("li").classList.remove("sfHover");e.classList.toggle("sfHover");var l=e.querySelector(".dropdown-menu-toggle");"false"!==l.getAttribute("aria-expanded")&&l.getAttribute("aria-expanded")?l.setAttribute("aria-expanded","false"):l.setAttribute("aria-expanded","true"),l=e.querySelector(".sub-menu")?".sub-menu":".children",r.classList.contains("dropdown-click-menu-item")?t.parentNode.querySelector(l).classList.toggle("toggled-on"):r.classList.contains("dropdown-click-arrow")&&e.querySelector(l).classList.toggle("toggled-on")},e=document.querySelectorAll(".main-nav .menu-item-has-children > a");if(r.classList.contains("dropdown-click-menu-item"))for(o=0;o<e.length;o++)e[o].addEventListener("click",t,!0);if(r.classList.contains("dropdown-click-arrow")){for(o=0;o<document.querySelectorAll(".main-nav .menu-item-has-children > a").length;o++)"#"===document.querySelectorAll(".main-nav .menu-item-has-children > a")[o].getAttribute("href")&&document.querySelectorAll(".main-nav .menu-item-has-children > a")[o].classList.add("menu-item-dropdown-click");for(var n=document.querySelectorAll(".main-nav .menu-item-has-children > a .dropdown-menu-toggle"),o=0;o<n.length;o++)n[o].addEventListener("click",t,!1),n[o].addEventListener("keydown",function(e){"Enter"===e.key&&t(e,this)},!1);for(o=0;o<document.querySelectorAll(".main-nav .menu-item-has-children > a.menu-item-dropdown-click").length;o++)document.querySelectorAll(".main-nav .menu-item-has-children > a.menu-item-dropdown-click")[o].addEventListener("click",t,!1)}var l=function(){if(document.querySelector("nav ul .toggled-on")){var e=document.querySelectorAll("nav ul .toggled-on"),t=document.querySelectorAll("nav .dropdown-menu-toggle");for(o=0;o<e.length;o++)e[o].classList.remove("toggled-on"),e[o].closest(".sfHover").classList.remove("sfHover");for(o=0;o<t.length;o++)t[o].setAttribute("aria-expanded","false")}};document.addEventListener("click",function(e){e.target.closest(".sfHover")||l()},!1),document.addEventListener("keydown",function(e){"Escape"===e.key&&l()},!1)}}();
|
||||
(()=>{if("querySelector"in document&&"addEventListener"in window){var a=document.body,t=function(e,t){e.preventDefault(),e.stopPropagation();var e=(t=t||this).closest("li"),n=t.closest("nav").querySelectorAll("ul.toggled-on");if(n&&!t.closest("ul").classList.contains("toggled-on")&&!t.closest("li").classList.contains("sfHover"))for(var r=0;r<n.length;r++)n[r].classList.remove("toggled-on"),n[r].closest("li").classList.remove("sfHover");e.classList.toggle("sfHover"),a.classList.contains("dropdown-click-arrow")&&("false"!==(o=e.querySelector(".dropdown-menu-toggle")).getAttribute("aria-expanded")&&o.getAttribute("aria-expanded")?o.setAttribute("aria-expanded","false"):o.setAttribute("aria-expanded","true")),a.classList.contains("dropdown-click-menu-item")&&t.tagName&&"A"===t.tagName.toUpperCase()&&("false"!==t.getAttribute("aria-expanded")&&t.getAttribute("aria-expanded")?(t.setAttribute("aria-expanded","false"),t.setAttribute("aria-label",generatepressDropdownClick.openSubMenuLabel)):(t.setAttribute("aria-expanded","true"),t.setAttribute("aria-label",generatepressDropdownClick.closeSubMenuLabel)));var o=".children";e.querySelector(".sub-menu")&&(o=".sub-menu"),a.classList.contains("dropdown-click-menu-item")?t.parentNode.querySelector(o).classList.toggle("toggled-on"):a.classList.contains("dropdown-click-arrow")&&e.querySelector(o).classList.toggle("toggled-on")},e=document.querySelectorAll(".main-nav .menu-item-has-children > a");if(a.classList.contains("dropdown-click-menu-item"))for(r=0;r<e.length;r++)e[r].addEventListener("click",t,!0),e[r].addEventListener("keydown",function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),t(e,this))},!1);if(a.classList.contains("dropdown-click-arrow")){for(r=0;r<e.length;r++)"#"===e[r].getAttribute("href")&&e[r].classList.add("menu-item-dropdown-click");for(var n=document.querySelectorAll(".main-nav .menu-item-has-children > a .dropdown-menu-toggle"),r=0;r<n.length;r++)n[r].addEventListener("click",t,!1),n[r].addEventListener("keydown",function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),t(e,this))},!1);var o=document.querySelectorAll(".main-nav .menu-item-has-children > a.menu-item-dropdown-click");for(r=0;r<o.length;r++)o[r].addEventListener("click",t,!1),o[r].addEventListener("keydown",function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),t(e,this))},!1)}var s=function(){if(document.querySelector("nav ul .toggled-on")){var e=document.querySelectorAll("nav ul .toggled-on");for(r=0;r<e.length;r++)e[r].classList.remove("toggled-on"),e[r].closest(".sfHover").classList.remove("sfHover");if(a.classList.contains("dropdown-click-arrow")){var t=document.querySelectorAll("nav .dropdown-menu-toggle");for(r=0;r<t.length;r++)t[r].setAttribute("aria-expanded","false")}if(a.classList.contains("dropdown-click-menu-item")){var n=document.querySelectorAll("nav .menu-item-has-children > a");for(r=0;r<n.length;r++)n[r].setAttribute("aria-expanded","false"),n[r].setAttribute("aria-label",generatepressDropdownClick.openSubMenuLabel)}}};document.addEventListener("click",function(e){e.target.closest(".sfHover")||s()},!1),document.addEventListener("keydown",function(e){"Escape"===e.key&&s()},!1)}})();
|
@ -1,5 +1,33 @@
|
||||
( function() {
|
||||
'use strict';
|
||||
var allSubMenus = document.querySelectorAll( '.main-nav .sub-menu, .main-nav .children' );
|
||||
|
||||
// Add missing aria roles and attributes for accessibility.
|
||||
if ( allSubMenus ) {
|
||||
allSubMenus.forEach( function( subMenu ) {
|
||||
var parentLi = subMenu.closest( 'li' );
|
||||
var button = parentLi.querySelector( '.dropdown-menu-toggle[role="button"]' );
|
||||
|
||||
if ( ! subMenu.id ) {
|
||||
var itemId = parentLi.id
|
||||
? parentLi.id
|
||||
: 'menu-item-' + Math.floor( Math.random() * 100000 ); // Just in case our menu item has no ID.
|
||||
|
||||
subMenu.id = itemId + '-sub-menu';
|
||||
}
|
||||
|
||||
// Bail if no button to update
|
||||
if ( ! button ) {
|
||||
button = parentLi.querySelector( 'a[role="button"]' );
|
||||
|
||||
if ( ! button ) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
button.setAttribute( 'aria-controls', subMenu.id );
|
||||
} );
|
||||
}
|
||||
|
||||
if ( 'querySelector' in document && 'addEventListener' in window ) {
|
||||
/**
|
||||
@ -54,10 +82,15 @@
|
||||
var dropdownItems = nav.querySelectorAll( 'li.menu-item-has-children' );
|
||||
|
||||
for ( i = 0; i < dropdownItems.length; i++ ) {
|
||||
dropdownItems[ i ].querySelector( '.dropdown-menu-toggle' ).setAttribute( 'tabindex', '0' );
|
||||
dropdownItems[ i ].querySelector( '.dropdown-menu-toggle' ).setAttribute( 'role', 'button' );
|
||||
dropdownItems[ i ].querySelector( '.dropdown-menu-toggle' ).setAttribute( 'aria-expanded', 'false' );
|
||||
dropdownItems[ i ].querySelector( '.dropdown-menu-toggle' ).setAttribute( 'aria-label', generatepressMenu.openSubMenuLabel );
|
||||
var toggle = dropdownItems[ i ].querySelector( '.dropdown-menu-toggle' );
|
||||
var parentLi = toggle.closest( 'li' );
|
||||
var subMenu = parentLi.querySelector( '.sub-menu, .children' );
|
||||
|
||||
toggle.setAttribute( 'tabindex', '0' );
|
||||
toggle.setAttribute( 'role', 'button' );
|
||||
toggle.setAttribute( 'aria-expanded', 'false' );
|
||||
toggle.setAttribute( 'aria-controls', subMenu.id );
|
||||
toggle.setAttribute( 'aria-label', generatepressMenu.openSubMenuLabel );
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -70,6 +103,7 @@
|
||||
dropdownItems[ i ].querySelector( '.dropdown-menu-toggle' ).removeAttribute( 'tabindex' );
|
||||
dropdownItems[ i ].querySelector( '.dropdown-menu-toggle' ).setAttribute( 'role', 'presentation' );
|
||||
dropdownItems[ i ].querySelector( '.dropdown-menu-toggle' ).removeAttribute( 'aria-expanded' );
|
||||
dropdownItems[ i ].querySelector( '.dropdown-menu-toggle' ).removeAttribute( 'aria-controls' );
|
||||
dropdownItems[ i ].querySelector( '.dropdown-menu-toggle' ).removeAttribute( 'aria-label' );
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
!function(){"use strict";if("querySelector"in document&&"addEventListener"in window){var s=function(e,t){e.preventDefault(),t=t||this;var a=document.querySelectorAll(".navigation-search"),s=document.querySelectorAll(".search-item"),c=document.querySelectorAll('a[href], area[href], input:not([disabled]):not(.navigation-search), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex="0"]'),r="";t.closest(".mobile-menu-control-wrapper")&&(r=document.getElementById("site-navigation"));for(var i=0;i<a.length;i++)if(a[i].classList.contains("nav-search-active")){if(!a[i].closest("#sticky-placeholder")){a[i].classList.remove("nav-search-active");var n=document.querySelector(".has-active-search");n&&n.classList.remove("has-active-search");for(var o=0;o<s.length;o++){s[o].classList.remove("close-search"),s[o].classList.remove("active"),s[o].querySelector("a").setAttribute("aria-label",generatepressNavSearch.open);for(var l=0;l<c.length;l++)c[l].closest(".navigation-search")||c[l].closest(".search-item")||c[l].removeAttribute("tabindex")}document.activeElement.blur()}}else if(!a[i].closest("#sticky-placeholder")){var n=a[i].closest(".toggled"),d=(n&&n.querySelector("button.menu-toggle").click(),r&&r.classList.add("has-active-search"),a[i].classList.add("nav-search-active"),this.closest("nav"));for(d&&(d=(d=d.classList.contains("mobile-menu-control-wrapper")?r:d).querySelector(".search-field"))&&d.focus(),o=0;o<s.length;o++){for(s[o].classList.add("active"),s[o].querySelector("a").setAttribute("aria-label",generatepressNavSearch.close),l=0;l<c.length;l++)c[l].closest(".navigation-search")||c[l].closest(".search-item")||c[l].setAttribute("tabindex","-1");s[o].classList.add("close-search")}}};if(document.body.classList.contains("nav-search-enabled")){for(var e=document.querySelectorAll(".search-item"),t=0;t<e.length;t++)e[t].addEventListener("click",s,!1);document.addEventListener("keydown",function(e){if(document.querySelector(".navigation-search.nav-search-active")&&"Escape"===e.key)for(var t=document.querySelectorAll(".search-item.active"),a=0;a<t.length;a++){s(e,t[a]);break}},!1)}}}();
|
||||
(()=>{if("querySelector"in document&&"addEventListener"in window){var s=function(e,t){e.preventDefault(),t=t||this;var a=document.querySelectorAll(".navigation-search"),s=document.querySelectorAll(".search-item"),c=document.querySelectorAll('a[href], area[href], input:not([disabled]):not(.navigation-search), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex="0"]'),r="";t.closest(".mobile-menu-control-wrapper")&&(r=document.getElementById("site-navigation"));for(var o=0;o<a.length;o++)if(a[o].classList.contains("nav-search-active")){if(!a[o].closest("#sticky-placeholder")){a[o].classList.remove("nav-search-active");var i=document.querySelector(".has-active-search");i&&i.classList.remove("has-active-search");for(var l=0;l<s.length;l++){s[l].classList.remove("close-search"),s[l].classList.remove("active"),s[l].querySelector("a").setAttribute("aria-label",generatepressNavSearch.open);for(var n=0;n<c.length;n++)c[n].closest(".navigation-search")||c[n].closest(".search-item")||c[n].removeAttribute("tabindex")}document.activeElement.blur()}}else if(!a[o].closest("#sticky-placeholder")){var i=a[o].closest(".toggled"),d=(i&&i.querySelector("button.menu-toggle").click(),r&&r.classList.add("has-active-search"),a[o].classList.add("nav-search-active"),this.closest("nav"));for(d&&(d=(d=d.classList.contains("mobile-menu-control-wrapper")?r:d).querySelector(".search-field"))&&d.focus(),l=0;l<s.length;l++){for(s[l].classList.add("active"),s[l].querySelector("a").setAttribute("aria-label",generatepressNavSearch.close),n=0;n<c.length;n++)c[n].closest(".navigation-search")||c[n].closest(".search-item")||c[n].setAttribute("tabindex","-1");s[l].classList.add("close-search")}}};if(document.body.classList.contains("nav-search-enabled")){for(var e=document.querySelectorAll(".search-item"),t=0;t<e.length;t++)e[t].addEventListener("click",s,!1);document.addEventListener("keydown",function(e){if(document.querySelector(".navigation-search.nav-search-active")&&"Escape"===e.key)for(var t=document.querySelectorAll(".search-item.active"),a=0;a<t.length;a++){s(e,t[a]);break}},!1)}}})();
|
@ -64,7 +64,7 @@ do_action( 'generate_before_comments' );
|
||||
echo apply_filters(
|
||||
'generate_comments_title_output',
|
||||
sprintf(
|
||||
'<h3 class="comments-title">%s</h3>',
|
||||
'<h2 class="comments-title">%s</h2>',
|
||||
esc_html( $comments_title )
|
||||
),
|
||||
$comments_title,
|
||||
|
23
wp-content/themes/generatepress/footer-min.php
Normal file
23
wp-content/themes/generatepress/footer-min.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
* The template for displaying the footer.
|
||||
*
|
||||
* @package GeneratePress
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
/**
|
||||
* generate_after_footer hook.
|
||||
*
|
||||
* @since 2.1
|
||||
*/
|
||||
do_action( 'generate_minimal_footer' );
|
||||
|
||||
wp_footer();
|
||||
?>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -12,7 +12,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
||||
}
|
||||
|
||||
// Set our theme version.
|
||||
define( 'GENERATE_VERSION', '3.4.0' );
|
||||
define( 'GENERATE_VERSION', '3.5.1' );
|
||||
|
||||
if ( ! function_exists( 'generate_setup' ) ) {
|
||||
add_action( 'after_setup_theme', 'generate_setup' );
|
||||
|
28
wp-content/themes/generatepress/header-min.php
Normal file
28
wp-content/themes/generatepress/header-min.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/**
|
||||
* The template for displaying the header.
|
||||
*
|
||||
* @package GeneratePress
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
?><!DOCTYPE html>
|
||||
<html <?php language_attributes(); ?>>
|
||||
<head>
|
||||
<meta charset="<?php bloginfo( 'charset' ); ?>">
|
||||
<?php wp_head(); ?>
|
||||
</head>
|
||||
|
||||
<body <?php body_class(); ?>>
|
||||
<?php
|
||||
/**
|
||||
* wp_body_open hook.
|
||||
*
|
||||
* @since 2.3
|
||||
*/
|
||||
do_action( 'wp_body_open' ); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound -- core WP hook.
|
||||
|
||||
do_action( 'generate_minimal_header' );
|
@ -264,23 +264,23 @@ function generate_do_inline_block_editor_css( $for = 'block-content' ) {
|
||||
|
||||
if ( 'never' !== $underline_links ) {
|
||||
if ( 'always' === $underline_links ) {
|
||||
$css->set_selector( '.wp-block a' );
|
||||
$css->set_selector( ':where(.wp-block a)' );
|
||||
$css->add_property( 'text-decoration', 'underline' );
|
||||
}
|
||||
|
||||
if ( 'hover' === $underline_links ) {
|
||||
$css->set_selector( '.wp-block a' );
|
||||
$css->set_selector( ':where(.wp-block a)' );
|
||||
$css->add_property( 'text-decoration', 'none' );
|
||||
|
||||
$css->set_selector( '.wp-block a:hover, .wp-block a:focus' );
|
||||
$css->set_selector( ':where(.wp-block a:hover), :where(.wp-block a:focus)' );
|
||||
$css->add_property( 'text-decoration', 'underline' );
|
||||
}
|
||||
|
||||
if ( 'not-hover' === $underline_links ) {
|
||||
$css->set_selector( '.wp-block a' );
|
||||
$css->set_selector( ':where(.wp-block a)' );
|
||||
$css->add_property( 'text-decoration', 'underline' );
|
||||
|
||||
$css->set_selector( '.wp-block a:hover, .wp-block a:focus' );
|
||||
$css->set_selector( ':where(.wp-block a:hover), :where(.wp-block a:focus)' );
|
||||
$css->add_property( 'text-decoration', 'none' );
|
||||
}
|
||||
|
||||
@ -501,7 +501,7 @@ function generate_do_inline_block_editor_css( $for = 'block-content' ) {
|
||||
}
|
||||
}
|
||||
|
||||
$css->set_selector( 'a, a:visited' );
|
||||
$css->set_selector( 'a' );
|
||||
|
||||
if ( $color_settings['content_link_color'] ) {
|
||||
$css->add_property( 'color', $color_settings['content_link_color'] );
|
||||
|
@ -154,11 +154,12 @@ class GeneratePress_Dashboard {
|
||||
<?php
|
||||
foreach ( $tabs as $tab ) {
|
||||
printf(
|
||||
'<a href="%1$s" class="%2$s"%4$s>%3$s</a>',
|
||||
'<a href="%1$s" class="%2$s"%4$s%5$s>%3$s</a>',
|
||||
esc_url( $tab['url'] ),
|
||||
esc_attr( $tab['class'] ),
|
||||
esc_html( $tab['name'] ),
|
||||
! empty( $tab['external'] ) ? 'target="_blank" rel="noreferrer noopener"' : ''
|
||||
! empty( $tab['external'] ) ? 'target="_blank" rel="noreferrer noopener"' : '',
|
||||
esc_attr( ! empty( $tab['id'] ) ? 'id=' . $tab['id'] : '' )
|
||||
);
|
||||
}
|
||||
?>
|
||||
|
@ -245,6 +245,11 @@ if ( ! function_exists( 'generate_base_css' ) ) {
|
||||
|
||||
$css->set_selector( '.dropdown-click .sfHover > a > .dropdown-menu-toggle > .gp-icon svg' );
|
||||
$css->add_property( 'transform', 'rotate(180deg)' );
|
||||
|
||||
if ( 'click' === generate_get_option( 'nav_dropdown_type' ) ) {
|
||||
$css->set_selector( '.menu-item-has-children .dropdown-menu-toggle[role="presentation"]' );
|
||||
$css->add_property( 'pointer-events', 'none' );
|
||||
}
|
||||
}
|
||||
|
||||
$css->set_selector( ':root' );
|
||||
|
@ -53,7 +53,7 @@ class GeneratePress_Customize_Field {
|
||||
$control_args['type'] = 'generate-wrapper-control';
|
||||
|
||||
$wp_customize->add_control(
|
||||
new GeneratePress_Customize_React_Control(
|
||||
new GeneratePress_Customize_Wrapper_Control(
|
||||
$wp_customize,
|
||||
$id,
|
||||
$control_args
|
||||
|
@ -0,0 +1,97 @@
|
||||
<?php
|
||||
/**
|
||||
* Customize API: Wrapper class.
|
||||
*
|
||||
* @package GeneratePress
|
||||
*/
|
||||
|
||||
/**
|
||||
* Customize Wrapper Control class.
|
||||
*
|
||||
* @see WP_Customize_Control
|
||||
*/
|
||||
class GeneratePress_Customize_Wrapper_Control extends WP_Customize_Control {
|
||||
/**
|
||||
* Type.
|
||||
*
|
||||
* @access public
|
||||
* @since 1.0.0
|
||||
* @var string
|
||||
*/
|
||||
public $type = 'generate-wrapper-control';
|
||||
|
||||
/**
|
||||
* Refresh the parameters passed to the JavaScript via JSON.
|
||||
*
|
||||
* @since 3.4.0
|
||||
* @uses WP_Customize_Control::to_json()
|
||||
*/
|
||||
public function to_json() {
|
||||
parent::to_json();
|
||||
$this->json['choices'] = $this->choices;
|
||||
}
|
||||
|
||||
/**
|
||||
* Empty JS template.
|
||||
*
|
||||
* @access public
|
||||
* @since 1.0.0
|
||||
* @return void
|
||||
*/
|
||||
public function content_template() {}
|
||||
|
||||
/**
|
||||
* Empty PHP template.
|
||||
*
|
||||
* @access public
|
||||
* @since 1.0.0
|
||||
* @return void
|
||||
*/
|
||||
public function render_content() {
|
||||
$html_attributes = array(
|
||||
'class' => 'generate-customize-control-wrapper',
|
||||
'id' => $this->id,
|
||||
'data-wrapper-type' => $this->choices['type'],
|
||||
);
|
||||
|
||||
if ( ! empty( $this->choices['class'] ) ) {
|
||||
$html_attributes['class'] .= ' ' . $this->choices['class'];
|
||||
}
|
||||
|
||||
$attributes_string = '';
|
||||
|
||||
foreach ( $html_attributes as $attribute => $value ) {
|
||||
$attributes_string .= $attribute . '="' . esc_attr( $value ) . '" ';
|
||||
}
|
||||
|
||||
$this->toggleIdScript();
|
||||
?>
|
||||
<div <?php echo $attributes_string; // phpcs:ignore -- Escaped above. ?>>
|
||||
<?php
|
||||
foreach ( $this->choices['items'] as $wrapper ) {
|
||||
?>
|
||||
<div id="<?php echo esc_attr( $wrapper . '--wrapper' ); ?>"></div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a script to toggle the wrapper.
|
||||
*/
|
||||
public function toggleIdScript() {
|
||||
if ( ! empty( $this->choices['toggleId'] ) ) :
|
||||
?>
|
||||
<script>
|
||||
var liElement = document.getElementById( 'customize-control-<?php echo esc_js( $this->id ); ?>' );
|
||||
|
||||
if ( liElement ) {
|
||||
liElement.setAttribute('data-toggleId', '<?php echo esc_attr( $this->choices['toggleId'] ); ?>');
|
||||
}
|
||||
</script>
|
||||
<?php
|
||||
endif;
|
||||
}
|
||||
}
|
@ -17,6 +17,7 @@ require_once trailingslashit( dirname( __FILE__ ) ) . 'controls/class-react-cont
|
||||
require_once trailingslashit( dirname( __FILE__ ) ) . 'controls/class-color-control.php';
|
||||
require_once trailingslashit( dirname( __FILE__ ) ) . 'controls/class-range-control.php';
|
||||
require_once trailingslashit( dirname( __FILE__ ) ) . 'controls/class-typography-control.php';
|
||||
require_once trailingslashit( dirname( __FILE__ ) ) . 'controls/class-wrapper-control.php';
|
||||
require_once trailingslashit( dirname( __FILE__ ) ) . 'controls/class-upsell-section.php';
|
||||
require_once trailingslashit( dirname( __FILE__ ) ) . 'controls/class-upsell-control.php';
|
||||
require_once trailingslashit( dirname( __FILE__ ) ) . 'controls/class-deprecated.php';
|
||||
|
@ -38,6 +38,11 @@ GeneratePress_Customize_Field::add_wrapper(
|
||||
$buttons_selector = 'button, html input[type="button"], input[type="reset"], input[type="submit"], a.button, a.button:visited, a.wp-block-button__link:not(.has-background)';
|
||||
$buttons_hover_selector = 'button:hover, html input[type="button"]:hover, input[type="reset"]:hover, input[type="submit"]:hover, a.button:hover, button:focus, html input[type="button"]:focus, input[type="reset"]:focus, input[type="submit"]:focus, a.button:focus, a.wp-block-button__link:not(.has-background):active, a.wp-block-button__link:not(.has-background):focus, a.wp-block-button__link:not(.has-background):hover';
|
||||
|
||||
if ( defined( 'GP_PREMIUM_VERSION' ) && version_compare( GP_PREMIUM_VERSION, '2.4.1', '>' ) ) {
|
||||
$buttons_selector .= ', .wc-block-components-button';
|
||||
$buttons_hover_selector .= ', .wc-block-components-button:hover';
|
||||
}
|
||||
|
||||
GeneratePress_Customize_Field::add_field(
|
||||
'generate_settings[form_button_background_color]',
|
||||
'GeneratePress_Customize_Color_Control',
|
||||
|
@ -370,6 +370,12 @@ function generate_do_control_inline_scripts() {
|
||||
'palette' => $colors,
|
||||
'showGoogleFonts' => apply_filters( 'generate_font_manager_show_google_fonts', true ),
|
||||
'colorPickerShouldShift' => function_exists( 'did_filter' ),
|
||||
'gpFontLibrary' => class_exists( 'GeneratePress_Pro_Font_Library' )
|
||||
? GeneratePress_Pro_Font_Library::get_fonts()
|
||||
: array(),
|
||||
'gpFontLibraryURI' => class_exists( 'GeneratePress_Pro_Font_Library' )
|
||||
? GeneratePress_Pro_Font_Library::get_font_library_uri()
|
||||
: '',
|
||||
)
|
||||
);
|
||||
|
||||
|
@ -91,6 +91,15 @@ if ( ! function_exists( 'generate_scripts' ) ) {
|
||||
|
||||
if ( 'click' === generate_get_option( 'nav_dropdown_type' ) || 'click-arrow' === generate_get_option( 'nav_dropdown_type' ) ) {
|
||||
wp_enqueue_script( 'generate-dropdown-click', $dir_uri . "/assets/js/dropdown-click{$suffix}.js", array(), GENERATE_VERSION, true );
|
||||
|
||||
wp_localize_script(
|
||||
'generate-dropdown-click',
|
||||
'generatepressDropdownClick',
|
||||
array(
|
||||
'openSubMenuLabel' => esc_attr__( 'Open Sub-Menu', 'generatepress' ),
|
||||
'closeSubMenuLabel' => esc_attr__( 'Close Sub-Menu', 'generatepress' ),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
if ( apply_filters( 'generate_enable_modal_script', false ) ) {
|
||||
|
@ -222,7 +222,7 @@ if ( ! function_exists( 'generate_back_to_top' ) ) {
|
||||
echo apply_filters( // phpcs:ignore
|
||||
'generate_back_to_top_output',
|
||||
sprintf(
|
||||
'<a title="%1$s" aria-label="%1$s" rel="nofollow" href="#" class="generate-back-to-top" data-scroll-speed="%2$s" data-start-scroll="%3$s">
|
||||
'<a title="%1$s" aria-label="%1$s" rel="nofollow" href="#" class="generate-back-to-top" data-scroll-speed="%2$s" data-start-scroll="%3$s" role="button">
|
||||
%5$s
|
||||
</a>',
|
||||
esc_attr__( 'Scroll back to top', 'generatepress' ),
|
||||
|
@ -367,10 +367,15 @@ if ( ! function_exists( 'generate_dropdown_icon_to_menu_link' ) ) {
|
||||
function generate_dropdown_icon_to_menu_link( $title, $item, $args, $depth ) {
|
||||
$role = 'presentation';
|
||||
$tabindex = '';
|
||||
$aria_label = '';
|
||||
|
||||
if ( 'click-arrow' === generate_get_option( 'nav_dropdown_type' ) ) {
|
||||
$role = 'button';
|
||||
$tabindex = ' tabindex="0"';
|
||||
$aria_label = sprintf(
|
||||
' aria-label="%s"',
|
||||
esc_attr__( 'Open Sub-Menu', 'generatepress' )
|
||||
);
|
||||
}
|
||||
|
||||
if ( isset( $args->container_class ) && 'main-nav' === $args->container_class ) {
|
||||
@ -417,7 +422,7 @@ if ( ! function_exists( 'generate_dropdown_icon_to_menu_link' ) ) {
|
||||
}
|
||||
|
||||
$icon = generate_get_svg_icon( 'arrow' . $arrow_direction );
|
||||
$title = $title . '<span role="' . $role . '" class="dropdown-menu-toggle"' . $tabindex . '>' . $icon . '</span>';
|
||||
$title = $title . '<span role="' . $role . '" class="dropdown-menu-toggle"' . $tabindex . $aria_label . '>' . $icon . '</span>';
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -426,6 +431,37 @@ if ( ! function_exists( 'generate_dropdown_icon_to_menu_link' ) ) {
|
||||
}
|
||||
}
|
||||
|
||||
add_filter( 'nav_menu_link_attributes', 'generate_set_menu_item_link_attributes', 10, 4 );
|
||||
/**
|
||||
* Add attributes to the menu item link when using the Click - Menu Item option.
|
||||
*
|
||||
* @since 3.5.0
|
||||
*
|
||||
* @param array $atts The menu item attributes.
|
||||
* @param WP_Post $item The current menu item.
|
||||
* @param stdClass $args The menu item args.
|
||||
* @param int $depth The depth of the menu item.
|
||||
* @return array The menu item attributes.
|
||||
*/
|
||||
function generate_set_menu_item_link_attributes( $atts, $item, $args, $depth ) {
|
||||
if ( ! isset( $args->container_class ) || 'main-nav' !== $args->container_class ) {
|
||||
return $atts;
|
||||
}
|
||||
|
||||
if ( 'click' !== generate_get_option( 'nav_dropdown_type' ) ) {
|
||||
return $atts;
|
||||
}
|
||||
|
||||
if ( in_array( 'menu-item-has-children', $item->classes, true ) ) {
|
||||
$atts['role'] = 'button';
|
||||
$atts['aria-expanded'] = 'false';
|
||||
$atts['aria-haspopup'] = 'true';
|
||||
$atts['aria-label'] = esc_attr__( 'Open Sub-Menu', 'generatepress' );
|
||||
}
|
||||
|
||||
return $atts;
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'generate_navigation_search' ) ) {
|
||||
add_action( 'generate_inside_navigation', 'generate_navigation_search' );
|
||||
/**
|
||||
|
@ -4,9 +4,10 @@ Donate link: https://generatepress.com/ongoing-development/
|
||||
License: GPLv2 or later
|
||||
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
||||
Tags: two-columns, three-columns, one-column, right-sidebar, left-sidebar, footer-widgets, blog, e-commerce, flexible-header, full-width-template, buddypress, custom-header, custom-background, custom-menu, custom-colors, sticky-post, threaded-comments, translation-ready, rtl-language-support, featured-images, theme-options
|
||||
Requires at least: 7.4
|
||||
Tested up to: 6.4
|
||||
Stable tag: 3.4.0
|
||||
Requires at least: 6.1
|
||||
Requires PHP: 7.4
|
||||
Tested up to: 6.6
|
||||
Stable tag: 3.5.1
|
||||
|
||||
GeneratePress is a lightweight WordPress theme built with a focus on speed and usability.
|
||||
|
||||
@ -99,6 +100,23 @@ MIT License: https://github.com/JedWatson/react-select/blob/master/LICENSE
|
||||
|
||||
== Changelog ==
|
||||
|
||||
= 3.5.1 =
|
||||
* Tweak: Revert addition of appearance-tools theme support
|
||||
* Fix: Dropdown click conflict with off-canvas panel
|
||||
|
||||
= 3.5.0 =
|
||||
* Feature: Add support for more core block options
|
||||
* Feature: Add support for GPP Font Library in the Customizer
|
||||
* Fix: Underlined buttons in the editor
|
||||
* Tweak: Add minimal header/footer templates for future GPP site editor
|
||||
* Tweak: Allow bottom margin value in custom typography elements
|
||||
* Accessibility: Add role to back to top button
|
||||
* Accessibility: Use h2 for comments title
|
||||
* Accessibility: Add aria-controls to menu dropdowns
|
||||
* Accessibility: Add aria-label to menu dropdown toggles
|
||||
* Accessibility: Add proper roles to menu dropdown toggles
|
||||
* Accessibility: Allow spacebar to open menu dropdowns
|
||||
|
||||
= 3.4.0 =
|
||||
|
||||
* Important: Require PHP 7.4 or later
|
||||
|
@ -4,9 +4,9 @@ Theme URI: https://generatepress.com
|
||||
Author: Tom Usborne
|
||||
Author URI: https://tomusborne.com
|
||||
Description: GeneratePress is a lightweight WordPress theme built with a focus on speed and usability. Performance is important to us, which is why a fresh GeneratePress install adds less than 10kb (gzipped) to your page size. We take full advantage of the block editor (Gutenberg), which gives you more control over creating your content. If you use page builders, GeneratePress is the right theme for you. It is completely compatible with all major page builders, including Beaver Builder and Elementor. Thanks to our emphasis on WordPress coding standards, we can boast full compatibility with all well-coded plugins, including WooCommerce. GeneratePress is fully responsive, uses valid HTML/CSS, and is translated into over 25 languages by our amazing community of users. A few of our many features include 60+ color controls, powerful dynamic typography, 5 navigation locations, 5 sidebar layouts, dropdown menus (click or hover), and 9 widget areas. Learn more and check out our powerful premium version at https://generatepress.com
|
||||
Version: 3.4.0
|
||||
Requires at least: 5.2
|
||||
Tested up to: 6.4
|
||||
Version: 3.5.1
|
||||
Requires at least: 6.1
|
||||
Tested up to: 6.6
|
||||
Requires PHP: 7.4
|
||||
License: GNU General Public License v2 or later
|
||||
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
Loading…
Reference in New Issue
Block a user