[1257] | 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 |
---|
| 4 | * Copyright (C) 2003-2006 Frederico Caldeira Knabben |
---|
| 5 | * |
---|
| 6 | * Licensed under the terms of the GNU Lesser General Public License: |
---|
| 7 | * http://www.opensource.org/licenses/lgpl-license.php |
---|
| 8 | * |
---|
| 9 | * For further information visit: |
---|
| 10 | * http://www.fckeditor.net/ |
---|
| 11 | * |
---|
| 12 | * "Support Open Source software. What about a donation today?" |
---|
| 13 | * |
---|
| 14 | * File Name: sample05.html |
---|
| 15 | * Sample page. |
---|
| 16 | * |
---|
| 17 | * File Authors: |
---|
| 18 | * Frederico Caldeira Knabben (fredck@fckeditor.net) |
---|
| 19 | --> |
---|
| 20 | <html xmlns="http://www.w3.org/1999/xhtml"> |
---|
| 21 | <head> |
---|
| 22 | <title>FCKeditor - Sample</title> |
---|
| 23 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
---|
| 24 | <meta name="robots" content="noindex, nofollow" /> |
---|
| 25 | <link href="../sample.css" rel="stylesheet" type="text/css" /> |
---|
| 26 | <script type="text/javascript" src="../../fckeditor.js"></script> |
---|
| 27 | <script type="text/javascript"> |
---|
| 28 | |
---|
| 29 | function FCKeditor_OnComplete( editorInstance ) |
---|
| 30 | { |
---|
| 31 | var oCombo = document.getElementById( 'cmbSkins' ) ; |
---|
| 32 | |
---|
| 33 | // Get the active skin. |
---|
| 34 | var sSkin = editorInstance.Config['SkinPath'] ; |
---|
| 35 | sSkin = sSkin.match( /[^\/]+(?=\/$)/g ) ; |
---|
| 36 | |
---|
| 37 | oCombo.value = sSkin ; |
---|
| 38 | oCombo.style.visibility = '' ; |
---|
| 39 | } |
---|
| 40 | |
---|
| 41 | function ChangeLanguage( languageCode ) |
---|
| 42 | { |
---|
| 43 | window.location.href = window.location.pathname + "?" + languageCode ; |
---|
| 44 | } |
---|
| 45 | |
---|
| 46 | </script> |
---|
| 47 | </head> |
---|
| 48 | <body> |
---|
| 49 | <h1> |
---|
| 50 | FCKeditor - JavaScript - Sample 5</h1> |
---|
| 51 | <div> |
---|
| 52 | This sample shows how to change the editor skin. |
---|
| 53 | </div> |
---|
| 54 | <hr /> |
---|
| 55 | <table cellpadding="0" cellspacing="0" border="0"> |
---|
| 56 | <tr> |
---|
| 57 | <td> |
---|
| 58 | Select the skin to load: |
---|
| 59 | </td> |
---|
| 60 | <td> |
---|
| 61 | <select id="cmbSkins" onchange="ChangeLanguage(this.value);" style="visibility: hidden"> |
---|
| 62 | <option value="default" selected="selected">Default</option> |
---|
| 63 | <option value="office2003">Office 2003</option> |
---|
| 64 | <option value="silver">Silver</option> |
---|
| 65 | </select> |
---|
| 66 | </td> |
---|
| 67 | </tr> |
---|
| 68 | </table> |
---|
| 69 | <br /> |
---|
| 70 | <form action="sampleposteddata.asp" method="post" target="_blank"> |
---|
| 71 | <script type="text/javascript"> |
---|
| 72 | <!-- |
---|
| 73 | // Automatically calculates the editor base path based on the _samples directory. |
---|
| 74 | // This is usefull only for these samples. A real application should use something like this: |
---|
| 75 | // oFCKeditor.BasePath = '/fckeditor/' ; // '/fckeditor/' is the default value. |
---|
| 76 | var sBasePath = document.location.pathname.substring(0,document.location.pathname.lastIndexOf('_samples')) ; |
---|
| 77 | |
---|
| 78 | // Get the skin from the URL. |
---|
| 79 | var sSkin ; |
---|
| 80 | if ( document.location.search.length > 1 ) |
---|
| 81 | sSkin = document.location.search.substr(1) ; |
---|
| 82 | |
---|
| 83 | var oFCKeditor = new FCKeditor( 'FCKeditor1' ) ; |
---|
| 84 | oFCKeditor.BasePath = sBasePath ; |
---|
| 85 | |
---|
| 86 | if ( sSkin != null ) |
---|
| 87 | { |
---|
| 88 | var sSkinPath = sBasePath + 'editor/skins/' + sSkin + '/' ; |
---|
| 89 | oFCKeditor.Config['SkinPath'] = sSkinPath ; |
---|
| 90 | |
---|
| 91 | // The following switch is optional. It is done to enhance the loading |
---|
| 92 | // time of the toolbar, by preloading the images used on it. |
---|
| 93 | switch ( sSkin ) |
---|
| 94 | { |
---|
| 95 | case 'office2003' : |
---|
| 96 | oFCKeditor.Config['PreloadImages'] = |
---|
| 97 | sSkinPath + 'images/toolbar.start.gif' + ';' + |
---|
| 98 | sSkinPath + 'images/toolbar.end.gif' + ';' + |
---|
| 99 | sSkinPath + 'images/toolbar.bg.gif' + ';' + |
---|
| 100 | sSkinPath + 'images/toolbar.buttonarrow.gif' ; |
---|
| 101 | break ; |
---|
| 102 | |
---|
| 103 | case 'silver' : |
---|
| 104 | oFCKeditor.Config['PreloadImages'] = |
---|
| 105 | sSkinPath + 'images/toolbar.start.gif' + ';' + |
---|
| 106 | sSkinPath + 'images/toolbar.end.gif' + ';' + |
---|
| 107 | sSkinPath + 'images/toolbar.buttonbg.gif' + ';' + |
---|
| 108 | sSkinPath + 'images/toolbar.buttonarrow.gif' ; |
---|
| 109 | break ; |
---|
| 110 | } |
---|
| 111 | } |
---|
| 112 | |
---|
| 113 | oFCKeditor.Value = 'This is some <strong>sample text</strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor</a>.' ; |
---|
| 114 | oFCKeditor.Create() ; |
---|
| 115 | //--> |
---|
| 116 | </script> |
---|
| 117 | <br /> |
---|
| 118 | <input type="submit" value="Submit" /> |
---|
| 119 | </form> |
---|
| 120 | </body> |
---|
| 121 | </html> |
---|