Commit b55ed79b582c474d45a028e2e204d629b84852a9
- Diff rendering mode:
- inline
- side by side
server.py
(3 / 1)
  | |||
90 | 90 | del(i['_id']) | |
91 | 91 | ret[y] = i | |
92 | 92 | y = y + 1 | |
93 | return render_template('blank.html', content = ret, flag = request.args['flag']) | ||
93 | |||
94 | return render_template('blank.html', content = ret, flag =\ | ||
95 | request.args['flag']) | ||
94 | 96 | ||
95 | 97 | ||
96 | 98 | @app.route('/submit', methods=['POST']) |
static/text-annotation.js
(9 / 5)
  | |||
51 | 51 | backdrop: false, | |
52 | 52 | }); | |
53 | 53 | $('.well a').click(function(event){ | |
54 | if($(event.currentTarget).text().search('#')){ | ||
54 | $('.highlight').removeClass('highlight'); | ||
55 | if($(event.currentTarget).text().search('#') >= 0) { | ||
55 | 56 | len = $(event.currentTarget).text().split('#').length; | |
56 | xpath = $(event.currentTarget).text().split('#')[len-1]; | ||
57 | var xpath = $(event.currentTarget).text().split('#')[len-1]; | ||
57 | 58 | } | |
58 | else | ||
59 | xpath = $(event.currentTarget).text(); | ||
59 | else { | ||
60 | var xpath = $(event.currentTarget).text(); | ||
61 | } | ||
60 | 62 | var nodes = document.evaluate(xpath, document, null, XPathResult.ANY_TYPE,null); | |
61 | 63 | result = nodes.iterateNext(); | |
62 | 64 | while(result){ | |
63 | 65 | $(result).addClass("highlight"); | |
64 | result = nodes.iterateNext(); | ||
66 | if(nodes.iterateNext) { | ||
67 | result = nodes.iterateNext(); | ||
68 | } | ||
65 | 69 | } | |
66 | 70 | }); | |
67 | 71 | }); |
templates/blank.html
(0 / 3)
  | |||
1 | 1 | <!doctype html> | |
2 | <body> | ||
3 | 2 | {% if flag == '1' %} | |
4 | 3 | {% for obj in content %} | |
5 | 4 | <div class="well"> | |
… | … | ||
20 | 20 | </div> | |
21 | 21 | {% endfor %} | |
22 | 22 | {% endif %} | |
23 | </body> | ||
24 | </html> |