sample04.afp 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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 4</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( 'cmbSkins' ) ;
  34. // Get the active skin.
  35. var sSkin = editorInstance.Config['SkinPath'] ;
  36. sSkin = sSkin.match( /[^\/]+(?=\/$)/g ) ;
  37. oCombo.value = sSkin ;
  38. oCombo.style.visibility = '' ;
  39. }
  40. function ChangeSkin( skinName )
  41. {
  42. window.location.href = window.location.pathname + "?Skin=" + skinName ;
  43. }
  44. </script>
  45. </head>
  46. <body>
  47. <h1>FCKeditor - AFP - Sample 4</h1>
  48. This sample shows how to change the editor skin.
  49. <hr>
  50. <table cellpadding="0" cellspacing="0" border="0">
  51. <tr>
  52. <td>
  53. Select the skin to load:&nbsp;
  54. </td>
  55. <td>
  56. <select id="cmbSkins" onchange="ChangeSkin(this.value);" style="VISIBILITY: hidden">
  57. <option value="default" selected>Default</option>
  58. <option value="office2003">Office 2003</option>
  59. <option value="silver">Silver</option>
  60. </select>
  61. </td>
  62. </tr>
  63. </table>
  64. <br>
  65. <form action="sampleposteddata.afp" method="post" target="_blank">
  66. <%
  67. sBasePath="../../../fckeditor/" && <-- Change this to your local path
  68. oFCKeditor = CREATEOBJECT("FCKeditor")
  69. oFCKeditor.fckeditor("FCKeditor1")
  70. lcSkin=request.querystring("Skin") && Request Parameter
  71. lcSkin=oFCKeditor.StripAttacks(lcSkin) && Remove special escape characters
  72. IF !EMPTY(lcSkin)
  73. oFCKeditor.aconfig[1,1]="SkinPath"
  74. oFCKeditor.aconfig[1,2]="/fckeditor/editor/skins/"+lcSkin+"/" && <-- Change this to your local path
  75. ENDIF
  76. lcText=[<p>This is some <strong>sample text</strong>. You are using ]
  77. lcText=lcText+[<a href='http://www.fckeditor.net/'>FCKeditor</a>.]
  78. oFCKeditor.BasePath = sBasePath
  79. oFCKeditor.cValue = lcText
  80. ? oFCKeditor.Create()
  81. %>
  82. <br>
  83. <input type="submit" value="Submit">
  84. </form>
  85. </body>
  86. </html>