specialcharactersmathematical.js 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /**
  2. * @license Copyright (c) 2003-2019, 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/specialcharactersmathematical
  7. */
  8. import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
  9. import SpecialCharacters from './specialcharacters';
  10. /**
  11. * A plugin provides special characters for the "Mathematical" category.
  12. *
  13. * ClassicEditor
  14. * .create( {
  15. * plugins: [ ..., SpecialCharacters, SpecialCharactersMathematical ],
  16. * } )
  17. * .then( ... )
  18. * .catch( ... );
  19. *
  20. * @extends module:core/plugin~Plugin
  21. */
  22. export default class SpecialCharactersMathematical extends Plugin {
  23. /**
  24. * @inheritDoc
  25. */
  26. static get requires() {
  27. return [ SpecialCharacters ];
  28. }
  29. /**
  30. * @inheritDoc
  31. */
  32. init() {
  33. const editor = this.editor;
  34. const t = editor.t;
  35. editor.plugins.get( 'SpecialCharacters' ).addItems( 'Mathematical', [
  36. { character: '<', title: t( 'Less-than sign' ) },
  37. { character: '>', title: t( 'Greater-than sign' ) },
  38. { character: '≤', title: t( 'Less-than or equal to' ) },
  39. { character: '≥', title: t( 'Greater-than or equal to' ) },
  40. { character: '–', title: t( 'En dash' ) },
  41. { character: '—', title: t( 'Em dash' ) },
  42. { character: '¯', title: t( 'Macron' ) },
  43. { character: '‾', title: t( 'Overline' ) },
  44. { character: '°', title: t( 'Degree sign' ) },
  45. { character: '−', title: t( 'Minus sign' ) },
  46. { character: '±', title: t( 'Plus-minus sign' ) },
  47. { character: '÷', title: t( 'Division sign' ) },
  48. { character: '⁄', title: t( 'Fraction slash' ) },
  49. { character: '×', title: t( 'Multiplication sign' ) },
  50. { character: 'ƒ', title: t( 'Latin small letter f with hook' ) },
  51. { character: '∫', title: t( 'Integral' ) },
  52. { character: '∑', title: t( 'N-ary summation' ) },
  53. { character: '∞', title: t( 'Infinity' ) },
  54. { character: '√', title: t( 'Square root' ) },
  55. { character: '∼', title: t( 'Tilde operator' ) },
  56. { character: '≅', title: t( 'Approximately equal to' ) },
  57. { character: '≈', title: t( 'Almost equal to' ) },
  58. { character: '≠', title: t( 'Not equal to' ) },
  59. { character: '≡', title: t( 'Identical to' ) },
  60. { character: '∈', title: t( 'Element of' ) },
  61. { character: '∉', title: t( 'Not an element of' ) },
  62. { character: '∋', title: t( 'Contains as member' ) },
  63. { character: '∏', title: t( 'N-ary product' ) },
  64. { character: '∧', title: t( 'Logical and' ) },
  65. { character: '∨', title: t( 'Logical or' ) },
  66. { character: '¬', title: t( 'Not sign' ) },
  67. { character: '∩', title: t( 'Intersection' ) },
  68. { character: '∪', title: t( 'Union' ) },
  69. { character: '∂', title: t( 'Partial differential' ) },
  70. { character: '∀', title: t( 'For all' ) },
  71. { character: '∃', title: t( 'There exists' ) },
  72. { character: '∅', title: t( 'Empty set' ) },
  73. { character: '∇', title: t( 'Nabla' ) },
  74. { character: '∗', title: t( 'Asterisk operator' ) },
  75. { character: '∝', title: t( 'Proportional to' ) },
  76. { character: '∠', title: t( 'Angle' ) },
  77. { character: '¼', title: t( 'Vulgar fraction one quarter' ) },
  78. { character: '½', title: t( 'Vulgar fraction one half' ) },
  79. { character: '¾', title: t( 'Vulgar fraction three quarters' ) }
  80. ] );
  81. }
  82. }