attribute.js 977 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. * Linear data attribute. Attributes can store any additional information, its meaning is defined by the code which
  9. * use the.
  10. *
  11. *
  12. * Note that if two attributes has the same meaning the same `Attribute` instance should be used.
  13. * To handle this use {@link document.AttributeFactory}.
  14. *
  15. * @class Attribute
  16. */
  17. class Attribute {
  18. /**
  19. * Create a new attribute class. Once attribute is created it should not be modified.
  20. *
  21. * @param {String} key Attribute key
  22. * @param {Mixed} value Attribute value
  23. */
  24. constructor( key, value ) {
  25. this.key = key;
  26. this.value = value;
  27. }
  28. /**
  29. * Attribute key
  30. *
  31. * @readonly
  32. * @property {String} key
  33. */
  34. /**
  35. * Attribute value
  36. *
  37. * @readonly
  38. * @property {Mixed} value
  39. */
  40. }
  41. return Attribute;
  42. } );