Nils Diewald | 5d1ffb4 | 2014-05-21 17:45:34 +0000 | [diff] [blame] | 1 | <!DOCTYPE html> |
| 2 | <html> |
| 3 | <head> |
| 4 | <title><%= title %></title> |
| 5 | %= stylesheet '/style.css' |
Nils Diewald | 44a7278 | 2014-06-20 16:03:21 +0000 | [diff] [blame] | 6 | %= stylesheet '/hint.css' |
Nils Diewald | 1eba657 | 2014-06-17 19:49:53 +0000 | [diff] [blame] | 7 | %= stylesheet '/table.css' |
Nils Diewald | 33e1555 | 2014-06-13 19:38:37 +0000 | [diff] [blame] | 8 | %= stylesheet '/kwic-4.0.css' |
Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 9 | %= stylesheet '/fontawesome/font-awesome.min.css' |
Nils Diewald | 5d1ffb4 | 2014-05-21 17:45:34 +0000 | [diff] [blame] | 10 | %= javascript '/jquery-2.0.0.min.js' |
Nils Diewald | 1eba657 | 2014-06-17 19:49:53 +0000 | [diff] [blame] | 11 | %= javascript '/translateTable.js' |
Nils Diewald | 44a7278 | 2014-06-20 16:03:21 +0000 | [diff] [blame] | 12 | %= javascript '/hint.js' |
Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 13 | <meta charset="utf-8" /> |
Nils Diewald | 5d1ffb4 | 2014-05-21 17:45:34 +0000 | [diff] [blame] | 14 | </head> |
| 15 | <body> |
Nils Diewald | 2329e1d | 2014-06-12 16:07:57 +0000 | [diff] [blame] | 16 | |
Nils Diewald | b22abdf | 2014-06-18 22:57:50 +0000 | [diff] [blame] | 17 | % unless (current_route 'tutorial') { |
Nils Diewald | 2329e1d | 2014-06-12 16:07:57 +0000 | [diff] [blame] | 18 | <div id="tutorial" style="display: none"> |
Nils Diewald | b22abdf | 2014-06-18 22:57:50 +0000 | [diff] [blame] | 19 | % 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 Diewald | 2329e1d | 2014-06-12 16:07:57 +0000 | [diff] [blame] | 23 | </div> |
Nils Diewald | b22abdf | 2014-06-18 22:57:50 +0000 | [diff] [blame] | 24 | % }; |
Nils Diewald | 33e1555 | 2014-06-13 19:38:37 +0000 | [diff] [blame] | 25 | |
Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 26 | <div id="top"> |
Nils Diewald | b22abdf | 2014-06-18 22:57:50 +0000 | [diff] [blame] | 27 | <a href="<%= url_for 'index' %>"><h1><span>KorAP- Korpusanalyseplattform der nächsten Generation</span></h1></a> |
Nils Diewald | 5d1ffb4 | 2014-05-21 17:45:34 +0000 | [diff] [blame] | 28 | %= form_for url_for() => begin |
Nils Diewald | 2329e1d | 2014-06-12 16:07:57 +0000 | [diff] [blame] | 29 | %= select_field ql => [[Poliqarp => 'poliqarp'], ['Cosmas II' => 'cosmas2']], id => 'ql-field' |
Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 30 | <br /> |
Nils Diewald | 44a7278 | 2014-06-20 16:03:21 +0000 | [diff] [blame] | 31 | %= search_field 'q', id => 'q-field', autofocus => 'autofocus' |
| 32 | %= javascript begin |
| 33 | new Hint({ |
| 34 | "ref" : "q-field", |
Nils Diewald | 465c425 | 2014-06-20 21:51:58 +0000 | [diff] [blame] | 35 | "qlRef" : "ql-field", |
Nils Diewald | 44a7278 | 2014-06-20 16:03:21 +0000 | [diff] [blame] | 36 | "hintSize" : 10, |
| 37 | "hints" : { |
Nils Diewald | 465c425 | 2014-06-20 21:51:58 +0000 | [diff] [blame] | 38 | "-foundries" : { |
| 39 | "corenlp" : ["corenlp/", "CoreNLP"], |
| 40 | "cnx" : ["cnx/", "Connexor"], |
| 41 | "opennlp" : ["opennlp/", "OpenNLP"], |
| 42 | "xip" : ["xip/", "Xerox"], |
| 43 | "tt" : ["tt/", "TreeTagger"], |
| 44 | "mate" : ["mate/", "Mate"] |
| 45 | }, |
Nils Diewald | 44a7278 | 2014-06-20 16:03:21 +0000 | [diff] [blame] | 46 | "corenlp" : { |
| 47 | "ne_dewac_175m_600" : ["ne_dewac_175m_600=", "Named Entity"], |
| 48 | "ne_hgc_175m_600" : ["ne_hgc_175m_600=", "Named Entity"] |
| 49 | }, |
| 50 | "corenlp/ne_dewac_175m_600" : ["I-LOC","I-MISC","I-ORG","I-PER"], |
| 51 | "corenlp/ne_hgc_175m_600" : ["I-LOC","I-MISC","I-ORG","I-PER"], |
| 52 | "cnx" : { |
| 53 | "c" : ["c=", "Constituency"], |
| 54 | "l" : ["l=", "Lemma"], |
| 55 | "m" : ["m=", "Morpho Syntax"], |
| 56 | "p" : ["p=", "Part of Speech"], |
| 57 | "syn" : ["syn=", "Syntax"] |
| 58 | }, |
| 59 | "cnx/m" : ["Abbr","CMP","IMP","IND","INF","ORD","PAST","PCP","PERF","PL","PRES","PROG","Prop","SUB","SUP"], |
| 60 | "cnx/p" : ["A","ADV","CC","CS","DET","INTERJ","N","NUM","PREP","PRON","V"], |
| 61 | "cnx/syn" : ["@ADVL","@AUX","@CC","@MAIN","@NH","@POSTMOD","@PREMARK","@PREMOD"], |
| 62 | "opennlp" : { |
| 63 | "p" : ["p=", "Part of Speech"] |
| 64 | }, |
| 65 | "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"], |
| 66 | "xip" : { |
| 67 | "c" : ["c=", "Constituency"], |
| 68 | "d" : ["d=", "Dependency"], |
| 69 | "l" : ["l=", "Lemma"], |
| 70 | "p" : ["p=", "Part of Speech"] |
| 71 | }, |
| 72 | "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"], |
| 73 | "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"], |
| 74 | "xip/p" : ["ADJ","ADV","CONJ","DET","ITJ","NEGAT","NOUN","NUM","POSTP","PREP","PRON","PTCL","PUNCT","SYMBOL","TRUNC","VERB"], |
| 75 | "tt" : { |
| 76 | "l" : ["l=", "Lemma"], |
| 77 | "p" : ["p=", "Part of Speech"] |
| 78 | }, |
| 79 | "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"], |
| 80 | "mate" : { |
| 81 | "d" : ["d=", "Dependency"], |
| 82 | "l" : ["l=", "Lemma"], |
| 83 | "m" : ["m=", "Morpho Syntax"], |
| 84 | "p" : ["p=", "Part of Speech"] |
| 85 | }, |
| 86 | "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"], |
| 87 | "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"], |
| 88 | "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"] |
| 89 | }} |
| 90 | ); |
| 91 | |
| 92 | % end |
Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 93 | <button type="submit" name="action" value="ok"><i class="fa fa-search"></i></button> |
| 94 | <button type="submit" name="action" value="inspect"><i class="fa fa-code"></i></button> |
Nils Diewald | 5d1ffb4 | 2014-05-21 17:45:34 +0000 | [diff] [blame] | 95 | % end |
Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 96 | |
Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 97 | <div id="button-right"> |
Nils Diewald | 2329e1d | 2014-06-12 16:07:57 +0000 | [diff] [blame] | 98 | % if (param('q')) { |
Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 99 | <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 Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 100 | % } |
Nils Diewald | b22abdf | 2014-06-18 22:57:50 +0000 | [diff] [blame] | 101 | % unless (current_route 'tutorial') { |
Nils Diewald | 2329e1d | 2014-06-12 16:07:57 +0000 | [diff] [blame] | 102 | <button type="button" onclick="openTutorial()"><i class="fa fa-graduation-cap"></i></button> |
Nils Diewald | b22abdf | 2014-06-18 22:57:50 +0000 | [diff] [blame] | 103 | % }; |
Nils Diewald | 2329e1d | 2014-06-12 16:07:57 +0000 | [diff] [blame] | 104 | </div> |
Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 105 | |
| 106 | </div> |
| 107 | |
| 108 | <div id="sidebar" style="padding-top: 90px"> |
Nils Diewald | 2329e1d | 2014-06-12 16:07:57 +0000 | [diff] [blame] | 109 | %= include 'collections' |
Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 110 | </div> |
| 111 | |
| 112 | <div id="search"> |
Nils Diewald | 5d1ffb4 | 2014-05-21 17:45:34 +0000 | [diff] [blame] | 113 | %= content |
Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 114 | </div> |
| 115 | |
| 116 | %= javascript begin |
Nils Diewald | 2329e1d | 2014-06-12 16:07:57 +0000 | [diff] [blame] | 117 | |
Nils Diewald | 002e8fb | 2014-06-22 14:27:01 +0000 | [diff] [blame^] | 118 | $("#search > ol > li:not(.active)").on("click", function (e) { |
Nils Diewald | 2329e1d | 2014-06-12 16:07:57 +0000 | [diff] [blame] | 119 | $(this).addClass('active'); |
Nils Diewald | 002e8fb | 2014-06-22 14:27:01 +0000 | [diff] [blame^] | 120 | e.stopPropagation(); |
Nils Diewald | 2329e1d | 2014-06-12 16:07:57 +0000 | [diff] [blame] | 121 | }); |
| 122 | |
Nils Diewald | 002e8fb | 2014-06-22 14:27:01 +0000 | [diff] [blame^] | 123 | $("#search > ol > li:not(.active) > ul > li.close").on("click", function (e) { |
| 124 | $(this.parentNode.parentNode).removeClass('active'); |
| 125 | e.stopPropagation(); |
| 126 | }); |
| 127 | |
Nils Diewald | 2329e1d | 2014-06-12 16:07:57 +0000 | [diff] [blame] | 128 | |
Nils Diewald | 33e1555 | 2014-06-13 19:38:37 +0000 | [diff] [blame] | 129 | function showTable (o) { |
| 130 | var match = o.parentNode.parentNode; |
Nils Diewald | 1eba657 | 2014-06-17 19:49:53 +0000 | [diff] [blame] | 131 | var table = $(match).children("div").children("div.tokenInfo").first(); |
| 132 | |
| 133 | if (table.hasClass("active")) { |
| 134 | table.removeClass("active"); |
| 135 | return; |
| 136 | } |
| 137 | else if (table.children("table").length > 0) { |
| 138 | table.addClass("active"); |
| 139 | return; |
| 140 | }; |
| 141 | |
Nils Diewald | 33e1555 | 2014-06-13 19:38:37 +0000 | [diff] [blame] | 142 | var corpusID = match.getAttribute('data-corpus-id'); |
Nils Diewald | 002e8fb | 2014-06-22 14:27:01 +0000 | [diff] [blame^] | 143 | var docID = match.getAttribute('data-doc-id'); |
| 144 | var matchID = match.getAttribute('data-match-id'); |
| 145 | var url = '/corpus/' + corpusID + '/' + docID + '/' + matchID; |
Nils Diewald | 1eba657 | 2014-06-17 19:49:53 +0000 | [diff] [blame] | 146 | var snippet; |
| 147 | |
| 148 | jQuery.getJSON(url, function (res) { |
| 149 | var snippet = new SnippetTable(res['snippet']); |
| 150 | table.addClass("active"); |
| 151 | table.append(snippet.toTable()); |
| 152 | }); |
Nils Diewald | 33e1555 | 2014-06-13 19:38:37 +0000 | [diff] [blame] | 153 | }; |
| 154 | |
Nils Diewald | 2329e1d | 2014-06-12 16:07:57 +0000 | [diff] [blame] | 155 | function openTutorial (o) { |
| 156 | var tut = $("#tutorial"); |
| 157 | tut.slideDown(); |
| 158 | var iframe = tut.children("iframe"); |
| 159 | var src = iframe.attr("data-src"); |
| 160 | iframe.attr("src", src); |
| 161 | }; |
| 162 | |
| 163 | function closeTutorial (o) { |
| 164 | $("#tutorial").slideUp(); |
| 165 | }; |
| 166 | |
| 167 | function useQuery (o) { |
| 168 | var q = o.getAttribute("data-query"); |
| 169 | var ql = o.getAttribute("data-query-language"); |
| 170 | $("#ql-field").val(ql); |
| 171 | $("#q-field").val(q); |
| 172 | closeTutorial(); |
| 173 | }; |
| 174 | |
Nils Diewald | 002e8fb | 2014-06-22 14:27:01 +0000 | [diff] [blame^] | 175 | $("code.query.serial, #sidebar").on("click", function () { |
Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 176 | $(this).toggleClass('active'); |
| 177 | }); |
Nils Diewald | 2329e1d | 2014-06-12 16:07:57 +0000 | [diff] [blame] | 178 | |
Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 179 | % end |
| 180 | |
Nils Diewald | 33e1555 | 2014-06-13 19:38:37 +0000 | [diff] [blame] | 181 | |
Nils Diewald | 2329e1d | 2014-06-12 16:07:57 +0000 | [diff] [blame] | 182 | %= notifications 'Alertify' |
Nils Diewald | 5d1ffb4 | 2014-05-21 17:45:34 +0000 | [diff] [blame] | 183 | </body> |
| 184 | </html> |