<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Integrate tinyMCE into a WordPress widget</title>
	<atom:link href="http://matty.co.za/2009/06/integrate-tinymce-into-a-wordpress-widget/feed/" rel="self" type="application/rss+xml" />
	<link>http://matty.co.za/2009/06/integrate-tinymce-into-a-wordpress-widget/</link>
	<description>Web developer, WordPress enthusiast, avid musician and blogger</description>
	<lastBuildDate>Thu, 10 May 2012 07:37:42 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: Dan Imbrogno</title>
		<link>http://matty.co.za/2009/06/integrate-tinymce-into-a-wordpress-widget/comment-page-1/#comment-3423</link>
		<dc:creator>Dan Imbrogno</dc:creator>
		<pubDate>Sat, 07 Nov 2009 16:48:20 +0000</pubDate>
		<guid isPermaLink="false">http://matty.co.za/?p=425#comment-3423</guid>
		<description>Hi all, I had lots of problems trying to get Wordpress&#039; TinyMCE code to work with my plugin nicely. I kept running into problems trying to load the language translations. This resulted in having all these ugly titles in the link and image insert menus. I was including the javascript manually because using wp_enqueue_script(&#039;tinymce&#039;) didn&#039;t seem to work.

The solution was to simply call the following function in the template_redirect action (wp_head might work as well): 

wp_tiny_mce();

Then I simply inserted my initialization code, and everything works, language translation and all!


		/*  */


