Child pages
  • Rich Text Inline Edit API

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3
Info

This documentation refers to the latest trunk version of the Inline Edit code.

Section
Column
width50%

Rich Text Inline Edit Overview

The Rich Text Inline Edit is a specific integration of the Inline Edit component that uses a rich text editor to allow users to quickly make edits to formatted text. Two versions of Rich Text Inline Edit are provided, each using a different rich text editor:

  1. FCKEditorCKEditor
  2. TinyMCE

Creation

Note: The CKEditor integration is new in v1.2. It replaces the deprecated FCKEditor integration, which is officially removed as of v1.4.

Code Block
javascript
javascript
fluid.inlineEdit.FCKEditorCKEditor(container, options);
Code Block
javascript
javascript
fluid.inlineEdit.TinyMCE(container, options);

Return: The Inline Edit component object.

Column
Panel
borderColor#321137
bgColor#fff
titleBGColor#aab597
borderStylesolid
titleStatus

This component is in Sneak Peek status

solid
Panel
borderStyle
borderColor#566b30
bgColor#fff
titleBGColor#D3E3C4
borderStylesolid
titleOn This Page
Table of Contents
toc
maxLevel
5
minLevel2
maxLevel5
Panel
borderColor#321137
bgColor#fff
titleBGColor#c1b7c3
borderStylesolid
titleSee Also
borderStylesolid
Panel
borderColor#321137
bgColor#fff
titleBGColor#cccccc
borderStylesolid
titleStill need help?
borderStylesolid

Join the fluidinfusion-talk users mailing list and ask your questions there.

...

NOTE: If you override any of these defaults, the Rich Text Inline Edit may not function properly.

...

CKEditor integration:

Note: The CKEditor integration is new in v1.2. It replaces the deprecated FCKEditor integration.

Code Block
javascript
javascript
fluid.defaults("fluid.inlineEdit.FCKEditorCKEditor", {
    selectors: {
        edit: "textarea" 
    },
    
    styles: {
        invitation: null
    },
  
    displayAccessor: {
        type: "fluid.inlineEdit.richTextViewAccessor"
    },
    editAccessor: {
        type: "fluid.inlineEdit.FCKEditorCKEditor.viewAccessor"
    },
    lazyEditView: true,
    blurHandlerBinder: fluid.inlineEdit.CKEditor.blurHandlerBinder,
    editModeRenderer: fluid.inlineEdit.FCKEditorCKEditor.editModeRenderer
});

selectors

The FCKEditor CKEditor uses a <textarea> element, and so the default selector for this field is set to "textarea."

styles

 

displayAccessor

The standard display accessor uses the jQuery functions val or text depending on the tag type. The richTextAccessor returns the HTML contents of the element instead.

editAccessor

The standard edit accessor uses the jQuery functions val or text depending on the tag type. The FCKEditorCKEditor.viewAccessor function uses the FCKEditor CKEditor API to access the edit field.

lazyEditView

Loading a rich text editor is expensive, and so lazy loading is enabled.

editModeRenderer

The FCKEditorCKEditor-specific edit mode renderer uses the FCKEditor CKEditor itself.

TinyMCE integration:

Code Block
javascript
javascript
fluid.defaults("fluid.inlineEdit.tinyMCE", {
    useTooltip: true,
    selectors: {
        edit: "textarea" 
    },
    
    styles: {
        invitation: null
    },
    displayAccessor: {
        type: "fluid.inlineEdit.richTextViewAccessor"
    },
    editAccessor: {
        type: "fluid.inlineEdit.tinyMCE.viewAccessor"
    },
    lazyEditView: true,
    blurHandlerBinder: fluid.inlineEdit.tinyMCE.blurHandlerBinder,
    editModeRenderer: fluid.inlineEdit.tinyMCE.editModeRenderer
});

...

The Rich Text Inline Edit dependencies can be met by including the minified Fluid-allInfusionAll.js file in the header of the HTML file, along with your choice of rich text editor:

CKEditor Inetgration:

Code Block
html
html
<script type="text/javascript" src="Fluid-all.http://ckeditor-fluid.appspot.com/ckeditor.js"></script>
<script type="text/javascript" src="InfusionAll.js"></script>

TinyMCE Inetgration:

Code Block
html
html

<script type="text/javascript" src="http://tinymce-fluid.appspot.com/tiny_mce.js"></script>
<script type="text/javascript" src="InfusionAll.js"></script>

Alternatively, the individual file requirements if using CKEditor are:

FCKEditor integration:

Code Block
html
html
<script type="text/javascript" src="libhttp:/fckeditor/fckeditor.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/jquery.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/jqueryFluidDocument.keyboard-a11y.js"></script> <!-- New in v1.3 -->
<script type="text/javascript" src="framework/core/js/Fluidjquery.keyboard-a11y.js"></script>
<script type="text/javascript" src="componentsframework/inlineEditcore/js/jqueryFluid.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>

...

Otherwise, the individual file requirements if using TinyMCE are:

Code Block
html
html
<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/jquery.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/FluidDocument.js"></script> <!-- New in v1.3 -->
<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>