From 82cb6d52680cc6be1259d12f26ddc1613c0820ae Mon Sep 17 00:00:00 2001 From: pewgeuges <73141620+pewgeuges@users.noreply.github.com> Date: Sun, 3 Jan 2021 20:03:51 +0000 Subject: [PATCH] development 2.4.0d0 needed for support git-svn-id: https://plugins.svn.wordpress.org/footnotes/trunk@2449533 b8457f37-d9ea-0310-8a92-e5e31aec5664 --- class/dashboard/subpage-main.php | 17 +++++++------ class/settings.php | 8 +++--- class/task.php | 25 ++++++++++++------- class/template.php | 17 +++++++------ css/public.css | 18 +++++++------ css/settings.css | 4 +-- footnotes.php | 4 +-- readme.txt | 13 +++++++--- templates/dashboard/customize-css-new.html | 3 ++- templates/note-for-developers.txt | 5 ++-- .../reference-container-body-3column.html | 2 +- 11 files changed, 69 insertions(+), 47 deletions(-) diff --git a/class/dashboard/subpage-main.php b/class/dashboard/subpage-main.php index d35b00f..4e381cd 100644 --- a/class/dashboard/subpage-main.php +++ b/class/dashboard/subpage-main.php @@ -6,6 +6,8 @@ * @author Stefan Herndler * @since 1.5.0 14.09.14 14:47 * + * Last modified: 2021-01-02T2335+0100 + * * Edited: * @since 2.0.4 restore arrow settings 2020-11-01T0509+0100 * @since 2.1.0 read-on button label 2020-11-08T2148+0100 @@ -36,9 +38,7 @@ * @since 2.3.0 add settings for hard links, thanks to @psykonevro and @martinneumannat 2020-12-29T1322+0100 * @see * @see - * @since 2.3.1 footnote shortcode syntax validation 2021-01-01T0624+0100 - * - * Last modified: 2021-01-01T1241+0100 + * @since 2.4.0 footnote shortcode syntax validation 2021-01-01T0624+0100 */ /** @@ -335,11 +335,13 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine { * @since 1.5.0 * * Edited heading 2020-12-12T1412+0100 - * @since 2.2.0 start/end short codes: more predefined options, thanks to @nikelaos 2020-12-12T1412+0100 + * @since 2.2.0 start/end short codes: more predefined options 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 + * @since 2.4.0 added warning about Block Editor escapement disruption 2021-01-02T2324+0100 + * @since 2.4.0 removed the HTML comment tag option 2021-01-02T2325+0100 */ public function StartEnd() { // footnotes start tag short code options: @@ -353,7 +355,6 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine { htmlspecialchars("") => htmlspecialchars(""), "[ref]" => "[ref]", htmlspecialchars("") => htmlspecialchars(""), - htmlspecialchars("") => htmlspecialchars(""), // Custom (user-defined) start and end tags bracketing the footnote text inline: - "userdefined" => __('custom short code', MCI_Footnotes_Config::C_STR_PLUGIN_NAME) + "userdefined" => __("custom short code", MCI_Footnotes_Config::C_STR_PLUGIN_NAME) ); // options for the syntax validation: $l_arr_Enable = array( @@ -383,6 +383,9 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine { // replace all placeholders $l_obj_Template->replace( array( + + "description" => __("WARNING: Short codes with closing pointy brackets are disabled in the new WordPress Block Editor that disrupts the traditional balanced escapement applied by WordPress Classic Editor.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), + "label-short-code-start" => $this->addLabel(MCI_Footnotes_Settings::C_STR_FOOTNOTES_SHORT_CODE_START, __("Footnote start tag short code:", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)), "short-code-start" => $this->addSelectBox(MCI_Footnotes_Settings::C_STR_FOOTNOTES_SHORT_CODE_START, $l_arr_ShortCodeStart), "short-code-start-user" => $this->addTextBox(MCI_Footnotes_Settings::C_STR_FOOTNOTES_SHORT_CODE_START_USER_DEFINED), diff --git a/class/settings.php b/class/settings.php index 9dc7fae..271ed6a 100644 --- a/class/settings.php +++ b/class/settings.php @@ -6,6 +6,8 @@ * @author Stefan Herndler * @since 1.5.0 14.09.14 10:43 * + * Last modified: 2021-01-02T2340+0100 + * * Edited: * @since 2.0.4 restore arrow settings 2020-11-02T2115+0100 * @since 2.0.7 remove hook the_post 2020-11-06T1342+0100 @@ -37,9 +39,7 @@ * @see * @since 2.3.0 swap Custom CSS migration Boolean from 'migration complete' to 'show legacy' 2020-12-27T1243+0100 * @since 2.3.0 referrers, reference container: settings for anchor slugs 2020-12-31T1429+0100 - * @since 2.3.1 footnote shortcode syntax validation 2021-01-01T0624+0100 - * - * Last modified: 2021-01-01T0624+0100 + * @since 2.4.0 footnote shortcode syntax validation 2021-01-01T0624+0100 */ @@ -569,7 +569,7 @@ class MCI_Footnotes_Settings { /** * Settings container key for shortcode syntax validation * - * @since 2.3.1 + * @since 2.4.0 * @var bool * * 2021-01-01T0616+0100 diff --git a/class/task.php b/class/task.php index 9808c30..3bfd931 100644 --- a/class/task.php +++ b/class/task.php @@ -8,6 +8,8 @@ * * Edited for v2.0.0 and following. * + * Last modified: 2021-01-03T2056+0100 + * * @since 2.0.5 Autoload / infinite scroll support added thanks to code from @docteurfitness * @see * @@ -64,9 +66,8 @@ * @see * @see * @since 2.3.0 swap Custom CSS migration Boolean from 'migration complete' to 'show legacy' 2020-12-27T1243+0100 - * @since 2.3.1 syntax validation for balanced footnote start and end tags 2021-01-01T0227+0100 - * - * Last modified: 2021-01-01T1239+0100 + * @since 2.4.0 syntax validation for balanced footnote start and end tags 2021-01-01T0227+0100 + * @since 2.4.0 scroll offset to a safety default value 34 right in the properties section 2021-01-03T2056+0100 */ // If called directly, abort: @@ -152,14 +153,17 @@ class MCI_Footnotes_Task { * @see * @since 2.3.0 * @var bool|str|int + * + * @since 2.4.0 scroll offset to a safety default value 34 right here 2021-01-03T2055+0100 + * Some websites are using really high fixed headers not contracting at scroll. */ public static $l_bool_HardLinksEnable = false; public static $l_str_ReferrerLinkSlug = 'r'; public static $l_str_FootnoteLinkSlug = 'f'; public static $l_str_LinkIdsSeparator = '+'; public static $l_str_PostContainerIdCompound = ''; - // scroll offset may now need to get into inline CSS: - public static $l_int_ScrollOffset = 0; + // scroll offset may now need to get into inline CSS; default: + public static $l_int_ScrollOffset = 34; /** * OPTIONAL LINK ELEMENT FOR FOOTNOTE REFERRERS AND BACKLINKS @@ -209,7 +213,7 @@ class MCI_Footnotes_Task { * is considered a design flaw, and the feature is released as a bug fix after overdue 2.3.0 * released in urgency to provide AMP compat before 2021. * - * @since 2.3.1 + * @since 2.4.0 * @var bool */ public static $l_bool_SyntaxErrorFlag = true; @@ -338,11 +342,14 @@ class MCI_Footnotes_Task { echo " {border-bottom: 1px solid #aaaaaa !important;}\r\n"; } - // ref container table borders: + // ref container table row borders: if ( MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_REFERENCE_CONTAINER_ROW_BORDERS_ENABLE))) { echo ".footnotes_table, .footnotes_plugin_reference_row {"; echo "border: 1px solid #060606;"; echo " !important;}\r\n"; + // adapt left padding to the presence of a border: + echo ".footnote_plugin_index, .footnote_plugin_index_combi {"; + echo "padding-left: 6px !important}\r\n"; } // ref container first column width and max-width: @@ -747,8 +754,8 @@ class MCI_Footnotes_Task { * @return string * * Edited since 2.0.0 - * - * @since 2.3.1 footnote shortcode syntax validation + * + * @since 2.4.0 footnote shortcode syntax validation */ public function search($p_str_Content, $p_bool_ConvertHtmlChars, $p_bool_HideFootnotesText) { diff --git a/class/template.php b/class/template.php index edc15b5..15123e9 100644 --- a/class/template.php +++ b/class/template.php @@ -6,16 +6,18 @@ * @author Stefan Herndler * @since 1.5.0 14.09.14 10:58 * + * Last modified: 2021-01-02T2352+0100 + * * Edited: + * @since 2.0.3 prettify reference container template * @since 2.0.3 further minify template content * @since 2.0.4 regex to delete multiple spaces - * + * @since 2.0.6 prettify other templates (footnote, tooltip script, ref container row) + * @since 2.2.6 delete a space before a closing pointy bracket * @since 2.2.6 support for custom templates in fixed location, while failing to add filter thanks to @misfist 2020-12-19T0606+0100 * @see - * @since 2.3.1 templates may be in active theme, thanks to @misfist + * @since 2.4.0 templates may be in active theme, thanks to @misfist * @see - * - * Last modified: 2021-01-01T2246+0100 */ @@ -80,9 +82,9 @@ class MCI_Footnotes_Template { * @since 2.2.6 support for custom templates 2020-12-19T0606+0100 * @see * - * @since 2.2.6 regex to delete a space before a closing pointy bracket + * @since 2.2.6 delete a space before a closing pointy bracket * - * @since 2.3.1 look for custom template in the active theme first, thanks to @misfist + * @since 2.4.0 look for custom template in the active theme first, thanks to @misfist * @see */ public function __construct($p_str_FileType, $p_str_FileName, $p_str_Extension = "html") { @@ -95,6 +97,7 @@ class MCI_Footnotes_Template { $l_str_TemplateFile = dirname(__FILE__) . "/../../../themes/"; // get active theme dir name (parent theme unlikely to contain custom templates): // see + // returns the stylesheet’s folder name, not the actual style sheet: $l_str_TemplateFile .= get_stylesheet(); $l_str_TemplateFile .= "/templates/footnotes/" . $p_str_FileName . "." . $p_str_Extension; @@ -116,7 +119,7 @@ class MCI_Footnotes_Template { } } - // minify template to some extent: + // minify template content 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); diff --git a/css/public.css b/css/public.css index 7233a76..8a12f6a 100755 --- a/css/public.css +++ b/css/public.css @@ -5,7 +5,10 @@ * Created-Time: 16:21 * Since: 1.0 * - * Version: 2.3.1 + * Version: 2.4.0 + * + * Last modified: 2021-01-02T1203+0100 + * * * Classes added to public.css may be added to the * list documenting CSS classes for Custom CSS if @@ -20,9 +23,7 @@ * @since 2.1.6 set z-index to maximum 2147483647 to address display issues with overlay content, thanks to @russianicons * @see * @since 2.3.0 offset anchors for optional hard links - * @since 2.3.1 validation error warning box - * - * Last modified: 2021-01-01T0642+0100 + * @since 2.4.0 validation error warning box */ @@ -65,7 +66,7 @@ post title, populated with the first instance of a content snippet preceded by an unbalanced start tag short code. -@since 2.3.1 +@since 2.4.0 */ .footnotes_validation_error { @@ -268,8 +269,9 @@ Classes: .footnote_plugin_index_combi = first if identical footnotes are combined .footnote_plugin_index = first if not .footnote_index = or in first in 3-column table -.footnote_plugin_link = or if identical footnotes are not combined, or second in 3-column table -.footnote_backlink = or if identical footnotes are combined, or in second in 3-column table +.footnote_plugin_symbol = second in 3-column table +.footnote_plugin_link = or (identical footnotes not combined) +.footnote_backlink = or .footnote_index_arrow = nested , symbol only .footnote_plugin_text = second , or third in 3-column table */ @@ -342,7 +344,7 @@ enforced borderless table cells with !important property, thanks to @ragonesi */ .footnote_plugin_index, .footnote_plugin_index_combi, -.footnote_plugin_link, +.footnote_plugin_symbol, .footnote_plugin_text { border: none !important; text-align: left !important; diff --git a/css/settings.css b/css/settings.css index 6078fe0..1d6c5d7 100755 --- a/css/settings.css +++ b/css/settings.css @@ -5,9 +5,9 @@ * Created-Time: 16:21 * Since: 1.0 * - * Version: 2.3.0 + * Version: 2.4.0 * - * Last modified: 2020-12-31T1026+0100 + * Last modified: 2021-01-02T1204+0100 */ diff --git a/footnotes.php b/footnotes.php index 1c53bee..c03cbfa 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.1d2 + Version: 2.4.0d0 Author URI: http://cheret.de/plugins/footnotes-2/ Text Domain: footnotes Domain Path: /languages */ -define( 'FOOTNOTES_VERSION', '2.3.1d2' ); +define( 'FOOTNOTES_VERSION', '2.4.0d0' ); /* Copyright 2020 Mark Cheret (email: mark@cheret.de) diff --git a/readme.txt b/readme.txt index 95c1834..ffab71d 100755 --- a/readme.txt +++ b/readme.txt @@ -80,9 +80,14 @@ Visit this swift write-up from a **footnotes** user by the name of **Southwest** == Changelog == -= 2.3.1 = -- Bugfix: Customization: support for custom templates in active theme, thanks to @misfist -- Bugfix: Shortcodes: syntax validation for balanced footnote start and end tag short codes += 2.4.0 = +- Bugfix: Shortcodes: Dashboard: warning about '>' escapement disruption in WordPress Block Editor +- Bugfix: Shortcodes: Dashboard: remove new option involving HTML comment tags only usable in source mode +- Add: Customization: support for custom templates in active theme, thanks to @misfist +- Add: Shortcodes: syntax validation for balanced footnote start and end tag short codes +- Add: Reference container: Row borders: more options for border width, style and color +- Bugfix: Reference container: Row borders: adapt left padding to the presence of a left border +- Bugfix: Reference container: add class footnote_plugin_symbol to disambiguate repurposed class footnote_plugin_link = 2.3.0 = - Add: optional hard links in referrers and backlinks for AMP compatibility, thanks to @psykonevro and @martinneumannat @@ -142,7 +147,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, thanks to @nikelaos +- Add: Start/end short codes: more predefined options - 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 diff --git a/templates/dashboard/customize-css-new.html b/templates/dashboard/customize-css-new.html index 4ef3e3b..74b737b 100644 --- a/templates/dashboard/customize-css-new.html +++ b/templates/dashboard/customize-css-new.html @@ -20,7 +20,8 @@

