diff --git a/src/plugins/hexly-commerce b/src/plugins/hexly-commerce index 1e1c7aa..2f8a4d7 160000 --- a/src/plugins/hexly-commerce +++ b/src/plugins/hexly-commerce @@ -1 +1 @@ -Subproject commit 1e1c7aa7e497efbdf86101775b2e7bb4556dccec +Subproject commit 2f8a4d77f937f4c0a7d90e6d86d719647316d892 diff --git a/src/plugins/hexly-common b/src/plugins/hexly-common index aff1423..6fab1bb 160000 --- a/src/plugins/hexly-common +++ b/src/plugins/hexly-common @@ -1 +1 @@ -Subproject commit aff142370024ce3e7fdc842acc6889c1ad250a18 +Subproject commit 6fab1bb7a89ce0d8743230ffe31f1e44f9b0eeae diff --git a/src/plugins/hexly-replicated-sites b/src/plugins/hexly-replicated-sites index 72e1084..716ca72 160000 --- a/src/plugins/hexly-replicated-sites +++ b/src/plugins/hexly-replicated-sites @@ -1 +1 @@ -Subproject commit 72e108454e10418473ec86d174952e50116e4b1d +Subproject commit 716ca729246e1e5629e39b3e784eb7e07d1d65fc diff --git a/src/themes/storefront/404.php b/src/themes/storefront/404.php new file mode 100644 index 0000000..bdbad0c --- /dev/null +++ b/src/themes/storefront/404.php @@ -0,0 +1,83 @@ + + +
' + message.replace( '\n\n', '
' ) + '
'; + } + }; + + $( document ).ready( function() { + api.SFGuidedTour.init(); + }); +} )( window.wp, jQuery ); diff --git a/src/themes/storefront/assets/js/admin/customizer.min.js b/src/themes/storefront/assets/js/admin/customizer.min.js new file mode 100644 index 0000000..c6a4598 --- /dev/null +++ b/src/themes/storefront/assets/js/admin/customizer.min.js @@ -0,0 +1 @@ +!function(n,s){"use strict";if(n&&n.customize){var o=n.customize;o.SFGuidedTourSteps=[],"undefined"!=typeof _wpCustomizeSFGuidedTourSteps&&s.extend(o.SFGuidedTourSteps,_wpCustomizeSFGuidedTourSteps),o.SFGuidedTour={$container:null,currentStep:-1,init:function(){this._setupUI()},_setupUI:function(){var t=this,e=s("body.wp-customizer .wp-full-overlay");this.$container=s("").addClass("sf-guided-tour"),e.prepend(this.$container),this._addListeners(),this.$container.css(s("body").hasClass("rtl")?"right":"left",s("#customize-controls").width()+10+"px").on("transitionend",function(){t.$container.addClass("sf-loaded")}),this._showNextStep(),s(document).on("click",".sf-guided-tour-step .sf-nux-button",function(){return t._showNextStep(),!1}),s(document).on("click",".sf-guided-tour-step .sf-guided-tour-skip",function(){return 0===t.currentStep?t._hideTour(!0):t._showNextStep(),!1})},_addListeners:function(){var t=this;o.state("expandedSection").bind(function(){t._adjustPosition()}),o.state("expandedPanel").bind(function(){t._adjustPosition()})},_adjustPosition:function(){var t=this._getCurrentStep(),e=o.state("expandedSection").get(),n=o.state("expandedPanel").get();if(t)if(this.$container.removeClass("sf-inside-section"),e&&t.section===e.id)this._moveContainer(s(e.container[1]).find(".customize-section-title")),this.$container.addClass("sf-inside-section");else if(!1===e&&!1===n)if(this._isTourHidden())this._revealTour();else{var i=this._getSelector(t.section);this._moveContainer(i)}else this._hideTour()},_hideTour:function(t){var e=this;this._isTourHidden()||(this.$container.css({transform:"",top:this.$container.offset().top}),s("body").addClass("sf-exiting").on("animationend.storefront webkitAnimationEnd.storefront",function(){s(this).removeClass("sf-exiting").off("animationend.storefront webkitAnimationEnd.storefront").addClass("sf-hidden"),e.$container.hide(),_.isUndefined(t)||!0!==t||e._removeTour()}))},_revealTour:function(){var t=this;s("body").removeClass("sf-hidden"),t.$container.show(),s("body").addClass("sf-entering").on("animationend.storefront webkitAnimationEnd.storefront",function(){s(this).removeClass("sf-entering").off("animationend.storefront webkitAnimationEnd.storefront"),t.$container.css({top:"auto",transform:"translateY("+parseInt(t.$container.offset().top,10)+"px)"})})},_removeTour:function(){this.$container.remove()},_closeAllSections:function(){o.section.each(function(t){t.collapse({duration:0})}),o.panel.each(function(t){t.collapse({duration:0})})},_showNextStep:function(){var t,e;this._isLastStep()?this._hideTour(!0):(this._closeAllSections(),(t=this._getNextStep()).message=this._lineBreaksToParagraphs(t.message),e=n.template("sf-guided-tour-step"),this.$container.removeClass("sf-first-step"),0===this.currentStep&&(t.first_step=!0,this.$container.addClass("sf-first-step")),this._isLastStep()&&(t.last_step=!0,this.$container.addClass("sf-last-step")),this._moveContainer(this._getSelector(t.section)),this.$container.html(e(t)))},_moveContainer:function(t){var e,n=this;t&&(e=parseInt(t.offset().top,10)+t.height()/2-44,this.$container.addClass("sf-moving").css({transform:"translateY("+parseInt(e,10)+"px)"}).on("transitionend.storefront",function(){n.$container.removeClass("sf-moving"),n.$container.off("transitionend.storefront")}))},_getSelector:function(t){var e=o.section(t)?o.section(t):o.panel(t);return _.isUndefined(e)?s(t):s(e.container[0])},_getCurrentStep:function(){return o.SFGuidedTourSteps[this.currentStep]},_getNextStep:function(){return this.currentStep=this.currentStep+1,o.SFGuidedTourSteps[this.currentStep]},_isTourHidden:function(){return!!s("body").hasClass("sf-hidden")},_isLastStep:function(){return!(this.currentStep+1")+"
"}},s(document).ready(function(){o.SFGuidedTour.init()})}}(window.wp,jQuery); \ No newline at end of file diff --git a/src/themes/storefront/assets/js/admin/plugin-install.js b/src/themes/storefront/assets/js/admin/plugin-install.js new file mode 100644 index 0000000..3d6c940 --- /dev/null +++ b/src/themes/storefront/assets/js/admin/plugin-install.js @@ -0,0 +1,41 @@ +( function( wp, $ ) { + 'use strict'; + + if ( ! wp ) { + return; + } + + $( function() { + $( document ).on( 'click', '.sf-install-now', function( event ) { + var $button = $( event.target ); + + if ( $button.hasClass( 'activate-now' ) ) { + return true; + } + + event.preventDefault(); + + if ( $button.hasClass( 'updating-message' ) || $button.hasClass( 'button-disabled' ) ) { + return; + } + + if ( wp.updates.shouldRequestFilesystemCredentials && ! wp.updates.ajaxLocked ) { + wp.updates.requestFilesystemCredentials( event ); + + $( document ).on( 'credential-modal-cancel', function() { + var $message = $( '.sf-install-now.updating-message' ); + + $message + .removeClass( 'updating-message' ) + .text( wp.updates.l10n.installNow ); + + wp.a11y.speak( wp.updates.l10n.updateCancel, 'polite' ); + } ); + } + + wp.updates.installPlugin( { + slug: $button.data( 'slug' ) + } ); + }); + }); +})( window.wp, jQuery ); \ No newline at end of file diff --git a/src/themes/storefront/assets/js/admin/plugin-install.min.js b/src/themes/storefront/assets/js/admin/plugin-install.min.js new file mode 100644 index 0000000..6a7b330 --- /dev/null +++ b/src/themes/storefront/assets/js/admin/plugin-install.min.js @@ -0,0 +1 @@ +!function(a,t){"use strict";a&&t(function(){t(document).on("click",".sf-install-now",function(e){var s=t(e.target);if(s.hasClass("activate-now"))return!0;e.preventDefault(),s.hasClass("updating-message")||s.hasClass("button-disabled")||(a.updates.shouldRequestFilesystemCredentials&&!a.updates.ajaxLocked&&(a.updates.requestFilesystemCredentials(e),t(document).on("credential-modal-cancel",function(){t(".sf-install-now.updating-message").removeClass("updating-message").text(a.updates.l10n.installNow),a.a11y.speak(a.updates.l10n.updateCancel,"polite")})),a.updates.installPlugin({slug:s.data("slug")}))})})}(window.wp,jQuery); \ No newline at end of file diff --git a/src/themes/storefront/assets/js/editor.js b/src/themes/storefront/assets/js/editor.js new file mode 100644 index 0000000..67cf564 --- /dev/null +++ b/src/themes/storefront/assets/js/editor.js @@ -0,0 +1,153 @@ +/** + * Block editor enhancements. + * + * Contains functionality to dynamically update the block editor + * configuration and styling. + */ +(function () { + /** + * Check if the main sidebar is active (has widgets). + * + * This uses a custom property `mainSidebarActive` added via the + * `block_editor_settings` filter. + * + * @return {boolean} Whether sidebar is active. + */ + var sidebarIsActive = function sidebarIsActive() { + var settings = wp.data.select('core/editor').getEditorSettings(); + + if (settings.hasOwnProperty('mainSidebarActive') && !!settings.mainSidebarActive) { + return true; + } + + return false; + }; + /** + * Get current page template name. + * + * @return {string} The page template name. + */ + + + var getCurrentPageTemplate = function getCurrentPageTemplate() { + return wp.data.select('core/editor').getEditedPostAttribute('template'); + }; + /** + * Check if the active theme supports a wide layout. + * + * @return {boolean} Whether the theme supports wide layout. + */ + + + var themeSupportsWide = function themeSupportsWide() { + var settings = wp.data.select('core/editor').getEditorSettings(); + + if (settings.hasOwnProperty('alignWide') && !!settings.alignWide) { + return true; + } + + return false; + }; + /** + * Update editor wide support. + * + * @param {boolean} alignWide Whether the editor supports + * alignWide support. + * + * @return {void} + */ + + + var updateWideSupport = function updateWideSupport(alignWide) { + wp.data.dispatch('core/editor').updateEditorSettings({ + 'alignWide': !!alignWide + }); + }; + /** + * Update `data-align` attribute on each block. + * + * @param {boolean} alignWide Whether alignWide is supported. + * + * @return {void} + */ + + + var updateAlignAttribute = function updateAlignAttribute(alignWide) { + var blocks = wp.data.select('core/editor').getBlocks(); + blocks.forEach(function (block) { + if (block.attributes.hasOwnProperty('align')) { + var align = block.attributes.align; + + if (!['full', 'wide'].includes(align)) { + return; + } + + var blockWrapper = document.getElementById('block-' + block.clientId); + + if (blockWrapper) { + blockWrapper.setAttribute('data-align', alignWide ? align : ''); + } + } + }); + }; + /** + * Add custom class to editor wrapper if main sidebar is active. + * + * @param {boolean} showSidebar Whether to add custom class. + * + * @return {void} + */ + + + var toggleCustomSidebarClass = function toggleCustomSidebarClass(showSidebar) { + var editorWrapper = document.getElementsByClassName('editor-writing-flow'); + + if (!editorWrapper.length) { + return; + } + + if (!!showSidebar) { + editorWrapper[0].classList.add('storefront-has-sidebar'); + } else { + editorWrapper[0].classList.remove('storefront-has-sidebar'); + } + }; + /** + * Update editor and blocks when layout changes. + * + * @return {void} + */ + + + var maybeUpdateEditor = function maybeUpdateEditor() { + if ('template-fullwidth.php' === getCurrentPageTemplate()) { + updateWideSupport(true); + toggleCustomSidebarClass(false); + updateAlignAttribute(true); + } else if (sidebarIsActive()) { + updateWideSupport(false); + toggleCustomSidebarClass(true); + updateAlignAttribute(false); + } else { + updateWideSupport(true); + toggleCustomSidebarClass(false); + updateAlignAttribute(true); + } + }; + + wp.domReady(function () { + // Don't do anything if the theme doesn't declare support for `align-wide`. + if (!themeSupportsWide()) { + return; + } + + maybeUpdateEditor(); + var pageTemplate = getCurrentPageTemplate(); + wp.data.subscribe(function () { + if (getCurrentPageTemplate() !== pageTemplate) { + pageTemplate = getCurrentPageTemplate(); + maybeUpdateEditor(); + } + }); + }); +})(); diff --git a/src/themes/storefront/assets/js/editor.min.js b/src/themes/storefront/assets/js/editor.min.js new file mode 100644 index 0000000..6be5e28 --- /dev/null +++ b/src/themes/storefront/assets/js/editor.min.js @@ -0,0 +1 @@ +!function(){function e(){return wp.data.select("core/editor").getEditedPostAttribute("template")}function t(t){wp.data.dispatch("core/editor").updateEditorSettings({alignWide:!!t})}function i(a){wp.data.select("core/editor").getBlocks().forEach(function(t){if(t.attributes.hasOwnProperty("align")){var e=t.attributes.align;if(!["full","wide"].includes(e))return;var i=document.getElementById("block-"+t.clientId);i&&i.setAttribute("data-align",a?e:"")}})}function a(t){var e=document.getElementsByClassName("editor-writing-flow");e.length&&(t?e[0].classList.add("storefront-has-sidebar"):e[0].classList.remove("storefront-has-sidebar"))}function n(){"template-fullwidth.php"===e()?(t(!0),a(!1),i(!0)):!function(){var t=wp.data.select("core/editor").getEditorSettings();return!(!t.hasOwnProperty("mainSidebarActive")||!t.mainSidebarActive)}()?(t(!0),a(!1),i(!0)):(t(!1),a(!0),i(!1))}wp.domReady(function(){if(function(){var t=wp.data.select("core/editor").getEditorSettings();return!(!t.hasOwnProperty("alignWide")||!t.alignWide)}()){n();var t=e();wp.data.subscribe(function(){e()!==t&&(t=e(),n())})}})}(); \ No newline at end of file diff --git a/src/themes/storefront/assets/js/footer.js b/src/themes/storefront/assets/js/footer.js new file mode 100644 index 0000000..61138be --- /dev/null +++ b/src/themes/storefront/assets/js/footer.js @@ -0,0 +1,47 @@ +/** + * footer.js + * + * Adds a class required to reveal the search in the handheld footer bar. + * Also hides the handheld footer bar when an input is focused. + */ +( function() { + // Wait for DOM to be ready. + document.addEventListener( 'DOMContentLoaded', function() { + if ( 0 === document.getElementsByClassName( 'storefront-handheld-footer-bar' ).length ) { + return; + } + + // Add class to footer search when clicked. + [].forEach.call( document.querySelectorAll( '.storefront-handheld-footer-bar .search > a' ), function( anchor ) { + anchor.addEventListener( 'click', function( event ) { + anchor.parentElement.classList.toggle( 'active' ); + event.preventDefault(); + } ); + } ); + + // Add focus class to body when an input field is focused. + // This is used to hide the Handheld Footer Bar when an input is focused. + var footer_bar = document.getElementsByClassName( 'storefront-handheld-footer-bar' ); + var forms = document.forms; + var isFocused = function( focused ) { + return function( event ) { + if ( !! focused && event.target.tabIndex !== -1 ) { + document.body.classList.add( 'sf-input-focused' ); + } else { + document.body.classList.remove( 'sf-input-focused' ); + } + }; + }; + + if ( footer_bar.length && forms.length ) { + for ( var i = 0; i < forms.length; i++ ) { + if ( footer_bar[0].contains( forms[ i ] ) ) { + continue; + } + + forms[ i ].addEventListener( 'focus', isFocused( true ), true ); + forms[ i ].addEventListener( 'blur', isFocused( false ), true ); + } + } + } ); +} )(); diff --git a/src/themes/storefront/assets/js/footer.min.js b/src/themes/storefront/assets/js/footer.min.js new file mode 100644 index 0000000..c53eadf --- /dev/null +++ b/src/themes/storefront/assets/js/footer.min.js @@ -0,0 +1 @@ +document.addEventListener("DOMContentLoaded",function(){if(0!==document.getElementsByClassName("storefront-handheld-footer-bar").length){function e(t){return function(e){t&&-1!==e.target.tabIndex?document.body.classList.add("sf-input-focused"):document.body.classList.remove("sf-input-focused")}}[].forEach.call(document.querySelectorAll(".storefront-handheld-footer-bar .search > a"),function(t){t.addEventListener("click",function(e){t.parentElement.classList.toggle("active"),e.preventDefault()})});var t=document.getElementsByClassName("storefront-handheld-footer-bar"),n=document.forms;if(t.length&&n.length)for(var o=0;o+ Get started here.', 'storefront' ), array( 'a' => array( 'href' => array() ) ) ), esc_url( admin_url( 'post-new.php' ) ) ); + ?> +
+ + + + + + + + + + + + +
+ ' . get_the_title() . '' + ); + ?> +
+ + 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through. ?> + + + ++ 'ol', + 'short_ping' => true, + 'callback' => 'storefront_comment', + ) + ); + ?> +
+ + 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through. ?> + + + + '', + ) + ); + + comment_form( $args ); + ?> + +