Hi,
Please find the attached patch for RM # 2904: As a visually impaired user I
need all buttons in the application to have appropriate tooltips for my
screen reader to interpret.
Thanks,
Khushboo
diff --git a/web/pgadmin/about/static/js/about.js b/web/pgadmin/about/static/js/about.js
index 1e72c91..1a6446a 100644
--- a/web/pgadmin/about/static/js/about.js
+++ b/web/pgadmin/about/static/js/about.js
@@ -20,7 +20,8 @@ define(
},
setup: function() {
return {
- buttons:[{ text: gettext('OK'), key: 27, className: 'btn btn-primary' }],
+ buttons:[{ text: gettext('OK'), key: 27, className: 'btn btn-primary',
+ attrs: {'title': gettext('OK')}}],
options: {
modal: false,
resizable: true,
diff --git a/web/pgadmin/browser/static/js/wizard.js b/web/pgadmin/browser/static/js/wizard.js
index 56b1edf..a95f702 100644
--- a/web/pgadmin/browser/static/js/wizard.js
+++ b/web/pgadmin/browser/static/js/wizard.js
@@ -128,14 +128,18 @@ define([
' </div>' +
' <div class="col-sm-8">' +
' <div class="wizard-buttons">' +
- ' <button class="btn btn-primary wizard-back" <%=this.options.disable_prev ? "disabled" : ""%>>' +
+ ' <button class="btn btn-primary wizard-back" <%=this.options.disable_prev ? "disabled" : ""%>' +
+ ' title = "' + gettext('Back') + '">' +
' <i class="fa fa-backward"></i>' + gettext('Back') + '</button>' +
- ' <button class="btn btn-primary wizard-next" <%=this.options.disable_next ? "disabled" : ""%>>' +
+ ' <button class="btn btn-primary wizard-next" <%=this.options.disable_next ? "disabled" : ""%>' +
+ ' title = "' + gettext('Next') + '" >' +
' ' + gettext('Next') +
' <i class="fa fa-forward"></i></button>' +
- ' <button class="btn btn-danger wizard-cancel" <%=this.options.disable_cancel ? "disabled" : ""%>>' +
+ ' <button class="btn btn-danger wizard-cancel" <%=this.options.disable_cancel ? "disabled" : ""%>' +
+ ' title = "' + gettext('Cancel') + '">' +
' <i class="fa fa-lg fa-close"></i>' + gettext('Cancel') + '</button>' +
- ' <button class="btn btn-primary wizard-finish" <%=this.options.disable_finish ? "disabled" : ""%>>' +
+ ' <button class="btn btn-primary wizard-finish" <%=this.options.disable_finish ? "disabled" : ""%>' +
+ ' title = "' + gettext('Finish') + '">' +
' ' + gettext('Finish') + '</button>' +
' </div>' +
' </div>' +
diff --git a/web/pgadmin/preferences/static/js/preferences.js b/web/pgadmin/preferences/static/js/preferences.js
index d025be1..dfa3b2c 100644
--- a/web/pgadmin/preferences/static/js/preferences.js
+++ b/web/pgadmin/preferences/static/js/preferences.js
@@ -401,10 +401,12 @@ define('pgadmin.preferences', [
text: gettext('OK'),
key: 13,
className: 'btn btn-primary fa fa-lg fa-save pg-alertify-button',
+ attrs: {'title': gettext('OK')}
}, {
text: gettext('Cancel'),
key: 27,
className: 'btn btn-danger fa fa-lg fa-times pg-alertify-button',
+ attrs: {'title': gettext('Cancel')}
}],
focus: {
element: 0,
diff --git a/web/pgadmin/settings/static/js/settings.js b/web/pgadmin/settings/static/js/settings.js
index 634368c..0402b5c 100644
--- a/web/pgadmin/settings/static/js/settings.js
+++ b/web/pgadmin/settings/static/js/settings.js
@@ -51,7 +51,7 @@ define('pgadmin.settings', [
function() {
// Do nothing as user canceled the operation.
}
- );
+ )
},
};
diff --git a/web/pgadmin/static/js/alertify.pgadmin.defaults.js b/web/pgadmin/static/js/alertify.pgadmin.defaults.js
index 3129ecc..9b815f5 100644
--- a/web/pgadmin/static/js/alertify.pgadmin.defaults.js
+++ b/web/pgadmin/static/js/alertify.pgadmin.defaults.js
@@ -369,5 +369,11 @@ define([
},
});
+ // Confirm dialogue: Set title tag
+ alertify.confirm().set({onshow:function() {
+ $(this.__internal.buttons[0].element).attr('title', gettext('OK'));
+ $(this.__internal.buttons[1].element).attr('title', gettext('Cancel'));
+ }});
+
return alertify;
});
diff --git a/web/pgadmin/tools/backup/static/js/backup.js b/web/pgadmin/tools/backup/static/js/backup.js
index 367f354..c20b98e 100644
--- a/web/pgadmin/tools/backup/static/js/backup.js
+++ b/web/pgadmin/tools/backup/static/js/backup.js
@@ -604,6 +604,7 @@ define([
type: 'button',
url: 'backup.html',
label: gettext('Backup'),
+ title: gettext('Backup')
},
}, {
text: '',
@@ -616,17 +617,24 @@ define([
url: url_for('help.static', {
'filename': 'backup_dialog.html',
}),
+ title: gettext('Backup')
},
}, {
text: gettext('Backup'),
key: 13,
className: 'btn btn-primary fa fa-lg fa-save pg-alertify-button',
'data-btn-name': 'backup',
+ attrs: {
+ title: gettext('Backup')
+ }
}, {
text: gettext('Cancel'),
key: 27,
className: 'btn btn-danger fa fa-lg fa-times pg-alertify-button',
'data-btn-name': 'cancel',
+ attrs: {
+ title: gettext('Cancel')
+ }
}],
// Set options for dialog
options: {
@@ -853,6 +861,7 @@ define([
type: 'button',
url: 'backup.html',
label: gettext('Backup'),
+ title: gettext('Backup')
},
}, {
text: '',
@@ -865,17 +874,24 @@ define([
url: url_for('help.static', {
'filename': 'backup_dialog.html',
}),
+ title: gettext('Backup')
},
}, {
text: gettext('Backup'),
key: 13,
className: 'btn btn-primary fa fa-lg fa-save pg-alertify-button',
'data-btn-name': 'backup',
+ attrs: {
+ title: gettext('Backup')
+ }
}, {
text: gettext('Cancel'),
key: 27,
className: 'btn btn-danger fa fa-lg fa-times pg-alertify-button',
'data-btn-name': 'cancel',
+ attrs: {
+ title: gettext('Cancel')
+ }
}],
// Set options for dialog
options: {
diff --git a/web/pgadmin/tools/import_export/static/js/import_export.js b/web/pgadmin/tools/import_export/static/js/import_export.js
index 070ba6c..ab6d20a 100644
--- a/web/pgadmin/tools/import_export/static/js/import_export.js
+++ b/web/pgadmin/tools/import_export/static/js/import_export.js
@@ -497,11 +497,13 @@ define([
disable: true,
'data-btn-name': 'ok',
className: 'btn btn-primary fa fa-lg fa-save pg-alertify-button',
+ attrs: {title: getetxt('OK')}
}, {
text: gettext('Cancel'),
key: 27,
'data-btn-name': 'cancel',
className: 'btn btn-danger fa fa-lg fa-times pg-alertify-button',
+ attrs: {title: getetxt('Cancel')}
}],
options: {
modal: true,
diff --git a/web/pgadmin/tools/maintenance/static/js/maintenance.js b/web/pgadmin/tools/maintenance/static/js/maintenance.js
index 7f67dbf..f3502b1 100644
--- a/web/pgadmin/tools/maintenance/static/js/maintenance.js
+++ b/web/pgadmin/tools/maintenance/static/js/maintenance.js
@@ -301,6 +301,7 @@ define([
type: 'button',
url: 'maintenance.html',
label: gettext('Maintenance'),
+ title: gettext('Maintenance')
},
}, {
text: '',
@@ -315,17 +316,20 @@ define([
'filename': 'maintenance_dialog.html',
}
),
+ title: gettext('Maintenance')
},
}, {
text: gettext('OK'),
key: 13,
className: 'btn btn-primary fa fa-lg fa-save pg-alertify-button',
'data-btn-name': 'ok',
+ attrs: { title: gettext('OK') }
}, {
text: gettext('Cancel'),
key: 27,
className: 'btn btn-danger fa fa-lg fa-times pg-alertify-button',
'data-btn-name': 'cancel',
+ attrs: { title: gettext('Cancel') }
}],
options: {
modal: 0,
diff --git a/web/pgadmin/tools/restore/static/js/restore.js b/web/pgadmin/tools/restore/static/js/restore.js
index 2b44cf0..8540835 100644
--- a/web/pgadmin/tools/restore/static/js/restore.js
+++ b/web/pgadmin/tools/restore/static/js/restore.js
@@ -475,6 +475,7 @@ define('tools.restore', [
type: 'button',
url: 'backup.html',
label: gettext('Restore'),
+ title: gettext('Restore')
},
}, {
text: '',
@@ -487,6 +488,7 @@ define('tools.restore', [
url: url_for('help.static', {
'filename': 'restore_dialog.html',
}),
+ title: gettext('Restore')
},
}, {
text: gettext('Restore'),
@@ -494,12 +496,14 @@ define('tools.restore', [
className: 'btn btn-primary fa fa-upload pg-alertify-button',
restore: true,
'data-btn-name': 'restore',
+ attrs: {title: gettext('Restore')}
}, {
text: gettext('Cancel'),
key: 27,
className: 'btn btn-danger fa fa-lg fa-times pg-alertify-button',
restore: false,
'data-btn-name': 'cancel',
+ attrs: {title: gettext('Cancel')}
}],
// Set options for dialog
options: {