From 7d661c53dab08492f7ffd0372b45181b8fe97d5d Mon Sep 17 00:00:00 2001 From: Jeroen Dalsem Date: Wed, 4 Dec 2024 12:01:40 +0100 Subject: [PATCH] added: target blank behaviour can be forced on an anchor --- views/default/target_blank/target_blank.mjs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/views/default/target_blank/target_blank.mjs b/views/default/target_blank/target_blank.mjs index 76b68f9..5acec9a 100644 --- a/views/default/target_blank/target_blank.mjs +++ b/views/default/target_blank/target_blank.mjs @@ -10,7 +10,8 @@ if (site_url.substring(0, 1) === 's') { } var selector = 'a[href^="http://"]:not([target], [href^="http' + site_url + '"], [href^="https' + site_url + '"]),'; -selector += 'a[href^="https://"]:not([target], [href^="http' + site_url + '"], [href^="https' + site_url + '"])'; +selector += 'a[href^="https://"]:not([target], [href^="http' + site_url + '"], [href^="https' + site_url + '"]),'; +selector += 'a[data-target-blank-suffix]'; $(document).on('click', selector, function () { $(this).attr('target', '_blank');