Development preview 2.6.0d1 with AMP compat at work.

Stable Tag is 2.5.10. v2.6.0d0 does already exist on SVN (2456650 2021-01-14).
Tooltip timing settings are not yet usable in AMP mode.
Tooltip transitions don’t work now, only delays, need to debug.
It’s late and we have a deadline, so this is committed as a preview.
Thanks for looking into it.

git-svn-id: https://plugins.svn.wordpress.org/footnotes/trunk@2497297 b8457f37-d9ea-0310-8a92-e5e31aec5664
This commit is contained in:
pewgeuges 2021-03-16 19:41:08 +00:00
parent 7b7b8547b1
commit c5a9af037a
31 changed files with 586 additions and 204 deletions

View file

@ -131,6 +131,7 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_Layout_Engine {
$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' );
@ -164,6 +165,31 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_Layout_Engine {
return $l_arr_meta_boxes;
}
/**
* Displays the AMP compatibility mode option.
*
* @since 2.6.0
*/
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(
'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 scroll offset.', 'footnotes' ),
// Translators: '%s' is the logogram of Footnotes.
'description-amp' => sprintf( __( '%s is now fully functional on AMP pages and websites in all modes including Standard mode, except animated scrolling but with scroll offset in screen height per cent as configured, styled tooltips and reference container expand/collapse.', '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.
*