3 Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
4 For licensing, see LICENSE.md or http://ckeditor.com/license
9 <title>Editing source code in a dialog — CKEditor Sample</title>
10 <script src="../../../ckeditor.js"></script>
11 <link rel="stylesheet" href="../../../samples/old/sample.css">
12 <meta name="ckeditor-sample-name" content="Editing source code in a dialog">
13 <meta name="ckeditor-sample-group" content="Plugins">
14 <meta name="ckeditor-sample-description" content="Editing HTML content of both inline and classic editor instances.">
15 <meta name="ckeditor-sample-isnew" content="1">
28 <a href="../../../samples/old/index.html">CKEditor Samples</a> » Editing source code in a dialog
30 <div class="warning deprecated">
31 This sample is not maintained anymore. Check out its <a href="http://sdk.ckeditor.com/samples/sourcearea.html">brand new version in CKEditor SDK</a>.
33 <div class="description">
35 <strong>Sourcedialog</strong> plugin provides an easy way to edit raw HTML content
36 of an editor, similarly to what is possible with <strong>Sourcearea</strong>
37 plugin for classic (<code>iframe</code>-based) instances but using dialogs. Thanks to that, it's also possible
38 to manipulate raw content of inline editor instances.
41 This plugin extends the toolbar with a button,
42 which opens a dialog window with a source code editor. It works with both classic
43 and inline instances. To enable this
44 plugin, basically add <code>extraPlugins: 'sourcedialog'</code> to editor's
49 CKEDITOR.inline( 'editable', {
50 <strong>extraPlugins: 'sourcedialog'</strong>
53 // Classic (iframe-based) editor.
54 CKEDITOR.replace( 'textarea_id', {
55 <strong>extraPlugins: 'sourcedialog'</strong>,
56 removePlugins: 'sourcearea'
60 Note that you may want to include <code>removePlugins: 'sourcearea'</code>
61 in your config when using <strong>Sourcedialog</strong> in classic editor instances.
62 This prevents feature redundancy.
65 Note that <code>editable</code> in the code above is the <code>id</code>
66 attribute of the <code><div></code> element to be converted into an inline instance.
69 Note that <code><em>textarea_id</em></code> in the code above is the <code>id</code> attribute of
70 the <code><textarea></code> element to be replaced with CKEditor.
77 <div id="editor1" contenteditable="true" style="padding: 5px 20px;">
78 <p>This is some <strong>sample text</strong>. You are using <a href="http://ckeditor.com/">CKEditor</a>.</p>
86 <textarea cols="80" id="editor2" name="editor2" rows="10">
87 This is some <strong>sample text</strong>. You are using <a href="http://ckeditor.com/">CKEditor</a>.
92 // We need to turn off the automatic editor creation first.
93 CKEDITOR.disableAutoInline = true;
98 { name: 'basicstyles' },
101 extraPlugins: 'sourcedialog',
102 removePlugins: 'sourcearea'
105 CKEDITOR.inline( 'editor1', config );
106 CKEDITOR.replace( 'editor2', config );
112 CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">
113 http://ckeditor.com</a>
116 Copyright © 2003-2016, <a class="samples" href="http://cksource.com/">CKSource</a>
117 - Frederico Knabben. All rights reserved.