Commit 9c339b84ed5a4c00e0dfee8ec7a6a8767c2fc091
- Diff rendering mode:
- inline
- side by side
server/alipi.py
(10 / 1)
  | |||
367 | 367 | connection.disconnect() | |
368 | 368 | return "empty" | |
369 | 369 | ||
370 | |||
370 | @app.route("/demo",methods=['GET']) | ||
371 | def doDemo(): | ||
372 | root = lxml.html.parse(request.args['foruri']).getroot() | ||
373 | root2 = html5parser.parse(request.args['blog']).getroot() | ||
374 | tree2 = root2.getroottree() | ||
375 | if tree2.docinfo.doctype == '': | ||
376 | lxml.html.xhtml_to_html(root2) | ||
377 | root.make_links_absolute(request.args['foruri'], resolve_base_href = True) | ||
378 | root.xpath(request.args['xpath'])[0].addnext(root2.xpath(request.args['bxpath'])[0]) | ||
379 | return lxml.html.tostring(root) | ||
371 | 380 | import logging,os | |
372 | 381 | from logging import FileHandler | |
373 | 382 |
server/templates/feeds.html
(7 / 3)
  | |||
1 | 1 | <!doctype html> | |
2 | 2 | <head> | |
3 | 3 | <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script> | |
4 | <script type="text/javascript" src="http://localhost/server/config.js"></script> | ||
4 | 5 | <script type="text/javascript"> | |
5 | $.getJSON("http://127.0.0.1:5000/feed", function(data) | ||
6 | $.getJSON(config.deploy+"/feed", function(data) | ||
6 | 7 | { | |
7 | 8 | d = $.makeArray(data); | |
8 | 9 | d.reverse(); | |
… | … | ||
26 | 26 | </script> | |
27 | 27 | </head> | |
28 | 28 | <body style="text-wrap:normal"> | |
29 | @<input type="text" id="t1" name="author" value="author" /> says <input type="text" id="t2" name="about" value="about" /> <input type="text" id="t3" name="xpath" value="xpath" /> has <select id="selected" onchange="checkVal();"><option>re-narrations</option><option>5el</option></select> at <input type="text" id="t4" name="blog" value="blog" /> <input type="text" id="t5" name="bxpath" value="bxpath" /> in <input type="text" name="lang" value="language" id="t6" /> <span id="remove">targetting</span> <input type="text" name="loc" value="location" id="t7"/> <input type="submit" id="post" name="alipi" value="Feed" onclick="postForm();" /> | ||
29 | @<input type="text" id="t1" name="author" value="author" /> says <input type="text" id="t2" name="about" value="about" /> <input type="text" id="t3" name="xpath" value="xpath" /> has <select id="selected" onchange="checkVal();"><option>re-narrations</option><option>5el</option></select> at <input type="text" id="t4" name="blog" value="blog" /> <input type="text" id="t5" name="bxpath" value="bxpath" /> in <input type="text" name="lang" value="language" id="t6" /> <span id="remove">targetting</span> <input type="text" name="loc" value="location" id="t7"/> <input type="submit" id="post" name="alipi" value="Feed" onclick="postForm();" /> <input type="submit" name="alipi" value="Test the feed" onclick="doDemo();" /> | ||
30 | 30 | <div id="feeds"> | |
31 | 31 | </div> | |
32 | 32 | <script type="text/javascript"> | |
… | … | ||
58 | 58 | $("#t6").val("language"); | |
59 | 59 | } | |
60 | 60 | } | |
61 | |||
61 | function doDemo() | ||
62 | { | ||
63 | window.open(config.deploy+"/demo?foruri="+encodeURIComponent($('#t2').val())+"&xpath="+encodeURIComponent($('#t3').val())+"&blog="+encodeURIComponent($('#t4').val())+"&bxpath="+encodeURIComponent($('#t5').val())); | ||
64 | } | ||
62 | 65 | </script> | |
63 | 66 | </body> | |
64 | 67 | </html> |