summaryrefslogtreecommitdiff
path: root/program/js
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2014-03-22 12:58:35 +0100
committerAleksander Machniak <alec@alec.pl>2014-03-22 12:58:35 +0100
commit57330612612a77e309945429fa0e832a58a17ce9 (patch)
tree5ed957480ad9f09f50a4f5a4a37adbd221d7fb39 /program/js
parent8cc567c00423a343f3b785ee4dd856111b985fe7 (diff)
parentd2215764898919f1ea3b461fb08ac430db4340a4 (diff)
Merge branch 'master' of github.com:roundcube/roundcubemail
Diffstat (limited to 'program/js')
-rw-r--r--program/js/app.js26
1 files changed, 17 insertions, 9 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