|
3 | 3 | <head>
|
4 | 4 | <meta charset="utf-8">
|
5 | 5 | <title>Readability.js test page</title>
|
6 |
| - <style> |
7 |
| - body { |
8 |
| - background-color: #ffe; |
9 |
| - font-size: 18px; |
10 |
| - } |
11 |
| - form { margin: 1em 0; } |
12 |
| - input { font-size: 16px; } |
13 |
| - iframe { |
14 |
| - width: 49%; |
15 |
| - height: 640px; |
16 |
| - background: #fff; |
17 |
| - } |
18 |
| - iframe body { |
19 |
| - font-size: 22px; |
20 |
| - } |
21 |
| - </style> |
| 6 | + <link rel="stylesheet" type="text/css" href="bootstrap.min.css"> |
| 7 | + <link rel="stylesheet" type="text/css" href="style.css"> |
22 | 8 | </head>
|
23 | 9 | <body>
|
24 |
| - <h1>Readability.js test page</h1> |
25 |
| - <form id="form"> |
26 |
| - <p><label>URL |
27 |
| - <input type="url" id="url" size="120" placeholder="http://"> |
28 |
| - </label></p> |
29 |
| - <p><label> |
30 |
| - <input type="checkbox" id="sanitize"> Sanitize output |
31 |
| - </label></p> |
32 |
| - <input type="submit"> |
33 |
| - </form> |
34 |
| - <iframe id="source"></iframe> |
35 |
| - <iframe id="target"></iframe> |
36 |
| - <script> |
37 |
| - var q = document.querySelector.bind(document); |
38 |
| - |
39 |
| - function injectReadableContents(url, sanitize, target) { |
40 |
| - var req = new XMLHttpRequest(); |
41 |
| - req.open("GET", "/api/get?sanitize=" + (sanitize ? "yes" : "no") + "&url=" + encodeURIComponent(url), false); |
42 |
| - req.send(null); |
43 |
| - target.contentDocument.body.innerHTML = JSON.parse(req.responseText).content; |
44 |
| - } |
45 |
| - |
46 |
| - q("form").addEventListener("submit", function(event) { |
47 |
| - event.preventDefault(); |
48 |
| - var url = q("#url").value; |
49 |
| - q("#source").src = url; |
50 |
| - injectReadableContents(url, q("#sanitize").checked, q("#target")); |
51 |
| - }); |
52 |
| - </script> |
| 10 | + <div class="container-fluid"> |
| 11 | + <div class="page-header"> |
| 12 | + <h1>Readability.js <small>test page</small></h1> |
| 13 | + </div> |
| 14 | + <div class="row"> |
| 15 | + <div class="col-md-6"> |
| 16 | + <form class="form-horizontal" id="form"> |
| 17 | + <div class="form-group"> |
| 18 | + <label class="col-sm-1 control-label">URL</label> |
| 19 | + <div class="col-sm-11"> |
| 20 | + <input type="url" class="form-control" id="url" placeholder="http://"> |
| 21 | + </div> |
| 22 | + </div> |
| 23 | + <div class="form-group"> |
| 24 | + <div class="col-sm-offset-1 col-sm-11"> |
| 25 | + <div class="checkbox"> |
| 26 | + <label><input type="checkbox" id="sanitize">Sanitize output</label> |
| 27 | + </div> |
| 28 | + </div> |
| 29 | + </div> |
| 30 | + <div class="form-group"> |
| 31 | + <div class="col-sm-offset-1 col-sm-10"> |
| 32 | + <input class="btn btn-info" type="submit"> |
| 33 | + </div> |
| 34 | + </div> |
| 35 | + </form> |
| 36 | + </div> |
| 37 | + <div class="col-md-6"> |
| 38 | + <table class="table table-striped"> |
| 39 | + <tr><th>Title</th><td id="title"></td></tr> |
| 40 | + <tr><th>Dir</th><td id="dir"></td></tr> |
| 41 | + <tr><th>Byline</th><td id="byline"></td></tr> |
| 42 | + <tr><th>Length</th><td id="length"></td></tr> |
| 43 | + <tr><th>Excerpt</th><td id="excerpt"></td></tr> |
| 44 | + </table> |
| 45 | + </div> |
| 46 | + </div> |
| 47 | + <div class="row"> |
| 48 | + <div class="col-md-6"> |
| 49 | + <div class="panel panel-default"> |
| 50 | + <div class="panel-heading">Original</div> |
| 51 | + <iframe id="source"></iframe> |
| 52 | + </div> |
| 53 | + </div> |
| 54 | + <div class="col-md-6"> |
| 55 | + <div class="panel panel-default"> |
| 56 | + <div class="panel-heading">Readable</div> |
| 57 | + <iframe id="target"></iframe> |
| 58 | + </div> |
| 59 | + </div> |
| 60 | + </div> |
| 61 | + </div> |
| 62 | + <script src="main.js"></script> |
53 | 63 | </body>
|
54 | 64 | </html>
|
0 commit comments