modified file themes

This commit is contained in:
KawaiiPunk 2024-10-09 12:47:35 +00:00 committed by Gitium
parent db85936315
commit 9cbc2cb832
142 changed files with 37145 additions and 0 deletions

View File

@ -0,0 +1,46 @@
<?php
/**
* The template for displaying 404 pages (Not Found).
*
* @package GeneratePress
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
get_header(); ?>
<div <?php generate_do_attr( 'content' ); ?>>
<main <?php generate_do_attr( 'main' ); ?>>
<?php
/**
* generate_before_main_content hook.
*
* @since 0.1
*/
do_action( 'generate_before_main_content' );
generate_do_template_part( '404' );
/**
* generate_after_main_content hook.
*
* @since 0.1
*/
do_action( 'generate_after_main_content' );
?>
</main>
</div>
<?php
/**
* generate_after_primary_content_area hook.
*
* @since 2.0
*/
do_action( 'generate_after_primary_content_area' );
generate_construct_sidebars();
get_footer();

View File

@ -0,0 +1,85 @@
<?php
/**
* The template for displaying Archive pages.
*
* @package GeneratePress
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
get_header(); ?>
<div <?php generate_do_attr( 'content' ); ?>>
<main <?php generate_do_attr( 'main' ); ?>>
<?php
/**
* generate_before_main_content hook.
*
* @since 0.1
*/
do_action( 'generate_before_main_content' );
if ( generate_has_default_loop() ) {
if ( have_posts() ) :
/**
* generate_archive_title hook.
*
* @since 0.1
*
* @hooked generate_archive_title - 10
*/
do_action( 'generate_archive_title' );
/**
* generate_before_loop hook.
*
* @since 3.1.0
*/
do_action( 'generate_before_loop', 'archive' );
while ( have_posts() ) :
the_post();
generate_do_template_part( 'archive' );
endwhile;
/**
* generate_after_loop hook.
*
* @since 2.3
*/
do_action( 'generate_after_loop', 'archive' );
else :
generate_do_template_part( 'none' );
endif;
}
/**
* generate_after_main_content hook.
*
* @since 0.1
*/
do_action( 'generate_after_main_content' );
?>
</main>
</div>
<?php
/**
* generate_after_primary_content_area hook.
*
* @since 2.0
*/
do_action( 'generate_after_primary_content_area' );
generate_construct_sidebars();
get_footer();

View File

@ -0,0 +1,153 @@
.block-editor-block-list__layout pre {
background: rgba(0, 0, 0, 0.05);
font-family: inherit;
font-size: inherit;
line-height: normal;
margin-bottom: 1.5em;
padding: 20px;
overflow: auto;
color: inherit; /* editor only */
}
body .block-editor-block-list__block blockquote {
border-left: 5px solid rgba(0, 0, 0, 0.05);
padding: 20px;
font-size: 1.2em;
font-style:italic;
margin: 0 0 1.5em;
position: relative;
color: inherit; /* editor only */
}
body .wp-block-quote:not(.is-large):not(.is-style-large) {
border-left: 5px solid rgba(0, 0, 0, 0.05);
padding: 20px;
}
body .block-editor-block-list__block blockquote p:last-child {
margin: 0;
}
.block-editor-block-list__layout table,
.block-editor-block-list__layout th,
.block-editor-block-list__layout td {
border: 1px solid rgba(0, 0, 0, 0.1);
}
body .block-editor-block-list__block table {
border-collapse: separate;
border-spacing: 0;
border-width: 1px 0 0 1px;
margin: 0 0 1.5em;
width: 100%;
}
.block-editor-block-list__layout th,
.block-editor-block-list__layout td {
padding: 8px;
}
.block-editor-block-list__layout th {
border-width: 0 1px 1px 0;
}
.block-editor-block-list__layout td {
border-width: 0 1px 1px 0;
}
body .block-editor-block-list__block hr {
background-color: rgba(0, 0, 0, 0.1);
border: 0;
height: 1px;
margin-bottom: 40px;
margin-top: 40px;
width: auto;
}
body .block-editor-default-block-appender input[type=text].editor-default-block-appender__content,
body .block-editor-default-block-appender textarea.editor-default-block-appender__content {
font-family: inherit;
font-size: inherit;
}
/*--------------------------------------------------------------
## Gallery
--------------------------------------------------------------*/
.block-editor-block-list__layout .wp-block-gallery li figcaption {
background: rgba(255, 255, 255, 0.7);
color: #000;
padding: 10px;
box-sizing: border-box;
}
/*--------------------------------------------------------------
# Button
--------------------------------------------------------------*/
.block-editor-block-list__layout .wp-block-button .wp-block-button__link,
.block-editor-block-list__layout .button {
font-size: inherit;
padding: 10px 15px;
line-height: normal;
}
/*--------------------------------------------------------------
# Content Title
--------------------------------------------------------------*/
button.content-title-visibility {
position: absolute;
right: 0;
font-size: 30px;
line-height: 30px;
top: calc(50% - 15px);
opacity: 0.4;
background: none;
border: none;
cursor: pointer;
display: none;
}
button.show-content-title:before {
content: "\f530";
}
button.disable-content-title:before {
content: "\f177";
}
body:not(.content-title-hidden) .editor-post-title__block:hover button.disable-content-title,
.content-title-hidden .editor-post-title__block:hover button.show-content-title {
display: block;
}
button.content-title-visibility:before {
font-family: dashicons;
}
.content-title-hidden .editor-post-title textarea {
opacity: 0.4;
}
.edit-post-text-editor .editor-post-title__block .editor-post-title__input {
color: initial;
opacity: 1;
}
/*--------------------------------------------------------------
# Columns
--------------------------------------------------------------*/
.block-editor-block-list__block .wp-block-columns .wp-block-column {
margin-bottom: 0;
}
/*--------------------------------------------------------------
# Fix shortcode block label color
--------------------------------------------------------------*/
.wp-block-shortcode label,
.wp-block-shortcode .block-editor-plain-text {
color: initial;
}

View File

@ -0,0 +1,65 @@
img {
max-width: 100%;
height: auto;
}
pre {
background: rgba(0, 0, 0, 0.05);
font-family: inherit;
font-size: inherit;
line-height: normal;
margin-bottom: 1.5em;
padding: 20px;
overflow: auto;
max-width: 100%;
}
blockquote {
border-left: 5px solid rgba(0, 0, 0, 0.05);
padding: 20px;
font-size: 1.2em;
font-style:italic;
margin: 0 0 1.5em;
position: relative;
}
blockquote p:last-child {
margin: 0;
}
table, th, td {
border: 1px solid rgba(0, 0, 0, 0.1);
}
table {
border-collapse: separate;
border-spacing: 0;
border-width: 1px 0 0 1px;
margin: 0 0 1.5em;
table-layout: fixed;
width: 100%;
}
th,
td {
padding: 8px;
}
th {
border-width: 0 1px 1px 0;
}
td {
border-width: 0 1px 1px 0;
}
hr {
background-color: rgba(0, 0, 0, 0.1);
border: 0;
height: 1px;
margin-bottom: 40px;
margin-top: 40px;
}
/* Make sure embeds and iframes fit their containers */
embed,
iframe,
object {
max-width: 100%;
}

View File

@ -0,0 +1,67 @@
body {
font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
font-weight: normal;
text-transform: none;
font-size: 17px;
line-height: 1.5;
}
p {
line-height: inherit;
font-size: inherit;
margin-top: 0;
margin-bottom: 1.5em;
}
h1, h2, h3, h4, h5, h6 {
font-family: inherit;
font-size: 100%;
font-style: inherit;
font-weight: inherit;
}
h1 {
font-family: inherit;
font-size: 42px;
margin-bottom: 20px;
margin-top: 0;
line-height: 1.2em;
font-weight: normal;
text-transform: none;
}
h2 {
font-family: inherit;
font-size: 35px;
margin-bottom: 20px;
margin-top: 0;
line-height: 1.2em;
font-weight: normal;
text-transform: none;
}
h3 {
font-family: inherit;
font-size: 29px;
margin-bottom: 20px;
margin-top: 0;
line-height: 1.2em;
font-weight: normal;
text-transform: none;
}
h4 {
font-size: 24px;
}
h5 {
font-size: 20px;
}
h4,
h5,
h6 {
font-family: inherit;
margin-bottom: 20px;
margin-top: 0;
}

View File

@ -0,0 +1,98 @@
.generate-meta-box-content > div {
padding: 12px;
}
#generate_layout_options_meta_box .inside {
padding: 0;
margin:0;
}
#generate-meta-box-container .generate-meta-box-menu {
position: relative;
float: left;
list-style: none;
width: 180px;
line-height: 1em;
margin: 0 0 -1px 0;
padding: 0;
background-color: #fafafa;
border-right: 1px solid #eee;
box-sizing: border-box;
}
#generate-meta-box-container .generate-meta-box-menu li {
display: block;
position: relative;
margin: 0;
padding: 0;
line-height: 20px;
}
#generate-meta-box-container .generate-meta-box-menu li a {
display: block;
margin: 0;
padding: 10px;
line-height: 20px !important;
text-decoration: none;
border-bottom: 1px solid #eee;
box-shadow: none;
}
#generate-meta-box-container .generate-meta-box-content {
float: left;
width: calc( 100% - 180px );
margin-left: -1px;
border-left: 1px solid #eee;
background-color: #fff;
}
#generate-meta-box-container {
overflow: hidden;
background: #fff;
background: linear-gradient( 90deg, #fafafa 0%, #fafafa 180px, #fff 180px, #fff 100% );
}
#generate-meta-box-container .current {
position: relative;
font-weight: bold;
background-color: #e0e0e0;
}
#generate-meta-box-container .current a {
color: #555;
}
#generate-meta-box-container label {
font-weight: 400;
display: inline-block;
margin-bottom: 3px;
}
.generate-meta-box-menu li {
display: inline-block;
}
#side-sortables #generate-meta-box-container .generate-meta-box-menu,
#side-sortables #generate-meta-box-container .generate-meta-box-content {
float: none;
width: 100%;
margin: 0;
border: 0;
}
.edit-post-meta-boxes-area.is-side .generate-meta-box-content > div {
display: block !important;
}
.edit-post-meta-boxes-area.is-side .generate-meta-box-menu {
display: none;
}
#generate-meta-box-container label {
display: none;
}
.edit-post-meta-boxes-area.is-side #generate-meta-box-container label.generate-layout-metabox-section-title {
display: block;
font-weight: 500;
margin-bottom: 5px;
}

View File

@ -0,0 +1,232 @@
.js .generate-metabox.postbox .hndle {
cursor: inherit;
}
.generate-metabox .clear {
padding-top: 10px;
margin-bottom: 10px;
border-bottom: 1px solid #DDD;
}
.generate-metabox .clear:after {
content: "";
display: table;
clear: both;
}
.customize-button a.button,
.customize-button a.button:visited {
font-size: 25px;
padding: 10px 20px;
line-height: normal;
height: auto;
width: 100%;
text-align: center;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
.customize-button {
margin-bottom: 40px;
}
.addon-container:before,
.addon-container:after {
content: ".";
display: block;
overflow: hidden;
visibility: hidden;
font-size: 0;
line-height: 0;
width: 0;
height: 0;
}
.addon-container:after {
clear: both;
}
.premium-addons .gp-clear {
margin: 0 !important;
border: 0;
padding: 0 !important;
}
.premium-addons .add-on.gp-clear {
padding: 15px !important;
margin: 0 !important;
-moz-box-shadow: 0 -1px 0 rgba(0, 0, 0, 0.1) inset;
-webkit-box-shadow: 0 -1px 0 rgba(0, 0, 0, 0.1) inset;
box-shadow: 0 -1px 0 rgba(0, 0, 0, 0.1) inset;
}
.premium-addons .add-on:last-child {
border: 0 !important;
}
.addon-action {
float: right;
clear: right;
}
.addon-name {
float: left;
}
.addon-name a {
text-decoration: none;
font-weight: bold;
}
/* New admin */
.clearfix:after,
.clearfix:before {
content: ".";
display: block;
overflow: hidden;
visibility: hidden;
font-size: 0;
line-height: 0;
width: 0;
height: 0;
}
.clearfix:after {
clear: both;
}
.gp-container {
max-width: 1200px;
margin: 0 auto;
padding: 0 20px;
box-sizing: border-box;
}
.gp-container a {
text-decoration: none;
}
.appearance_page_generate-options #wpcontent,
.appearance_page_generate-options #wpbody-content .metabox-holder {
padding: 0;
}
.appearance_page_generate-options .wrap {
margin-top: 0;
margin-left: 0;
margin-right: 0;
}
.gp-masthead {
background-color: #fff;
text-align: center;
box-shadow: 0 1px 0 rgba(200,215,225,0.5), 0 1px 2px #DDD;
margin-bottom: 40px;
padding: 20px;
}
.gp-container .postbox {
box-shadow: 0 0 0 1px rgba(200, 215, 225, 0.5), 0 1px 2px #DDD;
border: 0;
min-width: initial;
margin-bottom: 40px;
}
.gp-masthead .gp-title {
float: left;
}
.gp-masthead .gp-title a {
font-size: 20px;
color: #000;
font-weight: 500;
}
.gp-masthead .gp-masthead-links {
float: right;
}
.gp-masthead-links a {
display: inline-block;
margin: 0 10px;
}
.gp-masthead .gp-version {
display: inline-block;
background: #EFEFEF;
padding: 1px 3px;
border-radius: 2px;
font-size: 11px;
vertical-align: top;
margin-left: 5px;
}
.gp-options-footer {
text-align: center;
}
.popular-articles ul {
list-style-type: disc;
margin-left: 20px;
margin-bottom: 0;
}
.popular-articles .hndle a {
float:right;
font-size:13px;
}
#gen-delete p:last-child {
margin-bottom: 0;
}
.start-customizing li {
margin-bottom: 15px;
}
.start-customizing li span {
padding-right: 5px;
}
.start-customizing ul {
border-bottom: 1px solid #ddd;
}
.gp-container .postbox > h3.hndle {
padding-top: 12px;
padding-bottom: 12px;
}
@media (min-width: 768px) {
.hide-on-desktop {
display: none;
}
.grid-70 {
float: left;
width: 70%;
box-sizing: border-box;
padding-right: 20px;
}
.grid-30 {
float: left;
width: 30%;
box-sizing: border-box;
padding-left: 20px;
}
.grid-parent {
padding-left: 0;
padding-right: 0;
}
}
@media (max-width: 767px) {
.hide-on-mobile {
display: none;
}
.gp-masthead .gp-masthead-links,
.gp-masthead .gp-title {
float: none;
text-align: center;
}
.gp-masthead .gp-title {
margin-bottom: 20px;
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,129 @@
.comment-content a {
word-wrap: break-word;
}
.bypostauthor {
display: block;
}
.comment,
.comment-list {
list-style-type: none;
padding: 0;
margin: 0;
}
.comment-author-info {
display: inline-block;
vertical-align: middle;
}
.comment-meta .avatar {
float: left;
margin-right: 10px;
border-radius: 50%;
}
.comment-author cite {
font-style: normal;
font-weight: bold;
}
.entry-meta.comment-metadata {
margin-top: 0;
}
.comment-content {
margin-top: 1.5em;
}
.comment-respond {
margin-top: 0;
}
.comment-form > .form-submit {
margin-bottom: 0;
}
.comment-form input,
.comment-form-comment {
margin-bottom: 10px;
}
.comment-form-comment textarea {
resize: vertical;
}
.comment-form #author,
.comment-form #email,
.comment-form #url {
display: block;
}
.comment-metadata .edit-link:before {
display: none;
}
.comment-body {
padding: 30px 0;
}
.comment-content {
padding: 30px;
border: 1px solid rgba(0, 0, 0, 0.05);
}
.depth-1.parent > .children {
border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.comment .children {
padding-left: 30px;
margin-top: -30px;
border-left: 1px solid rgba(0, 0, 0, 0.05);
}
.pingback .comment-body,
.trackback .comment-body {
border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.pingback .edit-link {
font-size: 13px;
}
.comment-content p:last-child {
margin-bottom: 0;
}
.comment-list > .comment:first-child {
padding-top: 0;
margin-top: 0;
border-top: 0;
}
ol.comment-list {
margin-bottom: 1.5em;
}
.comment-form-cookies-consent {
display: flex;
align-items: center;
}
.comment-form-cookies-consent input {
margin-right: 0.5em;
margin-bottom: 0;
}
.one-container .comments-area {
margin-top: 1.5em;
}
.comment-content .reply {
font-size: 85%;
}
#cancel-comment-reply-link {
padding-left: 10px;
}

View File

@ -0,0 +1 @@
.comment-content a{word-wrap:break-word}.bypostauthor{display:block}.comment,.comment-list{list-style-type:none;padding:0;margin:0}.comment-author-info{display:inline-block;vertical-align:middle}.comment-meta .avatar{float:left;margin-right:10px;border-radius:50%}.comment-author cite{font-style:normal;font-weight:700}.entry-meta.comment-metadata{margin-top:0}.comment-content{margin-top:1.5em}.comment-respond{margin-top:0}.comment-form>.form-submit{margin-bottom:0}.comment-form input,.comment-form-comment{margin-bottom:10px}.comment-form-comment textarea{resize:vertical}.comment-form #author,.comment-form #email,.comment-form #url{display:block}.comment-metadata .edit-link:before{display:none}.comment-body{padding:30px 0}.comment-content{padding:30px;border:1px solid rgba(0,0,0,.05)}.depth-1.parent>.children{border-bottom:1px solid rgba(0,0,0,.05)}.comment .children{padding-left:30px;margin-top:-30px;border-left:1px solid rgba(0,0,0,.05)}.pingback .comment-body,.trackback .comment-body{border-bottom:1px solid rgba(0,0,0,.05)}.pingback .edit-link{font-size:13px}.comment-content p:last-child{margin-bottom:0}.comment-list>.comment:first-child{padding-top:0;margin-top:0;border-top:0}ol.comment-list{margin-bottom:1.5em}.comment-form-cookies-consent{display:flex;align-items:center}.comment-form-cookies-consent input{margin-right:.5em;margin-bottom:0}.one-container .comments-area{margin-top:1.5em}.comment-content .reply{font-size:85%}#cancel-comment-reply-link{padding-left:10px}

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,174 @@
@font-face {
font-family: "GeneratePress";
src: url("../../fonts/generatepress.eot");
src: url("../../fonts/generatepress.eot#iefix") format("embedded-opentype"), url("../../fonts/generatepress.woff2") format("woff2"), url("../../fonts/generatepress.woff") format("woff"), url("../../fonts/generatepress.ttf") format("truetype"), url("../../fonts/generatepress.svg#GeneratePress") format("svg");
font-weight: normal;
font-style: normal;
}
.menu-toggle:before,
.search-item a:before,
.dropdown-menu-toggle:before,
.cat-links:before,
.tags-links:before,
.comments-link:before,
.nav-previous .prev:before,
.nav-next .next:before,
.generate-back-to-top:before,
.search-form .search-submit:before {
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
font-style: normal;
font-variant: normal;
text-rendering: auto;
line-height: 1;
}
.cat-links:before,
.tags-links:before,
.comments-link:before,
.nav-previous .prev:before,
.nav-next .next:before {
opacity: 0.7;
}
/*--------------------------------------------------------------
# Mobile Menu
--------------------------------------------------------------*/
.menu-toggle:before {
content: "\f0c9";
font-family: GeneratePress;
width: 1.28571429em;
text-align: center;
display: inline-block;
}
.toggled .menu-toggle:before {
content: "\f00d";
}
.main-navigation.toggled .sfHover > a .dropdown-menu-toggle:before {
content: "\f106";
}
/*--------------------------------------------------------------
# Navigation Search
--------------------------------------------------------------*/
.search-item a:before {
content: "\f002";
font-family: GeneratePress;
width: 1.28571429em;
text-align: center;
display: inline-block;
}
.search-item.close-search a:before {
content: "\f00d";
}
.widget .search-form button:before {
content: "\f002";
font-family: GeneratePress;
}
/*--------------------------------------------------------------
# Navigation Dropdowns
--------------------------------------------------------------*/
.dropdown-menu-toggle:before {
content: "\f107";
font-family: GeneratePress;
display: inline-block;
width: 0.8em;
text-align: left;
}
nav:not(.toggled) ul ul .dropdown-menu-toggle:before {
text-align: right;
}
.dropdown-hover .sub-menu-left:not(.toggled) ul ul .dropdown-menu-toggle:before {
transform: rotate(180deg);
}
.dropdown-click .menu-item-has-children.sfHover > a .dropdown-menu-toggle:before {
content: "\f106";
}
.dropdown-hover nav:not(.toggled) ul ul .dropdown-menu-toggle:before {
content: "\f105";
}
/*--------------------------------------------------------------
# Post Content
--------------------------------------------------------------*/
.entry-header .cat-links:before,
.entry-header .tags-links:before,
.entry-header .comments-link:before {
display: none;
}
.cat-links:before,
.tags-links:before,
.comments-link:before,
.nav-previous .prev:before,
.nav-next .next:before {
font-family: GeneratePress;
text-decoration: inherit;
position: relative;
margin-right: 0.6em;
width: 13px;
text-align: center;
display: inline-block;
}
.cat-links:before {
content: "\f07b";
}
.tags-links:before {
content: "\f02c";
}
.comments-link:before {
content: "\f086";
}
.nav-previous .prev:before {
content: "\f104";
}
.nav-next .next:before {
content: "\f105";
}
/*--------------------------------------------------------------
# Sidebar Navigation
--------------------------------------------------------------*/
.dropdown-hover.both-right .inside-left-sidebar .dropdown-menu-toggle:before,
.dropdown-hover .inside-right-sidebar .dropdown-menu-toggle:before {
content: "\f104";
}
.dropdown-hover.both-left .inside-right-sidebar .dropdown-menu-toggle:before,
.dropdown-hover .inside-left-sidebar .dropdown-menu-toggle:before {
content: "\f105";
}
/*--------------------------------------------------------------
# Back to Top Button
--------------------------------------------------------------*/
.generate-back-to-top:before {
content: "\f106";
font-family: GeneratePress;
}
/*--------------------------------------------------------------
# Search button
--------------------------------------------------------------*/
.search-form .search-submit:before {
content: "\f002";
font-family: GeneratePress;
width: 1.28571429em;
text-align: center;
display: inline-block;
}

View File

@ -0,0 +1 @@
@font-face{font-family:GeneratePress;src:url("../../fonts/generatepress.eot");src:url("../../fonts/generatepress.eot#iefix") format("embedded-opentype"),url("../../fonts/generatepress.woff2") format("woff2"),url("../../fonts/generatepress.woff") format("woff"),url("../../fonts/generatepress.ttf") format("truetype"),url("../../fonts/generatepress.svg#GeneratePress") format("svg");font-weight:400;font-style:normal}.cat-links:before,.comments-link:before,.dropdown-menu-toggle:before,.generate-back-to-top:before,.menu-toggle:before,.nav-next .next:before,.nav-previous .prev:before,.search-form .search-submit:before,.search-item a:before,.tags-links:before{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-style:normal;font-variant:normal;text-rendering:auto;line-height:1}.cat-links:before,.comments-link:before,.nav-next .next:before,.nav-previous .prev:before,.tags-links:before{opacity:.7}.menu-toggle:before{content:"\f0c9";font-family:GeneratePress;width:1.28571429em;text-align:center;display:inline-block}.toggled .menu-toggle:before{content:"\f00d"}.main-navigation.toggled .sfHover>a .dropdown-menu-toggle:before{content:"\f106"}.search-item a:before{content:"\f002";font-family:GeneratePress;width:1.28571429em;text-align:center;display:inline-block}.search-item.close-search a:before{content:"\f00d"}.widget .search-form button:before{content:"\f002";font-family:GeneratePress}.dropdown-menu-toggle:before{content:"\f107";font-family:GeneratePress;display:inline-block;width:.8em;text-align:left}nav:not(.toggled) ul ul .dropdown-menu-toggle:before{text-align:right}.dropdown-hover .sub-menu-left:not(.toggled) ul ul .dropdown-menu-toggle:before{transform:rotate(180deg)}.dropdown-click .menu-item-has-children.sfHover>a .dropdown-menu-toggle:before{content:"\f106"}.dropdown-hover nav:not(.toggled) ul ul .dropdown-menu-toggle:before{content:"\f105"}.entry-header .cat-links:before,.entry-header .comments-link:before,.entry-header .tags-links:before{display:none}.cat-links:before,.comments-link:before,.nav-next .next:before,.nav-previous .prev:before,.tags-links:before{font-family:GeneratePress;text-decoration:inherit;position:relative;margin-right:.6em;width:13px;text-align:center;display:inline-block}.cat-links:before{content:"\f07b"}.tags-links:before{content:"\f02c"}.comments-link:before{content:"\f086"}.nav-previous .prev:before{content:"\f104"}.nav-next .next:before{content:"\f105"}.dropdown-hover .inside-right-sidebar .dropdown-menu-toggle:before,.dropdown-hover.both-right .inside-left-sidebar .dropdown-menu-toggle:before{content:"\f104"}.dropdown-hover .inside-left-sidebar .dropdown-menu-toggle:before,.dropdown-hover.both-left .inside-right-sidebar .dropdown-menu-toggle:before{content:"\f105"}.generate-back-to-top:before{content:"\f106";font-family:GeneratePress}.search-form .search-submit:before{content:"\f002";font-family:GeneratePress;width:1.28571429em;text-align:center;display:inline-block}

View File

@ -0,0 +1,256 @@
/*--------------------------------------------------------------
## Footer Widgets
--------------------------------------------------------------*/
.footer-widgets-container {
padding: 40px;
}
.inside-footer-widgets {
display: flex;
}
.inside-footer-widgets > div {
flex: 1 1 0;
}
.site-footer .footer-widgets-container .inner-padding {
padding: 0px 0px 0px 40px;
}
.site-footer .footer-widgets-container .inside-footer-widgets {
margin-left: -40px;
}
/*--------------------------------------------------------------
## Top Bar
--------------------------------------------------------------*/
.top-bar {
font-weight: normal;
text-transform: none;
font-size: 13px;
}
.top-bar .inside-top-bar {
display: flex;
align-items: center;
flex-wrap: wrap;
}
.top-bar .inside-top-bar .widget {
padding: 0;
display: inline-block;
margin-bottom: 0;
}
.top-bar .inside-top-bar .textwidget p:last-child {
margin: 0;
}
.top-bar .widget-title {
display: none;
}
.top-bar .widget {
margin: 0 10px;
}
.top-bar .widget_nav_menu > div > ul {
display: flex;
align-items: center;
}
.top-bar .widget_nav_menu li {
margin: 0 10px;
padding: 0;
}
.top-bar .widget_nav_menu li:first-child {
margin-left: 0;
}
.top-bar .widget_nav_menu li:last-child {
margin-right: 0;
}
.top-bar .widget_nav_menu li ul {
display: none;
}
.inside-top-bar {
padding: 10px 40px;
}
div.top-bar .widget {
margin-bottom: 0;
}
.top-bar-align-right .widget {
margin-right: 0;
}
.top-bar-align-right .widget:first-child {
margin-left: auto;
}
.top-bar-align-right .widget:nth-child(even) {
order: -20;
}
.top-bar-align-right .widget:nth-child(2) {
margin-left: 0;
}
.top-bar-align-left .widget {
margin-left: 0;
}
.top-bar-align-left .widget:nth-child(odd) {
order: -20;
}
.top-bar-align-left .widget:nth-child(2) {
margin-left: auto;
}
.top-bar-align-left .widget:last-child {
margin-right: 0;
}
.top-bar-align-center .widget:first-child {
margin-left: auto;
}
.top-bar-align-center .widget:last-child {
margin-right: auto;
}
.top-bar-align-center .widget:not(:first-child):not(:last-child) {
margin: 0 5px;
}
/*--------------------------------------------------------------
## Footer Bar
--------------------------------------------------------------*/
.footer-bar-active .footer-bar .widget {
padding: 0;
}
.footer-bar .widget_nav_menu > div > ul {
display: flex;
align-items: center;
flex-wrap: wrap;
}
.footer-bar .widget_nav_menu li {
margin: 0 10px;
padding: 0;
}
.footer-bar .widget_nav_menu li:first-child {
margin-left: 0;
}
.footer-bar .widget_nav_menu li:last-child {
margin-right: 0;
}
.footer-bar .widget_nav_menu li ul {
display: none;
}
.footer-bar .textwidget p:last-child {
margin: 0;
}
.footer-bar .widget-title {
display: none;
}
.footer-bar-align-right .copyright-bar {
order: -20;
margin-right: auto;
}
.footer-bar-align-left .copyright-bar {
margin-left: auto;
}
.footer-bar-align-center .inside-site-info {
flex-direction: column;
}
.footer-bar-align-center .footer-bar {
margin-bottom: 10px;
}
.site-footer:not(.footer-bar-active) .copyright-bar {
margin: 0 auto;
}
/*--------------------------------------------------------------
## Breakpoint (768px)
--------------------------------------------------------------*/
@media (max-width: 768px) {
/*--------------------------------------------------------------
## Top Bar
--------------------------------------------------------------*/
.top-bar .inside-top-bar {
justify-content: center;
}
.top-bar .inside-top-bar > .widget {
order: 1;
margin: 0 10px;
}
.top-bar .inside-top-bar:first-child {
margin-left: auto;
}
.top-bar .inside-top-bar:last-child {
margin-right: auto;
}
.top-bar .widget_nav_menu li {
padding: 5px 0;
}
.top-bar-align-center {
text-align: center;
}
/*--------------------------------------------------------------
## Footer
--------------------------------------------------------------*/
.inside-footer-widgets {
flex-direction: column;
}
.inside-footer-widgets > div:not(:last-child) {
margin-bottom: 40px;
}
.site-footer .footer-widgets .footer-widgets-container .inside-footer-widgets {
margin: 0;
}
.site-footer .footer-widgets .footer-widgets-container .inner-padding {
padding: 0;
}
.footer-bar-active .inside-site-info {
flex-direction: column;
}
.footer-bar-active .footer-bar {
margin-bottom: 10px;
}
.footer-bar .widget_nav_menu > div > ul {
justify-content: center;
}
.footer-bar .widget_nav_menu li {
padding: 5px 0;
}
.footer-bar .widget_nav_menu li:first-child {
margin-left: 10px;
}
.footer-bar .widget_nav_menu li:last-child {
margin-right: 10px;
}
.footer-bar-align-left .copyright-bar {
margin-left: 0;
}
.footer-bar-align-right .copyright-bar {
order: unset;
margin-right: 0;
}
}

View File

@ -0,0 +1 @@
.footer-widgets-container{padding:40px}.inside-footer-widgets{display:flex}.inside-footer-widgets>div{flex:1 1 0}.site-footer .footer-widgets-container .inner-padding{padding:0 0 0 40px}.site-footer .footer-widgets-container .inside-footer-widgets{margin-left:-40px}.top-bar{font-weight:400;text-transform:none;font-size:13px}.top-bar .inside-top-bar{display:flex;align-items:center;flex-wrap:wrap}.top-bar .inside-top-bar .widget{padding:0;display:inline-block;margin-bottom:0}.top-bar .inside-top-bar .textwidget p:last-child{margin:0}.top-bar .widget-title{display:none}.top-bar .widget{margin:0 10px}.top-bar .widget_nav_menu>div>ul{display:flex;align-items:center}.top-bar .widget_nav_menu li{margin:0 10px;padding:0}.top-bar .widget_nav_menu li:first-child{margin-left:0}.top-bar .widget_nav_menu li:last-child{margin-right:0}.top-bar .widget_nav_menu li ul{display:none}.inside-top-bar{padding:10px 40px}div.top-bar .widget{margin-bottom:0}.top-bar-align-right .widget{margin-right:0}.top-bar-align-right .widget:first-child{margin-left:auto}.top-bar-align-right .widget:nth-child(2n){order:-20}.top-bar-align-right .widget:nth-child(2){margin-left:0}.top-bar-align-left .widget{margin-left:0}.top-bar-align-left .widget:nth-child(odd){order:-20}.top-bar-align-left .widget:nth-child(2){margin-left:auto}.top-bar-align-left .widget:last-child{margin-right:0}.top-bar-align-center .widget:first-child{margin-left:auto}.top-bar-align-center .widget:last-child{margin-right:auto}.top-bar-align-center .widget:not(:first-child):not(:last-child){margin:0 5px}.footer-bar-active .footer-bar .widget{padding:0}.footer-bar .widget_nav_menu>div>ul{display:flex;align-items:center;flex-wrap:wrap}.footer-bar .widget_nav_menu li{margin:0 10px;padding:0}.footer-bar .widget_nav_menu li:first-child{margin-left:0}.footer-bar .widget_nav_menu li:last-child{margin-right:0}.footer-bar .widget_nav_menu li ul{display:none}.footer-bar .textwidget p:last-child{margin:0}.footer-bar .widget-title{display:none}.footer-bar-align-right .copyright-bar{order:-20;margin-right:auto}.footer-bar-align-left .copyright-bar{margin-left:auto}.footer-bar-align-center .inside-site-info{flex-direction:column}.footer-bar-align-center .footer-bar{margin-bottom:10px}.site-footer:not(.footer-bar-active) .copyright-bar{margin:0 auto}@media (max-width:768px){.top-bar .inside-top-bar{justify-content:center}.top-bar .inside-top-bar>.widget{order:1;margin:0 10px}.top-bar .inside-top-bar:first-child{margin-left:auto}.top-bar .inside-top-bar:last-child{margin-right:auto}.top-bar .widget_nav_menu li{padding:5px 0}.top-bar-align-center{text-align:center}.inside-footer-widgets{flex-direction:column}.inside-footer-widgets>div:not(:last-child){margin-bottom:40px}.site-footer .footer-widgets .footer-widgets-container .inside-footer-widgets{margin:0}.site-footer .footer-widgets .footer-widgets-container .inner-padding{padding:0}.footer-bar-active .inside-site-info{flex-direction:column}.footer-bar-active .footer-bar{margin-bottom:10px}.footer-bar .widget_nav_menu>div>ul{justify-content:center}.footer-bar .widget_nav_menu li{padding:5px 0}.footer-bar .widget_nav_menu li:first-child{margin-left:10px}.footer-bar .widget_nav_menu li:last-child{margin-right:10px}.footer-bar-align-left .copyright-bar{margin-left:0}.footer-bar-align-right .copyright-bar{order:unset;margin-right:0}}

View File

@ -0,0 +1,195 @@
caption,
td,
th {
text-align: right;
}
.header-aligned-right:not([class*="nav-float-"]) .inside-header {
justify-content: flex-start;
}
.header-aligned-left:not([class*="nav-float-"]) .inside-header {
justify-content: flex-end;
}
.header-aligned-right:not([class*="nav-float-"]) .header-widget {
order: 10;
}
.header-aligned-left:not([class*="nav-float-"]) .header-widget {
order: -10;
}
.site-logo + .site-branding {
order: -1;
}
.nav-float-right #site-navigation {
order: -5;
}
.nav-float-right #site-navigation.toggled, .nav-float-right #site-navigation.has-active-search {
order: 10;
}
.nav-float-right .header-widget {
order: -10;
}
.nav-float-left #site-navigation {
order: 5;
}
.nav-float-left .header-widget,
.nav-float-left .mobile-menu-control-wrapper {
order: 10;
}
.mobile-menu-control-wrapper {
margin-right: auto;
margin-left: 0;
}
.nav-align-right .inside-navigation {
justify-content: flex-start;
}
.nav-align-left .inside-navigation {
justify-content: flex-end;
}
.menu-item-has-children .dropdown-menu-toggle {
float: left !important;
}
.main-navigation ul ul {
text-align: right;
}
.sidebar .menu-item-has-children .dropdown-menu-toggle,
nav ul ul .menu-item-has-children .dropdown-menu-toggle {
float: left;
}
.comment-meta .avatar {
float: right;
margin-left: 10px;
}
.page-header .avatar {
float: right;
margin-left: 1.5em;
}
.slideout-navigation .menu-item-has-children .dropdown-menu-toggle {
float: left;
}
.dropdown-click #generate-slideout-menu .slideout-menu .menu-item-has-children > a:first-child,
.slideout-desktop.dropdown-hover #generate-slideout-menu .slideout-menu .menu-item-has-children > a:first-child {
padding-left: 0;
}
.comment .children {
padding-right: 30px;
border-right: 1px solid rgba(0, 0, 0, 0.05);
}
.main-navigation .main-nav ul li.menu-item-has-children > a,
.secondary-navigation .main-nav ul li.menu-item-has-children > a {
padding-left: 0;
}
nav:not(.toggled) ul ul .menu-item-has-children .dropdown-menu-toggle {
padding-left: 15px;
}
nav:not(.toggled) .menu-item-has-children .dropdown-menu-toggle {
padding-right: 10px;
}
.main-navigation {
padding-right: 0;
}
ol,
ul {
margin: 0 3em 1.5em 0;
}
li > ol,
li > ul {
margin-right: 1.5em;
}
.menu-toggle .mobile-menu {
margin-right: 5px;
margin-left: 0;
}
.widget_categories .children {
margin-right: 1.5em;
}
.widget_nav_menu ul ul,
.widget_pages ul ul {
margin-right: 1em;
}
.cat-links:before,
.comments-link:before,
.nav-next .next:before,
.nav-previous .prev:before,
.tags-links:before {
margin-left: 0.6em;
margin-right: 0;
}
.entry-meta .gp-icon {
margin-right: 0;
margin-left: 0.6em;
}
.menu-toggle,
.nav-search-enabled .main-navigation .menu-toggle {
text-align: right;
}
.rtl .navigation-search {
left: auto;
right: -99999px;
}
.rtl .navigation-search.nav-search-active {
right: 0;
}
.main-navigation.toggled .main-nav li {
text-align: right;
}
.left-sidebar .sidebar,
.both-left #left-sidebar,
.both-sidebars #left-sidebar {
order: 10;
}
.both-left #right-sidebar {
order: 5;
}
.both-right #left-sidebar {
order: -5;
}
.both-right #right-sidebar,
.both-sidebars #right-sidebar,
.right-sidebar #right-sidebar {
order: -10;
}
@media (max-width: 768px) {
.site-content .content-area {
order: -20;
}
}

