Index: src/webapp/components/inlineEdit/js/InlineEditIntegrations.js
===================================================================
--- src/webapp/components/inlineEdit/js/InlineEditIntegrations.js	(revision 9801)
+++ src/webapp/components/inlineEdit/js/InlineEditIntegrations.js	(working copy)
@@ -10,19 +10,42 @@
 https://source.fluidproject.org/svn/LICENSE.txt
 */
 
-/*global jQuery*/
-/*global fluid_1_2*/
-/*global tinyMCE*/
-/*global FCKeditor*/
-/*global FCKeditorAPI*/
-/*global fluid*/ //this global function will refer to whichever version of Fluid Infusion was first loaded
+/*global setTimeout*/
+/*global jQuery, fluid_1_2, fluid*/
+/*global tinyMCE, FCKeditor, FCKeditorAPI, CKEDITOR*/
 
 fluid_1_2 = fluid_1_2 || {};
 
 (function ($, fluid) {
 
+    /*************************************
+     * Shared Rich Text Editor functions *
+     *************************************/
+     
+    fluid.inlineEdit.makeViewAccessor = function (editorGetFn, setValueFn, getValueFn) {
+        return function (editField) {
+            return {
+                value: function (newValue) {
+                    var editor = editorGetFn(editField);
+                    if (!editor) {
+                        if (newValue) {
+                            $(editField).val(newValue);
+                        }
+                        return "";
+                    }
+                    if (newValue) {
+                        setValueFn(editField, editor, newValue);
+                    }
+                    else {
+                        return getValueFn(editor);
+                    }
+                }
+            };
+        };
+    };
+    
     var configureInlineEdit = function (configurationName, container, options) {
-    	var defaults = fluid.defaults(configurationName); 
+        var defaults = fluid.defaults(configurationName); 
         var assembleOptions = fluid.merge(defaults? defaults.mergePolicy: null, {}, defaults, options);
         return fluid.inlineEdit(container, assembleOptions);
     };
@@ -41,7 +64,10 @@
            fluid.inlineEdit.normalizeHTML(el2);
     };
 
-    // Configuration for integrating tinyMCE
+
+    /************************
+     * Tiny MCE Integration *
+     ************************/
     
     /**
      * Instantiate a rich-text InlineEdit component that uses an instance of TinyMCE.
@@ -55,24 +81,24 @@
         return inlineEditor;
     };
         
-    fluid.inlineEdit.tinyMCE.viewAccessor = function (editField) {
-        return {
-            value: function (newValue) {
-                var editor = tinyMCE.get(editField.id);
-                if (!editor) {
-                    return "";
-                }
-                if (newValue) {
-                    // without this, there is an intermittent race condition if the editor has been created on this event.
-                    $(editField).val(newValue); 
-                    editor.setContent(newValue, {format : 'raw'});
-                }
-                else {
-                    return editor.getContent();
-                }
-            }
-        };
+    fluid.inlineEdit.tinyMCE.getEditor = function (editField) {
+        return tinyMCE.get(editField.id);
     };
+    
+    fluid.inlineEdit.tinyMCE.setValue = function (editField, editor, value) {
+        // without this, there is an intermittent race condition if the editor has been created on this event.
+        $(editField).val(value); 
+        editor.setContent(value, {format : 'raw'});
+    };
+    
+    fluid.inlineEdit.tinyMCE.getValue = function (editor) {
+        return editor.getContent();
+    };
+    
+    var flTinyMCE = fluid.inlineEdit.tinyMCE; // Shorter alias for awfully long fully-qualified names.
+    flTinyMCE.viewAccessor = fluid.inlineEdit.makeViewAccessor(flTinyMCE.getEditor, 
+                                                               flTinyMCE.setValue,
+                                                               flTinyMCE.getValue);
    
     fluid.inlineEdit.tinyMCE.blurHandlerBinder = function (that) {
         function focusEditor(editor) {
@@ -109,7 +135,6 @@
         });
     };
    
-   
     fluid.inlineEdit.tinyMCE.editModeRenderer = function (that) {
         var options = that.options.tinyMCE;
         options.elements = fluid.allocateSimpleId(that.editField);
@@ -152,9 +177,10 @@
     });
     
     
-    
-    // Configuration for integrating FCKEditor
-    
+    /*****************************
+     * FCKEditor 2.x Integration *
+     *****************************/
+         
     /**
      * Instantiate a rich-text InlineEdit component that uses an instance of FCKeditor.
      * 
@@ -165,6 +191,11 @@
         return configureInlineEdit("fluid.inlineEdit.FCKEditor", container, options);
     };
     
+    fluid.inlineEdit.FCKEditor.getEditor = function (editField) {
+        var editor = typeof(FCKeditorAPI) === "undefined"? null: FCKeditorAPI.GetInstance(editField.id);
+        return editor;
+    };
+    
     fluid.inlineEdit.FCKEditor.complete = fluid.event.getEventFirer();
     
     fluid.inlineEdit.FCKEditor.complete.addListener(function (editor) {
@@ -183,30 +214,16 @@
         that.events.afterInitEdit.addListener(
             function (editor) {
                 focusEditor(editor);
-                var editorBody = editor.EditingArea.TargetElement;
-
-                // NB - this section has no effect - on most browsers no focus events
-                // are delivered to the actual body
-                //fluid.deadMansBlur(that.editField,
-                //         $(editorBody),
-                //           function () {
-                //               that.cancel();
-                //            });
             }
         );
         that.events.afterBeginEdit.addListener(function () {
-            var editor = fluid.inlineEdit.FCKEditor.byId(that.editField[0].id);
+            var editor = fluid.inlineEdit.FCKEditor.getEditor(that.editField[0]);
             if (editor) {
                 focusEditor(editor);
             } 
         });
 
     };
-
-    fluid.inlineEdit.FCKEditor.byId = function (id) {
-        var editor = typeof(FCKeditorAPI) === "undefined"? null: FCKeditorAPI.GetInstance(id);
-        return editor;  
-    };
     
     fluid.inlineEdit.FCKEditor.editModeRenderer = function (that) {
         var id = fluid.allocateSimpleId(that.editField);
@@ -224,28 +241,22 @@
         oFCKeditor.Config.fluidInstance = that;
         oFCKeditor.ReplaceTextarea();
     };
+
     
-    fluid.inlineEdit.FCKEditor.viewAccessor = function (editField) {
-        return {
-            value: function (newValue) {
-                var editor = fluid.inlineEdit.FCKEditor.byId(editField.id); 
-                if (!editor) {
-                	if (newValue) {
-                        $(editField).val(newValue);
-                	}
-                	return "";
-                }
-                if (newValue) {
-                    editor.SetHTML(newValue);
-                }
-                else {
-                    return editor.GetHTML();
-                }
-            }
-        };
+    fluid.inlineEdit.FCKEditor.setValue = function (editField, editor, value) {
+        editor.SetHTML(value);
     };
     
+    fluid.inlineEdit.FCKEditor.getValue = function (editor) {
+        return editor.GetHTML();
+    };
     
+    var flFCKEditor = fluid.inlineEdit.FCKEditor;
+    
+    flFCKEditor.viewAccessor = fluid.inlineEdit.makeViewAccessor(flFCKEditor.getEditor,
+                                                                 flFCKEditor.setValue,
+                                                                 flFCKEditor.getValue);
+    
     fluid.defaults("fluid.inlineEdit.FCKEditor", {
         selectors: {
             edit: "textarea" 
@@ -271,8 +282,90 @@
     });
     
     
-    // Configuration for integrating a drop-down editor
+    /****************************
+     * CKEditor 3.x Integration *
+     ****************************/
     
+    fluid.inlineEdit.CKEditor = function (container, options) {
+        return configureInlineEdit("fluid.inlineEdit.CKEditor", container, options);
+    };
+    
+    fluid.inlineEdit.CKEditor.editModeRenderer = function (that) {
+        
+    };
+    
+    fluid.inlineEdit.CKEditor.getEditor = function (editField) {
+        return CKEDITOR.instances[editField.id];
+    };
+    
+    fluid.inlineEdit.CKEditor.setValue = function (editField, editor, value) {
+        editor.setData(value);
+    };
+    
+    fluid.inlineEdit.CKEditor.getValue = function (editor) {
+        return editor.getData();
+    };
+    
+    var flCKEditor = fluid.inlineEdit.CKEditor;
+    flCKEditor.viewAccessor = fluid.inlineEdit.makeViewAccessor(flCKEditor.getEditor,
+                                                                flCKEditor.setValue,
+                                                                flCKEditor.getValue);
+                             
+    fluid.inlineEdit.CKEditor.focus = function (editor) {
+        setTimeout(function () {
+            // CKEditor won't focus itself except in a timeout.
+            editor.focus();
+        }, 0);
+    };
+                                    
+    fluid.inlineEdit.CKEditor.blurHandlerBinder = function (that) {
+        that.events.afterInitEdit.addListener(fluid.inlineEdit.CKEditor.focus);
+        that.events.afterBeginEdit.addListener(function () {
+            var editor = fluid.inlineEdit.CKEditor.getEditor(that.editField[0]);
+            if (editor) {
+                fluid.inlineEdit.CKEditor.focus(editor);
+            }
+        });
+    };
+    
+    fluid.inlineEdit.CKEditor.editModeRenderer = function (that) {
+        var id = fluid.allocateSimpleId(that.editField);
+        $.data(fluid.unwrap(that.editField), "fluid.inlineEdit.CKEditor", that);
+        var editor = CKEDITOR.replace(id, that.options.CKEditor);
+        editor.on("instanceReady", function (e) {
+            fluid.inlineEdit.CKEditor.focus(e.editor);
+            that.events.afterInitEdit.fire(e.editor);
+        });
+    };                                                     
+    
+    fluid.defaults("fluid.inlineEdit.CKEditor", {
+        selectors: {
+            edit: "textarea" 
+        },
+        
+        styles: {
+            invitation: "fl-inlineEdit-richText-invitation"
+        },
+      
+        displayAccessor: {
+            type: "fluid.inlineEdit.richTextViewAccessor"
+        },
+        editAccessor: {
+            type: "fluid.inlineEdit.CKEditor.viewAccessor"
+        },
+        lazyEditView: true,
+        modelComparator: fluid.inlineEdit.htmlComparator,
+        blurHandlerBinder: fluid.inlineEdit.CKEditor.blurHandlerBinder,
+        editModeRenderer: fluid.inlineEdit.CKEditor.editModeRenderer,
+        CKEditor: {
+            // CKEditor-specific configuration goes here.
+        }
+    });
+    
+    
+    /************************
+     * Dropdown Integration *
+     ************************/    
     /**
      * Instantiate a drop-down InlineEdit component
      * 
@@ -321,4 +414,4 @@
 // register it with the standard fluid event firer at fluid.inlineEdit.FCKEditor.complete
 function FCKeditor_OnComplete(editorInstance) {
     fluid.inlineEdit.FCKEditor.complete.fire(editorInstance);
-}
\ No newline at end of file
+}
Index: src/webapp/demos/inlineEdit/rich/html/inlineEdit.html
===================================================================
--- src/webapp/demos/inlineEdit/rich/html/inlineEdit.html	(revision 9801)
+++ src/webapp/demos/inlineEdit/rich/html/inlineEdit.html	(working copy)
@@ -2,7 +2,7 @@
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
     <head>
         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-        <title>Untitled</title>
+        <title>Rich Text Inline Edit Demo</title>
 
         <link rel="stylesheet" type="text/css" href="../../../../framework/fss/css/fss-reset.css" />
         <link rel="stylesheet" type="text/css" href="../../../../framework/fss/css/fss-layout.css" />
@@ -21,14 +21,14 @@
         <script type="text/javascript" src="../../../../components/inlineEdit/js/InlineEditIntegrations.js"></script>
         <script type="text/javascript" src="../../../../components/undo/js/Undo.js"></script>
         
-        <script type="text/javascript" src="../../../../tests/manual-tests/lib/fckeditor/fckeditor.js"></script>
+        <script type="text/javascript" src="http://ckeditor-fluid.appspot.com/ckeditor.js"></script>
         
         <script type="text/javascript" src="../js/inlineEdit.js"></script>
  
    </head>
     <body>
  
-       <h1>Example 4: Rich Text Inline Edit (using Tiny_MCE editor)</h1>
+       <h1>Rich Text Inline Edit with Tiny MCE</h1>
         <div id="richEdit1">
             <div class="flc-inlineEdit-text">
                 <p>After a hiatus, <strong>Portishead</strong> is back with their first studio 
@@ -45,7 +45,7 @@
         </div>
 
         
-        <h1>Example 5: Rich Text Inline Edit (using FCKEditor)</h1>
+        <h1>Rich Text Inline Edit with CKEditor 3</h1>
         <div id="richEdit2">
             <div class="flc-inlineEdit-text">
                 <p>After a hiatus, <strong>Portishead</strong> is back with their first studio 
@@ -63,7 +63,7 @@
         
         
         <script type="text/javascript">
-            demo.initInlineEdit();
+            demo.initRichInlineEdit();
         </script>        
     </body>
 </html>
\ No newline at end of file
Index: src/webapp/demos/inlineEdit/rich/js/inlineEdit.js
===================================================================
--- src/webapp/demos/inlineEdit/rich/js/inlineEdit.js	(revision 9801)
+++ src/webapp/demos/inlineEdit/rich/js/inlineEdit.js	(working copy)
@@ -11,21 +11,12 @@
 https://source.fluidproject.org/svn/LICENSE.txt
 */
 
-/*global jQuery*/
-/*global fluid*/
-/*global demo*/
-
+/*global jQuery, fluid, demo*/
 var demo = demo || {};
-(function ($, fluid) {
 
-    /**
-     * Initialize all rich text inline edit components present on the inline-edit 
-     * demo.
-     */
-    var inlineRichTextEditSetup = function () {
+(function ($, fluid) {
         
-        var editors = [];
-        
+    demo.initRichInlineEdit = function () {
         /**
          * Create cancel and save buttons for a rich inline editor.
          * @param {Object} editor 
@@ -40,51 +31,28 @@
                 editor.cancel();
                 return false;
             });
-        };
-        
-        /**
-         * Create cancel and save buttons for all rich text editors.
-         * @param {Object} editors array of rich inline editors.
-         */
-        var makeAllButtons = function (editors) {
-            while (editors.length > 0) {
-                makeButtons(editors.pop());
+        }; 
+
+        // Create a TinyMCE-based Rich Inline Edit component.
+        var tinyEditor = fluid.inlineEdit.tinyMCE("#richEdit1", {
+            tinyMCE: {
+                    width: 1024,
+                    theme: "advanced",
+                    theme_advanced_toolbar_location : "top"
+                }, 
+            componentDecorators: {
+                type: "fluid.undoDecorator"
             }
-        };          
-        
-        /**
-         * Tiny MCE rich inline text editor example. 
-         */
-        editors.push(
-            fluid.inlineEdit.tinyMCE("#richEdit1", {
-                tinyMCE: {
-                        width: 1024,
-                        theme: "advanced",
-                        theme_advanced_toolbar_location : "top"
-                    }, 
-                componentDecorators: {
-                    type: "fluid.undoDecorator"
-                }
-            })
-        );
-        
-        /**
-         * FCK Editor rich inline text editor example. 
-         */
-        editors.push(
-            fluid.inlineEdit.FCKEditor("#richEdit2", {
-                FCKEditor: {BasePath: "../../../../tests/manual-tests/lib/fckeditor/"},
-                componentDecorators: {
-                    type: "fluid.undoDecorator"
-                }
-            })
-        );
-        
-        makeAllButtons(editors);
-    };
+        });
+        makeButtons(tinyEditor);
 
-        
-    demo.initInlineEdit = function () {        
-        inlineRichTextEditSetup();
+        // Create an CKEditor 3.x-based Rich Inline Edit component.
+        var ckEditor = fluid.inlineEdit.CKEditor("#richEdit2", {
+            componentDecorators: {
+                type: "fluid.undoDecorator"
+            }
+        });
+        makeButtons(ckEditor);    
     };    
-})(jQuery, fluid);
\ No newline at end of file
+
+})(jQuery, fluid);
