| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|---|
| 2 | <html xmlns="http://www.w3.org/1999/xhtml"> |
|---|
| 3 | <head> |
|---|
| 4 | <meta content="text/html; charset=utf-8" http-equiv="content-type" /> |
|---|
| 5 | <script type="text/javascript" src="../ckeditor.js"></script> |
|---|
| 6 | <script src="sample.js" type="text/javascript"></script> |
|---|
| 7 | <link href="sample.css" rel="stylesheet" type="text/css" /> |
|---|
| 8 | <style id="styles" type="text/css"> |
|---|
| 9 | |
|---|
| 10 | .cke_button_testCmd .cke_icon |
|---|
| 11 | { |
|---|
| 12 | display: none !important; |
|---|
| 13 | } |
|---|
| 14 | |
|---|
| 15 | .cke_button_testCmd .cke_label |
|---|
| 16 | { |
|---|
| 17 | display: inline !important; |
|---|
| 18 | } |
|---|
| 19 | |
|---|
| 20 | </style> |
|---|
| 21 | <script type="text/javascript"> |
|---|
| 22 | //<![CDATA[ |
|---|
| 23 | |
|---|
| 24 | //]]> |
|---|
| 25 | </script> |
|---|
| 26 | |
|---|
| 27 | </head> |
|---|
| 28 | <body> |
|---|
| 29 | <textarea cols="80" id="editor1" name="editor1" rows="10"></textarea> |
|---|
| 30 | <script type="text/javascript"> |
|---|
| 31 | //<![CDATA[ |
|---|
| 32 | // Replace the <textarea id="editor1"> with an CKEditor instance. |
|---|
| 33 | var editor = CKEDITOR.replace( 'editor1', |
|---|
| 34 | { |
|---|
| 35 | // Defines a simpler toolbar to be used in this sample. |
|---|
| 36 | // Note that we have added out "MyButton" button here. |
|---|
| 37 | toolbar : [ [ 'Source', '-', 'Test Button' ] ] |
|---|
| 38 | }); |
|---|
| 39 | editor.on( 'pluginsLoaded', function( ev ) |
|---|
| 40 | { |
|---|
| 41 | editor.addCommand( 'testCmd', { |
|---|
| 42 | exec: function() { |
|---|
| 43 | var hyperLink = editor.document.createElement('a'); |
|---|
| 44 | hyperLink.setAttribute("href", "alm://caliberrm!WL028197_20000_101/283;ns=requirement"); |
|---|
| 45 | hyperLink.setHtml("Test 123"); |
|---|
| 46 | editor.insertElement(hyperLink); |
|---|
| 47 | } |
|---|
| 48 | }); |
|---|
| 49 | |
|---|
| 50 | // Add the a custom toolbar buttons, which fires the above |
|---|
| 51 | // command.. |
|---|
| 52 | editor.ui.addButton( 'Test Button', |
|---|
| 53 | { |
|---|
| 54 | label : 'Test', |
|---|
| 55 | command : 'testCmd' |
|---|
| 56 | } ); |
|---|
| 57 | }); |
|---|
| 58 | //]]> |
|---|
| 59 | </script> |
|---|
| 60 | </body> |
|---|
| 61 | </html> |
|---|