1 | <cfsetting enablecfoutputonly="true">
|
---|
2 | <!---
|
---|
3 | * FCKeditor - The text editor for Internet - http://www.fckeditor.net
|
---|
4 | * Copyright (C) 2003-2009 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 for ColdFusion MX 6.0 and above.
|
---|
23 | --->
|
---|
24 | <cfoutput>
|
---|
25 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
---|
26 | <html>
|
---|
27 | <head>
|
---|
28 | <title>FCKeditor - Sample</title>
|
---|
29 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
---|
30 | <meta name="robots" content="noindex, nofollow">
|
---|
31 | <link href="../sample.css" rel="stylesheet" type="text/css" />
|
---|
32 | <script type="text/javascript">
|
---|
33 |
|
---|
34 | function FCKeditor_OnComplete( editorInstance )
|
---|
35 | {
|
---|
36 | var oCombo = document.getElementById( 'cmbSkins' ) ;
|
---|
37 |
|
---|
38 | // Get the active skin.
|
---|
39 | var sSkin = editorInstance.Config['SkinPath'] ;
|
---|
40 | sSkin = sSkin.match( /[^\/]+(?=\/$)/g ) ;
|
---|
41 |
|
---|
42 | oCombo.value = sSkin ;
|
---|
43 | oCombo.style.visibility = '' ;
|
---|
44 | }
|
---|
45 |
|
---|
46 | function ChangeSkin( skinName )
|
---|
47 | {
|
---|
48 | window.location.href = window.location.pathname + "?Skin=" + skinName ;
|
---|
49 | }
|
---|
50 |
|
---|
51 | </script>
|
---|
52 | </head>
|
---|
53 | <body>
|
---|
54 | <h1>FCKeditor - ColdFusion Component (CFC) - Sample 4</h1>
|
---|
55 | This sample shows how to change the editor skin.
|
---|
56 | <hr>
|
---|
57 | </cfoutput>
|
---|
58 | <cfif listFirst( server.coldFusion.productVersion ) LT 6>
|
---|
59 | <cfoutput><br><em style="color: red;">This sample works only with a ColdFusion MX server and higher, because it uses some advantages of this version.</em></cfoutput>
|
---|
60 | <cfabort>
|
---|
61 | </cfif>
|
---|
62 | <cfoutput>
|
---|
63 | <table cellpadding="0" cellspacing="0" border="0">
|
---|
64 | <tr>
|
---|
65 | <td>
|
---|
66 | Select the skin to load:
|
---|
67 | </td>
|
---|
68 | <td>
|
---|
69 | <select id="cmbSkins" onchange="ChangeSkin(this.value);" style="VISIBILITY: hidden">
|
---|
70 | <option value="default" selected>Default</option>
|
---|
71 | <option value="office2003">Office 2003</option>
|
---|
72 | <option value="silver">Silver</option>
|
---|
73 | </select>
|
---|
74 | </td>
|
---|
75 | </tr>
|
---|
76 | </table>
|
---|
77 | <br>
|
---|
78 | <form action="sampleposteddata.cfm" method="post" target="_blank">
|
---|
79 | </cfoutput>
|
---|
80 | <cfscript>
|
---|
81 | // Calculate basepath for FCKeditor. It's in the folder right above _samples
|
---|
82 | basePath = Left( cgi.script_name, FindNoCase( '_samples', cgi.script_name ) - 1 ) ;
|
---|
83 |
|
---|
84 | fckEditor = createObject( "component", "#basePath#fckeditor" ) ;
|
---|
85 | fckEditor.instanceName = "myEditor" ;
|
---|
86 | fckEditor.value = '<p>This is some <strong>sample text</strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor</a>.</p>' ;
|
---|
87 | fckEditor.basePath = basePath ;
|
---|
88 | if ( isDefined( "URL.Skin" ) )
|
---|
89 | {
|
---|
90 | fckEditor.config['SkinPath'] = basePath & 'editor/skins/' & REReplaceNoCase( URL.Skin, "[^a-z0-9]", "", "all" ) & '/' ;
|
---|
91 | }
|
---|
92 | fckEditor.create() ; // create the editor.
|
---|
93 | </cfscript>
|
---|
94 | <cfoutput>
|
---|
95 | <br>
|
---|
96 | <input type="submit" value="Submit">
|
---|
97 | </form>
|
---|
98 | </body>
|
---|
99 | </html>
|
---|
100 | </cfoutput>
|
---|
101 | <cfsetting enablecfoutputonly="false">
|
---|