3 Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
4 For licensing, see LICENSE.md or http://ckeditor.com/license
9 <title>Using Stylesheet Parser Plugin
— CKEditor Sample
</title>
10 <script src=
"../../../ckeditor.js"></script>
11 <script src=
"../../../samples/old/sample.js"></script>
12 <link rel=
"stylesheet" href=
"../../../samples/old/sample.css">
13 <meta name=
"ckeditor-sample-required-plugins" content=
"stylescombo">
14 <meta name=
"ckeditor-sample-name" content=
"Stylesheet Parser plugin">
15 <meta name=
"ckeditor-sample-description" content=
"Using the Stylesheet Parser plugin to fill the Styles drop-down list based on the CSS classes available in the document stylesheet.">
16 <meta name=
"ckeditor-sample-group" content=
"Plugins">
20 <a href=
"../../../samples/old/index.html">CKEditor Samples
</a> » Using the Stylesheet Parser Plugin
22 <div class=
"warning deprecated">
23 This sample is not maintained anymore. Check out its
<a href=
"http://sdk.ckeditor.com/samples/styles.html">brand new version in CKEditor SDK
</a>.
25 <div class=
"description">
27 This sample shows how to configure CKEditor instances to use the
28 <strong>Stylesheet Parser
</strong> (
<code>stylesheetparser
</code>) plugin that fills
29 the
<strong>Styles
</strong> drop-down list based on the CSS rules available in the document stylesheet.
32 To add a CKEditor instance using the
<code>stylesheetparser
</code> plugin, insert
33 the following JavaScript call into your code:
36 CKEDITOR.replace( '
<em>textarea_id
</em>', {
37 <strong>extraPlugins: 'stylesheetparser'
</strong>
40 Note that
<code><em>textarea_id
</em></code> in the code above is the
<code>id
</code> attribute of
41 the
<code><textarea
></code> element to be replaced with CKEditor.
44 <form action=
"../../../samples/sample_posteddata.php" method=
"post">
47 CKEditor using the
<code>stylesheetparser
</code> plugin with its default configuration:
49 <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>
52 // This call can be placed at any point after the
53 // <textarea>, or inside a <head><script> in a
54 // window.onload event handler.
56 // Replace the <textarea id="editor"> with an CKEditor
57 // instance, using default configurations.
58 CKEDITOR
.replace( 'editor1' , {
59 extraPlugins
: 'stylesheetparser',
61 // Stylesheet for the contents.
62 contentsCss
: 'assets/sample.css',
64 // Do not load the default Styles configuration.
71 <input type=
"submit" value=
"Submit">
77 CKEditor - The text editor for the Internet -
<a class=
"samples" href=
"http://ckeditor.com/">http://ckeditor.com
</a>
80 Copyright
© 2003-
2017,
<a class=
"samples" href=
"http://cksource.com/">CKSource
</a> - Frederico
81 Knabben. All rights reserved.