Skip to content

Commit

Permalink
0.1.12
Browse files Browse the repository at this point in the history
  • Loading branch information
stiofan committed Mar 26, 2024
1 parent 147dbfd commit 9a93f5e
Show file tree
Hide file tree
Showing 23 changed files with 240 additions and 41 deletions.
20 changes: 20 additions & 0 deletions blocks/class-blockstrap-widget-button.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,12 @@ public function set_arguments() {
'element_require' => '[%icon_class%]!=""',
);

if ( function_exists( 'sd_get_new_window_input' ) ) {
$arguments['link_new_window'] = sd_get_new_window_input();
$arguments['link_nofollow'] = sd_get_nofollow_input();
$arguments['link_attributes'] = sd_get_attributes_input();
}

// button styles
$arguments['link_type'] = array(
'type' => 'select',
Expand Down Expand Up @@ -660,6 +666,20 @@ public function output( $args = array(), $widget_args = array(), $content = '' )
$href = '';//'href="#"';
}

if ( $href && function_exists( 'sd_build_attributes_string_escaped' ) ) {
$attributes_escaped = sd_build_attributes_string_escaped(
array(
'new_window' => ! empty( $args['link_new_window'] ) ? 1 : '',
'nofollow' => ! empty( $args['link_nofollow'] ) ? 1 : '',
'custom' => ! empty( $args['link_attributes'] ) ? $args['link_attributes'] : array(),
)
);

if ( $attributes_escaped ) {
$link_attr .= ' ' . $attributes_escaped;
}
}

$styles = sd_build_aui_styles( $args );
$style = $styles ? 'style="' . $styles . '"' : '';

Expand Down
30 changes: 24 additions & 6 deletions blocks/class-blockstrap-widget-nav.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function __construct() {
array(
'element' => 'BlocksProps',
'inner_element' => 'div',
'if_className' => '[%inside_navbar%]=="1" ? "collapse navbar-collapse" : ""',
'if_className' => '[%inside_navbar%]=="1" ? "blockstrap-nav collapse navbar-collapse" : "blockstrap-nav"',
'style' => '{[%WrapStyle%]}',
'id' => 'navbarNav_[%anchor%]',

Expand All @@ -58,11 +58,11 @@ public function __construct() {
),
),
),
array(
'element' => 'script',
'content' => 'jQuery("#navbarNav_[%anchor%]").on("show.bs.collapse", function () {jQuery("#navbarNav_[%anchor%]").closest(".bg-transparent-until-scroll,.bg-transparent").addClass("nav-menu-open"); jQuery(window).trigger("scroll");});jQuery("#navbarNav_[%anchor%]").on("hidden.bs.collapse", function () {jQuery("#navbarNav_[%anchor%]").closest(".bg-transparent-until-scroll,.bg-transparent").removeClass("nav-menu-open"); jQuery(window).trigger("scroll");});',
'element_require' => '[%inside_navbar%]=="1"',
),
// array(
// 'element' => 'script',
// 'content' => 'jQuery("#navbarNav_[%anchor%]").on("show.bs.collapse", function () {jQuery("#navbarNav_[%anchor%]").closest(".bg-transparent-until-scroll,.bg-transparent").addClass("nav-menu-open"); jQuery(window).trigger("scroll");});jQuery("#navbarNav_[%anchor%]").on("hidden.bs.collapse", function () {jQuery("#navbarNav_[%anchor%]").closest(".bg-transparent-until-scroll,.bg-transparent").removeClass("nav-menu-open"); jQuery(window).trigger("scroll");});',
// 'element_require' => '[%inside_navbar%]=="1"',
// ),

),
'block-wrap' => '',
Expand Down Expand Up @@ -325,11 +325,29 @@ public function output( $args = array(), $widget_args = array(), $content = '' )
if ( empty( $content ) ) {
return '';
} else {
add_action( 'wp_enqueue_scripts',array( $this, 'enqueue_scripts' ) );
return $content;
}

}

