Skrývaný text: Porovnání verzí
Skočit na navigaci
Skočit na vyhledávání
m (naimportována 1 revize) |
|||
(Není zobrazena jedna mezilehlá verze od stejného uživatele.) | |||
Řádek 8: | Řádek 8: | ||
declare function GetGuid dll "ActualDocument" (): string | declare function GetGuid dll "ActualDocument" (): string | ||
− | script JavascriptText (): | + | script JavascriptText(): boolean |
− | var | + | var |
+ | HtmlBody, HtmlSubject, Html: string | ||
+ | TextId: string | ||
begin | begin | ||
− | + | HtmlSubject := "<b>" + "Toto je náhled textu " + "</b>" | |
− | + | HtmlBody := "<table cellpadding=""10"">" | |
− | + | HtmlBody += "<tr>" | |
− | + | HtmlBody += " <td>" | |
− | + | HtmlBody += " aaaa <br/> bbbb <br/> cccc" | |
− | + | HtmlBody += " </td>" | |
− | + | HtmlBody += " <td>" | |
− | + | HtmlBody += " 1111 <br/> 2222 <br/> 3333" | |
− | + | HtmlBody += " </td>" | |
− | + | HtmlBody += "</tr>" | |
+ | HtmlBody += "</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;"">" + HtmlSubject + "</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;"">" + HtmlBody + " </p>" | |
− | + | Html += " </div>" | |
− | + | Html += "</div>" | |
− | AddHtmlText("actualdocument", | + | |
− | + | AddHtmlText("actualdocument", Html, "", actualdocument) | |
− | end | + | |
− | </pre> | + | result := true |
+ | end</pre> | ||
+ | [[Category: enTeam skripty]] |
Aktuální verze z 22. 12. 2020, 21:30
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 HtmlBody, HtmlSubject, Html: string TextId: string begin HtmlSubject := "<b>" + "Toto je náhled textu " + "</b>" HtmlBody := "<table cellpadding=""10"">" HtmlBody += "<tr>" HtmlBody += " <td>" HtmlBody += " aaaa <br/> bbbb <br/> cccc" HtmlBody += " </td>" HtmlBody += " <td>" HtmlBody += " 1111 <br/> 2222 <br/> 3333" HtmlBody += " </td>" HtmlBody += "</tr>" HtmlBody += "</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;"">" + HtmlSubject + "</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;"">" + HtmlBody + " </p>" Html += " </div>" Html += "</div>" AddHtmlText("actualdocument", Html, "", actualdocument) result := true end