traceability update 2.5.4d2

git-svn-id: https://plugins.svn.wordpress.org/footnotes/trunk@2469883 b8457f37-d9ea-0310-8a92-e5e31aec5664
This commit is contained in:
pewgeuges 2021-02-06 01:57:25 +00:00
parent 6706ba811e
commit cee486702c
9 changed files with 849 additions and 551 deletions

View file

@ -7,13 +7,13 @@
* @since 1.5.0 12.09.14 10:56 * @since 1.5.0 12.09.14 10:56
* *
* *
* @edit 1.6.5 Bugfix: Improve widgets registration, thanks to @felipelavinz code contribution * @since 1.6.5 Bugfix: Improve widgets registration, thanks to @felipelavinz code contribution
* @edit 1.6.5 Update: Fix for deprecated PHP function create_function(), thanks to @psykonevro @daliasued bug reports, thanks to @felipelavinz code contribution * @since 1.6.5 Update: Fix for deprecated PHP function create_function(), thanks to @psykonevro @daliasued bug reports, thanks to @felipelavinz code contribution
* @edit 2.0.0 Update: Tooltips: fix disabling bug by loading jQuery UI library, thanks to @rajinderverma @ericcorbett2 @honlapdavid @mmallett bug reports, thanks to @vonpiernik code contribution * @since 2.0.0 Update: Tooltips: fix disabling bug by loading jQuery UI library, thanks to @rajinderverma @ericcorbett2 @honlapdavid @mmallett bug reports, thanks to @vonpiernik code contribution
* @edit 2.0.3 add versioning of public.css for cache busting 2020-10-29T1413+0100 * @since 2.0.3 add versioning of public.css for cache busting 2020-10-29T1413+0100
* @edit 2.0.4 add jQuery UI from WordPress 2020-11-01T1902+0100 * @since 2.0.4 add jQuery UI from WordPress 2020-11-01T1902+0100
* @edit 2.1.4 automate passing version number for cache busting 2020-11-30T0646+0100 * @since 2.1.4 automate passing version number for cache busting 2020-11-30T0646+0100
* @edit 2.1.4 optionally enqueue an extra style sheet 2020-12-04T2231+0100 * @since 2.1.4 optionally enqueue an extra style sheet 2020-12-04T2231+0100
* *
* Last modified: 2021-01-31T0755+0100 * Last modified: 2021-01-31T0755+0100
*/ */
@ -47,7 +47,7 @@ class MCI_Footnotes {
* @since 1.6.5 * @since 1.6.5
* *
* @contributor @felipelavinz * @contributor @felipelavinz
* @source https://github.com/media-competence-institute/footnotes/commit/87173d2980c7ff90e12ffee94ca7153e11163793 * @link https://github.com/media-competence-institute/footnotes/commit/87173d2980c7ff90e12ffee94ca7153e11163793
*/ */
public function run() { public function run() {
// register language // register language
@ -81,14 +81,14 @@ class MCI_Footnotes {
* @since 1.6.5 * @since 1.6.5
* *
* @contributor @felipelavinz * @contributor @felipelavinz
* @source https://github.com/media-competence-institute/footnotes/commit/87173d2980c7ff90e12ffee94ca7153e11163793 * @link https://github.com/media-competence-institute/footnotes/commit/87173d2980c7ff90e12ffee94ca7153e11163793
* *
* @reporter @psykonevro * @reporter @psykonevro
* @bugreport https://wordpress.org/support/topic/bug-function-create_function-is-deprecated/ * @link https://wordpress.org/support/topic/bug-function-create_function-is-deprecated/
* @bugreport https://wordpress.org/support/topic/deprecated-function-create_function-14/ * @link https://wordpress.org/support/topic/deprecated-function-create_function-14/
* *
* @reporter @daliasued * @reporter @daliasued
* @bugreport https://wordpress.org/support/topic/deprecated-function-create_function-14/#post-13312853 * @link https://wordpress.org/support/topic/deprecated-function-create_function-14/#post-13312853
* *
* create_function() was deprecated in PHP 7.2.0 and removed in PHP 8.0.0. * create_function() was deprecated in PHP 7.2.0 and removed in PHP 8.0.0.
* @link https://www.php.net/manual/en/function.create-function.php * @link https://www.php.net/manual/en/function.create-function.php
@ -128,7 +128,7 @@ class MCI_Footnotes {
* @author Stefan Herndler * @author Stefan Herndler
* @since 1.5.0 * @since 1.5.0
* *
* @edit 2.0.0 Update: Tooltips: fix disabling bug by loading jQuery UI library, thanks to @rajinderverma @ericcorbett2 @honlapdavid @mmallett bug reports, thanks to @vonpiernik code contribution * @since 2.0.0 Update: Tooltips: fix disabling bug by loading jQuery UI library, thanks to @rajinderverma @ericcorbett2 @honlapdavid @mmallett bug reports, thanks to @vonpiernik code contribution
* Updated for v2.0.0 adding jQuery UI * Updated for v2.0.0 adding jQuery UI
* Updated for v2.0.4 by adding jQuery UI from WordPress following @check2020de: * Updated for v2.0.4 by adding jQuery UI from WordPress following @check2020de:
* <https://wordpress.org/support/topic/gdpr-issue-with-jquery/> * <https://wordpress.org/support/topic/gdpr-issue-with-jquery/>
@ -143,12 +143,11 @@ class MCI_Footnotes {
// These are only enqueued if the jQuery tooltips are enabled. // These are only enqueued if the jQuery tooltips are enabled.
// If alternative tooltips are enabled, these libraries are not needed. // If alternative tooltips are enabled, these libraries are not needed.
// Scroll animation doesnt seem to need even jQuery Core or it gets it from elsewhere. // Scroll animation doesnt seem to need even jQuery Core or it gets it from elsewhere.
//* @edit 2.0.0 add jQueryUI from Cloudflare 2020-10-26T1907+0100 // @since 2.0.0 add jQueryUI from Cloudflare 2020-10-26T1907+0100
//* @edit 2.0.3 add versioning of public.css for cache busting 2020-10-29T1413+0100 // @since 2.0.3 add versioning of public.css for cache busting 2020-10-29T1413+0100
//* @edit 2.0.4 add jQuery UI from WordPress 2020-11-01T1902+0100 // @since 2.0.4 add jQuery UI from WordPress 2020-11-01T1902+0100
//* @edit 2.1.4 automate passing version number for cache busting 2020-11-30T0646+0100 // @since 2.1.4 automate passing version number for cache busting 2020-11-30T0646+0100
//* @edit 2.1.4 optionally enqueue an extra style sheet 2020-12-04T2231+0100 // @since 2.1.4 optionally enqueue an extra style sheet 2020-12-04T2231+0100
//*/
if (!MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_FOOTNOTES_MOUSE_OVER_BOX_ALTERNATIVE))) { if (!MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_FOOTNOTES_MOUSE_OVER_BOX_ALTERNATIVE))) {

View file

@ -7,95 +7,128 @@
* @since 1.5.0 * @since 1.5.0
* *
* *
* @lastmodified 2021-01-26T0752+0100 * @lastmodified 2021-02-06T0241+0100
* *
* @edit 2.0.0 * @since 2.0.0 Bugfix: Various.
* @edit 2.0.5 Reference container: fix relative position through priority level, thanks to @june01 @imeson 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.
* @edit 2.0.6 Infinite scroll: debug autoload by adding post ID, thanks to @docteurfitness code contribution * @since 2.0.5 Update: Hooks: Default-enable all hooks to prevent footnotes from seeming broken in some parts.
* @edit 2.0.9 REMOVE the_post HOOK 2020-11-08T1839+0100 * @since 2.0.6 Bugfix: Infinite scroll: debug autoload by adding post ID, thanks to @docteurfitness code contribution.
* @edit 2.1.0 Tooltips: Read-on button: Label: configurable instead of localizable * @since 2.0.6 Bugfix: Priority level back to PHP_INT_MAX (ref container positioning not this plugins responsibility).
* @edit 2.1.1 Combining identical footnotes: fix dead links and ensure referrer-backlink bijectivity, thanks to @happyches bug report * @since 2.0.7 BUGFIX: Hooks: Default-disable 'the_post', thanks to @spaceling @@markcheret @nyamachi @whichgodsaves @spiralofhope2 @mmallett @andreasra @widecast @ymorin007 @tashi1es bug reports.
* @edit 2.1.1 Reference container: fix start pages by making its display optional, thanks to @dragon013 bug report * @since 2.0.9 Bugfix: Remove the_post hook 2020-11-08T1839+0100.
* @edit 2.1.1 Referrers: new setting for vertical align: superscript (default) or baseline (optional), thanks to @cwbayer bug report * @since 2.1.0 Add: Tooltips: Read-on button: Label: configurable instead of localizable.
* @edit 2.1.1 Reference container: option to restore 3-column layout (combining identicals turned off) * @since 2.1.1 Bugfix: Combining identical footnotes: fix dead links and ensure referrer-backlink bijectivity, thanks to @happyches bug report.
* @edit 2.1.1 Reference container: option to append symbol (prepended by default) (combining identicals turned off) * @since 2.1.1 Bugfix: Reference container: fix start pages by making its display optional, thanks to @dragon013 bug report.
* @edit 2.1.1 Dashboard: priority level setting for the_content hook, thanks to @imeson bug report * @since 2.1.1 Bugfix: Referrers: new setting for vertical align: superscript (default) or baseline (optional), thanks to @cwbayer bug report.
* @edit 2.1.2 Dashboard: priority level settings for all other hooks, thanks to @nikelaos bug report * @since 2.1.1 Bugfix: Reference container: option to append symbol (prepended by default), thanks to @spaceling code contribution.
* @since 2.1.1 Bugfix: Reference container: Backlink symbol: make optional, not suggest configuring it to invisible, thanks to @spaceling feedback.
* @since 2.1.1 Bugfix: Reference container: option to restore 3-column layout (combining identicals turned off).
* @since 2.1.1 Bugfix: Dashboard: priority level setting for the_content hook, thanks to @imeson bug report.
* @since 2.1.2 Bugfix: Dashboard: priority level settings for all other hooks, thanks to @nikelaos bug report.
* *
* @edit 2.1.4 fix line wrapping of URLs based on pattern, not link element 2020-11-25T0837+0100 * @since 2.1.4 Bugfix: Reference container, tooltips: fix line wrapping of URLs based on pattern, not link element.
* @edit 2.1.4 fix issues with link elements by making them optional 2020-11-26T1051+0100 * @datetime 2020-11-25T0837+0100
* @edit 2.1.4 support appending arrow when combining identicals is on 2020-11-26T1633+0100 * @since 2.1.4 Bugfix: Styling: Referrers and backlinks: make link elements optional to fix issues.
* @edit 2.1.4 disable or select backlink separator and terminator 2020-11-28T1048+0100 * @datetime 2020-11-26T1051+0100
* @edit 2.1.4 optional line breaks to stack enumerated backlinks 2020-11-28T1049+0100 * @since 2.1.4 Bugfix: Reference container: Backlink symbol: support for appending when combining identicals is on.
* @edit 2.1.4 ref container column width and tooltip font size settings 2020-12-03T0954+0100 * @datetime 2020-11-26T1633+0100
* @edit 2.1.4 scroll offset and duration settings 2020-12-05T0538+0100 * @since 2.1.4 Bugfix: Reference container: make separating and terminating punctuation optional and configurable.
* @edit 2.1.4 tooltip display duration settings 2020-12-06T1320+0100 * @datetime 2020-11-28T1048+0100
* @since 2.1.4 Bugfix: Reference container: Backlinks: fix stacked enumerations by adding optional line breaks.
* @datetime 2020-11-28T1049+0100
* @since 2.1.4 Bugfix: Reference container: fix layout issues by moving backlink column width to settings.
* @since 2.1.4 Bugfix: Styling: Tooltips: fix font size issue by adding font size to settings with legacy as default.
* @datetime 2020-12-03T0954+0100
* @since 2.1.4 Bugfix: Scroll offset: make configurable to fix site-dependent issues related to fixed headers.
* @since 2.1.4 Bugfix: Scroll duration: make configurable to conform to website content and style requirements.
* @datetime 2020-12-05T0538+0100
* @since 2.1.4 Bugfix: Tooltips: make display delays and fade durations configurable to conform to website style.
* @datetime 2020-12-06T1320+0100
* @since 2.1.4 Bugfix: Styling: Referrers and backlinks: make link elements optional to fix issues.
* @since 2.1.4 Bugfix: Reference container, tooltips: fix line wrapping of URLs based on pattern, not link element.
* @since 2.1.4 Bugfix: Reference container: Backlink symbol: support for appending when combining identicals is on.
* @since 2.1.4 Reference container: Backlinks: fix line breaking with respect to separators and terminators.
* *
* @edit 2.1.5 URL wrap: exclude image source too, thanks to @bjrnet21 * @since 2.1.5 URL wrap: exclude image source too, thanks to @bjrnet21
* @link https://wordpress.org/support/topic/2-1-4-breaks-on-my-site-images-dont-show/ * @link https://wordpress.org/support/topic/2-1-4-breaks-on-my-site-images-dont-show/
* *
* @edit 2.1.6 option to disable URL line wrapping 2020-12-09T1606+0100 * @since 2.1.6 option to disable URL line wrapping
* @datetime 2020-12-09T1606+0100
* *
* @edit 2.1.6 add catch-all exclusion to fix URL line wrapping, thanks to @a223123131 2020-12-09T1921+0100 * @since 2.1.6 add catch-all exclusion to fix URL line wrapping, thanks to @a223123131
* @datetime 2020-12-09T1921+0100
* @link https://wordpress.org/support/topic/broken-layout-starting-version-2-1-4/ * @link https://wordpress.org/support/topic/broken-layout-starting-version-2-1-4/
* *
* @edit 2.2.0 support for custom position shortcode for reference container, thanks to @hamshe 2020-12-13T2058+0100 * @since 2.2.0 support for custom position shortcode for reference container, thanks to @hamshe
* @datetime 2020-12-13T2058+0100
* @link https://wordpress.org/support/topic/reference-container-in-elementor/ * @link https://wordpress.org/support/topic/reference-container-in-elementor/
* *
* @edit 2.2.3 custom CSS from new setting in header after legacy 2020-12-15T1128+0100 * @since 2.2.3 custom CSS from new setting in header after legacy
* @datetime 2020-12-15T1128+0100
* *
* @edit 2.2.5 connect alternative tooltips to position and timing settings 2020-12-18T1113+0100 * @since 2.2.5 connect alternative tooltips to position and timing settings
* @datetime 2020-12-18T1113+0100
* *
* @edit 2.2.5 delete unused position shortcode when ref container in widget or footer, thanks to @hamshe 2020-12-18T1437+0100 * @since 2.2.5 delete unused position shortcode when ref container in widget or footer, thanks to @hamshe
* @datetime 2020-12-18T1437+0100
* @link https://wordpress.org/support/topic/reference-container-in-elementor/#post-13784126 * @link https://wordpress.org/support/topic/reference-container-in-elementor/#post-13784126
* *
* @edit 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
* @datetime 2020-12-18T1447+0100
* @link https://wordpress.org/support/topic/how-do-i-eliminate-the-horizontal-line-beneath-the-reference-container-heading/ * @link https://wordpress.org/support/topic/how-do-i-eliminate-the-horizontal-line-beneath-the-reference-container-heading/
* *
* @edit 2.2.6 URL wrap: make the quotation mark optional in the exclusion regex, thanks to @spiralofhope2 2020-12-23T0409+0100 * @since 2.2.6 URL wrap: make the quotation mark optional in the exclusion regex, thanks to @spiralofhope2
* @datetime 2020-12-23T0409+0100
* @link https://wordpress.org/support/topic/two-links-now-breaks-footnotes-with-blogtext/ * @link https://wordpress.org/support/topic/two-links-now-breaks-footnotes-with-blogtext/
* *
* @edit 2.2.7 revert that change in the exclusion regex, thanks to @rjl20, @spaceling, @friedrichnorth, @bernardzit 2020-12-23T1046+0100 * @since 2.2.7 revert that change in the exclusion regex, thanks to @rjl20, @spaceling, @friedrichnorth, @bernardzit
* @datetime 2020-12-23T1046+0100
* @link https://wordpress.org/support/topic/two-links-now-breaks-footnotes-with-blogtext/ * @link https://wordpress.org/support/topic/two-links-now-breaks-footnotes-with-blogtext/
* @link https://wordpress.org/support/topic/footnotes-dont-show-after-update-to-2-2-6/ * @link https://wordpress.org/support/topic/footnotes-dont-show-after-update-to-2-2-6/
* *
* @edit 2.2.8 URL wrap: correct lookbehind by duplicating it with and without quotation mark class 2020-12-23T1108+0100 * @since 2.2.8 URL wrap: correct lookbehind by duplicating it with and without quotation mark class
* @datetime 2020-12-23T1108+0100
* *
* @edit 2.2.9 URL wrap: account for RFC 2396 allowed characters in parameter names 2020-12-24T1956+0100 * @since 2.2.9 URL wrap: account for RFC 2396 allowed characters in parameter names
* @datetime 2020-12-24T1956+0100
* @link https://stackoverflow.com/questions/814700/http-url-allowed-characters-in-parameter-names * @link https://stackoverflow.com/questions/814700/http-url-allowed-characters-in-parameter-names
* *
* @edit 2.2.9 Reference containers, widget_text hook: support for multiple containers in a page, thanks to @justbecuz bug report * @since 2.2.9 Reference containers, widget_text hook: support for multiple containers in a page, thanks to @justbecuz bug report
* @link https://wordpress.org/support/topic/reset-footnotes-to-1/#post-13662830 * @link https://wordpress.org/support/topic/reset-footnotes-to-1/#post-13662830
* *
* @edit 2.2.9 URL wrap: exclude URLs also where the equals sign is preceded by an entity or character reference 2020-12-25T1251+0100 * @since 2.2.9 URL wrap: exclude URLs also where the equals sign is preceded by an entity or character reference
* @datetime 2020-12-25T1251+0100
* *
* @edit 2.2.10 URL wrap: support also file transfer protocol URLs 2020-12-25T2220+0100 * @since 2.2.10 URL wrap: support also file transfer protocol URLs
* @datetime 2020-12-25T2220+0100
* *
* @edit 2.2.10 Reference container: add option for table borders to revert 2.0.0/2.0.1 change made on user request, thanks to @noobishh 2020-12-25T2304+0100 * @since 2.2.10 Reference container: add option for table borders to revert 2.0.0/2.0.1 change made on user request, thanks to @noobishh
* @datetime 2020-12-25T2304+0100
* @link https://wordpress.org/support/topic/borders-25/ * @link https://wordpress.org/support/topic/borders-25/
* *
* @edit 2.3.0 Reference container: convert top padding to margin and make it a setting, thanks to @hamshe bug report * @since 2.3.0 Reference container: convert top padding to margin and make it a setting, thanks to @hamshe bug report
* @link https://wordpress.org/support/topic/reference-container-in-elementor/#post-13786635 * @link https://wordpress.org/support/topic/reference-container-in-elementor/#post-13786635
* *
* @edit 2.3.0 optional hard links in referrers and backlinks for AMP compatibility, thanks to @psykonevro bug report, thanks to @martinneumannat code contribution * @since 2.3.0 optional hard links in referrers and backlinks for AMP compatibility, thanks to @psykonevro bug report, thanks to @martinneumannat code contribution
* @edit 2.3.0 swap Custom CSS migration Boolean from 'migration complete' to 'show legacy' 2020-12-27T1243+0100 * @since 2.3.0 swap Custom CSS migration Boolean from 'migration complete' to 'show legacy'
* @edit 2.4.0 syntax validation for balanced footnote start and end tags 2021-01-01T0227+0100 * @datetime 2020-12-27T1243+0100
* @edit 2.4.0 initialize scroll offset variable to 34 as a more robust default, thanks to @lukashuggenberg 2021-01-04T0504+0100 * @since 2.4.0 syntax validation for balanced footnote start and end tags 2021-01-01T0227+0100
* @edit 2.4.0 set empty reference container label to NNBSP to make it more robust, thanks to @lukashuggenberg 2021-01-04T0504+0100 * @since 2.4.0 initialize scroll offset variable to 34 as a more robust default, thanks to @lukashuggenberg 2021-01-04T0504+0100
* @edit 2.4.0 Performance: optimize template load and process according to settings, thanks to @misfist code contribution * @since 2.4.0 set empty reference container label to NNBSP to make it more robust, thanks to @lukashuggenberg 2021-01-04T0504+0100
* @edit 2.4.0 initialize hard link address as empty to fix undefined variable bug, thanks to @a223123131 2021-01-04T1622+0100 * @since 2.4.0 Performance: optimize template load and process according to settings, thanks to @misfist code contribution
* @since 2.4.0 initialize hard link address as empty to fix undefined variable bug, thanks to @a223123131 2021-01-04T1622+0100
* *
* @edit 2.5.0 Shortcode syntax validation: exclude certain cases involving scripts, thanks to @andreasra 2021-01-07T0824+0100 * @since 2.5.0 Shortcode syntax validation: exclude certain cases involving scripts, thanks to @andreasra 2021-01-07T0824+0100
* @edit 2.5.0 Shortcode syntax validation: complete message with hint about setting, thanks to @andreasra * @since 2.5.0 Shortcode syntax validation: complete message with hint about setting, thanks to @andreasra
* @edit 2.5.0 Shortcode syntax validation: limit length of quoted string to 300 characters, thanks to @andreasra * @since 2.5.0 Shortcode syntax validation: limit length of quoted string to 300 characters, thanks to @andreasra
* @link https://wordpress.org/support/topic/warning-unbalanced-footnote-start-tag-short-code-before/ * @link https://wordpress.org/support/topic/warning-unbalanced-footnote-start-tag-short-code-before/
* *
* @edit 2.5.0 Hooks: support footnotes on category pages, thanks to @vitaefit bug report, thanks to @misfist code contribution * @since 2.5.0 Hooks: support footnotes on category pages, thanks to @vitaefit bug report, thanks to @misfist code contribution
* @edit 2.5.1 Hooks: support footnotes in Popup Maker popups, thanks to @squatcher bug report * @since 2.5.1 Hooks: support footnotes in Popup Maker popups, thanks to @squatcher bug report
* *
* @edit 2.5.2 Tooltips: ability to display dedicated content, thanks to @jbj2199 bug report * @since 2.5.2 Tooltips: ability to display dedicated content, thanks to @jbj2199 bug report
* *
* @edit 2.5.3 URL wrap: exclude URL pattern as folder name in Wayback Machine URL, thanks to @rumperuu bug report * @since 2.5.3 URL wrap: exclude URL pattern as folder name in Wayback Machine URL, thanks to @rumperuu bug report
*/ */
// If called directly, abort: // If called directly, abort:
@ -143,19 +176,18 @@ class MCI_Footnotes_Task {
/** /**
* INFINITE SCROLL / AUTOLOAD OR ARCHIVE VIEW * INFINITE SCROLL / AUTOLOAD OR ARCHIVE VIEW
* *
* debug autoload / infinite scroll by adding post ID, thanks to @docteurfitness code contribution * - Bugfix: Infinite scroll: debug autoload by adding post ID, thanks to @docteurfitness code contribution
*
* @since 2.0.6 * @since 2.0.6
*
* As multiple posts are appended to each other, functions and fragment IDs must be disambiguated.
*
* @contributor @docteurfitness
* @reporter @docteurfitness
*
* @source https://wordpress.org/support/topic/auto-load-post-compatibility-update/#post-13618833
* @bugreport https://wordpress.org/support/topic/auto-load-post-compatibility-update/
*
* @var int * @var int
* *
* @contributor @docteurfitness
* @link https://wordpress.org/support/topic/auto-load-post-compatibility-update/#post-13618833
*
* @reporter @docteurfitness
* @link https://wordpress.org/support/topic/auto-load-post-compatibility-update/
*
* As multiple posts are appended to each other, functions and fragment IDs must be disambiguated.
* post ID to make everything unique wrt infinite scroll and archive view: * post ID to make everything unique wrt infinite scroll and archive view:
*/ */
public static $a_int_PostId = 0; public static $a_int_PostId = 0;
@ -163,14 +195,15 @@ class MCI_Footnotes_Task {
/** /**
* MULTIPLE REFERENCE CONTAINERS IN CONTENT AND WIDGETS * MULTIPLE REFERENCE CONTAINERS IN CONTENT AND WIDGETS
* *
* Reference containers, widget_text hook: support for multiple containers in a page, thanks to @justbecuz bug report * - Bugfix: Reference containers, widget_text hook: support for multiple containers in a page, thanks to @justbecuz bug report
*
* @since 2.2.9 * @since 2.2.9
* @datestamp 2020-12-25T0338+0100 * @datetime 2020-12-25T0338+0100
* *
* @reporter @justbecuz * @reporter @justbecuz
* *
* @bugreport https://wordpress.org/support/topic/reset-footnotes-to-1/ * @link https://wordpress.org/support/topic/reset-footnotes-to-1/
* @bugreport https://wordpress.org/support/topic/reset-footnotes-to-1/#post-13662830 * @link https://wordpress.org/support/topic/reset-footnotes-to-1/#post-13662830
* *
* @var int incremented each time after a reference container is inserted * @var int incremented each time after a reference container is inserted
* *
@ -183,13 +216,14 @@ class MCI_Footnotes_Task {
/** /**
* TEMPLATE PROCESS OPTIMIZATION * TEMPLATE PROCESS OPTIMIZATION
* *
* Performance: optimize template load and process according to settings, thanks to @misfist code contribution * - Bugfix: Performance: optimize template load and process according to settings, thanks to @misfist code contribution
*
* @since 2.4.0 * @since 2.4.0
* @datestamp 2021-01-04T1355+0100 * @datetime 2021-01-04T1355+0100
* *
* @author Patrizia Lutz @misfist * @author Patrizia Lutz @misfist
* *
* @source https://wordpress.org/support/topic/template-override-filter/#post-13864301 * @link https://wordpress.org/support/topic/template-override-filter/#post-13864301
* @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
* *
@ -204,14 +238,25 @@ class MCI_Footnotes_Task {
/** /**
* HARD LINKS FOR AMP * HARD LINKS FOR AMP
* *
* Optional hard links in referrers and backlinks for AMP compatibility * - Bugfix: Optional hard links in referrers and backlinks for AMP compatibility, thanks to @psykonevro bug report, thanks to @martinneumannat code contribution.
* *
* @thanksto @martinneumannat code contribution
* @link https://wordpress.org/support/topic/making-it-amp-compatible/
* @thanksto @psykonevro bug report
* @link https://wordpress.org/support/topic/footnotes-is-not-amp-compatible/
* @since 2.3.0 * @since 2.3.0
* @var bool|str|int * @var bool|str|int
*
* @contributor @martinneumannat
* @link https://wordpress.org/support/topic/making-it-amp-compatible/
*
* @reporter @psykonevro
* @link https://wordpress.org/support/topic/footnotes-is-not-amp-compatible/
*
* The official AMP plugin strips off JavaScript, breaking Footnotes
* animated scrolling.
*
*
* @since 2.0.4 remove hard links on user request
* @link https://wordpress.org/support/topic/hyperlinked-footnotes-creating-excessive-back-history/
*
* @since 2.0.0 add hard links
*/ */
public static $a_bool_HardLinksEnable = false; public static $a_bool_HardLinksEnable = false;
public static $a_str_ReferrerLinkSlug = 'r'; public static $a_str_ReferrerLinkSlug = 'r';
@ -222,21 +267,23 @@ class MCI_Footnotes_Task {
/** /**
* SCROLL OFFSET * SCROLL OFFSET
* *
* Optional hard links in referrers and backlinks for AMP compatibility * @since 2.4.0
* @datetime 2021-01-03T2055+0100
* @var int
* *
* By accident, this variable may not be updated with settings storage.
* Websites may use high fixed headers not contracting at scroll. * Websites may use high fixed headers not contracting at scroll.
* Scroll offset may now need to get into inline CSS. * Scroll offset may now need to get into inline CSS.
* Hence initialize scroll offset to a safety default value 34 right here. * Hence it needs to be loaded twice.
*
* @since 2.4.0
* @datestamp 2021-01-03T2055+0100
*/ */
public static $a_int_ScrollOffset = 34; public static $a_int_ScrollOffset = 34;
/** /**
* OPTIONAL LINK ELEMENT FOR FOOTNOTE REFERRERS AND BACKLINKS * OPTIONAL LINK ELEMENT FOR FOOTNOTE REFERRERS AND BACKLINKS
* *
* @since 2.3.0
* @datetime 2020-12-30T2313+0100
* @var str
*
* STYLING: * STYLING:
* Link color is preferred for referrers and backlinks. * Link color is preferred for referrers and backlinks.
* Setting a global link color is a common feature in WordPress themes. * Setting a global link color is a common feature in WordPress themes.
@ -258,20 +305,16 @@ class MCI_Footnotes_Task {
* of the already supported pseudo-classes :link, :hover, :active and :visited that can * of the already supported pseudo-classes :link, :hover, :active and :visited that can
* still not be used in color names. * still not be used in color names.
* *
* @since 2.0.0 add the link elements with hard links * @since 2.0.0 add link elements with hard links
* *
* @since 2.0.4 remove the hard links on user request * @since 2.0.4 remove hard links on user request
* @link https://wordpress.org/support/topic/hyperlinked-footnotes-creating-excessive-back-history/ * @link https://wordpress.org/support/topic/hyperlinked-footnotes-creating-excessive-back-history/
* *
* link elements optional for styling purposes * link elements optional for styling purposes
* @since 2.1.4 * @since 2.1.4
* @datestamp 2020-11-25T1306+0100 * @datetime 2020-11-25T1306+0100
* *
* this variable keeps its default value if hard links are enabled * this variable keeps its default value if hard links are disabled
* @since 2.3.0
* @datestamp 2020-12-30T2313+0100
*
* @var str
*/ */
public static $a_str_LinkSpan = 'span'; public static $a_str_LinkSpan = 'span';
public static $a_str_LinkOpenTag = ''; public static $a_str_LinkOpenTag = '';
@ -280,16 +323,18 @@ class MCI_Footnotes_Task {
/** /**
* DEDICATED TOOLTIP TEXT * DEDICATED TOOLTIP TEXT
* *
* The ability to display dedicated content, thanks to @jbj2199 bug report * - Bugfix: Tooltips: ability to display dedicated content, thanks to @jbj2199 bug report
*
* @since 2.5.2
* @datetime 2021-01-19T2223+0100
*
* @reporter @jbj2199
* @link https://wordpress.org/support/topic/change-tooltip-text/
* *
* Tooltips can display another content than the footnote entry * Tooltips can display another content than the footnote entry
* in the reference container. The trigger is a shortcode in * in the reference container. The trigger is a shortcode in
* the footnote text separating the tooltip text from the note. * the footnote text separating the tooltip text from the note.
* * That is consistent with what WordPress does for excerpts.
* @thanksto @jbj2199 bug report
* @link https://wordpress.org/support/topic/change-tooltip-text/
* @since 2.5.2
* @datestamp 2021-01-19T2223+0100
*/ */
public static $a_bool_MirrorTooltipText = false; public static $a_bool_MirrorTooltipText = false;
public static $a_str_TooltipShortcode = '[[/tooltip]]'; public static $a_str_TooltipShortcode = '[[/tooltip]]';
@ -298,6 +343,9 @@ class MCI_Footnotes_Task {
/** /**
* SYNTAX VALIDATION * SYNTAX VALIDATION
* *
* @since 2.4.0
* @var bool
*
* This part of the algorithm first checks for balanced footnote opening and closing tag * This part of the algorithm first checks for balanced footnote opening and closing tag
* short codes. The first encountered error triggers the display of a warning below the * short codes. The first encountered error triggers the display of a warning below the
* post title and cancellation of further parsing. * post title and cancellation of further parsing.
@ -306,9 +354,6 @@ class MCI_Footnotes_Task {
* Any compiler or other tool reports syntax errors in the first place. Footnotes exception * Any compiler or other tool reports syntax errors in the first place. Footnotes exception
* is considered a design flaw, and the feature is released as a bug fix after overdue 2.3.0 * is considered a design flaw, and the feature is released as a bug fix after overdue 2.3.0
* released in urgency to provide AMP compat before 2021. * released in urgency to provide AMP compat before 2021.
*
* @since 2.4.0
* @var bool
*/ */
public static $a_bool_SyntaxErrorFlag = true; public static $a_bool_SyntaxErrorFlag = true;
@ -324,74 +369,83 @@ class MCI_Footnotes_Task {
* @author Stefan Herndler * @author Stefan Herndler
* @since 1.5.0 * @since 1.5.0
* *
* @edit 2.0.5 Reference container: fix relative position through priority level, thanks to @june01 @imeson bug reports, thanks to @spaceling code contribution * @since 1.5.4 Add: Hooks: support 'the_post' in response to user request for custom post types.
* @edit 2.0.6 Priority level back to PHP_INT_MAX (ref container positioning not this plugins responsibility) * @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.
* @edit 2.0.7 Set priority level back to 10 assuming it is unproblematic 2020-11-06T1344+0100 * @since 2.0.5 Update: Hooks: Default-enable all hooks to prevent footnotes from seeming broken in some parts.
* @edit 2.0.8 Priority level back to PHP_INT_MAX (need to get in touch with other plugins) * @since 2.0.6 Bugfix: Priority level back to PHP_INT_MAX (ref container positioning not this plugins responsibility).
* @edit 2.0.9 removed the_post hook after its default enabling caused multiple issues * @since 2.0.7 BUGFIX: Hooks: Default-disable 'the_post', thanks to @spaceling @@markcheret @nyamachi @whichgodsaves @spiralofhope2 @mmallett @andreasra @widecast @ymorin007 @tashi1es bug reports.
* @edit 2.1.1 Dashboard: priority level setting for the_content hook, thanks to @imeson bug report * @since 2.0.7 Bugfix: Set priority level back to 10 assuming it is unproblematic 2020-11-06T1344+0100.
* @edit 2.1.2 Dashboard: priority level settings for all other hooks, thanks to @nikelaos bug report * @since 2.0.8 Bugfix: Priority level back to PHP_INT_MAX (need to get in touch with other plugins).
* @edit 2.5.0 Hooks: support footnotes on category pages, thanks to @vitaefit bug report, thanks to @misfist code contribution * @since 2.1.0 UPDATE: Hooks: remove 'the_post', the plugin stops supporting this hook.
* @edit 2.5.1 Hooks: support footnotes in Popup Maker popups, thanks to @squatcher bug report * @since 2.1.1 Bugfix: Dashboard: priority level setting for the_content hook, thanks to @imeson bug report.
* @since 2.1.2 Bugfix: Dashboard: priority level settings for all other hooks, thanks to @nikelaos bug report.
* @since 2.5.0 Bugfix: Hooks: support footnotes on category pages, thanks to @vitaefit bug report, thanks to @misfist code contribution.
* @since 2.5.1 Bugfix: Hooks: support footnotes in Popup Maker popups, thanks to @squatcher bug report.
*/ */
public function registerHooks() { public function registerHooks() {
/** /**
* PRIORITY LEVELS * PRIORITY LEVELS
* *
* Reference container: fix relative position through priority level, thanks to @june01 @imeson bug reports, thanks to @spaceling code contribution * - 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 * @since 2.0.5
* @datestamp 2020-11-02T0330+0100 * @datetime 2020-11-02T0330+0100
* @link https://codex.wordpress.org/Plugin_API/#Hook_in_your_Filter
* *
* @contributor @spaceling * @contributor @spaceling
* @source https://wordpress.org/support/topic/change-the-position-5/#post-13608594 * @link https://wordpress.org/support/topic/change-the-position-5/#post-13608594
* *
* @reporter @june01 * @reporter @june01
* @bugreport https://wordpress.org/support/topic/change-the-position-5/ * @link https://wordpress.org/support/topic/change-the-position-5/
* *
* @reporter @imeson * @reporter @imeson
* @bugreport https://wordpress.org/support/topic/change-the-position-5/#post-13538345 * @link https://wordpress.org/support/topic/change-the-position-5/#post-13538345
*
*
* - Bugfix: Dashboard: priority level setting for the_content hook, thanks to @imeson bug report.
* *
* Dashboard: priority level setting for the_content hook, thanks to @imeson bug report
* @since 2.1.1 * @since 2.1.1
* @datestamp 2020-11-17T0254+0100 * @datetime 2020-11-17T0254+0100
* *
* @reporter @imeson * @reporter @imeson
* @bugreport https://wordpress.org/support/topic/change-the-position-5/#post-13538345 * @link https://wordpress.org/support/topic/change-the-position-5/#post-13538345
*
*
* - Bugfix: Dashboard: priority level settings for all other hooks, thanks to @nikelaos bug report.
* *
* Dashboard: priority level settings for all other hooks, thanks to @nikelaos bug report
* @since 2.1.2 * @since 2.1.2
* @datestamp 2020-11-19T1849+0100 * @datetime 2020-11-19T1849+0100
* *
* @reporter @nikelaos * @reporter @nikelaos
* @bugreport https://wordpress.org/support/topic/doesnt-work-any-more-11/#post-13676705 * @link https://wordpress.org/support/topic/doesnt-work-any-more-11/#post-13676705
* *
* @link https://codex.wordpress.org/Plugin_API/#Hook_in_your_Filter
* *
* Setting the_content priority to 10 instead of PHP_INT_MAX i.e. 9223372036854775807 * Setting the_content priority to 10 instead of PHP_INT_MAX i.e. 9223372036854775807
* makes the footnotes reference container display beneath the post and above other * makes the footnotes reference container display beneath the post and above other
* features added by other plugins, e.g. related post lists and social buttons. * features added by other plugins, e.g. related post lists and social buttons.
* *
* For YARPP to display related posts below the Footnotes reference container, * For YARPP to display related posts below the Footnotes reference container,
* priority needs to be at least 1200. * priority needs to be at least 1200 (i.e. 0 =< $l_int_TheContentPriority =< 1200).
* *
* PHP_INT_MAX cannot be reset by leaving the number box empty. because browsers * PHP_INT_MAX cannot be reset by leaving the number box empty. because browsers
* (WebKit) dont allow it, so we must resort to -1. * (WebKit) dont allow it, so we must resort to -1.
* * @link https://github.com/Modernizr/Modernizr/issues/171
*/ */
// get values from settings: // get values from settings:
$p_int_TheTitlePriority = intval(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_INT_EXPERT_LOOKUP_THE_TITLE_PRIORITY_LEVEL)); $l_int_TheTitlePriority = intval(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_INT_EXPERT_LOOKUP_THE_TITLE_PRIORITY_LEVEL));
$p_int_TheContentPriority = intval(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_INT_EXPERT_LOOKUP_THE_CONTENT_PRIORITY_LEVEL)); $l_int_TheContentPriority = intval(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_INT_EXPERT_LOOKUP_THE_CONTENT_PRIORITY_LEVEL));
$p_int_TheExcerptPriority = intval(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_INT_EXPERT_LOOKUP_THE_EXCERPT_PRIORITY_LEVEL)); $l_int_TheExcerptPriority = intval(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_INT_EXPERT_LOOKUP_THE_EXCERPT_PRIORITY_LEVEL));
$p_int_WidgetTitlePriority = intval(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_INT_EXPERT_LOOKUP_WIDGET_TITLE_PRIORITY_LEVEL)); $l_int_WidgetTitlePriority = intval(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_INT_EXPERT_LOOKUP_WIDGET_TITLE_PRIORITY_LEVEL));
$p_int_WidgetTextPriority = intval(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_INT_EXPERT_LOOKUP_WIDGET_TEXT_PRIORITY_LEVEL)); $l_int_WidgetTextPriority = intval(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_INT_EXPERT_LOOKUP_WIDGET_TEXT_PRIORITY_LEVEL));
// PHP_INT_MAX can be set by -1: // PHP_INT_MAX can be set by -1:
$p_int_TheTitlePriority = ($p_int_TheTitlePriority == -1) ? PHP_INT_MAX : $p_int_TheTitlePriority ; $l_int_TheTitlePriority = ($l_int_TheTitlePriority == -1) ? PHP_INT_MAX : $l_int_TheTitlePriority ;
$p_int_TheContentPriority = ($p_int_TheContentPriority == -1) ? PHP_INT_MAX : $p_int_TheContentPriority ; $l_int_TheContentPriority = ($l_int_TheContentPriority == -1) ? PHP_INT_MAX : $l_int_TheContentPriority ;
$p_int_TheExcerptPriority = ($p_int_TheExcerptPriority == -1) ? PHP_INT_MAX : $p_int_TheExcerptPriority ; $l_int_TheExcerptPriority = ($l_int_TheExcerptPriority == -1) ? PHP_INT_MAX : $l_int_TheExcerptPriority ;
$p_int_WidgetTitlePriority = ($p_int_WidgetTitlePriority == -1) ? PHP_INT_MAX : $p_int_WidgetTitlePriority; $l_int_WidgetTitlePriority = ($l_int_WidgetTitlePriority == -1) ? PHP_INT_MAX : $l_int_WidgetTitlePriority;
$p_int_WidgetTextPriority = ($p_int_WidgetTextPriority == -1) ? PHP_INT_MAX : $p_int_WidgetTextPriority ; $l_int_WidgetTextPriority = ($l_int_WidgetTextPriority == -1) ? PHP_INT_MAX : $l_int_WidgetTextPriority ;
// append custom css to the header // append custom css to the header
@ -401,75 +455,124 @@ class MCI_Footnotes_Task {
add_filter('wp_footer', array($this, "wp_footer"), PHP_INT_MAX); add_filter('wp_footer', array($this, "wp_footer"), PHP_INT_MAX);
if (MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_EXPERT_LOOKUP_THE_TITLE))) { if (MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_EXPERT_LOOKUP_THE_TITLE))) {
add_filter('the_title', array($this, "the_title"), $p_int_TheTitlePriority); add_filter('the_title', array($this, "the_title"), $l_int_TheTitlePriority);
} }
// configurable priority level for reference container relative positioning; default 98: // configurable priority level for reference container relative positioning; default 98:
if (MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_EXPERT_LOOKUP_THE_CONTENT))) { if (MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_EXPERT_LOOKUP_THE_CONTENT))) {
add_filter('the_content', array($this, "the_content"), $p_int_TheContentPriority); add_filter('the_content', array($this, "the_content"), $l_int_TheContentPriority);
/** /**
* HOOK FOR CATEGORY PAGES * HOOK FOR CATEGORY PAGES
* *
* Hooks: support footnotes on category pages, thanks to @vitaefit bug report, thanks to @misfist code contribution * -Bugfix: Hooks: support footnotes on category pages, thanks to @vitaefit bug report, thanks to @misfist code contribution
*
* @since 2.5.0 * @since 2.5.0
* @datestamp 2021-01-05T1402+0100 * @datetime 2021-01-05T1402+0100
* *
* @reporter @vitaefit * @reporter @vitaefit
* @bugreport https://wordpress.org/support/topic/footnote-doesntwork-on-category-page/ * @link https://wordpress.org/support/topic/footnote-doesntwork-on-category-page/
* *
* @contributor @misfist * @contributor @misfist
* @source https://wordpress.org/support/topic/footnote-doesntwork-on-category-page/#post-13864859 * @link https://wordpress.org/support/topic/footnote-doesntwork-on-category-page/#post-13864859
* *
* Category pages can have rich HTML content in a term description with article status. * Category pages can have rich HTML content in a term description with article status.
* For this to happen, WordPress built-in partial HTML blocker needs to be disabled. * For this to happen, WordPress built-in partial HTML blocker needs to be disabled.
* @link https://docs.woocommerce.com/document/allow-html-in-term-category-tag-descriptions/ * @link https://docs.woocommerce.com/document/allow-html-in-term-category-tag-descriptions/
*/ */
add_filter('term_description', array($this, "the_content"), $p_int_TheContentPriority); add_filter('term_description', array($this, "the_content"), $l_int_TheContentPriority);
/** /**
* HOOK FOR POPUP MAKER POPUPS * HOOK FOR POPUP MAKER POPUPS
* *
* Hooks: support footnotes in Popup Maker popups, thanks to @squatcher bug report * - Bugfix: Hooks: support footnotes in Popup Maker popups, thanks to @squatcher bug report
*
* @since 2.5.1 * @since 2.5.1
* @datestamp 2021-01-18T2038+0100 * @datetime 2021-01-18T2038+0100
* *
* @reporter @squatcher * @reporter @squatcher
* @bugreport https://wordpress.org/support/topic/footnotes-use-in-popup-maker/ * @link https://wordpress.org/support/topic/footnotes-use-in-popup-maker/
*/ */
add_filter('pum_popup_content', array($this, "the_content"), $p_int_TheContentPriority); add_filter('pum_popup_content', array($this, "the_content"), $l_int_TheContentPriority);
} }
if (MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_EXPERT_LOOKUP_THE_EXCERPT))) { if (MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_EXPERT_LOOKUP_THE_EXCERPT))) {
add_filter('the_excerpt', array($this, "the_excerpt"), $p_int_TheExcerptPriority); add_filter('the_excerpt', array($this, "the_excerpt"), $l_int_TheExcerptPriority);
} }
if (MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_EXPERT_LOOKUP_WIDGET_TITLE))) { if (MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_EXPERT_LOOKUP_WIDGET_TITLE))) {
add_filter('widget_title', array($this, "widget_title"), $p_int_WidgetTitlePriority); add_filter('widget_title', array($this, "widget_title"), $l_int_WidgetTitlePriority);
} }
if (MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_EXPERT_LOOKUP_WIDGET_TEXT))) { if (MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_EXPERT_LOOKUP_WIDGET_TEXT))) {
add_filter('widget_text', array($this, "widget_text"), $p_int_WidgetTextPriority); add_filter('widget_text', array($this, "widget_text"), $l_int_WidgetTextPriority);
} }
/** /**
* THE the_post HOOK * THE the_post HOOK
* *
* support the_post hook in response to user request for custom post types * - Add: Hooks: support 'the_post' in response to user request for custom post types.
*
* @since 1.5.4 * @since 1.5.4
* @accountable @aricura * @accountable @aricura
* @link https://wordpress.org/support/topic/doesnt-work-in-custon-post-types/#post-5339110 * @link https://wordpress.org/support/topic/doesnt-work-in-custon-post-types/#post-5339110
* *
* remove the_post hook after its default enabling caused multiple issues *
* @edit 2.0.9 * - Update: Hooks: Default-enable all hooks to prevent footnotes from seeming broken in some parts.
*
* @since 2.0.5
* @accountable @pewgeuges
*
*
* - BUGFIX: Hooks: Default-disable 'the_post', thanks to @spaceling @@markcheret @nyamachi @whichgodsaves @spiralofhope2 @mmallett @andreasra @widecast @ymorin007 @tashi1es bug reports.
*
* @since 2.0.7
* @accountable @pewgeuges * @accountable @pewgeuges
* @datestamp 2020-11-08T1839+0100
* @link https://wordpress.org/support/topic/change-the-position-5/page/2/#post-13630114 * @link https://wordpress.org/support/topic/change-the-position-5/page/2/#post-13630114
* @link https://wordpress.org/support/topic/footnotes-appearing-in-header/#post-13630303 * @link https://wordpress.org/support/topic/footnotes-appearing-in-header/#post-13630303
* @link https://wordpress.org/support/topic/footnotes-appearing-in-header/page/2/#post-13630799 * @link https://wordpress.org/support/topic/footnotes-appearing-in-header/page/2/#post-13630799
* @link https://wordpress.org/support/topic/no-footnotes-anymore/#post-13813233 * @link https://wordpress.org/support/topic/no-footnotes-anymore/#post-13813233
*
* @reporter @spaceling
* @link https://wordpress.org/support/topic/change-the-position-5/#post-13612697
*
* @reporter @markcheret on behalf of W. Beinert
* @link https://wordpress.org/support/topic/footnotes-now-appear-in-summaries-even-though-this-is-marked-no/
*
* @reporter @nyamachi
* @link https://wordpress.org/support/topic/footnotes-appearing-in-header/
*
* @reporter @whichgodsaves
* @link https://wordpress.org/support/topic/footnotes-appearing-in-header/#post-13622694
*
* @reporter @spiralofhope2
* @link https://wordpress.org/support/topic/2-0-5-broken/
*
* @reporter @mmallett
* @link https://wordpress.org/support/topic/2-0-5-broken/#post-13623208
*
* @reporter @andreasra
* @link https://wordpress.org/support/topic/footnotes-appearing-in-header/#post-13624091
*
* @reporter @widecast
* @link https://wordpress.org/support/topic/2-0-5-broken/#post-13626222
*
* @reporter @ymorin007
* @link https://wordpress.org/support/topic/footnotes-appearing-in-header/#post-13627050
*
* @reporter @markcheret on behalf of L. Smith
* @link https://wordpress.org/support/topic/footnotes-appear-in-random-places-on-academic-website/
*
* @reporter @tashi1es
* @link https://wordpress.org/support/topic/footnotes-appear-in-random-places-on-academic-website/#post-13630495
*
*
* - UPDATE: Hooks: remove 'the_post', the plugin stops supporting this hook.
*
* @since 2.1.0
* @datetime 2020-11-08T1839+0100
* @accountable @pewgeuges
*/ */
// reset stored footnotes when displaying the header // reset stored footnotes when displaying the header
self::$a_arr_Footnotes = array(); self::$a_arr_Footnotes = array();
self::$a_bool_AllowLoveMe = true; self::$a_bool_AllowLoveMe = true;
@ -481,11 +584,9 @@ class MCI_Footnotes_Task {
* @author Stefan Herndler * @author Stefan Herndler
* @since 1.5.0 * @since 1.5.0
* *
* @edited
* *
* @since 2.1.1 Reference container: fix start pages by making its display optional, thanks to @dragon013 bug report * @since 2.1.1 Bugfix: Reference container: fix start pages by making its display optional, thanks to @dragon013 bug report
* @since 2.1.1 option to hide ref container from start page * @since 2.1.1 Bugfix: Tooltips: optional alternative JS implementation with CSS transitions to fix configuration-related outage, thanks to @andreasra feedback.
* @since 2.1.1 script for alternative tooltips
* @since 2.1.3 raise settings priority to override theme style sheets * @since 2.1.3 raise settings priority to override theme style sheets
* @since 2.1.4 tootip font size and backlink column width settings * @since 2.1.4 tootip font size and backlink column width settings
* @since 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
@ -501,10 +602,12 @@ class MCI_Footnotes_Task {
/** /**
* REF CONTAINER DISPLAY ON HOME PAGE * REF CONTAINER DISPLAY ON HOME PAGE
* *
* Reference container: fix start pages by making its display optional * - Bugfix: Reference container: fix start pages by making its display optional, thanks to @dragon013 bug report.
* @thanksto @dragon013 bug report *
* @link https://wordpress.org/support/topic/possible-to-hide-it-from-start-page/
* @since 2.1.1 * @since 2.1.1
*
* @reporter @dragon013
* @link https://wordpress.org/support/topic/possible-to-hide-it-from-start-page/
*/ */
if (!MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_REFERENCE_CONTAINER_START_PAGE_ENABLE))) { if (!MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_REFERENCE_CONTAINER_START_PAGE_ENABLE))) {
echo ".home .footnotes_reference_container { display: none; }\r\n"; echo ".home .footnotes_reference_container { display: none; }\r\n";
@ -719,7 +822,7 @@ class MCI_Footnotes_Task {
echo "\r\n</style>\r\n"; echo "\r\n</style>\r\n";
// alternative tooltip script printed formatted not minified: // alternative tooltip script printed formatted not minified:
if (self::$a_bool_AlternativeTooltipsEnabled) { if ( self::$a_bool_AlternativeTooltipsEnabled ) {
?> ?>
<script content="text/javascript"> <script content="text/javascript">
function footnoteTooltipShow(footnoteTooltipId) { function footnoteTooltipShow(footnoteTooltipId) {
@ -741,7 +844,7 @@ class MCI_Footnotes_Task {
* @author Stefan Herndler * @author Stefan Herndler
* @since 1.5.0 * @since 1.5.0
* *
* Edited: *
* @since 2.2.0 more options 2020-12-11T0506+0100 * @since 2.2.0 more options 2020-12-11T0506+0100
*/ */
public function wp_footer() { public function wp_footer() {
@ -882,11 +985,24 @@ class MCI_Footnotes_Task {
* @param bool $p_bool_HideFootnotesText Hide footnotes found in the string. * @param bool $p_bool_HideFootnotesText Hide footnotes found in the string.
* @return string * @return string
* *
* Edited: *
* @since 2.2.0 insert reference container at shortcode, thanks to @hamshe 2020-12-13T2057+0100 * @since 2.2.0 Add: Reference container: support for custom position shortcode, thanks to @hamshe feature request.
* @since 2.2.5 Bugfix: Reference container: delete position shortcode if unused because position may be widget or footer, thanks to @hamshe bug report.
*
* - Add: Reference container: support for custom position shortcode, thanks to @hamshe feature request.
*
* @since 2.2.0
* @datetime 2020-12-13T2057+0100
*
* @reporter @hamshe
* @link https://wordpress.org/support/topic/reference-container-in-elementor/ * @link https://wordpress.org/support/topic/reference-container-in-elementor/
* *
* @since 2.2.5 delete unused position shortcode, when position is widget or footer, thanks to @hamshe 2020-12-18T1434+0100 * - Bugfix: Reference container: delete position shortcode if unused because position may be widget or footer, thanks to @hamshe bug report.
*
* @since 2.2.5
* @datetime 2020-12-18T1434+0100
*
* @reporter @hamshe
* @link https://wordpress.org/support/topic/reference-container-in-elementor/#post-13784126 * @link 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) { public function exec($p_str_Content, $p_bool_OutputReferences = false, $p_bool_HideFootnotesText = false) {
@ -1096,10 +1212,11 @@ class MCI_Footnotes_Task {
} }
/** /**
* URL line wrap * URL WRAP
* *
* Fix line wrapping of URLs (hyperlinked or not) based on pattern, not link element, * Fix line wrapping of URLs (hyperlinked or not) based on pattern, not link element,
* to prevent them from hanging out of the tooltip in non-Unicode-compliant user agents. * to prevent them from hanging out of the tooltip or extending the reference container
* in non-Unicode-compliant user agents, mainly Chrome (not Firefox).
* @see public.css * @see public.css
* *
* spare however values of the href and the src arguments! * spare however values of the href and the src arguments!
@ -1130,7 +1247,7 @@ class MCI_Footnotes_Task {
* @since 2.2.10 support also file transfer protocol URLs 2020-12-25T2220+0100 * @since 2.2.10 support also file transfer protocol URLs 2020-12-25T2220+0100
* *
* URL pattern may be part of a Wayback Machine URL * URL pattern may be part of a Wayback Machine URL
* @thanksto @rumperuu bug report * @reporter @rumperuu bug report
* @link https://wordpress.org/support/topic/line-wrap-href-regex-bug/ * @link https://wordpress.org/support/topic/line-wrap-href-regex-bug/
* @since 2.5.3 * @since 2.5.3
* exclude protocols with prepended slash hinting its in a Wayback Machine URL * exclude protocols with prepended slash hinting its in a Wayback Machine URL
@ -1173,17 +1290,15 @@ class MCI_Footnotes_Task {
/** /**
* TOOLTIP TRUNCATION * TOOLTIP TRUNCATION
* *
* If the option is enabled, the tooltip text is truncated based on character count. * - Add: Tooltips: Read-on button: Label: configurable instead of localizable.
*
* @since 2.1.0
* @datetime 2020-11-08T2146+0100
*
* If the tooltip truncation option is enabled, its done based on character count,
* and a trailing incomplete word is cropped.
* This is equivalent to the WordPress default excerpt generation, i.e. without a * This is equivalent to the WordPress default excerpt generation, i.e. without a
* custom excerpt and without a delimiter. But WordPress does word count, usually 55. * custom excerpt and without a delimiter. But WordPress does word count, usually 55.
*
* Tooltips: Read-on button: Label: configurable instead of localizable
* @since 2.1.0
* @datestamp 2020-11-08T2146+0100
* @thanksto @rovanov
* @triggeredby https://wordpress.org/support/topic/offset-x-axis-and-offset-y-axis-does-not-working/
* (The feature was not requested but it fixes an apparent design flaw of the plugin
* appearing when looking at a longer tooltip on the web page linked from this topic.)
*/ */
if (self::$a_bool_TooltipsEnabled && $l_bool_EnableExcerpt) { if (self::$a_bool_TooltipsEnabled && $l_bool_EnableExcerpt) {
$l_str_DummyText = strip_tags($l_str_FootnoteText); $l_str_DummyText = strip_tags($l_str_FootnoteText);
@ -1222,7 +1337,7 @@ class MCI_Footnotes_Task {
* @since 2.1.1 * @since 2.1.1
* *
* @reporter @cwbayer * @reporter @cwbayer
* @bugreport https://wordpress.org/support/topic/footnote-number-in-text-superscript-disrupts-leading/ * @link https://wordpress.org/support/topic/footnote-number-in-text-superscript-disrupts-leading/
* *
* define the HTML element to use for the referrers: * define the HTML element to use for the referrers:
*/ */
@ -1356,8 +1471,8 @@ class MCI_Footnotes_Task {
* @since 1.5.0 * @since 1.5.0
* @return string * @return string
* *
* @edit 2.0.6 fix line breaking behavior in footnote number clusters * @since 2.0.6 fix line breaking behavior in footnote number clusters
* @edit 2.1.1 fix fragment IDs and backlinks with combine identical turned on 2020-11-14T1808+0100 * @since 2.1.1 fix fragment IDs and backlinks with combine identical turned on 2020-11-14T1808+0100
*/ */
public function ReferenceContainer() { public function ReferenceContainer() {
@ -1370,10 +1485,18 @@ class MCI_Footnotes_Task {
/** /**
* FOOTNOTE INDEX BACKLINK SYMBOL * FOOTNOTE INDEX BACKLINK SYMBOL
* *
* @since 2.0.0 removed backlink symbol along with column 2 of the reference container * @since 2.0.0 Update: remove backlink symbol along with column 2 of the reference container
* @since 2.0.3 prepended an arrow on user request * @since 2.0.3 Bugfix: prepend an arrow on user request
* @since 2.0.4 restored the arrow select & symbol input setting * @since 2.0.4 Bugfix: restore the arrow select and backlink symbol input settings
* @since 2.1.1 made the symbol optional instead of configuring it to invisible * @since 2.1.1 Bugfix: Reference container: Backlink symbol: make optional, not suggest configuring it to invisible, thanks to @spaceling feedback.
*
*
* - Bugfix: Reference container: Backlink symbol: make optional, not suggest configuring it to invisible, thanks to @spaceling feedback.
*
* @since 2.1.1
*
* @reporter @spaceling
* @link https://wordpress.org/support/topic/change-the-position-5/page/2/#post-13671138
*/ */
if (MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_REFERENCE_CONTAINER_BACKLINK_SYMBOL_ENABLE))) { if (MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_REFERENCE_CONTAINER_BACKLINK_SYMBOL_ENABLE))) {
@ -1487,7 +1610,7 @@ class MCI_Footnotes_Task {
* *
* Reference container: option to restore 3-column layout (combining identicals turned off) * Reference container: option to restore 3-column layout (combining identicals turned off)
* @since 2.1.1 * @since 2.1.1
* @datestamp 2020-11-16T2024+0100 * @datetime 2020-11-16T2024+0100
*/ */
// when combining identical footnotes is turned on, another template is needed: // when combining identical footnotes is turned on, another template is needed:
@ -1519,9 +1642,14 @@ class MCI_Footnotes_Task {
/** /**
* SWITCH BACKLINK SYMBOL AND FOOTNOTE NUMBER * SWITCH BACKLINK SYMBOL AND FOOTNOTE NUMBER
* *
* Reference container: option to append symbol (prepended by default) (combining identicals turned off) * - Bugfix: Reference container: option to append symbol (prepended by default), thanks to @spaceling code contribution.
*
* @since 2.1.1 * @since 2.1.1
* @datestamp 2020-11-16T2024+0100 * @datetime 2020-11-16T2024+0100
*
* @contributor @spaceling
* @link https://wordpress.org/support/topic/change-the-position-5/#post-13615994
*
*/ */
$l_bool_SymbolSwitch = MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_REFERENCE_CONTAINER_BACKLINK_SYMBOL_SWITCH)); $l_bool_SymbolSwitch = MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_REFERENCE_CONTAINER_BACKLINK_SYMBOL_SWITCH));
@ -1585,10 +1713,10 @@ class MCI_Footnotes_Task {
* SUPPORT FOR COMBINING IDENTICALS: COMPOSE ENUMERATED BACKLINKS * SUPPORT FOR COMBINING IDENTICALS: COMPOSE ENUMERATED BACKLINKS
* *
* Combining identical footnotes: fix dead links and ensure referrer-backlink bijectivity * Combining identical footnotes: fix dead links and ensure referrer-backlink bijectivity
* @thanksto @happyches bug report * @reporter @happyches bug report
* @link https://wordpress.org/support/topic/custom-css-for-jumbled-references/ * @link https://wordpress.org/support/topic/custom-css-for-jumbled-references/
* @since 2.1.1 * @since 2.1.1
* @datestamp 2020-11-14T2233+0100 * @datetime 2020-11-14T2233+0100
* *
* Prepare to have single footnotes, where the click event and * Prepare to have single footnotes, where the click event and
* optional hard link need to be set to cover the table cell, * optional hard link need to be set to cover the table cell,

View file

@ -4,12 +4,12 @@
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.4d1 Version: 2.5.4d2
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
*/ */
define( 'C_STR_FOOTNOTES_VERSION', '2.5.4d1' ); define( 'C_STR_FOOTNOTES_VERSION', '2.5.4d2' );
/* /*
Copyright 2020 Mark Cheret (email: mark@cheret.de) Copyright 2020 Mark Cheret (email: mark@cheret.de)

View file

@ -25,72 +25,77 @@
* Make sure to sync the version number in class/init.php: * Make sure to sync the version number in class/init.php:
* @version 1.2.7.redacted.2 * @version 1.2.7.redacted.2
* *
* @lastmodified 2021-02-01T0411+0100 * @lastmodified 2021-02-05T0618+0100
* @accountable @pewgeuges * @accountable @pewgeuges
* *
* @edit 2.0.0 Update: Tooltips: fix disabling bug by loading jQuery UI library, thanks to @rajinderverma @ericcorbett2 @honlapdavid @mmallett bug reports, thanks to @vonpiernik code contribution * @since 2.0.0 Update: Tooltips: fix disabling bug by loading jQuery UI library, thanks to @rajinderverma @ericcorbett2 @honlapdavid @mmallett @twellve_million bug reports, thanks to @vonpiernik code contribution
* @edit 2.0.0 Update: Libraries: jQuery Tools: add condition whether deprecated function jQuery.browser() exists, thanks to @vonpiernik code contribution * @since 2.0.0 Update: Libraries: jQuery Tools: add condition whether deprecated function jQuery.browser() exists, thanks to @vonpiernik code contribution
* @edit 2.1.1 Update: Libraries: jQuery Tools: redact (comment out) all 6 instances of deprecated function jQuery.browser(), thanks to @bjrnet21 @cconser @vyassuresh @spaceling @widecast @olivlyon @maxident bug reports * @since 2.1.1 Update: Libraries: jQuery Tools: redact (comment out) all 6 instances of deprecated function jQuery.browser(), thanks to @bjrnet21 @cconser @vyassuresh @spaceling @widecast @olivlyon @maxident bug reports
* @edit 2.1.1 Bugfix: Libraries: jQuery Tools: complete minification * @since 2.1.1 Bugfix: Libraries: jQuery Tools: complete minification
* @edit 2.5.4 Update: Libraries: jQuery Tools: replace deprecated function jQuery.isFunction(), thanks to @a223123131 bug report * @since 2.5.4 Update: Libraries: jQuery Tools: replace deprecated function jQuery.isFunction(), thanks to @a223123131 bug report
* @edit 2.5.4 Bugfix: Libraries: jQuery Tools: replace discouraged double equals sign with recommended triple equals sign * @since 2.5.4 Bugfix: Libraries: jQuery Tools: replace discouraged double equals sign with recommended triple equals sign
*/ */
/** /**
* UPGRADE TO JQUERY UI AND FIX DEPRECATED FUNCTION jQuery.browser() * UPGRADE TO JQUERY UI AND FIX DEPRECATED FUNCTION jQuery.browser()
* *
* Update: Tooltips: fix disabling bug by loading jQuery UI library, thanks to @rajinderverma @ericcorbett2 @honlapdavid @mmallett bug reports, thanks to @vonpiernik code contribution * - Update: Tooltips: fix disabling bug by loading jQuery UI library, thanks to @rajinderverma @ericcorbett2 @honlapdavid @mmallett @twellve_million bug reports, thanks to @vonpiernik code contribution
* Update: Libraries: jQuery Tools: add condition whether deprecated function jQuery.browser() exists, thanks to @vonpiernik code contribution * - Update: Libraries: jQuery Tools: add condition whether deprecated function jQuery.browser() exists, thanks to @vonpiernik code contribution
*
* @since 2.0.0 * @since 2.0.0
* @datestamp 2020-10-26T2005+0100 * @datetime 2020-10-26T2005+0100
* @accountable @pewgeuges * @accountable @pewgeuges
* *
* @contributor @vonpiernik * @contributor @vonpiernik
* @source https://wordpress.org/support/topic/tooltip-hover-not-showing/#post-13456762 * @link https://wordpress.org/support/topic/tooltip-hover-not-showing/#post-13456762
* *
* @reporter @rajinderverma * @reporter @rajinderverma
* @bugreport https://wordpress.org/support/topic/tooltip-hover-not-showing/ * @link https://wordpress.org/support/topic/tooltip-hover-not-showing/
* *
* @reporter @ericcorbett2 * @reporter @ericcorbett2
* @bugreport https://wordpress.org/support/topic/tooltip-hover-not-showing/#post-13324142 * @link https://wordpress.org/support/topic/tooltip-hover-not-showing/#post-13324142
* *
* @reporter @honlapdavid * @reporter @honlapdavid
* @bugreport https://wordpress.org/support/topic/tooltip-hover-not-showing/#post-13355421 * @link https://wordpress.org/support/topic/tooltip-hover-not-showing/#post-13355421
* *
* @reporter @mmallett * @reporter @mmallett
* @bugreport https://wordpress.org/support/topic/tooltip-hover-not-showing/#post-13445437 * @link https://wordpress.org/support/topic/tooltip-hover-not-showing/#post-13445437
*
* @reporter @twellve_million
* @link https://wordpress.org/support/topic/error-in-jquery-tools-min-js-a-browser-is-undefined/
* *
* Fixing jQuery.browser was needed alongside adding the jQueryUI library to debug the tooltips. * Fixing jQuery.browser was needed alongside adding the jQueryUI library to debug the tooltips.
*/ */
/** /**
* FUNCTION jQuery.browser() DEPRECATED, REDACTED (COMMENTED OUT) * REDACT (COMMENT OUT) DEPRECATED FUNCTION jQuery.browser()
* *
* Update: Libraries: jQuery Tools: redact (comment out) all 6 instances of deprecated function jQuery.browser(), thanks to @bjrnet21 @cconser @vyassuresh @spaceling @widecast @olivlyon @maxident bug reports * - Update: Libraries: jQuery Tools: redact (comment out) all 6 instances of deprecated function jQuery.browser(), thanks to @bjrnet21 @cconser @vyassuresh @spaceling @widecast @olivlyon @maxident bug reports
*
* @since 2.1.1 * @since 2.1.1
* @datestamp 2020-11-12T0127+0100 * @datetime 2020-11-12T0127+0100
* @accountable @pewgeuges * @accountable @pewgeuges
* *
* @reporter @bjrnet21 * @reporter @bjrnet21
* @bugreport https://wordpress.org/support/topic/after-wp-5-5-upgrade-jquery-is-deprecated/ * @link https://wordpress.org/support/topic/after-wp-5-5-upgrade-jquery-is-deprecated/
* *
* @reporter @cconser * @reporter @cconser
* @bugreport https://wordpress.org/support/topic/after-wp-5-5-upgrade-jquery-is-deprecated/#post-13262355 * @link https://wordpress.org/support/topic/after-wp-5-5-upgrade-jquery-is-deprecated/#post-13262355
* *
* @reporter @vyassuresh * @reporter @vyassuresh
* @bugreport https://wordpress.org/support/topic/after-wp-5-5-upgrade-jquery-is-deprecated/#post-13263019 * @link https://wordpress.org/support/topic/after-wp-5-5-upgrade-jquery-is-deprecated/#post-13263019
* *
* @reporter @spaceling * @reporter @spaceling
* @bugreport https://wordpress.org/support/topic/after-wp-5-5-upgrade-jquery-is-deprecated/#post-13309712 * @link https://wordpress.org/support/topic/after-wp-5-5-upgrade-jquery-is-deprecated/#post-13309712
* *
* @reporter @widecast * @reporter @widecast
* @bugreport https://wordpress.org/support/topic/after-wp-5-5-upgrade-jquery-is-deprecated/#post-13414243 * @link https://wordpress.org/support/topic/after-wp-5-5-upgrade-jquery-is-deprecated/#post-13414243
* *
* @reporter @olivlyon * @reporter @olivlyon
* @bugreport https://wordpress.org/support/topic/after-wp-5-5-upgrade-jquery-is-deprecated/#post-13472896 * @link https://wordpress.org/support/topic/after-wp-5-5-upgrade-jquery-is-deprecated/#post-13472896
* *
* @reporter @maxident * @reporter @maxident
* @bugreport https://wordpress.org/support/topic/jquery-issues-13/ * @link https://wordpress.org/support/topic/jquery-issues-13/
* *
* The function jQuery.browser() cannot be easily replaced like other deprecated functions. * The function jQuery.browser() cannot be easily replaced like other deprecated functions.
* The recommended fix is to use Modernizr instead. * The recommended fix is to use Modernizr instead.
@ -126,7 +131,7 @@
function c() { function c() {
/** /**
* REDACT DEPRECATED jQuery.browser() * REDACT (COMMENT OUT) DEPRECATED FUNCTION jQuery.browser()
* *
* #1 This was only a tweak to adjust width and height in Internet Explorer. * #1 This was only a tweak to adjust width and height in Internet Explorer.
*/ */
@ -149,14 +154,15 @@
/** /**
* EQUALS SIGN IN JAVASCRIPT * EQUALS SIGN IN JAVASCRIPT
* *
* Bugfix: Libraries: jQuery Tools: replace discouraged double equals sign with recommended triple equals sign * - Bugfix: Libraries: jQuery Tools: replace discouraged double equals sign with recommended triple equals sign
*
* @since 2.5.4 * @since 2.5.4
* @datestamp 2021-01-27T1955+0100 * @datetime 2021-01-27T1955+0100
* @accountable @pewgeuges * @accountable @pewgeuges
* *
* 23 instances (27 less 4 already triple), first below, next was already * 23 instances (27 less 4 already triple), first below, next was already
* All instances checked whether '==' has the semantics of '===', though. * All instances checked whether '==' has the semantics of '===', though.
* @see Douglas Crockford, JavaScript: The Good Parts * @bib Douglas Crockford, JavaScript: The Good Parts
*/ */
typeof j === "string" && (j = {color: j}), j = j || h, h = j = a.extend(a.extend({}, b.conf), j), e = a("#" + j.maskId), e.length || (e = a("<div/>").attr("id", j.maskId), a("body").append(e)); typeof j === "string" && (j = {color: j}), j = j || h, h = j = a.extend(a.extend({}, b.conf), j), e = a("#" + j.maskId), e.length || (e = a("<div/>").attr("id", j.maskId), a("body").append(e));
@ -321,7 +327,7 @@
a.tools = a.tools || {version: "v1.2.7"}, a.tools.history = {init: function (g) { a.tools = a.tools || {version: "v1.2.7"}, a.tools.history = {init: function (g) {
/** /**
* REDACT DEPRECATED jQuery.browser() * REDACT (COMMENT OUT) DEPRECATED FUNCTION jQuery.browser()
* *
* #2 This was only for very old Internet Explorer (older than IE8). * #2 This was only for very old Internet Explorer (older than IE8).
*/ */
@ -369,7 +375,7 @@
}}; }};
/** /**
* REDACT DEPRECATED jQuery.browser() * REDACT (COMMENT OUT) DEPRECATED FUNCTION jQuery.browser()
* *
* #3 This was only about a naming convention of Firefox: 'DOMMouseScroll' vs 'mousewheel', * #3 This was only about a naming convention of Firefox: 'DOMMouseScroll' vs 'mousewheel',
* or 'mousemove' in very old Firefox (older than v1.9). * or 'mousemove' in very old Firefox (older than v1.9).
@ -406,7 +412,7 @@
var c = this.getConf(); var c = this.getConf();
/** /**
* REDACT DEPRECATED jQuery.browser() * REDACT (COMMENT OUT) DEPRECATED FUNCTION jQuery.browser()
* *
* #4 This disabled fade-in for Internet Explorer other than FadeIE. * #4 This disabled fade-in for Internet Explorer other than FadeIE.
*/ */
@ -416,7 +422,7 @@
var c = this.getConf(); var c = this.getConf();
/** /**
* REDACT DEPRECATED jQuery.browser() * REDACT (COMMENT OUT) DEPRECATED FUNCTION jQuery.browser()
* *
* #5 This disabled fade-out for Internet Explorer other than FadeIE. * #5 This disabled fade-out for Internet Explorer other than FadeIE.
*/ */
@ -489,20 +495,21 @@
/** /**
* REPLACE DEPRECATED FUNCTION jQuery.isFunction() * REPLACE DEPRECATED FUNCTION jQuery.isFunction()
* *
* 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
* @edit 2.5.4 *
* @datestamp 2021-01-27T1911+0100 * @since 2.5.4
* @accountable @pewgeuges * @datetime 2021-01-27T1911+0100
* @accountable @pewgeuges
* *
* @reporter @a223123131 * @reporter @a223123131
* @bugreport https://wordpress.org/support/topic/deprecated-jquery-code-9/ * @link https://wordpress.org/support/topic/deprecated-jquery-code-9/
* *
* The official fix is to replace it with the typeof operator. * The official fix is to replace it with the typeof operator.
* @link https://api.jquery.com/jquery.isfunction/ * @link https://api.jquery.com/jquery.isfunction/
* *
* That requires to double-check the absence of problem with * That requires to double-check the absence of problem with
* the use of typeof. * the use of typeof.
* @see Douglas Crockford, JavaScript: The Good Parts * @bib Douglas Crockford, JavaScript: The Good Parts
*/ */
typeof (e[c]) === "function" && a(f).on(c, e[c]), f[c] = function (b) { typeof (e[c]) === "function" && a(f).on(c, e[c]), f[c] = function (b) {
@ -569,7 +576,7 @@
var b = a.tools.tooltip; var b = a.tools.tooltip;
/** /**
* REDACT DEPRECATED jQuery.browser() * REDACT (COMMENT OUT) DEPRECATED FUNCTION jQuery.browser()
* *
* #6 This disabled slide-fade for Internet Explorer. * #6 This disabled slide-fade for Internet Explorer.
* Browsers not supporting an effect simply dont execute it, they wont throw an error. * Browsers not supporting an effect simply dont execute it, they wont throw an error.

268
note-for-developers.txt Normal file
View file

@ -0,0 +1,268 @@
note-for-developers.txt
2020-12-19T0609+0100
Last modified: 2021-02-04T0544+0100
Footnotes plugin for WordPress, v2.5.3 and later
A. Support for custom templates
‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
Since v2.2.6, Footnotes supports custom templates.
Custom templates may be loaded from a sibling folder 'footnotes-custom'
or since v2.4.0 from a folder 'templates/footnotes/' in the active theme.
Priority order:
1. active theme
2. sibling folder
3. internal
See footnotes/class/template.php:67..116
1. Active theme
‾‾‾‾‾‾‾‾‾‾‾‾
Please create a folder 'templates/footnotes/' in your child theme and
store all your public custom templates for Footnotes directly therein.
Existing homonymous templates are loaded instead of their counterparts in
wp-content/plugins/footnotes/templates/public/.
2. Sibling folder
‾‾‾‾‾‾‾‾‾‾‾‾‾‾
Please make a sibling of the "footnotes" folder called 'footnotes-custom' and
the same internal structure and file names as 'footnotes/templates/public/'.
Example for custom tooltips:
footnotes-custom
└── templates
└── public
├── footnote.html
└── tooltip.html
Note: The timing parameters in the inline jQuery script 'tooltip.html' are already
configurable in the dashboard > Referrers and tooltips > Tooltip timing.
B. PHPDOC custom tags
‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
PHPDOC tags
2021-01-24T2310+0100
2021-02-04T0831+0100
▲ Source for standard tags:
https://manual.phpdoc.org/HTMLSmartyConverter/HandS/phpDocumentor/tutorial_tags.pkg.html
@access
@author
@copyright
@deprecated
@example
@ignore
@internal
@link
@see
@since
@tutorial
@version
inline {@internal}}
inline {@inheritdoc}
inline {@link}
Sidepane:
phpDocumentor tags
@abstract
@access
@author
@category
@copyright
@deprecated
@example
@final
@filesource
@global
@ignore
@internal
@license
@link
@method
@name
@package
@param
@property
@return
@see
@since
@static
@staticvar
@subpackage
@todo
@tutorial
@uses
@var
@version
phpDocumentor Inline tags
inline {@example}
inline {@id}
inline {@internal}}
inline {@inheritdoc}
inline {@link}
inline {@source}
inline {@toc}
inline {@tutorial}
▲ Tags required/recommended by WordPress coding standard:
https://developer.wordpress.org/coding-standards/inline-documentation-standards/php/
(the only tag added from draft PSR-5 recommendations is @type)
@access
@author [DO NOT USE]
@copyright
@deprecated
@global
@ignore
@internal
@license
@link
@method
@package
@param
@return
@see
@since
@static
@staticvar
@subpackage
@todo
@type
@uses
@var
▲ Tags supported in Atom TextMate found in VSCode 1.47.3:
/usr/share/code/resources/app/extensions/php/syntaxes/php.tmLanguage.json
(Note the 4 tags appended to the list, hence initially missing)
@api
@abstract
@author
@category
@copyright
@example
@global
@inherit[Dd]oc
@internal
@license
@link
@method
@property(-(read|write))?
@package
@param
@return
@see
@since
@source
@static
@subpackage
@throws
@todo
@var
@version
@uses
@deprecated
@final
@ignore
MISSING TAGS:
- wrt phpDocumentor:
@access
@filesource
@id
@name
@staticvar
@toc
@tutorial
@usedby
- wrt WordPress:
@type
▲ up-to-date list (standard/WP, custom) as per 2021-02-04T0522+0100:
@api
@abstract
@access
@author
@category
@copyright
@deprecated
@example
@filesource
@final
@global
@id
@ignore
@inherit[Dd]oc
@internal
@license
@link
@method
@name
@package
@param
@property(-(read|write))?
@return
@see
@since
@source
@static
@staticvar
@subpackage
@throws
@toc
@todo
@tutorial
@type
@usedby
@uses
@var
@version
@accountable
@bib
@biblio
@bibliography
@bugfix
@callback
@commit
@committed
@committer
@contributed
@contribution
@contributor
@courtesy
@date
@datetime
@feature
@featurerequest
@lastmodified
@modified
@publisher
@reporter
@time
▲ Complements for update (missing and added tags):
/usr/share/code/resources/app/extensions/php/syntaxes/php.tmLanguage.json
|access|filesource|id|name|staticvar|toc|tutorial|type|usedby
|accountable|bib|biblio|bugfix|callback|commit|committed|committer|contributed|contribution|contributor|courtesy|date|datetime|feature|featurerequest|lastmodified|modified|publisher|reporter

View file

@ -79,266 +79,267 @@ Visit this swift write-up from a **footnotes** user by the name of **Southwest**
== Changelog == == Changelog ==
= 2.5.4d1 = = 2.5.4d2 =
- 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: Tooltips: fix display in Popup Maker popups - Bugfix: Tooltips: fix display in Popup Maker popups.
- Bugfix: Libraries: jQuery Tools: replace discouraged double equals sign with recommended triple equals sign - Bugfix: Libraries: jQuery Tools: replace discouraged double equals sign with recommended triple equals sign.
- Bugfix: Editor button: Text editor button: try to fix uncaught reference error of “QTags is not defined”, thanks to @dpartridge bug report - Bugfix: Editor button: Text editor button: try to fix uncaught reference error of “QTags is not defined”, thanks to @dpartridge bug report.
- Bugfix: Editor button: Classic Editor text mode: correct label to singular.
= 2.5.3 = = 2.5.3 =
- Bugfix: URL wrap: exclude URL pattern as folder name in Wayback Machine URL, thanks to @rumperuu bug report - Bugfix: URL wrap: exclude URL pattern as folder name in Wayback Machine URL, thanks to @rumperuu bug report.
= 2.5.2 = = 2.5.2 =
- Bugfix: Tooltips: ability to display dedicated content before `[[/tooltip]]`, thanks to @jbj2199 bug report - Bugfix: Tooltips: ability to display dedicated content before `[[/tooltip]]`, thanks to @jbj2199 bug 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 =
- Bugfix: Hooks: support footnotes in Popup Maker popups, thanks to @squatcher bug report - Bugfix: Hooks: support footnotes in Popup Maker popups, thanks to @squatcher bug report.
- Bugfix: Reference container: click on label expands but also collapses, thanks to @ahmadword bug report - Bugfix: Reference container: click on label expands but also collapses, thanks to @ahmadword bug report.
- Bugfix: Reference container: Label: cursor takes pointer shape, thanks to @ahmadword bug report - Bugfix: Reference container: Label: cursor takes pointer shape, thanks to @ahmadword bug report.
- Bugfix: Dashboard: Custom CSS: mention validity of legacy while visible, thanks to @rkupadhya bug report - Bugfix: Dashboard: Custom CSS: mention validity of legacy while visible, thanks to @rkupadhya bug report.
- Bugfix: Dashboard: Custom CSS: make class list column formatting effective again - Bugfix: Dashboard: Custom CSS: make class list column formatting effective again.
- Update: Readme/documentation: add new contributors in the file headers Contributors field - Update: Readme/documentation: add new contributors in the file headers Contributors field.
- Update: Readme/documentation: update or fix URLs in Download, Support and Development sections - Update: Readme/documentation: update or fix URLs in Download, Support and Development sections.
= 2.5.0 = = 2.5.0 =
- Add: Customization: Enable template location stack, thanks to @misfist source file contribution - Add: Customization: Enable template location stack, thanks to @misfist source file contribution.
- Bugfix: Hooks: support footnotes on category pages, thanks to @vitaefit bug report, thanks to @misfist code contribution - Bugfix: Hooks: support footnotes on category pages, thanks to @vitaefit bug report, thanks to @misfist code contribution.
- Bugfix: Shortcode syntax validation: exclude certain cases involving scripts, thanks to @andreasra bug report - Bugfix: Shortcode syntax validation: exclude certain cases involving scripts, thanks to @andreasra bug report.
- Bugfix: Shortcode syntax validation: complete message with hint about setting, thanks to @andreasra bug report - Bugfix: Shortcode syntax validation: complete message with hint about setting, thanks to @andreasra bug report.
- Bugfix: Shortcode syntax validation: limit length of quoted string to 300 characters, thanks to @andreasra bug report - Bugfix: Shortcode syntax validation: limit length of quoted string to 300 characters, thanks to @andreasra bug report.
- Update: Shortcode syntax validation: add more information around the setting - Update: Shortcode syntax validation: add more information around the setting.
- Bugfix: Shortcodes: Dashboard: warning about '&gt;' escapement disruption in WordPress Block Editor - Bugfix: Shortcodes: Dashboard: warning about '&gt;' escapement disruption in WordPress Block Editor.
= 2.4.0 = = 2.4.0 =
- Add: Shortcodes: syntax validation for balanced footnote start and end tag short codes - Add: Shortcodes: syntax validation for balanced footnote start and end tag short codes.
- Bugfix: Performance: optimize template load and process according to settings, thanks to @misfist code contribution - Bugfix: Performance: optimize template load and process according to settings, thanks to @misfist code contribution.
- Bugfix: Process: initialize hard link address variable to empty to fix 'undefined variable' bug, thanks to @a223123131 bug report - Bugfix: Process: initialize hard link address variable to empty to fix 'undefined variable' bug, thanks to @a223123131 bug report.
- Bugfix: Reference container: Label: set empty label to U+202F NNBSP for more robustness, thanks to @lukashuggenberg bug report - Bugfix: Reference container: Label: set empty label to U+202F NNBSP for more robustness, thanks to @lukashuggenberg bug report.
- Bugfix: Scroll offset: initialize to safer one third window height for more robustness, thanks to @lukashuggenberg bug report - Bugfix: Scroll offset: initialize to safer one third window height for more robustness, thanks to @lukashuggenberg bug report.
- Bugfix: Shortcodes: Dashboard: remove new option involving HTML comment tags only usable in source mode - Bugfix: Shortcodes: Dashboard: remove new option involving HTML comment tags only usable in source mode.
- Bugfix: Reference container: Row borders: adapt left padding to the presence of an optional left border - Bugfix: Reference container: Row borders: adapt left padding to the presence of an optional left border.
- Bugfix: Reference container: add class 'footnote_plugin_symbol' to disambiguate repurposed class 'footnote_plugin_link' - Bugfix: Reference container: add class 'footnote_plugin_symbol' to disambiguate repurposed class 'footnote_plugin_link'.
= 2.3.0 = = 2.3.0 =
- Add: optional hard links in referrers and backlinks for AMP compatibility, thanks to @psykonevro bug report, thanks to @martinneumannat code contribution - Add: optional hard links in referrers and backlinks for AMP compatibility, thanks to @psykonevro bug report, thanks to @martinneumannat code contribution.
- Bugfix: Reference container: convert top padding to margin and make it a setting, thanks to @hamshe bug report - Bugfix: Reference container: convert top padding to margin and make it a setting, thanks to @hamshe bug report.
- Bugfix: Referrers and tooltips: disable box shadow to more effectively remove unwanted underline as bottom border, thanks to @klusik bug report - Bugfix: Referrers and tooltips: disable box shadow to more effectively remove unwanted underline as bottom border, thanks to @klusik bug report.
- Bugfix: Dashboard: swap Custom CSS migration Boolean, meaning 'show legacy' instead of 'migration complete', due to storage data structure constraints - Bugfix: Dashboard: swap Custom CSS migration Boolean, meaning 'show legacy' instead of 'migration complete', due to storage data structure constraints.
- Update: Dashboard: rename 'Priority level' tab as 'Scope and priority', to account for the new alternative depending on widget_text hook activation - Update: Dashboard: rename 'Priority level' tab as 'Scope and priority', to account for the new alternative depending on widget_text hook activation.
- Bugfix: Referrers and tooltips: correct scope of the line height fix to only affect the referrers - Bugfix: Referrers and tooltips: correct scope of the line height fix to only affect the referrers.
- Bugfix: Referrers: extend clickable area to the full line height in sync with current pointer shape - Bugfix: Referrers: extend clickable area to the full line height in sync with current pointer shape.
- Bugfix: Referrers: extend scope of the underline inhibition to be more comprehensive and consistent - Bugfix: Referrers: extend scope of the underline inhibition to be more comprehensive and consistent.
- Bugfix: Reference container: edits to optional basic responsive page layout style sheet - Bugfix: Reference container: edits to optional basic responsive page layout style sheet.
= 2.2.10 = = 2.2.10 =
- Bugfix: Reference container: add option for table borders to revert 2.0.0/2.0.1 change, thanks to @noobishh bug report - Bugfix: Reference container: add option for table borders to revert 2.0.0/2.0.1 change, thanks to @noobishh bug report.
- Bugfix: Reference container: add missing container ID in function name in one of the four table row templates - Bugfix: Reference container: add missing container ID in function name in one of the four table row templates.
- Bugfix: Reference container, tooltips: URL wrap: support also file transfer protocol URLs - Bugfix: Reference container, tooltips: URL wrap: support also file transfer protocol URLs.
= 2.2.9 = = 2.2.9 =
- Bugfix: Reference container, widget_text hook: support for multiple reference containers in a page, thanks to @justbecuz bug report - Bugfix: Reference container, widget_text hook: support for multiple reference containers in a page, thanks to @justbecuz bug report.
- Update: Priority levels: set widget_text default to 98 and update its description in the dashboard Priority level tab - Update: Priority levels: set widget_text default to 98 and update its description in the dashboard Priority level tab.
- Bugfix: Reference container, tooltips: URL wrap: account for RFC 2396 allowed characters in parameter names - 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 - Bugfix: Reference container, tooltips: URL wrap: exclude URLs also where the equals sign is preceded by an entity or character reference.
= 2.2.8 = = 2.2.8 =
- Bugfix: Reference container, tooltips: URL wrap: correct lookbehind by duplicating it with and without quotation mark class - Bugfix: Reference container, tooltips: URL wrap: correct lookbehind by duplicating it with and without quotation mark class.
= 2.2.7 = = 2.2.7 =
- Bugfix: Reference container, tooltips: URL wrap: revert the change in the regex, thanks to @rjl20 @spaceling @friedrichnorth @bernardzit @lukashuggenberg bug reports - Bugfix: Reference container, tooltips: URL wrap: revert the change in the regex, thanks to @rjl20 @spaceling @friedrichnorth @bernardzit @lukashuggenberg bug reports.
= 2.2.6 = = 2.2.6 =
- Bugfix: Reference container, tooltips: URL wrap: make the quotation mark optional wrt query parameters, thanks to @spiralofhope2 bug report - Bugfix: Reference container, tooltips: URL wrap: make the quotation mark optional wrt query parameters, thanks to @spiralofhope2 bug report.
- Add: Customization: support for custom templates in sibling folder, thanks to @misfist filter request - Add: Customization: support for custom templates in sibling folder, thanks to @misfist filter request.
= 2.2.5 = = 2.2.5 =
- Bugfix: Dashboard: Footnotes numbering: add missing support for Ibid. notation to suggestions, thanks to @meglio code contribution - Bugfix: Dashboard: Footnotes numbering: add missing support for Ibid. notation to suggestions, thanks to @meglio code contribution.
- Bugfix: Reference container: Label: not enforce bottom border but make it an option, thanks to @markhillyer bug report - Bugfix: Reference container: Label: not enforce bottom border but make it an option, thanks to @markhillyer bug report.
- Bugfix: Reference container: Label: allow to switch from paragraph element to heading, thanks to @markhillyer code contribution - Bugfix: Reference container: Label: allow to switch from paragraph element to heading, thanks to @markhillyer code contribution.
- Bugfix: Reference container: delete position shortcode if unused because position may be widget or footer, thanks to @hamshe bug report - Bugfix: Reference container: delete position shortcode if unused because position may be widget or footer, thanks to @hamshe bug report.
- Bugfix: Dashboard: Tooltip position/timing settings: include alternative tooltips (for themes not supporting jQuery tooltips) - Bugfix: Dashboard: Tooltip position/timing settings: include alternative tooltips (for themes not supporting jQuery tooltips).
- Bugfix: Dashboard: Tooltip position/timing settings: raise above tooltip truncation settings for better consistency - Bugfix: Dashboard: Tooltip position/timing settings: raise above tooltip truncation settings for better consistency.
= 2.2.4 = = 2.2.4 =
- Bugfix: Reference container: Backlink symbol selection: move back to previous tab “Referrers and tooltips” - Bugfix: Reference container: Backlink symbol selection: move back to previous tab “Referrers and tooltips”.
- Bugfix: Custom CSS: make inserting existing in header depend on migration complete checkbox status - Bugfix: Custom CSS: make inserting existing in header depend on migration complete checkbox status.
= 2.2.3 = = 2.2.3 =
- Bugfix: Custom CSS: insert new CSS in the public page header element after existing CSS - Bugfix: Custom CSS: insert new CSS in the public page header element after existing CSS.
= 2.2.2 = = 2.2.2 =
- Bugfix: Dashboard: Link element setting only under General settings > Reference container - Bugfix: Dashboard: Link element setting only under General settings > Reference container.
- Bugfix: Dashboard: Custom CSS: unearth text area and migrate to dedicated tab as designed - Bugfix: Dashboard: Custom CSS: unearth text area and migrate to dedicated tab as designed.
- Bugfix: Reference container: edits to optional basic responsive page layout style sheets - Bugfix: Reference container: edits to optional basic responsive page layout style sheets.
= 2.2.1 = = 2.2.1 =
- Bugfix: Dashboard: duplicate moved settings under their legacy tab to account for data structure - Bugfix: Dashboard: duplicate moved settings under their legacy tab to account for data structure.
= 2.2.0 = = 2.2.0 =
- Add: Reference container: support for custom position shortcode, thanks to @hamshe feature request - Add: Reference container: support for custom position shortcode, thanks to @hamshe feature request.
- Add: Start/end short codes: more predefined options - Add: Start/end short codes: more predefined options.
- Add: Numbering styles: lowercase Roman numerals support - Add: Numbering styles: lowercase Roman numerals support.
- Update: Priority levels: update the notice in the dashboard Priority tab - Update: Priority levels: update the notice in the dashboard Priority tab.
- Update: Dashboard: Tooltip settings: group into 3 thematic containers - Update: Dashboard: Tooltip settings: group into 3 thematic containers.
- Update: Dashboard: Main settings: group into 3 specific containers - Update: Dashboard: Main settings: group into 3 specific containers.
- Update: Dashboard: move link element option to the Referrers options - Update: Dashboard: move link element option to the Referrers options.
- Update: Dashboard: move URL wrap option to the Reference container options - Update: Dashboard: move URL wrap option to the Reference container options.
- Update: Dashboard: group both Custom CSS and priority level settings under the same tab - Update: Dashboard: group both Custom CSS and priority level settings under the same tab.
- Update: Dashboard: rename tab labels 'Referrers and tooltips', 'Priority and CSS' - Update: Dashboard: rename tab labels 'Referrers and tooltips', 'Priority and CSS'.
- Bugfix: Tooltips: add 'important' property to z-index to fix display overlay issue - Bugfix: Tooltips: add 'important' property to z-index to fix display overlay issue.
- Bugfix: Localization: correct arguments for plugin textdomain load function - Bugfix: Localization: correct arguments for plugin textdomain load function.
- Bugfix: Reference container, tooltips: URL wrap: specifically catch the quotation mark - Bugfix: Reference container, tooltips: URL wrap: specifically catch the quotation mark.
- Add: Footnotes mention in the footer: more options - Add: Footnotes mention in the footer: more options.
= 2.1.6 = = 2.1.6 =
- Bugfix: Priority levels: set the_content priority level to 98 to prevent plugin conflict, thanks to @marthalindeman bug report - Bugfix: Priority levels: set the_content priority level to 98 to prevent plugin conflict, thanks to @marthalindeman bug report.
- Bugfix: Tooltips: set z-index to maximum 2147483647 to address display issues with overlay content, thanks to @russianicons bug report - Bugfix: Tooltips: set z-index to maximum 2147483647 to address display issues with overlay content, thanks to @russianicons bug report.
- Bugfix: Reference container, tooltips: URL wrap: fix regex, thanks to @a223123131 bug report - Bugfix: Reference container, tooltips: URL wrap: fix regex, thanks to @a223123131 bug report.
- Bugfix: Dashboard: URL wrap: add option to properly enable/disable URL wrap - Bugfix: Dashboard: URL wrap: add option to properly enable/disable URL wrap.
- Update: Dashboard: reorder tabs and update tab labels - Update: Dashboard: reorder tabs and update tab labels.
- Bugfix: Dashboard: remove Expert mode enable setting since permanently enabled as 'Priority' - Bugfix: Dashboard: remove Expert mode enable setting since permanently enabled as 'Priority'.
- Bugfix: Dashboard: fix punctuation-related localization issue by including colon in labels - Bugfix: Dashboard: fix punctuation-related localization issue by including colon in labels.
- Bugfix: Localization: conform to WordPress plugin language file name scheme, thanks to @nikelaos bug report - Bugfix: Localization: conform to WordPress plugin language file name scheme, thanks to @nikelaos bug report.
= 2.1.5 = = 2.1.5 =
- Bugfix: Reference container, tooltips: URL wrap: exclude image source too, thanks to @bjrnet21 bug report - Bugfix: Reference container, tooltips: URL wrap: exclude image source too, thanks to @bjrnet21 bug report.
= 2.1.4 = = 2.1.4 =
- Bugfix: Scroll offset: make configurable to fix site-dependent issues related to fixed headers - Bugfix: Scroll offset: make configurable to fix site-dependent issues related to fixed headers.
- Bugfix: Scroll duration: make configurable to conform to website content and style requirements - Bugfix: Scroll duration: make configurable to conform to website content and style requirements.
- Bugfix: Tooltips: make display delays and fade durations configurable to conform to website style - Bugfix: Tooltips: make display delays and fade durations configurable to conform to website style.
- Bugfix: Styling: Tooltips: fix font size issue by adding font size to settings with legacy as default - Bugfix: Styling: Tooltips: fix font size issue by adding font size to settings with legacy as default.
- Bugfix: Reference container: fix layout by optionally enqueuing additional style sheet (depends on theme) - Bugfix: Reference container: fix layout by optionally enqueuing additional style sheet (depends on theme).
- Bugfix: Reference container: fix layout issues by moving backlink column width to settings - Bugfix: Reference container: fix layout issues by moving backlink column width to settings.
- Bugfix: Reference container: make separating and terminating punctuation optional and configurable - Bugfix: Reference container: make separating and terminating punctuation optional and configurable.
- Bugfix: Reference container: Backlinks: fix stacked enumerations by adding optional line breaks - Bugfix: Reference container: Backlinks: fix stacked enumerations by adding optional line breaks.
- Bugfix: Layout: Tooltips: prevent line break in Read-on link label - Bugfix: Layout: Tooltips: prevent line break in Read-on link label.
- Bugfix: Styling: Referrers and backlinks: make link elements optional to fix issues - Bugfix: Styling: Referrers and backlinks: make link elements optional to fix issues.
- Bugfix: Styling: Referrers: disable hover underline - Bugfix: Styling: Referrers: disable hover underline.
- Bugfix: Reference container, tooltips: fix line wrapping of URLs based on pattern, not link element - Bugfix: Reference container, tooltips: fix line wrapping of URLs based on pattern, not link element.
- Bugfix: Reference container: Backlink symbol: support for appending when combining identicals is on - Bugfix: Reference container: Backlink symbol: support for appending when combining identicals is on.
- Bugfix: Reference container: Backlinks: deprioritize hover underline to ease customization - Bugfix: Reference container: Backlinks: deprioritize hover underline to ease customization.
- Bugfix: Reference container: Backlinks: fix line breaking with respect to separators and terminators - Bugfix: Reference container: Backlinks: fix line breaking with respect to separators and terminators.
- Bugfix: Reference container: Label: delete overflow hidden rule - Bugfix: Reference container: Label: delete overflow hidden rule.
- Bugfix: Reference container: Expand/collapse button: same padding to the right for right-to-left - Bugfix: Reference container: Expand/collapse button: same padding to the right for right-to-left.
- Bugfix: Reference container: Styles: re-add the class dedicated to combined footnotes indices - Bugfix: Reference container: Styles: re-add the class dedicated to combined footnotes indices.
- Bugfix: Dashboard: move arrow settings from Customize to Settings > Reference container to reunite and fix issue with new heading wording - Bugfix: Dashboard: move arrow settings from Customize to Settings > Reference container to reunite and fix issue with new heading wording.
- Bugfix: Dashboard: Main settings: fix layout, raise shortcodes to top - Bugfix: Dashboard: Main settings: fix layout, raise shortcodes to top.
- Bugfix: Dashboard: Tooltip settings: Truncation length: change input box type from text to numeric - Bugfix: Dashboard: Tooltip settings: Truncation length: change input box type from text to numeric.
- Update: Dashboard: Notices: use explicit italic style - Update: Dashboard: Notices: use explicit italic style.
- Bugfix: Dashboard: Other settings: Excerpt: display guidance next to select box, thanks to @nikelaos bug report - Bugfix: Dashboard: Other settings: Excerpt: display guidance next to select box, thanks to @nikelaos bug report.
- Bugfix: WordPress hooks: the_content: set priority to 1000 as a safeguard - Bugfix: WordPress hooks: the_content: set priority to 1000 as a safeguard.
- Update: Dashboard: Expert mode: streamline and update description for hooks and priority levels - Update: Dashboard: Expert mode: streamline and update description for hooks and priority levels.
= 2.1.3 = = 2.1.3 =
- Bugfix: Hooks: disable widget_text hook by default to fix accordions declaring headings as widgets - Bugfix: Hooks: disable widget_text hook by default to fix accordions declaring headings as widgets.
- Bugfix: Hooks: disable the_excerpt hook by default to fix issues, thanks to @nikelaos bug report - Bugfix: Hooks: disable the_excerpt hook by default to fix issues, thanks to @nikelaos bug report.
- Bugfix: Reference container: fix column width when combining turned on by reverting new CSS class to legacy - Bugfix: Reference container: fix column width when combining turned on by reverting new CSS class to legacy.
- Bugfix: Reference container: fix width in mobile view by URL wrapping wrt Unicode-non-conformant browsers - Bugfix: Reference container: fix width in mobile view by URL wrapping wrt Unicode-non-conformant browsers.
- Bugfix: Reference container: table cell backlinking if index is single and combining identicals turned on - Bugfix: Reference container: table cell backlinking if index is single and combining identicals turned on.
- Bugfix: Styling: raise Custom CSS priority to override settings - Bugfix: Styling: raise Custom CSS priority to override settings.
- Bugfix: Styling: Tooltips: raise settings priority to override theme style sheets - Bugfix: Styling: Tooltips: raise settings priority to override theme style sheets.
= 2.1.2 = = 2.1.2 =
- Bugfix: Reference container: Backlinks: no underline on hover cell when combining identicals is on - Bugfix: Reference container: Backlinks: no underline on hover cell when combining identicals is on.
- Bugfix: Dashboard: priority level settings for all other hooks, thanks to @nikelaos bug report - Bugfix: Dashboard: priority level settings for all other hooks, thanks to @nikelaos bug report.
- Update: Dashboard: WordPress documentation URLs of the hooks - Update: Dashboard: WordPress documentation URLs of the hooks.
- Update: Dashboard: feature description for the hooks priority level settings, thanks to @nikelaos bug report - Update: Dashboard: feature description for the hooks priority level settings, thanks to @nikelaos bug report.
= 2.1.1 = = 2.1.1 =
- Bugfix: Combining identical footnotes: fix dead links and ensure referrer-backlink bijectivity, thanks to @happyches bug report - Bugfix: Combining identical footnotes: fix dead links and ensure referrer-backlink bijectivity, thanks to @happyches bug report.
- Bugfix: Dashboard: priority level setting for the_content hook, thanks to @imeson bug report - Bugfix: Dashboard: priority level setting for the_content hook, thanks to @imeson bug report.
- Update: Libraries: jQuery Tools: redact (comment out) all 6 instances of deprecated function jQuery.browser(), thanks to @bjrnet21 @cconser @vyassuresh @spaceling @widecast @olivlyon @maxident bug reports - Update: Libraries: jQuery Tools: redact (comment out) all 6 instances of deprecated function jQuery.browser(), thanks to @bjrnet21 @cconser @vyassuresh @spaceling @widecast @olivlyon @maxident bug reports.
- Bugfix: Libraries: jQuery Tools: complete minification - Bugfix: Libraries: jQuery Tools: complete minification.
- Bugfix: Libraries: make script loads depend on tooltip implementation option - Bugfix: Libraries: make script loads depend on tooltip implementation option.
- Bugfix: Libraries: jQuery UI: properly pick the libraries registered by WordPress needed for tooltips - Bugfix: Libraries: jQuery UI: properly pick the libraries registered by WordPress needed for tooltips.
- Bugfix: Reference container: fix start pages by making its display optional, thanks to @dragon013 bug report - Bugfix: Reference container: fix start pages by making its display optional, thanks to @dragon013 bug report.
- Bugfix: Reference container: Backlink symbol: select box to disable instead of space character - Bugfix: Reference container: Backlink symbol: make optional, not suggest configuring it to invisible, thanks to @spaceling feedback.
- Bugfix: Reference container: Footnote number links: disable bottom border for theme compatibility - Bugfix: Reference container: Footnote number links: disable bottom border for theme compatibility.
- Bugfix: Reference container: option to restore 3-column layout (combining identicals turned off) - Bugfix: Reference container: option to restore 3-column layout (combining identicals turned off).
- Bugfix: Reference container: option to append symbol (prepended by default) (combining identicals turned off) - Bugfix: Reference container: option to append symbol (prepended by default), thanks to @spaceling code contribution.
- Bugfix: Reference container: Table rows: fix top and bottom padding - Bugfix: Reference container: Table rows: fix top and bottom padding.
- Bugfix: Referrers: new setting for vertical align: superscript (default) or baseline (optional), thanks to @cwbayer bug report - Bugfix: Referrers: new setting for vertical align: superscript (default) or baseline (optional), thanks to @cwbayer bug report.
- Bugfix: Referrers: line height 0 to fix superscript, thanks to @cwbayer bug report - Bugfix: Referrers: line height 0 to fix superscript, thanks to @cwbayer bug report.
- Bugfix: Tooltips: optional alternative JS implementation with CSS transitions to fix configuration-related outage - Bugfix: Tooltips: optional alternative JS implementation with CSS transitions to fix configuration-related outage, thanks to @andreasra feedback.
- Bugfix: Tooltips: add delay (400ms) before fade-out to fix UX wrt links and Read-on button - Bugfix: Tooltips: add delay (400ms) before fade-out to fix UX wrt links and Read-on button.
- Bugfix: Tooltips: fix line breaking for hyperlinked URLs in Unicode-non-compliant user agents - Bugfix: Tooltips: fix line breaking for hyperlinked URLs in Unicode-non-compliant user agents.
- Bugfix: Formatting: disable overline showing in some themes on hovered backlinks - Bugfix: Formatting: disable overline showing in some themes on hovered backlinks.
= 2.1.0 = = 2.1.0 =
- Add: Tooltips: Read-on button: Label: configurable instead of localizable - Add: Tooltips: Read-on button: Label: configurable instead of localizable.
- Bugfix: Referrers: disable bottom border for theme compatibility - Bugfix: Referrers: disable bottom border for theme compatibility.
- Update: Accessibility: add 'speaker-mute' class to reference container - Update: Accessibility: add 'speaker-mute' class to reference container.
- Bugfix: Dashboard: Layout: added named selectors to limit applicability of styles - Bugfix: Dashboard: Layout: added named selectors to limit applicability of styles.
- UPDATE: REMOVED the_post hook, the plugin stopped supporting this hook - UPDATE: Hooks: remove 'the_post', the plugin stops supporting this hook.
= 2.0.8 = = 2.0.8 =
- BUGFIX: Priority level back to PHP_INT_MAX (need to get in touch with other plugins) - BUGFIX: Priority level back to PHP_INT_MAX (need to get in touch with other plugins).
= 2.0.7 = = 2.0.7 =
- BUGFIX: Disabled hook "the_post" **Any related code in the plugin shall disappear** - BUGFIX: Hooks: Default-disable 'the_post', thanks to @spaceling @@markcheret @nyamachi @whichgodsaves @spiralofhope2 @mmallett @andreasra @widecast @ymorin007 @tashi1es bug reports.
- Update: Set priority level back to 10 assuming it is unproblematic - Update: Set priority level back to 10 assuming it is unproblematic.
- Update: Added backwards compatible support for legacy arrow and index placeholders in template - Update: Added backwards compatible support for legacy arrow and index placeholders in template.
- Update: Settings defaults adjusted for better and more up-to-date tooltip layout - Update: Settings defaults adjusted for better and more up-to-date tooltip layout.
= 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 # clusters - Bugfix: Reference container: fix line breaking behavior in footnote # 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.
- Bugfix: Typesetting: discard the dot after footnote numbers as not localizable (should be optional) - Bugfix: Typesetting: discard the dot after footnote numbers as not localizable (should be optional).
- Bugfix: Reference container: Collapse button fully clickable, not sign only - Bugfix: Reference container: Collapse button fully clickable, not sign only.
- Bugfix: Reference container: Collapse button 'collapse' with minus sign not hyphen-minus - Bugfix: Reference container: Collapse button 'collapse' with minus sign not hyphen-minus.
- Update: Tooltips: set display predelay to 0 for responsiveness (was 800 since 2.0.0, 400 before) - Update: Tooltips: set display predelay to 0 for responsiveness (was 800 since 2.0.0, 400 before).
- Update: Tooltips: set fade duration to 200ms both ways (was 200 in and 2000 out since 2.0.0, 0 in and 100 out before) - Update: Tooltips: set fade duration to 200ms both ways (was 200 in and 2000 out since 2.0.0, 0 in and 100 out before).
- BUGFIX: Priority level back to PHP_INT_MAX (ref container positioning not this plugins responsibility) - BUGFIX: Priority level back to PHP_INT_MAX (ref container positioning not this plugins responsibility).
- Update: Scroll offset: raise percentage from 12% to a safer 20% inner window height, by lack of configurability - Update: Scroll offset: raise percentage from 12% to a safer 20% inner window height, by lack of configurability.
= 2.0.5 = = 2.0.5 =
- Bugfix: Reference container: fix relative position through priority level, thanks to @june01 @imeson bug reports, thanks to @spaceling code contribution - Bugfix: Reference container: fix relative position through priority level, thanks to @june01 @imeson @spaceling bug reports, thanks to @spaceling code contribution.
- Bugfix: Reference container: unset width of text column to fix site issues - Bugfix: Reference container: unset width of text column to fix site issues.
- Update: Enable all hooks by default to prevent footnotes from seeming broken in post titles - Update: Hooks: Default-enable all hooks to prevent footnotes from seeming broken in some parts.
- Bugfix: Restore cursor shape pointer over 'Continue reading' button after hyperlink removal - Bugfix: Tooltips: Restore cursor shape 'pointer' over Read-on button after hard link removal.
- Bugfix: Settings style sheet: unenqueue to fix input boxes on public pages (enqueued for 2.0.4) - Bugfix: Settings style sheet: unenqueue to fix input boxes on public pages (enqueued for 2.0.4).
= 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: UX: Remove hyperlink addresses from referrers and backlinks wrt browsing history.
- 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.
- Bugfix: Translations: review all locales (en, de, es, fr), synced ref line # with edited code - Bugfix: Translations: review all locales (en, de, es, fr), synced ref line # with edited code.
- Bugfix: Dashboard: fix display of two headings containing the logo - Bugfix: Dashboard: fix display of two headings containing the logo.
= 2.0.3 = = 2.0.3 =
- Bugfix: Reference container: Self-adjusting width of ID column but hidden overflow - Bugfix: Reference container: Self-adjusting width of ID column but hidden overflow.
- Update: Reference container: clarify backlink semantics by prepended transitional up arrow, thanks to bug report - Update: Reference container: clarify backlink semantics by prepended transitional up arrow, thanks to bug report.
- Bugfix: Fragment IDs: Prepended post ID to footnote number - Bugfix: Fragment IDs: Prepended post ID to footnote number.
- Bugfix: Feed plugin version in style sheet query string for cache busting - Bugfix: Feed plugin version in style sheet query string for cache busting.
- Bugfix: Print style: prevent a page break just after the reference container label - Bugfix: Print style: prevent a page break just after the reference container label.
- Bugfix: Print style: Hide reference collapse button - Bugfix: Print style: Hide reference collapse button.
- Update: Reference container: Headline: remove padding before reference container label - Update: Reference container: Headline: remove padding before reference container label.
- Update: Scroll offset: raise percentage from 5% to a safer 12% inner window height, by lack of setting - Update: Scroll offset: raise percentage from 5% to a safer 12% inner window height, by lack of setting.
= 2.0.2 = = 2.0.2 =
- Bugfix: Restored expand/collapse button of reference container - Bugfix: Restored expand/collapse button of reference container.
- Bugfix: Dashboard: Available CSS selectors, last item display - Bugfix: Dashboard: Available CSS selectors, last item display.
- Bugfix: Footnote anchor and ID color to default on screen, to inherit in print - Bugfix: Footnote anchor and ID color to default on screen, to inherit in print.
- Bugfix: Disabled underline in footnote anchors, underline only on hover - Bugfix: Disabled underline in footnote anchors, underline only on hover.
= 2.0.1 = = 2.0.1 =
- Bugfix: enforce borderless table cells through !important property, thanks to @ragonesi bug report - Bugfix: enforce borderless table cells through !important property, thanks to @ragonesi bug report.
- Update: Translations: revised fr_FR - Update: Translations: revised fr_FR.
= 2.0.0 = = 2.0.0 =
- Major contributions taken from WordPress user pewgeuges, all details here https://github.com/media-competence-institute/footnotes/blob/master/README.md: - Major contributions taken from WordPress user pewgeuges, all details here https://github.com/media-competence-institute/footnotes/blob/master/README.md:
- Update: **symbol for backlinks** removed - Update: **symbol for backlinks** removed
- Update: hyperlink moved to the reference number - Update: hyperlink moved to the reference number
- Update: Tooltips: fix disabling bug by loading jQuery UI library, thanks to @rajinderverma @ericcorbett2 @honlapdavid @mmallett bug reports, thanks to @vonpiernik code contribution - Update: Tooltips: fix disabling bug by loading jQuery UI library, thanks to @rajinderverma @ericcorbett2 @honlapdavid @mmallett @twellve_million bug reports, thanks to @vonpiernik code contribution
- Update: Libraries: jQuery Tools: add condition whether deprecated function jQuery.browser() exists, thanks to @vonpiernik code contribution - Update: Libraries: jQuery Tools: add condition whether deprecated function jQuery.browser() exists, thanks to @vonpiernik code contribution
- Update: Account for disruptive PHP change - Update: Account for disruptive PHP change
- Bugfix: footnote links script independent - Bugfix: footnote links script independent

View file

@ -15,15 +15,19 @@
textArea.val(textArea.val().substring(0, start) + replacement + textArea.val().substring(end, len)); textArea.val(textArea.val().substring(0, start) + replacement + textArea.val().substring(end, len));
} }
/** /**
* adds a new button to the plain text editor * adds a button to the Classic Editor text mode
* *
* @edit 2.5.4d1 try to fix uncaught reference error of “QTags is not defined” *
* @since 2.5.4d1 try to fix uncaught reference error of “QTags is not defined”
* *
* @reporter @dpartridge * @reporter @dpartridge
* @bugreport https://wordpress.org/support/topic/qtags-addbutton/ * @link https://wordpress.org/support/topic/qtags-addbutton/
*
*
* @link 2.5.4 correct label to singular
*/ */
if ( QTags ) { if ( QTags ) {
QTags.addButton( 'MCI_Footnotes_QuickTag_button', 'footnotes', MCI_Footnotes_text_editor_callback ); QTags.addButton( 'MCI_Footnotes_QuickTag_button', 'footnote', MCI_Footnotes_text_editor_callback );
} }
/** /**

View file

@ -1,63 +0,0 @@
<?php ?>
<script type="text/javascript">
/**
* adds a tag in at the beginning and at the end of a selected text in the specific text area
* @param string elementID
* @param string openTag
* @param string closeTag
*/
function MCI_Footnotes_wrapText(elementID, openTag, closeTag) {
var textArea = jQuery('#' + elementID);
var len = textArea.val().length;
var start = textArea[0].selectionStart;
var end = textArea[0].selectionEnd;
var selectedText = textArea.val().substring(start, end);
var replacement = openTag + selectedText + closeTag;
textArea.val(textArea.val().substring(0, start) + replacement + textArea.val().substring(end, len));
}
<?php
/**
* adds a new button to the plain text editor
*/
function load_footnotes_quicktag_inline() {
/**
* Adds a check to ensure the quicktags script is available
* preventing undefined error if no quicktags script
* @author Erica Franz
*/
if ( wp_script_is( 'quicktags' ) ) { ?>
// And now the footnotes button
QTags.addButton('MCI_Footnotes_QuickTag_button', 'footnotes', MCI_Footnotes_text_editor_callback);
<?php }
}
add_action( 'admin_print_footer_scripts', 'load_footnotes_quicktag_inline' );
?>
/**
* callback function when the button is clicked
* executes a ajax call to get the start and end tag for the footnotes and
* adds them in before and after the selected text
*/
function MCI_Footnotes_text_editor_callback() {
jQuery.ajax({
type: 'POST',
url: '/wp-admin/admin-ajax.php',
data: {
action: 'footnotes_getTags'
},
success: function (data, textStatus, XMLHttpRequest) {
var l_arr_Tags = JSON.parse(data);
MCI_Footnotes_wrapText("content", l_arr_Tags['start'], l_arr_Tags['end']);
},
error: function (MLHttpRequest, textStatus, errorThrown) {}
});
}
</script>
<?php ?>

View file

@ -1,46 +0,0 @@
note-for-developers.txt
2020-12-19T0609+0100
Last modified: 2021-01-04T1734+0100
Footnotes plugin for WordPress, v2.2.6 and later
Support for custom templates
‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
Since v2.2.6, Footnotes supports custom templates.
Custom templates may be loaded from a sibling folder 'footnotes-custom'
or since v2.4.0 from a folder 'templates/footnotes/' in the active theme.
Priority order:
1. active theme
2. sibling folder
3. internal
See footnotes/class/template.php:67..116
A. Active theme
‾‾‾‾‾‾‾‾‾‾‾‾
Please create a folder 'templates/footnotes/' in your child theme and
store all your public custom templates for Footnotes directly therein.
Existing homonymous templates are loaded instead of their counterparts in
wp-content/plugins/footnotes/templates/public/.
B. Sibling folder
‾‾‾‾‾‾‾‾‾‾‾‾‾‾
Please make a sibling of the "footnotes" folder called 'footnotes-custom' and
the same internal structure and file names as 'footnotes/templates/public/'.
Example for custom tooltips:
footnotes-custom
└── templates
└── public
├── footnote.html
└── tooltip.html
The timing parameters in the inline jQuery script 'tooltip.html' are already
configurable in the dashboard > Referrers and tooltips > Tooltip timing.