Re: TinyMCE and ajax
Re: TinyMCE and ajax
- Subject: Re: TinyMCE and ajax
- From: Pascal Robert <email@hidden>
- Date: Sun, 14 Mar 2010 12:56:05 -0400
<script language = "javascript" type = "text/javascript">
tinyMCE.init({
mode : "specific_textareas",
editor_selector: "mceEditor",
theme : "advanced",
theme_advanced_buttons1 : "bold,italic,underline,separator,strikethrough,justifyleft,justifycenter,justifyright,justifyfull,bullist,numlist,undo,redo,link,unlink,code",
theme_advanced_buttons2 : "",
theme_advanced_buttons3 : "",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_path_location : "bottom",
theme_advanced_resizing : true,
valid_elements : "span[style],strong/b,em/i,strike,u,ul[style],li[style],a[name|href|target|title],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|name],hr[class|width|size|noshade],font[face|size|color|style],p[style]"
});
var saveOnSubmit = function() {
tinyMCE.activeEditor.save();
$('<wo:str value="$^id"/>').form.stopObserving('ajax:submit', arguments.callee);
};
$('<wo:str value="$^id"/>').form.observe('ajax:submit', saveOnSubmit);
$('<wo:str value="$^id"/>').form.observe('submit', saveOnSubmit);
</script>
On my AjaxSubmitButton component :
onClick="tinyMCE.execCommand('mceRemoveControl', false, 'longText');fancySave()"
And calling my TinyMCEJS component :
<wo:TinyMCEJS id = "presentation" />
> Hi All,
>
> I use tinyMCE in my page, but if I perform an Ajaxupdate, the tinyMCE has disappeared. I have to a new tinyMCE.init to solve that, but I also have to add a timeout to make is appear again:
>
> <wo:AjaxSubmitButton action = "$doAction" updateContainerID = "$updaterID" button = "$false" onSuccess ="function(e) {doOneUpdate() ;doTwoUpdate();}" onComplete = "function(e) { setTimeout(\"setupEditor('infovak')\",500);}">
>
> the 'setupEditor' is doing tinyMCE.init({....}), but why is it only working with a timeout?
> How can I solve this?
>
> Thanks in advance,
> Frank Stock
> Belgium
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden