JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.6.3
[ckeditor.git] / _samples / ui_color.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>UI Color Picker &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 </head>\r
14 <body>\r
15         <h1 class="samples">\r
16                 CKEditor Sample &mdash; UI Color Picker\r
17         </h1>\r
18         <div class="description">\r
19         <p>\r
20                 This sample shows how to automatically replace <code>&lt;textarea&gt;</code> elements\r
21                 with a CKEditor instance with an option to change the color of its user interface.\r
22         </p>\r
23         <h2 class="samples">Setting the User Interface Color</h2>\r
24         <p>\r
25         To specify the color of the user interface, set the <code>uiColor</code> property:\r
26         </p>\r
27         <pre class="samples">CKEDITOR.replace( '<em>textarea_id</em>',\r
28         {\r
29                 <strong>uiColor: '#EE0000'</strong>\r
30         });</pre>\r
31         <p>\r
32                 Note that <code><em>textarea_id</em></code> in the code above is the <code>id</code> attribute of\r
33                 the <code>&lt;textarea&gt;</code> element to be replaced.\r
34         </p>\r
35         <h2 class="samples">Enabling the Color Picker</h2>\r
36         <p>\r
37                 If the <strong>uicolor</strong> plugin along with the dedicated <strong>UIColor</strong>\r
38                 toolbar button is added to CKEditor, the user will also be able to pick the color of the\r
39                 UI from the color palette available in the <strong>UI Color Picker</strong> dialog window.\r
40         </p>\r
41         <p>\r
42                 To insert a CKEditor instance with the <strong>uicolor</strong> plugin enabled,\r
43                 use the following JavaScript call:\r
44         </p>\r
45         <pre class="samples">CKEDITOR.replace( '<em>textarea_id</em>',\r
46         {\r
47                 <strong>extraPlugins : 'uicolor',</strong>\r
48                 toolbar : [ [ 'Bold', 'Italic' ], [ <strong>'UIColor'</strong> ] ]\r
49         });</pre>\r
50         </div>\r
51         <!-- This <div> holds alert messages to be display in the sample page. -->\r
52         <div id="alerts">\r
53                 <noscript>\r
54                         <p>\r
55                                 <strong>CKEditor requires JavaScript to run</strong>. In a browser with no JavaScript\r
56                                 support, like yours, you should still see the contents (HTML data) and you should\r
57                                 be able to edit it normally, without a rich editor interface.\r
58                         </p>\r
59                 </noscript>\r
60         </div>\r
61         <p>\r
62                 Click the <strong>UI Color Picker</strong> button to test your color preferences at runtime.\r
63         </p>\r
64         <p>\r
65                 The first editor instance includes the <strong>UI Color Picker</strong> toolbar button,\r
66                 but the default UI color is not defined, so the editor uses the skin color.\r
67         </p>\r
68         <form action="sample_posteddata.php" method="post">\r
69         <p>\r
70                 <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
71                 <script type="text/javascript">\r
72                 //<![CDATA[\r
73 \r
74                         // Replace the <textarea id="editor"> with an CKEditor\r
75                         // instance, using default configurations.\r
76                         CKEDITOR.replace( 'editor1',\r
77                                 {\r
78                                         extraPlugins : 'uicolor',\r
79                                         toolbar :\r
80                                         [\r
81                                                 [ 'Bold', 'Italic', '-', 'NumberedList', 'BulletedList', '-', 'Link', 'Unlink' ],\r
82                                                 [ 'UIColor' ]\r
83                                         ]\r
84                                 });\r
85 \r
86                 //]]>\r
87                 </script>\r
88         </p>\r
89         <p>\r
90                 The second editor instance includes the <strong>UI Color Picker</strong> toolbar button. The\r
91                 default UI color was defined, so the skin color is not used.\r
92         </p>\r
93         <p>\r
94                 <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
95                 <script type="text/javascript">\r
96                 //<![CDATA[\r
97 \r
98                         // Replace the <textarea id="editor"> with an CKEditor\r
99                         // instance, using default configurations.\r
100                         CKEDITOR.replace( 'editor2',\r
101                                 {\r
102                                         extraPlugins : 'uicolor',\r
103                                         uiColor: '#14B8C4',\r
104                                         toolbar :\r
105                                         [\r
106                                                 [ 'Bold', 'Italic', '-', 'NumberedList', 'BulletedList', '-', 'Link', 'Unlink' ],\r
107                                                 [ 'UIColor' ]\r
108                                         ]\r
109                                 } );\r
110 \r
111                 //]]>\r
112                 </script>\r
113         </p>\r
114         <p>\r
115                 <input type="submit" value="Submit" />\r
116         </p>\r
117         </form>\r
118         <div id="footer">\r
119                 <hr />\r
120                 <p>\r
121                         CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>\r
122                 </p>\r
123                 <p id="copy">\r
124                         Copyright &copy; 2003-2012, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico\r
125                         Knabben. All rights reserved.\r
126                 </p>\r
127         </div>\r
128 </body>\r
129 </html>\r