From 7cadbec59aabd83fcca7bc589fcb7f4d8c7a89b3 Mon Sep 17 00:00:00 2001
From: pewgeuges <73141620+pewgeuges@users.noreply.github.com>
Date: Tue, 24 Nov 2020 09:22:27 +0000
Subject: [PATCH] update trunk for upcoming 2.1.3, thanks for testing!
git-svn-id: https://plugins.svn.wordpress.org/footnotes/trunk@2424352 b8457f37-d9ea-0310-8a92-e5e31aec5664
---
class/dashboard/layout.php | 2 +-
class/dashboard/subpage-main.php | 4 +-
class/init.php | 7 +-
class/settings.php | 27 ++++--
class/task.php | 92 ++++++++++---------
css/public.css | 21 +++--
css/settings.css | 4 +-
footnotes.php | 2 +-
readme.txt | 8 ++
templates/dashboard/expert-lookup.html | 1 +
.../reference-container-body-combi.html | 5 +-
11 files changed, 102 insertions(+), 71 deletions(-)
diff --git a/class/dashboard/layout.php b/class/dashboard/layout.php
index 939f25c..ccc57eb 100644
--- a/class/dashboard/layout.php
+++ b/class/dashboard/layout.php
@@ -207,7 +207,7 @@ abstract class MCI_Footnotes_LayoutEngine {
'mci-footnotes-admin-styles',
plugins_url('../../css/settings.css', __FILE__),
'',
- '2.1.2'
+ '2.1.3'
);
// UPDATE version # when making changes to settings.css, FOR CACHE BUSTING
diff --git a/class/dashboard/subpage-main.php b/class/dashboard/subpage-main.php
index 1d19a3d..aa2fcfd 100644
--- a/class/dashboard/subpage-main.php
+++ b/class/dashboard/subpage-main.php
@@ -10,8 +10,9 @@
* 2.0.4 2020-11-01T0509+0100
* 2.1.0 2020-11-08T2148+0100
* 2.1.1 2020-11-16T2152+0100
+ * 2.1.3 2020-11-24T0955+0100
*
- * Last modified: 2020-11-16T2152+0100
+ * Last modified: 2020-11-24T0955+0100
*/
/**
@@ -498,6 +499,7 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
"description-4" => __("For the reference container to sit above related posts, the priority level of the_content hook may need to be at most 1200.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
"description-5" => __("For Footnotes to work when a glossary plugin is active, a higher priority of 1000 may be needed.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
"description-6" => __("For the_content, another good pick with proven efficiency is priority level 10.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
+ "description-7" => __("Usually only the_content should be enabled; widget_text may cause issues in accordions, the_title causes issues in browser tabs.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
"head-hook" => __("WordPress hook function name", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
"head-checkbox" => __("Activate", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
diff --git a/class/init.php b/class/init.php
index 0f05ec1..989ebc5 100644
--- a/class/init.php
+++ b/class/init.php
@@ -3,7 +3,8 @@
* Includes the main Class of the Plugin.
*
* ******************************************************************************************************
- * IMPORTANT: In registerPublic() line 134: Please keep plugin version # up to date for cache busting. *
+ * IMPORTANT: In registerPublic() line 163: Please keep plugin version # up to date for cache busting. *
+ * Also in class/dashboard/layout:210 for settings.css *
* ******************************************************************************************************
*
* @filesource
@@ -15,7 +16,7 @@
* Edited for v2.0.3: Added style sheet versioning 2020-10-29T1413+0100
* Edited for v2.0.4: Added jQuery UI from WordPress 2020-11-01T1902+0100
*
- * Continual update of version number.
+ * Continual update of version number for cache busting.
*/
@@ -159,7 +160,7 @@ class MCI_Footnotes {
'mci-footnotes-css-public',
plugins_url('../css/public.css', __FILE__),
'',
- '2.1.2'
+ '2.1.3'
);
}
diff --git a/class/settings.php b/class/settings.php
index db68362..c968bcf 100644
--- a/class/settings.php
+++ b/class/settings.php
@@ -16,7 +16,7 @@
* 2.1.1 fix start pages by option to hide ref container
* 2.1.1 fix ref container by option restoring 3-column layout
* 2.1.1 fix ref container by option to switch index/symbol 2020-11-16T2022+0100
- * 2.1.1 fix ref container positioning by priority level 2020-11-17T0205+0100
+ * 2.1.3 fix ref container positioning by priority level 2020-11-17T0205+0100
*
* Last modified: 2020-11-17T0311+0100
*/
@@ -440,7 +440,7 @@ class MCI_Footnotes_Settings {
self::C_STR_FOOTNOTES_SHORT_CODE_END_USER_DEFINED => '',
self::C_STR_FOOTNOTES_COUNTER_STYLE => 'arabic_plain',
self::C_STR_FOOTNOTES_LOVE => 'no',
- self::C_BOOL_FOOTNOTES_IN_EXCERPT => 'yes',
+ self::C_BOOL_FOOTNOTES_IN_EXCERPT => 'no',
// since removal of the_post hook, expert mode is no danger zone
// not for experts only; raising awareness about relative positioning
@@ -513,12 +513,21 @@ class MCI_Footnotes_Settings {
// Titles should all be enabled by default to prevent users from
// thinking at first that the feature is broken in post titles.
// See
- // Yet in titles, footnotes are functionally pointless in WordPress.
- self::C_BOOL_EXPERT_LOOKUP_THE_TITLE => '',
- self::C_BOOL_EXPERT_LOOKUP_THE_CONTENT => 'yes',
- self::C_BOOL_EXPERT_LOOKUP_THE_EXCERPT => 'yes',
- self::C_BOOL_EXPERT_LOOKUP_WIDGET_TITLE => '',
- self::C_BOOL_EXPERT_LOOKUP_WIDGET_TEXT => 'yes',
+ // Yet in titles, footnotes are functionally pointless in WordPress.
+ self::C_BOOL_EXPERT_LOOKUP_THE_TITLE => '',
+
+ // This is the only useful one:
+ self::C_BOOL_EXPERT_LOOKUP_THE_CONTENT => 'yes',
+
+ // And the_excerpt is disabled by default following @nikelaos in
+ //
+ //
+ self::C_BOOL_EXPERT_LOOKUP_THE_EXCERPT => '',
+
+ self::C_BOOL_EXPERT_LOOKUP_WIDGET_TITLE => '',
+
+ // disabled by default because of issues with footnotes in Elementor accordions:
+ self::C_BOOL_EXPERT_LOOKUP_WIDGET_TEXT => '',
// initially hard-coded default
// shows "9223372036854775807" in the numbox
@@ -526,7 +535,7 @@ class MCI_Footnotes_Settings {
// but a numbox cannot be set to empty:
// define -1 as PHP_INT_MAX instead
self::C_INT_EXPERT_LOOKUP_THE_TITLE_PRIORITY_LEVEL => PHP_INT_MAX,
- self::C_INT_EXPERT_LOOKUP_THE_CONTENT_PRIORITY_LEVEL => PHP_INT_MAX,
+ self::C_INT_EXPERT_LOOKUP_THE_CONTENT_PRIORITY_LEVEL => 10,
self::C_INT_EXPERT_LOOKUP_THE_EXCERPT_PRIORITY_LEVEL => PHP_INT_MAX,
self::C_INT_EXPERT_LOOKUP_WIDGET_TITLE_PRIORITY_LEVEL => PHP_INT_MAX,
self::C_INT_EXPERT_LOOKUP_WIDGET_TEXT_PRIORITY_LEVEL => PHP_INT_MAX,
diff --git a/class/task.php b/class/task.php
index 23f66f9..78485fe 100644
--- a/class/task.php
+++ b/class/task.php
@@ -17,7 +17,8 @@
* 2.1.1: options fixing ref container layout and referrer vertical alignment 2020-11-16T2024+0100
* 2.1.1: option fixing ref container relative position 2020-11-17T0254+0100
* 2.1.2: options for the other hooks 2020-11-19T1849+0100
- * 2.1.2: support for Elementor accordion toggle section names 2020-11-20T0617+0100
+ *
+ * Last modified: 2020-11-24T0957+0100
*/
// If called directly, abort:
@@ -66,11 +67,14 @@ class MCI_Footnotes_Task {
*
* Edited for:
* 2.0.5 through v2.0.7 changes to priority 2020-11-02T0330+0100..2020-11-06T1344+0100
- * 2.2.0 add settings for all hooks 2020-11-19T1248+0100
+ * 2.1.1 add setting for the_content
+ * 2.1.2 add settings for 4 other hooks 2020-11-19T1248+0100
*
- * Explicitly setting the_content priority to "10" instead of lowest "PHP_INT_MAX",
+ * Setting the_content priority to "10" instead of PHP_INT_MAX i.e. 9223372036854775807
* makes the footnotes reference container display beneath the post and above other
* features added by other plugins, e.g. related post lists and social buttons.
+ * For YARPP to display related posts below the Footnotes reference container,
+ * priority needs to be at least 1200.
* Requested by users:
* Documentation:
*
@@ -148,7 +152,6 @@ class MCI_Footnotes_Task {
?>
get(MCI_Footnotes_Settings::C_BOOL_FOOTNOTES_MOUSE_OVER_BOX_ALTERNATIVE))) {
@@ -376,15 +383,7 @@ class MCI_Footnotes_Task {
// post ID to make everything unique wrt infinite scroll and archive view
global $l_int_PostId;
- // add support for Elementor section names:
- // Element_Section::get_name()
- // see
- if (function_exists('Element_Section::get_name')) {
- $l_int_PostId = Element_Section::get_name();
- } else {
- // work in WordPress mode:
- $l_int_PostId = get_the_id();
- }
+ $l_int_PostId = get_the_id();
// contains the index for the next footnote on this page
$l_int_FootnoteIndex = count(self::$a_arr_Footnotes) + 1;
@@ -547,15 +546,7 @@ class MCI_Footnotes_Task {
// post ID to make everything unique wrt infinite scroll and archive view:
global $l_int_PostId;
- // add support for Elementor section names: 2020-11-20T0615+0100
- // Element_Section::get_name()
- // see
- if (function_exists('Element_Section::get_name')) {
- $l_int_PostId = Element_Section::get_name();
- } else {
- // work in WordPress mode:
- $l_int_PostId = get_the_id();
- }
+ $l_int_PostId = get_the_id();
// no footnotes has been replaced on this page
if (empty(self::$a_arr_Footnotes)) {
@@ -660,17 +651,24 @@ class MCI_Footnotes_Task {
$l_str_FootnoteId = $l_str_FootnoteIndex;
- // The dedicated template enumerating backlinks uses a new placeholder:
+ // in case the footnote is unique:
+ $l_str_FootnoteReference = '';
+ // the click event goes in the table cell:
+ $l_str_BacklinkEvent = ' onclick="footnote_moveToAnchor_' . $l_int_PostId;
+ $l_str_BacklinkEvent .= "('footnote_plugin_tooltip_$l_int_PostId";
+ $l_str_BacklinkEvent .= "_$l_str_FootnoteId');\"";
+
+ // the dedicated template enumerating backlinks uses another variable:
+ $l_str_FootnoteBacklinks = $l_str_FootnoteReference;
+ $l_str_FootnoteBacklinks .= $l_str_BacklinkEvent;
+
+ // finish both single note and notes cluster:
+ $l_str_FootnoteReference .= ">$l_str_FootnoteArrow$l_str_FootnoteId";
+ $l_str_FootnoteBacklinks .= ">$l_str_FootnoteArrow$l_str_FootnoteId";
// If that is the only footnote with this text, we’re done.
@@ -690,6 +688,9 @@ class MCI_Footnotes_Task {
// if so, set the further footnote as empty so it won't be displayed later:
self::$a_arr_Footnotes[$l_int_CheckIndex] = "";
+ // cancel the event altogether:
+ $l_str_BacklinkEvent = "";
+
// HERE GOES THE FRAGMENT IDENTIFIER AND THE BACKLINK TOO:
// add the footnote index to the actual index:
@@ -697,16 +698,15 @@ class MCI_Footnotes_Task {
// update the footnote ID:
$l_str_FootnoteId = MCI_Footnotes_Convert::Index(($l_int_CheckIndex + 1), MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_FOOTNOTES_COUNTER_STYLE));
- // keep on composing the backlinks enumeration:
+ // resume composing the backlinks enumeration:
$l_str_FootnoteBacklinks .= ', ';
+ $l_str_FootnoteBacklinks .= "_$l_str_FootnoteId');\"";
+ $l_str_FootnoteBacklinks .= ">$l_str_FootnoteArrow$l_str_FootnoteId";
// this legacy is not used:
//$l_str_FootnoteIndex .= ', ' . MCI_Footnotes_Convert::Index(($l_int_CheckIndex + 1), MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_FOOTNOTES_COUNTER_STYLE));
@@ -717,6 +717,8 @@ class MCI_Footnotes_Task {
// replace all placeholders in 'templates/public/reference-container-body.html'
// or in 'templates/public/reference-container-body-combi.html'
+ // or in 'templates/public/reference-container-body-3column.html'
+ // or in 'templates/public/reference-container-body-switch.html'
$l_obj_Template->replace(
array(
// placeholder used in all templates:
@@ -727,7 +729,9 @@ class MCI_Footnotes_Task {
"id" => MCI_Footnotes_Convert::Index($l_int_FirstFootnoteIndex, MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_FOOTNOTES_COUNTER_STYLE)),
// used in standard layout WITH COMBINED IDENTICALS TURNED ON:
- "backlinks" => $l_str_FootnoteBacklinks,
+ "pointer" => empty($l_str_BacklinkEvent) ? '' : ' pointer',
+ "event" => $l_str_BacklinkEvent,
+ "backlinks" => empty($l_str_BacklinkEvent) ? $l_str_FootnoteBacklinks : $l_str_FootnoteReference,
// Legacy placeholders for use in legacy layout templates:
"arrow" => $l_str_FootnoteArrow,
diff --git a/css/public.css b/css/public.css
index 8bf7701..8c8e215 100755
--- a/css/public.css
+++ b/css/public.css
@@ -4,13 +4,13 @@
* Created-Date: 15.05.14
* Created-Time: 16:21
* Since: 1.0
- * Version: 2.1.2
+ * Version: 2.1.3
*
- * Last modified: 2020-11-20T0620+0100
+ * Last modified: 2020-11-24T0958+0100
*/
-/*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
+/*****************************************************
MCI Footnotes logo
The classes with 'heading' fix display in dashboard
@@ -33,7 +33,7 @@ css/settings.css
color: #545f5a;
}
-/*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
+/*****************************************************
Footnote referrers and tooltips
templates/public/footnote.html
@@ -131,7 +131,7 @@ Read-on button
}
-/*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
+/*****************************************************
Footnote references container
templates/public/reference-container.html
@@ -192,7 +192,6 @@ footnotes
reference-container-body.html
*/
.footnote_plugin_index,
-.footnote_plugin_index_combi,
.footnote_plugin_link,
.footnote_plugin_text {
border:none !important;
@@ -225,7 +224,7 @@ when hovered in some themes, not in others:
}
.footnote_plugin_index {
max-width: 140px;
- width: 2em; /*auto-extending column to fit widest*/
+ width: 2em; /*auto-expanding column to fit widest*/
}
.footnote_backlink,
.footnote_plugin_link {
@@ -241,6 +240,12 @@ when hovered in some themes, not in others:
.footnote_plugin_text {
width: unset; /*unset width of text column to fix site issues*/
}
+/*
+prevent long URLs from expanding the reference container in mobile view:
+*/
+.footnote_plugin_text a {
+ word-wrap: anywhere;
+}
/*
Responsive
@@ -251,7 +256,7 @@ Responsive
}
}
-/*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
+/****************************************************************
Footnotes printing style rules
Printing a table, browsers tend to avoid page breaks,
diff --git a/css/settings.css b/css/settings.css
index 99ec4c8..cc18444 100755
--- a/css/settings.css
+++ b/css/settings.css
@@ -4,9 +4,9 @@
* Created-Date: 15.05.14
* Created-Time: 16:21
* Since: 1.0
- * Version: 2.1.2
+ * Version: 2.1.3
*
- * Last modified: 2020-11-20T0620+0100
+ * Last modified: 2020-11-24T0957+0100
*/
diff --git a/footnotes.php b/footnotes.php
index e7de7f1..90d4e32 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.1.2
+ Version: 2.1.3
Author URI: http://cheret.de/plugins/footnotes-2/
Text Domain: footnotes
Domain Path: /languages
diff --git a/readme.txt b/readme.txt
index 9c8d7a2..2d72a3e 100755
--- a/readme.txt
+++ b/readme.txt
@@ -80,6 +80,14 @@ Visit this swift write-up from a **footnotes** user by the name of **Southwest**
== Changelog ==
+= 2.1.3 =
+- Bugfix: disable widget_text hook by default to fix accordions declaring headings as widgets
+- Bugfix: Reference container: fix column width when combining turned on by reverting new CSS class to legacy
+- Bugfix: Reference container: fix width in mobile view by URL wrapping wrt Unicode-non-conformant browsers
+- Bugfix: Reference container: table cell backlinking if index is single and combining identicals turned on
+- Bugfix: Styling: raise Custom CSS priority to override settings
+- Bugfix: Styling: Tooltips: raise settings priority to override theme style sheets
+
= 2.1.2 =
- Bugfix: Layout: Reference container: Backlinks: no underline on hover cell when combining identicals is on
- Bugfix: Elementor: add experimental support for section name function
diff --git a/templates/dashboard/expert-lookup.html b/templates/dashboard/expert-lookup.html
index 36c3610..36f3a68 100644
--- a/templates/dashboard/expert-lookup.html
+++ b/templates/dashboard/expert-lookup.html
@@ -5,6 +5,7 @@
[[description-4]]
[[description-5]]
[[description-6]]
+ [[description-7]]
diff --git a/templates/public/reference-container-body-combi.html b/templates/public/reference-container-body-combi.html
index 303218e..f3484f1 100644
--- a/templates/public/reference-container-body-combi.html
+++ b/templates/public/reference-container-body-combi.html
@@ -1,8 +1,9 @@
+ >[[text]]