source: sandbox/filemanager/tp/fckeditor/_samples/asp/sample02.asp @ 1575

Revision 1575, 3.5 KB checked in by amuller, 14 years ago (diff)

Ticket #597 - Implentação, melhorias do modulo gerenciador de arquivos

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