View File

@ -0,0 +1 @@
caption,td,th{text-align:right}.header-aligned-right:not([class*=nav-float-]) .inside-header{justify-content:flex-start}.header-aligned-left:not([class*=nav-float-]) .inside-header{justify-content:flex-end}.header-aligned-right:not([class*=nav-float-]) .header-widget{order:10}.header-aligned-left:not([class*=nav-float-]) .header-widget{order:-10}.site-logo+.site-branding{order:-1}.nav-float-right #site-navigation{order:-5}.nav-float-right #site-navigation.has-active-search,.nav-float-right #site-navigation.toggled{order:10}.nav-float-right .header-widget{order:-10}.nav-float-left #site-navigation{order:5}.nav-float-left .header-widget,.nav-float-left .mobile-menu-control-wrapper{order:10}.mobile-menu-control-wrapper{margin-right:auto;margin-left:0}.nav-align-right .inside-navigation{justify-content:flex-start}.nav-align-left .inside-navigation{justify-content:flex-end}.menu-item-has-children .dropdown-menu-toggle{float:left!important}.main-navigation ul ul{text-align:right}.sidebar .menu-item-has-children .dropdown-menu-toggle,nav ul ul .menu-item-has-children .dropdown-menu-toggle{float:left}.comment-meta .avatar{float:right;margin-left:10px}.page-header .avatar{float:right;margin-left:1.5em}.slideout-navigation .menu-item-has-children .dropdown-menu-toggle{float:left}.dropdown-click #generate-slideout-menu .slideout-menu .menu-item-has-children>a:first-child,.slideout-desktop.dropdown-hover #generate-slideout-menu .slideout-menu .menu-item-has-children>a:first-child{padding-left:0}.comment .children{padding-right:30px;border-right:1px solid rgba(0,0,0,.05)}.main-navigation .main-nav ul li.menu-item-has-children>a,.secondary-navigation .main-nav ul li.menu-item-has-children>a{padding-left:0}nav:not(.toggled) ul ul .menu-item-has-children .dropdown-menu-toggle{padding-left:15px}nav:not(.toggled) .menu-item-has-children .dropdown-menu-toggle{padding-right:10px}.main-navigation{padding-right:0}ol,ul{margin:0 3em 1.5em 0}li>ol,li>ul{margin-right:1.5em}.menu-toggle .mobile-menu{margin-right:5px;margin-left:0}.widget_categories .children{margin-right:1.5em}.widget_nav_menu ul ul,.widget_pages ul ul{margin-right:1em}.cat-links:before,.comments-link:before,.nav-next .next:before,.nav-previous .prev:before,.tags-links:before{margin-left:.6em;margin-right:0}.entry-meta .gp-icon{margin-right:0;margin-left:.6em}.menu-toggle,.nav-search-enabled .main-navigation .menu-toggle{text-align:right}.rtl .navigation-search{left:auto;right:-99999px}.rtl .navigation-search.nav-search-active{right:0}.main-navigation.toggled .main-nav li{text-align:right}.both-left #left-sidebar,.both-sidebars #left-sidebar,.left-sidebar .sidebar{order:10}.both-left #right-sidebar{order:5}.both-right #left-sidebar{order:-5}.both-right #right-sidebar,.both-sidebars #right-sidebar,.right-sidebar #right-sidebar{order:-10}@media (max-width:768px){.site-content .content-area{order:-20}}

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,258 @@
/*--------------------------------------------------------------
# Mobile Menu
--------------------------------------------------------------*/
.menu-toggle,
.mobile-bar-items,
.sidebar-nav-mobile {
display: none;
}
.menu-toggle {
padding: 0 20px;
line-height: 60px;
margin: 0;
font-weight: normal;
text-transform: none;
font-size: 15px;
cursor: pointer;
}
button.menu-toggle {
background-color: transparent;
width: 100%;
border: 0;
text-align: center;
}
button.menu-toggle:hover,
button.menu-toggle:active,
button.menu-toggle:focus {
background-color: transparent;
}
.menu-toggle .mobile-menu {
padding-left: 3px;
}
.menu-toggle .gp-icon + .mobile-menu {
padding-left: 9px;
}
.menu-toggle .mobile-menu:empty {
display: none;
}
.nav-search-enabled .main-navigation .menu-toggle {
text-align: left;
}
.mobile-bar-items {
display: none;
position: absolute;
right: 0;
top: 0;
z-index: 21;
list-style-type: none;
}
.mobile-bar-items a {
display: inline-block;
}
nav.toggled ul ul.sub-menu {
width: 100%;
}
.dropdown-hover .main-navigation.toggled ul li:hover > ul,
.dropdown-hover .main-navigation.toggled ul li.sfHover > ul {
transition-delay: 0s;
}
.toggled .menu-item-has-children .dropdown-menu-toggle {
padding-left: 20px;
}
.main-navigation.toggled ul ul {
transition: 0s;
visibility: hidden;
}
.main-navigation.toggled .main-nav > ul {
display: block;
}
.main-navigation.toggled .main-nav ul ul.toggled-on {
position: relative;
top: 0;
left: auto !important;
right: auto !important;
width: 100%;
pointer-events: auto;
height: auto;
opacity: 1;
display: block;
visibility: visible;
float: none;
}
.main-navigation.toggled .main-nav li {
float: none;
clear: both;
display: block;
text-align: left;
}
.main-navigation.toggled .main-nav li.hide-on-mobile {
display: none !important;
}
.main-navigation.toggled .menu-item-has-children .dropdown-menu-toggle {
float: right;
}
.main-navigation.toggled .menu li.search-item {
display: none !important;
}
.main-navigation.toggled .sf-menu > li.menu-item-float-right {
float: none;
display: inline-block;
}
/*--------------------------------------------------------------
# Breakpoint (768px)
--------------------------------------------------------------*/
@media (max-width: 768px) {
/*--------------------------------------------------------------
## Links
--------------------------------------------------------------*/
a, body, button, input, select, textarea {
transition: all 0s ease-in-out;
}
/*--------------------------------------------------------------
## Top Bar
--------------------------------------------------------------*/
.top-bar.top-bar-align-left,
.top-bar.top-bar-align-right {
text-align: center;
}
.top-bar .widget {
float: none !important;
margin: 0 10px !important;
}
.top-bar .widget_nav_menu li {
float: none;
display: inline-block;
padding: 5px 0;
}
.footer-bar .widget_nav_menu li:first-child {
margin-left: 10px;
}
.footer-bar .widget_nav_menu li:last-child {
margin-right: 10px;
}
/*--------------------------------------------------------------
## Header
--------------------------------------------------------------*/
.inside-header > *:not(:last-child):not(.main-navigation) {
margin-bottom: 20px;
}
.site-header,
.header-aligned-right .site-header {
text-align: center;
}
.header-widget {
float: none;
max-width: 100%;
text-align: center;
}
/*--------------------------------------------------------------
## Content Area
--------------------------------------------------------------*/
.sidebar,
.content-area,
.inside-footer-widgets > div {
float: none;
width: 100%;
left: 0;
right: 0;
}
.site-main {
margin-left: 0 !important;
margin-right: 0 !important;
}
body:not(.no-sidebar) .site-main {
margin-bottom: 0 !important;
}
.one-container .sidebar {
margin-top: 40px;
}
.separate-containers #left-sidebar + #right-sidebar .inside-right-sidebar {
margin-top: 0;
}
.both-right.separate-containers .inside-left-sidebar,
.both-left.separate-containers .inside-left-sidebar,
.both-right.separate-containers .inside-right-sidebar,
.both-left.separate-containers .inside-right-sidebar {
margin-right: 0;
margin-left: 0;
}
.alignleft,
.alignright {
float: none;
display: block;
margin-left: auto;
margin-right: auto;
}
.post-image-aligned-left .post-image,
.post-image-aligned-right .post-image {
float: none;
margin: 2em 0;
text-align: center;
}
.comment .children {
padding-left: 10px;
margin-left: 0;
}
.edd_download {
display: block;
float: none !important;
margin-bottom: 1.5em;
width: 100% !important;
}
.entry-meta {
font-size: inherit;
}
.entry-meta a {
line-height: 1.8em;
}
/*--------------------------------------------------------------
## Footer
--------------------------------------------------------------*/
.site-info {
text-align: center;
}
.copyright-bar {
float: none !important;
text-align: center !important;
}
.footer-bar {
float: none !important;
text-align: center !important;
margin-bottom: 20px;
}
.footer-bar .widget_nav_menu li {
float: none;
display: inline-block;
padding: 5px 0;
}
.inside-footer-widgets > div:not(:last-child) {
margin-bottom: 40px;
}
.site-footer .footer-widgets .footer-widgets-container .inside-footer-widgets {
margin: 0;
}
.site-footer .footer-widgets .footer-widgets-container .inner-padding {
padding: 0;
}
}

View File

@ -0,0 +1 @@
.menu-toggle,.mobile-bar-items,.sidebar-nav-mobile{display:none}.menu-toggle{padding:0 20px;line-height:60px;margin:0;font-weight:400;text-transform:none;font-size:15px;cursor:pointer}button.menu-toggle{background-color:transparent;width:100%;border:0;text-align:center}button.menu-toggle:active,button.menu-toggle:focus,button.menu-toggle:hover{background-color:transparent}.menu-toggle .mobile-menu{padding-left:3px}.menu-toggle .gp-icon+.mobile-menu{padding-left:9px}.menu-toggle .mobile-menu:empty{display:none}.nav-search-enabled .main-navigation .menu-toggle{text-align:left}.mobile-bar-items{display:none;position:absolute;right:0;top:0;z-index:21;list-style-type:none}.mobile-bar-items a{display:inline-block}nav.toggled ul ul.sub-menu{width:100%}.dropdown-hover .main-navigation.toggled ul li.sfHover>ul,.dropdown-hover .main-navigation.toggled ul li:hover>ul{transition-delay:0s}.toggled .menu-item-has-children .dropdown-menu-toggle{padding-left:20px}.main-navigation.toggled ul ul{transition:0s;visibility:hidden}.main-navigation.toggled .main-nav>ul{display:block}.main-navigation.toggled .main-nav ul ul.toggled-on{position:relative;top:0;left:auto!important;right:auto!important;width:100%;pointer-events:auto;height:auto;opacity:1;display:block;visibility:visible;float:none}.main-navigation.toggled .main-nav li{float:none;clear:both;display:block;text-align:left}.main-navigation.toggled .main-nav li.hide-on-mobile{display:none!important}.main-navigation.toggled .menu-item-has-children .dropdown-menu-toggle{float:right}.main-navigation.toggled .menu li.search-item{display:none!important}.main-navigation.toggled .sf-menu>li.menu-item-float-right{float:none;display:inline-block}@media (max-width:768px){a,body,button,input,select,textarea{transition:all 0s ease-in-out}.top-bar.top-bar-align-left,.top-bar.top-bar-align-right{text-align:center}.top-bar .widget{float:none!important;margin:0 10px!important}.top-bar .widget_nav_menu li{float:none;display:inline-block;padding:5px 0}.footer-bar .widget_nav_menu li:first-child{margin-left:10px}.footer-bar .widget_nav_menu li:last-child{margin-right:10px}.inside-header>:not(:last-child):not(.main-navigation){margin-bottom:20px}.header-aligned-right .site-header,.site-header{text-align:center}.header-widget{float:none;max-width:100%;text-align:center}.content-area,.inside-footer-widgets>div,.sidebar{float:none;width:100%;left:0;right:0}.site-main{margin-left:0!important;margin-right:0!important}body:not(.no-sidebar) .site-main{margin-bottom:0!important}.one-container .sidebar{margin-top:40px}.separate-containers #left-sidebar+#right-sidebar .inside-right-sidebar{margin-top:0}.both-left.separate-containers .inside-left-sidebar,.both-left.separate-containers .inside-right-sidebar,.both-right.separate-containers .inside-left-sidebar,.both-right.separate-containers .inside-right-sidebar{margin-right:0;margin-left:0}.alignleft,.alignright{float:none;display:block;margin-left:auto;margin-right:auto}.post-image-aligned-left .post-image,.post-image-aligned-right .post-image{float:none;margin:2em 0;text-align:center}.comment .children{padding-left:10px;margin-left:0}.edd_download{display:block;float:none!important;margin-bottom:1.5em;width:100%!important}.entry-meta{font-size:inherit}.entry-meta a{line-height:1.8em}.site-info{text-align:center}.copyright-bar{float:none!important;text-align:center!important}.footer-bar{float:none!important;text-align:center!important;margin-bottom:20px}.footer-bar .widget_nav_menu li{float:none;display:inline-block;padding:5px 0}.inside-footer-widgets>div:not(:last-child){margin-bottom:40px}.site-footer .footer-widgets .footer-widgets-container .inside-footer-widgets{margin:0}.site-footer .footer-widgets .footer-widgets-container .inner-padding{padding:0}}

View File

@ -0,0 +1,178 @@
caption,
td,
th {
text-align: right;
}
.menu-item-has-children .dropdown-menu-toggle {
float: left !important;
}
.main-navigation li {
float: right;
text-align: right;
}
.main-navigation li.search-item,
.nav-aligned-right.nav-below-header .main-navigation .menu > li.search-item {
float: left;
}
.nav-left-sidebar .main-navigation li.search-item.current-menu-item,
.nav-right-sidebar .main-navigation li.search-item.current-menu-item {
float: left;
}
.rtl.nav-aligned-left .main-navigation .menu > li {
float: none;
display: inline-block;
}
.rtl.nav-aligned-left .main-navigation ul {
letter-spacing: -0.31em;
font-size: 1em;
}
.rtl.nav-aligned-left .main-navigation ul li {
letter-spacing: normal;
}
.rtl.nav-aligned-left .main-navigation {
text-align: left;
}
.sidebar .menu-item-has-children .dropdown-menu-toggle,
nav ul ul .menu-item-has-children .dropdown-menu-toggle {
float: left;
}
.comment-meta .avatar {
float: right;
margin-left: 10px;
}
.page-header .avatar {
float: right;
margin-left: 1.5em;
}
.header-widget {
float: left;
}
.sf-menu > li.menu-item-float-right {
float: left !important;
}
.slideout-navigation .menu-item-has-children .dropdown-menu-toggle {
float: left;
}
.dropdown-click #generate-slideout-menu .slideout-menu .menu-item-has-children > a:first-child,
.slideout-desktop.dropdown-hover #generate-slideout-menu .slideout-menu .menu-item-has-children > a:first-child {
padding-left: 0;
}
.comment .children {
padding-right: 30px;
border-right: 1px solid rgba(0, 0, 0, 0.05);
}
.main-navigation .main-nav ul li.menu-item-has-children > a,
.secondary-navigation .main-nav ul li.menu-item-has-children > a {
padding-left: 0;
}
nav:not(.toggled) ul ul .menu-item-has-children .dropdown-menu-toggle {
padding-left: 15px;
}
nav:not(.toggled) .menu-item-has-children .dropdown-menu-toggle {
padding-right: 10px;
}
.main-navigation ul,
.menu-toggle li.search-item {
padding-right: 0;
}
ol,
ul {
margin: 0 3em 1.5em 0;
}
li > ol,
li > ul {
margin-right: 1.5em;
}
.menu-toggle .mobile-menu {
margin-right: 5px;
margin-left: 0;
}
.widget_categories .children {
margin-right: 1.5em;
}
.widget_nav_menu ul ul,
.widget_pages ul ul {
margin-right: 1em;
}
.cat-links:before,
.comments-link:before,
.nav-next .next:before,
.nav-previous .prev:before,
.tags-links:before {
margin-left: 0.6em;
margin-right: 0;
}
.menu-toggle,
.nav-search-enabled .main-navigation .menu-toggle {
text-align: right;
}
.main-navigation .mobile-bar-items {
float: left;
left: 0;
right: auto;
}
.rtl .navigation-search {
left: auto;
right: -999999px;
}
.rtl .navigation-search.nav-search-active {
right: 0;
}
.rtl .footer-bar .widget_nav_menu li {
direction: rtl;
float: right;
}
.main-navigation.toggled .main-nav li {
text-align: right !important;
}
.entry-meta .gp-icon {
margin-right: 0;
margin-left: 0.6em;
}
@media (max-width: 768px) {
.rtl .mobile-bar-items {
position: absolute;
left: 0;
top: 0;
}
}
@media (min-width: 768px) {
.inside-footer-widgets > div {
float: right;
}
}

View File

@ -0,0 +1 @@
caption,td,th{text-align:right}.menu-item-has-children .dropdown-menu-toggle{float:left!important}.main-navigation li{float:right;text-align:right}.main-navigation li.search-item,.nav-aligned-right.nav-below-header .main-navigation .menu>li.search-item{float:left}.nav-left-sidebar .main-navigation li.search-item.current-menu-item,.nav-right-sidebar .main-navigation li.search-item.current-menu-item{float:left}.rtl.nav-aligned-left .main-navigation .menu>li{float:none;display:inline-block}.rtl.nav-aligned-left .main-navigation ul{letter-spacing:-.31em;font-size:1em}.rtl.nav-aligned-left .main-navigation ul li{letter-spacing:normal}.rtl.nav-aligned-left .main-navigation{text-align:left}.sidebar .menu-item-has-children .dropdown-menu-toggle,nav ul ul .menu-item-has-children .dropdown-menu-toggle{float:left}.comment-meta .avatar{float:right;margin-left:10px}.page-header .avatar{float:right;margin-left:1.5em}.header-widget{float:left}.sf-menu>li.menu-item-float-right{float:left!important}.slideout-navigation .menu-item-has-children .dropdown-menu-toggle{float:left}.dropdown-click #generate-slideout-menu .slideout-menu .menu-item-has-children>a:first-child,.slideout-desktop.dropdown-hover #generate-slideout-menu .slideout-menu .menu-item-has-children>a:first-child{padding-left:0}.comment .children{padding-right:30px;border-right:1px solid rgba(0,0,0,.05)}.main-navigation .main-nav ul li.menu-item-has-children>a,.secondary-navigation .main-nav ul li.menu-item-has-children>a{padding-left:0}nav:not(.toggled) ul ul .menu-item-has-children .dropdown-menu-toggle{padding-left:15px}nav:not(.toggled) .menu-item-has-children .dropdown-menu-toggle{padding-right:10px}.main-navigation ul,.menu-toggle li.search-item{padding-right:0}ol,ul{margin:0 3em 1.5em 0}li>ol,li>ul{margin-right:1.5em}.menu-toggle .mobile-menu{margin-right:5px;margin-left:0}.widget_categories .children{margin-right:1.5em}.widget_nav_menu ul ul,.widget_pages ul ul{margin-right:1em}.cat-links:before,.comments-link:before,.nav-next .next:before,.nav-previous .prev:before,.tags-links:before{margin-left:.6em;margin-right:0}.menu-toggle,.nav-search-enabled .main-navigation .menu-toggle{text-align:right}.main-navigation .mobile-bar-items{float:left;left:0;right:auto}.rtl .navigation-search{left:auto;right:-999999px}.rtl .navigation-search.nav-search-active{right:0}.rtl .footer-bar .widget_nav_menu li{direction:rtl;float:right}.main-navigation.toggled .main-nav li{text-align:right!important}.entry-meta .gp-icon{margin-right:0;margin-left:.6em}@media (max-width:768px){.rtl .mobile-bar-items{position:absolute;left:0;top:0}}@media (min-width:768px){.inside-footer-widgets>div{float:right}}

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
<?php return array('dependencies' => array('wp-data', 'wp-dom-ready', 'wp-element', 'wp-plugins'), 'version' => '166c384f313c8f5d9914');

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
<?php return array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-components', 'wp-element', 'wp-hooks', 'wp-i18n'), 'version' => '42a74b551d83e1b85238');

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
<?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-components', 'wp-element', 'wp-hooks', 'wp-i18n'), 'version' => 'dbc22cbe57941af36094');

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
<?php return array('dependencies' => array(), 'version' => 'b4d4871691423abff87b');

View File

@ -0,0 +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)}}();

View File

