annotate sites/all/libraries/ckeditor/_samples/jqueryadapter.html @ 0:ff03f76ab3fe

initial version
author danieleb <danielebarchiesi@me.com>
date Wed, 21 Aug 2013 18:51:11 +0100
parents
children
rev   line source
danielebarchiesi@0 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
danielebarchiesi@0 2 <!--
danielebarchiesi@0 3 Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
danielebarchiesi@0 4 For licensing, see LICENSE.html or http://ckeditor.com/license
danielebarchiesi@0 5 -->
danielebarchiesi@0 6 <html xmlns="http://www.w3.org/1999/xhtml">
danielebarchiesi@0 7 <head>
danielebarchiesi@0 8 <title>jQuery Adapter &mdash; CKEditor Sample</title>
danielebarchiesi@0 9 <meta content="text/html; charset=utf-8" http-equiv="content-type" />
danielebarchiesi@0 10 <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js"></script>
danielebarchiesi@0 11 <script type="text/javascript" src="../ckeditor.js"></script>
danielebarchiesi@0 12 <script type="text/javascript" src="../adapters/jquery.js"></script>
danielebarchiesi@0 13 <script src="sample.js" type="text/javascript"></script>
danielebarchiesi@0 14 <link href="sample.css" rel="stylesheet" type="text/css" />
danielebarchiesi@0 15 <script type="text/javascript">
danielebarchiesi@0 16 //<![CDATA[
danielebarchiesi@0 17
danielebarchiesi@0 18 $(function()
danielebarchiesi@0 19 {
danielebarchiesi@0 20 var config = {
danielebarchiesi@0 21 toolbar:
danielebarchiesi@0 22 [
danielebarchiesi@0 23 ['Bold', 'Italic', '-', 'NumberedList', 'BulletedList', '-', 'Link', 'Unlink'],
danielebarchiesi@0 24 ['UIColor']
danielebarchiesi@0 25 ]
danielebarchiesi@0 26 };
danielebarchiesi@0 27
danielebarchiesi@0 28 // Initialize the editor.
danielebarchiesi@0 29 // Callback function can be passed and executed after full instance creation.
danielebarchiesi@0 30 $('.jquery_ckeditor').ckeditor(config);
danielebarchiesi@0 31 });
danielebarchiesi@0 32
danielebarchiesi@0 33 //]]>
danielebarchiesi@0 34 </script>
danielebarchiesi@0 35 </head>
danielebarchiesi@0 36 <body>
danielebarchiesi@0 37 <h1 class="samples">
danielebarchiesi@0 38 CKEditor Sample &mdash; Using jQuery Adapter
danielebarchiesi@0 39 </h1>
danielebarchiesi@0 40 <div class="description">
danielebarchiesi@0 41 <p>
danielebarchiesi@0 42 This sample shows how to load CKEditor and configure it using the
danielebarchiesi@0 43 <a class="samples" href="http://docs.cksource.com/CKEditor_3.x/Developers_Guide/jQuery_Adapter">jQuery adapter</a>.
danielebarchiesi@0 44 In this case the jQuery adapter is responsible for transforming a <code>&lt;textarea&gt;</code>
danielebarchiesi@0 45 element into a CKEditor instance and setting the configuration of the toolbar.
danielebarchiesi@0 46 </p>
danielebarchiesi@0 47 <p>
danielebarchiesi@0 48 CKEditor instance with custom configuration set in jQuery can be inserted with the
danielebarchiesi@0 49 following JavaScript code:
danielebarchiesi@0 50 </p>
danielebarchiesi@0 51 <pre class="samples">$(function()
danielebarchiesi@0 52 {
danielebarchiesi@0 53 var config = {
danielebarchiesi@0 54 skin:'v2'
danielebarchiesi@0 55 };
danielebarchiesi@0 56
danielebarchiesi@0 57 $('.<em>textarea_class</em>').ckeditor(config);
danielebarchiesi@0 58 });</pre>
danielebarchiesi@0 59 <p>
danielebarchiesi@0 60 Note that <code><em>textarea_class</em></code> in the code above is the
danielebarchiesi@0 61 <code>class</code> attribute of the <code>&lt;textarea&gt;</code> element to be replaced with
danielebarchiesi@0 62 CKEditor. Any other jQuery selector can be used to match the target element.
danielebarchiesi@0 63 </p>
danielebarchiesi@0 64 </div>
danielebarchiesi@0 65
danielebarchiesi@0 66 <!-- This <div> holds alert messages to be display in the sample page. -->
danielebarchiesi@0 67 <div id="alerts">
danielebarchiesi@0 68 <noscript>
danielebarchiesi@0 69 <p>
danielebarchiesi@0 70 <strong>CKEditor requires JavaScript to run</strong>. In a browser with no JavaScript
danielebarchiesi@0 71 support, like yours, you should still see the contents (HTML data) and you should
danielebarchiesi@0 72 be able to edit it normally, without a rich editor interface.
danielebarchiesi@0 73 </p>
danielebarchiesi@0 74 </noscript>
danielebarchiesi@0 75 </div>
danielebarchiesi@0 76 <!-- This <fieldset> holds the HTML that you will usually find in your
danielebarchiesi@0 77 pages. -->
danielebarchiesi@0 78 <form action="sample_posteddata.php" method="post">
danielebarchiesi@0 79 <p>
danielebarchiesi@0 80 <label for="editor1">
danielebarchiesi@0 81 Editor 1:</label>
danielebarchiesi@0 82 <textarea class="jquery_ckeditor" cols="80" id="editor1" name="editor1" rows="10">&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://ckeditor.com/"&gt;CKEditor&lt;/a&gt;.&lt;/p&gt;</textarea>
danielebarchiesi@0 83 </p>
danielebarchiesi@0 84 <p>
danielebarchiesi@0 85 <input type="submit" value="Submit" />
danielebarchiesi@0 86 </p>
danielebarchiesi@0 87 </form>
danielebarchiesi@0 88 <div id="footer">
danielebarchiesi@0 89 <hr />
danielebarchiesi@0 90 <p>
danielebarchiesi@0 91 CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
danielebarchiesi@0 92 </p>
danielebarchiesi@0 93 <p id="copy">
danielebarchiesi@0 94 Copyright &copy; 2003-2013, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico
danielebarchiesi@0 95 Knabben. All rights reserved.
danielebarchiesi@0 96 </p>
danielebarchiesi@0 97 </div>
danielebarchiesi@0 98 </body>
danielebarchiesi@0 99 </html>