source: trunk/phpgwapi/js/ckeditor/_samples/divreplace.html @ 2862

Revision 2862, 4.3 KB checked in by rodsouza, 14 years ago (diff)

Ticket #663 - Atualizando e centralizando o CKEditor (v. 3.2.1)

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-2010, 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>Replace DIV - 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        <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 type="text/javascript">
29        //<![CDATA[
30
31// Uncomment the following code to test the "Timeout Loading Method".
32// CKEDITOR.loadFullCoreTimeout = 5;
33
34window.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
44function 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
58var editor;
59
60function replaceDiv( div )
61{
62        if ( editor )
63                editor.destroy();
64
65        editor = CKEDITOR.replace( div );
66}
67
68        //]]>
69        </script>
70
71</head>
72<body>
73        <h1>
74                CKEditor Sample
75        </h1>
76        <!-- This <div> holds alert messages to be display in the sample page. -->
77        <div id="alerts">
78                <noscript>
79                        <p>
80                                <strong>CKEditor requires JavaScript to run</strong>. In a browser with no JavaScript
81                                support, like yours, you should still see the contents (HTML data) and you should
82                                be able to edit it normally, without a rich editor interface.
83                        </p>
84                </noscript>
85        </div>
86        <p>
87                Double-click on any of the following DIVs to transform them into editor instances.</p>
88        <div class="editable">
89                <h3>
90                        Part 1</h3>
91                <p>
92                        Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Cras et ipsum quis mi
93                        semper accumsan. Integer pretium dui id massa. Suspendisse in nisl sit amet urna
94                        rutrum imperdiet. Nulla eu tellus. Donec ante nisi, ullamcorper quis, fringilla
95                        nec, sagittis eleifend, pede. Nulla commodo interdum massa. Donec id metus. Fusce
96                        eu ipsum. Suspendisse auctor. Phasellus fermentum porttitor risus.
97                </p>
98        </div>
99        <div class="editable">
100                <h3>
101                        Part 2</h3>
102                <p>
103                        Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Cras et ipsum quis mi
104                        semper accumsan. Integer pretium dui id massa. Suspendisse in nisl sit amet urna
105                        rutrum imperdiet. Nulla eu tellus. Donec ante nisi, ullamcorper quis, fringilla
106                        nec, sagittis eleifend, pede. Nulla commodo interdum massa. Donec id metus. Fusce
107                        eu ipsum. Suspendisse auctor. Phasellus fermentum porttitor risus.
108                </p>
109                <p>
110                        Donec velit. Mauris massa. Vestibulum non nulla. Nam suscipit arcu nec elit. Phasellus
111                        sollicitudin iaculis ante. Ut non mauris et sapien tincidunt adipiscing. Vestibulum
112                        vitae leo. Suspendisse nec mi tristique nulla laoreet vulputate.
113                </p>
114        </div>
115        <div class="editable">
116                <h3>
117                        Part 3</h3>
118                <p>
119                        Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Cras et ipsum quis mi
120                        semper accumsan. Integer pretium dui id massa. Suspendisse in nisl sit amet urna
121                        rutrum imperdiet. Nulla eu tellus. Donec ante nisi, ullamcorper quis, fringilla
122                        nec, sagittis eleifend, pede. Nulla commodo interdum massa. Donec id metus. Fusce
123                        eu ipsum. Suspendisse auctor. Phasellus fermentum porttitor risus.
124                </p>
125        </div>
126        <div id="footer">
127                <hr />
128                <p>
129                        CKEditor - The text editor for Internet - <a href="http://ckeditor.com/">http://ckeditor.com</a>
130                </p>
131                <p id="copy">
132                        Copyright &copy; 2003-2010, <a href="http://cksource.com/">CKSource</a> - Frederico
133                        Knabben. All rights reserved.
134                </p>
135        </div>
136</body>
137</html>
Note: See TracBrowser for help on using the repository browser.