1 | <%@ CodePage=65001 Language="VBScript"%>
|
---|
2 | <% Option Explicit %>
|
---|
3 | <!--
|
---|
4 | * FCKeditor - The text editor for internet
|
---|
5 | * Copyright (C) 2003-2006 Frederico Caldeira Knabben
|
---|
6 | *
|
---|
7 | * Licensed under the terms of the GNU Lesser General Public License:
|
---|
8 | * http://www.opensource.org/licenses/lgpl-license.php
|
---|
9 | *
|
---|
10 | * For further information visit:
|
---|
11 | * http://www.fckeditor.net/
|
---|
12 | *
|
---|
13 | * "Support Open Source software. What about a donation today?"
|
---|
14 | *
|
---|
15 | * File Name: sample02.asp
|
---|
16 | * Sample page.
|
---|
17 | *
|
---|
18 | * File Authors:
|
---|
19 | * Frederico Caldeira Knabben (fredck@fckeditor.net)
|
---|
20 | -->
|
---|
21 | <% ' You must set "Enable Parent Paths" on your web site in order this relative include to work. %>
|
---|
22 | <!-- #INCLUDE file="../../fckeditor.asp" -->
|
---|
23 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
---|
24 | <html>
|
---|
25 | <head>
|
---|
26 | <title>FCKeditor - Sample</title>
|
---|
27 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
---|
28 | <meta name="robots" content="noindex, nofollow">
|
---|
29 | <link href="../sample.css" rel="stylesheet" type="text/css" />
|
---|
30 | <script type="text/javascript">
|
---|
31 |
|
---|
32 | function FCKeditor_OnComplete( editorInstance )
|
---|
33 | {
|
---|
34 | var oCombo = document.getElementById( 'cmbLanguages' ) ;
|
---|
35 | for ( code in editorInstance.Language.AvailableLanguages )
|
---|
36 | {
|
---|
37 | AddComboOption( oCombo, editorInstance.Language.AvailableLanguages[code] + ' (' + code + ')', code ) ;
|
---|
38 | }
|
---|
39 | oCombo.value = editorInstance.Language.ActiveLanguage.Code ;
|
---|
40 | }
|
---|
41 |
|
---|
42 | function AddComboOption(combo, optionText, optionValue)
|
---|
43 | {
|
---|
44 | var oOption = document.createElement("OPTION") ;
|
---|
45 |
|
---|
46 | combo.options.add(oOption) ;
|
---|
47 |
|
---|
48 | oOption.innerHTML = optionText ;
|
---|
49 | oOption.value = optionValue ;
|
---|
50 |
|
---|
51 | return oOption ;
|
---|
52 | }
|
---|
53 |
|
---|
54 | function ChangeLanguage( languageCode )
|
---|
55 | {
|
---|
56 | window.location.href = window.location.pathname + "?Lang=" + languageCode ;
|
---|
57 | }
|
---|
58 | </script>
|
---|
59 | </head>
|
---|
60 | <body>
|
---|
61 | <h1>FCKeditor - ASP - Sample 2</h1>
|
---|
62 | This sample shows the editor in all its available languages.
|
---|
63 | <hr>
|
---|
64 | <table cellpadding="0" cellspacing="0" border="0">
|
---|
65 | <tr>
|
---|
66 | <td>
|
---|
67 | Select a language:
|
---|
68 | </td>
|
---|
69 | <td>
|
---|
70 | <select id="cmbLanguages" onchange="ChangeLanguage(this.value);">
|
---|
71 | </select>
|
---|
72 | </td>
|
---|
73 | </tr>
|
---|
74 | </table>
|
---|
75 | <br>
|
---|
76 | <form action="sampleposteddata.asp" method="post" target="_blank">
|
---|
77 | <%
|
---|
78 | ' Automatically calculates the editor base path based on the _samples directory.
|
---|
79 | ' This is usefull only for these samples. A real application should use something like this:
|
---|
80 | ' oFCKeditor.BasePath = '/fckeditor/' ; // '/fckeditor/' is the default value.
|
---|
81 | Dim sBasePath
|
---|
82 | sBasePath = Request.ServerVariables("PATH_INFO")
|
---|
83 | sBasePath = Left( sBasePath, InStrRev( sBasePath, "/_samples" ) )
|
---|
84 |
|
---|
85 | Dim oFCKeditor
|
---|
86 | Set oFCKeditor = New FCKeditor
|
---|
87 | oFCKeditor.BasePath = sBasePath
|
---|
88 |
|
---|
89 | If Request.QueryString("Lang") = "" Then
|
---|
90 | oFCKeditor.Config("AutoDetectLanguage") = True
|
---|
91 | oFCKeditor.Config("DefaultLanguage") = "en"
|
---|
92 | Else
|
---|
93 | oFCKeditor.Config("AutoDetectLanguage") = False
|
---|
94 | oFCKeditor.Config("DefaultLanguage") = Request.QueryString("Lang")
|
---|
95 | End If
|
---|
96 |
|
---|
97 | oFCKeditor.Value = "This is some <strong>sample text</strong>. You are using <a href=""http://www.fckeditor.net/"">FCKeditor</a>."
|
---|
98 | oFCKeditor.Create "FCKeditor1"
|
---|
99 | %>
|
---|
100 | <br>
|
---|
101 | <input type="submit" value="Submit">
|
---|
102 | </form>
|
---|
103 | </body>
|
---|
104 | </html> |
---|