Version Description
- Replace the 'Load JavaScript during window.onload event' option with a 'Load JavaScript during DOMContentLoaded event' option, which is a much better solution.
=
Download this release
Release Info
Developer | simonpedge |
Plugin | Slide Anything – Responsive Content / HTML Slider and Carousel |
Version | 2.1.21 |
Comparing to | |
See all releases |
Code changes from version 2.1.20 to 2.1.21
- php/slide-anything-admin.php +5 -4
- php/slide-anything-frontend.php +2 -2
- readme.txt +7 -1
- slide-anything.php +1 -1
php/slide-anything-admin.php
CHANGED
@@ -1661,15 +1661,16 @@ function cpt_slider_style_content($post) {
|
|
1661 |
|
1662 |
echo "<h4 style='margin-top:10px !important;'>Other Settings:</h4>";
|
1663 |
|
1664 |
-
// USE '
|
1665 |
$window_onload = get_post_meta($post->ID, 'sa_window_onload', true);
|
1666 |
if ($window_onload == '') {
|
1667 |
$window_onload = '0';
|
1668 |
}
|
1669 |
-
$tooltip = '
|
1670 |
-
$tooltip .= '
|
|
|
1671 |
echo "<div id='sa_window_onload_line'>";
|
1672 |
-
echo "<span class='sa_tooltip' title='".$tooltip."'></span><span style='min-width:160px;'>
|
1673 |
if ($window_onload == '1') {
|
1674 |
echo "<input type='checkbox' id='sa_window_onload' name='sa_window_onload' value='1' checked/>";
|
1675 |
} else {
|
1661 |
|
1662 |
echo "<h4 style='margin-top:10px !important;'>Other Settings:</h4>";
|
1663 |
|
1664 |
+
// USE 'DOMContentLoaded' EVENT (checkbox)
|
1665 |
$window_onload = get_post_meta($post->ID, 'sa_window_onload', true);
|
1666 |
if ($window_onload == '') {
|
1667 |
$window_onload = '0';
|
1668 |
}
|
1669 |
+
$tooltip = 'Load the Slide Anything JavaScript during the DOMContentLoaded event. Use this option if jQuery ';
|
1670 |
+
$tooltip .= 'is loading in your theme footer and you are getting the JavaScript error message ';
|
1671 |
+
$tooltip .= '"Uncaught ReferenceError: jQuery is not defined".';
|
1672 |
echo "<div id='sa_window_onload_line'>";
|
1673 |
+
echo "<span class='sa_tooltip' title='".$tooltip."'></span><span style='min-width:160px;'>DOMContentLoaded event:</span>";
|
1674 |
if ($window_onload == '1') {
|
1675 |
echo "<input type='checkbox' id='sa_window_onload' name='sa_window_onload' value='1' checked/>";
|
1676 |
} else {
|
php/slide-anything-frontend.php
CHANGED
@@ -452,7 +452,7 @@ function slide_anything_shortcode($atts) {
|
|
452 |
|
453 |
// ### ENQUEUE JQUERY SCRIPT IF IT HAS NOT ALREADY BEEN LOADED ###
|
454 |
if (!wp_script_is('jquery', 'done')) {
|
455 |
-
wp_enqueue_script('jquery');
|
456 |
}
|
457 |
|
458 |
|
@@ -466,7 +466,7 @@ function slide_anything_shortcode($atts) {
|
|
466 |
}
|
467 |
$output .= "<script type='text/javascript'>\n";
|
468 |
if ($slide_data['sa_window_onload'] == '1') {
|
469 |
-
$output .= "
|
470 |
} else {
|
471 |
$output .= " jQuery(document).ready(function() {\n";
|
472 |
}
|
452 |
|
453 |
// ### ENQUEUE JQUERY SCRIPT IF IT HAS NOT ALREADY BEEN LOADED ###
|
454 |
if (!wp_script_is('jquery', 'done')) {
|
455 |
+
wp_enqueue_script('jquery', false, array(), false, false);
|
456 |
}
|
457 |
|
458 |
|
466 |
}
|
467 |
$output .= "<script type='text/javascript'>\n";
|
468 |
if ($slide_data['sa_window_onload'] == '1') {
|
469 |
+
$output .= " document.addEventListener('DOMContentLoaded', function() {\n";
|
470 |
} else {
|
471 |
$output .= " jQuery(document).ready(function() {\n";
|
472 |
}
|
readme.txt
CHANGED
@@ -252,6 +252,9 @@ Adding a SLIDE ANYTHING slider using the WordPress 5.0 'Block Editor' is pretty
|
|
252 |
= 2.1.20 =
|
253 |
* Bug Fix - Fixed an issue where the Slide Anything JavaScript code was not being generated with certain newer themes.
|
254 |
|
|
|
|
|
|
|
255 |
== Upgrade Notice ==
|
256 |
|
257 |
= 1.0 =
|
@@ -413,4 +416,7 @@ Adding a SLIDE ANYTHING slider using the WordPress 5.0 'Block Editor' is pretty
|
|
413 |
* Small enhancement - The Slide Anything container is now set to hidden (visibility:hidden) until all the slides have been displayed and owl-carousel JavaScript code executed, then the SA container is set to visible (visibility:visible). This presents a cleaner page loading experience without the individual slide containers (DIVS) sometimes being displayed (even for a fraction of a second) prior to slider initialisation.
|
414 |
|
415 |
= 2.1.20 =
|
416 |
-
* Bug Fix - Fixed an issue where the Slide Anything JavaScript code was not being generated with certain newer themes.
|
|
|
|
|
|
252 |
= 2.1.20 =
|
253 |
* Bug Fix - Fixed an issue where the Slide Anything JavaScript code was not being generated with certain newer themes.
|
254 |
|
255 |
+
= 2.1.21 =
|
256 |
+
* Replace the 'Load JavaScript during window.onload event' option with a 'Load JavaScript during DOMContentLoaded event' option, which is a much better solution.
|
257 |
+
|
258 |
== Upgrade Notice ==
|
259 |
|
260 |
= 1.0 =
|
416 |
* Small enhancement - The Slide Anything container is now set to hidden (visibility:hidden) until all the slides have been displayed and owl-carousel JavaScript code executed, then the SA container is set to visible (visibility:visible). This presents a cleaner page loading experience without the individual slide containers (DIVS) sometimes being displayed (even for a fraction of a second) prior to slider initialisation.
|
417 |
|
418 |
= 2.1.20 =
|
419 |
+
* Bug Fix - Fixed an issue where the Slide Anything JavaScript code was not being generated with certain newer themes.
|
420 |
+
|
421 |
+
= 2.1.21 =
|
422 |
+
* Replace the 'Load JavaScript during window.onload event' option with a 'Load JavaScript during DOMContentLoaded event' option, which is a much better solution.
|
slide-anything.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
* Plugin URI: https://wordpress.org/plugins/slide-anything/
|
5 |
* Description: Slide Anything allows you to create a carousel/slider where the content for each slide can be anything you want - images, text, HTML, and even shortcodes. This plugin uses the Owl Carousel jQuery plugin, and lets you create beautiful, touch enabled, responsive carousels and sliders.
|
6 |
* Author: Simon Edge
|
7 |
-
* Version: 2.1.
|
8 |
* License: GPLv2 or later
|
9 |
*/
|
10 |
|
4 |
* Plugin URI: https://wordpress.org/plugins/slide-anything/
|
5 |
* Description: Slide Anything allows you to create a carousel/slider where the content for each slide can be anything you want - images, text, HTML, and even shortcodes. This plugin uses the Owl Carousel jQuery plugin, and lets you create beautiful, touch enabled, responsive carousels and sliders.
|
6 |
* Author: Simon Edge
|
7 |
+
* Version: 2.1.21
|
8 |
* License: GPLv2 or later
|
9 |
*/
|
10 |
|