Debugged development test and prerelease v2.6.0d5, Stable Tag 2.5.10.

Tooltip fade-in/fade-out now works in AMP and everything is functional,
except scroll animation because animated scrolling in AMP has only 3 positions.

git-svn-id: https://plugins.svn.wordpress.org/footnotes/trunk@2498089 b8457f37-d9ea-0310-8a92-e5e31aec5664
This commit is contained in:
pewgeuges 2021-03-17 15:51:49 +00:00
parent 12301035ab
commit 93d1c06373
14 changed files with 108 additions and 69 deletions

View file

@ -181,7 +181,7 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_Layout_Engine {
'amp' => $this->add_checkbox( MCI_Footnotes_Settings::C_STR_FOOTNOTES_AMP_COMPATIBILITY_ENABLE ), '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 % window height.', 'footnotes' ), 'notice-amp' => __( 'This option enables hard links with configurable scroll offset in % window height.', 'footnotes' ),
// Translators: '%s' is the logogram of the 'Footnotes' plugin. // Translators: '%s' is the logogram of the 'Footnotes' plugin.
'description-amp' => sprintf( __( '%s becomes AMP compatible if this box is checked, but without scroll animation and fade-in/fade-out. Styled tooltips show up if enabled, and the reference container expands also on clicking a referrer if its collapsed by default.', 'footnotes' ), '<span style="font-style: normal;">' . MCI_Footnotes_Config::C_STR_PLUGIN_PUBLIC_NAME . '</span>' ), 'description-amp' => sprintf( __( '%s is AMP compatible (without scroll animation) 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 its collapsed by default.', 'footnotes' ), '<span style="font-style: normal;">' . MCI_Footnotes_Config::C_STR_PLUGIN_PUBLIC_NAME . '</span>' ),
) )
); );
// Display template with replaced placeholders. // Display template with replaced placeholders.

View file

