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

Revision 1575, 3.2 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( 'cmbSkins' ) ;
39
40        // Get the active skin.
41        var sSkin = editorInstance.Config['SkinPath'] ;
42        sSkin = sSkin.match( /[^\/]+(?=\/$)/g ) ;
43
44        oCombo.value = sSkin ;
45        oCombo.style.visibility = '' ;
46}
47
48function ChangeSkin( skinName )
49{
50        window.location.href = window.location.pathname + "?Skin=" + skinName ;
51}
52
53                </script>
54        </head>
55        <body>
56                <h1>FCKeditor - ASP - Sample 4</h1>
57                This sample shows how to change the editor skin.
58                <hr>
59                <table cellpadding="0" cellspacing="0" border="0">
60                        <tr>
61                                <td>
62                                        Select the skin to load:&nbsp;
63                                </td>
64                                <td>
65                                        <select id="cmbSkins" onchange="ChangeSkin(this.value);" style="VISIBILITY: hidden">
66                                                <option value="default" selected>Default</option>
67                                                <option value="office2003">Office 2003</option>
68                                                <option value="silver">Silver</option>
69                                        </select>
70                                </td>
71                        </tr>
72                </table>
73                <br>
74                <form action="sampleposteddata.asp" method="post" target="_blank">
75<%
76' Automatically calculates the editor base path based on the _samples directory.
77' This is usefull only for these samples. A real application should use something like this:
78' oFCKeditor.BasePath = '/fckeditor/' ; // '/fckeditor/' is the default value.
79Dim sBasePath
80sBasePath = Request.ServerVariables("PATH_INFO")
81sBasePath = Left( sBasePath, InStrRev( sBasePath, "/_samples" ) )
82
83'This RegExp is used to sanitize recived skin parameter
84Dim oRegex
85Set oRegex = New RegExp
86oRegex.Global           = True
87oRegex.Pattern = "[^a-zA-Z0-9]"
88
89Dim oFCKeditor
90Set oFCKeditor = New FCKeditor
91oFCKeditor.BasePath = sBasePath
92
93If Request.QueryString("Skin") <> "" Then
94        oFCKeditor.Config("SkinPath") = sBasePath + "editor/skins/" & oRegex.Replace( Request.QueryString("Skin"), "" ) + "/"
95End If
96
97oFCKeditor.Value = "<p>This is some <strong>sample text</strong>. You are using <a href=""http://www.fckeditor.net/"">FCKeditor</a>."
98oFCKeditor.Create "FCKeditor1"
99%>
100                        <br>
101                        <input type="submit" value="Submit">
102                </form>
103        </body>
104</html>
Note: See TracBrowser for help on using the repository browser.