blob: a14b0e0f4cfe747f4102fa7f1f57eb6f454ab6f4 [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 Diewald5d1ffb42014-05-21 17:45:34 +000010%= javascript '/jquery-2.0.0.min.js'
Nils Diewald1eba6572014-06-17 19:49:53 +000011%= javascript '/translateTable.js'
Nils Diewald44a72782014-06-20 16:03:21 +000012%= javascript '/hint.js'
Nils Diewald02df9912014-06-03 16:08:07 +000013<meta charset="utf-8" />
Nils Diewald5d1ffb42014-05-21 17:45:34 +000014 </head>
15 <body>
Nils Diewald2329e1d2014-06-12 16:07:57 +000016
Nils Diewaldb22abdf2014-06-18 22:57:50 +000017% unless (current_route 'tutorial') {
Nils Diewald2329e1d2014-06-12 16:07:57 +000018<div id="tutorial" style="display: none">
Nils Diewaldb22abdf2014-06-18 22:57:50 +000019 % my $tut_page = url_for(session('tutorial') || 'tutorial');
20 <a href="<%= $tut_page %>" target="_blank"><i title="Open in new tab" class="fa fa-external-link-square"></i></a>
21 <i onclick="closeTutorial()" title="close" class="fa fa-toggle-up"></i>
22 <iframe src="about:blank" data-src="<%= $tut_page->query([snippet => 1]) %>"></iframe>
Nils Diewald2329e1d2014-06-12 16:07:57 +000023</div>
Nils Diewaldb22abdf2014-06-18 22:57:50 +000024% };
Nils Diewald33e15552014-06-13 19:38:37 +000025
Nils Diewald02df9912014-06-03 16:08:07 +000026<div id="top">
Nils Diewaldb22abdf2014-06-18 22:57:50 +000027 <a href="<%= url_for 'index' %>"><h1><span>KorAP- Korpusanalyseplattform der nächsten Generation</span></h1></a>
Nils Diewald5d1ffb42014-05-21 17:45:34 +000028%= form_for url_for() => begin
Nils Diewald2329e1d2014-06-12 16:07:57 +000029%= select_field ql => [[Poliqarp => 'poliqarp'], ['Cosmas II' => 'cosmas2']], id => 'ql-field'
Nils Diewald02df9912014-06-03 16:08:07 +000030<br />
Nils Diewald44a72782014-06-20 16:03:21 +000031%= search_field 'q', id => 'q-field', autofocus => 'autofocus'
32%= javascript begin
33new Hint({
34 "ref" : "q-field",
35 "hintSize" : 10,
36 "hints" : {
37 "corenlp" : {
38 "ne_dewac_175m_600" : ["ne_dewac_175m_600=", "Named Entity"],
39 "ne_hgc_175m_600" : ["ne_hgc_175m_600=", "Named Entity"]
40 },
41 "corenlp/ne_dewac_175m_600" : ["I-LOC","I-MISC","I-ORG","I-PER"],
42 "corenlp/ne_hgc_175m_600" : ["I-LOC","I-MISC","I-ORG","I-PER"],
43 "cnx" : {
44 "c" : ["c=", "Constituency"],
45 "l" : ["l=", "Lemma"],
46 "m" : ["m=", "Morpho Syntax"],
47 "p" : ["p=", "Part of Speech"],
48 "syn" : ["syn=", "Syntax"]
49 },
50 "cnx/m" : ["Abbr","CMP","IMP","IND","INF","ORD","PAST","PCP","PERF","PL","PRES","PROG","Prop","SUB","SUP"],
51 "cnx/p" : ["A","ADV","CC","CS","DET","INTERJ","N","NUM","PREP","PRON","V"],
52 "cnx/syn" : ["@ADVL","@AUX","@CC","@MAIN","@NH","@POSTMOD","@PREMARK","@PREMOD"],
53 "opennlp" : {
54 "p" : ["p=", "Part of Speech"]
55 },
56 "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"],
57 "xip" : {
58 "c" : ["c=", "Constituency"],
59 "d" : ["d=", "Dependency"],
60 "l" : ["l=", "Lemma"],
61 "p" : ["p=", "Part of Speech"]
62 },
63 "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"],
64 "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"],
65 "xip/p" : ["ADJ","ADV","CONJ","DET","ITJ","NEGAT","NOUN","NUM","POSTP","PREP","PRON","PTCL","PUNCT","SYMBOL","TRUNC","VERB"],
66 "tt" : {
67 "l" : ["l=", "Lemma"],
68 "p" : ["p=", "Part of Speech"]
69 },
70 "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"],
71 "mate" : {
72 "d" : ["d=", "Dependency"],
73 "l" : ["l=", "Lemma"],
74 "m" : ["m=", "Morpho Syntax"],
75 "p" : ["p=", "Part of Speech"]
76 },
77 "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"],
78 "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"],
79 "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"]
80 }}
81);
82
83% end
Nils Diewald02df9912014-06-03 16:08:07 +000084<button type="submit" name="action" value="ok"><i class="fa fa-search"></i></button>
85<button type="submit" name="action" value="inspect"><i class="fa fa-code"></i></button>
Nils Diewald5d1ffb42014-05-21 17:45:34 +000086% end
Nils Diewald02df9912014-06-03 16:08:07 +000087
Nils Diewald02df9912014-06-03 16:08:07 +000088<div id="button-right">
Nils Diewald2329e1d2014-06-12 16:07:57 +000089% if (param('q')) {
Nils Diewald02df9912014-06-03 16:08:07 +000090<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 +000091% }
Nils Diewaldb22abdf2014-06-18 22:57:50 +000092% unless (current_route 'tutorial') {
Nils Diewald2329e1d2014-06-12 16:07:57 +000093<button type="button" onclick="openTutorial()"><i class="fa fa-graduation-cap"></i></button>
Nils Diewaldb22abdf2014-06-18 22:57:50 +000094% };
Nils Diewald2329e1d2014-06-12 16:07:57 +000095</div>
Nils Diewald02df9912014-06-03 16:08:07 +000096
97</div>
98
99<div id="sidebar" style="padding-top: 90px">
Nils Diewald2329e1d2014-06-12 16:07:57 +0000100%= include 'collections'
Nils Diewald02df9912014-06-03 16:08:07 +0000101</div>
102
103<div id="search">
Nils Diewald5d1ffb42014-05-21 17:45:34 +0000104%= content
Nils Diewald02df9912014-06-03 16:08:07 +0000105</div>
106
107%= javascript begin
Nils Diewald2329e1d2014-06-12 16:07:57 +0000108
109$("ol > li:not(.active)").on("click", function () {
110 $(this).addClass('active');
111});
112
113function closeSnippet (o) {
114 $(o.parentNode.parentNode).removeClass('active');
115};
116
Nils Diewald33e15552014-06-13 19:38:37 +0000117function showTable (o) {
118 var match = o.parentNode.parentNode;
Nils Diewald1eba6572014-06-17 19:49:53 +0000119 var table = $(match).children("div").children("div.tokenInfo").first();
120
121 if (table.hasClass("active")) {
122 table.removeClass("active");
123 return;
124 }
125 else if (table.children("table").length > 0) {
126 table.addClass("active");
127 return;
128 };
129
Nils Diewald33e15552014-06-13 19:38:37 +0000130 var corpusID = match.getAttribute('data-corpus-id');
131 var docID = match.getAttribute('data-doc-id');
132 var matchID = match.getAttribute('data-match-id');
Nils Diewald1eba6572014-06-17 19:49:53 +0000133 var url = '/corpus/' + corpusID + '/' + docID + '/' + matchID;
134 var snippet;
135
136 jQuery.getJSON(url, function (res) {
137 var snippet = new SnippetTable(res['snippet']);
138 table.addClass("active");
139 table.append(snippet.toTable());
140 });
Nils Diewald33e15552014-06-13 19:38:37 +0000141};
142
Nils Diewald2329e1d2014-06-12 16:07:57 +0000143function openTutorial (o) {
144 var tut = $("#tutorial");
145 tut.slideDown();
146 var iframe = tut.children("iframe");
147 var src = iframe.attr("data-src");
148 iframe.attr("src", src);
149};
150
151function closeTutorial (o) {
152 $("#tutorial").slideUp();
153};
154
155function useQuery (o) {
156 var q = o.getAttribute("data-query");
157 var ql = o.getAttribute("data-query-language");
158 $("#ql-field").val(ql);
159 $("#q-field").val(q);
160 closeTutorial();
161};
162
Nils Diewald2329e1d2014-06-12 16:07:57 +0000163$("code.query.serial,#sidebar").on("click", function () {
Nils Diewald02df9912014-06-03 16:08:07 +0000164 $(this).toggleClass('active');
165});
Nils Diewald2329e1d2014-06-12 16:07:57 +0000166
167
Nils Diewald02df9912014-06-03 16:08:07 +0000168% end
169
Nils Diewald33e15552014-06-13 19:38:37 +0000170
Nils Diewald2329e1d2014-06-12 16:07:57 +0000171%= notifications 'Alertify'
Nils Diewald5d1ffb42014-05-21 17:45:34 +0000172 </body>
173</html>