Skip to content

Commit

Permalink
FLUID-4681: Trial version of improved "dead man's blur" which provide…
Browse files Browse the repository at this point in the history
…s a facade API to "globalDismissal" strategy rescued from CSpace, for resolving failure of blur detection when using TinyMCE version 3.4.8. New implementation and tests for fluid.keys and fluid.values
  • Loading branch information
amb26 committed Mar 27, 2012
1 parent ed9b661 commit 9708a6f
Show file tree
Hide file tree
Showing 74 changed files with 22,380 additions and 36 deletions.
25 changes: 13 additions & 12 deletions src/webapp/components/inlineEdit/js/InlineEditIntegrations.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,6 @@ var fluid_1_5 = fluid_1_5 || {};
function focusEditor(editor) {
setTimeout(function () {
tinyMCE.execCommand('mceFocus', false, that.editField[0].id);
if ($.browser.mozilla && $.browser.version.substring(0, 3) === "1.8") {
// Have not yet found any way to make this work on FF2.x - best to do nothing,
// for FLUID-2206
//var body = editor.getBody();
//fluid.setCaretToEnd(body.firstChild, "");
return;
}
editor.selection.select(editor.getBody(), 1);
editor.selection.collapse(0);
}, 10);
Expand All @@ -185,12 +178,13 @@ var fluid_1_5 = fluid_1_5 || {};
var editorBody = editor.getBody();

// NB - this section has no effect - on most browsers no focus events
// are delivered to the actual body
fluid.deadMansBlur(that.editField,
{
// are delivered to the actual body - however, on recent TinyMCE, the
// "focusEditor" call DOES deliver a blur which causes FLUID-4681
that.deadMansBlur = fluid.deadMansBlur(that.editField, {
cancelByDefault: true,
exclusions: {body: $(editorBody)},
handler: function () {
that.cancel();
that[that.options.onBlur]();
}
});
});
Expand All @@ -199,7 +193,13 @@ var fluid_1_5 = fluid_1_5 || {};
var editor = tinyMCE.get(that.editField[0].id);
if (editor) {
focusEditor(editor);
}
}
if (that.deadMansBlur) {
that.deadMansBlur.reArm();
}
});
that.events.afterFinishEdit.addListener(function () {
that.deadMansBlur.noteProceeded();
});
};

Expand Down Expand Up @@ -245,6 +245,7 @@ var fluid_1_5 = fluid_1_5 || {};
lazyEditView: true,
defaultViewText: "Click Edit",
modelComparator: fluid.inlineEdit.htmlComparator,
onBlur: "finish",
blurHandlerBinder: fluid.inlineEdit.tinyMCE.blurHandlerBinder,
displayModeRenderer: fluid.inlineEdit.richTextDisplayModeRenderer,
editModeRenderer: fluid.inlineEdit.tinyMCE.editModeRenderer
Expand Down
4 changes: 3 additions & 1 deletion src/webapp/demos/inlineEdit/rich/html/inlineEdit.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@
<link rel="stylesheet" type="text/css" href="../../../../lib/jquery/ui/css/jquery.ui.theme.css" />
<link rel="stylesheet" type="text/css" href="../../../../components/inlineEdit/css/InlineEdit.css" />
<link rel="stylesheet" type="text/css" href="../css/InlineEdit.css" />

<!--
<script type="text/javascript" src="http://tinymce-fluid.appspot.com/tiny_mce.js"></script>
-->
<script type="text/javascript" src="../tinyMCE/tiny_mce_src.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>
Expand Down
1 change: 1 addition & 0 deletions src/webapp/demos/inlineEdit/rich/tinyMCE/langs/en.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 9708a6f

Please sign in to comment.