@ -0,0 +1,9 @@
.components-base-control__help{margin-bottom:0;margin-top:2px}.components-base-control__label{display:block;margin-bottom:10px}.generate-customize-control-wrapper{display:flex}.generate-customize-control-wrapper[data-wrapper-type=color]>div:first-child{flex-grow:1}.generate-customize-control-wrapper[data-wrapper-type=color]>div:not(:first-child):not(:empty){margin-left:5px}.generate-customize-control-wrapper[data-wrapper-type=two-col]>div{flex-basis:calc(50% - 5px)}.generate-customize-control-wrapper[data-wrapper-type=two-col]>div:nth-child(odd){margin-right:5px}.generate-customize-control-wrapper[data-wrapper-type=two-col]>div:nth-child(2n){margin-left:5px}.generate-customize-control--popover>.components-popover__content{box-sizing:border-box;padding:15px;width:280px}.generate-customize-control--popover .components-base-control:not(:last-child){margin-bottom:15px}.customize-control[data-toggleid]{display:none}#customize-control-generate_settings-google_font_display{display:flex;flex-direction:column;margin-top:10px}#customize-control-generate_settings-google_font_display .description{margin-bottom:0;margin-top:5px;order:10}
.generate-component-color-picker{padding:5px 15px 5px 5px}
.generate-component-color-picker .components-color-picker{box-sizing:border-box}.generate-component-color-picker .components-color-picker__inputs-wrapper{display:none}.generate-component-color-picker .react-colorful{width:100%!important}.generate-component-color-picker .react-colorful .react-colorful__pointer{height:20px;width:20px}.generate-component-color-picker .react-colorful .react-colorful__saturation{height:150px}.generate-component-color-picker .generate-color-input-wrapper{display:flex;padding:0}.generate-component-color-picker .generate-color-input-wrapper .generate-color-input{flex-grow:1}.generate-component-color-picker .generate-color-input-wrapper .components-color-clear-color{margin-left:5px}.generate-component-color-picker .generate-color-input-wrapper input{margin-right:5px}.generate-component-color-picker .generate-color-input-wrapper .components-base-control__field,.generate-component-color-picker>.components-base-control:first-child{margin-bottom:0}.generate-component-color-picker .components-color-picker__inputs-wrapper{min-width:auto}.generate-component-color-picker .generate-component-color-picker-palette{padding:16px 0 0}.generate-component-color-picker .generate-component-color-picker-palette .components-circular-option-picker{display:flex;flex-wrap:wrap}.generate-component-color-picker .generate-component-color-picker-palette .components-circular-option-picker .components-circular-option-picker__swatches{display:flex;flex-wrap:wrap;gap:6px}.generate-component-color-picker .components-color-palette,.generate-component-color-picker .generate-component-color-picker-palette .components-circular-option-picker .components-circular-option-picker__swatches .components-circular-option-picker__option-wrapper{margin:0}.generate-component-color-picker .components-color-picker{padding:5px;width:100%}.generate-component-color-picker .components-color-picker__body{padding-bottom:0}.generate-component-color-picker .components-popover__content{box-sizing:border-box;padding:10px;width:295px}.generate-component-color-picker .components-color-clear-color{height:auto}.generate-component-color-picker .components-circular-option-picker__option.is-pressed+svg{fill:#fff;background:#000;transform:scale(.6)}@media screen and (max-width:1666px){.generate-component-color-picker .components-popover__content{width:265px}}.generate-customize-control-wrapper{display:flex}.generate-customize-control-wrapper.generate-customize-color-control-wrapper>div:first-child{flex-grow:1}.generate-customize-control-wrapper.generate-customize-color-control-wrapper>div:not(:last-child){margin-right:5px}.generate-component-color-picker-wrapper>.components-base-control__field{align-items:center;display:flex;justify-content:space-between;position:relative}.generate-component-color-picker-wrapper>.components-base-control__field .components-color-palette__item-wrapper{margin:0}.generate-color-picker-area button,.generate-component-color-picker-palette button{height:28px;position:relative;width:28px}.generate-color-picker-area button:hover,.generate-component-color-picker-palette button:hover{background-color:inherit}.generate-color-picker-area button:focus:after,.generate-component-color-picker-palette button:focus:after{border:0;box-shadow:inset 0 0 0 2px #757575;height:28px;left:0;top:0;transform:none;width:28px}.generate-customize-control--popover .components-color-picker{box-sizing:border-box}.generate-customize-control--popover .components-color-picker__inputs-wrapper{display:none}.generate-customize-control--popover>.components-base-control:first-child{margin-bottom:0}.generate-customize-control--popover .components-color-picker__inputs-wrapper{min-width:auto}.generate-customize-control--popover .components-color-picker{padding:5px}.generate-customize-control--popover .components-color-picker__body{padding-bottom:0}.generate-customize-control--popover .components-color-clear-color{height:auto}.generate-component-color-picker[data-x-axis=left] .components-popover__content{margin-right:-35px!important}.generate-color-input--icon{align-items:center;border:1px solid;border-bottom-left-radius:3px;border-right:0;border-top-left-radius:3px;display:flex;justify-content:center;padding:5px}.generate-color-input--icon svg{height:1em;transform:scale(1.3);width:1em}.generate-color-option-area{padding:16px 0 0}.generate-color-input--css-var-name-wrapper{position:relative}.generate-color-input--css-var-name-wrapper button{bottom:0;height:auto;min-height:30px;padding:0 8px;position:absolute;right:0}.generate-color-input--css-var-name-wrapper button svg{fill:none;height:1em;width:1em}
.generate-font-manager--item{margin-bottom:10px}.generate-font-manager--item .generate-font-manager--header{align-items:center;display:flex}.generate-font-manager--item .generate-font-manager--header .generate-font-manager--label{flex-grow:1;overflow:hidden;padding-left:0;text-overflow:ellipsis;white-space:nowrap}.generate-font-manager--item .generate-font-manager--header .components-button:not(.generate-font-manager--label){align-items:center;background:#fff;border:1px solid #777;border-radius:100%;display:flex;flex-shrink:0;height:30px;justify-content:center;margin-left:5px;min-width:30px;padding:0;width:30px}.generate-font-manager--item .generate-font-manager--header .components-button:not(.generate-font-manager--label) svg{height:1em;margin-right:0;width:1em}.generate-font-manager--item .generate-font-manager--header .components-button:not(.generate-font-manager--label).generate-font-manager--open svg{fill:none}.generate-font-manager--item .generate-font-manager--options{margin-top:15px}.generate-font-manager--item .generate-font-manager--footer{border-top:1px solid #ddd;margin-top:15px;padding-top:15px}.generate-font-manager--item .generate-font-manager-google-font--field{margin-top:10px}.generate-font-manager--item .generate-font-manager--google-font-options{display:flex;flex-wrap:wrap;margin-top:15px}.generate-font-manager--item .generate-font-manager--google-font-options>div{flex-basis:calc(50% - 10px);margin-bottom:0}.generate-font-manager--item .generate-font-manager--google-font-options>div:nth-child(2n){margin-left:5px}.generate-font-manager--item .generate-font-manager--google-font-options>div:nth-child(odd){margin-right:5px}.generate-font-manager--item .generate-font-manager--google-font-options .components-base-control__field{margin-bottom:0!important}.generate-font-manager--item .generate-font-manager--select-options{display:flex;flex-wrap:wrap}.generate-font-manager--item .generate-font-manager--select-options>div{flex-basis:calc(50% - 5px)}.generate-font-manager--item .generate-font-manager--select-options>div:nth-child(2n){margin-left:5px}.generate-font-manager--item .generate-font-manager--select-options>div:nth-child(odd){margin-right:5px}.generate-font-manager--item .components-select-control__input--generate-fontfamily{margin-bottom:3px}.generate-font-manager--item .generate-advanced-select__menu{position:relative!important}.generate-font-manager-group{margin-bottom:20px;margin-top:10px}.generate-font-manager-group__label{color:#000;font-size:11px;margin-bottom:10px;margin-top:0;text-transform:uppercase}.generate-font-manager-group .generate-font-manager--item:last-child{margin-bottom:0}.generate-customize-control--font-dropdown{background:#fff;margin-top:10px;padding:15px;position:relative}.generate-customize-control--font-dropdown:before{border-color:transparent transparent #fff;border-style:solid;border-width:0 10px 10px;content:"";height:0;left:11px;position:absolute;top:-10px;width:0;z-index:10}.generate-customize-control--font-dropdown>.components-base-control:not(:last-child){margin-bottom:15px}.generate-customize-control--font-dropdown>.components-base-control:last-child .components-base-control__field{margin-bottom:0}
.generate-advanced-select__control{margin-bottom:12px}.generate-advanced-select__value-container{padding:0 6px!important}.generate-advanced-select__value-container>div{margin:0;padding:0}.generate-advanced-select__input input[type=text]:focus{box-shadow:none}.generate-advanced-select__option--is-selected{color:hsla(0,0%,100%,.5)!important}
.components-generate-units-control-header__units{align-items:center;display:flex;justify-content:space-between;margin-bottom:5px}.components-generate-control__units .components-generate-control-buttons__units button.components-button{background:#fff;border:0;border-radius:0!important;box-shadow:none!important;color:#929da7;font-size:10px;height:auto;line-height:20px;padding:0 5px;position:relative;text-align:center;text-shadow:none}.components-generate-control__units .components-generate-control-buttons__units button.components-button.is-primary{background:#fff!important;color:#000!important;cursor:default;font-weight:700;z-index:1}.generate-component-device-field[data-device=desktop],.generate-component-device-field[data-device=mobile],.generate-component-device-field[data-device=tablet]{display:none}.preview-desktop .generate-component-device-field[data-device=desktop]{display:block}.preview-desktop .components-generate-control__units button.components-generate-control-button__units--desktop{color:#000}.preview-tablet .generate-component-device-field[data-device=tablet]{display:block}.preview-tablet .components-generate-control__units button.components-generate-control-button__units--tablet{color:#000}.preview-mobile .generate-component-device-field[data-device=mobile]{display:block}.preview-mobile .components-generate-control__units button.components-generate-control-button__units--mobile{color:#000}
.gblocks-unit-control__disabled .gblocks-unit-control__input>.components-base-control{opacity:.5}.gblocks-unit-control__override-action{align-items:center;display:flex}.gblocks-unit-control__override-action button.components-button{height:20px;justify-content:center!important;min-width:20px;padding:0;width:20px}.gblocks-unit-control__override-action button.components-button.is-primary:focus:not(.disabled){box-shadow:0 0 0}.gblocks-unit-control__override-action button.components-button svg{margin:0!important;width:15px}.gblocks-unit-control__input{align-items:flex-start;display:flex;position:relative}.gblocks-unit-control__input .components-base-control:first-child{flex-grow:1}.gblocks-unit-control__input .components-base-control,.gblocks-unit-control__input .components-base-control__field{margin-bottom:0}.gblocks-unit-control__input--action{bottom:0;display:flex;gap:3px;position:absolute;right:5px;top:0}.gblocks-unit-control__input .gblocks-unit-control-units{align-items:center;display:flex;justify-content:center}.gblocks-unit-control__input .gblocks-unit-control-units button{align-items:center;border:1px solid rgba(0,0,0,.1);display:flex;font-size:10px;height:20px;justify-content:center;min-width:20px;padding:0 3px;width:auto}.gblocks-unit-control__input .gblocks-unit-control-units button:disabled{pointer-events:none}.gblocks-unit-control__input .gblocks-unit-control-units button.is-opened,.gblocks-unit-control__input .gblocks-unit-control-units button:hover{border-color:currentColor}.gblocks-unit-control__input .gblocks-unit-control-units button.is-opened{background:var(--wp-components-color-accent,var(--wp-admin-theme-color,#007cba));color:var(--wp-components-color-accent-inverted,#fff)}.gblocks-unit-control-popover .components-menu-group>div[role=group]{-ms-grid-columns:(1fr)[4];display:-ms-grid;display:grid;grid-template-columns:repeat(4,1fr)}.gblocks-unit-control-popover .components-menu-group>div[role=group] button{display:flex;justify-content:center;min-height:auto}.gblocks-unit-control-popover .components-menu-group>div[role=group] button .components-menu-item__item{font-size:11px;margin:0;min-width:auto}
.generate-color-manager-dnd-list{border:1px dashed #959595;display:flex;flex-wrap:wrap;padding:10px 5px 5px}.generate-color-manager-dnd-list .generate-color-manager-dnd-list-item{border-radius:50%;cursor:grab;display:inline-block;height:28px;margin:0 5px 5px 0;position:relative;vertical-align:top;width:28px}.generate-color-manager-dnd-list .generate-color-manager-dnd-list-item:before{background:url("data:image/svg+xml;charset=utf-8,%3Csvg width=%2728%27 height=%2728%27 fill=%27none%27 xmlns=%27http://www.w3.org/2000/svg%27%3E%3Cpath d=%27M6 8V6H4v2h2zm2 0V6h2v2H8zm2 8H8v-2h2v2zm2 0v-2h2v2h-2zm0 2v-2h-2v2H8v2h2v-2h2zm2 0v2h-2v-2h2zm2 0h-2v-2h2v2z%27 fill=%27%23555D65%27/%3E%3Cpath fill-rule=%27evenodd%27 clip-rule=%27evenodd%27 d=%27M18 18h2v-2h-2v-2h2v-2h-2v-2h2V8h-2v2h-2V8h-2v2h2v2h-2v2h2v2h2v2zm-2-4v-2h2v2h-2z%27 fill=%27%23555D65%27/%3E%3Cpath d=%27M18 18v2h-2v-2h2z%27 fill=%27%23555D65%27/%3E%3Cpath fill-rule=%27evenodd%27 clip-rule=%27evenodd%27 d=%27M8 10V8H6v2H4v2h2v2H4v2h2v2H4v2h2v2H4v2h2v-2h2v2h2v-2h2v2h2v-2h2v2h2v-2h2v2h2v-2h2v-2h-2v-2h2v-2h-2v-2h2v-2h-2v-2h2V8h-2V6h2V4h-2v2h-2V4h-2v2h-2V4h-2v2h-2V4h-2v2h2v2h-2v2H8zm0 2v-2H6v2h2zm2 0v-2h2v2h-2zm0 2v-2H8v2H6v2h2v2H6v2h2v2h2v-2h2v2h2v-2h2v2h2v-2h2v2h2v-2h-2v-2h2v-2h-2v-2h2v-2h-2v-2h2V8h-2V6h-2v2h-2V6h-2v2h-2v2h2v2h-2v2h-2z%27 fill=%27%23555D65%27/%3E%3Cpath fill-rule=%27evenodd%27 clip-rule=%27evenodd%27 d=%27M4 0H2v2H0v2h2v2H0v2h2v2H0v2h2v2H0v2h2v2H0v2h2v2H0v2h2v2H0v2h2v-2h2v2h2v-2h2v2h2v-2h2v2h2v-2h2v2h2v-2h2v2h2v-2h2v2h2v-2h2v-2h-2v-2h2v-2h-2v-2h2v-2h-2v-2h2v-2h-2v-2h2V8h-2V6h2V4h-2V2h2V0h-2v2h-2V0h-2v2h-2V0h-2v2h-2V0h-2v2h-2V0h-2v2H8V0H6v2H4V0zm0 4V2H2v2h2zm2 0V2h2v2H6zm0 2V4H4v2H2v2h2v2H2v2h2v2H2v2h2v2H2v2h2v2H2v2h2v2h2v-2h2v2h2v-2h2v2h2v-2h2v2h2v-2h2v2h2v-2h2v2h2v-2h-2v-2h2v-2h-2v-2h2v-2h-2v-2h2v-2h-2v-2h2V8h-2V6h2V4h-2V2h-2v2h-2V2h-2v2h-2V2h-2v2h-2V2h-2v2H8v2H6z%27 fill=%27%23555D65%27/%3E%3C/svg%3E");border-radius:50%;bottom:1px;content:"";left:1px;position:absolute;right:1px;top:1px;z-index:-1}.generate-color-manager-dnd-list .generate-color-manager-dnd-list-item span{border-radius:50%;display:block;height:28px;position:relative;width:28px}.generate-color-manager-dnd-list .generate-color-manager-dnd-list-item span:after{border:1px solid transparent;border-radius:50%;bottom:-1px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.2);content:"";left:-1px;position:absolute;right:-1px;top:-1px}.generate-color-manager-wrapper{display:flex;flex-wrap:wrap}.generate-color-manager-wrapper .generate-color-manager--item{margin-bottom:5px;margin-right:5px;position:relative}.generate-color-manager-wrapper .generate-color-manager--item:last-child{margin-right:0}.generate-color-manager-wrapper .generate-color-manager--item .components-button.generate-color-manager--delete-color{background:rgba(0,0,0,.7);border-radius:100%;color:#fff;height:auto;min-width:0;opacity:0;padding:2px;pointer-events:none;position:absolute;right:-10px;top:-10px;transition:opacity .5s ease}.generate-color-manager-wrapper .generate-color-manager--item .components-button.generate-color-manager--delete-color svg{height:15px;margin-right:0!important;width:15px}.generate-color-manager-wrapper .generate-color-manager--item .components-button.generate-color-manager--delete-color:focus,.generate-color-manager-wrapper .generate-color-manager--item:hover .components-button.generate-color-manager--delete-color{opacity:1;pointer-events:auto}.generate-color-manager-wrapper .generate-color-manager--item .components-circular-option-picker__option-wrapper{margin:0}.generate-color-manager-wrapper .generate-color-manager--item .components-button.generate-color-manager--add-color{align-items:center;background:#fff;border:1px solid #777;border-radius:100%;display:flex;height:28px;justify-content:center;padding:0;width:28px}.generate-color-manager-wrapper .generate-color-manager--item .components-button.generate-color-manager--add-color svg{width:20px}
.generate-customize-control-title{display:flex;justify-content:space-between}.generate-customize-control-title button.generate-customize-control-title--label{font-size:14px;font-weight:500;height:auto;padding:0}.generate-customize-control-title button.generate-customize-control-title--toggle{align-items:center;background:#fff;border:1px solid #777;border-radius:100%;display:flex;height:28px;justify-content:center;padding:0;width:28px}.generate-customize-control-title button.generate-customize-control-title--toggle svg{fill:none;height:1em;width:1em}.generate-customize-control-title h3{font-size:14px!important;font-weight:500;margin-bottom:0}

View File

@ -0,0 +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}}
.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}

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 434 KiB

View File

@ -0,0 +1,20 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
<svg xmlns="http://www.w3.org/2000/svg">
<metadata>Generated by IcoMoon</metadata>
<defs>
<font id="GeneratePress" horiz-adv-x="1024">
<font-face units-per-em="1024" ascent="896" descent="-128" />
<missing-glyph horiz-adv-x="1024" />
<glyph unicode="&#x20;" horiz-adv-x="512" d="" />
<glyph unicode="&#xf002;" glyph-name="search" d="M416 800c-176.732 0-320-143.268-320-320s143.268-320 320-320c176.732 0 320 143.268 320 320s-143.268 320-320 320zM0 480c0 229.75 186.25 416 416 416s416-186.25 416-416c0-97.482-33.53-187.132-89.686-258.048l267.652-268.036c18.732-18.758 18.71-49.15-0.050-67.882-18.758-18.732-49.15-18.71-67.882 0.050l-267.558 267.942c-70.982-56.36-160.798-90.026-258.476-90.026-229.75 0-416 186.25-416 416z" />
<glyph unicode="&#xf00d;" glyph-name="times" d="M142.058 753.942c18.746 18.744 49.138 18.744 67.884 0l302.058-302.060 302.058 302.060c18.746 18.744 49.138 18.744 67.884 0 18.744-18.746 18.744-49.138 0-67.884l-302.060-302.058 302.060-302.058c18.744-18.746 18.744-49.138 0-67.884-18.746-18.744-49.138-18.744-67.884 0l-302.058 302.060-302.058-302.060c-18.746-18.744-49.138-18.744-67.884 0-18.744 18.746-18.744 49.138 0 67.884l302.060 302.058-302.060 302.058c-18.744 18.746-18.744 49.138 0 67.884z" />
<glyph unicode="&#xf02c;" glyph-name="tags" d="M40 817c-17.672 0-32-14.326-32-32v-352c0-8.486 3.372-16.626 9.374-22.628l448-448c12.496-12.496 32.756-12.496 45.252 0l352 352c12.488 12.488 12.5 32.728 0.026 45.23l-447 448c-6.002 6.016-14.152 9.398-22.652 9.398h-353zM152 625c0 26.51 21.49 48 48 48s48-21.49 48-48c0-26.51-21.49-48-48-48s-48 21.49-48 48zM519.030 809.97c9.372 9.374 24.568 9.374 33.94 0l456-456c9.372-9.372 9.372-24.568 0-33.94l-360-360c-9.372-9.374-24.568-9.374-33.94 0-9.372 9.372-9.372 24.568 0 33.94l343.028 343.030-439.028 439.030c-9.372 9.372-9.372 24.568 0 33.94z" />
<glyph unicode="&#xf07b;" glyph-name="folder" d="M0 672c0 53.020 42.98 96 96 96h220.028c37.462 0 71.502-21.792 87.184-55.814l24.698-53.582c5.228-11.34 16.574-18.604 29.062-18.604h471.028c53.020 0 96-42.98 96-96v-448c0-53.020-42.98-96-96-96h-832c-53.020 0-96 42.98-96 96v576z" />
<glyph unicode="&#xf086;" glyph-name="comments" d="M265.676 236.054c11.374 5.805 22.622 11.82 33.537 18.008 26.727 15.149 53.176 32.285 74.839 51.015 15.088-1.193 30.54-1.851 46.197-1.851 109.809 0 211.267 30.622 286.571 82.561 47.454 32.73 86.229 75.384 108.309 125.29 109.478-44.412 182.996-126.545 182.996-220.573 0-84.371-59.116-158.995-150.179-205.655 46.921-98.432 150.179-203.418 150.179-203.418s-231.674 76.701-308.848 156.918c-19.911-2.238-40.594-3.515-61.584-3.515-177.454 0-325.855 86.143-362.015 201.221zM766.742 630.996c0-141.206-165.922-255.575-370.433-255.575-20.991 0-41.674 1.278-61.584 3.515-77.174-80.187-308.848-156.859-308.848-156.859s103.258 104.944 150.179 203.341c-91.063 46.641-150.179 121.237-150.179 205.577 0 141.204 165.922 255.573 370.433 255.573s370.433-114.369 370.433-255.573z" />
<glyph unicode="&#xf0c9;" glyph-name="bars" d="M0 704c0 26.51 21.49 48 48 48h928c26.51 0 48-21.49 48-48s-21.49-48-48-48h-928c-26.51 0-48 21.49-48 48zM0 384c0 26.51 21.49 48 48 48h928c26.51 0 48-21.49 48-48s-21.49-48-48-48h-928c-26.51 0-48 21.49-48 48zM0 64c0 26.51 21.49 48 48 48h928c26.51 0 48-21.49 48-48s-21.49-48-48-48h-928c-26.51 0-48 21.49-48 48z" />
<glyph unicode="&#xf104;" glyph-name="angle-left" horiz-adv-x="384" d="M356.85 619.576c0-4.53-2.266-9.627-5.665-13.025l-222.633-222.554 222.633-222.554c3.399-3.398 5.665-8.494 5.665-13.025s-2.266-9.627-5.665-13.025l-28.325-28.315c-3.399-3.398-8.497-5.663-13.029-5.663s-9.63 2.265-13.029 5.663l-263.987 263.893c-3.399 3.398-5.665 8.494-5.665 13.025s2.266 9.627 5.665 13.025l263.987 263.893c3.399 3.398 8.497 5.663 13.029 5.663s9.63-2.265 13.029-5.663l28.325-28.315c3.399-3.398 5.665-7.928 5.665-13.025z" />
<glyph unicode="&#xf105;" glyph-name="angle-right" horiz-adv-x="384" d="M356.85 383.998c0-4.532-2.266-9.63-5.665-13.029l-263.987-263.987c-3.399-3.399-8.497-5.665-13.029-5.665s-9.63 2.266-13.029 5.665l-28.325 28.325c-3.399 3.399-5.665 7.931-5.665 13.029 0 4.532 2.266 9.63 5.665 13.029l222.633 222.633-222.633 222.633c-3.399 3.399-5.665 8.497-5.665 13.029s2.266 9.63 5.665 13.029l28.325 28.325c3.399 3.399 8.497 5.665 13.029 5.665s9.63-2.266 13.029-5.665l263.987-263.987c3.399-3.399 5.665-8.497 5.665-13.029z" />
<glyph unicode="&#xf106;" glyph-name="angle-up" horiz-adv-x="660" d="M611.725 266.169c0-4.532-2.265-9.63-5.663-13.029l-28.315-28.325c-3.398-3.399-7.928-5.665-13.025-5.665-4.53 0-9.627 2.266-13.025 5.665l-222.554 222.633-222.554-222.633c-3.398-3.399-8.494-5.665-13.025-5.665s-9.627 2.266-13.025 5.665l-28.315 28.325c-3.398 3.399-5.663 8.497-5.663 13.029s2.265 9.63 5.663 13.029l263.893 263.987c3.398 3.399 8.494 5.665 13.025 5.665s9.627-2.266 13.025-5.665l263.893-263.987c3.398-3.399 5.663-8.497 5.663-13.029z" />
<glyph unicode="&#xf107;" glyph-name="angle-down" horiz-adv-x="660" d="M611.825 501.831c0-4.532-2.266-9.63-5.665-13.029l-263.987-263.987c-3.399-3.399-8.497-5.665-13.029-5.665s-9.63 2.266-13.029 5.665l-263.987 263.987c-3.399 3.399-5.665 8.497-5.665 13.029s2.266 9.63 5.665 13.029l28.325 28.325c3.399 3.399 7.931 5.665 13.029 5.665 4.532 0 9.63-2.266 13.029-5.665l222.633-222.633 222.633 222.633c3.399 3.399 8.497 5.665 13.029 5.665s9.63-2.266 13.029-5.665l28.325-28.325c3.399-3.399 5.665-8.497 5.665-13.029z" />
</font></defs></svg>

After

Width:  |  Height:  |  Size: 5.3 KiB

View File

@ -0,0 +1,65 @@
( function() {
'use strict';
// Feature Test
if ( 'querySelector' in document && 'addEventListener' in window ) {
var goTopBtn = document.querySelector( '.generate-back-to-top' );
var trackScroll = function() {
var scrolled = window.pageYOffset;
var coords = goTopBtn.getAttribute( 'data-start-scroll' );
if ( scrolled > coords ) {
goTopBtn.classList.add( 'generate-back-to-top__show' );
}
if ( scrolled < coords ) {
goTopBtn.classList.remove( 'generate-back-to-top__show' );
}
};
// Function to animate the scroll
var smoothScroll = function( anchor, duration ) {
// Calculate how far and how fast to scroll
var startLocation = window.pageYOffset;
var endLocation = document.body.offsetTop;
var distance = endLocation - startLocation;
var increments = distance / ( duration / 16 );
var stopAnimation;
// Scroll the page by an increment, and check if it's time to stop
var animateScroll = function() {
window.scrollBy( 0, increments );
stopAnimation();
};
// Stop animation when you reach the anchor OR the top of the page
stopAnimation = function() {
var travelled = window.pageYOffset;
if ( travelled <= ( endLocation || 0 ) ) {
clearInterval( runAnimation );
document.activeElement.blur();
}
};
// Loop the animation function
var runAnimation = setInterval( animateScroll, 16 );
};
if ( goTopBtn ) {
// Show the button when scrolling down.
window.addEventListener( 'scroll', trackScroll );
// Scroll back to top when clicked.
goTopBtn.addEventListener( 'click', function( e ) {
e.preventDefault();
if ( generatepressBackToTop.smooth ) {
smoothScroll( document.body, goTopBtn.getAttribute( 'data-scroll-speed' ) || 400 );
} else {
window.scrollTo( 0, 0 );
}
}, false );
}
}
}() );

View File

@ -0,0 +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))}();

View File

@ -0,0 +1,240 @@
/*
* classList.js: Cross-browser full element.classList implementation.
* 1.1.20170427
*
* By Eli Grey, http://eligrey.com
* License: Dedicated to the public domain.
* See https://github.com/eligrey/classList.js/blob/master/LICENSE.md
*/
/*global self, document, DOMException */
/*! @source http://purl.eligrey.com/github/classList.js/blob/master/classList.js */
if ("document" in self) {
// Full polyfill for browsers with no classList support
// Including IE < Edge missing SVGElement.classList
if (!("classList" in document.createElement("_"))
|| document.createElementNS && !("classList" in document.createElementNS("http://www.w3.org/2000/svg","g"))) {
(function (view) {
"use strict";
if (!('Element' in view)) return;
var
classListProp = "classList"
, protoProp = "prototype"
, elemCtrProto = view.Element[protoProp]
, objCtr = Object
, strTrim = String[protoProp].trim || function () {
return this.replace(/^\s+|\s+$/g, "");
}
, arrIndexOf = Array[protoProp].indexOf || function (item) {
var
i = 0
, len = this.length
;
for (; i < len; i++) {
if (i in this && this[i] === item) {
return i;
}
}
return -1;
}
// Vendors: please allow content code to instantiate DOMExceptions
, DOMEx = function (type, message) {
this.name = type;
this.code = DOMException[type];
this.message = message;
}
, checkTokenAndGetIndex = function (classList, token) {
if (token === "") {
throw new DOMEx(
"SYNTAX_ERR"
, "An invalid or illegal string was specified"
);
}
if (/\s/.test(token)) {
throw new DOMEx(
"INVALID_CHARACTER_ERR"
, "String contains an invalid character"
);
}
return arrIndexOf.call(classList, token);
}
, ClassList = function (elem) {
var
trimmedClasses = strTrim.call(elem.getAttribute("class") || "")
, classes = trimmedClasses ? trimmedClasses.split(/\s+/) : []
, i = 0
, len = classes.length
;
for (; i < len; i++) {
this.push(classes[i]);
}
this._updateClassName = function () {
elem.setAttribute("class", this.toString());
};
}
, classListProto = ClassList[protoProp] = []
, classListGetter = function () {
return new ClassList(this);
}
;
// Most DOMException implementations don't allow calling DOMException's toString()
// on non-DOMExceptions. Error's toString() is sufficient here.
DOMEx[protoProp] = Error[protoProp];
classListProto.item = function (i) {
return this[i] || null;
};
classListProto.contains = function (token) {
token += "";
return checkTokenAndGetIndex(this, token) !== -1;
};
classListProto.add = function () {
var
tokens = arguments
, i = 0
, l = tokens.length
, token
, updated = false
;
do {
token = tokens[i] + "";
if (checkTokenAndGetIndex(this, token) === -1) {
this.push(token);
updated = true;
}
}
while (++i < l);
if (updated) {
this._updateClassName();
}
};
classListProto.remove = function () {
var
tokens = arguments
, i = 0
, l = tokens.length
, token
, updated = false
, index
;
do {
token = tokens[i] + "";
index = checkTokenAndGetIndex(this, token);
while (index !== -1) {
this.splice(index, 1);
updated = true;
index = checkTokenAndGetIndex(this, token);
}
}
while (++i < l);
if (updated) {
this._updateClassName();
}
};
classListProto.toggle = function (token, force) {
token += "";
var
result = this.contains(token)
, method = result ?
force !== true && "remove"
:
force !== false && "add"
;
if (method) {
this[method](token);
}
if (force === true || force === false) {
return force;
} else {
return !result;
}
};
classListProto.toString = function () {
return this.join(" ");
};
if (objCtr.defineProperty) {
var classListPropDesc = {
get: classListGetter
, enumerable: true
, configurable: true
};
try {
objCtr.defineProperty(elemCtrProto, classListProp, classListPropDesc);
} catch (ex) { // IE 8 doesn't support enumerable:true
// adding undefined to fight this issue https://github.com/eligrey/classList.js/issues/36
// modernie IE8-MSW7 machine has IE8 8.0.6001.18702 and is affected
if (ex.number === undefined || ex.number === -0x7FF5EC54) {
classListPropDesc.enumerable = false;
objCtr.defineProperty(elemCtrProto, classListProp, classListPropDesc);
}
}
} else if (objCtr[protoProp].__defineGetter__) {
elemCtrProto.__defineGetter__(classListProp, classListGetter);
}
}(self));
}
// There is full or partial native classList support, so just check if we need
// to normalize the add/remove and toggle APIs.
(function () {
"use strict";
var testElement = document.createElement("_");
testElement.classList.add("c1", "c2");
// Polyfill for IE 10/11 and Firefox <26, where classList.add and
// classList.remove exist but support only one argument at a time.
if (!testElement.classList.contains("c2")) {
var createMethod = function(method) {
var original = DOMTokenList.prototype[method];
DOMTokenList.prototype[method] = function(token) {
var i, len = arguments.length;
for (i = 0; i < len; i++) {
token = arguments[i];
original.call(this, token);
}
};
};
createMethod('add');
createMethod('remove');
}
testElement.classList.toggle("c3", false);
// Polyfill for IE 10 and Firefox <24, where classList.toggle does not
// support the second argument.
if (testElement.classList.contains("c3")) {
var _toggle = DOMTokenList.prototype.toggle;
DOMTokenList.prototype.toggle = function(token, force) {
if (1 in arguments && !this.contains(token) === !force) {
return force;
} else {
return _toggle.call(this, token);
}
};
}
testElement = null;
}());
}

View File

@ -0,0 +1,2 @@
/*! @source http://purl.eligrey.com/github/classList.js/blob/master/classList.js */
"document"in self&&("classList"in document.createElement("_")&&(!document.createElementNS||"classList"in document.createElementNS("http://www.w3.org/2000/svg","g"))||!function(t){"use strict";if("Element"in t){var e="classList",n="prototype",i=t.Element[n],s=Object,r=String[n].trim||function(){return this.replace(/^\s+|\s+$/g,"")},o=Array[n].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1},a=function(t,e){this.name=t,this.code=DOMException[t],this.message=e},c=function(t,e){if(""===e)throw new a("SYNTAX_ERR","An invalid or illegal string was specified");if(/\s/.test(e))throw new a("INVALID_CHARACTER_ERR","String contains an invalid character");return o.call(t,e)},l=function(t){for(var e=r.call(t.getAttribute("class")||""),n=e?e.split(/\s+/):[],i=0,s=n.length;s>i;i++)this.push(n[i]);this._updateClassName=function(){t.setAttribute("class",""+this)}},u=l[n]=[],h=function(){return new l(this)};if(a[n]=Error[n],u.item=function(t){return this[t]||null},u.contains=function(t){return t+="",-1!==c(this,t)},u.add=function(){var t,e=arguments,n=0,i=e.length,s=!1;do t=e[n]+"",-1===c(this,t)&&(this.push(t),s=!0);while(++n<i);s&&this._updateClassName()},u.remove=function(){var t,e,n=arguments,i=0,s=n.length,r=!1;do for(t=n[i]+"",e=c(this,t);-1!==e;)this.splice(e,1),r=!0,e=c(this,t);while(++i<s);r&&this._updateClassName()},u.toggle=function(t,e){t+="";var n=this.contains(t),i=n?e!==!0&&"remove":e!==!1&&"add";return i&&this[i](t),e===!0||e===!1?e:!n},u.toString=function(){return this.join(" ")},s.defineProperty){var f={get:h,enumerable:!0,configurable:!0};try{s.defineProperty(i,e,f)}catch(g){(void 0===g.number||-2146823252===g.number)&&(f.enumerable=!1,s.defineProperty(i,e,f))}}else s[n].__defineGetter__&&i.__defineGetter__(e,h)}}(self),function(){"use strict";var t=document.createElement("_");if(t.classList.add("c1","c2"),!t.classList.contains("c2")){var e=function(t){var e=DOMTokenList.prototype[t];DOMTokenList.prototype[t]=function(t){var n,i=arguments.length;for(n=0;i>n;n++)t=arguments[n],e.call(this,t)}};e("add"),e("remove")}if(t.classList.toggle("c3",!1),t.classList.contains("c3")){var n=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(t,e){return 1 in arguments&&!this.contains(t)==!e?e:n.call(this,t)}}t=null}());

View File

@ -0,0 +1,123 @@
( function() {
'use strict';
if ( 'querySelector' in document && 'addEventListener' in window ) {
var body = document.body,
i;
/**
* Dropdown click
*
* @param {Object} e The event.
* @param {Object} _this The clicked item.
*/
var dropdownClick = function( e, _this ) {
e.preventDefault();
e.stopPropagation();
if ( ! _this ) {
_this = this;
}
var closestLi = _this.closest( 'li' );
// Close other sub-menus
var openedSubMenus = _this.closest( 'nav' ).querySelectorAll( 'ul.toggled-on' );
if ( openedSubMenus && ! _this.closest( 'ul' ).classList.contains( 'toggled-on' ) && ! _this.closest( 'li' ).classList.contains( 'sfHover' ) ) {
for ( var o = 0; o < openedSubMenus.length; o++ ) {
openedSubMenus[ o ].classList.remove( 'toggled-on' );
openedSubMenus[ o ].closest( 'li' ).classList.remove( 'sfHover' );
}
}
// Add sfHover class to parent li
closestLi.classList.toggle( 'sfHover' );
// Set aria-expanded on arrow
var dropdownToggle = closestLi.querySelector( '.dropdown-menu-toggle' );
if ( 'false' === dropdownToggle.getAttribute( 'aria-expanded' ) || ! dropdownToggle.getAttribute( 'aria-expanded' ) ) {
dropdownToggle.setAttribute( 'aria-expanded', 'true' );
} else {
dropdownToggle.setAttribute( 'aria-expanded', 'false' );
}
if ( closestLi.querySelector( '.sub-menu' ) ) {
var subMenuSelector = '.sub-menu';
} else {
subMenuSelector = '.children';
}
// Open the sub-menu
if ( body.classList.contains( 'dropdown-click-menu-item' ) ) {
_this.parentNode.querySelector( subMenuSelector ).classList.toggle( 'toggled-on' );
} else if ( body.classList.contains( 'dropdown-click-arrow' ) ) {
closestLi.querySelector( subMenuSelector ).classList.toggle( 'toggled-on' );
}
};
// Do stuff if click dropdown if enabled
var parentElementLinks = document.querySelectorAll( '.main-nav .menu-item-has-children > a' );
// Open the sub-menu by clicking on the entire link element
if ( body.classList.contains( 'dropdown-click-menu-item' ) ) {
for ( i = 0; i < parentElementLinks.length; i++ ) {
parentElementLinks[ i ].addEventListener( 'click', dropdownClick, true );
}
}
// 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' );
}
}
var dropdownToggleLinks = document.querySelectorAll( '.main-nav .menu-item-has-children > a .dropdown-menu-toggle' );
for ( i = 0; i < dropdownToggleLinks.length; i++ ) {
dropdownToggleLinks[ i ].addEventListener( 'click', dropdownClick, false );
dropdownToggleLinks[ i ].addEventListener( 'keydown', function( e ) {
var _this = this;
if ( 'Enter' === e.key ) {
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 );
}
}
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' );
}
for ( i = 0; i < activeDropdownToggles.length; i++ ) {
activeDropdownToggles[ i ].setAttribute( 'aria-expanded', 'false' );
}
}
};
// Close sub-menus when clicking elsewhere
document.addEventListener( 'click', function( event ) {
if ( ! event.target.closest( '.sfHover' ) ) {
closeSubMenus();
}
}, false );
// Close sub-menus on escape key
document.addEventListener( 'keydown', function( e ) {
if ( 'Escape' === e.key ) { // 27 is esc
closeSubMenus();
}
}, false );
}
}() );

View File

@ -0,0 +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)}}();

View File

@ -0,0 +1,415 @@
( function() {
'use strict';
if ( 'querySelector' in document && 'addEventListener' in window ) {
/**
* matches() pollyfil
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/Element/closest#Browser_compatibility
*/
if ( ! Element.prototype.matches ) {
Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;
}
/**
* closest() pollyfil
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/Element/closest#Browser_compatibility
* @param {Object} s The element to check.
* @return {Object} The closest object.
*/
if ( ! Element.prototype.closest ) {
Element.prototype.closest = function( s ) {
var el = this;
var ancestor = this;
if ( ! document.documentElement.contains( el ) ) {
return null;
}
do {
if ( ancestor.matches( s ) ) {
return ancestor;
}
ancestor = ancestor.parentElement;
} while ( ancestor !== null );
return null;
};
}
var getSiblings = function( elem ) {
return Array.prototype.filter.call( elem.parentNode.children, function( sibling ) {
return sibling !== elem;
} );
};
var allNavToggles = document.querySelectorAll( '.menu-toggle' ),
dropdownToggles = document.querySelectorAll( 'nav .dropdown-menu-toggle' ),
navLinks = document.querySelectorAll( 'nav .main-nav ul a' ),
mobileMenuControls = document.querySelector( '.mobile-menu-control-wrapper' ),
body = document.body,
htmlEl = document.documentElement,
i;
var enableDropdownArrows = function( nav ) {
if ( nav && body.classList.contains( 'dropdown-hover' ) ) {
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 disableDropdownArrows = function( nav ) {
if ( nav && body.classList.contains( 'dropdown-hover' ) ) {
var dropdownItems = nav.querySelectorAll( 'li.menu-item-has-children' );
for ( i = 0; i < dropdownItems.length; i++ ) {
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-label' );
}
}
};
var setDropdownArrowAttributes = function( arrow ) {
if ( 'false' === arrow.getAttribute( 'aria-expanded' ) || ! arrow.getAttribute( 'aria-expanded' ) ) {
arrow.setAttribute( 'aria-expanded', 'true' );
arrow.setAttribute( 'aria-label', generatepressMenu.closeSubMenuLabel );
} else {
arrow.setAttribute( 'aria-expanded', 'false' );
arrow.setAttribute( 'aria-label', generatepressMenu.openSubMenuLabel );
}
};
/**
* Start mobile menu toggle.
*
* @param {Object} e The event.
* @param {Object} _this The clicked item.
*/
var toggleNav = function( e, _this ) {
if ( ! _this ) {
_this = this;
}
var parentContainer = '';
if ( _this.getAttribute( 'data-nav' ) ) {
parentContainer = document.getElementById( _this.getAttribute( 'data-nav' ) );
} else {
parentContainer = document.getElementById( _this.closest( 'nav' ).getAttribute( 'id' ) );
}
if ( ! parentContainer ) {
return;
}
var isExternalToggle = false;
if ( _this.closest( '.mobile-menu-control-wrapper' ) ) {
isExternalToggle = true;
}
var nav = parentContainer.getElementsByTagName( 'ul' )[ 0 ];
if ( parentContainer.classList.contains( 'toggled' ) ) {
parentContainer.classList.remove( 'toggled' );
htmlEl.classList.remove( 'mobile-menu-open' );
if ( nav ) {
nav.setAttribute( 'aria-hidden', 'true' );
}
_this.setAttribute( 'aria-expanded', 'false' );
if ( isExternalToggle ) {
mobileMenuControls.classList.remove( 'toggled' );
} else if ( mobileMenuControls && parentContainer.classList.contains( 'main-navigation' ) ) {
mobileMenuControls.classList.remove( 'toggled' );
}
disableDropdownArrows( nav );
} else {
parentContainer.classList.add( 'toggled' );
htmlEl.classList.add( 'mobile-menu-open' );
if ( nav ) {
nav.setAttribute( 'aria-hidden', 'false' );
}
_this.setAttribute( 'aria-expanded', 'true' );
if ( isExternalToggle ) {
mobileMenuControls.classList.add( 'toggled' );
if ( mobileMenuControls.querySelector( '.search-item' ) ) {
if ( mobileMenuControls.querySelector( '.search-item' ).classList.contains( 'active' ) ) {
mobileMenuControls.querySelector( '.search-item' ).click();
}
}
} else if ( mobileMenuControls && parentContainer.classList.contains( 'main-navigation' ) ) {
mobileMenuControls.classList.add( 'toggled' );
}
enableDropdownArrows( nav );
}
};
for ( i = 0; i < allNavToggles.length; i++ ) {
allNavToggles[ i ].addEventListener( 'click', toggleNav, false );
}
/**
* Open sub-menus
*
* @param {Object} e The event.
* @param {Object} _this The clicked item.
*/
var toggleSubNav = function( e, _this ) {
if ( ! _this ) {
_this = this;
}
if ( ( _this.closest( 'nav' ).classList.contains( 'toggled' ) || htmlEl.classList.contains( 'slide-opened' ) ) && ! body.classList.contains( 'dropdown-click' ) ) {
e.preventDefault();
var closestLi = _this.closest( 'li' );
setDropdownArrowAttributes( closestLi.querySelector( '.dropdown-menu-toggle' ) );
if ( closestLi.querySelector( '.sub-menu' ) ) {
var subMenu = closestLi.querySelector( '.sub-menu' );
} else {
subMenu = closestLi.querySelector( '.children' );
}
if ( generatepressMenu.toggleOpenedSubMenus ) {
var siblings = getSiblings( closestLi );
for ( i = 0; i < siblings.length; i++ ) {
if ( siblings[ i ].classList.contains( 'sfHover' ) ) {
siblings[ i ].classList.remove( 'sfHover' );
siblings[ i ].querySelector( '.toggled-on' ).classList.remove( 'toggled-on' );
setDropdownArrowAttributes( siblings[ i ].querySelector( '.dropdown-menu-toggle' ) );
}
}
}
closestLi.classList.toggle( 'sfHover' );
subMenu.classList.toggle( 'toggled-on' );
}
e.stopPropagation();
};
for ( i = 0; i < dropdownToggles.length; i++ ) {
dropdownToggles[ i ].addEventListener( 'click', toggleSubNav, false );
dropdownToggles[ i ].addEventListener( 'keypress', function( e ) {
if ( 'Enter' === e.key || ' ' === e.key ) {
toggleSubNav( e, this );
}
}, false );
}
/**
* Disable the mobile menu if our toggle isn't visible.
* Makes it possible to style mobile item with .toggled class.
*/
var checkMobile = function() {
var openedMobileMenus = document.querySelectorAll( '.toggled, .has-active-search' );
for ( i = 0; i < openedMobileMenus.length; i++ ) {
var menuToggle = openedMobileMenus[ i ].querySelector( '.menu-toggle' );
if ( mobileMenuControls && ! menuToggle.closest( 'nav' ).classList.contains( 'mobile-menu-control-wrapper' ) ) {
menuToggle = mobileMenuControls.querySelector( '.menu-toggle' );
}
if ( menuToggle && menuToggle.offsetParent === null ) {
if ( openedMobileMenus[ i ].classList.contains( 'toggled' ) ) {
var remoteNav = false;
if ( openedMobileMenus[ i ].classList.contains( 'mobile-menu-control-wrapper' ) ) {
remoteNav = true;
}
if ( ! remoteNav ) {
// Navigation is toggled, but .menu-toggle isn't visible on the page (display: none).
var closestNav = openedMobileMenus[ i ].getElementsByTagName( 'ul' )[ 0 ],
closestNavItems = closestNav ? closestNav.getElementsByTagName( 'li' ) : [],
closestSubMenus = closestNav ? closestNav.getElementsByTagName( 'ul' ) : [];
}
document.activeElement.blur();
openedMobileMenus[ i ].classList.remove( 'toggled' );
htmlEl.classList.remove( 'mobile-menu-open' );
menuToggle.setAttribute( 'aria-expanded', 'false' );
if ( ! remoteNav ) {
for ( var li = 0; li < closestNavItems.length; li++ ) {
closestNavItems[ li ].classList.remove( 'sfHover' );
}
for ( var sm = 0; sm < closestSubMenus.length; sm++ ) {
closestSubMenus[ sm ].classList.remove( 'toggled-on' );
}
if ( closestNav ) {
closestNav.removeAttribute( 'aria-hidden' );
}
}
disableDropdownArrows( openedMobileMenus[ i ] );
}
if ( mobileMenuControls.querySelector( '.search-item' ) ) {
if ( mobileMenuControls.querySelector( '.search-item' ).classList.contains( 'active' ) ) {
mobileMenuControls.querySelector( '.search-item' ).click();
}
}
}
}
};
window.addEventListener( 'resize', checkMobile, false );
window.addEventListener( 'orientationchange', checkMobile, false );
if ( body.classList.contains( 'dropdown-hover' ) ) {
/**
* Do some essential things when menu items are clicked.
*/
for ( i = 0; i < navLinks.length; i++ ) {
navLinks[ i ].addEventListener( 'click', function( e ) {
// Remove sfHover class if we're going to another site.
if ( this.hostname !== window.location.hostname ) {
document.activeElement.blur();
}
var closestNav = this.closest( 'nav' );
if ( closestNav.classList.contains( 'toggled' ) || htmlEl.classList.contains( 'slide-opened' ) ) {
var url = this.getAttribute( 'href' );
// Open the sub-menu if the link has no destination
if ( '#' === url || '' === url ) {
e.preventDefault();
var closestLi = this.closest( 'li' );
closestLi.classList.toggle( 'sfHover' );
var subMenu = closestLi.querySelector( '.sub-menu' );
if ( subMenu ) {
subMenu.classList.toggle( 'toggled-on' );
}
}
}
}, false );
}
}
if ( body.classList.contains( 'dropdown-hover' ) ) {
var menuBarItems = document.querySelectorAll( '.menu-bar-items .menu-bar-item > a' );
/**
* Make menu items tab accessible when using the hover dropdown type
*/
var toggleFocus = function() {
if ( this.closest( 'nav' ).classList.contains( 'toggled' ) || this.closest( 'nav' ).classList.contains( 'slideout-navigation' ) ) {
return;
}
var self = this;
while ( -1 === self.className.indexOf( 'main-nav' ) ) {
if ( 'li' === self.tagName.toLowerCase() ) {
self.classList.toggle( 'sfHover' );
}
self = self.parentElement;
}
};
/**
* Make our menu bar items tab accessible.
*/
var toggleMenuBarItemFocus = function() {
if ( this.closest( 'nav' ).classList.contains( 'toggled' ) || this.closest( 'nav' ).classList.contains( 'slideout-navigation' ) ) {
return;
}
var self = this;
while ( -1 === self.className.indexOf( 'menu-bar-items' ) ) {
if ( self.classList.contains( 'menu-bar-item' ) ) {
self.classList.toggle( 'sfHover' );
}
self = self.parentElement;
}
};
for ( i = 0; i < navLinks.length; i++ ) {
navLinks[ i ].addEventListener( 'focus', toggleFocus );
navLinks[ i ].addEventListener( 'blur', toggleFocus );
}
for ( i = 0; i < menuBarItems.length; i++ ) {
menuBarItems[ i ].addEventListener( 'focus', toggleMenuBarItemFocus );
menuBarItems[ i ].addEventListener( 'blur', toggleMenuBarItemFocus );
}
}
/**
* Make hover dropdown touch-friendly.
*/
if ( 'ontouchend' in document.documentElement && document.body.classList.contains( 'dropdown-hover' ) ) {
var parentElements = document.querySelectorAll( '.sf-menu .menu-item-has-children' );
for ( i = 0; i < parentElements.length; i++ ) {
parentElements[ i ].addEventListener( 'touchend', function( e ) {
// Bail on mobile
if ( this.closest( 'nav' ).classList.contains( 'toggled' ) ) {
return;
}
if ( e.touches.length === 1 || e.touches.length === 0 ) {
// Prevent touch events within dropdown bubbling down to document
e.stopPropagation();
// Toggle hover
if ( ! this.classList.contains( 'sfHover' ) ) {
// Prevent link on first touch
if ( e.target === this || e.target.parentNode === this || e.target.parentNode.parentNode ) {
e.preventDefault();
}
// Close other sub-menus.
var closestLi = this.closest( 'li' ),
siblings = getSiblings( closestLi );
for ( i = 0; i < siblings.length; i++ ) {
if ( siblings[ i ].classList.contains( 'sfHover' ) ) {
siblings[ i ].classList.remove( 'sfHover' );
}
}
this.classList.add( 'sfHover' );
// Hide dropdown on touch outside
var closeDropdown,
thisItem = this;
document.addEventListener( 'touchend', closeDropdown = function( event ) {
event.stopPropagation();
thisItem.classList.remove( 'sfHover' );
document.removeEventListener( 'touchend', closeDropdown );
} );
}
}
} );
}
}
}
}() );

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,126 @@
( function() {
'use strict';
if ( 'querySelector' in document && 'addEventListener' in window ) {
/**
* Navigation search.
*
* @param {Object} e The event.
* @param {Object} item The clicked item.
*/
var toggleSearch = function( e, item ) {
e.preventDefault();
if ( ! item ) {
item = this;
}
var forms = document.querySelectorAll( '.navigation-search' ),
toggles = document.querySelectorAll( '.search-item' ),
focusableEls = document.querySelectorAll( 'a[href], area[href], input:not([disabled]):not(.navigation-search), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex="0"]' ),
nav = '';
if ( item.closest( '.mobile-menu-control-wrapper' ) ) {
nav = document.getElementById( 'site-navigation' );
}
for ( var i = 0; i < forms.length; i++ ) {
if ( forms[ i ].classList.contains( 'nav-search-active' ) ) {
if ( forms[ i ].closest( '#sticky-placeholder' ) ) {
continue;
}
forms[ i ].classList.remove( 'nav-search-active' );
var activeSearch = document.querySelector( '.has-active-search' );
if ( activeSearch ) {
activeSearch.classList.remove( 'has-active-search' );
}
for ( var t = 0; t < toggles.length; t++ ) {
toggles[ t ].classList.remove( 'close-search' );
toggles[ t ].classList.remove( 'active' );
toggles[ t ].querySelector( 'a' ).setAttribute( 'aria-label', generatepressNavSearch.open );
// Allow tabindex on items again.
for ( var f = 0; f < focusableEls.length; f++ ) {
if ( ! focusableEls[ f ].closest( '.navigation-search' ) && ! focusableEls[ f ].closest( '.search-item' ) ) {
focusableEls[ f ].removeAttribute( 'tabindex' );
}
}
}
document.activeElement.blur();
} else {
if ( forms[ i ].closest( '#sticky-placeholder' ) ) {
continue;
}
var openedMobileMenu = forms[ i ].closest( '.toggled' );
if ( openedMobileMenu ) {
// Close the mobile menu.
openedMobileMenu.querySelector( 'button.menu-toggle' ).click();
}
if ( nav ) {
nav.classList.add( 'has-active-search' );
}
forms[ i ].classList.add( 'nav-search-active' );
var container = this.closest( 'nav' );
if ( container ) {
if ( container.classList.contains( 'mobile-menu-control-wrapper' ) ) {
container = nav;
}
var searchField = container.querySelector( '.search-field' );
if ( searchField ) {
searchField.focus();
}
}
for ( t = 0; t < toggles.length; t++ ) {
toggles[ t ].classList.add( 'active' );
toggles[ t ].querySelector( 'a' ).setAttribute( 'aria-label', generatepressNavSearch.close );
// Trap tabindex within the search element
for ( f = 0; f < focusableEls.length; f++ ) {
if ( ! focusableEls[ f ].closest( '.navigation-search' ) && ! focusableEls[ f ].closest( '.search-item' ) ) {
focusableEls[ f ].setAttribute( 'tabindex', '-1' );
}
}
toggles[ t ].classList.add( 'close-search' );
}
}
}
};
if ( document.body.classList.contains( 'nav-search-enabled' ) ) {
var searchItems = document.querySelectorAll( '.search-item' );
for ( var i = 0; i < searchItems.length; i++ ) {
searchItems[ i ].addEventListener( 'click', toggleSearch, false );
}
// Close navigation search on escape key
document.addEventListener( 'keydown', function( e ) {
if ( document.querySelector( '.navigation-search.nav-search-active' ) ) {
if ( 'Escape' === e.key ) {
var activeSearchItems = document.querySelectorAll( '.search-item.active' );
for ( var activeSearchItem = 0; activeSearchItem < activeSearchItems.length; activeSearchItem++ ) {
toggleSearch( e, activeSearchItems[ activeSearchItem ] );
break;
}
}
}
}, false );
}
}
}() );

View File

@ -0,0 +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)}}}();

