Merge pull request #70 from markcheret/svn-update

Sync with changes made directly to SVN repo.
This commit is contained in:
Mark Cheret 2021-04-10 22:57:46 +02:00 committed by GitHub
commit cdb4dc0fea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
54 changed files with 5538 additions and 1461 deletions

View file

@ -211,7 +211,7 @@ abstract class MCI_Footnotes_Layout_Engine {
* automated update of version number for cache busting.
* No need to use '-styles' in the handle, as '-css' is appended automatically.
*/
if ( C_BOOL_CSS_PRODUCTION_MODE === true ) {
if ( C_BOOL_CSS_PRODUCTION_MODE ) {
wp_register_style(
'mci-footnotes-admin',
@ -232,7 +232,7 @@ abstract class MCI_Footnotes_Layout_Engine {
array(),
filemtime(
plugin_dir_path(
dirname( __FILE__ )
dirname( __FILE__, 2 )
) . 'css/settings.css'
)
);

View file

@ -121,7 +121,7 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_Layout_Engine {
*
* @since 2.0.4 to reflect changes in meta box label display since WPv5.5
* spans need position:fixed and become unlocalizable
* fix: logo is kept only in the label that doesnt need to be translated:
* fix: logo is kept only in the label that doesn’t need to be translated:
* Change string "%s styling" to "Footnotes styling" to fix layout in WPv5.5
* @see details in class/config.php
*
@ -130,16 +130,18 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_Layout_Engine {
protected function get_meta_boxes() {
$l_arr_meta_boxes = array();
// Sync box name with mirror in task.php.
$l_arr_meta_boxes[] = $this->add_meta_box( 'settings', 'amp-compat', __( 'AMP compatibility', 'footnotes' ), 'amp_compat' );
$l_arr_meta_boxes[] = $this->add_meta_box( 'settings', 'start-end', __( 'Footnote start and end short codes', 'footnotes' ), 'start_end' );
$l_arr_meta_boxes[] = $this->add_meta_box( 'settings', 'numbering', __( 'Footnotes numbering', 'footnotes' ), 'Numbering' );
$l_arr_meta_boxes[] = $this->add_meta_box( 'settings', 'scrolling', __( 'Scrolling behavior', 'footnotes' ), 'Scrolling' );
$l_arr_meta_boxes[] = $this->add_meta_box( 'settings', 'numbering', __( 'Footnotes numbering', 'footnotes' ), 'numbering' );
$l_arr_meta_boxes[] = $this->add_meta_box( 'settings', 'scrolling', __( 'Scrolling behavior', 'footnotes' ), 'scrolling' );
$l_arr_meta_boxes[] = $this->add_meta_box( 'settings', 'hard-links', __( 'URL fragment ID configuration', 'footnotes' ), 'hard_links' );
$l_arr_meta_boxes[] = $this->add_meta_box( 'settings', 'reference-container', __( 'Reference container', 'footnotes' ), 'reference_container' );
$l_arr_meta_boxes[] = $this->add_meta_box( 'settings', 'excerpts', __( 'Footnotes in excerpts', 'footnotes' ), 'excerpts' );
$l_arr_meta_boxes[] = $this->add_meta_box( 'settings', 'love', MCI_Footnotes_Config::C_STR_PLUGIN_HEADING_NAME . ' ' . MCI_Footnotes_Config::C_STR_LOVE_SYMBOL_HEADING, 'Love' );
$l_arr_meta_boxes[] = $this->add_meta_box( 'settings', 'love', MCI_Footnotes_Config::C_STR_PLUGIN_HEADING_NAME . ' ' . MCI_Footnotes_Config::C_STR_LOVE_SYMBOL_HEADING, 'love' );
$l_arr_meta_boxes[] = $this->add_meta_box( 'customize', 'hyperlink-arrow', __( 'Backlink symbol', 'footnotes' ), 'hyperlink_arrow' );
$l_arr_meta_boxes[] = $this->add_meta_box( 'customize', 'superscript', __( 'Referrer typesetting and formatting', 'footnotes' ), 'superscript' );
$l_arr_meta_boxes[] = $this->add_meta_box( 'customize', 'superscript', __( 'Referrers', 'footnotes' ), 'superscript' );
$l_arr_meta_boxes[] = $this->add_meta_box( 'customize', 'label-solution', __( 'Referrers in labels', 'footnotes' ), 'label_solution' );
$l_arr_meta_boxes[] = $this->add_meta_box( 'customize', 'mouse-over-box', __( 'Tooltips', 'footnotes' ), 'mouseover_box' );
$l_arr_meta_boxes[] = $this->add_meta_box( 'customize', 'mouse-over-box-position', __( 'Tooltip position', 'footnotes' ), 'mouseover_box_position' );
$l_arr_meta_boxes[] = $this->add_meta_box( 'customize', 'mouse-over-box-dimensions', __( 'Tooltip dimensions', 'footnotes' ), 'mouseover_box_dimensions' );
@ -164,6 +166,34 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_Layout_Engine {
return $l_arr_meta_boxes;
}
/**
* Displays the AMP compatibility mode option.
*
* @since 2.5.11 (draft)
* @since 2.6.0 (release)
*/
public function amp_compat() {
// Load template file.
$l_obj_template = new MCI_Footnotes_Template( MCI_Footnotes_Template::C_STR_DASHBOARD, 'settings-amp' );
// Replace all placeholders.
$l_obj_template->replace(
array(
// Translators: '%s' is the link text 'AMP-WP' linked to the plugin’s front page on WordPress.org.
'description-1-amp' => sprintf( __( 'The official %s plugin is required when this option is enabled.', 'footnotes' ), '<a href="https://wordpress.org/plugins/amp/" target="_blank" style="font-style: normal;">AMP-WP</a>' ),
'label-amp' => $this->add_label( MCI_Footnotes_Settings::C_STR_FOOTNOTES_AMP_COMPATIBILITY_ENABLE, __( 'Enable AMP compatibility mode:', 'footnotes' ) ),
'amp' => $this->add_checkbox( MCI_Footnotes_Settings::C_STR_FOOTNOTES_AMP_COMPATIBILITY_ENABLE ),
'notice-amp' => __( 'This option enables hard links with configurable scroll offset in % viewport height.', 'footnotes' ),
// Translators: '%s' is the logogram of the 'Footnotes' plugin.
'description-2-amp' => sprintf( __( '%s is becoming AMP compatible when this box is checked. Styled tooltips are displayed with fade-in/fade-out effect if enabled, and the reference container expands also on clicking a referrer if it’s collapsed by default.', 'footnotes' ), '<span style="font-style: normal;">' . MCI_Footnotes_Config::C_STR_PLUGIN_PUBLIC_NAME . '</span>' ),
)
);
// Display template with replaced placeholders.
// phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
echo $l_obj_template->get_content();
// phpcs:enable
}
/**
* Displays all settings for the reference container.
*
@ -207,7 +237,7 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_Layout_Engine {
);
// Options for the terminating punctuation after backlinks.
// The Unicode name of RIGHT PARENTHESIS was originally more accurate because.
// This character is bidi-mirrored. Lets use the Unicode 1.0 name.
// This character is bidi-mirrored. Let’s use the Unicode 1.0 name.
// The wrong names were enforced in spite of Unicode, that subsequently scrambled to correct.
$l_arr_terminators = array(
'period' => __( 'FULL STOP', 'footnotes' ),
@ -242,7 +272,7 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_Layout_Engine {
'label-name' => $this->add_label( MCI_Footnotes_Settings::C_STR_REFERENCE_CONTAINER_NAME, __( 'Heading:', 'footnotes' ) ),
'name' => $this->add_text_box( MCI_Footnotes_Settings::C_STR_REFERENCE_CONTAINER_NAME ),
'label-element' => $this->add_label( MCI_Footnotes_Settings::C_STR_REFERENCE_CONTAINER_LABEL_ELEMENT, __( 'Headings HTML element:', 'footnotes' ) ),
'label-element' => $this->add_label( MCI_Footnotes_Settings::C_STR_REFERENCE_CONTAINER_LABEL_ELEMENT, __( 'Heading’s HTML element:', 'footnotes' ) ),
'element' => $this->add_select_box( MCI_Footnotes_Settings::C_STR_REFERENCE_CONTAINER_LABEL_ELEMENT, $l_arr_label_element ),
'label-border' => $this->add_label( MCI_Footnotes_Settings::C_STR_REFERENCE_CONTAINER_LABEL_BOTTOM_BORDER, __( 'Border under the heading:', 'footnotes' ) ),
@ -253,7 +283,7 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_Layout_Engine {
'label-script' => $this->add_label( MCI_Footnotes_Settings::C_STR_FOOTNOTES_REFERENCE_CONTAINER_SCRIPT_MODE, __( 'Script mode:', 'footnotes' ) ),
'script' => $this->add_select_box( MCI_Footnotes_Settings::C_STR_FOOTNOTES_REFERENCE_CONTAINER_SCRIPT_MODE, $l_arr_script_mode ),
'notice-script' => __( 'The plain JavaScript mode does not support scroll animation and will enable hard links with scroll offset.', 'footnotes' ),
'notice-script' => __( 'The plain JavaScript mode will enable hard links with configurable scroll offset.', 'footnotes' ),
'label-position' => $this->add_label( MCI_Footnotes_Settings::C_STR_REFERENCE_CONTAINER_POSITION, __( 'Default position:', 'footnotes' ) ),
'position' => $this->add_select_box( MCI_Footnotes_Settings::C_STR_REFERENCE_CONTAINER_POSITION, $l_arr_positions ),
@ -277,11 +307,11 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_Layout_Engine {
'label-page-layout' => $this->add_label( MCI_Footnotes_Settings::C_STR_FOOTNOTES_PAGE_LAYOUT_SUPPORT, __( 'Apply basic responsive page layout:', 'footnotes' ) ),
'page-layout' => $this->add_select_box( MCI_Footnotes_Settings::C_STR_FOOTNOTES_PAGE_LAYOUT_SUPPORT, $l_arr_page_layout_options ),
'notice-page-layout' => __( 'Most themes dont need this fix.', 'footnotes' ),
'notice-page-layout' => __( 'Most themes don’t need this fix.', 'footnotes' ),
'label-url-wrap' => $this->add_label( MCI_Footnotes_Settings::C_STR_FOOTNOTE_URL_WRAP_ENABLED, __( 'Allow URLs to line-wrap anywhere:', 'footnotes' ) ),
'url-wrap' => $this->add_select_box( MCI_Footnotes_Settings::C_STR_FOOTNOTE_URL_WRAP_ENABLED, $l_arr_enabled ),
'notice-url-wrap' => __( 'Unicode-conformant browsers dont need this fix.', 'footnotes' ),
'notice-url-wrap' => __( 'Unicode-conformant browsers don’t need this fix.', 'footnotes' ),
'label-symbol' => $this->add_label( MCI_Footnotes_Settings::C_STR_REFERENCE_CONTAINER_BACKLINK_SYMBOL_ENABLE, __( 'Display a backlink symbol:', 'footnotes' ) ),
'symbol-enable' => $this->add_select_box( MCI_Footnotes_Settings::C_STR_REFERENCE_CONTAINER_BACKLINK_SYMBOL_ENABLE, $l_arr_enabled ),
@ -313,13 +343,13 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_Layout_Engine {
'width-enable' => $this->add_select_box( MCI_Footnotes_Settings::C_STR_BACKLINKS_COLUMN_WIDTH_ENABLED, $l_arr_enabled ),
'width-scalar' => $this->add_num_box( MCI_Footnotes_Settings::C_INT_BACKLINKS_COLUMN_WIDTH_SCALAR, 0, 500, true ),
'width-unit' => $this->add_select_box( MCI_Footnotes_Settings::C_STR_BACKLINKS_COLUMN_WIDTH_UNIT, $l_arr_width_units ),
'notice-width' => __( 'Absolute width in pixels doesnt need to be accurate to the tenth, but relative width in rem or em may.', 'footnotes' ),
'notice-width' => __( 'Absolute width in pixels doesn’t need to be accurate to the tenth, but relative width in rem or em may.', 'footnotes' ),
'label-max-width' => $this->add_label( MCI_Footnotes_Settings::C_STR_BACKLINKS_COLUMN_MAX_WIDTH_ENABLED, __( 'Set backlinks column maximum width:', 'footnotes' ) ),
'max-width-enable' => $this->add_select_box( MCI_Footnotes_Settings::C_STR_BACKLINKS_COLUMN_MAX_WIDTH_ENABLED, $l_arr_enabled ),
'max-width-scalar' => $this->add_num_box( MCI_Footnotes_Settings::C_INT_BACKLINKS_COLUMN_MAX_WIDTH_SCALAR, 0, 500, true ),
'max-width-unit' => $this->add_select_box( MCI_Footnotes_Settings::C_STR_BACKLINKS_COLUMN_MAX_WIDTH_UNIT, $l_arr_width_units ),
'notice-max-width' => __( 'Absolute width in pixels doesnt need to be accurate to the tenth, but relative width in rem or em may.', 'footnotes' ),
'notice-max-width' => __( 'Absolute width in pixels doesn’t need to be accurate to the tenth, but relative width in rem or em may.', 'footnotes' ),
'label-line-break' => $this->add_label( MCI_Footnotes_Settings::C_STR_BACKLINKS_LINE_BREAKS_ENABLED, __( 'Stack backlinks when enumerating:', 'footnotes' ) ),
'line-break' => $this->add_select_box( MCI_Footnotes_Settings::C_STR_BACKLINKS_LINE_BREAKS_ENABLED, $l_arr_enabled ),
@ -327,7 +357,7 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_Layout_Engine {
'label-link' => $this->add_label( MCI_Footnotes_Settings::C_STR_LINK_ELEMENT_ENABLED, __( 'Use the link element for referrers and backlinks:', 'footnotes' ) ),
'link' => $this->add_select_box( MCI_Footnotes_Settings::C_STR_LINK_ELEMENT_ENABLED, $l_arr_enabled ),
'notice-link' => __( 'The link element is needed to apply the themes link color.', 'footnotes' ),
'notice-link' => __( 'The link element is needed to apply the theme’s link color.', 'footnotes' ),
'description-link' => __( 'If the link element is not desired for styling, a simple span is used instead when the above is set to No. The link addresses have been removed. Else footnote clicks are logged in the browsing history and make the back button unusable.', 'footnotes' ),
)
);
@ -393,8 +423,8 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_Layout_Engine {
// Replace all placeholders.
$l_obj_template->replace(
array(
'description-escapement' => __( 'WARNING: Short codes with closing pointy brackets are disabled in the new WordPress Block Editor that disrupts the traditional balanced escapement applied by WordPress Classic Editor.', 'footnotes' ),
// Translators: The 2 placeholders are the &lt;ref&gt;&lt;/ref&gt; and &lt;fn&gt;&lt;/fn&gt; shortcodes.
'description-escapement' => sprintf( __( 'The problems with shortcodes with pointy brackets have been solved. We apologize for the longlasting bugs making the %1$s and %2$s shortcodes close to unusable.', 'footnotes' ), '&lt;ref&gt;&lt;/ref&gt;', '&lt;fn&gt;&lt;/fn&gt;' ),
'label-short-code-start' => $this->add_label( MCI_Footnotes_Settings::C_STR_FOOTNOTES_SHORT_CODE_START, __( 'Footnote start tag short code:', 'footnotes' ) ),
'short-code-start' => $this->add_select_box( MCI_Footnotes_Settings::C_STR_FOOTNOTES_SHORT_CODE_START, $l_arr_shortcode_start ),
@ -417,7 +447,7 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_Layout_Engine {
'syntax' => $this->add_select_box( MCI_Footnotes_Settings::C_STR_FOOTNOTE_SHORTCODE_SYNTAX_VALIDATION_ENABLE, $l_arr_enable ),
'notice-syntax' => __( 'In the presence of a lone start tag shortcode, a warning displays below the post title.', 'footnotes' ),
'description-syntax' => __( 'If the start tag short code is (( or (((, it will not be reported as unbalanced if the following string contains braces hinting that it is a script.', 'footnotes' ),
'description-syntax' => __( 'If the start tag short code is ‘((’ or ‘(((’, it will not be reported as unbalanced if the following string contains braces hinting that it is a script.', 'footnotes' ),
)
);
// Display template with replaced placeholders.
@ -441,12 +471,12 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_Layout_Engine {
);
// Options for the numbering style of the footnotes.
$l_arr_counter_style = array(
'arabic_plain' => __( 'plain Arabic numbers', 'footnotes' ) . $l_str_space . '1, 2, 3, 4, 5, ',
'arabic_leading' => __( 'zero-padded Arabic numbers', 'footnotes' ) . $l_str_space . '01, 02, 03, 04, 05, ',
'latin_low' => __( 'lowercase Latin letters', 'footnotes' ) . $l_str_space . 'a, b, c, d, e, ',
'latin_high' => __( 'uppercase Latin letters', 'footnotes' ) . $l_str_space . 'A, B, C, D, E, ',
'romanic' => __( 'uppercase Roman numerals', 'footnotes' ) . $l_str_space . 'I, II, III, IV, V, ',
'roman_low' => __( 'lowercase Roman numerals', 'footnotes' ) . $l_str_space . 'i, ii, iii, iv, v, ',
'arabic_plain' => __( 'plain Arabic numbers', 'footnotes' ) . $l_str_space . '1, 2, 3, 4, 5, …',
'arabic_leading' => __( 'zero-padded Arabic numbers', 'footnotes' ) . $l_str_space . '01, 02, 03, 04, 05, …',
'latin_low' => __( 'lowercase Latin letters', 'footnotes' ) . $l_str_space . 'a, b, c, d, e, …',
'latin_high' => __( 'uppercase Latin letters', 'footnotes' ) . $l_str_space . 'A, B, C, D, E, …',
'romanic' => __( 'uppercase Roman numerals', 'footnotes' ) . $l_str_space . 'I, II, III, IV, V, …',
'roman_low' => __( 'lowercase Roman numerals', 'footnotes' ) . $l_str_space . 'i, ii, iii, iv, v, …',
);
// Load template file.
@ -478,7 +508,7 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_Layout_Engine {
*/
public function scrolling() {
// Options for enabling hard links for AMP compat.
// Options for enabling scroll duration asymmetricity.
$l_arr_enable = array(
'yes' => __( 'Yes', 'footnotes' ),
'no' => __( 'No', 'footnotes' ),
@ -490,18 +520,66 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_Layout_Engine {
$l_obj_template->replace(
array(
'label-scroll-css' => $this->add_label( MCI_Footnotes_Settings::C_STR_FOOTNOTES_CSS_SMOOTH_SCROLLING, __( 'CSS-based smooth scrolling:', 'footnotes' ) ),
'scroll-css' => $this->add_select_box( MCI_Footnotes_Settings::C_STR_FOOTNOTES_CSS_SMOOTH_SCROLLING, $l_arr_enable ),
'notice-scroll-css' => __( 'May slightly disturb jQuery scrolling and is therefore disabled by default. Works in recent browsers.', 'footnotes' ),
'label-scroll-offset' => $this->add_label( MCI_Footnotes_Settings::C_INT_FOOTNOTES_SCROLL_OFFSET, __( 'Scroll offset:', 'footnotes' ) ),
'scroll-offset' => $this->add_num_box( MCI_Footnotes_Settings::C_INT_FOOTNOTES_SCROLL_OFFSET, 0, 100 ),
'notice-scroll-offset' => __( 'per cent from the upper edge of the window', 'footnotes' ),
'notice-scroll-offset' => __( 'per cent viewport height from the upper edge', 'footnotes' ),
'label-scroll-duration' => $this->add_label( MCI_Footnotes_Settings::C_INT_FOOTNOTES_SCROLL_DURATION, __( 'Scroll duration:', 'footnotes' ) ),
'scroll-duration' => $this->add_num_box( MCI_Footnotes_Settings::C_INT_FOOTNOTES_SCROLL_DURATION, 0, 20000 ),
'notice-scroll-duration' => __( 'milliseconds; instantly if hard links are enabled and JavaScript is disabled', 'footnotes' ),
'notice-scroll-duration' => __( 'milliseconds. If asymmetric scroll durations are enabled, this is the scroll-up duration.', 'footnotes' ),
// Enable scroll duration asymmetricity.
'label-scroll-asymmetricity' => $this->add_label( MCI_Footnotes_Settings::C_STR_FOOTNOTES_SCROLL_DURATION_ASYMMETRICITY, __( 'Enable asymmetric scroll durations:', 'footnotes' ) ),
'scroll-asymmetricity' => $this->add_select_box( MCI_Footnotes_Settings::C_STR_FOOTNOTES_SCROLL_DURATION_ASYMMETRICITY, $l_arr_enable ),
'notice-scroll-asymmetricity' => __( 'With this option enabled, scrolling up may take longer than down, or conversely.', 'footnotes' ),
'label-scroll-down-duration' => $this->add_label( MCI_Footnotes_Settings::C_INT_FOOTNOTES_SCROLL_DOWN_DURATION, __( 'Scroll-down duration:', 'footnotes' ) ),
'scroll-down-duration' => $this->add_num_box( MCI_Footnotes_Settings::C_INT_FOOTNOTES_SCROLL_DOWN_DURATION, 0, 20000 ),
'notice-scroll-down-duration' => __( 'milliseconds', 'footnotes' ),
'label-scroll-down-delay' => $this->add_label( MCI_Footnotes_Settings::C_INT_FOOTNOTES_SCROLL_DOWN_DELAY, __( 'Scroll-down delay:', 'footnotes' ) ),
'scroll-down-delay' => $this->add_num_box( MCI_Footnotes_Settings::C_INT_FOOTNOTES_SCROLL_DOWN_DELAY, 0, 20000 ),
'notice-scroll-down-delay' => __( 'milliseconds. Useful to see the effect on input elements when referrers without hard links are clicked in form labels.', 'footnotes' ),
'label-scroll-up-delay' => $this->add_label( MCI_Footnotes_Settings::C_INT_FOOTNOTES_SCROLL_UP_DELAY, __( 'Scroll-up delay:', 'footnotes' ) ),
'scroll-up-delay' => $this->add_num_box( MCI_Footnotes_Settings::C_INT_FOOTNOTES_SCROLL_UP_DELAY, 0, 20000 ),
'notice-scroll-up-delay' => __( 'milliseconds. Less useful than the scroll-down delay.', 'footnotes' ),
)
);
// Display template with replaced placeholders.
// phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
echo $l_obj_template->get_content();
// phpcs:enable
}
/**
* Displays all options for the fragment identifier configuration.
*
* @since 2.2.0 in scrolling().
* @since 2.5.12 separate metabox.
*/
public function hard_links() {
// Options for enabling hard links for AMP compat.
$l_arr_enable = array(
'yes' => __( 'Yes', 'footnotes' ),
'no' => __( 'No', 'footnotes' ),
);
// Load template file.
$l_obj_template = new MCI_Footnotes_Template( MCI_Footnotes_Template::C_STR_DASHBOARD, 'settings-hard-links' );
// Replace all placeholders.
$l_obj_template->replace(
array(
// Enable hard links for AMP compat.
'label-hard-links' => $this->add_label( MCI_Footnotes_Settings::C_STR_FOOTNOTES_HARD_LINKS_ENABLE, __( 'Enable hard links:', 'footnotes' ) ),
'hard-links' => $this->add_select_box( MCI_Footnotes_Settings::C_STR_FOOTNOTES_HARD_LINKS_ENABLE, $l_arr_enable ),
'notice-hard-links' => __( 'Hard links are indispensable for AMP compatibility and allow to link to footnotes.', 'footnotes' ),
'notice-hard-links' => __( 'Hard links disable jQuery delays but have the same scroll offset, and allow to share footnotes (accessed if the list is not collapsed by default).', 'footnotes' ),
'label-footnote' => $this->add_label( MCI_Footnotes_Settings::C_STR_FOOTNOTE_FRAGMENT_ID_SLUG, __( 'Fragment identifier slug for footnotes:', 'footnotes' ) ),
'footnote' => $this->add_text_box( MCI_Footnotes_Settings::C_STR_FOOTNOTE_FRAGMENT_ID_SLUG ),
@ -522,7 +600,7 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_Layout_Engine {
'label-backlink-tooltip-text' => $this->add_label( MCI_Footnotes_Settings::C_STR_FOOTNOTES_BACKLINK_TOOLTIP_TEXT, __( 'Backlink tooltip text:', 'footnotes' ) ),
'backlink-tooltip-text' => $this->add_text_box( MCI_Footnotes_Settings::C_STR_FOOTNOTES_BACKLINK_TOOLTIP_TEXT ),
'notice-backlink-tooltip-text' => __( 'Default text is the keyboard shortcut, but you may wish to input a descriptive hint in your language.', 'footnotes' ),
'notice-backlink-tooltip-text' => __( 'Default text is the keyboard shortcut; may be a localized descriptive hint.', 'footnotes' ),
)
);
@ -552,15 +630,15 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_Layout_Engine {
'text-5' => sprintf( '%s %s', MCI_Footnotes_Config::C_STR_LOVE_SYMBOL, MCI_Footnotes_Config::C_STR_PLUGIN_PUBLIC_NAME ),
// Translators: 2: heart symbol 1: footnotes logogram.
'text-1' => sprintf( __( 'I %2$s %1$s', 'footnotes' ), MCI_Footnotes_Config::C_STR_PLUGIN_PUBLIC_NAME, MCI_Footnotes_Config::C_STR_LOVE_SYMBOL ),
// Translators: %s: Plugin logo.
// Translators: %s: Footnotes plugin logo.
'text-6' => sprintf( __( 'This website uses %s.', 'footnotes' ), MCI_Footnotes_Config::C_STR_PLUGIN_PUBLIC_NAME ),
// Translators: %s: Plugin logo.
// Translators: %s: Footnotes plugin logo.
'text-7' => sprintf( __( 'This website uses the %s plugin.', 'footnotes' ), MCI_Footnotes_Config::C_STR_PLUGIN_PUBLIC_NAME ),
// Translators: %s: Plugin logo.
// Translators: %s: Footnotes plugin logo.
'text-2' => sprintf( __( 'This website uses the awesome %s plugin.', 'footnotes' ), MCI_Footnotes_Config::C_STR_PLUGIN_PUBLIC_NAME ),
'random' => __( 'randomly determined display of either mention', 'footnotes' ),
// Translators: 1: Plugin logo.2: heart symbol.
'no' => sprintf( __( 'no display of any “%1$s %2$s” mention in the footer', 'footnotes' ), MCI_Footnotes_Config::C_STR_PLUGIN_PUBLIC_NAME, MCI_Footnotes_Config::C_STR_LOVE_SYMBOL ),
'no' => sprintf( __( 'no display of any “%1$s %2$s” mention in the footer', 'footnotes' ), MCI_Footnotes_Config::C_STR_PLUGIN_PUBLIC_NAME, MCI_Footnotes_Config::C_STR_LOVE_SYMBOL ),
);
// Load template file.
@ -568,10 +646,11 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_Layout_Engine {
// Replace all placeholders.
$l_obj_template->replace(
array(
// Translators: %s: Plugin logo.
'label-love' => $this->add_label( MCI_Footnotes_Settings::C_STR_FOOTNOTES_LOVE, sprintf( __( 'Tell the world youre using %s:', 'footnotes' ), MCI_Footnotes_Config::C_STR_PLUGIN_PUBLIC_NAME ) ),
// Translators: %s: Footnotes plugin logo.
'label-love' => $this->add_label( MCI_Footnotes_Settings::C_STR_FOOTNOTES_LOVE, sprintf( __( 'Tell the world you’re using %s:', 'footnotes' ), MCI_Footnotes_Config::C_STR_PLUGIN_PUBLIC_NAME ) ),
'love' => $this->add_select_box( MCI_Footnotes_Settings::C_STR_FOOTNOTES_LOVE, $l_arr_love ),
// Translators: %s: Plugin logo.
// Translators: %s: Footnotes plugin logo.
'label-no-love' => $this->add_text( sprintf( __( 'Shortcode to inhibit the display of the %s mention on specific pages:', 'footnotes' ), MCI_Footnotes_Config::C_STR_PLUGIN_PUBLIC_NAME ) ),
'no-love' => $this->add_text( MCI_Footnotes_Config::C_STR_NO_LOVE_SLUG ),
)
@ -607,9 +686,10 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_Layout_Engine {
array(
'label-excerpts' => $this->add_label( MCI_Footnotes_Settings::C_STR_FOOTNOTES_IN_EXCERPT, __( 'Display footnotes in excerpts:', 'footnotes' ) ),
'excerpts' => $this->add_select_box( MCI_Footnotes_Settings::C_STR_FOOTNOTES_IN_EXCERPT, $l_arr_enabled ),
'notice-excerpts' => __( 'The recommended value is No.', 'footnotes' ),
// Translators: %s: link to the Advanced Excerpt Plugin.
'description-excerpts' => sprintf( __( 'In some themes, the %s plugin is indispensable to display footnotes in excerpts. Footnotes cannot be disabled in excerpts. A workaround is to avoid footnotes in the first 55&nbsp;words.', 'footnotes' ), '<a href="https://wordpress.org/plugins/advanced-excerpt/" target="_blank">Advanced Excerpt</a>' ),
'notice-excerpts' => __( 'For this setting to be effective, the hook the_excerpt must be enabled under Scope and priority.', 'footnotes' ),
// Translators: %s: link text 'Advanced Excerpt' linked to the plugin’s WordPress.org front page.
// Translators: %s: Footnotes plugin logo.
'description-excerpts' => sprintf( __( 'Both to display footnotes and to not display footnotes in excerpts, the %s plugin generates excerpts on the basis of the posts to ensure that footnotes are handled and don’t impact the excerpt length.', 'footnotes' ), '<span style="font-style: normal;">' . MCI_Footnotes_Config::C_STR_PLUGIN_PUBLIC_NAME . '</span>' ),
)
);
// Display template with replaced placeholders.
@ -647,6 +727,10 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_Layout_Engine {
'label-superscript' => $this->add_label( MCI_Footnotes_Settings::C_STR_FOOTNOTES_REFERRER_SUPERSCRIPT_TAGS, __( 'Display footnote referrers in superscript:', 'footnotes' ) ),
'superscript' => $this->add_select_box( MCI_Footnotes_Settings::C_STR_FOOTNOTES_REFERRER_SUPERSCRIPT_TAGS, $l_arr_enabled ),
'label-normalize' => $this->add_label( MCI_Footnotes_Settings::C_STR_FOOTNOTE_REFERRERS_NORMAL_SUPERSCRIPT, __( 'Normalize vertical alignment and font size:', 'footnotes' ) ),
'normalize' => $this->add_select_box( MCI_Footnotes_Settings::C_STR_FOOTNOTE_REFERRERS_NORMAL_SUPERSCRIPT, $l_arr_normalize_superscript ),
'notice-normalize' => __( 'Most themes don’t need this fix.', 'footnotes' ),
'label-before' => $this->add_label( MCI_Footnotes_Settings::C_STR_FOOTNOTES_STYLING_BEFORE, __( 'At the start of the footnote referrers:', 'footnotes' ) ),
'before' => $this->add_text_box( MCI_Footnotes_Settings::C_STR_FOOTNOTES_STYLING_BEFORE ),
@ -654,11 +738,36 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_Layout_Engine {
'after' => $this->add_text_box( MCI_Footnotes_Settings::C_STR_FOOTNOTES_STYLING_AFTER ),
'label-link' => $this->add_label( MCI_Footnotes_Settings::C_STR_LINK_ELEMENT_ENABLED, __( 'Use the link element for referrers and backlinks:', 'footnotes' ) ),
'notice-link' => __( 'Please find this setting at the end of the reference container settings. The link element is needed to apply the themes link color.', 'footnotes' ),
'notice-link' => __( 'Please find this setting at the end of the reference container settings. The link element is needed to apply the theme’s link color.', 'footnotes' ),
)
);
// Display template with replaced placeholders.
// phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
echo $l_obj_template->get_content();
// phpcs:enable
}
'label-normalize' => $this->add_label( MCI_Footnotes_Settings::C_STR_FOOTNOTE_REFERRERS_NORMAL_SUPERSCRIPT, __( 'Normalize vertical alignment and font size:', 'footnotes' ) ),
'normalize' => $this->add_select_box( MCI_Footnotes_Settings::C_STR_FOOTNOTE_REFERRERS_NORMAL_SUPERSCRIPT, $l_arr_normalize_superscript ),
'notice-normalize' => __( 'Most themes dont need this fix.', 'footnotes' ),
/**
* Displays the setting for the input label issue solution.
*
* @since 2.5.12
*/
public function label_solution() {
// Options for the input label issue solution.
$l_arr_issue_solutions = array(
'none' => __( '0. No problem or solved otherwise', 'footnotes' ),
'move' => __( 'A. Footnotes are moved out and appended after the label’s end (recommended)', 'footnotes' ),
'disconnect' => __( 'B. Labels with footnotes are disconnected from input element (discouraged)', 'footnotes' ),
);
// Load template file.
$l_obj_template = new MCI_Footnotes_Template( MCI_Footnotes_Template::C_STR_DASHBOARD, 'configure-label-solution' );
// Replace all placeholders.
$l_obj_template->replace(
array(
'description-1-selection' => __( 'Clicking a footnote referrer in an input element label toggles the input except when hard links are enabled. In jQuery mode, the recommended solution is to move footnotes and append them after the label (option A).', 'footnotes' ),
'label-selection' => $this->add_label( MCI_Footnotes_Settings::C_STR_FOOTNOTES_LABEL_ISSUE_SOLUTION, __( 'Solve input label issue:', 'footnotes' ) ),
'selection' => $this->add_select_box( MCI_Footnotes_Settings::C_STR_FOOTNOTES_LABEL_ISSUE_SOLUTION, $l_arr_issue_solutions ),
'description-2-selection' => __( 'Option B is discouraged because disconnecting a label from its input element may compromise accessibility. This option is a last resort in case footnotes must absolutely stay inside the label. (Using jQuery ‘event.stopPropagation’ failed.)', 'footnotes' ),
)
);
// Display template with replaced placeholders.
@ -696,8 +805,8 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_Layout_Engine {
'label-alternative' => $this->add_label( MCI_Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_ALTERNATIVE, __( 'Display alternative tooltips:', 'footnotes' ) ),
'alternative' => $this->add_select_box( MCI_Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_ALTERNATIVE, $l_arr_enabled ),
'notice-alternative' => __( 'Intended to work around a configuration-related tooltip outage.', 'footnotes' ),
// Translators: %s: Plugin logo.
'description-alternative' => sprintf( __( 'These alternative tooltips work around a website related jQuery UI outage. They are low-script but use the AMP incompatible onmouseover and onmouseout arguments, along with CSS transitions for fade-in/out. The very small script is inserted after Footnotes internal stylesheet. When this option is enabled, %s does not load jQuery&nbsp;UI nor jQuery&nbsp;Tools.', 'footnotes' ), '<span style="font-style: normal;">' . MCI_Footnotes_Config::C_STR_PLUGIN_PUBLIC_NAME . '</span>' ),
// Translators: %s: Footnotes plugin logo.
'description-alternative' => sprintf( __( 'These alternative tooltips work around a website related jQuery UI outage. They are low-script but use the AMP incompatible onmouseover and onmouseout arguments, along with CSS transitions for fade-in/out. The very small script is inserted after Footnotes’ internal stylesheet. When this option is enabled, %s does not load jQuery&nbsp;UI nor jQuery&nbsp;Tools.', 'footnotes' ), '<span style="font-style: normal;">' . MCI_Footnotes_Config::C_STR_PLUGIN_PUBLIC_NAME . '</span>' ),
)
);
@ -851,7 +960,7 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_Layout_Engine {
// The feature trims back until the last full word.
'notice-max-length' => __( 'No weird cuts.', 'footnotes' ),
'label-readon' => $this->add_label( MCI_Footnotes_Settings::C_STR_FOOTNOTES_TOOLTIP_READON_LABEL, __( 'Read on button label:', 'footnotes' ) ),
'label-readon' => $this->add_label( MCI_Footnotes_Settings::C_STR_FOOTNOTES_TOOLTIP_READON_LABEL, __( '‘Read on’ button label:', 'footnotes' ) ),
'readon' => $this->add_text_box( MCI_Footnotes_Settings::C_STR_FOOTNOTES_TOOLTIP_READON_LABEL ),
)
@ -941,12 +1050,12 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_Layout_Engine {
'label-color' => $this->add_label( MCI_Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_COLOR, __( 'Text color:', 'footnotes' ) ),
'color' => $this->add_color_selection( MCI_Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_COLOR ),
// Translators: %s: Clear or leave empty.
'notice-color' => sprintf( __( 'To use the current themes default text color: %s', 'footnotes' ), __( 'Clear or leave empty.', 'footnotes' ) ),
'notice-color' => sprintf( __( 'To use the current theme’s default text color: %s', 'footnotes' ), __( 'Clear or leave empty.', 'footnotes' ) ),
'label-background' => $this->add_label( MCI_Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_BACKGROUND, __( 'Background color:', 'footnotes' ) ),
'background' => $this->add_color_selection( MCI_Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_BACKGROUND ),
// Translators: %s: Clear or leave empty.
'notice-background' => sprintf( __( 'To use the current themes default background color: %s', 'footnotes' ), __( 'Clear or leave empty.', 'footnotes' ) ),
'notice-background' => sprintf( __( 'To use the current theme’s default background color: %s', 'footnotes' ), __( 'Clear or leave empty.', 'footnotes' ) ),
'label-border-width' => $this->add_label( MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_BORDER_WIDTH, __( 'Border width:', 'footnotes' ) ),
'border-width' => $this->add_num_box( MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_BORDER_WIDTH, 0, 4, true ),
@ -955,7 +1064,7 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_Layout_Engine {
'label-border-color' => $this->add_label( MCI_Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_BORDER_COLOR, __( 'Border color:', 'footnotes' ) ),
'border-color' => $this->add_color_selection( MCI_Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_BORDER_COLOR ),
// Translators: %s: Clear or leave empty.
'notice-border-color' => sprintf( __( 'To use the current themes default border color: %s', 'footnotes' ), __( 'Clear or leave empty.', 'footnotes' ) ),
'notice-border-color' => sprintf( __( 'To use the current theme’s default border color: %s', 'footnotes' ), __( 'Clear or leave empty.', 'footnotes' ) ),
'label-border-radius' => $this->add_label( MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_BORDER_RADIUS, __( 'Rounded corner radius:', 'footnotes' ) ),
'border-radius' => $this->add_num_box( MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_BORDER_RADIUS, 0, 500 ),
@ -964,7 +1073,7 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_Layout_Engine {
'label-box-shadow-color' => $this->add_label( MCI_Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_SHADOW_COLOR, __( 'Box shadow color:', 'footnotes' ) ),
'box-shadow-color' => $this->add_color_selection( MCI_Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_SHADOW_COLOR ),
// Translators: %s: Clear or leave empty.
'notice-box-shadow-color' => sprintf( __( 'To use the current themes default box shadow color: %s', 'footnotes' ), __( 'Clear or leave empty.', 'footnotes' ) ),
'notice-box-shadow-color' => sprintf( __( 'To use the current theme’s default box shadow color: %s', 'footnotes' ), __( 'Clear or leave empty.', 'footnotes' ) ),
)
);
@ -979,11 +1088,22 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_Layout_Engine {
*
* @since 1.5.0
*
* Edited heading for v2.0.4
* - Update: **symbol for backlinks** removed; hyperlink moved to the reference number.
*
* The former 'hyperlink arrow', incompatible with combined identical footnotes,
* became 'prepended arrow' in v2.0.3 after a user complaint about missing backlinking semantics
* of the footnote number.
* @since 2.0.0
* The former 'hyperlink arrow' is incompatible with combined identical footnotes.
*
* - Update: Reference container: clarify backlink semantics by prepended transitional up arrow, thanks to @mmallett issue report.
*
* @since 2.0.3
*
* - Update: Restore arrow settings to customize or disable the now prepended arrow symbol, thanks to @mmallett issue report.
*
* @since 2.0.4
* @date 2020-11-02T2115+0100
*
* @reporter @mmallett
* @link https://wordpress.org/support/topic/mouse-over-broken/#post-13593037
*
* @since 2.1.4 moved to Settings > Reference container > Display a backlink symbol
* @since 2.2.1 and 2.2.4 back here
@ -1034,7 +1154,7 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_Layout_Engine {
// phpcs:disable Squiz.PHP.CommentedOutCode.Found
// CSS classes are listed in the template.
// Localized notices are dropped to ease translators task.
// Localized notices are dropped to ease translators’ task.
// "label-class-1" => ".footnote_plugin_tooltip_text",.
// "class-1" => $this->add_text(__("superscript, Footnotes index", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),.
@ -1222,17 +1342,17 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_Layout_Engine {
array(
'label-start' => __( 'Start your footnote with the following short code:', 'footnotes' ),
'start' => $l_arr_footnote_starting_tag['value'],
'label-end' => __( 'and end your footnote with this short code:', 'footnotes' ),
'label-end' => __( '…and end your footnote with this short code:', 'footnotes' ),
'end' => $l_arr_footnote_ending_tag['value'],
'example-code' => $l_str_example,
'example-string' => '<br/>' . __( 'will be displayed as:', 'footnotes' ),
'example' => $g_obj_mci_footnotes->a_obj_task->exec( $l_str_example, true ),
// Translators: 1: <a>; 2: </a>.
'information' => sprintf( __( 'For further information please check out our %1$ssupport forum%2$s on WordPress.org.', 'footnotes' ), '<a href="http://wordpress.org/support/plugin/footnotes" target="_blank" class="footnote_plugin">', '</a>' ),
'information' => sprintf( __( 'For further information please check out our %1$ssupport forum%2$s on WordPress.org.', 'footnotes' ), '<a href="https://wordpress.org/support/plugin/footnotes" target="_blank" class="footnote_plugin">', '</a>' ),
)
);
// Call wp_head function to get the Styling of the mouse-over box.
$g_obj_mci_footnotes->a_obj_task->wp_head();
$g_obj_mci_footnotes->a_obj_task->footnotes_output_head();
// Display template with replaced placeholders.
// phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
echo $l_obj_template->get_content();
@ -1259,3 +1379,4 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_Layout_Engine {
// phpcs:enable
}
}

View file

@ -76,7 +76,7 @@ class MCI_Footnotes_Hooks {
*/
public static function plugin_links( $p_arr_links, $p_str_plugin_file_name ) {
// Append link to the WordPress Plugin page.
$p_arr_links[] = sprintf( '<a href="http://wordpress.org/support/plugin/footnotes" target="_blank">%s</a>', __( 'Support', 'footnotes' ) );
$p_arr_links[] = sprintf( '<a href="https://wordpress.org/support/plugin/footnotes" target="_blank">%s</a>', __( 'Support', 'footnotes' ) );
// Append link to the settings page.
$p_arr_links[] = sprintf( '<a href="%s">%s</a>', admin_url( 'admin.php?page=mfmmf-footnotes' ), __( 'Settings', 'footnotes' ) );
// Append link to the PayPal donate function.

View file

@ -38,29 +38,83 @@ class MCI_Footnotes {
public $a_obj_task = null;
/**
* Idenfifies whether tooltips are enabled. Actual value depends on settings.
* Allows to determine whether tooltips are enabled.
* The actual value of these properties is configurable.
*
* - Bugfix: Templates: optimize template load and processing based on settings, thanks to @misfist code contribution.
*
* @since 2.4.0
* @date 2021-01-04T1355+0100
*
* @contributor Patrizia Lutz @misfist
* @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/compare/2.4.0%E2%80%A62.4.0d3 diff
*
* @var bool
*
* @todo Refactor to have defines and assignments only in this class,
* then re-use these properties also in class/task.php (and elsewhere).
* Account for priority level issues. These properties must be assigned before
* the hooks—whose priority level may be configured to 0—are called in class/task.php.
* Template process and script / stylesheet load optimization.
* Streamline process depending on tooltip enabled status.
* Load tooltip inline script only if jQuery tooltips are enabled.
*/
public static $a_bool_tooltips_enabled = false;
/**
* Idenfifies whether alternative tooltips are enabled. Actual value depends
* on settings.
* Allows to determine whether alternative tooltips are enabled.
*
* - 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
*
* @since 2.4.0
* @contributor Patrizia Lutz @misfist
* @var bool
*
* @todo Refactor to have defines only here, and use assignments also in class/task.php.
*/
public static $a_bool_alternative_tooltips_enabled = false;
/**
* Allows to determine whether AMP compatibility mode is enabled.
*
* - Adding: Tooltips: make display work purely by style rules for AMP compatibility, thanks to @milindmore22 code contribution.
* - Bugfix: Tooltips: enable accessibility by keyboard navigation, thanks to @westonruter code contribution.
* - Adding: Reference container: get expanding and collapsing to work also in AMP compatibility mode, thanks to @westonruter code contribution.
*
* @since 2.5.11 (draft)
* @since 2.6.0 (release)
*
* @contributor @milindmore22
* @link @link https://github.com/ampproject/amp-wp/issues/5913#issuecomment-785306933
*
* @contributor @westonruter
* @link https://github.com/ampproject/amp-wp/issues/5913#issuecomment-785419655
* @link https://github.com/markcheret/footnotes/issues/48#issuecomment-799580854
* @link https://github.com/markcheret/footnotes/issues/48#issuecomment-799582394
*
* @var bool
*/
public static $a_bool_amp_enabled = false;
/**
* Allows to determine the script mode among jQuery or plain JS.
*
* - Bugfix: Reference container: optional alternative expanding and collapsing without jQuery for use with hard links, thanks to @hopper87it @pkverma99 issue reports.
*
* @since 2.5.6
*
* @reporter @hopper87it
* @link https://wordpress.org/support/topic/footnotes-wp-rocket/
*
* @reporter @pkverma99
* @link https://wordpress.org/support/topic/footnotes-wp-rocket/#post-14076188
*
* @var str 'js' Plain JavaScript.
* 'jquery' Use jQuery libraries.
*/
public static $a_str_script_mode = 'js';
/**
* Executes the Plugin.
*
@ -173,10 +227,11 @@ class MCI_Footnotes {
*
* The condition about tooltips was missing, only the not-alternative-tooltips part was present.
*/
// Set conditions re-used for stylesheet enqueuing.
// Set conditions re-used for stylesheet enqueuing and in class/task.php.
self::$a_bool_amp_enabled = MCI_Footnotes_Convert::to_bool( MCI_Footnotes_Settings::instance()->get( MCI_Footnotes_Settings::C_STR_FOOTNOTES_AMP_COMPATIBILITY_ENABLE ) );
self::$a_bool_tooltips_enabled = MCI_Footnotes_Convert::to_bool( MCI_Footnotes_Settings::instance()->get( MCI_Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_ENABLED ) );
self::$a_bool_alternative_tooltips_enabled = MCI_Footnotes_Convert::to_bool( MCI_Footnotes_Settings::instance()->get( MCI_Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_ALTERNATIVE ) );
$l_str_script_mode = MCI_Footnotes_Settings::instance()->get( MCI_Footnotes_Settings::C_STR_FOOTNOTES_REFERENCE_CONTAINER_SCRIPT_MODE );
self::$a_str_script_mode = MCI_Footnotes_Settings::instance()->get( MCI_Footnotes_Settings::C_STR_FOOTNOTES_REFERENCE_CONTAINER_SCRIPT_MODE );
/**
* Enqueues the jQuery library registered by WordPress.
@ -193,80 +248,83 @@ class MCI_Footnotes {
* After adding the alternative reference container, jQuery has become optional,
* but still enabled by default.
*/
if ( 'jquery' === $l_str_script_mode || ( self::$a_bool_tooltips_enabled && ! self::$a_bool_alternative_tooltips_enabled ) ) {
if ( ! self::$a_bool_amp_enabled ) {
wp_enqueue_script( 'jquery' );
if ( 'jquery' === self::$a_str_script_mode || ( self::$a_bool_tooltips_enabled && ! self::$a_bool_alternative_tooltips_enabled ) ) {
}
wp_enqueue_script( 'jquery' );
if ( self::$a_bool_tooltips_enabled && ! self::$a_bool_alternative_tooltips_enabled ) {
}
/**
* Enqueues the jQuery Tools library shipped with the plugin.
*
* Redacted jQuery.browser, completed minification;
* see full header in js/jquery.tools.js.
*
* Add versioning.
*
* @since 2.1.2
* @date 2020-11-18T2150+0100
*
* No '-js' in the handle, is appended automatically.
*
* Deferring to the footer breaks jQuery tooltip display.
* @date 2021-02-23T1105+0100
*/
wp_enqueue_script(
'mci-footnotes-jquery-tools',
plugins_url( 'footnotes/js/jquery.tools.min.js' ),
array(),
'1.2.7.redacted.2',
false
);
if ( self::$a_bool_tooltips_enabled && ! self::$a_bool_alternative_tooltips_enabled ) {
/**
* Enqueues some jQuery UI libraries registered by WordPress.
*
* - 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
*
* @reporter @rajinderverma
* @link https://wordpress.org/support/topic/tooltip-hover-not-showing/
*
* @reporter @ericcorbett2
* @link https://wordpress.org/support/topic/tooltip-hover-not-showing/#post-13324142
*
* @reporter @honlapdavid
* @link https://wordpress.org/support/topic/tooltip-hover-not-showing/#post-13355421
*
* @reporter @mmallett
* @link https://wordpress.org/support/topic/tooltip-hover-not-showing/#post-13445437
*
* Fetch jQuery UI from cdnjs.cloudflare.com.
* @since 2.0.0
* @date 2020-10-26T1907+0100
* @contributor @vonpiernik
* @link https://wordpress.org/support/topic/tooltip-hover-not-showing/#post-13456762
*
* jQueryUI re-enables the tooltip infobox disabled when WPv5.5 was released. * @since 2.1.2
*
* - Update: Libraries: Load jQuery UI from WordPress, thanks to @check2020de issue report.
*
* @since 2.0.4
* @date 2020-11-01T1902+0100
* @reporter @check2020de
* @link https://wordpress.org/support/topic/gdpr-issue-with-jquery/
* @link https://wordpress.stackexchange.com/questions/273986/correct-way-to-enqueue-jquery-ui
*
* If alternative tooltips are enabled, these libraries are not needed.
*/
wp_enqueue_script( 'jquery-ui-core' );
wp_enqueue_script( 'jquery-ui-widget' );
wp_enqueue_script( 'jquery-ui-position' );
wp_enqueue_script( 'jquery-ui-tooltip' );
/**
* Enqueues the jQuery Tools library shipped with the plugin.
*
* Redacted jQuery.browser, completed minification;
* see full header in js/jquery.tools.js.
*
* Add versioning.
*
* @since 2.1.2
* @date 2020-11-18T2150+0100
*
* No '-js' in the handle, is appended automatically.
*
* Deferring to the footer breaks jQuery tooltip display.
* @date 2021-02-23T1105+0100
*/
wp_enqueue_script(
'mci-footnotes-jquery-tools',
plugins_url( 'footnotes/js/jquery.tools.min.js' ),
array(),
'1.2.7.redacted.2',
false
);
/**
* Enqueues some jQuery UI libraries registered by WordPress.
*
* - 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
*
* @reporter @rajinderverma
* @link https://wordpress.org/support/topic/tooltip-hover-not-showing/
*
* @reporter @ericcorbett2
* @link https://wordpress.org/support/topic/tooltip-hover-not-showing/#post-13324142
*
* @reporter @honlapdavid
* @link https://wordpress.org/support/topic/tooltip-hover-not-showing/#post-13355421
*
* @reporter @mmallett
* @link https://wordpress.org/support/topic/tooltip-hover-not-showing/#post-13445437
*
* Fetch jQuery UI from cdnjs.cloudflare.com.
* @since 2.0.0
* @date 2020-10-26T1907+0100
* @contributor @vonpiernik
* @link https://wordpress.org/support/topic/tooltip-hover-not-showing/#post-13456762
*
* jQueryUI re-enables the tooltip infobox disabled when WPv5.5 was released. * @since 2.1.2
*
* - Update: Libraries: Load jQuery UI from WordPress, thanks to @check2020de issue report.
*
* @since 2.0.4
* @date 2020-11-01T1902+0100
* @reporter @check2020de
* @link https://wordpress.org/support/topic/gdpr-issue-with-jquery/
* @link https://wordpress.stackexchange.com/questions/273986/correct-way-to-enqueue-jquery-ui
*
* If alternative tooltips are enabled, these libraries are not needed.
*/
wp_enqueue_script( 'jquery-ui-core' );
wp_enqueue_script( 'jquery-ui-widget' );
wp_enqueue_script( 'jquery-ui-position' );
wp_enqueue_script( 'jquery-ui-tooltip' );
}
}
/**
@ -281,7 +339,7 @@ class MCI_Footnotes {
* The Boolean may be set at the bottom of the plugins main PHP file.
* @see footnotes.php
*/
if ( C_BOOL_CSS_PRODUCTION_MODE === true ) {
if ( C_BOOL_CSS_PRODUCTION_MODE ) {
/**
* Enqueues a minified united external stylesheet in production.
@ -305,21 +363,32 @@ class MCI_Footnotes {
* @date 2020-10-29T1413+0100
* Plugin version number is needed for busting browser caches after each plugin update.
*
* @since 2.1.4 automate passing version number for cache busting.
* @date 2020-11-30T0646+0100
* The constant C_STR_PACKAGE_VERSION is defined at start of footnotes.php.
*
* The media scope argument 'all' is the default.
* No need to use '-css' in the handle, as this is appended automatically.
*/
// Set tooltip mode for use in stylesheet name.
if ( self::$a_bool_tooltips_enabled ) {
if ( self::$a_bool_alternative_tooltips_enabled ) {
$l_str_tooltip_mode_short = 'al';
$l_str_tooltip_mode_rest = 'ternative-tooltips';
if ( self::$a_bool_amp_enabled ) {
$l_str_tooltip_mode_short = 'ampt';
$l_str_tooltip_mode_long = 'amp-tooltips';
} elseif ( self::$a_bool_alternative_tooltips_enabled ) {
$l_str_tooltip_mode_short = 'altt';
$l_str_tooltip_mode_long = 'alternative-tooltips';
} else {
$l_str_tooltip_mode_short = 'jq';
$l_str_tooltip_mode_rest = 'uery-tooltips';
$l_str_tooltip_mode_short = 'jqtt';
$l_str_tooltip_mode_long = 'jquery-tooltips';
}
} else {
$l_str_tooltip_mode_short = 'no';
$l_str_tooltip_mode_rest = '-tooltips';
$l_str_tooltip_mode_short = 'nott';
$l_str_tooltip_mode_long = 'no-tooltips';
}
// Set basic responsive page layout mode for use in stylesheet name.
@ -342,9 +411,9 @@ class MCI_Footnotes {
// Enqueue the tailored united minified stylesheet.
wp_enqueue_style(
'mci-footnotes-' . $l_str_tooltip_mode_short . $l_str_tooltip_mode_rest . '-pagelayout-' . $l_str_page_layout_option,
'mci-footnotes-' . $l_str_tooltip_mode_long . '-pagelayout-' . $l_str_page_layout_option,
plugins_url(
MCI_Footnotes_Config::C_STR_PLUGIN_NAME . '/css/footnotes-' . $l_str_tooltip_mode_short . 'ttbrpl' . $l_str_layout_mode . '.min.css'
MCI_Footnotes_Config::C_STR_PLUGIN_NAME . '/css/footnotes-' . $l_str_tooltip_mode_short . 'brpl' . $l_str_layout_mode . '.min.css'
),
array(),
filemtime(
@ -385,16 +454,32 @@ class MCI_Footnotes {
) . 'css/dev-tooltips.css'
)
);
wp_enqueue_style(
'mci-footnotes-alternative',
plugins_url( MCI_Footnotes_Config::C_STR_PLUGIN_NAME . '/css/dev-tooltips-alternative.css' ),
array(),
filemtime(
plugin_dir_path(
dirname( __FILE__ )
) . 'css/dev-tooltips-alternative.css'
)
);
if ( self::$a_bool_amp_enabled ) {
wp_enqueue_style(
'mci-footnotes-amp',
plugins_url( MCI_Footnotes_Config::C_STR_PLUGIN_NAME . '/css/dev-amp-tooltips.css' ),
array(),
filemtime(
plugin_dir_path(
dirname( __FILE__ )
) . 'css/dev-amp-tooltips.css'
)
);
}
if ( self::$a_bool_alternative_tooltips_enabled ) {
wp_enqueue_style(
'mci-footnotes-alternative',
plugins_url( MCI_Footnotes_Config::C_STR_PLUGIN_NAME . '/css/dev-tooltips-alternative.css' ),
array(),
filemtime(
plugin_dir_path(
dirname( __FILE__ )
) . 'css/dev-tooltips-alternative.css'
)
);
}
$l_str_page_layout_option = MCI_Footnotes_Settings::instance()->get( MCI_Footnotes_Settings::C_STR_FOOTNOTES_PAGE_LAYOUT_SUPPORT );
if ( 'none' !== $l_str_page_layout_option ) {

View file

@ -0,0 +1,587 @@
<?php // phpcs:disable WordPress.Files.FileName.InvalidClassFileName, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.EscapeOutput.OutputNotEscaped
/**
* Includes Layout Engine for the admin dashboard.
*
* @filesource
* @package footnotes
* @since 1.5.0
* @date 12.09.14 10:56
*
* @since 2.1.2 add versioning of settings.css for cache busting 2020-11-19T1456+0100
* @since 2.1.4 automate passing version number for cache busting 2020-11-30T0648+0100
* @since 2.1.4 optional step argument and support for floating in numbox 2020-12-05T0540+0100
* @since 2.1.6 fix punctuation-related localization issue in dashboard labels 2020-12-08T1547+0100
*
* @since 2.5.5 Bugfix: Stylesheets: minify to shrink the carbon footprint, increase speed and implement best practice, thanks to @docteurfitness issue report.
*/
/**
* Layout Engine for the administration dashboard.
*
* @since 1.5.0
*/
abstract class MCI_Footnotes_Layout_Engine {
/**
* Stores the Hook connection string for the child sub page.
*
* @since 1.5.0
* @var null|string
*/
protected $a_str_sub_page_hook = null;
/**
* Stores all Sections for the child sub page.
*
* @since 1.5.0
* @var array
*/
protected $a_arr_sections = array();
/**
* Returns a Priority index. Lower numbers have a higher Priority.
*
* @since 1.5.0
* @return int
*/
abstract public function get_priority();
/**
* Returns the unique slug of the child sub page.
*
* @since 1.5.0
* @return string
*/
abstract protected function get_sub_page_slug();
/**
* Returns the title of the child sub page.
*
* @since 1.5.0
* @return string
*/
abstract protected function get_sub_page_title();
/**
* Returns an array of all registered sections for a sub page.
*
* @since 1.5.0
* @return array
*/
abstract protected function get_sections();
/**
* Returns an array of all registered meta boxes.
*
* @since 1.5.0
* @return array
*/
abstract protected function get_meta_boxes();
/**
* Returns an array describing a sub page section.
*
* @since 1.5.0
* @param string $p_str_id Unique ID suffix.
* @param string $p_str_title Title of the section.
* @param int $p_int_settings_container_index Settings Container Index.
* @param bool $p_bool_has_submit_button Should a Submit Button be displayed for this section, default: true.
* @return array Array describing the section.
*/
protected function add_section( $p_str_id, $p_str_title, $p_int_settings_container_index, $p_bool_has_submit_button = true ) {
return array(
'id' => MCI_Footnotes_Config::C_STR_PLUGIN_NAME . '-' . $p_str_id,
'title' => $p_str_title,
'submit' => $p_bool_has_submit_button,
'container' => $p_int_settings_container_index,
);
}
/**
* Returns an array describing a meta box.
*
* @since 1.5.0
* @param string $p_str_section_id Parent Section ID.
* @param string $p_str_id Unique ID suffix.
* @param string $p_str_title Title for the meta box.
* @param string $p_str_callback_function_name Class method name for callback.
* @return array meta box description to be able to append a meta box to the output.
*/
protected function add_meta_box( $p_str_section_id, $p_str_id, $p_str_title, $p_str_callback_function_name ) {
return array(
'parent' => MCI_Footnotes_Config::C_STR_PLUGIN_NAME . '-' . $p_str_section_id,
'id' => $p_str_id,
'title' => $p_str_title,
'callback' => $p_str_callback_function_name,
);
}
/**
* Registers a sub page.
*
* @since 1.5.0
*/
public function register_sub_page() {
global $submenu;
if ( array_key_exists( plugin_basename( MCI_Footnotes_Layout_Init::C_STR_MAIN_MENU_SLUG ), $submenu ) ) {
foreach ( $submenu[ plugin_basename( MCI_Footnotes_Layout_Init::C_STR_MAIN_MENU_SLUG ) ] as $l_arr_sub_menu ) {
if ( plugin_basename( MCI_Footnotes_Layout_Init::C_STR_MAIN_MENU_SLUG . $this->get_sub_page_slug() ) === $l_arr_sub_menu[2] ) {
remove_submenu_page( MCI_Footnotes_Layout_Init::C_STR_MAIN_MENU_SLUG, MCI_Footnotes_Layout_Init::C_STR_MAIN_MENU_SLUG . $this->get_sub_page_slug() );
}
}
}
$this->a_str_sub_page_hook = add_submenu_page(
MCI_Footnotes_Layout_Init::C_STR_MAIN_MENU_SLUG,
$this->get_sub_page_title(),
$this->get_sub_page_title(),
'manage_options',
MCI_Footnotes_Layout_Init::C_STR_MAIN_MENU_SLUG . $this->get_sub_page_slug(),
array( $this, 'display_content' )
);
}
/**
* Registers all sections for a sub page.
*
* @since 1.5.0
*/
public function register_sections() {
foreach ( $this->get_sections() as $l_arr_section ) {
// Append tab to the tab-array.
$this->a_arr_sections[ $l_arr_section['id'] ] = $l_arr_section;
add_settings_section(
$l_arr_section['id'],
'',
array( $this, 'Description' ),
$l_arr_section['id']
);
$this->register_meta_boxes( $l_arr_section['id'] );
}
}
/**
* Registers all Meta boxes for a sub page.
*
* @since 1.5.0
* @param string $p_str_parent_id Parent section unique id.
*/
private function register_meta_boxes( $p_str_parent_id ) {
// Iterate through each meta box.
foreach ( $this->get_meta_boxes() as $l_arr_meta_box ) {
if ( $p_str_parent_id !== $l_arr_meta_box['parent'] ) {
continue;
}
add_meta_box(
$p_str_parent_id . '-' . $l_arr_meta_box['id'],
$l_arr_meta_box['title'],
array( $this, $l_arr_meta_box['callback'] ),
$p_str_parent_id,
'main'
);
}
}
/**
* Append javascript and css files for specific sub page.
*
* @since 1.5.0
*/
private function append_scripts() {
wp_enqueue_script( 'postbox' );
wp_enqueue_style( 'wp-color-picker' );
wp_enqueue_script( 'wp-color-picker' );
/**
* Registers and enqueues the dashboard stylesheet.
*
* - Bugfix: Stylesheets: minify to shrink the carbon footprint, increase speed and implement best practice, thanks to @docteurfitness issue report.
*
* @since 2.5.5
* @date 2021-02-14T1928+0100
*
* @reporter @docteurfitness
* @link https://wordpress.org/support/topic/simply-speed-optimisation/
*
* See the public stylesheet enqueuing:
* @see class/init.php
*
* added version # after changes started to settings.css from 2.1.2 on.
* automated update of version number for cache busting.
* No need to use '-styles' in the handle, as '-css' is appended automatically.
*/
if ( true === C_BOOL_CSS_PRODUCTION_MODE ) {
wp_register_style( 'mci-footnotes-admin', plugins_url( 'footnotes/css/settings.min.css' ), array(), C_STR_PACKAGE_VERSION );
} else {
wp_register_style( 'mci-footnotes-admin', plugins_url( 'footnotes/css/settings.css' ), array(), C_STR_PACKAGE_VERSION );
}
wp_enqueue_style( 'mci-footnotes-admin' );
}
// phpcs:disable WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing
/**
* Displays the content of specific sub page.
*
* @since 1.5.0
*/
public function display_content() {
$this->append_scripts();
// TODO: add nonce verification.
// Get the current section.
reset( $this->a_arr_sections );
$l_str_active_section_id = isset( $_GET['t'] ) ? wp_unslash( $_GET['t'] ) : key( $this->a_arr_sections );
$l_arr_active_section = $this->a_arr_sections[ $l_str_active_section_id ];
// Store settings.
$l_bool_settings_updated = false;
if ( array_key_exists( 'save-settings', $_POST ) ) {
if ( 'save' === $_POST['save-settings'] ) {
unset( $_POST['save-settings'] );
unset( $_POST['submit'] );
$l_bool_settings_updated = $this->save_settings();
}
}
// Display all sections and highlight the active section.
echo '<div class="wrap">';
echo '<h2 class="nav-tab-wrapper">';
// Iterate through all register sections.
foreach ( $this->a_arr_sections as $l_str_id => $l_arr_description ) {
$l_str_tab_active = ( $l_str_id === $l_arr_active_section['id'] ) ? ' nav-tab-active' : '';
echo sprintf(
'<a class="nav-tab%s" href="?page=%s&t=%s">%s</a>',
( $l_str_id === $l_arr_active_section['id'] ) ? ' nav-tab-active' : '',
MCI_Footnotes_Layout_Init::C_STR_MAIN_MENU_SLUG . $this->get_sub_page_slug(),
$l_str_id,
$l_arr_description['title']
);
}
echo '</h2><br/>';
if ( $l_bool_settings_updated ) {
echo sprintf( '<div id="message" class="updated">%s</div>', __( 'Settings saved', 'footnotes' ) );
}
// Form to submit the active section.
echo '<!--suppress HtmlUnknownTarget --><form method="post" action="">';
echo '<input type="hidden" name="save-settings" value="save" />';
// Outputs the settings field of the active section.
do_settings_sections( $l_arr_active_section['id'] );
do_meta_boxes( $l_arr_active_section['id'], 'main', null );
// Add submit button to active section if defined.
if ( $l_arr_active_section['submit'] ) {
submit_button();
}
echo '</form>';
echo '</div>';
// Echo JavaScript for the expand/collapse function of the meta boxes.
echo '<script type="text/javascript">';
echo 'jQuery(document).ready(function ($) {';
echo 'jQuery(".mfmmf-color-picker").wpColorPicker();';
echo "jQuery('.if-js-closed').removeClass('if-js-closed').addClass('closed');";
echo "postboxes.add_postbox_toggles('" . $this->a_str_sub_page_hook . "');";
echo '});';
echo '</script>';
}
// phpcs:enable WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing
// phpcs:disable WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing
/**
* Save all Plugin settings.
*
* @since 1.5.0
* @return bool
*/
private function save_settings() {
$l_arr_new_settings = array();
// TODO: add nonce verification.
// Get current section.
reset( $this->a_arr_sections );
$l_str_active_section_id = isset( $_GET['t'] ) ? wp_unslash( $_GET['t'] ) : key( $this->a_arr_sections );
$l_arr_active_section = $this->a_arr_sections[ $l_str_active_section_id ];
foreach ( MCI_Footnotes_Settings::instance()->get_defaults( $l_arr_active_section['container'] ) as $l_str_key => $l_mixed_value ) {
if ( array_key_exists( $l_str_key, $_POST ) ) {
$l_arr_new_settings[ $l_str_key ] = wp_unslash( $_POST[ $l_str_key ] );
} else {
// Setting is not defined in the POST array, define it to avoid the Default value.
$l_arr_new_settings[ $l_str_key ] = '';
}
}
// Update settings.
return MCI_Footnotes_Settings::instance()->save_options( $l_arr_active_section['container'], $l_arr_new_settings );
}
// phpcs:enable WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing
/**
* Output the Description of a section. May be overwritten in any section.
*
* @since 1.5.0
*/
public function description() {
// Default no description will be displayed.
}
/**
* Loads specific setting and returns an array with the keys [id, name, value].
*
* @since 1.5.0
* @param string $p_str_setting_key_name Settings Array key name.
* @return array Contains Settings ID, Settings Name and Settings Value.
*
* @since 2.5.11 Remove escapement function.
* When refactoring the codebase after 2.5.8, all and every output was escaped.
* After noticing that the plugin was broken, all escapement functions were removed.
* @link https://github.com/markcheret/footnotes/pull/50/commits/25c3f2f12eb5de1079e9215bf624ec4289b095a5
* @link https://github.com/markcheret/footnotes/pull/50#issuecomment-787624123
* In that process, this instance of esc_attr() was removed too, so the plugin was
* broken again.
* @link https://github.com/markcheret/footnotes/pull/50/commits/25c3f2f12eb5de1079e9215bf624ec4289b095a5#diff-a8ed6e859c32a18fc10bbbad3b4dd8ce7f43f2378d29471c7638e314ab30f1bdL349-L354
*
* @since 2.5.15 To fix it, the data was escaped in add_select_box() instead.
* @since 2.6.1 Restore esc_attr() in load_setting().
* @see add_select_box()
* This is the only instance of esc_|kses|sanitize in the pre-2.5.11 codebase.
* Removing this did not fix the quotation mark backslash escapement bug.
*/
protected function load_setting( $p_str_setting_key_name ) {
// Get current section.
reset( $this->a_arr_sections );
$p_arr_return = array();
$p_arr_return['id'] = sprintf( '%s', $p_str_setting_key_name );
$p_arr_return['name'] = sprintf( '%s', $p_str_setting_key_name );
$p_arr_return['value'] = esc_attr( MCI_Footnotes_Settings::instance()->get( $p_str_setting_key_name ) );
return $p_arr_return;
}
/**
* Returns a line break to start a new line.
*
* @since 1.5.0
* @return string
*/
protected function add_newline() {
return '<br/>';
}
/**
* Returns a line break to have a space between two lines.
*
* @since 1.5.0
* @return string
*/
protected function add_line_space() {
return '<br/><br/>';
}
/**
* Returns a simple text inside html <span> text.
*
* @since 1.5.0
* @param string $p_str_text Message to be surrounded with simple html tag (span).
* @return string
*/
protected function add_text( $p_str_text ) {
return sprintf( '<span>%s</span>', $p_str_text );
}
/**
* Returns the html tag for an input/select label.
*
* @since 1.5.0
* @param string $p_str_setting_name Name of the Settings key to connect the Label with the input/select field.
* @param string $p_str_caption Label caption.
* @return string
*/
protected function add_label( $p_str_setting_name, $p_str_caption ) {
if ( empty( $p_str_caption ) ) {
return '';
}
/*
* Remove the colon causing localization issues with French, and with
* languages not using punctuation at all, and with languages using other
* punctuation marks instead of colon, e.g. Greek using a raised dot.
* In French, colon is preceded by a space, forcibly non-breaking, and
* narrow per new school.
* Add colon to label strings for inclusion in localization. Colon after
* label is widely preferred best practice, mandatory per
* [style guides](https://softwareengineering.stackexchange.com/questions/234546/colons-in-internationalized-ui).
*/
return sprintf( '<label for="%s">%s</label>', $p_str_setting_name, $p_str_caption );
}
/**
* Returns the html tag for an input [type = text].
*
* @since 1.5.0
* @param string $p_str_setting_name Name of the Settings key to pre load the input field.
* @param int $p_str_max_length Maximum length of the input, default 999 characters.
* @param bool $p_bool_readonly Set the input to be read only, default false.
* @param bool $p_bool_hidden Set the input to be hidden, default false.
* @return string
*/
protected function add_text_box( $p_str_setting_name, $p_str_max_length = 999, $p_bool_readonly = false, $p_bool_hidden = false ) {
$l_str_style = '';
// Collect data for given settings field.
$l_arr_data = $this->load_setting( $p_str_setting_name );
if ( $p_bool_hidden ) {
$l_str_style .= 'display:none;';
}
return sprintf(
'<input type="text" name="%s" id="%s" maxlength="%d" style="%s" value="%s" %s/>',
$l_arr_data['name'],
$l_arr_data['id'],
$p_str_max_length,
$l_str_style,
$l_arr_data['value'],
$p_bool_readonly ? 'readonly="readonly"' : ''
);
}
/**
* Returns the html tag for an input [type = checkbox].
*
* @since 1.5.0
* @param string $p_str_setting_name Name of the Settings key to pre load the input field.
* @return string
*/
protected function add_checkbox( $p_str_setting_name ) {
// Collect data for given settings field.
$l_arr_data = $this->load_setting( $p_str_setting_name );
return sprintf(
'<input type="checkbox" name="%s" id="%s" %s/>',
$l_arr_data['name'],
$l_arr_data['id'],
MCI_Footnotes_Convert::to_bool( $l_arr_data['value'] ) ? 'checked="checked"' : ''
);
}
/**
* Returns the html tag for a select box.
*
* @since 1.5.0
*
* - Bugfix: Dashboard: Referrers and tooltips: Backlink symbol: debug select box by reverting identity check to equality check, thanks to @lolzim bug report.
*
* @reporter @lolzim
*
* @since 2.5.13
* @param string $p_str_setting_name Name of the Settings key to pre select the current value.
* @param array $p_arr_options Possible options to be selected.
* @return string
*
* @since 2.5.15 Bugfix: Dashboard: General settings: Footnote start and end short codes: debug select box for shortcodes with pointy brackets.
* @since 2.6.1 Restore esc_attr() in load_setting(), remove htmlspecialchars() here.
*/
protected function add_select_box( $p_str_setting_name, $p_arr_options ) {
// Collect data for given settings field.
$l_arr_data = $this->load_setting( $p_str_setting_name );
$l_str_options = '';
// Loop through all array keys.
foreach ( $p_arr_options as $l_str_value => $l_str_caption ) {
$l_str_options .= sprintf(
'<option value="%s" %s>%s</option>',
$l_str_value,
// Only check for equality, not identity, WRT backlink symbol arrows.
$l_str_value == $l_arr_data['value'] ? 'selected' : '',
$l_str_caption
);
}
return sprintf(
'<select name="%s" id="%s">%s</select>',
$l_arr_data['name'],
$l_arr_data['id'],
$l_str_options
);
}
/**
* Returns the html tag for a text area.
*
* @since 1.5.0
* @param string $p_str_setting_name Name of the Settings key to pre fill the text area.
* @return string
*/
protected function add_textarea( $p_str_setting_name ) {
// Collect data for given settings field.
$l_arr_data = $this->load_setting( $p_str_setting_name );
return sprintf(
'<textarea name="%s" id="%s">%s</textarea>',
$l_arr_data['name'],
$l_arr_data['id'],
$l_arr_data['value']
);
}
/**
* Returns the html tag for an input [type = text] with color selection class.
*
* @since 1.5.6
* @param string $p_str_setting_name Name of the Settings key to pre load the input field.
* @return string
*/
protected function add_color_selection( $p_str_setting_name ) {
// Collect data for given settings field.
$l_arr_data = $this->load_setting( $p_str_setting_name );
return sprintf(
'<input type="text" name="%s" id="%s" class="mfmmf-color-picker" value="%s"/>',
$l_arr_data['name'],
$l_arr_data['id'],
$l_arr_data['value']
);
}
/**
* Returns the html tag for an input [type = num].
*
* @since 1.5.0
* @param string $p_str_setting_name Name of the Settings key to pre load the input field.
* @param int $p_in_min Minimum value.
* @param int $p_int_max Maximum value.
* @param bool $p_bool_deci true if 0.1 steps and floating to string, false if integer (default).
* @return string
*
* Edited:
* @since 2.1.4 step argument and number_format() to allow decimals 2020-12-03T0631+0100..2020-12-12T1110+0100
*/
protected function add_num_box( $p_str_setting_name, $p_in_min, $p_int_max, $p_bool_deci = false ) {
// Collect data for given settings field.
$l_arr_data = $this->load_setting( $p_str_setting_name );
if ( $p_bool_deci ) {
$l_str_value = number_format( floatval( $l_arr_data['value'] ), 1 );
return sprintf(
'<input type="number" name="%s" id="%s" value="%s" step="0.1" min="%d" max="%d"/>',
$l_arr_data['name'],
$l_arr_data['id'],
$l_str_value,
$p_in_min,
$p_int_max
);
} else {
return sprintf(
'<input type="number" name="%s" id="%s" value="%d" min="%d" max="%d"/>',
$l_arr_data['name'],
$l_arr_data['id'],
$l_arr_data['value'],
$p_in_min,
$p_int_max
);
}
}
}

View file

@ -0,0 +1,147 @@
<?php // phpcs:disable WordPress.Files.FileName.InvalidClassFileName, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.EscapeOutput.OutputNotEscaped
/**
* Includes the Plugin Class to display Diagnostics.
*
* @filesource
* @package footnotes
* @since 1.5.0
* @date 14.09.14 14:47
*/
/**
* Displays Diagnostics of the web server, PHP and WordPress.
*
* @since 1.5.0
*/
class MCI_Footnotes_Layout_Diagnostics extends MCI_Footnotes_Layout_Engine {
/**
* Returns a Priority index. Lower numbers have a higher Priority.
*
* @since 1.5.0
* @return int
*/
public function get_priority() {
return 999;
}
/**
* Returns the unique slug of the sub page.
*
* @since 1.5.0
* @return string
*/
protected function get_sub_page_slug() {
return '-diagnostics';
}
/**
* Returns the title of the sub page.
*
* @since 1.5.0
* @return string
*/
protected function get_sub_page_title() {
return __( 'Diagnostics', 'footnotes' );
}
/**
* Returns an array of all registered sections for the sub page.
*
* @since 1.5.0
* @return array
*/
protected function get_sections() {
return array(
$this->add_section( 'diagnostics', __( 'Diagnostics', 'footnotes' ), null, false ),
);
}
/**
* Returns an array of all registered meta boxes for each section of the sub page.
*
* @since 1.5.0
* @return array
*/
protected function get_meta_boxes() {
return array(
$this->add_meta_box( 'diagnostics', 'diagnostics', __( 'Displays information about the web server, PHP and WordPress', 'footnotes' ), 'Diagnostics' ),
);
}
/**
* Displays a diagnostics about the web server, php and WordPress.
*
* @since 1.5.0
*/
public function Diagnostics() {
global $wp_version;
$l_str_php_extensions = '';
// Iterate through each PHP extension.
foreach ( get_loaded_extensions() as $l_int_index => $l_str_extension ) {
if ( $l_int_index > 0 ) {
$l_str_php_extensions .= ' | ';
}
$l_str_php_extensions .= $l_str_extension . ' ' . phpversion( $l_str_extension );
}
$l_obj_current_theme = wp_get_theme();
$l_str_wordpress_plugins = '';
// Iterate through each installed WordPress Plugin.
foreach ( get_plugins() as $l_arr_plugin ) {
$l_str_wordpress_plugins .= '<tr>';
$l_str_wordpress_plugins .= '<td>' . $l_arr_plugin['Name'] . '</td>';
// phpcs:disable Generic.Strings.UnnecessaryStringConcat.Found
$l_str_wordpress_plugins .= '<td>' . $l_arr_plugin['Version'] . ' [' . $l_arr_plugin['PluginURI'] . ']' . '</td>';
// phpcs:enable Generic.Strings.UnnecessaryStringConcat.Found
$l_str_wordpress_plugins .= '</tr>';
}
// Load template file.
$l_obj_template = new MCI_Footnotes_Template( MCI_Footnotes_Template::C_STR_DASHBOARD, 'diagnostics' );
if ( ! isset( $_SERVER['SERVER_NAME'] ) ) {
die;
} else {
$l_str_server_name = wp_unslash( $_SERVER['SERVER_NAME'] );
}
if ( ! isset( $_SERVER['HTTP_USER_AGENT'] ) ) {
die;
} else {
$l_str_http_user_agent = wp_unslash( $_SERVER['HTTP_USER_AGENT'] );
}
// Replace all placeholders.
$l_obj_template->replace(
array(
'label-server' => __( 'Server name', 'footnotes' ),
'server' => $l_str_server_name,
'label-php' => __( 'PHP version', 'footnotes' ),
'php' => phpversion(),
'label-user-agent' => __( 'User agent', 'footnotes' ),
'user-agent' => $l_str_http_user_agent,
'label-max-execution-time' => __( 'Max execution time', 'footnotes' ),
'max-execution-time' => ini_get( 'max_execution_time' ) . ' ' . __( 'seconds', 'footnotes' ),
'label-memory-limit' => __( 'Memory limit', 'footnotes' ),
'memory-limit' => ini_get( 'memory_limit' ),
'label-php-extensions' => __( 'PHP extensions', 'footnotes' ),
'php-extensions' => $l_str_php_extensions,
'label-wordpress' => __( 'WordPress version', 'footnotes' ),
'wordpress' => $wp_version,
'label-theme' => __( 'Active Theme', 'footnotes' ),
'theme' => $l_obj_current_theme->get( 'Name' ) . ' ' . $l_obj_current_theme->get( 'Version' ) . ', ' . $l_obj_current_theme->get( 'Author' ) . ' [' . $l_obj_current_theme->get( 'AuthorURI' ) . ']',
'plugins' => $l_str_wordpress_plugins,
)
);
// Display template with replaced placeholders.
echo $l_obj_template->get_content();
}
}

207
class/layout/init.php Normal file
View file

@ -0,0 +1,207 @@
<?php // phpcs:disable WordPress.Files.FileName.InvalidClassFileName, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
/**
* Includes the Plugin settings menu.
*
* @filesource
* @package footnotes
* @since 1.5.0
* @date 12.09.14 10:26
*/
/**
* Handles the Settings interface of the Plugin.
*
* @since 1.5.0
*/
class MCI_Footnotes_Layout_Init {
/**
* Slug for the Plugin main menu.
*
* @since 1.5.0
* @var string
*/
const C_STR_MAIN_MENU_SLUG = 'mfmmf';
/**
* Plugin main menu name.
*
* @since 1.5.0
* @var string
*/
const C_STR_MAIN_MENU_TITLE = 'ManFisher';
/**
* Contains layout engine sub classes.
*
* @since 1.5.0
* @var array
*/
private $a_arr_sub_page_classes = array();
/**
* Class Constructor. Initializes all WordPress hooks for the Plugin Settings.
*
* @since 1.5.0
*/
public function __construct() {
foreach ( get_declared_classes() as $l_str_class_name ) {
if ( is_subclass_of( $l_str_class_name, 'MCI_Footnotes_Layout_Engine' ) ) {
$l_obj_class = new $l_str_class_name();
// Append new instance of the layout engine sub class.
$this->a_arr_sub_page_classes[ $l_obj_class->get_priority() ] = $l_obj_class;
}
}
ksort( $this->a_arr_sub_page_classes );
// Register hooks/actions.
add_action( 'admin_init', array( $this, 'initialize_settings' ) );
add_action( 'admin_menu', array( $this, 'register_main_menu' ) );
// Register AJAX callbacks for Plugin information.
add_action( 'wp_ajax_nopriv_footnotes_get_plugin_info', array( $this, 'get_plugin_meta_information' ) );
add_action( 'wp_ajax_footnotes_get_plugin_info', array( $this, 'get_plugin_meta_information' ) );
}
/**
* Initializes all sub pages and registers the settings.
*
* @since 1.5.0
*/
public function initialize_settings() {
MCI_Footnotes_Settings::instance()->register_settings();
// Iterate though each sub class of the layout engine and register their sections.
foreach ( $this->a_arr_sub_page_classes as $l_obj_layout_engine_sub_class ) {
$l_obj_layout_engine_sub_class->register_sections();
}
}
/**
* Registers the new main menu for the WordPress dashboard.
* Registers all sub menu pages for the new main menu.
*
* @since 1.5.0
* @see http://codex.wordpress.org/Function_Reference/add_menu_page
*/
public function register_main_menu() {
global $menu;
// Iterate through each main menu.
foreach ( $menu as $l_arr_main_menu ) {
// 3terate through each main menu attribute.
foreach ( $l_arr_main_menu as $l_str_attribute ) {
// Main menu already added, append sub pages and stop.
if ( self::C_STR_MAIN_MENU_SLUG === $l_str_attribute ) {
$this->register_sub_pages();
return;
}
}
}
// Add a new main menu page to the WordPress dashboard.
add_menu_page(
self::C_STR_MAIN_MENU_TITLE, // Page title.
self::C_STR_MAIN_MENU_TITLE, // Menu title.
'manage_options', // Capability.
self::C_STR_MAIN_MENU_SLUG, // Menu slug.
array( $this, 'display_other_plugins' ), // Function.
plugins_url( 'footnotes/img/main-menu.png' ), // Icon URL.
null // Position.
);
$this->register_sub_pages();
}
/**
* Registers all SubPages for this Plugin.
*
* @since 1.5.0
*/
private function register_sub_pages() {
// First registered sub menu page MUST NOT contain a unique slug suffix.
// Iterate though each sub class of the layout engine and register their sub page.
foreach ( $this->a_arr_sub_page_classes as $l_obj_layout_engine_sub_class ) {
$l_obj_layout_engine_sub_class->register_sub_page();
}
}
/**
* Displays other Plugins from the developers.
*
* @since 1.5.0
*/
public function display_other_plugins() {
printf( '<br/><br/>' );
// Load template file.
$l_obj_template = new MCI_Footnotes_Template( MCI_Footnotes_Template::C_STR_DASHBOARD, 'manfisher' );
// phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
echo $l_obj_template->get_content();
// phpcs:enable WordPress.Security.EscapeOutput.OutputNotEscaped
printf( '<em>visit <a href="https://cheret.org/footnotes/" target="_blank">Mark Cheret</a></em>' );
printf( '<br/><br/>' );
printf( '</div>' );
}
// phpcs:disable WordPress.Security.NonceVerification.Missing
/**
* AJAX call. returns a JSON string containing meta information about a specific WordPress Plugin.
*
* @since 1.5.0
*/
public function get_plugin_meta_information() {
// TODO: add nonce verification.
// Get plugin internal name from POST data.
if ( isset( $_POST['plugin'] ) ) {
$l_str_plugin_name = wp_unslash( $_POST['plugin'] );
}
if ( empty( $l_str_plugin_name ) ) {
echo wp_json_encode( array( 'error' => 'Plugin name invalid.' ) );
exit;
}
$l_str_url = 'https://api.wordpress.org/plugins/info/1.0/' . $l_str_plugin_name . '.json';
// Call URL and collect data.
$l_arr_response = wp_remote_get( $l_str_url );
// Check if response is valid.
if ( is_wp_error( $l_arr_response ) ) {
echo wp_json_encode( array( 'error' => 'Error receiving Plugin Information from WordPress.' ) );
exit;
}
if ( ! array_key_exists( 'body', $l_arr_response ) ) {
echo wp_json_encode( array( 'error' => 'Error reading WordPress API response message.' ) );
exit;
}
// Get the body of the response.
$l_str_response = $l_arr_response['body'];
// Get plugin object.
$l_arr_plugin = json_decode( $l_str_response, true );
if ( empty( $l_arr_plugin ) ) {
echo wp_json_encode( array( 'error' => 'Error reading Plugin meta information.<br/>URL: ' . $l_str_url . '<br/>Response: ' . $l_str_response ) );
exit;
}
$l_int_num_ratings = array_key_exists( 'num_ratings', $l_arr_plugin ) ? intval( $l_arr_plugin['num_ratings'] ) : 0;
$l_int_rating = array_key_exists( 'rating', $l_arr_plugin ) ? floatval( $l_arr_plugin['rating'] ) : 0.0;
$l_int_stars = round( 5 * $l_int_rating / 100.0, 1 );
// Return Plugin information as JSON encoded string.
echo wp_json_encode(
array(
'error' => '',
'PluginDescription' => array_key_exists( 'short_description', $l_arr_plugin ) ? html_entity_decode( $l_arr_plugin['short_description'] ) : 'Error reading Plugin information',
'PluginAuthor' => array_key_exists( 'author', $l_arr_plugin ) ? html_entity_decode( $l_arr_plugin['author'] ) : 'unknown',
'PluginRatingText' => $l_int_stars . ' ' . __( 'rating based on', 'footnotes' ) . ' ' . $l_int_num_ratings . ' ' . __( 'ratings', 'footnotes' ),
'PluginRating1' => $l_int_stars >= 0.5 ? 'star-full' : 'star-empty',
'PluginRating2' => $l_int_stars >= 1.5 ? 'star-full' : 'star-empty',
'PluginRating3' => $l_int_stars >= 2.5 ? 'star-full' : 'star-empty',
'PluginRating4' => $l_int_stars >= 3.5 ? 'star-full' : 'star-empty',
'PluginRating5' => $l_int_stars >= 4.5 ? 'star-full' : 'star-empty',
'PluginRating' => $l_int_num_ratings,
'PluginLastUpdated' => array_key_exists( 'last_updated', $l_arr_plugin ) ? $l_arr_plugin['last_updated'] : 'unknown',
'PluginDownloads' => array_key_exists( 'downloaded', $l_arr_plugin ) ? $l_arr_plugin['downloaded'] : '---',
)
);
exit;
}
// phpcs:enable WordPress.Security.NonceVerification.Missing
}

1380
class/layout/settings.php Normal file

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -8,7 +8,7 @@
* @date 14.09.14 10:58
*
* @since 2.2.6 Adding: Templates: support for custom templates in sibling folder, thanks to @misfist issue report.
* @since 2.5.0 Adding: Templates: Enable template location stack, thanks to @misfist code contribution.
* @since 2.5.0 Adding: Templates: Enable template location stack, thanks to @misfist issue report and code contribution.
*/
/**
@ -176,7 +176,7 @@ class MCI_Footnotes_Template {
/**
* Get the template.
*
* - Adding: Templates: Enable template location stack, thanks to @misfist code contribution.
* - Adding: Templates: Enable template location stack, thanks to @misfist issue report and code contribution.
*
* @since 2.4.0d3 Contribution.
* @since 2.5.0 Release.

View file

@ -6,8 +6,6 @@
* @package footnotes
* @since 1.5.0
* @date 14.09.14 14:26
*
* @since 2.2.0 (TBD) 2020-12-12T2131+0100
*/
/**
@ -66,7 +64,7 @@ class MCI_Footnotes_Widget_Reference_Container extends MCI_Footnotes_Widget_Base
* Outputs the Content of the Widget.
*
* @since 1.5.0
* @param mixed $args The widget's arguments.
* @param mixed $args The widget's arguments.
* @param mixed $instance The instance of the widget.
*/
public function widget( $args, $instance ) {
@ -74,7 +72,7 @@ class MCI_Footnotes_Widget_Reference_Container extends MCI_Footnotes_Widget_Base
// Reference container positioning is set to "widget area".
if ( 'widget' === MCI_Footnotes_Settings::instance()->get( MCI_Footnotes_Settings::C_STR_REFERENCE_CONTAINER_POSITION ) ) {
// phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
echo $g_obj_mci_footnotes->a_obj_task->Reference_Container();
echo $g_obj_mci_footnotes->a_obj_task->reference_container();
// phpcs:enable
}
}

View file

@ -18,6 +18,14 @@ class MCI_Footnotes_WYSIWYG {
/**
* Registers Button hooks.
*
* @since 1.5.0
*
* - Bugfix: Editor buttons: debug button by reverting name change in PHP file while JS file and HTML template remained unsynced, thanks to @gova bug report.
*
* @reporter @gova
* @link https://wordpress.org/support/topic/back-end-footnotes-not-working-400-bad-erro/
*
* @since 2.6.5
* @return void
*/
public static function register_hooks() {
@ -26,8 +34,12 @@ class MCI_Footnotes_WYSIWYG {
add_filter( 'mce_external_plugins', array( 'MCI_Footnotes_WYSIWYG', 'include_scripts' ) );
add_action( 'wp_ajax_nopriv_footnotes_get_tags', array( 'MCI_Footnotes_WYSIWYG', 'ajax_callback' ) );
add_action( 'wp_ajax_footnotes_get_tags', array( 'MCI_Footnotes_WYSIWYG', 'ajax_callback' ) );
// phpcs:disable
// 'footnotes_getTags' must match its instance in wysiwyg-editor.js.
// 'footnotes_getTags' must match its instance in editor-button.html.
add_action( 'wp_ajax_nopriv_footnotes_getTags', array( 'MCI_Footnotes_WYSIWYG', 'ajax_callback' ) );
add_action( 'wp_ajax_footnotes_getTags', array( 'MCI_Footnotes_WYSIWYG', 'ajax_callback' ) );
// phpcs:enable
}
@ -81,7 +93,7 @@ class MCI_Footnotes_WYSIWYG {
$l_str_starting_tag = MCI_Footnotes_Settings::instance()->get( MCI_Footnotes_Settings::C_STR_FOOTNOTES_SHORT_CODE_START_USER_DEFINED );
$l_str_ending_tag = MCI_Footnotes_Settings::instance()->get( MCI_Footnotes_Settings::C_STR_FOOTNOTES_SHORT_CODE_END_USER_DEFINED );
}
echo wp_json_encode(
echo json_encode(
array(
'start' => htmlspecialchars( $l_str_starting_tag ),
'end' => htmlspecialchars( $l_str_ending_tag ),

182
composer.lock generated
View file

@ -328,16 +328,16 @@
},
{
"name": "jawira/plantuml",
"version": "v1.52.0",
"version": "v1.54.0",
"source": {
"type": "git",
"url": "https://github.com/jawira/plantuml.git",
"reference": "297a2845de839d1289f6d1805a30fe0ebed1c23a"
"reference": "d313d5373618fef6a6c09eeae9676538c38da6a9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/jawira/plantuml/zipball/297a2845de839d1289f6d1805a30fe0ebed1c23a",
"reference": "297a2845de839d1289f6d1805a30fe0ebed1c23a",
"url": "https://api.github.com/repos/jawira/plantuml/zipball/d313d5373618fef6a6c09eeae9676538c38da6a9",
"reference": "d313d5373618fef6a6c09eeae9676538c38da6a9",
"shasum": ""
},
"suggest": {
@ -366,9 +366,9 @@
],
"support": {
"issues": "https://github.com/jawira/plantuml/issues",
"source": "https://github.com/jawira/plantuml/tree/v1.52.0"
"source": "https://github.com/jawira/plantuml/tree/v1.54.0"
},
"time": "2021-03-12T14:07:11+00:00"
"time": "2021-04-09T13:05:56+00:00"
},
{
"name": "jean85/pretty-package-versions",
@ -427,16 +427,16 @@
},
{
"name": "laminas/laminas-code",
"version": "4.0.0",
"version": "4.1.0",
"source": {
"type": "git",
"url": "https://github.com/laminas/laminas-code.git",
"reference": "28a6d70ea8b8bca687d7163300e611ae33baf82a"
"reference": "5b553c274b94af3f880cbaaf8fbab047f279a31c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laminas/laminas-code/zipball/28a6d70ea8b8bca687d7163300e611ae33baf82a",
"reference": "28a6d70ea8b8bca687d7163300e611ae33baf82a",
"url": "https://api.github.com/repos/laminas/laminas-code/zipball/5b553c274b94af3f880cbaaf8fbab047f279a31c",
"reference": "5b553c274b94af3f880cbaaf8fbab047f279a31c",
"shasum": ""
},
"require": {
@ -494,7 +494,7 @@
"type": "community_bridge"
}
],
"time": "2020-12-30T16:16:14+00:00"
"time": "2021-03-27T13:55:31+00:00"
},
{
"name": "laminas/laminas-eventmanager",
@ -626,16 +626,16 @@
},
{
"name": "league/commonmark",
"version": "1.5.7",
"version": "1.5.8",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/commonmark.git",
"reference": "11df9b36fd4f1d2b727a73bf14931d81373b9a54"
"reference": "08fa59b8e4e34ea8a773d55139ae9ac0e0aecbaf"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/commonmark/zipball/11df9b36fd4f1d2b727a73bf14931d81373b9a54",
"reference": "11df9b36fd4f1d2b727a73bf14931d81373b9a54",
"url": "https://api.github.com/repos/thephpleague/commonmark/zipball/08fa59b8e4e34ea8a773d55139ae9ac0e0aecbaf",
"reference": "08fa59b8e4e34ea8a773d55139ae9ac0e0aecbaf",
"shasum": ""
},
"require": {
@ -723,7 +723,7 @@
"type": "tidelift"
}
],
"time": "2020-10-31T13:49:32+00:00"
"time": "2021-03-28T18:51:39+00:00"
},
{
"name": "league/flysystem",
@ -2265,16 +2265,16 @@
},
{
"name": "squizlabs/php_codesniffer",
"version": "3.5.8",
"version": "3.6.0",
"source": {
"type": "git",
"url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
"reference": "9d583721a7157ee997f235f327de038e7ea6dac4"
"reference": "ffced0d2c8fa8e6cdc4d695a743271fab6c38625"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/9d583721a7157ee997f235f327de038e7ea6dac4",
"reference": "9d583721a7157ee997f235f327de038e7ea6dac4",
"url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/ffced0d2c8fa8e6cdc4d695a743271fab6c38625",
"reference": "ffced0d2c8fa8e6cdc4d695a743271fab6c38625",
"shasum": ""
},
"require": {
@ -2317,20 +2317,20 @@
"source": "https://github.com/squizlabs/PHP_CodeSniffer",
"wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki"
},
"time": "2020-10-23T02:01:07+00:00"
"time": "2021-04-09T00:54:41+00:00"
},
{
"name": "symfony/cache",
"version": "v5.2.4",
"version": "v5.2.6",
"source": {
"type": "git",
"url": "https://github.com/symfony/cache.git",
"reference": "d15fb2576cdbe2c40d7c851e62f85b0faff3dd3d"
"reference": "093d69bb10c959553c8beb828b8d4ea250a247dd"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/cache/zipball/d15fb2576cdbe2c40d7c851e62f85b0faff3dd3d",
"reference": "d15fb2576cdbe2c40d7c851e62f85b0faff3dd3d",
"url": "https://api.github.com/repos/symfony/cache/zipball/093d69bb10c959553c8beb828b8d4ea250a247dd",
"reference": "093d69bb10c959553c8beb828b8d4ea250a247dd",
"shasum": ""
},
"require": {
@ -2396,7 +2396,7 @@
"psr6"
],
"support": {
"source": "https://github.com/symfony/cache/tree/v5.2.4"
"source": "https://github.com/symfony/cache/tree/v5.2.6"
},
"funding": [
{
@ -2412,7 +2412,7 @@
"type": "tidelift"
}
],
"time": "2021-02-25T23:54:56+00:00"
"time": "2021-03-16T09:10:13+00:00"
},
{
"name": "symfony/config",
@ -2494,16 +2494,16 @@
},
{
"name": "symfony/console",
"version": "v5.2.5",
"version": "v5.2.6",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
"reference": "938ebbadae1b0a9c9d1ec313f87f9708609f1b79"
"reference": "35f039df40a3b335ebf310f244cb242b3a83ac8d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/938ebbadae1b0a9c9d1ec313f87f9708609f1b79",
"reference": "938ebbadae1b0a9c9d1ec313f87f9708609f1b79",
"url": "https://api.github.com/repos/symfony/console/zipball/35f039df40a3b335ebf310f244cb242b3a83ac8d",
"reference": "35f039df40a3b335ebf310f244cb242b3a83ac8d",
"shasum": ""
},
"require": {
@ -2571,7 +2571,7 @@
"terminal"
],
"support": {
"source": "https://github.com/symfony/console/tree/v5.2.5"
"source": "https://github.com/symfony/console/tree/v5.2.6"
},
"funding": [
{
@ -2587,7 +2587,7 @@
"type": "tidelift"
}
],
"time": "2021-03-06T13:42:15+00:00"
"time": "2021-03-28T09:42:18+00:00"
},
{
"name": "symfony/contracts",
@ -2690,16 +2690,16 @@
},
{
"name": "symfony/dependency-injection",
"version": "v5.2.5",
"version": "v5.2.6",
"source": {
"type": "git",
"url": "https://github.com/symfony/dependency-injection.git",
"reference": "be0c7926f5729b15e4e79fd2bf917cac584b1970"
"reference": "1e66194bed2a69fa395d26bf1067e5e34483afac"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/dependency-injection/zipball/be0c7926f5729b15e4e79fd2bf917cac584b1970",
"reference": "be0c7926f5729b15e4e79fd2bf917cac584b1970",
"url": "https://api.github.com/repos/symfony/dependency-injection/zipball/1e66194bed2a69fa395d26bf1067e5e34483afac",
"reference": "1e66194bed2a69fa395d26bf1067e5e34483afac",
"shasum": ""
},
"require": {
@ -2757,7 +2757,7 @@
"description": "Allows you to standardize and centralize the way objects are constructed in your application",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/dependency-injection/tree/v5.2.5"
"source": "https://github.com/symfony/dependency-injection/tree/v5.2.6"
},
"funding": [
{
@ -2773,7 +2773,7 @@
"type": "tidelift"
}
],
"time": "2021-03-05T20:13:41+00:00"
"time": "2021-03-22T11:10:24+00:00"
},
{
"name": "symfony/dom-crawler",
@ -2921,16 +2921,16 @@
},
{
"name": "symfony/error-handler",
"version": "v5.2.4",
"version": "v5.2.6",
"source": {
"type": "git",
"url": "https://github.com/symfony/error-handler.git",
"reference": "b547d3babcab5c31e01de59ee33e9d9c1421d7d0"
"reference": "bdb7fb4188da7f4211e4b88350ba0dfdad002b03"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/error-handler/zipball/b547d3babcab5c31e01de59ee33e9d9c1421d7d0",
"reference": "b547d3babcab5c31e01de59ee33e9d9c1421d7d0",
"url": "https://api.github.com/repos/symfony/error-handler/zipball/bdb7fb4188da7f4211e4b88350ba0dfdad002b03",
"reference": "bdb7fb4188da7f4211e4b88350ba0dfdad002b03",
"shasum": ""
},
"require": {
@ -2970,7 +2970,7 @@
"description": "Provides tools to manage errors and ease debugging PHP code",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/error-handler/tree/v5.2.4"
"source": "https://github.com/symfony/error-handler/tree/v5.2.6"
},
"funding": [
{
@ -2986,7 +2986,7 @@
"type": "tidelift"
}
],
"time": "2021-02-11T08:21:20+00:00"
"time": "2021-03-16T09:07:47+00:00"
},
{
"name": "symfony/event-dispatcher",
@ -3139,16 +3139,16 @@
},
{
"name": "symfony/filesystem",
"version": "v5.2.4",
"version": "v5.2.6",
"source": {
"type": "git",
"url": "https://github.com/symfony/filesystem.git",
"reference": "710d364200997a5afde34d9fe57bd52f3cc1e108"
"reference": "8c86a82f51658188119e62cff0a050a12d09836f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/filesystem/zipball/710d364200997a5afde34d9fe57bd52f3cc1e108",
"reference": "710d364200997a5afde34d9fe57bd52f3cc1e108",
"url": "https://api.github.com/repos/symfony/filesystem/zipball/8c86a82f51658188119e62cff0a050a12d09836f",
"reference": "8c86a82f51658188119e62cff0a050a12d09836f",
"shasum": ""
},
"require": {
@ -3181,7 +3181,7 @@
"description": "Provides basic utilities for the filesystem",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/filesystem/tree/v5.2.4"
"source": "https://github.com/symfony/filesystem/tree/v5.2.6"
},
"funding": [
{
@ -3197,7 +3197,7 @@
"type": "tidelift"
}
],
"time": "2021-02-12T10:38:38+00:00"
"time": "2021-03-28T14:30:26+00:00"
},
{
"name": "symfony/finder",
@ -3330,16 +3330,16 @@
},
{
"name": "symfony/framework-bundle",
"version": "v5.2.5",
"version": "v5.2.6",
"source": {
"type": "git",
"url": "https://github.com/symfony/framework-bundle.git",
"reference": "4dae531503072a57cf26f7f4beb4c3ef8a061f8f"
"reference": "8889da18c6faa76c6149a90e6542be4afe723f2f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/framework-bundle/zipball/4dae531503072a57cf26f7f4beb4c3ef8a061f8f",
"reference": "4dae531503072a57cf26f7f4beb4c3ef8a061f8f",
"url": "https://api.github.com/repos/symfony/framework-bundle/zipball/8889da18c6faa76c6149a90e6542be4afe723f2f",
"reference": "8889da18c6faa76c6149a90e6542be4afe723f2f",
"shasum": ""
},
"require": {
@ -3459,7 +3459,7 @@
"description": "Provides a tight integration between Symfony components and the Symfony full-stack framework",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/framework-bundle/tree/v5.2.5"
"source": "https://github.com/symfony/framework-bundle/tree/v5.2.6"
},
"funding": [
{
@ -3475,7 +3475,7 @@
"type": "tidelift"
}
],
"time": "2021-03-09T08:47:49+00:00"
"time": "2021-03-22T14:43:01+00:00"
},
{
"name": "symfony/http-foundation",
@ -3552,16 +3552,16 @@
},
{
"name": "symfony/http-kernel",
"version": "v5.2.5",
"version": "v5.2.6",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-kernel.git",
"reference": "b8c63ef63c2364e174c3b3e0ba0bf83455f97f73"
"reference": "f34de4c61ca46df73857f7f36b9a3805bdd7e3b2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/http-kernel/zipball/b8c63ef63c2364e174c3b3e0ba0bf83455f97f73",
"reference": "b8c63ef63c2364e174c3b3e0ba0bf83455f97f73",
"url": "https://api.github.com/repos/symfony/http-kernel/zipball/f34de4c61ca46df73857f7f36b9a3805bdd7e3b2",
"reference": "f34de4c61ca46df73857f7f36b9a3805bdd7e3b2",
"shasum": ""
},
"require": {
@ -3644,7 +3644,7 @@
"description": "Provides a structured process for converting a Request into a Response",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/http-kernel/tree/v5.2.5"
"source": "https://github.com/symfony/http-kernel/tree/v5.2.6"
},
"funding": [
{
@ -3660,7 +3660,7 @@
"type": "tidelift"
}
],
"time": "2021-03-10T17:07:35+00:00"
"time": "2021-03-29T05:16:58+00:00"
},
{
"name": "symfony/monolog-bridge",
@ -3746,30 +3746,30 @@
},
{
"name": "symfony/monolog-bundle",
"version": "v3.6.0",
"version": "v3.7.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/monolog-bundle.git",
"reference": "e495f5c7e4e672ffef4357d4a4d85f010802f940"
"reference": "4054b2e940a25195ae15f0a49ab0c51718922eb4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/monolog-bundle/zipball/e495f5c7e4e672ffef4357d4a4d85f010802f940",
"reference": "e495f5c7e4e672ffef4357d4a4d85f010802f940",
"url": "https://api.github.com/repos/symfony/monolog-bundle/zipball/4054b2e940a25195ae15f0a49ab0c51718922eb4",
"reference": "4054b2e940a25195ae15f0a49ab0c51718922eb4",
"shasum": ""
},
"require": {
"monolog/monolog": "~1.22 || ~2.0",
"php": ">=5.6",
"symfony/config": "~3.4 || ~4.0 || ^5.0",
"symfony/dependency-injection": "~3.4.10 || ^4.0.10 || ^5.0",
"symfony/http-kernel": "~3.4 || ~4.0 || ^5.0",
"symfony/monolog-bridge": "~3.4 || ~4.0 || ^5.0"
"php": ">=7.1.3",
"symfony/config": "~4.4 || ^5.0",
"symfony/dependency-injection": "^4.4 || ^5.0",
"symfony/http-kernel": "~4.4 || ^5.0",
"symfony/monolog-bridge": "~4.4 || ^5.0"
},
"require-dev": {
"symfony/console": "~3.4 || ~4.0 || ^5.0",
"symfony/phpunit-bridge": "^4.4 || ^5.0",
"symfony/yaml": "~3.4 || ~4.0 || ^5.0"
"symfony/console": "~4.4 || ^5.0",
"symfony/phpunit-bridge": "^5.1",
"symfony/yaml": "~4.4 || ^5.0"
},
"type": "symfony-bundle",
"extra": {
@ -3796,18 +3796,18 @@
},
{
"name": "Symfony Community",
"homepage": "http://symfony.com/contributors"
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony MonologBundle",
"homepage": "http://symfony.com",
"homepage": "https://symfony.com",
"keywords": [
"log",
"logging"
],
"support": {
"issues": "https://github.com/symfony/monolog-bundle/issues",
"source": "https://github.com/symfony/monolog-bundle/tree/v3.6.0"
"source": "https://github.com/symfony/monolog-bundle/tree/v3.7.0"
},
"funding": [
{
@ -3823,7 +3823,7 @@
"type": "tidelift"
}
],
"time": "2020-10-06T15:12:11+00:00"
"time": "2021-03-31T07:20:47+00:00"
},
{
"name": "symfony/polyfill-ctype",
@ -4442,16 +4442,16 @@
},
{
"name": "symfony/routing",
"version": "v5.2.4",
"version": "v5.2.6",
"source": {
"type": "git",
"url": "https://github.com/symfony/routing.git",
"reference": "cafa138128dfd6ab6be1abf6279169957b34f662"
"reference": "31fba555f178afd04d54fd26953501b2c3f0c6e6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/routing/zipball/cafa138128dfd6ab6be1abf6279169957b34f662",
"reference": "cafa138128dfd6ab6be1abf6279169957b34f662",
"url": "https://api.github.com/repos/symfony/routing/zipball/31fba555f178afd04d54fd26953501b2c3f0c6e6",
"reference": "31fba555f178afd04d54fd26953501b2c3f0c6e6",
"shasum": ""
},
"require": {
@ -4512,7 +4512,7 @@
"url"
],
"support": {
"source": "https://github.com/symfony/routing/tree/v5.2.4"
"source": "https://github.com/symfony/routing/tree/v5.2.6"
},
"funding": [
{
@ -4528,7 +4528,7 @@
"type": "tidelift"
}
],
"time": "2021-02-22T15:48:39+00:00"
"time": "2021-03-14T13:53:33+00:00"
},
{
"name": "symfony/stopwatch",
@ -4677,16 +4677,16 @@
},
{
"name": "symfony/var-dumper",
"version": "v5.2.5",
"version": "v5.2.6",
"source": {
"type": "git",
"url": "https://github.com/symfony/var-dumper.git",
"reference": "002ab5a36702adf0c9a11e6d8836623253e9045e"
"reference": "89412a68ea2e675b4e44f260a5666729f77f668e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/002ab5a36702adf0c9a11e6d8836623253e9045e",
"reference": "002ab5a36702adf0c9a11e6d8836623253e9045e",
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/89412a68ea2e675b4e44f260a5666729f77f668e",
"reference": "89412a68ea2e675b4e44f260a5666729f77f668e",
"shasum": ""
},
"require": {
@ -4745,7 +4745,7 @@
"dump"
],
"support": {
"source": "https://github.com/symfony/var-dumper/tree/v5.2.5"
"source": "https://github.com/symfony/var-dumper/tree/v5.2.6"
},
"funding": [
{
@ -4761,7 +4761,7 @@
"type": "tidelift"
}
],
"time": "2021-03-06T07:59:01+00:00"
"time": "2021-03-28T09:42:18+00:00"
},
{
"name": "symfony/var-exporter",

65
css/dev-amp-tooltips.css Normal file
View file

@ -0,0 +1,65 @@
/*<?php for docblocks
/**
* Additional stylesheet for AMP compatible tooltips.
*
* - Adding: Tooltips: make display work purely by style rules for AMP compatibility, thanks to @milindmore22 code contribution.
* - Bugfix: Tooltips: enable accessibility by keyboard navigation, thanks to @westonruter code contribution.
*
* @since 2.5.11 (draft)
* @since 2.6.0 (release)
*
* @contributor @milindmore22
* @link https://github.com/ampproject/amp-wp/issues/5913#issuecomment-785306933
*
* @contributor @westonruter
* @link https://github.com/ampproject/amp-wp/issues/5913#issuecomment-785419655
*
* To streamline internal CSS, immutable rules are in external stylesheet.
* Property values of settings are internal CSS.
* @see class/task.php
*
* System of unified minified style sheets tailored to the instance.
* @see dev-common.css.
*/
span.footnote_referrer > span.footnote_tooltip {
visibility: hidden;
opacity: 0;
transition-property: visibility, opacity;
/*
transition-delay: 500ms;
transition-duration: 1s;
*/
}
span.footnote_referrer:focus-within > span.footnote_tooltip,
span.footnote_referrer:hover > span.footnote_tooltip {
visibility: visible;
opacity: 1;
transition-property: visibility, opacity;
/*
transition-delay: 0;
transition-duration: 200ms;
*/
}
/**
* Position.
*
* Values are defined by internal CSS.
* @see class/task.php
*/
.footnote_referrer.relative {
position: relative;
}
.footnote_tooltip.position {
display: unset;
position: absolute;
/*
bottom: 24px;
left: -50px;
width: 400px;
*/
}

1
css/dev-amp-tooltips.min.css vendored Normal file
View file

@ -0,0 +1 @@
span.footnote_referrer>span.footnote_tooltip{visibility:hidden;opacity:0;transition-property:visibility,opacity}span.footnote_referrer:focus-within>span.footnote_tooltip,span.footnote_referrer:hover>span.footnote_tooltip{visibility:visible;opacity:1;transition-property:visibility,opacity}.footnote_referrer.relative{position:relative}.footnote_tooltip.position{display:unset;position:absolute}

View file

@ -5,53 +5,46 @@
* Created-Date: 15.05.14
* Created-Time: 16:21
* Since: 1.0
*
* @version 2.5.8
* @lastmodified 2021-02-28T1320+0100
*
* Classes recommended for Custom CSS:
* @see templates/dashboard/customize-css-new.html
*/
/**
*
* System of unified minified style sheets tailored to the needs of the instance.
*
*
* - Update: Stylesheets: increase speed and energy efficiency by tailoring stylesheets to the needs of the instance, thanks to @docteurfitness design contribution.
* - Bugfix: Stylesheets: minify to shrink the carbon footprint, increase speed and implement best practice, thanks to @docteurfitness issue report.
*
* @since 2.5.5
* @date 2021-02-14T1543+0100
*
* @contributor @docteurfitness
* @link https://wordpress.org/support/topic/simply-speed-optimisation/
*
* @reporter @docteurfitness
* @link https://wordpress.org/support/topic/simply-speed-optimisation/
*
* @contributor @docteurfitness
* @link https://wordpress.org/support/topic/simply-speed-optimisation/
*
* @since 2.5.5
* @date 2021-02-14T1543+0100
*
* Six development stylesheets are concatenated to 12 unified stylesheets.
* @see development/csscat.sh
* Once these are minified, the temporary files are deleted to streamline
* the plugins codebase.
* The stylesheet file names consist of "footnotes-" and a code showing
* which additional stlesheets enter into its composition:
*
* The unminified development stylesheets are distributed for reference.
* Their minified versions are included for consistency and convenience.
*
* A production stylesheet file name consists of "footnotes-" and a code
* showing which additional stlesheets enter into its composition.
*
* The first part of the code contains 4 letters showing whether tooltips
* are enabled, and if so, which implementation: jQuery or alternative:
* nott no tooltips -
* jqtt jQuery tooltips dev-tooltips.css
* altt alternative tooltips dev-tooltips.css & dev-tooltips-alternative.css
*
* The second part of the code consists of the 4 letters "brpl", for
* Basic Responsive Page Layout, followed by a digit showing if a fix
* is applied, and if so, which one:
* 0 -
* 1 dev-layout-reference-container.css (only)
* 2 dev-layout-entry-content.css article without the title
* 3 dev-layout-main-content.css the article with its title
*
* The dashboard stylesheet is minified as-is.
* @see class/dashboard/layout.php
*
* are enabled, and if so, of which implementation:
* ampt AMP compatible tooltips dev-tooltips.css & dev-amp-tooltips.css
* altt alternative tooltips dev-tooltips.css & dev-tooltips-alternative.css
* jqtt jQuery tooltips dev-tooltips.css
* nott no tooltips -
*
* The second part of the code consists of the initialism of
* Basic Responsive Page Layout, followed by a digit showing
* if a fix is applied, and if so, which one:
* 0 -
* 1 dev-layout-reference-container.css footnote list only
* 2 dev-layout-entry-content.css post without title
* 3 dev-layout-main-content.css title and post
*
* @since 2.0.0 various.
* @since 2.0.0 Referrers: vertical align: lower from top: 0.4em to top: 0.6em
* @since 2.0.0 Tooltips: Font size: set to inherit instead of 13px
@ -65,6 +58,7 @@
* @since 2.3.0 offset anchors for optional hard links, thanks to @psychonevro @martinneumannat bug reports
* @since 2.4.0 validation error warning box
* @since 2.5.0 validation error warning box more paragraphs
* @since 2.5.11 Bugfix: Reference container: apply web semantics to improve readability for assistive technologies, thanks to @derivationfr issue report and code contribution.
*/
/**
@ -133,7 +127,6 @@
* word-wrap: anywhere;
* word-break: break-all;
*
*
* - Bugfix: Reference container, tooltips: URL wrap: enable the 'word-wrap: anywhere' rule, thanks to @rebelc0de bug report.
*
* @since 2.5.4
@ -153,16 +146,25 @@
}
/**
* Optional hard links: anchors with scroll offset
* Optional hard links: anchors with scroll offset.
*
* - Adding: Referrers and backlinks: optional hard links for AMP compatibility, thanks to @psykonevro bug report, thanks to @martinneumannat code contribution.
* - Adding: Referrers and backlinks: optional hard links for AMP compatibility, thanks to @psykonevro issue report, thanks to @martinneumannat issue report and code contribution.
*
* @since 2.3.0
* @contributor @martinneumannat
* @link https://wordpress.org/support/topic/making-it-amp-compatible/
* @reporter @psychonevro
* @link https://wordpress.org/support/topic/footnotes-is-not-amp-compatible/
*
* @contributor @martinneumannat
* @link https://wordpress.org/support/topic/making-it-amp-compatible/
*
* @since 2.3.0
*
* - Bugfix: Referrers: Hard links: enforce scroll offset with '!important' property for surroundings specifying otherwise, thanks to @bogosavljev bug report.
*
* @reporter @bogosavljev
* @link https://wordpress.org/support/topic/compatibility-issue-with-wpforms/
*
* @since 2.5.12
*
* Although often skipped as unstraightforward, or believed impossible,
* an offset hard link anchor can be coded out of a fragment identifier
* span with absolute position nested in a span with relative position.
@ -170,12 +172,12 @@
.footnote_item_base,
.footnote_referrer_base {
position: absolute;
position: relative !important;
}
.footnote_item_anchor,
.footnote_referrer_anchor {
position: relative;
position: absolute !important;
}
/**
@ -215,15 +217,17 @@
*
* - Bugfix: Referrers: line height 0 to fix superscript, thanks to @cwbayer bug report.
*
* @since 2.1.1
* @reporter @cwbayer
* @link https://wordpress.org/support/topic/footnote-number-in-text-superscript-disrupts-leading/
*
* @since 2.1.1
*
* - Bugfix: Tooltips: fix jQuery positioning bug moving tooltips out of view and affecting (TablePress tables in) some themes, thanks to @wisenilesh bug report.
*
* @since 2.5.4
* @reporter @wisenilesh
* @link https://wordpress.org/support/topic/footnotes-not-working-properly-inside-the-tables-of-tablepress-plugin/
*
* @since 2.5.4
*/
.footnote_plugin_tooltip_text {
@ -273,14 +277,23 @@ Classes:
box-sizing: border-box;
}
.collapsed {
display: none;
}
.unfolded {
display: inline;
}
/**
* Reference container label.
*
*
* - Bugfix: Layout: support right-to-left writing direction by replacing remaining CSS values 'left' with 'start', thanks to @arahmanshaalan bug report.
*
* @since 2.5.8
*
* @reporter @arahmanshaalan
* @link https://wordpress.org/support/topic/right-to-left-text-problem/
*
* @since 2.5.8
*/
.footnote_container_prepare {
@ -340,33 +353,79 @@ h6 > .footnote_reference_container_collapse_button {
table
*/
.footnote-reference-container,
.footnotes_table {
width: 100%;
border: none;
.footnotes_table,
.footnote-reference-container {
width: 100% !important;
border: none !important;
}
/**
* Footnotes list.
*
* Table caption for accessibility.
*
* - Bugfix: Reference container: apply web semantics to improve readability for assistive technologies, thanks to @derivationfr issue report and code contribution.
*
* @contributor @derivationfr
* @link https://wordpress.org/support/topic/enhance-accesibility-by-using-instead-of/
* @link https://a11y-101.com/development/tables
*
* @since 2.5.11
*
* The table caption must be present for screen readers but may be hidden to sighted users.
*/
.footnotes_table caption.accessibility {
text-align: start;
margin-top: -2px !important;
height: 1px !important;
width: 1px !important;
white-space: nowrap !important;
overflow: hidden !important;
color: #ffffff00 !important;
background-color: #ffffff00 !important;
}
/**
* Footnotes list, table header cells.
*
* - Bugfix: Reference container: debug footnotes number text color in the table header cells required for accessibility, thanks to @spaceling bug report.
*
* @reporter @spaceling
* @link https://wordpress.org/support/topic/footnote-numbers-not-visible-in-2-6-0/
*
* @since 2.6.3
* The background was fixed but not the text color.
* The color mustnt be inherited as that would disable link color.
*/
.footnotes_table .footnotes_plugin_reference_row th {
color: unset !important;
background-color: inherit !important;
}
/**
* Footnotes list, table cell borders.
*
* - Bugfix: Reference container: no borders around footnotes, thanks to @ragonesi bug report.
*
* @since 2.0.0
*
* @reporter @ragonesi
* @link https://wordpress.org/support/topic/thin-box-around-notes-in-reference-container/
*
*
* @since 2.0.0
*
* - Bugfix: Reference container: enforce borderless table cells, thanks to @ragonesi bug report.
*
* @since 2.0.1
*
* @reporter @ragonesi
* @link https://wordpress.org/support/topic/box-around-c-references-container/
*
*
* @since 2.0.1
*
* - Bugfix: Layout: support right-to-left writing direction by replacing remaining CSS values 'left' with 'start', thanks to @arahmanshaalan bug report.
* - Bugfix: Layout: support right-to-left writing direction by enabling mirrored paddings on HTML dir="rtl" pages, thanks to @arahmanshaalan bug report.
*
* @since 2.5.8
*
* @reporter @arahmanshaalan
* @link https://wordpress.org/support/topic/right-to-left-text-problem/
*
* @since 2.5.8
*/
.footnote_plugin_index,
@ -508,8 +567,8 @@ Link color set to inherit, so referrers/numbers are not grayed out.
* have all their rules moved to settings.css so as to alleviate
* the common stylesheet. Still these rules are only used if the
* Footnotes ad link logo is present in the page footer per user
* dashboard setting. Making these rules conditional like those
* pertaining to tooltips, either jQuery or alternative, would
* dashboard setting. Making these rules conditional like those
* pertaining to tooltips, either jQuery or alternative, would
* double the number of united minified stylesheets shipped with
* the plugin. Hence these are present by default at the bottom.
*

1
css/dev-common.min.css vendored Normal file
View file

@ -0,0 +1 @@
.footnotes_validation_error{border:4px solid red;padding:20px 40px;margin:20px 0;background:#ff000055;text-align:start}.footnotes_validation_error p:first-child{font-size:20px;font-weight:700;text-align:center}.footnotes_validation_error p:nth-child(2){font-size:16px;font-style:italic}.footnotes_validation_error p:nth-child(3){font-size:14px;font-weight:700}.footnotes_validation_error p:last-child{font-size:12px}.footnote_url_wrap{word-wrap:anywhere;overflow-wrap:anywhere;word-break:break-all}.footnote_item_base,.footnote_referrer_base{position:relative!important}.footnote_item_anchor,.footnote_referrer_anchor{position:absolute!important}.footnote_plugin_tooltip_text,.footnote_plugin_tooltip_text:hover,.footnote_referrer,.footnote_referrer:hover,.footnote_referrer:link,.footnote_referrer>a,.footnote_referrer>a:hover,.footnote_referrer>a:link,.main-content .footnote_plugin_tooltip_text,.main-content .footnote_plugin_tooltip_text:hover,.main-content .footnote_referrer,.main-content .footnote_referrer:hover,.main-content .footnote_referrer:link,.main-content .footnote_referrer>a,.main-content .footnote_referrer>a:hover,.main-content .footnote_referrer>a:link{text-decoration:none!important;border-bottom:none!important;box-shadow:none!important}.footnote_plugin_tooltip_text{line-height:0;position:relative!important;cursor:pointer}.footnotes_reference_container{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.collapsed{display:none}.unfolded{display:inline}.footnote_container_prepare{display:block!important;padding-top:24px!important}.footnote_container_prepare>p{line-height:1.3!important;margin-top:1em!important;margin-bottom:.25em!important;padding:0!important;font-weight:400!important;display:block!important;-webkit-margin-before:.83em!important;-webkit-margin-after:.83em!important;-webkit-margin-start:0!important;-webkit-margin-end:0!important;text-align:start!important;vertical-align:middle}.footnote_container_prepare>p>span:first-child,.footnote_container_prepare>p>span:nth-child(3){text-align:start!important;font-size:1.5em!important}.footnote_reference_container_collapse_button{cursor:pointer;padding:0 .5em;font-size:1.3em!important;vertical-align:2px;text-decoration:none!important}h2>.footnote_reference_container_collapse_button,h3>.footnote_reference_container_collapse_button,h4>.footnote_reference_container_collapse_button,h5>.footnote_reference_container_collapse_button,h6>.footnote_reference_container_collapse_button{font-size:inherit!important}.footnote_container_prepare>p>span:last-child a,.footnote_reference_container_collapse_button a{text-decoration:none!important}.footnote-reference-container,.footnotes_table{width:100%!important;border:none!important}.footnotes_table caption.accessibility{text-align:start;margin-top:-2px!important;height:1px!important;width:1px!important;white-space:nowrap!important;overflow:hidden!important;color:#ffffff00!important;background-color:#ffffff00!important}.footnotes_table .footnotes_plugin_reference_row th{color:unset!important;background-color:inherit!important}.footnote_plugin_index,.footnote_plugin_index_combi,.footnote_plugin_symbol,.footnote_plugin_text{border:none!important;text-align:start!important;vertical-align:top!important;padding:5px 6px 10px 0!important}html[dir=rtl] .footnote_plugin_index,html[dir=rtl] .footnote_plugin_index_combi,html[dir=rtl] .footnote_plugin_symbol,html[dir=rtl] .footnote_plugin_text{padding:5px 0 10px 6px!important}.footnote_backlink,.footnote_backlink:link,.footnote_plugin_link,.footnote_plugin_link:link,.main-content .footnote_backlink,.main-content .footnote_backlink:link,.main-content .footnote_plugin_link,.main-content .footnote_plugin_link:link{text-decoration:none!important;border-bottom:none!important}.footnote_backlink,.footnote_plugin_link{white-space:nowrap}.footnote_backlink,.footnote_index,.pointer{cursor:pointer}.footnote_backlink:hover,.footnote_plugin_link:hover,.footnote_plugin_text a:hover{text-decoration:unset;text-decoration:underline}.footnote_plugin_text{width:unset}.footnote_plugin_index,.footnote_plugin_index_combi{max-width:100px;width:2.5em}@media only screen and (max-width:768px){.footnote_plugin_index,.footnote_plugin_index_combi{max-width:80px}}.footnotes_reference_container{page-break-inside:avoid}@media print{.footnote_index_arrow,.footnote_reference_container_collapse_button,.footnote_tooltip{display:none}.footnote_plugin_tooltip_text{color:inherit}.footnote_plugin_index a,.footnote_plugin_index_combi a{color:inherit;text-decoration:none!important}div.post-meta-edit-link-wrapper{display:none}}.footnotes_logo,.footnotes_logo:hover{text-decoration:none;font-weight:400}.footnotes_logo_part1{color:#2bb975}.footnotes_logo_part2{color:#545f5a}

1
css/dev-layout-entry-content.min.css vendored Normal file
View file

@ -0,0 +1 @@
.entry .entry-content,.entry-content,.page-content,main .entry .entry-content{margin:0 auto}@media (max-width:575px){.entry .entry-content,.entry-content,.page-content,main .entry .entry-content{padding:0 10px}}@media (min-width:576px){.entry .entry-content,.entry-content,.page-content,main .entry .entry-content{max-width:500px}}@media (min-width:768px){.entry .entry-content,.entry-content,.page-content,main .entry .entry-content{max-width:600px}}@media (min-width:992px){.entry .entry-content,.entry-content,.page-content,main .entry .entry-content{max-width:800px}}@media (min-width:1200px){.entry .entry-content,.entry-content,.page-content,main .entry .entry-content{max-width:960px}}

1
css/dev-layout-main-content.min.css vendored Normal file
View file

@ -0,0 +1 @@
.main-content,.site-main,div.hentry,main{margin:0 auto}@media (max-width:575px){.main-content,.site-main,div.hentry,main{padding:0 10px}}@media (min-width:576px){.main-content,.site-main,div.hentry,main{max-width:500px}}@media (min-width:768px){.main-content,.site-main,div.hentry,main{max-width:600px}}@media (min-width:992px){.main-content,.site-main,div.hentry,main{max-width:800px}}@media (min-width:1200px){.main-content,.site-main,div.hentry,main{max-width:960px}}

View file

@ -0,0 +1 @@
.entry-content div.footnotes_reference_container,.entry-content>.footnotes_reference_container,main div.footnotes_reference_container{margin:0 auto}@media (max-width:575px){.entry-content div.footnotes_reference_container,.entry-content>.footnotes_reference_container,main div.footnotes_reference_container{padding:0 10px}}@media (min-width:576px){.entry-content div.footnotes_reference_container,.entry-content>.footnotes_reference_container,main div.footnotes_reference_container{max-width:500px}}@media (min-width:768px){.entry-content div.footnotes_reference_container,.entry-content>.footnotes_reference_container,main div.footnotes_reference_container{max-width:600px}}@media (min-width:992px){.entry-content div.footnotes_reference_container,.entry-content>.footnotes_reference_container,main div.footnotes_reference_container{max-width:800px}}@media (min-width:1200px){.entry-content div.footnotes_reference_container,.entry-content>.footnotes_reference_container,main div.footnotes_reference_container{max-width:960px}}

View file

@ -3,9 +3,7 @@
* Additional stylesheet for alternative tooltips.
*
* @since 2.5.5
* @version 2.5.5
* @lastmodified 2021-02-18T2029+0100
*
* System of unified minified style sheets tailored to the instance.
*
* @see full header in dev-common.css.
@ -25,38 +23,38 @@
.footnote_tooltip.position {
display: unset;
position: absolute;
/*
bottom: 24px;
left: -50px;
width: 400px;
*/
}
/*
fade-in parameters
/**
* Timing; fade-in/fade-out parameters.
*
* To streamline internal CSS, immutable rules are in external stylesheet.
* Property values of settings are internal CSS.
* @see class/task.php
*/
.footnote_tooltip.shown {
visibility: visible;
opacity: 1;
transition-property: visibility opacity;
transition-property: visibility, opacity;
transition-timing-function: linear;
/*
property values of settings are inline CSS
transition-delay: 0ms;
transition-duration: 200ms;
*/
}
/*
fade-out parameters
*/
.footnote_tooltip.hidden {
visibility: hidden;
opacity: 0;
transition-property: visibility opacity;
transition-property: visibility, opacity;
transition-timing-function: linear;
/*
property values of settings are inline CSS
transition-delay: 400ms;
transition-duration: 200ms;
*/

1
css/dev-tooltips-alternative.min.css vendored Normal file
View file

@ -0,0 +1 @@
.footnote_referrer.relative{position:relative}.footnote_tooltip.position{display:unset;position:absolute}.footnote_tooltip.shown{visibility:visible;opacity:1;transition-property:visibility,opacity;transition-timing-function:linear}.footnote_tooltip.hidden{visibility:hidden;opacity:0;transition-property:visibility,opacity;transition-timing-function:linear}

View file

@ -37,7 +37,7 @@
z-index: 2147483647 !important;
cursor: auto;
text-align: start !important;
padding: 12px;
padding: 12px !important;
line-height: 1.2;
font-weight: normal;
font-style: normal;

1
css/dev-tooltips.min.css vendored Normal file
View file

@ -0,0 +1 @@
.footnote_tooltip{display:none;z-index:2147483647!important;cursor:auto;text-align:start!important;padding:12px!important;line-height:1.2;font-weight:400;font-style:normal}.footnote_tooltip_continue{font-style:italic;color:green;text-decoration:none!important;cursor:pointer;white-space:nowrap}.footnote_tooltip_continue:hover{color:#00f;text-decoration:underline!important}

1
css/footnotes-amptbrpl0.min.css vendored Normal file

File diff suppressed because one or more lines are too long

1
css/footnotes-amptbrpl1.min.css vendored Normal file

File diff suppressed because one or more lines are too long

1
css/footnotes-amptbrpl2.min.css vendored Normal file

File diff suppressed because one or more lines are too long

1
css/footnotes-amptbrpl3.min.css vendored Normal file

File diff suppressed because one or more lines are too long

View file

@ -5,9 +5,9 @@
* Created-Date: 15.05.14
* Created-Time: 16:21
* Since: 1.0
*
* @version 2.5.5
* @lastmodified 2021-02-18T2026+0100
*
* This dashboard stylesheet is minified as-is.
* @see class/dashboard/layout.php
*/
/**

View file

@ -10,7 +10,7 @@ A. Customized template parts
‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
@since 2.2.6 Adding: Templates: support for custom templates in sibling folder, thanks to @misfist issue report.
@since 2.5.0 Adding: Templates: Enable template location stack, thanks to @misfist code contribution.
@since 2.5.0 Adding: Templates: Enable template location stack, thanks to @misfist issue report and code contribution.
Priority order:

View file

@ -4,7 +4,7 @@
* Plugin URI: https://wordpress.org/plugins/footnotes/
* Description: time to bring footnotes to your website! footnotes are known from offline publishing and everybody takes them for granted when reading a magazine.
* Author: Mark Cheret
* Version: 2.5.10
* Version: 2.6.5
* Author URI: https://cheret.org/footnotes/
* Text Domain: footnotes
* Domain Path: /languages
@ -14,33 +14,6 @@
*/
/**
* Version numbers in WordPress plugin readme.txt and main PHP headers.
*
* - Adding: Documentation: Readme.txt: informative 'Package Version' field in sync with the package version currently hidden in the main PHP script header.
* - Adding: Documentation: Readme.txt: informative 'Version' field pointing a tag folder in SVN for bugfix versions available ahead of the stable tag.
* - Adding: Documentation: Readme.txt: comment line below the 'Stable Tag' field to warn that this is (unexpectedly) parsed for release configuration.
*
* @since 2.5.11
* @see readme.txt
* @link https://meta.trac.wordpress.org/ticket/5652
*
* Package Version Actual version string, informative only.
* May identify a development version.
* A 'd' series is suffixed to incremented bugfix version.
* Used for style sheet cache busting.
*
* Version Parsed in the main PHP file header for update configuration.
* Refers to the latest tag.
* Typically the best available version.
* May not be released, due to release frequency concerns.
*
* Stable Tag Parsed in the readme.txt in trunk/ for release configuration.
* May be smaller than Version, avoiding too frequent releases.
*
* WordPress plugin readmes are usually lacking the version number of the package.
* In Footnotes, this has been included after the stable tag had been mistaken for
* the package version, given that state-of-the-art readmes have that information.
*
* - Bugfix: Codebase: revert to 2.5.8, thanks to @little-shiva @watershare @adjayabdg @staho @frav8 @voregnev @dsl225 @alexclassroom @a223123131 @codldmac bug reports.
*
* @version 2.5.10 (reversion to @version 2.5.8)

View file

@ -1,7 +1,6 @@
/**
* Created by Stefan on 24.05.14.
*
*
*
* Edit: be careful to maintain version number near EOF 2020-12-11T1225+0100
*/
@ -42,13 +41,13 @@
},
/**
* Creates control instances based in the incomming name. This method is normally not
* needed since the addButton method of the tinymce.Editor class is a more easy way of adding buttons
* Creates control instances based on the incoming name. This method is normally not
* needed since the addButton method of the tinymce.Editor class is an easier way of adding buttons,
* but you sometimes need to create more complex controls like listboxes, split buttons etc then this
* method can be used to create those.
*
* @param {String} n Name of the control to create.
* @param {tinymce.ControlManager} cm Control manager to use inorder to create new control.
* @param {tinymce.ControlManager} cm Control manager to use in order to create new control.
* @return {tinymce.ui.Control} New control instance or null if no control was created.
*/
createControl : function(n, cm) {
@ -60,8 +59,8 @@
* The current keys are longname, author, authorurl, infourl and version.
*
* @return {Object} Name/value array containing information about the plugin.
*
* Edit: needs update the version number manually 2020-12-11T1224+0100
*
* Edit: needs updating the version number manually 2020-12-11T1224+0100
*/
getInfo : function() {
return {
@ -69,7 +68,7 @@
author : 'Mark Cheret',
authorurl : 'https://cheret.org/footnotes/',
infourl : 'https://wordpress.org/plugins/footnotes/',
version : "2.5.11d"
version : '2.6.5'
};
}
});

View file

@ -1,10 +1,10 @@
=== footnotes ===
Contributors: mark.cheret, lolzim, rumperuu, aricura, misfist, ericakfranz, dartiss, docteurfitness, felipelavinz, martinneumannat, matkus2, meglio, spaceling, vonpiernik, pewgeuges
Contributors: mark.cheret, lolzim, rumperuu, aricura, misfist, ericakfranz, milindmore22, westonruter, dartiss, derivationfr, docteurfitness, felipelavinz, martinneumannat, matkus2, meglio, spaceling, vonpiernik, pewgeuges
Tags: footnote, footnotes, bibliography, formatting, notes, Post, posts, reference, referencing
Requires at least: 3.9
Tested up to: 5.7
Requires PHP: 5.6
Stable Tag: 2.5.10
Stable Tag: 2.6.5
License: GPLv3 or later
License URI: https://www.gnu.org/licenses/gpl-3.0.html
@ -16,7 +16,7 @@ Cheers for the review, folks!
https://www.youtube.com/watch?v=HzHaMAAJwbI
**footnotes** aims to be the all-in-one solution for displaying an automatically generated list of references on your Page or Post. The Plugin ships with a set of defaults while also empowering you to control how your footnotes are being displayed.
**footnotes** gives you the ability to display well-formatted footnotes on your WordPress Pages and Posts — those footnotes we know from offline publishing.
**footnotes** gives you the ability to display well-formatted footnotes on your WordPress Pages and Posts, as well as in post excerpts with fully functional tooltips if enabled.
= Main Features =
- Fully customizable **footnote** start and end shortcodes;
@ -34,7 +34,7 @@ These are a few examples of possible ways to delimit footnotes:
1. Your awesome text((with an awesome footnote))
2. Your awesome text[ref]with an awesome footnote[/ref]
3. Your awesome text`<fn>`with an awesome footnote`</fn>`
4. Your awesome text`custom-shortcode`with an awesome footnote`custom-shortcode`
4. Your awesome text`custom-start-shortcode`with an awesome footnote`custom-end-shortcode`
= Where to get footnotes? =
The current version is available on the [WordPress.org plugins platform, Footnotes](https://wordpress.org/plugins/footnotes/).
@ -77,15 +77,72 @@ Visit this swift write-up from a **footnotes** user by the name of **Southwest**
== Changelog ==
= 2.6.5 =
- Bugfix: Editor buttons: debug button by reverting name change in PHP file while JS file and HTML template remained unsynced, thanks to @gova bug report.
- Bugfix: Hooks: default-disable the_excerpt hook with respect to theme-specific excerpt handling, thanks to @mmallett bug reports.
= 2.6.4 =
- Bugfix: Process: remove trailing comma after last argument in multiline function calls for PHP < 7.3, thanks to @scroom @copylefter @lagoon24 bug reports.
= 2.6.3 =
- Bugfix: Reference container: debug footnotes number text color in the table header cells required for accessibility, thanks to @spaceling bug report.
- Bugfix: Excerpts: debug the 'Yes' option by generating excerpts with footnotes on the basis of the posts, thanks to @nikelaos @martinneumannat bug reports.
- Bugfix: Reference container: debug span elements in backlinks by removing 'event.stopPropagation()' from jQuery scroll down function, thanks to @lolzim bug report.
- Update: Excerpts: set the default value of the debugged 'Footnotes in excerpts' setting to Yes.
- Update: Excerpts: enable the hook 'the_excerpt' by default to make the debugged 'Footnotes in excerpts' setting effective.
= 2.6.2 =
- Bugfix: Excerpts: debug the 'No' option by generating excerpts from scratch without footnotes, thanks to @nikelaos @markcheret @martinneumannat bug reports.
- Bugfix: Tooltips: Continue reading: debug link for AMP compatibility mode.
= 2.6.1 =
- Bugfix: Tooltips: Styling: Font color: set default value to black for maximum contrast on default white background color, thanks to 4msc bug report.
- Bugfix: Tooltips: Styling: Background color: set default value back to white because empty doesnt work out as expected.
= 2.6.0 =
- Adding: Reference container: get expanding and collapsing to work also in AMP compatibility mode, thanks to @westonruter code contribution.
- Adding: Tooltips: make display work purely by style rules for AMP compatibility, thanks to @milindmore22 code contribution.
- Bugfix: Tooltips: AMP tooltips: enable accessibility by keyboard navigation, thanks to @westonruter code contribution.
= 2.5.15 =
- Bugfix: Dashboard: General settings: Footnote start and end short codes: debug select box for shortcodes with pointy brackets.
- Update: Dashboard: General settings: Footnote start and end short codes: add information about pointy brackets.
= 2.5.14 =
- Bugfix: Footnote delimiter short codes: fix numbering bug by cross-editor HTML escapement schema unification, thanks to @patrick_here @alifarahani8000 @gova bug reports.
- Update: Dashboard: General settings: Footnote start and end short codes: delete comment on pointy brackets.
= 2.5.13 =
- Bugfix: Dashboard: Referrers and tooltips: Backlink symbol: debug select box by reverting identity check to equality check, thanks to @lolzim bug report.
- Bugfix: Footnote delimiter short codes: debug closing pointy brackets in the Block Editor by accounting for unbalanced HTML escapement.
- Update: Dashboard: General settings: Footnote start and end short codes: update information about short codes using pointy brackets.
= 2.5.12 =
- Update: Scrolling: CSS-based smooth scroll behavior (optional), thanks to @paulgpetty and @bogosavljev issue reports.
- Bugfix: Backlinks: reflect scroll functions down/up differentiation across the template set, thanks to @bogosavljev bug report.
- Bugfix: Referrers: Hard links: enforce scroll offset with '!important' property for surroundings specifying otherwise, thanks to @bogosavljev bug report.
- Bugfix: Forms: prevent inadvertently toggling input elements with footnotes in their label, by optionally moving footnotes after the end of the label.
- Bugfix: Forms: prevent inadvertently toggling input elements with footnotes in their label, by optionally disconnecting those labels.
- Bugfix: Scroll offset: correct syntax error in the main style sheet.
- Bugfix: Reference container: correct new syntax errors in the 8 reference container row templates.
- Bugfix: Reference container: correct a new typo in the JavaScript reference container template.
- Update: Dashboard: General settings: split a dedicated 'URL fragment ID configuration' metabox off the 'Scrolling behavior' metabox.
= 2.5.11 =
- Bugfix: Forms: remove footnotes from input field values, thanks to @bogosavljev bug report.
- Bugfix: Reference container: apply web semantics to improve readability for assistive technologies, thanks to @derivationfr issue report and code contribution.
- Bugfix: Tooltips: Styling: Background color: empty default value to adopt theme background, thanks to 4msc bug report.
- Bugfix: Dashboard: debug text input fields by disabling quotation mark escapement, thanks to @rumperuu code contribution in the standards compliance overhaul.
- Update: Documentation: Readme.txt: comment line below the 'Stable Tag' field to warn that this field is (unintuitively) parsed for release configuration.
- Update: Documentation: Readme.txt: informative 'Version' field in sync with 'Version' in 'footnotes.php' for bugfix versions available ahead of the Stable Tag.
- Update: Documentation: Readme.txt: informative 'Package Version' field in sync with the 'Package V.' field added in the 'footnotes.php' file header.
- Bugfix: Dashboard: debug text input fields by disabling quotation mark escapement, thanks to @rumperuu code contribution in the standards compliance overhaul.
- Update: Codebase: make all PHP code comply to WordPress Coding Standards requirements, thanks to @rumperuu code contribution and refactoring.
- Update: Documentation: help and support for contributors by the means of Contributing Guidelines in 'CONTRIBUTING.md', thanks to @rumperuu code contribution.
- Update: Documentation: additional readme in markdown format 'README.md' for use with the code repository on GitHub, thanks to @rumperuu code contribution.
- Update: Documentation: move 'customized-template-stack.txt' and 'customized-documentation-schema.txt' from the 'development/' folder to root.
- Update: Codebase: make PHP code comply to WordPress PHP Coding Standards requirements, thanks to @rumperuu code contribution and refactoring.
- Bugfix: Forms: try to prevent the adverse effect of clicking footnote referrers in labels of input elements by 'event.stopPropagation()' in jQuery scroll down function.
- Bugfix: Forms: mitigate the adverse effect of clicking footnote referrers in labels of input elements by an optional, configurable scroll down delay.
- Bugfix: Scroll durations: mitigate the downside of delayed scrolling down by optionally enabling asymmetric scroll durations (e.g. fast down, slower up).
- Update: Scroll delays: add a setting to configure also a scroll up delay for completeness.
- Bugfix: Tooltips: Styling: protect padding against removal in surroundings with explicit zero padding.
- Bugfix: Tooltips: Display: CSS transitions: fix syntax error.
= 2.5.10 =
- Bugfix: Codebase: revert to 2.5.8 with apologies (below), thanks to @little-shiva @watershare @adjayabdg @staho @frav8 @voregnev @dsl225 @alexclassroom @a223123131 @codldmac bug reports.
@ -144,7 +201,7 @@ Visit this swift write-up from a **footnotes** user by the name of **Southwest**
- Update: Readme/documentation: update or fix URLs in Download, Support and Development sections.
= 2.5.0 =
- Adding: Templates: Enable template location stack, thanks to @misfist code contribution.
- Adding: Templates: Enable template location stack, thanks to @misfist issue report and code contribution.
- Bugfix: Hooks: support footnotes on category pages, thanks to @vitaefit bug report, thanks to @misfist code contribution.
- Bugfix: Footnote delimiters: Syntax validation: exclude certain cases involving scripts, thanks to @andreasra bug report.
- Bugfix: Footnote delimiters: Syntax validation: complete message with hint about setting, thanks to @andreasra bug report.
@ -163,7 +220,7 @@ Visit this swift write-up from a **footnotes** user by the name of **Southwest**
- Bugfix: Reference container: add class 'footnote_plugin_symbol' to disambiguate repurposed class 'footnote_plugin_link'.
= 2.3.0 =
- Adding: Referrers and backlinks: optional hard links for AMP compatibility, thanks to @psykonevro bug report, thanks to @martinneumannat code contribution.
- Adding: Referrers and backlinks: optional hard links for AMP compatibility, thanks to @psykonevro issue report, thanks to @martinneumannat issue report and code contribution.
- Bugfix: Reference container: convert top padding to margin and make it a setting, thanks to @hamshe bug report.
- Bugfix: Referrers and backlinks: more effectively remove unwanted underline by disabling box shadow used instead of bottom border, thanks to @klusik feedback.
- Bugfix: Dashboard: Custom CSS: swap migration Boolean, meaning 'show legacy' instead of 'migration complete', due to storage data structure constraints.
@ -212,7 +269,7 @@ Visit this swift write-up from a **footnotes** user by the name of **Southwest**
= 2.2.2 =
- 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.
- Update: Dashboard: Custom CSS: unearth text area and migrate to dedicated tab as designed.
- Bugfix: Reference container: edits to optional basic responsive page layout stylesheets.
= 2.2.1 =
@ -275,8 +332,8 @@ Visit this swift write-up from a **footnotes** user by the name of **Southwest**
- Update: Dashboard: Expert mode: streamline and update description for hooks and priority levels.
= 2.1.3 =
- 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 widget_text hook by default to fix accordions declaring headings as widgets.
- 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 for Unicode-non-conformant browsers, thanks to @karolszakiel bug report.
- Bugfix: Reference container: table cell backlinking if index is single and combining identicals turned on.
@ -326,7 +383,7 @@ Visit this swift write-up from a **footnotes** user by the name of **Southwest**
- Update: Settings defaults adjusted for better and more up-to-date tooltip layout.
= 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 issue report and code contribution.
- Bugfix: Referrers: delete vertical align tweaks, for cross-theme and user agent compatibility.
- Bugfix: Reference container: fix line breaking behavior in footnote number clusters.
- Bugfix: Reference container: auto-extending column to fit widest, to fix display with short note texts.
@ -348,7 +405,7 @@ Visit this swift write-up from a **footnotes** user by the name of **Southwest**
- Bugfix: Settings stylesheet: unenqueue to fix input boxes on public pages (enqueued for 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, thanks to @mmallett issue report.
- Update: Libraries: Load jQuery UI from WordPress, thanks to @check2020de issue report.
- Bugfix: Referrers and backlinks: remove hard links to streamline browsing history, thanks to @theroninjedi47 bug report.
- Bugfix: Reference container: remove inconvenient left/right cellpadding.
@ -359,7 +416,7 @@ Visit this swift write-up from a **footnotes** user by the name of **Southwest**
= 2.0.3 =
- 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 @mmallett issue report.
- Bugfix: Fragment IDs: Prepended post ID to footnote number.
- Bugfix: External stylesheets cache busting: add plugin version number argument in enqueuing function call.
- Bugfix: Print style: prevent a page break just after the reference container label.
@ -478,7 +535,7 @@ Visit this swift write-up from a **footnotes** user by the name of **Southwest**
- Update: Removed unnecessary hidden inputs from the Settings page
- Update: Merged public CSS files to reduce the output and improve the performance
- Update: Translations (EN and DE)
- Bugfix: Removed the 'trim' function to allow whitespaces at the beginning and end of each setting
- Bugfix: Removed the 'trim' function to allow leading and trailing whitespace in settings text boxes, thanks to @compasscare bug report.
- Bugfix: Convert the footnotes short code to HTML special chars when adding them into the page/post editor (visual and text)
- Bugfix: Detailed error messages if other Plugins can't be loaded. Also added empty strings as default values to avoid 'undefined'
@ -518,7 +575,6 @@ Visit this swift write-up from a **footnotes** user by the name of **Southwest**
- Update: language EN and DE
- Adding: Setting to customize the hyperlink symbol in der reference container for each footnote reference
- Adding: Setting to enter a user defined hyperlink symbol
-
= 1.3.1 =
- Bugfix: Allow settings to be empty

View file

@ -0,0 +1,14 @@
<div class="footnotes_description">
<p>[[description-1-selection]]</p>
</div>
<table class="configure-label-solution widefat fixed">
<tbody>
<tr>
<td>[[label-selection]]</td>
<td>[[selection]]</td>
</tr>
</tbody>
</table>
<div class="footnotes_description">
<p>[[description-2-selection]]</p>
</div>

View file

@ -0,0 +1,14 @@
<div class="footnotes_description">
<p>[[description-1-amp]]</p>
</div>
<table class="settings_amp widefat fixed">
<tbody>
<tr>
<td>[[label-amp]]</td>
<td>[[amp]] <span class="footnotes_notice">[[notice-amp]]</span></td>
</tr>
</tbody>
</table>
<div class="footnotes_description">
<p>[[description-2-amp]]</p>
</div>

View file

@ -0,0 +1,28 @@
<table class="settings_hard_links widefat fixed">
<tbody>
<tr>
<td>[[label-hard-links]]</td>
<td>[[hard-links]] <span class="footnotes_notice">[[notice-hard-links]]</span></td>
</tr>
<tr>
<td>[[label-footnote]]</td>
<td>[[footnote]] <span class="footnotes_notice">[[notice-footnote]]</span></td>
</tr>
<tr>
<td>[[label-referrer]]</td>
<td>[[referrer]] <span class="footnotes_notice">[[notice-referrer]]</span></td>
</tr>
<tr>
<td>[[label-separator]]</td>
<td>[[separator]] <span class="footnotes_notice">[[notice-separator]]</span></td>
</tr>
<tr>
<td>[[label-backlink-tooltips]]</td>
<td>[[backlink-tooltips]] <span class="footnotes_notice">[[notice-backlink-tooltips]]</span></td>
</tr>
<tr>
<td>[[label-backlink-tooltip-text]]</td>
<td>[[backlink-tooltip-text]] <span class="footnotes_notice">[[notice-backlink-tooltip-text]]</span></td>
</tr>
</tbody>
</table>

View file

@ -1,5 +1,9 @@
<table class="settings_scrolling widefat fixed">
<tbody>
<tr>
<td>[[label-scroll-css]]</td>
<td>[[scroll-css]] <span class="footnotes_notice">[[notice-scroll-css]]</span></td>
</tr>
<tr>
<td>[[label-scroll-offset]]</td>
<td>[[scroll-offset]] <span class="footnotes_notice">[[notice-scroll-offset]]</span></td>
@ -9,28 +13,20 @@
<td>[[scroll-duration]] <span class="footnotes_notice">[[notice-scroll-duration]]</span></td>
</tr>
<tr>
<td>[[label-hard-links]]</td>
<td>[[hard-links]] <span class="footnotes_notice">[[notice-hard-links]]</span></td>
<td>[[label-scroll-asymmetricity]]</td>
<td>[[scroll-asymmetricity]] <span class="footnotes_notice">[[notice-scroll-asymmetricity]]</span></td>
</tr>
<tr>
<td>[[label-footnote]]</td>
<td>[[footnote]] <span class="footnotes_notice">[[notice-footnote]]</span></td>
<td>[[label-scroll-down-duration]]</td>
<td>[[scroll-down-duration]] <span class="footnotes_notice">[[notice-scroll-down-duration]]</span></td>
</tr>
<tr>
<td>[[label-referrer]]</td>
<td>[[referrer]] <span class="footnotes_notice">[[notice-referrer]]</span></td>
<td>[[label-scroll-down-delay]]</td>
<td>[[scroll-down-delay]] <span class="footnotes_notice">[[notice-scroll-down-delay]]</span></td>
</tr>
<tr>
<td>[[label-separator]]</td>
<td>[[separator]] <span class="footnotes_notice">[[notice-separator]]</span></td>
</tr>
<tr>
<td>[[label-backlink-tooltips]]</td>
<td>[[backlink-tooltips]] <span class="footnotes_notice">[[notice-backlink-tooltips]]</span></td>
</tr>
<tr>
<td>[[label-backlink-tooltip-text]]</td>
<td>[[backlink-tooltip-text]] <span class="footnotes_notice">[[notice-backlink-tooltip-text]]</span></td>
<td>[[label-scroll-up-delay]]</td>
<td>[[scroll-up-delay]] <span class="footnotes_notice">[[notice-scroll-up-delay]]</span></td>
</tr>
</tbody>
</table>

View file

@ -0,0 +1,40 @@
<!--<?php//for docblock, @see MCI_Footnotes_Template::process_template()
/**
* Footnote template to enable AMP compatibility mode.
*
* - Adding: Tooltips: make display work purely by style rules for AMP compatibility, thanks to @milindmore22 code contribution.
* - Bugfix: Tooltips: enable accessibility by keyboard navigation, thanks to @westonruter code contribution.
* - Adding: Reference container: get expanding and collapsing to work also in AMP compatibility mode, thanks to @westonruter code contribution.
*
* @since 2.5.11 (draft)
* @since 2.6.0 (release)
*
* @contributor @milindmore22
* @link @link https://github.com/ampproject/amp-wp/issues/5913#issuecomment-785306933
*
* @contributor @westonruter
* @link https://github.com/ampproject/amp-wp/issues/5913#issuecomment-785419655
* @link https://github.com/markcheret/footnotes/issues/48#issuecomment-799580854
* @link https://github.com/markcheret/footnotes/issues/48#issuecomment-799582394
* @link https://amp.dev/documentation/guides-and-tutorials/learn/amp-actions-and-events/#*-(all-elements)
*/?>
-->
<span
class="footnote_referrer relative"
><[[link-span]]
role="button"
tabindex="0"
[[hard-link]]
on="tap:footnote_references_container_[[post_id]]_[[container_id]].toggleClass(class=collapsed, force=false),footnotes_container_button_plus_[[post_id]]_[[container_id]].toggleClass(class=collapsed, force=true),footnotes_container_button_minus_[[post_id]]_[[container_id]].toggleClass(class=collapsed, force=false)"
><[[sup-span]]
id="footnote_plugin_tooltip_[[post_id]]_[[container_id]]_[[note_id]]"
class="footnote_plugin_tooltip_text"
>[[before]][[index]][[after]]</[[sup-span]]
></[[link-span]]
>[[anchor-element]]<span
id="footnote_plugin_tooltip_text_[[post_id]]_[[container_id]]_[[note_id]]"
class="footnote_tooltip position"
[[style]]
>[[text]]</span
></span
>

View file

@ -0,0 +1,35 @@
<!--<?php//for docblock, @see MCI_Footnotes_Template::process_template()
/**
* Footnote template to enable AMP compatibility mode.
*
* - Adding: Tooltips: make display work purely by style rules for AMP compatibility, thanks to @milindmore22 code contribution.
* - Bugfix: Tooltips: enable accessibility by keyboard navigation, thanks to @westonruter code contribution.
*
* @since 2.5.11 (draft)
* @since 2.6.0 (release)
*
* @contributor @milindmore22
* @link @link https://github.com/ampproject/amp-wp/issues/5913#issuecomment-785306933
*
* @contributor @westonruter
* @link https://github.com/ampproject/amp-wp/issues/5913#issuecomment-785419655
*/?>
-->
<span
class="footnote_referrer relative"
><[[link-span]]
role="button"
tabindex="0"
[[hard-link]]
><[[sup-span]]
id="footnote_plugin_tooltip_[[post_id]]_[[container_id]]_[[note_id]]"
class="footnote_plugin_tooltip_text"
>[[before]][[index]][[after]]</[[sup-span]]
></[[link-span]]
>[[anchor-element]]<span
id="footnote_plugin_tooltip_text_[[post_id]]_[[container_id]]_[[note_id]]"
class="footnote_tooltip position"
[[style]]
>[[text]]</span
></span
>

View file

@ -0,0 +1,47 @@
<!--<?php//for docblock, @see MCI_Footnotes_Template::process_template()
/**
* AMP compatible table row template with legacy extra column for backlink symbol, uncombined footnotes.
*
* @since 2.5.11 (draft)
* @since 2.6.0 (release)
*
* - Bugfix: Reference container: apply web semantics to improve readability for assistive technologies, thanks to @derivationfr issue report and code contribution.
*
* @since 2.5.11
*
* @contributor @derivationfr
* @link https://wordpress.org/support/topic/enhance-accesibility-by-using-instead-of/
* @link https://a11y-101.com/development/tables
*
* For assistive technologies to improve accessibility by reading tables in a meaningful manner,
* the tables must be marked up properly using table header elements for header rows and header
* columns as applicable.
* The table caption must also be present for screen readers but may be hidden to sighted users.
*/?>
-->
<tr class="footnotes_plugin_reference_row">
<th
scope="row"
class="footnote_plugin_index"
><[[link-span]]
role="button"
tabindex="0"
id="footnote_plugin_reference_[[post_id]]_[[container_id]]_[[note_id]]"
class="footnote_index"
[[hard-link]]
>[[index]][[terminator]]</[[link-span]]
>[[anchor-element]]</th
>
<td
class="footnote_plugin_symbol"
><[[link-span]]
class="footnote_backlink"
[[hard-link]]
>[[arrow]]</[[link-span]]
></td
>
<td
class="footnote_plugin_text"
>[[text]]</td
>
</tr>

View file

@ -0,0 +1,38 @@
<!--<?php//for docblock, @see MCI_Footnotes_Template::process_template()
/**
* AMP compatible table row template with the ability to have combined footnotes.
*
* @since 2.5.11 (draft)
* @since 2.6.0 (release)
*
* - Bugfix: Referrers, reference container: Combining identical footnotes: fix dead links and ensure referrer-backlink bijectivity, thanks to @happyches bug report.
*
* @since 2.1.1
*
* @reporter @happyches
* @link https://wordpress.org/support/topic/custom-css-for-jumbled-references/
*
* - Bugfix: Reference container: apply web semantics to improve readability for assistive technologies, thanks to @derivationfr issue report and code contribution.
*
* @since 2.5.11
*
* @contributor @derivationfr
* @link https://wordpress.org/support/topic/enhance-accesibility-by-using-instead-of/
* @link https://a11y-101.com/development/tables
*
* For assistive technologies to improve accessibility by reading tables in a meaningful manner,
* the tables must be marked up properly using table header elements for header rows and header
* columns as applicable.
* The table caption must also be present for screen readers but may be hidden to sighted users.
*/?>
-->
<tr class="footnotes_plugin_reference_row">
<th
scope="row"
class="footnote_plugin_index_combi[[pointer]]"
>[[backlinks]]</th
>
<td
class="footnote_plugin_text"
>[[text]]</td>
</tr>

View file

@ -0,0 +1,45 @@
<!--<?php//for docblock, @see MCI_Footnotes_Template::process_template()
/**
* AMP compatible table row template for uncombined footnotes with the backlink symbol appended.
*
* @since 2.5.11 (draft)
* @since 2.6.0 (release)
*
* - Bugfix: Reference container: option to append symbol (prepended by default), thanks to @spaceling code contribution.
*
* @since 2.1.1
*
* @contributor @spaceling
* @link https://wordpress.org/support/topic/change-the-position-5/#post-13615994
*
* - Bugfix: Reference container: apply web semantics to improve readability for assistive technologies, thanks to @derivationfr issue report and code contribution.
*
* @since 2.5.11
*
* @contributor @derivationfr
* @link https://wordpress.org/support/topic/enhance-accesibility-by-using-instead-of/
* @link https://a11y-101.com/development/tables
*
* For assistive technologies to improve accessibility by reading tables in a meaningful manner,
* the tables must be marked up properly using table header elements for header rows and header
* columns as applicable.
* The table caption must also be present for screen readers but may be hidden to sighted users.
*/?>
-->
<tr class="footnotes_plugin_reference_row">
<th
scope="row"
id="footnote_plugin_reference_[[post_id]]_[[container_id]]_[[note_id]]"
class="footnote_plugin_index pointer"
><[[link-span]]
role="button"
tabindex="0"
class="footnote_plugin_link"
[[hard-link]]
>[[index]][[terminator]][[arrow]]</[[link-span]]
>[[anchor-element]]</th
>
<td
class="footnote_plugin_text"
>[[text]]</td>
</tr>

View file

@ -0,0 +1,39 @@
<!--<?php//for docblock, @see MCI_Footnotes_Template::process_template()
/**
* AMP compatible table row default template for uncombined footnotes.
*
* @since 2.5.11 (draft)
* @since 2.6.0 (release)
*
* - Bugfix: Reference container: apply web semantics to improve readability for assistive technologies, thanks to @derivationfr issue report and code contribution.
*
* @since 2.5.11
*
* @contributor @derivationfr
* @link https://wordpress.org/support/topic/enhance-accesibility-by-using-instead-of/
* @link https://a11y-101.com/development/tables
*
* For assistive technologies to improve accessibility by reading tables in a meaningful manner,
* the tables must be marked up properly using table header elements for header rows and header
* columns as applicable.
* The table caption must also be present for screen readers but may be hidden to sighted users.
*/?>
-->
<tr class="footnotes_plugin_reference_row">
<th
scope="row"
id="footnote_plugin_reference_[[post_id]]_[[container_id]]_[[note_id]]"
class="footnote_plugin_index pointer"
><[[link-span]]
role="button"
tabindex="0"
class="footnote_plugin_link"
[[hard-link]]
>[[arrow]][[index]][[terminator]]</[[link-span]]
>[[anchor-element]]</th
>
<td
class="footnote_plugin_text"
>[[text]]</td
>
</tr>

View file

@ -0,0 +1,75 @@
<!--<?php//for docblock, @see MCI_Footnotes_Template::process_template()
/**
* Reference container template to enable AMP compatibility mode.
*
* - Adding: Reference container: get expanding and collapsing to work also in AMP compatibility mode, thanks to @westonruter code contribution.
*
* @since 2.5.11 (draft)
* @since 2.6.0 (release)
*
* @contributor @westonruter
* @link https://github.com/markcheret/footnotes/issues/48#issuecomment-799580854
* @link https://github.com/markcheret/footnotes/issues/48#issuecomment-799582394
* @link https://amp.dev/documentation/guides-and-tutorials/learn/amp-actions-and-events/#*-(all-elements)
*
* - Bugfix: Reference container: apply web semantics to improve readability for assistive technologies, thanks to @derivationfr issue report and code contribution.
*
* @since 2.5.11
*
* @contributor @derivationfr
* @link https://wordpress.org/support/topic/enhance-accesibility-by-using-instead-of/
* @link https://a11y-101.com/development/tables
*
* For assistive technologies to improve accessibility by reading tables in a meaningful manner,
* the tables must be marked up properly using table header elements for header rows and header
* columns as applicable.
* The table caption must also be present for screen readers but may be hidden to sighted users.
*/?>
-->
<div
class="speaker-mute footnotes_reference_container"
>
<div
class="footnote_container_prepare"
><[[element]]
><span
role="button"
tabindex="0"
id="footnotes_container_label_expand_[[post_id]]_[[container_id]]"
class="footnote_reference_container_label pointer"
on="tap:footnote_references_container_[[post_id]]_[[container_id]].toggleClass(class=collapsed),footnotes_container_button_plus_[[post_id]]_[[container_id]].toggleClass(class=collapsed),footnotes_container_button_minus_[[post_id]]_[[container_id]].toggleClass(class=collapsed)"
>[[name]]</span
><span
role="button"
tabindex="0"
id="footnotes_container_button_plus_[[post_id]]_[[container_id]]"
class="footnote_reference_container_collapse_button"
on="tap:footnote_references_container_[[post_id]]_[[container_id]].toggleClass(class=collapsed),footnotes_container_button_plus_[[post_id]]_[[container_id]].toggleClass(class=collapsed),footnotes_container_button_minus_[[post_id]]_[[container_id]].toggleClass(class=collapsed)"
>[+]</span
><span
></span
><span
role="button"
tabindex="0"
id="footnotes_container_button_minus_[[post_id]]_[[container_id]]"
class="footnote_reference_container_collapse_button collapsed"
on="tap:footnote_references_container_[[post_id]]_[[container_id]].toggleClass(class=collapsed),footnotes_container_button_plus_[[post_id]]_[[container_id]].toggleClass(class=collapsed),footnotes_container_button_minus_[[post_id]]_[[container_id]].toggleClass(class=collapsed)"
>[]</span
></[[element]]
></div
>
<div
id="footnote_references_container_[[post_id]]_[[container_id]]"
class="collapsed"
><table
class="footnotes_table footnote-reference-container"
><caption
class="accessibility"
>[[caption]]</caption
>
<tbody>
[[content]]
</tbody>
</table>
</div>
</div>

View file

@ -0,0 +1,58 @@
<!--<?php//for docblock, @see MCI_Footnotes_Template::process_template()
/**
* Reference container template to enable AMP compatibility mode.
*
* - Adding: Reference container: get expanding and collapsing to work also in AMP compatibility mode, thanks to @westonruter code contribution.
*
* @since 2.5.11 (draft)
* @since 2.6.0 (release)
*
* @contributor @westonruter
* @link https://github.com/markcheret/footnotes/issues/48#issuecomment-799580854
* @link https://github.com/markcheret/footnotes/issues/48#issuecomment-799582394
* @link https://amp.dev/documentation/guides-and-tutorials/learn/amp-actions-and-events/#*-(all-elements)
*
* - Bugfix: Reference container: apply web semantics to improve readability for assistive technologies, thanks to @derivationfr issue report and code contribution.
*
* @since 2.5.11
*
* @contributor @derivationfr
* @link https://wordpress.org/support/topic/enhance-accesibility-by-using-instead-of/
* @link https://a11y-101.com/development/tables
*
* For assistive technologies to improve accessibility by reading tables in a meaningful manner,
* the tables must be marked up properly using table header elements for header rows and header
* columns as applicable.
* The table caption must also be present for screen readers but may be hidden to sighted users.
*/?>
-->
<div
class="speaker-mute footnotes_reference_container"
>
<div
class="footnote_container_prepare"
><[[element]]
><span
role="button"
tabindex="0"
id="footnotes_container_label_expand_[[post_id]]_[[container_id]]"
class="footnote_reference_container_label pointer"
on="tap:footnote_references_container_[[post_id]]_[[container_id]].toggleClass(class=collapsed)"
>[[name]]</span
></[[element]]
></div
>
<div
id="footnote_references_container_[[post_id]]_[[container_id]]"
><table
class="footnotes_table footnote-reference-container"
><caption
class="accessibility"
>[[caption]]</caption
>
<tbody>
[[content]]
</tbody>
</table>
</div>
</div>

View file

@ -1,13 +1,32 @@
<!--<?php//for docblock, @see MCI_Footnotes_Template::process_template()
/**
* Alternative footnote template with plain JS tooltips 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
*
* - Bugfix: Tooltips: Alternative tooltips: add missing accessibility, thanks to @derivationfr issue report.
*
* @since 2.5.11 (draft)
*
* @reporter @derivationfr
* @link https://wordpress.org/support/topic/enhance-accesibility-by-using-instead-of/
*/?>
-->
<span
class="footnote_referrer relative"
onmouseover="footnote_tooltip_show('footnote_plugin_tooltip_text_[[post_id]]_[[container_id]]_[[note_id]]')"
onfocus="footnote_tooltip_show('footnote_plugin_tooltip_text_[[post_id]]_[[container_id]]_[[note_id]]')"
onmouseout="footnote_tooltip_hide('footnote_plugin_tooltip_text_[[post_id]]_[[container_id]]_[[note_id]]')"
onfocusout="footnote_tooltip_hide('footnote_plugin_tooltip_text_[[post_id]]_[[container_id]]_[[note_id]]')"
><[[link-span]]
onclick="footnote_moveToAnchor_[[post_id]]_[[container_id]]('footnote_plugin_reference_[[post_id]]_[[container_id]]_[[note_id]]');"
role="button"
tabindex="0"
onclick="footnote_moveToReference_[[post_id]]_[[container_id]]('footnote_plugin_reference_[[post_id]]_[[container_id]]_[[note_id]]');"
[[hard-link]]
><[[sup-span]]
id="footnote_plugin_tooltip_[[post_id]]_[[container_id]]_[[note_id]]"

View file

@ -5,7 +5,10 @@
<span
class="footnote_referrer"
><[[link-span]]
onclick="footnote_moveToAnchor_[[post_id]]_[[container_id]]('footnote_plugin_reference_[[post_id]]_[[container_id]]_[[note_id]]');"
role="button"
tabindex="0"
onclick="footnote_moveToReference_[[post_id]]_[[container_id]]('footnote_plugin_reference_[[post_id]]_[[container_id]]_[[note_id]]');"
onkeypress="footnote_moveToReference_[[post_id]]_[[container_id]]('footnote_plugin_reference_[[post_id]]_[[container_id]]_[[note_id]]');"
[[hard-link]]
><[[sup-span]]
id="footnote_plugin_tooltip_[[post_id]]_[[container_id]]_[[note_id]]"

View file

@ -12,14 +12,32 @@
*
* @reporter @hopper87it
* @link https://wordpress.org/support/topic/footnotes-wp-rocket/
*
*
* @reporter @pkverma99
* @link https://wordpress.org/support/topic/footnotes-wp-rocket/#post-14076188
*
* The heavy jQuery Core library from WordPress must not be deferred for
* The heavy jQuery Core library from WordPress must not be deferred for
* the jQuery reference container to work, and is detrimental to page speed.
* This alternative works with plain JS but does not support scroll animation.
* The plugin is set to enable hard links when this option is enabled.
*
* - Bugfix: Reference container: apply web semantics to improve readability for assistive technologies, thanks to @derivationfr issue report and code contribution.
*
* @since 2.5.11
*
* @contributor @derivationfr
* @link https://wordpress.org/support/topic/enhance-accesibility-by-using-instead-of/
* @link https://a11y-101.com/development/tables
*
* For assistive technologies to improve accessibility by reading tables in a meaningful manner,
* the tables must be marked up properly using table header elements for header rows and header
* columns as applicable.
* The table caption must also be present for screen readers but may be hidden to sighted users.
*
* - Bugfix: Backlinks: reflect scroll functions down/up differentiation across the template set, thanks to @bogosavljev bug report.
*
* @reporter @bogosavljef
* @link https://wordpress.org/support/topic/compatibility-issue-with-wpforms/#post-14214720
*/?>
-->
<div
@ -29,27 +47,39 @@
class="footnote_container_prepare"
><[[element]]
><span
role="button"
tabindex="0"
id="footnotes_container_label_expand_[[post_id]]_[[container_id]]"
class="footnote_reference_container_label pointer"
onclick="footnote_expand_reference_container_[[post_id]]_[[container_id]]();"
onkeydown="footnote_expand_reference_container_[[post_id]]_[[container_id]]();"
>[[name]]</span
><span
role="button"
tabindex="0"
id="footnotes_container_button_plus_[[post_id]]_[[container_id]]"
class="footnote_reference_container_collapse_button"
style="[[button-style]]"
onclick="footnote_expand_reference_container_[[post_id]]_[[container_id]]();"
onkeydown="footnote_expand_reference_container_[[post_id]]_[[container_id]]();"
>[+]</span
><span
role="button"
tabindex="0"
id="footnotes_container_label_collapse_[[post_id]]_[[container_id]]"
class="footnote_reference_container_label pointer"
style="display: none;"
onclick="footnote_collapse_reference_container_[[post_id]]_[[container_id]]();"
onkeydown="footnote_collapse_reference_container_[[post_id]]_[[container_id]]();"
>[[name]]</span
><span
role="button"
tabindex="0"
id="footnotes_container_button_minus_[[post_id]]_[[container_id]]"
class="footnote_reference_container_collapse_button"
style="display: none;"
onclick="footnote_collapse_reference_container_[[post_id]]_[[container_id]]();"
onkeydown="footnote_collapse_reference_container_[[post_id]]_[[container_id]]();"
>[]</span
></[[element]]
></div
@ -57,10 +87,12 @@
<div
id="footnote_references_container_[[post_id]]_[[container_id]]"
style="[[style]]"
>
<table
><table
class="footnotes_table footnote-reference-container"
>
><caption
class="accessibility"
>[[caption]]</caption
>
<tbody>
[[content]]
</tbody>
@ -82,7 +114,10 @@
document.getElementById('footnotes_container_button_minus_[[post_id]]_[[container_id]]').style.display = "none";
document.getElementById('footnotes_container_button_plus_[[post_id]]_[[container_id]]').style.display = "inline";
}
function footnote_moveToAnchor_[[post_id]]_[[container_id]](p_str_TargetID) {
function footnote_moveToReference_[[post_id]]_[[container_id]](p_str_TargetID) {
footnote_expand_reference_container_[[post_id]]_[[container_id]]();
}
function footnote_moveToAnchor_[[post_id]]_[[container_id]](p_str_TargetID) {
/* defined to keep using standard row templates */
}
</script>

View file

@ -1,19 +1,40 @@
<!--<?php//for docblock, @see MCI_Footnotes_Template::process_template()
/**
* Table row template with legacy extra column for backlink symbol, uncombined footnotes.
*
* - Bugfix: Reference container: option to restore pre-2.0.0 layout with the backlink symbol in an extra column.
*
* @since 2.1.1
*
* - Bugfix: Reference container: apply web semantics to improve readability for assistive technologies, thanks to @derivationfr issue report and code contribution.
*
* @since 2.5.11
*
* @contributor @derivationfr
* @link https://wordpress.org/support/topic/enhance-accesibility-by-using-instead-of/
* @link https://a11y-101.com/development/tables
*
* For assistive technologies to improve accessibility by reading tables in a meaningful manner,
* the tables must be marked up properly using table header elements for header rows and header
* columns as applicable.
* The table caption must also be present for screen readers but may be hidden to sighted users.
*/?>
-->
<tr class="footnotes_plugin_reference_row">
<td
<th
scope="row"
class="footnote_plugin_index"
><[[link-span]]
role="button"
tabindex="0"
id="footnote_plugin_reference_[[post_id]]_[[container_id]]_[[note_id]]"
class="footnote_index"
onclick="footnote_moveToAnchor_[[post_id]]_[[container_id]]('footnote_plugin_tooltip_[[post_id]]_[[container_id]]_[[note_id]]');"
[[hard-link]]
>[[index]][[terminator]]</[[link-span]]
>[[anchor-element]]</td
>[[anchor-element]]</th
>
<td
<td
class="footnote_plugin_symbol"
><[[link-span]]
onclick="footnote_moveToAnchor_[[post_id]]_[[container_id]]('footnote_plugin_tooltip_[[post_id]]_[[container_id]]_[[note_id]]');"
@ -22,7 +43,7 @@
>[[arrow]]</[[link-span]]
></td
>
<td
<td
class="footnote_plugin_text"
>[[text]]</td
>

View file

@ -1,14 +1,36 @@
<!--<?php//for docblock, @see MCI_Footnotes_Template::process_template()
/**
* Table row template with the ability to have combined footnotes.
*
* - Bugfix: Referrers, reference container: Combining identical footnotes: fix dead links and ensure referrer-backlink bijectivity, thanks to @happyches bug report.
*
* @since 2.1.1
*
* @reporter @happyches
* @link https://wordpress.org/support/topic/custom-css-for-jumbled-references/
*
* - Bugfix: Reference container: apply web semantics to improve readability for assistive technologies, thanks to @derivationfr issue report and code contribution.
*
* @since 2.5.11
*
* @contributor @derivationfr
* @link https://wordpress.org/support/topic/enhance-accesibility-by-using-instead-of/
* @link https://a11y-101.com/development/tables
*
* For assistive technologies to improve accessibility by reading tables in a meaningful manner,
* the tables must be marked up properly using table header elements for header rows and header
* columns as applicable.
* The table caption must also be present for screen readers but may be hidden to sighted users.
*/?>
-->
<tr class="footnotes_plugin_reference_row">
<td
<th
scope="row"
class="footnote_plugin_index_combi[[pointer]]"
[[event]]
>[[backlinks]]</td
>[[backlinks]]</th
>
<td
<td
class="footnote_plugin_text"
>[[text]]</td>
</tr>

View file

@ -1,19 +1,43 @@
<!--<?php//for docblock, @see MCI_Footnotes_Template::process_template()
/**
* Table row template for uncombined footnotes with the backlink symbol appended.
*
* - Bugfix: Reference container: option to append symbol (prepended by default), thanks to @spaceling code contribution.
*
* @since 2.1.1
*
* @contributor @spaceling
* @link https://wordpress.org/support/topic/change-the-position-5/#post-13615994
*
* - Bugfix: Reference container: apply web semantics to improve readability for assistive technologies, thanks to @derivationfr issue report and code contribution.
*
* @since 2.5.11
*
* @contributor @derivationfr
* @link https://wordpress.org/support/topic/enhance-accesibility-by-using-instead-of/
* @link https://a11y-101.com/development/tables
*
* For assistive technologies to improve accessibility by reading tables in a meaningful manner,
* the tables must be marked up properly using table header elements for header rows and header
* columns as applicable.
* The table caption must also be present for screen readers but may be hidden to sighted users.
*/?>
-->
<tr class="footnotes_plugin_reference_row">
<td
<th
scope="row"
id="footnote_plugin_reference_[[post_id]]_[[container_id]]_[[note_id]]"
class="footnote_plugin_index pointer"
onclick="footnote_moveToAnchor_[[post_id]]_[[container_id]]('footnote_plugin_tooltip_[[post_id]]_[[container_id]]_[[note_id]]');"
><[[link-span]]
role="button"
tabindex="0"
class="footnote_plugin_link"
[[hard-link]]
>[[index]][[terminator]][[arrow]]</[[link-span]]
>[[anchor-element]]</td
>[[anchor-element]]</th
>
<td
<td
class="footnote_plugin_text"
>[[text]]</td>
</tr>

View file

@ -1,23 +1,39 @@
<!--<?php//for docblock, @see MCI_Footnotes_Template::process_template()
/**
* Default table row template for uncombined footnotes
*
* Table row default template for uncombined footnotes.
*
* @since 2.2.10 Bugfix: Reference container: add missing container ID in function name in default table row template for uncombined footnotes.
*
*
*
* - Bugfix: Reference container: apply web semantics to improve readability for assistive technologies, thanks to @derivationfr issue report and code contribution.
*
* @since 2.5.11
*
* @contributor @derivationfr
* @link https://wordpress.org/support/topic/enhance-accesibility-by-using-instead-of/
* @link https://a11y-101.com/development/tables
*
* For assistive technologies to improve accessibility by reading tables in a meaningful manner,
* the tables must be marked up properly using table header elements for header rows and header
* columns as applicable.
* The table caption must also be present for screen readers but may be hidden to sighted users.
*/?>
-->
<tr class="footnotes_plugin_reference_row">
<td
<th
scope="row"
id="footnote_plugin_reference_[[post_id]]_[[container_id]]_[[note_id]]"
class="footnote_plugin_index pointer"
onclick="footnote_moveToAnchor_[[post_id]]_[[container_id]]('footnote_plugin_tooltip_[[post_id]]_[[container_id]]_[[note_id]]');"
><[[link-span]]
role="button"
tabindex="0"
class="footnote_plugin_link"
[[hard-link]]
>[[arrow]][[index]][[terminator]]</[[link-span]]
>[[anchor-element]]</td
>[[anchor-element]]</th
>
<td
<td
class="footnote_plugin_text"
>[[text]]</td
>

View file

@ -2,13 +2,9 @@
/**
* Yields the reference container start and end including the scroll script.
*
* @since Unknown
* @since unknown
* @type object
*
* @lastmodified 2021-02-18T2046+0100
*
*
*
* - Bugfix: Reference container: restore expand/collapse button in the template, thanks to @ragonesi bug report.
*
* @since 2.0.2
@ -18,6 +14,19 @@
*
* The expand/collapse button was lost @since 2.0.0 for an unknown reason.
* The fix was about restoring the button code (only, while the script remained complete).
*
* - Bugfix: Reference container: apply web semantics to improve readability for assistive technologies, thanks to @derivationfr issue report and code contribution.
*
* @since 2.5.11
*
* @contributor @derivationfr
* @link https://wordpress.org/support/topic/enhance-accesibility-by-using-instead-of/
* @link https://a11y-101.com/development/tables
*
* For assistive technologies to improve accessibility by reading tables in a meaningful manner,
* the tables must be marked up properly using table header elements for header rows and header
* columns as applicable.
* The table caption must also be present for screen readers but may be hidden to sighted users.
*/?>
-->
<div
@ -27,10 +36,14 @@
class="footnote_container_prepare"
><[[element]]
><span
role="button"
tabindex="0"
class="footnote_reference_container_label pointer"
onclick="footnote_expand_collapse_reference_container_[[post_id]]_[[container_id]]();"
>[[name]]</span
><span
role="button"
tabindex="0"
class="footnote_reference_container_collapse_button"
style="[[button-style]]"
onclick="footnote_expand_collapse_reference_container_[[post_id]]_[[container_id]]();"
@ -44,10 +57,12 @@
<div
id="footnote_references_container_[[post_id]]_[[container_id]]"
style="[[style]]"
>
<table
><table
class="footnotes_table footnote-reference-container"
>
><caption
class="accessibility"
>[[caption]]</caption
>
<tbody>
[[content]]
</tbody>
@ -70,14 +85,26 @@
footnote_collapse_reference_container_[[post_id]]_[[container_id]]();
}
}
function footnote_moveToReference_[[post_id]]_[[container_id]](p_str_TargetID) {
footnote_expand_reference_container_[[post_id]]_[[container_id]]();
var l_obj_Target = jQuery('#' + p_str_TargetID);
if (l_obj_Target.length) {
jQuery( 'html, body' ).delay( [[scroll-down-delay]] );
jQuery('html, body').animate({
scrollTop: l_obj_Target.offset().top - window.innerHeight * [[scroll-offset]]
},
[[scroll-down-duration]]);
}
}
function footnote_moveToAnchor_[[post_id]]_[[container_id]](p_str_TargetID) {
footnote_expand_reference_container_[[post_id]]_[[container_id]]();
var l_obj_Target = jQuery('#' + p_str_TargetID);
if (l_obj_Target.length) {
jQuery( 'html, body' ).delay( [[scroll-up-delay]] );
jQuery('html, body').animate({
scrollTop: l_obj_Target.offset().top - window.innerHeight * [[scroll-offset]]
},
[[scroll-duration]]);
[[scroll-up-duration]]);
}
}
</script>