From 439406a5100b24b90bbec0c70c6338101abe735d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ale=C5=A1=20Smodi=C5=A1?= Date: Thu, 1 Oct 2015 17:25:40 +0200 Subject: Use codeq.templator() for hints. Support for images. --- js/codeq/hint.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'js/codeq/hint.js') diff --git a/js/codeq/hint.js b/js/codeq/hint.js index fc2429a..75df457 100644 --- a/js/codeq/hint.js +++ b/js/codeq/hint.js @@ -20,6 +20,8 @@ hintProblemTr = problemDef.hint, hintCommonTr = commonDef.hint, planDef = problemDef.plan, + templatePath = [problemDef.language, problemDef.group, problemDef.problem], + templateName = templatePath.join('/'), clearHints = function () { var i; @@ -46,14 +48,16 @@ }, processTemplate = function (template, args) { - if (!args) + var fn = codeq.templator(template, templatePath, templateName); + return fn(args); +/* if (!args) return template; return template.replace(/\[%=(\w+)%\]/g, function(match, name) { return args[name].toString() .replace(/&/g, '&') .replace(//g, '>'); - }); + });*/ }, prepareStaticHintContent = function (hintContent, indices, hintId) { -- cgit v1.2.1