1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-02 07:27:04 +00:00

[A11y] improvements for pages (#6030)

* [A11y] improvements for pages

* [A11y] added 'user-scalable=no' back
This commit is contained in:
llj
2024-04-22 10:36:42 +08:00
committed by GitHub
parent 047f03c722
commit 1b881ca914
10 changed files with 13 additions and 31 deletions

View File

@@ -727,7 +727,7 @@ class DirentListItem extends React.Component {
onContextMenu={this.onItemContextMenu} onContextMenu={this.onItemContextMenu}
> >
<td className={`pl10 ${this.state.isDragTipShow ? 'tr-drag-effect' : ''}`}> <td className={`pl10 ${this.state.isDragTipShow ? 'tr-drag-effect' : ''}`}>
<input type="checkbox" className="vam" onChange={this.onItemSelected} checked={dirent.isSelected}/> <input type="checkbox" className="vam" onChange={this.onItemSelected} checked={dirent.isSelected} aria-label={dirent.isSelected ?gettext('Unselect this item') : gettext('Select this item')} />
</td> </td>
<td className="pl10"> <td className="pl10">
{dirent.starred !== undefined && {dirent.starred !== undefined &&

View File

@@ -619,7 +619,7 @@ class DirentListView extends React.Component {
<thead onMouseDown={this.onThreadMouseDown} onContextMenu={this.onThreadContextMenu}> <thead onMouseDown={this.onThreadMouseDown} onContextMenu={this.onThreadContextMenu}>
<tr> <tr>
<th width="3%" className="pl10"> <th width="3%" className="pl10">
<input type="checkbox" className="vam" onChange={this.props.onAllItemSelected} checked={this.props.isAllItemSelected} /> <input type="checkbox" className="vam" onChange={this.props.onAllItemSelected} checked={this.props.isAllItemSelected} aria-label={this.props.isAllItemSelected ? gettext('Unselect all items') : gettext('Select all items')} />
</th> </th>
<th width="3%" className="pl10">{/*icon */}</th> <th width="3%" className="pl10">{/*icon */}</th>
<th width="5%" className="pl10">{/*star */}</th> <th width="5%" className="pl10">{/*star */}</th>

View File

@@ -681,7 +681,7 @@ class FileUploader extends React.Component {
<Fragment> <Fragment>
<div className="file-uploader-container"> <div className="file-uploader-container">
<div className="file-uploader"> <div className="file-uploader">
<input className="upload-input" type="file" ref={this.uploadInput} onClick={this.onClick}/> <input className="upload-input" type="file" ref={this.uploadInput} onClick={this.onClick} aria-label={gettext('Upload')} />
</div> </div>
</div> </div>
{this.state.isUploadRemindDialogShow && {this.state.isUploadRemindDialogShow &&

View File

@@ -664,7 +664,7 @@ class FileUploader extends React.Component {
<Fragment> <Fragment>
<div className="file-uploader-container"> <div className="file-uploader-container">
<div className="file-uploader"> <div className="file-uploader">
<input className="upload-input" type="file" ref={this.uploadInput} onClick={this.onClick}/> <input className="upload-input" type="file" ref={this.uploadInput} onClick={this.onClick} aria-label={gettext('Upload')} />
</div> </div>
</div> </div>
{this.state.isUploadProgressDialogShow && {this.state.isUploadProgressDialogShow &&

View File

@@ -622,7 +622,7 @@ class FileUploader extends React.Component {
<Fragment> <Fragment>
<div className="file-uploader-container"> <div className="file-uploader-container">
<div className="file-uploader"> <div className="file-uploader">
<input className="upload-input" type="file" ref={this.uploadInput} onClick={this.onClick} /> <input className="upload-input" type="file" ref={this.uploadInput} onClick={this.onClick} aria-label={gettext('Upload')} />
</div> </div>
</div> </div>
<UploadProgressDialog <UploadProgressDialog

View File

@@ -104,10 +104,10 @@ class UploadProgressDialog extends React.Component {
<table className="table-thead-hidden"> <table className="table-thead-hidden">
<thead> <thead>
<tr> <tr>
<th width="40%">{gettext('name')}</th> <th width="40%" scope="col">{gettext('name')}</th>
<th width="15%">{gettext('size')}</th> <th width="15%" scope="col">{gettext('size')}</th>
<th width="30%">{gettext('progress')}</th> <th width="30%" scope="col">{gettext('progress')}</th>
<th width="15%">{gettext('state')}</th> <th width="15%" scope="col">{gettext('state')}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>

View File

@@ -95,7 +95,7 @@ def avatar(user, size=AVATAR_DEFAULT_SIZE):
logger.error(e) logger.error(e)
url = get_default_avatar_non_registered_url() url = get_default_avatar_non_registered_url()
return format_html("""<img src="%s" width="%s" height="%s" class="avatar" />""" % (url, size, size)) return format_html("""<img src="%s" width="%s" height="%s" class="avatar" alt="Avatar" />""" % (url, size, size))
@cache_result @cache_result
@register.simple_tag @register.simple_tag

View File

@@ -197,12 +197,6 @@ $('#login-form').on('submit', function(){
return false; return false;
} }
}); });
// set tabindex
$(function() {
$('input:not([type="hidden"])').each(function(index) {
$(this).attr('tabindex', index + 1);
});
});
{% if enable_sso %} {% if enable_sso %}
$(function() { $(function() {

View File

@@ -32,10 +32,10 @@ html, body, #wrapper { height:100%; }
{% block main_content %} {% block main_content %}
<div class="login-panel-outer-container vh"> <div class="login-panel-outer-container vh">
<div class="login-panel"> <div class="login-panel" id="log-in-panel">
<h1 class="login-panel-hd">{% trans "Log In" %}</h1> <h1 class="login-panel-hd">{% trans "Log In" %}</h1>
<form action="" method="post" id="login-form">{% csrf_token %} <form action="" method="post" id="login-form">{% csrf_token %}
<input type="text" name="login" placeholder="{% trans "Email or Username" %}" aria-label="{% trans "Email or Username" %}" title="{% trans "Email or Username" %}" value="" class="input name-input" /><br /> <input type="text" name="login" placeholder="{% trans "Email or Username" %}" aria-label="{% trans "Email or Username" %}" title="{% trans "Email or Username" %}" value="" class="input" /><br />
<input type="hidden" name="next" value="{% if next %}{{ next|escape }}{% else %}{{ SITE_ROOT }}{% endif %}" /> <input type="hidden" name="next" value="{% if next %}{{ next|escape }}{% else %}{{ SITE_ROOT }}{% endif %}" />
{% if error_msg %} {% if error_msg %}
@@ -91,12 +91,6 @@ $('#login-form').on('submit', function(){
return false; return false;
} }
}); });
// set tabindex
$(function() {
$('input:not([type="hidden"])').each(function(index) {
$(this).attr('tabindex', index + 1);
});
});
</script> </script>
{% endblock %} {% endblock %}

View File

@@ -72,12 +72,6 @@ $('[type="submit"]').on('click', function(){
return false; return false;
} }
}); });
// set tabindex
$(function() {
$('input:not([type="hidden"]), button').each(function(index) {
$(this).attr('tabindex', index + 1);
});
});
{% if enable_sso %} {% if enable_sso %}
$(function() { $(function() {