sample02.asp 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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( 'cmbLanguages' ) ;
  38. for ( code in editorInstance.Language.AvailableLanguages )
  39. {
  40. AddComboOption( oCombo, editorInstance.Language.AvailableLanguages[code] + ' (' + code + ')', code ) ;
  41. }
  42. oCombo.value = editorInstance.Language.ActiveLanguage.Code ;
  43. }
  44. function AddComboOption(combo, optionText, optionValue)
  45. {
  46. var oOption = document.createElement("OPTION") ;
  47. combo.options.add(oOption) ;
  48. oOption.innerHTML = optionText ;
  49. oOption.value = optionValue ;
  50. return oOption ;
  51. }
  52. function ChangeLanguage( languageCode )
  53. {
  54. window.location.href = window.location.pathname + "?Lang=" + languageCode ;
  55. }
  56. </script>
  57. </head>
  58. <body>
  59. <h1>FCKeditor - ASP - Sample 2</h1>
  60. This sample shows the editor in all its available languages.
  61. <hr>
  62. <table cellpadding="0" cellspacing="0" border="0">
  63. <tr>
  64. <td>
  65. Select a language:&nbsp;
  66. </td>
  67. <td>
  68. <select id="cmbLanguages" onchange="ChangeLanguage(this.value);">
  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.
  79. Dim sBasePath
  80. sBasePath = Request.ServerVariables("PATH_INFO")
  81. sBasePath = Left( sBasePath, InStrRev( sBasePath, "/_samples" ) )
  82. Dim oFCKeditor
  83. Set oFCKeditor = New FCKeditor
  84. oFCKeditor.BasePath = sBasePath
  85. If Request.QueryString("Lang") = "" Then
  86. oFCKeditor.Config("AutoDetectLanguage") = True
  87. oFCKeditor.Config("DefaultLanguage") = "en"
  88. Else
  89. oFCKeditor.Config("AutoDetectLanguage") = False
  90. oFCKeditor.Config("DefaultLanguage") = Request.QueryString("Lang")
  91. End If
  92. oFCKeditor.Value = "<p>This is some <strong>sample text</strong>. You are using <a href=""http://www.fckeditor.net/"">FCKeditor</a>."
  93. oFCKeditor.Create "FCKeditor1"
  94. %>
  95. <br>
  96. <input type="submit" value="Submit">
  97. </form>
  98. </body>
  99. </html>