commit 5f2bde6dbb84ae16bce0c0416bd30e7b170fbd82
Author: Anděl Ondřej <ondrej.andel@marbes.cz>
Date:   Thu Apr 29 23:00:33 2021 +0200

    Enhancement #8764: Morfem tooltip

diff --git a/application/view/contents/searchContent.php b/application/view/contents/searchContent.php
index 279e7bd..1f9c717 100644
--- a/application/view/contents/searchContent.php
+++ b/application/view/contents/searchContent.php
@@ -328,7 +328,7 @@
                         <?php }?>
                         result += "<td>" + item.lemma.lemma + "</td>";
                         result += "<td>" + item.word + "</td>";
-                        result += "<td>" + item.tag.tag + "</td>";
+                        result += "<td>" + renderTag(item.tag.tag) + "</td>";
                         result += "<td>" + renderManuscript(item.manuscript) + "</td>";
                         result += "<td>" + item.position1 + (item.position2 ? ("/" + item.position2 + (item.positiondetail ? "/"  + item.positiondetail :  "")) : "")  + "</td>";
                         result += "<td>" + ((item.description2 !== null) ? item.description2 : "-") + "</td>";
diff --git a/application/view/js-scripts/convertors.js b/application/view/js-scripts/convertors.js
index 21ffeba..e6db349 100644
--- a/application/view/js-scripts/convertors.js
+++ b/application/view/js-scripts/convertors.js
@@ -172,5 +172,40 @@ function renderManuscript(manuscripts, shorten=true) {
                 output += "; ";
         }
     }
+    return output;
+}
+
+function renderTag(tag) {
+    let output = "";
+
+    output += ((codeToWordclass.hasOwnProperty(tag[0])) ? ("<span title=\"" + codeToWordclass[tag[0]] + "\">" + tag[0] + "</span>") : ("<span>" + tag[0] + "</span>"));
+    output += ((codeToCase.hasOwnProperty(tag[1])) ? ("<span title=\"" + codeToCase[tag[1]] + "\">" + tag[1] + "</span>") : ("<span>" + tag[1] + "</span>"));
+    output += ((codeToCountability.hasOwnProperty(tag[2])) ? ("<span title=\"" + codeToCountability[tag[2]] + "\">" + tag[2] + "</span>") : ("<span>" + tag[2] + "</span>"));
+    output += ((codeToGender.hasOwnProperty(tag[3])) ? ("<span title=\"" + codeToGender[tag[3]] + "\">" + tag[3] + "</span>") : ("<span>" + tag[3] + "</span>"));
+    output += ((codeToGrade.hasOwnProperty(tag[4])) ? ("<span title=\"" + codeToGrade[tag[4]] + "\">" + tag[4] + "</span>") : ("<span>" + tag[4] + "</span>"));
+    output += ((codeToShape.hasOwnProperty(tag[5])) ? ("<span title=\"" + codeToShape[tag[5]] + "\">" + tag[5] + "</span>") : ("<span>" + tag[5] + "</span>"));
+    output += ("<span>" + tag[6] + "</span>");
+
+    if(tag[0] === "P"){
+        output += ((codeToType.hasOwnProperty(tag[7])) ? ("<span title=\""+ codeToType[tag[7]] +"\">" + tag[7] + "</span>") : ("<span>" + tag[7] + "</span>"));
+    } else if(tag[0] === "V"){
+        if(codeToMood.hasOwnProperty(tag[7])){
+            output += ("<span title=\""+ codeToMood[tag[7]] +"\">" + tag[7] + "</span>");
+        } else if(codeToIrregular.hasOwnProperty(tag[7])){
+            output += ("<span title=\""+ codeToIrregular[tag[7]] +"\">" + tag[7] + "</span>");
+        } else {
+            output += "<span>" + tag[7] + "</span>";
+        }
+    } else if(tag[0] === "J"){
+        output += ((codeToKType.hasOwnProperty(tag[7])) ? ("<span title=\""+ codeToKType[tag[7]] +"\">" + tag[7] + "</span>") : ("<span>" + tag[7] + "</span>"));
+    } else {
+        output += "<span>" + tag[7] + "</span>";
+    }
+
+    output += ((tag[8] !== "-") ? ("<span title=\""+ tag[8] +". osoba\">" + tag[8] + "</span>") : ("<span>" + tag[8] + "</span>"));
+    output += ((codeToTime.hasOwnProperty(tag[9])) ? ("<span title=\""+ codeToTime[tag[9]] +"\">" + tag[9] + "</span>") : ("<span>" + tag[9] + "</span>"));
+    output += ((codeToVType.hasOwnProperty(tag[10])) ? ("<span title=\""+ codeToVType[tag[10]] +"\">" + tag[10] + "</span>") : ("<span>" + tag[10] + "</span>"));
+    output += ((codeToVid.hasOwnProperty(tag[11])) ? ("<span title=\""+ codeToVid[tag[11]] +"\">" + tag[11] + "</span>") : ("<span>" + tag[11] + "</span>"));
+
     return output;
 }
\ No newline at end of file