View File

@ -0,0 +1,130 @@
<?php
/**
* The template for displaying Comments.
*
* The area of the page that contains both current comments
* and the comment form. The actual display of comments is
* handled by a callback to generate_comment() which is
* located in the inc/template-tags.php file.
*
* @package GeneratePress
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
/*
* If the current post is protected by a password and
* the visitor has not yet entered the password we will
* return early without loading the comments.
*/
if ( post_password_required() ) {
return;
}
/**
* generate_before_comments hook.
*
* @since 0.1
*/
do_action( 'generate_before_comments' );
?>
<div id="comments">
<?php
/**
* generate_inside_comments hook.
*
* @since 1.3.47
*/
do_action( 'generate_inside_comments' );
if ( have_comments() ) :
$comments_number = get_comments_number();
$comments_title = apply_filters(
'generate_comment_form_title',
sprintf(
esc_html(
/* translators: 1: number of comments, 2: post title */
_nx(
'%1$s thought on &ldquo;%2$s&rdquo;',
'%1$s thoughts on &ldquo;%2$s&rdquo;',
$comments_number,
'comments title',
'generatepress'
)
),
number_format_i18n( $comments_number ),
get_the_title()
)
);
// phpcs:ignore -- Title escaped in output.
echo apply_filters(
'generate_comments_title_output',
sprintf(
'<h3 class="comments-title">%s</h3>',
esc_html( $comments_title )
),
$comments_title,
$comments_number
);
/**
* generate_below_comments_title hook.
*
* @since 0.1
*/
do_action( 'generate_below_comments_title' );
if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) :
?>
<nav id="comment-nav-above" class="comment-navigation" role="navigation">
<h2 class="screen-reader-text"><?php esc_html_e( 'Comment navigation', 'generatepress' ); ?></h2>
<div class="nav-previous"><?php previous_comments_link( __( '&larr; Older Comments', 'generatepress' ) ); ?></div>
<div class="nav-next"><?php next_comments_link( __( 'Newer Comments &rarr;', 'generatepress' ) ); ?></div>
</nav><!-- #comment-nav-above -->
<?php endif; ?>
<ol class="comment-list">
<?php
/*
* Loop through and list the comments. Tell wp_list_comments()
* to use generate_comment() to format the comments.
* If you want to override this in a child theme, then you can
* define generate_comment() and that will be used instead.
* See generate_comment() in inc/template-tags.php for more.
*/
wp_list_comments(
array(
'callback' => 'generate_comment',
)
);
?>
</ol><!-- .comment-list -->
<?php
if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) :
?>
<nav id="comment-nav-below" class="comment-navigation" role="navigation">
<h2 class="screen-reader-text"><?php esc_html_e( 'Comment navigation', 'generatepress' ); ?></h2>
<div class="nav-previous"><?php previous_comments_link( __( '&larr; Older Comments', 'generatepress' ) ); ?></div>
<div class="nav-next"><?php next_comments_link( __( 'Newer Comments &rarr;', 'generatepress' ) ); ?></div>
</nav><!-- #comment-nav-below -->
<?php
endif;
endif;
// phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison
if ( ! comments_open() && '0' != get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) :
?>
<p class="no-comments"><?php esc_html_e( 'Comments are closed.', 'generatepress' ); ?></p>
<?php
endif;
comment_form();
?>
</div><!-- #comments -->

View File

@ -0,0 +1,67 @@
<?php
/**
* The template for displaying 404 pages.
*
* @package GeneratePress
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
?>
<div class="inside-article">
<?php
/**
* generate_before_content hook.
*
* @since 0.1
*
* @hooked generate_featured_page_header_inside_single - 10
*/
do_action( 'generate_before_content' );
?>
<header <?php generate_do_attr( 'entry-header' ); ?>>
<?php // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- HTML is allowed in filter here. ?>
<h1 class="entry-title" itemprop="headline"><?php echo apply_filters( 'generate_404_title', __( 'Oops! That page can&rsquo;t be found.', 'generatepress' ) ); ?></h1>
</header>
<?php
/**
* generate_after_entry_header hook.
*
* @since 0.1
*
* @hooked generate_post_image - 10
*/
do_action( 'generate_after_entry_header' );
$itemprop = '';
if ( 'microdata' === generate_get_schema_type() ) {
$itemprop = ' itemprop="text"';
}
?>
<div class="entry-content"<?php echo $itemprop; // phpcs:ignore -- No escaping needed. ?>>
<?php
printf(
'<p>%s</p>',
apply_filters( 'generate_404_text', __( 'It looks like nothing was found at this location. Maybe try searching?', 'generatepress' ) ) // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- HTML is allowed in filter here.
);
get_search_form();
?>
</div>
<?php
/**
* generate_after_content hook.
*
* @since 0.1
*/
do_action( 'generate_after_content' );
?>
</div>

View File

@ -0,0 +1,111 @@
<?php
/**
* The template for displaying Link post formats.
*
* @package GeneratePress
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?> <?php generate_do_microdata( 'article' ); ?>>
<div class="inside-article">
<?php
/**
* generate_before_content hook.
*
* @since 0.1
*
* @hooked generate_featured_page_header_inside_single - 10
*/
do_action( 'generate_before_content' );
if ( generate_show_entry_header() ) :
?>
<header <?php generate_do_attr( 'entry-header' ); ?>>
<?php
/**
* generate_before_entry_title hook.
*
* @since 0.1
*/
do_action( 'generate_before_entry_title' );
if ( generate_show_title() ) {
$params = generate_get_the_title_parameters();
the_title( $params['before'], $params['after'] );
}
/**
* generate_after_entry_title hook.
*
* @since 0.1
*
* @hooked generate_post_meta - 10
*/
do_action( 'generate_after_entry_title' );
?>
</header>
<?php
endif;
/**
* generate_after_entry_header hook.
*
* @since 0.1
*
* @hooked generate_post_image - 10
*/
do_action( 'generate_after_entry_header' );
$itemprop = '';
if ( 'microdata' === generate_get_schema_type() ) {
$itemprop = ' itemprop="text"';
}
if ( generate_show_excerpt() ) :
?>
<div class="entry-summary"<?php echo $itemprop; // phpcs:ignore -- No escaping needed. ?>>
<?php the_excerpt(); ?>
</div>
<?php else : ?>
<div class="entry-content"<?php echo $itemprop; // phpcs:ignore -- No escaping needed. ?>>
<?php
the_content();
wp_link_pages(
array(
'before' => '<div class="page-links">' . __( 'Pages:', 'generatepress' ),
'after' => '</div>',
)
);
?>
</div>
<?php
endif;
/**
* generate_after_entry_content hook.
*
* @since 0.1
*
* @hooked generate_footer_meta - 10
*/
do_action( 'generate_after_entry_content' );
/**
* generate_after_content hook.
*
* @since 0.1
*/
do_action( 'generate_after_content' );
?>
</div>
</article>

View File

@ -0,0 +1,93 @@
<?php
/**
* The template used for displaying page content in page.php
*
* @package GeneratePress
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?> <?php generate_do_microdata( 'article' ); ?>>
<div class="inside-article">
<?php
/**
* generate_before_content hook.
*
* @since 0.1
*
* @hooked generate_featured_page_header_inside_single - 10
*/
do_action( 'generate_before_content' );
if ( generate_show_entry_header() ) :
?>
<header <?php generate_do_attr( 'entry-header' ); ?>>
<?php
/**
* generate_before_page_title hook.
*
* @since 2.4
*/
do_action( 'generate_before_page_title' );
if ( generate_show_title() ) {
$params = generate_get_the_title_parameters();
the_title( $params['before'], $params['after'] );
}
/**
* generate_after_page_title hook.
*
* @since 2.4
*/
do_action( 'generate_after_page_title' );
?>
</header>
<?php
endif;
/**
* generate_after_entry_header hook.
*
* @since 0.1
*
* @hooked generate_post_image - 10
*/
do_action( 'generate_after_entry_header' );
$itemprop = '';
if ( 'microdata' === generate_get_schema_type() ) {
$itemprop = ' itemprop="text"';
}
?>
<div class="entry-content"<?php echo $itemprop; // phpcs:ignore -- No escaping needed. ?>>
<?php
the_content();
wp_link_pages(
array(
'before' => '<div class="page-links">' . __( 'Pages:', 'generatepress' ),
'after' => '</div>',
)
);
?>
</div>
<?php
/**
* generate_after_content hook.
*
* @since 0.1
*/
do_action( 'generate_after_content' );
?>
</div>
</article>

View File

@ -0,0 +1,102 @@
<?php
/**
* The template for displaying single posts.
*
* @package GeneratePress
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?> <?php generate_do_microdata( 'article' ); ?>>
<div class="inside-article">
<?php
/**
* generate_before_content hook.
*
* @since 0.1
*
* @hooked generate_featured_page_header_inside_single - 10
*/
do_action( 'generate_before_content' );
if ( generate_show_entry_header() ) :
?>
<header <?php generate_do_attr( 'entry-header' ); ?>>
<?php
/**
* generate_before_entry_title hook.
*
* @since 0.1
*/
do_action( 'generate_before_entry_title' );
if ( generate_show_title() ) {
$params = generate_get_the_title_parameters();
the_title( $params['before'], $params['after'] );
}
/**
* generate_after_entry_title hook.
*
* @since 0.1
*
* @hooked generate_post_meta - 10
*/
do_action( 'generate_after_entry_title' );
?>
</header>
<?php
endif;
/**
* generate_after_entry_header hook.
*
* @since 0.1
*
* @hooked generate_post_image - 10
*/
do_action( 'generate_after_entry_header' );
$itemprop = '';
if ( 'microdata' === generate_get_schema_type() ) {
$itemprop = ' itemprop="text"';
}
?>
<div class="entry-content"<?php echo $itemprop; // phpcs:ignore -- No escaping needed. ?>>
<?php
the_content();
wp_link_pages(
array(
'before' => '<div class="page-links">' . __( 'Pages:', 'generatepress' ),
'after' => '</div>',
)
);
?>
</div>
<?php
/**
* generate_after_entry_content hook.
*
* @since 0.1
*
* @hooked generate_footer_meta - 10
*/
do_action( 'generate_after_entry_content' );
/**
* generate_after_content hook.
*
* @since 0.1
*/
do_action( 'generate_after_content' );
?>
</div>
</article>

View File

@ -0,0 +1,111 @@
<?php
/**
* The template for displaying posts within the loop.
*
* @package GeneratePress
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?> <?php generate_do_microdata( 'article' ); ?>>
<div class="inside-article">
<?php
/**
* generate_before_content hook.
*
* @since 0.1
*
* @hooked generate_featured_page_header_inside_single - 10
*/
do_action( 'generate_before_content' );
if ( generate_show_entry_header() ) :
?>
<header <?php generate_do_attr( 'entry-header' ); ?>>
<?php
/**
* generate_before_entry_title hook.
*
* @since 0.1
*/
do_action( 'generate_before_entry_title' );
if ( generate_show_title() ) {
$params = generate_get_the_title_parameters();
the_title( $params['before'], $params['after'] );
}
/**
* generate_after_entry_title hook.
*
* @since 0.1
*
* @hooked generate_post_meta - 10
*/
do_action( 'generate_after_entry_title' );
?>
</header>
<?php
endif;
/**
* generate_after_entry_header hook.
*
* @since 0.1
*
* @hooked generate_post_image - 10
*/
do_action( 'generate_after_entry_header' );
$itemprop = '';
if ( 'microdata' === generate_get_schema_type() ) {
$itemprop = ' itemprop="text"';
}
if ( generate_show_excerpt() ) :
?>
<div class="entry-summary"<?php echo $itemprop; // phpcs:ignore -- No escaping needed. ?>>
<?php the_excerpt(); ?>
</div>
<?php else : ?>
<div class="entry-content"<?php echo $itemprop; // phpcs:ignore -- No escaping needed. ?>>
<?php
the_content();
wp_link_pages(
array(
'before' => '<div class="page-links">' . __( 'Pages:', 'generatepress' ),
'after' => '</div>',
)
);
?>
</div>
<?php
endif;
/**
* generate_after_entry_content hook.
*
* @since 0.1
*
* @hooked generate_footer_meta - 10
*/
do_action( 'generate_after_entry_content' );
/**
* generate_after_content hook.
*
* @since 0.1
*/
do_action( 'generate_after_content' );
?>
</div>
</article>

View File

@ -0,0 +1,65 @@
<?php
/**
* The template for displaying the footer.
*
* @package GeneratePress
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
?>
</div>
</div>
<?php
/**
* generate_before_footer hook.
*
* @since 0.1
*/
do_action( 'generate_before_footer' );
?>
<div <?php generate_do_attr( 'footer' ); ?>>
<?php
/**
* generate_before_footer_content hook.
*
* @since 0.1
*/
do_action( 'generate_before_footer_content' );
/**
* generate_footer hook.
*
* @since 1.3.42
*
* @hooked generate_construct_footer_widgets - 5
* @hooked generate_construct_footer - 10
*/
do_action( 'generate_footer' );
/**
* generate_after_footer_content hook.
*
* @since 0.1
*/
do_action( 'generate_after_footer_content' );
?>
</div>
<?php
/**
* generate_after_footer hook.
*
* @since 2.1
*/
do_action( 'generate_after_footer' );
wp_footer();
?>
</body>
</html>

View File

@ -0,0 +1,123 @@
<?php
/**
* GeneratePress.
*
* Please do not make any edits to this file. All edits should be done in a child theme.
*
* @package GeneratePress
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
// Set our theme version.
define( 'GENERATE_VERSION', '3.4.0' );
if ( ! function_exists( 'generate_setup' ) ) {
add_action( 'after_setup_theme', 'generate_setup' );
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* @since 0.1
*/
function generate_setup() {
// Make theme available for translation.
load_theme_textdomain( 'generatepress' );
// Add theme support for various features.
add_theme_support( 'automatic-feed-links' );
add_theme_support( 'post-thumbnails' );
add_theme_support( 'post-formats', array( 'aside', 'image', 'video', 'quote', 'link', 'status' ) );
add_theme_support( 'woocommerce' );
add_theme_support( 'title-tag' );
add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption', 'script', 'style' ) );
add_theme_support( 'customize-selective-refresh-widgets' );
add_theme_support( 'align-wide' );
add_theme_support( 'responsive-embeds' );
$color_palette = generate_get_editor_color_palette();
if ( ! empty( $color_palette ) ) {
add_theme_support( 'editor-color-palette', $color_palette );
}
add_theme_support(
'custom-logo',
array(
'height' => 70,
'width' => 350,
'flex-height' => true,
'flex-width' => true,
)
);
// Register primary menu.
register_nav_menus(
array(
'primary' => __( 'Primary Menu', 'generatepress' ),
)
);
/**
* Set the content width to something large
* We set a more accurate width in generate_smart_content_width()
*/
global $content_width;
if ( ! isset( $content_width ) ) {
$content_width = 1200; /* pixels */
}
// Add editor styles to the block editor.
add_theme_support( 'editor-styles' );
$editor_styles = apply_filters(
'generate_editor_styles',
array(
'assets/css/admin/block-editor.css',
)
);
add_editor_style( $editor_styles );
}
}
/**
* Get all necessary theme files
*/
$theme_dir = get_template_directory();
require $theme_dir . '/inc/theme-functions.php';
require $theme_dir . '/inc/defaults.php';
require $theme_dir . '/inc/class-css.php';
require $theme_dir . '/inc/css-output.php';
require $theme_dir . '/inc/general.php';
require $theme_dir . '/inc/customizer.php';
require $theme_dir . '/inc/markup.php';
require $theme_dir . '/inc/typography.php';
require $theme_dir . '/inc/plugin-compat.php';
require $theme_dir . '/inc/block-editor.php';
require $theme_dir . '/inc/class-typography.php';
require $theme_dir . '/inc/class-typography-migration.php';
require $theme_dir . '/inc/class-html-attributes.php';
require $theme_dir . '/inc/class-theme-update.php';
require $theme_dir . '/inc/class-rest.php';
require $theme_dir . '/inc/deprecated.php';
if ( is_admin() ) {
require $theme_dir . '/inc/meta-box.php';
require $theme_dir . '/inc/class-dashboard.php';
}
/**
* Load our theme structure
*/
require $theme_dir . '/inc/structure/archives.php';
require $theme_dir . '/inc/structure/comments.php';
require $theme_dir . '/inc/structure/featured-images.php';
require $theme_dir . '/inc/structure/footer.php';
require $theme_dir . '/inc/structure/header.php';
require $theme_dir . '/inc/structure/navigation.php';
require $theme_dir . '/inc/structure/post-meta.php';
require $theme_dir . '/inc/structure/sidebars.php';
require $theme_dir . '/inc/structure/search-modal.php';

View File

@ -0,0 +1,74 @@
<?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 generate_do_microdata( 'body' ); ?>>
<?php
/**
* wp_body_open hook.
*
* @since 2.3
*/
do_action( 'wp_body_open' ); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound -- core WP hook.
/**
* generate_before_header hook.
*
* @since 0.1
*
* @hooked generate_do_skip_to_content_link - 2
* @hooked generate_top_bar - 5
* @hooked generate_add_navigation_before_header - 5
*/
do_action( 'generate_before_header' );
/**
* generate_header hook.
*
* @since 1.3.42
*
* @hooked generate_construct_header - 10
*/
do_action( 'generate_header' );
/**
* generate_after_header hook.
*
* @since 0.1
*
* @hooked generate_featured_page_header - 10
*/
do_action( 'generate_after_header' );
?>
<div <?php generate_do_attr( 'page' ); ?>>
<?php
/**
* generate_inside_site_container hook.
*
* @since 2.4
*/
do_action( 'generate_inside_site_container' );
?>
<div <?php generate_do_attr( 'site-content' ); ?>>
<?php
/**
* generate_inside_container hook.
*
* @since 0.1
*/
do_action( 'generate_inside_container' );

View File

@ -0,0 +1,521 @@
<?php
/**
* Integrate GeneratePress with the WordPress block editor.
*
* @package GeneratePress
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
/**
* Check what sidebar layout we're using.
* We need this function as the post meta in generate_get_layout() only runs
* on is_singular()
*
* @since 2.2
*
* @param bool $meta Check for post meta.
* @return string The saved sidebar layout.
*/
function generate_get_block_editor_sidebar_layout( $meta = true ) {
$layout = generate_get_option( 'layout_setting' );
if ( function_exists( 'get_current_screen' ) ) {
$screen = get_current_screen();
if ( is_object( $screen ) && 'post' === $screen->post_type ) {
$layout = generate_get_option( 'single_layout_setting' );
}
}
// Add in our default filter in case people have adjusted it.
$layout = apply_filters( 'generate_sidebar_layout', $layout );
if ( $meta ) {
$layout_meta = get_post_meta( get_the_ID(), '_generate-sidebar-layout-meta', true );
if ( $layout_meta ) {
$layout = $layout_meta;
}
}
return apply_filters( 'generate_block_editor_sidebar_layout', $layout );
}
/**
* Check whether we're disabling the content title or not.
* We need this function as the post meta in generate_show_title() only runs
* on is_singular()
*
* @since 2.2
*/
function generate_get_block_editor_show_content_title() {
$title = generate_show_title();
$disable_title = get_post_meta( get_the_ID(), '_generate-disable-headline', true );
if ( $disable_title ) {
$title = false;
}
return apply_filters( 'generate_block_editor_show_content_title', $title );
}
/**
* Get the content width for this post.
*
* @since 2.2
*/
function generate_get_block_editor_content_width() {
$container_width = generate_get_option( 'container_width' );
$content_width = $container_width;
$right_sidebar_width = apply_filters( 'generate_right_sidebar_width', '25' );
$left_sidebar_width = apply_filters( 'generate_left_sidebar_width', '25' );
$layout = generate_get_block_editor_sidebar_layout();
if ( 'left-sidebar' === $layout ) {
$content_width = $container_width * ( ( 100 - $left_sidebar_width ) / 100 );
} elseif ( 'right-sidebar' === $layout ) {
$content_width = $container_width * ( ( 100 - $right_sidebar_width ) / 100 );
} elseif ( 'no-sidebar' === $layout ) {
$content_width = $container_width;
} else {
$content_width = $container_width * ( ( 100 - ( $left_sidebar_width + $right_sidebar_width ) ) / 100 );
}
return apply_filters( 'generate_block_editor_content_width', $content_width );
}
add_filter( 'block_editor_settings_all', 'generate_add_inline_block_editor_styles' );
/**
* Add dynamic inline styles to the block editor content.
*
* @param array $editor_settings The existing editor settings.
*/
function generate_add_inline_block_editor_styles( $editor_settings ) {
$show_editor_styles = apply_filters( 'generate_show_block_editor_styles', true );
if ( $show_editor_styles ) {
if ( generate_is_using_dynamic_typography() ) {
$google_fonts_uri = GeneratePress_Typography::get_google_fonts_uri();
if ( $google_fonts_uri ) {
// Need to use @import for now until this is ready: https://github.com/WordPress/gutenberg/pull/35950.
$google_fonts_import = sprintf(
'@import "%s";',
$google_fonts_uri
);
$editor_settings['styles'][] = array( 'css' => $google_fonts_import );
}
}
$editor_settings['styles'][] = array( 'css' => wp_strip_all_tags( generate_do_inline_block_editor_css() ) );
if ( generate_is_using_dynamic_typography() ) {
$editor_settings['styles'][] = array( 'css' => wp_strip_all_tags( GeneratePress_Typography::get_css( 'core' ) ) );
}
}
return $editor_settings;
}
add_action( 'enqueue_block_editor_assets', 'generate_enqueue_google_fonts' );
add_action( 'enqueue_block_editor_assets', 'generate_enqueue_backend_block_editor_assets' );
/**
* Add CSS to the admin side of the block editor.
*
* @since 2.2
*/
function generate_enqueue_backend_block_editor_assets() {
wp_enqueue_script(
'generate-block-editor',
trailingslashit( get_template_directory_uri() ) . 'assets/dist/block-editor.js',
array( 'wp-data', 'wp-dom-ready', 'wp-element', 'wp-plugins', 'wp-polyfill' ),
GENERATE_VERSION,
true
);
$color_settings = wp_parse_args(
get_option( 'generate_settings', array() ),
generate_get_color_defaults()
);
$spacing_settings = wp_parse_args(
get_option( 'generate_spacing_settings', array() ),
generate_spacing_get_defaults()
);
$text_color = generate_get_option( 'text_color' );
if ( $color_settings['content_text_color'] ) {
$text_color = $color_settings['content_text_color'];
}
$sidebar_layout = get_post_meta( get_the_ID(), '_generate_sidebar_layout', true );
$content_area_type = get_post_meta( get_the_ID(), '_generate-full-width-content', true );
wp_localize_script(
'generate-block-editor',
'generatepressBlockEditor',
array(
'sidebarLayout' => $sidebar_layout ? $sidebar_layout : generate_get_block_editor_sidebar_layout( false ),
'containerWidth' => generate_get_option( 'container_width' ),
'contentPaddingRight' => absint( $spacing_settings['content_right'] ) . 'px',
'contentPaddingLeft' => absint( $spacing_settings['content_left'] ) . 'px',
'rightSidebarWidth' => apply_filters( 'generate_right_sidebar_width', '25' ),
'leftSidebarWidth' => apply_filters( 'generate_left_sidebar_width', '25' ),
'text_color' => $text_color,
'show_editor_styles' => apply_filters( 'generate_show_block_editor_styles', true ),
'contentAreaType' => $content_area_type ? $content_area_type : apply_filters( 'generate_block_editor_content_area_type', '' ),
'customContentWidth' => apply_filters( 'generate_block_editor_container_width', '' ),
)
);
wp_register_style( 'generate-block-editor', false, array(), true, true );
wp_add_inline_style( 'generate-block-editor', generate_do_inline_block_editor_css( 'block-editor' ) );
wp_enqueue_style( 'generate-block-editor' );
}
/**
* Write our CSS for the block editor.
*
* @since 2.2
* @param string $for Define whether this CSS for the block content or the block editor.
*/
function generate_do_inline_block_editor_css( $for = 'block-content' ) {
$css = new GeneratePress_CSS();
$css->set_selector( ':root' );
$global_colors = generate_get_global_colors();
if ( ! empty( $global_colors ) ) {
foreach ( (array) $global_colors as $key => $data ) {
if ( ! empty( $data['slug'] ) && ! empty( $data['color'] ) ) {
$css->add_property( '--' . $data['slug'], $data['color'] );
}
}
foreach ( (array) $global_colors as $key => $data ) {
if ( ! empty( $data['slug'] ) && ! empty( $data['color'] ) ) {
$css->set_selector( '.has-' . $data['slug'] . '-color' );
$css->add_property( 'color', 'var(--' . $data['slug'] . ')' );
$css->set_selector( '.has-' . $data['slug'] . '-background-color' );
$css->add_property( 'background-color', 'var(--' . $data['slug'] . ')' );
}
}
}
// If this CSS is for the editor only (not the block content), we can return here.
if ( 'block-editor' === $for ) {
return $css->css_output();
}
$color_settings = wp_parse_args(
get_option( 'generate_settings', array() ),
generate_get_color_defaults()
);
$font_settings = wp_parse_args(
get_option( 'generate_settings', array() ),
generate_get_default_fonts()
);
$content_width = generate_get_block_editor_content_width();
$spacing_settings = wp_parse_args(
get_option( 'generate_spacing_settings', array() ),
generate_spacing_get_defaults()
);
$content_width_calc = sprintf(
'calc(%1$s - %2$s - %3$s)',
absint( $content_width ) . 'px',
absint( $spacing_settings['content_left'] ) . 'px',
absint( $spacing_settings['content_right'] ) . 'px'
);
$css->set_selector( 'body' );
$css->add_property(
'--content-width',
'true' === get_post_meta( get_the_ID(), '_generate-full-width-content', true )
? '100%'
: $content_width_calc
);
$css->set_selector( 'body .wp-block' );
$css->add_property( 'max-width', 'var(--content-width)' );
$css->set_selector( '.wp-block[data-align="full"]' );
$css->add_property( 'max-width', 'none' );
$css->set_selector( '.wp-block[data-align="wide"]' );
$css->add_property( 'max-width', absint( $content_width ), false, 'px' );
$underline_links = generate_get_option( 'underline_links' );
if ( 'never' !== $underline_links ) {
if ( 'always' === $underline_links ) {
$css->set_selector( '.wp-block a' );
$css->add_property( 'text-decoration', 'underline' );
}
if ( 'hover' === $underline_links ) {
$css->set_selector( '.wp-block a' );
$css->add_property( 'text-decoration', 'none' );
$css->set_selector( '.wp-block a:hover, .wp-block a:focus' );
$css->add_property( 'text-decoration', 'underline' );
}
if ( 'not-hover' === $underline_links ) {
$css->set_selector( '.wp-block a' );
$css->add_property( 'text-decoration', 'underline' );
$css->set_selector( '.wp-block a:hover, .wp-block a:focus' );
$css->add_property( 'text-decoration', 'none' );
}
$css->set_selector( 'a.button, .wp-block-button__link' );
$css->add_property( 'text-decoration', 'none' );
} else {
$css->set_selector( '.wp-block a' );
$css->add_property( 'text-decoration', 'none' );
}
if ( apply_filters( 'generate_do_group_inner_container_style', true ) ) {
$css->set_selector( '.wp-block-group__inner-container' );
$css->add_property( 'max-width', absint( $content_width ), false, 'px' );
$css->add_property( 'margin-left', 'auto' );
$css->add_property( 'margin-right', 'auto' );
$css->add_property( 'padding', generate_padding_css( $spacing_settings['content_top'], $spacing_settings['content_right'], $spacing_settings['content_bottom'], $spacing_settings['content_left'] ) );
}
$css->set_selector( 'a.button, a.button:visited, .wp-block-button__link:not(.has-background)' );
$css->add_property( 'color', $color_settings['form_button_text_color'] );
$css->add_property( 'background-color', $color_settings['form_button_background_color'] );
$css->add_property( 'padding', '10px 20px' );
$css->add_property( 'border', '0' );
$css->add_property( 'border-radius', '0' );
$css->set_selector( 'a.button:hover, a.button:active, a.button:focus, .wp-block-button__link:not(.has-background):active, .wp-block-button__link:not(.has-background):focus, .wp-block-button__link:not(.has-background):hover' );
$css->add_property( 'color', $color_settings['form_button_text_color_hover'] );
$css->add_property( 'background-color', $color_settings['form_button_background_color_hover'] );
if ( ! generate_is_using_dynamic_typography() ) {
$body_family = generate_get_font_family_css( 'font_body', 'generate_settings', generate_get_default_fonts() );
$h1_family = generate_get_font_family_css( 'font_heading_1', 'generate_settings', generate_get_default_fonts() );
$h2_family = generate_get_font_family_css( 'font_heading_2', 'generate_settings', generate_get_default_fonts() );
$h3_family = generate_get_font_family_css( 'font_heading_3', 'generate_settings', generate_get_default_fonts() );
$h4_family = generate_get_font_family_css( 'font_heading_4', 'generate_settings', generate_get_default_fonts() );
$h5_family = generate_get_font_family_css( 'font_heading_5', 'generate_settings', generate_get_default_fonts() );
$h6_family = generate_get_font_family_css( 'font_heading_6', 'generate_settings', generate_get_default_fonts() );
$buttons_family = generate_get_font_family_css( 'font_buttons', 'generate_settings', generate_get_default_fonts() );
}
$css->set_selector( 'body' );
if ( ! generate_is_using_dynamic_typography() ) {
$css->add_property( 'font-family', $body_family );
$css->add_property( 'font-size', absint( $font_settings['body_font_size'] ), false, 'px' );
}
if ( $color_settings['content_text_color'] ) {
$css->add_property( 'color', $color_settings['content_text_color'] );
} else {
$css->add_property( 'color', generate_get_option( 'text_color' ) );
}
$css->set_selector( '.content-title-visibility' );
if ( $color_settings['content_text_color'] ) {
$css->add_property( 'color', $color_settings['content_text_color'] );
} else {
$css->add_property( 'color', generate_get_option( 'text_color' ) );
}
if ( ! generate_is_using_dynamic_typography() ) {
$css->set_selector( 'body, p' );
$css->add_property( 'line-height', floatval( $font_settings['body_line_height'] ) );
$css->set_selector( 'p' );
$css->add_property( 'margin-top', '0px' );
$css->add_property( 'margin-bottom', $font_settings['paragraph_margin'], false, 'em' );
}
$css->set_selector( 'h1' );
if ( ! generate_is_using_dynamic_typography() ) {
$css->add_property( 'font-family', 'inherit' === $h1_family || '' === $h1_family ? $body_family : $h1_family );
$css->add_property( 'font-weight', $font_settings['heading_1_weight'] );
$css->add_property( 'text-transform', $font_settings['heading_1_transform'] );
$css->add_property( 'font-size', absint( $font_settings['heading_1_font_size'] ), false, 'px' );
$css->add_property( 'line-height', floatval( $font_settings['heading_1_line_height'] ), false, 'em' );
$css->add_property( 'margin-bottom', floatval( $font_settings['heading_1_margin_bottom'] ), false, 'px' );
$css->add_property( 'margin-top', '0' );
}
$css->add_property( 'color', $color_settings['h1_color'] );
if ( $color_settings['content_title_color'] ) {
$css->set_selector( '.edit-post-visual-editor__post-title-wrapper h1' );
$css->add_property( 'color', $color_settings['content_title_color'] );
}
$css->set_selector( 'h2' );
if ( ! generate_is_using_dynamic_typography() ) {
$css->add_property( 'font-family', $h2_family );
$css->add_property( 'font-weight', $font_settings['heading_2_weight'] );
$css->add_property( 'text-transform', $font_settings['heading_2_transform'] );
$css->add_property( 'font-size', absint( $font_settings['heading_2_font_size'] ), false, 'px' );
$css->add_property( 'line-height', floatval( $font_settings['heading_2_line_height'] ), false, 'em' );
$css->add_property( 'margin-bottom', floatval( $font_settings['heading_2_margin_bottom'] ), false, 'px' );
$css->add_property( 'margin-top', '0' );
}
$css->add_property( 'color', $color_settings['h2_color'] );
$css->set_selector( 'h3' );
if ( ! generate_is_using_dynamic_typography() ) {
$css->add_property( 'font-family', $h3_family );
$css->add_property( 'font-weight', $font_settings['heading_3_weight'] );
$css->add_property( 'text-transform', $font_settings['heading_3_transform'] );
$css->add_property( 'font-size', absint( $font_settings['heading_3_font_size'] ), false, 'px' );
$css->add_property( 'line-height', floatval( $font_settings['heading_3_line_height'] ), false, 'em' );
$css->add_property( 'margin-bottom', floatval( $font_settings['heading_3_margin_bottom'] ), false, 'px' );
$css->add_property( 'margin-top', '0' );
}
$css->add_property( 'color', $color_settings['h3_color'] );
$css->set_selector( 'h4' );
if ( ! generate_is_using_dynamic_typography() ) {
$css->add_property( 'font-family', $h4_family );
$css->add_property( 'font-weight', $font_settings['heading_4_weight'] );
$css->add_property( 'text-transform', $font_settings['heading_4_transform'] );
$css->add_property( 'margin-bottom', '20px' );
$css->add_property( 'margin-top', '0' );
if ( '' !== $font_settings['heading_4_font_size'] ) {
$css->add_property( 'font-size', absint( $font_settings['heading_4_font_size'] ), false, 'px' );
} else {
$css->add_property( 'font-size', 'inherit' );
}
if ( '' !== $font_settings['heading_4_line_height'] ) {
$css->add_property( 'line-height', floatval( $font_settings['heading_4_line_height'] ), false, 'em' );
}
}
$css->add_property( 'color', $color_settings['h4_color'] );
$css->set_selector( 'h5' );
if ( ! generate_is_using_dynamic_typography() ) {
$css->add_property( 'font-family', $h5_family );
$css->add_property( 'font-weight', $font_settings['heading_5_weight'] );
$css->add_property( 'text-transform', $font_settings['heading_5_transform'] );
$css->add_property( 'margin-bottom', '20px' );
$css->add_property( 'margin-top', '0' );
if ( '' !== $font_settings['heading_5_font_size'] ) {
$css->add_property( 'font-size', absint( $font_settings['heading_5_font_size'] ), false, 'px' );
} else {
$css->add_property( 'font-size', 'inherit' );
}
if ( '' !== $font_settings['heading_5_line_height'] ) {
$css->add_property( 'line-height', floatval( $font_settings['heading_5_line_height'] ), false, 'em' );
}
}
$css->add_property( 'color', $color_settings['h5_color'] );
$css->set_selector( 'h6' );
if ( ! generate_is_using_dynamic_typography() ) {
$css->add_property( 'font-family', $h6_family );
$css->add_property( 'font-weight', $font_settings['heading_6_weight'] );
$css->add_property( 'text-transform', $font_settings['heading_6_transform'] );
$css->add_property( 'margin-bottom', '20px' );
$css->add_property( 'margin-top', '0' );
if ( '' !== $font_settings['heading_6_font_size'] ) {
$css->add_property( 'font-size', absint( $font_settings['heading_6_font_size'] ), false, 'px' );
} else {
$css->add_property( 'font-size', 'inherit' );
}
if ( '' !== $font_settings['heading_6_line_height'] ) {
$css->add_property( 'line-height', floatval( $font_settings['heading_6_line_height'] ), false, 'em' );
}
}
$css->add_property( 'color', $color_settings['h6_color'] );
$css->set_selector( 'a.button, .block-editor-block-list__layout .wp-block-button .wp-block-button__link' );
if ( ! generate_is_using_dynamic_typography() ) {
$css->add_property( 'font-family', $buttons_family );
$css->add_property( 'font-weight', $font_settings['buttons_font_weight'] );
$css->add_property( 'text-transform', $font_settings['buttons_font_transform'] );
if ( '' !== $font_settings['buttons_font_size'] ) {
$css->add_property( 'font-size', absint( $font_settings['buttons_font_size'] ), false, 'px' );
} else {
$css->add_property( 'font-size', 'inherit' );
}
}
if ( version_compare( $GLOBALS['wp_version'], '5.7-alpha.1', '>' ) ) {
$css->set_selector( '.block-editor__container .edit-post-visual-editor' );
$css->add_property( 'background-color', generate_get_option( 'background_color' ) );
$css->set_selector( 'body' );
if ( $color_settings['content_background_color'] ) {
$css->add_property( 'background-color', $color_settings['content_background_color'] );
} else {
$css->add_property( 'background-color', generate_get_option( 'background_color' ) );
}
} else {
$css->set_selector( 'body' );
$css->add_property( 'background-color', generate_get_option( 'background_color' ) );
if ( $color_settings['content_background_color'] ) {
$body_background = generate_get_option( 'background_color' );
$content_background = $color_settings['content_background_color'];
$css->add_property( 'background', 'linear-gradient(' . $content_background . ',' . $content_background . '), linear-gradient(' . $body_background . ',' . $body_background . ')' );
}
}
$css->set_selector( 'a, a:visited' );
if ( $color_settings['content_link_color'] ) {
$css->add_property( 'color', $color_settings['content_link_color'] );
} else {
$css->add_property( 'color', generate_get_option( 'link_color' ) );
}
$css->set_selector( 'a:hover, a:focus, a:active' );
if ( $color_settings['content_link_hover_color'] ) {
$css->add_property( 'color', $color_settings['content_link_hover_color'] );
} else {
$css->add_property( 'color', generate_get_option( 'link_color_hover' ) );
}
return $css->css_output();
}

