8
0

specialcharacterstext.js 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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/specialcharacterstext
  7. */
  8. import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
  9. /**
  10. * A plugin that provides special characters for the "Text" category.
  11. *
  12. * ClassicEditor
  13. * .create( {
  14. * plugins: [ ..., SpecialCharacters, SpecialCharactersText ],
  15. * } )
  16. * .then( ... )
  17. * .catch( ... );
  18. *
  19. * @extends module:core/plugin~Plugin
  20. */
  21. export default class SpecialCharactersText extends Plugin {
  22. /**
  23. * @inheritDoc
  24. */
  25. init() {
  26. const editor = this.editor;
  27. const t = editor.t;
  28. editor.plugins.get( 'SpecialCharacters' ).addItems( 'Text', [
  29. { character: '‹', title: t( 'Single left-pointing angle quotation mark' ) },
  30. { character: '›', title: t( 'Single right-pointing angle quotation mark' ) },
  31. { character: '«', title: t( 'Left-pointing double angle quotation mark' ) },
  32. { character: '»', title: t( 'Right-pointing double angle quotation mark' ) },
  33. { character: '‘', title: t( 'Left single quotation mark' ) },
  34. { character: '’', title: t( 'Right single quotation mark' ) },
  35. { character: '“', title: t( 'Left double quotation mark' ) },
  36. { character: '”', title: t( 'Right double quotation mark' ) },
  37. { character: '‚', title: t( 'Single low-9 quotation mark' ) },
  38. { character: '„', title: t( 'Double low-9 quotation mark' ) },
  39. { character: '¡', title: t( 'Inverted exclamation mark' ) },
  40. { character: '¿', title: t( 'Inverted question mark' ) },
  41. { character: '‥', title: t( 'Two dot leader' ) },
  42. { character: '…', title: t( 'Horizontal ellipsis' ) },
  43. { character: '‡', title: t( 'Double dagger' ) },
  44. { character: '‰', title: t( 'Per mille sign' ) },
  45. { character: '‱', title: t( 'Per ten thousand sign' ) },
  46. { character: '‼', title: t( 'Double exclamation mark' ) },
  47. { character: '⁈', title: t( 'Question exclamation mark' ) },
  48. { character: '⁉', title: t( 'Exclamation question mark' ) },
  49. { character: '⁇', title: t( 'Double question mark' ) },
  50. { character: '©', title: t( 'Copyright sign' ) },
  51. { character: '®', title: t( 'Registered sign' ) },
  52. { character: '™', title: t( 'Trade mark sign' ) },
  53. { character: '§', title: t( 'Section sign' ) },
  54. { character: '¶', title: t( 'Paragraph sign' ) },
  55. { character: '⁋', title: t( 'Reversed paragraph sign' ) }
  56. ] );
  57. }
  58. }