allow to disable installing EGroupware as mailto handler globally

This commit is contained in:
ralf 2022-07-26 10:05:43 +02:00
parent 9fd06b3892
commit f87eb6ec7c
5 changed files with 29 additions and 10 deletions

View File

@ -673,6 +673,7 @@ number of sessions / egroupware logins in the last 30 days admin de Anzahl Sitzu
number of users admin de Anzahl Benutzer
number the applications serially. if they are not numbered serially, sorting the applications could work wrong. this will not change the application's order. admin de Numeriere Anwendungen aufeinander folgend. Wenn sie nicht aufeinander folgend numeriert sind, funktioniert das Sortieren der Anwendungen nicht. Ändert nicht die Reihenfolge der Anwendungen
nummeric account id admin de numerische Benutzer ID
offer to installing egroupware as mail-handler admin de Anbieten EGroupware als Mail-Handler zu installieren
official egroupware usage statistic admin de Offizielle EGroupware Nutzungsstatistik
one day admin de ein Tag
one hour admin de eine Stunde

View File

@ -676,6 +676,7 @@ number of sessions / egroupware logins in the last 30 days admin en Number of se
number of users admin en Number of users
number the applications serially. if they are not numbered serially, sorting the applications could work wrong. this will not change the application's order. admin en Number the applications serially. If they are not numbered serially, sorting the applications could work wrong. This will not change the application's order.
nummeric account id admin en Numeric account ID
offer to installing egroupware as mail-handler admin en Offer to installing EGroupware as mail-handler
official egroupware usage statistic admin en Official EGroupware usage statistic
one day admin en One day
one hour admin en One hour

View File

@ -47,6 +47,13 @@
<option value="True">Yes</option>
</select>
</row>
<row>
<description value="Offer to installing EGroupware as mail-handler" label="%s:"/>
<select id="newsettings[install_mailto_handler]">
<option value="">Yes - {Default}</option>
<option value="disabled">{No}</option>
</select>
</row>
<row>
<description value="Disable minifying of javascript and CSS files" label="%s:"/>
<select id="newsettings[debug_minify]">

View File

@ -438,14 +438,6 @@
parseInt(egw_script.getAttribute('data-websocket-account_id'))
);
}
// register our mail as mailto protocol handler (only for main-page, FF seems to pop it up constantly, if we do so in an iframe)
if (location.href.match(/(\?|&)cd=yes(&|$)/))
{
let url = egw_webserverUrl;
if (url[0] === '/') url = document.location.protocol+'://'+document.location.hostname+(url !== '/' ? url : '');
navigator.registerProtocolHandler('mailto', url+'/index.php?menuaction=mail.mail_compose.compose&preset[mailto]=%s', 'Mail');
}
}
catch(e) {
// ignore SecurityError exception if top is different security context / cross-origin

View File

@ -25,6 +25,20 @@ egw.extend('config', egw.MODULE_GLOBAL, function()
*/
var configs = {};
/**
* register our mail as mailto protocol handler (only for main-page, FF seems to pop it up constantly, if we do so in an iframe)
*/
function install_mailto_handler()
{
if (document.location.href.match(/(\?|&)cd=yes(&|$)/))
{
let url = egw_webserverUrl;
if (url[0] === '/') url = document.location.protocol+'://'+document.location.hostname+(url !== '/' ? url : '');
navigator.registerProtocolHandler('mailto', url+'/index.php?menuaction=mail.mail_compose.compose&preset[mailto]=%s', 'Mail');
}
}
return {
/**
* Query clientside config
@ -52,7 +66,11 @@ egw.extend('config', egw.MODULE_GLOBAL, function()
set_configs: function(_configs, _need_clone)
{
configs = _need_clone ? jQuery.extend(true, {}, _configs) : _configs;
if (this.config('install_mailto_handler') !== 'disabled')
{
install_mailto_handler();
}
}
};
});