development 2.4.0d0 needed for support

git-svn-id: https://plugins.svn.wordpress.org/footnotes/trunk@2449533 b8457f37-d9ea-0310-8a92-e5e31aec5664
This commit is contained in:
pewgeuges 2021-01-03 20:03:51 +00:00
parent 0879535bb4
commit 82cb6d5268
11 changed files with 69 additions and 47 deletions

View file

@ -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 <https://wordpress.org/support/topic/making-it-amp-compatible/>
* @see <https://wordpress.org/support/topic/footnotes-is-not-amp-compatible/>
* @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 <https://wordpress.org/support/topic/doesnt-work-with-mailpoet/>
* @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 <https://wordpress.org/support/topic/add-support-for-ibid-notation/>
* @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("<fn>") => htmlspecialchars("<fn>"),
"[ref]" => "[ref]",
htmlspecialchars("<ref>") => htmlspecialchars("<ref>"),
htmlspecialchars("<!--n>") => htmlspecialchars("<!--n>"),
// Custom (user-defined) start and end tags bracketing the footnote text inline:
"userdefined" => __('custom short code', MCI_Footnotes_Config::C_STR_PLUGIN_NAME)
);
@ -368,9 +369,8 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
htmlspecialchars("</fn>") => htmlspecialchars("</fn>"),
"[/ref]" => "[/ref]",
htmlspecialchars("</ref>") => htmlspecialchars("</ref>"),
htmlspecialchars("<n-->") => htmlspecialchars("<n-->"),
// 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),

View file

@ -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 <https://wordpress.org/support/topic/reference-container-in-elementor/#post-13786635>
* @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

View file

@ -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 <https://wordpress.org/support/topic/auto-load-post-compatibility-update/>
*
@ -64,9 +66,8 @@
* @see <https://wordpress.org/support/topic/making-it-amp-compatible/>
* @see <https://wordpress.org/support/topic/footnotes-is-not-amp-compatible/>
* @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 <https://wordpress.org/support/topic/footnotes-is-not-amp-compatible/>
* @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) {

View file

@ -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 <https://wordpress.org/support/topic/template-override-filter/>
* @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 <https://wordpress.org/support/topic/template-override-filter/#post-13846598>
*
* 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 <https://wordpress.org/support/topic/template-override-filter/>
*
* @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 <https://wordpress.org/support/topic/template-override-filter/#post-13846598>
*/
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 <https://wordpress.stackexchange.com/questions/220942/how-to-get-the-active-themes-slug>
// returns the stylesheets 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);

View file

@ -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 <https://wordpress.org/support/topic/counter-styles-not-working/>
* @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 <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_backlink = <a> or <span> if identical footnotes are combined, or in second <td> in 3-column table
.footnote_plugin_symbol = second <td> in 3-column table
.footnote_plugin_link = <a> or <span> (identical footnotes not combined)
.footnote_backlink = <a> or <span>
.footnote_index_arrow = nested <span>, symbol only
.footnote_plugin_text = second <td>, or third <td> 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;

View file

@ -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
*/

View file

@ -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)

View file

@ -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 '&gt;' 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

View file

@ -20,7 +20,8 @@
<p>.footnote_plugin_index_combi = first &lt;td> if identical footnotes are combined
<p>.footnote_plugin_index = first &lt;td> if not
<p>.footnote_index = &lt;a> or &lt;span> in first &lt;td> in 3-column table
<p>.footnote_plugin_link = &lt;a> or &lt;span> if identical footnotes are not combined, or second &lt;td> in 3-column table
<p>.footnote_plugin_symbol = second &lt;td> in 3-column table
<p>.footnote_plugin_link = &lt;a> or &lt;span> if identical footnotes are not combined
<p>.footnote_backlink = &lt;a> or &lt;span> if identical footnotes are combined, or in second &lt;td> in 3-column table
<p>.footnote_index_arrow = nested &lt;span>, symbol only
<p>.footnote_plugin_text = second &lt;td>, or third &lt;td> in 3-column table

View file

@ -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

View file

@ -10,7 +10,7 @@
>[[anchor-element]]</td
>
<td
class="footnote_plugin_link"
class="footnote_plugin_symbol"
><[[link-span]]
onclick="footnote_moveToAnchor_[[post_id]]_[[container_id]]('footnote_plugin_tooltip_[[post_id]]_[[container_id]]_[[note_id]]');"
class="footnote_backlink"