summaryrefslogtreecommitdiff
path: root/inc/builder/type/footer/copyright
diff options
context:
space:
mode:
authorZach van Rijn <me@zv.io>2021-07-21 14:54:07 -0500
committerZach van Rijn <me@zv.io>2021-07-21 14:54:07 -0500
commit9d4123cee1867ee7199b06bdc92d40611f547ecc (patch)
tree6d864e2725242863afed1f8ba12d9c7a9bc63a69 /inc/builder/type/footer/copyright
downloadblog-ng-9d4123cee1867ee7199b06bdc92d40611f547ecc.tar.gz
blog-ng-9d4123cee1867ee7199b06bdc92d40611f547ecc.tar.bz2
blog-ng-9d4123cee1867ee7199b06bdc92d40611f547ecc.tar.xz
blog-ng-9d4123cee1867ee7199b06bdc92d40611f547ecc.zip
Initial unmodified import from Astra (Version: 3.6.5) @ /wp-content/themes/astra/.
Diffstat (limited to 'inc/builder/type/footer/copyright')
-rw-r--r--inc/builder/type/footer/copyright/assets/js/minified/customizer-preview.min.js1
-rw-r--r--inc/builder/type/footer/copyright/assets/js/unminified/customizer-preview.js98
-rw-r--r--inc/builder/type/footer/copyright/class-astra-footer-copyright-component-loader.php52
-rw-r--r--inc/builder/type/footer/copyright/class-astra-footer-copyright-component.php49
-rw-r--r--inc/builder/type/footer/copyright/dynamic-css/dynamic.css.php102
5 files changed, 302 insertions, 0 deletions
diff --git a/inc/builder/type/footer/copyright/assets/js/minified/customizer-preview.min.js b/inc/builder/type/footer/copyright/assets/js/minified/customizer-preview.min.js
new file mode 100644
index 0000000..8d1e5a6
--- /dev/null
+++ b/inc/builder/type/footer/copyright/assets/js/minified/customizer-preview.min.js
@@ -0,0 +1 @@
+!function(){var i=".ast-footer-copyright",e=astraBuilderPreview.tablet_break_point||768,a=astraBuilderPreview.mobile_break_point||544;astra_css("astra-settings[footer-copyright-color]","color",i),astra_responsive_font_size("astra-settings[font-size-section-footer-copyright]",i),wp.customize("astra-settings[footer-copyright-alignment]",function(t){t.bind(function(t){var o;""==t.desktop&&""==t.tablet&&""==t.mobile||(o="",o+=".ast-footer-copyright {",o+="text-align: "+t.desktop+";",o+="} ",o+="@media (max-width: "+e+"px) {",o+=".ast-footer-copyright {",o+="text-align: "+t.tablet+";",o+="} ",o+="} ",o+="@media (max-width: "+a+"px) {",o+=".ast-footer-copyright {",o+="text-align: "+t.mobile+";",o+="} ",o+="} ",astra_add_dynamic_css("footer-copyright-alignment",o))})}),wp.customize("astra-settings[section-footer-copyright-margin]",function(t){t.bind(function(t){var o;""==t.desktop.bottom&&""==t.desktop.top&&""==t.desktop.left&&""==t.desktop.right&&""==t.tablet.bottom&&""==t.tablet.top&&""==t.tablet.left&&""==t.tablet.right&&""==t.mobile.bottom&&""==t.mobile.top&&""==t.mobile.left&&""==t.mobile.right||(o="",o+=i+" {",o+="margin-left: "+t.desktop.left+t["desktop-unit"]+";",o+="margin-right: "+t.desktop.right+t["desktop-unit"]+";",o+="margin-top: "+t.desktop.top+t["desktop-unit"]+";",o+="margin-bottom: "+t.desktop.bottom+t["desktop-unit"]+";",o+="} ",o+="@media (max-width: "+e+"px) {",o+=i+" {",o+="margin-left: "+t.tablet.left+t["tablet-unit"]+";",o+="margin-right: "+t.tablet.right+t["tablet-unit"]+";",o+="margin-top: "+t.tablet.top+t["desktop-unit"]+";",o+="margin-bottom: "+t.tablet.bottom+t["desktop-unit"]+";",o+="} ",o+="} ",o+="@media (max-width: "+a+"px) {",o+=i+" {",o+="margin-left: "+t.mobile.left+t["mobile-unit"]+";",o+="margin-right: "+t.mobile.right+t["mobile-unit"]+";",o+="margin-top: "+t.mobile.top+t["desktop-unit"]+";",o+="margin-bottom: "+t.mobile.bottom+t["desktop-unit"]+";",o+="} ",o+="} ",astra_add_dynamic_css("footer-copyright-margin",o))})}),astra_builder_visibility_css("section-footer-copyright",".ast-footer-copyright.ast-builder-layout-element")}(jQuery); \ No newline at end of file
diff --git a/inc/builder/type/footer/copyright/assets/js/unminified/customizer-preview.js b/inc/builder/type/footer/copyright/assets/js/unminified/customizer-preview.js
new file mode 100644
index 0000000..4a70418
--- /dev/null
+++ b/inc/builder/type/footer/copyright/assets/js/unminified/customizer-preview.js
@@ -0,0 +1,98 @@
+/**
+ * This file adds some LIVE to the Customizer live preview. To leverage
+ * this, set your custom settings to 'postMessage' and then add your handling
+ * here. Your javascript should grab settings from customizer controls, and
+ * then make any necessary changes to the page using jQuery.
+ *
+ * @package Astra Builder
+ * @since 3.0.0
+ */
+
+( function( $ ) {
+
+ var selector = '.ast-footer-copyright';
+ var visibility_selector = '.ast-footer-copyright.ast-builder-layout-element';
+
+ var tablet_break_point = astraBuilderPreview.tablet_break_point || 768,
+ mobile_break_point = astraBuilderPreview.mobile_break_point || 544;
+
+ // HTML color.
+ astra_css(
+ 'astra-settings[footer-copyright-color]',
+ 'color',
+ selector
+ );
+
+ // Typography CSS Generation.
+ astra_responsive_font_size(
+ 'astra-settings[font-size-section-footer-copyright]',
+ selector
+ );
+
+ wp.customize( 'astra-settings[footer-copyright-alignment]', function( value ) {
+ value.bind( function( alignment ) {
+ if( alignment.desktop != '' || alignment.tablet != '' || alignment.mobile != '' ) {
+ var dynamicStyle = '';
+ dynamicStyle += '.ast-footer-copyright {';
+ dynamicStyle += 'text-align: ' + alignment['desktop'] + ';';
+ dynamicStyle += '} ';
+
+ dynamicStyle += '@media (max-width: ' + tablet_break_point + 'px) {';
+ dynamicStyle += '.ast-footer-copyright {';
+ dynamicStyle += 'text-align: ' + alignment['tablet'] + ';';
+ dynamicStyle += '} ';
+ dynamicStyle += '} ';
+
+ dynamicStyle += '@media (max-width: ' + mobile_break_point + 'px) {';
+ dynamicStyle += '.ast-footer-copyright {';
+ dynamicStyle += 'text-align: ' + alignment['mobile'] + ';';
+ dynamicStyle += '} ';
+ dynamicStyle += '} ';
+
+ astra_add_dynamic_css( 'footer-copyright-alignment', dynamicStyle );
+ }
+ } );
+ } );
+
+ // Margin.
+ wp.customize( 'astra-settings[section-footer-copyright-margin]', function( value ) {
+ value.bind( function( margin ) {
+ if(
+ margin.desktop.bottom != '' || margin.desktop.top != '' || margin.desktop.left != '' || margin.desktop.right != '' ||
+ margin.tablet.bottom != '' || margin.tablet.top != '' || margin.tablet.left != '' || margin.tablet.right != '' ||
+ margin.mobile.bottom != '' || margin.mobile.top != '' || margin.mobile.left != '' || margin.mobile.right != ''
+ ) {
+ var dynamicStyle = '';
+ dynamicStyle += selector + ' {';
+ dynamicStyle += 'margin-left: ' + margin['desktop']['left'] + margin['desktop-unit'] + ';';
+ dynamicStyle += 'margin-right: ' + margin['desktop']['right'] + margin['desktop-unit'] + ';';
+ dynamicStyle += 'margin-top: ' + margin['desktop']['top'] + margin['desktop-unit'] + ';';
+ dynamicStyle += 'margin-bottom: ' + margin['desktop']['bottom'] + margin['desktop-unit'] + ';';
+ dynamicStyle += '} ';
+
+ dynamicStyle += '@media (max-width: ' + tablet_break_point + 'px) {';
+ dynamicStyle += selector + ' {';
+ dynamicStyle += 'margin-left: ' + margin['tablet']['left'] + margin['tablet-unit'] + ';';
+ dynamicStyle += 'margin-right: ' + margin['tablet']['right'] + margin['tablet-unit'] + ';';
+ dynamicStyle += 'margin-top: ' + margin['tablet']['top'] + margin['desktop-unit'] + ';';
+ dynamicStyle += 'margin-bottom: ' + margin['tablet']['bottom'] + margin['desktop-unit'] + ';';
+ dynamicStyle += '} ';
+ dynamicStyle += '} ';
+
+ dynamicStyle += '@media (max-width: ' + mobile_break_point + 'px) {';
+ dynamicStyle += selector + ' {';
+ dynamicStyle += 'margin-left: ' + margin['mobile']['left'] + margin['mobile-unit'] + ';';
+ dynamicStyle += 'margin-right: ' + margin['mobile']['right'] + margin['mobile-unit'] + ';';
+ dynamicStyle += 'margin-top: ' + margin['mobile']['top'] + margin['desktop-unit'] + ';';
+ dynamicStyle += 'margin-bottom: ' + margin['mobile']['bottom'] + margin['desktop-unit'] + ';';
+ dynamicStyle += '} ';
+ dynamicStyle += '} ';
+ astra_add_dynamic_css( 'footer-copyright-margin', dynamicStyle );
+ }
+ } );
+ } );
+
+ // Advanced Visibility CSS Generation.
+ astra_builder_visibility_css( 'section-footer-copyright', visibility_selector );
+
+} )( jQuery );
diff --git a/inc/builder/type/footer/copyright/class-astra-footer-copyright-component-loader.php b/inc/builder/type/footer/copyright/class-astra-footer-copyright-component-loader.php
new file mode 100644
index 0000000..cf69a0f
--- /dev/null
+++ b/inc/builder/type/footer/copyright/class-astra-footer-copyright-component-loader.php
@@ -0,0 +1,52 @@
+<?php
+/**
+ * Copyright Styling Loader for Astra theme.
+ *
+ * @package Astra Builder
+ * @author Brainstorm Force
+ * @copyright Copyright (c) 2020, Brainstorm Force
+ * @link https://www.brainstormforce.com
+ * @since Astra 3.0.0
+ */
+
+if ( ! defined( 'ABSPATH' ) ) {
+ exit; // Exit if accessed directly.
+}
+
+/**
+ * Customizer Initialization
+ *
+ * @since 3.0.0
+ */
+class Astra_Footer_Copyright_Component_Loader {
+
+ /**
+ * Constructor
+ *
+ * @since 3.0.0
+ */
+ public function __construct() {
+ add_action( 'customize_preview_init', array( $this, 'preview_scripts' ), 110 );
+ }
+
+ /**
+ * Customizer Preview
+ *
+ * @since 3.0.0
+ */
+ public function preview_scripts() {
+ /**
+ * Load unminified if SCRIPT_DEBUG is true.
+ */
+ /* Directory and Extension */
+ $dir_name = ( SCRIPT_DEBUG ) ? 'unminified' : 'minified';
+ $file_prefix = ( SCRIPT_DEBUG ) ? '' : '.min';
+ wp_enqueue_script( 'astra-footer-copyright-customizer-preview-js', ASTRA_BUILDER_FOOTER_COPYRIGHT_URI . '/assets/js/' . $dir_name . '/customizer-preview' . $file_prefix . '.js', array( 'customize-preview', 'astra-customizer-preview-js' ), ASTRA_THEME_VERSION, true );
+
+ }
+}
+
+/**
+* Kicking this off by creating the object of the class.
+*/
+new Astra_Footer_Copyright_Component_Loader();
diff --git a/inc/builder/type/footer/copyright/class-astra-footer-copyright-component.php b/inc/builder/type/footer/copyright/class-astra-footer-copyright-component.php
new file mode 100644
index 0000000..1c03485
--- /dev/null
+++ b/inc/builder/type/footer/copyright/class-astra-footer-copyright-component.php
@@ -0,0 +1,49 @@
+<?php
+/**
+ * Copyright component.
+ *
+ * @package Astra Builder
+ * @author Brainstorm Force
+ * @copyright Copyright (c) 2020, Brainstorm Force
+ * @link https://www.brainstormforce.com
+ * @since Astra 3.0.0
+ */
+
+if ( ! defined( 'ABSPATH' ) ) {
+ exit; // Exit if accessed directly.
+}
+
+define( 'ASTRA_BUILDER_FOOTER_COPYRIGHT_DIR', ASTRA_THEME_DIR . 'inc/builder/type/footer/copyright' );
+define( 'ASTRA_BUILDER_FOOTER_COPYRIGHT_URI', ASTRA_THEME_URI . 'inc/builder/type/footer/copyright' );
+
+if ( ! class_exists( 'Astra_Footer_Copyright_Component' ) ) {
+
+ /**
+ * Astra_Footer_Copyright_Component
+ *
+ * @since 3.0.0
+ */
+ class Astra_Footer_Copyright_Component {
+
+ /**
+ * Constructor function that initializes required actions and hooks
+ */
+ public function __construct() {
+
+ // @codingStandardsIgnoreStart WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
+ require_once ASTRA_BUILDER_FOOTER_COPYRIGHT_DIR . '/class-astra-footer-copyright-component-loader.php';
+
+ // Include front end files.
+ if ( ! is_admin() ) {
+ require_once ASTRA_BUILDER_FOOTER_COPYRIGHT_DIR . '/dynamic-css/dynamic.css.php';
+ }
+ // @codingStandardsIgnoreEnd WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
+ }
+ }
+
+ /**
+ * Kicking this off by creating an object.
+ */
+ new Astra_Footer_Copyright_Component();
+
+}
diff --git a/inc/builder/type/footer/copyright/dynamic-css/dynamic.css.php b/inc/builder/type/footer/copyright/dynamic-css/dynamic.css.php
new file mode 100644
index 0000000..bd74c46
--- /dev/null
+++ b/inc/builder/type/footer/copyright/dynamic-css/dynamic.css.php
@@ -0,0 +1,102 @@
+<?php
+/**
+ * Copyright control - Dynamic CSS
+ *
+ * @package Astra Builder
+ * @since 3.0.0
+ */
+
+if ( ! defined( 'ABSPATH' ) ) {
+ exit; // Exit if accessed directly.
+}
+
+/**
+ * Copyright CSS
+ */
+add_filter( 'astra_dynamic_theme_css', 'astra_fb_copyright_dynamic_css' );
+
+/**
+ * Dynamic CSS
+ *
+ * @param string $dynamic_css Astra Dynamic CSS.
+ * @param string $dynamic_css_filtered Astra Dynamic CSS Filters.
+ * @return String Generated dynamic CSS for Heading Colors.
+ *
+ * @since 3.0.0
+ */
+function astra_fb_copyright_dynamic_css( $dynamic_css, $dynamic_css_filtered = '' ) {
+
+ if ( ! Astra_Builder_Helper::is_component_loaded( 'copyright', 'footer' ) ) {
+ return $dynamic_css;
+ }
+
+ $_section = 'section-footer-copyright';
+
+ $selector = '.ast-footer-copyright ';
+
+ $visibility_selector = '.ast-footer-copyright.ast-builder-layout-element';
+
+ $alignment = astra_get_option( 'footer-copyright-alignment' );
+
+ $desktop_alignment = ( isset( $alignment['desktop'] ) ) ? $alignment['desktop'] : '';
+ $tablet_alignment = ( isset( $alignment['tablet'] ) ) ? $alignment['tablet'] : '';
+ $mobile_alignment = ( isset( $alignment['mobile'] ) ) ? $alignment['mobile'] : '';
+
+ $margin = astra_get_option( $_section . '-margin' );
+
+ /**
+ * Copyright CSS.
+ */
+ $css_output_desktop = array(
+ '.ast-footer-copyright' => array(
+ 'text-align' => $desktop_alignment,
+ ),
+ $selector => array(
+ 'color' => astra_get_option( 'footer-copyright-color' ),
+ // Margin CSS.
+ 'margin-top' => astra_responsive_spacing( $margin, 'top', 'desktop' ),
+ 'margin-bottom' => astra_responsive_spacing( $margin, 'bottom', 'desktop' ),
+ 'margin-left' => astra_responsive_spacing( $margin, 'left', 'desktop' ),
+ 'margin-right' => astra_responsive_spacing( $margin, 'right', 'desktop' ),
+ ),
+ );
+
+ $css_output_tablet = array(
+ '.ast-footer-copyright' => array(
+ 'text-align' => $tablet_alignment,
+ ),
+ $selector => array(
+ // Margin CSS.
+ 'margin-top' => astra_responsive_spacing( $margin, 'top', 'tablet' ),
+ 'margin-bottom' => astra_responsive_spacing( $margin, 'bottom', 'tablet' ),
+ 'margin-left' => astra_responsive_spacing( $margin, 'left', 'tablet' ),
+ 'margin-right' => astra_responsive_spacing( $margin, 'right', 'tablet' ),
+ ),
+ );
+
+ $css_output_mobile = array(
+ '.ast-footer-copyright' => array(
+ 'text-align' => $mobile_alignment,
+ ),
+ $selector => array(
+ // Margin CSS.
+ 'margin-top' => astra_responsive_spacing( $margin, 'top', 'mobile' ),
+ 'margin-bottom' => astra_responsive_spacing( $margin, 'bottom', 'mobile' ),
+ 'margin-left' => astra_responsive_spacing( $margin, 'left', 'mobile' ),
+ 'margin-right' => astra_responsive_spacing( $margin, 'right', 'mobile' ),
+ ),
+ );
+
+ /* Parse CSS from array() */
+ $css_output = astra_parse_css( $css_output_desktop );
+ $css_output .= astra_parse_css( $css_output_tablet, '', astra_get_tablet_breakpoint() );
+ $css_output .= astra_parse_css( $css_output_mobile, '', astra_get_mobile_breakpoint() );
+
+ $dynamic_css .= $css_output;
+
+ $dynamic_css .= Astra_Builder_Base_Dynamic_CSS::prepare_advanced_typography_css( $_section, $selector );
+
+ $dynamic_css .= Astra_Builder_Base_Dynamic_CSS::prepare_visibility_css( $_section, $visibility_selector );
+
+ return $dynamic_css;
+}