A semi-automatic parser of Ancient Greek and Latin languages.
https://lexis.glossa.info/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
110 lines
3.4 KiB
110 lines
3.4 KiB
{{ define "page" }} |
|
<!doctype html> |
|
<html lang="{{ .Lang }}"> |
|
<head> |
|
<meta charset="utf-8"> |
|
<meta http-equiv="x-ua-compatible" content="ie=edge"> |
|
<meta name="viewport" content="width=device-width, initial-scale=1"> |
|
|
|
<meta name="description" content="description"> |
|
|
|
<title>LEΞΙΣ | ΓΛΩΣΣΑ</title> |
|
|
|
<link rel="stylesheet" href="/assets/css/theme.css" type="text/css"> |
|
<link rel="stylesheet" href="/assets/css/style.css" type="text/css"> |
|
<link rel="stylesheet" href="/assets/css/glossa-ribbon.css" type="text/css"> |
|
<link rel="stylesheet" href="/assets/css/print.css" type="text/css" media="print" /> |
|
<link rel="icon" href="/assets/favicon.ico"> |
|
</head> |
|
|
|
<body> |
|
<div class="ribbon"><a href="https://glossa.info/" title="glossa.info">ΓΛΩΣΣΑ</a></div> |
|
|
|
<nav class="nav"> |
|
<div class="nav-container"> |
|
<a href="/{{ .Lang }}/"><h2 class="nav-title">LEΞΙΣ</h2></a> <sup class="app-version">ἄλφα</sup> |
|
<ul> |
|
<li><img class="img-flag" id="tr-ru" src="/assets/img/RUS.png" /></li> |
|
<li><img class="img-flag" id="tr-en" src="/assets/img/ENG.png" /></li> |
|
<li><a href="/{{ .Lang }}/about/">Τί ἐστιν;</a></li> |
|
</ul> |
|
</div> |
|
</nav> |
|
|
|
<main> |
|
<div id="content"> |
|
|
|
{{ if eq .Page "index" }} |
|
{{ template "index" . }} |
|
{{ end }} |
|
|
|
{{ if eq .Page "parse" }} |
|
{{ template "parse" . }} |
|
{{ end }} |
|
|
|
{{ if eq .Page "about" }} |
|
{{ template "about" . }} |
|
{{ end }} |
|
|
|
</div> <!-- content --> |
|
</main> |
|
|
|
<footer> |
|
<span>© <a href="https://glossa.info/" target="_blank">ΓΛΩΣΣΑ.info</a>, LEΞΙΣ, 2019</span> |
|
</footer> |
|
|
|
{{ if eq .Page "parse" }} |
|
<script type="text/javascript" src="/assets/js/lexis.js"></script> |
|
{{ end }} |
|
|
|
{{ if eq .Page "index" }} |
|
<script> |
|
function countWords(tx) { |
|
// return tx?tx.replace(/ +/g," ").replace(/\w+| $|^ /g,"").length + 1:0; |
|
return tx.match(/\S+/g).length; |
|
} |
|
|
|
document.addEventListener('DOMContentLoaded', function() { |
|
var textarea = document.getElementById("text"); |
|
|
|
document.getElementById("counter").textContent = countWords(textarea.value); |
|
|
|
textarea.addEventListener('keyup', function() { |
|
document.getElementById("counter").textContent = countWords(this.value); |
|
}); |
|
}); |
|
|
|
document.getElementById("clear-text").onclick = function() { |
|
document.getElementById("text").textContent = ""; |
|
}; |
|
</script> |
|
{{ end }} |
|
|
|
<script> |
|
function translate(lang) { |
|
path = window.location.pathname.split('/'); |
|
|
|
if (path.length >= 2) { |
|
// e.g. ru -> en |
|
path[1] = lang; |
|
|
|
localStorage.setItem("glossa.info.lexis.language", lang); |
|
|
|
window.location = path.join("/").replace(/\/?$/, '/') + window.location.search; |
|
} |
|
}; |
|
|
|
document.getElementById("tr-ru").onclick = function() { translate("ru"); }; |
|
document.getElementById("tr-en").onclick = function() { translate("en"); }; |
|
|
|
savedLanguage = localStorage.getItem("glossa.info.lexis.language"); |
|
currentLanguage = window.location.pathname.split('/')[1]; |
|
|
|
if (savedLanguage != null && savedLanguage != currentLanguage) { |
|
translate(savedLanguage); |
|
} |
|
</script> |
|
|
|
</body> |
|
</html> |
|
{{ end }}
|
|
|