diff options
author | Robert Zorko <robertz@gurucue.com> | 2015-09-29 15:34:39 +0200 |
---|---|---|
committer | Robert Zorko <robertz@gurucue.com> | 2015-09-29 15:34:39 +0200 |
commit | ba7f477d4dcc155132d69d8faefc33523a0089fd (patch) | |
tree | b4731ab16b54f551b45f7fa5697c3fb349240db1 /js/codeq/hint.js | |
parent | a565a09172071783174450cea5a425964f3b6aa6 (diff) | |
parent | b2983855ea01fd04a8ba53099d2d5ee7ebed31f9 (diff) |
resolved merge conflicts
Diffstat (limited to 'js/codeq/hint.js')
-rw-r--r-- | js/codeq/hint.js | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/js/codeq/hint.js b/js/codeq/hint.js index e1c7a6b..1b97afc 100644 --- a/js/codeq/hint.js +++ b/js/codeq/hint.js @@ -7,10 +7,11 @@ var firstCharacterPos = {'line': 0, 'ch': 0}, sel_no_scroll = {'scroll': false}; - codeq.makeHinter = function (jqHints, jqEditor, editor, hintDefs, planDef) { + codeq.makeHinter = function (jqHints, jqEditor, editor, trNamespace, hintDefsA, commonHintDefsA, planDef) { var hintCounter = 0, // for generating unique class-names hintCleaners = [], planIdx = 0, + dictionary = [], clearHints = function () { var i; @@ -130,6 +131,25 @@ } }; + codeq.tr.registerDictionary(trNamespace, dictionary); + + // TODO: below is a temporary code to bridge the old implementation with the new data format + if (planDef.sl) planDef = planDef.sl; + else planDef = planDef.en || []; + var hintDefs = {}, t1, t2, k; + if (hintDefsA.sl) t1 = hintDefsA.sl; + else t1 = hintDefsA.en || {}; + if (commonHintDefsA.sl) t2 = commonHintDefsA.sl; + else t2 = commonHintDefsA.en || {}; + for (k in t2) { + if (!t2.hasOwnProperty(k)) continue; + hintDefs[k] = t2[k]; + } + for (k in t1) { + if (!t1.hasOwnProperty(k)) continue; + hintDefs[k] = t1[k]; + } + return { /** Display the next "planning" hint and return whether there are * any more available. @@ -195,6 +215,7 @@ 'destroy': function () { clearHints(); + codeq.tr.unregisterDictionary(trNamespace); jqHints.empty(); jqHints = null; jqEditor = null; |