editor-quill.js 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /*=========================================================================================
  2. File Name: editor-quill.js
  3. Description: Quill is a modern rich text editor built for compatibility and extensibility.
  4. ----------------------------------------------------------------------------------------
  5. Item name: Vuexy - Vuejs, HTML & Laravel Admin Dashboard Template
  6. Author: PIXINVENT
  7. Author URL: http://www.themeforest.net/user/pixinvent
  8. ==========================================================================================*/
  9. (function (window, document, $) {
  10. 'use strict';
  11. var Font = Quill.import('formats/font');
  12. Font.whitelist = ['sofia', 'slabo', 'roboto', 'inconsolata', 'ubuntu'];
  13. Quill.register(Font, true);
  14. // Bubble Editor
  15. var bubbleEditor = new Quill('#bubble-container .editor', {
  16. bounds: '#bubble-container .editor',
  17. modules: {
  18. 'formula': true,
  19. 'syntax': true
  20. },
  21. theme: 'bubble'
  22. });
  23. // Snow Editor
  24. var snowEditor = new Quill('#snow-container .editor', {
  25. bounds: '#snow-container .editor',
  26. modules: {
  27. 'formula': true,
  28. 'syntax': true,
  29. 'toolbar': '#snow-container .quill-toolbar'
  30. },
  31. theme: 'snow'
  32. });
  33. // Full Editor
  34. var fullEditor = new Quill('#full-container .editor', {
  35. bounds: '#full-container .editor',
  36. modules: {
  37. 'formula': true,
  38. 'syntax': true,
  39. 'toolbar': [
  40. [{
  41. 'font': []
  42. }, {
  43. 'size': []
  44. }],
  45. ['bold', 'italic', 'underline', 'strike'],
  46. [{
  47. 'color': []
  48. }, {
  49. 'background': []
  50. }],
  51. [{
  52. 'script': 'super'
  53. }, {
  54. 'script': 'sub'
  55. }],
  56. [{
  57. 'header': '1'
  58. }, {
  59. 'header': '2'
  60. }, 'blockquote', 'code-block'],
  61. [{
  62. 'list': 'ordered'
  63. }, {
  64. 'list': 'bullet'
  65. }, {
  66. 'indent': '-1'
  67. }, {
  68. 'indent': '+1'
  69. }],
  70. ['direction', {
  71. 'align': []
  72. }],
  73. ['link', 'image', 'video', 'formula'],
  74. ['clean']
  75. ],
  76. },
  77. theme: 'snow'
  78. });
  79. var editors = [bubbleEditor, snowEditor, fullEditor];
  80. })(window, document, jQuery);