<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
<!--\r
-Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.\r
+Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.\r
For licensing, see LICENSE.html or http://ckeditor.com/license\r
-->\r
<html xmlns="http://www.w3.org/1999/xhtml">\r
<head>\r
- <title>Replace DIV - CKEditor Sample</title>\r
+ <title>Replace DIV — CKEditor Sample</title>\r
<meta content="text/html; charset=utf-8" http-equiv="content-type" />\r
<script type="text/javascript" src="../ckeditor.js"></script>\r
<script src="sample.js" type="text/javascript"></script>\r
var element = ev.target || ev.srcElement;\r
\r
// Find out the div that holds this element.\r
- element = element.parentNode;\r
+ var name;\r
+ do\r
+ {\r
+ element = element.parentNode;\r
+ }\r
+ while ( element && ( name = element.nodeName.toLowerCase() ) && ( name != 'div' || element.className.indexOf( 'editable' ) == -1 ) && name != 'body' )\r
\r
- if ( element.nodeName.toLowerCase() == 'div'\r
- && ( element.className.indexOf( 'editable' ) != -1 ) )\r
+\r
+ if ( name == 'div' && element.className.indexOf( 'editable' ) != -1 )\r
replaceDiv( element );\r
}\r
\r
\r
</head>\r
<body>\r
- <h1>\r
- CKEditor Sample\r
+ <h1 class="samples">\r
+ CKEditor Sample — Replace DIV with CKEditor on the Fly\r
</h1>\r
+ <div class="description">\r
+ <p>\r
+ This sample shows how to automatically replace <code><div></code> elements\r
+ with a CKEditor instance on the fly, following user's doubleclick. The content\r
+ that was previously placed inside the <code><div></code> element will now\r
+ be moved into CKEditor editing area.\r
+ </p>\r
+ <p>\r
+ For details on how to create this setup check the source code of this sample page.\r
+ </p>\r
+ </div>\r
<!-- This <div> holds alert messages to be display in the sample page. -->\r
<div id="alerts">\r
<noscript>\r
</noscript>\r
</div>\r
<p>\r
- Double-click on any of the following DIVs to transform them into editor instances.</p>\r
+ Double-click any of the following <code><div></code> elements to transform them into\r
+ editor instances.</p>\r
<div class="editable">\r
<h3>\r
Part 1</h3>\r
<div id="footer">\r
<hr />\r
<p>\r
- CKEditor - The text editor for Internet - <a href="http://ckeditor.com/">http://ckeditor.com</a>\r
+ CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>\r
</p>\r
<p id="copy">\r
- Copyright © 2003-2010, <a href="http://cksource.com/">CKSource</a> - Frederico\r
+ Copyright © 2003-2013, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico\r
Knabben. All rights reserved.\r
</p>\r
</div>\r