| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|---|
| 2 | <!-- |
|---|
| 3 | * FCKeditor - The text editor for Internet - http://www.fckeditor.net |
|---|
| 4 | * Copyright (C) 2003-2007 Frederico Caldeira Knabben |
|---|
| 5 | * |
|---|
| 6 | * == BEGIN LICENSE == |
|---|
| 7 | * |
|---|
| 8 | * Licensed under the terms of any of the following licenses at your |
|---|
| 9 | * choice: |
|---|
| 10 | * |
|---|
| 11 | * - GNU General Public License Version 2 or later (the "GPL") |
|---|
| 12 | * http://www.gnu.org/licenses/gpl.html |
|---|
| 13 | * |
|---|
| 14 | * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") |
|---|
| 15 | * http://www.gnu.org/licenses/lgpl.html |
|---|
| 16 | * |
|---|
| 17 | * - Mozilla Public License Version 1.1 or later (the "MPL") |
|---|
| 18 | * http://www.mozilla.org/MPL/MPL-1.1.html |
|---|
| 19 | * |
|---|
| 20 | * == END LICENSE == |
|---|
| 21 | * |
|---|
| 22 | * Sample page. |
|---|
| 23 | --> |
|---|
| 24 | <html xmlns="http://www.w3.org/1999/xhtml"> |
|---|
| 25 | <head> |
|---|
| 26 | <title>#1509 TC</title> |
|---|
| 27 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
|---|
| 28 | <meta name="robots" content="noindex, nofollow" /> |
|---|
| 29 | <script type="text/javascript" src="/fckeditor/fckeditor.js"></script> |
|---|
| 30 | <script type="text/javascript"> |
|---|
| 31 | |
|---|
| 32 | function InsertHTML() |
|---|
| 33 | { |
|---|
| 34 | // Get the editor instance that we want to interact with. |
|---|
| 35 | var oEditor = FCKeditorAPI.GetInstance('FCKeditor1') ; |
|---|
| 36 | |
|---|
| 37 | // Check the active editing mode. |
|---|
| 38 | if ( oEditor.EditMode == FCK_EDITMODE_WYSIWYG ) |
|---|
| 39 | { |
|---|
| 40 | // Insert the desired HTML. |
|---|
| 41 | oEditor.InsertHtml( 'some text' ) ; |
|---|
| 42 | } |
|---|
| 43 | else |
|---|
| 44 | alert( 'You must be on WYSIWYG mode!' ) ; |
|---|
| 45 | } |
|---|
| 46 | |
|---|
| 47 | </script> |
|---|
| 48 | </head> |
|---|
| 49 | <body> |
|---|
| 50 | <h1> |
|---|
| 51 | TC for #1509 |
|---|
| 52 | </h1> |
|---|
| 53 | <ol> |
|---|
| 54 | <li>Wait the editor to load</li> |
|---|
| 55 | <li>Click the editing area</li> |
|---|
| 56 | <li>Type "a " (a + [space])</li> |
|---|
| 57 | <li>Hit the "Insert HTML"</li> |
|---|
| 58 | <li>Switch to source. Expected results: "<code><p>a Some text</a></code>". </li> |
|---|
| 59 | </ol> |
|---|
| 60 | <hr /> |
|---|
| 61 | <form method="post" target="_blank"> |
|---|
| 62 | <script type="text/javascript"> |
|---|
| 63 | |
|---|
| 64 | var oFCKeditor = new FCKeditor( 'FCKeditor1' ) ; |
|---|
| 65 | oFCKeditor.BasePath = '/fckeditor/' ; |
|---|
| 66 | oFCKeditor.Create() ; |
|---|
| 67 | |
|---|
| 68 | </script> |
|---|
| 69 | </form> |
|---|
| 70 | <hr /> |
|---|
| 71 | <input type="button" value="Insert HTML" onclick="InsertHTML();" /> |
|---|
| 72 | </body> |
|---|
| 73 | </html> |
|---|