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