@ -861,7 +861,7 @@ class MCI_Footnotes_Task {
} }
/** /**
* Tooltip position and timing. * Tooltip position, dimensions and timing.
* *
* - Bugfix: Tooltips: make display delays and fade durations configurable to conform to website style. * - Bugfix: Tooltips: make display delays and fade durations configurable to conform to website style.
* *
@ -874,28 +874,44 @@ class MCI_Footnotes_Task {
* @date 2020-12-18T1113+0100 * @date 2020-12-18T1113+0100
*/ */
if ( ! MCI_Footnotes::$a_bool_alternative_tooltips_enabled && ! MCI_Footnotes::$a_bool_amp_enabled ) { if ( ! MCI_Footnotes::$a_bool_alternative_tooltips_enabled && ! MCI_Footnotes::$a_bool_amp_enabled ) {
/*
* jQuery tooltips. /**
* Dimensions of jQuery tooltips.
*
* Position and timing of jQuery tooltips are script defined.
* @see templates/public/tooltip.html.
*/ */
$l_int_max_width = MCI_Footnotes_Settings::instance()->get( MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_MAX_WIDTH ); $l_int_max_width = MCI_Footnotes_Settings::instance()->get( MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_MAX_WIDTH );
if ( ! empty( $l_int_max_width ) && intval( $l_int_max_width ) > 0 ) { if ( ! empty( $l_int_max_width ) && intval( $l_int_max_width ) > 0 ) {
printf( ' max-width: %dpx !important;', $l_int_max_width ); printf( ' max-width: %dpx !important;', $l_int_max_width );
} }
echo "}\r\n"; echo "}\r\n";
} else { } else {
/* /*
* AMP compatible and alternative tooltips. * AMP compatible and alternative tooltips.
*/ */
echo "}\r\n"; echo "}\r\n";
// Dimensions. /**
* Dimensions.
*
* @see 'Determine shrink width if alternative tooltips are enabled'.
*/
$l_int_alternative_tooltip_width = intval( MCI_Footnotes_Settings::instance()->get( MCI_Footnotes_Settings::C_INT_FOOTNOTES_ALTERNATIVE_MOUSE_OVER_BOX_WIDTH ) ); $l_int_alternative_tooltip_width = intval( MCI_Footnotes_Settings::instance()->get( MCI_Footnotes_Settings::C_INT_FOOTNOTES_ALTERNATIVE_MOUSE_OVER_BOX_WIDTH ) );
echo '.footnote_tooltip.position {'; echo '.footnote_tooltip.position {';
echo ' width: ' . $l_int_alternative_tooltip_width . 'px;'; echo ' width: ' . $l_int_alternative_tooltip_width . 'px;';
// Set also as max-width wrt short tooltip shrinking. // Set also as max-width wrt short tooltip shrinking.
echo ' max-width: ' . $l_int_alternative_tooltip_width . 'px;'; echo ' max-width: ' . $l_int_alternative_tooltip_width . 'px;';
// Position. /**
* Position.
*
* @see dev-amp-tooltips.css.
* @see dev-tooltips-alternative.css.
*/
$l_str_alternative_position = MCI_Footnotes_Settings::instance()->get( MCI_Footnotes_Settings::C_STR_FOOTNOTES_ALTERNATIVE_MOUSE_OVER_BOX_POSITION ); $l_str_alternative_position = MCI_Footnotes_Settings::instance()->get( MCI_Footnotes_Settings::C_STR_FOOTNOTES_ALTERNATIVE_MOUSE_OVER_BOX_POSITION );
$l_int_offset_x = intval( MCI_Footnotes_Settings::instance()->get( MCI_Footnotes_Settings::C_INT_FOOTNOTES_ALTERNATIVE_MOUSE_OVER_BOX_OFFSET_X ) ); $l_int_offset_x = intval( MCI_Footnotes_Settings::instance()->get( MCI_Footnotes_Settings::C_INT_FOOTNOTES_ALTERNATIVE_MOUSE_OVER_BOX_OFFSET_X ) );
@ -914,38 +930,54 @@ class MCI_Footnotes_Task {
} }
echo "}\r\n"; echo "}\r\n";
/*
* Timing.
*/
$l_int_fade_in_delay = intval( MCI_Footnotes_Settings::instance()->get( MCI_Footnotes_Settings::C_INT_MOUSE_OVER_BOX_FADE_IN_DELAY ) );
$l_int_fade_in_delay = ! empty( $l_int_fade_in_delay ) ? $l_int_fade_in_delay : '0';
$l_int_fade_in_duration = intval( MCI_Footnotes_Settings::instance()->get( MCI_Footnotes_Settings::C_INT_MOUSE_OVER_BOX_FADE_IN_DURATION ) );
$l_int_fade_in_duration = ! empty( $l_int_fade_in_duration ) ? $l_int_fade_in_duration : '0';
$l_int_fade_out_delay = intval( MCI_Footnotes_Settings::instance()->get( MCI_Footnotes_Settings::C_INT_MOUSE_OVER_BOX_FADE_OUT_DELAY ) );
$l_int_fade_out_delay = ! empty( $l_int_fade_out_delay ) ? $l_int_fade_out_delay : '0';
$l_int_fade_out_duration = intval( MCI_Footnotes_Settings::instance()->get( MCI_Footnotes_Settings::C_INT_MOUSE_OVER_BOX_FADE_OUT_DURATION ) );
$l_int_fade_out_duration = ! empty( $l_int_fade_out_duration ) ? $l_int_fade_out_duration : '0';
/** /**
* AMP compatible and alternative tooltip timing. * AMP compatible tooltips.
* *
* @see dev-amp-tooltips.css or dev-tooltips-alternative.css. * To streamline internal CSS, immutable rules are in external stylesheet.
* For jQuery tooltip timing @see templates/public/tooltip.html. * @see dev-amp-tooltips.css.
*/ */
if ( MCI_Footnotes::$a_bool_amp_enabled ) { if ( MCI_Footnotes::$a_bool_amp_enabled ) {
echo 'span.footnote_referrer > span.footnote_tooltip {'; echo 'span.footnote_referrer > span.footnote_tooltip {';
} else { echo 'transition-delay: ' . $l_int_fade_out_delay . 'ms;';
echo '.footnote_tooltip.hidden {'; echo 'transition-duration: ' . $l_int_fade_out_duration . 'ms;';
}
$l_int_fade_out_delay = intval( MCI_Footnotes_Settings::instance()->get( MCI_Footnotes_Settings::C_INT_MOUSE_OVER_BOX_FADE_OUT_DELAY ) );
$l_int_fade_out_duration = intval( MCI_Footnotes_Settings::instance()->get( MCI_Footnotes_Settings::C_INT_MOUSE_OVER_BOX_FADE_OUT_DURATION ) );
$l_int_fade_out_delay = ! empty( $l_int_fade_out_delay ) ? $l_int_fade_out_delay : '0';
$l_int_fade_out_duration = ! empty( $l_int_fade_out_duration ) ? $l_int_fade_out_duration : '0';
echo ' transition-delay: ' . $l_int_fade_out_delay . 'ms;';
echo ' transition-duration: ' . $l_int_fade_out_duration . 'ms;';
echo "}\r\n"; echo "}\r\n";
if ( MCI_Footnotes::$a_bool_amp_enabled ) {
echo 'span.footnote_referrer:focus-within > span.footnote_tooltip, span.footnote_referrer:hover > span.footnote_tooltip {'; echo 'span.footnote_referrer:focus-within > span.footnote_tooltip, span.footnote_referrer:hover > span.footnote_tooltip {';
} else { echo 'transition-delay: ' . $l_int_fade_in_delay . 'ms;';
echo '.footnote_tooltip.shown {'; echo 'transition-duration: ' . $l_int_fade_in_duration . 'ms;';
}
$l_int_fade_in_delay = intval( MCI_Footnotes_Settings::instance()->get( MCI_Footnotes_Settings::C_INT_MOUSE_OVER_BOX_FADE_IN_DELAY ) );
$l_int_fade_in_duration = intval( MCI_Footnotes_Settings::instance()->get( MCI_Footnotes_Settings::C_INT_MOUSE_OVER_BOX_FADE_IN_DURATION ) );
$l_int_fade_in_delay = ! empty( $l_int_fade_in_delay ) ? $l_int_fade_in_delay : '0';
$l_int_fade_in_duration = ! empty( $l_int_fade_in_duration ) ? $l_int_fade_in_duration : '0';
echo ' transition-delay: ' . $l_int_fade_in_delay . 'ms;';
echo ' transition-duration: ' . $l_int_fade_in_duration . 'ms;';
echo "}\r\n"; echo "}\r\n";
/**
* Alternative tooltips.
*
* To streamline internal CSS, immutable rules are in external stylesheet.
* @see dev-tooltips-alternative.css.
*/
} else {
echo '.footnote_tooltip.hidden {';
echo 'transition-delay: ' . $l_int_fade_out_delay . 'ms;';
echo 'transition-duration: ' . $l_int_fade_out_duration . 'ms;';
echo "}\r\n";
echo '.footnote_tooltip.shown {';
echo 'transition-delay: ' . $l_int_fade_in_delay . 'ms;';
echo 'transition-duration: ' . $l_int_fade_in_duration . 'ms;';
echo "}\r\n";
}
} }
} }

