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>UI Color Picker
— 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" />
16 CKEditor Sample
— UI Color Picker
18 <div class=
"description">
20 This sample shows how to automatically replace
<code><textarea
></code> elements
21 with a CKEditor instance with an option to change the color of its user interface.
23 <h2 class=
"samples">Setting the User Interface Color
</h2>
25 To specify the color of the user interface, set the
<code>uiColor
</code> property:
27 <pre class=
"samples">CKEDITOR.replace( '
<em>textarea_id
</em>',
29 <strong>uiColor: '#EE0000'
</strong>
32 Note that
<code><em>textarea_id
</em></code> in the code above is the
<code>id
</code> attribute of
33 the
<code><textarea
></code> element to be replaced.
35 <h2 class=
"samples">Enabling the Color Picker
</h2>
37 If the
<strong>uicolor
</strong> plugin along with the dedicated
<strong>UIColor
</strong>
38 toolbar button is added to CKEditor, the user will also be able to pick the color of the
39 UI from the color palette available in the
<strong>UI Color Picker
</strong> dialog window.
42 To insert a CKEditor instance with the
<strong>uicolor
</strong> plugin enabled,
43 use the following JavaScript call:
45 <pre class=
"samples">CKEDITOR.replace( '
<em>textarea_id
</em>',
47 <strong>extraPlugins : 'uicolor',
</strong>
48 toolbar : [ [ 'Bold', 'Italic' ], [
<strong>'UIColor'
</strong> ] ]
51 <!-- This <div> holds alert messages to be display in the sample page. -->
55 <strong>CKEditor requires JavaScript to run
</strong>. In a browser with no JavaScript
56 support, like yours, you should still see the contents (HTML data) and you should
57 be able to edit it normally, without a rich editor interface.
62 Click the
<strong>UI Color Picker
</strong> button to test your color preferences at runtime.
65 The first editor instance includes the
<strong>UI Color Picker
</strong> toolbar button,
66 but the default UI color is not defined, so the editor uses the skin color.
68 <form action=
"sample_posteddata.php" method=
"post">
70 <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>
71 <script type=
"text/javascript">
74 // Replace the
<textarea id=
"editor"> with an CKEditor
75 // instance, using default configurations.
76 CKEDITOR.replace( 'editor1',
78 extraPlugins : 'uicolor',
81 [ 'Bold', 'Italic', '-', 'NumberedList', 'BulletedList', '-', 'Link', 'Unlink' ],
90 The second editor instance includes the
<strong>UI Color Picker
</strong> toolbar button. The
91 default UI color was defined, so the skin color is not used.
94 <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>
95 <script type=
"text/javascript">
98 // Replace the
<textarea id=
"editor"> with an CKEditor
99 // instance, using default configurations.
100 CKEDITOR.replace( 'editor2',
102 extraPlugins : 'uicolor',
106 [ 'Bold', 'Italic', '-', 'NumberedList', 'BulletedList', '-', 'Link', 'Unlink' ],
115 <input type=
"submit" value=
"Submit" />
121 CKEditor - The text editor for the Internet -
<a class=
"samples" href=
"http://ckeditor.com/">http://ckeditor.com
</a>
124 Copyright
© 2003-
2011,
<a class=
"samples" href=
"http://cksource.com/">CKSource
</a> - Frederico
125 Knabben. All rights reserved.