highlight.html 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. <!DOCTYPE html>
  2. <!--
  3. * Copyright (c) 2021, 2024, 5 Mode and other contributors
  4. * Released under the MIT license
  5. *
  6. * This file is part of SqueeJS.
  7. *
  8. * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
  9. * and associated documentation files (the "Software"), to deal in the Software
  10. * without restriction, including without limitation the rights to use, copy, modify, merge, publish,
  11. * distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the
  12. * Software is furnished to do so, subject to the following conditions:
  13. *
  14. * The above copyright notice and this permission notice shall be included in all copies or
  15. * substantial portions of the Software.
  16. *
  17. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
  18. * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
  19. * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
  20. * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
  21. * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  22. * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  23. *
  24. * highlight.html
  25. *
  26. * SqueeJS Doc and examples for the Hightlight functionalities.
  27. *
  28. * @author Daniele Bonini <my25mb@aol.com>
  29. * @copyrights (c) 2016, 2024, 5 Mode
  30. * @license https://opensource.org/licenses/MIT
  31. * -->
  32. <html>
  33. <head>
  34. <title>Highlight: doc and examples.</title>
  35. <meta charset="UTF-8">
  36. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  37. <link rel="shortcut icon" href="favicon.ico" />
  38. <meta name="description" content="Welcome to Squeejs! Let everyone squeez its javascript code."/>
  39. <meta name="author" content="5 Mode"/>
  40. <meta name="robots" content="index,follow"/>
  41. <meta name="keywords" content="Squeejs,javascript,framework,squeejs.com,MIT,license,5 Mode"/>
  42. <script src="/js/common.js" type="text/javascript"></script>
  43. <script src="/js/squeejs.js" type="text/javascript"></script>
  44. <link href="/css/style.css?v=1631827555" type="text/css" rel="stylesheet">
  45. </head>
  46. <body style="height:2900px;border:0px solid lightgray; padding:20px; margin-right:20px;">
  47. <a href="/"><img src="/res/logo.png" style="width:300px;background:#FFFFFF;border:1px solid gray;"></a><br>
  48. <br><br><br>
  49. <h2>HIGHLIGHT</h2>
  50. Here the Javascript code available to be inserted in your web pages to implement the <i>highlight functionalities</i> of their html elements.<br>
  51. <br>
  52. Please check the <b>context</b> of implementation for each of the functions.<br>
  53. <br><br><br>
  54. <h2>Code:</h2>
  55. <pre>
  56. /**
  57. * SQJS.highlightDiv
  58. *
  59. * Highlight the current DIV element
  60. *
  61. * context:
  62. * - call this function in the &lt;onmouseenter&gt; event
  63. *
  64. * @param {Element} tthis, the current DIV element (&lt;this&gt; on the function call)
  65. * @returns {void}
  66. */
  67. <b>function SQJS.highlightDiv(tthis){};</b>
  68. /**
  69. * SQJS.unlightDiv
  70. *
  71. * Unlight the current DIV element
  72. *
  73. * Context:
  74. * - call this function in the &lt;onmouseleave&gt; event
  75. *
  76. * @param {Element} tthis, the current DIV element (this on the function call)
  77. * @returns {void}
  78. */
  79. <b>function SQJS.unlightDiv(tthis){};</b>
  80. /**
  81. * SQJS.highlightInput
  82. *
  83. * Highlight the current INPUT element
  84. *
  85. * Context:
  86. * - call this function in the &lt;onmouseenter&gt; event
  87. *
  88. * @param {Element} tthis, the current INPUT element (this on the function call)
  89. * @returns {void}
  90. */
  91. <b>function SQJS.highlightInput(tthis){};</b>
  92. /**
  93. * SQJS.unlightInput
  94. *
  95. * Unlight the current INPUT element
  96. *
  97. * Context:
  98. * - call this function in the &lt;onmouseleave&gt; event
  99. *
  100. * @param {Element} tthis, the current INPUT element (this on the function call)
  101. * @returns {void}
  102. */
  103. <b>function SQJS.unlightInput(tthis){};</b>
  104. /**
  105. * SQJS.highlightInput
  106. *
  107. * Highlight the current TEXTAREA element
  108. *
  109. * Context:
  110. * - call this function in the &lt;onmouseenter&gt; event
  111. *
  112. * @param {Element} tthis, the current TEXTAREA element (this on the function call)
  113. * @returns {void}
  114. */
  115. <b>function SQJS.highlightTextArea(tthis){};</b>
  116. /**
  117. * SQJS.unlightTextArea
  118. *
  119. * Highlight the current TEXTAREA element
  120. *
  121. * Context:
  122. * - call this function in the &lt;onmouseleave&gt; event
  123. *
  124. * @param {Element} tthis, the current TEXTAREA element (this on the function call)
  125. * @returns {void}
  126. */
  127. <b>function SQJS.unlightTextArea(tthis){};</b>
  128. </pre>
  129. <br><br>
  130. <h2>Usage example:</h2>
  131. <pre style="background:lightyellow;width:100%;white-space: pre-wrap;">
  132. &lt;div id="content" onmouseenter="SQJS.highlightDiv(this);" onmouseleave="SQJS.unlightDiv(this);" style="max-width:450px; width:100%; padding:35px;"&gt;
  133. &lt;input type="text" id="txtName" onmouseenter="SQJS.highlightInput(this);" onmouseleave="SQJS.unlightInput(this);" value="Capitan Cloud"&gt;
  134. &lt;input type="text" id="txtCompany" onmouseenter="SQJS.highlightInput(this);" onmouseleave="SQJS.unlightInput(this);" value="5 Mode"&gt;
  135. &lt;input type="text" id="txtEmail" onmouseenter="SQJS.highlightInput(this);" onmouseleave="SQJS.unlightInput(this);" value="my25mb@aol.com"&gt;
  136. &lt;textarea style="height:150px;width:300px;resize:none;" onmouseenter="SQJS.highlightTextArea(this);" onmouseleave="SQJS.unlightTextArea(this);"&gt;&lt;/textarea&gt;
  137. &lt;/div&gt;
  138. </pre>
  139. <br><br>
  140. <h2>How it looks like:</h2>
  141. <div id="content" onmouseenter="SQJS.highlightDiv(this);" onmouseleave="SQJS.unlightDiv(this);" style="max-width:650px; width:450px; padding:35px; border:1px solid gray;">
  142. <input type="text" id="txtName" onmouseenter="SQJS.highlightInput(this);" onmouseleave="SQJS.unlightInput(this);" value="Capitan Cloud"><br><br>
  143. <input type="text" id="txtCompany" onmouseenter="SQJS.highlightInput(this);" onmouseleave="SQJS.unlightInput(this);" value="5 Mode"><br><br>
  144. <input type="text" id="txtEmail" onmouseenter="SQJS.highlightInput(this);" onmouseleave="SQJS.unlightInput(this);" value="my25mb@aol.com"><br><br>
  145. <textarea style="height:150px;width:300px;resize:none;" onmouseenter="SQJS.highlightTextArea(this);" onmouseleave="SQJS.unlightTextArea(this);"></textarea><br>
  146. </div>
  147. <div style="clear:both; margin:auto;">
  148. <br><br><br>
  149. </div>
  150. <div class="footer">
  151. <div id="footerCont">&nbsp;</div>
  152. <div id="footer"><span style="background:#FFFFFF;color:black;opacity:1.0;margin-right:10px;">&nbsp;&nbsp;<a href="dd.html">Disclaimer</a>&nbsp;&nbsp;A <a href="http://5mode.com">5 Mode</a> project and <a href="http://demo.5mode.com">WYSIWYG</a> system. MIT License.</span></div>
  153. </div>
  154. <script>
  155. function setFooterPos() {
  156. if (document.getElementById("footerCont")) {
  157. tollerance = 12;
  158. footerContHeight = 35;
  159. footerHeight = 32;
  160. document.getElementById("footerCont").style.top = parseInt( getDocHeight2() - footerContHeight - tollerance ) + "px";
  161. document.getElementById("footer").style.top = parseInt( getDocHeight2() - footerHeight - tollerance) + "px";
  162. }
  163. }
  164. setFooterPos();
  165. </script>
  166. <!-- Yandex.Metrika counter -->
  167. <script type="text/javascript" >
  168. (function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)};
  169. m[i].l=1*new Date();k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)})
  170. (window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym");
  171. ym(90317440, "init", {
  172. clickmap:true,
  173. trackLinks:true,
  174. accurateTrackBounce:true
  175. });
  176. </script>
  177. <noscript><div><img src="https://mc.yandex.ru/watch/90317440" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
  178. <!-- /Yandex.Metrika counter -->
  179. </body>
  180. </html>