From af9550251ee9eb922f3f2fafcbeeede19aeb6cf0 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Thu, 4 Jan 2018 13:11:42 +0100 Subject: [PATCH] Display an error when clicking disabled link to register protocol handler (#6079) --- CHANGELOG | 1 + program/js/app.js | 5 ++++- program/localization/en_US/messages.inc | 1 + program/steps/settings/edit_prefs.inc | 2 +- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 8cc966ec1..042782a0c 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,7 @@ CHANGELOG Roundcube Webmail =========================== +- Display an error when clicking disabled link to register protocol handler (#6079) - Add option trusted_host_patterns (#6009, #5752) - Support SMTPUTF8 and relax email address validation to support unicode in local part (#5120) - Support additional connect parameters in PostgreSQL database wrapper diff --git a/program/js/app.js b/program/js/app.js index cac553b70..9dfb15968 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -9473,7 +9473,10 @@ function rcube_webmail() var nav = window.navigator; if (!nav || (typeof nav.registerProtocolHandler != 'function')) { - $(elem).addClass('disabled').click(function(){ return false; }); + $(elem).addClass('disabled').click(function() { + ref.display_message(ref.gettext('nosupporterror'), 'error'); + return false; + }); } else if (typeof nav.isProtocolHandlerRegistered == 'function') { var status = nav.isProtocolHandlerRegistered('mailto', this.mailto_handler_uri()); diff --git a/program/localization/en_US/messages.inc b/program/localization/en_US/messages.inc index 5f65290ba..944906458 100644 --- a/program/localization/en_US/messages.inc +++ b/program/localization/en_US/messages.inc @@ -216,3 +216,4 @@ $messages['clicktoresumesession'] = 'Click here to resume your previous session' $messages['errcomposesession'] = 'Compose session error'; $messages['errcomposesessionexplain'] = 'Requested compose session not found.'; $messages['clicktocompose'] = 'Click here to compose a new message'; +$messages['nosupporterror'] = 'This feature is not supported by your web browser.'; diff --git a/program/steps/settings/edit_prefs.inc b/program/steps/settings/edit_prefs.inc index 79aaeeb86..87d3133bd 100644 --- a/program/steps/settings/edit_prefs.inc +++ b/program/steps/settings/edit_prefs.inc @@ -42,7 +42,7 @@ function rcmail_user_prefs_form($attrib) global $RCMAIL, $CURR_SECTION, $SECTIONS; // add some labels to client - $RCMAIL->output->add_label('nopagesizewarning'); + $RCMAIL->output->add_label('nopagesizewarning', 'nosupporterror'); unset($attrib['form']);