advanced.asp 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <%@ codepage="65001" language="VBScript" %>
  2. <% Option Explicit %>
  3. <!-- #INCLUDE file="../../ckeditor.asp" -->
  4. <%
  5. ' You must set "Enable Parent Paths" on your web site
  6. ' in order for the above relative include to work.
  7. ' Or you can use #INCLUDE VIRTUAL="/full path/ckeditor.asp"
  8. %>
  9. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  10. <!--
  11. Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
  12. For licensing, see LICENSE.html or http://ckeditor.com/license
  13. -->
  14. <html xmlns="http://www.w3.org/1999/xhtml">
  15. <head>
  16. <title>Sample - CKEditor</title>
  17. <meta content="text/html; charset=utf-8" http-equiv="content-type"/>
  18. <link href="../sample.css" rel="stylesheet" type="text/css"/>
  19. </head>
  20. <body>
  21. <h1 class="samples">
  22. CKEditor Sample
  23. </h1>
  24. <!-- This <div> holds alert messages to be display in the sample page. -->
  25. <div id="alerts">
  26. <noscript>
  27. <p>
  28. <strong>CKEditor requires JavaScript to run</strong>. In a browser with no JavaScript
  29. support, like yours, you should still see the contents (HTML data) and you should
  30. be able to edit it normally, without a rich editor interface.
  31. </p>
  32. </noscript>
  33. </div>
  34. <!-- This <fieldset> holds the HTML that you will usually find in your pages. -->
  35. <fieldset title="Output">
  36. <legend>Output</legend>
  37. <form action="sample_posteddata.asp" method="post">
  38. <p>
  39. <label>Editor 1:</label><br/>
  40. </p>
  41. <%
  42. ' Create class instance.
  43. dim editor, initialValue, code, textareaAttributes
  44. set editor = New CKEditor
  45. ' Do not print the code directly to the browser, return it instead
  46. editor.returnOutput = true
  47. ' Path to CKEditor directory, ideally instead of relative dir, use an absolute path:
  48. ' editor.basePath = "/ckeditor/"
  49. ' If not set, CKEditor will default to /ckeditor/
  50. editor.basePath = "../../"
  51. ' Set global configuration (will be used by all instances of CKEditor).
  52. editor.config("width") = 600
  53. ' Change default textarea attributes
  54. set textareaAttributes = CreateObject("Scripting.Dictionary")
  55. textareaAttributes.Add "rows", 10
  56. textareaAttributes.Add "cols", 80
  57. Set editor.textareaAttributes = textareaAttributes
  58. ' The initial value to be displayed in the editor.
  59. initialValue = "<p>This is some <strong>sample text</strong>. You are using <a href=""http://ckeditor.com/"">CKEditor</a>.</p>"
  60. ' Create first instance.
  61. code = editor.editor("editor1", initialValue)
  62. response.write code
  63. %>
  64. <p>
  65. <label>Editor 2:</label><br/>
  66. </p>
  67. <%
  68. ' Configuration that will be used only by the second editor.
  69. editor.instanceConfig("toolbar") = Array( _
  70. Array( "Source", "-", "Bold", "Italic", "Underline", "Strike" ), _
  71. Array( "Image", "Link", "Unlink", "Anchor" ) _
  72. )
  73. editor.instanceConfig("skin") = "v2"
  74. ' Create second instance.
  75. response.write editor.editor("editor2", initialValue)
  76. %>
  77. <p>
  78. <input type="submit" value="Submit"/>
  79. </p>
  80. </form>
  81. </fieldset>
  82. <div id="footer">
  83. <hr />
  84. <p>
  85. CKEditor - The text editor for Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
  86. </p>
  87. <p id="copy">
  88. Copyright &copy; 2003-2011, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico
  89. Knabben. All rights reserved.
  90. </p>
  91. </div>
  92. </body>
  93. </html>