Improve accessibility of iconfont icons
Iconfont icons are of no value to screenreader users; in our case, they get alternative text. By adding 'aria-hidden="true"' to the <span> holding the iconfont icon, we avoid the screenreader trying to announce the iconfont icon.
This commit is contained in:
@@ -502,7 +502,7 @@ class serendipity_event_entryproperties extends serendipity_event
|
||||
<div id="ep_column_<?php echo $_fieldname; ?>" class="clearfix form_area media_choose">
|
||||
<label for="prop<?php echo $_fieldname; ?>"><?php echo $_fieldname; ?></label>
|
||||
<textarea id="prop<?php echo $_fieldname; ?>" class="change_preview" name="serendipity[properties][<?php echo $_fieldname; ?>]" data-configitem="prop<?php echo $_fieldname; ?>"><?php echo serendipity_specialchars($value); ?></textarea>
|
||||
<button class="customfieldMedia" type="button" name="insImage" title="<?php echo MEDIA ; ?>"><span class="icon-picture"></span><span class="visuallyhidden"><?php echo MEDIA ; ?></span></button>
|
||||
<button class="customfieldMedia" type="button" name="insImage" title="<?php echo MEDIA ; ?>"><span class="icon-picture" aria-hidden="true"></span><span class="visuallyhidden"><?php echo MEDIA ; ?></span></button>
|
||||
<?php if (preg_match('/(\.jpg|\.png|\.bmp)$/', $value)) { ?>
|
||||
<figure id="prop<?php echo $_fieldname; ?>_preview">
|
||||
<figcaption><?php echo PREVIEW; ?></figcaption>
|
||||
@@ -676,7 +676,7 @@ class serendipity_event_entryproperties extends serendipity_event
|
||||
</script>
|
||||
<?php
|
||||
} else {
|
||||
echo '<span class="msg_notice"><span class="icon-info-circled"></span>' . PLUGIN_EVENT_ENTRYPROPERTIES_CACHE_DONE . '</span>';
|
||||
echo '<span class="msg_notice"><span class="icon-info-circled" aria-hidden="true"></span>' . PLUGIN_EVENT_ENTRYPROPERTIES_CACHE_DONE . '</span>';
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -1370,7 +1370,7 @@ class serendipity_event_spamblock extends serendipity_event
|
||||
$this->set_config('contentfilter_emails', implode(';', $items));
|
||||
}
|
||||
|
||||
echo '<a class="button_link" title="' . PLUGIN_EVENT_SPAMBLOCK_CONFIG . '" href="serendipity_admin.php?serendipity[adminModule]=plugins&serendipity[plugin_to_conf]=' . $this->instance . '"><span class="icon-medkit"></span><span class="visuallyhidden"> ' . PLUGIN_EVENT_SPAMBLOCK_CONFIG . '</span></a>';
|
||||
echo '<a class="button_link" title="' . PLUGIN_EVENT_SPAMBLOCK_CONFIG . '" href="serendipity_admin.php?serendipity[adminModule]=plugins&serendipity[plugin_to_conf]=' . $this->instance . '"><span class="icon-medkit" aria-hidden="true"></span><span class="visuallyhidden"> ' . PLUGIN_EVENT_SPAMBLOCK_CONFIG . '</span></a>';
|
||||
break;
|
||||
|
||||
case 'backend_view_comment':
|
||||
@@ -1382,20 +1382,20 @@ class serendipity_event_spamblock extends serendipity_event
|
||||
$akismet_apikey = $this->get_config('akismet');
|
||||
$akismet = $this->get_config('akismet_filter');
|
||||
if (!empty($akismet_apikey)) {
|
||||
$eventData['action_more'] .= ' <a class="button_link actions_extra" title="' . PLUGIN_EVENT_SPAMBLOCK_SPAM . '" href="serendipity_admin.php?serendipity[adminModule]=comments&serendipity[spamIsSpam]=' . $eventData['id'] . $addData . '#' . $clink . '"><span class="icon-block"></span><span class="visuallyhidden"> ' . PLUGIN_EVENT_SPAMBLOCK_SPAM . '</span></a>';
|
||||
$eventData['action_more'] .= ' <a class="button_link actions_extra" title="' . PLUGIN_EVENT_SPAMBLOCK_NOT_SPAM . '" href="serendipity_admin.php?serendipity[adminModule]=comments&serendipity[spamNotSpam]=' . $eventData['id'] . $addData . '#' . $clink . '"><span class="icon-ok-circled"></span><span class="visuallyhidden"> ' . PLUGIN_EVENT_SPAMBLOCK_NOT_SPAM . '</span></a>';
|
||||
$eventData['action_more'] .= ' <a class="button_link actions_extra" title="' . PLUGIN_EVENT_SPAMBLOCK_SPAM . '" href="serendipity_admin.php?serendipity[adminModule]=comments&serendipity[spamIsSpam]=' . $eventData['id'] . $addData . '#' . $clink . '"><span class="icon-block" aria-hidden="true"></span><span class="visuallyhidden"> ' . PLUGIN_EVENT_SPAMBLOCK_SPAM . '</span></a>';
|
||||
$eventData['action_more'] .= ' <a class="button_link actions_extra" title="' . PLUGIN_EVENT_SPAMBLOCK_NOT_SPAM . '" href="serendipity_admin.php?serendipity[adminModule]=comments&serendipity[spamNotSpam]=' . $eventData['id'] . $addData . '#' . $clink . '"><span class="icon-ok-circled" aria-hidden="true"></span><span class="visuallyhidden"> ' . PLUGIN_EVENT_SPAMBLOCK_NOT_SPAM . '</span></a>';
|
||||
}
|
||||
|
||||
$eventData['action_author'] .= ' <a class="button_link" title="' . ($author_is_filtered ? PLUGIN_EVENT_SPAMBLOCK_REMOVE_AUTHOR : PLUGIN_EVENT_SPAMBLOCK_ADD_AUTHOR) . '" href="serendipity_admin.php?serendipity[adminModule]=comments&serendipity[spamBlockAuthor]=' . $eventData['id'] . $addData . $randomString . '#' . $clink . '"><span class="icon-' . ($author_is_filtered ? 'ok-circled' : 'block') .'"></span><span class="visuallyhidden"> ' . ($author_is_filtered ? PLUGIN_EVENT_SPAMBLOCK_REMOVE_AUTHOR : PLUGIN_EVENT_SPAMBLOCK_ADD_AUTHOR) . '</span></a>';
|
||||
$eventData['action_author'] .= ' <a class="button_link" title="' . ($author_is_filtered ? PLUGIN_EVENT_SPAMBLOCK_REMOVE_AUTHOR : PLUGIN_EVENT_SPAMBLOCK_ADD_AUTHOR) . '" href="serendipity_admin.php?serendipity[adminModule]=comments&serendipity[spamBlockAuthor]=' . $eventData['id'] . $addData . $randomString . '#' . $clink . '"><span class="icon-' . ($author_is_filtered ? 'ok-circled' : 'block') .'" aria-hidden="true"></span><span class="visuallyhidden"> ' . ($author_is_filtered ? PLUGIN_EVENT_SPAMBLOCK_REMOVE_AUTHOR : PLUGIN_EVENT_SPAMBLOCK_ADD_AUTHOR) . '</span></a>';
|
||||
|
||||
if (!empty($eventData['url'])) {
|
||||
$url_is_filtered = $this->checkFilter('urls', $eventData['url']);
|
||||
$eventData['action_url'] .= ' <a class="button_link" title="' . ($url_is_filtered ? PLUGIN_EVENT_SPAMBLOCK_REMOVE_URL : PLUGIN_EVENT_SPAMBLOCK_ADD_URL) . '" href="serendipity_admin.php?serendipity[adminModule]=comments&serendipity[spamBlockURL]=' . $eventData['id'] . $addData . $randomString . '#' . $clink . '"><span class="icon-' . ($url_is_filtered ? 'ok-circled' : 'block') .'"></span><span class="visuallyhidden"> ' . ($url_is_filtered ? PLUGIN_EVENT_SPAMBLOCK_REMOVE_URL : PLUGIN_EVENT_SPAMBLOCK_ADD_URL) . '</span></a>';
|
||||
$eventData['action_url'] .= ' <a class="button_link" title="' . ($url_is_filtered ? PLUGIN_EVENT_SPAMBLOCK_REMOVE_URL : PLUGIN_EVENT_SPAMBLOCK_ADD_URL) . '" href="serendipity_admin.php?serendipity[adminModule]=comments&serendipity[spamBlockURL]=' . $eventData['id'] . $addData . $randomString . '#' . $clink . '"><span class="icon-' . ($url_is_filtered ? 'ok-circled' : 'block') .'" aria-hidden="true"></span><span class="visuallyhidden"> ' . ($url_is_filtered ? PLUGIN_EVENT_SPAMBLOCK_REMOVE_URL : PLUGIN_EVENT_SPAMBLOCK_ADD_URL) . '</span></a>';
|
||||
}
|
||||
|
||||
if (!empty($eventData['email'])) {
|
||||
$email_is_filtered = $this->checkFilter('emails', $eventData['email']);
|
||||
$eventData['action_email'] .= ' <a class="button_link" title="' . ($email_is_filtered ? PLUGIN_EVENT_SPAMBLOCK_REMOVE_EMAIL : PLUGIN_EVENT_SPAMBLOCK_ADD_EMAIL) . '" href="serendipity_admin.php?serendipity[adminModule]=comments&serendipity[spamBlockEmail]=' . $eventData['id'] . $addData . $randomString . '#' . $clink . '"><span class="icon-' . ($email_is_filtered ? 'ok-circled' : 'block') .'"></span><span class="visuallyhidden"> ' . ($email_is_filtered ? PLUGIN_EVENT_SPAMBLOCK_REMOVE_EMAIL : PLUGIN_EVENT_SPAMBLOCK_ADD_EMAIL) . '</span></a>';
|
||||
$eventData['action_email'] .= ' <a class="button_link" title="' . ($email_is_filtered ? PLUGIN_EVENT_SPAMBLOCK_REMOVE_EMAIL : PLUGIN_EVENT_SPAMBLOCK_ADD_EMAIL) . '" href="serendipity_admin.php?serendipity[adminModule]=comments&serendipity[spamBlockEmail]=' . $eventData['id'] . $addData . $randomString . '#' . $clink . '"><span class="icon-' . ($email_is_filtered ? 'ok-circled' : 'block') .'" aria-hidden="true"></span><span class="visuallyhidden"> ' . ($email_is_filtered ? PLUGIN_EVENT_SPAMBLOCK_REMOVE_EMAIL : PLUGIN_EVENT_SPAMBLOCK_ADD_EMAIL) . '</span></a>';
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
@@ -377,11 +377,11 @@ class serendipity_event_spartacus extends serendipity_event
|
||||
global $serendipity;
|
||||
switch($status) {
|
||||
case 'notice':
|
||||
echo '<span class="msg_notice"><span class="icon-info-circled"></span> '. $msg .'</span>' . "\n";
|
||||
echo '<span class="msg_notice"><span class="icon-info-circled" aria-hidden="true"></span> '. $msg .'</span>' . "\n";
|
||||
break;
|
||||
|
||||
case 'error':
|
||||
echo '<span class="msg_error"><span class="icon-attention-circled"></span> '. $msg .'</span>' . "\n";
|
||||
echo '<span class="msg_error"><span class="icon-attention-circled" aria-hidden="true"></span> '. $msg .'</span>' . "\n";
|
||||
if ($serendipity['ajax']) {
|
||||
// we need to set an actual error header so the ajax request can react to the error state
|
||||
header('HTTP/1.1 400');
|
||||
@@ -390,7 +390,7 @@ class serendipity_event_spartacus extends serendipity_event
|
||||
|
||||
case 'success':
|
||||
default:
|
||||
echo '<span class="msg_success"><span class="icon-ok-circled"></span> '. $msg .'</span>' . "\n";
|
||||
echo '<span class="msg_success"><span class="icon-ok-circled" aria-hidden="true"></span> '. $msg .'</span>' . "\n";
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -836,7 +836,7 @@ class serendipity_event_spartacus extends serendipity_event
|
||||
"Please try again later or switch your XML/File mirror location. ".
|
||||
"You can also try to go to the plugin configuration of the Spartacus Plugin and simply click on 'Save' - this will purge all cached XML files and try to download it again.\n".
|
||||
'<div style="display: none">' . print_r($tree, true) . "</div>\n";
|
||||
echo '<span class="msg_error"><span class="icon-attention-circled"></span> '. $msg .'</span>' . "\n";
|
||||
echo '<span class="msg_error"><span class="icon-attention-circled" aria-hidden="true"></span> '. $msg .'</span>' . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1007,7 +1007,7 @@ class serendipity_event_spartacus extends serendipity_event
|
||||
|
||||
if (count($files) == 0) {
|
||||
$msg = "DEBUG: ERROR: XML tree did not contain requested plugin:\n<div>" . print_r($tree, true) . "</div>\n";
|
||||
echo '<span class="msg_error"><span class="icon-attention-circled"></span> '. $msg .'</span>' . "\n";
|
||||
echo '<span class="msg_error"><span class="icon-attention-circled" aria-hidden="true"></span> '. $msg .'</span>' . "\n";
|
||||
}
|
||||
|
||||
$mirrors = $this->getMirrors('files', true);
|
||||
@@ -1229,10 +1229,10 @@ class serendipity_event_spartacus extends serendipity_event
|
||||
case 'backend_pluginlisting_header':
|
||||
if (serendipity_db_bool($this->get_config('enable_plugins'))) {
|
||||
echo '<div id="upgrade_notice" class="clearfix">';
|
||||
if (version_compare($serendipity['version'], '2.1-alpha3', '<')) {
|
||||
if (version_compare($serendipity['version'], '2.1-alpha3', '<')) {
|
||||
echo ' <a id="upgrade_sidebar" class="button_link" href="?serendipity[adminModule]=plugins&serendipity[adminAction]=addnew&serendipity[only_group]=UPGRADE">'. PLUGIN_EVENT_SPARTACUS_CHECK_SIDEBAR .'</a>';
|
||||
echo ' <a id="upgrade_event" class="button_link" href="?serendipity[adminModule]=plugins&serendipity[adminAction]=addnew&serendipity[only_group]=UPGRADE&serendipity[type]=event">'. PLUGIN_EVENT_SPARTACUS_CHECK_EVENT .'</a> ';
|
||||
|
||||
|
||||
} else {
|
||||
echo ' <a id="upgrade_plugins" class="button_link" href="?serendipity[adminModule]=plugins&serendipity[adminAction]=addnew&serendipity[only_group]=UPGRADE">'. PLUGIN_EVENT_SPARTACUS_CHECK .'</a>';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user