Section | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...
Include Page | ||||
---|---|---|---|---|
|
...
Step 1: Prepare your markup
Let's assume that you're working with some HTML that displays the information about a CD in your collection - something simple like this:
Code Block | ||||
---|---|---|---|---|
| ||||
<h1>Album Details</h1> <h2>Artist</h2> Portishead <h2>Album</h2> Third <h2>Year</h2> 2008 <h2>Label</h2> Universal Music <h2>Review</h2> <p>After a hiatus, <strong>Portishead</strong> is back with their first studio album in 6 years. <em>Third</em> brings back the familiar and the new, and none of this is best exemplified than in the track <em>Machine Gun</em>.</p> <p>It seems that regardless of how <strong>Portishead</strong> sounds now, the one thing that has stayed constant is their refusal to be ordinary.</p> |
The Changes
Section | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
|
...
Step 2: Write the script
There are some scripts you will need to add to your HTML file before the Rich Text Inline Edit will function properly.
Define Button Behaviour
The <button>
elements by themselves will not do anything special unless we specify some behaviour. This can be done by adding the following script:
...
This will make the Save
and Cancel
buttons perform what we'd expect.
Initialize the Rich Text Inline Editor
Now you need to initialize the Rich Text Inline Editor.
...
Note: The FCKEditor integration is deprecated for v1.2. Please use the CKEditor integration instead.
Putting it All Together
Combining all of the above scripts together, it will look like this:
...
By putting these functions inside the jQuery(document).ready()
call, you ensure that all of your markup is ready before you try to initialize the Rich Text Inline Edit components. This script can also be placed in a <script>
block at the end of your document.
...
Step 3: Add the Fluid library to your HTML
You'll need to add the Fluid library to you your HTML file. In the header of the file, link to the Javascript files with <script>
tags:
FCKEditor InetgrationCKEditor Integration:
Code Block | ||||
---|---|---|---|---|
| ||||
<script type="text/javascript" src="lib/fckeditor/fckeditorhttp://ckeditor-fluid.appspot.com/ckeditor.js"></script> <script type="text/javascript" src="InfusionAll.js"></script> |
TinyMCE InetgrationIntegration:
Code Block | ||||
---|---|---|---|---|
| ||||
<script type="text/javascript" src="libhttp:/tiny_mce//tinymce-fluid.appspot.com/tiny_mce.js"></script> <script type="text/javascript" src="InfusionAll.js"></script> |
Alternatively, the individual file requirements if using FCKEditor CKEditor are:
Code Block | ||||
---|---|---|---|---|
| ||||
<script type="text/javascript" src="lib/fckeditor/fckeditorhttp://ckeditor-fluid.appspot.com/ckeditor.js"></script> <script type="text/javascript" src="lib/jquery/core/js/jquery.js"></script> <script type="text/javascript" src="lib/jquery/ui/js/ui.core.js"></script> <script type="text/javascript" src="lib/jquery/plugins/tooltip/js/jquery.tooltip.js"></script> <script type="text/javascript" src="framework/core/js/jquery.keyboard-a11y.js"></script> <script type="text/javascript" src="framework/core/js/Fluid.js"></script> <script type="text/javascript" src="components/inlineEdit/js/InlineEdit.js"></script> <script type="text/javascript" src="components/inlineEdit/js/InlineEditIntegrations.js"></script> |
...
Code Block | ||||
---|---|---|---|---|
| ||||
<script type="text/javascript" src="libhttp:/tiny_mce//tinymce-fluid.appspot.com/tiny_mce.js"></script> <script type="text/javascript" src="lib/jquery/core/js/jquery.js"></script> <script type="text/javascript" src="lib/jquery/ui/js/ui.core.js"></script> <script type="text/javascript" src="lib/jquery/plugins/tooltip/js/jquery.tooltip.js"></script> <script type="text/javascript" src="framework/core/js/jquery.keyboard-a11y.js"></script> <script type="text/javascript" src="framework/core/js/Fluid.js"></script> <script type="text/javascript" src="components/inlineEdit/js/jquery.tinymce.js"></script> <script type="text/javascript" src="components/inlineEdit/js/InlineEdit.js"></script> <script type="text/javascript" src="components/inlineEdit/js/InlineEditIntegrations.js"></script> |
...