1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
---|
2 | <!--
|
---|
3 | Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
|
---|
4 | For licensing, see LICENSE.html or http://ckeditor.com/license
|
---|
5 | -->
|
---|
6 | <html xmlns="http://www.w3.org/1999/xhtml">
|
---|
7 | <head>
|
---|
8 | <title>Sample - CKEditor</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 | <style id="styles" type="text/css">
|
---|
14 |
|
---|
15 | div.editable
|
---|
16 | {
|
---|
17 | border: solid 2px Transparent;
|
---|
18 | padding-left: 15px;
|
---|
19 | padding-right: 15px;
|
---|
20 | }
|
---|
21 |
|
---|
22 | div.editable:hover
|
---|
23 | {
|
---|
24 | border-color: black;
|
---|
25 | }
|
---|
26 |
|
---|
27 | </style>
|
---|
28 | <script id="headscript" type="text/javascript">
|
---|
29 | //<![CDATA[
|
---|
30 |
|
---|
31 | // Uncomment the following code to test the "Timeout Loading Method".
|
---|
32 | // CKEDITOR.loadFullCoreTimeout = 5;
|
---|
33 |
|
---|
34 | window.onload = function()
|
---|
35 | {
|
---|
36 | // Listen to the double click event.
|
---|
37 | if ( window.addEventListener )
|
---|
38 | document.body.addEventListener( 'dblclick', onDoubleClick, false );
|
---|
39 | else if ( window.attachEvent )
|
---|
40 | document.body.attachEvent( 'ondblclick', onDoubleClick );
|
---|
41 |
|
---|
42 | };
|
---|
43 |
|
---|
44 | function onDoubleClick( ev )
|
---|
45 | {
|
---|
46 | // Get the element which fired the event. This is not necessarily the
|
---|
47 | // element to which the event has been attached.
|
---|
48 | var element = ev.target || ev.srcElement;
|
---|
49 |
|
---|
50 | // Find out the div that holds this element.
|
---|
51 | element = element.parentNode;
|
---|
52 |
|
---|
53 | if ( element.nodeName.toLowerCase() == 'div'
|
---|
54 | && ( element.className.indexOf( 'editable' ) != -1 ) )
|
---|
55 | replaceDiv( element );
|
---|
56 | }
|
---|
57 |
|
---|
58 | var editor;
|
---|
59 |
|
---|
60 | function replaceDiv( div )
|
---|
61 | {
|
---|
62 | if ( editor )
|
---|
63 | editor.destroy();
|
---|
64 |
|
---|
65 | editor = CKEDITOR.replace( div );
|
---|
66 | }
|
---|
67 |
|
---|
68 | //]]>
|
---|
69 | </script>
|
---|
70 | </head>
|
---|
71 | <body>
|
---|
72 | <h1>
|
---|
73 | CKEditor Sample
|
---|
74 | </h1>
|
---|
75 | <!-- This <div> holds alert messages to be display in the sample page. -->
|
---|
76 | <div id="alerts">
|
---|
77 | <noscript>
|
---|
78 | <p>
|
---|
79 | <strong>CKEditor requires JavaScript to run</strong>. In a browser with no JavaScript
|
---|
80 | support, like yours, you should still see the contents (HTML data) and you should
|
---|
81 | be able to edit it normally, without a rich editor interface.
|
---|
82 | </p>
|
---|
83 | </noscript>
|
---|
84 | </div>
|
---|
85 | <!-- This <fieldset> holds the HTML that you will usually find in your
|
---|
86 | pages. -->
|
---|
87 | <p>
|
---|
88 | Double-click on any of the following DIVs to transform them into editor instances.</p>
|
---|
89 | <div class="editable">
|
---|
90 | <h3>
|
---|
91 | Part 1</h3>
|
---|
92 | <p>
|
---|
93 | Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Cras et ipsum quis mi
|
---|
94 | semper accumsan. Integer pretium dui id massa. Suspendisse in nisl sit amet urna
|
---|
95 | rutrum imperdiet. Nulla eu tellus. Donec ante nisi, ullamcorper quis, fringilla
|
---|
96 | nec, sagittis eleifend, pede. Nulla commodo interdum massa. Donec id metus. Fusce
|
---|
97 | eu ipsum. Suspendisse auctor. Phasellus fermentum porttitor risus.
|
---|
98 | </p>
|
---|
99 | </div>
|
---|
100 | <div class="editable">
|
---|
101 | <h3>
|
---|
102 | Part 2</h3>
|
---|
103 | <p>
|
---|
104 | Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Cras et ipsum quis mi
|
---|
105 | semper accumsan. Integer pretium dui id massa. Suspendisse in nisl sit amet urna
|
---|
106 | rutrum imperdiet. Nulla eu tellus. Donec ante nisi, ullamcorper quis, fringilla
|
---|
107 | nec, sagittis eleifend, pede. Nulla commodo interdum massa. Donec id metus. Fusce
|
---|
108 | eu ipsum. Suspendisse auctor. Phasellus fermentum porttitor risus.
|
---|
109 | </p>
|
---|
110 | <p>
|
---|
111 | Donec velit. Mauris massa. Vestibulum non nulla. Nam suscipit arcu nec elit. Phasellus
|
---|
112 | sollicitudin iaculis ante. Ut non mauris et sapien tincidunt adipiscing. Vestibulum
|
---|
113 | vitae leo. Suspendisse nec mi tristique nulla laoreet vulputate.
|
---|
114 | </p>
|
---|
115 | </div>
|
---|
116 | <div class="editable">
|
---|
117 | <h3>
|
---|
118 | Part 3</h3>
|
---|
119 | <p>
|
---|
120 | Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Cras et ipsum quis mi
|
---|
121 | semper accumsan. Integer pretium dui id massa. Suspendisse in nisl sit amet urna
|
---|
122 | rutrum imperdiet. Nulla eu tellus. Donec ante nisi, ullamcorper quis, fringilla
|
---|
123 | nec, sagittis eleifend, pede. Nulla commodo interdum massa. Donec id metus. Fusce
|
---|
124 | eu ipsum. Suspendisse auctor. Phasellus fermentum porttitor risus.
|
---|
125 | </p>
|
---|
126 | </div>
|
---|
127 | <div id="footer">
|
---|
128 | <hr/>
|
---|
129 | <p>
|
---|
130 | CKEditor - The text editor for Internet - <a href="http://ckeditor.com/" shape="rect">http://ckeditor.com</a>
|
---|
131 | </p>
|
---|
132 | <p id="copy">
|
---|
133 | Copyright © 2003-2009, <a href="http://cksource.com/" shape="rect">CKSource</a> - Frederico Knabben. All rights reserved.
|
---|
134 | </p>
|
---|
135 | </div>
|
---|
136 | </body>
|
---|
137 | </html>
|
---|