Ticket #8487: _move_to_element.html

File _move_to_element.html, 2.2 KB (added by alfx, 9 years ago)
Line 
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2<!--
3Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
4For licensing, see LICENSE.html or http://ckeditor.com/license
5-->
6<html xmlns="http://www.w3.org/1999/xhtml">
7<head>
8        <title>API Usage &mdash; CKEditor Sample</title>
9        <meta content="text/html; charset=utf-8" http-equiv="content-type" />
10        <script type="text/javascript" src="../ckeditor.js"></script>
11        <script src="sample.js" type="text/javascript"></script>
12        <link href="sample.css" rel="stylesheet" type="text/css" />
13        <script type="text/javascript">
14        //<![CDATA[
15
16// The instanceReady event is fired, when an instance of CKEditor has finished
17// its initialization.
18CKEDITOR.on( 'instanceReady', function( ev )
19{
20        // Show the editor name and description in the browser status bar.
21        document.getElementById( 'eMessage' ).innerHTML = '<p>Instance <code>' + ev.editor.name + '<\/code> loaded.<\/p>';
22
23        // Show this sample buttons.
24         document.getElementById( 'eButtons' ).style.display = 'block';
25});
26
27function moveTo()
28{
29        var origElem = document.getElementById( 'testOrigElem' );
30        var movedElem = document.getElementById( 'testMovedElem' );
31        var targetElem = document.getElementById( 'testTargetElem' );
32       
33        origElem.removeChild(movedElem);
34        targetElem.appendChild(movedElem);
35}
36
37        //]]>
38        </script>
39
40</head>
41<body>
42        <div id="testOrigElem">
43                <form id="testMovedElem" action="sample_posteddata.php" method="post">
44                        <textarea cols="100" 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>
45                        <script type="text/javascript">
46                                //<![CDATA[
47                                // Replace the <textarea id="editor1"> with an CKEditor instance.
48                                var editor = CKEDITOR.replace( 'editor1' );
49                                //]]>
50                        </script>
51                </form>
52        </div>
53       
54        <br /><br />
55               
56        <form action="sample_posteddata.php" method="post">
57                <input onclick="moveTo();" type="button" value="Move!" />
58        </form>
59       
60        <br /><br />
61       
62        <div id="testTargetElem">
63        </div>
64       
65</body>
66</html>
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy