sample03.asp 2.8 KB

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