Changeset 697
- Timestamp:
- 08/21/07 17:49:31 (6 years ago)
- Location:
- FCKeditor/trunk
- Files:
-
- 7 added
- 3 edited
-
_samples/cfm/sample01.cfm (modified) (3 diffs)
-
_samples/cfm/sample01_mx.cfm (added)
-
_samples/cfm/sample02.cfm (added)
-
_samples/cfm/sample02_mx.cfm (modified) (2 diffs)
-
_samples/cfm/sample03.cfm (added)
-
_samples/cfm/sample03_mx.cfm (added)
-
_samples/cfm/sample04.cfm (added)
-
_samples/cfm/sample04_mx.cfm (added)
-
_samples/cfm/sampleposteddata.cfm (added)
-
fckeditor.cfc (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
FCKeditor/trunk/_samples/cfm/sample01.cfm
r136 r697 1 <cfsetting enablecfoutputonly="true" showdebugoutput="false">1 <cfsetting enablecfoutputonly="true"> 2 2 <!--- 3 3 * FCKeditor - The text editor for Internet - http://www.fckeditor.net … … 32 32 <link href="../sample.css" rel="stylesheet" type="text/css" /> 33 33 </head> 34 35 34 <body> 36 37 35 <h1>FCKeditor - ColdFusion - Sample 1</h1> 38 36 39 This sample displays a normal HTML form with a FCKeditor with full features enabled ; invoked by a ColdFusion Custom Tag / Module.37 This sample displays a normal HTML form with a FCKeditor with full features enabled. 40 38 <hr> 41 <form method="POST" action="#cgi.script_name#"> 39 40 <form method="POST" action="sampleposteddata.cfm"> 42 41 </cfoutput> 42 43 <!--- Calculate basepath for FCKeditor. It's in the folder right above _samples ---> 44 <cfset basePath = Left( cgi.script_name, FindNoCase( '_samples', cgi.script_name ) - 1 )> 43 45 44 46 <cfmodule 45 47 template="../../fckeditor.cfm" 46 basePath="# Left(cgi.script_name, FindNoCase('_samples', cgi.script_name)-1)#"48 basePath="#basePath#" 47 49 instanceName="myEditor" 48 50 value='This is some sample text. You are using <a href="http://fckeditor.net/" target="_blank">FCKeditor</a>.' … … 50 52 height="200" 51 53 > 54 52 55 <cfoutput> 53 56 <br /> 54 57 <input type="submit" value="Submit"> 55 < br />58 <hr /> 56 59 </form> 57 </cfoutput>58 59 <cfif isDefined( 'FORM.fieldnames' )>60 <cfoutput>61 <hr />62 <style>63 <!--64 td, th { font: 11px Verdana, Arial, Helv, Helvetica, sans-serif; }65 -->66 </style>67 <table border="1" cellspacing="0" cellpadding="2" bordercolor="darkblue" bordercolordark="darkblue" bordercolorlight="darkblue">68 <tr>69 <th colspan="2" bgcolor="darkblue"><font color="white"><strong>Dump of FORM Variables</strong></font></th>70 </tr>71 <tr>72 <td bgcolor="lightskyblue">FieldNames</td>73 <td>#FORM.fieldNames#</td>74 </tr>75 <cfloop list="#FORM.fieldnames#" index="key">76 <tr>77 <td valign="top" bgcolor="lightskyblue">#key#</td>78 <td>#HTMLEditFormat(evaluate("FORM.#key#"))#</td>79 </tr>80 </cfloop>81 </table>82 </cfoutput>83 </cfif>84 85 60 </body> 86 61 </html> 62 </cfoutput> 87 63 <cfsetting enablecfoutputonly="false"> -
FCKeditor/trunk/_samples/cfm/sample02_mx.cfm
r132 r697 23 23 ---> 24 24 25 <!--- ::26 * You must set the url path to the base directory for your media files (images, flash, files)27 * The best position for this variable is in your Application.cfm file28 *29 * Possible variable scopes are:30 * <cfset APPLICATION.userFilesPath = "/userfiles/">31 * OR:32 * <cfset SERVER.userFilesPath = "/userfiles/">33 * OR:34 * <cfset request.FCKeditor.userFilesPath = "/userfiles/">35 * OR:36 * <cfset application.FCKeditor.userFilesPath = "/userfiles/">37 * OR:38 * <cfset server.FCKeditor.userFilesPath = "/userfiles/">39 *40 * Note #1: Do _not_ set the physical directory on your server, only a path relative to your current webroot41 * Note #2: Directories will be automatically created42 :: --->43 44 25 <cfoutput> 45 26 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> … … 50 31 <meta name="robots" content="noindex, nofollow"> 51 32 <link href="../sample.css" rel="stylesheet" type="text/css" /> 33 <script type="text/javascript"> 34 35 function FCKeditor_OnComplete( editorInstance ) 36 { 37 var oCombo = document.getElementById( 'cmbLanguages' ) ; 38 for ( code in editorInstance.Language.AvailableLanguages ) 39 { 40 AddComboOption( oCombo, editorInstance.Language.AvailableLanguages[code] + ' (' + code + ')', code ) ; 41 } 42 oCombo.value = editorInstance.Language.ActiveLanguage.Code ; 43 } 44 45 function AddComboOption(combo, optionText, optionValue) 46 { 47 var oOption = document.createElement("OPTION") ; 48 49 combo.options.add(oOption) ; 50 51 oOption.innerHTML = optionText ; 52 oOption.value = optionValue ; 53 54 return oOption ; 55 } 56 57 function ChangeLanguage( languageCode ) 58 { 59 window.location.href = window.location.pathname + "?Lang=" + languageCode ; 60 } 61 </script> 52 62 </head> 53 63 <body> 54 64 <h1>FCKeditor - ColdFusion Component (CFC) - Sample 2</h1> 55 56 This sample displays a normal HTML form with a FCKeditor with full features enabled; invoked by a ColdFusion Component. 65 This sample shows the editor in all its available languages. 57 66 <hr> 58 59 <form method="POST" action="#cgi.script_name#">60 67 </cfoutput> 61 62 68 <cfif listFirst( server.coldFusion.productVersion ) LT 6> 63 69 <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> 64 70 <cfabort> 65 71 </cfif> 72 <cfoutput> 73 <table cellpadding="0" cellspacing="0" border="0"> 74 <tr> 75 <td> 76 Select a language: 77 </td> 78 <td> 79 <select id="cmbLanguages" onchange="ChangeLanguage(this.value);"> 80 </select> 81 </td> 82 </tr> 83 </table> 84 <br> 85 <form action="sampleposteddata.cfm" method="post" target="_blank"> 86 </cfoutput> 87 <cfscript> 88 // Calculate basepath for FCKeditor. It's in the folder right above _samples 89 basePath = Left( cgi.script_name, FindNoCase( '_samples', cgi.script_name ) - 1 ) ; 66 90 67 <cfscript> 68 // Calculate basepath for FCKeditor. It's in the folder right above _samples 69 basePath = Left(cgi.script_name, FindNoCase('_samples', cgi.script_name)-1); 70 71 fckEditor = createObject("component", "#basePath#fckeditor"); 72 fckEditor.instanceName = "myEditor"; 73 fckEditor.value = 'This is some sample text. You are using <a href="http://fckeditor.net/" target="_blank">FCKeditor</a>.'; 74 fckEditor.basePath = basePath; 75 fckEditor.width = "100%"; 76 fckEditor.height = 300; 77 fckEditor.create(); // create the editor. 78 </cfscript> 79 91 fckEditor = createObject( "component", "#basePath#fckeditor" ) ; 92 fckEditor.instanceName = "myEditor" ; 93 fckEditor.value = 'This is some sample text. You are using <a href="http://fckeditor.net/" target="_blank">FCKeditor</a>.' ; 94 fckEditor.basePath = basePath ; 95 if ( isDefined( "URL.Lang" ) ) 96 { 97 fckEditor.config["AutoDetectLanguage"] = false ; 98 fckEditor.config["DefaultLanguage"] = HTMLEditFormat( URL.Lang ) ; 99 } 100 else 101 { 102 fckEeditor.config["AutoDetectLanguage"] = true ; 103 fckEeditor.config["DefaultLanguage"] = 'en' ; 104 } 105 fckEditor.create() ; // create the editor. 106 </cfscript> 80 107 <cfoutput> 81 <br /> 82 <input type="submit" value="Submit"> 83 <hr /> 108 <br> 109 <input type="submit" value="Submit"> 110 </form> 111 </body> 112 </html> 84 113 </cfoutput> 85 86 <cfdump87 var="#FORM#"88 label="Dump of FORM Variables"89 >90 91 <cfoutput></form></body></html></cfoutput>92 93 114 <cfsetting enablecfoutputonly="false"> -
FCKeditor/trunk/fckeditor.cfc
r387 r697 1 1 <cfcomponent output="false" displayname="FCKeditor" hint="Create an instance of the FCKeditor."> 2 2 3 <!--- 3 4 * FCKeditor - The text editor for Internet - http://www.fckeditor.net … … 43 44 * limitation with the cfc invocation. 44 45 ---> 45 <cffunction 46 name="create" 46 47 <cffunction 48 name="Create" 47 49 access="public" 48 50 output="true" 49 51 returntype="void" 50 hint="Initialize the FCKeditor instance." 52 hint="Outputs the editor HTML in the place where the function is called" 53 > 54 <cfoutput> 55 #CreateHtml()# 56 </cfoutput> 57 </cffunction> 58 59 <cffunction 60 name="CreateHtml" 61 access="public" 62 output="false" 63 returntype="string" 64 hint="Retrieves the editor HTML" 51 65 > 52 66 … … 63 77 // display the html editor or a plain textarea? 64 78 if( isCompatible() ) 65 showHTMLEditor();79 return getHtmlEditor(); 66 80 else 67 showTextArea();81 return getTextArea(); 68 82 </cfscript> 69 83 … … 117 131 118 132 <cffunction 119 name=" showTextArea"120 access="private" 121 output=" true"122 returnType=" void"133 name="getTextArea" 134 access="private" 135 output="false" 136 returnType="string" 123 137 hint="Create a textarea field for non-compatible browsers." 124 138 > 139 <cfset var result = "" /> 125 140 126 141 <cfscript> … … 132 147 </cfscript> 133 148 134 <cf output>135 <div>136 <textarea name="#this.instanceName#" rows="4" cols="40" style="WIDTH: #this.width#; HEIGHT: #this.height#">#HTMLEditFormat(this.value)#</textarea>137 </div>138 </cf output>139 140 </cffunction> 141 142 <cffunction 143 name=" showHTMLEditor"144 access="private" 145 output=" true"146 returnType=" void"149 <cfscript> 150 result = result & "<div>" & chr(13) & chr(10); 151 result = result & "<textarea name=""#this.instanceName#"" rows=""4"" cols=""40"" style=""WIDTH: #this.width#; HEIGHT: #this.height#"">#HTMLEditFormat(this.value)#</textarea>" & chr(13) & chr(10); 152 result = result & "</div>" & chr(13) & chr(10); 153 </cfscript> 154 <cfreturn result /> 155 </cffunction> 156 157 <cffunction 158 name="getHtmlEditor" 159 access="private" 160 output="false" 161 returnType="string" 147 162 hint="Create the html editor instance for compatible browsers." 148 163 > 149 164 <cfset var sURL = "" /> 150 165 <cfset var result = "" /> 166 151 167 <cfscript> 152 168 // try to fix the basePath, if ending slash is missing … … 162 178 </cfscript> 163 179 164 <cf output>165 <div>166 <input type="hidden" id="#this.instanceName#" name="#this.instanceName#" value="#HTMLEditFormat(this.value)#" style="display:none" />167 <input type="hidden" id="#this.instanceName#___Config" value="#GetConfigFieldString()#" style="display:none" />168 <iframe id="#this.instanceName#___Frame" src="#sURL#" width="#this.width#" height="#this.height#" frameborder="0" scrolling="no"></iframe>169 </div>170 </cf output>171 180 <cfscript> 181 result = result & "<div>" & chr(13) & chr(10); 182 result = result & "<input type=""hidden"" id=""#this.instanceName#"" name=""#this.instanceName#"" value=""#HTMLEditFormat(this.value)#"" style=""display:none"" />" & chr(13) & chr(10); 183 result = result & "<input type=""hidden"" id=""#this.instanceName#___Config"" value=""#GetConfigFieldString()#"" style=""display:none"" />" & chr(13) & chr(10); 184 result = result & "<iframe id=""#this.instanceName#___Frame"" src=""#sURL#"" width=""#this.width#"" height=""#this.height#"" frameborder=""0"" scrolling=""no""></iframe>" & chr(13) & chr(10); 185 result = result & "</div>" & chr(13) & chr(10); 186 </cfscript> 187 <cfreturn result /> 172 188 </cffunction> 173 189 … … 205 221 lConfigKeys = lConfigKeys & ",FontFormats,StylesXmlPath,TemplatesXmlPath,SpellChecker,IeSpellDownloadUrl"; 206 222 lConfigKeys = lConfigKeys & ",SpellerPagesServerScript,FirefoxSpellChecker,MaxUndoLevels,DisableObjectResizing,DisableFFTableHandles"; 207 lConfigKeys = lConfigKeys & ",LinkDlgHideTarget ,LinkDlgHideAdvanced,ImageDlgHideLink,ImageDlgHideAdvanced,FlashDlgHideAdvanced";223 lConfigKeys = lConfigKeys & ",LinkDlgHideTarget,LinkDlgHideAdvanced,ImageDlgHideLink,ImageDlgHideAdvanced,FlashDlgHideAdvanced"; 208 224 lConfigKeys = lConfigKeys & ",ProtectedTags,BodyId,BodyClass,DefaultLinkTarget,CleanWordKeepsStructure"; 209 225 lConfigKeys = lConfigKeys & ",LinkBrowser,LinkBrowserURL,LinkBrowserWindowWidth,LinkBrowserWindowHeight,ImageBrowser"; 210 226 lConfigKeys = lConfigKeys & ",ImageBrowserURL,ImageBrowserWindowWidth,ImageBrowserWindowHeight,FlashBrowser,FlashBrowserURL"; 211 lConfigKeys = lConfigKeys & ",FlashBrowserWindowWidth ,FlashBrowserWindowHeight,LinkUpload,LinkUploadURL,LinkUploadWindowWidth";227 lConfigKeys = lConfigKeys & ",FlashBrowserWindowWidth,FlashBrowserWindowHeight,LinkUpload,LinkUploadURL,LinkUploadWindowWidth"; 212 228 lConfigKeys = lConfigKeys & ",LinkUploadWindowHeight,LinkUploadAllowedExtensions,LinkUploadDeniedExtensions,ImageUpload,ImageUploadURL"; 213 229 lConfigKeys = lConfigKeys & ",ImageUploadAllowedExtensions,ImageUploadDeniedExtensions,FlashUpload,FlashUploadURL,FlashUploadAllowedExtensions";
Note: See TracChangeset
for help on using the changeset viewer.
