From 5a97dbb05a0c13b95637d894567fabf487afedbc Mon Sep 17 00:00:00 2001 From: pewgeuges <73141620+pewgeuges@users.noreply.github.com> Date: Thu, 26 Nov 2020 09:54:41 +0000 Subject: [PATCH] development 2.1.4d3 bugfix, for sharing on Forum git-svn-id: https://plugins.svn.wordpress.org/footnotes/trunk@2426439 b8457f37-d9ea-0310-8a92-e5e31aec5664 --- class/dashboard/layout.php | 2 +- class/dashboard/subpage-main.php | 19 ++++++++------- class/init.php | 2 +- class/settings.php | 25 ++++++++++++++++++-- class/task.php | 31 +++++++++++++------------ css/public.css | 12 +++++----- css/settings.css | 4 ++-- footnotes.php | 2 +- readme.txt | 6 +++++ templates/dashboard/expert-lookup.html | 10 +++----- templates/dashboard/settings-other.html | 6 ++++- 11 files changed, 74 insertions(+), 45 deletions(-) diff --git a/class/dashboard/layout.php b/class/dashboard/layout.php index b01be16..4b73596 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.4d1' + '2.1.4d2' ); // 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 aa2fcfd..3000360 100644 --- a/class/dashboard/subpage-main.php +++ b/class/dashboard/subpage-main.php @@ -11,8 +11,9 @@ * 2.1.0 2020-11-08T2148+0100 * 2.1.1 2020-11-16T2152+0100 * 2.1.3 2020-11-24T0955+0100 + * 2.1.4 2020-11-26T1052+0100 * - * Last modified: 2020-11-24T0955+0100 + * Last modified: 2020-11-26T1052+0100 */ /** @@ -89,9 +90,9 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine { // Change string "%s styling" to "Footnotes styling" to fix layout in WPv5.5: $this->addMetaBox("settings", "styling", __("Footnotes styling", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "Styling"), $this->addMetaBox("settings", "reference-container", __("References Container", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "ReferenceContainer"), + $this->addMetaBox("settings", "other", __("Other", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "Other"), // Leave intact since this is not localized: $this->addMetaBox("settings", "love", MCI_Footnotes_Config::C_STR_PLUGIN_HEADING_NAME . ' ' . MCI_Footnotes_Config::C_STR_LOVE_SYMBOL_HEADING, "Love"), - $this->addMetaBox("settings", "other", __("Other", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "Other"), // This is restored to meet user demand for arrow symbol semantics: $this->addMetaBox("customize", "hyperlink-arrow", __("Hyperlink symbol in the Reference container", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "HyperlinkArrow"), @@ -276,6 +277,8 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine { // replace all placeholders $l_obj_Template->replace( array( + "label-link" => $this->addLabel(MCI_Footnotes_Settings::C_BOOL_LINK_ELEMENT_ENABLED, __("Use the link element for referrers and backlinks", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)), + "link" => $this->addSelectBox(MCI_Footnotes_Settings::C_BOOL_LINK_ELEMENT_ENABLED, $l_arr_Enabled), "label-excerpt" => $this->addLabel(MCI_Footnotes_Settings::C_BOOL_FOOTNOTES_IN_EXCERPT, __("Allow footnotes on Summarized Posts", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)), "excerpt" => $this->addSelectBox(MCI_Footnotes_Settings::C_BOOL_FOOTNOTES_IN_EXCERPT, $l_arr_Enabled), "label-expert-mode" => $this->addLabel(MCI_Footnotes_Settings::C_BOOL_FOOTNOTES_EXPERT_MODE, __("Enable the Expert mode", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)), @@ -493,13 +496,11 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine { $l_obj_Template->replace( array( - "description-1" => __("The priority level determines whether Footnotes is executed timely before other plugins, and how the reference container is positioned relative to other features.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), - "description-2" => __("Default 9223372036854775807 is lowest priority, 0 is highest.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), - "description-3" => __("To restore default priority, set to -1, interpreted as 9223372036854775807, the constant PHP_INT_MAX.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), - "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), + "description-1" => __("The priority level determines whether Footnotes is executed timely before other plugins, and how the reference container is positioned relative to other features", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), + "description-2" => __("Default 9223372036854775807 is lowest priority, 0 is highest", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), + "description-3" => __("To restore default priority, set to -1, interpreted as 9223372036854775807, the constant PHP_INT_MAX", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), + "description-4" => __("For the_content, this figure needs to be lower than 1200 to make sure that a feature inserted by another plugin running at 1200 displays below the reference container", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), + "description-5" => __("For Elementor accordions, the widget_text hook must be disabled", 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 0a2c67e..4720164 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.4d1' + '2.1.4d2' ); } diff --git a/class/settings.php b/class/settings.php index 1a7f2ec..3b6252c 100644 --- a/class/settings.php +++ b/class/settings.php @@ -373,7 +373,7 @@ class MCI_Footnotes_Settings { const C_STR_FOOTNOTES_TOOLTIP_READON_LABEL = "footnote_inputfield_readon_label"; /** - * Settings Container Keys of options fixing default layout + * Settings Container Keys for options fixing default layout * * @since 2.1.1 * @var string @@ -381,18 +381,37 @@ class MCI_Footnotes_Settings { * 2020-11-16T0859+0100 */ const C_BOOL_FOOTNOTES_REFERRER_SUPERSCRIPT_TAGS = "footnotes_inputfield_referrer_superscript_tags"; - const C_BOOL_REFERENCE_CONTAINER_BACKLINK_SYMBOL_ENABLE = "footnotes_inputfield_reference_container_backlink_symbol_enable"; const C_BOOL_REFERENCE_CONTAINER_START_PAGE_ENABLE = "footnotes_inputfield_reference_container_start_page_enable"; const C_BOOL_REFERENCE_CONTAINER_3COLUMN_LAYOUT_ENABLE = "footnotes_inputfield_reference_container_3column_layout_enable"; const C_BOOL_REFERENCE_CONTAINER_BACKLINK_SYMBOL_SWITCH = "footnotes_inputfield_reference_container_backlink_symbol_switch"; + /** + * Settings Container Keys for hook priority levels + * + * @since 2.1.1 (the_content) + * @since 2.1.2 + * @var string + * + * 2020-11-16T0859+0100 + * 2020-11-20T0620+0100 + */ const C_INT_EXPERT_LOOKUP_THE_TITLE_PRIORITY_LEVEL = "footnote_inputfield_expert_lookup_the_title_priority_level"; const C_INT_EXPERT_LOOKUP_THE_CONTENT_PRIORITY_LEVEL = "footnote_inputfield_expert_lookup_the_content_priority_level"; const C_INT_EXPERT_LOOKUP_THE_EXCERPT_PRIORITY_LEVEL = "footnote_inputfield_expert_lookup_the_excerpt_priority_level"; const C_INT_EXPERT_LOOKUP_WIDGET_TITLE_PRIORITY_LEVEL = "footnote_inputfield_expert_lookup_widget_title_priority_level"; const C_INT_EXPERT_LOOKUP_WIDGET_TEXT_PRIORITY_LEVEL = "footnote_inputfield_expert_lookup_widget_text_priority_level"; + /** + * Settings Container Keys for the link element option + * + * @since 2.1.4 + * @var string + * + * 2020-11-26T1002+0100 + */ + const C_BOOL_LINK_ELEMENT_ENABLED = "footnote_inputfield_link_element_enabled"; + /** @@ -434,6 +453,8 @@ class MCI_Footnotes_Settings { self::C_BOOL_REFERENCE_CONTAINER_3COLUMN_LAYOUT_ENABLE => 'no', self::C_BOOL_REFERENCE_CONTAINER_BACKLINK_SYMBOL_SWITCH => 'no', + self::C_BOOL_LINK_ELEMENT_ENABLED => 'yes', + self::C_STR_FOOTNOTES_SHORT_CODE_START => '((', self::C_STR_FOOTNOTES_SHORT_CODE_END => '))', self::C_STR_FOOTNOTES_SHORT_CODE_START_USER_DEFINED => '', diff --git a/class/task.php b/class/task.php index 405310e..ee9e9c9 100644 --- a/class/task.php +++ b/class/task.php @@ -18,8 +18,9 @@ * 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.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 * - * Last modified: 2020-11-26T0036+0100 + * Last modified: 2020-11-26T1051+0100 */ // If called directly, abort: @@ -484,16 +485,17 @@ class MCI_Footnotes_Task { $l_str_SupSpan = 'span'; } - // determine whether the link element is used, see below - - + // determine whether the link element is used, see below in ReferenceContainer() + $l_str_LinkSpan = MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_LINK_ELEMENT_ENABLED)) ? 'a' : 'span'; + + // fill in 'templates/public/footnote.html': $l_obj_Template->replace( array( "post_id" => $l_int_PostId, "id" => $l_int_Index, - "link-start" => '', - "link-end" => '', + "link-start" => $l_str_LinkSpan == 'a' ? '' : '', + "link-end" => $l_str_LinkSpan == 'a' ? '' : '', "sup-span" => $l_str_SupSpan, "before" => MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_FOOTNOTES_STYLING_BEFORE), "index" => $l_int_Index, @@ -563,7 +565,7 @@ class MCI_Footnotes_Task { /** * INFINITE SCROLL / AUTOLOAD, ARCHIVE VIEW - * + * * Multiple posts are appended to each other, functions and IDs must be disambiguated. * Contributed by @docteurfitness * @since 2.0.5 @@ -576,7 +578,7 @@ class MCI_Footnotes_Task { /** * OPTIONAL LINK ELEMENT FOR FOOTNOTE REFERRERS AND BACKLINKS - * + * * STYLING: * Link color is preferred for referrers and backlinks. * Setting a global link color is a common feature in WordPress themes. @@ -585,23 +587,22 @@ class MCI_Footnotes_Task { * Hence the link element must be present for styling purposes. * But styling these elements with the link color is not universally preferred. * If not, the very presence of the link elements may need to be avoided. - * + * * FUNCTIONALITY: * Although widely used for that purpose, hyperlinks are disliked for footnote linking. * Browsers may need to be prevented from logging these clicks in the browsing history, * as logging compromises the usability of the 'return to previous' button in browsers. * For that purpose, and for scroll animation, this linking is performed by JavaScript. - * + * * The link elements have been added and are present @since 2.0.0. * Then the link addresses were removed @since 2.0.4. * Then the presence of elements was made optional * @since 2.1.4 * 2020-11-25T1306+0100 */ - $l_str_LinkSpan = true ? 'a' : 'span'; - // in progress ############################################## - - + $l_str_LinkSpan = MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_LINK_ELEMENT_ENABLED)) ? 'a' : 'span'; + + // FOOTNOTE INDEX BACKLINK SYMBOL // check if arrow is enabled: @@ -767,7 +768,7 @@ class MCI_Footnotes_Task { // line wrapping of URLs already fixed, see: // $l_str_FootnoteText = preg_replace( '#(?$1', $l_str_FootnoteText ); - + // 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' diff --git a/css/public.css b/css/public.css index 2c30a6c..cebe4f7 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.4d1 + * Version: 2.1.4d2 * - * Last modified: 2020-11-26T0037+0100 + * Last modified: 2020-11-26T1050+0100 */ @@ -44,12 +44,13 @@ class/task.php not cross-browser compatible: word-break: break-word; -word-break: break-all; overflow-wrap: anywhere; word-wrap: anywhere; +word-break: break-all; */ .footnote_url_wrap { + overflow-wrap: break-word; word-wrap: break-word; } @@ -76,9 +77,7 @@ templates/public/footnote-alternative.html text-decoration: none !important; border-bottom: none !important; line-height: 0; - cursor: pointer; - position: relative; - vertical-align: baseline; + cursor: pointer; } .footnote_referrer:hover, .footnote_referrer a:hover, @@ -143,6 +142,7 @@ Read-on button color: green; text-decoration: none !important; cursor: pointer; + white-space: nowrap; } .footnote_tooltip_continue:hover { color: blue; diff --git a/css/settings.css b/css/settings.css index 51e6f6e..50795de 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.4d1 + * Version: 2.1.4d2 * - * Last modified: 2020-11-26T0036+0100 + * Last modified: 2020-11-26T1050+0100 */ diff --git a/footnotes.php b/footnotes.php index 151e17f..d081a15 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.4d1 + Version: 2.1.4d2 Author URI: http://cheret.de/plugins/footnotes-2/ Text Domain: footnotes Domain Path: /languages diff --git a/readme.txt b/readme.txt index e0eac15..4971fe7 100755 --- a/readme.txt +++ b/readme.txt @@ -80,8 +80,14 @@ Visit this swift write-up from a **footnotes** user by the name of **Southwest** == Changelog == += 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 +- Bugfix: Layout: Tooltip: prevent line break in Read-on link label + = 2.1.4d1 = - Bugfix: Reference container, tooltips: fix line wrapping of URLs based on pattern, not link element +- Bugfix: Reference container: Styles: re-add the class dedicated to combined footnotes indices = 2.1.3 = - Bugfix: disable widget_text hook by default to fix accordions declaring headings as widgets diff --git a/templates/dashboard/expert-lookup.html b/templates/dashboard/expert-lookup.html index 36f3a68..da54ec1 100644 --- a/templates/dashboard/expert-lookup.html +++ b/templates/dashboard/expert-lookup.html @@ -1,11 +1,7 @@
-

[[description-1]]

-

[[description-2]]

-

[[description-3]]

-

[[description-4]]

-

[[description-5]]

-

[[description-6]]

-

[[description-7]]

+

[[description-1]].

+

[[description-2]]. [[description-3]].

+

[[description-4]]. [[description-5]].

diff --git a/templates/dashboard/settings-other.html b/templates/dashboard/settings-other.html index e0a8006..ad0711b 100644 --- a/templates/dashboard/settings-other.html +++ b/templates/dashboard/settings-other.html @@ -1,5 +1,9 @@
+ + + + @@ -9,4 +13,4 @@ -
[[label-link]][[link]]
[[label-excerpt]] [[excerpt]][[expert-mode]]
\ No newline at end of file +