Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / ckeditor / js / models / Model.es6.js
1 /**
2  * @file
3  * A Backbone Model for the state of a CKEditor toolbar configuration .
4  */
5
6 (function (Drupal, Backbone) {
7   /**
8    * Backbone model for the CKEditor toolbar configuration state.
9    *
10    * @constructor
11    *
12    * @augments Backbone.Model
13    */
14   Drupal.ckeditor.Model = Backbone.Model.extend(/** @lends Drupal.ckeditor.Model# */{
15
16     /**
17      * Default values.
18      *
19      * @type {object}
20      */
21     defaults: /** @lends Drupal.ckeditor.Model# */{
22
23       /**
24        * The CKEditor configuration that is being manipulated through the UI.
25        */
26       activeEditorConfig: null,
27
28       /**
29        * The textarea that contains the serialized representation of the active
30        * CKEditor configuration.
31        */
32       $textarea: null,
33
34       /**
35        * Tracks whether the active toolbar DOM structure has been changed. When
36        * true, activeEditorConfig needs to be updated, and when that is updated,
37        * $textarea will also be updated.
38        */
39       isDirty: false,
40
41       /**
42        * The configuration for the hidden CKEditor instance that is used to
43        * build the features metadata.
44        */
45       hiddenEditorConfig: null,
46
47       /**
48        * A hash that maps buttons to features.
49        */
50       buttonsToFeatures: null,
51
52       /**
53        * A hash, keyed by a feature name, that details CKEditor plugin features.
54        */
55       featuresMetadata: null,
56
57       /**
58        * Whether the button group names are currently visible.
59        */
60       groupNamesVisible: false,
61     },
62
63     /**
64      * @method
65      */
66     sync() {
67       // Push the settings into the textarea.
68       this.get('$textarea').val(JSON.stringify(this.get('activeEditorConfig')));
69     },
70   });
71 }(Drupal, Backbone));