JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.1
[ckeditor.git] / _samples / enterkey.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
2 <!--\r
3 Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.\r
4 For licensing, see LICENSE.html or http://ckeditor.com/license\r
5 -->\r
6 <html xmlns="http://www.w3.org/1999/xhtml">\r
7 <head>\r
8         <title>ENTER Key Configuration - CKEditor Sample</title>\r
9         <meta content="text/html; charset=utf-8" http-equiv="content-type" />\r
10         <script type="text/javascript" src="../ckeditor.js"></script>\r
11         <script src="sample.js" type="text/javascript"></script>\r
12         <link href="sample.css" rel="stylesheet" type="text/css" />\r
13         <script type="text/javascript">\r
14         //<![CDATA[\r
15 \r
16 var editor;\r
17 \r
18 function changeEnter()\r
19 {\r
20         // If we already have an editor, let's destroy it first.\r
21         if ( editor )\r
22                 editor.destroy( true );\r
23 \r
24         // Create the editor again, with the appropriate settings.\r
25         editor = CKEDITOR.replace( 'editor1',\r
26                 {\r
27                         enterMode               : Number( document.getElementById( 'xEnter' ).value ),\r
28                         shiftEnterMode  : Number( document.getElementById( 'xShiftEnter' ).value )\r
29                 });\r
30 }\r
31 \r
32 window.onload = changeEnter;\r
33 \r
34         //]]>\r
35         </script>\r
36 </head>\r
37 <body>\r
38         <h1>\r
39                 CKEditor Sample\r
40         </h1>\r
41         <!-- This <div> holds alert messages to be display in the sample page. -->\r
42         <div id="alerts">\r
43                 <noscript>\r
44                         <p>\r
45                                 <strong>CKEditor requires JavaScript to run</strong>. In a browser with no JavaScript\r
46                                 support, like yours, you should still see the contents (HTML data) and you should\r
47                                 be able to edit it normally, without a rich editor interface.\r
48                         </p>\r
49                 </noscript>\r
50         </div>\r
51         <div style="float: left; margin-right: 20px">\r
52                 When ENTER is pressed:<br />\r
53                 <select id="xEnter" onchange="changeEnter();">\r
54                         <option selected="selected" value="1">Create new &lt;P&gt; (recommended)</option>\r
55                         <option value="3">Create new &lt;DIV&gt;</option>\r
56                         <option value="2">Break the line with a &lt;BR&gt;</option>\r
57                 </select>\r
58         </div>\r
59         <div style="float: left">\r
60                 When SHIFT + ENTER is pressed:<br />\r
61                 <select id="xShiftEnter" onchange="changeEnter();">\r
62                         <option value="1">Create new &lt;P&gt;</option>\r
63                         <option value="3">Create new &lt;DIV&gt;</option>\r
64                         <option selected="selected" value="2">Break the line with a &lt;BR&gt; (recommended)</option>\r
65                 </select>\r
66         </div>\r
67         <br style="clear: both" />\r
68         <form action="sample_posteddata.php" method="post">\r
69                 <p>\r
70                         <br />\r
71                         <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>\r
72                 </p>\r
73                 <p>\r
74                         <input type="submit" value="Submit" />\r
75                 </p>\r
76         </form>\r
77         <div id="footer">\r
78                 <hr />\r
79                 <p>\r
80                         CKEditor - The text editor for Internet - <a href="http://ckeditor.com/">http://ckeditor.com</a>\r
81                 </p>\r
82                 <p id="copy">\r
83                         Copyright &copy; 2003-2010, <a href="http://cksource.com/">CKSource</a> - Frederico\r
84                         Knabben. All rights reserved.\r
85                 </p>\r
86         </div>\r
87 </body>\r
88 </html>\r