Commit | Line | Data |
---|---|---|
78e9a6ca MW |
1 | /** |
2 | * @license Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. | |
ff6ab9ba | 3 | * For licensing, see LICENSE.md or http://ckeditor.com/license |
78e9a6ca MW |
4 | */ |
5 | ||
6 | /** | |
7 | * @fileOverview The "divarea" plugin. It registers the "wysiwyg" editing | |
8 | * mode using a DIV element. | |
9 | */ | |
10 | ||
11 | CKEDITOR.plugins.add( 'divarea', { | |
12 | afterInit: function( editor ) { | |
13 | // Add the "wysiwyg" mode. | |
14 | // Do that in the afterInit function, so it'll eventually overwrite | |
15 | // the mode defined by the wysiwygarea plugin. | |
16 | editor.addMode( 'wysiwyg', function( callback ) { | |
17 | var editingBlock = CKEDITOR.dom.element.createFromHtml( '<div class="cke_wysiwyg_div cke_reset" hidefocus="true"></div>' ); | |
18 | ||
19 | var contentSpace = editor.ui.space( 'contents' ); | |
20 | contentSpace.append( editingBlock ); | |
21 | ||
22 | editingBlock = editor.editable( editingBlock ); | |
23 | ||
24 | editingBlock.detach = CKEDITOR.tools.override( editingBlock.detach, | |
25 | function( org ) { | |
26 | return function() { | |
27 | org.apply( this, arguments ); | |
28 | this.remove(); | |
29 | }; | |
30 | }); | |
31 | ||
32 | editor.setData( editor.getData( 1 ), callback ); | |
33 | editor.fire( 'contentDom' ); | |
34 | }); | |
35 | } | |
36 | }); |