View File

@ -0,0 +1,217 @@
<?php
/**
* Builds our dynamic CSS.
*
* @package GeneratePress
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
if ( ! class_exists( 'GeneratePress_CSS' ) ) {
/**
* Creates minified css via PHP.
*
* @author Carlos Rios
* Modified by Tom Usborne for GeneratePress
*/
class GeneratePress_CSS {
/**
* The css selector that you're currently adding rules to
*
* @access protected
* @var string
*/
protected $_selector = ''; // phpcs:ignore PSR2.Classes.PropertyDeclaration.Underscore
/**
* Stores the final css output with all of its rules for the current selector.
*
* @access protected
* @var string
*/
protected $_selector_output = ''; // phpcs:ignore PSR2.Classes.PropertyDeclaration.Underscore
/**
* Stores all of the rules that will be added to the selector
*
* @access protected
* @var string
*/
protected $_css = ''; // phpcs:ignore PSR2.Classes.PropertyDeclaration.Underscore
/**
* The string that holds all of the css to output
*
* @access protected
* @var string
*/
protected $_output = ''; // phpcs:ignore PSR2.Classes.PropertyDeclaration.Underscore
/**
* Stores media queries
*
* @var null
*/
protected $_media_query = null; // phpcs:ignore PSR2.Classes.PropertyDeclaration.Underscore
/**
* The string that holds all of the css to output inside of the media query
*
* @access protected
* @var string
*/
protected $_media_query_output = ''; // phpcs:ignore PSR2.Classes.PropertyDeclaration.Underscore
/**
* Sets a selector to the object and changes the current selector to a new one
*
* @access public
* @since 1.0
*
* @param string $selector - the css identifier of the html that you wish to target.
* @return $this
*/
public function set_selector( $selector = '' ) {
// Render the css in the output string everytime the selector changes.
if ( '' !== $this->_selector ) {
$this->add_selector_rules_to_output();
}
$this->_selector = $selector;
return $this;
}
/**
* Adds a css property with value to the css output
*
* @access public
* @since 1.0
*
* @param string $property The css property.
* @param string $value The value to be placed with the property.
* @param string $og_default Check to see if the value matches the default.
* @param string $unit The unit for the value (px).
* @return $this
*/
public function add_property( $property, $value, $og_default = false, $unit = false ) {
// Setting font-size to 0 is rarely ever a good thing.
if ( 'font-size' === $property && 0 === $value ) {
return false;
}
// Add our unit to our value if it exists.
if ( $unit && '' !== $unit && is_numeric( $value ) ) {
$value = $value . $unit;
if ( '' !== $og_default ) {
$og_default = $og_default . $unit;
}
}
// If we don't have a value or our value is the same as our og default, bail.
if ( ( empty( $value ) && ! is_numeric( $value ) ) || $og_default === $value ) {
return false;
}
$this->_css .= $property . ':' . $value . ';';
return $this;
}
/**
* Sets a media query in the class
*
* @since 1.1
* @param string $value The media query.
* @return $this
*/
public function start_media_query( $value ) {
// Add the current rules to the output.
$this->add_selector_rules_to_output();
// Add any previous media queries to the output.
if ( ! empty( $this->_media_query ) ) {
$this->add_media_query_rules_to_output();
}
// Set the new media query.
$this->_media_query = $value;
return $this;
}
/**
* Stops using a media query.
*
* @see start_media_query()
*
* @since 1.1
* @return $this
*/
public function stop_media_query() {
return $this->start_media_query( null );
}
/**
* Adds the current media query's rules to the class' output variable
*
* @since 1.1
* @return $this
*/
private function add_media_query_rules_to_output() {
if ( ! empty( $this->_media_query_output ) ) {
$this->_output .= sprintf( '@media %1$s{%2$s}', $this->_media_query, $this->_media_query_output );
// Reset the media query output string.
$this->_media_query_output = '';
}
return $this;
}
/**
* Adds the current selector rules to the output variable
*
* @access private
* @since 1.0
*
* @return $this
*/
private function add_selector_rules_to_output() {
if ( ! empty( $this->_css ) ) {
$this->_selector_output = $this->_selector;
$selector_output = sprintf( '%1$s{%2$s}', $this->_selector_output, $this->_css );
// Add our CSS to the output.
if ( ! empty( $this->_media_query ) ) {
$this->_media_query_output .= $selector_output;
$this->_css = '';
} else {
$this->_output .= $selector_output;
}
// Reset the css.
$this->_css = '';
}
return $this;
}
/**
* Returns the minified css in the $_output variable
*
* @access public
* @since 1.0
*
* @return string
*/
public function css_output() {
// Add current selector's rules to output.
$this->add_selector_rules_to_output();
// Output minified css.
return $this->_output;
}
}
}

View File

@ -0,0 +1,266 @@
<?php
/**
* Build our admin dashboard.
*
* @package GeneratePress
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
/**
* This class adds HTML attributes to various theme elements.
*/
class GeneratePress_Dashboard {
/**
* Class instance.
*
* @access private
* @var $instance Class instance.
*/
private static $instance;
/**
* Initiator
*/
public static function get_instance() {
if ( ! isset( self::$instance ) ) {
self::$instance = new self();
}
return self::$instance;
}
/**
* Get started.
*/
public function __construct() {
// Load our old dashboard if we're using an old version of GP Premium.
if ( defined( 'GP_PREMIUM_VERSION' ) && version_compare( GP_PREMIUM_VERSION, '2.1.0-alpha.1', '<' ) ) {
require_once get_template_directory() . '/inc/dashboard.php';
return;
}
add_action( 'admin_menu', array( $this, 'add_menu_item' ) );
add_filter( 'admin_body_class', array( $this, 'set_admin_body_class' ) );
add_action( 'in_admin_header', array( $this, 'add_header' ) );
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
add_action( 'generate_admin_dashboard', array( $this, 'start_customizing' ) );
add_action( 'generate_admin_dashboard', array( $this, 'go_pro' ), 15 );
add_action( 'generate_admin_dashboard', array( $this, 'reset' ), 100 );
}
/**
* Add our dashboard menu item.
*/
public function add_menu_item() {
add_theme_page(
esc_html__( 'GeneratePress', 'generatepress' ),
esc_html__( 'GeneratePress', 'generatepress' ),
apply_filters( 'generate_dashboard_page_capability', 'edit_theme_options' ),
'generate-options',
array( $this, 'page' )
);
}
/**
* Get our dashboard pages so we can style them.
*/
public static function get_pages() {
return apply_filters(
'generate_dashboard_screens',
array(
'appearance_page_generate-options',
)
);
}
/**
* Add a body class on GP dashboard pages.
*
* @param string $classes The existing classes.
*/
public function set_admin_body_class( $classes ) {
$dashboard_pages = self::get_pages();
$current_screen = get_current_screen();
if ( in_array( $current_screen->id, $dashboard_pages ) ) {
$classes .= ' generate-dashboard-page';
}
return $classes;
}
/**
* Build our Dashboard header.
*/
public static function header() {
?>
<div class="generatepress-dashboard-header">
<div class="generatepress-dashboard-header__title">
<h1>
<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 600 600"><path d="M485.2 427.8l-99.1-46.2 15.8-34c5.6-11.9 8.8-24.3 10-36.7 3.3-33.7-9-67.3-33.2-91.1-8.9-8.7-19.3-16.1-31.3-21.7-11.9-5.6-24.3-8.8-36.7-10-33.7-3.3-67.4 9-91.1 33.2-8.7 8.9-16.1 19.3-21.7 31.3l-15.8 34-30.4 65.2c-.7 1.5-.1 3.3 1.5 4l65.2 30.4 34 15.8 34 15.8 68 31.7 74.7 34.8c-65 45.4-152.1 55.2-228.7 17.4C90.2 447.4 44.1 313.3 97.3 202.6c53.3-110.8 186-158.5 297.8-106.3 88.1 41.1 137.1 131.9 129.1 223.4-.1 1.3.6 2.4 1.7 3l65.6 30.6c1.8.8 3.9-.3 4.2-2.2 22.6-130.7-44-265.4-170.5-323.5-150.3-69-327-4.1-396.9 145.8-70 150.1-5.1 328.5 145.1 398.5 114.1 53.2 244.5 28.4 331.3-52.3 17.9-16.6 33.9-35.6 47.5-56.8 1-1.5.4-3.6-1.3-4.3l-65.7-30.7zm-235-109.6l15.8-34c8.8-18.8 31.1-26.9 49.8-18.1s26.9 31 18.1 49.8l-15.8 34-34-15.8-33.9-15.9z" fill="currentColor" /></svg>
<?php echo esc_html( get_admin_page_title() ); ?>
</h1>
</div>
<?php self::navigation(); ?>
</div>
<?php
}
/**
* Build our Dashboard menu.
*/
public static function navigation() {
$screen = get_current_screen();
$tabs = apply_filters(
'generate_dashboard_tabs',
array(
'dashboard' => array(
'name' => __( 'Dashboard', 'generatepress' ),
'url' => admin_url( 'themes.php?page=generate-options' ),
'class' => 'appearance_page_generate-options' === $screen->id ? 'active' : '',
),
)
);
if ( ! defined( 'GP_PREMIUM_VERSION' ) ) {
$tabs['premium'] = array(
'name' => __( 'Premium', 'generatepress' ),
'url' => 'https://generatepress.com/premium',
'class' => '',
'external' => true,
);
}
$tabs['support'] = array(
'name' => __( 'Support', 'generatepress' ),
'url' => 'https://generatepress.com/support',
'class' => '',
'external' => true,
);
$tabs['documentation'] = array(
'name' => __( 'Documentation', 'generatepress' ),
'url' => 'https://docs.generatepress.com',
'class' => '',
'external' => true,
);
?>
<div class="generatepress-dashboard-header__navigation">
<?php
foreach ( $tabs as $tab ) {
printf(
'<a href="%1$s" class="%2$s"%4$s>%3$s</a>',
esc_url( $tab['url'] ),
esc_attr( $tab['class'] ),
esc_html( $tab['name'] ),
! empty( $tab['external'] ) ? 'target="_blank" rel="noreferrer noopener"' : ''
);
}
?>
</div>
<?php
}
/**
* Add our Dashboard headers.
*/
public function add_header() {
$dashboard_pages = self::get_pages();
$current_screen = get_current_screen();
if ( in_array( $current_screen->id, $dashboard_pages ) ) {
self::header();
/**
* generate_dashboard_after_header hook.
*
* @since 2.0
*/
do_action( 'generate_dashboard_after_header' );
}
}
/**
* Add our scripts to the page.
*/
public function enqueue_scripts() {
$dashboard_pages = self::get_pages();
$current_screen = get_current_screen();
if ( in_array( $current_screen->id, $dashboard_pages ) ) {
wp_enqueue_style(
'generate-dashboard',
get_template_directory_uri() . '/assets/dist/style-dashboard.css',
array( 'wp-components' ),
GENERATE_VERSION
);
if ( 'appearance_page_generate-options' === $current_screen->id ) {
wp_enqueue_script(
'generate-dashboard',
get_template_directory_uri() . '/assets/dist/dashboard.js',
array( 'wp-api', 'wp-i18n', 'wp-components', 'wp-element', 'wp-api-fetch', 'wp-hooks', 'wp-polyfill' ),
GENERATE_VERSION,
true
);
wp_set_script_translations( 'generate-dashboard', 'generatepress' );
wp_localize_script(
'generate-dashboard',
'generateDashboard',
array(
'hasPremium' => defined( 'GP_PREMIUM_VERSION' ),
'customizeSectionUrls' => array(
'siteIdentitySection' => add_query_arg( rawurlencode( 'autofocus[section]' ), 'title_tagline', wp_customize_url() ),
'colorsSection' => add_query_arg( rawurlencode( 'autofocus[section]' ), 'generate_colors_section', wp_customize_url() ),
'typographySection' => add_query_arg( rawurlencode( 'autofocus[section]' ), 'generate_typography_section', wp_customize_url() ),
'layoutSection' => add_query_arg( rawurlencode( 'autofocus[panel]' ), 'generate_layout_panel', wp_customize_url() ),
),
)
);
}
}
}
/**
* Add the HTML for our page.
*/
public function page() {
?>
<div class="wrap">
<div class="generatepress-dashboard">
<?php do_action( 'generate_admin_dashboard' ); ?>
</div>
</div>
<?php
}
/**
* Add the container for our start customizing app.
*/
public function start_customizing() {
echo '<div id="generatepress-dashboard-app"></div>';
}
/**
* Add the container for our start customizing app.
*/
public function go_pro() {
echo '<div id="generatepress-dashboard-go-pro"></div>';
}
/**
* Add the container for our reset app.
*/
public function reset() {
echo '<div id="generatepress-reset"></div>';
}
}
GeneratePress_Dashboard::get_instance();

View File

@ -0,0 +1,495 @@
<?php
/**
* Add HTML attributes to our theme elements.
*
* @package GeneratePress
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
/**
* This class adds HTML attributes to various theme elements.
*/
class GeneratePress_HTML_Attributes {
/**
* Class instance.
*
* @access private
* @var $instance Class instance.
*/
private static $instance;
/**
* Initiator
*/
public static function get_instance() {
if ( ! isset( self::$instance ) ) {
self::$instance = new self();
}
return self::$instance;
}
/**
* Constructor
*/
public function __construct() {
add_filter( 'generate_parse_attr', array( $this, 'parse_attributes' ), 10, 3 );
}
/**
* Parse the attributes.
*
* @since 3.1.0
* @param array $attributes The current attributes.
* @param string $context The context in which attributes are applied.
* @param array $settings Custom settings passed to the filter.
*/
public function parse_attributes( $attributes, $context, $settings ) {
switch ( $context ) {
case 'top-bar':
return $this->top_bar( $attributes );
case 'inside-top-bar':
return $this->inside_top_bar( $attributes );
case 'header':
return $this->site_header( $attributes );
case 'inside-header':
return $this->inside_site_header( $attributes );
case 'menu-toggle':
return $this->menu_toggle( $attributes );
case 'navigation':
return $this->primary_navigation( $attributes );
case 'inside-navigation':
return $this->primary_inner_navigation( $attributes );
case 'mobile-menu-control-wrapper':
return $this->mobile_menu_control_wrapper( $attributes );
case 'site-info':
return $this->site_info( $attributes );
case 'inside-site-info':
return $this->inside_site_info( $attributes );
case 'entry-header':
return $this->entry_header( $attributes );
case 'page-header':
return $this->page_header( $attributes );
case 'site-content':
return $this->site_content( $attributes );
case 'page':
return $this->page( $attributes );
case 'content':
return $this->content( $attributes );
case 'main':
return $this->main( $attributes );
case 'post-navigation':
return $this->post_navigation( $attributes );
case 'left-sidebar':
return $this->left_sidebar( $attributes );
case 'right-sidebar':
return $this->right_sidebar( $attributes );
case 'footer-widgets-container':
return $this->footer_widgets_container( $attributes );
case 'comment-body':
return $this->comment_body( $attributes, $settings );
case 'comment-meta':
return $this->comment_meta( $attributes );
case 'footer-entry-meta':
return $this->footer_entry_meta( $attributes );
case 'woocommerce-content':
return $this->woocommerce_content( $attributes );
}
return $attributes;
}
/**
* Add attributes to our top bar.
*
* @since 3.1.0
* @param array $attributes The existing attributes.
*/
public function top_bar( $attributes ) {
$classes = generate_get_element_classes( 'top_bar' );
if ( $classes ) {
$attributes['class'] .= ' ' . join( ' ', $classes );
}
return $attributes;
}
/**
* Add attributes to our inside top bar container.
*
* @since 3.1.0
* @param array $attributes The existing attributes.
*/
public function inside_top_bar( $attributes ) {
$attributes['class'] .= ' inside-top-bar';
if ( 'contained' === generate_get_option( 'top_bar_inner_width' ) ) {
$attributes['class'] .= ' grid-container';
if ( ! generate_is_using_flexbox() ) {
$attributes['class'] .= ' grid-parent';
}
}
return $attributes;
}
/**
* Add attributes to our site header.
*
* @since 3.1.0
* @param array $attributes The existing attributes.
*/
public function site_header( $attributes ) {
$attributes['id'] = 'masthead';
$attributes['aria-label'] = esc_attr__( 'Site', 'generatepress' );
return $attributes;
}
/**
* Add attributes to our inside site header container.
*
* @since 3.1.0
* @param array $attributes The existing attributes.
*/
public function inside_site_header( $attributes ) {
$classes = generate_get_element_classes( 'inside_header' );
if ( $classes ) {
$attributes['class'] .= ' ' . join( ' ', $classes );
}
return $attributes;
}
/**
* Add attributes to our menu toggle.
*
* @since 3.1.0
* @param array $attributes The existing attributes.
*/
public function menu_toggle( $attributes ) {
$attributes['class'] .= ' menu-toggle';
$attributes['aria-controls'] = 'primary-menu';
$attributes['aria-expanded'] = 'false';
return $attributes;
}
/**
* Add attributes to our main navigation.
*
* @since 3.1.0
* @param array $attributes The existing attributes.
*/
public function primary_navigation( $attributes ) {
$attributes['id'] = 'site-navigation';
$attributes['aria-label'] = esc_attr__( 'Primary', 'generatepress' );
return $attributes;
}
/**
* Add attributes to our main navigation.
*
* @since 3.1.0
* @param array $attributes The existing attributes.
*/
public function primary_inner_navigation( $attributes ) {
$classes = generate_get_element_classes( 'inside_navigation' );
if ( $classes ) {
$attributes['class'] .= ' ' . join( ' ', $classes );
}
return $attributes;
}
/**
* Add attributes to our main navigation.
*
* @since 3.1.0
* @param array $attributes The existing attributes.
*/
public function mobile_menu_control_wrapper( $attributes ) {
$attributes['id'] = 'mobile-menu-control-wrapper';
$attributes['class'] .= ' main-navigation mobile-menu-control-wrapper';
$attributes['aria-label'] = esc_attr__( 'Mobile Toggle', 'generatepress' );
return $attributes;
}
/**
* Add attributes to our footer element.
*
* @since 3.1.0
* @param array $attributes The existing attributes.
*/
public function site_info( $attributes ) {
$attributes['class'] .= ' site-info';
$attributes['aria-label'] = esc_attr__( 'Site', 'generatepress' );
return $attributes;
}
/**
* Add attributes to our inside site info container.
*
* @since 3.1.0
* @param array $attributes The existing attributes.
*/
public function inside_site_info( $attributes ) {
$attributes['class'] .= ' inside-site-info';
if ( 'full-width' !== generate_get_option( 'footer_inner_width' ) ) {
$attributes['class'] .= ' grid-container';
if ( ! generate_is_using_flexbox() ) {
$attributes['class'] .= ' grid-parent';
}
}
return $attributes;
}
/**
* Add attributes to our entry headers.
*
* @since 3.1.0
* @param array $attributes The existing attributes.
*/
public function entry_header( $attributes ) {
$attributes['class'] .= ' entry-header';
return $attributes;
}
/**
* Add attributes to our page headers.
*
* @since 3.1.0
* @param array $attributes The existing attributes.
*/
public function page_header( $attributes ) {
$attributes['class'] .= ' page-header';
$attributes['aria-label'] = esc_attr__( 'Page', 'generatepress' );
return $attributes;
}
/**
* Add attributes to our entry headers.
*
* @since 3.1.0
* @param array $attributes The existing attributes.
*/
public function post_navigation( $attributes ) {
if ( is_single() ) {
$attributes['class'] .= ' post-navigation';
$attributes['aria-label'] = esc_attr__( 'Posts', 'generatepress' );
} else {
$attributes['class'] .= ' paging-navigation';
$attributes['aria-label'] = esc_attr__( 'Archive Page', 'generatepress' );
}
return $attributes;
}
/**
* Add attributes to our page container.
*
* @since 3.1.0
* @param array $attributes The existing attributes.
*/
public function page( $attributes ) {
$attributes['id'] = 'page';
return $attributes;
}
/**
* Add attributes to our site content container.
*
* @since 3.1.0
* @param array $attributes The existing attributes.
*/
public function site_content( $attributes ) {
$attributes['id'] = 'content';
$attributes['class'] .= ' site-content';
return $attributes;
}
/**
* Add attributes to our primary content container.
*
* @since 3.1.0
* @param array $attributes The existing attributes.
*/
public function content( $attributes ) {
$attributes['id'] = 'primary';
return $attributes;
}
/**
* Add attributes to our primary content container.
*
* @since 3.1.0
* @param array $attributes The existing attributes.
*/
public function main( $attributes ) {
$attributes['id'] = 'main';
return $attributes;
}
/**
* Add attributes to our left sidebar.
*
* @since 3.1.0
* @param array $attributes The existing attributes.
*/
public function left_sidebar( $attributes ) {
$classes = generate_get_element_classes( 'left_sidebar' );
if ( $classes ) {
$attributes['class'] .= ' ' . join( ' ', $classes );
}
$attributes['id'] = 'left-sidebar';
return $attributes;
}
/**
* Add attributes to our right sidebar.
*
* @since 3.1.0
* @param array $attributes The existing attributes.
*/
public function right_sidebar( $attributes ) {
$classes = generate_get_element_classes( 'right_sidebar' );
if ( $classes ) {
$attributes['class'] .= ' ' . join( ' ', $classes );
}
$attributes['id'] = 'right-sidebar';
return $attributes;
}
/**
* Add attributes to our footer widget inner container.
*
* @since 3.1.0
* @param array $attributes The existing attributes.
*/
public function footer_widgets_container( $attributes ) {
$classes = generate_get_element_classes( 'inside_footer' );
if ( $classes ) {
$attributes['class'] .= ' ' . join( ' ', $classes );
}
return $attributes;
}
/**
* Add attributes to our footer widget inner container.
*
* @since 3.1.0
* @param array $attributes The existing attributes.
* @param array $settings Settings passed through the function.
*/
public function comment_body( $attributes, $settings ) {
$attributes['class'] .= ' comment-body';
$attributes['id'] = 'div-comment-' . $settings['comment-id'];
return $attributes;
}
/**
* Add attributes to our comment meta.
*
* @since 3.1.0
* @param array $attributes The existing attributes.
*/
public function comment_meta( $attributes ) {
$attributes['class'] .= ' comment-meta';
$attributes['aria-label'] = esc_attr__( 'Comment meta', 'generatepress' );
return $attributes;
}
/**
* Add attributes to our footer entry meta.
*
* @since 3.1.0
* @param array $attributes The existing attributes.
*/
public function footer_entry_meta( $attributes ) {
$attributes['class'] .= ' entry-meta';
$attributes['aria-label'] = esc_attr__( 'Entry meta', 'generatepress' );
return $attributes;
}
/**
* Add attributes to our WooCommerce content container.
*
* @since 3.2.0
* @param array $attributes The existing attributes.
*/
public function woocommerce_content( $attributes ) {
if ( is_singular() ) {
$attributes['id'] = 'post-' . get_the_ID();
$attributes['class'] = esc_attr( implode( ' ', get_post_class( '', get_the_ID() ) ) );
if ( 'microdata' === generate_get_schema_type() ) {
$type = apply_filters( 'generate_article_itemtype', 'CreativeWork' );
$attributes['itemtype'] = sprintf(
'https://schema.org/%s',
$type
);
$attributes['itemscope'] = true;
}
} else {
$attributes['class'] = 'woocommerce-archive-wrapper';
}
return $attributes;
}
}
GeneratePress_HTML_Attributes::get_instance();

View File

@ -0,0 +1,151 @@
<?php
/**
* Rest API functions
*
* @package GenerateBlocks
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Class GenerateBlocks_Rest
*/
class GeneratePress_Rest extends WP_REST_Controller {
/**
* Instance.
*
* @access private
* @var object Instance
*/
private static $instance;
/**
* Namespace.
*
* @var string
*/
protected $namespace = 'generatepress/v';
/**
* Version.
*
* @var string
*/
protected $version = '1';
/**
* Initiator.
*
* @return object initialized object of class.
*/
public static function get_instance() {
if ( ! isset( self::$instance ) ) {
self::$instance = new self();
}
return self::$instance;
}
/**
* GeneratePress_Rest constructor.
*/
public function __construct() {
add_action( 'rest_api_init', array( $this, 'register_routes' ) );
}
/**
* Register rest routes.
*/
public function register_routes() {
$namespace = $this->namespace . $this->version;
register_rest_route(
$namespace,
'/reset/',
array(
'methods' => WP_REST_Server::EDITABLE,
'callback' => array( $this, 'reset' ),
'permission_callback' => array( $this, 'update_settings_permission' ),
)
);
}
/**
* Get edit options permissions.
*
* @return bool
*/
public function update_settings_permission() {
return current_user_can( 'manage_options' );
}
/**
* Reset settings.
*
* @param WP_REST_Request $request request object.
*
* @return mixed
*/
public function reset( WP_REST_Request $request ) {
delete_option( 'generate_settings' );
delete_option( 'generate_dynamic_css_output' );
delete_option( 'generate_dynamic_css_cached_version' );
return $this->success( __( 'Settings reset.', 'generatepress' ) );
}
/**
* Success rest.
*
* @param mixed $response response data.
* @return mixed
*/
public function success( $response ) {
return new WP_REST_Response(
array(
'success' => true,
'response' => $response,
),
200
);
}
/**
* Failed rest.
*
* @param mixed $response response data.
* @return mixed
*/
public function failed( $response ) {
return new WP_REST_Response(
array(
'success' => false,
'response' => $response,
),
200
);
}
/**
* Error rest.
*
* @param mixed $code error code.
* @param mixed $response response data.
* @return mixed
*/
public function error( $code, $response ) {
return new WP_REST_Response(
array(
'error' => true,
'success' => false,
'error_code' => $code,
'response' => $response,
),
401
);
}
}
GeneratePress_Rest::get_instance();

View File

@ -0,0 +1,408 @@
<?php
/**
* Migrates old options on update.
*
* @package GeneratePress
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
/**
* Process option updates if necessary.
*/
class GeneratePress_Theme_Update {
/**
* Class instance.
*
* @access private
* @var $instance Class instance.
*/
private static $instance;
/**
* Initiator
*/
public static function get_instance() {
if ( ! isset( self::$instance ) ) {
self::$instance = new self();
}
return self::$instance;
}
/**
* Constructor
*/
public function __construct() {
if ( is_admin() ) {
add_action( 'admin_init', __CLASS__ . '::init', 5 );
} else {
add_action( 'wp', __CLASS__ . '::init', 5 );
}
add_action( 'admin_init', __CLASS__ . '::admin_updates', 1 );
}
/**
* Implement theme update logic. Only run updates on existing sites.
*
* @since 3.0.0
*/
public static function init() {
if ( is_customize_preview() ) {
return;
}
$saved_version = get_option( 'generate_db_version', false );
if ( false === $saved_version ) {
// Typically this would mean this is a new install, but we haven't always had the version saved, so we need to check for existing settings.
$existing_settings = get_option( 'generate_settings', array() );
// Can't count this as a user-set option since a previous migration script set it.
if ( isset( $existing_settings['combine_css'] ) ) {
unset( $existing_settings['combine_css'] );
}
if ( ! empty( $existing_settings ) ) {
// We have settings, which means this is an old install with no version number.
$saved_version = '2.0';
} else {
// No settings and no saved version, must be a new install.
if ( 'admin_init' === current_action() ) {
// If we're in the admin, add our version to the database.
update_option( 'generate_db_version', GENERATE_VERSION );
}
return;
}
}
if ( version_compare( $saved_version, GENERATE_VERSION, '=' ) ) {
return;
}
if ( version_compare( $saved_version, '2.3.0', '<' ) ) {
self::v_2_3_0();
}
if ( version_compare( $saved_version, '3.0.0-alpha.1', '<' ) ) {
self::v_3_0_0();
}
if ( version_compare( $saved_version, '3.1.0-alpha.1', '<' ) ) {
self::v_3_1_0();
}
// Delete our CSS cache.
delete_option( 'generate_dynamic_css_output' );
delete_option( 'generate_dynamic_css_cached_version' );
// Reset our dynamic CSS file updated time so it regenerates.
$dynamic_css_data = get_option( 'generatepress_dynamic_css_data', array() );
if ( ! empty( $dynamic_css_data ) ) {
if ( isset( $dynamic_css_data['updated_time'] ) ) {
unset( $dynamic_css_data['updated_time'] );
}
update_option( 'generatepress_dynamic_css_data', $dynamic_css_data );
}
// Last thing to do is update our version.
update_option( 'generate_db_version', GENERATE_VERSION );
}
/**
* Less important updates that should only happen in the Dashboard.
* These use a database flag instead of our version number for legacy reasons.
*
* @since 3.0.0
*/
public static function admin_updates() {
self::v_1_3_0();
self::v_1_3_29();
}
/**
* Remove variants from font family values.
*
* @since 1.3.0
*/
public static function v_1_3_0() {
// Don't run this if Typography add-on is activated.
if ( function_exists( 'generate_fonts_customize_register' ) ) {
return;
}
$settings = get_option( 'generate_settings', array() );
if ( ! isset( $settings['font_body'] ) ) {
return;
}
$value = $settings['font_body'];
$needs_update = false;
// If our value has : in it.
if ( ! empty( $value ) && strpos( $value, ':' ) !== false ) {
// Remove the : and anything past it.
$value = current( explode( ':', $value ) );
$settings['font_body'] = $value;
$needs_update = true;
}
if ( $needs_update ) {
update_option( 'generate_settings', $settings );
}
}
/**
* Move logo to custom_logo option as required by WP.org.
*
* @since 1.3.29
*/
public static function v_1_3_29() {
if ( ! function_exists( 'the_custom_logo' ) ) {
return;
}
if ( get_theme_mod( 'custom_logo' ) ) {
return;
}
$settings = get_option( 'generate_settings', array() );
if ( ! isset( $settings['logo'] ) ) {
return;
}
$old_value = $settings['logo'];
if ( empty( $old_value ) ) {
return;
}
$logo = attachment_url_to_postid( $old_value );
if ( is_int( $logo ) ) {
set_theme_mod( 'custom_logo', $logo );
}
if ( get_theme_mod( 'custom_logo' ) ) {
$settings['logo'] = '';
update_option( 'generate_settings', $settings );
}
}
/**
* Turn off the combine CSS option for existing sites.
*
* @since 2.3.0
*/
public static function v_2_3_0() {
$settings = get_option( 'generate_settings', array() );
$update_options = false;
if ( ! isset( $settings['combine_css'] ) ) {
$settings['combine_css'] = false;
$update_options = true;
}
if ( $update_options ) {
update_option( 'generate_settings', $settings );
}
}
/**
* Update sites using old defaults.
*
* @since 3.0.0
*/
public static function v_3_0_0() {
$settings = get_option( 'generate_settings', array() );
$update_options = false;
$old_defaults = array(
'icons' => 'font',
'structure' => 'floats',
'hide_tagline' => '',
'container_width' => '1100',
'nav_position_setting' => 'nav-below-header',
'container_alignment' => 'boxes',
'background_color' => '#efefef',
'text_color' => '#3a3a3a',
'header_text_color' => '#3a3a3a',
'header_link_color' => '#3a3a3a',
'navigation_background_color' => '#222222',
'navigation_text_color' => '#ffffff',
'navigation_background_hover_color' => '#3f3f3f',
'navigation_text_hover_color' => '#ffffff',
'navigation_background_current_color' => '#3f3f3f',
'navigation_text_current_color' => '#ffffff',
'subnavigation_background_color' => '#3f3f3f',
'subnavigation_text_color' => '#ffffff',
'subnavigation_background_hover_color' => '#4f4f4f',
'subnavigation_text_hover_color' => '#ffffff',
'subnavigation_background_current_color' => '#4f4f4f',
'subnavigation_text_current_color' => '#ffffff',
'sidebar_widget_title_color' => '#000000',
'site_title_font_size' => '45',
'mobile_site_title_font_size' => '30',
'form_button_background_color' => '#666666',
'form_button_background_color_hover' => '#3f3f3f',
'footer_background_color' => '#222222',
'footer_link_hover_color' => '#606060',
'entry_meta_link_color' => '#595959',
'entry_meta_link_color_hover' => '#1e73be',
'blog_post_title_color' => '',
'blog_post_title_hover_color' => '',
'heading_1_font_size' => '40',
'mobile_heading_1_font_size' => '30',
'heading_1_weight' => '300',
'heading_2_font_size' => '30',
'mobile_heading_2_font_size' => '25',
'heading_2_weight' => '300',
'heading_3_font_size' => '20',
'mobile_heading_3_font_size' => '',
'heading_4_font_size' => '',
'mobile_heading_4_font_size' => '',
'heading_5_font_size' => '',
'mobile_heading_5_font_size' => '',
);
foreach ( $old_defaults as $key => $value ) {
if ( ! isset( $settings[ $key ] ) ) {
$settings[ $key ] = $value;
$update_options = true;
}
}
if ( $update_options ) {
update_option( 'generate_settings', $settings );
}
$spacing_settings = get_option( 'generate_spacing_settings', array() );
$update_spacing_options = false;
$old_spacing_defaults = array(
'left_sidebar_width' => '25',
'right_sidebar_width' => '25',
'top_bar_right' => '10',
'top_bar_left' => '10',
'mobile_top_bar_right' => '',
'mobile_top_bar_left' => '',
'header_top' => '40',
'header_bottom' => '40',
'mobile_header_right' => '',
'mobile_header_left' => '',
'mobile_widget_top' => '',
'mobile_widget_right' => '',
'mobile_widget_bottom' => '',
'mobile_widget_left' => '',
'mobile_footer_widget_container_top' => '',
'mobile_footer_widget_container_right' => '',
'mobile_footer_widget_container_bottom' => '',
'mobile_footer_widget_container_left' => '',
'footer_right' => '20',
'footer_left' => '20',
'mobile_footer_right' => '10',
'mobile_footer_left' => '10',
);
foreach ( $old_spacing_defaults as $key => $value ) {
if ( ! isset( $spacing_settings[ $key ] ) ) {
$spacing_settings[ $key ] = $value;
$update_spacing_options = true;
}
}
if ( $update_spacing_options ) {
update_option( 'generate_spacing_settings', $spacing_settings );
}
if ( $update_options || $update_spacing_options ) {
delete_option( 'generate_dynamic_css_output' );
delete_option( 'generate_dynamic_css_cached_version' );
// Reset our dynamic CSS file updated time so it regenerates.
$dynamic_css_data = get_option( 'generatepress_dynamic_css_data', array() );
if ( ! empty( $dynamic_css_data ) ) {
if ( isset( $dynamic_css_data['updated_time'] ) ) {
unset( $dynamic_css_data['updated_time'] );
}
update_option( 'generatepress_dynamic_css_data', $dynamic_css_data );
}
}
}
/**
* Update sites using old defaults.
*
* @since 3.1.0
*/
public static function v_3_1_0() {
$settings = get_option( 'generate_settings', array() );
$update_options = false;
$old_defaults = array(
'underline_links' => 'never',
'use_dynamic_typography' => false,
'background_color' => '#f7f8f9',
'text_color' => '#222222',
'link_color' => '#1e73be',
'link_color_hover' => '#000000',
'header_background_color' => '#ffffff',
'site_title_color' => '#222222',
'site_tagline_color' => '#757575',
'navigation_background_color' => '#ffffff',
'navigation_background_hover_color' => '#ffffff',
'navigation_background_current_color' => '#ffffff',
'navigation_text_color' => '#515151',
'navigation_text_hover_color' => '#7a8896',
'navigation_text_current_color' => '#7a8896',
'subnavigation_background_color' => '#eaeaea',
'subnavigation_background_hover_color' => '#eaeaea',
'subnavigation_background_current_color' => '#eaeaea',
'subnavigation_text_color' => '#515151',
'subnavigation_text_hover_color' => '#7a8896',
'subnavigation_text_current_color' => '#7a8896',
'content_background_color' => '#ffffff',
'blog_post_title_color' => '#222222',
'blog_post_title_hover_color' => '#55555e',
'entry_meta_text_color' => '#595959',
'sidebar_widget_background_color' => '#ffffff',
'footer_widget_background_color' => '#ffffff',
'footer_widget_title_color' => '#000000',
'footer_background_color' => '#55555e',
'footer_text_color' => '#ffffff',
'footer_link_color' => '#ffffff',
'footer_link_hover_color' => '#d3d3d3',
'form_background_color' => '#fafafa',
'form_text_color' => '#666666',
'form_background_color_focus' => '#ffffff',
'form_text_color_focus' => '#666666',
'form_border_color' => '#cccccc',
'form_border_color_focus' => '#bfbfbf',
);
foreach ( $old_defaults as $key => $value ) {
if ( ! isset( $settings[ $key ] ) ) {
$settings[ $key ] = $value;
$update_options = true;
}
}
if ( $update_options ) {
update_option( 'generate_settings', $settings );
}
}
}
GeneratePress_Theme_Update::get_instance();

View File

