From 93d2e12b210ce0a9c0aa32d19b461da90ba2a3f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20Wodzyn=CC=81ski?= Date: Wed, 9 Aug 2023 16:03:34 +0200 Subject: [PATCH] Infoclick: allow for some common Markdown and URL characters inside the infoclick placeholder string: - I've implemented both of the proposals from #1368 in this commit - Closes #1368. --- new-admin/src/views/tools/infoclick.jsx | 24 +++++++++++++++++++ .../FeatureInfo/FeaturePropsParsing.js | 15 ++++++++++-- 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/new-admin/src/views/tools/infoclick.jsx b/new-admin/src/views/tools/infoclick.jsx index ed5f11f00..2682fdaba 100644 --- a/new-admin/src/views/tools/infoclick.jsx +++ b/new-admin/src/views/tools/infoclick.jsx @@ -25,6 +25,7 @@ var defaultState = { anchorY: 1, allowDangerousHtml: true, useNewInfoclick: false, + useNewPlaceholderMatching: false, transformLinkUri: true, }; @@ -71,6 +72,9 @@ class ToolOptions extends Component { tool.options.allowDangerousHtml || this.state.allowDangerousHtml, useNewInfoclick: tool.options.useNewInfoclick || this.state.useNewInfoclick, + useNewPlaceholderMatching: + tool.options.useNewPlaceholderMatching || + this.state.useNewPlaceholderMatching, transformLinkUri: tool.options.transformLinkUri ?? this.state.transformLinkUri, visibleForGroups: tool.options.visibleForGroups @@ -146,6 +150,7 @@ class ToolOptions extends Component { fillColor: this.state.fillColor, allowDangerousHtml: this.state.allowDangerousHtml, useNewInfoclick: this.state.useNewInfoclick, + useNewPlaceholderMatching: this.state.useNewPlaceholderMatching, transformLinkUri: this.state.transformLinkUri, visibleForGroups: this.state.visibleForGroups.map( Function.prototype.call, @@ -390,6 +395,25 @@ class ToolOptions extends Component { Använd ny Infoclick-variant (se GitHub issue #1034) +
+ { + this.handleInputChange(e); + }} + checked={this.state.useNewPlaceholderMatching} + /> +   + +
{ // placeholder is a string, e.g. "{intern_url_1@@documenthandler}" or "{foobar}" // Let's replace all occurrences of the placeholder like this: