text.js 818 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /**
  2. * @license Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. 'use strict';
  6. CKEDITOR.define( [], function() {
  7. /**
  8. * Data structure for text with attributes. Note that Text is not a node, because it will never be part of document
  9. * tree, {@link document.Character is a node}.
  10. *
  11. * @class document.Text
  12. */
  13. class Text {
  14. /**
  15. * Creates text with attributes.
  16. *
  17. * @param {String} text Described character.
  18. * @param {Array} attrs Array of attributes.
  19. * @constructor
  20. */
  21. constructor( text, attrs ) {
  22. /**
  23. * Text.
  24. *
  25. * @readonly
  26. * @property {String} text
  27. */
  28. this.text = text;
  29. /**
  30. * Array of attributes.
  31. *
  32. * @property {Array} attr
  33. */
  34. this.attrs = attrs;
  35. }
  36. }
  37. return Text;
  38. } );