refactor: rename templates/
into partials/
, split into admin and public
This commit is contained in:
parent
84c299a368
commit
88e3302166
43 changed files with 0 additions and 0 deletions
40
src/public/partials/amp-footnote-expand.html
Normal file
40
src/public/partials/amp-footnote-expand.html
Normal 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 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
|
||||
>
|
35
src/public/partials/amp-footnote.html
Normal file
35
src/public/partials/amp-footnote.html
Normal 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 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
|
||||
>
|
|
@ -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>
|
38
src/public/partials/amp-reference-container-body-combi.html
Normal file
38
src/public/partials/amp-reference-container-body-combi.html
Normal 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>
|
45
src/public/partials/amp-reference-container-body-switch.html
Normal file
45
src/public/partials/amp-reference-container-body-switch.html
Normal 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>
|
39
src/public/partials/amp-reference-container-body.html
Executable file
39
src/public/partials/amp-reference-container-body.html
Executable 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>
|
75
src/public/partials/amp-reference-container-collapsed.html
Normal file
75
src/public/partials/amp-reference-container-collapsed.html
Normal 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>
|
58
src/public/partials/amp-reference-container.html
Normal file
58
src/public/partials/amp-reference-container.html
Normal 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>
|
43
src/public/partials/footnote-alternative.html
Normal file
43
src/public/partials/footnote-alternative.html
Normal file
|
@ -0,0 +1,43 @@
|
|||
<!--<?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]]
|
||||
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]]"
|
||||
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 hidden"
|
||||
onmouseout="footnote_tooltip_hide('footnote_plugin_tooltip_text_[[post_id]]_[[container_id]]_[[note_id]]')"
|
||||
[[style]]
|
||||
>[[text]]</span
|
||||
></span
|
||||
>
|
23
src/public/partials/footnote.html
Executable file
23
src/public/partials/footnote.html
Executable file
|
@ -0,0 +1,23 @@
|
|||
<!--<?php//for docblock, @see MCI_Footnotes_Template::process_template()
|
||||
/**
|
||||
*/?>
|
||||
-->
|
||||
<span
|
||||
class="footnote_referrer"
|
||||
><[[link-span]]
|
||||
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]]"
|
||||
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"
|
||||
>[[text]]</span
|
||||
></span
|
||||
>
|
123
src/public/partials/js-reference-container.html
Normal file
123
src/public/partials/js-reference-container.html
Normal file
|
@ -0,0 +1,123 @@
|
|||
<!--<?php//for docblock, @see MCI_Footnotes_Template::process_template()
|
||||
/**
|
||||
* Plain JavaScript reference container start and end without scroll script.
|
||||
*
|
||||
* @since 2.5.6
|
||||
* @type object
|
||||
* @lastmodified 2021-02-20T0252+0100
|
||||
*
|
||||
* - 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
|
||||
*
|
||||
* 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
|
||||
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"
|
||||
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
|
||||
>
|
||||
<div
|
||||
id="footnote_references_container_[[post_id]]_[[container_id]]"
|
||||
style="[[style]]"
|
||||
><table
|
||||
class="footnotes_table footnote-reference-container"
|
||||
><caption
|
||||
class="accessibility"
|
||||
>[[caption]]</caption
|
||||
>
|
||||
<tbody>
|
||||
[[content]]
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
function footnote_expand_reference_container_[[post_id]]_[[container_id]]() {
|
||||
document.getElementById('footnote_references_container_[[post_id]]_[[container_id]]').style.display = "inline";
|
||||
document.getElementById('footnotes_container_label_expand_[[post_id]]_[[container_id]]').style.display = "none";
|
||||
document.getElementById('footnotes_container_label_collapse_[[post_id]]_[[container_id]]').style.display = "inline";
|
||||
document.getElementById('footnotes_container_button_plus_[[post_id]]_[[container_id]]').style.display = "none";
|
||||
document.getElementById('footnotes_container_button_minus_[[post_id]]_[[container_id]]').style.display = "inline";
|
||||
}
|
||||
function footnote_collapse_reference_container_[[post_id]]_[[container_id]]() {
|
||||
document.getElementById('footnote_references_container_[[post_id]]_[[container_id]]').style.display = "none";
|
||||
document.getElementById('footnotes_container_label_collapse_[[post_id]]_[[container_id]]').style.display = "none";
|
||||
document.getElementById('footnotes_container_label_expand_[[post_id]]_[[container_id]]').style.display = "inline";
|
||||
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_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>
|
50
src/public/partials/reference-container-body-3column.html
Normal file
50
src/public/partials/reference-container-body-3column.html
Normal file
|
@ -0,0 +1,50 @@
|
|||
<!--<?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">
|
||||
<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]]</th
|
||||
>
|
||||
<td
|
||||
class="footnote_plugin_symbol"
|
||||
><[[link-span]]
|
||||
onclick="footnote_moveToAnchor_[[post_id]]_[[container_id]]('footnote_plugin_tooltip_[[post_id]]_[[container_id]]_[[note_id]]');"
|
||||
class="footnote_backlink"
|
||||
[[hard-link]]
|
||||
>[[arrow]]</[[link-span]]
|
||||
></td
|
||||
>
|
||||
<td
|
||||
class="footnote_plugin_text"
|
||||
>[[text]]</td
|
||||
>
|
||||
</tr>
|
36
src/public/partials/reference-container-body-combi.html
Normal file
36
src/public/partials/reference-container-body-combi.html
Normal file
|
@ -0,0 +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">
|
||||
<th
|
||||
scope="row"
|
||||
class="footnote_plugin_index_combi[[pointer]]"
|
||||
[[event]]
|
||||
>[[backlinks]]</th
|
||||
>
|
||||
<td
|
||||
class="footnote_plugin_text"
|
||||
>[[text]]</td>
|
||||
</tr>
|
43
src/public/partials/reference-container-body-switch.html
Normal file
43
src/public/partials/reference-container-body-switch.html
Normal file
|
@ -0,0 +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">
|
||||
<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]]</th
|
||||
>
|
||||
<td
|
||||
class="footnote_plugin_text"
|
||||
>[[text]]</td>
|
||||
</tr>
|
40
src/public/partials/reference-container-body.html
Executable file
40
src/public/partials/reference-container-body.html
Executable file
|
@ -0,0 +1,40 @@
|
|||
<!--<?php//for docblock, @see MCI_Footnotes_Template::process_template()
|
||||
/**
|
||||
* 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">
|
||||
<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]]</th
|
||||
>
|
||||
<td
|
||||
class="footnote_plugin_text"
|
||||
>[[text]]</td
|
||||
>
|
||||
</tr>
|
110
src/public/partials/reference-container.html
Normal file
110
src/public/partials/reference-container.html
Normal file
|
@ -0,0 +1,110 @@
|
|||
<!--<?php//for docblock, @see MCI_Footnotes_Template::process_template()
|
||||
/**
|
||||
* Yields the reference container start and end including the scroll script.
|
||||
*
|
||||
* @since unknown
|
||||
* @type object
|
||||
*
|
||||
* - Bugfix: Reference container: restore expand/collapse button in the template, thanks to @ragonesi bug report.
|
||||
*
|
||||
* @since 2.0.2
|
||||
*
|
||||
* @reporter @ragonesi
|
||||
* @link https://wordpress.org/support/topic/hyperlink-symbol-in-reference-container/#post-13587782
|
||||
*
|
||||
* 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
|
||||
class="speaker-mute footnotes_reference_container"
|
||||
>
|
||||
<div
|
||||
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]]();"
|
||||
>[<a
|
||||
id="footnote_reference_container_collapse_button_[[post_id]]_[[container_id]]"
|
||||
>+</a
|
||||
>]</span
|
||||
></[[element]]
|
||||
></div
|
||||
>
|
||||
<div
|
||||
id="footnote_references_container_[[post_id]]_[[container_id]]"
|
||||
style="[[style]]"
|
||||
><table
|
||||
class="footnotes_table footnote-reference-container"
|
||||
><caption
|
||||
class="accessibility"
|
||||
>[[caption]]</caption
|
||||
>
|
||||
<tbody>
|
||||
[[content]]
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
function footnote_expand_reference_container_[[post_id]]_[[container_id]]() {
|
||||
jQuery('#footnote_references_container_[[post_id]]_[[container_id]]').show();
|
||||
jQuery('#footnote_reference_container_collapse_button_[[post_id]]_[[container_id]]').text('−');
|
||||
}
|
||||
function footnote_collapse_reference_container_[[post_id]]_[[container_id]]() {
|
||||
jQuery('#footnote_references_container_[[post_id]]_[[container_id]]').hide();
|
||||
jQuery('#footnote_reference_container_collapse_button_[[post_id]]_[[container_id]]').text('+');
|
||||
}
|
||||
function footnote_expand_collapse_reference_container_[[post_id]]_[[container_id]]() {
|
||||
if (jQuery('#footnote_references_container_[[post_id]]_[[container_id]]').is(':hidden')) {
|
||||
footnote_expand_reference_container_[[post_id]]_[[container_id]]();
|
||||
} else {
|
||||
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-up-duration]]);
|
||||
}
|
||||
}
|
||||
</script>
|
18
src/public/partials/tooltip.html
Normal file
18
src/public/partials/tooltip.html
Normal file
|
@ -0,0 +1,18 @@
|
|||
<!--<?php//for docblock, @see MCI_Footnotes_Template::process_template()
|
||||
/**
|
||||
*/?>
|
||||
-->
|
||||
<script type="text/javascript">
|
||||
jQuery('#footnote_plugin_tooltip_[[post_id]]_[[container_id]]_[[note_id]]').tooltip({
|
||||
tip: '#footnote_plugin_tooltip_text_[[post_id]]_[[container_id]]_[[note_id]]',
|
||||
tipClass: 'footnote_tooltip',
|
||||
effect: 'fade',
|
||||
predelay: [[fade-in-delay]],
|
||||
fadeInSpeed: [[fade-in-duration]],
|
||||
delay: [[fade-out-delay]],
|
||||
fadeOutSpeed: [[fade-out-duration]],
|
||||
position: '[[position]]',
|
||||
relative: true,
|
||||
offset: [[[offset-y]], [[offset-x]]],
|
||||
});
|
||||
</script>
|
Reference in a new issue