preview 2.2.9d2

git-svn-id: https://plugins.svn.wordpress.org/footnotes/trunk@2445928 b8457f37-d9ea-0310-8a92-e5e31aec5664
This commit is contained in:
pewgeuges 2020-12-25 15:14:43 +00:00
parent 9026c8ae19
commit ba10a9b137
14 changed files with 215 additions and 146 deletions

View file

@ -6,28 +6,28 @@
* @author Stefan Herndler
* @since 1.5.0 14.09.14 14:47
*
* Edited for:
* 2.0.4 restore arrow settings 2020-11-01T0509+0100
* 2.1.0 read-on button label 2020-11-08T2148+0100
* 2.1.1 options for ref container and alternative tooltips 2020-11-16T2152+0100
* 2.1.2 priority level settings for all other hooks, thanks to @nikelaos
* Edited:
* @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.1 options for ref container and alternative tooltips 2020-11-16T2152+0100
* @since 2.1.2 priority level settings for all other hooks, thanks to @nikelaos
* @see <https://wordpress.org/support/topic/doesnt-work-any-more-11/#post-13676705>
* 2.1.4 settings for ref container, tooltips and scrolling 2020-12-03T0950+0100
* 2.1.6 slight UI reordering 2020-12-09T1114+0100
* 2.1.6 option to disable URL line wrapping 2020-12-09T1604+0100
* 2.1.6 remove expert mode setting as outdated 2020-12-09T2105+0100
* 2.2.0 start/end short codes: more predefined options, thanks to @nikelaos
* @since 2.1.4 settings for ref container, tooltips and scrolling 2020-12-03T0950+0100
* @since 2.1.6 slight UI reordering 2020-12-09T1114+0100
* @since 2.1.6 option to disable URL line wrapping 2020-12-09T1604+0100
* @since 2.1.6 remove expert mode setting as outdated 2020-12-09T2105+0100
* @since 2.2.0 start/end short codes: more predefined options, thanks to @nikelaos
* @see <https://wordpress.org/support/topic/doesnt-work-with-mailpoet/>
* 2.2.0 add options, redistribute, update strings 2020-12-12T2135+0100
* 2.2.0 shortcode for reference container custom position 2020-12-13T2055+0100
* 2.2.2 Custom CSS settings container migration 2020-12-15T0709+0100
* 2.2.4 move backlink symbol selection under previous tab 2020-12-16T1244+0100
* 2.2.5 support for Ibid. notation thanks to @meglio 2020-12-17T2021+0100
* @since 2.2.0 add options, redistribute, update strings 2020-12-12T2135+0100
* @since 2.2.0 shortcode for reference container custom position 2020-12-13T2055+0100
* @since 2.2.2 Custom CSS settings container migration 2020-12-15T0709+0100
* @since 2.2.4 move backlink symbol selection under previous tab 2020-12-16T1244+0100
* @since 2.2.5 support for Ibid. notation thanks to @meglio 2020-12-17T2021+0100
* @see <https://wordpress.org/support/topic/add-support-for-ibid-notation/>
* 2.2.5 options for label element and label bottom border, thanks to @markhillyer 2020-12-18T1447+0100
* @since 2.2.5 options for label element and label bottom border, thanks to @markhillyer 2020-12-18T1447+0100
* @see <https://wordpress.org/support/topic/how-do-i-eliminate-the-horizontal-line-beneath-the-reference-container-heading/>
*
* Last modified: 2020-12-20T0533+0100
* Last modified: 2020-12-25T0355+0100
*/
/**
@ -79,11 +79,11 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
* @return array
*
* Edited:
* 2.1.6 tabs reordered and renamed
* @since 2.1.6 tabs reordered and renamed
* @see customization vs configuration
* <https://www.linkedin.com/pulse/20140610191154-4746170-configuration-vs-customization-when-and-why-would-i-implement-each>
*
* 2.1.6 removed if statement around expert tab
* @since 2.1.6 removed if statement around expert tab
*/
protected function getSections() {
$l_arr_Tabs = array();
@ -160,7 +160,7 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
*
* Completed:
* @since 2.1.4: layout and typography options 2020-11-30T0548+0100
* 2.2.5 options for label element and label bottom border, thanks to @markhillyer 2020-12-18T1447+0100
* @since 2.2.5 options for label element and label bottom border, thanks to @markhillyer 2020-12-18T1447+0100
* @see <https://wordpress.org/support/topic/how-do-i-eliminate-the-horizontal-line-beneath-the-reference-container-heading/>
*/
public function ReferenceContainer() {
@ -808,12 +808,12 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
* @since 1.5.0
*
* Edited:
* 2.1.6 drop localized notices for CSS classes as the number increased to 16
* @since 2.1.6 drop localized notices for CSS classes as the number increased to 16
* list directly in the template, as CSS is in English anyway
* @see templates/dashboard/customize-css.html
* 2020-12-09T1113+0100
*
* 2.2.2 migrate Custom CSS to a dedicated tab 2020-12-15T0506+0100
* @since 2.2.2 migrate Custom CSS to a dedicated tab 2020-12-15T0506+0100
*/
public function CustomCSS() {
// load template file
@ -896,6 +896,9 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
* empty should be interpreted as PHP_INT_MAX,
* but a numbox cannot be set to empty: <https://github.com/Modernizr/Modernizr/issues/171>
* define -1 as PHP_INT_MAX instead
*
* @since 2.2.9 removed the warning about the widget text hook 2020-12-25T0348+0100
* @since 2.2.9 added guidance for the widget text hook 2020-12-25T0353+0100
*/
public function LookupHooks() {
// load template file
@ -908,7 +911,7 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
"description-1" => __('The priority level determines whether Footnotes is executed timely before other plugins, and how the reference container is positioned relative to other features.', MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
"description-2" => sprintf(__('For the_content, this figure must be lower than %1$d so that certain strings added by a plugin running at %1$d may not be mistaken as a footnote. This makes also sure that the reference container displays above a feature inserted by a plugin running at %2$d.', MCI_Footnotes_Config::C_STR_PLUGIN_NAME), 99, 1200),
"description-3" => sprintf(__('%1$d is lowest priority, %2$d is highest. To set priority level to lowest, set it to %3$d, interpreted as %1$d, the constant %4$s.', MCI_Footnotes_Config::C_STR_PLUGIN_NAME), PHP_INT_MAX, 0, -1, 'PHP_INT_MAX'),
"description-4" => __('The widget_text hook must be disabled, because a reference container is inserted at the bottom of each widget with footnotes, but multiple containers in a page are not functional.', MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
"description-4" => __('The widget_text hook must be enabled either when footnotes are present in theme text widgets, or when Elementor accordions or toggles shall have a reference container per section. If they should not, this hook must be disabled.', MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
"head-hook" => __("WordPress hook function name", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
"head-checkbox" => __("Activate", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),

View file

@ -6,10 +6,10 @@
* @since 1.5.0 14.09.14 17:47
*
* Edited for:
* 2.0.0 PHP-related bug fix thanks to MatKus (@matkus) 2020-10-26T1609+0100
* 2.0.0 PHP-related bug fix thanks to @matkus 2020-10-26T1609+0100
* 2.1.6 conform to WordPress plugin language file name scheme 2020-12-08T1931+0100
*
* Last modified: 2020-12-11T1449+0100
* Last modified: 2020-12-25T0344+0100
*/
/**
@ -35,7 +35,7 @@ class MCI_Footnotes_Language {
* @author Stefan Herndler
* @since 1.5.0
*
* @since 2.0.0 PHP 7.1 related bug fix thanks to MatKus (@matkus)
* @since 2.0.0 PHP 7.1 related bug fix thanks to @matkus
* @see <https://wordpress.org/support/topic/error-missing-parameter-if-using-php-7-1-or-later/>
* @see <https://www.php.net/manual/en/migration71.incompatible.php>
*/
@ -46,7 +46,7 @@ class MCI_Footnotes_Language {
// 2020-10-26T1609+0100
return;
}
// fallback to english
// fall back to British English:
self::load("en_GB");
}

View file

@ -46,11 +46,17 @@
* @see <https://wordpress.org/support/topic/how-do-i-eliminate-the-horizontal-line-beneath-the-reference-container-heading/>
* @since 2.2.6 URL wrap: make the quotation mark optional in the exclusion regex, thanks to @spiralofhope2 2020-12-23T0409+0100
* @see <https://wordpress.org/support/topic/two-links-now-breaks-footnotes-with-blogtext/>
* @since 2.2.7 revert that change in the exclusion regex, thanks to @rjl20 and @spaceling 2020-12-23T1046+0100
* @since 2.2.7 revert that change in the exclusion regex, thanks to @rjl20, @spaceling, @friedrichnorth, @bernardzit 2020-12-23T1046+0100
* @see <https://wordpress.org/support/topic/two-links-now-breaks-footnotes-with-blogtext/>
* @since 2.2.8 correct lookbehind by duplicating it with and without quotation mark class 2020-12-23T1108+0100
* @see <https://wordpress.org/support/topic/footnotes-dont-show-after-update-to-2-2-6/>
* @since 2.2.8 URL wrap: correct lookbehind by duplicating it with and without quotation mark class 2020-12-23T1108+0100
* @since 2.2.9 URL wrap: account for RFC 2396 allowed characters in parameter names 2020-12-24T1956+0100
* @see <https://stackoverflow.com/questions/814700/http-url-allowed-characters-in-parameter-names>
* @since 2.2.9 Reference containers, widget_text hook: support for multiple containers in a page, thanks to @justbecuz 2020-12-25T0338+0100
* @see <https://wordpress.org/support/topic/reset-footnotes-to-1/#post-13662830>
* @since 2.2.9 URL wrap: exclude URLs also where the equals sign is preceded by an entity or character reference 2020-12-25T1251+0100
*
* Last modified: 2020-12-23T1108+0100
* Last modified: 2020-12-25T1301+0100
*/
// If called directly, abort:
@ -91,6 +97,37 @@ class MCI_Footnotes_Task {
*/
public static $a_str_Prefix = "";
/**
* INFINITE SCROLL / AUTOLOAD, ARCHIVE VIEW
*
* Multiple posts are appended to each other, functions and note IDs must be disambiguated.
*
* Contribution thankfully received from @docteurfitness
* @see <https://wordpress.org/support/topic/auto-load-post-compatibility-update/>
* @since 2.0.5
* @var int
*
* post ID to make everything unique wrt infinite scroll and archive view:
* (will be filled in by the next possible occasion; PHP seems to prohibit doing so here)
*/
public static $l_int_PostId = '';
/**
* Reference container ID
*
* This ID disambiguates multiple reference containers in a page
* as they may occur when the widget_text hook is active and the page
* is built with Elementor and has an accordion or similar toggle sections.
*
* Is incremented each time after a reference container is inserted.
*
* Thanks to @justbecuz
* @see <https://wordpress.org/support/topic/reset-footnotes-to-1/#post-13662830>
* @since 2.2.9
* @var int
*/
public static $l_int_ReferenceContainerId = 1;
/**
* Register WordPress Hooks to replace Footnotes in the content of a public page.
*
@ -183,7 +220,7 @@ class MCI_Footnotes_Task {
*/
public function wp_head() {
// no switch out to insert start tag:
// insert start tag without switching out of PHP:
echo "\r\n<style type=\"text/css\" media=\"all\">\r\n";
// display ref container on home page:
@ -368,7 +405,7 @@ class MCI_Footnotes_Task {
}
echo MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_CUSTOM_CSS_NEW);
// no switch out to insert end tag:
// insert end tag without switching out of PHP:
echo "\r\n</style>\r\n";
// alternative tooltip script printed formatted not minified:
@ -543,13 +580,13 @@ class MCI_Footnotes_Task {
* @see <https://wordpress.org/support/topic/reference-container-in-elementor/#post-13784126>
*/
public function exec($p_str_Content, $p_bool_OutputReferences = false, $p_bool_HideFootnotesText = false) {
// replace all footnotes in the content, settings are converted to html characters
$p_str_Content = $this->search($p_str_Content, true, $p_bool_HideFootnotesText);
// replace all footnotes in the content, settings are NOT converted to html characters
$p_str_Content = $this->search($p_str_Content, false, $p_bool_HideFootnotesText);
// append the reference container
// or insert at shortcode: added for 2.2.0, thanks to @hamshe
// append the reference container or insert at shortcode:
$l_str_ReferenceContainerPositionShortcode = MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_REFERENCE_CONTAINER_POSITION_SHORTCODE);
if ($p_bool_OutputReferences) {
@ -563,6 +600,9 @@ class MCI_Footnotes_Task {
$p_str_Content .= $this->ReferenceContainer();
}
// increment the container ID:
self::$l_int_ReferenceContainerId++;
}
// delete position shortcode should any remain e.g. when ref container is in footer, thanks to @hamshe:
@ -573,7 +613,7 @@ class MCI_Footnotes_Task {
self::$a_bool_AllowLoveMe = false;
$p_str_Content = str_replace(MCI_Footnotes_Config::C_STR_NO_LOVE_SLUG, "", $p_str_Content);
}
// return the content with replaced footnotes and optional reference container append
// return the content with replaced footnotes and optional reference container appended:
return $p_str_Content;
}
@ -586,12 +626,13 @@ class MCI_Footnotes_Task {
* @param bool $p_bool_ConvertHtmlChars html encode settings, default true.
* @param bool $p_bool_HideFootnotesText Hide footnotes found in the string.
* @return string
*
* Edited since 2.0.0
*/
public function search($p_str_Content, $p_bool_ConvertHtmlChars, $p_bool_HideFootnotesText) {
// post ID to make everything unique wrt infinite scroll and archive view
global $l_int_PostId;
$l_int_PostId = get_the_id();
self::$l_int_PostId = get_the_id();
// contains the index for the next footnote on this page
$l_int_FootnoteIndex = count(self::$a_arr_Footnotes) + 1;
@ -631,7 +672,7 @@ class MCI_Footnotes_Task {
// search footnotes short codes in the content
do {
// get first occurrence of the footnote short code [start]
// get first occurrence of the footnote start tag short code:
$i_int_len_Content = strlen($p_str_Content);
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);
@ -639,7 +680,7 @@ class MCI_Footnotes_Task {
if ($l_int_PosStart === false) {
break;
}
// get first occurrence of a footnote short code [end]
// get first occurrence of the footnote end tag short code:
$l_int_PosEnd = strpos($p_str_Content, $l_str_EndingTag, $l_int_PosStart);
// no short code found, stop here
if ($l_int_PosEnd === false) {
@ -672,12 +713,16 @@ class MCI_Footnotes_Task {
* URLs may be a query string in a URL:
* @since 2.2.6 make the quotation mark optional in the exclusion regex, thanks to @spiralofhope2 2020-12-23T0409+0100
* @see <https://wordpress.org/support/topic/two-links-now-breaks-footnotes-with-blogtext/>
* @since 2.2.7 revert that change in the exclusion regex, thanks to @rjl20 and @spaceling 2020-12-23T1046+0100
* @since 2.2.7 revert that change in the exclusion regex, thanks to @rjl20, @spaceling, @friedrichnorth, @bernardzit 2020-12-23T1046+0100
* @see <https://wordpress.org/support/topic/two-links-now-breaks-footnotes-with-blogtext/>
* @see <https://wordpress.org/support/topic/footnotes-dont-show-after-update-to-2-2-6/>
* @since 2.2.8 correct lookbehind by duplicating it with and without quotation mark class 2020-12-23T1107+0100
* @since 2.2.9 account for RFC 2396 allowed characters in parameter names 2020-12-24T1956+0100
* @see <https://stackoverflow.com/questions/814700/http-url-allowed-characters-in-parameter-names>
* @since 2.2.9 exclude URLs also where the equals sign is preceded by an entity or character reference 2020-12-25T1234+0100
*/
if (MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_FOOTNOTE_URL_WRAP_ENABLED))) {
$l_str_FootnoteText = preg_replace( '#(?<!\w=[\'"])(?<!\w=)(https?://[^\\s<]+)#', '<span class="footnote_url_wrap">$1</span>', $l_str_FootnoteText );
$l_str_FootnoteText = preg_replace( '#(?<![-\w\.!~\*\'\(\);]=[\'"])(?<![-\w\.!~\*\'\(\);]=)(https?://[^\\s<]+)#', '<span class="footnote_url_wrap">$1</span>', $l_str_FootnoteText );
}
// Text to be displayed instead of the footnote
@ -687,7 +732,7 @@ class MCI_Footnotes_Task {
if (!$p_bool_HideFootnotesText) {
$l_int_Index = MCI_Footnotes_Convert::Index($l_int_FootnoteIndex, MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_FOOTNOTES_COUNTER_STYLE));
// display only an excerpt of the footnotes text if enabled
// display only a truncated footnote text if option enabled:
$l_str_ExcerptText = $l_str_FootnoteText;
$l_bool_EnableExcerpt = MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_FOOTNOTES_MOUSE_OVER_BOX_EXCERPT_ENABLED));
$l_int_MaxLength = intval(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_EXCERPT_LENGTH));
@ -699,8 +744,10 @@ class MCI_Footnotes_Task {
$l_str_ExcerptText = substr($l_str_ExcerptText, 0, strrpos($l_str_ExcerptText, ' '));
$l_str_ExcerptText .= '&nbsp;&#x2026; ';
$l_str_ExcerptText .= '<span class="footnote_tooltip_continue" ';
$l_str_ExcerptText .= 'onclick="footnote_moveToAnchor_' . $l_int_PostId;
$l_str_ExcerptText .= '(\'footnote_plugin_reference_' . $l_int_PostId;
$l_str_ExcerptText .= 'onclick="footnote_moveToAnchor_' . self::$l_int_PostId;
$l_str_ExcerptText .= '_' . self::$l_int_ReferenceContainerId;
$l_str_ExcerptText .= '(\'footnote_plugin_reference_' . self::$l_int_PostId;
$l_str_ExcerptText .= '_' . self::$l_int_ReferenceContainerId;
$l_str_ExcerptText .= '_' . $l_int_Index . '\');">';
$l_str_ExcerptText .= MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_FOOTNOTES_TOOLTIP_READON_LABEL);
$l_str_ExcerptText .= '</span>';
@ -721,8 +768,9 @@ class MCI_Footnotes_Task {
// fill in 'templates/public/footnote.html':
$l_obj_Template->replace(
array(
"post_id" => $l_int_PostId,
"id" => $l_int_Index,
"post_id" => self::$l_int_PostId,
"container_id" => self::$l_int_ReferenceContainerId,
"note_id" => $l_int_Index,
"link-start" => $l_str_LinkSpan == 'a' ? '<a>' : '',
"link-end" => $l_str_LinkSpan == 'a' ? '</a>' : '',
"sup-span" => $l_str_SupSpan,
@ -750,8 +798,9 @@ class MCI_Footnotes_Task {
// fill in 'templates/public/tooltip.html':
$l_obj_TemplateTooltip->replace(
array(
"post_id" => $l_int_PostId,
"id" => $l_int_Index,
"post_id" => self::$l_int_PostId,
"container_id" => self::$l_int_ReferenceContainerId,
"note_id" => $l_int_Index,
"position" => MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_POSITION),
"offset-y" => !empty($l_int_OffsetY) ? $l_int_OffsetY : 0,
"offset-x" => !empty($l_int_OffsetX) ? $l_int_OffsetX : 0,
@ -801,19 +850,6 @@ class MCI_Footnotes_Task {
return "";
}
/**
* INFINITE SCROLL / AUTOLOAD, ARCHIVE VIEW
*
* Multiple posts are appended to each other, functions and IDs must be disambiguated.
* Contributed by @docteurfitness
* @see <https://wordpress.org/support/topic/auto-load-post-compatibility-update/>
* @since 2.0.5
*
* post ID to make everything unique wrt infinite scroll and archive view:
*/
global $l_int_PostId;
$l_int_PostId = get_the_id();
/**
* OPTIONAL LINK ELEMENT FOR FOOTNOTE REFERRERS AND BACKLINKS
@ -834,9 +870,10 @@ class MCI_Footnotes_Task {
* For that purpose, and for scroll animation, this linking is performed by JavaScript.
*
*
* @since 2.0.0 the link elements have been added and are present.
* @since 2.0.4 the link addresses were removed.
* @since 2.1.4 the presence of <a> elements was made optional, 2020-11-25T1306+0100
* @since 2.0.0 added the link elements with hard links
* @since 2.0.4 removed the hard links on user request
* @see <https://wordpress.org/support/topic/hyperlinked-footnotes-creating-excessive-back-history/>
* @since 2.1.4 made link elements optional, 2020-11-25T1306+0100
*/
$l_str_LinkSpan = MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_LINK_ELEMENT_ENABLED)) ? 'a' : 'span';
@ -844,11 +881,11 @@ class MCI_Footnotes_Task {
/**
* FOOTNOTE INDEX BACKLINK SYMBOL
*
* The backlink symbol has been removed for 2.0.0 along with column 2 of the reference container.
* On user request, an arrow is prepended @since 2.0.3, and the setting is restored @since 2.0.4.
* @since 2.1.1 a select box allows to disable the symbol instead of customizing it to invisible.
* @since 2.0.0 removed backlink symbol along with column 2 of the reference container
* @since 2.0.3 prepended an arrow on user request
* @since 2.0.4 restored the arrow select & symbol input setting
* @since 2.1.1 made the symbol optional instead of customizing it to invisible
*/
// check if arrow is enabled:
if (MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_REFERENCE_CONTAINER_BACKLINK_SYMBOL_ENABLE))) {
// get html arrow
@ -883,11 +920,15 @@ class MCI_Footnotes_Task {
* The comma in enumerations is not generally preferred.
* @since 2.1.4 the separator is optional, has options, and is customizable:
*/
// check if it is even enabled:
if (MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_BACKLINKS_SEPARATOR_ENABLED))) {
// if so, check if it is customized:
$l_str_Separator = MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_BACKLINKS_SEPARATOR_CUSTOM);
if (empty($l_str_Separator)) {
// if it is not, check which option is on:
$l_str_SeparatorOption = MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_BACKLINKS_SEPARATOR_OPTION);
switch ($l_str_SeparatorOption) {
@ -896,7 +937,9 @@ class MCI_Footnotes_Task {
case 'en_dash' : $l_str_Separator = '&nbsp;&#x2013;'; break;
}
}
} else {
$l_str_Separator = '';
}
@ -908,11 +951,15 @@ class MCI_Footnotes_Task {
* making it optional was envisaged.
* @since 2.1.4 the terminator is optional, has options, and is customizable:
*/
// check if it is even enabled:
if (MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_BACKLINKS_TERMINATOR_ENABLED))) {
// if so, check if it is customized:
$l_str_Terminator = MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_BACKLINKS_TERMINATOR_CUSTOM);
if (empty($l_str_Terminator)) {
// if it is not, check which option is on:
$l_str_TerminatorOption = MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_BACKLINKS_TERMINATOR_OPTION);
switch ($l_str_TerminatorOption) {
@ -921,7 +968,9 @@ class MCI_Footnotes_Task {
case 'colon' : $l_str_Terminator = ':'; break;
}
}
} else {
$l_str_Terminator = '';
}
@ -1022,13 +1071,18 @@ class MCI_Footnotes_Task {
// in case the footnote is unique:
$l_str_FootnoteReference = "<$l_str_LinkSpan";
$l_str_FootnoteReference .= ' id="footnote_plugin_reference_';
$l_str_FootnoteReference .= $l_int_PostId;
$l_str_FootnoteReference .= self::$l_int_PostId;
$l_str_FootnoteReference .= '_' . self::$l_int_ReferenceContainerId;
$l_str_FootnoteReference .= "_$l_str_FootnoteId\"";
$l_str_FootnoteReference .= ' class="footnote_backlink"';
// the click event goes in the table cell:
$l_str_BacklinkEvent = ' onclick="footnote_moveToAnchor_' . $l_int_PostId;
$l_str_BacklinkEvent .= "('footnote_plugin_tooltip_$l_int_PostId";
$l_str_BacklinkEvent = ' onclick="footnote_moveToAnchor_';
$l_str_BacklinkEvent .= self::$l_int_PostId;
$l_str_BacklinkEvent .= '_' . self::$l_int_ReferenceContainerId;
$l_str_BacklinkEvent .= "('footnote_plugin_tooltip_";
$l_str_BacklinkEvent .= self::$l_int_PostId;
$l_str_BacklinkEvent .= '_' . self::$l_int_ReferenceContainerId;
$l_str_BacklinkEvent .= "_$l_str_FootnoteId');\"";
// the dedicated template enumerating backlinks uses another variable:
@ -1076,11 +1130,16 @@ class MCI_Footnotes_Task {
$l_str_FootnoteBacklinks .= "$l_str_Separator</$l_str_LinkSpan>";
$l_str_FootnoteBacklinks .= "$l_str_LineBreak<$l_str_LinkSpan";
$l_str_FootnoteBacklinks .= ' id="footnote_plugin_reference_';
$l_str_FootnoteBacklinks .= $l_int_PostId;
$l_str_FootnoteBacklinks .= self::$l_int_PostId;
$l_str_FootnoteBacklinks .= '_' . self::$l_int_ReferenceContainerId;
$l_str_FootnoteBacklinks .= "_$l_str_FootnoteId";
$l_str_FootnoteBacklinks .= '" class="footnote_backlink" ';
$l_str_FootnoteBacklinks .= 'onclick="footnote_moveToAnchor_' . $l_int_PostId;
$l_str_FootnoteBacklinks .= "('footnote_plugin_tooltip_$l_int_PostId";
$l_str_FootnoteBacklinks .= 'onclick="footnote_moveToAnchor_';
$l_str_FootnoteBacklinks .= self::$l_int_PostId;
$l_str_FootnoteBacklinks .= '_' . self::$l_int_ReferenceContainerId;
$l_str_FootnoteBacklinks .= "('footnote_plugin_tooltip_";
$l_str_FootnoteBacklinks .= self::$l_int_PostId;
$l_str_FootnoteBacklinks .= '_' . self::$l_int_ReferenceContainerId;
$l_str_FootnoteBacklinks .= "_$l_str_FootnoteId');\">";
$l_str_FootnoteBacklinks .= $l_bool_SymbolSwitch ? '' : $l_str_FootnoteArrow;
$l_str_FootnoteBacklinks .= $l_str_FootnoteId;
@ -1107,8 +1166,9 @@ class MCI_Footnotes_Task {
"text" => $l_str_FootnoteText,
// used in standard layout W/O COMBINED FOOTNOTES:
"post_id" => $l_int_PostId,
"id" => MCI_Footnotes_Convert::Index($l_int_FirstFootnoteIndex, MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_FOOTNOTES_COUNTER_STYLE)),
"post_id" => self::$l_int_PostId,
"container_id" => self::$l_int_ReferenceContainerId,
"note_id" => MCI_Footnotes_Convert::Index($l_int_FirstFootnoteIndex, MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_FOOTNOTES_COUNTER_STYLE)),
"link-start" => $l_str_LinkSpan == 'a' ? '<a>' : '',
"link-end" => $l_str_LinkSpan == 'a' ? '</a>' : '',
"link-span" => $l_str_LinkSpan,
@ -1141,7 +1201,8 @@ class MCI_Footnotes_Task {
$l_obj_TemplateContainer = new MCI_Footnotes_Template(MCI_Footnotes_Template::C_STR_PUBLIC, "reference-container");
$l_obj_TemplateContainer->replace(
array(
"post_id" => $l_int_PostId,
"post_id" => self::$l_int_PostId,
"container_id" => self::$l_int_ReferenceContainerId,
"element" => MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_REFERENCE_CONTAINER_LABEL_ELEMENT),
"name" => MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_REFERENCE_CONTAINER_NAME),
"button-style" => !$l_bool_CollapseDefault ? 'display: none;' : '',

View file

@ -5,7 +5,7 @@
* Created-Time: 16:21
* Since: 1.0
*
* Version: 2.2.8
* Version: 2.2.9
*
* Classes added to public.css may be added to the
* list documenting CSS classes for Custom CSS if
@ -20,7 +20,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/>
*
* Last modified: 2020-12-23T1109+0100
* Last modified: 2020-12-25T0356+0100
*/

View file

@ -5,9 +5,9 @@
* Created-Time: 16:21
* Since: 1.0
*
* Version: 2.2.8
* Version: 2.2.9
*
* Last modified: 2020-12-23T1110+0100
* Last modified: 2020-12-25T0356+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.2.8
Version: 2.2.9d2
Author URI: http://cheret.de/plugins/footnotes-2/
Text Domain: footnotes
Domain Path: /languages
*/
define( 'FOOTNOTES_VERSION', '2.2.8' );
define( 'FOOTNOTES_VERSION', '2.2.9d2' );
/*
Copyright 2020 Mark Cheret (email: mark@cheret.de)

View file

@ -80,11 +80,16 @@ Visit this swift write-up from a **footnotes** user by the name of **Southwest**
== Changelog ==
= 2.2.9d2 =
- Bugfix: Reference containers, widget_text hook: support for multiple reference containers in a page, thanks to @justbecuz
- Bugfix: Reference container, tooltips: URL wrap: account for RFC 2396 allowed characters in parameter names
- Bugfix: Reference container, tooltips: URL wrap: exclude URLs also where the equals sign is preceded by an entity or character reference
= 2.2.8 =
- Bugfix: Reference container, tooltips: URL wrap: correct lookbehind by duplicating it with and without quotation mark class
= 2.2.7 =
- Bugfix: Reference container, tooltips: URL wrap: revert the change in the exclusion regex, thanks to @rjl20 and @spaceling
- Bugfix: Reference container, tooltips: URL wrap: revert the change in the regex, thanks to @rjl20, @spaceling, @friedrichnorth, @bernardzit
= 2.2.6 =
- Bugfix: Reference container, tooltips: URL wrap: make the quotation mark optional wrt query parameters, thanks to @spiralofhope2

View file

@ -1,16 +1,16 @@
<span
class="footnote_referrer relative"
onmouseover="footnoteTooltipShow('footnote_plugin_tooltip_text_[[post_id]]_[[id]]')"
onmouseout="footnoteTooltipHide('footnote_plugin_tooltip_text_[[post_id]]_[[id]]')"
onmouseover="footnoteTooltipShow('footnote_plugin_tooltip_text_[[post_id]]_[[container_id]]_[[note_id]]')"
onmouseout="footnoteTooltipHide('footnote_plugin_tooltip_text_[[post_id]]_[[container_id]]_[[note_id]]')"
>[[link-start]]<[[sup-span]]
id="footnote_plugin_tooltip_[[post_id]]_[[id]]"
id="footnote_plugin_tooltip_[[post_id]]_[[container_id]]_[[note_id]]"
class="footnote_plugin_tooltip_text"
onclick="footnote_moveToAnchor_[[post_id]]('footnote_plugin_reference_[[post_id]]_[[id]]');"
onclick="footnote_moveToAnchor_[[post_id]]_[[container_id]]('footnote_plugin_reference_[[post_id]]_[[container_id]]_[[note_id]]');"
>[[before]][[index]][[after]]</[[sup-span]]
>[[link-end]]<span
id="footnote_plugin_tooltip_text_[[post_id]]_[[id]]"
id="footnote_plugin_tooltip_text_[[post_id]]_[[container_id]]_[[note_id]]"
class="footnote_tooltip position hidden"
onmouseout="footnoteTooltipHide('footnote_plugin_tooltip_text_[[post_id]]_[[id]]')"
onmouseout="footnoteTooltipHide('footnote_plugin_tooltip_text_[[post_id]]_[[container_id]]_[[note_id]]')"
>[[text]]</span
></span
>

View file

@ -1,12 +1,12 @@
<span
class="footnote_referrer"
>[[link-start]]<[[sup-span]]
id="footnote_plugin_tooltip_[[post_id]]_[[id]]"
id="footnote_plugin_tooltip_[[post_id]]_[[container_id]]_[[note_id]]"
class="footnote_plugin_tooltip_text"
onclick="footnote_moveToAnchor_[[post_id]]('footnote_plugin_reference_[[post_id]]_[[id]]');"
onclick="footnote_moveToAnchor_[[post_id]]_[[container_id]]('footnote_plugin_reference_[[post_id]]_[[container_id]]_[[note_id]]');"
>[[before]][[index]][[after]]</[[sup-span]]
>[[link-end]]<span
id="footnote_plugin_tooltip_text_[[post_id]]_[[id]]"
id="footnote_plugin_tooltip_text_[[post_id]]_[[container_id]]_[[note_id]]"
class="footnote_tooltip"
>[[text]]</span
></span

View file

@ -2,15 +2,15 @@
<td
class="footnote_plugin_index"
><[[link-span]]
id="footnote_plugin_reference_[[post_id]]_[[id]]"
id="footnote_plugin_reference_[[post_id]]_[[container_id]]_[[note_id]]"
class="footnote_index"
onclick="footnote_moveToAnchor_[[post_id]]('footnote_plugin_tooltip_[[post_id]]_[[id]]');"
onclick="footnote_moveToAnchor_[[post_id]]_[[container_id]]('footnote_plugin_tooltip_[[post_id]]_[[container_id]]_[[note_id]]');"
>[[index]][[terminator]]</[[link-span]]
></td
><td
class="footnote_plugin_link"
><[[link-span]]
onclick="footnote_moveToAnchor_[[post_id]]('footnote_plugin_tooltip_[[post_id]]_[[id]]');"
onclick="footnote_moveToAnchor_[[post_id]]_[[container_id]]('footnote_plugin_tooltip_[[post_id]]_[[container_id]]_[[note_id]]');"
class="footnote_backlink"
>[[arrow]]</[[link-span]]
></td

View file

@ -1,8 +1,8 @@
<tr>
<td
id="footnote_plugin_reference_[[post_id]]_[[id]]"
id="footnote_plugin_reference_[[post_id]]_[[container_id]]_[[note_id]]"
class="footnote_plugin_index pointer"
onclick="footnote_moveToAnchor_[[post_id]]('footnote_plugin_tooltip_[[post_id]]_[[id]]');"
onclick="footnote_moveToAnchor_[[post_id]]_[[container_id]]('footnote_plugin_tooltip_[[post_id]]_[[container_id]]_[[note_id]]');"
><[[link-span]]
class="footnote_plugin_link"
>[[index]][[terminator]][[arrow]]</[[link-span]]

View file

@ -1,8 +1,8 @@
<tr>
<td
id="footnote_plugin_reference_[[post_id]]_[[id]]"
id="footnote_plugin_reference_[[post_id]]_[[container_id]]_[[note_id]]"
class="footnote_plugin_index pointer"
onclick="footnote_moveToAnchor_[[post_id]]('footnote_plugin_tooltip_[[post_id]]_[[id]]');"
onclick="footnote_moveToAnchor_[[post_id]]('footnote_plugin_tooltip_[[post_id]]_[[container_id]]_[[note_id]]');"
><[[link-span]]
class="footnote_plugin_link"
>[[arrow]][[index]][[terminator]]</[[link-span]]

View file

@ -6,21 +6,21 @@
><[[element]]
><span
class="footnote_reference_container_label"
onclick="footnote_expand_reference_container_[[post_id]]();"
onclick="footnote_expand_reference_container_[[post_id]]_[[container_id]]();"
>[[name]]</span
><span
class="footnote_reference_container_collapse_button"
style="[[button-style]]"
onclick="footnote_expand_collapse_reference_container_[[post_id]]();"
onclick="footnote_expand_collapse_reference_container_[[post_id]]_[[container_id]]();"
>[<a
id="footnote_reference_container_collapse_button_[[post_id]]"
id="footnote_reference_container_collapse_button_[[post_id]]_[[container_id]]"
>+</a
>]</span
></[[element]]
></div
>
<div
id="footnote_references_container_[[post_id]]"
id="footnote_references_container_[[post_id]]_[[container_id]]"
style="[[style]]"
>
<table
@ -33,23 +33,23 @@
</div>
</div>
<script type="text/javascript">
function footnote_expand_reference_container_[[post_id]]() {
jQuery('#footnote_references_container_[[post_id]]').show();
jQuery('#footnote_reference_container_collapse_button_[[post_id]]').text('');
function footnote_expand_reference_container_[[post_id]]_[[container_id]]() {
jQuery('#footnote_references_container_[[post_id]]_[[container_id]]').show();
jQuery('#footnote_reference_container_collapse_button_[[post_id]]_[[container_id]]').text('');
}
function footnote_collapse_reference_container_[[post_id]]() {
jQuery('#footnote_references_container_[[post_id]]').hide();
jQuery('#footnote_reference_container_collapse_button_[[post_id]]').text('+');
function footnote_collapse_reference_container_[[post_id]]_[[container_id]]() {
jQuery('#footnote_references_container_[[post_id]]_[[container_id]]').hide();
jQuery('#footnote_reference_container_collapse_button_[[post_id]]_[[container_id]]').text('+');
}
function footnote_expand_collapse_reference_container_[[post_id]]() {
if (jQuery('#footnote_references_container_[[post_id]]').is(':hidden')) {
footnote_expand_reference_container_[[post_id]]();
function footnote_expand_collapse_reference_container_[[post_id]]_[[container_id]]() {
if (jQuery('#footnote_references_container_[[post_id]]_[[container_id]]').is(':hidden')) {
footnote_expand_reference_container_[[post_id]]_[[container_id]]();
} else {
footnote_collapse_reference_container_[[post_id]]();
footnote_collapse_reference_container_[[post_id]]_[[container_id]]();
}
}
function footnote_moveToAnchor_[[post_id]](p_str_TargetID) {
footnote_expand_reference_container_[[post_id]]();
function footnote_moveToAnchor_[[post_id]]_[[container_id]](p_str_TargetID) {
footnote_expand_reference_container_[[post_id]]_[[container_id]]();
var l_obj_Target = jQuery('#' + p_str_TargetID);
if (l_obj_Target.length) {
jQuery('html, body').animate({

View file

@ -1,6 +1,6 @@
<script type="text/javascript">
jQuery('#footnote_plugin_tooltip_[[post_id]]_[[id]]').tooltip({
tip: '#footnote_plugin_tooltip_text_[[post_id]]_[[id]]',
jQuery('#footnote_plugin_tooltip_[[post_id]]_[[container_id]]_[[note_id]]').tooltip({
tip: '#footnote_plugin_tooltip_text_[[post_id]]_[[container_id]]_[[note_id]]',
tipClass: 'footnote_tooltip',
effect: 'fade',
predelay: [[fade-in-delay]],