|
Now point your browser to __fckconfig.js__ (http://localhost/bitweaver/fckeditor/jscripts/fckconfig.js) and hit reload to makes sure that your changes are present in your browser.
|
|
-!Custom configuration files
|
-By setting up your FCKeditor with a custom fckconfig.js, updates become less problematic, and playing around with different settings becomes easier:
|
|
-{code}
|
-1. copy /fckeditor/templates/header_inc.tpl to your theme folder:
|
-2. /themes/styles/mytheme/fckeditor/header_inc.tpl
|
-3. find a line like:
|
-4. var oFCKeditor = something ;
|
-5. write this underneath:
|
-6. oFCKeditor.Config["CustomConfigurationsPath"] = {$smarty.const.THEMES_PKG_URL}styles/mytheme/fckeditor/fckconfig.js";
|
-7. you might also want this next extra line for ultra-fine-control over the toolbar:
|
-8. oFCKeditor.ToolbarSet = "finetunedtoolbar";
|
-{/code}
|
+! Custom configuration files |
+Set up your FCKeditor with a __custom fckconfig.js__ to make updates and trying different settings easier: |
+# Admin > FCKeditor > Settings: |
+# enable ''Custom config file'' |
+# copy /fckeditor/fckconfig.bitweaver.js to your custom style: |
+# /themes/styles/your-style/fckeditor/fckconfig.bitweaver.js |
+# edit settings and toolbars, see: |
+# [http://wiki.fckeditor.net/Developer%27s_Guide/Configuration/Configurations_Settings|FCKeditor documentation] |
+# trick: externalize the XML file that holds FCKeditor's styles: |
+## copy ''fckstyles.xml'' from /fckeditor/jscripts/fckstyles.xml to your custom style |
+## in /themes/styles/your-style/fckeditor/fckconfig.bitweaver.js, add: |
+## FCKConfig.StylesXmlPath = '/themes/styles/your-style/fckeditor/fckstyles.xml'; |
+## by editing that file you can control which styles are shown in FCKeditor's style dropdown |
|
-Now, of course, create the file __fckconfig.js__ in the path mentioned above. Copy desired variables from [http://wiki.fckeditor.net/Developer%27s_Guide/Configuration/Configurations_Settings|their documentation pages]. Now if the FCKeditor package is updated, your settings are not lost. FCKeditor's own __fckconfig.js__ stays where it is, the settings of both files are considered automatically. To take it even one step further, externalize the XML file that holds FCK's styles. Copy the file __fckstyles.xml__ from /fckeditor/jscripts/fckstyles.xml to your custom theme. Now you can control what FCK's style drop down looks like to the user. For example, your __fckconfig.js__ file might look like this:
|
|
-{code}
|
-FCKConfig.Plugins.Add( 'attachment' ) ;
|
-FCKConfig.BodyClass = 'fck';
|
-FCKConfig.EditorAreaCSS = '/themes/styles/mystyle/mystyle.css';
|
-FCKConfig.ForceStrongEm = true;
|
-FCKConfig.StylesXmlPath = '/themes/styles/mystyle/fckeditor/fckstyles.xml';
|
-FCKConfig.ToolbarSets["finetunedtoolbar"] = [
|
- ['Source','Style','PasteText','RemoveFormat','Undo','Redo','Bold','Italic','OrderedList','UnorderedList','Outdent','Indent'],
|
- ['Link','Unlink','Table','SpecialChar','FitWindow','Attachment']
|
-];
|
|
-// for UTF-8 + Text Diff uncomment these 4 lines:
|
-// FCKConfig.ProcessHTMLEntities = false;
|
-// FCKConfig.IncludeLatinEntities = false;
|
-// FCKConfig.IncludeGreekEntities = false;
|
-// FCKConfig.ProcessNumericEntities = false;
|
-{/code}
|
+! How to prevent the FCKifying of certain textareas |
+There are quite a few textareas that should not be FCKified even if the editor is supposed to be available in general. Examples would be the textarea to add trackback URLs to a blog posting and many of the kernel's textareas. To prevent the editor to hook on to your textareas, don't use bitweaver's "textarea" Smarty-plugin, but normal plain HTML: |
|
-!How to use a real ))Text_Diff(( (and UTF-8)
|
-If you're using the HTML format and also sometimes the ))WYSIWYG(( editor and still want to compare different versions of a Wiki page efficiently, you want ))Text_Diff((, the PEAR package that should be installed on your system. There are only 2 problems. First, to make ))Text_Diff(( work in a UTF-8 (e.g., non English) environment, you need to stop FCKeditor from processing special characters, otherwise ))Text_Diff(( will always find that Motörhead is something else than Motörhead. For that, the last 4 variables in that code sample above need to be uncommented. Next, in /wiki/templates/))page_history((.tpl around line 40:
|
-
|
-{code title="/wiki/templates/page_history.tpl"}
|
+{code title="somepackage/templates/some.tpl"} |
{*
|
-// original:
|
-// {$diffdata}
|
-// change to:
|
+// instead of: |
+// {textarea id="someid" rows=6 help="somehelpnote"}{/textarea} |
+// write: |
*}
|
- {$diffdata|html_entity_decode}
|
+ <textarea id="someid" rows=6 help="somehelpnote"></textarea> |
{/code}
|
-
|
-Both can be desirable, but the latter version renders HTML, so that ))Text_Diff(('ing might not result in an exact view of all characters that have actually changed, but in a nicy-fied view of what ''content'' has actually changed:
|
-
|
-||before (normal plain text diff) | after (html enhanced diff)
|
-{attachment id=790 size=medium} | {attachment id=791 size=medium}||
|
-
|
-! How to prevent the FCKifying of certain textareas
|
-There are quite a few textareas that should not be FCKified even if the editor is supposed to be available in general. Examples would be the textarea to add trackback URLs to a blog posting and many of the kernel's textareas, as well as the ones you add yourself. To prevent the editor to hook onto those, use the __noformat="y"__ attribut like so:
|
-
|
-{code title="somepackage/templates/some.tpl"}
|
-{textarea id="someid" noformat="y" rows=6 help="somehelpnote"}{/textarea}
|
-{/code}
|
- |