From: Vincent Vanwaelscappel Date: Tue, 6 Dec 2022 11:57:51 +0000 (+0100) Subject: wait #5511 @1 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=8e227010a7137b353da24f14a5bea0a6e61ca02e;p=fluidbook-html5.git wait #5511 @1 --- diff --git a/js/libs/fluidbook/fluidbook.links.js b/js/libs/fluidbook/fluidbook.links.js index 11777768..1af89aad 100644 --- a/js/libs/fluidbook/fluidbook.links.js +++ b/js/libs/fluidbook/fluidbook.links.js @@ -595,6 +595,9 @@ FluidbookLinks.prototype = { }); } + // Replace variables in text links + this.replaceVariableInTextLinks(); + links.prepend('
'); this.fluidbook.resize.resizeLinks(); @@ -616,6 +619,22 @@ FluidbookLinks.prototype = { this.resize(); }, + + replaceVariableInTextLinks: function () { + $('.textLink').each(function () { + + var t = $(this).text(); + while (res = t.match(/\$_GET\[['"]?(\w+)['"]?\]/)) { + var val = $_GET[res[1]]; + if (val === undefined || val === null) { + val = ''; + } + t = t.replace(res[0], val); + } + $(this).text(t); + }); + }, + setLinksInContainer: function (page, side) { var links = $("#links"); links.prepend('
');