Skip to content

Commit

Permalink
AUI updated
Browse files Browse the repository at this point in the history
  • Loading branch information
stiofan committed Feb 22, 2024
1 parent 6153f6f commit 294bea7
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 25 deletions.
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.6";
$this_version = "0.2.8";
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
7 changes: 6 additions & 1 deletion vendor/ayecode/wp-ayecode-ui/change-log.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
= 0.2.6 - 2024-01-25 =
= 0.2.8 - 2024-02-22 =
* Gallery padding made slider images taller than single images - FIXED
* aui_modal_iframe() function not loading iframe when bs5 selected - FIXED

= 0.2.7 - 2024-01-25 =
* Single quote breaks validation message - FIXED
* WP Editor Styles can now style headings, links, typography - ADDED
* Unused icons font file can load if old class used - FIXED

= 0.2.5 - 2023-12-14 =
* Update textdomain - CHANGED
Expand Down
41 changes: 38 additions & 3 deletions vendor/ayecode/wp-ayecode-ui/includes/ayecode-ui-settings.php
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.6';
public $version = '0.2.8';

/**
* Class textdomain.
Expand Down Expand Up @@ -791,6 +791,33 @@ public function theme_js_settings(){
);
}

/**
* Get the date the site was installed.
*
* @return false|string
*/
public function get_site_install_date() {
global $wpdb; // This gives you access to the WordPress database object

// Prepare the SQL query to get the oldest registration date
$query = "SELECT MIN(user_registered) AS oldest_registration_date FROM {$wpdb->users}";

// Execute the query
$date = $wpdb->get_var($query);

return $date ? $date : false;
}

/**
* Show admin notice if backend scripts not loaded.
*/
public function show_admin_version_notice(){
$fix_url = admin_url("options-general.php?page=ayecode-ui-settings" );
$button = '<a href="'.esc_url($fix_url).'" class="button-primary">View Settings</a>';
$message = __( '<b>Style Issue:</b> AyeCode UI has changed its default version from v4 to v5, if you notice unwanted style changes, please revert to v4 (saving the settings page will remove this notice)')." " .$button;
echo '<div class="notice notice-error aui-settings-error-notice"><p>'.$message.'</p></div>';
}

