annotate sites/all/libraries/ckeditor/_samples/enterkey.html @ 2:b74b41bb73f0

-- Google analytics module
author danieleb <danielebarchiesi@me.com>
date Thu, 22 Aug 2013 17:22:54 +0100
parents ff03f76ab3fe
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>ENTER Key Configuration &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="../ckeditor.js"></script>
danielebarchiesi@0 11 <script src="sample.js" type="text/javascript"></script>
danielebarchiesi@0 12 <link href="sample.css" rel="stylesheet" type="text/css" />
danielebarchiesi@0 13 <script type="text/javascript">
danielebarchiesi@0 14 //<![CDATA[
danielebarchiesi@0 15
danielebarchiesi@0 16 var editor;
danielebarchiesi@0 17
danielebarchiesi@0 18 function changeEnter()
danielebarchiesi@0 19 {
danielebarchiesi@0 20 // If we already have an editor, let's destroy it first.
danielebarchiesi@0 21 if ( editor )
danielebarchiesi@0 22 editor.destroy( true );
danielebarchiesi@0 23
danielebarchiesi@0 24 // Create the editor again, with the appropriate settings.
danielebarchiesi@0 25 editor = CKEDITOR.replace( 'editor1',
danielebarchiesi@0 26 {
danielebarchiesi@0 27 enterMode : Number( document.getElementById( 'xEnter' ).value ),
danielebarchiesi@0 28 shiftEnterMode : Number( document.getElementById( 'xShiftEnter' ).value )
danielebarchiesi@0 29 });
danielebarchiesi@0 30 }
danielebarchiesi@0 31
danielebarchiesi@0 32 window.onload = changeEnter;
danielebarchiesi@0 33
danielebarchiesi@0 34 //]]>
danielebarchiesi@0 35 </script>
danielebarchiesi@0 36 </head>
danielebarchiesi@0 37 <body>
danielebarchiesi@0 38 <h1 class="samples">
danielebarchiesi@0 39 CKEditor Sample &mdash; ENTER Key Configuration
danielebarchiesi@0 40 </h1>
danielebarchiesi@0 41 <div class="description">
danielebarchiesi@0 42 <p>
danielebarchiesi@0 43 This sample shows how to configure the <em>Enter</em> and <em>Shift+Enter</em> keys
danielebarchiesi@0 44 to perform actions specified in the
danielebarchiesi@0 45 <a class="samples" href="http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html#.enterMode"><code>enterMode</code></a>
danielebarchiesi@0 46 and <a class="samples" href="http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html#.shiftEnterMode"><code>shiftEnterMode</code></a>
danielebarchiesi@0 47 parameters, respectively.
danielebarchiesi@0 48 You can choose from the following options:
danielebarchiesi@0 49 </p>
danielebarchiesi@0 50 <ul class="samples">
danielebarchiesi@0 51 <li><strong><code>ENTER_P</code></strong> &ndash; new <code>&lt;p&gt;</code> paragraphs are created;</li>
danielebarchiesi@0 52 <li><strong><code>ENTER_BR</code></strong> &ndash; lines are broken with <code>&lt;br&gt;</code> elements;</li>
danielebarchiesi@0 53 <li><strong><code>ENTER_DIV</code></strong> &ndash; new <code>&lt;div&gt;</code> blocks are created.</li>
danielebarchiesi@0 54 </ul>
danielebarchiesi@0 55 <p>
danielebarchiesi@0 56 The sample code below shows how to configure CKEditor to create a <code>&lt;div&gt;</code> block when <em>Enter</em> key is pressed.
danielebarchiesi@0 57 </p>
danielebarchiesi@0 58 <pre class="samples">CKEDITOR.replace( '<em>textarea_id</em>',
danielebarchiesi@0 59 {
danielebarchiesi@0 60 <strong>enterMode : CKEDITOR.ENTER_DIV</strong>
danielebarchiesi@0 61 });</pre>
danielebarchiesi@0 62 <p>
danielebarchiesi@0 63 Note that <code><em>textarea_id</em></code> in the code above is the <code>id</code> attribute of
danielebarchiesi@0 64 the <code>&lt;textarea&gt;</code> element to be replaced.
danielebarchiesi@0 65 </p>
danielebarchiesi@0 66 </div>
danielebarchiesi@0 67
danielebarchiesi@0 68 <!-- This <div> holds alert messages to be display in the sample page. -->
danielebarchiesi@0 69 <div id="alerts">
danielebarchiesi@0 70 <noscript>
danielebarchiesi@0 71 <p>
danielebarchiesi@0 72 <strong>CKEditor requires JavaScript to run</strong>. In a browser with no JavaScript
danielebarchiesi@0 73 support, like yours, you should still see the contents (HTML data) and you should
danielebarchiesi@0 74 be able to edit it normally, without a rich editor interface.
danielebarchiesi@0 75 </p>
danielebarchiesi@0 76 </noscript>
danielebarchiesi@0 77 </div>
danielebarchiesi@0 78 <div style="float: left; margin-right: 20px">
danielebarchiesi@0 79 When <em>Enter</em> is pressed:<br />
danielebarchiesi@0 80 <select id="xEnter" onchange="changeEnter();">
danielebarchiesi@0 81 <option selected="selected" value="1">Create a new &lt;P&gt; (recommended)</option>
danielebarchiesi@0 82 <option value="3">Create a new &lt;DIV&gt;</option>
danielebarchiesi@0 83 <option value="2">Break the line with a &lt;BR&gt;</option>
danielebarchiesi@0 84 </select>
danielebarchiesi@0 85 </div>
danielebarchiesi@0 86 <div style="float: left">
danielebarchiesi@0 87 When <em>Shift+Enter</em> is pressed:<br />
danielebarchiesi@0 88 <select id="xShiftEnter" onchange="changeEnter();">
danielebarchiesi@0 89 <option value="1">Create a new &lt;P&gt;</option>
danielebarchiesi@0 90 <option value="3">Create a new &lt;DIV&gt;</option>
danielebarchiesi@0 91 <option selected="selected" value="2">Break the line with a &lt;BR&gt; (recommended)</option>
danielebarchiesi@0 92 </select>
danielebarchiesi@0 93 </div>
danielebarchiesi@0 94 <br style="clear: both" />
danielebarchiesi@0 95 <form action="sample_posteddata.php" method="post">
danielebarchiesi@0 96 <p>
danielebarchiesi@0 97 <br />
danielebarchiesi@0 98 <textarea cols="80" id="editor1" name="editor1" rows="10">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;.</textarea>
danielebarchiesi@0 99 </p>
danielebarchiesi@0 100 <p>
danielebarchiesi@0 101 <input type="submit" value="Submit" />
danielebarchiesi@0 102 </p>
danielebarchiesi@0 103 </form>
danielebarchiesi@0 104 <div id="footer">
danielebarchiesi@0 105 <hr />
danielebarchiesi@0 106 <p>
danielebarchiesi@0 107 CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
danielebarchiesi@0 108 </p>
danielebarchiesi@0 109 <p id="copy">
danielebarchiesi@0 110 Copyright &copy; 2003-2013, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico
danielebarchiesi@0 111 Knabben. All rights reserved.
danielebarchiesi@0 112 </p>
danielebarchiesi@0 113 </div>
danielebarchiesi@0 114 </body>
danielebarchiesi@0 115 </html>