cirandas.net

ref: master

public/javascripts/tinymce/tools/docs/tinymce.Editor.js


  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
/**
 * This file contains the documentation for all TinyMCE Editor events.
 */

// Native DOM events:
// focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange
// mouseout mouseenter mouseleave keydown keypress keyup contextmenu dragend dragover draggesture dragdrop drop drag

// Custom events:
// BeforeRenderUI SetAttrib PreInit (PostRender) init deactivate activate NodeChange BeforeExecCommand ExecCommand show hide
// ProgressState LoadContent SaveContent BeforeSetContent SetContent BeforeGetContent GetContent (VisualAid) remove submit reset
// BeforeAddUndo AddUndo change undo redo (ClearUndos) ObjectSelected ObjectResizeStart ObjectResized PreProcess PostProcess focus blur

// Plugin events:
// autosave: StoreDraft, RestoreDraft
// paste: PastePreProcess, 
// fullscreen: FullscreenStateChanged
// spellcheck: SpellcheckStart, SpellcheckEnd

/**
 * Fires before the UI gets rendered.
 *
 * @example
 * tinymce.init({
 *     ...
 *     setup: function(editor) {
 *         editor.on('BeforeRenderUI', function(e) {
 *             console.log('BeforeRenderUI event', e);
 *         });
 *     }
 * });
 *
 * @event BeforeRenderUI
 * @param {tinymce.Event} e Event arguments.
 */

/**
 * Fires when attributes are updated on DOM elements.
 *
 * @example
 * tinymce.init({
 *     ...
 *     setup: function(editor) {
 *         editor.on('SetAttrib', function(e) {
 *             console.log('SetAttrib event', e);
 *         });
 *     }
 * });
 *
 * @event SetAttrib
 * @param {tinymce.Event} e Event arguments.
 */

/**
 * Fires before the editor has been initialized. This is before any contents gets inserted into the editor but
 * after we have selection and dom instances.
 *
 * @example
 * tinymce.init({
 *     ...
 *     setup: function(editor) {
 *         editor.on('PreInit', function(e) {
 *             console.log('PreInit event', e);
 *         });
 *     }
 * });
 *
 * @event PreInit
 * @param {tinymce.Event} e Event arguments.
 */

/**
 * Fires after the editor has been initialized. This is after the editor has been filled with contents.
 *
 * @example
 * tinymce.init({
 *     ...
 *     setup: function(editor) {
 *         editor.on('init', function(e) {
 *             console.log('init event', e);
 *         });
 *     }
 * });
 *
 * @event init
 * @param {tinymce.Event} e Event arguments.
 */

/**
 * Fires when the focus is moved from one editor to another editor.
 *
 * @example
 * tinymce.init({
 *     ...
 *     setup: function(editor) {
 *         editor.on('deactivate', function(e) {
 *             console.log('deactivate event', e);
 *         });
 *     }
 * });
 *
 * @event deactivate
 * @param {tinymce.Event} e Event arguments.
 */

/**
 * Fires when the focus is moved from one editor to another editor.
 *
 * @example
 * tinymce.init({
 *     ...
 *     setup: function(editor) {
 *         editor.on('activate', function(e) {
 *             console.log('activate event', e);
 *         });
 *     }
 * });
 *
 * @event activate
 * @param {tinymce.Event} e Event arguments.
 */

/**
 * Fires when the selection is moved to a new location or is the DOM is updated by some command.
 * This event enables you to update the UI based on the current selection etc.
 *
 * @example
 * tinymce.init({
 *     ...
 *     setup: function(editor) {
 *         editor.on('NodeChange', function(e) {
 *             console.log('NodeChange event', e);
 *         });
 *     }
 * });
 *
 * @event NodeChange
 * @param {tinymce.Event} e Event arguments.
 */

/**
 * Fires before a execCommand call is made. This enables you to prevent it and replace the logic
 * with custom logic.
 *
 * @example
 * tinymce.init({
 *     ...
 *     setup: function(editor) {
 *         editor.on('BeforeExecCommand', function(e) {
 *             console.log('BeforeExecCommand event', e);
 *         });
 *     }
 * });
 *
 * @event BeforeExecCommand
 * @param {tinymce.CommandEvent} e Event arguments.
 */

