Fix role attributes

This commit is contained in:
Tetrakern 2023-01-24 18:05:31 +01:00
parent 8c6a09a656
commit a122559e85
7 changed files with 19 additions and 18 deletions

View File

@ -642,7 +642,7 @@ if ( ! function_exists( 'fictioneer_get_story_buttons' ) ) {
if ( ! empty( $subscribe_buttons ) ) {
ob_start();
// Start HTML ---> ?>
<div class="toggle-last-clicked button _secondary popup-menu-toggle _popup-right-if-last" tabindex="0" aria-role="button" aria-label="<?php echo fcntr( 'subscribe', true ); ?>">
<div class="toggle-last-clicked button _secondary popup-menu-toggle _popup-right-if-last" tabindex="0" role="button" aria-label="<?php echo fcntr( 'subscribe', true ); ?>">
<div><i class="fa-solid fa-bell"></i> <span><?php echo fcntr( 'subscribe' ); ?></span></div>
<div class="popup-menu _bottom _center"><?php echo $subscribe_buttons; ?></div>
</div>

View File

@ -628,7 +628,7 @@ function fictioneer_shortcode_chapter_list( $attr ) {
<?php if ( $heading ) : ?>
<?php $discriminator = md5( $heading . microtime() ); ?>
<input id="group-toggle-<?php echo $discriminator; ?>" class="chapter-group__toggle" type="checkbox" hidden>
<label class="chapter-group__label" for="group-toggle-<?php echo $discriminator; ?>" tabindex="0" aria-role="button" aria-label="<?php esc_attr_e( 'Toggle chapter group collapse', 'fictioneer' ); ?>">
<label class="chapter-group__label" for="group-toggle-<?php echo $discriminator; ?>" tabindex="0" role="button" aria-label="<?php esc_attr_e( 'Toggle chapter group collapse', 'fictioneer' ); ?>">
<i class="fa-solid fa-chevron-down chapter-group__heading-icon"></i>
<span><?php echo $heading; ?></span>
</label>
@ -703,7 +703,7 @@ function fictioneer_shortcode_chapter_list( $attr ) {
<?php if ( $can_checkmarks && ! empty( $chapter_story_id ) && get_post_status( $chapter_story_id ) === 'publish' ) : ?>
<div class="chapter-group__list-item-right">
<button class="checkmark chapter-group__list-item-checkmark" data-type="chapter" data-story-id="<?php echo $chapter_story_id; ?>" data-id="<?php echo $post_id; ?>"><i class="fa-solid fa-check"></i></button>
<button class="checkmark chapter-group__list-item-checkmark" data-type="chapter" data-story-id="<?php echo $chapter_story_id; ?>" data-id="<?php echo $post_id; ?>" role="checkbox" aria-checked="false"><i class="fa-solid fa-check"></i></button>
</div>
<?php endif; ?>
</li>

View File

@ -164,7 +164,7 @@ if ( ! function_exists( 'fictioneer_change_submit_field' ) ) {
if ( get_option( 'fictioneer_enable_private_commenting' ) ) {
$hint = esc_attr_x( 'Toggle to mark as private. Hides the comment from uninvolved viewers.', 'Comment form private toggle.', 'fictioneer' );
$private_toggle = '<div class="fictioneer-private-comment-toggle fictioneer-respond__form-toggle"><label class="comment-respond-option-toggle" tabindex="0" aria-role="checkbox" aria-label="' . $hint . '"><input name="fictioneer-private-comment-toggle" id="fictioneer-private-comment-toggle" type="checkbox" hidden><span class="tooltipped _mobile-tooltip" data-tooltip="' . $hint . '"><i class="fa-solid fa-eye off"></i><i class="fa-solid fa-eye-slash on"></i></span></label></div>';
$private_toggle = '<div class="fictioneer-private-comment-toggle fictioneer-respond__form-toggle"><label class="comment-respond-option-toggle" tabindex="0" role="checkbox" aria-checked="false" aria-label="' . $hint . '"><input name="fictioneer-private-comment-toggle" id="fictioneer-private-comment-toggle" type="checkbox" hidden><span class="tooltipped _mobile-tooltip" data-tooltip="' . $hint . '"><i class="fa-solid fa-eye off"></i><i class="fa-solid fa-eye-slash on"></i></span></label></div>';
}
// Email subscriptions toggle
@ -175,7 +175,8 @@ if ( ! function_exists( 'fictioneer_change_submit_field' ) ) {
if ( get_option( 'fictioneer_enable_comment_notifications' ) && ! $notifications_blocked ) {
$hint = esc_attr_x( 'Toggle to get email notifications about direct replies.', 'Comment form email notification toggle.', 'fictioneer' );
$notification_toggle = '<div class="fictioneer-comment-notification-toggle fictioneer-respond__form-toggle"><label class="comment-respond-option-toggle" tabindex="0" aria-role="checkbox" aria-label="' . $hint . '"><input name="fictioneer-comment-notification-toggle" id="fictioneer-comment-notification-toggle" type="checkbox" ' . checked( 1, $notification_checked, false ) . ' tabindex="-1" hidden><span class="tooltipped _mobile-tooltip" data-tooltip="' . $hint . '"><i class="fa-solid fa-bell on"></i><i class="fa-solid fa-bell-slash off"></i></span></label></div>';
$aria_checked = $notification_checked ? 'true' : 'false';
$notification_toggle = '<div class="fictioneer-comment-notification-toggle fictioneer-respond__form-toggle"><label class="comment-respond-option-toggle" tabindex="0" role="checkbox" aria-checked="' . $aria_checked . '" aria-label="' . $hint . '"><input name="fictioneer-comment-notification-toggle" id="fictioneer-comment-notification-toggle" type="checkbox" ' . checked( 1, $notification_checked, false ) . ' tabindex="-1" hidden><span class="tooltipped _mobile-tooltip" data-tooltip="' . $hint . '"><i class="fa-solid fa-bell on"></i><i class="fa-solid fa-bell-slash off"></i></span></label></div>';
}
// Private comment notice for guests

View File

@ -127,7 +127,7 @@ if ( ! function_exists( 'fictioneer_chapter_warnings' ) ) {
printf(
_x( 'Warning: %1$s! — You can hide <em>marked</em> sensitive content %2$s or with the %3$s toggle in the %4$s formatting menu. If provided, <em>alternative</em> content will be displayed instead.', 'Chapter warning (1) with sensitive content toggle (2) and icons (3-4).', 'fictioneer' ),
$warning,
'<label id="inline-sensitive-content-toggle" for="reader-settings-sensitive-content-toggle" tabindex="0" aria-role="checkbox" aria-label="' . esc_attr__( 'Toggle sensitive content', 'fictioneer' ) . '"><i class="fa-solid off fa-toggle-on"></i><i class="fa-solid on fa-toggle-off"></i> <span>' . _x( 'by clicking here', ' As in hide sensitive content by clicking here.', 'fictioneer' ) . '</span></label>',
'<label id="inline-sensitive-content-toggle" for="reader-settings-sensitive-content-toggle" tabindex="0" role="checkbox" aria-label="' . esc_attr__( 'Toggle sensitive content', 'fictioneer' ) . '"><i class="fa-solid off fa-toggle-on"></i><i class="fa-solid on fa-toggle-off"></i> <span>' . _x( 'by clicking here', ' As in hide sensitive content by clicking here.', 'fictioneer' ) . '</span></label>',
'<i class="fa-solid fa-exclamation-circle"></i>',
fictioneer_get_icon( 'font-settings' )
);
@ -228,7 +228,7 @@ if ( ! function_exists( 'fictioneer_chapter_formatting_button' ) ) {
function fictioneer_chapter_formatting_button() {
// Start HTML ---> ?>
<label class="button _secondary open" for="modal-formatting-toggle" tabindex="0" aria-role="button" aria-label="<?php esc_attr_e( 'Open chapter formatting modal', 'fictioneer' ); ?>">
<label class="button _secondary open" for="modal-formatting-toggle" tabindex="0" role="button" aria-label="<?php esc_attr_e( 'Open chapter formatting modal', 'fictioneer' ); ?>">
<?php fictioneer_icon( 'font-settings' ); ?>
<span class="hide-below-tablet"><?php echo fcntr( 'formatting' ); ?></span>
</label>
@ -253,7 +253,7 @@ if ( ! function_exists( 'fictioneer_chapter_subscribe_button' ) ) {
if ( ! empty( $subscribe_buttons ) ) {
// Start HTML ---> ?>
<div class="toggle-last-clicked button _secondary popup-menu-toggle" tabindex="0" aria-role="button" aria-label="<?php echo fcntr( 'subscribe', true ); ?>">
<div class="toggle-last-clicked button _secondary popup-menu-toggle" tabindex="0" role="button" aria-label="<?php echo fcntr( 'subscribe', true ); ?>">
<i class="fa-solid fa-bell"></i> <span class="hide-below-tablet"><?php echo fcntr( 'subscribe' ); ?></span>
<div class="popup-menu _top _center"><?php echo $subscribe_buttons; ?></div>
</div>

View File

@ -134,7 +134,7 @@ if ( ! function_exists( 'fictioneer_post_subscribe_button' ) ) {
if ( ! empty( $subscribe_buttons ) ) {
// Start HTML ---> ?>
<div class="toggle-last-clicked button _secondary popup-menu-toggle" tabindex="0" aria-role="button" aria-label="<?php echo fcntr( 'subscribe', true ); ?>">
<div class="toggle-last-clicked button _secondary popup-menu-toggle" tabindex="0" role="button" aria-label="<?php echo fcntr( 'subscribe', true ); ?>">
<i class="fa-solid fa-bell"></i> <span><?php echo fcntr( 'subscribe' ); ?></span>
<div class="popup-menu _top _align-right"><?php echo $subscribe_buttons; ?></div>
</div>

View File

@ -116,31 +116,31 @@
<div class="modal__row reader-settings__row">
<i class="fa-solid fa-check" title="<?php esc_attr_e( 'Toggles', 'fictioneer' ); ?>"></i>
<div class="reader-settings__toggles">
<label class="toggle" title="<?php esc_attr_e( 'Toggle text indent', 'fictioneer' ); ?>" tabindex="0" aria-role="checkbox" aria-label="<?php esc_attr_e( 'Toggle text indent', 'fictioneer' ); ?>">
<label class="toggle" title="<?php esc_attr_e( 'Toggle text indent', 'fictioneer' ); ?>" tabindex="0" role="checkbox" aria-label="<?php esc_attr_e( 'Toggle text indent', 'fictioneer' ); ?>">
<input type="checkbox" id="reader-settings-indent-toggle" hidden checked>
<span><i class="fa-solid fa-indent"></i></span>
</label>
<label class="toggle" title="<?php esc_attr_e( 'Toggle text justify', 'fictioneer' ); ?>" tabindex="0" aria-role="checkbox" aria-label="<?php esc_attr_e( 'Toggle text justify', 'fictioneer' ); ?>">
<label class="toggle" title="<?php esc_attr_e( 'Toggle text justify', 'fictioneer' ); ?>" tabindex="0" role="checkbox" aria-label="<?php esc_attr_e( 'Toggle text justify', 'fictioneer' ); ?>">
<input type="checkbox" id="reader-settings-justify-toggle" hidden>
<span><i class="fa-solid fa-align-justify"></i></span>
</label>
<label class="toggle" title="<?php esc_attr_e( 'Toggle light mode', 'fictioneer' ); ?>" tabindex="0" aria-role="checkbox" aria-label="<?php esc_attr_e( 'Toggle light mode', 'fictioneer' ); ?>">
<label class="toggle" title="<?php esc_attr_e( 'Toggle light mode', 'fictioneer' ); ?>" tabindex="0" role="checkbox" aria-label="<?php esc_attr_e( 'Toggle light mode', 'fictioneer' ); ?>">
<input type="checkbox" id="reader-settings-lightmode-toggle" class="toggle-light-mode" hidden>
<span><i class="fa-solid fa-sun"></i></span>
</label>
<label class="toggle" title="<?php esc_attr_e( 'Toggle paragraph tools', 'fictioneer' ); ?>" tabindex="0" aria-role="checkbox" aria-label="<?php esc_attr_e( 'Toggle paragraph tools', 'fictioneer' ); ?>">
<label class="toggle" title="<?php esc_attr_e( 'Toggle paragraph tools', 'fictioneer' ); ?>" tabindex="0" role="checkbox" aria-label="<?php esc_attr_e( 'Toggle paragraph tools', 'fictioneer' ); ?>">
<input type="checkbox" id="reader-settings-paragraph-tools-toggle" hidden checked>
<span><i class="fa-solid fa-marker"></i></span>
</label>
<label class="toggle" title="<?php esc_attr_e( 'Toggle chapter notes', 'fictioneer' ); ?>" tabindex="0" aria-role="checkbox" aria-label="<?php esc_attr_e( 'Toggle chapter notes', 'fictioneer' ); ?>">
<label class="toggle" title="<?php esc_attr_e( 'Toggle chapter notes', 'fictioneer' ); ?>" tabindex="0" role="checkbox" aria-label="<?php esc_attr_e( 'Toggle chapter notes', 'fictioneer' ); ?>">
<input type="checkbox" id="reader-settings-chapter-notes-toggle" hidden checked>
<span><?php fictioneer_icon( 'note-filled' ); ?></span>
</label>
<label class="toggle" title="<?php esc_attr_e( 'Toggle comment section', 'fictioneer' ); ?>" tabindex="0" aria-role="checkbox" aria-label="<?php esc_attr_e( 'Toggle comment section', 'fictioneer' ); ?>">
<label class="toggle" title="<?php esc_attr_e( 'Toggle comment section', 'fictioneer' ); ?>" tabindex="0" role="checkbox" aria-label="<?php esc_attr_e( 'Toggle comment section', 'fictioneer' ); ?>">
<input type="checkbox" id="reader-settings-comments-toggle" hidden checked>
<span><i class="fa-solid fa-comments"></i></span>
</label>
<label class="toggle" title="<?php esc_attr_e( 'Toggle sensitive content', 'fictioneer' ); ?>" tabindex="0" aria-role="checkbox" aria-label="<?php esc_attr_e( 'Toggle sensitive content', 'fictioneer' ); ?>">
<label class="toggle" title="<?php esc_attr_e( 'Toggle sensitive content', 'fictioneer' ); ?>" tabindex="0" role="checkbox" aria-label="<?php esc_attr_e( 'Toggle sensitive content', 'fictioneer' ); ?>">
<input type="checkbox" id="reader-settings-sensitive-content-toggle" hidden checked>
<span><i class="fa-solid fa-exclamation"></i></span>
</label>

View File

@ -239,7 +239,7 @@ $blog_posts = new WP_Query(
<?php if ( $has_groups ) : ?>
<input id="group-toggle-<?php echo $group_index; ?>" class="chapter-group__toggle" type="checkbox" hidden>
<label class="chapter-group__label" for="group-toggle-<?php echo $group_index; ?>" tabindex="0" aria-role="button" aria-label="<?php esc_attr_e( 'Toggle chapter group collapse', 'fictioneer' ); ?>">
<label class="chapter-group__label" for="group-toggle-<?php echo $group_index; ?>" tabindex="0" role="button" aria-label="<?php esc_attr_e( 'Toggle chapter group collapse', 'fictioneer' ); ?>">
<i class="fa-solid fa-chevron-down chapter-group__heading-icon"></i>
<span><?php echo $group['group']; ?></span>
</label>
@ -310,7 +310,7 @@ $blog_posts = new WP_Query(
<?php if ( get_option( 'fictioneer_enable_checkmarks' ) ) : ?>
<div class="chapter-group__list-item-right">
<button class="checkmark chapter-group__list-item-checkmark" data-type="chapter" data-story-id="<?php echo $story_id; ?>" data-id="<?php echo $chapter['id']; ?>"><i class="fa-solid fa-check"></i></button>
<button class="checkmark chapter-group__list-item-checkmark" data-type="chapter" data-story-id="<?php echo $story_id; ?>" data-id="<?php echo $chapter['id']; ?>" role="checkbox" aria-checked="false"><i class="fa-solid fa-check"></i></button>
</div>
<?php endif; ?>