|
61 | 61 | .active {border: 1px solid red !important;} |
62 | 62 | .selected {background: red !important; text-shadow: 1px 1px 4px white, -1px 1px 4px white, 1px -1px 4px white, -1px -1px 4px white;} |
63 | 63 | .other {background: hsl(0, 0%, 85%);} |
| 64 | +.sent_id {display: none; background: #ddd; border-radius: 3px;} |
64 | 65 | ''' |
65 | 66 |
|
66 | 67 | SCRIPT_BASE = ''' |
|
133 | 134 | add_show_tree_button = function(index, el){ |
134 | 135 | var sent_id = el.id; |
135 | 136 | $(el).prepend( |
136 | | - $("<button>", {append: "🌲", id:"button-"+sent_id, title: "show dependency tree", class: "showtree"}).on("click", async function() { |
| 137 | + $("<button>", {append: "🌲", id:"button-"+sent_id, title: "show dependency tree "+sent_id.substring(1), class: "showtree"}).on("click", async function() { |
137 | 138 | var tree_div = $("#tree-"+sent_id); |
138 | 139 | if (tree_div.length == 0){ |
139 | 140 | $('#button-'+sent_id).attr('title', 'hide dependency tree'); |
@@ -247,6 +248,7 @@ def process_document(self, doc): |
247 | 248 | print('<div id="main-menu">Show<br><div>\n' |
248 | 249 | f' <input id="show-eid" type="checkbox" {"checked" if self.show_eid else ""} onclick="$(\'.eid\').toggle();"><label for="show-eid">eid</label><br>\n' |
249 | 250 | f' <input id="show-etype" type="checkbox" {"checked" if self.show_etype else ""} onclick="$(\'.etype\').toggle();"><label for="show-etype">etype</label><br>\n' |
| 251 | + ' <input id="show-sent_id" type="checkbox" onclick="$(\'.sent_id\').toggle();"><label for="show-sent_id">sent_id</label><br>\n' |
250 | 252 | ' <input id="show-trees" type="checkbox" checked onclick="$(\'.showtree\').toggle();"><label for="show-trees">trees</label><br>\n' |
251 | 253 | ' <input id="show-color" type="checkbox" checked onclick="$(\'.m\').toggleClass(\'nocolor\');"><label for="show-color">colors</label><br>\n' |
252 | 254 | ' <input id="show-boxes" type="checkbox" checked onclick="$(\'.m\').toggleClass(\'nobox\');"><label for="show-boxes">boxes</label></div><div>\n' |
@@ -330,6 +332,7 @@ def process_tree(self, tree): |
330 | 332 | print('<hr class="par">') |
331 | 333 | opened = [] |
332 | 334 | print(f'<p class="sentence" id={_id(tree)}>') |
| 335 | + print(f'<span class="sent_id">🆔{tree.sent_id}</span>') |
333 | 336 | for node in nodes_and_empty: |
334 | 337 | while subspans and subspans[-1].words[0] == node: |
335 | 338 | subspan = subspans.pop() |
|
0 commit comments