diff --git a/class/dashboard/subpage-main.php b/class/dashboard/subpage-main.php index b00205a..c7b46a2 100644 --- a/class/dashboard/subpage-main.php +++ b/class/dashboard/subpage-main.php @@ -6,42 +6,42 @@ * @author Stefan Herndler * @since 1.5.0 14.09.14 14:47 * - * Last modified: 2021-01-22T0545+0100 * - * Edited: + * @lastmodified 2021-02-11T0821+0100 + * * @since 2.0.4 restore arrow settings 2020-11-01T0509+0100 * @since 2.1.0 read-on button label 2020-11-08T2148+0100 * @since 2.1.1 options for ref container and alternative tooltips 2020-11-16T2152+0100 * @since 2.1.1 Referrers: superscript becomes optional, thanks to @cwbayer bug report * @since 2.1.2 priority level settings for all other hooks, thanks to @nikelaos - * @see + * @link https://wordpress.org/support/topic/doesnt-work-any-more-11/#post-13676705 * @since 2.1.4 settings for ref container, tooltips and scrolling 2020-12-03T0950+0100 * @since 2.1.6 slight UI reordering 2020-12-09T1114+0100 * @since 2.1.6 option to disable URL line wrapping 2020-12-09T1604+0100 * @since 2.1.6 remove expert mode setting as outdated 2020-12-09T2105+0100 * @since 2.2.0 start/end short codes: more predefined options, thanks to @nikelaos - * @see + * @link https://wordpress.org/support/topic/doesnt-work-with-mailpoet/ * @since 2.2.0 add options, redistribute, update strings 2020-12-12T2135+0100 * @since 2.2.0 shortcode for reference container custom position 2020-12-13T2055+0100 * @since 2.2.2 Custom CSS settings container migration 2020-12-15T0709+0100 * @since 2.2.4 move backlink symbol selection under previous tab 2020-12-16T1244+0100 * @since 2.2.5 support for Ibid. notation thanks to @meglio 2020-12-17T2021+0100 - * @see + * @link https://wordpress.org/support/topic/add-support-for-ibid-notation/ * @since 2.2.5 options for label element and label bottom border, thanks to @markhillyer 2020-12-18T1447+0100 - * @see + * @link https://wordpress.org/support/topic/how-do-i-eliminate-the-horizontal-line-beneath-the-reference-container-heading/ * @since 2.2.10 reference container row border option, thanks to @noobishh 2020-12-25T2316+0100 - * @see + * @link https://wordpress.org/support/topic/borders-25/ * @since 2.3.0 Reference container: convert top padding to margin and make it a setting, thanks to @hamshe - * @see + * @link https://wordpress.org/support/topic/reference-container-in-elementor/#post-13786635 * @since 2.3.0 rename Priority level tab as Scope and priority 2020-12-26T2222+0100 * @since 2.3.0 swap Custom CSS migration Boolean from 'migration complete' to 'show legacy' 2020-12-27T1243+0100 * @since 2.3.0 mention op. cit. abbreviation 2020-12-28T2342+0100 * @since 2.3.0 add settings for hard links, thanks to @psykonevro and @martinneumannat 2020-12-29T1322+0100 - * @see - * @see + * @link https://wordpress.org/support/topic/making-it-amp-compatible/ + * @link https://wordpress.org/support/topic/footnotes-is-not-amp-compatible/ * @since 2.4.0 footnote shortcode syntax validation 2021-01-01T0624+0100 * @since 2.5.0 Shortcode syntax validation: add more information around the setting, thanks to @andreasra - * @see + * @link https://wordpress.org/support/topic/warning-unbalanced-footnote-start-tag-short-code-before/ */ /** @@ -94,8 +94,7 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine { * * Edited: * @since 2.1.6 tabs reordered and renamed - * @see customization vs configuration - * + * @link https://www.linkedin.com/pulse/20140610191154-4746170-configuration-vs-customization-when-and-why-would-i-implement-each * * @since 2.1.6 removed if statement around expert tab */ @@ -182,7 +181,7 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine { * Completed: * @since 2.1.4: layout and typography options 2020-11-30T0548+0100 * @since 2.2.5 options for label element and label bottom border, thanks to @markhillyer 2020-12-18T1447+0100 - * @see + * @link https://wordpress.org/support/topic/how-do-i-eliminate-the-horizontal-line-beneath-the-reference-container-heading/ */ public function ReferenceContainer() { @@ -345,14 +344,14 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine { * * Edited heading 2020-12-12T1412+0100 * @since 2.2.0 start/end short codes: more predefined options 2020-12-12T1412+0100 - * @see + * @link https://wordpress.org/support/topic/doesnt-work-with-mailpoet/ * @since 2.2.0 3 boxes for clarity 2020-12-12T1422+0100 * @since 2.2.5 support for Ibid. notation thanks to @meglio 2020-12-17T2019+0100 - * @see + * @link https://wordpress.org/support/topic/add-support-for-ibid-notation/ * @since 2.4.0 added warning about Block Editor escapement disruption 2021-01-02T2324+0100 * @since 2.4.0 removed the HTML comment tag option 2021-01-02T2325+0100 * @since 2.5.0 Shortcode syntax validation: add more information around the setting, thanks to @andreasra - * @see + * @link https://wordpress.org/support/topic/warning-unbalanced-footnote-start-tag-short-code-before/ */ public function StartEnd() { // footnotes start tag short code options: @@ -564,8 +563,8 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine { * * Edited heading 2020-12-12T1453+0100 * @since 2.1.1 more settings and notices, thanks to @nikelaos - * @see - * @see + * @link https://wordpress.org/support/topic/doesnt-work-any-more-11/#post-13687068 + * @link https://wordpress.org/support/topic/jquery-comes-up-in-feed-content/#post-13110879 * @since 2.2.0 dedicated to the excerpt setting and its notices 2020-12-12T1454+0100 */ public function Excerpts() { diff --git a/class/init.php b/class/init.php index 589e90c..006c5e0 100644 --- a/class/init.php +++ b/class/init.php @@ -7,7 +7,7 @@ * @since 1.5.0 12.09.14 10:56 * * - * @lastmodified 2021-02-08T1910+0100 + * @lastmodified 2021-02-11T0816+0100 * * @since 1.6.5 Bugfix: Improve widgets registration, 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. @@ -50,7 +50,7 @@ class MCI_Footnotes { * @contributor @felipelavinz * @link https://github.com/media-competence-institute/footnotes/commit/87173d2980c7ff90e12ffee94ca7153e11163793 * - * @see initializeWidgets() + * @see self::initializeWidgets() */ public function run() { // register language @@ -99,7 +99,7 @@ class MCI_Footnotes { * * The fix is to move add_action() above into run(), * and use the bare register_widget() here. - * @see run() + * @see self::run() * * Also, the visibility of initializeWidgets() is not private any longer. */ diff --git a/class/settings.php b/class/settings.php index 049e25a..42911f6 100644 --- a/class/settings.php +++ b/class/settings.php @@ -6,27 +6,17 @@ * @author Stefan Herndler * @since 1.5.0 14.09.14 10:43 * - * Last modified: 2021-01-12T2217+0100 * - * Edited: + * @lastmodified 2021-02-11T1130+0100 * * @since 2.0.4 restore arrow settings 2020-11-02T2115+0100 - * * @since 2.0.7 remove hook the_post 2020-11-06T1342+0100 - * * @since 2.1.0 add read-on button label customization 2020-11-08T2149+0100 - * * @since 2.1.1 fix tooltips on site by alternative 2020-11-11T1819+0100 - * * @since 2.1.1 fix disabling backlink symbol 2020-11-16T2021+0100 - * * @since 2.1.1 fix superscript by making it optional - * * @since 2.1.1 fix start pages by option to hide ref container, thanks to @dragon013 - * @link https://wordpress.org/support/topic/possible-to-hide-it-from-start-page/ - * * @since 2.1.1 fix ref container by option restoring 3-column layout - * * @since 2.1.1 fix ref container by option to switch index/symbol 2020-11-16T2022+0100 * * @since 2.1.3 excerpt hook: disable by default, thanks to @nikelaos @@ -68,28 +58,20 @@ * @since 2.4.0 footnote shortcode syntax validation 2021-01-01T0624+0100 */ - /** - * The class loads all Settings from each WordPress Settings container. - * It a Setting is not defined yet, the default value will be used. - * Each Setting will be validated and sanitized when loaded from the container. + * Loads the settings values, sets to default values if undefined. * * @author Stefan Herndler * @since 1.5.0 */ class MCI_Footnotes_Settings { - - /** - * SETTINGS CONTAINER KEY DEFINITIONS - */ - /** * Settings Container Key for the label of the reference container. * * @author Stefan Herndler * @since 1.5.0 - * @var string + * @var str */ const C_STR_REFERENCE_CONTAINER_NAME = "footnote_inputfield_references_label"; @@ -98,21 +80,28 @@ class MCI_Footnotes_Settings { * * @author Stefan Herndler * @since 1.5.0 - * @var bool + * @var str + * The string is converted to Boolean false if 'no', true if 'yes'. + * @see MCI_Footnotes_Convert::toBool() + * The type in the variable name is useful to hint the intended use + * and IMO should therefore not be changed to _STR_ + * Else: + * @todo Change misleading variable names C_BOOL_… to C_STR_… (that’s how Hungarian screws things up). + * @todo Do not convert strings to Booleans: toBool() fixes empty, or empty() must be used everywhere. */ const C_BOOL_REFERENCE_CONTAINER_COLLAPSE = "footnote_inputfield_collapse_references"; /** - * Settings Container Key for the positioning of the reference container. + * Settings Container Key for the position of the reference container. * * @author Stefan Herndler * @since 1.5.0 - * @var string + * @var str */ const C_STR_REFERENCE_CONTAINER_POSITION = "footnote_inputfield_reference_container_place"; /** - * Settings Container Key to combine identical footnotes. + * Settings Container Key for combining identical footnotes. * * @author Stefan Herndler * @since 1.5.0 @@ -121,38 +110,38 @@ class MCI_Footnotes_Settings { const C_BOOL_COMBINE_IDENTICAL_FOOTNOTES = "footnote_inputfield_combine_identical"; /** - * Settings Container Key for the start of the footnotes short code. + * Settings Container Key for the short code of the footnote’s start. * * @author Stefan Herndler * @since 1.5.0 - * @var string + * @var str */ const C_STR_FOOTNOTES_SHORT_CODE_START = "footnote_inputfield_placeholder_start"; /** - * Settings Container Key for the end of the footnotes short code. + * Settings Container Key for the short code of the footnote’s end. * * @author Stefan Herndler * @since 1.5.0 - * @var string + * @var str */ const C_STR_FOOTNOTES_SHORT_CODE_END = "footnote_inputfield_placeholder_end"; /** - * Settings Container Key for the user defined start of the footnotes short code. + * Settings Container Key for the user-defined short code of the footnotes start. * * @author Stefan Herndler * @since 1.5.0 - * @var string + * @var str */ const C_STR_FOOTNOTES_SHORT_CODE_START_USER_DEFINED = "footnote_inputfield_placeholder_start_user_defined"; /** - * Settings Container Key for the user defined end of the footnotes short code. + * Settings Container Key for the user-defined short code of the footnotes end. * * @author Stefan Herndler * @since 1.5.0 - * @var string + * @var str */ const C_STR_FOOTNOTES_SHORT_CODE_END_USER_DEFINED = "footnote_inputfield_placeholder_end_user_defined"; @@ -161,7 +150,7 @@ class MCI_Footnotes_Settings { * * @author Stefan Herndler * @since 1.5.0 - * @var string + * @var str */ const C_STR_FOOTNOTES_COUNTER_STYLE = "footnote_inputfield_counter_style"; @@ -170,7 +159,7 @@ class MCI_Footnotes_Settings { * * @author Stefan Herndler * @since 1.5.0 - * @var string + * @var str */ const C_STR_FOOTNOTES_LOVE = "footnote_inputfield_love"; @@ -179,7 +168,7 @@ class MCI_Footnotes_Settings { * * @author Stefan Herndler * @since 1.5.0 - * @var string + * @var str */ const C_BOOL_FOOTNOTES_IN_EXCERPT = "footnote_inputfield_search_in_excerpt"; @@ -188,55 +177,61 @@ class MCI_Footnotes_Settings { * * @author Stefan Herndler * @since 1.5.5 - * @var string + * @var str * - * @since 2.1.6: this setting removed as irrelevant since priority level setting is permanently visible 2020-12-09T2107+0100 + * @since 2.1.6 This setting removed as irrelevant since priority level settings need permanent visibility. + * @datetime 2020-12-09T2107+0100 */ const C_BOOL_FOOTNOTES_EXPERT_MODE = "footnote_inputfield_enable_expert_mode"; /** - * Settings Container Key for the styling before the footnotes index. + * Settings Container Key for the string before the footnote referrer. * * @author Stefan Herndler * @since 1.5.0 - * @var string + * @var str */ const C_STR_FOOTNOTES_STYLING_BEFORE = "footnote_inputfield_custom_styling_before"; /** - * Settings Container Key for the styling after the footnotes index. + * Settings Container Key for the string after the footnote referrer. * * @author Stefan Herndler * @since 1.5.0 - * @var string + * @var str */ const C_STR_FOOTNOTES_STYLING_AFTER = "footnote_inputfield_custom_styling_after"; /** - * Settings Container Key for the mouse-over box to be enabled. + * Settings Container Key to enable the mouse-over box. * * @author Stefan Herndler * @since 1.5.2 - * @var string + * @var str */ const C_BOOL_FOOTNOTES_MOUSE_OVER_BOX_ENABLED = "footnote_inputfield_custom_mouse_over_box_enabled"; /** - * Settings Container Key for alternative tooltip implementation + * Settings Container Key to enable the alternative tooltips. * - * @since 2.1.4 - * @var string + * - Bugfix: Tooltips: optional alternative JS implementation with CSS transitions to fix configuration-related outage, thanks to @andreasra feedback. * - * 2020-11-11T1817+0100 + * @since 2.1.1 + * @datetime 2020-11-11T1817+0100 + * + * @reporter @andreasra + * @link https://wordpress.org/support/topic/footnotes-appearing-in-header/page/2/#post-13632566 + * + * @var str */ const C_BOOL_FOOTNOTES_MOUSE_OVER_BOX_ALTERNATIVE = "footnote_inputfield_custom_mouse_over_box_alternative"; /** - * Settings Container Key for the mouse-over box to display only an excerpt. + * Settings Container Key to enable tooltip truncation. * * @author Stefan Herndler * @since 1.5.4 - * @var string + * @var str */ const C_BOOL_FOOTNOTES_MOUSE_OVER_BOX_EXCERPT_ENABLED = "footnote_inputfield_custom_mouse_over_box_excerpt_enabled"; @@ -245,16 +240,16 @@ class MCI_Footnotes_Settings { * * @author Stefan Herndler * @since 1.5.4 - * @var string + * @var str */ const C_INT_FOOTNOTES_MOUSE_OVER_BOX_EXCERPT_LENGTH = "footnote_inputfield_custom_mouse_over_box_excerpt_length"; /** - * Settings Container Key for the mouse-over box to define the positioning. + * Settings Container Key for the mouse-over box to define the position. * * @author Stefan Herndler * @since 1.5.7 - * @var string + * @var str */ const C_STR_FOOTNOTES_MOUSE_OVER_BOX_POSITION = "footnote_inputfield_custom_mouse_over_box_position"; @@ -263,7 +258,7 @@ class MCI_Footnotes_Settings { * * @author Stefan Herndler * @since 1.5.7 - * @var string + * @var str */ const C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_X = "footnote_inputfield_custom_mouse_over_box_offset_x"; @@ -272,7 +267,7 @@ class MCI_Footnotes_Settings { * * @author Stefan Herndler * @since 1.5.7 - * @var string + * @var str */ const C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_Y = "footnote_inputfield_custom_mouse_over_box_offset_y"; @@ -281,7 +276,7 @@ class MCI_Footnotes_Settings { * * @author Stefan Herndler * @since 1.5.6 - * @var string + * @var str */ const C_STR_FOOTNOTES_MOUSE_OVER_BOX_COLOR = "footnote_inputfield_custom_mouse_over_box_color"; @@ -290,7 +285,7 @@ class MCI_Footnotes_Settings { * * @author Stefan Herndler * @since 1.5.6 - * @var string + * @var str */ const C_STR_FOOTNOTES_MOUSE_OVER_BOX_BACKGROUND = "footnote_inputfield_custom_mouse_over_box_background"; @@ -299,7 +294,7 @@ class MCI_Footnotes_Settings { * * @author Stefan Herndler * @since 1.5.6 - * @var string + * @var str */ const C_INT_FOOTNOTES_MOUSE_OVER_BOX_BORDER_WIDTH = "footnote_inputfield_custom_mouse_over_box_border_width"; @@ -308,7 +303,7 @@ class MCI_Footnotes_Settings { * * @author Stefan Herndler * @since 1.5.6 - * @var string + * @var str */ const C_STR_FOOTNOTES_MOUSE_OVER_BOX_BORDER_COLOR = "footnote_inputfield_custom_mouse_over_box_border_color"; @@ -317,16 +312,16 @@ class MCI_Footnotes_Settings { * * @author Stefan Herndler * @since 1.5.6 - * @var string + * @var str */ const C_INT_FOOTNOTES_MOUSE_OVER_BOX_BORDER_RADIUS = "footnote_inputfield_custom_mouse_over_box_border_radius"; /** - * Settings Container Key for the mouse-over box to define the max width. + * Settings Container Key for the mouse-over box to define the max. width. * * @author Stefan Herndler * @since 1.5.6 - * @var string + * @var str */ const C_INT_FOOTNOTES_MOUSE_OVER_BOX_MAX_WIDTH = "footnote_inputfield_custom_mouse_over_box_max_width"; @@ -335,25 +330,25 @@ class MCI_Footnotes_Settings { * * @author Stefan Herndler * @since 1.5.8 - * @var string + * @var str */ const C_STR_FOOTNOTES_MOUSE_OVER_BOX_SHADOW_COLOR = "footnote_inputfield_custom_mouse_over_box_shadow_color"; /** - * Settings Container Key for the Hyperlink arrow. + * Settings Container Key for the backlink symbol selection. * * @author Stefan Herndler * @since 1.5.0 - * @var string + * @var str */ const C_STR_HYPERLINK_ARROW = "footnote_inputfield_custom_hyperlink_symbol"; /** - * Settings Container Key for the user defined Hyperlink arrow. + * Settings Container Key for the user-defined backlink symbol. * * @author Stefan Herndler * @since 1.5.0 - * @var string + * @var str */ const C_STR_HYPERLINK_ARROW_USER_DEFINED = "footnote_inputfield_custom_hyperlink_symbol_user"; @@ -362,108 +357,187 @@ class MCI_Footnotes_Settings { * * @author Stefan Herndler * @since 1.5.0 - * @var string + * @var str * - * Edited heading 2020-12-27T1233+0100 - * Edited: - * @since 2.2.2 migrate Custom CSS to a dedicated tab 2020-12-15T0520+0100 - * @var string|bool - * - * @since 2.3.0 swap Boolean from 'migration complete' to 'show legacy' 2020-12-27T1233+0100 - * The Boolean must be false if its setting is contained in the container to be hidden, - * because when saving, all missing constants are zeroed, i.e. this is set to false. + * @since 1.3.0 Adding: new settings tab for custom CSS settings. */ const C_STR_CUSTOM_CSS = "footnote_inputfield_custom_css"; + + /** + * Settings Container Key for the Custom CSS migrated to a dedicated tab. + * + * @since 2.2.2 Bugfix: Dashboard: Custom CSS: unearth text area and migrate to dedicated tab as designed. + * @datetime 2020-12-15T0520+0100 + * @var str + */ const C_STR_CUSTOM_CSS_NEW = "footnote_inputfield_custom_css_new"; + + /** + * Settings Container Key to enable display of legacy Custom CSS metaboxes. + * + * @since 2.2.2 + * @datetime 2020-12-15T0520+0100 + * @var str + * + * @since 2.3.0 swap Boolean from 'migration complete' to 'show legacy' + * @datetime 2020-12-27T1233+0100 + * + * The Boolean must be false if its setting is contained in the container to be hidden, + * because when saving, all missing constants are emptied, and toBool() converts empty to false. + */ const C_BOOL_CUSTOM_CSS_LEGACY_ENABLE = "footnote_inputfield_custom_css_legacy_enable"; /** - * Settings Container Key the activation of the_title hook. + * Settings Container Key to enable the 'the_title' hook. * * @author Stefan Herndler * @since 1.5.5 - * @var string + * @var str */ const C_BOOL_EXPERT_LOOKUP_THE_TITLE = "footnote_inputfield_expert_lookup_the_title"; /** - * Settings Container Key the activation of the_content hook. + * Settings Container Key to enable the 'the_content' hook. * * @author Stefan Herndler * @since 1.5.5 - * @var string + * @var str */ const C_BOOL_EXPERT_LOOKUP_THE_CONTENT = "footnote_inputfield_expert_lookup_the_content"; /** - * Settings Container Key the activation of the_excerpt hook. + * Settings Container Key to enable the 'the_excerpt' hook. * * @author Stefan Herndler * @since 1.5.5 - * @var string + * @var str */ const C_BOOL_EXPERT_LOOKUP_THE_EXCERPT = "footnote_inputfield_expert_lookup_the_excerpt"; /** - * Settings Container Key the activation of widget_title hook. + * Settings Container Key to enable the 'widget_title' hook. * * @author Stefan Herndler * @since 1.5.5 - * @var string + * @var str */ const C_BOOL_EXPERT_LOOKUP_WIDGET_TITLE = "footnote_inputfield_expert_lookup_widget_title"; /** - * Settings Container Key the activation of widget_text hook. + * Settings Container Key to enable the 'widget_text' hook. * * @author Stefan Herndler * @since 1.5.5 - * @var string + * @var str */ const C_BOOL_EXPERT_LOOKUP_WIDGET_TEXT = "footnote_inputfield_expert_lookup_widget_text"; /** - * Settings Container Key for the label of the 'Read on' button in truncated tooltips + * Settings Container Key for the label of the Read-on button in truncated tooltips. + * + * - Adding: Tooltips: Read-on button: Label: configurable instead of localizable, thanks to @rovanov example provision. * * @since 2.1.0 - * @var string + * @datetime 2020-11-08T2106+0100 * - * 2020-11-08T2106+0100 + * @reporter @rovanov + * @link https://wordpress.org/support/topic/offset-x-axis-and-offset-y-axis-does-not-working/ + * + * @var str */ const C_STR_FOOTNOTES_TOOLTIP_READON_LABEL = "footnote_inputfield_readon_label"; /** - * Settings Container Keys for options fixing default layout + * Settings Container Key for the referrer element. + * + * - Bugfix: Referrers: new setting for vertical align: superscript (default) or baseline (optional), thanks to @cwbayer bug report. * * @since 2.1.1 - * @var string + * @datetime 2020-11-16T0859+0100 * - * 2020-11-16T0859+0100 - * - * option to enable/disable the superscript element for referrers, thanks to @cwbayer + * @reporter @cwbayer * @link https://wordpress.org/support/topic/footnote-number-in-text-superscript-disrupts-leading/ + * + * @var str */ const C_BOOL_FOOTNOTES_REFERRER_SUPERSCRIPT_TAGS = "footnotes_inputfield_referrer_superscript_tags"; + + /** + * Settings Container Key to enable the display of a backlink symbol. + * + * - 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 + * + * @var str + */ const C_BOOL_REFERENCE_CONTAINER_BACKLINK_SYMBOL_ENABLE = "footnotes_inputfield_reference_container_backlink_symbol_enable"; + + /** + * Settings Container Key to not display the reference container on the homepage. + * + * - Bugfix: Reference container: fix start pages by making its display optional, thanks to @dragon013 bug report. + * + * @since 2.1.1 + * + * @reporter @dragon013 + * @link https://wordpress.org/support/topic/possible-to-hide-it-from-start-page/ + * + * @var str + */ const C_BOOL_REFERENCE_CONTAINER_START_PAGE_ENABLE = "footnotes_inputfield_reference_container_start_page_enable"; + + /** + * Settings Container Key to enable the legacy layout of the reference container. + * + * - Bugfix: Reference container: option to restore pre-2.0.0 layout with the backlink symbol in an extra column. + * + * @since 2.1.1 + * + * @var str + */ const C_BOOL_REFERENCE_CONTAINER_3COLUMN_LAYOUT_ENABLE = "footnotes_inputfield_reference_container_3column_layout_enable"; + + /** + * Settings Container Key to get the backlink symbol switch side. + * + * - Bugfix: Reference container: option to append symbol (prepended by default), thanks to @spaceling code contribution. + * + * @since 2.1.1 + * @datetime 2020-11-16T2024+0100 + * + * @contributor @spaceling + * @link https://wordpress.org/support/topic/change-the-position-5/#post-13615994 + * + * @var str + */ const C_BOOL_REFERENCE_CONTAINER_BACKLINK_SYMBOL_SWITCH = "footnotes_inputfield_reference_container_backlink_symbol_switch"; /** - * Settings Container Keys for hook priority levels + * Settings Container Key for 'the_content' hook priority level. + * + * @since 2.1.1 + * @datetime 2020-11-16T0859+0100 + * + * @var str + */ + const C_INT_EXPERT_LOOKUP_THE_CONTENT_PRIORITY_LEVEL = "footnote_inputfield_expert_lookup_the_content_priority_level"; + + /** + * Settings Container Key for '' hook priority level * - * @since 2.1.1 (the_content) * @since 2.1.2 - * @var string + * @datetime 2020-11-20T0620+0100 * - * 2020-11-16T0859+0100 - * 2020-11-20T0620+0100 + * @var str */ const C_INT_EXPERT_LOOKUP_THE_TITLE_PRIORITY_LEVEL = "footnote_inputfield_expert_lookup_the_title_priority_level"; - const C_INT_EXPERT_LOOKUP_THE_CONTENT_PRIORITY_LEVEL = "footnote_inputfield_expert_lookup_the_content_priority_level"; - const C_INT_EXPERT_LOOKUP_THE_EXCERPT_PRIORITY_LEVEL = "footnote_inputfield_expert_lookup_the_excerpt_priority_level"; const C_INT_EXPERT_LOOKUP_WIDGET_TITLE_PRIORITY_LEVEL = "footnote_inputfield_expert_lookup_widget_title_priority_level"; const C_INT_EXPERT_LOOKUP_WIDGET_TEXT_PRIORITY_LEVEL = "footnote_inputfield_expert_lookup_widget_text_priority_level"; + const C_INT_EXPERT_LOOKUP_THE_EXCERPT_PRIORITY_LEVEL = "footnote_inputfield_expert_lookup_the_excerpt_priority_level"; /** * Settings Container Keys for the link element option @@ -474,7 +548,7 @@ class MCI_Footnotes_Settings { * Settings Container Keys for tooltip display durations * * @since 2.1.4 - * @var string|bool|int|flo + * @var str|bool|int|flo * * 2020-11-26T1002+0100 * 2020-11-30T0427+0100 @@ -511,6 +585,15 @@ class MCI_Footnotes_Settings { // page layout support: const C_STR_FOOTNOTES_PAGE_LAYOUT_SUPPORT = "footnotes_inputfield_page_layout_support"; + /** + * Scroll offset and duration + * + * - 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. + * + * @since 2.1.4 + * @datetime 2020-12-05T0538+0100 + */ // scroll offset and duration: const C_INT_FOOTNOTES_SCROLL_OFFSET = "footnotes_inputfield_scroll_offset"; const C_INT_FOOTNOTES_SCROLL_DURATION = "footnotes_inputfield_scroll_duration"; @@ -539,7 +622,7 @@ class MCI_Footnotes_Settings { * Settings Container Key for reference container position shortcode * * @since 2.2.0 - * @var string + * @var str * * 2020-12-13T2056+0100 */ @@ -707,7 +790,7 @@ class MCI_Footnotes_Settings { self::C_INT_BACKLINKS_COLUMN_WIDTH_SCALAR => '50', self::C_STR_BACKLINKS_COLUMN_WIDTH_UNIT => 'px', - // set backlinks column max width: + // set backlinks column max. width: self::C_BOOL_BACKLINKS_COLUMN_MAX_WIDTH_ENABLED => 'no', self::C_INT_BACKLINKS_COLUMN_MAX_WIDTH_SCALAR => '140', self::C_STR_BACKLINKS_COLUMN_MAX_WIDTH_UNIT => 'px', @@ -910,7 +993,7 @@ class MCI_Footnotes_Settings { * @author Stefan Herndler * @since 1.5.0 * @param int $p_int_Index Settings Container Array Key Index. - * @return string Settings Container name. + * @return str Settings Container name. */ public function getContainer($p_int_Index) { return $this->a_arr_Container[$p_int_Index]; diff --git a/class/task.php b/class/task.php index 79a0a3d..2947f65 100644 --- a/class/task.php +++ b/class/task.php @@ -7,34 +7,37 @@ * @since 1.5.0 * * - * @lastmodified 2021-02-10T0027+0100 + * @lastmodified 2021-02-11T0817+0100 * * @since 2.0.0 Bugfix: various. * @since 2.0.5 Bugfix: Reference container: fix relative position through priority level, thanks to @june01 @imeson @spaceling bug reports, thanks to @spaceling code contribution. * @since 2.0.5 Update: Hooks: Default-enable all hooks to prevent footnotes from seeming broken in some parts. * @since 2.0.6 Bugfix: Infinite scroll: debug autoload by adding post ID, thanks to @docteurfitness code contribution. * @since 2.0.6 Bugfix: Priority level back to PHP_INT_MAX (ref container positioning not this plugin’s responsibility). + * @since 2.0.6 Bugfix: Reference container: fix line breaking behavior in footnote number clusters. * @since 2.0.7 BUGFIX: Hooks: Default-disable 'the_post', thanks to @spaceling @@markcheret @nyamachi @whichgodsaves @spiralofhope2 @mmallett @andreasra @widecast @ymorin007 @tashi1es bug reports. * @since 2.0.9 Bugfix: Remove the_post hook 2020-11-08T1839+0100. - * @since 2.1.0 Adding: Tooltips: Read-on button: Label: configurable instead of localizable. + * @since 2.1.0 Adding: Tooltips: Read-on button: Label: configurable instead of localizable, thanks to @rovanov example provision. * @since 2.1.1 Bugfix: Referrers, reference container: Combining identical footnotes: fix dead links and ensure referrer-backlink bijectivity, thanks to @happyches 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 Bugfix: Referrers: new setting for vertical align: superscript (default) or baseline (optional), thanks to @cwbayer 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.1 Bugfix: Tooltips: optional alternative JS implementation with CSS transitions to fix configuration-related outage, thanks to @andreasra feedback. + * @since 2.1.1 Bugfix: Reference container: option to restore pre-2.0.0 layout with the backlink symbol in an extra column. * @since 2.1.2 Bugfix: Dashboard: priority level settings for all other hooks, thanks to @nikelaos bug report. + * @since 2.1.3 Bugfix: Reference container: fix width in mobile view by URL wrapping for Unicode-non-conformant browsers, thanks to @karolszakiel bug report. * @since 2.1.4 Bugfix: Styling: Referrers and backlinks: make link elements optional to fix issues. * @since 2.1.4 Bugfix: Reference container: Backlink symbol: support for appending when combining identicals is on. - * @since 2.1.4 Bugfix: Reference container: make separating and terminating punctuation optional and configurable. + * @since 2.1.4 Bugfix: Reference container: make separating and terminating punctuation optional and configurable, thanks to @docteurfitness issue report and code contribution. * @since 2.1.4 Bugfix: Reference container: Backlinks: fix stacked enumerations by adding optional line breaks. * @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. * @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. * @since 2.1.4 Bugfix: Tooltips: make display delays and fade durations configurable to conform to website style. - * @since 2.1.4 Bugfix: Referrers and backlinks: Styling: make link elements optional to fix issues. + * @since 2.1.4 Bugfix: Referrers and backlinks: Styling: make link elements optional to fix issues, thanks to @docteurfitness issue report and code contribution. * @since 2.1.4 Bugfix: Reference container, tooltips: fix line wrapping of URLs (hyperlinked or not) 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 Bugfix: Reference container: Backlinks: fix line breaking with respect to separators and terminators. @@ -64,19 +67,22 @@ * @since 2.4.0 Bugfix: Templates: optimize template load and processing based on settings, thanks to @misfist code contribution. * @since 2.4.0 Bugfix: Process: initialize hard link address variables to empty string to fix 'undefined variable' bug, thanks to @a223123131 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.0 Bugfix: Footnote delimiter syntax validation: exclude certain cases involving scripts, thanks to @andreasra bug report. - * @since 2.5.0 Bugfix: Footnote delimiter syntax validation: complete message with hint about setting, thanks to @andreasra bug report. - * @since 2.5.0 Bugfix: Footnote delimiter syntax validation: limit length of quoted string to 300 characters, thanks to @andreasra bug report. + * @since 2.5.0 Bugfix: Footnote delimiters: Syntax validation: exclude certain cases involving scripts, thanks to @andreasra bug report. + * @since 2.5.0 Bugfix: Footnote delimiters: Syntax validation: complete message with hint about setting, thanks to @andreasra bug report. + * @since 2.5.0 Bugfix: Footnote delimiters: Syntax validation: limit length of quoted string to 300 characters, thanks to @andreasra bug report. * @since 2.5.1 Bugfix: Hooks: support footnotes in Popup Maker popups, thanks to @squatcher bug report. * @since 2.5.2 Update: Tooltips: ability to display dedicated content before `[[/tooltip]]`, thanks to @jbj2199 issue report. * @since 2.5.3 Bugfix: Reference container, tooltips: URL wrap: exclude URL pattern as folder name in Wayback Machine URL, thanks to @rumperuu bug report. + * @since 2.5.4 Bugfix: Reference container, tooltips: URL wrap: account for leading space in value, thanks to @karolszakiel example provision. + * @since 2.5.4 Bugfix: Tooltips: fix display in Popup Maker popups by correcting a coding error. */ // If called directly, abort: defined( 'ABSPATH' ) or die; /** - * Looks for Footnotes short codes and replaces them. Also displays the Reference Container. + * Searches and replaces the footnotes. + * Generates the reference container. * * @author Stefan Herndler * @since 1.5.0 @@ -167,7 +173,7 @@ class MCI_Footnotes_Task { * @link https://github.com/misfist/footnotes/releases/tag/2.4.0d3 repository * @link https://github.com/misfist/footnotes/compare/2.4.0%E2%80%A62.4.0d3 diff * - * @var bool from DB + * @var bool false; depend on settings * * Streamline process depending on tooltip enabled status. * Load tooltip inline script only if jQuery tooltips are enabled. @@ -207,6 +213,12 @@ class MCI_Footnotes_Task { /** * Scroll offset * + * - Bugfix: Scroll offset: make configurable to fix site-dependent issues related to fixed headers. + * + * @since 2.1.4 + * @datetime 2020-12-05T0538+0100 + * + * * - Bugfix: Scroll offset: initialize to safer one third window height for more robustness, thanks to @lukashuggenberg bug report. * * @since 2.4.0 @@ -227,25 +239,29 @@ class MCI_Footnotes_Task { /** * Optional link element for footnote referrers and backlinks * - * @var str - * * @since 2.0.0 add link elements with hard links * @since 2.0.4 remove hard links on user request * @link https://wordpress.org/support/topic/hyperlinked-footnotes-creating-excessive-back-history/ * * - * - Bugfix: Styling: Referrers and backlinks: make link elements optional to fix issues. + * - Bugfix: Referrers and backlinks: Styling: make link elements optional to fix issues, thanks to @docteurfitness issue report and code contribution. * * @since 2.1.4 * @datetime 2020-11-25T1306+0100 * @datetime 2020-11-26T1051+0100 * + * @contributor @docteurfitness + * @link https://wordpress.org/support/topic/update-2-1-3/#post-13704194 + * + * @reporter @docteurfitness + * @link https://wordpress.org/support/topic/update-2-1-3/ + * * * - Adding: Referrers and backlinks: optional hard links for AMP compatibility, thanks to @psykonevro bug report, thanks to @martinneumannat code contribution. * * @since 2.3.0 * @datetime 2020-12-30T2313+0100 - * @see $a_bool_HardLinksEnable + * @see self::$a_bool_HardLinksEnable * * # Styling * @@ -266,11 +282,7 @@ class MCI_Footnotes_Task { * * Link elements also raise further concerns, so that their useless proliferation needs * to be mitigated. By contrast, due to an insufficiency in the CSS standard, real link - * elements are required to get the link color, as opposed to named colors on the basis - * of the already supported pseudo-classes :link, :hover, :active and :visited that can - * still not be used in color names. - * - * + * elements are required to get the link color, as oppose * this variable keeps its default value if hard links are disabled */ public static $a_str_LinkSpan = 'span'; @@ -574,7 +586,7 @@ class MCI_Footnotes_Task { } /** - * Referernce container top and bottom margins + * Reference container top and bottom margins * * - Bugfix: Reference container: convert top padding to margin and make it a setting, thanks to @hamshe bug report. * @@ -850,7 +862,18 @@ class MCI_Footnotes_Task { // insert end tag without switching out of PHP: echo "\r\n\r\n"; - // alternative tooltip script printed formatted not minified: + /** + * Alternative tooltip implementation relying on plain JS and CSS transitions. + * + * - Bugfix: Tooltips: optional alternative JS implementation with CSS transitions to fix configuration-related outage, thanks to @andreasra feedback. + * + * @since 2.1.1 + * + * @reporter @andreasra + * @link https://wordpress.org/support/topic/footnotes-appearing-in-header/page/2/#post-13632566 + * + * Alternative tooltip script: printed formatted, not minified: + */ if ( self::$a_bool_AlternativeTooltipsEnabled ) { ?>