From f8a87d592854b660f9935cc0bf58e92d08603082 Mon Sep 17 00:00:00 2001
From: pewgeuges <73141620+pewgeuges@users.noreply.github.com>
Date: Wed, 17 Feb 2021 10:58:28 +0000
Subject: [PATCH] =?UTF-8?q?dev=20version=20implementing=20@lolzim=E2=80=99?=
=?UTF-8?q?s=20bugfix=202.5.5d2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
git-svn-id: https://plugins.svn.wordpress.org/footnotes/trunk@2476267 b8457f37-d9ea-0310-8a92-e5e31aec5664
---
class/dashboard/subpage-main.php | 14 +++++++-------
class/settings.php | 9 +++++----
class/task.php | 25 +++++++++++++++++++++++--
css/settings.min.css | 2 +-
footnotes.php | 8 ++++----
readme.txt | 1 +
6 files changed, 41 insertions(+), 18 deletions(-)
diff --git a/class/dashboard/subpage-main.php b/class/dashboard/subpage-main.php
index a553dd5..cf4841f 100644
--- a/class/dashboard/subpage-main.php
+++ b/class/dashboard/subpage-main.php
@@ -7,7 +7,7 @@
* @since 1.5.0 14.09.14 14:47
*
*
- * @lastmodified 2021-02-12T1705+0100
+ * @lastmodified 2021-02-17T1136+0100
*
* @since 2.0.4 restore arrow settings 2020-11-01T0509+0100
* @since 2.1.0 read-on button label 2020-11-08T2148+0100
@@ -615,8 +615,8 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
$l_arr_Enabled = array(
"yes" => __("Yes", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
"no" => __("No", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)
- );
- // options for superscript normalize scope:
+ );
+ // options for superscript normalize scope:
$l_arr_NormalizeSuperscript = array(
"no" => __("No", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
"referrers" => __("Footnote referrers", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
@@ -679,7 +679,7 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
"alternative" => $this->addSelectBox(MCI_Footnotes_Settings::C_BOOL_FOOTNOTES_MOUSE_OVER_BOX_ALTERNATIVE, $l_arr_Enabled),
"notice-alternative" => __("Intended to work around a configuration-related tooltip outage.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
// The placeholder is the name of the plugin as logogram “footnotes”.
- "description-alternative" => sprintf(__("These alternative tooltips work around a website related jQuery UI outage. They are low-script but use the AMP incompatible onmouseover and onmouseout arguments, along with CSS transitions for fade-in/out. The very small script is inserted after Footnotes’ internal stylesheet. When this option is enabled, %s does not load jQuery UI nor jQuery Tools.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), '' . MCI_Footnotes_Config::C_STR_PLUGIN_PUBLIC_NAME . ''),
+ "description-alternative" => sprintf(__("These alternative tooltips work around a website related jQuery UI outage. They are low-script but use the AMP incompatible onmouseover and onmouseout arguments, along with CSS transitions for fade-in/out. The very small script is inserted after Footnotes’ internal stylesheet. When this option is enabled, %s does not load jQuery UI nor jQuery Tools.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), '' . MCI_Footnotes_Config::C_STR_PLUGIN_PUBLIC_NAME . ''),
)
);
@@ -839,9 +839,9 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
"label-separator" => $this->addLabel(MCI_Footnotes_Settings::C_STR_FOOTNOTES_TOOLTIP_EXCERPT_MIRROR_SEPARATOR, __("Separator between tooltip text and footnote text:", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
"separator" => $this->addTextBox(MCI_Footnotes_Settings::C_STR_FOOTNOTES_TOOLTIP_EXCERPT_MIRROR_SEPARATOR),
- "notice-separator" => __("May be a simple space, or a line break <br />, or any string in your language.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
-
- "description-mirror" => __("Tooltips, even jQuery-driven, may be hard to consult on mobiles. This option allows to find the tooltip content in the reference container too.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
+ "notice-separator" => __("May be a simple space, or a line break <br />, or any string in your language.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
+
+ "description-mirror" => __("Tooltips, even jQuery-driven, may be hard to consult on mobiles. This option allows to read the tooltip content in the reference container too.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
)
diff --git a/class/settings.php b/class/settings.php
index ddd1407..2ba15ae 100644
--- a/class/settings.php
+++ b/class/settings.php
@@ -7,7 +7,7 @@
* @since 1.5.0 14.09.14 10:43
*
*
- * @lastmodified 2021-02-17T1026+0100
+ * @lastmodified 2021-02-17T1136+0100
*
* @since 2.0.4 restore arrow settings 2020-11-02T2115+0100
* @since 2.0.7 remove hook the_post 2020-11-06T1342+0100
@@ -699,7 +699,7 @@ class MCI_Footnotes_Settings {
const C_BOOL_FOOTNOTE_SHORTCODE_SYNTAX_VALIDATION_ENABLE = "footnotes_inputfield_shortcode_syntax_validation_enable";
/**
- * Settings container key to enable a backlink tooltip.
+ * Settings container key to enable backlink tooltips.
*
* - Update: Reference container: Hard backlinks (optional): optional configurable tooltip hinting to use the backbutton instead, thanks to @theroninjedi47 bug report.
*
@@ -708,7 +708,8 @@ class MCI_Footnotes_Settings {
* @reporter @theroninjedi47
* @link https://wordpress.org/support/topic/hyperlinked-footnotes-creating-excessive-back-history/
*
- * When hard links are enabled, clicks on the backlinks are logged in the browsing history.
+ * When hard links are enabled, clicks on the backlinks are logged in the browsing history,
+ * along with clicks on the referrers.
* This tooltip hints to use the backbutton instead, so the history gets streamlined again.
* @link https://wordpress.org/support/topic/making-it-amp-compatible/#post-13837359
*
@@ -758,7 +759,7 @@ class MCI_Footnotes_Settings {
* @var str
*
* Tooltips, even jQuery-driven, may be hard to consult on mobiles.
- * This option allows to find the tooltip content in the reference container too.
+ * This option allows to read the tooltip content in the reference container too.
* @link https://wordpress.org/support/topic/change-tooltip-text/#post-13935050
* But this must not be the default behavior.
* @link https://wordpress.org/support/topic/change-tooltip-text/#post-13935488
diff --git a/class/task.php b/class/task.php
index e043a6b..13c416d 100644
--- a/class/task.php
+++ b/class/task.php
@@ -7,7 +7,7 @@
* @since 1.5.0
*
*
- * @lastmodified 2021-02-16T0055+0100
+ * @lastmodified 2021-02-17T1142+0100
*
* @since 2.0.0 Bugfix: various.
* @since 2.0.4 Bugfix: Referrers and backlinks: remove hard links to streamline browsing history, thanks to @theroninjedi47 bug report.
@@ -78,6 +78,7 @@
* @since 2.5.4 Bugfix: Reference container, tooltips: URL wrap: account for leading space in value, thanks to @karolszakiel example provision.
* @since 2.5.4 Update: Reference container: Hard backlinks (optional): optional configurable tooltip hinting to use the backbutton instead, thanks to @theroninjedi47 bug report.
* @since 2.5.4 Bugfix: Tooltips: fix display in Popup Maker popups by correcting a coding error.
+ * @since 2.5.5 Bugfix: Process: fix numbering bug impacting footnote #2 with footnote #1 close to start, thanks to @rumperuu bug report, thanks to @lolzim code contribution.
*/
// If called directly, abort:
@@ -1701,7 +1702,27 @@ class MCI_Footnotes_Task {
}
// add offset to the new starting position
$l_int_PosStart += $l_int_Length + strlen($l_str_EndingTag);
- $l_int_PosStart = $l_int_Length + strlen($l_str_FootnoteReplaceText);
+
+ /**
+ * Fixes a footnotes numbering bug (happening under de facto rare circumstances).
+ *
+ * - Bugfix: Process: fix numbering bug impacting footnote #2 with footnote #1 close to start, thanks to @rumperuu bug report, thanks to @lolzim code contribution.
+ *
+ * @since 2.5.5
+ *
+ * @contributor @lolzim
+ * @link https://wordpress.org/support/topic/footnotes-numbered-incorrectly/#post-14062032
+ *
+ * @reporter @rumperuu
+ * @link https://wordpress.org/support/topic/footnotes-numbered-incorrectly/
+ *
+ * This line caused the algorithm to jump back near the post start, disturbing
+ * the order of the footnotes depending on the text before the first footnote,
+ * the length of the first footnote and the length of the footnote and tooltip
+ * templates.
+ */
+ // $l_int_PosStart = $l_int_Length + strlen($l_str_FootnoteReplaceText);
+
} while (true);
// return content
diff --git a/css/settings.min.css b/css/settings.min.css
index d8387a1..fbafda4 100644
--- a/css/settings.min.css
+++ b/css/settings.min.css
@@ -1 +1 @@
-.postbox-header{position:relative;padding:0 20px}.footnotes_logo_heading{display:inline-block;float:left;position:absolute}.footnotes_logo_part1_heading{left:20px}.footnotes_logo_part2_heading{left:51px}.footnotes_heart_heading{color:#ff6d3b;font-weight:700;position:absolute;left:96px}#footnote_inputfield_love,#footnote_inputfield_readon_label,#footnote_inputfield_references_label{padding-left:8px!important;padding-right:8px!important;width:80%!important}#footnote_inputfield_reference_container_place{width:310px}#footnote_inputfield_counter_style,#footnotes_inputfield_page_layout_support{width:505px}#footnote_inputfield_custom_mouse_over_box_excerpt_length,#footnote_inputfield_placeholder_end,#footnote_inputfield_placeholder_start{width:180px}#footnote_inputfield_placeholder_end_user_defined,#footnote_inputfield_placeholder_start_user_defined{width:320px}#footnote_inputfield_combine_identical,#footnote_inputfield_custom_mouse_over_box_border_radius,#footnote_inputfield_custom_mouse_over_box_border_width,#footnote_inputfield_custom_mouse_over_box_excerpt_enabled,#footnote_inputfield_custom_mouse_over_box_max_width,#footnote_inputfield_custom_mouse_over_box_offset_x,#footnote_inputfield_custom_mouse_over_box_offset_y,#footnotes_inputfield_alternative_mouse_over_box_offset_x,#footnotes_inputfield_alternative_mouse_over_box_offset_y,#footnotes_inputfield_alternative_mouse_over_box_width,#footnotes_inputfield_mouse_over_box_fade_in_delay,#footnotes_inputfield_mouse_over_box_fade_in_duration,#footnotes_inputfield_mouse_over_box_fade_out_delay,#footnotes_inputfield_mouse_over_box_fade_out_duration,#footnotes_inputfield_scroll_duration,#footnotes_inputfield_scroll_offset{width:80px}#footnote_inputfield_custom_hyperlink_symbol,#footnotes_inputfield_backlinks_separator_option,#footnotes_inputfield_backlinks_terminator_option{width:230px}#footnotes_inputfield_backlinks_column_max_width_scalar,#footnotes_inputfield_backlinks_column_width_scalar,#footnotes_inputfield_mouse_over_box_font_size_scalar,#footnotes_inputfield_reference_container_bottom_margin,#footnotes_inputfield_reference_container_top_margin{width:85px}#footnotes_inputfield_backlinks_column_max_width_unit,#footnotes_inputfield_backlinks_column_width_unit,#footnotes_inputfield_mouse_over_box_font_size_unit{width:140px}label{display:inline-block}.postbox>h3{height:32px!important;line-height:32px!important}.postbox>h3>span{padding:0 10px}.postbox>.inside>table{border:none!important}.postbox>.inside>table>tbody>tr>td:first-child{width:15%!important;font-weight:700!important}.footnote_placeholder_box_container{text-align:center!important}span.footnote_highlight_placeholder{font-weight:700!important;padding:0 8px!important}.footnote_placeholder_box_example{border:2px solid #2bb975!important;border-radius:4px!important;padding:16px 0!important;width:50%!important;display:block!important;margin:20px auto!important;text-align:center!important}.expert_lookup tr td:first-child,.expert_lookup tr th:first-child{width:170px!important}.expert_lookup tr td:nth-child(2),.expert_lookup tr th:nth-child(2){width:65px!important}.expert_lookup tr td:nth-child(3),.expert_lookup tr th:nth-child(3){width:200px!important}.expert_lookup tr td:nth-child(3) input{width:190px}.expert_lookup tr td:last-child,.expert_lookup tr th:last-child{white-space:nowrap}#customize_css_new tr td:first-child{width:38%!important;font-weight:400!important}.customize_css_new tr td:first-child span:first-child{font-weight:700!important}.customize_css_new .list{padding-top:10px}.customize_css_new .list p{font-family:monospace;padding:0 10px;text-indent:-10px;margin:.5em 0}#footnote_inputfield_custom_css_new{height:500px}#footnote_inputfield_custom_css,#footnote_inputfield_custom_css_new{width:96%;resize:both;overflow:scroll;font-family:monospace}.footnotes_notice{font-style:italic;display:inline-block;text-align:end}.footnotes_description{padding:0 6%}.footnotes_description p{font-size:1.2em;font-style:italic}
\ No newline at end of file
+.footnotes_logo_heading{display:inline-block;float:left;position:absolute;text-decoration:none;font-weight:400}.footnotes_logo_part1_heading{left:20px;color:#2bb975}.footnotes_logo_part2_heading{left:51px;color:#545f5a}.footnotes_heart_heading{color:#ff6d3b;font-weight:700;position:absolute;left:96px}.postbox-header{position:relative;padding:0 20px}#footnote_inputfield_love,#footnote_inputfield_readon_label,#footnote_inputfield_references_label{padding-left:8px!important;padding-right:8px!important;width:80%!important}#footnote_inputfield_reference_container_place{width:310px}#footnote_inputfield_counter_style,#footnotes_inputfield_page_layout_support{width:505px}#footnote_inputfield_custom_mouse_over_box_excerpt_length,#footnote_inputfield_placeholder_end,#footnote_inputfield_placeholder_start{width:180px}#footnote_inputfield_placeholder_end_user_defined,#footnote_inputfield_placeholder_start_user_defined{width:320px}#footnote_inputfield_combine_identical,#footnote_inputfield_custom_mouse_over_box_border_radius,#footnote_inputfield_custom_mouse_over_box_border_width,#footnote_inputfield_custom_mouse_over_box_excerpt_enabled,#footnote_inputfield_custom_mouse_over_box_max_width,#footnote_inputfield_custom_mouse_over_box_offset_x,#footnote_inputfield_custom_mouse_over_box_offset_y,#footnotes_inputfield_alternative_mouse_over_box_offset_x,#footnotes_inputfield_alternative_mouse_over_box_offset_y,#footnotes_inputfield_alternative_mouse_over_box_width,#footnotes_inputfield_mouse_over_box_fade_in_delay,#footnotes_inputfield_mouse_over_box_fade_in_duration,#footnotes_inputfield_mouse_over_box_fade_out_delay,#footnotes_inputfield_mouse_over_box_fade_out_duration,#footnotes_inputfield_scroll_duration,#footnotes_inputfield_scroll_offset{width:80px}#footnote_inputfield_custom_hyperlink_symbol,#footnotes_inputfield_backlinks_separator_option,#footnotes_inputfield_backlinks_terminator_option{width:230px}#footnotes_inputfield_backlinks_column_max_width_scalar,#footnotes_inputfield_backlinks_column_width_scalar,#footnotes_inputfield_mouse_over_box_font_size_scalar,#footnotes_inputfield_reference_container_bottom_margin,#footnotes_inputfield_reference_container_top_margin{width:85px}#footnotes_inputfield_backlinks_column_max_width_unit,#footnotes_inputfield_backlinks_column_width_unit,#footnotes_inputfield_mouse_over_box_font_size_unit{width:140px}label{display:inline-block}.postbox>h3{height:32px!important;line-height:32px!important}.postbox>h3>span{padding:0 10px}.postbox>.inside>table{border:none!important}.postbox>.inside>table>tbody>tr>td:first-child{width:15%!important;font-weight:700!important}.footnote_placeholder_box_container{text-align:center!important}span.footnote_highlight_placeholder{font-weight:700!important;padding:0 8px!important}.footnote_placeholder_box_example{border:2px solid #2bb975!important;border-radius:4px!important;padding:16px 0!important;width:50%!important;display:block!important;margin:20px auto!important;text-align:center!important}.expert_lookup tr td:first-child,.expert_lookup tr th:first-child{width:170px!important}.expert_lookup tr td:nth-child(2),.expert_lookup tr th:nth-child(2){width:65px!important}.expert_lookup tr td:nth-child(3),.expert_lookup tr th:nth-child(3){width:200px!important}.expert_lookup tr td:nth-child(3) input{width:190px}.expert_lookup tr td:last-child,.expert_lookup tr th:last-child{white-space:nowrap}#customize_css_new tr td:first-child{width:38%!important;font-weight:400!important}.customize_css_new tr td:first-child span:first-child{font-weight:700!important}.customize_css_new .list{padding-top:10px}.customize_css_new .list p{font-family:monospace;padding:0 10px;text-indent:-10px;margin:.5em 0}#footnote_inputfield_custom_css_new{height:500px}#footnote_inputfield_custom_css,#footnote_inputfield_custom_css_new{width:96%;resize:both;overflow:scroll;font-family:monospace}.footnotes_notice{font-style:italic;display:inline-block;text-align:end}.footnotes_description{padding:0 4%}.footnotes_description p{font-size:1.06em;font-style:italic}
\ No newline at end of file
diff --git a/footnotes.php b/footnotes.php
index e761423..069e4d7 100755
--- a/footnotes.php
+++ b/footnotes.php
@@ -4,7 +4,7 @@
Plugin URI: https://wordpress.org/plugins/footnotes/
Description: time to bring footnotes to your website! footnotes are known from offline publishing and everybody takes them for granted when reading a magazine.
Author: Mark Cheret
- Version: 2.5.5d1
+ Version: 2.5.5d2
Author URI: http://cheret.de/plugins/footnotes-2/
Text Domain: footnotes
Domain Path: /languages
@@ -18,10 +18,10 @@
* @since 2.1.4
* @since 2.5.3 (Hungarian)
* @var str
- * @lastmodified 2021-02-17T1028+0100
+ * @lastmodified 2021-02-17T1137+0100
* @committer @pewgeuges
*/
-define( 'C_STR_FOOTNOTES_VERSION', '2.5.5d1' );
+define( 'C_STR_FOOTNOTES_VERSION', '2.5.5d2' );
/*
LICENSE NOTICE
@@ -70,6 +70,6 @@ $g_obj_MCI_Footnotes->run();
* In production, a minified CSS file tailored to the settings is enqueued.
*
* Developing stylesheets is meant to be easier when this is set to false.
- * WARNING: This facility is designed for development and must NOT be used in production.
+ * WARNING: This facility designed for development must NOT be used in production.
*/
define( 'C_BOOL_CSS_PRODUCTION_MODE', true );
diff --git a/readme.txt b/readme.txt
index 0717b4b..19633d7 100755
--- a/readme.txt
+++ b/readme.txt
@@ -83,6 +83,7 @@ Visit this swift write-up from a **footnotes** user by the name of **Southwest**
- Update: Stylesheets: increase speed and energy efficiency by tailoring stylesheets to the needs of the instance, thanks to @docteurfitness design contribution.
- Bugfix: Stylesheets: minify to shrink the carbon footprint, increase speed and implement best practice, thanks to @docteurfitness issue report.
- Bugfix: Libraries: optimize processes by loading external and internal scripts only if needed, thanks to @docteurfitness issue report.
+- Bugfix: Process: fix numbering bug impacting footnote #2 with footnote #1 close to start, thanks to @rumperuu bug report, thanks to @lolzim code contribution.
- Update: Dashboard: add or edit descriptions to the tooltips and tooltip text delimiter settings and the backlink symbol configuration setting.
- Update: Dashboard: decrease font size and padding of the descriptions.