Compare commits
2 Commits
0c03cb4b25
...
da5d97fbc2
Author | SHA1 | Date |
---|---|---|
Alex Kotov | da5d97fbc2 | |
Alex Kotov | e681533b0b |
47
bundle.js
47
bundle.js
|
@ -14,7 +14,10 @@ window.leqsikoni = {
|
|||
|
||||
$.getJSON(
|
||||
'http://localhost:4567/words/' + word_id,
|
||||
window.leqsikoni.words_xxxxx_template,
|
||||
function(data) {
|
||||
document.title = window.leqsikoni.maybe_text(data.primary_form) || ''
|
||||
$('#words-xxxxx').html(window.leqsikoni.words_xxxxx_template(data))
|
||||
},
|
||||
)
|
||||
},
|
||||
|
||||
|
@ -34,39 +37,29 @@ window.leqsikoni = {
|
|||
var examples =
|
||||
window.leqsikoni.words_xxxxx_examples_template(options.examples)
|
||||
|
||||
document.title = primary_form || ''
|
||||
var html = ''
|
||||
|
||||
$('#primary-form').text(primary_form || '')
|
||||
$('#part-of-speech').text(part_of_speech || '')
|
||||
$('#commentary-data').text(commentary || '')
|
||||
|
||||
$('#translations-data').html(translations || '')
|
||||
$('#inflections-data').html(inflections || '')
|
||||
$('#examples-data').html(examples || '')
|
||||
|
||||
if (commentary) {
|
||||
$('#commentary').removeClass('invisible')
|
||||
} else {
|
||||
$('#commentary').addClass('invisible')
|
||||
if (primary_form) {
|
||||
html += '<h1>' + primary_form + '</h1>'
|
||||
}
|
||||
if (part_of_speech) {
|
||||
html += '<p>' + part_of_speech + '</p>'
|
||||
}
|
||||
|
||||
if (translations) {
|
||||
$('#translations').removeClass('invisible')
|
||||
} else {
|
||||
$('#translations').addClass('invisible')
|
||||
html += '<div><h2>Значения</h2><div>' + translations + '</div></div>'
|
||||
}
|
||||
if (commentary) {
|
||||
html += '<div><h2>Комментарий</h2><p>' + commentary + '</p></div>'
|
||||
}
|
||||
|
||||
if (inflections) {
|
||||
$('#inflections').removeClass('invisible')
|
||||
} else {
|
||||
$('#inflections').addClass('invisible')
|
||||
html += '<div><h2>Inflectioons</h2><div>' + inflections + '</div></div>'
|
||||
}
|
||||
if (examples) {
|
||||
html +=
|
||||
'<div><h2>Примеры употребления</h2><div>' + examples + '</div></div>'
|
||||
}
|
||||
|
||||
if (examples) {
|
||||
$('#examples').removeClass('invisible')
|
||||
} else {
|
||||
$('#examples').addClass('invisible')
|
||||
}
|
||||
return html
|
||||
},
|
||||
|
||||
words_xxxxx_translations_template: function(translations) {
|
||||
|
|
|
@ -8,29 +8,6 @@
|
|||
<body>
|
||||
<div id="words-xxxxx"></div>
|
||||
|
||||
<h1 id="primary-form"></h1>
|
||||
<p id="part-of-speech"></p>
|
||||
|
||||
<div id="translations" class="invisible">
|
||||
<h2>Значения</h2>
|
||||
<div id="translations-data"></div>
|
||||
</div>
|
||||
|
||||
<div id="commentary" class="invisible">
|
||||
<h2>Комментарий</h2>
|
||||
<p id="commentary-data"></p>
|
||||
</div>
|
||||
|
||||
<div id="inflections" class="invisible">
|
||||
<h2>Inflections</h2>
|
||||
<div id="inflections-data"></div>
|
||||
</div>
|
||||
|
||||
<div id="examples" class="invisible">
|
||||
<h2>Примеры употребления</h2>
|
||||
<div id="examples-data"></div>
|
||||
</div>
|
||||
|
||||
<script
|
||||
src="https://code.jquery.com/jquery-3.6.3.min.js"
|
||||
integrity="sha256-pvPw+upLPUjgMXY0G+8O0xUf+/Im1MZjXxxgOcBQBXU="
|
||||
|
|
Loading…
Reference in New Issue