Here&#039;s my blog post on the subject: [ Link moved to main blog post. Thanks Dan. :) ]</description>
		<content:encoded><![CDATA[<p>Hi all, I had lots of problems trying to get WordPress&#8217; TinyMCE code to work with my plugin nicely. I kept running into problems trying to load the language translations. This resulted in having all these ugly titles in the link and image insert menus. I was including the javascript manually because using wp_enqueue_script(&#8216;tinymce&#8217;) didn&#8217;t seem to work.</p>
<p>The solution was to simply call the following function in the template_redirect action (wp_head might work as well): </p>
<p>wp_tiny_mce();</p>
<p>Then I simply inserted my initialization code, and everything works, language translation and all!</p>
<p>		/*  */</p>
<p>Here&#8217;s my blog post on the subject: [ Link moved to main blog post. Thanks Dan. <img src='http://matty.co.za/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matty</title>
		<link>http://matty.co.za/2009/06/integrate-tinymce-into-a-wordpress-widget/comment-page-1/#comment-3420</link>
		<dc:creator>Matty</dc:creator>
		<pubDate>Sat, 07 Nov 2009 08:08:27 +0000</pubDate>
		<guid isPermaLink="false">http://matty.co.za/?p=425#comment-3420</guid>
		<description>Thanks for your comment, Simone. I&#039;m glad you found what you were looking for. :)</description>
		<content:encoded><![CDATA[<p>Thanks for your comment, Simone. I&#8217;m glad you found what you were looking for. <img src='http://matty.co.za/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: simone</title>
		<link>http://matty.co.za/2009/06/integrate-tinymce-into-a-wordpress-widget/comment-page-1/#comment-3419</link>
		<dc:creator>simone</dc:creator>
		<pubDate>Tue, 03 Nov 2009 15:14:10 +0000</pubDate>
		<guid isPermaLink="false">http://matty.co.za/?p=425#comment-3419</guid>
		<description>Great, after a long trip I&#039;ve found the answer to my needs!!!

Thanks.</description>
		<content:encoded><![CDATA[<p>Great, after a long trip I&#8217;ve found the answer to my needs!!!</p>
<p>Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matty</title>
		<link>http://matty.co.za/2009/06/integrate-tinymce-into-a-wordpress-widget/comment-page-1/#comment-3231</link>
		<dc:creator>Matty</dc:creator>
		<pubDate>Wed, 12 Aug 2009 07:11:43 +0000</pubDate>
		<guid isPermaLink="false">http://matty.co.za/?p=425#comment-3231</guid>
		<description>Wow! Thanks for posting this, Michael. :)</description>
		<content:encoded><![CDATA[<p>Wow! Thanks for posting this, Michael. <img src='http://matty.co.za/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael</title>
		<link>http://matty.co.za/2009/06/integrate-tinymce-into-a-wordpress-widget/comment-page-1/#comment-3217</link>
		<dc:creator>Michael</dc:creator>
		<pubDate>Tue, 11 Aug 2009 20:48:44 +0000</pubDate>
		<guid isPermaLink="false">http://matty.co.za/?p=425#comment-3217</guid>
		<description>Here it is cleaned up and fully functional ... Please note you will need to place the TinyMCE libraries into the directory of the plug-in. Hope you enjoy =)

&lt;strong&gt;(Code snippet moved to main post content, for consistency.)&lt;/strong&gt;</description>
		<content:encoded><![CDATA[<p>Here it is cleaned up and fully functional &#8230; Please note you will need to place the TinyMCE libraries into the directory of the plug-in. Hope you enjoy =)</p>
<p><strong>(Code snippet moved to main post content, for consistency.)</strong></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matty</title>
		<link>http://matty.co.za/2009/06/integrate-tinymce-into-a-wordpress-widget/comment-page-1/#comment-3216</link>
		<dc:creator>Matty</dc:creator>
		<pubDate>Tue, 11 Aug 2009 20:12:36 +0000</pubDate>
		<guid isPermaLink="false">http://matty.co.za/?p=425#comment-3216</guid>
		<description>That&#039;s really awesome, Michael, thanks for posting. Your explanation is really helpful as well. :)</description>
		<content:encoded><![CDATA[<p>That&#8217;s really awesome, Michael, thanks for posting. Your explanation is really helpful as well. <img src='http://matty.co.za/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael</title>
		<link>http://matty.co.za/2009/06/integrate-tinymce-into-a-wordpress-widget/comment-page-1/#comment-3213</link>
		<dc:creator>Michael</dc:creator>
		<pubDate>Tue, 11 Aug 2009 19:48:33 +0000</pubDate>
		<guid isPermaLink="false">http://matty.co.za/?p=425#comment-3213</guid>
		<description>Here&#039;s a correction to my previous post: the live function wouldn&#039;t work in this situation since it handles events such as click, mouseover etc.

I did however get tinyMCE to load into a widget in wordpress 2.8.3. For those of you having trouble getting the editor to save in the widget form, you must include this code into the tinyMCE.init function :

          setup : function(ed) {
		ed.onChange.add(function(ed) {
			tinyMCE.triggerSave();
			});
		}

Now the main problem with this situation was that wordpress loads the form again after you save. Disabling the editor. What I did was in the update function of the widget I pass a variable to define that the content has been updated. Then in the form display code I check for this variable and recall the init function to get the editor back into the widget.

After I tidy up my code a bit I will post it and hopefully it will help a lot of you guys out. =)</description>
		<content:encoded><![CDATA[<p>Here&#8217;s a correction to my previous post: the live function wouldn&#8217;t work in this situation since it handles events such as click, mouseover etc.</p>
<p>I did however get tinyMCE to load into a widget in wordpress 2.8.3. For those of you having trouble getting the editor to save in the widget form, you must include this code into the tinyMCE.init function :</p>
<p>          setup : function(ed) {<br />
		ed.onChange.add(function(ed) {<br />
			tinyMCE.triggerSave();<br />
			});<br />
		}</p>
<p>Now the main problem with this situation was that wordpress loads the form again after you save. Disabling the editor. What I did was in the update function of the widget I pass a variable to define that the content has been updated. Then in the form display code I check for this variable and recall the init function to get the editor back into the widget.</p>
<p>After I tidy up my code a bit I will post it and hopefully it will help a lot of you guys out. =)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matty</title>
		<link>http://matty.co.za/2009/06/integrate-tinymce-into-a-wordpress-widget/comment-page-1/#comment-3210</link>
		<dc:creator>Matty</dc:creator>
		<pubDate>Tue, 11 Aug 2009 18:33:23 +0000</pubDate>
		<guid isPermaLink="false">http://matty.co.za/?p=425#comment-3210</guid>
		<description>Thanks, Michael. :)

The use of jQuery&#039;s live() sounds like a pretty solid solution to me. This may prevent users using a pre-1.3 version of jQuery from using this feature as, if I understand correctly, live() has been included only since jQuery 1.3. This can, however, easily be resolved by including the jQuery library from Google Code instead of relying on the native Wordpress jQuery library. :)

Thanks for posting, Michael. I look forward to reading your progress updates. :)

Cheers,
Matty.</description>
		<content:encoded><![CDATA[<p>Thanks, Michael. <img src='http://matty.co.za/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>The use of jQuery&#8217;s live() sounds like a pretty solid solution to me. This may prevent users using a pre-1.3 version of jQuery from using this feature as, if I understand correctly, live() has been included only since jQuery 1.3. This can, however, easily be resolved by including the jQuery library from Google Code instead of relying on the native WordPress jQuery library. <img src='http://matty.co.za/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Thanks for posting, Michael. I look forward to reading your progress updates. <img src='http://matty.co.za/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Cheers,<br />
Matty.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael</title>
		<link>http://matty.co.za/2009/06/integrate-tinymce-into-a-wordpress-widget/comment-page-1/#comment-3207</link>
		<dc:creator>Michael</dc:creator>
		<pubDate>Tue, 11 Aug 2009 17:39:29 +0000</pubDate>
		<guid isPermaLink="false">http://matty.co.za/?p=425#comment-3207</guid>
		<description>It seems the issue to this problem is with how wordpress is handling the ajax requests. TinyMCE.init is called on load when the widgets page is loaded. In order to keep the editor intact it will require recalling the init function after the ajax request completes. Maybe using jquery&#039;s live feature to bind to the textarea&#039;s class? I will keep ya&#039;ll updated on my progress if i get this feature to work without the AM.</description>
		<content:encoded><![CDATA[<p>It seems the issue to this problem is with how wordpress is handling the ajax requests. TinyMCE.init is called on load when the widgets page is loaded. In order to keep the editor intact it will require recalling the init function after the ajax request completes. Maybe using jquery&#8217;s live feature to bind to the textarea&#8217;s class? I will keep ya&#8217;ll updated on my progress if i get this feature to work without the AM.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matty</title>
		<link>http://matty.co.za/2009/06/integrate-tinymce-into-a-wordpress-widget/comment-page-1/#comment-3112</link>
		<dc:creator>Matty</dc:creator>
		<pubDate>Sat, 08 Aug 2009 06:44:47 +0000</pubDate>
		<guid isPermaLink="false">http://matty.co.za/?p=425#comment-3112</guid>
		<description>Great. :)

So the next step is to get it working without AM. :)

I should have a bit of time today to do some research and testing into this. :)</description>
		<content:encoded><![CDATA[<p>Great. <img src='http://matty.co.za/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>So the next step is to get it working without AM. <img src='http://matty.co.za/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I should have a bit of time today to do some research and testing into this. <img src='http://matty.co.za/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Object Caching 372/382 objects using disk: basic

Served from: matty.co.za @ 2012-05-14 12:39:54 -->
