8
0

editorconfig.js 952 B

1234567891011121314151617181920212223242526272829303132333435
  1. /**
  2. * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. 'use strict';
  6. import CKEDITOR from '../../ckeditor.js';
  7. import Config from '../utils/config.js';
  8. /**
  9. * Handles a configuration dictionary for an editor instance.
  10. *
  11. * The basic difference between {@link core.EditorConfig} and {@link utils.Config} is that {@link core.EditorConfig#get} retrieves
  12. * configurations from {@link CKEDITOR#config} if they are not found.
  13. *
  14. * @memberOf core
  15. * @extends utils.Config
  16. */
  17. export default class EditorConfig extends Config {
  18. /**
  19. * @inheritDoc
  20. */
  21. get() {
  22. // Try to take it from this editor instance.
  23. let value = super.get.apply( this, arguments );
  24. // If the configuration is not defined in the instance, try to take it from CKEDITOR.config.
  25. if ( typeof value == 'undefined' ) {
  26. value = super.get.apply( CKEDITOR.config, arguments );
  27. }
  28. return value;
  29. }
  30. }