[ Index ]
 

Code source de FCKeditor 2.4

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/_samples/asp/ -> sample04.asp (source)

   1  <%@ CodePage=65001 Language="VBScript"%>
   2  <% Option Explicit %>
   3  <!--
   4   * FCKeditor - The text editor for Internet - http://www.fckeditor.net
   5   * Copyright (C) 2003-2007 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   * File Name: sample04.asp
  24   *     Sample page.
  25   * 
  26   * File Authors:
  27   *         Frederico Caldeira Knabben (www.fckeditor.net)
  28  -->
  29  <% ' You must set "Enable Parent Paths" on your web site in order this relative include to work. %>
  30  <!-- #INCLUDE file="../../fckeditor.asp" -->
  31  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  32  <html>
  33      <head>
  34          <title>FCKeditor - Sample</title>
  35          <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  36          <meta name="robots" content="noindex, nofollow">
  37          <link href="../sample.css" rel="stylesheet" type="text/css" />
  38          <script type="text/javascript">
  39  
  40  function FCKeditor_OnComplete( editorInstance )
  41  {
  42      var oCombo = document.getElementById( 'cmbSkins' ) ;
  43      
  44      // Get the active skin.
  45      var sSkin = editorInstance.Config['SkinPath'] ;
  46      sSkin = sSkin.match( /[^\/]+(?=\/$)/g ) ;
  47      
  48      oCombo.value = sSkin ;
  49      oCombo.style.visibility = '' ;
  50  }
  51  
  52  function ChangeSkin( skinName )
  53  {
  54      window.location.href = window.location.pathname + "?Skin=" + skinName ;
  55  }
  56  
  57          </script>
  58      </head>
  59      <body>
  60          <h1>FCKeditor - ASP - Sample 4</h1>
  61          This sample shows how to change the editor skin.
  62          <hr>
  63          <table cellpadding="0" cellspacing="0" border="0">
  64              <tr>
  65                  <td>
  66                      Select the skin to load:&nbsp;
  67                  </td>
  68                  <td>
  69                      <select id="cmbSkins" onchange="ChangeSkin(this.value);" style="VISIBILITY: hidden">
  70                          <option value="default" selected>Default</option>
  71                          <option value="office2003">Office 2003</option>
  72                          <option value="silver">Silver</option>
  73                      </select>
  74                  </td>
  75              </tr>
  76          </table>
  77          <br>
  78          <form action="sampleposteddata.asp" method="post" target="_blank">
  79  <%
  80  ' Automatically calculates the editor base path based on the _samples directory.
  81  ' This is usefull only for these samples. A real application should use something like this:
  82  ' oFCKeditor.BasePath = '/fckeditor/' ;    // '/fckeditor/' is the default value.
  83  Dim sBasePath
  84  sBasePath = Request.ServerVariables("PATH_INFO")
  85  sBasePath = Left( sBasePath, InStrRev( sBasePath, "/_samples" ) )
  86  
  87  Dim oFCKeditor
  88  Set oFCKeditor = New FCKeditor
  89  oFCKeditor.BasePath = sBasePath
  90  
  91  If Request.QueryString("Skin") <> "" Then
  92      oFCKeditor.Config("SkinPath") = sBasePath + "editor/skins/" & Server.HTMLEncode( Request.QueryString("Skin") ) + "/"
  93  End If
  94  
  95  oFCKeditor.Value = "This is some <strong>sample text</strong>. You are using <a href=""http://www.fckeditor.net/"">FCKeditor</a>."
  96  oFCKeditor.Create "FCKeditor1"
  97  %>
  98              <br>
  99              <input type="submit" value="Submit">
 100          </form>
 101      </body>
 102  </html>


Généré le : Sun Feb 25 15:28:05 2007 par Balluche grâce à PHPXref 0.7