@ -0,0 +1,306 @@
<?php
/**
* This file handles typography migration.
*
* @package GeneratePress
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
/**
* Handles all of our typography migration.
*/
class GeneratePress_Typography_Migration {
/**
* Class instance.
*
* @access private
* @var $instance Class instance.
*/
private static $instance;
/**
* Initiator
*/
public static function get_instance() {
if ( ! isset( self::$instance ) ) {
self::$instance = new self();
}
return self::$instance;
}
/**
* Map our new typography keys to the old prefixes.
*/
public static function get_option_prefixes() {
$data = array(
array(
'selector' => 'body',
'legacy_prefix' => 'body',
'group' => 'base',
'module' => 'core',
),
array(
'selector' => 'top-bar',
'legacy_prefix' => 'top_bar',
'group' => 'widgets',
'module' => 'core',
),
array(
'selector' => 'main-title',
'legacy_prefix' => 'site_title',
'group' => 'header',
'module' => 'core',
),
array(
'selector' => 'site-description',
'legacy_prefix' => 'site_tagline',
'group' => 'header',
'module' => 'core',
),
array(
'selector' => 'primary-menu-items',
'legacy_prefix' => 'navigation',
'group' => 'primaryNavigation',
'module' => 'core',
),
array(
'selector' => 'widget-titles',
'legacy_prefix' => 'widget_title',
'group' => 'widgets',
'module' => 'core',
),
array(
'selector' => 'buttons',
'legacy_prefix' => 'buttons',
'group' => 'content',
'module' => 'core',
),
array(
'selector' => 'single-content-title',
'legacy_prefix' => 'single_post_title',
'group' => 'content',
'module' => 'core',
),
array(
'selector' => 'archive-content-title',
'legacy_prefix' => 'archive_post_title',
'group' => 'content',
'module' => 'core',
),
array(
'selector' => 'footer',
'legacy_prefix' => 'footer',
'group' => 'footer',
'module' => 'core',
),
);
$headings = array(
'h1' => 'heading_1',
'h2' => 'heading_2',
'h3' => 'heading_3',
'h4' => 'heading_4',
'h5' => 'heading_5',
'h6' => 'heading_6',
);
foreach ( $headings as $selector => $legacy_prefix ) {
$data[] = array(
'selector' => $selector,
'legacy_prefix' => $legacy_prefix,
'group' => 'content',
'module' => 'core',
);
}
if ( function_exists( 'generate_secondary_nav_typography_selectors' ) ) {
$data[] = array(
'selector' => 'secondary-nav-menu-items',
'legacy_prefix' => 'secondary_navigation',
'group' => 'secondaryNavigation',
'module' => 'secondary-nav',
);
}
if ( function_exists( 'generate_menu_plus_typography_selectors' ) ) {
$data[] = array(
'selector' => 'off-canvas-panel-menu-items',
'legacy_prefix' => 'slideout',
'group' => 'offCanvasPanel',
'module' => 'off-canvas-panel',
);
}
if ( function_exists( 'generate_woocommerce_typography_selectors' ) ) {
$data[] = array(
'selector' => 'woocommerce-catalog-product-titles',
'legacy_prefix' => 'wc_product_title',
'group' => 'wooCommerce',
'module' => 'woocommerce',
);
$data[] = array(
'selector' => 'woocommerce-related-product-titles',
'legacy_prefix' => 'wc_related_product_title',
'group' => 'wooCommerce',
'module' => 'woocommerce',
);
}
return $data;
}
/**
* Check if we have a saved value.
*
* @param string $id The option ID.
* @param array $settings The saved settings.
* @param array $defaults The defaults.
*/
public static function has_saved_value( $id, $settings, $defaults ) {
return isset( $settings[ $id ] )
&& isset( $defaults[ $id ] )
&& $defaults[ $id ] !== $settings[ $id ] // Need this because the Customizer treats defaults as saved values.
&& (
! empty( $settings[ $id ] )
|| 0 === $settings[ $id ]
);
}
/**
* Get all of our mapped typography data.
*/
public static function get_mapped_typography_data() {
$settings = get_option( 'generate_settings', array() );
$defaults = generate_get_default_fonts();
$typography_mapping = array();
// These options don't have "font" in their IDs.
$no_font_in_ids = array(
'single_post_title',
'archive_post_title',
);
for ( $headings = 1; $headings < 7; $headings++ ) {
$no_font_in_ids[] = 'heading_' . $headings;
}
foreach ( self::get_option_prefixes() as $key => $data ) {
$legacy_setting_ids = array(
'fontFamily' => 'font_' . $data['legacy_prefix'],
'fontWeight' => $data['legacy_prefix'] . '_font_weight',
'textTransform' => $data['legacy_prefix'] . '_font_transform',
'fontSize' => $data['legacy_prefix'] . '_font_size',
'fontSizeMobile' => 'mobile_' . $data['legacy_prefix'] . 'font_size',
'lineHeight' => $data['legacy_prefix'] . '_line_height',
);
if ( 'slideout' === $data['legacy_prefix'] ) {
$legacy_setting_ids['fontSizeMobile'] = $data['legacy_prefix'] . '_mobile_font_size';
}
if ( in_array( $data['legacy_prefix'], $no_font_in_ids ) ) {
$legacy_setting_ids['fontWeight'] = $data['legacy_prefix'] . '_weight';
$legacy_setting_ids['textTransform'] = $data['legacy_prefix'] . '_transform';
}
foreach ( $legacy_setting_ids as $name => $id ) {
if ( self::has_saved_value( $id, $settings, $defaults ) ) {
$typography_mapping[ $key ][ $name ] = $settings[ $id ];
}
if ( 'secondary_navigation' === $data['legacy_prefix'] && function_exists( 'generate_secondary_nav_get_defaults' ) ) {
$secondary_nav_settings = get_option( 'generate_secondary_nav_settings', array() );
$secondary_nav_defaults = generate_secondary_nav_get_defaults();
if ( self::has_saved_value( $id, $secondary_nav_settings, $secondary_nav_defaults ) ) {
$typography_mapping[ $key ][ $name ] = $secondary_nav_settings[ $id ];
}
}
}
if ( 'body' === $key ) {
if ( self::has_saved_value( 'body_line_height', $settings, $defaults ) ) {
$typography_mapping[ $key ]['lineHeightUnit'] = '';
}
if ( self::has_saved_value( 'paragraph_margin', $settings, $defaults ) ) {
$typography_mapping[ $key ]['marginBottom'] = $settings['paragraph_margin'];
$typography_mapping[ $key ]['marginBottomUnit'] = 'em';
}
}
if ( 'widget-titles' === $key && self::has_saved_value( 'widget_title_separator', $settings, $defaults ) ) {
$typography_mapping[ $key ]['marginBottom'] = $settings['widget_title_separator'];
$typography_mapping[ $key ]['marginBottomUnit'] = 'px';
}
if ( 'h1' === $key || 'h2' === $key || 'h3' === $key ) {
if ( self::has_saved_value( $data['legacy_prefix'] . '_margin_bottom', $settings, $defaults ) ) {
$typography_mapping[ $key ]['marginBottom'] = $settings[ $data['legacy_prefix'] . '_margin_bottom' ];
$typography_mapping[ $key ]['marginBottomUnit'] = 'px';
}
}
if ( isset( $typography_mapping[ $key ]['fontSize'] ) ) {
$typography_mapping[ $key ]['fontSizeUnit'] = 'px';
}
if ( isset( $typography_mapping[ $key ] ) ) {
$typography_mapping[ $key ]['selector'] = $data['selector'];
$typography_mapping[ $key ]['module'] = $data['module'];
$typography_mapping[ $key ]['group'] = $data['group'];
}
}
// Reset array keys starting at 0.
$typography_mapping = array_values( $typography_mapping );
return $typography_mapping;
}
/**
* Get all of our mapped font data.
*/
public static function get_mapped_font_data() {
$font_mapping = array();
foreach ( self::get_option_prefixes() as $key => $data ) {
$settings = get_option( 'generate_settings', array() );
$defaults = generate_get_default_fonts();
if ( 'secondary_navigation' === $data['legacy_prefix'] && function_exists( 'generate_secondary_nav_get_defaults' ) ) {
$settings = get_option( 'generate_secondary_nav_settings', array() );
$defaults = generate_secondary_nav_get_defaults();
}
if ( self::has_saved_value( 'font_' . $data['legacy_prefix'], $settings, $defaults ) ) {
$has_font = array_search( $settings[ 'font_' . $data['legacy_prefix'] ], array_column( $font_mapping, 'fontFamily' ) );
if ( false !== $has_font ) {
continue;
}
$font_mapping[ $key ]['fontFamily'] = $settings[ 'font_' . $data['legacy_prefix'] ];
$local_fonts = generate_typography_default_fonts();
if ( ! in_array( $settings[ 'font_' . $data['legacy_prefix'] ], $local_fonts ) ) {
$font_mapping[ $key ]['googleFont'] = true;
$font_mapping[ $key ]['googleFontCategory'] = get_theme_mod( 'font_' . $data['legacy_prefix'] . '_category' );
$font_mapping[ $key ]['googleFontVariants'] = get_theme_mod( 'font_' . $data['legacy_prefix'] . '_variants' );
}
}
}
// Reset array keys starting at 0.
$font_mapping = array_values( $font_mapping );
return $font_mapping;
}
}
GeneratePress_Typography_Migration::get_instance();

View File

@ -0,0 +1,395 @@
<?php
/**
* This file handles typography on the front-end.
*
* @package GeneratePress
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
/**
* Handles all of our typography option output.
*/
class GeneratePress_Typography {
/**
* Class instance.
*
* @access private
* @var $instance Class instance.
*/
private static $instance;
/**
* Initiator
*/
public static function get_instance() {
if ( ! isset( self::$instance ) ) {
self::$instance = new self();
}
return self::$instance;
}
/**
* Constructor
*/
public function __construct() {
add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_google_fonts' ) );
add_filter( 'generate_editor_styles', array( $this, 'add_editor_styles' ) );
add_action( 'enqueue_block_editor_assets', array( $this, 'enqueue_editor_scripts' ) );
// Load fonts the old way in versions before 5.8 as block_editor_settings_all didn't exist.
if ( version_compare( $GLOBALS['wp_version'], '5.8', '<' ) ) {
add_action( 'enqueue_block_editor_assets', array( $this, 'enqueue_google_fonts' ) );
}
}
/**
* Generate our Google Fonts URI.
*/
public static function get_google_fonts_uri() {
$fonts = generate_get_option( 'font_manager' );
if ( empty( $fonts ) ) {
return;
}
$google_fonts_uri = '';
$data = array();
foreach ( $fonts as $font ) {
if ( empty( $font['googleFont'] ) ) {
continue;
}
$variants = array();
if ( ! empty( $font['googleFontVariants'] ) ) {
// Remove spaces from string.
$variants = str_replace( ' ', '', $font['googleFontVariants'] );
// Turn string into array.
$variants = explode( ',', $variants );
}
$variants = apply_filters( 'generate_google_font_variants', $variants, $font['fontFamily'] );
$name = str_replace( ' ', '+', $font['fontFamily'] );
$name = str_replace( '"', '', $name );
if ( $variants ) {
$data[] = $name . ':' . implode( ',', $variants );
} else {
$data[] = $name;
}
}
if ( ! empty( $data ) ) {
$font_args = apply_filters(
'generate_google_font_args',
array(
'family' => implode( '|', $data ),
'subset' => null,
'display' => generate_get_option( 'google_font_display' ),
)
);
$google_fonts_uri = add_query_arg( $font_args, 'https://fonts.googleapis.com/css' );
}
return $google_fonts_uri;
}
/**
* Enqueue Google Fonts if they're set.
*/
public function enqueue_google_fonts() {
if ( ! generate_is_using_dynamic_typography() ) {
return;
}
$google_fonts_uri = self::get_google_fonts_uri();
if ( $google_fonts_uri ) {
wp_enqueue_style( 'generate-google-fonts', $google_fonts_uri, array(), GENERATE_VERSION );
}
}
/**
* Build our typography CSS.
*
* @param string $module The name of the module we're generating CSS for.
* @param string $specific_selector Target a specific selector to get the CSS for.
*/
public static function get_css( $module = 'core', $specific_selector = '' ) {
$typography = generate_get_option( 'typography' );
// Get data for a specific module so CSS can be compiled separately.
$typography = array_filter(
(array) $typography,
function( $data ) use ( $module ) {
return ( isset( $data['module'] ) && $data['module'] === $module );
}
);
if ( empty( $typography ) ) {
return '';
}
$css = new GeneratePress_CSS();
$body_selector = 'body';
$paragraph_selector = 'p';
foreach ( $typography as $key => $data ) {
$options = wp_parse_args(
$data,
self::get_defaults()
);
$selector = self::get_css_selector( $options['selector'] );
if ( 'custom' === $selector ) {
$selector = $options['customSelector'];
}
if (
$specific_selector &&
$options['selector'] !== $specific_selector &&
$options['customSelector'] !== $specific_selector
) {
continue;
}
$font_family = self::get_font_family( $options['fontFamily'] );
$css->set_selector( $selector );
$css->add_property( 'font-family', $font_family );
$css->add_property( 'font-weight', $options['fontWeight'] );
$css->add_property( 'text-transform', $options['textTransform'] );
$css->add_property( 'font-style', $options['fontStyle'] );
$css->add_property( 'text-decoration', $options['textDecoration'] );
$css->add_property( 'font-size', $options['fontSize'], false, $options['fontSizeUnit'] );
$css->add_property( 'letter-spacing', $options['letterSpacing'], false, $options['letterSpacingUnit'] );
if ( 'body' !== $options['selector'] ) {
$css->add_property( 'line-height', $options['lineHeight'], false, $options['lineHeightUnit'] );
$css->add_property( 'margin-bottom', $options['marginBottom'], false, $options['marginBottomUnit'] );
} else {
$css->set_selector( $body_selector );
$css->add_property( 'line-height', $options['lineHeight'], false, $options['lineHeightUnit'] );
$css->set_selector( $paragraph_selector );
$css->add_property( 'margin-bottom', $options['marginBottom'], false, $options['marginBottomUnit'] );
}
$css->start_media_query( generate_get_media_query( 'tablet' ) );
$css->set_selector( $selector );
$css->add_property( 'font-size', $options['fontSizeTablet'], false, $options['fontSizeUnit'] );
$css->add_property( 'letter-spacing', $options['letterSpacingTablet'], false, $options['letterSpacingUnit'] );
if ( 'body' !== $options['selector'] ) {
$css->add_property( 'line-height', $options['lineHeightTablet'], false, $options['lineHeightUnit'] );
$css->add_property( 'margin-bottom', $options['marginBottomTablet'], false, $options['marginBottomUnit'] );
} else {
$css->set_selector( $body_selector );
$css->add_property( 'line-height', $options['lineHeightTablet'], false, $options['lineHeightUnit'] );
$css->set_selector( $paragraph_selector );
$css->add_property( 'margin-bottom', $options['marginBottomTablet'], false, $options['marginBottomUnit'] );
}
$css->stop_media_query();
$css->start_media_query( generate_get_media_query( 'mobile' ) );
$css->set_selector( $selector );
$css->add_property( 'font-size', $options['fontSizeMobile'], false, $options['fontSizeUnit'] );
$css->add_property( 'letter-spacing', $options['letterSpacingMobile'], false, $options['letterSpacingUnit'] );
if ( 'body' !== $options['selector'] ) {
$css->add_property( 'line-height', $options['lineHeightMobile'], false, $options['lineHeightUnit'] );
$css->add_property( 'margin-bottom', $options['marginBottomMobile'], false, $options['marginBottomUnit'] );
} else {
$css->set_selector( $body_selector );
$css->add_property( 'line-height', $options['lineHeightMobile'], false, $options['lineHeightUnit'] );
$css->set_selector( $paragraph_selector );
$css->add_property( 'margin-bottom', $options['marginBottomMobile'], false, $options['marginBottomUnit'] );
}
$css->stop_media_query();
}
return $css->css_output();
}
/**
* Get the CSS selector.
*
* @param string $selector The saved selector to look up.
*/
public static function get_css_selector( $selector ) {
switch ( $selector ) {
case 'body':
$selector = 'body, button, input, select, textarea';
break;
case 'main-title':
$selector = '.main-title';
break;
case 'site-description':
$selector = '.site-description';
break;
case 'primary-menu-items':
$selector = '.main-navigation a, .main-navigation .menu-toggle, .main-navigation .menu-bar-items';
break;
case 'primary-sub-menu-items':
$selector = '.main-navigation .main-nav ul ul li a';
break;
case 'primary-menu-toggle':
$selector = '.main-navigation .menu-toggle';
break;
case 'buttons':
$selector = 'button:not(.menu-toggle),html input[type="button"],input[type="reset"],input[type="submit"],.button,.wp-block-button .wp-block-button__link';
break;
case 'all-headings':
$selector = 'h1, h2, h3, h4, h5, h6';
break;
case 'single-content-title':
$selector = 'h1.entry-title';
break;
case 'archive-content-title':
$selector = 'h2.entry-title';
break;
case 'top-bar':
$selector = '.top-bar';
break;
case 'widget-titles':
$selector = '.widget-title';
break;
case 'footer':
$selector = '.site-info';
break;
}
return apply_filters( 'generate_typography_css_selector', $selector );
}
/**
* Get our full font family value.
*
* @param string $font_family The font family name.
*/
public static function get_font_family( $font_family ) {
if ( ! $font_family ) {
return $font_family;
}
$font_manager = generate_get_option( 'font_manager' );
$font_families = array();
foreach ( (array) $font_manager as $key => $data ) {
$font_families[ $data['fontFamily'] ] = $data;
}
$font_family_args = array();
if ( ! empty( $font_families[ $font_family ] ) ) {
$font_family_args = $font_families[ $font_family ];
}
if ( ! empty( $font_family_args['googleFont'] ) && ! empty( $font_family_args['googleFontCategory'] ) ) {
// Add quotations around font names with standalone numbers.
if ( preg_match( '/(?<!\S)\d+(?!\S)/', $font_family ) ) {
$font_family = '"' . $font_family . '"';
}
$font_family = $font_family . ', ' . $font_family_args['googleFontCategory'];
} elseif ( 'System Default' === $font_family ) {
$font_family = generate_get_system_default_font();
}
return $font_family;
}
/**
* Get the defaults for our CSS options.
*/
public static function get_defaults() {
return array(
'selector' => '',
'customSelector' => '',
'fontFamily' => '',
'fontWeight' => '',
'textTransform' => '',
'textDecoration' => '',
'fontStyle' => '',
'fontSize' => '',
'fontSizeTablet' => '',
'fontSizeMobile' => '',
'fontSizeUnit' => 'px',
'lineHeight' => '',
'lineHeightTablet' => '',
'lineHeightMobile' => '',
'lineHeightUnit' => '',
'letterSpacing' => '',
'letterSpacingTablet' => '',
'letterSpacingMobile' => '',
'letterSpacingUnit' => 'px',
'marginBottom' => '',
'marginBottomTablet' => '',
'marginBottomMobile' => '',
'marginBottomUnit' => 'px',
);
}
/**
* Add editor styles to the block editor.
*
* @param array $editor_styles Existing styles.
*/
public function add_editor_styles( $editor_styles ) {
if ( generate_is_using_dynamic_typography() ) {
$editor_styles[] = 'assets/css/admin/editor-typography.css';
}
return $editor_styles;
}
/**
* Add scripts to the block editor.
*/
public function enqueue_editor_scripts() {
$html_typography = self::get_css( 'core', 'html' );
if ( $html_typography ) {
wp_add_inline_style(
/**
* `wp-edit-blocks` is enqueued in the editor, including the iframes.
* This is not ideal, as we should use the `block_editor_settings_all` filter to add editor CSS.
* However, that filter prepends all selectors with `.editor-styles-wrapper`, which breaks the above
* selector, as it appears above that element in the DOM.
*
* Related: https://github.com/tomusborne/generatepress/issues/472
*/
'wp-edit-blocks',
$html_typography
);
}
}
}
GeneratePress_Typography::get_instance();

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,217 @@
<?php
/**
* This file handles adding Customizer controls.
*
* @package GeneratePress
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
/**
* Helper functions to add Customizer fields.
*/
class GeneratePress_Customize_Field {
/**
* Instance.
*
* @access private
* @var object Instance
*/
private static $instance;
/**
* Initiator.
*
* @since 1.2.0
* @return object initialized object of class.
*/
public static function get_instance() {
if ( ! isset( self::$instance ) ) {
self::$instance = new self();
}
return self::$instance;
}
/**
* Add a wrapper for defined controls.
*
* @param string $id The settings ID for this field.
* @param array $control_args The args for add_control().
*/
public static function add_wrapper( $id, $control_args = array() ) {
global $wp_customize;
if ( ! $id ) {
return;
}
$control_args['settings'] = isset( $wp_customize->selective_refresh ) ? array() : 'blogname';
$control_args['choices']['id'] = str_replace( '_', '-', $id );
$control_args['type'] = 'generate-wrapper-control';
$wp_customize->add_control(
new GeneratePress_Customize_React_Control(
$wp_customize,
$id,
$control_args
)
);
}
/**
* Add a title.
*
* @param string $id The settings ID for this field.
* @param array $control_args The args for add_control().
*/
public static function add_title( $id, $control_args = array() ) {
global $wp_customize;
if ( ! $id ) {
return;
}
$control_args['settings'] = isset( $wp_customize->selective_refresh ) ? array() : 'blogname';
$control_args['type'] = 'generate-title-control';
$control_args['choices']['title'] = $control_args['title'];
unset( $control_args['title'] );
$wp_customize->add_control(
new GeneratePress_Customize_React_Control(
$wp_customize,
$id,
$control_args
)
);
}
/**
* Add a Customizer field.
*
* @param string $id The settings ID for this field.
* @param object $control_class A custom control classes if we want one.
* @param array $setting_args The args for add_setting().
* @param array $control_args The args for add_control().
*/
public static function add_field( $id, $control_class, $setting_args = array(), $control_args = array() ) {
global $wp_customize;
if ( ! $id ) {
return;
}
$settings = wp_parse_args(
$setting_args,
array(
'type' => 'option',
'capability' => 'edit_theme_options',
'default' => '',
'transport' => 'refresh',
'validate_callback' => '',
'sanitize_callback' => '',
)
);
$wp_customize->add_setting(
$id,
array(
'type' => $settings['type'],
'capability' => $settings['capability'],
'default' => $settings['default'],
'transport' => $settings['transport'],
'validate_callback' => $settings['validate_callback'],
'sanitize_callback' => $settings['sanitize_callback'],
)
);
$control_args['settings'] = $id;
if ( ! isset( $control_args['type'] ) ) {
unset( $control_args['type'] );
}
if ( ! isset( $control_args['defaultValue'] ) && isset( $setting_args['default'] ) ) {
$control_args['defaultValue'] = $setting_args['default'];
}
if ( isset( $control_args['output'] ) ) {
global $generate_customize_fields;
$generate_customize_fields[] = array(
'js_vars' => $control_args['output'],
'settings' => $id,
);
}
if ( $control_class ) {
$wp_customize->add_control(
new $control_class(
$wp_customize,
$id,
$control_args
)
);
return;
}
$wp_customize->add_control(
$id,
$control_args
);
}
/**
* Add color field group.
*
* @param string $id The ID for the group wrapper.
* @param string $section_id The section ID.
* @param string $toggle_id The Toggle ID.
* @param array $fields The color fields.
*/
public static function add_color_field_group( $id, $section_id, $toggle_id, $fields ) {
self::add_wrapper(
"generate_{$id}_wrapper",
array(
'section' => $section_id,
'choices' => array(
'type' => 'color',
'toggleId' => $toggle_id,
'items' => array_keys( $fields ),
),
)
);
foreach ( $fields as $key => $field ) {
self::add_field(
$key,
'GeneratePress_Customize_Color_Control',
array(
'default' => $field['default_value'],
'transport' => 'postMessage',
'sanitize_callback' => 'generate_sanitize_rgba_color',
),
array(
'label' => $field['label'],
'section' => $section_id,
'choices' => array(
'alpha' => isset( $field['alpha'] ) ? $field['alpha'] : true,
'toggleId' => $toggle_id,
'wrapper' => $key,
'tooltip' => $field['tooltip'],
'hideLabel' => isset( $field['hide_label'] ) ? $field['hide_label'] : false,
),
'output' => array(
array(
'element' => $field['element'],
'property' => $field['property'],
),
),
)
);
}
}
}

View File

@ -0,0 +1,44 @@
<?php
/**
* Customize API: ColorAlpha class
*
* @package GeneratePress
*/
/**
* Customize Color Control class.
*
* @since 1.0.0
*
* @see WP_Customize_Control
*/
class GeneratePress_Customize_Color_Control extends WP_Customize_Color_Control {
/**
* Type.
*
* @access public
* @since 1.0.0
* @var string
*/
public $type = 'generate-color-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() {}
}

View File

@ -0,0 +1,303 @@
<?php
/**
* Where old Customizer controls retire.
*
* @package GeneratePress
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
if ( class_exists( 'WP_Customize_Control' ) && ! class_exists( 'Generate_Customize_Width_Slider_Control' ) ) {
/**
* Create our container width slider control
*
* @deprecated 1.3.47
*/
class Generate_Customize_Width_Slider_Control extends WP_Customize_Control {
/**
* Render content.
*/
public function render_content() {}
}
}
if ( class_exists( 'WP_Customize_Control' ) && ! class_exists( 'GenerateLabelControl' ) ) {
/**
* Heading area
*
* @since 0.1
* @depreceted 1.3.41
**/
class GenerateLabelControl extends WP_Customize_Control { // phpcs:ignore
/**
* Render content.
*/
public function render_content() {}
}
}
if ( ! class_exists( 'Generate_Google_Font_Dropdown_Custom_Control' ) ) {
/**
* A class to create a dropdown for all google fonts
*/
class Generate_Google_Font_Dropdown_Custom_Control extends WP_Customize_Control { // phpcs:ignore
/**
* Set type.
*
* @var $type
*/
public $type = 'gp-customizer-fonts';
/**
* Enqueue scripts.
*/
public function enqueue() {
wp_enqueue_script( 'generatepress-customizer-fonts', trailingslashit( get_template_directory_uri() ) . 'inc/js/typography-controls.js', array( 'customize-controls' ), GENERATE_VERSION, true );
wp_localize_script( 'generatepress-customizer-fonts', 'gp_customize', array( 'nonce' => wp_create_nonce( 'gp_customize_nonce' ) ) );
}
/**
* Send variables to json.
*/
public function to_json() {
parent::to_json();
$number_of_fonts = apply_filters( 'generate_number_of_fonts', 200 );
$this->json['link'] = $this->get_link();
$this->json['value'] = $this->value();
$this->json['default_fonts_title'] = __( 'Default fonts', 'generatepress' );
$this->json['google_fonts_title'] = __( 'Google fonts', 'generatepress' );
$this->json['description'] = __( 'Font family', 'generatepress' );
$this->json['google_fonts'] = apply_filters( 'generate_typography_customize_list', generate_get_all_google_fonts( $number_of_fonts ) );
$this->json['default_fonts'] = generate_typography_default_fonts();
}
/**
* Render content.
*/
public function content_template() {
?>
<label>
<span class="customize-control-title">{{ data.label }}</span>
<select {{{ data.link }}}>
<optgroup label="{{ data.default_fonts_title }}">
<# for ( var key in data.default_fonts ) { #>
<# var name = data.default_fonts[ key ].split(',')[0]; #>
<option value="{{ data.default_fonts[ key ] }}" <# if ( data.default_fonts[ key ] === data.value ) { #>selected="selected"<# } #>>{{ name }}</option>
<# } #>
</optgroup>
<optgroup label="{{ data.google_fonts_title }}">
<# for ( var key in data.google_fonts ) { #>
<option value="{{ data.google_fonts[ key ].name }}" <# if ( data.google_fonts[ key ].name === data.value ) { #>selected="selected"<# } #>>{{ data.google_fonts[ key ].name }}</option>
<# } #>
</optgroup>
</select>
<p class="description">{{ data.description }}</p>
</label>
<?php
}
}
}
if ( ! class_exists( 'Generate_Select_Control' ) ) {
/**
* A class to create a dropdown for font weight
*/
class Generate_Select_Control extends WP_Customize_Control { // phpcs:ignore
/**
* Set type.
*
* @var $type
*/
public $type = 'gp-typography-select';
/**
* Set choices.
*
* @var $choices
*/
public $choices = array();
/**
* Send variables to json.
*/
public function to_json() {
parent::to_json();
foreach ( $this->choices as $name => $choice ) {
$this->choices[ $name ] = $choice;
}
$this->json['choices'] = $this->choices;
$this->json['link'] = $this->get_link();
$this->json['value'] = $this->value();
}
/**
* Render content.
*/
public function content_template() {
?>
<# if ( ! data.choices )
return;
#>
<label>
<select {{{ data.link }}}>
<# jQuery.each( data.choices, function( label, choice ) { #>
<option value="{{ choice }}" <# if ( choice === data.value ) { #> selected="selected"<# } #>>{{ choice }}</option>
<# } ) #>
</select>
<# if ( data.label ) { #>
<p class="description">{{ data.label }}</p>
<# } #>
</label>
<?php
}
}
}
if ( ! class_exists( 'Generate_Hidden_Input_Control' ) ) {
/**
* Create our hidden input control
*/
class Generate_Hidden_Input_Control extends WP_Customize_Control { // phpcs:ignore
/**
* Set type.
*
* @var $type
*/
public $type = 'gp-hidden-input';
/**
* Set ID
*
* @var $id
*/
public $id = '';
/**
* Send variables to json.
*/
public function to_json() {
parent::to_json();
$this->json['link'] = $this->get_link();
$this->json['value'] = $this->value();
$this->json['id'] = $this->id;
}
/**
* Render content.
*/
public function content_template() {
?>
<input name="{{ data.id }}" type="text" {{{ data.link }}} value="{{{ data.value }}}" class="gp-hidden-input" />
<?php
}
}
}
if ( ! class_exists( 'Generate_Font_Weight_Custom_Control' ) ) {
/**
* A class to create a dropdown for font weight
*
* @deprecated since 1.3.40
*/
class Generate_Font_Weight_Custom_Control extends WP_Customize_Control { // phpcs:ignore
/**
* Construct.
*
* @param object $manager The manager.
* @param int $id The ID.
* @param array $args The args.
* @param array $options The options.
*/
public function __construct( $manager, $id, $args = array(), $options = array() ) {
parent::__construct( $manager, $id, $args );
}
/**
* Render the content of the category dropdown
*/
public function render_content() {
?>
<label>
<select <?php $this->link(); ?>>
<?php
printf( '<option value="%s" %s>%s</option>', 'normal', selected( $this->value(), 'normal', false ), 'normal' );
printf( '<option value="%s" %s>%s</option>', 'bold', selected( $this->value(), 'bold', false ), 'bold' );
printf( '<option value="%s" %s>%s</option>', '100', selected( $this->value(), '100', false ), '100' );
printf( '<option value="%s" %s>%s</option>', '200', selected( $this->value(), '200', false ), '200' );
printf( '<option value="%s" %s>%s</option>', '300', selected( $this->value(), '300', false ), '300' );
printf( '<option value="%s" %s>%s</option>', '400', selected( $this->value(), '400', false ), '400' );
printf( '<option value="%s" %s>%s</option>', '500', selected( $this->value(), '500', false ), '500' );
printf( '<option value="%s" %s>%s</option>', '600', selected( $this->value(), '600', false ), '600' );
printf( '<option value="%s" %s>%s</option>', '700', selected( $this->value(), '700', false ), '700' );
printf( '<option value="%s" %s>%s</option>', '800', selected( $this->value(), '800', false ), '800' );
printf( '<option value="%s" %s>%s</option>', '900', selected( $this->value(), '900', false ), '900' );
?>
</select>
<p class="description"><?php echo esc_html( $this->label ); ?></p>
</label>
<?php
}
}
}
if ( ! class_exists( 'Generate_Text_Transform_Custom_Control' ) ) {
/**
* A class to create a dropdown for text-transform
*
* @deprecated since 1.3.40
*/
class Generate_Text_Transform_Custom_Control extends WP_Customize_Control { // phpcs:ignore
/**
* Construct.
*
* @param object $manager The manager.
* @param int $id The ID.
* @param array $args The args.
* @param array $options The options.
*/
public function __construct( $manager, $id, $args = array(), $options = array() ) {
parent::__construct( $manager, $id, $args );
}
/**
* Render the content of the category dropdown
*/
public function render_content() {
?>
<label>
<select <?php $this->link(); ?>>
<?php
printf( '<option value="%s" %s>%s</option>', 'none', selected( $this->value(), 'none', false ), 'none' );
printf( '<option value="%s" %s>%s</option>', 'capitalize', selected( $this->value(), 'capitalize', false ), 'capitalize' );
printf( '<option value="%s" %s>%s</option>', 'uppercase', selected( $this->value(), 'uppercase', false ), 'uppercase' );
printf( '<option value="%s" %s>%s</option>', 'lowercase', selected( $this->value(), 'lowercase', false ), 'lowercase' );
?>
</select>
<p class="description"><?php echo esc_html( $this->label ); ?></p>
</label>
<?php
}
}
}
if ( ! class_exists( 'Generate_Customize_Slider_Control' ) ) {
/**
* Create our container width slider control
*
* @deprecated 1.3.47
*/
class Generate_Customize_Slider_Control extends WP_Customize_Control { // phpcs:ignore
/**
* Render content.
*/
public function render_content() {}
}
}

View File

