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 | 1eba657 | 2014-06-17 19:49:53 +0000 | [diff] [blame] | 6 | %= stylesheet '/table.css' |
Nils Diewald | 33e1555 | 2014-06-13 19:38:37 +0000 | [diff] [blame] | 7 | %= stylesheet '/kwic-4.0.css' |
Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 8 | %= stylesheet '/fontawesome/font-awesome.min.css' |
Nils Diewald | 5d1ffb4 | 2014-05-21 17:45:34 +0000 | [diff] [blame] | 9 | %= javascript '/jquery-2.0.0.min.js' |
Nils Diewald | 1eba657 | 2014-06-17 19:49:53 +0000 | [diff] [blame] | 10 | %= javascript '/translateTable.js' |
Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 11 | <meta charset="utf-8" /> |
Nils Diewald | 5d1ffb4 | 2014-05-21 17:45:34 +0000 | [diff] [blame] | 12 | </head> |
| 13 | <body> |
Nils Diewald | 2329e1d | 2014-06-12 16:07:57 +0000 | [diff] [blame] | 14 | |
| 15 | <div id="tutorial" style="display: none"> |
| 16 | <i onclick="closeTutorial()" class="fa fa-toggle-up"></i> |
Nils Diewald | 33e1555 | 2014-06-13 19:38:37 +0000 | [diff] [blame] | 17 | <iframe src="about:blank" data-src="<%= url_for(session('tutorial') || 'tutorial') %>"></iframe> |
Nils Diewald | 2329e1d | 2014-06-12 16:07:57 +0000 | [diff] [blame] | 18 | </div> |
Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 19 | |
Nils Diewald | 33e1555 | 2014-06-13 19:38:37 +0000 | [diff] [blame] | 20 | |
Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 21 | <div id="top"> |
Nils Diewald | 33e1555 | 2014-06-13 19:38:37 +0000 | [diff] [blame] | 22 | <h1><span>KorAP- Korpusanalyseplattform der nächsten Generation</span></h1> |
Nils Diewald | 5d1ffb4 | 2014-05-21 17:45:34 +0000 | [diff] [blame] | 23 | %= form_for url_for() => begin |
Nils Diewald | 2329e1d | 2014-06-12 16:07:57 +0000 | [diff] [blame] | 24 | %= select_field ql => [[Poliqarp => 'poliqarp'], ['Cosmas II' => 'cosmas2']], id => 'ql-field' |
Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 25 | <br /> |
Nils Diewald | 2329e1d | 2014-06-12 16:07:57 +0000 | [diff] [blame] | 26 | %= search_field 'q', id => 'q-field' |
Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 27 | <button type="submit" name="action" value="ok"><i class="fa fa-search"></i></button> |
| 28 | <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] | 29 | % end |
Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 30 | |
Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 31 | <div id="button-right"> |
Nils Diewald | 2329e1d | 2014-06-12 16:07:57 +0000 | [diff] [blame] | 32 | % if (param('q')) { |
Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 33 | <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] | 34 | % } |
Nils Diewald | 2329e1d | 2014-06-12 16:07:57 +0000 | [diff] [blame] | 35 | <button type="button" onclick="openTutorial()"><i class="fa fa-graduation-cap"></i></button> |
| 36 | </div> |
Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 37 | |
| 38 | </div> |
| 39 | |
| 40 | <div id="sidebar" style="padding-top: 90px"> |
Nils Diewald | 2329e1d | 2014-06-12 16:07:57 +0000 | [diff] [blame] | 41 | %= include 'collections' |
Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 42 | </div> |
| 43 | |
| 44 | <div id="search"> |
Nils Diewald | 5d1ffb4 | 2014-05-21 17:45:34 +0000 | [diff] [blame] | 45 | %= content |
Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 46 | </div> |
| 47 | |
| 48 | %= javascript begin |
Nils Diewald | 2329e1d | 2014-06-12 16:07:57 +0000 | [diff] [blame] | 49 | |
| 50 | $("ol > li:not(.active)").on("click", function () { |
| 51 | $(this).addClass('active'); |
| 52 | }); |
| 53 | |
| 54 | function closeSnippet (o) { |
| 55 | $(o.parentNode.parentNode).removeClass('active'); |
| 56 | }; |
| 57 | |
Nils Diewald | 33e1555 | 2014-06-13 19:38:37 +0000 | [diff] [blame] | 58 | function showTable (o) { |
| 59 | var match = o.parentNode.parentNode; |
Nils Diewald | 1eba657 | 2014-06-17 19:49:53 +0000 | [diff] [blame] | 60 | var table = $(match).children("div").children("div.tokenInfo").first(); |
| 61 | |
| 62 | if (table.hasClass("active")) { |
| 63 | table.removeClass("active"); |
| 64 | return; |
| 65 | } |
| 66 | else if (table.children("table").length > 0) { |
| 67 | table.addClass("active"); |
| 68 | return; |
| 69 | }; |
| 70 | |
Nils Diewald | 33e1555 | 2014-06-13 19:38:37 +0000 | [diff] [blame] | 71 | var corpusID = match.getAttribute('data-corpus-id'); |
| 72 | var docID = match.getAttribute('data-doc-id'); |
| 73 | var matchID = match.getAttribute('data-match-id'); |
Nils Diewald | 1eba657 | 2014-06-17 19:49:53 +0000 | [diff] [blame] | 74 | var url = '/corpus/' + corpusID + '/' + docID + '/' + matchID; |
| 75 | var snippet; |
| 76 | |
| 77 | jQuery.getJSON(url, function (res) { |
| 78 | var snippet = new SnippetTable(res['snippet']); |
| 79 | table.addClass("active"); |
| 80 | table.append(snippet.toTable()); |
| 81 | }); |
Nils Diewald | 33e1555 | 2014-06-13 19:38:37 +0000 | [diff] [blame] | 82 | }; |
| 83 | |
Nils Diewald | 2329e1d | 2014-06-12 16:07:57 +0000 | [diff] [blame] | 84 | function openTutorial (o) { |
| 85 | var tut = $("#tutorial"); |
| 86 | tut.slideDown(); |
| 87 | var iframe = tut.children("iframe"); |
| 88 | var src = iframe.attr("data-src"); |
| 89 | iframe.attr("src", src); |
| 90 | }; |
| 91 | |
| 92 | function closeTutorial (o) { |
| 93 | $("#tutorial").slideUp(); |
| 94 | }; |
| 95 | |
| 96 | function useQuery (o) { |
| 97 | var q = o.getAttribute("data-query"); |
| 98 | var ql = o.getAttribute("data-query-language"); |
| 99 | $("#ql-field").val(ql); |
| 100 | $("#q-field").val(q); |
| 101 | closeTutorial(); |
| 102 | }; |
| 103 | |
Nils Diewald | 2329e1d | 2014-06-12 16:07:57 +0000 | [diff] [blame] | 104 | $("code.query.serial,#sidebar").on("click", function () { |
Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 105 | $(this).toggleClass('active'); |
| 106 | }); |
Nils Diewald | 2329e1d | 2014-06-12 16:07:57 +0000 | [diff] [blame] | 107 | |
| 108 | |
Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 109 | % end |
| 110 | |
Nils Diewald | 33e1555 | 2014-06-13 19:38:37 +0000 | [diff] [blame] | 111 | |
Nils Diewald | 2329e1d | 2014-06-12 16:07:57 +0000 | [diff] [blame] | 112 | %= notifications 'Alertify' |
Nils Diewald | 5d1ffb4 | 2014-05-21 17:45:34 +0000 | [diff] [blame] | 113 | </body> |
| 114 | </html> |