char_counter.html 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  5. <link rel="stylesheet"
  6. href="https://cdnjs.cloudflare.com/ajax/libs/material-design-iconic-font/2.0.2/css/material-design-iconic-font.min.css">
  7. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.4.0/css/font-awesome.min.css">
  8. <link rel="stylesheet" href="../../css/froala_editor.css">
  9. <link rel="stylesheet" href="../../css/froala_style.css">
  10. <link rel="stylesheet" href="../../css/plugins/char_counter.css">
  11. <style>
  12. body {
  13. text-align: center;
  14. }
  15. section {
  16. width: 81%;
  17. margin: auto;
  18. text-align: left;
  19. }
  20. </style>
  21. </head>
  22. <body>
  23. <section id="editor">
  24. <h1>Character Counter</h1>
  25. <p>Using the <code>char_counter.min.js</code> plugin it is possible to limit the number of characters that can be
  26. introduced into the WYSIWYG HTML editor.</p>
  27. <div id='edit' style="margin-top: 30px;">
  28. <p>You can type only 140 characters.</p>
  29. <p>The maximum number of characters can be changed using the <a
  30. href="https://www.froala.com/wysiwyg-editor/docs/options#charCounterMax"
  31. title="charCounterMax">charCounterMax</a> option.</p>
  32. </div>
  33. </section>
  34. <script type="text/javascript" src="../../js/froala_editor.min.js"></script>
  35. <script type="text/javascript" src="../../js/plugins/char_counter.min.js"></script>
  36. <script>
  37. (function () {
  38. new FroalaEditor("#edit", {
  39. // Set maximum number of characters.
  40. charCounterMax: 140
  41. })
  42. })()
  43. </script>
  44. </body>
  45. </html>