Skrývaný text: Porovnání verzí

Z enTeam
Skočit na navigaci Skočit na vyhledávání
m (naimportována 1 revize)
Řádek 8: Řádek 8:
 
declare function GetGuid dll "ActualDocument" (): string
 
declare function GetGuid dll "ActualDocument" (): string
  
script JavascriptText (): Boolean
+
script JavascriptText(): boolean
var bodyHtml,subjectHtml, html, sBR, textID : String
+
var
 +
  HtmlBody, HtmlSubject, Html: string
 +
  TextId: string
  
 
begin
 
begin
   sBR := "<BR/>"
+
   HtmlSubject :=  "<b>" + "Toto je náhled textu " + "</b>"
  subjectHtml :=  "<b>" + "Toto je náhled textu " + "</b>"
+
   HtmlBody := "<table cellpadding=""10"">"
   bodyHtml := "<table cellpadding=""10"">"
+
   HtmlBody += "<tr>"
   bodyHtml += "<tr>"
+
   HtmlBody += " <td>"
   bodyHtml +=   "<td>" + "aaaa" + sBR + "bbbb" + sBR + "cccc"
+
  HtmlBody += "   aaaa <br/> bbbb <br/> cccc"
   bodyHtml +=   "</td>"
+
   HtmlBody += " </td>"
   bodyHtml +=   "<td>" + "1111" + sBR + "2222" + sBR + "3333"
+
   HtmlBody += " <td>"
   bodyHtml += "</td>"
+
  HtmlBody += "   1111 <br/> 2222 <br/> 3333"
   bodyHtml += "</tr>"
+
   HtmlBody += " </td>"
   bodyHtml += "</table>"
+
   HtmlBody += "</tr>"
 +
   HtmlBody += "</table>"
  
   textID :=  GetGuid()
+
   TextId :=  GetGuid()
   html := "<div onMouseOver=""document.getElementById('info_" + textID + "').style.visibility = 'visible'; return false;"
+
   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 += """ 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_" + 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 += "  <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 += "    <p style=""font-size: 12px;"">" + HtmlBody   + " </p>"
   html += "  </div>"
+
   Html += "  </div>"
   html += "</div>"
+
   Html += "</div>"
   AddHtmlText("actualdocument", html, "", actualDocument)
+
 
   Result := True
+
   AddHtmlText("actualdocument", Html, "", actualdocument)
end
+
 
</pre>
+
   result := true
 +
end</pre>

Verze z 14. 8. 2020, 09:07

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.


Aaa.png

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