Nils Diewald | d077049 | 2014-12-19 03:55:00 +0000 | [diff] [blame] | 1 | <!DOCTYPE html> |
| 2 | <html> |
| 3 | <head> |
| 4 | <title>Virtual Collection demo</title> |
Nils Diewald | 966abf1 | 2014-12-20 02:27:45 +0000 | [diff] [blame] | 5 | <meta charset="utf-8" /> |
Nils Diewald | 2fe12e1 | 2015-03-06 16:47:06 +0000 | [diff] [blame] | 6 | <script src="../src/menu.js"></script> |
Nils Diewald | d077049 | 2014-12-19 03:55:00 +0000 | [diff] [blame] | 7 | <script src="../src/vc.js"></script> |
Nils Diewald | 966abf1 | 2014-12-20 02:27:45 +0000 | [diff] [blame] | 8 | <link href="../../css/vc.css" rel="stylesheet" type="text/css"></link> |
Nils Diewald | d2b5737 | 2015-03-10 20:09:48 +0000 | [diff] [blame] | 9 | <link href="../../css/menu.css" rel="stylesheet" type="text/css"></link> |
Nils Diewald | 8f6b610 | 2015-01-08 18:25:33 +0000 | [diff] [blame] | 10 | <style type="text/css" rel="stylesheet"> |
| 11 | .info { |
| 12 | background-color:white; |
| 13 | color: black; |
| 14 | padding: 1em; |
| 15 | font-family: mono; |
| 16 | } |
| 17 | </style> |
Nils Diewald | d077049 | 2014-12-19 03:55:00 +0000 | [diff] [blame] | 18 | </head> |
| 19 | <body> |
| 20 | <div id="vc"></div> |
Nils Diewald | 59c02fc | 2015-03-07 01:29:09 +0000 | [diff] [blame] | 21 | <div id="menu" class="vc"></div> |
Nils Diewald | 966abf1 | 2014-12-20 02:27:45 +0000 | [diff] [blame] | 22 | |
Nils Diewald | d077049 | 2014-12-19 03:55:00 +0000 | [diff] [blame] | 23 | <script> |
| 24 | var json = { |
Nils Diewald | 2fe12e1 | 2015-03-06 16:47:06 +0000 | [diff] [blame] | 25 | "@type":"koral:docGroup", |
Nils Diewald | d077049 | 2014-12-19 03:55:00 +0000 | [diff] [blame] | 26 | "operation":"operation:or", |
| 27 | "operands":[ |
| 28 | { |
Nils Diewald | 2fe12e1 | 2015-03-06 16:47:06 +0000 | [diff] [blame] | 29 | "@type":"koral:docGroup", |
Nils Diewald | d077049 | 2014-12-19 03:55:00 +0000 | [diff] [blame] | 30 | "operation":"operation:and", |
| 31 | "operands":[ |
| 32 | { |
Nils Diewald | 2fe12e1 | 2015-03-06 16:47:06 +0000 | [diff] [blame] | 33 | "@type":"koral:doc", |
Nils Diewald | d077049 | 2014-12-19 03:55:00 +0000 | [diff] [blame] | 34 | "key":"Titel", |
Nils Diewald | edb7801 | 2015-03-11 20:06:08 +0000 | [diff] [blame] | 35 | "value":"Der Birnbaum", |
Nils Diewald | d077049 | 2014-12-19 03:55:00 +0000 | [diff] [blame] | 36 | "match":"match:eq" |
| 37 | }, |
| 38 | { |
Nils Diewald | 2fe12e1 | 2015-03-06 16:47:06 +0000 | [diff] [blame] | 39 | "@type":"koral:doc", |
Nils Diewald | d077049 | 2014-12-19 03:55:00 +0000 | [diff] [blame] | 40 | "key":"Veröffentlichungsort", |
Nils Diewald | edb7801 | 2015-03-11 20:06:08 +0000 | [diff] [blame] | 41 | "value":"Mannheim", |
Nils Diewald | d077049 | 2014-12-19 03:55:00 +0000 | [diff] [blame] | 42 | "match":"match:eq" |
Nils Diewald | 0297ba1 | 2015-01-05 21:56:12 +0000 | [diff] [blame] | 43 | }, |
| 44 | { |
Nils Diewald | 2fe12e1 | 2015-03-06 16:47:06 +0000 | [diff] [blame] | 45 | "@type":"koral:docGroup", |
Nils Diewald | 0297ba1 | 2015-01-05 21:56:12 +0000 | [diff] [blame] | 46 | "operation":"operation:or", |
| 47 | "operands":[ |
| 48 | { |
Nils Diewald | 2fe12e1 | 2015-03-06 16:47:06 +0000 | [diff] [blame] | 49 | "@type":"koral:doc", |
Nils Diewald | edb7801 | 2015-03-11 20:06:08 +0000 | [diff] [blame] | 50 | "key":"Untertitel", |
| 51 | "value":"Aufzucht und Pflege", |
Nils Diewald | 0297ba1 | 2015-01-05 21:56:12 +0000 | [diff] [blame] | 52 | "match":"match:eq" |
| 53 | }, |
| 54 | { |
Nils Diewald | 2fe12e1 | 2015-03-06 16:47:06 +0000 | [diff] [blame] | 55 | "@type":"koral:doc", |
Nils Diewald | edb7801 | 2015-03-11 20:06:08 +0000 | [diff] [blame] | 56 | "key":"Untertitel", |
| 57 | "value":"Gedichte", |
Nils Diewald | 86dad5b | 2015-01-28 15:09:07 +0000 | [diff] [blame] | 58 | "match":"match:eq", |
| 59 | "rewrites" : [ |
| 60 | { |
Nils Diewald | 2fe12e1 | 2015-03-06 16:47:06 +0000 | [diff] [blame] | 61 | "@type": "koral:rewrite", |
Nils Diewald | 86dad5b | 2015-01-28 15:09:07 +0000 | [diff] [blame] | 62 | "src" : "policy", |
| 63 | "operation" : "operation:injection", |
| 64 | } |
| 65 | ] |
Nils Diewald | 0297ba1 | 2015-01-05 21:56:12 +0000 | [diff] [blame] | 66 | } |
| 67 | ] |
Nils Diewald | d077049 | 2014-12-19 03:55:00 +0000 | [diff] [blame] | 68 | } |
| 69 | ] |
| 70 | }, |
| 71 | { |
Nils Diewald | 2fe12e1 | 2015-03-06 16:47:06 +0000 | [diff] [blame] | 72 | "@type":"koral:doc", |
Nils Diewald | edb7801 | 2015-03-11 20:06:08 +0000 | [diff] [blame] | 73 | "key":"Veröffentlichungsdatum", |
| 74 | "type":"type:date", |
| 75 | "value":"2015-03-05", |
| 76 | "match":"match:geq" |
Nils Diewald | d077049 | 2014-12-19 03:55:00 +0000 | [diff] [blame] | 77 | } |
| 78 | ] |
| 79 | }; |
Nils Diewald | e15b7a2 | 2015-01-09 21:50:21 +0000 | [diff] [blame] | 80 | KorAP.Locale.AND = 'und'; |
| 81 | KorAP.Locale.OR = 'oder'; |
| 82 | |
Nils Diewald | 966abf1 | 2014-12-20 02:27:45 +0000 | [diff] [blame] | 83 | var vc = KorAP.VirtualCollection.render(json); |
| 84 | document.getElementById('vc').appendChild(vc.element()); |
Nils Diewald | 5c817a4 | 2015-01-06 01:08:56 +0000 | [diff] [blame] | 85 | |
| 86 | function showJSON() { |
| 87 | document.getElementById("json").innerHTML = JSON.stringify(vc.root().toJson()); |
| 88 | }; |
| 89 | |
Nils Diewald | d599d54 | 2015-01-08 20:41:34 +0000 | [diff] [blame] | 90 | function showQuery() { |
| 91 | document.getElementById("query").innerHTML = vc.root().toQuery(); |
Nils Diewald | 8f6b610 | 2015-01-08 18:25:33 +0000 | [diff] [blame] | 92 | }; |
| 93 | |
Nils Diewald | d077049 | 2014-12-19 03:55:00 +0000 | [diff] [blame] | 94 | </script> |
Nils Diewald | 5c817a4 | 2015-01-06 01:08:56 +0000 | [diff] [blame] | 95 | |
Nils Diewald | 8f6b610 | 2015-01-08 18:25:33 +0000 | [diff] [blame] | 96 | <hr /> |
| 97 | |
Nils Diewald | 5c817a4 | 2015-01-06 01:08:56 +0000 | [diff] [blame] | 98 | <p><a onclick="showJSON()" style="cursor:pointer">show JSON!</a></p> |
Nils Diewald | 8f6b610 | 2015-01-08 18:25:33 +0000 | [diff] [blame] | 99 | <div id="json" class="info"></div> |
| 100 | |
| 101 | <hr /> |
| 102 | |
Nils Diewald | d599d54 | 2015-01-08 20:41:34 +0000 | [diff] [blame] | 103 | <p><a onclick="showQuery()" style="cursor:pointer">show Query!</a></p> |
| 104 | <div id="query" class="info"></div> |
Nils Diewald | 8f6b610 | 2015-01-08 18:25:33 +0000 | [diff] [blame] | 105 | |
Nils Diewald | d077049 | 2014-12-19 03:55:00 +0000 | [diff] [blame] | 106 | </body> |
| 107 | </html> |