/**
 * Fires after a execCommand call has been made.
 *
 * @example
 * tinymce.init({
 *     ...
 *     setup: function(editor) {
 *         editor.on('ExecCommand', function(e) {
 *             console.log('ExecCommand event', e);
 *         });
 *     }
 * });
 *
 * @event ExecCommand
 * @param {tinymce.CommandEvent} e Event arguments.
 */


/**
 * Fires when the editor is shown.
 *
 * @example
 * tinymce.init({
 *     ...
 *     setup: function(editor) {
 *         editor.on('show', function(e) {
 *             console.log('show event', e);
 *         });
 *     }
 * });
 *
 * @event show
 * @param {tinymce.Event} e Event arguments.
 */

/**
 * Fires when the editor is hidden.
 *
 * @example
 * tinymce.init({
 *     ...
 *     setup: function(editor) {
 *         editor.on('hide', function(e) {
 *             console.log('hide event', e);
 *         });
 *     }
 * });
 *
 * @event hide
 * @param {tinymce.Event} e Event arguments.
 */

/**
 * Fires when a progress event is made. To display a throbber/loader.
 *
 * @example
 * tinymce.init({
 *     ...
 *     setup: function(editor) {
 *         editor.on('ProgressState', function(e) {
 *             console.log('ProgressState event', e);
 *         });
 *     }
 * });
 *
 * @event ProgressState
 * @param {tinymce.ProgressStateEvent} e Event arguments.
 */

/**
 * Fires after contents has been loaded into the editor.
 *
 * @example
 * tinymce.init({
 *     ...
 *     setup: function(editor) {
 *         editor.on('LoadContent', function(e) {
 *             console.log('LoadContent event', e);
 *         });
 *     }
 * });
 *
 * @event LoadContent
 * @param {tinymce.ContentEvent} e Event arguments.
 */

/**
 * Fires after contents has been saved/extracted from the editor.
 *
 * @example
 * tinymce.init({
 *     ...
 *     setup: function(editor) {
 *         editor.on('SaveContent', function(e) {
 *             console.log('SaveContent event', e);
 *         });
 *     }
 * });
 *
 * @event SaveContent
 * @param {tinymce.ContentEvent} e Event arguments.
 */

/**
 * Fires before contents is inserted into the editor.
 *
 * @example
 * tinymce.init({
 *     ...
 *     setup: function(editor) {
 *         editor.on('BeforeSetContent', function(e) {
 *             console.log('BeforeSetContent event', e);
 *         });
 *     }
 * });
 *
 * @event BeforeSetContent
 * @param {tinymce.ContentEvent} e Event arguments.
 */

/**
 * Fires after contents has been extracted from the editor.
 *
 * @example
 * tinymce.init({
 *     ...
 *     setup: function(editor) {
 *         editor.on('GetContent', function(e) {
 *             console.log('GetContent event', e);
 *         });
 *     }
 * });
 *
 * @event GetContent
 * @param {tinymce.ContentEvent} e Event arguments.
 */

/**
 * Fires when the editor instance is removed.
 *
 * @example
 * tinymce.init({
 *     ...
 *     setup: function(editor) {
 *         editor.on('remove', function(e) {
 *             console.log('remove event', e);
 *         });
 *     }
 * });
 *
 * @event remove
 * @param {tinymce.Event} e Event arguments.
 */

/**
 * Fires when the form containing the editor is submitted.
 *
 * @example
 * tinymce.init({
 *     ...
 *     setup: function(editor) {
 *         editor.on('submit', function(e) {
 *             console.log('submit event', e);
 *         });
 *     }
 * });
 *
 * @event submit
 * @param {tinymce.Event} e Event arguments.
 */

/**
 * Fires when the form containing the editor is resetted.
 *
 * @example
 * tinymce.init({
 *     ...
 *     setup: function(editor) {
 *         editor.on('reset', function(e) {
 *             console.log('reset event', e);
 *         });
 *     }
 * });
 *
 * @event reset
 * @param {tinymce.Event} e Event arguments.
 */

