<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ReadyState4 &#187; tinymce</title>
	<atom:link href="http://readystate4.com/category/tinymce/feed/" rel="self" type="application/rss+xml" />
	<link>http://readystate4.com</link>
	<description>JavaScript, Web Development, Ruby, and Technology.</description>
	<lastBuildDate>Fri, 04 Jun 2010 19:42:44 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>TinyMCE: TypeError: t.win.document is null in Firebug Console</title>
		<link>http://readystate4.com/2009/05/15/tinymce-typeerror-twindocument-is-null-in-firebug-console/</link>
		<comments>http://readystate4.com/2009/05/15/tinymce-typeerror-twindocument-is-null-in-firebug-console/#comments</comments>
		<pubDate>Sat, 16 May 2009 02:33:33 +0000</pubDate>
		<dc:creator>Mauvis</dc:creator>
				<category><![CDATA[tinymce]]></category>

		<guid isPermaLink="false">http://readystate4.com/2009/05/15/tinymce-typeerror-twindocument-is-null-in-firebug-console/</guid>
		<description><![CDATA[I came across this error on a site I was helping to troubleshoot today and with a little Googling found it happens when you move the DOM containing a TinyMCE editor to another place in the document: TinyMCE loses it&#8217;s reference to that original element.
To get around this, showing or hiding the editor won&#8217;t work, [...]]]></description>
			<content:encoded><![CDATA[<p>I came across this error on a site I was helping to troubleshoot today and with a little Googling found it happens when you move the DOM containing a TinyMCE editor to another place in the document: TinyMCE loses it&#8217;s reference to that original element.</p>
<p>To get around this, showing or hiding the editor won&#8217;t work, instead destroying the element before you move it and recreating it (same as the previous post) does the trick:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">tinyMCE.<span style="color: #660066;">execCommand</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'mceRemoveControl'</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'idOfElement'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #006600; font-style: italic;">// move DOM element</span>
tinyMCE.<span style="color: #660066;">execCommand</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'mceAddControl'</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'idOfElement'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://readystate4.com/2009/05/15/tinymce-typeerror-twindocument-is-null-in-firebug-console/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Removing all TinyMCE editors on the page for reinitializing</title>
		<link>http://readystate4.com/2009/05/06/removing-all-tinymce-editors-on-the-page-for-reinitializing/</link>
		<comments>http://readystate4.com/2009/05/06/removing-all-tinymce-editors-on-the-page-for-reinitializing/#comments</comments>
		<pubDate>Wed, 06 May 2009 16:47:49 +0000</pubDate>
		<dc:creator>Mauvis</dc:creator>
				<category><![CDATA[tinymce]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://readystate4.com/2009/05/06/removing-all-tinymce-editors-on-the-page-for-reinitializing/</guid>
		<description><![CDATA[Sometimes, one needs to remove (not hide) all TinyMCE editors on the page to run a modified version of the global tinyMCE.init code again. This is the best way I&#8217;ve found to do it so far:

var i, t = tinyMCE.editors;
for &#40;i in t&#41;&#123;
    if &#40;t.hasOwnProperty&#40;i&#41;&#41;&#123;
        [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes, one needs to remove (not hide) all TinyMCE editors on the page to run a modified version of the global tinyMCE.init code again. This is the best way I&#8217;ve found to do it so far:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> i<span style="color: #339933;">,</span> t <span style="color: #339933;">=</span> tinyMCE.<span style="color: #660066;">editors</span><span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span>i <span style="color: #000066; font-weight: bold;">in</span> t<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>t.<span style="color: #660066;">hasOwnProperty</span><span style="color: #009900;">&#40;</span>i<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        t<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">remove</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #006600; font-style: italic;">// new tinyMCE.init code here</span></pre></div></div>

<p>Additionally, you can &#8220;destrory&#8221; and &#8220;recreate&#8221; specific editors via:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">tinyMCE.<span style="color: #660066;">execCommand</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'mceRemoveControl'</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'idOfElement'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
tinyMCE.<span style="color: #660066;">execCommand</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'mceAddControl'</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'idOfElement'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>If anyone knows a better way, post in the comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://readystate4.com/2009/05/06/removing-all-tinymce-editors-on-the-page-for-reinitializing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
