~ubuntu-branches/ubuntu/trusty/fusionforge/trusty

« back to all changes in this revision

Viewing changes to plugins/fckeditor/www/_samples/cfm/sample02.cfm

  • Committer: Bazaar Package Importer
  • Author(s): Roland Mas
  • Date: 2011-04-15 14:55:34 UTC
  • mfrom: (4.1.10 sid)
  • Revision ID: james.westby@ubuntu.com-20110415145534-mvn1nochufjmw177
Tags: 5.0.3-1
New upstream bugfix release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<cfsetting enablecfoutputonly="true">
 
2
<!---
 
3
 * FCKeditor - The text editor for Internet - http://www.fckeditor.net
 
4
 * Copyright (C) 2003-2008 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.
 
23
--->
 
24
 
 
25
<cfoutput>
 
26
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 
27
<html>
 
28
<head>
 
29
        <title>FCKeditor - Sample</title>
 
30
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 
31
        <meta name="robots" content="noindex, nofollow">
 
32
        <link href="../sample.css" rel="stylesheet" type="text/css" />
 
33
                <script type="text/javascript">
 
34
 
 
35
function FCKeditor_OnComplete( editorInstance )
 
36
{
 
37
        var oCombo = document.getElementById( 'cmbLanguages' ) ;
 
38
        for ( code in editorInstance.Language.AvailableLanguages )
 
39
        {
 
40
                AddComboOption( oCombo, editorInstance.Language.AvailableLanguages[code] + ' (' + code + ')', code ) ;
 
41
        }
 
42
        oCombo.value = editorInstance.Language.ActiveLanguage.Code ;
 
43
}
 
44
 
 
45
function AddComboOption(combo, optionText, optionValue)
 
46
{
 
47
        var oOption = document.createElement("OPTION") ;
 
48
 
 
49
        combo.options.add(oOption) ;
 
50
 
 
51
        oOption.innerHTML = optionText ;
 
52
        oOption.value     = optionValue ;
 
53
 
 
54
        return oOption ;
 
55
}
 
56
 
 
57
function ChangeLanguage( languageCode )
 
58
{
 
59
        window.location.href = window.location.pathname + "?Lang=" + languageCode ;
 
60
}
 
61
                </script>
 
62
</head>
 
63
<body>
 
64
<h1>FCKeditor - ColdFusion - Sample 2</h1>
 
65
This sample shows the editor in all its available languages.
 
66
<hr>
 
67
<table cellpadding="0" cellspacing="0" border="0">
 
68
        <tr>
 
69
                <td>
 
70
                        Select a language:&nbsp;
 
71
                </td>
 
72
                <td>
 
73
                        <select id="cmbLanguages" onchange="ChangeLanguage(this.value);">
 
74
                        </select>
 
75
                </td>
 
76
        </tr>
 
77
</table>
 
78
<br>
 
79
<form action="sampleposteddata.cfm" method="post" target="_blank">
 
80
</cfoutput>
 
81
 
 
82
<cfset config = structNew()>
 
83
<cfif isDefined( "URL.Lang" )>
 
84
        <cfset config["AutoDetectLanguage"]             = false>
 
85
        <cfset config["DefaultLanguage"]                = HTMLEditFormat( URL.Lang )>
 
86
<cfelse>
 
87
        <cfset config["AutoDetectLanguage"]             = true>
 
88
        <cfset config["DefaultLanguage"]                = 'en'>
 
89
</cfif>
 
90
 
 
91
<!--- Calculate basepath for FCKeditor. It's in the folder right above _samples --->
 
92
<cfset basePath = Left( cgi.script_name, FindNoCase( '_samples', cgi.script_name ) - 1 )>
 
93
 
 
94
<cfmodule
 
95
        template="../../fckeditor.cfm"
 
96
        basePath="#basePath#"
 
97
        instanceName="myEditor"
 
98
        value='<p>This is some <strong>sample text</strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor</a>.</p>'
 
99
        width="100%"
 
100
        height="200"
 
101
        config="#config#"
 
102
>
 
103
<cfoutput>
 
104
        <br>
 
105
        <input type="submit" value="Submit">
 
106
        </form>
 
107
</body>
 
108
</html>
 
109
</cfoutput>
 
110
<cfsetting enablecfoutputonly="false">