blob: a483390df53df2ad5b9cf04cdd9cf1fcdd6c55ed [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 Diewaldb22abdf2014-06-18 22:57:50 +000018% unless (current_route 'tutorial') {
Nils Diewald2329e1d2014-06-12 16:07:57 +000019<div id="tutorial" style="display: none">
Nils Diewaldb22abdf2014-06-18 22:57:50 +000020 % my $tut_page = url_for(session('tutorial') || 'tutorial');
21 <a href="<%= $tut_page %>" target="_blank"><i title="Open in new tab" class="fa fa-external-link-square"></i></a>
22 <i onclick="closeTutorial()" title="close" class="fa fa-toggle-up"></i>
23 <iframe src="about:blank" data-src="<%= $tut_page->query([snippet => 1]) %>"></iframe>
Nils Diewald2329e1d2014-06-12 16:07:57 +000024</div>
Nils Diewaldb22abdf2014-06-18 22:57:50 +000025% };
Nils Diewald33e15552014-06-13 19:38:37 +000026
Nils Diewald02df9912014-06-03 16:08:07 +000027<div id="top">
Nils Diewaldb22abdf2014-06-18 22:57:50 +000028 <a href="<%= url_for 'index' %>"><h1><span>KorAP- Korpusanalyseplattform der nächsten Generation</span></h1></a>
Nils Diewald5d1ffb42014-05-21 17:45:34 +000029%= form_for url_for() => begin
Nils Diewald2329e1d2014-06-12 16:07:57 +000030%= select_field ql => [[Poliqarp => 'poliqarp'], ['Cosmas II' => 'cosmas2']], id => 'ql-field'
Nils Diewald02df9912014-06-03 16:08:07 +000031<br />
Nils Diewald44a72782014-06-20 16:03:21 +000032%= search_field 'q', id => 'q-field', autofocus => 'autofocus'
33%= javascript begin
34new Hint({
35 "ref" : "q-field",
Nils Diewald465c4252014-06-20 21:51:58 +000036 "qlRef" : "ql-field",
Nils Diewald44a72782014-06-20 16:03:21 +000037 "hintSize" : 10,
38 "hints" : {
Nils Diewald465c4252014-06-20 21:51:58 +000039 "-foundries" : {
40 "corenlp" : ["corenlp/", "CoreNLP"],
41 "cnx" : ["cnx/", "Connexor"],
42 "opennlp" : ["opennlp/", "OpenNLP"],
43 "xip" : ["xip/", "Xerox"],
44 "tt" : ["tt/", "TreeTagger"],
45 "mate" : ["mate/", "Mate"]
46 },
Nils Diewald44a72782014-06-20 16:03:21 +000047 "corenlp" : {
48 "ne_dewac_175m_600" : ["ne_dewac_175m_600=", "Named Entity"],
49 "ne_hgc_175m_600" : ["ne_hgc_175m_600=", "Named Entity"]
50 },
51 "corenlp/ne_dewac_175m_600" : ["I-LOC","I-MISC","I-ORG","I-PER"],
52 "corenlp/ne_hgc_175m_600" : ["I-LOC","I-MISC","I-ORG","I-PER"],
53 "cnx" : {
54 "c" : ["c=", "Constituency"],
55 "l" : ["l=", "Lemma"],
56 "m" : ["m=", "Morpho Syntax"],
57 "p" : ["p=", "Part of Speech"],
58 "syn" : ["syn=", "Syntax"]
59 },
60 "cnx/m" : ["Abbr","CMP","IMP","IND","INF","ORD","PAST","PCP","PERF","PL","PRES","PROG","Prop","SUB","SUP"],
61 "cnx/p" : ["A","ADV","CC","CS","DET","INTERJ","N","NUM","PREP","PRON","V"],
62 "cnx/syn" : ["@ADVL","@AUX","@CC","@MAIN","@NH","@POSTMOD","@PREMARK","@PREMOD"],
63 "opennlp" : {
64 "p" : ["p=", "Part of Speech"]
65 },
66 "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"],
67 "xip" : {
68 "c" : ["c=", "Constituency"],
69 "d" : ["d=", "Dependency"],
70 "l" : ["l=", "Lemma"],
71 "p" : ["p=", "Part of Speech"]
72 },
73 "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"],
74 "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"],
75 "xip/p" : ["ADJ","ADV","CONJ","DET","ITJ","NEGAT","NOUN","NUM","POSTP","PREP","PRON","PTCL","PUNCT","SYMBOL","TRUNC","VERB"],
76 "tt" : {
77 "l" : ["l=", "Lemma"],
78 "p" : ["p=", "Part of Speech"]
79 },
80 "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"],
81 "mate" : {
82 "d" : ["d=", "Dependency"],
83 "l" : ["l=", "Lemma"],
84 "m" : ["m=", "Morpho Syntax"],
85 "p" : ["p=", "Part of Speech"]
86 },
87 "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"],
88 "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"],
89 "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"]
90 }}
91);
92
93% end
Nils Diewald02df9912014-06-03 16:08:07 +000094<button type="submit" name="action" value="ok"><i class="fa fa-search"></i></button>
95<button type="submit" name="action" value="inspect"><i class="fa fa-code"></i></button>
Nils Diewald5d1ffb42014-05-21 17:45:34 +000096% end
Nils Diewald02df9912014-06-03 16:08:07 +000097
Nils Diewald02df9912014-06-03 16:08:07 +000098<div id="button-right">
Nils Diewald2329e1d2014-06-12 16:07:57 +000099% if (param('q')) {
Nils Diewald02df9912014-06-03 16:08:07 +0000100<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 +0000101% }
Nils Diewaldb22abdf2014-06-18 22:57:50 +0000102% unless (current_route 'tutorial') {
Nils Diewald2329e1d2014-06-12 16:07:57 +0000103<button type="button" onclick="openTutorial()"><i class="fa fa-graduation-cap"></i></button>
Nils Diewaldb22abdf2014-06-18 22:57:50 +0000104% };
Nils Diewald2329e1d2014-06-12 16:07:57 +0000105</div>
Nils Diewald02df9912014-06-03 16:08:07 +0000106
107</div>
108
109<div id="sidebar" style="padding-top: 90px">
Nils Diewald2329e1d2014-06-12 16:07:57 +0000110%= include 'collections'
Nils Diewald02df9912014-06-03 16:08:07 +0000111</div>
112
113<div id="search">
Nils Diewald5d1ffb42014-05-21 17:45:34 +0000114%= content
Nils Diewald02df9912014-06-03 16:08:07 +0000115</div>
116
117%= javascript begin
Nils Diewald2329e1d2014-06-12 16:07:57 +0000118
Nils Diewald002e8fb2014-06-22 14:27:01 +0000119$("#search > ol > li:not(.active)").on("click", function (e) {
Nils Diewald2329e1d2014-06-12 16:07:57 +0000120 $(this).addClass('active');
Nils Diewald002e8fb2014-06-22 14:27:01 +0000121 e.stopPropagation();
Nils Diewald2329e1d2014-06-12 16:07:57 +0000122});
123
Nils Diewald002e8fb2014-06-22 14:27:01 +0000124$("#search > ol > li:not(.active) > ul > li.close").on("click", function (e) {
125 $(this.parentNode.parentNode).removeClass('active');
126 e.stopPropagation();
127});
128
Nils Diewald2329e1d2014-06-12 16:07:57 +0000129
Nils Diewald33e15552014-06-13 19:38:37 +0000130function showTable (o) {
131 var match = o.parentNode.parentNode;
Nils Diewald1eba6572014-06-17 19:49:53 +0000132 var table = $(match).children("div").children("div.tokenInfo").first();
133
134 if (table.hasClass("active")) {
135 table.removeClass("active");
136 return;
137 }
138 else if (table.children("table").length > 0) {
139 table.addClass("active");
140 return;
141 };
142
Nils Diewald33e15552014-06-13 19:38:37 +0000143 var corpusID = match.getAttribute('data-corpus-id');
Nils Diewald002e8fb2014-06-22 14:27:01 +0000144 var docID = match.getAttribute('data-doc-id');
145 var matchID = match.getAttribute('data-match-id');
146 var url = '/corpus/' + corpusID + '/' + docID + '/' + matchID;
Nils Diewald1eba6572014-06-17 19:49:53 +0000147 var snippet;
148
149 jQuery.getJSON(url, function (res) {
150 var snippet = new SnippetTable(res['snippet']);
151 table.addClass("active");
152 table.append(snippet.toTable());
153 });
Nils Diewald33e15552014-06-13 19:38:37 +0000154};
155
Nils Diewald2329e1d2014-06-12 16:07:57 +0000156function openTutorial (o) {
157 var tut = $("#tutorial");
158 tut.slideDown();
159 var iframe = tut.children("iframe");
160 var src = iframe.attr("data-src");
161 iframe.attr("src", src);
162};
163
164function closeTutorial (o) {
165 $("#tutorial").slideUp();
166};
167
168function useQuery (o) {
169 var q = o.getAttribute("data-query");
170 var ql = o.getAttribute("data-query-language");
171 $("#ql-field").val(ql);
172 $("#q-field").val(q);
173 closeTutorial();
174};
175
Nils Diewald002e8fb2014-06-22 14:27:01 +0000176$("code.query.serial, #sidebar").on("click", function () {
Nils Diewald02df9912014-06-03 16:08:07 +0000177 $(this).toggleClass('active');
178});
Nils Diewald2329e1d2014-06-12 16:07:57 +0000179
Nils Diewald02df9912014-06-03 16:08:07 +0000180% end
181
Nils Diewald33e15552014-06-13 19:38:37 +0000182
Nils Diewald2329e1d2014-06-12 16:07:57 +0000183%= notifications 'Alertify'
Nils Diewald5d1ffb42014-05-21 17:45:34 +0000184 </body>
185</html>