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' |
| 6 | %= stylesheet '/kwic-3.0.css' |
Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 7 | %= stylesheet '/fontawesome/font-awesome.min.css' |
Nils Diewald | 5d1ffb4 | 2014-05-21 17:45:34 +0000 | [diff] [blame] | 8 | %= javascript '/jquery-2.0.0.min.js' |
Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 9 | <meta charset="utf-8" /> |
Nils Diewald | 5d1ffb4 | 2014-05-21 17:45:34 +0000 | [diff] [blame] | 10 | </head> |
| 11 | <body> |
Nils Diewald | 2329e1d | 2014-06-12 16:07:57 +0000 | [diff] [blame^] | 12 | |
| 13 | <div id="tutorial" style="display: none"> |
| 14 | <i onclick="closeTutorial()" class="fa fa-toggle-up"></i> |
| 15 | <iframe src="about:blank" data-src="<%= url_for(session('tutorial') // 'tutorial') %>"></iframe> |
| 16 | </div> |
Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 17 | |
| 18 | <div id="top"> |
Nils Diewald | 2329e1d | 2014-06-12 16:07:57 +0000 | [diff] [blame^] | 19 | %#= image '/img/korap-logo.svg', style => 'position: absolute; z-index: 999' |
| 20 | %= image '/img/korap-logo-solo.svg', style => 'position: absolute; z-index: 999' |
Nils Diewald | 5d1ffb4 | 2014-05-21 17:45:34 +0000 | [diff] [blame] | 21 | %= form_for url_for() => begin |
Nils Diewald | 2329e1d | 2014-06-12 16:07:57 +0000 | [diff] [blame^] | 22 | %= select_field ql => [[Poliqarp => 'poliqarp'], ['Cosmas II' => 'cosmas2']], id => 'ql-field' |
Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 23 | <br /> |
Nils Diewald | 2329e1d | 2014-06-12 16:07:57 +0000 | [diff] [blame^] | 24 | %= search_field 'q', id => 'q-field' |
Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 25 | <button type="submit" name="action" value="ok"><i class="fa fa-search"></i></button> |
| 26 | <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] | 27 | % end |
Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 28 | |
Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 29 | <div id="button-right"> |
Nils Diewald | 2329e1d | 2014-06-12 16:07:57 +0000 | [diff] [blame^] | 30 | % if (param('q')) { |
Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 31 | <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] | 32 | % } |
Nils Diewald | 2329e1d | 2014-06-12 16:07:57 +0000 | [diff] [blame^] | 33 | <button type="button" onclick="openTutorial()"><i class="fa fa-graduation-cap"></i></button> |
| 34 | </div> |
Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 35 | |
| 36 | </div> |
| 37 | |
| 38 | <div id="sidebar" style="padding-top: 90px"> |
Nils Diewald | 2329e1d | 2014-06-12 16:07:57 +0000 | [diff] [blame^] | 39 | %= include 'collections' |
Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 40 | </div> |
| 41 | |
| 42 | <div id="search"> |
Nils Diewald | 5d1ffb4 | 2014-05-21 17:45:34 +0000 | [diff] [blame] | 43 | %= content |
Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 44 | </div> |
| 45 | |
| 46 | %= javascript begin |
Nils Diewald | 2329e1d | 2014-06-12 16:07:57 +0000 | [diff] [blame^] | 47 | |
| 48 | $("ol > li:not(.active)").on("click", function () { |
| 49 | $(this).addClass('active'); |
| 50 | }); |
| 51 | |
| 52 | function closeSnippet (o) { |
| 53 | $(o.parentNode.parentNode).removeClass('active'); |
| 54 | }; |
| 55 | |
| 56 | function openTutorial (o) { |
| 57 | var tut = $("#tutorial"); |
| 58 | tut.slideDown(); |
| 59 | var iframe = tut.children("iframe"); |
| 60 | var src = iframe.attr("data-src"); |
| 61 | iframe.attr("src", src); |
| 62 | }; |
| 63 | |
| 64 | function closeTutorial (o) { |
| 65 | $("#tutorial").slideUp(); |
| 66 | }; |
| 67 | |
| 68 | function useQuery (o) { |
| 69 | var q = o.getAttribute("data-query"); |
| 70 | var ql = o.getAttribute("data-query-language"); |
| 71 | $("#ql-field").val(ql); |
| 72 | $("#q-field").val(q); |
| 73 | closeTutorial(); |
| 74 | }; |
| 75 | |
| 76 | /* |
| 77 | function requestInfo |
| 78 | */ |
| 79 | |
| 80 | $("code.query.serial,#sidebar").on("click", function () { |
Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 81 | $(this).toggleClass('active'); |
| 82 | }); |
Nils Diewald | 2329e1d | 2014-06-12 16:07:57 +0000 | [diff] [blame^] | 83 | |
| 84 | |
Nils Diewald | 02df991 | 2014-06-03 16:08:07 +0000 | [diff] [blame] | 85 | % end |
| 86 | |
Nils Diewald | 2329e1d | 2014-06-12 16:07:57 +0000 | [diff] [blame^] | 87 | %= notifications 'Alertify' |
Nils Diewald | 5d1ffb4 | 2014-05-21 17:45:34 +0000 | [diff] [blame] | 88 | </body> |
| 89 | </html> |