PageRenderTime 9ms CodeModel.GetById 7ms app.highlight 1ms RepoModel.GetById 0ms app.codeStats 0ms

/EQT_V2/EQT/EQTWebApp/fckeditor/_samples/afp/sample02.afp

http://sgsoft-las.googlecode.com/
Unknown | 113 lines | 99 code | 14 blank | 0 comment | 0 complexity | b9dcc45d0ad3b67b33f9f2b923bca949 MD5 | raw file
Possible License(s): LGPL-2.1
  1<%
  2 * FCKeditor - The text editor for Internet - http://www.fckeditor.net
  3 * Copyright (C) 2003-2009 Frederico Caldeira Knabben
  4 *
  5 * == BEGIN LICENSE ==
  6 *
  7 * Licensed under the terms of any of the following licenses at your
  8 * choice:
  9 *
 10 *  - GNU General Public License Version 2 or later (the "GPL")
 11 *    http://www.gnu.org/licenses/gpl.html
 12 *
 13 *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
 14 *    http://www.gnu.org/licenses/lgpl.html
 15 *
 16 *  - Mozilla Public License Version 1.1 or later (the "MPL")
 17 *    http://www.mozilla.org/MPL/MPL-1.1.html
 18 *
 19 * == END LICENSE ==
 20 *
 21 * This page is a basic Sample for FCKeditor integration in the AFP script language (www.afpages.de)
 22 *
 23%>
 24
 25<html>
 26	<head>
 27		<title>FCKeditor - AFP Sample 2</title>
 28		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 29		<meta name="robots" content="noindex, nofollow">
 30		<link href="../sample.css" rel="stylesheet" type="text/css" />
 31
 32		<script type="text/javascript">
 33		function FCKeditor_OnComplete( editorInstance )
 34		{
 35				var oCombo = document.getElementById( 'cmbLanguages' ) ;
 36			for ( code in editorInstance.Language.AvailableLanguages )
 37			{
 38				AddComboOption( oCombo, editorInstance.Language.AvailableLanguages[code] + ' (' + code + ')', code ) ;
 39			}
 40			oCombo.value = editorInstance.Language.ActiveLanguage.Code ;
 41		}
 42
 43		function AddComboOption(combo, optionText, optionValue)
 44		{
 45			var oOption = document.createElement("OPTION") ;
 46
 47			combo.options.add(oOption) ;
 48
 49			oOption.innerHTML = optionText ;
 50			oOption.value     = optionValue ;
 51
 52			return oOption ;
 53		}
 54
 55		function ChangeLanguage( languageCode )
 56		{
 57			window.location.href = window.location.pathname + "?Lang=" + languageCode ;
 58		}
 59		</script>
 60		</head>
 61	<body>
 62		<h1>FCKeditor - AFP - Sample 2</h1>
 63		This sample shows the editor in all its available languages.
 64		<hr>
 65		<table cellpadding="0" cellspacing="0" border="0">
 66			<tr>
 67				<td>
 68					Select a language:&nbsp;
 69				</td>
 70				<td>
 71					<select id="cmbLanguages" onchange="ChangeLanguage(this.value);">
 72					</select>
 73				</td>
 74			</tr>
 75		</table>
 76		<br>
 77		<form action="sampleposteddata.afp" method="post" target="_blank">
 78<%
 79
 80			sBasePath="../../../fckeditor/"						&& Change this to your local path
 81
 82			oFCKeditor = CREATEOBJECT("FCKeditor")
 83			oFCKeditor.fckeditor("FCKeditor1")
 84
 85			lcLanguage=""										&& Initialize Variable
 86			lcLanguage=request.querystring("Lang")				&& Request Parameter
 87			lcLanguage=oFCKeditor.StripAttacks(lcLanguage)		&& Remove special escape characters
 88			IF EMPTY(lcLanguage)
 89				oFCKeditor.aconfig[1,1]="AutoDetectLanguage"
 90				oFCKeditor.aconfig[1,2]="true"
 91				oFCKeditor.aconfig[2,1]="DefaultLanguage"
 92				oFCKeditor.aconfig[2,2]="en"
 93			ELSE
 94				oFCKeditor.aconfig[1,1]="AutoDetectLanguage"
 95				oFCKeditor.aconfig[1,2]="false"
 96				oFCKeditor.aconfig[2,1]="DefaultLanguage"
 97				oFCKeditor.aconfig[2,2]=lcLanguage
 98			ENDIF
 99
100			lcText=[<p>This is some <strong>sample text</strong>. You are using ]
101			lcText=lcText+[<a href='http://www.fckeditor.net/'>FCKeditor</a>.]
102
103			oFCKeditor.BasePath	= sBasePath
104			oFCKeditor.cValue	= lcText
105
106			? oFCKeditor.Create()
107
108%>
109			<br>
110			<input type="submit" value="Submit">
111		</form>
112	</body>
113</html>