summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--program/js/app.js26
-rw-r--r--program/steps/settings/func.inc9
-rw-r--r--skins/classic/common.css7
-rw-r--r--skins/larry/settings.css5
-rw-r--r--skins/larry/styles.css6
5 files changed, 41 insertions, 12 deletions
diff --git a/program/js/app.js b/program/js/app.js
index 332d9841e..7fb644145 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -7516,20 +7516,28 @@ function rcube_webmail()
try {
window.navigator.registerProtocolHandler('mailto', this.mailto_handler_uri(), name);
}
- catch(e) {};
+ catch(e) {
+ this.display_message(String(e), 'error');
+ };
};
this.check_protocol_handler = function(name, elem)
{
var nav = window.navigator;
- if (!nav
- || (typeof nav.registerProtocolHandler != 'function')
- || ((typeof nav.isProtocolHandlerRegistered == 'function')
- && nav.isProtocolHandlerRegistered('mailto', this.mailto_handler_uri()) == 'registered')
- )
- $(elem).addClass('disabled');
- else
- $(elem).click(function() { rcmail.register_protocol_handler(name); return false; });
+ if (!nav || (typeof nav.registerProtocolHandler != 'function')) {
+ $(elem).addClass('disabled').click(function(){ return false; });
+ }
+ else {
+ var status = null;
+ if (typeof nav.isProtocolHandlerRegistered == 'function') {
+ status = nav.isProtocolHandlerRegistered('mailto', this.mailto_handler_uri());
+ if (status)
+ $(elem).parent().find('.mailtoprotohandler-status').html(status);
+ }
+ else {
+ $(elem).click(function() { rcmail.register_protocol_handler(name); return false; });
+ }
+ }
};
// Checks browser capabilities eg. PDF support, TIF support
diff --git a/program/steps/settings/func.inc b/program/steps/settings/func.inc
index 7c36df3b1..307be8c8e 100644
--- a/program/steps/settings/func.inc
+++ b/program/steps/settings/func.inc
@@ -376,13 +376,16 @@ function rcmail_user_prefs($current = null)
if ($current) {
$product_name = $RCMAIL->config->get('product_name', 'Roundcube Webmail');
$RCMAIL->output->add_script(sprintf("%s.check_protocol_handler('%s', '#mailtoprotohandler');",
- rcmail_output::JS_OBJECT_NAME, rcube::JQ($product_name)), 'foot');
+ rcmail_output::JS_OBJECT_NAME, rcube::JQ($product_name)), 'docready');
}
$blocks['browser']['options']['mailtoprotohandler'] = array(
'content' => html::a(array(
- 'href' => '#',
- 'id' => 'mailtoprotohandler'), rcube::Q($RCMAIL->gettext('mailtoprotohandler'))),
+ 'href' => '#',
+ 'id' => 'mailtoprotohandler'
+ ),
+ rcube::Q($RCMAIL->gettext('mailtoprotohandler'))) .
+ html::span('mailtoprotohandler-status', ''),
);
break;
diff --git a/skins/classic/common.css b/skins/classic/common.css
index 9eaa8f7b4..0de8a2f7f 100644
--- a/skins/classic/common.css
+++ b/skins/classic/common.css
@@ -55,6 +55,13 @@ a.tab
text-align: center;
}
+a.disabled
+{
+ color: #999;
+ text-decoration: none;
+ cursor: default;
+}
+
hr
{
height: 1px;
diff --git a/skins/larry/settings.css b/skins/larry/settings.css
index af667b9e7..675ef9973 100644
--- a/skins/larry/settings.css
+++ b/skins/larry/settings.css
@@ -319,3 +319,8 @@ img.skinthumbnail {
#rcmfd_signature_toolbar2 td {
width: auto;
}
+
+.mailtoprotohandler-status {
+ padding-left: 1em;
+ font-style: italic;
+}
diff --git a/skins/larry/styles.css b/skins/larry/styles.css
index 671cf6bd6..10e648970 100644
--- a/skins/larry/styles.css
+++ b/skins/larry/styles.css
@@ -1613,6 +1613,12 @@ body.iframe .footerleft.floating:before,
width: 95%;
}
+.propform a.disabled {
+ color: #999;
+ text-decoration: none;
+ cursor: default;
+}
+
fieldset.floating {
float: left;
margin-right: 10px;