From 0459e12dc45ff9c24b03f92df8bef0d9631a654c Mon Sep 17 00:00:00 2001 From: ansuz Date: Tue, 20 Apr 2021 15:45:06 +0530 Subject: [PATCH] modify rich text link handler to open URLs via the bounce app --- www/pad/links.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/www/pad/links.js b/www/pad/links.js index 479a3671b..68c59d5b3 100644 --- a/www/pad/links.js +++ b/www/pad/links.js @@ -25,10 +25,12 @@ define([ return; } - if(openLinkSetting) { - window.open(href, '_blank', 'noreferrer'); - return; - } + var open = function () { + var bounceHref = window.location.origin + '/bounce/#' + encodeURIComponent(href); + window.open(bounceHref); + }; + + if (openLinkSetting) { return void open(); } var $iframe = $('html').find('iframe').contents(); @@ -53,8 +55,7 @@ define([ $(a).click(function (ee) { ee.preventDefault(); ee.stopPropagation(); - var bounceHref = window.location.origin + '/bounce/#' + encodeURIComponent(href); - window.open(bounceHref); + open(); $link.remove(); }); $link.on('mouseleave', function () {