JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
6477d1766b496143edd88747f2720e37f1a5ad75
[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-2009, 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>Sample - CKEditor</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 id="headscript" 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         <!-- This <fieldset> holds the HTML that you will usually find in your\r
52              pages. -->\r
53         <div style="float: left; margin-right: 20px">\r
54                         When ENTER is pressed:<br/>\r
55                         <select id="xEnter" onchange="changeEnter();">\r
56                                 <option selected="selected" value="1">Create new &lt;P&gt; (recommended)</option>\r
57                                 <option value="3">Create new &lt;DIV&gt;</option>\r
58                                 <option value="2">Break the line with a &lt;BR&gt;</option>\r
59                         </select>\r
60                 </div>\r
61                 <div style="float: left">\r
62                         When SHIFT + ENTER is pressed:<br/>\r
63                         <select id="xShiftEnter" onchange="changeEnter();">\r
64                                 <option value="1">Create new &lt;P&gt;</option>\r
65                                 <option value="3">Create new &lt;DIV&gt;</option>\r
66                                 <option selected="selected" value="2">Break the line with a &lt;BR&gt; (recommended)</option>\r
67                         </select>\r
68                 </div>\r
69                 <br style="clear: both"/>\r
70 \r
71                 <form action="sample_posteddata.php" method="post">\r
72                         <p>\r
73                                 <br/>\r
74                                 <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
75                         </p>\r
76                         <p>\r
77                                 <input type="submit" value="Submit"/>\r
78                         </p>\r
79                 </form>\r
80         <div id="footer">\r
81                 <hr/>\r
82                 <p>\r
83                         CKEditor - The text editor for Internet - <a href="http://ckeditor.com/" shape="rect">http://ckeditor.com</a>\r
84                 </p>\r
85                 <p id="copy">\r
86                         Copyright © 2003-2009, <a href="http://cksource.com/" shape="rect">CKSource</a> - Frederico Knabben. All rights reserved.\r
87                 </p>\r
88         </div>\r
89 </body>\r
90 </html>\r