init_on_link.html 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0" />
  6. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.4.0/css/font-awesome.min.css">
  7. <link rel="stylesheet" href="../../css/froala_editor.css">
  8. <link rel="stylesheet" href="../../css/froala_style.css">
  9. <style>
  10. body {
  11. text-align: center;
  12. }
  13. div#editor {
  14. width: 81%;
  15. margin: auto;
  16. text-align: left;
  17. }
  18. </style>
  19. </head>
  20. <body>
  21. <div id="editor">
  22. <h1>Init On Link</h1>
  23. <p>Using the <code>link.min.js</code> plugin it is possible to initialize the WYSIWYG HTML editor only on a link.
  24. </p>
  25. <p>The rich text editor will be initialized only on this following link: <a id="edit"
  26. href="https://www.froala.com/wysiwyg-editor">Froala WYSIWYG HTML editor website</a></p>
  27. </div>
  28. <script type="text/javascript" src="../../js/froala_editor.min.js"></script>
  29. <script type="text/javascript" src="../../js/plugins/link.min.js"></script>
  30. <script>
  31. (function () {
  32. const editorInstance = new FroalaEditor('#edit', {
  33. events: {
  34. contentChanged: function () {
  35. console.log('content changed')
  36. }
  37. }
  38. })
  39. })()
  40. </script>
  41. </body>
  42. </html>