/**
 * Fires before an undo level is added to the editor.
 *
 * @example
 * tinymce.init({
 *     ...
 *     setup: function(editor) {
 *         editor.on('BeforeAddUndo', function(e) {
 *             console.log('BeforeAddUndo event', e);
 *         });
 *     }
 * });
 *
 * @event BeforeAddUndo
 * @param {tinymce.Event} e Event arguments.
 */

/**
 * Fires after an undo level has been added to the editor.
 *
 * @example
 * tinymce.init({
 *     ...
 *     setup: function(editor) {
 *         editor.on('AddUndo', function(e) {
 *             console.log('AddUndo event', e);
 *         });
 *     }
 * });
 *
 * @event AddUndo
 * @param {tinymce.Event} e Event arguments.
 */

/**
 * Fires when contents is modified in the editor.
 *
 * @example
 * tinymce.init({
 *     ...
 *     setup: function(editor) {
 *         editor.on('change', function(e) {
 *             console.log('change event', e);
 *         });
 *     }
 * });
 *
 * @event change
 * @param {tinymce.Event} e Event arguments.
 */

/**
 * Fires when an undo operation is executed.
 *
 * @example
 * tinymce.init({
 *     ...
 *     setup: function(editor) {
 *         editor.on('undo', function(e) {
 *             console.log('undo event', e);
 *         });
 *     }
 * });
 *
 * @event undo
 * @param {tinymce.Event} e Event arguments.
 */

/**
 * Fires when an redo operation is executed.
 *
 * @example
 * tinymce.init({
 *     ...
 *     setup: function(editor) {
 *         editor.on('redo', function(e) {
 *             console.log('redo event', e);
 *         });
 *     }
 * });
 *
 * @event redo
 * @param {tinymce.Event} e Event arguments.
 */

/**
 * Fires when an object is selected such as an image.
 *
 * @example
 * tinymce.init({
 *     ...
 *     setup: function(editor) {
 *         editor.on('ObjectSelected', function(e) {
 *             console.log('ObjectSelected event', e);
 *         });
 *     }
 * });
 *
 * @event ObjectSelected
 * @param {tinymce.Event} e Event arguments.
 */

/**
 * Fires when a resize of an object like an image is about to start.
 *
 * @example
 * tinymce.init({
 *     ...
 *     setup: function(editor) {
 *         editor.on('ObjectResizeStart', function(e) {
 *             console.log('ObjectResizeStart event', e);
 *         });
 *     }
 * });
 *
 * @event ObjectResizeStart
 * @param {tinymce.ResizeEvent} e Event arguments.
 */

/**
 * Fires after an object like an image is resized.
 *
 * @example
 * tinymce.init({
 *     ...
 *     setup: function(editor) {
 *         editor.on('ObjectResized', function(e) {
 *             console.log('ObjectResized event', e);
 *         });
 *     }
 * });
 *
 * @event ObjectResized
 * @param {tinymce.ResizeEvent} e Event arguments.
 */

/**
 * Fires before the contents is processed.
 *
 * @example
 * tinymce.init({
 *     ...
 *     setup: function(editor) {
 *         editor.on('PreProcess', function(e) {
 *             console.log('PreProcess event', e);
 *         });
 *     }
 * });
 *
 * @event PreProcess
 * @param {tinymce.Event} e Event arguments.
 */

/**
 * Fires after the contents has been processed.
 *
 * @example
 * tinymce.init({
 *     ...
 *     setup: function(editor) {
 *         editor.on('PostProcess', function(e) {
 *             console.log('PostProcess event', e);
 *         });
 *     }
 * });
 *
 * @event PostProcess
 * @param {tinymce.Event} e Event arguments.
 */

/**
 * Fires when the editor gets focused.
 *
 * @example
 * tinymce.init({
 *     ...
 *     setup: function(editor) {
 *         editor.on('focus', function(e) {
 *             console.log('focus event', e);
 *         });
 *     }
 * });
 *
 * @event focus
 * @param {tinymce.FocusEvent} e Event arguments.
 */

/**
 * Fires when the editor is blurred.
 *
 * @example
 * tinymce.init({
 *     ...
 *     setup: function(editor) {
 *         editor.on('blur', function(e) {
 *             console.log('blur event', e);
 *         });
 *     }
 * });
 *
 * @event blur
 * @param {tinymce.FocusEvent} e Event arguments.
 */