prepare urgent bugfix release 2.5.4 - this: 2.5.4d6

git-svn-id: https://plugins.svn.wordpress.org/footnotes/trunk@2473635 b8457f37-d9ea-0310-8a92-e5e31aec5664
This commit is contained in:
pewgeuges 2021-02-12 10:18:31 +00:00
parent b9476b682e
commit b009311766
10 changed files with 317 additions and 119 deletions

View file

@ -7,7 +7,7 @@
* @since 1.5.0 14.09.14 14:47
*
*
* @lastmodified 2021-02-11T0821+0100
* @lastmodified 2021-02-12T1035+0100
*
* @since 2.0.4 restore arrow settings 2020-11-01T0509+0100
* @since 2.1.0 read-on button label 2020-11-08T2148+0100
@ -150,10 +150,11 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
$l_arr_MetaBoxes[] = $this->addMetaBox("customize", "hyperlink-arrow", __("Backlink symbol", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "HyperlinkArrow");
$l_arr_MetaBoxes[] = $this->addMetaBox("customize", "superscript", __("Referrer typesetting and formatting", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "Superscript");
$l_arr_MetaBoxes[] = $this->addMetaBox("customize", "mouse-over-box", __("Tooltips", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "MouseOverBox");
$l_arr_MetaBoxes[] = $this->addMetaBox("customize", "mouse-over-box-position", __("Tooltip position", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "MouseOverBoxPosition");
$l_arr_MetaBoxes[] = $this->addMetaBox("customize", "mouse-over-box-dimensions", __("Tooltip dimensions", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "MouseOverBoxDimensions");
$l_arr_MetaBoxes[] = $this->addMetaBox("customize", "mouse-over-box-timing", __("Tooltip timing", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "MouseOverBoxTiming");
$l_arr_MetaBoxes[] = $this->addMetaBox("customize", "mouse-over-box-truncation", __("Tooltip truncation", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "MouseOverBoxTruncation");
$l_arr_MetaBoxes[] = $this->addMetaBox("customize", "mouse-over-box-text", __("Tooltip text", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "MouseOverBoxText");
$l_arr_MetaBoxes[] = $this->addMetaBox("customize", "mouse-over-box-appearance", __("Tooltip appearance", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "MouseOverBoxAppearance");
if (MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_CUSTOM_CSS_LEGACY_ENABLE))) {
$l_arr_MetaBoxes[] = $this->addMetaBox("customize", "custom-css", __("Your existing Custom CSS code", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "CustomCSS");
@ -501,6 +502,15 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
"separator" => $this->addTextBox(MCI_Footnotes_Settings::C_STR_HARD_LINK_IDS_SEPARATOR),
"notice-separator" => __("May be empty or any string, for example _, - or +, to distinguish post number, container number and footnote number.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
// enable backlink tooltips:
"label-backlink-tooltips" => $this->addLabel(MCI_Footnotes_Settings::C_BOOL_FOOTNOTES_BACKLINK_TOOLTIP_ENABLE, __("Enable backlink tooltips:", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
"backlink-tooltips" => $this->addSelectBox(MCI_Footnotes_Settings::C_BOOL_FOOTNOTES_BACKLINK_TOOLTIP_ENABLE, $l_arr_Enable),
"notice-backlink-tooltips" => __("Hard backlinks get ordinary tooltips hinting to use the backbutton instead.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
"label-backlink-tooltip-text" => $this->addLabel(MCI_Footnotes_Settings::C_STR_FOOTNOTES_BACKLINK_TOOLTIP_TEXT, __("Backlink tooltip text:", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
"backlink-tooltip-text" => $this->addTextBox(MCI_Footnotes_Settings::C_STR_FOOTNOTES_BACKLINK_TOOLTIP_TEXT),
"notice-backlink-tooltip-text" => __("Default text is the keyboard shortcut, but you may wish to input a descriptive hint in your language.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
)
);
// display template with replaced placeholders
@ -709,6 +719,20 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
"offset-y-alternative" => $this->addNumBox(MCI_Footnotes_Settings::C_INT_FOOTNOTES_ALTERNATIVE_MOUSE_OVER_BOX_OFFSET_Y, -500, 500),
"notice-offset-y" => __("pixels; negative value for an upwards offset; alternative tooltips: direction depends on position", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
)
);
// display template with replaced placeholders
echo $l_obj_Template->getContent();
}
public function MouseOverBoxDimensions() {
// load template file
$l_obj_Template = new MCI_Footnotes_Template(MCI_Footnotes_Template::C_STR_DASHBOARD, "mouse-over-box-dimensions");
// replace all placeholders
$l_obj_Template->replace(
array(
"label-max-width" => $this->addLabel(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_MAX_WIDTH, __("Maximum width:", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
"max-width" => $this->addNumBox(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_MAX_WIDTH, 0, 1280),
"width" => $this->addNumBox(MCI_Footnotes_Settings::C_INT_FOOTNOTES_ALTERNATIVE_MOUSE_OVER_BOX_WIDTH, 0, 1280),
@ -780,6 +804,38 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
echo $l_obj_Template->getContent();
}
public function MouseOverBoxText() {
// options for Yes/No select box:
$l_arr_Enabled = array(
"yes" => __("Yes", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
"no" => __("No", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)
);
// load template file
$l_obj_Template = new MCI_Footnotes_Template(MCI_Footnotes_Template::C_STR_DASHBOARD, "mouse-over-box-text");
// replace all placeholders
$l_obj_Template->replace(
array(
"label-delimiter" => $this->addLabel(MCI_Footnotes_Settings::C_STR_FOOTNOTES_TOOLTIP_EXCERPT_DELIMITER, __("Delimiter for dedicated tooltip text:", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
"delimiter" => $this->addTextBox(MCI_Footnotes_Settings::C_STR_FOOTNOTES_TOOLTIP_EXCERPT_DELIMITER),
"notice-delimiter" => __("If the delimiter shortcode is present, the tooltip text will be the part before it.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
"label-mirror" => $this->addLabel(MCI_Footnotes_Settings::C_BOOL_FOOTNOTES_TOOLTIP_EXCERPT_MIRROR_ENABLE, __("Mirror the tooltip in the reference container:", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
"mirror" => $this->addSelectBox(MCI_Footnotes_Settings::C_BOOL_FOOTNOTES_TOOLTIP_EXCERPT_MIRROR_ENABLE, $l_arr_Enabled),
"notice-mirror" => __("Tooltips may be harder to use on mobiles. This option allows to read it in the reference container.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
"label-separator" => $this->addLabel(MCI_Footnotes_Settings::C_STR_FOOTNOTES_TOOLTIP_EXCERPT_MIRROR_SEPARATOR, __("Separator between tooltip text and footnote text:", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
"separator" => $this->addTextBox(MCI_Footnotes_Settings::C_STR_FOOTNOTES_TOOLTIP_EXCERPT_MIRROR_SEPARATOR),
"notice-separator" => __("May be a simple space, or a line break <br />, or any string in your language.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
)
);
// display template with replaced placeholders
echo $l_obj_Template->getContent();
}
public function MouseOverBoxAppearance() {
// options for Yes/No select box:
$l_arr_Enabled = array(

View file

@ -7,7 +7,7 @@
* @since 1.5.0 14.09.14 10:43
*
*
* @lastmodified 2021-02-11T1130+0100
* @lastmodified 2021-02-12T0928+0100
*
* @since 2.0.4 restore arrow settings 2020-11-02T2115+0100
* @since 2.0.7 remove hook the_post 2020-11-06T1342+0100
@ -105,7 +105,7 @@ class MCI_Footnotes_Settings {
*
* @author Stefan Herndler
* @since 1.5.0
* @var bool
* @var str
*/
const C_BOOL_COMBINE_IDENTICAL_FOOTNOTES = "footnote_inputfield_combine_identical";
@ -496,7 +496,6 @@ class MCI_Footnotes_Settings {
* - Bugfix: Reference container: option to restore pre-2.0.0 layout with the backlink symbol in an extra column.
*
* @since 2.1.1
*
* @var str
*/
const C_BOOL_REFERENCE_CONTAINER_3COLUMN_LAYOUT_ENABLE = "footnotes_inputfield_reference_container_3column_layout_enable";
@ -612,7 +611,7 @@ class MCI_Footnotes_Settings {
* Unicode-compliant browsers break URLs at slashes.
*
* @since 2.1.6
* @var bool
* @var str
*
* 2020-12-09T1554+0100..2020-12-13T1313+0100
*/
@ -652,7 +651,7 @@ class MCI_Footnotes_Settings {
* @link https://wordpress.org/support/topic/borders-25/
*
* @since 2.2.10
* @var bool
* @var str
*
* 2020-12-25T2311+0100
*/
@ -679,12 +678,81 @@ class MCI_Footnotes_Settings {
* Settings container key for shortcode syntax validation
*
* @since 2.4.0
* @var bool
* @var str
*
* 2021-01-01T0616+0100
*/
const C_BOOL_FOOTNOTE_SHORTCODE_SYNTAX_VALIDATION_ENABLE = "footnotes_inputfield_shortcode_syntax_validation_enable";
/**
* Settings container key to enable a backlink tooltip
*
* -
*
* @since 2.5.4
*
* @reporter
* @link
*
* @var str
*/
const C_BOOL_FOOTNOTES_BACKLINK_TOOLTIP_ENABLE = "footnotes_inputfield_backlink_tooltip_enable";
/**
* Settings container key to configure the backlink tooltip
*
* -
*
* @since 2.5.4
*
* @reporter
* @link
*
* @var str
*/
const C_STR_FOOTNOTES_BACKLINK_TOOLTIP_TEXT = "footnotes_inputfield_backlink_tooltip_text";
/**
* Settings container key to configure the tooltip excerpt delimiter
*
* -
*
* @since 2.5.4
*
* @reporter
* @link
*
* @var str
*/
const C_STR_FOOTNOTES_TOOLTIP_EXCERPT_DELIMITER = "footnotes_inputfield_tooltip_excerpt_delimiter";
/**
* Settings container key to enable mirroring the tooltip excerpt in the reference container
*
* -
*
* @since 2.5.4
*
* @reporter
* @link
*
* @var str
*/
const C_BOOL_FOOTNOTES_TOOLTIP_EXCERPT_MIRROR_ENABLE = "footnotes_inputfield_tooltip_excerpt_mirror_enable";
/**
* Settings container key to configure the tooltip excerpt separator in the reference container
*
* -
*
* @since 2.5.4
*
* @reporter
* @link
*
* @var str
*/
const C_STR_FOOTNOTES_TOOLTIP_EXCERPT_MIRROR_SEPARATOR = "footnotes_inputfield_tooltip_excerpt_mirror_separator";
/**
@ -752,6 +820,11 @@ class MCI_Footnotes_Settings {
self::C_INT_FOOTNOTES_SCROLL_OFFSET => 20,
self::C_INT_FOOTNOTES_SCROLL_DURATION => 380,
// 2.5.4 fast-tracked:
self::C_BOOL_FOOTNOTES_BACKLINK_TOOLTIP_ENABLE => 'yes',
self::C_STR_FOOTNOTES_BACKLINK_TOOLTIP_TEXT => 'Alt+ ←',
self::C_STR_REFERENCE_CONTAINER_NAME => 'References',
self::C_STR_REFERENCE_CONTAINER_LABEL_ELEMENT => 'p',
self::C_BOOL_REFERENCE_CONTAINER_LABEL_BOTTOM_BORDER => 'yes',
@ -847,6 +920,12 @@ class MCI_Footnotes_Settings {
// The truncation length is raised from 150 to 200 chars:
self::C_INT_FOOTNOTES_MOUSE_OVER_BOX_EXCERPT_LENGTH => 200,
// 2.5.4 fast-tracked:
self::C_STR_FOOTNOTES_TOOLTIP_EXCERPT_DELIMITER => '[[/tooltip]]',
self::C_BOOL_FOOTNOTES_TOOLTIP_EXCERPT_MIRROR_ENABLE => 'no',
self::C_STR_FOOTNOTES_TOOLTIP_EXCERPT_MIRROR_SEPARATOR => ' — ',
// The default position should not be lateral because of the risk
// the box gets squeezed between note anchor at line end and window edge,
// and top because reading at the bottom of the window is more likely:

View file

@ -7,9 +7,10 @@
* @since 1.5.0
*
*
* @lastmodified 2021-02-11T0817+0100
* @lastmodified 2021-02-12T1100+0100
*
* @since 2.0.0 Bugfix: various.
* @since 2.0.4 Bugfix: Referrers and backlinks: remove hard links to streamline browsing history, thanks to @theroninjedi47 bug report.
* @since 2.0.5 Bugfix: Reference container: fix relative position through priority level, thanks to @june01 @imeson @spaceling bug reports, thanks to @spaceling code contribution.
* @since 2.0.5 Update: Hooks: Default-enable all hooks to prevent footnotes from seeming broken in some parts.
* @since 2.0.6 Bugfix: Infinite scroll: debug autoload by adding post ID, thanks to @docteurfitness code contribution.
@ -74,6 +75,7 @@
* @since 2.5.2 Update: Tooltips: ability to display dedicated content before `[[/tooltip]]`, thanks to @jbj2199 issue report.
* @since 2.5.3 Bugfix: Reference container, tooltips: URL wrap: exclude URL pattern as folder name in Wayback Machine URL, thanks to @rumperuu bug report.
* @since 2.5.4 Bugfix: Reference container, tooltips: URL wrap: account for leading space in value, thanks to @karolszakiel example provision.
* @since 2.5.4 Update: Reference container: Hard backlinks (optional): optional configurable tooltip hinting to use the backbutton instead, thanks to @@theroninjedi47 bug report.
* @since 2.5.4 Bugfix: Tooltips: fix display in Popup Maker popups by correcting a coding error.
*/
@ -173,16 +175,28 @@ class MCI_Footnotes_Task {
* @link https://github.com/misfist/footnotes/releases/tag/2.4.0d3 repository
* @link https://github.com/misfist/footnotes/compare/2.4.0%E2%80%A62.4.0d3 diff
*
* @var bool false; depend on settings
* @var bool
*
* Streamline process depending on tooltip enabled status.
* Load tooltip inline script only if jQuery tooltips are enabled.
* Actual value depends on settings.
*/
public static $a_bool_TooltipsEnabled = false;
public static $a_bool_AlternativeTooltipsEnabled = false;
/**
* Hard links for AMP compatibility
*
* @since 2.0.0 Bugfix: footnote links script independent.
*
*
* - Bugfix: Referrers and backlinks: remove hard links to streamline browsing history, thanks to @theroninjedi47 bug report.
*
* @since 2.0.4
*
* @reporter @theroninjedi47
* @link https://wordpress.org/support/topic/hyperlinked-footnotes-creating-excessive-back-history/
*
*
* - Adding: Referrers and backlinks: optional hard links for AMP compatibility, thanks to @psykonevro bug report, thanks to @martinneumannat code contribution.
*
@ -197,12 +211,6 @@ class MCI_Footnotes_Task {
*
* The official AMP plugin strips off JavaScript, breaking Footnotes
* animated scrolling.
*
*
* @since 2.0.4 remove hard links on user request
* @link https://wordpress.org/support/topic/hyperlinked-footnotes-creating-excessive-back-history/
*
* @since 2.0.0 add hard links
*/
public static $a_bool_HardLinksEnable = false;
public static $a_str_ReferrerLinkSlug = 'r';
@ -239,9 +247,7 @@ class MCI_Footnotes_Task {
/**
* Optional link element for footnote referrers and backlinks
*
* @since 2.0.0 add link elements with hard links
* @since 2.0.4 remove hard links on user request
* @link https://wordpress.org/support/topic/hyperlinked-footnotes-creating-excessive-back-history/
* @since 2.0.0 add link elements along with hard links.
*
*
* - Bugfix: Referrers and backlinks: Styling: make link elements optional to fix issues, thanks to @docteurfitness issue report and code contribution.
@ -261,29 +267,29 @@ class MCI_Footnotes_Task {
*
* @since 2.3.0
* @datetime 2020-12-30T2313+0100
* @see self::$a_bool_HardLinksEnable
*
* # Styling
* @contributor @martinneumannat
* @link https://wordpress.org/support/topic/making-it-amp-compatible/
*
* Link color is preferred for referrers and backlinks.
* Setting a global link color is a common feature in WordPress themes.
* CSS does not support identifiers for link colors (color: link | hover | active | visited)
* These are only supported as pseudo-classes of the link element.
* 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
* @reporter @psykonevro
* @link https://wordpress.org/support/topic/footnotes-is-not-amp-compatible/
*
* 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.
*
* Link elements also raise further concerns, so that their useless proliferation needs
* to be mitigated. By contrast, due to an insufficiency in the CSS standard, real link
* elements are required to get the link color, as oppose
* this variable keeps its default value if hard links are disabled
* Link elements raise concerns, so that mitigating their proliferation may be desired.
*
* By contrast, due to an insufficiency in the CSS standard, coloring elements with the
* themes link color requires real link elements and cannot be done with named colors,
* as CSS does not support 'color: link|hover|active|visited', after the pseudo-classes
* of the link element.
*
* Yet styling these elements with the link color is not universally preferred, so that
* the very presence of these link elements may need to be avoided.
*
* @see self::$a_bool_HardLinksEnable
*/
public static $a_str_LinkSpan = 'span';
public static $a_str_LinkOpenTag = '';
@ -1284,7 +1290,7 @@ class MCI_Footnotes_Task {
$l_str_FootnoteText = substr($p_str_Content, $l_int_PosStart + strlen($l_str_StartingTag), $l_int_Length - strlen($l_str_StartingTag));
// get tooltip text if present:
self::$a_str_TooltipShortcode = '[[/tooltip]]'; // grab from DB
self::$a_str_TooltipShortcode = MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_FOOTNOTES_TOOLTIP_EXCERPT_DELIMITER);
self::$a_int_TooltipShortcodeLength = strlen( self::$a_str_TooltipShortcode );
$l_int_TooltipTextLength = strpos( $l_str_FootnoteText, self::$a_str_TooltipShortcode );
$l_bool_HasTooltipText = $l_int_TooltipTextLength === false ? false : true;
@ -1563,9 +1569,11 @@ class MCI_Footnotes_Task {
$l_str_FootnoteLinkArgument .= $l_int_Index;
$l_str_FootnoteLinkArgument .= '" class="footnote_hard_link"';
// compose offset anchor, an empty span child of empty span
// to prevent browsers from drawing tall dotted rectangles:
$l_str_ReferrerAnchorElement = '<span class="footnote_referrer_base"><span id="';
/**
* Compose fragment ID anchor with offset, for use in reference container.
* Empty span, child of empty span, to avoid tall dotted rectangles in browser.
*/
$l_str_ReferrerAnchorElement = '<span class="footnote_referrer_base"><span id="';
$l_str_ReferrerAnchorElement .= self::$a_str_ReferrerLinkSlug;
$l_str_ReferrerAnchorElement .= self::$a_str_PostContainerIdCompound;
$l_str_ReferrerAnchorElement .= $l_int_Index;
@ -1831,7 +1839,7 @@ class MCI_Footnotes_Task {
* Reference container table row template load
*
* - Bugfix: Reference container: option to restore pre-2.0.0 layout with the backlink symbol in an extra column.
*
*
* @since 2.1.1
* @datetime 2020-11-16T2024+0100
*/
@ -1905,13 +1913,37 @@ class MCI_Footnotes_Task {
*
* If enabled, and for the case the footnote is single, compose hard link:
*/
// define variable as empty for the reference container if not enabled:
// define anyway:
$l_str_HardLinkAddress = '';
if (self::$a_bool_HardLinksEnable) {
/**
* Use-Backbutton-Hint tooltip, optional and configurable.
*
* - Update: Reference container: Hard backlinks (optional): optional configurable tooltip hinting to use the backbutton instead, thanks to @@theroninjedi47 bug report.
*
* @since 2.5.4
*
* @reporter @@theroninjedi47
* @link https://wordpress.org/support/topic/hyperlinked-footnotes-creating-excessive-back-history/
*
* When hard links are enabled, clicks on the backlinks are logged in the browsing history.
* This tooltip hints to use the backbutton instead, so the history gets streamlined again.
* @link https://wordpress.org/support/topic/making-it-amp-compatible/#post-13837359
*/
if ( MCI_Footnotes_Convert::toBool( MCI_Footnotes_Settings::instance()->get( MCI_Footnotes_Settings::C_BOOL_FOOTNOTES_BACKLINK_TOOLTIP_ENABLE ) ) ) {
$l_str_UseBackbuttonHint = ' title="';
$l_str_UseBackbuttonHint .= MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_FOOTNOTES_BACKLINK_TOOLTIP_TEXT);
$l_str_UseBackbuttonHint .= '"';
} else {
$l_str_UseBackbuttonHint = '';
}
// compose fragment ID anchor with offset, for use in reference container, an
// empty span child of empty span to avoid tall dotted rectangles in browser:
/**
* Compose fragment ID anchor with offset, for use in reference container.
* Empty span, child of empty span, to avoid tall dotted rectangles in browser.
*/
$l_str_FootnoteAnchorElement = '<span class="footnote_item_base"><span id="';
$l_str_FootnoteAnchorElement .= self::$a_str_FootnoteLinkSlug;
$l_str_FootnoteAnchorElement .= self::$a_str_PostContainerIdCompound;
@ -1923,6 +1955,7 @@ class MCI_Footnotes_Task {
$l_str_HardLinkAddress .= self::$a_str_ReferrerLinkSlug;
$l_str_HardLinkAddress .= self::$a_str_PostContainerIdCompound;
$l_str_HardLinkAddress .= $l_str_FootnoteId . '"';
$l_str_HardLinkAddress .= $l_str_UseBackbuttonHint;
// compose optional opening link tag with optional hard link, mandatory for instance:
self::$a_str_LinkOpenTag = '<a' . $l_str_HardLinkAddress;
@ -1970,6 +2003,7 @@ class MCI_Footnotes_Task {
$l_str_FootnoteReference .= self::$a_str_ReferrerLinkSlug;
$l_str_FootnoteReference .= self::$a_str_PostContainerIdCompound;
$l_str_FootnoteReference .= $l_str_FootnoteId . '"';
$l_str_FootnoteReference .= $l_str_UseBackbuttonHint;
}
$l_str_FootnoteReference .= ' class="footnote_backlink"';
@ -2038,16 +2072,17 @@ class MCI_Footnotes_Task {
$l_str_FootnoteBacklinks .= ' id="footnote_plugin_reference_';
$l_str_FootnoteBacklinks .= self::$a_int_PostId;
$l_str_FootnoteBacklinks .= '_' . self::$a_int_ReferenceContainerId;
$l_str_FootnoteBacklinks .= "_$l_str_FootnoteId\"";
$l_str_FootnoteBacklinks .= "_$l_str_FootnoteId\"";
// insert the optional hard link address:
if (self::$a_bool_HardLinksEnable) {
$l_str_FootnoteBacklinks .= ' href="#';
$l_str_FootnoteBacklinks .= self::$a_str_ReferrerLinkSlug;
$l_str_FootnoteBacklinks .= self::$a_str_PostContainerIdCompound;
$l_str_FootnoteBacklinks .= $l_str_FootnoteId . '"';
}
$l_str_FootnoteBacklinks .= $l_str_UseBackbuttonHint;
}
$l_str_FootnoteBacklinks .= ' class="footnote_backlink"';
$l_str_FootnoteBacklinks .= ' onclick="footnote_moveToAnchor_';
$l_str_FootnoteBacklinks .= self::$a_int_PostId;
@ -2055,8 +2090,8 @@ class MCI_Footnotes_Task {
$l_str_FootnoteBacklinks .= "('footnote_plugin_tooltip_";
$l_str_FootnoteBacklinks .= self::$a_int_PostId;
$l_str_FootnoteBacklinks .= '_' . self::$a_int_ReferenceContainerId;
$l_str_FootnoteBacklinks .= "_$l_str_FootnoteId');\">";
$l_str_FootnoteBacklinks .= "_$l_str_FootnoteId');\">";
// append the offset anchor for optional hard links:
if (self::$a_bool_HardLinksEnable) {
$l_str_FootnoteBacklinks .= '<span class="footnote_item_base"><span id="';
@ -2064,8 +2099,8 @@ class MCI_Footnotes_Task {
$l_str_FootnoteBacklinks .= self::$a_str_PostContainerIdCompound;
$l_str_FootnoteBacklinks .= $l_str_FootnoteId;
$l_str_FootnoteBacklinks .= '" class="footnote_item_anchor"></span></span>';
}
}
$l_str_FootnoteBacklinks .= $l_bool_SymbolSwitch ? '' : $l_str_FootnoteArrow;
$l_str_FootnoteBacklinks .= $l_str_FootnoteId;
$l_str_FootnoteBacklinks .= $l_bool_SymbolSwitch ? $l_str_FootnoteArrow : '';
@ -2087,10 +2122,10 @@ class MCI_Footnotes_Task {
$l_bool_HasTooltipText = $l_int_TooltipTextLength === false ? false : true;
if ( $l_bool_HasTooltipText ) {
$l_str_NotTooltipText = substr( $l_str_FootnoteText, ( $l_int_TooltipTextLength + self::$a_int_TooltipShortcodeLength ) );
self::$a_bool_MirrorTooltipText = false; // grab from settings!
self::$a_bool_MirrorTooltipText = MCI_Footnotes_Convert::toBool( MCI_Footnotes_Settings::instance()->get( MCI_Footnotes_Settings::C_BOOL_FOOTNOTES_TOOLTIP_EXCERPT_MIRROR_ENABLE ) );
if ( self::$a_bool_MirrorTooltipText ) {
$l_str_TooltipText = substr( $l_str_FootnoteText, 0, $l_int_TooltipTextLength );
$l_str_ReferenceTextIntroducer = ' '; // grab from settings!
$l_str_ReferenceTextIntroducer = MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_FOOTNOTES_TOOLTIP_EXCERPT_MIRROR_SEPARATOR);
$l_str_ReferenceText = $l_str_TooltipText . $l_str_ReferenceTextIntroducer . $l_str_NotTooltipText;
} else {
$l_str_ReferenceText = $l_str_NotTooltipText;
@ -2099,10 +2134,7 @@ class MCI_Footnotes_Task {
$l_str_ReferenceText = $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'
// or in 'templates/public/reference-container-body-switch.html'
// replace all placeholders in table row template:
$l_obj_Template->replace(
array(

View file

@ -7,7 +7,7 @@
* @since 1.5.0 14.09.14 10:58
*
*
* @lastmodified 2021-02-08T1925+0100
* @lastmodified 2021-02-12T1113+0100
*
* @since 2.0.3 prettify reference container template
* @since 2.0.3 replace tab with a space
@ -194,8 +194,8 @@ class MCI_Footnotes_Template {
* @since 2.5.4 collapse HTML comments and PHP/JS docblocks (only)
*/
public function process_template( $template ) {
$this->a_str_OriginalContent = preg_replace( '#<!--.+?-->#s', " ", file_get_contents( $template ) );
$this->a_str_OriginalContent = preg_replace( '#/\*\*.+?\*/#s', " ", $this->a_str_OriginalContent );
$this->a_str_OriginalContent = preg_replace( '#<!--.+?-->#s', "", file_get_contents( $template ) );
$this->a_str_OriginalContent = preg_replace( '#/\*\*.+?\*/#s', "", $this->a_str_OriginalContent );
$this->a_str_OriginalContent = str_replace( "\n", "", $this->a_str_OriginalContent );
$this->a_str_OriginalContent = str_replace( "\r", "", $this->a_str_OriginalContent );
$this->a_str_OriginalContent = str_replace( "\t", " ", $this->a_str_OriginalContent );