From f3b2f0e8640dab5eab1646a19ef601ebf98a6980 Mon Sep 17 00:00:00 2001 From: pewgeuges <73141620+pewgeuges@users.noreply.github.com> Date: Wed, 23 Dec 2020 03:34:51 +0000 Subject: [PATCH] urgent bugfix release 2.2.6 in response to bug report on forum git-svn-id: https://plugins.svn.wordpress.org/footnotes/trunk@2444735 b8457f37-d9ea-0310-8a92-e5e31aec5664 --- class/dashboard/subpage-main.php | 12 +++++-- class/settings.php | 16 +++++++-- class/task.php | 56 +++++++++++++++++++++++--------- class/template.php | 11 +++++-- css/public.css | 22 +++++++++++-- css/settings.css | 4 +-- footnotes.php | 4 +-- readme.txt | 33 ++++++++++--------- 8 files changed, 113 insertions(+), 45 deletions(-) diff --git a/class/dashboard/subpage-main.php b/class/dashboard/subpage-main.php index 5b3eb88..1ed2502 100644 --- a/class/dashboard/subpage-main.php +++ b/class/dashboard/subpage-main.php @@ -10,10 +10,14 @@ * 2.0.4 restore arrow settings 2020-11-01T0509+0100 * 2.1.0 read-on button label 2020-11-08T2148+0100 * 2.1.1 options for ref container and alternative tooltips 2020-11-16T2152+0100 + * 2.1.2 priority level settings for all other hooks, thanks to @nikelaos + * @see * 2.1.4 settings for ref container, tooltips and scrolling 2020-12-03T0950+0100 * 2.1.6 slight UI reordering 2020-12-09T1114+0100 * 2.1.6 option to disable URL line wrapping 2020-12-09T1604+0100 * 2.1.6 remove expert mode setting as outdated 2020-12-09T2105+0100 + * 2.2.0 start/end short codes: more predefined options, thanks to @nikelaos + * @see * 2.2.0 add options, redistribute, update strings 2020-12-12T2135+0100 * 2.2.0 shortcode for reference container custom position 2020-12-13T2055+0100 * 2.2.2 Custom CSS settings container migration 2020-12-15T0709+0100 @@ -23,7 +27,7 @@ * 2.2.5 options for label element and label bottom border, thanks to @markhillyer 2020-12-18T1447+0100 * @see * - * Last modified: 2020-12-18T1631+0100 + * Last modified: 2020-12-20T0533+0100 */ /** @@ -308,7 +312,8 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine { * @since 1.5.0 * * Edited heading 2020-12-12T1412+0100 - * @since 2.2.0 more short code options 2020-12-12T1412+0100 + * @since 2.2.0 start/end short codes: more predefined options, thanks to @nikelaos 2020-12-12T1412+0100 + * @see * @since 2.2.0 3 boxes for clarity 2020-12-12T1422+0100 * @since 2.2.5 support for Ibid. notation thanks to @meglio 2020-12-17T2019+0100 * @see @@ -485,7 +490,8 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine { * @since 1.5.0 * * Edited heading 2020-12-12T1453+0100 - * @since 2.1.1 more settings and notices + * @since 2.1.1 more settings and notices, thanks to @nikelaos + * @see * @since 2.2.0 dedicated to the excerpt setting and its notices 2020-12-12T1454+0100 */ public function Excerpts() { diff --git a/class/settings.php b/class/settings.php index b4dac3f..8a9e9c8 100644 --- a/class/settings.php +++ b/class/settings.php @@ -17,10 +17,12 @@ * @see * 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 + * @since 2.1.3 excerpt hook: disable by default, thanks to @nikelaos + * @see * 2.1.3 fix ref container positioning by priority level 2020-11-17T0205+0100 * 2.1.4 more settings container keys 2020-12-03T0955+0100 * 2.1.6 option to disable URL line wrapping 2020-12-09T1606+0100 - * 2.1.6 set default priority level of the_content to 98 2020-12-10T0447+0100 + * 2.1.6 set default priority level of the_content to 98 to prevent plugin conflict, thanks to @marthalindeman 2020-12-10T0447+0100 * 2.2.0 reference container custom position shortcode, thanks to @hamshe 2020-12-13T2056+0100 * @see * 2.2.2 Custom CSS settings container migration 2020-12-15T0709+0100 @@ -29,7 +31,7 @@ * 2.2.5 options for reference container label element and bottom border, thanks to @markhillyer 2020-12-18T1455+0100 * @see * - * Last modified: 2020-12-18T1632+0100 + * Last modified: 2020-12-20T0518+0100 */ @@ -397,6 +399,9 @@ class MCI_Footnotes_Settings { * @var string * * 2020-11-16T0859+0100 + * + * option to enable/disable the superscript element for referrers, thanks to @cwbayer + * @see */ 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"; @@ -553,6 +558,11 @@ class MCI_Footnotes_Settings { * @author Stefan Herndler * @since 1.5.0 * @var array + * + * Edited multiple times. + * + * @since 2.1.3 excerpt hook: disable by default, thanks to @nikelaos + * @see */ private $a_arr_Default = array( @@ -614,7 +624,7 @@ class MCI_Footnotes_Settings { // whether to use link elements: self::C_BOOL_LINK_ELEMENT_ENABLED => 'yes', - // excerpt should be disabled: + // excerpt should be disabled: self::C_BOOL_FOOTNOTES_IN_EXCERPT => 'no', // since removal of the_post hook, expert mode is no danger zone diff --git a/class/task.php b/class/task.php index cd8b35a..1976004 100644 --- a/class/task.php +++ b/class/task.php @@ -19,8 +19,10 @@ * 2.1.1 fix start pages by option to hide ref container, thanks to @dragon013 * @see * 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.1 priority level option fixing ref container relative position, thanks to june01, @spaceling, @imeson 2020-11-17T0254+0100 + * @see + * 2.1.2 priority level settings for all other hooks, thanks to @nikelaos 2020-11-19T1849+0100 + * @see * 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 @@ -29,8 +31,11 @@ * 2.1.4 ref container column width and tooltip font size settings 2020-12-03T0954+0100 * 2.1.4 scroll offset and duration settings 2020-12-05T0538+0100 * 2.1.4 tooltip display duration settings 2020-12-06T1320+0100 + * 2.1.5 URL wrap: exclude image source too, thanks to @bjrnet21 + * @see * 2.1.6 option to disable URL line wrapping 2020-12-09T1606+0100 - * 2.1.6 add catch-all exclusion to fix URL line wrapping 2020-12-09T1921+0100 + * 2.1.6 add catch-all exclusion to fix URL line wrapping, thanks to @a223123131 2020-12-09T1921+0100 + * @see * 2.2.0 support for custom position shortcode for reference container, thanks to @hamshe 2020-12-13T2058+0100 * @see * 2.2.3 custom CSS from new setting in header after legacy 2020-12-15T1128+0100 @@ -39,8 +44,10 @@ * @see * 2.2.5 options for label element and label bottom border, thanks to @markhillyer 2020-12-18T1447+0100 * @see + * 2.2.6 URL wrap: make the quotation mark optional in the exclusion regex, thanks to @spiralofhope2 2020-12-23T0409+0100 + * @see * - * Last modified: 2020-12-18T1751+0100 + * Last modified: 2020-12-23T0423+0100 */ // If called directly, abort: @@ -641,13 +648,30 @@ class MCI_Footnotes_Task { // get footnote text $l_str_FootnoteText = substr($p_str_Content, $l_int_PosStart + strlen($l_str_StartingTag), $l_int_Length - strlen($l_str_StartingTag)); - // fix line wrapping of URLs (hyperlinked or not) based on pattern, not link element, - // to prevent them from hanging out of the tooltip in non-Unicode-compliant user agents. - // spare however values of the href and the src arguments! - // Even ARIA labels may take an URL as value, so use \w=[\'"] as a catch-all 2020-12-10T1005+0100 - // see public.css + + /** + * URL line wrap + * + * Fix line wrapping of URLs (hyperlinked or not) based on pattern, not link element, + * to prevent them from hanging out of the tooltip in non-Unicode-compliant user agents. + * @see public.css + * + * spare however values of the href and the src arguments! + * @since 2.1.5 exclude image source too, thanks to @bjrnet21 + * @see + * + * Even ARIA labels may take a URL as value, so use \w=[\'"] as a catch-all 2020-12-10T1005+0100 + * @since 2.1.6 add catch-all exclusion to fix URL line wrapping, thanks to @a223123131 2020-12-09T1921+0100 + * @see + * + * @since 2.1.6 option to disable URL line wrapping 2020-12-09T1606+0100 + * + * URLs may be a query string in a URL: + * @since 2.2.6 make the quotation mark optional in the exclusion regex, thanks to @spiralofhope2 2020-12-23T0409+0100 + * @see + */ if (MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_FOOTNOTE_URL_WRAP_ENABLED))) { - $l_str_FootnoteText = preg_replace( '#(?$1', $l_str_FootnoteText ); + $l_str_FootnoteText = preg_replace( '#(?$1', $l_str_FootnoteText ); } // Text to be displayed instead of the footnote @@ -775,7 +799,8 @@ 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 + * Contributed by @docteurfitness + * @see * @since 2.0.5 * * post ID to make everything unique wrt infinite scroll and archive view: @@ -801,12 +826,11 @@ class MCI_Footnotes_Task { * 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 + * @since 2.0.0 the link elements have been added and are present. + * @since 2.0.4 the link addresses were removed. + * @since 2.1.4 the presence of elements was made optional, 2020-11-25T1306+0100 */ $l_str_LinkSpan = MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_LINK_ELEMENT_ENABLED)) ? 'a' : 'span'; diff --git a/class/template.php b/class/template.php index 1692ced..6debbc8 100644 --- a/class/template.php +++ b/class/template.php @@ -10,9 +10,10 @@ * @since 2.0.3 further minify template content * @since 2.0.4 regex to delete multiple spaces * - * @since 2.3.0 support for custom templates 2020-12-19T0606+0100 + * @since 2.3.0 support for custom templates in fixed location, while failing to add filter thanks to @misfist 2020-12-19T0606+0100 + * @see * - * Last modified: 2020-12-19T0713+0100 + * Last modified: 2020-12-20T0200+0100 */ @@ -75,6 +76,9 @@ class MCI_Footnotes_Template { * @since 2.0.4 regex to delete multiple spaces * * @since 2.3.0 support for custom templates 2020-12-19T0606+0100 + * @see + * + * @since 2.3.0 regex to delete space before > */ public function __construct($p_str_FileType, $p_str_FileName, $p_str_Extension = "html") { // no template file type and/or file name set @@ -87,6 +91,7 @@ class MCI_Footnotes_Template { $l_str_TemplateFile = dirname(__FILE__) . "/../../footnotes-custom/templates/" . $p_str_FileType . "/" . $p_str_FileName . "." . $p_str_Extension; if (!file_exists($l_str_TemplateFile)) { + // else load internal template: // get absolute path to the specified template file $l_str_TemplateFile = dirname(__FILE__) . "/../templates/" . $p_str_FileType . "/" . $p_str_FileName . "." . $p_str_Extension; // Template file does not exist @@ -95,11 +100,13 @@ class MCI_Footnotes_Template { } } + // minify template to some extent: // get Template file content $this->a_str_OriginalContent = str_replace("\n", "", file_get_contents($l_str_TemplateFile)); $this->a_str_OriginalContent = str_replace("\r", "", $this->a_str_OriginalContent); $this->a_str_OriginalContent = str_replace("\t", " ", $this->a_str_OriginalContent); $this->a_str_OriginalContent = preg_replace('# +#', " ", $this->a_str_OriginalContent); + $this->a_str_OriginalContent = str_replace(" >", ">", $this->a_str_OriginalContent); $this->reload(); } diff --git a/css/public.css b/css/public.css index 5dc74fa..8303028 100755 --- a/css/public.css +++ b/css/public.css @@ -5,14 +5,22 @@ * Created-Time: 16:21 * Since: 1.0 * - * Version: 2.2.5 + * Version: 2.2.6 * * Classes added to public.css may be added to the * list documenting CSS classes for Custom CSS if * recommended for general use. * List in templates/dashboard/customize-css-new.html * - * Last modified: 2020-12-18T1701+0100 + * Edited for 2.0.0 + * @since 2.0.1 enforced borderless table cells with !important property, thanks to @ragonesi + * @see + * @since 2.1.1 line height 0 for (superscript) referrers, thanks to @cwbayer + * @see + * @since 2.1.6 set z-index to maximum 2147483647 to address display issues with overlay content, thanks to @russianicons + * @see + * + * Last modified: 2020-12-23T0426+0100 */ @@ -102,6 +110,12 @@ Classes: font-weight: inherit; } +/* +tooltips + +@since 2.1.6 set z-index to maximum 2147483647 to address display issues with overlay content, thanks to @russianicons +@see +*/ .footnote_tooltip { display: none; z-index: 2147483647 !important; @@ -264,6 +278,10 @@ table /* footnotes + +enforced borderless table cells with !important property, thanks to @ragonesi +@since 2.0.1 +@see */ .footnote_plugin_index, .footnote_plugin_index_combi, diff --git a/css/settings.css b/css/settings.css index 55bfc03..0ffe379 100755 --- a/css/settings.css +++ b/css/settings.css @@ -5,9 +5,9 @@ * Created-Time: 16:21 * Since: 1.0 * - * Version: 2.2.5 + * Version: 2.2.6 * - * Last modified: 2020-12-18T1629+0100 + * Last modified: 2020-12-23T0426+0100 */ diff --git a/footnotes.php b/footnotes.php index 2c2b76d..030907b 100755 --- a/footnotes.php +++ b/footnotes.php @@ -4,12 +4,12 @@ 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.3.0d0 + Version: 2.2.6 Author URI: http://cheret.de/plugins/footnotes-2/ Text Domain: footnotes Domain Path: /languages */ -define( 'FOOTNOTES_VERSION', '2.3.0d0' ); +define( 'FOOTNOTES_VERSION', '2.2.6' ); /* Copyright 2020 Mark Cheret (email: mark@cheret.de) diff --git a/readme.txt b/readme.txt index d111220..a26e1ef 100755 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Tags: footnote, footnotes, bibliography, formatting, notes, Post, posts, referen Requires at least: 3.9 Tested up to: 5.6 Requires PHP: 5.6 -Stable Tag: 2.2.5 +Stable Tag: 2.2.6 License: GPLv3 or later License URI: http://www.gnu.org/licenses/gpl-3.0.html @@ -80,8 +80,9 @@ Visit this swift write-up from a **footnotes** user by the name of **Southwest** == Changelog == -= 2.3.0d0 = -- Add: Customization: support for custom templates += 2.2.6 = +- Bugfix: Reference container, tooltips: URL wrap: make the quotation mark optional wrt query parameters, thanks to @spiralofhope2 +- Add: Customization: support for custom templates in sibling folder (should be filterable function, thanks to @misfist) = 2.2.5 = - Add: Dashboard: Footnotes numbering: add support for Ibid. notation in suggestions for guidance, thanks to @meglio @@ -109,7 +110,7 @@ Visit this swift write-up from a **footnotes** user by the name of **Southwest** - Add: Reference container: support for custom position shortcode, thanks to @hamshe - Update: Priority levels: update the notice in the dashboard Priority tab - Bugfix: Tooltips: add 'important' property to z-index to fix display overlay issue -- Add: Start/end short codes: more predefined options +- Add: Start/end short codes: more predefined options, thanks to @nikelaos - Add: Numbering styles: lowercase Roman numerals support - Update: Dashboard: Tooltip settings: grouped into 3 thematic containers - Update: Dashboard: Main settings: grouped into 3 specific containers @@ -122,9 +123,9 @@ Visit this swift write-up from a **footnotes** user by the name of **Southwest** - Add: Footnotes mention in the footer: more options = 2.1.6 = -- Bugfix: Priority levels: set the_content priority level to 98 to prevent plugin conflict -- Bugfix: Tooltips: set z-index to maximum 2147483647 to address display issues with overlay content -- Bugfix: Reference container, tooltips: URL wrap: fix issues with span by catch-all negative lookbehind +- Bugfix: Priority levels: set the_content priority level to 98 to prevent plugin conflict, thanks to @marthalindeman +- Bugfix: Tooltips: set z-index to maximum 2147483647 to address display issues with overlay content, thanks to @russianicons +- Bugfix: Reference container, tooltips: URL wrap: fix regex, thanks to @a223123131 - Bugfix: Dashboard: URL wrap: add option to properly enable/disable URL wrap - Update: Dashboard: reorder tabs and update tab labels - Bugfix: Dashboard: remove Expert mode enable setting since permanently enabled as 'Priority' @@ -132,7 +133,7 @@ Visit this swift write-up from a **footnotes** user by the name of **Southwest** - Bugfix: Localization: conform to WordPress plugin language file name scheme = 2.1.5 = -- Bugfix: Reference container, tooltips: URL wrap: exclude image source too +- Bugfix: Reference container, tooltips: URL wrap: exclude image source too, thanks to @bjrnet21 = 2.1.4 = - Add: Dashboard: Main settings: add settings for scroll offset and duration @@ -156,12 +157,13 @@ Visit this swift write-up from a **footnotes** user by the name of **Southwest** - Bugfix: Dashboard: Main settings: fix layout, raise shortcodes to top - Bugfix: Dashboard: Tooltip settings: Truncation length: change input box type from text to numeric - Update: Dashboard: Notices: use explicit italic style -- Bugfix: Dashboard: Other settings: Excerpt: display guidance next to select box +- Bugfix: Dashboard: Other settings: Excerpt: display guidance next to select box, thanks to @nikelaos - Bugfix: WordPress hooks: the_content: set priority to 1000 as a safeguard - Update: Dashboard: Expert mode: streamline and update description for hooks and priority levels = 2.1.3 = -- Bugfix: disable widget_text hook by default to fix accordions declaring headings as widgets +- Bugfix: Hooks: disable widget_text hook by default to fix accordions declaring headings as widgets +- Bugfix: Hooks: disable the_excerpt hook by default to fix issues, thanks to @nikelaos - 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 @@ -170,9 +172,9 @@ Visit this swift write-up from a **footnotes** user by the name of **Southwest** = 2.1.2 = - Bugfix: Layout: Reference container: Backlinks: no underline on hover cell when combining identicals is on -- Bugfix: Dashboard: priority level settings for all other hooks +- Bugfix: Dashboard: priority level settings for all other hooks, thanks to @nikelaos - Update: Dashboard: WordPress documentation URLs of the hooks -- Update: Dashboard: feature description for the hooks priority level settings (not yet localized) +- Update: Dashboard: feature description for the hooks priority level settings, thanks to @nikelaos = 2.1.1 = - Bugfix: Combining identical footnotes: fix dead links, ensure referrer-backlink bijectivity, thanks to @happyches @@ -183,8 +185,8 @@ Visit this swift write-up from a **footnotes** user by the name of **Southwest** - Bugfix: UI: Tooltips: optional alternative JS implementation with CSS animation to fix site issues - Bugfix: UI: Tooltips: add delay (400ms) before fade-out to fix UX wrt links and Read-on button - Bugfix: UI: Tooltips: fix line breaking for hyperlinked URLs in Unicode-non-compliant user agents -- Bugfix: Layout: Footnote referrers: select box to make superscript optional wrt themes w/o support -- Bugfix: Layout: Reference container: fix relative positioning by priority level setting +- Bugfix: Layout: Footnote referrers: select box to make superscript optional wrt themes w/o support, thanks to @cwbayer +- Bugfix: Layout: Reference container: fix relative positioning by priority level setting, thanks to june01, @spaceling, @imeson - Bugfix: Layout: Reference container: Backlink symbol: select box to disable instead of space character - Bugfix: Layout: Reference container: Footnote number links: disable bottom border for theme compatibility - Bugfix: Layout: Reference container: option to restore 3-column layout when combined are turned off @@ -221,6 +223,7 @@ Visit this swift write-up from a **footnotes** user by the name of **Southwest** - Bugfix: UI: Reference container: Collapse button fully clickable, not sign only - Bugfix: UI: Reference container: Collapse button 'collapse' with minus sign not hyphen-minus - Update: UX: Tooltip: set display predelay to 0 for responsiveness (was 800 since 2.0.0, 400 before) +- Update: UX: Tooltip: set fade duration to 200ms both ways (was 200 in and 2000 out since 2.0.0, 0 in and 100 out before) - BUGFIX: Priority level back to PHP_INT_MAX (ref container positioning not this plugin’s responsibility) = 2.0.5 = @@ -256,7 +259,7 @@ Visit this swift write-up from a **footnotes** user by the name of **Southwest** - Bugfix: Disabled underline in footnote anchors, underline only on hover = 2.0.1 = -- Bugfix: Fixed public.css +- Bugfix: enforced borderless table cells with !important property, thanks to @ragonesi - Update: Language fr_FR along with es_ES, de_AT, de_DE, en_GB, en_US for 2.0 = 2.0.0 =