| 1 | <!DOCTYPE html> |
|---|
| 2 | <!-- |
|---|
| 3 | Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. |
|---|
| 4 | For licensing, see LICENSE.md or http://ckeditor.com/license |
|---|
| 5 | --> |
|---|
| 6 | <html> |
|---|
| 7 | <head> |
|---|
| 8 | <meta charset="utf-8"> |
|---|
| 9 | <title>Inline Editing by Code — CKEditor Sample</title> |
|---|
| 10 | <script src="../ckeditor.js"></script> |
|---|
| 11 | <link href="sample.css" rel="stylesheet"> |
|---|
| 12 | <style> |
|---|
| 13 | |
|---|
| 14 | #editable |
|---|
| 15 | { |
|---|
| 16 | padding: 10px; |
|---|
| 17 | float: left; |
|---|
| 18 | } |
|---|
| 19 | |
|---|
| 20 | </style> |
|---|
| 21 | </head> |
|---|
| 22 | <body> |
|---|
| 23 | <h1 class="samples"> |
|---|
| 24 | <a href="index.html">CKEditor Samples</a> » Inline Editing by Code |
|---|
| 25 | </h1> |
|---|
| 26 | <div class="description"> |
|---|
| 27 | <p> |
|---|
| 28 | This sample shows how to create an inline editor instance of CKEditor. It is created |
|---|
| 29 | with a JavaScript call using the following code: |
|---|
| 30 | </p> |
|---|
| 31 | <pre class="samples"> |
|---|
| 32 | // This property tells CKEditor to not activate every element with contenteditable=true element. |
|---|
| 33 | CKEDITOR.disableAutoInline = true; |
|---|
| 34 | |
|---|
| 35 | var editor = CKEDITOR.inline( document.getElementById( 'editable' ) ); |
|---|
| 36 | </pre> |
|---|
| 37 | <p> |
|---|
| 38 | Note that <code>editable</code> in the code above is the <code>id</code> |
|---|
| 39 | attribute of the <code><div></code> element to be converted into an inline instance. |
|---|
| 40 | </p> |
|---|
| 41 | </div> |
|---|
| 42 | <div id="editable" contenteditable="true"> |
|---|
| 43 | <p>ff</p> |
|---|
| 44 | </div> |
|---|
| 45 | |
|---|
| 46 | <script> |
|---|
| 47 | // We need to turn off the automatic editor creation first. |
|---|
| 48 | CKEDITOR.disableAutoInline = true; |
|---|
| 49 | |
|---|
| 50 | |
|---|
| 51 | var editor = CKEDITOR.inline( 'editable', {tabSpaces : 4} ); |
|---|
| 52 | </script> |
|---|
| 53 | <div id="footer"> |
|---|
| 54 | <hr> |
|---|
| 55 | <p> |
|---|
| 56 | CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/"> |
|---|
| 57 | http://ckeditor.com</a> |
|---|
| 58 | </p> |
|---|
| 59 | <p id="copy"> |
|---|
| 60 | Copyright © 2003-2014, <a class="samples" href="http://cksource.com/">CKSource</a> |
|---|
| 61 | - Frederico Knabben. All rights reserved. |
|---|
| 62 | </p> |
|---|
| 63 | </div> |
|---|
| 64 | </body> |
|---|
| 65 | </html> |
|---|