@ -0,0 +1,209 @@
<?php
/**
* The range slider Customizer control.
*
* @package GeneratePress
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
if ( class_exists( 'WP_Customize_Control' ) && ! class_exists( 'Generate_Range_Slider_Control' ) ) {
/**
* Create a range slider control.
* This control allows you to add responsive settings.
*
* @since 1.3.47
*/
class Generate_Range_Slider_Control extends WP_Customize_Control {
/**
* The control type.
*
* @access public
* @var string
*/
public $type = 'generatepress-range-slider';
/**
* The control description.
*
* @access public
* @var string
*/
public $description = '';
/**
* The control sub-description.
*
* @access public
* @var string
*/
public $sub_description = '';
/**
* Refresh the parameters passed to the JavaScript via JSON.
*
* @see WP_Customize_Control::to_json()
*/
public function to_json() {
parent::to_json();
$devices = array( 'desktop', 'tablet', 'mobile' );
foreach ( $devices as $device ) {
$this->json['choices'][ $device ]['min'] = ( isset( $this->choices[ $device ]['min'] ) ) ? $this->choices[ $device ]['min'] : '0';
$this->json['choices'][ $device ]['max'] = ( isset( $this->choices[ $device ]['max'] ) ) ? $this->choices[ $device ]['max'] : '100';
$this->json['choices'][ $device ]['step'] = ( isset( $this->choices[ $device ]['step'] ) ) ? $this->choices[ $device ]['step'] : '1';
$this->json['choices'][ $device ]['edit'] = ( isset( $this->choices[ $device ]['edit'] ) ) ? $this->choices[ $device ]['edit'] : false;
$this->json['choices'][ $device ]['unit'] = ( isset( $this->choices[ $device ]['unit'] ) ) ? $this->choices[ $device ]['unit'] : false;
}
foreach ( $this->settings as $setting_key => $setting_id ) {
$this->json[ $setting_key ] = array(
'link' => $this->get_link( $setting_key ),
'value' => $this->value( $setting_key ),
'default' => isset( $setting_id->default ) ? $setting_id->default : '',
);
}
$this->json['desktop_label'] = __( 'Desktop', 'generatepress' );
$this->json['tablet_label'] = __( 'Tablet', 'generatepress' );
$this->json['mobile_label'] = __( 'Mobile', 'generatepress' );
$this->json['reset_label'] = __( 'Reset', 'generatepress' );
$this->json['description'] = $this->description;
$this->json['sub_description'] = $this->sub_description;
}
/**
* Enqueue control related scripts/styles.
*
* @access public
*/
public function enqueue() {
wp_enqueue_script(
'generatepress-range-slider',
trailingslashit( get_template_directory_uri() ) . 'inc/customizer/controls/js/slider-control.js',
array(
'jquery',
'customize-base',
'jquery-ui-slider',
),
GENERATE_VERSION,
true
);
wp_enqueue_style(
'generatepress-range-slider-css',
trailingslashit( get_template_directory_uri() ) . 'inc/customizer/controls/css/slider-customizer.css',
array(),
GENERATE_VERSION
);
}
/**
* An Underscore (JS) template for this control's content (but not its container).
*
* Class variables for this control class are available in the `data` JS object;
* export custom variables by overriding {@see WP_Customize_Control::to_json()}.
*
* @see WP_Customize_Control::print_template()
*
* @access protected
*/
protected function content_template() {
?>
<div class="generatepress-range-slider-control">
<div class="gp-range-title-area">
<# if ( data.label || data.description ) { #>
<div class="gp-range-title-info">
<# if ( data.label ) { #>
<span class="customize-control-title">{{{ data.label }}}</span>
<# } #>
<# if ( data.description ) { #>
<p class="description">{{{ data.description }}}</p>
<# } #>
</div>
<# } #>
<div class="gp-range-slider-controls">
<span class="gp-device-controls">
<# if ( 'undefined' !== typeof ( data.desktop ) ) { #>
<span class="generatepress-device-desktop dashicons dashicons-desktop" data-option="desktop" title="{{ data.desktop_label }}"></span>
<# } #>
<# if ( 'undefined' !== typeof (data.tablet) ) { #>
<span class="generatepress-device-tablet dashicons dashicons-tablet" data-option="tablet" title="{{ data.tablet_label }}"></span>
<# } #>
<# if ( 'undefined' !== typeof (data.mobile) ) { #>
<span class="generatepress-device-mobile dashicons dashicons-smartphone" data-option="mobile" title="{{ data.mobile_label }}"></span>
<# } #>
</span>
<span title="{{ data.reset_label }}" class="generatepress-reset dashicons dashicons-image-rotate"></span>
</div>
</div>
<div class="gp-range-slider-areas">
<# if ( 'undefined' !== typeof ( data.desktop ) ) { #>
<label class="range-option-area" data-option="desktop" style="display: none;">
<div class="wrapper <# if ( '' !== data.choices['desktop']['unit'] ) { #>has-unit<# } #>">
<div class="generatepress-slider" data-step="{{ data.choices['desktop']['step'] }}" data-min="{{ data.choices['desktop']['min'] }}" data-max="{{ data.choices['desktop']['max'] }}"></div>
<div class="gp_range_value <# if ( '' == data.choices['desktop']['unit'] && ! data.choices['desktop']['edit'] ) { #>hide-value<# } #>">
<input <# if ( data.choices['desktop']['edit'] ) { #>style="display:inline-block;"<# } else { #>style="display:none;"<# } #> type="number" step="{{ data.choices['desktop']['step'] }}" class="desktop-range value" value="{{ data.desktop.value }}" min="{{ data.choices['desktop']['min'] }}" max="{{ data.choices['desktop']['max'] }}" {{{ data.desktop.link }}} data-reset_value="{{ data.desktop.default }}" />
<span <# if ( ! data.choices['desktop']['edit'] ) { #>style="display:inline-block;"<# } else { #>style="display:none;"<# } #> class="value">{{ data.desktop.value }}</span>
<# if ( data.choices['desktop']['unit'] ) { #>
<span class="unit">{{ data.choices['desktop']['unit'] }}</span>
<# } #>
</div>
</div>
</label>
<# } #>
<# if ( 'undefined' !== typeof ( data.tablet ) ) { #>
<label class="range-option-area" data-option="tablet" style="display:none">
<div class="wrapper <# if ( '' !== data.choices['tablet']['unit'] ) { #>has-unit<# } #>">
<div class="generatepress-slider" data-step="{{ data.choices['tablet']['step'] }}" data-min="{{ data.choices['tablet']['min'] }}" data-max="{{ data.choices['tablet']['max'] }}"></div>
<div class="gp_range_value <# if ( '' == data.choices['tablet']['unit'] && ! data.choices['desktop']['edit'] ) { #>hide-value<# } #>">
<input <# if ( data.choices['tablet']['edit'] ) { #>style="display:inline-block;"<# } else { #>style="display:none;"<# } #> type="number" step="{{ data.choices['tablet']['step'] }}" class="tablet-range value" value="{{ data.tablet.value }}" min="{{ data.choices['tablet']['min'] }}" max="{{ data.choices['tablet']['max'] }}" {{{ data.tablet.link }}} data-reset_value="{{ data.tablet.default }}" />
<span <# if ( ! data.choices['tablet']['edit'] ) { #>style="display:inline-block;"<# } else { #>style="display:none;"<# } #> class="value">{{ data.tablet.value }}</span>
<# if ( data.choices['tablet']['unit'] ) { #>
<span class="unit">{{ data.choices['tablet']['unit'] }}</span>
<# } #>
</div>
</div>
</label>
<# } #>
<# if ( 'undefined' !== typeof ( data.mobile ) ) { #>
<label class="range-option-area" data-option="mobile" style="display:none;">
<div class="wrapper <# if ( '' !== data.choices['mobile']['unit'] ) { #>has-unit<# } #>">
<div class="generatepress-slider" data-step="{{ data.choices['mobile']['step'] }}" data-min="{{ data.choices['mobile']['min'] }}" data-max="{{ data.choices['mobile']['max'] }}"></div>
<div class="gp_range_value <# if ( '' == data.choices['mobile']['unit'] && ! data.choices['desktop']['edit'] ) { #>hide-value<# } #>">
<input <# if ( data.choices['mobile']['edit'] ) { #>style="display:inline-block;"<# } else { #>style="display:none;"<# } #> type="number" step="{{ data.choices['mobile']['step'] }}" class="mobile-range value" value="{{ data.mobile.value }}" min="{{ data.choices['mobile']['min'] }}" max="{{ data.choices['mobile']['max'] }}" {{{ data.mobile.link }}} data-reset_value="{{ data.mobile.default }}" />
<span <# if ( ! data.choices['mobile']['edit'] ) { #>style="display:inline-block;"<# } else { #>style="display:none;"<# } #> class="value">{{ data.mobile.value }}</span>
<# if ( data.choices['mobile']['unit'] ) { #>
<span class="unit">{{ data.choices['mobile']['unit'] }}</span>
<# } #>
</div>
</div>
</label>
<# } #>
</div>
<# if ( data.sub_description ) { #>
<p class="description sub-description">{{{ data.sub_description }}}</p>
<# } #>
</div>
<?php
}
}
}

View File

@ -0,0 +1,53 @@
<?php
/**
* Customize API: ColorAlpha class
*
* @package GeneratePress
*/
/**
* Customize Color Control class.
*
* @since 1.0.0
*
* @see WP_Customize_Control
*/
class GeneratePress_Customize_React_Control extends WP_Customize_Control {
/**
* Type.
*
* @access public
* @since 1.0.0
* @var string
*/
public $type = 'generate-react-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() {}
}

View File

@ -0,0 +1,243 @@
<?php
/**
* The typography Customizer control.
*
* @package GeneratePress
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
if ( class_exists( 'WP_Customize_Control' ) && ! class_exists( 'Generate_Typography_Customize_Control' ) ) {
/**
* Create the typography elements control.
*
* @since 2.0
*/
class Generate_Typography_Customize_Control extends WP_Customize_Control {
/**
* Set the type.
*
* @var string $type
*/
public $type = 'gp-customizer-typography';
/**
* Enqueue scripts.
*/
public function enqueue() {
wp_enqueue_script(
'generatepress-typography-selectWoo',
trailingslashit( get_template_directory_uri() ) . 'inc/customizer/controls/js/selectWoo.min.js',
array(
'customize-controls',
'jquery',
),
GENERATE_VERSION,
true
);
wp_enqueue_style(
'generatepress-typography-selectWoo',
trailingslashit( get_template_directory_uri() ) . 'inc/customizer/controls/css/selectWoo.min.css',
array(),
GENERATE_VERSION
);
wp_enqueue_script(
'generatepress-typography-customizer',
trailingslashit( get_template_directory_uri() ) . 'inc/customizer/controls/js/typography-customizer.js',
array(
'customize-controls',
'generatepress-typography-selectWoo',
),
GENERATE_VERSION,
true
);
wp_enqueue_style(
'generatepress-typography-customizer',
trailingslashit( get_template_directory_uri() ) . 'inc/customizer/controls/css/typography-customizer.css',
array(),
GENERATE_VERSION
);
}
/**
* Send variables to json.
*/
public function to_json() {
parent::to_json();
$this->json['default_fonts_title'] = __( 'System fonts', 'generatepress' );
$this->json['google_fonts_title'] = __( 'Google fonts', 'generatepress' );
$this->json['default_fonts'] = generate_typography_default_fonts();
$this->json['family_title'] = esc_html__( 'Font family', 'generatepress' );
$this->json['weight_title'] = esc_html__( 'Font weight', 'generatepress' );
$this->json['transform_title'] = esc_html__( 'Text transform', 'generatepress' );
$this->json['category_title'] = '';
$this->json['variant_title'] = esc_html__( 'Variants', 'generatepress' );
foreach ( $this->settings as $setting_key => $setting_id ) {
$this->json[ $setting_key ] = array(
'link' => $this->get_link( $setting_key ),
'value' => $this->value( $setting_key ),
'default' => isset( $setting_id->default ) ? $setting_id->default : '',
'id' => isset( $setting_id->id ) ? $setting_id->id : '',
);
if ( 'weight' === $setting_key ) {
$this->json[ $setting_key ]['choices'] = $this->get_font_weight_choices();
}
if ( 'transform' === $setting_key ) {
$this->json[ $setting_key ]['choices'] = $this->get_font_transform_choices();
}
}
}
/**
* Render content.
*/
public function content_template() {
?>
<# if ( '' !== data.label ) { #>
<span class="customize-control-title">{{ data.label }}</span>
<# } #>
<# if ( 'undefined' !== typeof ( data.family ) ) { #>
<div class="generatepress-font-family">
<label>
<select {{{ data.family.link }}} data-category="{{{ data.category.id }}}" data-variants="{{{ data.variant.id }}}" style="width:100%;">
<optgroup label="{{ data.default_fonts_title }}">
<# for ( var key in data.default_fonts ) { #>
<# var name = data.default_fonts[ key ].split(',')[0]; #>
<option value="{{ data.default_fonts[ key ] }}" <# if ( data.default_fonts[ key ] === data.family.value ) { #>selected="selected"<# } #>>{{ name }}</option>
<# } #>
</optgroup>
<optgroup label="{{ data.google_fonts_title }}">
<# for ( var key in generatePressTypography.googleFonts ) { #>
<option value="{{ generatePressTypography.googleFonts[ key ].name }}" <# if ( generatePressTypography.googleFonts[ key ].name === data.family.value ) { #>selected="selected"<# } #>>{{ generatePressTypography.googleFonts[ key ].name }}</option>
<# } #>
</optgroup>
</select>
<# if ( '' !== data.family_title ) { #>
<p class="description">{{ data.family_title }}</p>
<# } #>
</label>
</div>
<# } #>
<# if ( 'undefined' !== typeof ( data.variant ) ) { #>
<#
var id = data.family.value.split(' ').join('_').toLowerCase();
var font_data = generatePressTypography.googleFonts[id];
var variants = '';
if ( typeof font_data !== 'undefined' ) {
variants = font_data.variants;
}
if ( null === data.variant.value ) {
data.variant.value = data.variant.default;
}
#>
<div id={{{ data.variant.id }}}" class="generatepress-font-variant" data-saved-value="{{ data.variant.value }}">
<label>
<select name="{{{ data.variant.id }}}" multiple class="typography-multi-select" style="width:100%;" {{{ data.variant.link }}}>
<# _.each( variants, function( label, choice ) { #>
<option value="{{ label }}">{{ label }}</option>
<# } ) #>
</select>
<# if ( '' !== data.variant_title ) { #>
<p class="description">{{ data.variant_title }}</p>
<# } #>
</label>
</div>
<# } #>
<# if ( 'undefined' !== typeof ( data.category ) ) { #>
<div class="generatepress-font-category">
<label>
<input name="{{{ data.category.id }}}" type="hidden" {{{ data.category.link }}} value="{{{ data.category.value }}}" class="gp-hidden-input" />
<# if ( '' !== data.category_title ) { #>
<p class="description">{{ data.category_title }}</p>
<# } #>
</label>
</div>
<# } #>
<div class="generatepress-weight-transform-wrapper">
<# if ( 'undefined' !== typeof ( data.weight ) ) { #>
<div class="generatepress-font-weight">
<label>
<select {{{ data.weight.link }}}>
<# _.each( data.weight.choices, function( label, choice ) { #>
<option value="{{ choice }}" <# if ( choice === data.weight.value ) { #> selected="selected" <# } #>>{{ label }}</option>
<# } ) #>
</select>
<# if ( '' !== data.weight_title ) { #>
<p class="description">{{ data.weight_title }}</p>
<# } #>
</label>
</div>
<# } #>
<# if ( 'undefined' !== typeof ( data.transform ) ) { #>
<div class="generatepress-font-transform">
<label>
<select {{{ data.transform.link }}}>
<# _.each( data.transform.choices, function( label, choice ) { #>
<option value="{{ choice }}" <# if ( choice === data.transform.value ) { #> selected="selected" <# } #>>{{ label }}</option>
<# } ) #>
</select>
<# if ( '' !== data.transform_title ) { #>
<p class="description">{{ data.transform_title }}</p>
<# } #>
</label>
</div>
<# } #>
</div>
<?php
}
/**
* Build font weight choices.
*/
public function get_font_weight_choices() {
return array(
'normal' => esc_html( 'normal' ),
'bold' => esc_html( 'bold' ),
'100' => esc_html( '100' ),
'200' => esc_html( '200' ),
'300' => esc_html( '300' ),
'400' => esc_html( '400' ),
'500' => esc_html( '500' ),
'600' => esc_html( '600' ),
'700' => esc_html( '700' ),
'800' => esc_html( '800' ),
'900' => esc_html( '900' ),
);
}
/**
* Build text transform choices.
*/
public function get_font_transform_choices() {
return array(
'none' => esc_html( 'none' ),
'capitalize' => esc_html( 'capitalize' ),
'uppercase' => esc_html( 'uppercase' ),
'lowercase' => esc_html( 'lowercase' ),
);
}
}
}

View File

@ -0,0 +1,80 @@
<?php
/**
* The upsell Customizer controll.
*
* @package GeneratePress
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
if ( class_exists( 'WP_Customize_Control' ) && ! class_exists( 'Generate_Customize_Misc_Control' ) ) {
/**
* Create our in-section upsell controls.
* Escape your URL in the Customizer using esc_url().
*
* @since 0.1
*/
class Generate_Customize_Misc_Control extends WP_Customize_Control {
/**
* Set description.
*
* @var public $description
*/
public $description = '';
/**
* Set URL.
*
* @var public $url
*/
public $url = '';
/**
* Set type.
*
* @var public $type
*/
public $type = 'addon';
/**
* Set label.
*
* @var public $label
*/
public $label = '';
/**
* Enqueue scripts.
*/
public function enqueue() {
wp_enqueue_style(
'generate-customizer-controls-css',
trailingslashit( get_template_directory_uri() ) . 'inc/customizer/controls/css/upsell-customizer.css',
array(),
GENERATE_VERSION
);
}
/**
* Send variables to json.
*/
public function to_json() {
parent::to_json();
$this->json['url'] = esc_url( $this->url );
}
/**
* Render content.
*/
public function content_template() {
?>
<p class="description" style="margin-top: 5px;">{{{ data.description }}}</p>
<span class="get-addon">
<a href="{{{ data.url }}}" class="button button-primary" target="_blank">{{ data.label }}</a>
</span>
<?php
}
}
}

View File

