diff options
author | Aleš Smodiš <aless@guru.si> | 2015-10-01 17:25:40 +0200 |
---|---|---|
committer | Aleš Smodiš <aless@guru.si> | 2015-10-01 17:25:40 +0200 |
commit | 439406a5100b24b90bbec0c70c6338101abe735d (patch) | |
tree | 85fa9010599f0216d0d777776b70c833b569504d /js/codeq/hint.js | |
parent | 026a0d5fb64d8c0ee5eb45e545b1ac294ac0e85c (diff) |
Use codeq.templator() for hints. Support for images.
Diffstat (limited to 'js/codeq/hint.js')
-rw-r--r-- | js/codeq/hint.js | 8 |
1 files changed, 6 insertions, 2 deletions
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, '<') .replace(/>/g, '>'); - }); + });*/ }, prepareStaticHintContent = function (hintContent, indices, hintId) { |