Skrývaný text
Verze z 29. 8. 2016, 08:32, kterou vytvořil en>Kadel
Protokol procesu je vlastně HTML prohlížeč (Internet explorer). Pomocí javascriptu je pak možné provádět s textem různé operace, např. zobrazovat, nebo skrývat části textu po najetí myši na jeho náhled. Ukázka níže vkládá do procesu pouze část textu a celý text je pak zobrazen po najetí myši na zmíněnou část textu.
declare procedure AddHtmlText dll "ActualDocument" (string, string, string, pointer)
declare function GetGuid dll "ActualDocument" (): string
script JavascriptText (): Boolean
var bodyHtml,subjectHtml, html, sBR, textID : String
begin
sBR := "<BR/>"
subjectHtml := "<b>" + "Toto je náhled textu " + "</b>"
bodyHtml := "<table cellpadding=""10"">"
bodyHtml += "<tr>"
bodyHtml += "<td>" + "aaaa" + sBR + "bbbb" + sBR + "cccc"
bodyHtml += "</td>"
bodyHtml += "<td>" + "1111" + sBR + "2222" + sBR + "3333"
bodyHtml += "</td>"
bodyHtml += "</tr>"
bodyHtml += "</table>"
textID := GetGuid()
html := "<div onMouseOver=""document.getElementById('info_" + textID + "').style.visibility = 'visible'; return false;"
html += """ onMouseOut=""document.getElementById('info_" + textID + "').style.visibility = 'hidden'; return false;"">" + subjectHtml + "</a>"
html += "<div id=""info_" + textID + """ style=""visibility: hidden;display: none; position: relative; top: 0px; left: 0px;"">"
html += " <div id=""info_box"" style=""position: absolute; top: 0px; left: 0px; background-color: #BBBBBB; padding: 2px 8px 2px 8px; border: 1px solid black; color: black;"">"
html += " <p style=""font-size: 12px;"">" + bodyHtml + " </p>"
html += " </div>"
html += "</div>"
AddHtmlText("actualdocument", html, "", actualDocument)
Result := True
end
