]> _ Git - fluidbook-html5.git/commitdiff
wait #5511 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 6 Dec 2022 11:57:51 +0000 (12:57 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 6 Dec 2022 11:57:51 +0000 (12:57 +0100)
js/libs/fluidbook/fluidbook.links.js

index 1177776834baf941ec1acf9fc9c64de2b802115a..1af89aadf8568efe712e303f4ec89d927f495a89 100644 (file)
@@ -595,6 +595,9 @@ FluidbookLinks.prototype = {
             });
         }
 
+        // Replace variables in text links
+        this.replaceVariableInTextLinks();
+
         links.prepend('<div class="nonlinkarea"></div>');
 
         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('<div class="' + side + 'Container container"></div>');