I am using tinyMCE in a page. I capture Ctrl+s to save the content using ajax, when the focus is out of tinyMCE, everything works fine, but when the focus is in the tinyMCE it doesn't work. I need a piece of code to insert in this block of code (and not in the settings or plugins) to make content save working even if the focus is inside tinyMCE.
<script type="text/javascript">
$(document).ready(function() {
dssModify = new Sol.Dss.Modify();
dssModify.config =
{
urlActionContentSave: "<?php echo \Sol\Dss\Dss::me () -> urlActionContentSaveGet () ; ?>",
buttonContentSaveId: "<?php echo \Sol\Dss\Dss::me () -> modifyButtonContentSaveIdGet () ; ?>",
buttonContentSavingTitle: "<?php echo \Sol\Dss\Dss::me () -> modifyButtonContentSavingTitleGet () ; ?>",
buttonContentSaveTitle: "<?php echo \Sol\Dss\Dss::me () -> modifyButtonContentSaveTitleGet () ; ?>",
textareaContentId: "<?php echo \Sol\Dss\Dss::me () -> modifyTextareaContentIdGet () ; ?>",
formId: "<?php echo \Sol\Dss\Dss::me () -> modifyFormIdGet () ; ?>",
idRoutes: "<?php echo $route[ 'id' ] ; ?>"
};
whenClicked = function()
{
$("#"+dssModify.config.textareaContentId).val(tinyMCE.activeEditor.getContent());
dssModify.contentSave();
}
$("#<?php echo Sol\Dss\Dss::me () -> modifyButtonContentSaveIdGet () ; ?>").click( whenClicked );//Click Function
$(window).keypress(function(event) {
if (!(event.which == 115 && event.ctrlKey) && !(event.which == 19))
return true;
whenClicked();
event.preventDefault();
return false;
});
}//Ready function
);
</script>