sample03.afp 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <%
  2. * FCKeditor - The text editor for Internet - http://www.fckeditor.net
  3. * Copyright (C) 2003-2009 Frederico Caldeira Knabben
  4. *
  5. * == BEGIN LICENSE ==
  6. *
  7. * Licensed under the terms of any of the following licenses at your
  8. * choice:
  9. *
  10. * - GNU General Public License Version 2 or later (the "GPL")
  11. * http://www.gnu.org/licenses/gpl.html
  12. *
  13. * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
  14. * http://www.gnu.org/licenses/lgpl.html
  15. *
  16. * - Mozilla Public License Version 1.1 or later (the "MPL")
  17. * http://www.mozilla.org/MPL/MPL-1.1.html
  18. *
  19. * == END LICENSE ==
  20. *
  21. * This page is a basic Sample for FCKeditor integration in the AFP script language (www.afpages.de)
  22. *
  23. %>
  24. <html>
  25. <head>
  26. <title>FCKeditor - AFP Sample 3</title>
  27. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  28. <meta name="robots" content="noindex, nofollow">
  29. <link href="../sample.css" rel="stylesheet" type="text/css" />
  30. <script type="text/javascript">
  31. function FCKeditor_OnComplete( editorInstance )
  32. {
  33. var oCombo = document.getElementById( 'cmbToolbars' ) ;
  34. oCombo.value = editorInstance.ToolbarSet.Name ;
  35. oCombo.style.visibility = '' ;
  36. }
  37. function ChangeToolbar( toolbarName )
  38. {
  39. window.location.href = window.location.pathname + "?Toolbar=" + toolbarName ;
  40. }
  41. </script>
  42. </head>
  43. <body>
  44. <h1>FCKeditor - AFP - Sample 3</h1>
  45. This sample shows how to change the editor toolbar.
  46. <hr>
  47. <table cellpadding="0" cellspacing="0" border="0">
  48. <tr>
  49. <td>
  50. Select the toolbar to load:&nbsp;
  51. </td>
  52. <td>
  53. <select id="cmbToolbars" onchange="ChangeToolbar(this.value);" style="VISIBILITY: hidden">
  54. <option value="Default" selected>Default</option>
  55. <option value="Basic">Basic</option>
  56. </select>
  57. </td>
  58. </tr>
  59. </table>
  60. <br>
  61. <form action="sampleposteddata.afp" method="post" target="_blank">
  62. <%
  63. sBasePath="../../../fckeditor/" && Change this to your local path
  64. oFCKeditor = CREATEOBJECT("FCKeditor")
  65. oFCKeditor.fckeditor("FCKeditor1")
  66. lcToolbar=request.querystring("Toolbar") && Request Parameter
  67. lcToolbar=oFCKeditor.StripAttacks(lcToolbar) && Remove special escape characters
  68. IF !EMPTY(lcToolbar)
  69. oFCKeditor.ToolbarSet=lcToolbar
  70. ENDIF
  71. lcText=[<p>This is some <strong>sample text</strong>. You are using ]
  72. lcText=lcText+[<a href='http://www.fckeditor.net/'>FCKeditor</a>.]
  73. oFCKeditor.BasePath = sBasePath
  74. oFCKeditor.cValue = lcText
  75. ? oFCKeditor.Create()
  76. %>
  77. <br>
  78. <input type="submit" value="Submit">
  79. </form>
  80. </body>
  81. </html>