.footnote_plugin_index_combi = first <td> if identical footnotes are combined

.footnote_plugin_index = first <td> if not

.footnote_index = <a> or <span> in first <td> in 3-column table -

.footnote_plugin_link = <a> or <span> if identical footnotes are not combined, or second <td> in 3-column table +

.footnote_plugin_symbol = second <td> in 3-column table +

.footnote_plugin_link = <a> or <span> if identical footnotes are not combined

.footnote_backlink = <a> or <span> if identical footnotes are combined, or in second <td> in 3-column table

.footnote_index_arrow = nested <span>, symbol only

.footnote_plugin_text = second <td>, or third <td> in 3-column table diff --git a/templates/note-for-developers.txt b/templates/note-for-developers.txt index db0dd37..ffedd1f 100644 --- a/templates/note-for-developers.txt +++ b/templates/note-for-developers.txt @@ -1,6 +1,7 @@ note-for-developers.txt 2020-12-19T0609+0100 -Last modified: 2021-01-01T2249+0100 + +Last modified: 2021-01-02T1207+0100 Footnotes plugin for WordPress, v2.2.6 and later @@ -10,7 +11,7 @@ Support for custom templates Since v2.2.6, Footnotes supports custom templates. Custom templates may be loaded from a sibling folder 'footnotes-custom' -or since v2.3.1 from a folder 'templates/footnotes/' in the active theme. +or since v2.4.0 from a folder 'templates/footnotes/' in the active theme. Priority order: 1. active theme diff --git a/templates/public/reference-container-body-3column.html b/templates/public/reference-container-body-3column.html index 9a0889f..11dee83 100644 --- a/templates/public/reference-container-body-3column.html +++ b/templates/public/reference-container-body-3column.html @@ -10,7 +10,7 @@ >[[anchor-element]] <[[link-span]] onclick="footnote_moveToAnchor_[[post_id]]_[[container_id]]('footnote_plugin_tooltip_[[post_id]]_[[container_id]]_[[note_id]]');" class="footnote_backlink"