From 84981721d7a694b95d16eb248bf20fceeb9dca32 Mon Sep 17 00:00:00 2001 From: pewgeuges <73141620+pewgeuges@users.noreply.github.com> Date: Mon, 4 Jan 2021 15:51:57 +0000 Subject: [PATCH] urgent release 2.4.0 git-svn-id: https://plugins.svn.wordpress.org/footnotes/trunk@2449988 b8457f37-d9ea-0310-8a92-e5e31aec5664 --- class/task.php | 74 +++++++++++++++++++++---------- footnotes.php | 4 +- readme.txt | 13 +++--- templates/note-for-developers.txt | 5 +-- 4 files changed, 63 insertions(+), 33 deletions(-) diff --git a/class/task.php b/class/task.php index 3bfd931..3862fca 100644 --- a/class/task.php +++ b/class/task.php @@ -8,7 +8,7 @@ * * Edited for v2.0.0 and following. * - * Last modified: 2021-01-03T2056+0100 + * Last modified: 2021-01-04T1623+0100 * * @since 2.0.5 Autoload / infinite scroll support added thanks to code from @docteurfitness * @see @@ -68,6 +68,10 @@ * @since 2.3.0 swap Custom CSS migration Boolean from 'migration complete' to 'show legacy' 2020-12-27T1243+0100 * @since 2.4.0 syntax validation for balanced footnote start and end tags 2021-01-01T0227+0100 * @since 2.4.0 scroll offset to a safety default value 34 right in the properties section 2021-01-03T2056+0100 + * @since 2.4.0 initialize scroll offset variable to 34 as a more robust default, thanks to @lukashuggenberg 2021-01-04T0504+0100 + * @since 2.4.0 set empty reference container label to NNBSP to make it more robust, thanks to @lukashuggenberg 2021-01-04T0504+0100 + * @since 2.4.0 optimize template load and process, thanks to @misfist 2021-01-04T1355+0100 + * @since 2.4.0 initialize hard link address as empty to fix undefined variable bug, thanks to @a223123131 2021-01-04T1622+0100 */ // If called directly, abort: @@ -143,6 +147,17 @@ class MCI_Footnotes_Task { */ public static $l_int_ReferenceContainerId = 1; + /** + * Load tooltip inline script only if jQuery tooltips are enabled + * Streamline process depending on tooltip enabled status + * + * @author Patrizia Lutz @misfist + * + * @since 2.4.0d0 + */ + public static $l_bool_TooltipsEnabled = false; + public static $l_bool_AlternativeTooltipsEnabled = false; + /** * Hard links for AMP * @@ -153,9 +168,10 @@ class MCI_Footnotes_Task { * @see * @since 2.3.0 * @var bool|str|int - * - * @since 2.4.0 scroll offset to a safety default value 34 right here 2021-01-03T2055+0100 - * Some websites are using really high fixed headers not contracting at scroll. + * + * @since 2.4.0 initialize scroll offset to a safety default value 34 right here 2021-01-03T2055+0100 + * By accident, this variable may not be updated with settings storage. + * Websites may use high fixed headers not contracting at scroll. */ public static $l_bool_HardLinksEnable = false; public static $l_str_ReferrerLinkSlug = 'r'; @@ -409,10 +425,10 @@ class MCI_Footnotes_Task { } // tooltips: - $l_bool_TooltipsEnabled = MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_FOOTNOTES_MOUSE_OVER_BOX_ENABLED)); - $l_bool_AlternativeTooltipsEnabled = MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_FOOTNOTES_MOUSE_OVER_BOX_ALTERNATIVE)); + self::$l_bool_TooltipsEnabled = MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_FOOTNOTES_MOUSE_OVER_BOX_ENABLED)); + self::$l_bool_AlternativeTooltipsEnabled = MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_FOOTNOTES_MOUSE_OVER_BOX_ALTERNATIVE)); - if ($l_bool_TooltipsEnabled) { + if (self::$l_bool_TooltipsEnabled) { echo '.footnote_tooltip {'; @@ -467,7 +483,7 @@ class MCI_Footnotes_Task { } // alternative tooltips: - if ( ! $l_bool_AlternativeTooltipsEnabled) { + if ( ! self::$l_bool_AlternativeTooltipsEnabled) { // tooltip position: $l_int_MaxWidth = MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_MAX_WIDTH); @@ -535,7 +551,7 @@ class MCI_Footnotes_Task { echo "\r\n\r\n"; // alternative tooltip script printed formatted not minified: - if ($l_bool_AlternativeTooltipsEnabled) { + if (self::$l_bool_AlternativeTooltipsEnabled) { ?>