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:
parent
b9476b682e
commit
b009311766
10 changed files with 317 additions and 119 deletions
|
@ -7,7 +7,7 @@
|
||||||
* @since 1.5.0 14.09.14 14:47
|
* @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.0.4 restore arrow settings 2020-11-01T0509+0100
|
||||||
* @since 2.1.0 read-on button label 2020-11-08T2148+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", "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", "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", __("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-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-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-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");
|
$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))) {
|
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");
|
$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),
|
"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),
|
"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
|
// 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),
|
"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),
|
"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)),
|
"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),
|
"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),
|
"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();
|
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() {
|
public function MouseOverBoxAppearance() {
|
||||||
// options for Yes/No select box:
|
// options for Yes/No select box:
|
||||||
$l_arr_Enabled = array(
|
$l_arr_Enabled = array(
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
* @since 1.5.0 14.09.14 10:43
|
* @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.4 restore arrow settings 2020-11-02T2115+0100
|
||||||
* @since 2.0.7 remove hook the_post 2020-11-06T1342+0100
|
* @since 2.0.7 remove hook the_post 2020-11-06T1342+0100
|
||||||
|
@ -105,7 +105,7 @@ class MCI_Footnotes_Settings {
|
||||||
*
|
*
|
||||||
* @author Stefan Herndler
|
* @author Stefan Herndler
|
||||||
* @since 1.5.0
|
* @since 1.5.0
|
||||||
* @var bool
|
* @var str
|
||||||
*/
|
*/
|
||||||
const C_BOOL_COMBINE_IDENTICAL_FOOTNOTES = "footnote_inputfield_combine_identical";
|
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.
|
* - Bugfix: Reference container: option to restore pre-2.0.0 layout with the backlink symbol in an extra column.
|
||||||
*
|
*
|
||||||
* @since 2.1.1
|
* @since 2.1.1
|
||||||
*
|
|
||||||
* @var str
|
* @var str
|
||||||
*/
|
*/
|
||||||
const C_BOOL_REFERENCE_CONTAINER_3COLUMN_LAYOUT_ENABLE = "footnotes_inputfield_reference_container_3column_layout_enable";
|
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.
|
* Unicode-compliant browsers break URLs at slashes.
|
||||||
*
|
*
|
||||||
* @since 2.1.6
|
* @since 2.1.6
|
||||||
* @var bool
|
* @var str
|
||||||
*
|
*
|
||||||
* 2020-12-09T1554+0100..2020-12-13T1313+0100
|
* 2020-12-09T1554+0100..2020-12-13T1313+0100
|
||||||
*/
|
*/
|
||||||
|
@ -652,7 +651,7 @@ class MCI_Footnotes_Settings {
|
||||||
* @link https://wordpress.org/support/topic/borders-25/
|
* @link https://wordpress.org/support/topic/borders-25/
|
||||||
*
|
*
|
||||||
* @since 2.2.10
|
* @since 2.2.10
|
||||||
* @var bool
|
* @var str
|
||||||
*
|
*
|
||||||
* 2020-12-25T2311+0100
|
* 2020-12-25T2311+0100
|
||||||
*/
|
*/
|
||||||
|
@ -679,12 +678,81 @@ class MCI_Footnotes_Settings {
|
||||||
* Settings container key for shortcode syntax validation
|
* Settings container key for shortcode syntax validation
|
||||||
*
|
*
|
||||||
* @since 2.4.0
|
* @since 2.4.0
|
||||||
* @var bool
|
* @var str
|
||||||
*
|
*
|
||||||
* 2021-01-01T0616+0100
|
* 2021-01-01T0616+0100
|
||||||
*/
|
*/
|
||||||
const C_BOOL_FOOTNOTE_SHORTCODE_SYNTAX_VALIDATION_ENABLE = "footnotes_inputfield_shortcode_syntax_validation_enable";
|
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_OFFSET => 20,
|
||||||
self::C_INT_FOOTNOTES_SCROLL_DURATION => 380,
|
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_NAME => 'References',
|
||||||
self::C_STR_REFERENCE_CONTAINER_LABEL_ELEMENT => 'p',
|
self::C_STR_REFERENCE_CONTAINER_LABEL_ELEMENT => 'p',
|
||||||
self::C_BOOL_REFERENCE_CONTAINER_LABEL_BOTTOM_BORDER => 'yes',
|
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:
|
// The truncation length is raised from 150 to 200 chars:
|
||||||
self::C_INT_FOOTNOTES_MOUSE_OVER_BOX_EXCERPT_LENGTH => 200,
|
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 default position should not be lateral because of the risk
|
||||||
// the box gets squeezed between note anchor at line end and window edge,
|
// 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:
|
// and top because reading at the bottom of the window is more likely:
|
||||||
|
|
128
class/task.php
128
class/task.php
|
@ -7,9 +7,10 @@
|
||||||
* @since 1.5.0
|
* @since 1.5.0
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @lastmodified 2021-02-11T0817+0100
|
* @lastmodified 2021-02-12T1100+0100
|
||||||
*
|
*
|
||||||
* @since 2.0.0 Bugfix: various.
|
* @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 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.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.
|
* @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.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.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 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.
|
* @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/releases/tag/2.4.0d3 repository
|
||||||
* @link https://github.com/misfist/footnotes/compare/2.4.0%E2%80%A62.4.0d3 diff
|
* @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.
|
* Streamline process depending on tooltip enabled status.
|
||||||
* Load tooltip inline script only if jQuery tooltips are enabled.
|
* 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_TooltipsEnabled = false;
|
||||||
public static $a_bool_AlternativeTooltipsEnabled = false;
|
public static $a_bool_AlternativeTooltipsEnabled = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Hard links for AMP compatibility
|
* 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.
|
* - 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’
|
* The official AMP plugin strips off JavaScript, breaking Footnotes’
|
||||||
* animated scrolling.
|
* 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_bool_HardLinksEnable = false;
|
||||||
public static $a_str_ReferrerLinkSlug = 'r';
|
public static $a_str_ReferrerLinkSlug = 'r';
|
||||||
|
@ -239,9 +247,7 @@ class MCI_Footnotes_Task {
|
||||||
/**
|
/**
|
||||||
* Optional link element for footnote referrers and backlinks
|
* Optional link element for footnote referrers and backlinks
|
||||||
*
|
*
|
||||||
* @since 2.0.0 add link elements with hard links
|
* @since 2.0.0 add link elements along 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/
|
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* - Bugfix: Referrers and backlinks: Styling: make link elements optional to fix issues, thanks to @docteurfitness issue report and code contribution.
|
* - 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
|
* @since 2.3.0
|
||||||
* @datetime 2020-12-30T2313+0100
|
* @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.
|
* @reporter @psykonevro
|
||||||
* Setting a global link color is a common feature in WordPress themes.
|
* @link https://wordpress.org/support/topic/footnotes-is-not-amp-compatible/
|
||||||
* 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
|
|
||||||
*
|
*
|
||||||
* Although widely used for that purpose, hyperlinks are disliked for footnote linking.
|
* 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,
|
* 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.
|
* 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.
|
* 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
|
* Link elements raise concerns, so that mitigating their proliferation may be desired.
|
||||||
* 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
|
* By contrast, due to an insufficiency in the CSS standard, coloring elements with the
|
||||||
* this variable keeps its default value if hard links are disabled
|
* theme’s 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_LinkSpan = 'span';
|
||||||
public static $a_str_LinkOpenTag = '';
|
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));
|
$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:
|
// 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 );
|
self::$a_int_TooltipShortcodeLength = strlen( self::$a_str_TooltipShortcode );
|
||||||
$l_int_TooltipTextLength = strpos( $l_str_FootnoteText, self::$a_str_TooltipShortcode );
|
$l_int_TooltipTextLength = strpos( $l_str_FootnoteText, self::$a_str_TooltipShortcode );
|
||||||
$l_bool_HasTooltipText = $l_int_TooltipTextLength === false ? false : true;
|
$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 .= $l_int_Index;
|
||||||
$l_str_FootnoteLinkArgument .= '" class="footnote_hard_link"';
|
$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:
|
* Compose fragment ID anchor with offset, for use in reference container.
|
||||||
$l_str_ReferrerAnchorElement = '<span class="footnote_referrer_base"><span id="';
|
* 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_ReferrerLinkSlug;
|
||||||
$l_str_ReferrerAnchorElement .= self::$a_str_PostContainerIdCompound;
|
$l_str_ReferrerAnchorElement .= self::$a_str_PostContainerIdCompound;
|
||||||
$l_str_ReferrerAnchorElement .= $l_int_Index;
|
$l_str_ReferrerAnchorElement .= $l_int_Index;
|
||||||
|
@ -1831,7 +1839,7 @@ class MCI_Footnotes_Task {
|
||||||
* Reference container table row template load
|
* 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.
|
* - Bugfix: Reference container: option to restore pre-2.0.0 layout with the backlink symbol in an extra column.
|
||||||
*
|
*
|
||||||
* @since 2.1.1
|
* @since 2.1.1
|
||||||
* @datetime 2020-11-16T2024+0100
|
* @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:
|
* 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 = '';
|
$l_str_HardLinkAddress = '';
|
||||||
|
|
||||||
if (self::$a_bool_HardLinksEnable) {
|
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 = '<span class="footnote_item_base"><span id="';
|
||||||
$l_str_FootnoteAnchorElement .= self::$a_str_FootnoteLinkSlug;
|
$l_str_FootnoteAnchorElement .= self::$a_str_FootnoteLinkSlug;
|
||||||
$l_str_FootnoteAnchorElement .= self::$a_str_PostContainerIdCompound;
|
$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_ReferrerLinkSlug;
|
||||||
$l_str_HardLinkAddress .= self::$a_str_PostContainerIdCompound;
|
$l_str_HardLinkAddress .= self::$a_str_PostContainerIdCompound;
|
||||||
$l_str_HardLinkAddress .= $l_str_FootnoteId . '"';
|
$l_str_HardLinkAddress .= $l_str_FootnoteId . '"';
|
||||||
|
$l_str_HardLinkAddress .= $l_str_UseBackbuttonHint;
|
||||||
|
|
||||||
// compose optional opening link tag with optional hard link, mandatory for instance:
|
// compose optional opening link tag with optional hard link, mandatory for instance:
|
||||||
self::$a_str_LinkOpenTag = '<a' . $l_str_HardLinkAddress;
|
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_ReferrerLinkSlug;
|
||||||
$l_str_FootnoteReference .= self::$a_str_PostContainerIdCompound;
|
$l_str_FootnoteReference .= self::$a_str_PostContainerIdCompound;
|
||||||
$l_str_FootnoteReference .= $l_str_FootnoteId . '"';
|
$l_str_FootnoteReference .= $l_str_FootnoteId . '"';
|
||||||
|
$l_str_FootnoteReference .= $l_str_UseBackbuttonHint;
|
||||||
}
|
}
|
||||||
$l_str_FootnoteReference .= ' class="footnote_backlink"';
|
$l_str_FootnoteReference .= ' class="footnote_backlink"';
|
||||||
|
|
||||||
|
@ -2038,16 +2072,17 @@ class MCI_Footnotes_Task {
|
||||||
$l_str_FootnoteBacklinks .= ' id="footnote_plugin_reference_';
|
$l_str_FootnoteBacklinks .= ' id="footnote_plugin_reference_';
|
||||||
$l_str_FootnoteBacklinks .= self::$a_int_PostId;
|
$l_str_FootnoteBacklinks .= self::$a_int_PostId;
|
||||||
$l_str_FootnoteBacklinks .= '_' . self::$a_int_ReferenceContainerId;
|
$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:
|
// insert the optional hard link address:
|
||||||
if (self::$a_bool_HardLinksEnable) {
|
if (self::$a_bool_HardLinksEnable) {
|
||||||
$l_str_FootnoteBacklinks .= ' href="#';
|
$l_str_FootnoteBacklinks .= ' href="#';
|
||||||
$l_str_FootnoteBacklinks .= self::$a_str_ReferrerLinkSlug;
|
$l_str_FootnoteBacklinks .= self::$a_str_ReferrerLinkSlug;
|
||||||
$l_str_FootnoteBacklinks .= self::$a_str_PostContainerIdCompound;
|
$l_str_FootnoteBacklinks .= self::$a_str_PostContainerIdCompound;
|
||||||
$l_str_FootnoteBacklinks .= $l_str_FootnoteId . '"';
|
$l_str_FootnoteBacklinks .= $l_str_FootnoteId . '"';
|
||||||
}
|
$l_str_FootnoteBacklinks .= $l_str_UseBackbuttonHint;
|
||||||
|
}
|
||||||
|
|
||||||
$l_str_FootnoteBacklinks .= ' class="footnote_backlink"';
|
$l_str_FootnoteBacklinks .= ' class="footnote_backlink"';
|
||||||
$l_str_FootnoteBacklinks .= ' onclick="footnote_moveToAnchor_';
|
$l_str_FootnoteBacklinks .= ' onclick="footnote_moveToAnchor_';
|
||||||
$l_str_FootnoteBacklinks .= self::$a_int_PostId;
|
$l_str_FootnoteBacklinks .= self::$a_int_PostId;
|
||||||
|
@ -2055,8 +2090,8 @@ class MCI_Footnotes_Task {
|
||||||
$l_str_FootnoteBacklinks .= "('footnote_plugin_tooltip_";
|
$l_str_FootnoteBacklinks .= "('footnote_plugin_tooltip_";
|
||||||
$l_str_FootnoteBacklinks .= self::$a_int_PostId;
|
$l_str_FootnoteBacklinks .= self::$a_int_PostId;
|
||||||
$l_str_FootnoteBacklinks .= '_' . self::$a_int_ReferenceContainerId;
|
$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:
|
// append the offset anchor for optional hard links:
|
||||||
if (self::$a_bool_HardLinksEnable) {
|
if (self::$a_bool_HardLinksEnable) {
|
||||||
$l_str_FootnoteBacklinks .= '<span class="footnote_item_base"><span id="';
|
$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 .= self::$a_str_PostContainerIdCompound;
|
||||||
$l_str_FootnoteBacklinks .= $l_str_FootnoteId;
|
$l_str_FootnoteBacklinks .= $l_str_FootnoteId;
|
||||||
$l_str_FootnoteBacklinks .= '" class="footnote_item_anchor"></span></span>';
|
$l_str_FootnoteBacklinks .= '" class="footnote_item_anchor"></span></span>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$l_str_FootnoteBacklinks .= $l_bool_SymbolSwitch ? '' : $l_str_FootnoteArrow;
|
$l_str_FootnoteBacklinks .= $l_bool_SymbolSwitch ? '' : $l_str_FootnoteArrow;
|
||||||
$l_str_FootnoteBacklinks .= $l_str_FootnoteId;
|
$l_str_FootnoteBacklinks .= $l_str_FootnoteId;
|
||||||
$l_str_FootnoteBacklinks .= $l_bool_SymbolSwitch ? $l_str_FootnoteArrow : '';
|
$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;
|
$l_bool_HasTooltipText = $l_int_TooltipTextLength === false ? false : true;
|
||||||
if ( $l_bool_HasTooltipText ) {
|
if ( $l_bool_HasTooltipText ) {
|
||||||
$l_str_NotTooltipText = substr( $l_str_FootnoteText, ( $l_int_TooltipTextLength + self::$a_int_TooltipShortcodeLength ) );
|
$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 ) {
|
if ( self::$a_bool_MirrorTooltipText ) {
|
||||||
$l_str_TooltipText = substr( $l_str_FootnoteText, 0, $l_int_TooltipTextLength );
|
$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;
|
$l_str_ReferenceText = $l_str_TooltipText . $l_str_ReferenceTextIntroducer . $l_str_NotTooltipText;
|
||||||
} else {
|
} else {
|
||||||
$l_str_ReferenceText = $l_str_NotTooltipText;
|
$l_str_ReferenceText = $l_str_NotTooltipText;
|
||||||
|
@ -2099,10 +2134,7 @@ class MCI_Footnotes_Task {
|
||||||
$l_str_ReferenceText = $l_str_FootnoteText;
|
$l_str_ReferenceText = $l_str_FootnoteText;
|
||||||
}
|
}
|
||||||
|
|
||||||
// replace all placeholders in 'templates/public/reference-container-body.html'
|
// replace all placeholders in table row template:
|
||||||
// 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'
|
|
||||||
$l_obj_Template->replace(
|
$l_obj_Template->replace(
|
||||||
array(
|
array(
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
* @since 1.5.0 14.09.14 10:58
|
* @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 prettify reference container template
|
||||||
* @since 2.0.3 replace tab with a space
|
* @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)
|
* @since 2.5.4 collapse HTML comments and PHP/JS docblocks (only)
|
||||||
*/
|
*/
|
||||||
public function process_template( $template ) {
|
public function process_template( $template ) {
|
||||||
$this->a_str_OriginalContent = preg_replace( '#<!--.+?-->#s', " ", file_get_contents( $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', "", $this->a_str_OriginalContent );
|
||||||
$this->a_str_OriginalContent = str_replace( "\n", "", $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( "\r", "", $this->a_str_OriginalContent );
|
||||||
$this->a_str_OriginalContent = str_replace( "\t", " ", $this->a_str_OriginalContent );
|
$this->a_str_OriginalContent = str_replace( "\t", " ", $this->a_str_OriginalContent );
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
/* Version: 2.5.4
|
/* Version: 2.5.4
|
||||||
|
|
||||||
Last modified: 2021-01-30T0113+0100
|
Last modified: 2021-02-12T1051+0100
|
||||||
|
|
||||||
|
|
||||||
Classes recommended for Custom CSS are listed in
|
Classes recommended for Custom CSS are listed in
|
||||||
|
@ -123,11 +123,24 @@ word-break: break-word;
|
||||||
overflow-wrap: anywhere;
|
overflow-wrap: anywhere;
|
||||||
word-wrap: anywhere;
|
word-wrap: anywhere;
|
||||||
word-break: break-all;
|
word-break: break-all;
|
||||||
|
|
||||||
|
These rules turn out useless for the purpose and are commented out:
|
||||||
|
word-wrap: break-word;
|
||||||
|
overflow-wrap: break-word;
|
||||||
|
|
||||||
|
|
||||||
|
- Bugfix: Reference container, tooltips: URL wrap: enable the 'word-wrap: anywhere' rule, thanks to @rebelc0de bug report.
|
||||||
|
|
||||||
|
@since 2.5.4
|
||||||
|
|
||||||
|
@reporter @rebelc0de
|
||||||
|
@link https://wordpress.org/support/topic/footnotes-on-mobile-phones/#post-14037101
|
||||||
*/
|
*/
|
||||||
|
|
||||||
.footnote_url_wrap {
|
.footnote_url_wrap {
|
||||||
overflow-wrap: break-word;
|
word-wrap: anywhere;
|
||||||
word-wrap: break-word;
|
overflow-wrap: anywhere;
|
||||||
|
word-break: break-all;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************
|
/*****************************************************
|
||||||
|
@ -164,6 +177,9 @@ Classes:
|
||||||
|
|
||||||
@since 2.1.1 Referrers: line height 0 to fix superscript, thanks to @cwbayer bug report
|
@since 2.1.1 Referrers: line height 0 to fix superscript, thanks to @cwbayer bug report
|
||||||
@see <https://wordpress.org/support/topic/footnote-number-in-text-superscript-disrupts-leading/>
|
@see <https://wordpress.org/support/topic/footnote-number-in-text-superscript-disrupts-leading/>
|
||||||
|
|
||||||
|
@since 2.5.4 Bugfix: Referrers: fix vertical alignment, font size and position (static) for cross-theme stability, thanks to @tomturowski bug report.
|
||||||
|
@link https://wordpress.org/support/topic/in-line-superscript-ref-rides-to-high/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
.footnote_referrer,
|
.footnote_referrer,
|
||||||
|
@ -189,6 +205,9 @@ Classes:
|
||||||
|
|
||||||
.footnote_plugin_tooltip_text {
|
.footnote_plugin_tooltip_text {
|
||||||
line-height: 0;
|
line-height: 0;
|
||||||
|
vertical-align: super;
|
||||||
|
font-size: smaller;
|
||||||
|
position: static;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
Plugin URI: https://wordpress.org/plugins/footnotes/
|
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.
|
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
|
Author: Mark Cheret
|
||||||
Version: 2.5.4d5
|
Version: 2.5.4d6
|
||||||
Author URI: http://cheret.de/plugins/footnotes-2/
|
Author URI: http://cheret.de/plugins/footnotes-2/
|
||||||
Text Domain: footnotes
|
Text Domain: footnotes
|
||||||
Domain Path: /languages
|
Domain Path: /languages
|
||||||
|
@ -18,10 +18,10 @@
|
||||||
* @since 2.1.4
|
* @since 2.1.4
|
||||||
* @since 2.5.3 (Hungarian)
|
* @since 2.5.3 (Hungarian)
|
||||||
* @var str
|
* @var str
|
||||||
* @lastmodified 2021-02-11T1131+0100
|
* @lastmodified 2021-02-12T1056+0100
|
||||||
* @committer @pewgeuges
|
* @committer @pewgeuges
|
||||||
*/
|
*/
|
||||||
define( 'C_STR_FOOTNOTES_VERSION', '2.5.4d5' );
|
define( 'C_STR_FOOTNOTES_VERSION', '2.5.4d6' );
|
||||||
|
|
||||||
/*
|
/*
|
||||||
LICENSE NOTICE
|
LICENSE NOTICE
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
note-for-developers.txt
|
note-for-developers.txt
|
||||||
@datetime 2020-12-19T0609+0100
|
@datetime 2020-12-19T0609+0100
|
||||||
@lastmodified 2021-02-08T0843+0100
|
@lastmodified 2021-02-12T0616+0100
|
||||||
|
|
||||||
|
|
||||||
Footnotes plugin for WordPress, v2.5.3 and later
|
Plugin Footnotes for WordPress, v2.5.3 and later
|
||||||
|
|
||||||
|
|
||||||
A. Customized template parts
|
A. Customized template parts
|
||||||
|
@ -53,22 +53,24 @@ configurable in the dashboard > Referrers and tooltips > Tooltip timing.
|
||||||
B. Customized documentation schema
|
B. Customized documentation schema
|
||||||
‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
|
‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
|
||||||
|
|
||||||
In community-based, open source projects, it is important to comprehensively
|
In community-based, open source projects, it is important to comprehensively
|
||||||
recognize, acknowledge and document how developers, testers and users helped
|
recognize, acknowledge and document how developers, testers and users helped
|
||||||
build the product.
|
build the product.
|
||||||
|
https://wordpress.org/support/topic/great-tool-1549/#post-14039334
|
||||||
|
|
||||||
Note: Per the WordPress Coding Standards, the '@author' tag must not be used.
|
Note: Per the WordPress Coding Standards, the '@author' tag must not be used.
|
||||||
https://developer.wordpress.org/coding-standards/inline-documentation-standards/php/
|
https://developer.wordpress.org/coding-standards/inline-documentation-standards/php/
|
||||||
|
|
||||||
PHPDOC tag: Role: In the changelog:
|
PHPDOC tag: Role: Acknowledgment in the changelog:
|
||||||
|
‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
|
||||||
@contributor Provided code. “thanks to @USERNAME code contribution.”
|
@contributor Provided code. “thanks to @USERNAME code contribution.”
|
||||||
|
|
||||||
@reporter Reported a bug. “thanks to @USERNAME bug report.”
|
@reporter Reported a bug. “thanks to @USERNAME bug report.”
|
||||||
@reporter Reported an issue. “thanks to @USERNAME issue report.”
|
@reporter Reported an issue. “thanks to @USERNAME issue report.”
|
||||||
@reporter Requested a feature. “thanks to @USERNAME issue report.” (!)
|
@reporter Requested a feature. “thanks to @USERNAME issue report.” (!)
|
||||||
|
@reporter Provided feedback. “thanks to @USERNAME feedback.”
|
||||||
|
@reporter Provided an example. “thanks to @USERNAME example provision.”
|
||||||
|
|
||||||
@user Provided feedback. “thanks to @USERNAME feedback.”
|
|
||||||
@user Allowed insight. “thanks to @USERNAME usage.”
|
@user Allowed insight. “thanks to @USERNAME usage.”
|
||||||
|
|
||||||
@accountable Edited the codebase. -
|
@accountable Edited the codebase. -
|
||||||
|
@ -77,6 +79,7 @@ PHPDOC tag: Role: In the changelog:
|
||||||
|
|
||||||
|
|
||||||
PHPDOC tags & custom tags
|
PHPDOC tags & custom tags
|
||||||
|
‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
|
||||||
2021-01-24T2310+0100
|
2021-01-24T2310+0100
|
||||||
2021-02-08T0415+0100
|
2021-02-08T0415+0100
|
||||||
|
|
||||||
|
@ -102,46 +105,46 @@ inline {@link}
|
||||||
Sidepane:
|
Sidepane:
|
||||||
|
|
||||||
phpDocumentor tags
|
phpDocumentor tags
|
||||||
@abstract
|
@abstract
|
||||||
@access
|
@access
|
||||||
@author
|
@author
|
||||||
@category
|
@category
|
||||||
@copyright
|
@copyright
|
||||||
@deprecated
|
@deprecated
|
||||||
@example
|
@example
|
||||||
@final
|
@final
|
||||||
@filesource
|
@filesource
|
||||||
@global
|
@global
|
||||||
@ignore
|
@ignore
|
||||||
@internal
|
@internal
|
||||||
@license
|
@license
|
||||||
@link
|
@link
|
||||||
@method
|
@method
|
||||||
@name
|
@name
|
||||||
@package
|
@package
|
||||||
@param
|
@param
|
||||||
@property
|
@property
|
||||||
@return
|
@return
|
||||||
@see
|
@see
|
||||||
@since
|
@since
|
||||||
@static
|
@static
|
||||||
@staticvar
|
@staticvar
|
||||||
@subpackage
|
@subpackage
|
||||||
@todo
|
@todo
|
||||||
@tutorial
|
@tutorial
|
||||||
@uses
|
@uses
|
||||||
@var
|
@var
|
||||||
@version
|
@version
|
||||||
|
|
||||||
phpDocumentor Inline tags
|
phpDocumentor Inline tags
|
||||||
inline {@example}
|
inline {@example}
|
||||||
inline {@id}
|
inline {@id}
|
||||||
inline {@internal}}
|
inline {@internal}}
|
||||||
inline {@inheritdoc}
|
inline {@inheritdoc}
|
||||||
inline {@link}
|
inline {@link}
|
||||||
inline {@source}
|
inline {@source}
|
||||||
inline {@toc}
|
inline {@toc}
|
||||||
inline {@tutorial}
|
inline {@tutorial}
|
||||||
|
|
||||||
|
|
||||||
▲ Tags required/recommended by WordPress coding standard:
|
▲ Tags required/recommended by WordPress coding standard:
|
||||||
|
|
17
readme.txt
17
readme.txt
|
@ -79,19 +79,24 @@ Visit this swift write-up from a **footnotes** user by the name of **Southwest**
|
||||||
|
|
||||||
== Changelog ==
|
== Changelog ==
|
||||||
|
|
||||||
= 2.5.4d5 =
|
= 2.5.4d6 =
|
||||||
|
- Bugfix: Referrers: fix vertical alignment, font size and position (static) for cross-theme stability, thanks to @tomturowski bug report.
|
||||||
|
- Bugfix: Reference container, tooltips: URL wrap: enable the 'word-wrap: anywhere' rule, thanks to @rebelc0de bug report.
|
||||||
|
- Bugfix: Reference container, tooltips: URL wrap: account for leading space in value, thanks to @karolszakiel example provision.
|
||||||
|
- Bugfix: Dashboard: Tooltip dimensions: move from 'Tooltip position' to a dedicated metabox, thanks to @codldmac issue report.
|
||||||
- Update: Libraries: jQuery Tools: replace deprecated function jQuery.isFunction(), thanks to @a223123131 bug report.
|
- Update: Libraries: jQuery Tools: replace deprecated function jQuery.isFunction(), thanks to @a223123131 bug report.
|
||||||
- Bugfix: Editor button: Classic Editor text mode: try to fix uncaught reference error of “QTags is not defined”, thanks to @dpartridge bug report.
|
- Bugfix: Editor button: Classic Editor text mode: try to fix uncaught reference error of “QTags is not defined”, thanks to @dpartridge bug report.
|
||||||
- Bugfix: Reference container, tooltips: URL wrap: account for leading space in value, thanks to @karolszakiel example provision.
|
- Update: Reference container: Hard backlinks (optional): optional configurable tooltip hinting to use the backbutton instead, thanks to @@theroninjedi47 bug report.
|
||||||
|
- Update: Tooltips: Excerpt delimiter: add configuration settings in the dashboard.
|
||||||
- Bugfix: Tooltips: fix display in Popup Maker popups by correcting a coding error.
|
- Bugfix: Tooltips: fix display in Popup Maker popups by correcting a coding error.
|
||||||
- Bugfix: Editor button: Classic Editor text mode: correct label to singular.
|
- Bugfix: Editor button: Classic Editor text mode: correct label to singular.
|
||||||
- Bugfix: Libraries: jQuery Tools: replace discouraged double equals sign with recommended triple equals sign.
|
- Bugfix: Libraries: jQuery Tools: replace double equals sign discouraged in JavaScript with recommended triple equals sign.
|
||||||
|
|
||||||
= 2.5.3 =
|
= 2.5.3 =
|
||||||
- Bugfix: Reference container, tooltips: URL wrap: exclude URL pattern as folder name in Wayback Machine URL, thanks to @rumperuu bug report.
|
- Bugfix: Reference container, tooltips: URL wrap: exclude URL pattern as folder name in Wayback Machine URL, thanks to @rumperuu bug report.
|
||||||
|
|
||||||
= 2.5.2 =
|
= 2.5.2 =
|
||||||
- Update: Tooltips: ability to display dedicated content before `[[/tooltip]]`, thanks to @jbj2199 issue report.
|
- Update: Tooltips: Excerpt delimiter: ability to display dedicated content before `[[/tooltip]]`, thanks to @jbj2199 issue report.
|
||||||
- Bugfix: Localization: plugin language file name changes effective in version control system.
|
- Bugfix: Localization: plugin language file name changes effective in version control system.
|
||||||
|
|
||||||
= 2.5.1 =
|
= 2.5.1 =
|
||||||
|
@ -288,7 +293,7 @@ Visit this swift write-up from a **footnotes** user by the name of **Southwest**
|
||||||
= 2.0.6 =
|
= 2.0.6 =
|
||||||
- Bugfix: Infinite scroll: debug autoload by adding post ID, thanks to @docteurfitness code contribution.
|
- Bugfix: Infinite scroll: debug autoload by adding post ID, thanks to @docteurfitness code contribution.
|
||||||
- Bugfix: Referrers: delete vertical align tweaks, for cross-theme and user agent compatibility.
|
- Bugfix: Referrers: delete vertical align tweaks, for cross-theme and user agent compatibility.
|
||||||
- Bugfix: Reference container: fix line breaking behavior in footnote backlink clusters.
|
- Bugfix: Reference container: fix line breaking behavior in footnote number clusters.
|
||||||
- Bugfix: Reference container: auto-extending column to fit widest, to fix display with short note texts.
|
- Bugfix: Reference container: auto-extending column to fit widest, to fix display with short note texts.
|
||||||
- Bugfix: Reference container: IDs: slightly increased left padding.
|
- Bugfix: Reference container: IDs: slightly increased left padding.
|
||||||
- Bugfix: Translations: fix spelling error and erroneously changed word in en_GB and en_US.
|
- Bugfix: Translations: fix spelling error and erroneously changed word in en_GB and en_US.
|
||||||
|
@ -310,7 +315,7 @@ Visit this swift write-up from a **footnotes** user by the name of **Southwest**
|
||||||
= 2.0.4 =
|
= 2.0.4 =
|
||||||
- Update: Restore arrow settings to customize or disable the now prepended arrow symbol.
|
- Update: Restore arrow settings to customize or disable the now prepended arrow symbol.
|
||||||
- Update: GDPR: Add jQuery UI from WordPress instead of third party.
|
- Update: GDPR: Add jQuery UI from WordPress instead of third party.
|
||||||
- Bugfix: UX: Remove hyperlink addresses from referrers and backlinks wrt browsing history.
|
- Bugfix: Referrers and backlinks: remove hard links to streamline browsing history, thanks to @theroninjedi47 bug report.
|
||||||
- Bugfix: Reference container: remove inconvenient left/right cellpadding.
|
- Bugfix: Reference container: remove inconvenient left/right cellpadding.
|
||||||
- Bugfix: Tooltips: improve layout with inherited font size by lower line height.
|
- Bugfix: Tooltips: improve layout with inherited font size by lower line height.
|
||||||
- Bugfix: Tooltips: 'Continue reading' button: disable default underline.
|
- Bugfix: Tooltips: 'Continue reading' button: disable default underline.
|
||||||
|
|
|
@ -12,9 +12,5 @@
|
||||||
<td>[[label-offset-y]]</td>
|
<td>[[label-offset-y]]</td>
|
||||||
<td>[[offset-y]] [[offset-y-alternative]] <span class="footnotes_notice">[[notice-offset-y]]</span></td>
|
<td>[[offset-y]] [[offset-y-alternative]] <span class="footnotes_notice">[[notice-offset-y]]</span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
|
||||||
<td>[[label-max-width]]</td>
|
|
||||||
<td>[[max-width]] [[width]] <span class="footnotes_notice">[[notice-max-width]]</span></td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
|
@ -24,5 +24,13 @@
|
||||||
<td>[[label-separator]]</td>
|
<td>[[label-separator]]</td>
|
||||||
<td>[[separator]] <span class="footnotes_notice">[[notice-separator]]</span></td>
|
<td>[[separator]] <span class="footnotes_notice">[[notice-separator]]</span></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>[[label-backlink-tooltips]]</td>
|
||||||
|
<td>[[backlink-tooltips]] <span class="footnotes_notice">[[notice-backlink-tooltips]]</span></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>[[label-backlink-tooltip-text]]</td>
|
||||||
|
<td>[[backlink-tooltip-text]] <span class="footnotes_notice">[[notice-backlink-tooltip-text]]</span></td>
|
||||||
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
Reference in a new issue