summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimotej Lazar <timotej.lazar@araneo.org>2015-08-28 18:17:35 +0200
committerTimotej Lazar <timotej.lazar@araneo.org>2015-08-28 18:17:35 +0200
commit36301db45d0422a4713b9d232cbdb4f932140ea6 (patch)
tree3b9a09faf2d072276833d8fbac072d06cdf1aaa3
parent1dbb01a159d646a59f4e79277edd864a18570c0e (diff)
Add support for template arguments in hints
-rw-r--r--js/prolog.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/js/prolog.js b/js/prolog.js
index a377cc9..e3c395c 100644
--- a/js/prolog.js
+++ b/js/prolog.js
@@ -187,6 +187,11 @@
hintHandlers = {
'static': function (type, template, serverHint) {
codeq.log.debug('Processing static hint');
+ if (serverHint.args) {
+ template = template.replace(/\[%=(\w+)%\]/g, function(match, name) {
+ return serverHint.args[name];
+ });
+ }
jqHints.append('<div class="hint-static">' + template + '</div>'); // TODO: incorporate any serverHint.args
// no hint cleaner here, a static hint remains on the screen
},