form-editor2.js 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. $(function() {
  2. 'use strict'
  3. var icons = Quill.import('ui/icons');
  4. icons['bold'] = '<i class="fa fa-bold" aria-hidden="true"><\/i>';
  5. icons['italic'] = '<i class="fa fa-italic" aria-hidden="true"><\/i>';
  6. icons['underline'] = '<i class="fa fa-underline" aria-hidden="true"><\/i>';
  7. icons['strike'] = '<i class="fa fa-strikethrough" aria-hidden="true"><\/i>';
  8. icons['list']['ordered'] = '<i class="fa fa-list-ol" aria-hidden="true"><\/i>';
  9. icons['list']['bullet'] = '<i class="fa fa-list-ul" aria-hidden="true"><\/i>';
  10. icons['link'] = '<i class="fa fa-link" aria-hidden="true"><\/i>';
  11. icons['image'] = '<i class="fa fa-image" aria-hidden="true"><\/i>';
  12. icons['video'] = '<i class="fa fa-film" aria-hidden="true"><\/i>';
  13. icons['code-block'] = '<i class="fa fa-code" aria-hidden="true"><\/i>';
  14. var toolbarOptions = [
  15. [{
  16. 'header': [1, 2, 3, 4, 5, 6, false]
  17. }],
  18. ['bold', 'italic', 'underline', 'strike'],
  19. [{
  20. 'list': 'ordered'
  21. }, {
  22. 'list': 'bullet'
  23. }],
  24. ['link', 'image', 'video']
  25. ];
  26. var quill = new Quill('#quillEditor', {
  27. modules: {
  28. toolbar: toolbarOptions
  29. },
  30. theme: 'snow'
  31. });
  32. var quillModal = new Quill('#quillEditorModal', {
  33. modules: {
  34. toolbar: toolbarOptions
  35. },
  36. theme: 'snow'
  37. });
  38. var quillModal2 = new Quill('#quillEditorModal2', {
  39. modules: {
  40. toolbar: toolbarOptions
  41. },
  42. theme: 'snow'
  43. });
  44. var toolbarInlineOptions = [
  45. ['bold', 'italic', 'underline'],
  46. [{
  47. 'header': 1
  48. }, {
  49. 'header': 2
  50. }, 'blockquote'],
  51. ['link', 'image', 'code-block'],
  52. ];
  53. var quillInline = new Quill('#quillInline', {
  54. modules: {
  55. toolbar: toolbarInlineOptions
  56. },
  57. bounds: '#quillInline',
  58. scrollingContainer: '#scrolling-container',
  59. placeholder: 'Write something...',
  60. theme: 'bubble'
  61. });
  62. new PerfectScrollbar('#scrolling-container', {
  63. suppressScrollX: true
  64. });
  65. });