View file

@ -4,11 +4,11 @@
* *
* @since 2.5.5 * @since 2.5.5
* @version 2.6.0 * @version 2.6.0
* @lastmodified 2021-03-16T2340+0100 * @lastmodified 2021-03-17T1627+0100
* *
* System of unified minified style sheets tailored to the instance. * System of unified minified style sheets tailored to the instance.
* *
* @see full header in dev-common.css. * @see dev-common.css.
*/ */
/** /**
@ -24,14 +24,16 @@
* @contributor @westonruter * @contributor @westonruter
* @link https://github.com/ampproject/amp-wp/issues/5913#issuecomment-785419655 * @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
*/ */
span.footnote_referrer > span.footnote_tooltip { span.footnote_referrer > span.footnote_tooltip {
visibility:hidden; visibility: hidden;
opacity:"0"; opacity: 0;
transition-property: visibility opacity; transition-property: visibility opacity;
/* /*
Property values of settings are internal CSS.
transition-delay: 500ms; transition-delay: 500ms;
transition-duration: 1s; transition-duration: 1s;
*/ */
@ -39,18 +41,20 @@ Property values of settings are internal CSS.
span.footnote_referrer:focus-within > span.footnote_tooltip, span.footnote_referrer:focus-within > span.footnote_tooltip,
span.footnote_referrer:hover > span.footnote_tooltip { span.footnote_referrer:hover > span.footnote_tooltip {
visibility:visible; visibility: visible;
opacity:1; opacity: 1;
transition-property: visibility opacity; transition-property: visibility opacity;
/* /*
Property values of settings are internal CSS.
transition-delay: 0; transition-delay: 0;
transition-duration: 200ms; transition-duration: 200ms;
*/ */
} }
/** /**
* These default position values may be overridden by internal CSS. * Position.
*
* Values are defined by internal CSS.
* @see class/task.php
*/ */
.footnote_referrer.relative { .footnote_referrer.relative {
@ -60,7 +64,9 @@ Property values of settings are internal CSS.
.footnote_tooltip.position { .footnote_tooltip.position {
display: unset; display: unset;
position: absolute; position: absolute;
/*
bottom: 24px; bottom: 24px;
left: -50px; left: -50px;
width: 400px; width: 400px;
*/
} }

View file

@ -4,17 +4,18 @@
* *
* @since 2.5.5 * @since 2.5.5
* @version 2.6.0 * @version 2.6.0
* @lastmodified 2021-03-16T1531+0100 * @lastmodified 2021-03-17T1552+0100
* *
* System of unified minified style sheets tailored to the instance. * System of unified minified style sheets tailored to the instance.
* *
* @see full header in dev-common.css. * @see dev-common.css.
*/ */
/** /**
* Alternative tooltips * Position.
* *
* These default position values may be overridden by internal CSS. * Values are defined by internal CSS.
* @see class/task.php
*/ */
.footnote_referrer.relative { .footnote_referrer.relative {
@ -24,13 +25,19 @@
.footnote_tooltip.position { .footnote_tooltip.position {
display: unset; display: unset;
position: absolute; position: absolute;
/*
bottom: 24px; bottom: 24px;
left: -50px; left: -50px;
width: 400px; 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 { .footnote_tooltip.shown {
@ -39,23 +46,17 @@ fade-in parameters
transition-property: visibility opacity; transition-property: visibility opacity;
transition-timing-function: linear; transition-timing-function: linear;
/* /*
Property values of settings are internal CSS.
transition-delay: 0ms; transition-delay: 0ms;
transition-duration: 200ms; transition-duration: 200ms;
*/ */
} }
/*
fade-out parameters
*/
.footnote_tooltip.hidden { .footnote_tooltip.hidden {
visibility: hidden; visibility: hidden;
opacity: 0; opacity: 0;
transition-property: visibility opacity; transition-property: visibility opacity;
transition-timing-function: linear; transition-timing-function: linear;
/* /*
property values of settings are inline CSS
transition-delay: 400ms; transition-delay: 400ms;
transition-duration: 200ms; transition-duration: 200ms;
*/ */

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -4,8 +4,8 @@
* Plugin URI: https://wordpress.org/plugins/footnotes/ * Plugin URI: https://wordpress.org/plugins/footnotes/
* Description: time to bring footnotes to your website! footnotes are known from offline publishing and everybody takes them for granted when reading a magazine. * Description: time to bring footnotes to your website! footnotes are known from offline publishing and everybody takes them for granted when reading a magazine.
* Author: Mark Cheret * Author: Mark Cheret
* Package V.: 2.6.0d4 * Package V.: 2.6.0d5
* Version: 2.6.0 * Version: 2.6.0d
* CAUTION: THIS V. FIELD IS PARSED FOR UPDATE CONFIGURATION. * CAUTION: THIS V. FIELD IS PARSED FOR UPDATE CONFIGURATION.
* Author URI: https://cheret.org/footnotes/ * Author URI: https://cheret.org/footnotes/
* Text Domain: footnotes * Text Domain: footnotes
@ -24,9 +24,9 @@
* @since 2.1.4 * @since 2.1.4
* @since 2.5.3 (Hungarian) * @since 2.5.3 (Hungarian)
* @var str * @var str
* @lastmodified 2021-03-17T0330+0100 * @lastmodified 2021-03-17T1628+0100
*/ */
define( 'C_STR_PACKAGE_VERSION', '2.6.0d4' ); define( 'C_STR_PACKAGE_VERSION', '2.6.0d5' );
/** /**
* Version numbers in WordPress plugin readme.txt and main PHP headers. * Version numbers in WordPress plugin readme.txt and main PHP headers.

View file

@ -4,8 +4,8 @@ Tags: footnote, footnotes, bibliography, formatting, notes, Post, posts, referen
Requires at least: 3.9 Requires at least: 3.9
Tested up to: 5.7 Tested up to: 5.7
Requires PHP: 5.6 Requires PHP: 5.6
Package Version: 2.6.0d4 Package Version: 2.6.0d5
Version: 2.6.0 Version: 2.6.0d
Stable Tag: 2.5.10 Stable Tag: 2.5.10
CAUTION: THE S. T. FIELD IS PARSED FOR RELEASE CONFIGURATION. CAUTION: THE S. T. FIELD IS PARSED FOR RELEASE CONFIGURATION.
License: GPLv3 or later License: GPLv3 or later