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