From 26326bdcd36e1c4873e4f7a2ac48f8f7a0d7e705 Mon Sep 17 00:00:00 2001 From: pewgeuges <73141620+pewgeuges@users.noreply.github.com> Date: Thu, 26 Nov 2020 17:15:21 +0000 Subject: [PATCH] development 2.1.4d3 (really) bugfix, for sharing on Forum git-svn-id: https://plugins.svn.wordpress.org/footnotes/trunk@2426754 b8457f37-d9ea-0310-8a92-e5e31aec5664 --- class/dashboard/layout.php | 2 +- class/init.php | 2 +- class/task.php | 53 +++++++++++++++++++++++++++----------- css/public.css | 8 +++--- css/settings.css | 4 +-- footnotes.php | 2 +- readme.txt | 5 ++++ 7 files changed, 52 insertions(+), 24 deletions(-) diff --git a/class/dashboard/layout.php b/class/dashboard/layout.php index 4b73596..519f056 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.4d2' + '2.1.4d3' ); // UPDATE version # when making changes to settings.css, FOR CACHE BUSTING diff --git a/class/init.php b/class/init.php index 4720164..fd494b7 100644 --- a/class/init.php +++ b/class/init.php @@ -160,7 +160,7 @@ class MCI_Footnotes { 'mci-footnotes-css-public', plugins_url('../css/public.css', __FILE__), '', - '2.1.4d2' + '2.1.4d3' ); } diff --git a/class/task.php b/class/task.php index ee9e9c9..8090f17 100644 --- a/class/task.php +++ b/class/task.php @@ -19,8 +19,9 @@ * 2.1.2: options for the other hooks 2020-11-19T1849+0100 * 2.1.4: fix line wrapping of URLs based on pattern, not link element 2020-11-25T0837+0100 * 2.1.4: fix issues with link elements by making them optional 2020-11-26T1051+0100 + * 2.1.4: support appending arrow when combining identicals is on 2020-11-26T1633+0100 * - * Last modified: 2020-11-26T1051+0100 + * Last modified: 2020-11-26T1706+0100 */ // If called directly, abort: @@ -638,20 +639,20 @@ class MCI_Footnotes_Task { // line breaks for source readability: $l_str_Body = "\r\n\r\n"; - // when combine identical is turned on, another template is needed: + // when combining identical footnotes is turned on, another template is needed: if (MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_COMBINE_IDENTICAL_FOOTNOTES))) { - // In the combined template, identifiers only are clickable. + // the combining template allows for backlink clusters and supports cell clicking for single notes: $l_obj_Template = new MCI_Footnotes_Template(MCI_Footnotes_Template::C_STR_PUBLIC, "reference-container-body-combi"); } else { - // when 3-column layout is turned on (only valid if combining is turned off): + // when 3-column layout is turned on (only available if combining is turned off): if (MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_REFERENCE_CONTAINER_3COLUMN_LAYOUT_ENABLE))) { $l_obj_Template = new MCI_Footnotes_Template(MCI_Footnotes_Template::C_STR_PUBLIC, "reference-container-body-3column"); } else { - // when switch symbol and index is turned on (only valid if 3-column is disabled): + // when switch symbol and index is turned on, and combining and 3-columns are off: if (MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_REFERENCE_CONTAINER_BACKLINK_SYMBOL_SWITCH))) { $l_obj_Template = new MCI_Footnotes_Template(MCI_Footnotes_Template::C_STR_PUBLIC, "reference-container-body-switch"); @@ -664,6 +665,19 @@ class MCI_Footnotes_Task { } } + // SET SWITCH FLAG INDEPENDENTLY + + if (MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_REFERENCE_CONTAINER_BACKLINK_SYMBOL_SWITCH))) { + + $l_bool_SymbolSwitch = true; + + } else { + + $l_bool_SymbolSwitch = false; + + } + + // FILL IN THE TEMPLATE // loop through all footnotes found in the page @@ -681,7 +695,7 @@ class MCI_Footnotes_Task { // INDEX COLUMN WITH ONE BACKLINK PER TABLE ROW - // Standard behavior appropriate for combine identical TURNED OFF + // Standard behavior appropriate for combining identicals turned off // generate content of footnote index cell $l_int_FirstFootnoteIndex = ($l_int_Index + 1); @@ -692,9 +706,7 @@ class MCI_Footnotes_Task { - // SUPPORT FOR COMBINE IDENTICAL: COMPOSING ENUMERATED BACKLINKS - - $l_str_FootnoteBacklinks = ""; + // SUPPORT FOR COMBINING IDENTICALS: COMPOSE ENUMERATED BACKLINKS if ( MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_COMBINE_IDENTICAL_FOOTNOTES))) { @@ -716,16 +728,24 @@ class MCI_Footnotes_Task { $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"; + // finish both single note and notes cluster, depending on switch option status: + if ($l_bool_SymbolSwitch) { + $l_str_FootnoteReference .= ">$l_str_FootnoteId$l_str_FootnoteArrow"; + $l_str_FootnoteBacklinks .= ">$l_str_FootnoteId$l_str_FootnoteArrow"; + + } else { + + $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. } - // CHECK IF COMBINE IDENTICAL IS TURNED ON, and + // CHECK IF COMBINING IDENTICALS IS TURNED ON, and // check if it isn't the last footnote in the array: if ($l_int_FirstFootnoteIndex < count(self::$a_arr_Footnotes) && MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_COMBINE_IDENTICAL_FOOTNOTES))) { @@ -756,8 +776,11 @@ class MCI_Footnotes_Task { $l_str_FootnoteBacklinks .= '" class="footnote_backlink" '; $l_str_FootnoteBacklinks .= 'onclick="footnote_moveToAnchor_' . $l_int_PostId; $l_str_FootnoteBacklinks .= "('footnote_plugin_tooltip_$l_int_PostId"; - $l_str_FootnoteBacklinks .= "_$l_str_FootnoteId');\""; - $l_str_FootnoteBacklinks .= ">$l_str_FootnoteArrow$l_str_FootnoteId"; + $l_str_FootnoteBacklinks .= "_$l_str_FootnoteId');\">"; + $l_str_FootnoteBacklinks .= $l_bool_SymbolSwitch ? '' : $l_str_FootnoteArrow; + $l_str_FootnoteBacklinks .= $l_str_FootnoteId; + $l_str_FootnoteBacklinks .= $l_bool_SymbolSwitch ? $l_str_FootnoteArrow : ''; + $l_str_FootnoteBacklinks .= ""; // 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)); diff --git a/css/public.css b/css/public.css index cebe4f7..7431a4b 100755 --- a/css/public.css +++ b/css/public.css @@ -4,9 +4,9 @@ * Created-Date: 15.05.14 * Created-Time: 16:21 * Since: 1.0 - * Version: 2.1.4d2 + * Version: 2.1.4d3 * - * Last modified: 2020-11-26T1050+0100 + * Last modified: 2020-11-26T1805+0100 */ @@ -82,7 +82,7 @@ templates/public/footnote-alternative.html .footnote_referrer:hover, .footnote_referrer a:hover, .footnote_plugin_tooltip_text:hover { - text-decoration: underline; + text-decoration: none; font-weight: inherit; } @@ -242,7 +242,7 @@ when hovered in some themes, not in others: .footnote_plugin_link:hover, .footnote_plugin_text a:hover { text-decoration: unset; - text-decoration: underline !important; + text-decoration: underline; /*deprioritized to ease customization*/ } .footnote_plugin_index, .footnote_plugin_index_combi { diff --git a/css/settings.css b/css/settings.css index 50795de..7303da5 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.4d2 + * Version: 2.1.4d3 * - * Last modified: 2020-11-26T1050+0100 + * Last modified: 2020-11-26T1804+0100 */ diff --git a/footnotes.php b/footnotes.php index d081a15..46c9b04 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.4d2 + Version: 2.1.4d3 Author URI: http://cheret.de/plugins/footnotes-2/ Text Domain: footnotes Domain Path: /languages diff --git a/readme.txt b/readme.txt index 4971fe7..fec3ffd 100755 --- a/readme.txt +++ b/readme.txt @@ -80,6 +80,11 @@ Visit this swift write-up from a **footnotes** user by the name of **Southwest** == Changelog == += 2.1.4d3 = +- Bugfix: Reference container: Backlink symbol: support for appending when combining identicals is on +- Bugfix: Reference container: Backlinks: deprioritize hover underline to ease customization +- Bugfix: Footnote referrers: disable hover underline + = 2.1.4d2 = - Bugfix: Styling: Referrers and backlinks: make link elements optional to fix issues - Update: Dashboard: Expert mode: streamline and update description for hooks and priority levels