danielebarchiesi@0
|
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
danielebarchiesi@0
|
2 <!--
|
danielebarchiesi@0
|
3 Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
|
danielebarchiesi@0
|
4 For licensing, see LICENSE.html or http://ckeditor.com/license
|
danielebarchiesi@0
|
5 -->
|
danielebarchiesi@0
|
6 <html xmlns="http://www.w3.org/1999/xhtml">
|
danielebarchiesi@0
|
7 <head>
|
danielebarchiesi@0
|
8 <title>Shared Toolbars — CKEditor Sample</title>
|
danielebarchiesi@0
|
9 <meta content="text/html; charset=utf-8" http-equiv="content-type" />
|
danielebarchiesi@0
|
10 <script type="text/javascript" src="../ckeditor.js"></script>
|
danielebarchiesi@0
|
11 <script src="sample.js" type="text/javascript"></script>
|
danielebarchiesi@0
|
12 <link href="sample.css" rel="stylesheet" type="text/css" />
|
danielebarchiesi@0
|
13 <style id="styles" type="text/css">
|
danielebarchiesi@0
|
14
|
danielebarchiesi@0
|
15 #editorsForm
|
danielebarchiesi@0
|
16 {
|
danielebarchiesi@0
|
17 height: 400px;
|
danielebarchiesi@0
|
18 overflow: auto;
|
danielebarchiesi@0
|
19 border: solid 1px #555;
|
danielebarchiesi@0
|
20 margin: 10px 0;
|
danielebarchiesi@0
|
21 padding: 0 10px;
|
danielebarchiesi@0
|
22 }
|
danielebarchiesi@0
|
23
|
danielebarchiesi@0
|
24 </style>
|
danielebarchiesi@0
|
25 </head>
|
danielebarchiesi@0
|
26 <body>
|
danielebarchiesi@0
|
27 <h1 class="samples">
|
danielebarchiesi@0
|
28 CKEditor Sample — Shared Toolbars
|
danielebarchiesi@0
|
29 </h1>
|
danielebarchiesi@0
|
30 <div class="description">
|
danielebarchiesi@0
|
31 <p>
|
danielebarchiesi@0
|
32 This sample shows how to configure multiple CKEditor instances to share some parts of the interface.
|
danielebarchiesi@0
|
33 You can choose to share the toolbar (<code>topSpace</code>), the elements path
|
danielebarchiesi@0
|
34 (<code>bottomSpace</code>), or both.
|
danielebarchiesi@0
|
35 </p>
|
danielebarchiesi@0
|
36 <p>
|
danielebarchiesi@0
|
37 CKEditor instances with shared spaces can be inserted with a JavaScript call using the following code:
|
danielebarchiesi@0
|
38 </p>
|
danielebarchiesi@0
|
39 <pre class="samples">CKEDITOR.replace( '<em>textarea_id</em>',
|
danielebarchiesi@0
|
40 {
|
danielebarchiesi@0
|
41 <strong>sharedSpaces :
|
danielebarchiesi@0
|
42 {
|
danielebarchiesi@0
|
43 top : 'topSpace',
|
danielebarchiesi@0
|
44 bottom : 'bottomSpace'
|
danielebarchiesi@0
|
45 }</strong>
|
danielebarchiesi@0
|
46 });</pre>
|
danielebarchiesi@0
|
47 <p>
|
danielebarchiesi@0
|
48 Note that <code><em>textarea_id</em></code> in the code above is the <code>id</code> attribute of
|
danielebarchiesi@0
|
49 the <code><textarea></code> element to be replaced with CKEditor.
|
danielebarchiesi@0
|
50 </p>
|
danielebarchiesi@0
|
51 </div>
|
danielebarchiesi@0
|
52 <!-- This <div> holds alert messages to be display in the sample page. -->
|
danielebarchiesi@0
|
53 <div id="alerts">
|
danielebarchiesi@0
|
54 <noscript>
|
danielebarchiesi@0
|
55 <p>
|
danielebarchiesi@0
|
56 <strong>CKEditor requires JavaScript to run</strong>. In a browser with no JavaScript
|
danielebarchiesi@0
|
57 support, like yours, you should still see the contents (HTML data) and you should
|
danielebarchiesi@0
|
58 be able to edit it normally, without a rich editor interface.
|
danielebarchiesi@0
|
59 </p>
|
danielebarchiesi@0
|
60 </noscript>
|
danielebarchiesi@0
|
61 </div>
|
danielebarchiesi@0
|
62 <div id="topSpace">
|
danielebarchiesi@0
|
63 </div>
|
danielebarchiesi@0
|
64 <form action="sample_posteddata.php" id="editorsForm" method="post">
|
danielebarchiesi@0
|
65 <p>
|
danielebarchiesi@0
|
66 <label for="editor1">
|
danielebarchiesi@0
|
67 Editor 1 (uses the shared toolbar and elements path):</label>
|
danielebarchiesi@0
|
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>
|
danielebarchiesi@0
|
69 </p>
|
danielebarchiesi@0
|
70 <p>
|
danielebarchiesi@0
|
71 <label for="editor2">
|
danielebarchiesi@0
|
72 Editor 2 (uses the shared toolbar and elements path):</label>
|
danielebarchiesi@0
|
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>
|
danielebarchiesi@0
|
74 </p>
|
danielebarchiesi@0
|
75 <p>
|
danielebarchiesi@0
|
76 <label for="editor3">
|
danielebarchiesi@0
|
77 Editor 3 (uses the shared toolbar only):</label>
|
danielebarchiesi@0
|
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>
|
danielebarchiesi@0
|
79 </p>
|
danielebarchiesi@0
|
80 <p>
|
danielebarchiesi@0
|
81 <label for="editor4">
|
danielebarchiesi@0
|
82 Editor 4 (no shared spaces):</label>
|
danielebarchiesi@0
|
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>
|
danielebarchiesi@0
|
84 </p>
|
danielebarchiesi@0
|
85 <p>
|
danielebarchiesi@0
|
86 <input type="submit" value="Submit" />
|
danielebarchiesi@0
|
87 </p>
|
danielebarchiesi@0
|
88 </form>
|
danielebarchiesi@0
|
89 <div id="bottomSpace">
|
danielebarchiesi@0
|
90 </div>
|
danielebarchiesi@0
|
91 <div id="footer">
|
danielebarchiesi@0
|
92 <hr />
|
danielebarchiesi@0
|
93 <p>
|
danielebarchiesi@0
|
94 CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
|
danielebarchiesi@0
|
95 </p>
|
danielebarchiesi@0
|
96 <p id="copy">
|
danielebarchiesi@0
|
97 Copyright © 2003-2013, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico
|
danielebarchiesi@0
|
98 Knabben. All rights reserved.
|
danielebarchiesi@0
|
99 </p>
|
danielebarchiesi@0
|
100 </div>
|
danielebarchiesi@0
|
101 <script type="text/javascript">
|
danielebarchiesi@0
|
102 //<![CDATA[
|
danielebarchiesi@0
|
103
|
danielebarchiesi@0
|
104 // Create all editor instances at the end of the page, so we are sure
|
danielebarchiesi@0
|
105 // that the "bottomSpace" div is available in the DOM (IE issue).
|
danielebarchiesi@0
|
106
|
danielebarchiesi@0
|
107 CKEDITOR.replace( 'editor1',
|
danielebarchiesi@0
|
108 {
|
danielebarchiesi@0
|
109 sharedSpaces :
|
danielebarchiesi@0
|
110 {
|
danielebarchiesi@0
|
111 top : 'topSpace',
|
danielebarchiesi@0
|
112 bottom : 'bottomSpace'
|
danielebarchiesi@0
|
113 },
|
danielebarchiesi@0
|
114
|
danielebarchiesi@0
|
115 // Removes the maximize plugin as it's not usable
|
danielebarchiesi@0
|
116 // in a shared toolbar.
|
danielebarchiesi@0
|
117 // Removes the resizer as it's not usable in a
|
danielebarchiesi@0
|
118 // shared elements path.
|
danielebarchiesi@0
|
119 removePlugins : 'maximize,resize'
|
danielebarchiesi@0
|
120 } );
|
danielebarchiesi@0
|
121
|
danielebarchiesi@0
|
122 CKEDITOR.replace( 'editor2',
|
danielebarchiesi@0
|
123 {
|
danielebarchiesi@0
|
124 sharedSpaces :
|
danielebarchiesi@0
|
125 {
|
danielebarchiesi@0
|
126 top : 'topSpace',
|
danielebarchiesi@0
|
127 bottom : 'bottomSpace'
|
danielebarchiesi@0
|
128 },
|
danielebarchiesi@0
|
129
|
danielebarchiesi@0
|
130 // Removes the maximize plugin as it's not usable
|
danielebarchiesi@0
|
131 // in a shared toolbar.
|
danielebarchiesi@0
|
132 // Removes the resizer as it's not usable in a
|
danielebarchiesi@0
|
133 // shared elements path.
|
danielebarchiesi@0
|
134 removePlugins : 'maximize,resize'
|
danielebarchiesi@0
|
135 } );
|
danielebarchiesi@0
|
136
|
danielebarchiesi@0
|
137 CKEDITOR.replace( 'editor3',
|
danielebarchiesi@0
|
138 {
|
danielebarchiesi@0
|
139 sharedSpaces :
|
danielebarchiesi@0
|
140 {
|
danielebarchiesi@0
|
141 top : 'topSpace'
|
danielebarchiesi@0
|
142 },
|
danielebarchiesi@0
|
143
|
danielebarchiesi@0
|
144 // Removes the maximize plugin as it's not usable
|
danielebarchiesi@0
|
145 // in a shared toolbar.
|
danielebarchiesi@0
|
146 removePlugins : 'maximize'
|
danielebarchiesi@0
|
147 } );
|
danielebarchiesi@0
|
148
|
danielebarchiesi@0
|
149 CKEDITOR.replace( 'editor4' );
|
danielebarchiesi@0
|
150 //]]>
|
danielebarchiesi@0
|
151 </script>
|
danielebarchiesi@0
|
152 </body>
|
danielebarchiesi@0
|
153 </html>
|