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