sample03_mx.cfm 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <cfsetting enablecfoutputonly="true">
  2. <!---
  3. * FCKeditor - The text editor for Internet - http://www.fckeditor.net
  4. * Copyright (C) 2003-2009 Frederico Caldeira Knabben
  5. *
  6. * == BEGIN LICENSE ==
  7. *
  8. * Licensed under the terms of any of the following licenses at your
  9. * choice:
  10. *
  11. * - GNU General Public License Version 2 or later (the "GPL")
  12. * http://www.gnu.org/licenses/gpl.html
  13. *
  14. * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
  15. * http://www.gnu.org/licenses/lgpl.html
  16. *
  17. * - Mozilla Public License Version 1.1 or later (the "MPL")
  18. * http://www.mozilla.org/MPL/MPL-1.1.html
  19. *
  20. * == END LICENSE ==
  21. *
  22. * Sample page for ColdFusion MX 6.0 and above.
  23. --->
  24. <cfoutput>
  25. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  26. <html>
  27. <head>
  28. <title>FCKeditor - Sample</title>
  29. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  30. <meta name="robots" content="noindex, nofollow">
  31. <link href="../sample.css" rel="stylesheet" type="text/css" />
  32. <script type="text/javascript">
  33. function FCKeditor_OnComplete( editorInstance )
  34. {
  35. var oCombo = document.getElementById( 'cmbToolbars' ) ;
  36. oCombo.value = editorInstance.ToolbarSet.Name ;
  37. oCombo.style.visibility = '' ;
  38. }
  39. function ChangeToolbar( toolbarName )
  40. {
  41. window.location.href = window.location.pathname + "?Toolbar=" + toolbarName ;
  42. }
  43. </script>
  44. </head>
  45. <body>
  46. <h1>FCKeditor - ColdFusion Component (CFC) - Sample 3</h1>
  47. This sample shows how to change the editor toolbar.
  48. <hr>
  49. </cfoutput>
  50. <cfif listFirst( server.coldFusion.productVersion ) LT 6>
  51. <cfoutput><br><em style="color: red;">This sample works only with a ColdFusion MX server and higher, because it uses some advantages of this version.</em></cfoutput>
  52. <cfabort>
  53. </cfif>
  54. <cfoutput>
  55. <table cellpadding="0" cellspacing="0" border="0">
  56. <tr>
  57. <td>
  58. Select the toolbar to load:&nbsp;
  59. </td>
  60. <td>
  61. <select id="cmbToolbars" onchange="ChangeToolbar(this.value);" style="VISIBILITY: hidden">
  62. <option value="Default" selected>Default</option>
  63. <option value="Basic">Basic</option>
  64. </select>
  65. </td>
  66. </tr>
  67. </table>
  68. <br>
  69. <form action="sampleposteddata.cfm" method="post" target="_blank">
  70. </cfoutput>
  71. <cfscript>
  72. // Calculate basepath for FCKeditor. It's in the folder right above _samples
  73. basePath = Left( cgi.script_name, FindNoCase( '_samples', cgi.script_name ) - 1 ) ;
  74. fckEditor = createObject( "component", "#basePath#fckeditor" ) ;
  75. fckEditor.instanceName = "myEditor" ;
  76. fckEditor.value = '<p>This is some <strong>sample text</strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor</a>.</p>' ;
  77. fckEditor.basePath = basePath ;
  78. if ( isDefined( "URL.Toolbar" ) )
  79. {
  80. fckEditor.ToolbarSet = HTMLEditFormat( URL.Toolbar ) ;
  81. }
  82. fckEditor.create() ; // create the editor.
  83. </cfscript>
  84. <cfoutput>
  85. <br>
  86. <input type="submit" value="Submit">
  87. </form>
  88. </body>
  89. </html>
  90. </cfoutput>
  91. <cfsetting enablecfoutputonly="false">