8
0

iconset.js 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. /**
  2. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  4. */
  5. /* global document */
  6. import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview';
  7. import ToolbarView from '@ckeditor/ckeditor5-ui/src/toolbar/toolbarview';
  8. import Locale from '@ckeditor/ckeditor5-utils/src/locale';
  9. import bold from '@ckeditor/ckeditor5-basic-styles/theme/icons/bold.svg';
  10. import italic from '@ckeditor/ckeditor5-basic-styles/theme/icons/italic.svg';
  11. import underline from '@ckeditor/ckeditor5-basic-styles/theme/icons/underline.svg';
  12. import code from '@ckeditor/ckeditor5-basic-styles/theme/icons/code.svg';
  13. import strikethrough from '@ckeditor/ckeditor5-basic-styles/theme/icons/strikethrough.svg';
  14. import subscript from '@ckeditor/ckeditor5-basic-styles/theme/icons/subscript.svg';
  15. import superscript from '@ckeditor/ckeditor5-basic-styles/theme/icons/superscript.svg';
  16. import browseFiles from '@ckeditor/ckeditor5-ckfinder/theme/icons/browse-files.svg';
  17. import codeBlock from '@ckeditor/ckeditor5-code-block/theme/icons/codeblock.svg';
  18. import cancel from '@ckeditor/ckeditor5-core/theme/icons/cancel.svg';
  19. import check from '@ckeditor/ckeditor5-core/theme/icons/check.svg';
  20. import eraser from '@ckeditor/ckeditor5-core/theme/icons/eraser.svg';
  21. import lowVision from '@ckeditor/ckeditor5-core/theme/icons/low-vision.svg';
  22. import image from '@ckeditor/ckeditor5-core/theme/icons/image.svg';
  23. import alignBottom from '@ckeditor/ckeditor5-core/theme/icons/align-bottom.svg';
  24. import alignMiddle from '@ckeditor/ckeditor5-core/theme/icons/align-middle.svg';
  25. import alignTop from '@ckeditor/ckeditor5-core/theme/icons/align-top.svg';
  26. import alignLeft from '@ckeditor/ckeditor5-core/theme/icons/align-left.svg';
  27. import alignCenter from '@ckeditor/ckeditor5-core/theme/icons/align-center.svg';
  28. import alignRight from '@ckeditor/ckeditor5-core/theme/icons/align-right.svg';
  29. import alignJustify from '@ckeditor/ckeditor5-core/theme/icons/align-justify.svg';
  30. import objectLeft from '@ckeditor/ckeditor5-core/theme/icons/object-left.svg';
  31. import objectCenter from '@ckeditor/ckeditor5-core/theme/icons/object-center.svg';
  32. import objectRight from '@ckeditor/ckeditor5-core/theme/icons/object-right.svg';
  33. import objectFullWidth from '@ckeditor/ckeditor5-core/theme/icons/object-full-width.svg';
  34. import pencil from '@ckeditor/ckeditor5-core/theme/icons/pencil.svg';
  35. import pilcrow from '@ckeditor/ckeditor5-core/theme/icons/pilcrow.svg';
  36. import quote from '@ckeditor/ckeditor5-core/theme/icons/quote.svg';
  37. import threeVerticalDots from '@ckeditor/ckeditor5-core/theme/icons/three-vertical-dots.svg';
  38. import fontFamily from '@ckeditor/ckeditor5-font/theme/icons/font-family.svg';
  39. import fontSize from '@ckeditor/ckeditor5-font/theme/icons/font-size.svg';
  40. import fontColor from '@ckeditor/ckeditor5-font/theme/icons/font-color.svg';
  41. import fontBackground from '@ckeditor/ckeditor5-font/theme/icons/font-background.svg';
  42. import heading1 from '@ckeditor/ckeditor5-heading/theme/icons/heading1.svg';
  43. import heading2 from '@ckeditor/ckeditor5-heading/theme/icons/heading2.svg';
  44. import heading3 from '@ckeditor/ckeditor5-heading/theme/icons/heading3.svg';
  45. import heading4 from '@ckeditor/ckeditor5-heading/theme/icons/heading4.svg';
  46. import heading5 from '@ckeditor/ckeditor5-heading/theme/icons/heading5.svg';
  47. import heading6 from '@ckeditor/ckeditor5-heading/theme/icons/heading6.svg';
  48. import indent from '@ckeditor/ckeditor5-indent/theme/icons/indent.svg';
  49. import outdent from '@ckeditor/ckeditor5-indent/theme/icons/outdent.svg';
  50. import marker from '@ckeditor/ckeditor5-highlight/theme/icons/marker.svg';
  51. import pen from '@ckeditor/ckeditor5-highlight/theme/icons/pen.svg';
  52. import link from '@ckeditor/ckeditor5-link/theme/icons/link.svg';
  53. import unlink from '@ckeditor/ckeditor5-link/theme/icons/unlink.svg';
  54. import bulletedList from '@ckeditor/ckeditor5-list/theme/icons/bulletedlist.svg';
  55. import numberedList from '@ckeditor/ckeditor5-list/theme/icons/numberedlist.svg';
  56. import todoList from '@ckeditor/ckeditor5-list/theme/icons/todolist.svg';
  57. import media from '@ckeditor/ckeditor5-media-embed/theme/icons/media.svg';
  58. import pageBreak from '@ckeditor/ckeditor5-page-break/theme/icons/pagebreak.svg';
  59. import paragraph from '@ckeditor/ckeditor5-paragraph/theme/icons/paragraph.svg';
  60. import removeFormat from '@ckeditor/ckeditor5-remove-format/theme/icons/remove-format.svg';
  61. import contentLock from '@ckeditor/ckeditor5-restricted-editing/theme/icons/contentlock.svg';
  62. import contentUnlock from '@ckeditor/ckeditor5-restricted-editing/theme/icons/contentunlock.svg';
  63. import selectAll from '@ckeditor/ckeditor5-select-all/theme/icons/select-all.svg';
  64. import specialCharacters from '@ckeditor/ckeditor5-special-characters/theme/icons/specialcharacters.svg';
  65. import table from '@ckeditor/ckeditor5-table/theme/icons/table.svg';
  66. import tableRow from '@ckeditor/ckeditor5-table/theme/icons/table-row.svg';
  67. import tableColumn from '@ckeditor/ckeditor5-table/theme/icons/table-column.svg';
  68. import tableMergeCell from '@ckeditor/ckeditor5-table/theme/icons/table-merge-cell.svg';
  69. import tableCellProperties from '@ckeditor/ckeditor5-table/theme/icons/table-cell-properties.svg';
  70. import tableProperties from '@ckeditor/ckeditor5-table/theme/icons/table-properties.svg';
  71. import nextArrow from '@ckeditor/ckeditor5-ui/theme/icons/next-arrow.svg';
  72. import previousArrow from '@ckeditor/ckeditor5-ui/theme/icons/previous-arrow.svg';
  73. import undo from '@ckeditor/ckeditor5-undo/theme/icons/undo.svg';
  74. import redo from '@ckeditor/ckeditor5-undo/theme/icons/redo.svg';
  75. import '../../theme/ckeditor5-ui/components/editorui/editorui.css';
  76. const icons = {
  77. // basic-styles
  78. bold, italic, underline, code, strikethrough, subscript, superscript,
  79. // ckfinder
  80. browseFiles,
  81. // code block
  82. codeBlock,
  83. // core
  84. alignTop, alignBottom, alignMiddle, alignLeft, alignCenter, alignRight,
  85. alignJustify, cancel, check, eraser, image, lowVision, objectCenter,
  86. objectFullWidth, objectLeft, objectRight, pencil, pilcrow, quote,
  87. threeVerticalDots,
  88. // font
  89. fontFamily, fontSize, fontColor, fontBackground,
  90. // heading
  91. heading1, heading2, heading3, heading4, heading5, heading6,
  92. // highlight
  93. marker, pen,
  94. // indent
  95. indent, outdent,
  96. // link
  97. link, unlink,
  98. // list
  99. bulletedList, numberedList, todoList,
  100. // media-embed
  101. media,
  102. // page-break
  103. pageBreak,
  104. // paragraph
  105. paragraph,
  106. // remove-format
  107. removeFormat,
  108. // restricted-editing
  109. contentLock, contentUnlock,
  110. // select-all
  111. selectAll,
  112. // special-characters
  113. specialCharacters,
  114. // table
  115. table, tableRow, tableColumn, tableMergeCell,
  116. tableCellProperties, tableProperties,
  117. // ui
  118. nextArrow, previousArrow,
  119. // undo
  120. undo, redo
  121. };
  122. const toolbar = new ToolbarView( new Locale() );
  123. for ( const i in icons ) {
  124. const button = new ButtonView();
  125. button.set( {
  126. label: i,
  127. icon: icons[ i ],
  128. tooltip: true
  129. } );
  130. button.iconView.fillColor = '#FFDA51';
  131. toolbar.items.add( button );
  132. }
  133. toolbar.class = 'ck-editor-toolbar ck-reset_all';
  134. toolbar.render();
  135. document.body.appendChild( toolbar.element );