specialcharacterscurrency.js 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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/specialcharacterscurrency
  7. */
  8. import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
  9. /**
  10. * A plugin that provides special characters for the "Currency" category.
  11. *
  12. * ClassicEditor
  13. * .create( {
  14. * plugins: [ ..., SpecialCharacters, SpecialCharactersCurrency ],
  15. * } )
  16. * .then( ... )
  17. * .catch( ... );
  18. *
  19. * @extends module:core/plugin~Plugin
  20. */
  21. export default class SpecialCharactersCurrency extends Plugin {
  22. /**
  23. * @inheritDoc
  24. */
  25. init() {
  26. const editor = this.editor;
  27. const t = editor.t;
  28. editor.plugins.get( 'SpecialCharacters' ).addItems( 'Currency', [
  29. { character: '$', title: t( 'Dollar sign' ) },
  30. { character: '€', title: t( 'Euro sign' ) },
  31. { character: '¥', title: t( 'Yen sign' ) },
  32. { character: '£', title: t( 'Pound sign' ) },
  33. { character: '¢', title: t( 'Cent sign' ) },
  34. { character: '₠', title: t( 'Euro-currency sign' ) },
  35. { character: '₡', title: t( 'Colon sign' ) },
  36. { character: '₢', title: t( 'Cruzeiro sign' ) },
  37. { character: '₣', title: t( 'French franc sign' ) },
  38. { character: '₤', title: t( 'Lira sign' ) },
  39. { character: '¤', title: t( 'Currency sign' ) },
  40. { character: '₿', title: t( 'Bitcoin sign' ) },
  41. { character: '₥', title: t( 'Mill sign' ) },
  42. { character: '₦', title: t( 'Naira sign' ) },
  43. { character: '₧', title: t( 'Peseta sign' ) },
  44. { character: '₨', title: t( 'Rupee sign' ) },
  45. { character: '₩', title: t( 'Won sign' ) },
  46. { character: '₪', title: t( 'New sheqel sign' ) },
  47. { character: '₫', title: t( 'Dong sign' ) },
  48. { character: '₭', title: t( 'Kip sign' ) },
  49. { character: '₮', title: t( 'Tugrik sign' ) },
  50. { character: '₯', title: t( 'Drachma sign' ) },
  51. { character: '₰', title: t( 'German penny sign' ) },
  52. { character: '₱', title: t( 'Peso sign' ) },
  53. { character: '₲', title: t( 'Guarani sign' ) },
  54. { character: '₳', title: t( 'Austral sign' ) },
  55. { character: '₴', title: t( 'Hryvnia sign' ) },
  56. { character: '₵', title: t( 'Cedi sign' ) },
  57. { character: '₶', title: t( 'Livre tournois sign' ) },
  58. { character: '₷', title: t( 'Spesmilo sign' ) },
  59. { character: '₸', title: t( 'Tenge sign' ) },
  60. { character: '₹', title: t( 'Indian rupee sign' ) },
  61. { character: '₺', title: t( 'Turkish lira sign' ) },
  62. { character: '₻', title: t( 'Nordic mark sign' ) },
  63. { character: '₼', title: t( 'Manat sign' ) },
  64. { character: '₽', title: t( 'Ruble sign' ) }
  65. ] );
  66. }
  67. }