/**
* Get the current Font Awesome output settings.
*
Expand All @@ -799,6 +826,14 @@ public function theme_js_settings(){
public function get_settings() {

$db_settings = get_option( 'ayecode-ui-settings' );

// Maybe show default version notice
$site_install_date = new DateTime( self::get_site_install_date() );
$switch_over_date = new DateTime("2024-02-01");
if ( empty( $db_settings ) && $site_install_date < $switch_over_date ) {
add_action( 'admin_notices', array( $this, 'show_admin_version_notice' ) );
}

$js_default = 'core-popper';
$js_default_backend = $js_default;

Expand All @@ -822,15 +857,15 @@ public function get_settings() {
'css_backend' => 'compatibility', // core, compatibility
'js_backend' => $js_default_backend, // js to load, core-popper, popper
'disable_admin' => '', // URL snippets to disable loading on admin
'bs_ver' => '4', // The default bootstrap version to sue by default
'bs_ver' => '5', // The default bootstrap version to sue by default
), $db_settings );

$settings = wp_parse_args( $db_settings, $defaults );

/**
* Filter the Bootstrap settings.
*
* @todo if we add this filer people might use it and then it defeates the purpose of this class :/
* @todo if we add this filer people might use it and then it defeats the purpose of this class :/
*/
return $this->settings = apply_filters( 'ayecode-ui-settings', $settings, $db_settings, $defaults );
}
Expand Down
27 changes: 19 additions & 8 deletions vendor/ayecode/wp-ayecode-ui/includes/inc/bs5-js.php
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,9 @@ function aui_init_iconpicker(){

function aui_modal_iframe($title,$url,$footer,$dismissible,$class,$dialog_class,$body_class,responsive){
if(!$body_class){$body_class = 'p-0';}
var wClass = 'text-center position-absolute w-100 text-dark overlay overlay-white p-0 m-0 d-none d-flex justify-content-center align-items-center';
var wClass = 'text-center position-absolute w-100 text-dark overlay overlay-white p-0 m-0 d-flex justify-content-center align-items-center';
var wStyle = '';
var sStyle = '';
var $body = "", sClass = "w-100 p-0 m-0";
if (responsive) {
$body += '<div class="embed-responsive embed-responsive-16by9">';
Expand All @@ -281,25 +283,34 @@ function aui_modal_iframe($title,$url,$footer,$dismissible,$class,$dialog_class,
} else {
wClass += ' vh-100';
sClass += ' vh-100';
wStyle += ' height: 90vh !important;';
sStyle += ' height: 90vh !important;';
}
$body += '<div class="ac-preview-loading ' + wClass + '" style="left:0;top:0"><div class="spinner-border" role="status"></div></div>';
$body += '<iframe id="embedModal-iframe" class="' + sClass + '" src="" width="100%" height="100%" frameborder="0" allowtransparency="true"></iframe>';
$body += '<div class="ac-preview-loading ' + wClass + '" style="left:0;top:0;' + wStyle + '"><div class="spinner-border" role="status"></div></div>';
$body += '<iframe id="embedModal-iframe" class="' + sClass + '" style="' + sStyle + '" src="" width="100%" height="100%" frameborder="0" allowtransparency="true"></iframe>';
if (responsive) {
$body += '</div>';
}

console.log('b4-show-modal');
$m = aui_modal($title,$body,$footer,$dismissible,$class,$dialog_class,$body_class);
jQuery( $m ).on( 'shown.bs.modal', function ( e ) {

// myModalEl.addEventListener('hidden.bs.modal', event => {
// jQuery(".aui-carousel-modal iframe").attr('src', '');
// });

const auiModal = document.getElementById('aui-modal');
auiModal.addEventListener( 'shown.bs.modal', function ( e ) {console.log('show-modal');
iFrame = jQuery( '#embedModal-iframe') ;

jQuery('.ac-preview-loading').addClass('d-flex');

iFrame.attr({
src: $url
});

//resize the iframe once loaded.
iFrame.load(function() {
jQuery('.ac-preview-loading').removeClass('d-flex');
jQuery('.ac-preview-loading').removeClass('d-flex').addClass('d-none');
});
});

Expand Down Expand Up @@ -473,7 +484,7 @@ function aui_carousel_maybe_show_multiple_items($carousel){
}

// content
$new_items += '<div class="col pe-1 ps-0">'+$items[index]+'</div>';
$new_items += '<div class="col ">'+$items[index]+'</div>';
$new_item_count++;


Expand All @@ -485,7 +496,7 @@ function aui_carousel_maybe_show_multiple_items($carousel){
if($md_count-$new_item_count > 0){
$placeholder_count = $md_count-$new_item_count;
while($placeholder_count > 0){
$new_items += '<div class="col pe-1 ps-0"></div>';
$new_items += '<div class="col "></div>';
$placeholder_count--;
}

Expand Down
14 changes: 7 additions & 7 deletions vendor/composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,20 @@
},
{
"name": "ayecode/wp-ayecode-ui",
"version": "0.2.6",
"version_normalized": "0.2.6.0",
"version": "0.2.8",
"version_normalized": "0.2.8.0",
"source": {
"type": "git",
"url": "https://github.com/AyeCode/wp-ayecode-ui.git",
"reference": "023e7750dab3a6fa212cdfef701c7a6f3e48d269"
"reference": "fa9a748f3bdbe47ed9c036dc3904a32edc9fea48"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/AyeCode/wp-ayecode-ui/zipball/023e7750dab3a6fa212cdfef701c7a6f3e48d269",
"reference": "023e7750dab3a6fa212cdfef701c7a6f3e48d269",
"url": "https://api.github.com/repos/AyeCode/wp-ayecode-ui/zipball/fa9a748f3bdbe47ed9c036dc3904a32edc9fea48",
"reference": "fa9a748f3bdbe47ed9c036dc3904a32edc9fea48",
"shasum": ""
},
"time": "2024-01-24T17:06:14+00:00",
"time": "2024-02-22T11:01:08+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
Expand Down Expand Up @@ -97,7 +97,7 @@
],
"support": {
"issues": "https://github.com/AyeCode/wp-ayecode-ui/issues",
"source": "https://github.com/AyeCode/wp-ayecode-ui/tree/0.2.3"
"source": "https://github.com/AyeCode/wp-ayecode-ui/tree/0.2.8"
},
"install-path": "../ayecode/wp-ayecode-ui"
},
Expand Down
10 changes: 5 additions & 5 deletions vendor/composer/installed.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
'type' => 'project',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'reference' => '3590d5f5c19940d0db0af2726f1a8e78c03a3bb3',
'reference' => '6153f6f650916bfe703736f6c5b3c86473bf9706',
'name' => 'ayecode/geodirectory',
'dev' => true,
),
Expand All @@ -25,16 +25,16 @@
'type' => 'project',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'reference' => '3590d5f5c19940d0db0af2726f1a8e78c03a3bb3',
'reference' => '6153f6f650916bfe703736f6c5b3c86473bf9706',
'dev_requirement' => false,
),
'ayecode/wp-ayecode-ui' => array(
'pretty_version' => '0.2.6',
'version' => '0.2.6.0',
'pretty_version' => '0.2.8',
'version' => '0.2.8.0',
'type' => 'library',
'install_path' => __DIR__ . '/../ayecode/wp-ayecode-ui',
'aliases' => array(),
'reference' => '023e7750dab3a6fa212cdfef701c7a6f3e48d269',
'reference' => 'fa9a748f3bdbe47ed9c036dc3904a32edc9fea48',
'dev_requirement' => false,
),
'ayecode/wp-country-database' => array(
Expand Down

0 comments on commit 294bea7

Please sign in to comment.