diff options
| author | hallgren <hallgren@chalmers.se> | 2012-04-02 16:05:11 +0000 |
|---|---|---|
| committer | hallgren <hallgren@chalmers.se> | 2012-04-02 16:05:11 +0000 |
| commit | 7ee66302d133c0c99227a5c38c74025f37f71c28 (patch) | |
| tree | f2d7eef09c81fc1a4cdc8bd78b1cf75330948af7 /src/www/minibar/minibar_translations.js | |
| parent | c2a72daa74923477fdc66343a30bdde87053319c (diff) | |
minibar: better implementation of word replacement
Instead of trying to reconstruct the abstract tree from the bracketed string,
use the node numbers (the field called "fid") to identify which node in the
abstact syntax tree a word in the bracketed string corresponds to.
Diffstat (limited to 'src/www/minibar/minibar_translations.js')
| -rw-r--r-- | src/www/minibar/minibar_translations.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/www/minibar/minibar_translations.js b/src/www/minibar/minibar_translations.js index 875a1b5db..1a429a48f 100644 --- a/src/www/minibar/minibar_translations.js +++ b/src/www/minibar/minibar_translations.js @@ -178,6 +178,7 @@ Translations.prototype.parsetree_button=function(abs,lang) { function draw_brackets(b) { return b.token ? span_class("token",text(b.token)) - : node("span",{"class":"brackets",title:(b.fun||"_")+":"+b.cat}, + : node("span",{"class":"brackets", + title:(b.fun||"_")+":"+b.cat+" "+b.fid+":"+b.index}, b.children.map(draw_brackets)) } |
