blob: 853d07e3bbfd9c78eaed71ad09bf55d20633391b [file] [log] [blame]
Nils Diewaldd0770492014-12-19 03:55:00 +00001<!DOCTYPE html>
2<html>
3 <head>
4 <title>Virtual Collection demo</title>
Nils Diewald966abf12014-12-20 02:27:45 +00005 <meta charset="utf-8" />
Nils Diewaldd0770492014-12-19 03:55:00 +00006 <script src="../src/vc.js"></script>
Nils Diewald966abf12014-12-20 02:27:45 +00007 <link href="../../css/vc.css" rel="stylesheet" type="text/css"></link>
Nils Diewaldd0770492014-12-19 03:55:00 +00008 </head>
9 <body>
10 <div id="vc"></div>
Nils Diewald966abf12014-12-20 02:27:45 +000011
Nils Diewaldd0770492014-12-19 03:55:00 +000012 <script>
13 var json = {
14 "@type":"korap:docGroup",
15 "operation":"operation:or",
16 "operands":[
17 {
18 "@type":"korap:docGroup",
19 "operation":"operation:and",
20 "operands":[
21 {
22 "@type":"korap:doc",
23 "key":"Titel",
24 "value":"Baum",
25 "match":"match:eq"
26 },
27 {
28 "@type":"korap:doc",
29 "key":"Veröffentlichungsort",
30 "value":"hihi",
31 "match":"match:eq"
Nils Diewald0297ba12015-01-05 21:56:12 +000032 },
33 {
34 "@type":"korap:docGroup",
35 "operation":"operation:or",
36 "operands":[
37 {
38 "@type":"korap:doc",
39 "key":"Titel",
40 "value":"Baum",
41 "match":"match:eq"
42 },
43 {
44 "@type":"korap:doc",
45 "key":"Veröffentlichungsort",
46 "value":"hihi",
47 "match":"match:eq"
48 }
49 ]
Nils Diewaldd0770492014-12-19 03:55:00 +000050 }
51 ]
52 },
53 {
54 "@type":"korap:doc",
55 "key":"Untertitel",
56 "value":"huhu",
57 "match":"match:eq"
58 }
59 ]
60 };
Nils Diewald966abf12014-12-20 02:27:45 +000061 var vc = KorAP.VirtualCollection.render(json);
62 document.getElementById('vc').appendChild(vc.element());
Nils Diewald5c817a42015-01-06 01:08:56 +000063
64 function showJSON() {
65 document.getElementById("json").innerHTML = JSON.stringify(vc.root().toJson());
66 };
67
Nils Diewaldd0770492014-12-19 03:55:00 +000068 </script>
Nils Diewald5c817a42015-01-06 01:08:56 +000069
70 <p><a onclick="showJSON()" style="cursor:pointer">show JSON!</a></p>
71 <div id="json" style="background-color:white; color: black; padding: 1em; font-family: mono;"></div>
Nils Diewaldd0770492014-12-19 03:55:00 +000072 </body>
73</html>