From 84d4011de356de9d22d4d59aada63be0843020f0 Mon Sep 17 00:00:00 2001 From: florian <f.spreckelsen@inidscale.com> Date: Mon, 6 Mar 2023 16:01:18 +0100 Subject: [PATCH] FIX: Introduce class for already linkified properties --- src/core/js/ext_cosmetics.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/js/ext_cosmetics.js b/src/core/js/ext_cosmetics.js index 4a3c57ad..0cd67e57 100644 --- a/src/core/js/ext_cosmetics.js +++ b/src/core/js/ext_cosmetics.js @@ -38,7 +38,7 @@ var cosmetics = new function () { var _linkify = function () { $('.caosdb-f-property-text-value').each(function (index) { - if (/https?:\/\//.test(this.innerText)) { + if (!($(this).hasClass("caosdb-v-property-linkified")) && (/https?:\/\//.test(this.innerText))) { var result = this.innerText.replace(/https?:\/\/[^\s]*/g, function (href, index) { var link_text = href; if (_link_cut_off_length > 4 && link_text.length > _link_cut_off_length) { @@ -48,6 +48,8 @@ var cosmetics = new function () { return `<a title="Open ${href} in a new tab." target="_blank" class="caosdb-v-property-href-value" href="${href}">${link_text} <i class="bi bi-box-arrow-up-right"></i></a>`; }); + // add class to highlight that this has been linkified already. + $(this).addClass("caosdb-v-property-linkified") $(this).hide(); $(this).after(result); } -- GitLab