1 <!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
4 For licensing, see LICENSE.html or http://ckeditor.com/license
6 <html xmlns=
"http://www.w3.org/1999/xhtml">
8 <title>Shared Toolbars
— CKEditor Sample
</title>
9 <meta content=
"text/html; charset=utf-8" http-equiv=
"content-type" />
10 <script type=
"text/javascript" src=
"../ckeditor.js"></script>
11 <script src=
"sample.js" type=
"text/javascript"></script>
12 <link href=
"sample.css" rel=
"stylesheet" type=
"text/css" />
13 <style id=
"styles" type=
"text/css">
19 border: solid
1px #
555;
28 CKEditor Sample
— Shared Toolbars
30 <div class=
"description">
32 This sample shows how to configure multiple CKEditor instances to share some parts of the interface.
33 You can choose to share the toolbar (
<code>topSpace
</code>), the elements path
34 (
<code>bottomSpace
</code>), or both.
37 CKEditor instances with shared spaces can be inserted with a JavaScript call using the following code:
39 <pre class=
"samples">CKEDITOR.replace( '
<em>textarea_id
</em>',
41 <strong>sharedSpaces :
44 bottom : 'bottomSpace'
48 Note that
<code><em>textarea_id
</em></code> in the code above is the
<code>id
</code> attribute of
49 the
<code><textarea
></code> element to be replaced with CKEditor.
52 <!-- This <div> holds alert messages to be display in the sample page. -->
56 <strong>CKEditor requires JavaScript to run
</strong>. In a browser with no JavaScript
57 support, like yours, you should still see the contents (HTML data) and you should
58 be able to edit it normally, without a rich editor interface.
64 <form action=
"sample_posteddata.php" id=
"editorsForm" method=
"post">
67 Editor
1 (uses the shared toolbar and elements path):
</label>
68 <textarea cols=
"80" id=
"editor1" name=
"editor1" rows=
"10"><p
>This is some
<strong
>sample text
</strong
>. You are using
<a
href=
"http://ckeditor.com/">CKEditor
</a
>.
</p
></textarea>
72 Editor
2 (uses the shared toolbar and elements path):
</label>
73 <textarea cols=
"80" id=
"editor2" name=
"editor2" rows=
"10"><p
>This is some
<strong
>sample text
</strong
>. You are using
<a
href=
"http://ckeditor.com/">CKEditor
</a
>.
</p
></textarea>
77 Editor
3 (uses the shared toolbar only):
</label>
78 <textarea cols=
"80" id=
"editor3" name=
"editor3" rows=
"10"><p
>This is some
<strong
>sample text
</strong
>. You are using
<a
href=
"http://ckeditor.com/">CKEditor
</a
>.
</p
></textarea>
82 Editor
4 (no shared spaces):
</label>
83 <textarea cols=
"80" id=
"editor4" name=
"editor4" rows=
"10"><p
>This is some
<strong
>sample text
</strong
>. You are using
<a
href=
"http://ckeditor.com/">CKEditor
</a
>.
</p
></textarea>
86 <input type=
"submit" value=
"Submit" />
89 <div id=
"bottomSpace">
94 CKEditor - The text editor for the Internet -
<a class=
"samples" href=
"http://ckeditor.com/">http://ckeditor.com
</a>
97 Copyright
© 2003-
2011,
<a class=
"samples" href=
"http://cksource.com/">CKSource
</a> - Frederico
98 Knabben. All rights reserved.
101 <script type=
"text/javascript">
104 // Create all editor instances at the end of the page, so we are sure
105 // that the
"bottomSpace" div is available in the DOM (IE issue).
107 CKEDITOR.replace( 'editor1',
112 bottom : 'bottomSpace'
115 // Removes the maximize plugin as it's not usable
116 // in a shared toolbar.
117 // Removes the resizer as it's not usable in a
118 // shared elements path.
119 removePlugins : 'maximize,resize'
122 CKEDITOR.replace( 'editor2',
127 bottom : 'bottomSpace'
130 // Removes the maximize plugin as it's not usable
131 // in a shared toolbar.
132 // Removes the resizer as it's not usable in a
133 // shared elements path.
134 removePlugins : 'maximize,resize'
137 CKEDITOR.replace( 'editor3',
144 // Removes the maximize plugin as it's not usable
145 // in a shared toolbar.
146 removePlugins : 'maximize'
149 CKEDITOR.replace( 'editor4' );