/**
* Enqueues the necessary scripts for the widget, shortcode, and block (front end).
*
* @return void
* @global $blockstrap_nav_js
*
*/
public function enqueue_scripts() {
global $blockstrap_nav_js;

// Don't load JS again.
if ( empty( $blockstrap_nav_js ) && class_exists( 'AyeCode_UI_Settings' ) ) {
$script = 'jQuery(function() { jQuery(".wp-block-blockstrap-blockstrap-widget-nav.navbar-collapse, .blockstrap-nav.navbar-collapse").on("show.bs.collapse", function () {jQuery(".wp-block-blockstrap-blockstrap-widget-nav.navbar-collapse, .blockstrap-nav.navbar-collapse").closest(".bg-transparent-until-scroll,.bg-transparent").addClass("nav-menu-open"); jQuery(window).trigger("scroll");});jQuery(".wp-block-blockstrap-blockstrap-widget-nav.navbar-collapse, .blockstrap-nav.navbar-collapse").on("hidden.bs.collapse", function () {jQuery(".wp-block-blockstrap-blockstrap-widget-nav.navbar-collapse, .blockstrap-nav.navbar-collapse").closest(".bg-transparent-until-scroll,.bg-transparent").removeClass("nav-menu-open"); jQuery(window).trigger("scroll");}); });';
$blockstrap_nav_js = wp_add_inline_script( 'bootstrap-js-bundle', $script );
}
}

}

// register it.
Expand Down
4 changes: 2 additions & 2 deletions blockstrap-page-builder-blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* Plugin Name: BlockStrap Page Builder Blocks
* Plugin URI: https://ayecode.io/
* Description: BlockStrap - A FSE page builder for WordPress
* Version: 0.1.11
* Version: 0.1.12
* Author: AyeCode
* Author URI: https://ayecode.io
* Text Domain: blockstrap-page-builder-blocks
Expand All @@ -21,7 +21,7 @@
*/


define( 'BLOCKSTRAP_BLOCKS_VERSION', '0.1.11' );
define( 'BLOCKSTRAP_BLOCKS_VERSION', '0.1.12' );

/**
* The BlockStrap Class
Expand Down
6 changes: 5 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Donate link: https://ayecode.io
Tags: page builder, bootstrap, blocks, builder, design
Requires at least: 6.0
Tested up to: 6.5
Stable tag: 0.1.11
Stable tag: 0.1.12
Requires PHP: 7.2
License: GPLv3
License URI: http://www.gnu.org/licenses/gpl-3.0.html
Expand Down Expand Up @@ -158,6 +158,10 @@ Automatic updates should work seamlessly. We always suggest you backup your webs

== Changelog ==

= 0.1.12 =
* BS > Nav inline script move to wp_add_inline_script() call - CHANGED
* BS > Button added link attributes options - ADDED

= 0.1.11 =
* BS > Rating block added to output rating stars, general use or for GeoDirectory - ADDED

Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion vendor/ayecode/wp-ayecode-ui/assets-v5/css/ayecode-ui.css

Large diffs are not rendered by default.

Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -157,3 +157,7 @@ body.modal-open .modal{
background: transparent; // this is for divi theme that does background position stuff and breaks it.
}

// Backend import/export safari issues
.gd-settings-wrap .moxie-shim input{
font-size: 0 !important;
}

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion vendor/ayecode/wp-ayecode-ui/assets/css/ayecode-ui-fse.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion vendor/ayecode/wp-ayecode-ui/assets/css/ayecode-ui.css

Large diffs are not rendered by default.

Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,9 @@ body>.flatpickr-calendar .flatpickr-month .flatpickr-current-month>*{display:inl
.geodir-add-files .moxie-shim {
position: initial !important;
background: transparent; // this is for divi theme that does background position stuff and breaks it.
}

// Backend import/export safari issues
.gd-settings-wrap .moxie-shim input{
font-size: 0 !important;
}
2 changes: 1 addition & 1 deletion vendor/ayecode/wp-ayecode-ui/ayecode-ui-loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
add_action('after_setup_theme', function () {
global $ayecode_ui_version,$ayecode_ui_file_key;
$this_version = "0.2.9";
$this_version = "0.2.10";
if(empty($ayecode_ui_version) || version_compare($this_version , $ayecode_ui_version, '>')){
$ayecode_ui_version = $this_version ;
$ayecode_ui_file_key = wp_hash( __FILE__ );
Expand Down
3 changes: 3 additions & 0 deletions vendor/ayecode/wp-ayecode-ui/change-log.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
= 0.2.10 - TBD =
* Safari wp-admin plupload overflow issue on hidden input causing horizontal scroll issue - FIXED

= 0.2.9 - 2024-03-19 =
* BS5 styles can call broken font awesome url from css - FIXED
* Plugin check review - DONE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class AyeCode_UI_Settings {
*
* @var string
*/
public $version = '0.2.9';
public $version = '0.2.10';

