diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2012-02-13 08:39:39 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2012-02-13 08:39:39 +0000 |
| commit | 6651a8b02b6f67371b1e87c5ede47917d35bb492 (patch) | |
| tree | aab429cf8ef37a733bb2b134c8ceeabb4203d7b0 /roundcubemail/program/js | |
| parent | c085f17d5f8b7018dedfe9b49fab8a2cc8688df6 (diff) | |
- Added mailto: protocol handler registration link in User Preferences (#1486580)
git-svn-id: https://svn.roundcube.net/trunk@5876 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/js')
| -rw-r--r-- | roundcubemail/program/js/app.js | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/roundcubemail/program/js/app.js b/roundcubemail/program/js/app.js index 53a746265..208e9b489 100644 --- a/roundcubemail/program/js/app.js +++ b/roundcubemail/program/js/app.js @@ -4849,7 +4849,7 @@ function rcube_webmail() return true; }; - + this.update_identity_row = function(id, name, add) { var row, col, list = this.identity_list, @@ -6316,6 +6316,32 @@ function rcube_webmail() } }; + this.mailto_handler_uri = function() + { + return location.href.split('?')[0] + '?_task=mail&_action=compose&_to=%s'; + }; + + this.register_protocol_handler = function(name) + { + try { + window.navigator.registerProtocolHandler('mailto', this.mailto_handler_uri(), name); + } + catch(e) {}; + }; + + 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; }); + }; + } // end object rcube_webmail |
