ckeditor/samples/old/enterkey/enterkey.html
changeset 0 44d330dccc59
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/ckeditor/samples/old/enterkey/enterkey.html	Thu Dec 15 18:10:20 2016 +0300
     1.3 @@ -0,0 +1,106 @@
     1.4 +<!DOCTYPE html>
     1.5 +<!--
     1.6 +Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
     1.7 +For licensing, see LICENSE.md or http://ckeditor.com/license
     1.8 +-->
     1.9 +<html>
    1.10 +<head>
    1.11 +	<meta charset="utf-8">
    1.12 +	<title>ENTER Key Configuration &mdash; CKEditor Sample</title>
    1.13 +	<script src="../../../ckeditor.js"></script>
    1.14 +	<link href="../../../samples/old/sample.css" rel="stylesheet">
    1.15 +	<meta name="ckeditor-sample-name" content="Using the &quot;Enter&quot; key in CKEditor">
    1.16 +	<meta name="ckeditor-sample-group" content="Advanced Samples">
    1.17 +	<meta name="ckeditor-sample-description" content="Configuring the behavior of &lt;em&gt;Enter&lt;/em&gt; and &lt;em&gt;Shift+Enter&lt;/em&gt; keys.">
    1.18 +	<script>
    1.19 +
    1.20 +		var editor;
    1.21 +
    1.22 +		function changeEnter() {
    1.23 +			// If we already have an editor, let's destroy it first.
    1.24 +			if ( editor )
    1.25 +				editor.destroy( true );
    1.26 +
    1.27 +			// Create the editor again, with the appropriate settings.
    1.28 +			editor = CKEDITOR.replace( 'editor1', {
    1.29 +				extraPlugins: 'enterkey',
    1.30 +				enterMode: Number( document.getElementById( 'xEnter' ).value ),
    1.31 +				shiftEnterMode: Number( document.getElementById( 'xShiftEnter' ).value )
    1.32 +			});
    1.33 +		}
    1.34 +
    1.35 +		window.onload = changeEnter;
    1.36 +
    1.37 +	</script>
    1.38 +</head>
    1.39 +<body>
    1.40 +	<h1 class="samples">
    1.41 +		<a href="../../../samples/old/index.html">CKEditor Samples</a> &raquo; ENTER Key Configuration
    1.42 +	</h1>
    1.43 +	<div class="warning deprecated">
    1.44 +		This sample is not maintained anymore. Check out its <a href="http://sdk.ckeditor.com/samples/enterkey.html">brand new version in CKEditor SDK</a>.
    1.45 +	</div>
    1.46 +	<div class="description">
    1.47 +		<p>
    1.48 +			This sample shows how to configure the <em>Enter</em> and <em>Shift+Enter</em> keys
    1.49 +			to perform actions specified in the
    1.50 +			<a class="samples" href="http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-enterMode"><code>enterMode</code></a>
    1.51 +			and <a class="samples" href="http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-shiftEnterMode"><code>shiftEnterMode</code></a>
    1.52 +			parameters, respectively.
    1.53 +	 		You can choose from the following options:
    1.54 +		</p>
    1.55 +		<ul class="samples">
    1.56 +			<li><strong><code>ENTER_P</code></strong> &ndash; new <code>&lt;p&gt;</code> paragraphs are created;</li>
    1.57 +			<li><strong><code>ENTER_BR</code></strong> &ndash; lines are broken with <code>&lt;br&gt;</code> elements;</li>
    1.58 +			<li><strong><code>ENTER_DIV</code></strong> &ndash; new <code>&lt;div&gt;</code> blocks are created.</li>
    1.59 +		</ul>
    1.60 +		<p>
    1.61 +			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.
    1.62 +		</p>
    1.63 +<pre class="samples">
    1.64 +CKEDITOR.replace( '<em>textarea_id</em>', {
    1.65 +	<strong>enterMode: CKEDITOR.ENTER_DIV</strong>
    1.66 +});</pre>
    1.67 +		<p>
    1.68 +			Note that <code><em>textarea_id</em></code> in the code above is the <code>id</code> attribute of
    1.69 +			the <code>&lt;textarea&gt;</code> element to be replaced.
    1.70 +		</p>
    1.71 +	</div>
    1.72 +	<div style="float: left; margin-right: 20px">
    1.73 +		When <em>Enter</em> is pressed:<br>
    1.74 +		<select id="xEnter" onchange="changeEnter();">
    1.75 +			<option selected="selected" value="1">Create a new &lt;P&gt; (recommended)</option>
    1.76 +			<option value="3">Create a new &lt;DIV&gt;</option>
    1.77 +			<option value="2">Break the line with a &lt;BR&gt;</option>
    1.78 +		</select>
    1.79 +	</div>
    1.80 +	<div style="float: left">
    1.81 +		When <em>Shift+Enter</em> is pressed:<br>
    1.82 +		<select id="xShiftEnter" onchange="changeEnter();">
    1.83 +			<option value="1">Create a new &lt;P&gt;</option>
    1.84 +			<option value="3">Create a new &lt;DIV&gt;</option>
    1.85 +			<option selected="selected" value="2">Break the line with a &lt;BR&gt; (recommended)</option>
    1.86 +		</select>
    1.87 +	</div>
    1.88 +	<br style="clear: both">
    1.89 +	<form action="../../../samples/sample_posteddata.php" method="post">
    1.90 +		<p>
    1.91 +			<br>
    1.92 +			<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>
    1.93 +		</p>
    1.94 +		<p>
    1.95 +			<input type="submit" value="Submit">
    1.96 +		</p>
    1.97 +	</form>
    1.98 +	<div id="footer">
    1.99 +		<hr>
   1.100 +		<p>
   1.101 +			CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
   1.102 +		</p>
   1.103 +		<p id="copy">
   1.104 +			Copyright &copy; 2003-2016, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico
   1.105 +			Knabben. All rights reserved.
   1.106 +		</p>
   1.107 +	</div>
   1.108 +</body>
   1.109 +</html>