/**
* Class textdomain.
Expand Down
3 changes: 3 additions & 0 deletions vendor/ayecode/wp-super-duper/change-log.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
= 1.1.36 - 2024-03-26 =
* Added helper functions for link attributes - ADDED

= 1.1.35 - 2024-03-13 =
* Add style multiselect field for Elementor editor - CHANGED

Expand Down
142 changes: 142 additions & 0 deletions vendor/ayecode/wp-super-duper/sd-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -2031,6 +2031,148 @@ function sd_get_scrollbars_input( $type = 'scrollbars', $overwrite = array() ) {
return $input;
}

/**
* @param $type
* @param $overwrite
*
* @return array
*/
function sd_get_new_window_input( $type = 'target', $overwrite = array() ) {

$defaults = array(
'type' => 'checkbox',
'title' => __( 'Open in new window', 'ayecode-connect' ),
'default' => '',
'desc_tip' => true,
'group' => __( 'Link', 'ayecode-connect' ),
);

$input = wp_parse_args( $overwrite, $defaults );

return $input;
}

/**
* @param $type
* @param $overwrite
*
* @return array
*/
function sd_get_nofollow_input( $type = 'nofollow', $overwrite = array() ) {

$defaults = array(
'type' => 'checkbox',
'title' => __( 'Add nofollow', 'ayecode-connect' ),
'default' => '',
'desc_tip' => true,
'group' => __( 'Link', 'ayecode-connect' ),
);

$input = wp_parse_args( $overwrite, $defaults );

return $input;
}

/**
* @param $type
* @param $overwrite
*
* @return array
*/
function sd_get_attributes_input( $type = 'attributes', $overwrite = array() ) {

$defaults = array(
'type' => 'text',
'title' => __( 'Custom Attributes', 'ayecode-connect' ),
'value' => '',
'default' => '',
'placeholder' => 'key|value,key2|value2',
'desc_tip' => true,
'group' => __( 'Link', 'ayecode-connect' ),
);

$input = wp_parse_args( $overwrite, $defaults );

return $input;
}

/**
* @param $args
*
* @return string
*/
function sd_build_attributes_string_escaped( $args ) {
global $aui_bs5;

$attributes = array();
$string_escaped = '';

if ( ! empty( $args['custom'] ) ) {
$attributes = sd_parse_custom_attributes($args['custom']);
}

// new window
if ( ! empty( $args['new_window'] ) ) {
$attributes['target'] = '_blank';
}

// nofollow
if ( ! empty( $args['nofollow'] ) ) {
$attributes['rel'] = isset($attributes['rel']) ? $attributes['rel'] . ' nofollow' : 'nofollow';
}

if(!empty($attributes )){
foreach ( $attributes as $key => $val ) {
$string_escaped .= esc_attr($key) . '="' . esc_attr($val) . '" ';
}
}

return $string_escaped;
}

/**
* @info borrowed from elementor
*
* @param $attributes_string
* @param $delimiter
*
* @return array
*/
function sd_parse_custom_attributes( $attributes_string, $delimiter = ',' ) {
$attributes = explode( $delimiter, $attributes_string );
$result = [];

foreach ( $attributes as $attribute ) {
$attr_key_value = explode( '|', $attribute );

$attr_key = mb_strtolower( $attr_key_value[0] );

// Remove any not allowed characters.
preg_match( '/[-_a-z0-9]+/', $attr_key, $attr_key_matches );

if ( empty( $attr_key_matches[0] ) ) {
continue;
}

$attr_key = $attr_key_matches[0];

// Avoid Javascript events and unescaped href.
if ( 'href' === $attr_key || 'on' === substr( $attr_key, 0, 2 ) ) {
continue;
}

if ( isset( $attr_key_value[1] ) ) {
$attr_value = trim( $attr_key_value[1] );
} else {
$attr_value = '';
}

$result[ $attr_key ] = $attr_value;
}

return $result;
}

/**
* Build AUI classes from settings.
*
Expand Down
2 changes: 1 addition & 1 deletion vendor/ayecode/wp-super-duper/wp-super-duper.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

if ( ! class_exists( 'WP_Super_Duper' ) ) {

define( 'SUPER_DUPER_VER', '1.1.35' );
define( 'SUPER_DUPER_VER', '1.1.36' );

/**
* A Class to be able to create a Widget, Shortcode or Block to be able to output content for WordPress.
Expand Down
Loading

0 comments on commit 9a93f5e

Please sign in to comment.