blob: 35a121d757726c491b020cee8163d01988de94d5 [file] [log] [blame]
Nils Diewald5d1ffb42014-05-21 17:45:34 +00001<!DOCTYPE html>
2<html>
3 <head>
4 <title><%= title %></title>
5%= stylesheet '/style.css'
Nils Diewald44a72782014-06-20 16:03:21 +00006%= stylesheet '/hint.css'
Nils Diewald1eba6572014-06-17 19:49:53 +00007%= stylesheet '/table.css'
Nils Diewald33e15552014-06-13 19:38:37 +00008%= stylesheet '/kwic-4.0.css'
Nils Diewald02df9912014-06-03 16:08:07 +00009%= stylesheet '/fontawesome/font-awesome.min.css'
Nils Diewaldbd56adc2014-06-22 18:44:53 +000010%= stylesheet '/responsive.css', media => '(max-width: 640px)'
Nils Diewald5d1ffb42014-05-21 17:45:34 +000011%= javascript '/jquery-2.0.0.min.js'
Nils Diewald1eba6572014-06-17 19:49:53 +000012%= javascript '/translateTable.js'
Nils Diewald44a72782014-06-20 16:03:21 +000013%= javascript '/hint.js'
Nils Diewald02df9912014-06-03 16:08:07 +000014<meta charset="utf-8" />
Nils Diewald5d1ffb42014-05-21 17:45:34 +000015 </head>
16 <body>
Nils Diewald2329e1d2014-06-12 16:07:57 +000017
Nils Diewalddb03fa92014-06-23 13:36:55 +000018% my $search_route = url_for;
Nils Diewaldb22abdf2014-06-18 22:57:50 +000019% unless (current_route 'tutorial') {
Nils Diewalddb03fa92014-06-23 13:36:55 +000020<div id="tutorial">
Nils Diewaldb22abdf2014-06-18 22:57:50 +000021 % my $tut_page = url_for(session('tutorial') || 'tutorial');
22 <a href="<%= $tut_page %>" target="_blank"><i title="Open in new tab" class="fa fa-external-link-square"></i></a>
23 <i onclick="closeTutorial()" title="close" class="fa fa-toggle-up"></i>
24 <iframe src="about:blank" data-src="<%= $tut_page->query([snippet => 1]) %>"></iframe>
Nils Diewald2329e1d2014-06-12 16:07:57 +000025</div>
Nils Diewalddb03fa92014-06-23 13:36:55 +000026% }
27% else {
28% $search_route = url_for('index');
Nils Diewaldb22abdf2014-06-18 22:57:50 +000029% };
Nils Diewald33e15552014-06-13 19:38:37 +000030
Nils Diewald02df9912014-06-03 16:08:07 +000031<div id="top">
Nils Diewaldb22abdf2014-06-18 22:57:50 +000032 <a href="<%= url_for 'index' %>"><h1><span>KorAP- Korpusanalyseplattform der nächsten Generation</span></h1></a>
Nils Diewalddb03fa92014-06-23 13:36:55 +000033
34
35%= form_for $search_route => begin
Nils Diewald2329e1d2014-06-12 16:07:57 +000036%= select_field ql => [[Poliqarp => 'poliqarp'], ['Cosmas II' => 'cosmas2']], id => 'ql-field'
Nils Diewald02df9912014-06-03 16:08:07 +000037<br />
Nils Diewald44a72782014-06-20 16:03:21 +000038%= search_field 'q', id => 'q-field', autofocus => 'autofocus'
39%= javascript begin
40new Hint({
41 "ref" : "q-field",
Nils Diewald465c4252014-06-20 21:51:58 +000042 "qlRef" : "ql-field",
Nils Diewald44a72782014-06-20 16:03:21 +000043 "hintSize" : 10,
44 "hints" : {
Nils Diewald465c4252014-06-20 21:51:58 +000045 "-foundries" : {
46 "corenlp" : ["corenlp/", "CoreNLP"],
47 "cnx" : ["cnx/", "Connexor"],
48 "opennlp" : ["opennlp/", "OpenNLP"],
49 "xip" : ["xip/", "Xerox"],
50 "tt" : ["tt/", "TreeTagger"],
51 "mate" : ["mate/", "Mate"]
52 },
Nils Diewald44a72782014-06-20 16:03:21 +000053 "corenlp" : {
54 "ne_dewac_175m_600" : ["ne_dewac_175m_600=", "Named Entity"],
55 "ne_hgc_175m_600" : ["ne_hgc_175m_600=", "Named Entity"]
56 },
57 "corenlp/ne_dewac_175m_600" : ["I-LOC","I-MISC","I-ORG","I-PER"],
58 "corenlp/ne_hgc_175m_600" : ["I-LOC","I-MISC","I-ORG","I-PER"],
59 "cnx" : {
60 "c" : ["c=", "Constituency"],
61 "l" : ["l=", "Lemma"],
62 "m" : ["m=", "Morpho Syntax"],
63 "p" : ["p=", "Part of Speech"],
64 "syn" : ["syn=", "Syntax"]
65 },
66 "cnx/m" : ["Abbr","CMP","IMP","IND","INF","ORD","PAST","PCP","PERF","PL","PRES","PROG","Prop","SUB","SUP"],
67 "cnx/p" : ["A","ADV","CC","CS","DET","INTERJ","N","NUM","PREP","PRON","V"],
68 "cnx/syn" : ["@ADVL","@AUX","@CC","@MAIN","@NH","@POSTMOD","@PREMARK","@PREMOD"],
69 "opennlp" : {
70 "p" : ["p=", "Part of Speech"]
71 },
72 "opennlp/p" : ["$(","$,","$.","ADJA","ADJD","ADV","APPR","APPRART","ART","CARD","FM","KOKOM","KON","KOUI","KOUS","NE","NN","PDAT","PDS","PIAT","PIS","PPER","PPOSAT","PRELS","PRF","PROAV","PTKNEG","PTKVZ","PTKZU","PWAT","PWAV","PWS","TRUNC","VAFIN","VAINF","VAPP","VMFIN","VVFIN","VVIMP","VVINF","VVIZU","VVPP","XY"],
73 "xip" : {
74 "c" : ["c=", "Constituency"],
75 "d" : ["d=", "Dependency"],
76 "l" : ["l=", "Lemma"],
77 "p" : ["p=", "Part of Speech"]
78 },
79 "xip/c" : ["ADJ","ADV","AP","CONJ","DET","INFC","INS","ITJ","MC","NEGAT","NOUN","NP","NPA","NUM","POSTP","PP","PREP","PRON","PTCL","PUNCT","SC","SYMBOL","TOP","TRUNC","VERB"],
80 "xip/d" : ["ADJMOD","AUXIL","CONNECT","COORD","DATE","DETERM","EXPL","LOC","MODAL","NEGAT","NMOD","NMOD2","NUMMOD","OBJ","ORG","PERSON","PLINK","PRED","REFLEX","SUBJ","THEMA","TIME","TRUNC","VMAIN","VMOD","VPREF"],
81 "xip/p" : ["ADJ","ADV","CONJ","DET","ITJ","NEGAT","NOUN","NUM","POSTP","PREP","PRON","PTCL","PUNCT","SYMBOL","TRUNC","VERB"],
82 "tt" : {
83 "l" : ["l=", "Lemma"],
84 "p" : ["p=", "Part of Speech"]
85 },
86 "tt/p" : ["$.","ADJA","ADJD","ADV","APPO","APPR","APPRART","APZR","ART","CARD","FM","ITJ","KOKOM","KON","KOUI","KOUS","NE","NN","PDAT","PDS","PIAT","PIS","PPER","PPOSAT","PRELS","PRF","PROAV","PTKA","PTKNEG","PTKVZ","PTKZU","PWAT","PWAV","PWS","TRUNC","VAFIN","VAINF","VAPP","VMFIN","VMINF","VVFIN","VVIMP","VVINF","VVIZU","VVPP","XY"],
87 "mate" : {
88 "d" : ["d=", "Dependency"],
89 "l" : ["l=", "Lemma"],
90 "m" : ["m=", "Morpho Syntax"],
91 "p" : ["p=", "Part of Speech"]
92 },
93 "mate/d" : ["--","AG","AMS","APP","CC","CD","CJ","CM","CP","CVC","DA","DM","EP","JU","MNR","MO","NG","NK","NMC","OA","OC","OG","OP","PAR","PD","PG","PH","PM","PNC","RC","RE","RS","SB","SBP","SVP","UC"],
94 "mate/m" : ["<no-type>","case:*","case:acc","case:dat","case:gen","case:nom","degree:comp","degree:pos","degree:sup","gender:*","gender:fem","gender:masc","gender:neut","mood:imp","mood:ind","mood:subj","number:*","number:pl","number:sg","person:1","person:2","person:3","tense:past","tense:pres"],
95 "mate/p" : ["$(","$,","$.","<root-POS>","ADJA","ADJD","ADV","APPO","APPR","APPRART","ART","CARD","FM","ITJ","KOKOM","KON","KOUI","KOUS","NE","NN","PDAT","PDS","PIAT","PIS","PPER","PPOSAT","PPOSS","PRELAT","PRELS","PRF","PROAV","PTKA","PTKNEG","PTKVZ","PTKZU","PWAT","PWAV","PWS","TRUNC","VAFIN","VAINF","VAPP","VMFIN","VVFIN","VVIMP","VVINF","VVIZU","VVPP","XY"]
96 }}
97);
98
99% end
Nils Diewald02df9912014-06-03 16:08:07 +0000100<button type="submit" name="action" value="ok"><i class="fa fa-search"></i></button>
Nils Diewaldb40ddad2014-06-23 15:39:18 +0000101% if (stash('test_port')) {
Nils Diewald02df9912014-06-03 16:08:07 +0000102<button type="submit" name="action" value="inspect"><i class="fa fa-code"></i></button>
Nils Diewaldb40ddad2014-06-23 15:39:18 +0000103% };
Nils Diewald5d1ffb42014-05-21 17:45:34 +0000104% end
Nils Diewald02df9912014-06-03 16:08:07 +0000105
Nils Diewald02df9912014-06-03 16:08:07 +0000106<div id="button-right">
Nils Diewald2329e1d2014-06-12 16:07:57 +0000107% if (param('q')) {
Nils Diewald02df9912014-06-03 16:08:07 +0000108<button type="button" onclick="$('#search > ol').toggleClass('left-aligned right-aligned'); $(this).children('i').toggleClass('fa-align-right fa-align-left')"><i class="fa fa-align-right"></i></button>
Nils Diewald02df9912014-06-03 16:08:07 +0000109% }
Nils Diewaldb22abdf2014-06-18 22:57:50 +0000110% unless (current_route 'tutorial') {
Nils Diewald2329e1d2014-06-12 16:07:57 +0000111<button type="button" onclick="openTutorial()"><i class="fa fa-graduation-cap"></i></button>
Nils Diewaldb22abdf2014-06-18 22:57:50 +0000112% };
Nils Diewald2329e1d2014-06-12 16:07:57 +0000113</div>
Nils Diewald02df9912014-06-03 16:08:07 +0000114
115</div>
116
117<div id="sidebar" style="padding-top: 90px">
Nils Diewald2329e1d2014-06-12 16:07:57 +0000118%= include 'collections'
Nils Diewalddb03fa92014-06-23 13:36:55 +0000119<i class="fa fa-bars"></i>
Nils Diewald02df9912014-06-03 16:08:07 +0000120</div>
121
122<div id="search">
Nils Diewald5d1ffb42014-05-21 17:45:34 +0000123%= content
Nils Diewald02df9912014-06-03 16:08:07 +0000124</div>
125
126%= javascript begin
Nils Diewald2329e1d2014-06-12 16:07:57 +0000127
Nils Diewald002e8fb2014-06-22 14:27:01 +0000128$("#search > ol > li:not(.active)").on("click", function (e) {
Nils Diewald2329e1d2014-06-12 16:07:57 +0000129 $(this).addClass('active');
Nils Diewald002e8fb2014-06-22 14:27:01 +0000130 e.stopPropagation();
Nils Diewald2329e1d2014-06-12 16:07:57 +0000131});
132
Nils Diewald002e8fb2014-06-22 14:27:01 +0000133$("#search > ol > li:not(.active) > ul > li.close").on("click", function (e) {
134 $(this.parentNode.parentNode).removeClass('active');
135 e.stopPropagation();
136});
137
Nils Diewald2329e1d2014-06-12 16:07:57 +0000138
Nils Diewald33e15552014-06-13 19:38:37 +0000139function showTable (o) {
140 var match = o.parentNode.parentNode;
Nils Diewald1eba6572014-06-17 19:49:53 +0000141 var table = $(match).children("div").children("div.tokenInfo").first();
142
143 if (table.hasClass("active")) {
144 table.removeClass("active");
145 return;
146 }
147 else if (table.children("table").length > 0) {
148 table.addClass("active");
149 return;
150 };
151
Nils Diewald33e15552014-06-13 19:38:37 +0000152 var corpusID = match.getAttribute('data-corpus-id');
Nils Diewald002e8fb2014-06-22 14:27:01 +0000153 var docID = match.getAttribute('data-doc-id');
154 var matchID = match.getAttribute('data-match-id');
155 var url = '/corpus/' + corpusID + '/' + docID + '/' + matchID;
Nils Diewald1eba6572014-06-17 19:49:53 +0000156 var snippet;
157
158 jQuery.getJSON(url, function (res) {
159 var snippet = new SnippetTable(res['snippet']);
160 table.addClass("active");
161 table.append(snippet.toTable());
162 });
Nils Diewald33e15552014-06-13 19:38:37 +0000163};
164
Nils Diewald2329e1d2014-06-12 16:07:57 +0000165function openTutorial (o) {
166 var tut = $("#tutorial");
Nils Diewalddb03fa92014-06-23 13:36:55 +0000167 tut.addClass("active");
Nils Diewald2329e1d2014-06-12 16:07:57 +0000168 var iframe = tut.children("iframe");
169 var src = iframe.attr("data-src");
170 iframe.attr("src", src);
171};
172
173function closeTutorial (o) {
Nils Diewalddb03fa92014-06-23 13:36:55 +0000174 $("#tutorial").removeClass("active");
Nils Diewald2329e1d2014-06-12 16:07:57 +0000175};
176
177function useQuery (o) {
178 var q = o.getAttribute("data-query");
179 var ql = o.getAttribute("data-query-language");
180 $("#ql-field").val(ql);
181 $("#q-field").val(q);
182 closeTutorial();
183};
184
Nils Diewald002e8fb2014-06-22 14:27:01 +0000185$("code.query.serial, #sidebar").on("click", function () {
Nils Diewald02df9912014-06-03 16:08:07 +0000186 $(this).toggleClass('active');
187});
Nils Diewald2329e1d2014-06-12 16:07:57 +0000188
Nils Diewald02df9912014-06-03 16:08:07 +0000189% end
190
Nils Diewald33e15552014-06-13 19:38:37 +0000191
Nils Diewald2329e1d2014-06-12 16:07:57 +0000192%= notifications 'Alertify'
Nils Diewald5d1ffb42014-05-21 17:45:34 +0000193 </body>
194</html>