sample04_mx.cfm 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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( 'cmbSkins' ) ;
  36. // Get the active skin.
  37. var sSkin = editorInstance.Config['SkinPath'] ;
  38. sSkin = sSkin.match( /[^\/]+(?=\/$)/g ) ;
  39. oCombo.value = sSkin ;
  40. oCombo.style.visibility = '' ;
  41. }
  42. function ChangeSkin( skinName )
  43. {
  44. window.location.href = window.location.pathname + "?Skin=" + skinName ;
  45. }
  46. </script>
  47. </head>
  48. <body>
  49. <h1>FCKeditor - ColdFusion Component (CFC) - Sample 4</h1>
  50. This sample shows how to change the editor skin.
  51. <hr>
  52. </cfoutput>
  53. <cfif listFirst( server.coldFusion.productVersion ) LT 6>
  54. <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>
  55. <cfabort>
  56. </cfif>
  57. <cfoutput>
  58. <table cellpadding="0" cellspacing="0" border="0">
  59. <tr>
  60. <td>
  61. Select the skin to load:&nbsp;
  62. </td>
  63. <td>
  64. <select id="cmbSkins" onchange="ChangeSkin(this.value);" style="VISIBILITY: hidden">
  65. <option value="default" selected>Default</option>
  66. <option value="office2003">Office 2003</option>
  67. <option value="silver">Silver</option>
  68. </select>
  69. </td>
  70. </tr>
  71. </table>
  72. <br>
  73. <form action="sampleposteddata.cfm" method="post" target="_blank">
  74. </cfoutput>
  75. <cfscript>
  76. // Calculate basepath for FCKeditor. It's in the folder right above _samples
  77. basePath = Left( cgi.script_name, FindNoCase( '_samples', cgi.script_name ) - 1 ) ;
  78. fckEditor = createObject( "component", "#basePath#fckeditor" ) ;
  79. fckEditor.instanceName = "myEditor" ;
  80. fckEditor.value = '<p>This is some <strong>sample text</strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor</a>.</p>' ;
  81. fckEditor.basePath = basePath ;
  82. if ( isDefined( "URL.Skin" ) )
  83. {
  84. fckEditor.config['SkinPath'] = basePath & 'editor/skins/' & HTMLEditFormat( URL.Skin ) & '/' ;
  85. }
  86. fckEditor.create() ; // create the editor.
  87. </cfscript>
  88. <cfoutput>
  89. <br>
  90. <input type="submit" value="Submit">
  91. </form>
  92. </body>
  93. </html>
  94. </cfoutput>
  95. <cfsetting enablecfoutputonly="false">