Mimimum syndical pour en faire un produit zope / cmf.
[ckeditor.git] / skins / ckeditor / _samples / divreplace.html
diff --git a/skins/ckeditor/_samples/divreplace.html b/skins/ckeditor/_samples/divreplace.html
new file mode 100644 (file)
index 0000000..4568f52
--- /dev/null
@@ -0,0 +1,154 @@
+<!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-2011, 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 &mdash; 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
+       <link href="sample.css" rel="stylesheet" type="text/css" />\r
+       <style id="styles" type="text/css">\r
+\r
+               div.editable\r
+               {\r
+                       border: solid 2px Transparent;\r
+                       padding-left: 15px;\r
+                       padding-right: 15px;\r
+               }\r
+\r
+               div.editable:hover\r
+               {\r
+                       border-color: black;\r
+               }\r
+\r
+       </style>\r
+       <script type="text/javascript">\r
+       //<![CDATA[\r
+\r
+// Uncomment the following code to test the "Timeout Loading Method".\r
+// CKEDITOR.loadFullCoreTimeout = 5;\r
+\r
+window.onload = function()\r
+{\r
+       // Listen to the double click event.\r
+       if ( window.addEventListener )\r
+               document.body.addEventListener( 'dblclick', onDoubleClick, false );\r
+       else if ( window.attachEvent )\r
+               document.body.attachEvent( 'ondblclick', onDoubleClick );\r
+\r
+};\r
+\r
+function onDoubleClick( ev )\r
+{\r
+       // Get the element which fired the event. This is not necessarily the\r
+       // element to which the event has been attached.\r
+       var element = ev.target || ev.srcElement;\r
+\r
+       // Find out the div that holds this element.\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
+\r
+       if ( name == 'div' && element.className.indexOf( 'editable' ) != -1 )\r
+               replaceDiv( element );\r
+}\r
+\r
+var editor;\r
+\r
+function replaceDiv( div )\r
+{\r
+       if ( editor )\r
+               editor.destroy();\r
+\r
+       editor = CKEDITOR.replace( div );\r
+}\r
+\r
+       //]]>\r
+       </script>\r
+\r
+</head>\r
+<body>\r
+       <h1 class="samples">\r
+               CKEditor Sample &mdash; Replace DIV with CKEditor on the Fly\r
+       </h1>\r
+       <div class="description">\r
+       <p>\r
+               This sample shows how to automatically replace <code>&lt;div&gt;</code> elements\r
+               with a CKEditor instance on the fly, following user's doubleclick. The content\r
+               that was previously placed inside the <code>&lt;div&gt;</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
+                       <p>\r
+                               <strong>CKEditor requires JavaScript to run</strong>. In a browser with no JavaScript\r
+                               support, like yours, you should still see the contents (HTML data) and you should\r
+                               be able to edit it normally, without a rich editor interface.\r
+                       </p>\r
+               </noscript>\r
+       </div>\r
+       <p>\r
+               Double-click any of the following <code>&lt;div&gt;</code> elements to transform them into\r
+               editor instances.</p>\r
+       <div class="editable">\r
+               <h3>\r
+                       Part 1</h3>\r
+               <p>\r
+                       Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Cras et ipsum quis mi\r
+                       semper accumsan. Integer pretium dui id massa. Suspendisse in nisl sit amet urna\r
+                       rutrum imperdiet. Nulla eu tellus. Donec ante nisi, ullamcorper quis, fringilla\r
+                       nec, sagittis eleifend, pede. Nulla commodo interdum massa. Donec id metus. Fusce\r
+                       eu ipsum. Suspendisse auctor. Phasellus fermentum porttitor risus.\r
+               </p>\r
+       </div>\r
+       <div class="editable">\r
+               <h3>\r
+                       Part 2</h3>\r
+               <p>\r
+                       Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Cras et ipsum quis mi\r
+                       semper accumsan. Integer pretium dui id massa. Suspendisse in nisl sit amet urna\r
+                       rutrum imperdiet. Nulla eu tellus. Donec ante nisi, ullamcorper quis, fringilla\r
+                       nec, sagittis eleifend, pede. Nulla commodo interdum massa. Donec id metus. Fusce\r
+                       eu ipsum. Suspendisse auctor. Phasellus fermentum porttitor risus.\r
+               </p>\r
+               <p>\r
+                       Donec velit. Mauris massa. Vestibulum non nulla. Nam suscipit arcu nec elit. Phasellus\r
+                       sollicitudin iaculis ante. Ut non mauris et sapien tincidunt adipiscing. Vestibulum\r
+                       vitae leo. Suspendisse nec mi tristique nulla laoreet vulputate.\r
+               </p>\r
+       </div>\r
+       <div class="editable">\r
+               <h3>\r
+                       Part 3</h3>\r
+               <p>\r
+                       Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Cras et ipsum quis mi\r
+                       semper accumsan. Integer pretium dui id massa. Suspendisse in nisl sit amet urna\r
+                       rutrum imperdiet. Nulla eu tellus. Donec ante nisi, ullamcorper quis, fringilla\r
+                       nec, sagittis eleifend, pede. Nulla commodo interdum massa. Donec id metus. Fusce\r
+                       eu ipsum. Suspendisse auctor. Phasellus fermentum porttitor risus.\r
+               </p>\r
+       </div>\r
+       <div id="footer">\r
+               <hr />\r
+               <p>\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 &copy; 2003-2011, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico\r
+                       Knabben. All rights reserved.\r
+               </p>\r
+       </div>\r
+</body>\r
+</html>\r