From 6734d131e5eb88bffe1632f455bae92bc5691742 Mon Sep 17 00:00:00 2001 From: Alex Kotov Date: Sat, 18 Feb 2023 12:12:33 +0400 Subject: [PATCH] Part of speech & conditional examples --- bundle.css | 1 + bundle.js | 16 ++++++++++++---- words/არის.html | 11 ++++++++--- words/აქვს.html | 11 ++++++++--- words/ყავს.html | 11 ++++++++--- 5 files changed, 37 insertions(+), 13 deletions(-) diff --git a/bundle.css b/bundle.css index aceb722..49f62c3 100644 --- a/bundle.css +++ b/bundle.css @@ -1,3 +1,4 @@ +.invisible { display: none } .morpheme-root { color: #dd0000; } .api-frame { diff --git a/bundle.js b/bundle.js index 24e6507..664f282 100644 --- a/bundle.js +++ b/bundle.js @@ -1,13 +1,21 @@ $(function() { - $('#examples').each(function(index, elem) { + $('#word').each(function(index, elem) { $.getJSON( 'http://ksenia.causa-arcana.com/api/words/' + $(elem).data('id'), function(data) { - var list_items = [] + var part_of_speech = data['part_of_speech'] + + var examples = [] data['examples'].forEach(function(item) { - list_items.push('
  • ' + item[0] + ' — ' + item[1] + '
  • ') + examples.push('
  • ' + item[0] + ' — ' + item[1] + '
  • ') }) - $(elem).html('') + + $('#part-of-speech').text(part_of_speech) + + if (examples.length > 0) { + $('#examples-data').html('') + $('#examples').removeClass('invisible') + } }, ) }) diff --git a/words/არის.html b/words/არის.html index 80365dc..691f5b9 100644 --- a/words/არის.html +++ b/words/არის.html @@ -6,8 +6,12 @@ +
    +

    არის

    +

    +

    быть

    Используется с существительным в именительном падеже или с @@ -42,9 +46,10 @@ -

    Примеры употребления

    - -
    +