]>
git.immae.eu Git - perso/Immae/Projets/packagist/piedsjaloux-ckeditor-component.git/blob - plugindefinition.js
caff95750ac2708eaf230cca9704363695fd9841
2 * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
3 * For licensing, see LICENSE.md or http://ckeditor.com/license
7 * @fileOverview Defines the "virtual" {@link CKEDITOR.pluginDefinition} class which
8 * contains the defintion of a plugin. This file serves documentation
13 * A virtual class that just illustrates the features of plugin objects which are
14 * passed to the {@link CKEDITOR.plugins#add} method.
16 * This class is not really a part of the API, so its constructor should not be called.
20 * * [The Plugin SDK](#!/guide/plugin_sdk_intro)
21 * * [Creating a CKEditor plugin in 20 Lines of Code](#!/guide/plugin_sdk_sample)
22 * * [Creating a Simple Plugin Tutorial](#!/guide/plugin_sdk_sample_1)
24 * @class CKEDITOR.pluginDefinition
29 * A list of plugins that are required by this plugin. Note that this property
30 * does not determine the loading order of the plugins.
32 * CKEDITOR.plugins.add( 'sample', {
33 * requires: 'button,selection'
38 * CKEDITOR.plugins.add( 'sample', {
39 * requires: [ 'button', 'selection' ]
42 * @property {String/String[]} requires
46 * The list of language files available for this plugin. These files are stored inside
47 * the `lang` directory in the plugin directory, follow the name
48 * pattern of `langCode.js`, and contain the language definition created with
49 * {@link CKEDITOR.plugins#setLang}.
51 * When the plugin is being loaded, the editor checks this list to see if
52 * a language file in the current editor language ({@link CKEDITOR.editor#langCode})
53 * is available, and if so, loads it. Otherwise, the file represented by the first item
54 * in the list is loaded.
56 * CKEDITOR.plugins.add( 'sample', {
62 * CKEDITOR.plugins.add( 'sample', {
63 * lang: [ 'en', 'fr' ]
66 * @property {String/String[]} lang
70 * A function called when the plugin definition is loaded for the first time.
71 * It is usually used to execute some code once for the entire page,
72 * for instance code that uses the {@link CKEDITOR}'s methods such as the {@link CKEDITOR#addCss} method.
74 * CKEDITOR.plugins.add( 'sample', {
75 * onLoad: function() {
76 * CKEDITOR.addCss( '.cke_some_class { ... }' );
80 * Read more about the initialization order in the {@link #init} method documentation.
86 * A function called on initialization of every editor instance created on the
87 * page before the {@link #init} call task. This feature makes it possible to
88 * initialize things that could be used in the `init` function of other plugins.
90 * CKEDITOR.plugins.add( 'sample1', {
91 * beforeInit: function( editor ) {
96 * CKEDITOR.plugins.add( 'sample2', {
97 * init: function( editor ) {
98 * // This will work regardless of order in which
99 * // plugins sample1 and sample2 where initialized.
100 * console.log( editor.foo ); // 'bar'
104 * Read more about the initialization order in the {@link #init} method documentation.
107 * @param {CKEDITOR.editor} editor The editor instance being initialized.
111 * A function called on initialization of every editor instance created on the page.
113 * CKEDITOR.plugins.add( 'sample', {
114 * init: function( editor ) {
115 * console.log( 'Editor "' + editor.name + '" is being initialized!' );
119 * Initialization order:
121 * 1. The {@link #beforeInit} methods of all enabled plugins are executed.
122 * 2. The {@link #init} methods of all enabled plugins are executed.
123 * 3. The {@link #afterInit} methods of all enabled plugins are executed.
124 * 4. The {@link CKEDITOR.editor#pluginsLoaded} event is fired.
126 * **Note:** The order in which the `init` methods are called does not depend on the plugins' {@link #requires requirements}
127 * or the order set in the {@link CKEDITOR.config#plugins} option. It may be random and therefore it is
128 * recommended to use the {@link #beforeInit} and {@link #afterInit} methods in order to ensure
129 * the right execution sequence.
131 * See also the {@link #onLoad} method.
134 * @param {CKEDITOR.editor} editor The editor instance being initialized.
138 * A function called on initialization of every editor instance created on the
139 * page after the {@link #init} call task. This feature makes it possible to use things
140 * that were initialized in the `init` function of other plugins.
142 * CKEDITOR.plugins.add( 'sample1', {
143 * afterInit: function( editor ) {
144 * // This will work regardless of order in which
145 * // plugins sample1 and sample2 where initialized.
146 * console.log( editor.foo ); // 'bar'
150 * CKEDITOR.plugins.add( 'sample2', {
151 * init: function( editor ) {
152 * editor.foo = 'bar';
156 * Read more about the initialization order in the {@link #init} method documentation.
159 * @param {CKEDITOR.editor} editor The editor instance being initialized.
163 * Announces the plugin as HiDPI-ready (optimized for high pixel density screens, e.g. *Retina*)
164 * by providing high-resolution icons and images. HiDPI icons must be twice as big
165 * (defaults are `16px x 16px`) and stored under `plugin_name/icons/hidpi/` directory.
167 * The common place for additional HiDPI images used by the plugin (**but not icons**)
168 * is the `plugin_name/images/hidpi/` directory.
170 * This property is optional and only makes sense if `32px x 32px` icons
171 * and high-resolution images actually exist. If this flag is set to `true`, the editor
172 * will automatically detect the HiDPI environment and attempt to load the
173 * high-resolution resources.
176 * @property {Boolean} hidpi