mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Added aria-label attribute wherever missing for accessibility.
This commit is contained in:
parent
37f76142fb
commit
8c4dff057f
@ -18,6 +18,7 @@ let _browserPanel = null;
|
|||||||
let _defaultToolBarButtons = [
|
let _defaultToolBarButtons = [
|
||||||
{
|
{
|
||||||
label: gettext('Filtered Rows'),
|
label: gettext('Filtered Rows'),
|
||||||
|
ariaLabel: gettext('Filtered Rows'),
|
||||||
btnClass: 'pg-font-icon icon-filter-table-toolbar',
|
btnClass: 'pg-font-icon icon-filter-table-toolbar',
|
||||||
text: '',
|
text: '',
|
||||||
toggled: false,
|
toggled: false,
|
||||||
@ -27,6 +28,7 @@ let _defaultToolBarButtons = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: gettext('View Data'),
|
label: gettext('View Data'),
|
||||||
|
ariaLabel: gettext('View Data'),
|
||||||
btnClass: 'fa fa-table',
|
btnClass: 'fa fa-table',
|
||||||
text: '',
|
text: '',
|
||||||
toggled: false,
|
toggled: false,
|
||||||
@ -36,6 +38,7 @@ let _defaultToolBarButtons = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: gettext('Query Tool'),
|
label: gettext('Query Tool'),
|
||||||
|
ariaLabel: gettext('Query Tool'),
|
||||||
btnClass: 'pg-font-icon icon-query-tool',
|
btnClass: 'pg-font-icon icon-query-tool',
|
||||||
text: '',
|
text: '',
|
||||||
toggled: false,
|
toggled: false,
|
||||||
@ -57,7 +60,7 @@ function registerToolBarButton(btn) {
|
|||||||
|| (_.findIndex(_browserPanel._buttonList,{name:btn.label}) < 0)) {
|
|| (_.findIndex(_browserPanel._buttonList,{name:btn.label}) < 0)) {
|
||||||
_browserPanel.addButton(
|
_browserPanel.addButton(
|
||||||
btn.label, btn.btnClass, btn.text, btn.label, btn.toggled,
|
btn.label, btn.btnClass, btn.text, btn.label, btn.toggled,
|
||||||
btn.toggleClass, btn.parentClass, btn.enabled
|
btn.toggleClass, btn.parentClass, btn.enabled, btn.ariaLabel
|
||||||
);
|
);
|
||||||
|
|
||||||
_toolbarButtons[btn.label] = btn;
|
_toolbarButtons[btn.label] = btn;
|
||||||
|
@ -82,10 +82,10 @@ define([
|
|||||||
' </div>' +
|
' </div>' +
|
||||||
' <% if (this.options.show_header_cancel_btn) { %>' +
|
' <% if (this.options.show_header_cancel_btn) { %>' +
|
||||||
' <div class="ml-auto">' +
|
' <div class="ml-auto">' +
|
||||||
' <button class="ajs-close wizard-cancel-event pull-right"' +
|
' <button aria-label="' + gettext('Close') +'" tabindex="0" class="ajs-close wizard-cancel-event pull-right"' +
|
||||||
' title="' + gettext('Close') + '"></button>' +
|
' title="' + gettext('Close') + '"></button>' +
|
||||||
' <% if (this.options.show_header_maximize_btn) { %>' +
|
' <% if (this.options.show_header_maximize_btn) { %>' +
|
||||||
' <button class="ajs-maximize wizard-maximize-event mr-1 pull-right"' +
|
' <button aria-label="' + gettext('Maximize') + '" tabindex="0" class="ajs-maximize wizard-maximize-event mr-1 pull-right"' +
|
||||||
' title="' + gettext('Maximize') + '"></button>' +
|
' title="' + gettext('Maximize') + '"></button>' +
|
||||||
' <% } %>' +
|
' <% } %>' +
|
||||||
' </div>' +
|
' </div>' +
|
||||||
@ -121,14 +121,14 @@ define([
|
|||||||
' </div> ' +
|
' </div> ' +
|
||||||
' <div class="alert-text"></div> ' +
|
' <div class="alert-text"></div> ' +
|
||||||
' <div class="ml-auto close-error-bar"> ' +
|
' <div class="ml-auto close-error-bar"> ' +
|
||||||
' <a class="close-error fa fa-times text-danger"></a> ' +
|
' <a aria-label="' + gettext('Close error bar') + '" class="close-error fa fa-times text-danger"></a> ' +
|
||||||
' </div> ' +
|
' </div> ' +
|
||||||
' </div> ' +
|
' </div> ' +
|
||||||
' </div> ' +
|
' </div> ' +
|
||||||
' </div>' +
|
' </div>' +
|
||||||
' <div class="wizard-buttons d-flex">' +
|
' <div class="wizard-buttons d-flex">' +
|
||||||
' <div>' +
|
' <div>' +
|
||||||
' <button title = "' + gettext('Help for this dialog.') + '"' +
|
' <button tabindex="0" aria-label="' + gettext('Help') + '" title = "' + gettext('Help for this dialog.') + '"' +
|
||||||
' class="btn btn-secondary pull-left wizard-help" <%=this.options.wizard_help ? "" : "disabled" %>>' +
|
' class="btn btn-secondary pull-left wizard-help" <%=this.options.wizard_help ? "" : "disabled" %>>' +
|
||||||
' <span class="fa fa-lg fa-question" role="img"></span></button>' +
|
' <span class="fa fa-lg fa-question" role="img"></span></button>' +
|
||||||
' </div>' +
|
' </div>' +
|
||||||
|
@ -424,6 +424,7 @@ define('pgadmin.preferences', [
|
|||||||
name: 'dialog_help',
|
name: 'dialog_help',
|
||||||
type: 'button',
|
type: 'button',
|
||||||
label: gettext('Preferences'),
|
label: gettext('Preferences'),
|
||||||
|
'aria-label': gettext('Help'),
|
||||||
url: url_for(
|
url: url_for(
|
||||||
'help.static', {
|
'help.static', {
|
||||||
'filename': 'preferences.html',
|
'filename': 'preferences.html',
|
||||||
|
@ -260,6 +260,8 @@ define([
|
|||||||
this.elements.dialog.classList.add('pg-el-container');
|
this.elements.dialog.classList.add('pg-el-container');
|
||||||
$(this.elements.commands.close).attr('title', gettext('Close'));
|
$(this.elements.commands.close).attr('title', gettext('Close'));
|
||||||
$(this.elements.commands.maximize).attr('title', gettext('Maximize'));
|
$(this.elements.commands.maximize).attr('title', gettext('Maximize'));
|
||||||
|
$(this.elements.commands.close).attr('aria-label', gettext('Close'));
|
||||||
|
$(this.elements.commands.maximize).attr('aria-label', gettext('Maximize'));
|
||||||
alertifyDialogResized.apply(this, arguments);
|
alertifyDialogResized.apply(this, arguments);
|
||||||
});
|
});
|
||||||
this.set('onresize', alertifyDialogStartResizing.bind(this, true));
|
this.set('onresize', alertifyDialogStartResizing.bind(this, true));
|
||||||
|
@ -1257,7 +1257,7 @@ define([
|
|||||||
gridHeader = _.template([
|
gridHeader = _.template([
|
||||||
'<div class="subnode-header">',
|
'<div class="subnode-header">',
|
||||||
' <label class="control-label pg-el-sm-10" id="<%=cId%>"><%-label%></label>',
|
' <label class="control-label pg-el-sm-10" id="<%=cId%>"><%-label%></label>',
|
||||||
' <button class="btn btn-sm-sq btn-secondary add fa fa-plus" <%=canAdd ? "" : "disabled=\'disabled\'"%> title="' + _('Add new row') + '"><%-add_label%></button>',
|
' <button aria-label="' + _('Add new row') + '" class="btn btn-sm-sq btn-secondary add fa fa-plus" <%=canAdd ? "" : "disabled=\'disabled\'"%> title="' + _('Add new row') + '"><%-add_label%></button>',
|
||||||
'</div>',
|
'</div>',
|
||||||
].join('\n')),
|
].join('\n')),
|
||||||
gridBody = $('<div class="pgadmin-control-group backgrid form-group pg-el-12 object subnode "></div>').append(
|
gridBody = $('<div class="pgadmin-control-group backgrid form-group pg-el-12 object subnode "></div>').append(
|
||||||
@ -1547,7 +1547,7 @@ define([
|
|||||||
var self = this,
|
var self = this,
|
||||||
gridHeader = ['<div class=\'subnode-header\'>',
|
gridHeader = ['<div class=\'subnode-header\'>',
|
||||||
' <label class=\'control-label pg-el-sm-10\'>' + data.label + '</label>',
|
' <label class=\'control-label pg-el-sm-10\'>' + data.label + '</label>',
|
||||||
' <button class=\'btn btn-sm-sq btn-secondary add fa fa-plus\' title=\'' + _('Add new row') + '\'></button>',
|
' <button aria-label="' + _('Add') + '" class=\'btn btn-sm-sq btn-secondary add fa fa-plus\' title=\'' + _('Add new row') + '\'></button>',
|
||||||
'</div>',
|
'</div>',
|
||||||
].join('\n'),
|
].join('\n'),
|
||||||
gridBody = $('<div class=\'pgadmin-control-group backgrid form-group pg-el-12 object subnode\'></div>').append(gridHeader);
|
gridBody = $('<div class=\'pgadmin-control-group backgrid form-group pg-el-12 object subnode\'></div>').append(gridHeader);
|
||||||
|
@ -555,7 +555,7 @@ define([
|
|||||||
var self = this;
|
var self = this;
|
||||||
this.$el.empty();
|
this.$el.empty();
|
||||||
$(this.$el).attr('tabindex', 0);
|
$(this.$el).attr('tabindex', 0);
|
||||||
this.$el.html('<i class=\'fa fa-trash\' title=\'' + _('Delete row') + '\'></i>');
|
this.$el.html('<i aria-label="' + _('Delete row') + '" class=\'fa fa-trash\' title=\'' + _('Delete row') + '\'></i>');
|
||||||
// Listen for Tab/Shift-Tab key
|
// Listen for Tab/Shift-Tab key
|
||||||
this.$el.on('keydown', function(e) {
|
this.$el.on('keydown', function(e) {
|
||||||
// with keyboard navigation on space key, mark row for deletion
|
// with keyboard navigation on space key, mark row for deletion
|
||||||
|
@ -70,6 +70,7 @@ let FilterDialog = {
|
|||||||
name: 'dialog_help',
|
name: 'dialog_help',
|
||||||
type: 'button',
|
type: 'button',
|
||||||
label: gettext('Help'),
|
label: gettext('Help'),
|
||||||
|
'aria-label': gettext('Help'),
|
||||||
url: url_for('help.static', {
|
url: url_for('help.static', {
|
||||||
'filename': 'editgrid.html',
|
'filename': 'editgrid.html',
|
||||||
}),
|
}),
|
||||||
|
@ -53,6 +53,7 @@ export class BackupDialogWrapper extends DialogWrapper {
|
|||||||
name: 'dialog_help',
|
name: 'dialog_help',
|
||||||
type: 'button',
|
type: 'button',
|
||||||
label: gettext('Backup'),
|
label: gettext('Backup'),
|
||||||
|
'aria-label': gettext('Help'),
|
||||||
url: url_for('help.static', {
|
url: url_for('help.static', {
|
||||||
'filename': get_help_file(this.typeOfDialog),
|
'filename': get_help_file(this.typeOfDialog),
|
||||||
}),
|
}),
|
||||||
|
@ -130,6 +130,7 @@ function initFilterDialog(alertify, pgBrowser) {
|
|||||||
name: 'dialog_help',
|
name: 'dialog_help',
|
||||||
type: 'button',
|
type: 'button',
|
||||||
label: gettext('Data Filter'),
|
label: gettext('Data Filter'),
|
||||||
|
'aria-label': gettext('Help'),
|
||||||
url: url_for('help.static', {
|
url: url_for('help.static', {
|
||||||
'filename': 'viewdata_filter.html',
|
'filename': 'viewdata_filter.html',
|
||||||
}),
|
}),
|
||||||
|
@ -53,7 +53,7 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="btn-group mr-1" role="group" aria-label="">
|
<div class="btn-group mr-1" role="group" aria-label="">
|
||||||
<button id="btn-find" type="button" class="btn btn-sm btn-secondary" title="{{ _('Find (Ctrl/Cmd+F)') }}">
|
<button id="btn-find" type="button" class="btn btn-sm btn-secondary" aria-label="{{ _('Find') }}" title="{{ _('Find (Ctrl/Cmd+F)') }}">
|
||||||
<i class="fa fa-search sql-icon-lg" aria-hidden="true" tabindex="0" role="img"></i>
|
<i class="fa fa-search sql-icon-lg" aria-hidden="true" tabindex="0" role="img"></i>
|
||||||
</button>
|
</button>
|
||||||
<button id="btn-find-menu-dropdown" type="button" class="btn btn-sm btn-secondary dropdown-toggle dropdown-toggle-split"
|
<button id="btn-find-menu-dropdown" type="button" class="btn btn-sm btn-secondary dropdown-toggle dropdown-toggle-split"
|
||||||
@ -151,7 +151,7 @@
|
|||||||
<div class="btn-group mr-1" role="group" aria-label="">
|
<div class="btn-group mr-1" role="group" aria-label="">
|
||||||
<button id="btn-edit-dropdown" type="button" class="btn btn-sm btn-secondary dropdown-toggle"
|
<button id="btn-edit-dropdown" type="button" class="btn btn-sm btn-secondary dropdown-toggle"
|
||||||
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"
|
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"
|
||||||
title="{{ _('Edit') }}" tabindex="0">
|
aria-label="{{ _('Edit') }}" title="{{ _('Edit') }}" tabindex="0">
|
||||||
<i class="fa fa-pencil-square-o sql-icon-lg" aria-hidden="true" role="img"></i>
|
<i class="fa fa-pencil-square-o sql-icon-lg" aria-hidden="true" role="img"></i>
|
||||||
</button>
|
</button>
|
||||||
<ul class="dropdown-menu">
|
<ul class="dropdown-menu">
|
||||||
|
@ -56,6 +56,7 @@ try {
|
|||||||
accesskey=""
|
accesskey=""
|
||||||
tabindex="0"
|
tabindex="0"
|
||||||
autofocus="autofocus"
|
autofocus="autofocus"
|
||||||
|
aria-label="{{ gettext('Step into') }}"
|
||||||
disabled>
|
disabled>
|
||||||
<i class="fa fa-indent sql-icon-lg"></i>
|
<i class="fa fa-indent sql-icon-lg"></i>
|
||||||
</button>
|
</button>
|
||||||
@ -63,6 +64,7 @@ try {
|
|||||||
title=""
|
title=""
|
||||||
accesskey=""
|
accesskey=""
|
||||||
tabindex="0"
|
tabindex="0"
|
||||||
|
aria-label="{{ gettext('Step over') }}"
|
||||||
disabled>
|
disabled>
|
||||||
<i class="fa fa-outdent sql-icon-lg"></i>
|
<i class="fa fa-outdent sql-icon-lg"></i>
|
||||||
</button>
|
</button>
|
||||||
@ -70,6 +72,7 @@ try {
|
|||||||
title=""
|
title=""
|
||||||
accesskey=""
|
accesskey=""
|
||||||
tabindex="0"
|
tabindex="0"
|
||||||
|
aria-label="{{ gettext('Continue/Start') }}"
|
||||||
disabled>
|
disabled>
|
||||||
<i class="fa fa-play-circle sql-icon-lg"></i>
|
<i class="fa fa-play-circle sql-icon-lg"></i>
|
||||||
</button>
|
</button>
|
||||||
@ -79,6 +82,7 @@ try {
|
|||||||
title=""
|
title=""
|
||||||
accesskey=""
|
accesskey=""
|
||||||
tabindex="0"
|
tabindex="0"
|
||||||
|
aria-label="{{ gettext('Toggle breakpoint') }}"
|
||||||
disabled>
|
disabled>
|
||||||
<i class="fa fa-circle sql-icon-lg"></i>
|
<i class="fa fa-circle sql-icon-lg"></i>
|
||||||
</button>
|
</button>
|
||||||
@ -86,6 +90,7 @@ try {
|
|||||||
title=""
|
title=""
|
||||||
accesskey=""
|
accesskey=""
|
||||||
tabindex="0"
|
tabindex="0"
|
||||||
|
aria-label="{{ gettext('Clear all breakpoints') }}"
|
||||||
disabled>
|
disabled>
|
||||||
<i class="fa fa-ban sql-icon-lg"></i>
|
<i class="fa fa-ban sql-icon-lg"></i>
|
||||||
</button>
|
</button>
|
||||||
@ -95,6 +100,7 @@ try {
|
|||||||
accesskey=""
|
accesskey=""
|
||||||
title=""
|
title=""
|
||||||
tabindex="0"
|
tabindex="0"
|
||||||
|
aria-label="{{ gettext('Stop') }}"
|
||||||
disabled>
|
disabled>
|
||||||
<i class="fa fa-stop-circle sql-icon-lg"></i>
|
<i class="fa fa-stop-circle sql-icon-lg"></i>
|
||||||
</button>
|
</button>
|
||||||
|
@ -286,6 +286,7 @@ define([
|
|||||||
name: 'dialog_help',
|
name: 'dialog_help',
|
||||||
type: 'button',
|
type: 'button',
|
||||||
label: gettext('Maintenance'),
|
label: gettext('Maintenance'),
|
||||||
|
'aria-label': gettext('Help'),
|
||||||
url: url_for(
|
url: url_for(
|
||||||
'help.static', {
|
'help.static', {
|
||||||
'filename': 'maintenance_dialog.html',
|
'filename': 'maintenance_dialog.html',
|
||||||
|
@ -47,6 +47,7 @@ export class RestoreDialogWrapper extends DialogWrapper {
|
|||||||
name: 'dialog_help',
|
name: 'dialog_help',
|
||||||
type: 'button',
|
type: 'button',
|
||||||
label: gettext('Restore'),
|
label: gettext('Restore'),
|
||||||
|
'aria-label': gettext('Help'),
|
||||||
url: url_for('help.static', {
|
url: url_for('help.static', {
|
||||||
'filename': 'restore_dialog.html',
|
'filename': 'restore_dialog.html',
|
||||||
}),
|
}),
|
||||||
|
Loading…
Reference in New Issue
Block a user