specialcharactersarrows.js 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. /**
  6. * @module special-characters/specialcharactersarrows
  7. */
  8. import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
  9. /**
  10. * A plugin that provides special characters for the "Arrows" category.
  11. *
  12. * ClassicEditor
  13. * .create( {
  14. * plugins: [ ..., SpecialCharacters, SpecialCharactersArrows ],
  15. * } )
  16. * .then( ... )
  17. * .catch( ... );
  18. *
  19. * @extends module:core/plugin~Plugin
  20. */
  21. export default class SpecialCharactersArrows extends Plugin {
  22. /**
  23. * @inheritDoc
  24. */
  25. init() {
  26. const editor = this.editor;
  27. const t = editor.t;
  28. editor.plugins.get( 'SpecialCharacters' ).addItems( 'Arrows', [
  29. { title: t( 'leftwards double arrow' ), character: '⇐' },
  30. { title: t( 'rightwards double arrow' ), character: '⇒' },
  31. { title: t( 'upwards double arrow' ), character: '⇑' },
  32. { title: t( 'downwards double arrow' ), character: '⇓' },
  33. { title: t( 'leftwards dashed arrow' ), character: '⇠' },
  34. { title: t( 'rightwards dashed arrow' ), character: '⇢' },
  35. { title: t( 'upwards dashed arrow' ), character: '⇡' },
  36. { title: t( 'downwards dashed arrow' ), character: '⇣' },
  37. { title: t( 'leftwards arrow to bar' ), character: '⇤' },
  38. { title: t( 'rightwards arrow to bar' ), character: '⇥' },
  39. { title: t( 'upwards arrow to bar' ), character: '⤒' },
  40. { title: t( 'downwards arrow to bar' ), character: '⤓' },
  41. { title: t( 'up down arrow with base' ), character: '↨' },
  42. { title: t( 'back with leftwards arrow above' ), character: '🔙' },
  43. { title: t( 'end with leftwards arrow above' ), character: '🔚' },
  44. { title: t( 'on with exclamation mark with left right arrow above' ), character: '🔛' },
  45. { title: t( 'soon with rightwards arrow above' ), character: '🔜' },
  46. { title: t( 'top with upwards arrow above' ), character: '🔝' }
  47. ] );
  48. }
  49. }