sample04.asp 3.0 KB

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