for bugfix release 2.0.3

git-svn-id: https://plugins.svn.wordpress.org/footnotes/trunk@2409068 b8457f37-d9ea-0310-8a92-e5e31aec5664
This commit is contained in:
pewgeuges 2020-10-29 13:17:36 +00:00
parent 45e85af501
commit 9d4768f040
8 changed files with 149 additions and 88 deletions

View file

@ -6,6 +6,9 @@
* @author Stefan Herndler
* @since 1.5.0 12.09.14 10:56
*/
// Versioning: update plugin version # for style sheet cache busting on line 103
// Added jQueryUI on 2020-10-26T1907+0100
// Following @vonpiernik <https://wordpress.org/support/topic/tooltip-hover-not-showing/#post-13456762>
@ -96,8 +99,8 @@ class MCI_Footnotes {
wp_register_script( 'jQueryUI', 'https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js', null, null, true );
wp_enqueue_script( 'jQueryUI' );
wp_enqueue_style('mci-footnotes-css-public', plugins_url('../css/public.css', __FILE__));
// IMPORTANT: current version number for cache busting:
wp_enqueue_style('mci-footnotes-css-public', plugins_url('../css/public.css', __FILE__), '', '2.0.3');
// add the jQuery plugin (already registered by WordPress)
wp_enqueue_script('jquery');

View file

@ -5,17 +5,10 @@
* @filesource
* @author Stefan Herndler
* @since 1.5.0
*
*/
/*
Customization: 2020-06-23T0613+0200 custom styles, fixed print output [now in public.css]
Customization: 2020-09-09T2140+0200 raised scroll level, shorter scroll time [reference-container.html]
Customization: 2020-09-09T2140+0200 changed parameters off dashboard [tooltip.html]
Debugging: 2020-09-09T2140+0200 fixed missing or wrong links #0#
Usability: 2020-09-09T2140+0200 voided $a_str_Prefix #1#
Usability: 2020-09-09T2140+0200 added line breaks #2#
Translation: 2020-09-10T2104+0200 fix infobox text and missing setting #0#
Upgrade v1.6.5: 2020-10-23T0252+0200 #3#
Last modified: 2020-10-23T0611+0200
Last modified: 2020-10-29T1402+0100
*/
// If called directly, abort:
defined( 'ABSPATH' ) or die;
@ -316,6 +309,10 @@ class MCI_Footnotes_Task {
* @return string
*/
public function search($p_str_Content, $p_bool_ConvertHtmlChars, $p_bool_HideFootnotesText) {
// prepare prepending post ID to make footnote IDs unique wrt archive view:
$id_underscore = get_the_id();
$id_underscore .= '_';
self::$a_str_Prefix = $id_underscore;
// contains the index for the next footnote on this page
$l_int_FootnoteIndex = count(self::$a_arr_Footnotes) + 1;
// contains the starting position for the lookup of a footnote
@ -350,7 +347,6 @@ class MCI_Footnotes_Task {
do {
// get first occurrence of the footnote short code [start]
$i_int_len_Content = strlen($p_str_Content);
// #3# upgrade v1.6.5:
if ($l_int_PosStart > $i_int_len_Content) $l_int_PosStart = $i_int_len_Content;
$l_int_PosStart = strpos($p_str_Content, $l_str_StartingTag, $l_int_PosStart);
// no short code found, stop here
@ -382,12 +378,6 @@ class MCI_Footnotes_Task {
if (is_int($l_int_MaxLength) && strlen($l_str_DummyText) > $l_int_MaxLength) {
$l_str_ExcerptText = substr($l_str_DummyText, 0, $l_int_MaxLength);
$l_str_ExcerptText = substr($l_str_ExcerptText, 0, strrpos($l_str_ExcerptText, ' '));
// #0#
// col 48: replaced space with no-break space.
// col 54: replaced three dots with horizontal ellipsis (&hellip;): “use the single Unicode …, and not three dots” <https://developer.mozilla.org/en-US/docs/Mozilla/Localization/Localization_content_best_practices>
// col 139: added class.
// col 162: added fragment id, or the footnote wont work if JS is disabled.
// col 294: added the random prefix for consistency, even if disabled.
$l_str_ExcerptText .= '&nbsp;&#x2026; ' . sprintf(__("%scontinue%s", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), '<a class="continue" href="#footnote_plugin_reference_' . self::$a_str_Prefix.$l_str_Index . '" onclick="footnote_moveToAnchor(\'footnote_plugin_reference_' . self::$a_str_Prefix . $l_str_Index . '\');">', '</a>');
}
}
@ -500,7 +490,7 @@ class MCI_Footnotes_Task {
"text" => $l_str_FootnoteText
)
);
// #2# added line breaks for source code legibility:
// extra line breaks for page source legibility:
$footnote_item_temp = $l_obj_Template->getContent();
$footnote_item_temp .= "\r\n\r\n";
$l_str_Body .= $footnote_item_temp;
@ -522,8 +512,6 @@ class MCI_Footnotes_Task {
// free all found footnotes if reference container will be displayed
self::$a_arr_Footnotes = array();
// #1# Disabled the random prefix preventing fn refs from being shared.
//self::$a_str_Prefix = rand(1000, 9999) . "_";
return $l_obj_TemplateContainer->getContent();
}
}

View file

@ -6,7 +6,7 @@
* @author Stefan Herndler
* @since 1.5.0 14.09.14 10:58
*/
// Last modified: 2020-10-29T0805+0100
/**
* Handles each Template file for the Plugin Frontend (e.g. Settings Dashboard, Public pages, ...).
@ -76,6 +76,8 @@ class MCI_Footnotes_Template {
// get Template file content
$this->a_str_OriginalContent = str_replace("\n", "", file_get_contents($l_str_TemplateFile));
$this->a_str_OriginalContent = str_replace("\r", "", $this->a_str_OriginalContent);
$this->a_str_OriginalContent = str_replace("\t", " ", $this->a_str_OriginalContent);
$this->a_str_OriginalContent = str_replace(" ", " ", $this->a_str_OriginalContent);
$this->reload();
}
@ -125,4 +127,4 @@ class MCI_Footnotes_Template {
return $this->a_str_ReplacedContent;
}
} // end of class
} // end of class