ckeditor.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /**
  2. * @license Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. /* global requirejs, define, require, window */
  6. 'use strict';
  7. // This file is required for the development version of CKEditor only. It bootstraps the API.
  8. // Basic Require.js configuration.
  9. requirejs.config( {
  10. // Modules are generally relative to the core project.
  11. baseUrl: '../node_modules/ckeditor-core/src/',
  12. paths: {
  13. // The RequireJS "plugin" plugin.
  14. plugin: '../src/plugin'
  15. }
  16. } );
  17. ( function( root ) {
  18. if ( root.CKEDITOR ) {
  19. return;
  20. }
  21. root.CKEDITOR = {
  22. /**
  23. * Defines an AMD module.
  24. *
  25. * See https://github.com/ckeditor/ckeditor5-design/wiki/AMD for more details about our AMD API.
  26. *
  27. * @method
  28. * @member CKEDITOR
  29. */
  30. define: define,
  31. /**
  32. * Retrieves one or more AMD modules.
  33. *
  34. * Note that the CKEditor AMD API does not download modules on demand so be sure to have their relative scripts
  35. * available in the page.
  36. *
  37. * See https://github.com/ckeditor/ckeditor5-design/wiki/AMD for more details about our AMD API.
  38. *
  39. * @method
  40. * @member CKEDITOR
  41. */
  42. require: require,
  43. // Documented in ckeditor-core/src/ckeditor.js.
  44. // This is the development version of this method, which overrides the default one.
  45. getPluginPath: function( name ) {
  46. return CKEDITOR.basePath + 'node_modules/ckeditor-plugin-' + name + '/src/';
  47. }
  48. };
  49. // Load the core CKEDITOR object and extend/override some of its methods with the above.
  50. require( [ 'ckeditor', 'tools/utils' ], function( CKEDITOR, utils ) {
  51. utils.extend( CKEDITOR, root.CKEDITOR );
  52. root.CKEDITOR = CKEDITOR;
  53. } );
  54. } )( window );