3 Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
\r
4 For licensing, see LICENSE.html or http://ckeditor.com/license
\r
8 <title>XHTML Compliant Output — CKEditor Sample</title>
\r
9 <meta charset="utf-8">
\r
10 <meta name="ckeditor-sample-required-plugins" content="sourcearea">
\r
11 <script src="../ckeditor.js"></script>
\r
12 <script src="../samples/sample.js"></script>
\r
13 <link href="sample.css" rel="stylesheet">
\r
16 <h1 class="samples">
\r
17 <a href="index.html">CKEditor Samples</a> » Producing XHTML Compliant Output
\r
19 <div class="description">
\r
21 This sample shows how to configure CKEditor to output valid
\r
22 <a class="samples" href="http://www.w3.org/TR/xhtml11/">XHTML 1.1</a> code.
\r
23 Deprecated elements (<code><font></code>, <code><u></code>) or attributes
\r
24 (<code>size</code>, <code>face</code>) will be replaced with XHTML compliant code.
\r
27 To add a CKEditor instance outputting valid XHTML code, load the editor using a standard
\r
28 JavaScript call and define CKEditor features to use the XHTML compliant elements and styles.
\r
31 A snippet of the configuration code can be seen below; check the source of this page for
\r
34 <pre class="samples">
\r
35 CKEDITOR.replace( '<em>textarea_id</em>', {
\r
36 contentsCss: 'assets/outputxhtml.css',
\r
40 attributes: { 'class': 'Bold' }
\r
42 coreStyles_italic: {
\r
44 attributes: { 'class': 'Italic' }
\r
50 <form action="sample_posteddata.php" method="post">
\r
52 <label for="editor1">
\r
55 <textarea cols="80" id="editor1" name="editor1" rows="10"><p>This is some <span class="Bold">sample text</span>. You are using <a href="http://ckeditor.com/">CKEditor</a>.</p></textarea>
\r
58 CKEDITOR.replace( 'editor1', {
\r
60 * Style sheet for the contents
\r
62 contentsCss: 'assets/outputxhtml/outputxhtml.css',
\r
69 attributes: { 'class': 'Bold' }
\r
71 coreStyles_italic: {
\r
73 attributes: { 'class': 'Italic' }
\r
75 coreStyles_underline: {
\r
77 attributes: { 'class': 'Underline' }
\r
79 coreStyles_strike: {
\r
81 attributes: { 'class': 'StrikeThrough' },
\r
84 coreStyles_subscript: {
\r
86 attributes: { 'class': 'Subscript' },
\r
89 coreStyles_superscript: {
\r
91 attributes: { 'class': 'Superscript' },
\r
99 // List of fonts available in the toolbar combo. Each font definition is
\r
100 // separated by a semi-colon (;). We are using class names here, so each font
\r
101 // is defined by {Combo Label}/{Class Name}.
\r
102 font_names: 'Comic Sans MS/FontComic;Courier New/FontCourier;Times New Roman/FontTimes',
\r
104 // Define the way font elements will be applied to the document. The "span"
\r
105 // element will be used. When a font is selected, the font name defined in the
\r
106 // above list is passed to this definition with the name "Font", being it
\r
107 // injected in the "class" attribute.
\r
108 // We must also instruct the editor to replace span elements that are used to
\r
109 // set the font (Overrides).
\r
112 attributes: { 'class': '#(family)' },
\r
117 'class': /^Font(?:Comic|Courier|Times)$/
\r
126 fontSize_sizes: 'Smaller/FontSmaller;Larger/FontLarger;8pt/FontSmall;14pt/FontBig;Double Size/FontDouble',
\r
129 attributes: { 'class': '#(size)' },
\r
134 'class': /^Font(?:Smaller|Larger|Small|Big|Double)$/
\r
143 colorButton_enableMore: false,
\r
145 colorButton_colors: 'FontColor1/FF9900,FontColor2/0066CC,FontColor3/F00',
\r
146 colorButton_foreStyle: {
\r
148 attributes: { 'class': '#(color)' },
\r
153 'class': /^FontColor(?:1|2|3)$/
\r
159 colorButton_backStyle: {
\r
161 attributes: { 'class': '#(color)BG' },
\r
166 'class': /^FontColor(?:1|2|3)BG$/
\r
175 indentClasses: [ 'Indent1', 'Indent2', 'Indent3' ],
\r
178 * Paragraph justification.
\r
180 justifyClasses: [ 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyFull' ],
\r
186 { name: 'Strong Emphasis', element: 'strong' },
\r
187 { name: 'Emphasis', element: 'em' },
\r
189 { name: 'Computer Code', element: 'code' },
\r
190 { name: 'Keyboard Phrase', element: 'kbd' },
\r
191 { name: 'Sample Text', element: 'samp' },
\r
192 { name: 'Variable', element: 'var' },
\r
194 { name: 'Deleted Text', element: 'del' },
\r
195 { name: 'Inserted Text', element: 'ins' },
\r
197 { name: 'Cited Work', element: 'cite' },
\r
198 { name: 'Inline Quotation', element: 'q' }
\r
205 <input type="submit" value="Submit">
\r
211 CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
\r
214 Copyright © 2003-2013, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico
\r
215 Knabben. All rights reserved.
\r