| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|---|
| 2 | |
|---|
| 3 | <html xmlns="http://www.w3.org/1999/xhtml"> |
|---|
| 4 | <head> |
|---|
| 5 | <title>Sample - CKEditor</title> |
|---|
| 6 | <meta content="text/html; charset=utf-8" http-equiv="content-type"/> |
|---|
| 7 | <script type="text/javascript" src="../ckeditor.js"></script> |
|---|
| 8 | </head> |
|---|
| 9 | |
|---|
| 10 | <body> |
|---|
| 11 | <pre> |
|---|
| 12 | insert html lost current selection under safari. it works under chrome, firefox, but doesn't work under safari. |
|---|
| 13 | Steps to reproduce using safari: |
|---|
| 14 | 1. open this test file |
|---|
| 15 | 2. click any position in the editor |
|---|
| 16 | 3. click safari address bar or search input box on the top |
|---|
| 17 | 4. click execute button |
|---|
| 18 | 5. it will insert the image at the beginning. |
|---|
| 19 | </pre> |
|---|
| 20 | |
|---|
| 21 | <p> |
|---|
| 22 | <textarea id="commands" cols="100" rows="8" name="commands" rows="5"> |
|---|
| 23 | try{ |
|---|
| 24 | var oEditor=CKEDITOR.instances.htmlEditor; |
|---|
| 25 | oEditor.focus(); |
|---|
| 26 | oEditor.insertHtml("<img src='http://www.google.com/images/nav_logo7.png'>"); |
|---|
| 27 | oEditor.fire( 'saveSnapshot' ); |
|---|
| 28 | } catch(e){ e.toString(); } |
|---|
| 29 | </textarea> |
|---|
| 30 | <input name="execute" type="button" value="Execute" onClick="return eval(document.getElementById('commands').value);"/> |
|---|
| 31 | </p> |
|---|
| 32 | |
|---|
| 33 | <p> |
|---|
| 34 | <textarea cols="80" id="htmlEditor" name="htmlEditor" rows="10"><p>This is some <strong>sample text</strong>. You are using <a href="http://ckeditor.com/">CKEditor</a>.</p></textarea> |
|---|
| 35 | <script type="text/javascript"> |
|---|
| 36 | //<![CDATA[ |
|---|
| 37 | CKEDITOR.replace( 'htmlEditor' ); |
|---|
| 38 | //]]> |
|---|
| 39 | </script> |
|---|
| 40 | </p> |
|---|
| 41 | </body> |
|---|
| 42 | </html> |
|---|