1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
---|
2 | <!-- |
---|
3 | Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. |
---|
4 | For licensing, see LICENSE.html or http://ckeditor.com/license |
---|
5 | --> |
---|
6 | <html xmlns="http://www.w3.org/1999/xhtml"> |
---|
7 | <head> |
---|
8 | <title>Using Stylesheet Parser Plugin — CKEditor Sample</title> |
---|
9 | <meta content="text/html; charset=utf-8" http-equiv="content-type" /> |
---|
10 | <!-- CKReleaser %REMOVE_LINE% |
---|
11 | <script type="text/javascript" src="../ckeditor.js"></script> |
---|
12 | CKReleaser %REMOVE_START% --> |
---|
13 | <script type="text/javascript" src="../ckeditor_source.js"></script> |
---|
14 | <!-- CKReleaser %REMOVE_END% --> |
---|
15 | <script src="sample.js" type="text/javascript"></script> |
---|
16 | <link href="sample.css" rel="stylesheet" type="text/css" /> |
---|
17 | </head> |
---|
18 | <body> |
---|
19 | <h1 class="samples"> |
---|
20 | CKEditor Sample — Using the Stylesheet Parser Plugin |
---|
21 | </h1> |
---|
22 | <div class="description"> |
---|
23 | <p> |
---|
24 | This sample shows how to configure CKEditor instances to use the |
---|
25 | <strong>Stylesheet Parser</strong> (<code>stylesheetparser</code>) plugin that fills |
---|
26 | the Styles combo based on the CSS rules available in the document stylesheet. |
---|
27 | </p> |
---|
28 | <p> |
---|
29 | To add a CKEditor instance using the <strong>stylesheetparser</strong> plugin, insert |
---|
30 | the following JavaScript call into your code: |
---|
31 | </p> |
---|
32 | <pre class="samples">CKEDITOR.replace( '<em>textarea_id</em>', |
---|
33 | { |
---|
34 | <strong>extraPlugins : 'stylesheetparser'</strong> |
---|
35 | });</pre> |
---|
36 | <p> |
---|
37 | Note that <code><em>textarea_id</em></code> in the code above is the <code>id</code> attribute of |
---|
38 | the <code><textarea></code> element to be replaced with CKEditor. |
---|
39 | </p> |
---|
40 | </div> |
---|
41 | |
---|
42 | <!-- This <div> holds alert messages to be display in the sample page. --> |
---|
43 | <div id="alerts"> |
---|
44 | <noscript> |
---|
45 | <p> |
---|
46 | <strong>CKEditor requires JavaScript to run</strong>. In a browser with no JavaScript |
---|
47 | support, like yours, you should still see the contents (HTML data) and you should |
---|
48 | be able to edit it normally, without a rich editor interface. |
---|
49 | </p> |
---|
50 | </noscript> |
---|
51 | </div> |
---|
52 | <form action="sample_posteddata.php" method="post"> |
---|
53 | <p> |
---|
54 | <label for="editor1"> |
---|
55 | Editor 1:</label> |
---|
56 | <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> |
---|
57 | <script type="text/javascript"> |
---|
58 | //<![CDATA[ |
---|
59 | |
---|
60 | // This call can be placed at any point after the |
---|
61 | // <textarea>, or inside a <head><script> in a |
---|
62 | // window.onload event handler. |
---|
63 | |
---|
64 | // Replace the <textarea id="editor"> with an CKEditor |
---|
65 | // instance, using default configurations. |
---|
66 | CKEDITOR.replace( 'editor1' , |
---|
67 | { |
---|
68 | extraPlugins : 'stylesheetparser', |
---|
69 | /* |
---|
70 | * Style sheet for the contents |
---|
71 | */ |
---|
72 | contentsCss : 'assets/parsesample.css', |
---|
73 | /* |
---|
74 | * Don't load the default Styles configuration |
---|
75 | */ |
---|
76 | stylesSet : [] |
---|
77 | }); |
---|
78 | |
---|
79 | //]]> |
---|
80 | </script> |
---|
81 | </p> |
---|
82 | <p> |
---|
83 | <label for="editor2"> |
---|
84 | Editor 1:</label> |
---|
85 | <textarea cols="80" id="editor1" name="editor2" rows="10"><p>This is some <strong>sample text</strong>. You are using <a href="http://ckeditor.com/">CKEditor</a>.</p></textarea> |
---|
86 | <script type="text/javascript"> |
---|
87 | //<![CDATA[ |
---|
88 | |
---|
89 | // This call can be placed at any point after the |
---|
90 | // <textarea>, or inside a <head><script> in a |
---|
91 | // window.onload event handler. |
---|
92 | |
---|
93 | // Replace the <textarea id="editor"> with an CKEditor |
---|
94 | // instance, using default configurations. |
---|
95 | CKEDITOR.replace( 'editor2' ); |
---|
96 | |
---|
97 | //]]> |
---|
98 | </script> |
---|
99 | </p> |
---|
100 | <p> |
---|
101 | <input type="submit" value="Submit" /> |
---|
102 | </p> |
---|
103 | </form> |
---|
104 | <div id="footer"> |
---|
105 | <hr /> |
---|
106 | <p> |
---|
107 | CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a> |
---|
108 | </p> |
---|
109 | <p id="copy"> |
---|
110 | Copyright © 2003-2011, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico |
---|
111 | Knabben. All rights reserved. |
---|
112 | </p> |
---|
113 | </div> |
---|
114 | </body> |
---|
115 | </html> |
---|