password.html 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset='utf-8'>
  5. <title>Password cell type - Handsontable</title>
  6. <!--
  7. Loading Handsontable (full distribution that includes all dependencies)
  8. -->
  9. <link data-jsfiddle="common" rel="stylesheet" media="screen" href="../dist/handsontable.css">
  10. <link data-jsfiddle="common" rel="stylesheet" media="screen" href="../dist/pikaday/pikaday.css">
  11. <script data-jsfiddle="common" src="../dist/pikaday/pikaday.js"></script>
  12. <script data-jsfiddle="common" src="../dist/moment/moment.js"></script>
  13. <script data-jsfiddle="common" src="../dist/zeroclipboard/ZeroClipboard.js"></script>
  14. <script data-jsfiddle="common" src="../dist/numbro/numbro.js"></script>
  15. <script data-jsfiddle="common" src="../dist/numbro/languages.js"></script>
  16. <script data-jsfiddle="common" src="../dist/handsontable.js"></script>
  17. <!--
  18. Loading demo dependencies. They are used here only to enhance the examples on this page
  19. -->
  20. <link data-jsfiddle="common" rel="stylesheet" media="screen" href="css/samples.css?20140331">
  21. <script src="js/samples.js"></script>
  22. <script src="js/highlight/highlight.pack.js"></script>
  23. <link rel="stylesheet" media="screen" href="js/highlight/styles/github.css">
  24. <link rel="stylesheet" href="css/font-awesome/css/font-awesome.min.css">
  25. <!--
  26. Facebook open graph. Don't copy this to your project :)
  27. -->
  28. <meta property="og:title" content="Password cell type">
  29. <meta property="og:description"
  30. content="This kind of cell behaves like a text cell with a difference that it masks it's value using asterisk in cell renderer">
  31. <meta property="og:url" content="http://handsontable.com/demo/password.html">
  32. <meta property="og:image" content="http://handsontable.com/demo/image/og-image.png">
  33. <meta property="og:image:type" content="image/png">
  34. <meta property="og:image:width" content="409">
  35. <meta property="og:image:height" content="164">
  36. <link rel="canonical" href="http://handsontable.com/demo/password.html">
  37. <!--
  38. Google Analytics for GitHub Page. Don't copy this to your project :)
  39. -->
  40. <script src="js/ga.js"></script>
  41. <script data-jsfiddle="common">
  42. function getCarData() {
  43. return [
  44. {id: 1, name: {first: "Ted", last: "Right"}, password: "plainTextPassword"},
  45. {id: 2, name: {first: "Frank", last: "Honest"}, password: "txt"},
  46. {id: 3, name: {first: "Joan", last: "Well"}, password: "longer"}
  47. ];
  48. }
  49. </script>
  50. </head>
  51. <body>
  52. <div class="wrapper">
  53. <div class="wrapper-row">
  54. <div id="global-menu-clone">
  55. <h1><a href="../index.html">Handsontable</a></h1>
  56. </div>
  57. <div id="container">
  58. <div class="columnLayout">
  59. <div class="rowLayout">
  60. <div class="descLayout">
  61. <div class="pad" data-jsfiddle="example1">
  62. <h2>Password cell type</h2>
  63. <p>This kind of cell behaves like a text cell with a difference that it masks it's value using asterisk in cell renderer.</p>
  64. <p>For the cell editor, a <code>&lt;input type="password"&gt;</code> field is used.</p>
  65. <p>Data is stored in the data source as plain text.</p>
  66. <div id="example1"></div>
  67. <p>
  68. <button name="dump" data-dump="#example1"data-instance="hot1" title="Prints current data source to Firebug/Chrome Dev Tools">
  69. Dump
  70. data to console
  71. </button>
  72. </p>
  73. </div>
  74. </div>
  75. <div class="codeLayout">
  76. <div class="pad">
  77. <div class="jsFiddle">
  78. <button class="jsFiddleLink" data-runfiddle="example1">Edit in jsFiddle</button>
  79. </div>
  80. <script data-jsfiddle="example1">
  81. var example1 = document.getElementById('example1'),
  82. hot1;
  83. hot1 = new Handsontable(example1, {
  84. data: getCarData(),
  85. colHeaders: ['ID', 'First name', 'Last name', 'Password'],
  86. columns: [
  87. {data: 'id'},
  88. {data: 'name.first'},
  89. {data: 'name.last'},
  90. {data: 'password', type: 'password'}
  91. ]
  92. });
  93. </script>
  94. </div>
  95. </div>
  96. </div>
  97. <div class="rowLayout">
  98. <div class="descLayout">
  99. <div class="pad" data-jsfiddle="example2">
  100. <h2>Fixed hash length</h2>
  101. <p>By default every hash has length equal to the length of value that it corresponds with. Use option <code>hashLength</code> to set fixed hash length.
  102. <div id="example2"></div>
  103. <p>
  104. <button name="dump" data-dump="#example2" data-instance="hot2" title="Prints current data source to Firebug/Chrome Dev Tools">
  105. Dump
  106. data to console
  107. </button>
  108. </p>
  109. </div>
  110. </div>
  111. <div class="codeLayout">
  112. <div class="pad">
  113. <div class="jsFiddle">
  114. <button class="jsFiddleLink" data-runfiddle="example2">Edit in jsFiddle</button>
  115. </div>
  116. <script data-jsfiddle="example2">
  117. var example2 = document.getElementById('example2'),
  118. hot2;
  119. hot2 = new Handsontable(example2, {
  120. data: getCarData(),
  121. colHeaders: ['ID', 'First name', 'Last name', 'Password'],
  122. columns: [
  123. {data: 'id'},
  124. {data: 'name.first'},
  125. {data: 'name.last'},
  126. {
  127. data: 'password',
  128. type: 'password',
  129. hashLength: 10
  130. }
  131. ]
  132. });
  133. </script>
  134. </div>
  135. </div>
  136. </div>
  137. <div class="rowLayout">
  138. <div class="descLayout">
  139. <div class="pad" data-jsfiddle="example3">
  140. <h2>Custom hash symbol</h2>
  141. <p>By default every hash consists of asterisks <code>*</code>. Use option <code>hashSymbol</code> to set
  142. custom hash symbol. You can use any character, entity or event HTML.
  143. <p><strong>Note:</strong> You cannot change symbol used by the input field due to browsers limitations.</p>
  144. <div id="example3"></div>
  145. <p>
  146. <button name="dump" data-dump="#example3" data-instance="hot3" title="Prints current data source to Firebug/Chrome Dev Tools">
  147. Dump
  148. data to console
  149. </button>
  150. </p>
  151. </div>
  152. </div>
  153. <div class="codeLayout">
  154. <div class="pad">
  155. <div class="jsFiddle">
  156. <button class="jsFiddleLink" data-runfiddle="example3">Edit in jsFiddle</button>
  157. </div>
  158. <script data-jsfiddle="example3">
  159. var example3 = document.getElementById('example3'),
  160. hot3;
  161. hot3 = new Handsontable(example3, {
  162. data: getCarData(),
  163. colHeaders: ['ID', 'First name', 'Last name', 'Password'],
  164. columns: [
  165. {data: 'id'},
  166. {data: 'name.first'},
  167. {data: 'name.last'},
  168. {
  169. data: 'password',
  170. type: 'password',
  171. hashSymbol: '&#9632;'
  172. }
  173. ]
  174. });
  175. </script>
  176. </div>
  177. </div>
  178. </div>
  179. <div class="footer-text">
  180. </div>
  181. </div>
  182. </div>
  183. </div>
  184. </div>
  185. <div id="outside-links-wrapper"></div>
  186. </body>
  187. </html>