diff --git a/mail/js/preview.js b/mail/js/preview.js index ed47e9b522..6bb6771ab9 100644 --- a/mail/js/preview.js +++ b/mail/js/preview.js @@ -1,12 +1,11 @@ /** - * mail - handle mailto and other links in preview + * EGroupware Mail - handle mailto and other links in preview * * @link http://www.egroupware.org * @author EGroupware GmbH [info@egroupware.org] * @copyright (c) 2014 by EGroupware GmbH * @package mail * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License - * @version $Id$ */ /*egw:uses @@ -24,6 +23,13 @@ jQuery(function() return false; // cant do event.stopImediatePropagation() in on! } + // open links with own orgin and "index.php?" as popup (not eg. share.php or *dav.php) + else if ((this.href[0] === '/' || this.href.match(new RegExp('^'+location.protocol+'//'+location.host+'/'))) && + this.href.match(/\/index.php\?/)) + { + top.egw.openPopup(this.href.replace(/([?&])no_popup=[^&]*/, '\1'), 800, 600, '_blank'); + return false; + } else // add target=_blank to all other links, gives CSP error and would open in preview { this.target = '_blank';