@ -0,0 +1,95 @@
<?php
/**
* The upsell Customizer section.
*
* @package GeneratePress
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
if ( class_exists( 'WP_Customize_Section' ) && ! class_exists( 'GeneratePress_Upsell_Section' ) ) {
/**
* Create our upsell section.
* Escape your URL in the Customizer using esc_url().
*
* @since unknown
*/
class GeneratePress_Upsell_Section extends WP_Customize_Section {
/**
* Set type.
*
* @var public $type
*/
public $type = 'gp-upsell-section';
/**
* Set pro URL.
*
* @var public $pro_url
*/
public $pro_url = '';
/**
* Set pro text.
*
* @var public $pro_text
*/
public $pro_text = '';
/**
* Set ID.
*
* @var public $id
*/
public $id = '';
/**
* Send variables to json.
*/
public function json() {
$json = parent::json();
$json['pro_text'] = $this->pro_text;
$json['pro_url'] = esc_url( $this->pro_url );
$json['id'] = $this->id;
return $json;
}
/**
* Render content.
*/
protected function render_template() {
?>
<li id="accordion-section-{{ data.id }}" class="generate-upsell-accordion-section control-section-{{ data.type }} cannot-expand accordion-section">
<h3><a href="{{{ data.pro_url }}}" target="_blank">{{ data.pro_text }}</a></h3>
</li>
<?php
}
}
}
if ( ! function_exists( 'generate_customizer_controls_css' ) ) {
add_action( 'customize_controls_enqueue_scripts', 'generate_customizer_controls_css' );
/**
* Add CSS for our controls
*
* @since 1.3.41
*/
function generate_customizer_controls_css() {
wp_enqueue_style(
'generate-customizer-controls-css',
trailingslashit( get_template_directory_uri() ) . 'inc/customizer/controls/css/upsell-customizer.css',
array(),
GENERATE_VERSION
);
wp_enqueue_script(
'generatepress-upsell',
trailingslashit( get_template_directory_uri() ) . 'inc/customizer/controls/js/upsell-control.js',
array( 'customize-controls' ),
GENERATE_VERSION,
true
);
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,142 @@
.customize-control-generatepress-range-slider .generatepress-slider {
position: relative;
width: calc(100% - 60px);
height: 6px;
background-color: rgba(0,0,0,.10);
cursor: pointer;
-webkit-transition: background .5s;
-moz-transition: background .5s;
transition: background .5s;
}
.customize-control-generatepress-range-slider .has-unit .generatepress-slider {
width: calc(100% - 90px);
}
.customize-control-generatepress-range-slider .gp_range_value.hide-value {
display: none;
}
.customize-control-generatepress-range-slider .gp_range_value.hide-value + .generatepress-slider {
width: 100%;
}
.customize-control-generatepress-range-slider .generatepress-slider .ui-slider-handle {
height: 16px;
width: 16px;
background-color: #3498D9;
display: inline-block;
position: absolute;
top: 50%;
-webkit-transform: translateY(-50%) translateX(-4px);
transform: translateY(-50%) translateX(-4px);
border-radius: 50%;
cursor: pointer;
}
.gp-range-title-area {
display: flex;
}
.gp-range-slider-controls {
margin-left: auto;
}
.customize-control-generatepress-range-slider .wrapper {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: justify;
-ms-flex-pack: justify;
justify-content: space-between;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
}
.customize-control-generatepress-range-slider .gp_range_value {
font-size: 14px;
padding: 0;
font-weight: 400;
width: 50px;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
}
.customize-control-generatepress-range-slider .has-unit .gp_range_value {
width: 80px;
}
.customize-control-generatepress-range-slider .gp_range_value span.value {
font-size: 12px;
width: calc(100% - 2px);
text-align: center;
min-height: 30px;
background: #FFF;
line-height: 30px;
border: 1px solid #DDD;
}
.customize-control-generatepress-range-slider .has-unit .gp_range_value span.value {
width: calc(100% - 32px);
display: block;
}
.customize-control-generatepress-range-slider .gp_range_value .unit {
width: 29px;
text-align: center;
font-size: 12px;
line-height: 30px;
background: #fff;
border: 1px solid #ddd;
margin-left: 1px;
}
.customize-control-generatepress-range-slider .generatepress-range-slider-reset span {
font-size: 16px;
line-height: 22px;
}
.customize-control-generatepress-range-slider .gp_range_value input {
font-size: 12px;
padding: 0px;
text-align: center;
min-height: 30px;
height: auto;
border-radius: 0;
border-color: #ddd;
}
.customize-control-generatepress-range-slider .has-unit .gp_range_value input {
width: calc(100% - 30px);
}
.customize-control-generatepress-range-slider .gp-range-title-area .dashicons {
cursor: pointer;
font-size: 11px;
width: 20px;
height: 20px;
line-height: 20px;
color: #222;
text-align: center;
position: relative;
top: 2px;
}
.customize-control-generatepress-range-slider .gp-range-title-area .dashicons:hover {
background: #fafafa;
}
.customize-control-generatepress-range-slider .gp-range-title-area .dashicons.selected {
background: #fff;
color: #222;
}
.customize-control-generatepress-range-slider .gp-device-controls > span:first-child:last-child {
display: none;
}
.customize-control-generatepress-range-slider .sub-description {
margin-top: 10px;
}

View File

@ -0,0 +1,47 @@
.generatepress-font-family {
margin-bottom: 12px;
}
.generatepress-weight-transform-wrapper {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: justify;
-ms-flex-pack: justify;
justify-content: space-between;
}
.generatepress-font-weight,
.generatepress-font-transform {
width: calc(50% - 5px);
}
span.select2-container.select2-container--default.select2-container--open li.select2-results__option {
margin:0;
}
span.select2-container.select2-container--default.select2-container--open{
z-index:999999;
}
.select2-selection__rendered li {
margin-bottom: 0;
}
.select2-container--default .select2-selection--single,
.select2-container--default.select2-container .select2-selection--multiple,
.select2-dropdown,
.select2-container--default .select2-selection--multiple .select2-selection__choice {
border-color: #ddd;
border-radius: 0;
}
.select2-container--default .select2-results__option[aria-selected=true] {
color: rgba(0,0,0,0.4);
}
#customize-control-font_heading_1_control,
#customize-control-font_heading_2_control,
#customize-control-font_heading_3_control {
margin-top: 20px;
}

View File

@ -0,0 +1,54 @@
.customize-control-addon:before {
content: "";
height: 1px;
width: 50px;
background: rgba(0,0,0,.10);
display: block;
margin-bottom: 10px;
}
.customize-control-addon {
margin-top: 10px;
}
li#accordion-section-generatepress_upsell_section {
border-top: 1px solid #D54E21;
border-bottom: 1px solid #D54E21;
}
.generate-upsell-accordion-section a {
background: #FFF;
display: block;
padding: 10px 10px 11px 14px;
line-height: 21px;
color: #D54E21;
text-decoration: none;
}
.generate-upsell-accordion-section a:hover {
background:#FAFAFA;
}
.generate-upsell-accordion-section h3 {
margin: 0;
position: relative;
}
.generate-upsell-accordion-section h3 a:after {
content: "\f345";
color: #D54E21;
position: absolute;
top: 11px;
right: 10px;
z-index: 1;
float: right;
border: none;
background: none;
font: normal 20px/1 dashicons;
speak: never;
display: block;
padding: 0;
text-indent: 0;
text-align: center;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

View File

@ -0,0 +1,297 @@
( function( api ) {
'use strict';
// Add callback for when the header_textcolor setting exists.
api( 'generate_settings[nav_position_setting]', function( setting ) {
var isNavFloated, isNavAlignable, setNavDropPointActiveState, setNavAlignmentsActiveState;
/**
* Determine whether the navigation is floating.
*
* @returns {boolean} Is floating?
*/
isNavFloated = function() {
if ( 'nav-float-right' === setting.get() || 'nav-float-left' === setting.get() ) {
return true;
}
return false;
};
/**
* Determine whether the navigation is align-able.
*
* @returns {boolean} Is floating?
*/
isNavAlignable = function() {
if ( 'nav-float-right' === setting.get() || 'nav-float-left' === setting.get() ) {
var navAsHeader = api.instance( 'generate_menu_plus_settings[navigation_as_header]' );
if ( navAsHeader && navAsHeader.get() ) {
return true;
}
return false;
}
return true;
};
/**
* Update a control's active state according to the navigation location setting's value.
*
* @param {wp.customize.Control} control
*/
setNavDropPointActiveState = function( control ) {
var setActiveState = function() {
control.active.set( isNavFloated() );
};
// FYI: With the following we can eliminate all of our PHP active_callback code.
control.active.validate = isNavFloated;
// Set initial active state.
setActiveState();
/*
* Update activate state whenever the setting is changed.
* Even when the setting does have a refresh transport where the
* server-side active callback will manage the active state upon
* refresh, having this JS management of the active state will
* ensure that controls will have their visibility toggled
* immediately instead of waiting for the preview to load.
* This is especially important if the setting has a postMessage
* transport where changing the setting wouldn't normally cause
* the preview to refresh and thus the server-side active_callbacks
* would not get invoked.
*/
setting.bind( setActiveState );
};
/**
* Update a control's active state according to the navigation location setting's value.
*
* @param {wp.customize.Control} control
*/
setNavAlignmentsActiveState = function( control ) {
var setActiveState = function() {
control.active.set( isNavAlignable() );
};
// FYI: With the following we can eliminate all of our PHP active_callback code.
control.active.validate = isNavAlignable;
// Set initial active state.
setActiveState();
/*
* Update activate state whenever the setting is changed.
* Even when the setting does have a refresh transport where the
* server-side active callback will manage the active state upon
* refresh, having this JS management of the active state will
* ensure that controls will have their visibility toggled
* immediately instead of waiting for the preview to load.
* This is especially important if the setting has a postMessage
* transport where changing the setting wouldn't normally cause
* the preview to refresh and thus the server-side active_callbacks
* would not get invoked.
*/
setting.bind( setActiveState );
};
api.control( 'generate_settings[nav_drop_point]', setNavDropPointActiveState );
api.control( 'generate_settings[nav_layout_setting]', setNavAlignmentsActiveState );
api.control( 'generate_settings[nav_inner_width]', setNavAlignmentsActiveState );
api.control( 'generate_settings[nav_alignment_setting]', setNavAlignmentsActiveState );
} );
var setOption = function( options ) {
if ( options.headerAlignment ) {
api.instance( 'generate_settings[header_alignment_setting]' ).set( options.headerAlignment );
}
if ( options.navLocation ) {
api.instance( 'generate_settings[nav_position_setting]' ).set( options.navLocation );
}
if ( options.navAlignment ) {
api.instance( 'generate_settings[nav_alignment_setting]' ).set( options.navAlignment );
}
if ( options.boxAlignment ) {
api.instance( 'generate_settings[container_alignment]' ).set( options.boxAlignment );
}
if ( options.siteTitleFontSize ) {
api.instance( 'generate_settings[site_title_font_size]' ).set( options.siteTitleFontSize );
}
if ( 'undefined' !== typeof options.hideSiteTagline ) {
api.instance( 'generate_settings[hide_tagline]' ).set( options.hideSiteTagline );
}
if ( options.headerPaddingTop ) {
api.instance( 'generate_spacing_settings[header_top]' ).set( options.headerPaddingTop );
}
if ( options.headerPaddingBottom ) {
api.instance( 'generate_spacing_settings[header_bottom]' ).set( options.headerPaddingBottom );
}
};
api( 'generate_header_helper', function( value ) {
var headerAlignment = false,
navLocation = false,
navAlignment = false,
boxAlignment = false,
siteTitleFontSize = false,
hideSiteTagline = false,
headerPaddingTop = false,
headerPaddingBottom = false;
value.bind( function( newval ) {
var headerAlignmentSetting = api.instance( 'generate_settings[header_alignment_setting]' );
var navLocationSetting = api.instance( 'generate_settings[nav_position_setting]' );
var navAlignmentSetting = api.instance( 'generate_settings[nav_alignment_setting]' );
var boxAlignmentSetting = api.instance( 'generate_settings[container_alignment]' );
var siteTitleFontSizeSetting = api.instance( 'generate_settings[site_title_font_size]' );
var hideSiteTaglineSetting = api.instance( 'generate_settings[hide_tagline]' );
var headerPaddingTopSetting = api.instance( 'generate_spacing_settings[header_top]' );
var headerPaddingBottomSetting = api.instance( 'generate_spacing_settings[header_bottom]' );
if ( ! headerAlignmentSetting._dirty ) {
headerAlignment = headerAlignmentSetting.get();
}
if ( ! navLocationSetting._dirty ) {
navLocation = navLocationSetting.get();
}
if ( ! navAlignmentSetting._dirty ) {
navAlignment = navAlignmentSetting.get();
}
if ( ! boxAlignmentSetting._dirty ) {
boxAlignment = boxAlignmentSetting.get();
}
if ( ! siteTitleFontSizeSetting._dirty ) {
siteTitleFontSize = siteTitleFontSizeSetting.get();
}
if ( ! hideSiteTaglineSetting._dirty ) {
hideSiteTagline = hideSiteTaglineSetting.get();
}
if ( ! headerPaddingTopSetting._dirty ) {
headerPaddingTop = headerPaddingTopSetting.get();
}
if ( ! headerPaddingBottomSetting._dirty ) {
headerPaddingBottom = headerPaddingBottomSetting.get();
}
var options = {
headerAlignment: generatepress_defaults.header_alignment_setting,
navLocation: generatepress_defaults.nav_position_setting,
navAlignment: generatepress_defaults.nav_alignment_setting,
boxAlignment: generatepress_defaults.container_alignment,
siteTitleFontSize: generatepress_typography_defaults.site_title_font_size,
hideSiteTagline: generatepress_defaults.hide_tagline,
headerPaddingTop: generatepress_spacing_defaults.header_top,
headerPaddingBottom: generatepress_spacing_defaults.header_bottom,
};
if ( 'current' === newval ) {
options = {
headerAlignment: headerAlignment,
navLocation: navLocation,
navAlignment: navAlignment,
boxAlignment: boxAlignment,
siteTitleFontSize: siteTitleFontSize,
hideSiteTagline: hideSiteTagline,
headerPaddingTop: headerPaddingTop,
headerPaddingBottom: headerPaddingBottom,
};
setOption( options );
}
if ( 'default' === newval ) {
setOption( options );
}
if ( 'classic' === newval ) {
var options = {
headerAlignment: 'left',
navLocation: 'nav-below-header',
navAlignment: 'left',
boxAlignment: 'boxes',
siteTitleFontSize: '45',
hideSiteTagline: '',
headerPaddingTop: '40',
headerPaddingBottom: '40',
};
setOption( options );
}
if ( 'nav-before' === newval ) {
options['headerAlignment'] = 'left';
options['navLocation'] = 'nav-above-header';
options['navAlignment'] = 'left';
setOption( options );
}
if ( 'nav-after' === newval ) {
options['headerAlignment'] = 'left';
options['navLocation'] = 'nav-below-header';
options['navAlignment'] = 'left';
setOption( options );
}
if ( 'nav-before-centered' === newval ) {
options['headerAlignment'] = 'center';
options['navLocation'] = 'nav-above-header';
options['navAlignment'] = 'center';
setOption( options );
}
if ( 'nav-after-centered' === newval ) {
options['headerAlignment'] = 'center';
options['navLocation'] = 'nav-below-header';
options['navAlignment'] = 'center';
setOption( options );
}
if ( 'nav-left' === newval ) {
options['headerAlignment'] = 'left';
options['navLocation'] = 'nav-float-left';
options['navAlignment'] = 'right';
setOption( options );
}
} );
} );
api( 'generate_settings[use_dynamic_typography]', function( value ) {
var fontManager = api.control( 'generate_settings[font_manager]' );
var typographyManager = api.control( 'generate_settings[typography]' );
value.bind( function( newval ) {
if ( newval ) {
if ( fontManager.setting.get().length === 0 ) {
fontManager.setting.set( generatepressCustomizeControls.mappedTypographyData.fonts );
}
if ( typographyManager.setting.get().length === 0 ) {
typographyManager.setting.set( generatepressCustomizeControls.mappedTypographyData.typography );
}
}
} );
} );
}( wp.customize ) );

View File

@ -0,0 +1,522 @@
/**
* Theme Customizer enhancements for a better user experience.
*
* Contains handlers to make Theme Customizer preview reload changes asynchronously.
*
* @param id
* @param selector
* @param property
* @param default_value
* @param get_value
*/
function generatepress_colors_live_update( id, selector, property, default_value, get_value ) {
default_value = typeof default_value !== 'undefined' ? default_value : 'initial';
get_value = typeof get_value !== 'undefined' ? get_value : '';
wp.customize( 'generate_settings[' + id + ']', function( value ) {
value.bind( function( newval ) {
default_value = ( '' !== get_value ) ? wp.customize.value( 'generate_settings[' + get_value + ']' )() : default_value;
newval = ( '' !== newval ) ? newval : default_value;
if ( jQuery( 'style#' + id ).length ) {
jQuery( 'style#' + id ).html( selector + '{' + property + ':' + newval + ';}' );
} else {
jQuery( 'head' ).append( '<style id="' + id + '">' + selector + '{' + property + ':' + newval + '}</style>' );
setTimeout( function() {
jQuery( 'style#' + id ).not( ':last' ).remove();
}, 1000 );
}
} );
} );
}
function generatepress_classes_live_update( id, classes, selector, prefix ) {
classes = typeof classes !== 'undefined' ? classes : '';
prefix = typeof prefix !== 'undefined' ? prefix : '';
wp.customize( 'generate_settings[' + id + ']', function( value ) {
value.bind( function( newval ) {
jQuery.each( classes, function( i, v ) {
jQuery( selector ).removeClass( prefix + v );
} );
jQuery( selector ).addClass( prefix + newval );
} );
} );
}
function generatepress_typography_live_update( id, selector, property, unit, media, settings ) {
settings = typeof settings !== 'undefined' ? settings : 'generate_settings';
wp.customize( settings + '[' + id + ']', function( value ) {
value.bind( function( newval ) {
// Get our unit if applicable
unit = typeof unit !== 'undefined' ? unit : '';
var isTablet = ( 'tablet' == id.substring( 0, 6 ) ) ? true : false,
isMobile = ( 'mobile' == id.substring( 0, 6 ) ) ? true : false;
if ( isTablet ) {
if ( '' == wp.customize( settings + '[' + id + ']' ).get() ) {
var desktopID = id.replace( 'tablet_', '' );
newval = wp.customize( settings + '[' + desktopID + ']' ).get();
}
}
if ( isMobile ) {
if ( '' == wp.customize( settings + '[' + id + ']' ).get() ) {
var desktopID = id.replace( 'mobile_', '' );
newval = wp.customize( settings + '[' + desktopID + ']' ).get();
}
}
if ( 'buttons_font_size' == id && '' == wp.customize( 'generate_settings[buttons_font_size]' ).get() ) {
newval = wp.customize( 'generate_settings[body_font_size]' ).get();
}
// We're using a desktop value
if ( ! isTablet && ! isMobile ) {
var tabletValue = ( typeof wp.customize( settings + '[tablet_' + id + ']' ) !== 'undefined' ) ? wp.customize( settings + '[tablet_' + id + ']' ).get() : '',
mobileValue = ( typeof wp.customize( settings + '[mobile_' + id + ']' ) !== 'undefined' ) ? wp.customize( settings + '[mobile_' + id + ']' ).get() : '';
// The tablet setting exists, mobile doesn't
if ( '' !== tabletValue && '' == mobileValue ) {
media = generatepress_live_preview.desktop + ', ' + generatepress_live_preview.mobile;
}
// The tablet setting doesn't exist, mobile does
if ( '' == tabletValue && '' !== mobileValue ) {
media = generatepress_live_preview.desktop + ', ' + generatepress_live_preview.tablet;
}
// The tablet setting doesn't exist, neither does mobile
if ( '' == tabletValue && '' == mobileValue ) {
media = generatepress_live_preview.desktop + ', ' + generatepress_live_preview.tablet + ', ' + generatepress_live_preview.mobile;
}
}
// Check if media query
media_query = typeof media !== 'undefined' ? 'media="' + media + '"' : '';
jQuery( 'head' ).append( '<style id="' + id + '" ' + media_query + '>' + selector + '{' + property + ':' + newval + unit + ';}</style>' );
setTimeout( function() {
jQuery( 'style#' + id ).not( ':last' ).remove();
}, 1000 );
setTimeout( "jQuery('body').trigger('generate_spacing_updated');", 1000 );
} );
} );
}
( function( $ ) {
// Update the site title in real time...
wp.customize( 'blogname', function( value ) {
value.bind( function( newval ) {
$( '.main-title a' ).html( newval );
} );
} );
//Update the site description in real time...
wp.customize( 'blogdescription', function( value ) {
value.bind( function( newval ) {
$( '.site-description' ).html( newval );
} );
} );
wp.customize( 'generate_settings[logo_width]', function( value ) {
value.bind( function( newval ) {
$( '.site-header .header-image' ).css( 'width', newval + 'px' );
if ( '' == newval ) {
$( '.site-header .header-image' ).css( 'width', '' );
}
} );
} );
/**
* Container width
*/
wp.customize( 'generate_settings[container_width]', function( value ) {
value.bind( function( newval ) {
if ( jQuery( 'style#container_width' ).length ) {
jQuery( 'style#container_width' ).html( 'body .grid-container, .wp-block-group__inner-container{max-width:' + newval + 'px;}' );
} else {
jQuery( 'head' ).append( '<style id="container_width">body .grid-container, .wp-block-group__inner-container{max-width:' + newval + 'px;}</style>' );
setTimeout( function() {
jQuery( 'style#container_width' ).not( ':last' ).remove();
}, 100 );
}
jQuery( 'body' ).trigger( 'generate_spacing_updated' );
} );
} );
/**
* Live update for typography options.
* We only want to run this if GP Premium isn't already doing it.
*/
if ( 'undefined' === typeof gp_premium_typography_live_update ) {
/**
* Body font size, weight and transform
*/
generatepress_typography_live_update( 'body_font_size', 'body, button, input, select, textarea', 'font-size', 'px' );
generatepress_typography_live_update( 'body_line_height', 'body', 'line-height', '' );
generatepress_typography_live_update( 'paragraph_margin', 'p, .entry-content > [class*="wp-block-"]:not(:last-child)', 'margin-bottom', 'em' );
generatepress_typography_live_update( 'body_font_weight', 'body, button, input, select, textarea', 'font-weight' );
generatepress_typography_live_update( 'body_font_transform', 'body, button, input, select, textarea', 'text-transform' );
/**
* H1 font size, weight and transform
*/
generatepress_typography_live_update( 'heading_1_font_size', 'h1', 'font-size', 'px', generatepress_live_preview.desktop );
generatepress_typography_live_update( 'mobile_heading_1_font_size', 'h1', 'font-size', 'px', generatepress_live_preview.mobile );
generatepress_typography_live_update( 'heading_1_weight', 'h1', 'font-weight' );
generatepress_typography_live_update( 'heading_1_transform', 'h1', 'text-transform' );
generatepress_typography_live_update( 'heading_1_line_height', 'h1', 'line-height', 'em' );
/**
* H2 font size, weight and transform
*/
generatepress_typography_live_update( 'heading_2_font_size', 'h2', 'font-size', 'px', generatepress_live_preview.desktop );
generatepress_typography_live_update( 'mobile_heading_2_font_size', 'h2', 'font-size', 'px', generatepress_live_preview.mobile );
generatepress_typography_live_update( 'heading_2_weight', 'h2', 'font-weight' );
generatepress_typography_live_update( 'heading_2_transform', 'h2', 'text-transform' );
generatepress_typography_live_update( 'heading_2_line_height', 'h2', 'line-height', 'em' );
/**
* H3 font size, weight and transform
*/
generatepress_typography_live_update( 'heading_3_font_size', 'h3', 'font-size', 'px' );
generatepress_typography_live_update( 'heading_3_weight', 'h3', 'font-weight' );
generatepress_typography_live_update( 'heading_3_transform', 'h3', 'text-transform' );
generatepress_typography_live_update( 'heading_3_line_height', 'h3', 'line-height', 'em' );
}
/**
* Top bar width
*/
wp.customize( 'generate_settings[top_bar_width]', function( value ) {
value.bind( function( newval ) {
if ( 'full' == newval ) {
$( '.top-bar' ).removeClass( 'grid-container' ).removeClass( 'grid-parent' );
if ( 'contained' == wp.customize.value( 'generate_settings[top_bar_inner_width]' )() ) {
$( '.inside-top-bar' ).addClass( 'grid-container' ).addClass( 'grid-parent' );
}
}
if ( 'contained' == newval ) {
$( '.top-bar' ).addClass( 'grid-container' ).addClass( 'grid-parent' );
$( '.inside-top-bar' ).removeClass( 'grid-container' ).removeClass( 'grid-parent' );
}
} );
} );
/**
* Inner top bar width
*/
wp.customize( 'generate_settings[top_bar_inner_width]', function( value ) {
value.bind( function( newval ) {
if ( 'full' == newval ) {
$( '.inside-top-bar' ).removeClass( 'grid-container' ).removeClass( 'grid-parent' );
}
if ( 'contained' == newval ) {
$( '.inside-top-bar' ).addClass( 'grid-container' ).addClass( 'grid-parent' );
}
} );
} );
/**
* Top bar alignment
*/
generatepress_classes_live_update( 'top_bar_alignment', [ 'left', 'center', 'right' ], '.top-bar', 'top-bar-align-' );
/**
* Header layout
*/
wp.customize( 'generate_settings[header_layout_setting]', function( value ) {
value.bind( function( newval ) {
if ( 'fluid-header' == newval ) {
$( '.site-header' ).removeClass( 'grid-container' ).removeClass( 'grid-parent' );
if ( 'contained' == wp.customize.value( 'generate_settings[header_inner_width]' )() ) {
$( '.inside-header' ).addClass( 'grid-container' ).addClass( 'grid-parent' );
}
}
if ( 'contained-header' == newval ) {
$( '.site-header' ).addClass( 'grid-container' ).addClass( 'grid-parent' );
$( '.inside-header' ).removeClass( 'grid-container' ).removeClass( 'grid-parent' );
}
} );
} );
/**
* Inner Header layout
*/
wp.customize( 'generate_settings[header_inner_width]', function( value ) {
value.bind( function( newval ) {
if ( 'full-width' == newval ) {
$( '.inside-header' ).removeClass( 'grid-container' ).removeClass( 'grid-parent' );
}
if ( 'contained' == newval ) {
$( '.inside-header' ).addClass( 'grid-container' ).addClass( 'grid-parent' );
}
} );
} );
/**
* Header alignment
*/
generatepress_classes_live_update( 'header_alignment_setting', [ 'left', 'center', 'right' ], 'body', 'header-aligned-' );
/**
* Navigation width
*/
wp.customize( 'generate_settings[nav_layout_setting]', function( value ) {
value.bind( function( newval ) {
var navLocation = wp.customize.value( 'generate_settings[nav_position_setting]' )();
if ( $( 'body' ).hasClass( 'sticky-enabled' ) ) {
wp.customize.preview.send( 'refresh' );
} else {
var mainNavigation = $( '.main-navigation' );
if ( 'fluid-nav' == newval ) {
mainNavigation.removeClass( 'grid-container' ).removeClass( 'grid-parent' );
if ( 'full-width' !== wp.customize.value( 'generate_settings[nav_inner_width]' )() ) {
$( '.main-navigation .inside-navigation' ).addClass( 'grid-container' ).addClass( 'grid-parent' );
}
}
if ( 'contained-nav' == newval ) {
if ( ! mainNavigation.hasClass( 'has-branding' ) && generatepress_live_preview.isFlex && ( 'nav-float-right' === navLocation || 'nav-float-left' === navLocation ) ) {
return;
}
mainNavigation.addClass( 'grid-container' ).addClass( 'grid-parent' );
}
}
} );
} );
/**
* Inner navigation width
*/
wp.customize( 'generate_settings[nav_inner_width]', function( value ) {
value.bind( function( newval ) {
if ( 'full-width' == newval ) {
$( '.main-navigation .inside-navigation' ).removeClass( 'grid-container' ).removeClass( 'grid-parent' );
}
if ( 'contained' == newval ) {
$( '.main-navigation .inside-navigation' ).addClass( 'grid-container' ).addClass( 'grid-parent' );
}
} );
} );
/**
* Navigation alignment
*/
wp.customize( 'generate_settings[nav_alignment_setting]', function( value ) {
value.bind( function( newval ) {
var classes = [ 'left', 'center', 'right' ];
var selector = 'body';
var prefix = 'nav-aligned-';
if ( generatepress_live_preview.isFlex ) {
selector = '.main-navigation:not(.slideout-navigation)';
prefix = 'nav-align-';
}
jQuery.each( classes, function( i, v ) {
jQuery( selector ).removeClass( prefix + v );
} );
if ( generatepress_live_preview.isFlex && generatepress_live_preview.isRTL ) {
jQuery( selector ).addClass( prefix + newval );
} else if ( 'nav-align-left' !== prefix + newval ) {
jQuery( selector ).addClass( prefix + newval );
}
} );
} );
/**
* Footer width
*/
wp.customize( 'generate_settings[footer_layout_setting]', function( value ) {
value.bind( function( newval ) {
if ( 'fluid-footer' == newval ) {
$( '.site-footer' ).removeClass( 'grid-container' ).removeClass( 'grid-parent' );
}
if ( 'contained-footer' == newval ) {
$( '.site-footer' ).addClass( 'grid-container' ).addClass( 'grid-parent' );
}
} );
} );
/**
* Inner footer width
*/
wp.customize( 'generate_settings[footer_inner_width]', function( value ) {
value.bind( function( newval ) {
if ( 'full-width' == newval ) {
if ( $( '.footer-widgets-container' ).length ) {
$( '.footer-widgets-container' ).removeClass( 'grid-container' ).removeClass( 'grid-parent' );
} else {
$( '.inside-footer-widgets' ).removeClass( 'grid-container' ).removeClass( 'grid-parent' );
}
$( '.inside-site-info' ).removeClass( 'grid-container' ).removeClass( 'grid-parent' );
}
if ( 'contained' == newval ) {
if ( $( '.footer-widgets-container' ).length ) {
$( '.footer-widgets-container' ).addClass( 'grid-container' ).addClass( 'grid-parent' );
} else {
$( '.inside-footer-widgets' ).addClass( 'grid-container' ).addClass( 'grid-parent' );
}
$( '.inside-site-info' ).addClass( 'grid-container' ).addClass( 'grid-parent' );
}
} );
} );
/**
* Footer bar alignment
*/
generatepress_classes_live_update( 'footer_bar_alignment', [ 'left', 'center', 'right' ], '.site-footer', 'footer-bar-align-' );
jQuery( 'body' ).on( 'generate_spacing_updated', function() {
var containerAlignment = wp.customize( 'generate_settings[container_alignment]' ).get(),
containerWidth = wp.customize( 'generate_settings[container_width]' ).get(),
containerLayout = wp.customize( 'generate_settings[content_layout_setting]' ).get(),
contentLeft = generatepress_live_preview.contentLeft,
contentRight = generatepress_live_preview.contentRight;
if ( ! generatepress_live_preview.isFlex && 'text' === containerAlignment ) {
if ( typeof wp.customize( 'generate_spacing_settings[content_left]' ) !== 'undefined' ) {
contentLeft = wp.customize( 'generate_spacing_settings[content_left]' ).get();
}
if ( typeof wp.customize( 'generate_spacing_settings[content_right]' ) !== 'undefined' ) {
contentRight = wp.customize( 'generate_spacing_settings[content_right]' ).get();
}
var newContainerWidth = Number( containerWidth ) + Number( contentLeft ) + Number( contentRight );
if ( jQuery( 'style#wide_container_width' ).length ) {
jQuery( 'style#wide_container_width' ).html( 'body:not(.full-width-content) #page{max-width:' + newContainerWidth + 'px;}' );
} else {
jQuery( 'head' ).append( '<style id="wide_container_width">body:not(.full-width-content) #page{max-width:' + newContainerWidth + 'px;}</style>' );
setTimeout( function() {
jQuery( 'style#wide_container_width' ).not( ':last' ).remove();
}, 100 );
}
}
if ( generatepress_live_preview.isFlex && 'boxes' === containerAlignment ) {
var topBarPaddingLeft = jQuery( '.inside-top-bar' ).css( 'padding-left' ),
topBarPaddingRight = jQuery( '.inside-top-bar' ).css( 'padding-right' ),
headerPaddingLeft = jQuery( '.inside-header' ).css( 'padding-left' ),
headerPaddingRight = jQuery( '.inside-header' ).css( 'padding-right' ),
footerWidgetPaddingLeft = jQuery( '.footer-widgets-container' ).css( 'padding-left' ),
footerWidgetPaddingRight = jQuery( '.footer-widgets-container' ).css( 'padding-right' ),
footerBarPaddingLeft = jQuery( '.inside-footer-bar' ).css( 'padding-left' ),
footerBarPaddingRight = jQuery( '.inside-footer-bar' ).css( 'padding-right' );
if ( typeof wp.customize( 'generate_spacing_settings[top_bar_left]' ) !== 'undefined' ) {
topBarPaddingLeft = wp.customize( 'generate_spacing_settings[top_bar_left]' ).get() + 'px';
}
if ( typeof wp.customize( 'generate_spacing_settings[top_bar_right]' ) !== 'undefined' ) {
topBarPaddingRight = wp.customize( 'generate_spacing_settings[top_bar_right]' ).get() + 'px';
}
if ( typeof wp.customize( 'generate_spacing_settings[header_left]' ) !== 'undefined' ) {
headerPaddingLeft = wp.customize( 'generate_spacing_settings[header_left]' ).get() + 'px';
}
if ( typeof wp.customize( 'generate_spacing_settings[header_right]' ) !== 'undefined' ) {
headerPaddingRight = wp.customize( 'generate_spacing_settings[header_right]' ).get() + 'px';
}
if ( typeof wp.customize( 'generate_spacing_settings[footer_widget_container_left]' ) !== 'undefined' ) {
footerWidgetPaddingLeft = wp.customize( 'generate_spacing_settings[footer_widget_container_left]' ).get() + 'px';
}
if ( typeof wp.customize( 'generate_spacing_settings[footer_widget_container_right]' ) !== 'undefined' ) {
footerWidgetPaddingRight = wp.customize( 'generate_spacing_settings[footer_widget_container_right]' ).get() + 'px';
}
if ( typeof wp.customize( 'generate_spacing_settings[footer_left]' ) !== 'undefined' ) {
footerBarPaddingLeft = wp.customize( 'generate_spacing_settings[footer_left]' ).get() + 'px';
}
if ( typeof wp.customize( 'generate_spacing_settings[footer_right]' ) !== 'undefined' ) {
footerBarPaddingRight = wp.customize( 'generate_spacing_settings[footer_right]' ).get() + 'px';
}
var newTopBarWidth = parseFloat( containerWidth ) + parseFloat( topBarPaddingLeft ) + parseFloat( topBarPaddingRight ),
newHeaderWidth = parseFloat( containerWidth ) + parseFloat( headerPaddingLeft ) + parseFloat( headerPaddingRight ),
newFooterWidgetWidth = parseFloat( containerWidth ) + parseFloat( footerWidgetPaddingLeft ) + parseFloat( footerWidgetPaddingRight ),
newFooterBarWidth = parseFloat( containerWidth ) + parseFloat( footerBarPaddingLeft ) + parseFloat( footerBarPaddingRight );
if ( jQuery( 'style#box_sizing_widths' ).length ) {
jQuery( 'style#box_sizing_widths' ).html( '.inside-top-bar.grid-container{max-width:' + newTopBarWidth + 'px;}.inside-header.grid-container{max-width:' + newHeaderWidth + 'px;}.footer-widgets-container.grid-container{max-width:' + newFooterWidgetWidth + 'px;}.inside-site-info.grid-container{max-width:' + newFooterBarWidth + 'px;}' );
} else {
jQuery( 'head' ).append( '<style id="box_sizing_widths">.inside-top-bar.grid-container{max-width:' + newTopBarWidth + 'px;}.inside-header.grid-container{max-width:' + newHeaderWidth + 'px;}.footer-widgets-container.grid-container{max-width:' + newFooterWidgetWidth + 'px;}.inside-site-info.grid-container{max-width:' + newFooterBarWidth + 'px;}</style>' );
setTimeout( function() {
jQuery( 'style#box_sizing_widths' ).not( ':last' ).remove();
}, 100 );
}
}
if ( generatepress_live_preview.isFlex && 'text' === containerAlignment ) {
var headerPaddingLeft = jQuery( '.inside-header' ).css( 'padding-left' ),
headerPaddingRight = jQuery( '.inside-header' ).css( 'padding-right' ),
menuItemPadding = jQuery( '.main-navigation .main-nav ul li a' ).css( 'padding-left' ),
secondaryMenuItemPadding = jQuery( '.secondary-navigation .main-nav ul li a' ).css( 'padding-left' );
if ( typeof wp.customize( 'generate_spacing_settings[header_left]' ) !== 'undefined' ) {
headerPaddingLeft = wp.customize( 'generate_spacing_settings[header_left]' ).get() + 'px';
}
if ( typeof wp.customize( 'generate_spacing_settings[header_right]' ) !== 'undefined' ) {
headerPaddingRight = wp.customize( 'generate_spacing_settings[header_right]' ).get() + 'px';
}
if ( typeof wp.customize( 'generate_spacing_settings[menu_item]' ) !== 'undefined' ) {
menuItemPadding = wp.customize( 'generate_spacing_settings[menu_item]' ).get() + 'px';
}
if ( typeof wp.customize( 'generate_spacing_settings[secondary_menu_item]' ) !== 'undefined' ) {
secondaryMenuItemPadding = wp.customize( 'generate_spacing_settings[secondary_menu_item]' ).get() + 'px';
}
var newNavPaddingLeft = parseFloat( headerPaddingLeft ) - parseFloat( menuItemPadding ),
newNavPaddingRight = parseFloat( headerPaddingRight ) - parseFloat( menuItemPadding ),
newSecondaryNavPaddingLeft = parseFloat( headerPaddingLeft ) - parseFloat( secondaryMenuItemPadding ),
newSecondaryNavPaddingRight = parseFloat( headerPaddingRight ) - parseFloat( secondaryMenuItemPadding );
if ( jQuery( 'style#navigation_padding' ).length ) {
jQuery( 'style#navigation_padding' ).html( '.nav-below-header .main-navigation .inside-navigation.grid-container, .nav-above-header .main-navigation .inside-navigation.grid-container{padding: 0 ' + newNavPaddingRight + 'px 0 ' + newNavPaddingLeft + 'px;}' );
jQuery( 'style#secondary_navigation_padding' ).html( '.secondary-nav-below-header .secondary-navigation .inside-navigation.grid-container, .secondary-nav-above-header .secondary-navigation .inside-navigation.grid-container{padding: 0 ' + newSecondaryNavPaddingRight + 'px 0 ' + newSecondaryNavPaddingLeft + 'px;}' );
} else {
jQuery( 'head' ).append( '<style id="navigation_padding">.nav-below-header .main-navigation .inside-navigation.grid-container, .nav-above-header .main-navigation .inside-navigation.grid-container{padding: 0 ' + newNavPaddingRight + 'px 0 ' + newNavPaddingLeft + 'px;}</style>' );
jQuery( 'head' ).append( '<style id="secondary_navigation_padding">.secondary-nav-below-header .secondary-navigation .inside-navigation.grid-container, .secondary-nav-above-header .secondary-navigation .inside-navigation.grid-container{padding: 0 ' + newSecondaryNavPaddingRight + 'px 0 ' + newSecondaryNavPaddingLeft + 'px;}</style>' );
setTimeout( function() {
jQuery( 'style#navigation_padding' ).not( ':last' ).remove();
jQuery( 'style#secondary_navigation_padding' ).not( ':last' ).remove();
}, 100 );
}
}
} );
wp.customize( 'generate_settings[global_colors]', function( value ) {
value.bind( function( newval ) {
var globalColors = '';
newval.forEach( function( item ) {
globalColors += '--' + item.slug + ':' + item.color + ';';
} );
if ( $( 'style#global_colors' ).length ) {
$( 'style#global_colors' ).html( ':root{' + globalColors + '}' );
} else {
$( 'head' ).append( '<style id="global_colors">:root{' + globalColors + '}</style>' );
setTimeout( function() {
$( 'style#global_colors' ).not( ':last' ).remove();
}, 100 );
}
} );
} );
}( jQuery ) );

View File

@ -0,0 +1,341 @@
/* global gpPostMessageFields */
/* eslint max-depth: off */
var gpPostMessage = {
/**
* The fields.
*
* @since 1.0.0
*/
fields: {},
/**
* A collection of methods for the <style> tags.
*
* @since 1.0.0
*/
styleTag: {
/**
* Add a <style> tag in <head> if it doesn't already exist.
*
* @since 1.0.0
*
* @param {string} id - The field-ID.
*
* @return {void}
*/
add( id ) {
id = id.replace( /[^\w\s]/gi, '-' );
if ( null === document.getElementById( 'gp-postmessage-' + id ) || 'undefined' === typeof document.getElementById( 'gp-postmessage-' + id ) ) {
jQuery( 'head' ).append( '<style id="gp-postmessage-' + id + '"></style>' );
}
},
/**
* Add a <style> tag in <head> if it doesn't already exist,
* by calling the this.add method, and then add styles inside it.
*
* @since 1.0.0
*
* @param {string} id - The field-ID.
* @param {string} styles - The styles to add.
*
* @return {void}
*/
addData( id, styles ) {
id = id.replace( '[', '-' ).replace( ']', '' );
gpPostMessage.styleTag.add( id );
jQuery( '#gp-postmessage-' + id ).text( styles );
},
},
/**
* Common utilities.
*
* @since 1.0.0
*/
util: {
/**
* Processes the value and applies any replacements and/or additions.
*
* @since 1.0.0
*
* @param {Object} output - The output (js_vars) argument.
* @param {mixed} value - The value.
* @param {string} controlType - The control-type.
*
* @return {string|false} - Returns false if value is excluded, otherwise a string.
*/
processValue( output, value ) {
var self = this,
settings = window.parent.wp.customize.get(),
excluded = false;
if ( 'object' === typeof value ) {
_.each( value, function( subValue, key ) {
value[ key ] = self.processValue( output, subValue );
} );
return value;
}
output = _.defaults( output, {
prefix: '',
units: '',
suffix: '',
value_pattern: '$',
pattern_replace: {},
exclude: [],
} );
if ( 1 <= output.exclude.length ) {
_.each( output.exclude, function( exclusion ) {
if ( value == exclusion ) {
excluded = true;
}
} );
}
if ( excluded ) {
return false;
}
value = output.value_pattern.replace( new RegExp( '\\$', 'g' ), value );
_.each( output.pattern_replace, function( id, placeholder ) {
if ( ! _.isUndefined( settings[ id ] ) ) {
value = value.replace( placeholder, settings[ id ] );
}
} );
return output.prefix + value + output.units + output.suffix;
},
/**
* Make sure urls are properly formatted for background-image properties.
*
* @since 1.0.0
*
* @param {string} url - The URL.
*
* @return {string} - Returns the URL.
*/
backgroundImageValue( url ) {
return ( -1 === url.indexOf( 'url(' ) ) ? 'url(' + url + ')' : url;
},
},
/**
* A collection of utilities for CSS generation.
*
* @since 1.0.0
*/
css: {
/**
* Generates the CSS from the output (js_vars) parameter.
*
* @since 1.0.0
*
* @param {Object} output - The output (js_vars) argument.
* @param {mixed} value - The value.
* @param {string} controlType - The control-type.
*
* @return {string} - Returns CSS as a string.
*/
fromOutput( output, value, controlType ) {
var styles = '',
mediaQuery = false,
processedValue;
try {
value = JSON.parse( value );
} catch ( e ) {} // eslint-disable-line no-empty
if ( output.js_callback && 'function' === typeof window[ output.js_callback ] ) {
value = window[ output.js_callback[ 0 ] ]( value, output.js_callback[ 1 ] );
}
// Apply the gpPostMessageStylesOutput filter.
styles = wp.hooks.applyFilters( 'gpPostMessageStylesOutput', styles, value, output, controlType );
if ( '' === styles ) {
switch ( controlType ) {
case 'kirki-multicolor':
case 'kirki-sortable':
styles += output.element + '{';
_.each( value, function( val, key ) {
if ( output.choice && key !== output.choice ) {
return;
}
processedValue = gpPostMessage.util.processValue( output, val );
if ( '' === processedValue ) {
if ( 'background-color' === output.property ) {
processedValue = 'unset';
} else if ( 'background-image' === output.property ) {
processedValue = 'none';
}
}
if ( false !== processedValue ) {
styles += output.property ? output.property + '-' + key + ':' + processedValue + ';' : key + ':' + processedValue + ';';
}
} );
styles += '}';
break;
default:
if ( 'kirki-image' === controlType ) {
value = ( ! _.isUndefined( value.url ) ) ? gpPostMessage.util.backgroundImageValue( value.url ) : gpPostMessage.util.backgroundImageValue( value );
}
if ( _.isObject( value ) ) {
styles += output.element + '{';
_.each( value, function( val, key ) {
var property;
if ( output.choice && key !== output.choice ) {
return;
}
processedValue = gpPostMessage.util.processValue( output, val );
property = output.property ? output.property : key;
if ( '' === processedValue ) {
if ( 'background-color' === property ) {
processedValue = 'unset';
} else if ( 'background-image' === property ) {
processedValue = 'none';
}
}
if ( false !== processedValue ) {
styles += property + ':' + processedValue + ';';
}
} );
styles += '}';
} else {
processedValue = gpPostMessage.util.processValue( output, value );
if ( '' === processedValue ) {
if ( 'background-color' === output.property ) {
processedValue = 'unset';
} else if ( 'background-image' === output.property ) {
processedValue = 'none';
}
}
if ( false !== processedValue ) {
styles += output.element + '{' + output.property + ':' + processedValue + ';}';
}
}
break;
}
}
// Get the media-query.
if ( output.media_query && 'string' === typeof output.media_query && ! _.isEmpty( output.media_query ) ) {
mediaQuery = output.media_query;
if ( -1 === mediaQuery.indexOf( '@media' ) ) {
mediaQuery = '@media ' + mediaQuery;
}
}
// If we have a media-query, add it and return.
if ( mediaQuery ) {
return mediaQuery + '{' + styles + '}';
}
// Return the styles.
return styles;
},
},
/**
* A collection of utilities to change the HTML in the document.
*
* @since 1.0.0
*/
html: {
/**
* Modifies the HTML from the output (js_vars) parameter.
*
* @since 1.0.0
*
* @param {Object} output - The output (js_vars) argument.
* @param {mixed} value - The value.
*
* @return {void}
*/
fromOutput( output, value ) {
if ( output.js_callback && 'function' === typeof window[ output.js_callback ] ) {
value = window[ output.js_callback[ 0 ] ]( value, output.js_callback[ 1 ] );
}
if ( _.isObject( value ) || _.isArray( value ) ) {
if ( ! output.choice ) {
return;
}
_.each( value, function( val, key ) {
if ( output.choice && key !== output.choice ) {
return;
}
value = val;
} );
}
value = gpPostMessage.util.processValue( output, value );
if ( output.attr ) {
jQuery( output.element ).attr( output.attr, value );
} else {
jQuery( output.element ).html( value );
}
},
},
/**
* A collection of utilities to allow toggling a CSS class.
*
* @since 1.0.0
*/
toggleClass: {
/**
* Toggles a CSS class from the output (js_vars) parameter.
*
* @since 1.0.0
*
* @param {Object} output - The output (js_vars) argument.
* @param {mixed} value - The value.
*
* @return {void}
*/
fromOutput( output, value ) {
if ( 'undefined' === typeof output.class || 'undefined' === typeof output.value ) {
return;
}
if ( value === output.value && ! jQuery( output.element ).hasClass( output.class ) ) {
jQuery( output.element ).addClass( output.class );
} else {
jQuery( output.element ).removeClass( output.class );
}
},
},
};
jQuery( document ).ready( function() {
var styles;
_.each( gpPostMessageFields, function( field ) {
wp.customize( field.settings, function( value ) {
value.bind( function( newVal ) {
styles = '';
_.each( field.js_vars, function( output ) {
output.function = ( ! output.function || 'undefined' === typeof gpPostMessage[ output.function ] ) ? 'css' : output.function;
field.type = ( field.choices && field.choices.parent_type ) ? field.choices.parent_type : field.type;
if ( 'css' === output.function ) {
styles += gpPostMessage.css.fromOutput( output, newVal, field.type );
} else {
gpPostMessage[ output.function ].fromOutput( output, newVal, field.type );
}
} );
gpPostMessage.styleTag.addData( field.settings, styles );
} );
} );
} );
} );

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,134 @@
wp.customize.controlConstructor['generatepress-range-slider'] = wp.customize.Control.extend({
ready: function() {
'use strict';
var control = this,
value,
thisInput,
inputDefault,
changeAction,
controlClass = '.customize-control-generatepress-range-slider',
footerActions = jQuery( '#customize-footer-actions' );
// Set up the sliders
jQuery( '.generatepress-slider' ).each( function() {
var _this = jQuery( this );
var _input = _this.closest( 'label' ).find( 'input[type="number"]' );
var _text = _input.next( '.value' );
_this.slider({
value: _input.val(),
min: _this.data( 'min' ),
max: _this.data( 'max' ),
step: _this.data( 'step' ),
slide: function( event, ui ) {
_input.val( ui.value ).change();
_text.text( ui.value );
}
});
});
// Update the range value based on the input value
jQuery( controlClass + ' .gp_range_value input[type=number]' ).on( 'input', function() {
value = jQuery( this ).attr( 'value' );
if ( '' == value ) {
value = -1;
}
jQuery( this ).closest( 'label' ).find( '.generatepress-slider' ).slider( 'value', parseFloat(value)).change();
});
// Handle the reset button
jQuery( controlClass + ' .generatepress-reset' ).on( 'click', function() {
var icon = jQuery( this ),
visible_area = icon.closest( '.gp-range-title-area' ).next( '.gp-range-slider-areas' ).children( 'label:visible' ),
input = visible_area.find( 'input[type=number]' ),
slider_value = visible_area.find( '.generatepress-slider' ),
visual_value = visible_area.find( '.gp_range_value' ),
reset_value = input.attr( 'data-reset_value' );
input.val( reset_value ).change();
visual_value.find( 'input' ).val( reset_value );
visual_value.find( '.value' ).text( reset_value );
if ( '' == reset_value ) {
reset_value = -1;
}
slider_value.slider( 'value', parseFloat( reset_value ) );
});
// Figure out which device icon to make active on load
jQuery( controlClass + ' .generatepress-range-slider-control' ).each( function() {
var _this = jQuery( this );
_this.find( '.gp-device-controls' ).children( 'span:first-child' ).addClass( 'selected' );
_this.find( '.range-option-area:first-child' ).show();
});
// Do stuff when device icons are clicked
jQuery( controlClass + ' .gp-device-controls > span' ).on( 'click', function( event ) {
var device = jQuery( this ).data( 'option' );
jQuery( controlClass + ' .gp-device-controls span' ).each( function() {
var _this = jQuery( this );
if ( device == _this.attr( 'data-option' ) ) {
_this.addClass( 'selected' );
_this.siblings().removeClass( 'selected' );
}
});
jQuery( controlClass + ' .gp-range-slider-areas label' ).each( function() {
var _this = jQuery( this );
if ( device == _this.attr( 'data-option' ) ) {
_this.show();
_this.siblings().hide();
}
});
// Set the device we're currently viewing
wp.customize.previewedDevice.set( jQuery( event.currentTarget ).data( 'option' ) );
} );
// Set the selected devices in our control when the Customizer devices are clicked
footerActions.find( '.devices button' ).on( 'click', function() {
var device = jQuery( this ).data( 'device' );
jQuery( controlClass + ' .gp-device-controls span' ).each( function() {
var _this = jQuery( this );
if ( device == _this.attr( 'data-option' ) ) {
_this.addClass( 'selected' );
_this.siblings().removeClass( 'selected' );
}
});
jQuery( controlClass + ' .gp-range-slider-areas label' ).each( function() {
var _this = jQuery( this );
if ( device == _this.attr( 'data-option' ) ) {
_this.show();
_this.siblings().hide();
}
});
});
// Apply changes when desktop slider is changed
control.container.on( 'input change', '.desktop-range',
function() {
control.settings['desktop'].set( jQuery( this ).val() );
}
);
// Apply changes when tablet slider is changed
control.container.on( 'input change', '.tablet-range',
function() {
control.settings['tablet'].set( jQuery( this ).val() );
}
);
// Apply changes when mobile slider is changed
control.container.on( 'input change', '.mobile-range',
function() {
control.settings['mobile'].set( jQuery( this ).val() );
}
);
}
});

View File

@ -0,0 +1,154 @@
( function( api ) {
api.controlConstructor['gp-customizer-typography'] = api.Control.extend( {
ready: function() {
var control = this;
control.container.on( 'change', '.generatepress-font-family select',
function() {
var _this = jQuery( this ),
_value = _this.val(),
_categoryID = _this.attr( 'data-category' ),
_variantsID = _this.attr( 'data-variants' );
// Set our font family
control.settings['family'].set( _this.val() );
// Bail if our controls don't exist
if ( 'undefined' == typeof control.settings['category'] || 'undefined' == typeof control.settings['variant'] ) {
return;
}
setTimeout( function() {
// Send our request to the generate_get_all_google_fonts_ajax function
var response = jQuery.getJSON({
type: 'POST',
url: ajaxurl,
data: {
action: 'generate_get_all_google_fonts_ajax',
gp_customize_nonce: gp_customize.nonce
},
async: false,
dataType: 'json',
});
// Get our response
var fonts = response.responseJSON;
// Create an ID from our selected font
var id = _value.split(' ').join('_').toLowerCase();
// Set our values if we have them
if ( id in fonts ) {
// Get existing variants if this font is already selected
var got_variants = false;
jQuery( '.generatepress-font-family select' ).not( _this ).each( function( key, select ) {
var parent = jQuery( this ).closest( '.generatepress-font-family' );
if ( _value == jQuery( select ).val() && _this.data( 'category' ) !== jQuery( select ).data( 'category' ) ) {
if ( ! got_variants ) {
updated_variants = jQuery( parent.next( '.generatepress-font-variant' ).find( 'select' ) ).val();
got_variants = true;
}
}
} );
// We're using a Google font, so show the variants field
_this.closest( '.generatepress-font-family' ).next( 'div' ).show();
// Remove existing variants
jQuery( 'select[name="' + _variantsID + '"]' ).find( 'option' ).remove();
// Populate our select input with available variants
jQuery.each( fonts[ id ].variants, function( key, value ) {
jQuery( 'select[name="' + _variantsID + '"]' ).append( jQuery( '<option></option>' ).attr( 'value', value ).text( value ) );
} );
// Set our variants
if ( ! got_variants ) {
control.settings[ 'variant' ].set( fonts[ id ].variants );
} else {
control.settings[ 'variant' ].set( updated_variants );
}
// Set our font category
control.settings[ 'category' ].set( fonts[ id ].category );
jQuery( 'input[name="' + _categoryID + '"' ).val( fonts[ id ].category );
} else {
_this.closest( '.generatepress-font-family' ).next( 'div' ).hide();
control.settings[ 'category' ].set( '' )
control.settings[ 'variant' ].set( '' )
jQuery( 'input[name="' + _categoryID + '"' ).val( '' );
jQuery( 'select[name="' + _variantsID + '"]' ).find( 'option' ).remove();
}
}, 25 );
}
);
control.container.on( 'change', '.generatepress-font-variant select',
function() {
var _this = jQuery( this );
var variants = _this.val();
control.settings['variant'].set( variants );
jQuery( '.generatepress-font-variant select' ).each( function( key, value ) {
var this_control = jQuery( this ).closest( 'li' ).attr( 'id' ).replace( 'customize-control-', '' );
var parent = jQuery( this ).closest( '.generatepress-font-variant' );
var font_val = api.control( this_control ).settings['family'].get();
if ( font_val == control.settings['family'].get() && _this.attr( 'name' ) !== jQuery( value ).attr( 'name' ) ) {
jQuery( parent.find( 'select' ) ).not( _this ).val( variants ).triggerHandler( 'change' );
api.control( this_control ).settings['variant'].set( variants );
}
} );
}
);
control.container.on( 'change', '.generatepress-font-category input',
function() {
control.settings['category'].set( jQuery( this ).val() );
}
);
control.container.on( 'change', '.generatepress-font-weight select',
function() {
control.settings['weight'].set( jQuery( this ).val() );
}
);
control.container.on( 'change', '.generatepress-font-transform select',
function() {
control.settings['transform'].set( jQuery( this ).val() );
}
);
}
} );
} )( wp.customize );
jQuery( document ).ready( function( $ ) {
$( '.generatepress-font-family select' ).select2();
$( '.generatepress-font-variant' ).each( function( key, value ) {
var _this = $( this );
var value = _this.data( 'saved-value' );
if ( value ) {
value = value.toString().split( ',' );
}
_this.find( 'select' ).select2().val( value ).trigger( 'change.select2' );
} );
$( ".generatepress-font-family" ).each( function( key, value ) {
var _this = $( this );
if ( $.inArray( _this.find( 'select' ).val(), typography_defaults ) !== -1 ) {
_this.next( '.generatepress-font-variant' ).hide();
}
} );
} );

View File

@ -0,0 +1,12 @@
( function( $, api ) {
api.sectionConstructor['gp-upsell-section'] = api.Section.extend( {
// No events for this type of section.
attachEvents: function () {},
// Always make the section active.
isContextuallyActive: function () {
return true;
}
} );
} )( jQuery, wp.customize );

View File

@ -0,0 +1,28 @@
<?php
/**
* Load necessary Customizer controls and functions.
*
* @package GeneratePress
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
// Add fields.
require_once trailingslashit( dirname( __FILE__ ) ) . 'class-customize-field.php';
// Controls.
require_once trailingslashit( dirname( __FILE__ ) ) . 'controls/class-react-control.php';
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-upsell-section.php';
require_once trailingslashit( dirname( __FILE__ ) ) . 'controls/class-upsell-control.php';
require_once trailingslashit( dirname( __FILE__ ) ) . 'controls/class-deprecated.php';
// Helper functions.
require_once trailingslashit( dirname( __FILE__ ) ) . 'helpers.php';
// Deprecated.
require_once trailingslashit( dirname( __FILE__ ) ) . 'deprecated.php';

View File

@ -0,0 +1,133 @@
<?php
/**
* Where old Customizer functions retire.
*
* @package GeneratePress
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
if ( ! function_exists( 'generate_sanitize_typography' ) ) {
/**
* Sanitize typography dropdown.
*
* @since 1.1.10
* @deprecated 1.3.45
* @param string $input The value to check.
*/
function generate_sanitize_typography( $input ) {
// Grab all of our fonts.
$fonts = generate_get_all_google_fonts();
// Loop through all of them and grab their names.
$font_names = array();
foreach ( $fonts as $k => $fam ) {
$font_names[] = $fam['name'];
}
// Get all non-Google font names.
$not_google = generate_typography_default_fonts();
// Merge them both into one array.
$valid = array_merge( $font_names, $not_google );
// Sanitize.
if ( in_array( $input, $valid ) ) {
return $input;
} else {
return 'Open Sans';
}
}
}
if ( ! function_exists( 'generate_sanitize_font_weight' ) ) {
/**
* Sanitize font weight.
*
* @since 1.1.10
* @deprecated 1.3.40
* @param string $input The value to check.
*/
function generate_sanitize_font_weight( $input ) {
$valid = array(
'normal',
'bold',
'100',
'200',
'300',
'400',
'500',
'600',
'700',
'800',
'900',
);
if ( in_array( $input, $valid ) ) {
return $input;
} else {
return 'normal';
}
}
}
if ( ! function_exists( 'generate_sanitize_text_transform' ) ) {
/**
* Sanitize text transform.
*
* @since 1.1.10
* @deprecated 1.3.40
* @param string $input The value to check.
*/
function generate_sanitize_text_transform( $input ) {
$valid = array(
'none',
'capitalize',
'uppercase',
'lowercase',
);
if ( in_array( $input, $valid ) ) {
return $input;
} else {
return 'none';
}
}
}
if ( ! function_exists( 'generate_typography_customize_preview_css' ) ) {
/**
* Hide the hidden input control
*
* @since 1.3.40
*/
function generate_typography_customize_preview_css() {
?>
<style>
.customize-control-gp-hidden-input {display:none !important;}
</style>
<?php
}
}
if ( ! function_exists( 'generate_hidden_navigation' ) && function_exists( 'is_customize_preview' ) ) {
/**
* Adds a hidden navigation if no navigation is set
* This allows us to use postMessage to position the navigation when it doesn't exist
*
* @since 1.3.40
*/
function generate_hidden_navigation() {
if ( is_customize_preview() && function_exists( 'generate_navigation_position' ) ) {
?>
<div style="display:none;">
<?php generate_navigation_position(); ?>
</div>
<?php
}
}
}

Some files were not shown because too many files have changed in this diff Show More