<?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>Bram.us &#187; TinyMCE</title>
	<atom:link href="http://www.bram.us/category/tinymce/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bram.us</link>
	<description>A rather geeky/technical weblog by Bram(us) Van Damme</description>
	<lastBuildDate>Sat, 04 Feb 2012 11:59:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>TinyMCE : hooking onto the resize event</title>
		<link>http://www.bram.us/2008/06/26/tinymce-hooking-onto-the-resize-event/</link>
		<comments>http://www.bram.us/2008/06/26/tinymce-hooking-onto-the-resize-event/#comments</comments>
		<pubDate>Thu, 26 Jun 2008 18:16:19 +0000</pubDate>
		<dc:creator>Bramus!</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[TinyMCE]]></category>
		<category><![CDATA[Webdevelopment]]></category>
		<guid isPermaLink="false">http://www.bram.us/?p=1698</guid>
		<description><![CDATA[Out of the box TinyMCE supports a nice set of events which you can trace via the handle_event_callback Callback. Amongst a few you can externally hook onto the mousedown, mouseup, click, keypress, keydown, keyup, etc. events. Very nice, yet I &#8230; <a href="http://www.bram.us/2008/06/26/tinymce-hooking-onto-the-resize-event/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img alt="TinyMCE Logo" id="image250" style="margin: 0px 10px 5px 0px; display: block; float: left" src="http://www.bram.us/wordpress/wp-content/uploads/2006/10/tinymce_logo.jpg" />Out of the box TinyMCE supports a nice set of events which you can trace via the <a href="http://wiki.moxiecode.com/index.php/TinyMCE:Configuration/handle_event_callback"><code>handle_event_callback</code></a> Callback. Amongst a few you can externally hook onto the <code>mousedown</code>, <code>mouseup</code>, <code>click</code>, <code>keypress</code>, <code>keydown</code>, <code>keyup</code>, etc. events. Very nice, yet I was missing one from <a href="http://wiki.moxiecode.com/index.php/TinyMCE:API/tinymce.Editor#Events">the list of supported events</a>: the <code>resize</code> event.<br style="clear: both;" /></p>
<p><span id="more-1698"></span></p>
<h2>Please note&#8230;</h2>
<div class="BramusBlock">
<p class="alert">Please note that in order to enable resizing, one must use the advanced <a href="http://wiki.moxiecode.com/index.php/TinyMCE:Configuration/theme"><code>theme</code></a> and enable the <a href="http://wiki.moxiecode.com/index.php/TinyMCE:Configuration/theme_advanced_resizing"><code>theme_advanced_resizing</code></a> setting <img src='http://www.bram.us/wordpress/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
</div>
<h2>Finding a way to hook</h2>
<div class="BramusBlock">
<p>Whilst investigating on how I precisely could hook onto the resize event I tried all kinds of stuff (<em>can&#8217;t even recall &#8216;m all &#8230; it&#8217;s been a while since I actually coded this <img src='http://www.bram.us/wordpress/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </em>) yet one thing was certain: the hook had to be placed after TinyMCE got inited. Aha, that <a href="http://www.bram.us/2007/02/14/my-tinymce-bugfix/">rings a bell</a>: <a href="http://wiki.moxiecode.com/index.php/TinyMCE:Configuration/init_instance_callback"><code>init_instance_callback</code></a> to the rescue!</p>
</div>
<h2>What to hook on?</h2>
<div class="BramusBlock">
<p>Most likely you already know this: After TinyMCE is inited, the editor itself (not the UI) in fact is an <code>iframe</code>. Perfect, as <code>iframe</code> have a <a href="http://www.w3schools.com/jsref/jsref_onresize.asp"><code>resize</code> event</a>! Now, the <code>init_instance_callback</code> function we&#8217;re about to define has one parameter passed in: a <a href="http://wiki.moxiecode.com/index.php/TinyMCE:API/tinymce.Editor">tinymce.Editor</a> instance. Via the provided <a href="http://wiki.moxiecode.com/index.php/TinyMCE:API/tinymce.Editor/getDoc">getDoc</a> function we can then get access to the <code>iframe</code>.</p>
</div>
<h2>Placing the hook</h2>
<div class="BramusBlock">
<p>As of TinyMCE 3, the internals of it have been totally refactored (<a href="http://wiki.moxiecode.com/index.php/TinyMCE:API">check the API: lots of classes <img src='http://www.bram.us/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </a>) and contains lots of functionality which you can also find in the infamouse JS libraries (<a href="http://jquery.com/">jQuery</a>, <a href="http://www.prototypejs.org/">Prototype</a>, <a href="http://www.mootools.net/">MooTools</a>, etc.). One of those classes is <a href="http://wiki.moxiecode.com/index.php/TinyMCE:API/tinymce.dom.Event">tinymce.dom.Event</a> by which we can add eventHandlers to given elements via its <a href="http://wiki.moxiecode.com/index.php/TinyMCE:API/tinymce.dom.Event/add">add</a> method.</p>
</div>
<h2>The actual code</h2>
<div class="BramusBlock">
<p>Given the knowledge above, it&#8217;s really easy to hook onto the resize event:</p>
<ol>
<li>Adjust your tinyMCE.init so that the <code>init_instance_callback</code> function gets called
<pre class="brush: jscript; title: ; notranslate">tinyMCE.init({
	...
	init_instance_callback : &quot;myCustomInitInstance&quot;
});</pre>
</li>
<li>In your defined <code>init_instance_callback</code> function, hook onto the instance&#8217;s <code>iframe</code> resize event via <code>tinymce.dom.Event</code>
<pre class="brush: jscript; title: ; notranslate">function myInitInstance(inst) {
	tinymce.dom.Event.add(inst.getWin(), 'resize', function(e) {
	   // Do your thing here <img src='http://www.bram.us/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />
	});
}</pre>
</li>
<li>That&#8217;s it; Happy coding!</li>
</ol>
</div>
<h2>Make a donation</h2>
<div class="BramusBlock">
<p>It certainly is no obligation but it would most certainly put a smile on my face <img src='http://www.bram.us/wordpress/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but04.gif" style="border: 0;" name="submit" alt="Make a donation" /><img alt="" style="border: 0;" src="https://www.paypal.com/nl_NL/i/scr/pixel.gif" width="1" height="1" /><br />
<input type="hidden" name="cmd" value="_xclick" style="display: none;" />
<input type="hidden" name="business" value="paypal@bram.us" style="display: none;" />
<input type="hidden" name="item_name" value="Bram Van Damme (Bram.us)" style="display: none;" />
<input type="hidden" name="no_shipping" value="0" style="display: none;" />
<input type="hidden" name="no_note" value="1" style="display: none;" />
<input type="hidden" name="currency_code" value="EUR" style="display: none;" />
<input type="hidden" name="tax" value="0" style="display: none;" />
<input type="hidden" name="lc" value="BE" style="display: none;" />
<input type="hidden" name="bn" value="PP-DonationsBF" style="display: none;" /></form>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.bram.us/2008/06/26/tinymce-hooking-onto-the-resize-event/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>TinyMCE 3.0.2 Released</title>
		<link>http://www.bram.us/2008/02/27/tinymce-302-released/</link>
		<comments>http://www.bram.us/2008/02/27/tinymce-302-released/#comments</comments>
		<pubDate>Wed, 27 Feb 2008 00:09:23 +0000</pubDate>
		<dc:creator>Bramus!</dc:creator>
				<category><![CDATA[Elsewhere]]></category>
		<category><![CDATA[TinyMCE]]></category>
		<category><![CDATA[link]]></category>
		<guid isPermaLink="false">http://www.bram.us/2008/02/27/tinymce-302-released/</guid>
		<description><![CDATA[&#8220;This release fixes many of these small issues and it also adds a few new features.&#8221; My favourite is body_id, a little something I used to implement manually by invoking a inst.contentDocument.documentElement.id = "my_id"; within the init_instance_callback (which still can &#8230; <a href="http://www.bram.us/2008/02/27/tinymce-302-released/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>&ldquo;<em>This release fixes many of these small issues and it also adds a few new features.</em>&rdquo; My favourite is <a href="http://wiki.moxiecode.com/index.php/TinyMCE:Configuration/body_id">body_id</a>, a little something I used to implement manually by invoking a <code>inst.contentDocument.documentElement.id = "my_id";</code> within the <a href="http://wiki.moxiecode.com/index.php/TinyMCE:Configuration/init_instance_callback">init_instance_callback</a> (<em>which still can be used for 2.x</em>). <a href="http://tinymce.moxiecode.com/punbb/viewtopic.php?id=10384">Announcement</a> &#8211; <a href="http://tinymce.moxiecode.com/changelog.php?example=true">Changelog</a> &#8211; <a href="http://prdownloads.sourceforge.net/tinymce/tinymce_3_0_2_1.zip?download">Download</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.bram.us/2008/02/27/tinymce-302-released/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>TinyMCE CSS Classes and IDs Plugin : bramus_cssextras 0.5.0 hits the net!</title>
		<link>http://www.bram.us/2007/12/13/tinymce-css-classes-and-ids-plugin-bramus_cssextras-050-hits-the-net/</link>
		<comments>http://www.bram.us/2007/12/13/tinymce-css-classes-and-ids-plugin-bramus_cssextras-050-hits-the-net/#comments</comments>
		<pubDate>Wed, 12 Dec 2007 23:35:42 +0000</pubDate>
		<dc:creator>Bramus!</dc:creator>
				<category><![CDATA[Bramus!]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[TinyMCE]]></category>
		<category><![CDATA[TinyMCE Plugins]]></category>
		<category><![CDATA[Webdevelopment]]></category>
		<category><![CDATA[CSS]]></category>
		<guid isPermaLink="false">http://www.bram.us/2007/12/13/tinymce-css-classes-and-ids-plugin-bramus_cssextras-050-hits-the-net/</guid>
		<description><![CDATA[Huzzah! bramus_cssextras 0.5.0 has been released! No new features have been added, yet this version differs a lot from the previously released versions of bramus_cssextras: Under the hood bramus_cssextras has been totally rewritten to make it TinyMCE 3.0 compatible. What &#8230; <a href="http://www.bram.us/2007/12/13/tinymce-css-classes-and-ids-plugin-bramus_cssextras-050-hits-the-net/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img alt="TinyMCE Logo" id="image250e" style="margin: 0px 10px 5px 0px; display: block; float: left" src="http://www.bram.us/wordpress/wp-content/uploads/2006/10/tinymce_logo.jpg" />Huzzah! <code>bramus_cssextras 0.5.0</code> has been released! No new features have been added, yet this version differs a lot from the previously released versions of <a href="http://www.bram.us/projects/tinymce-plugins/tinymce-classes-and-ids-plugin-bramus_cssextras/"><code>bramus_cssextras</code></a>: Under the hood <code>bramus_cssextras</code> has been totally rewritten to make it <a href="http://tinymce.moxiecode.com/punbb/viewtopic.php?pid=27938#p27938">TinyMCE 3.0</a> compatible.<br style="clear: both;" /></p>
<p><span id="more-1314"></span></p>
<h3>What is bramus_cssextras?</h3>
<div class="BramusBlock">
<p><code>bramus_cssextras</code> is a plugin for <a href="http://tinymce.moxiecode.com/">TinyMCE</a> which enables the usage of CSS classes and CSS ids on any HTML element within TinyMCE. Together with an external CSS file, set via the <a href="http://wiki.moxiecode.com/index.php/TinyMCE:Configuration/content_css">TinyMCE <code>content_css </code> setting</a>, <code>bramus_cssextras</code> bridges the (visual) gap between the content entered through TinyMCE and the actual output; as seen below.</p>
<p style="text-align: center; font-size: smaller;"><a class="imagelink" href="http://www.bram.us/wordpress/wp-content/uploads/2007/07/bramus_classeslist_visual.jpg" title="Plain TinyMCE (1) vs. TinyMCE with content_css (2) vs. TinyMCE with content_css and bramus_cssextras (3)"><img id="image845" src="http://www.bram.us/wordpress/wp-content/uploads/2007/07/bramus_classeslist_visual_s.jpg" alt="Plain TinyMCE (1) vs. TinyMCE with content_css (2) vs. TinyMCE with content_css and bramus_cssextrast (3)" title="Plain TinyMCE (1) vs. TinyMCE with content_css (2) vs. TinyMCE with content_css and bramus_cssextras (3)" /></a><br />Plain TinyMCE vs. TinyMCE with content_css vs. TinyMCE with content_css and bramus_cssextras</p>
<p>Where <code>content_css</code> only lets you <em>view</em> the CSS styles applied on elements, <code>bramus_cssextras</code> takes it to the next level by <strong>letting you <em>set</em> these CSS styles on <em>any</em> element</strong>, giving the user more power on the visual representation then ever before.</p>
</div>
<h3>How does it work?</h3>
<div class="BramusBlock">
<p><code>bramus_cssextras</code> works really simple: Just hook it to TinyMCE, add the button references and you&#8217;re good to go. <code>bramus_cssextras</code> will do all the work for you, by scanning the defined <code>content_css</code>-file for possible classes/ids which can be set on elements. Then, when editing a piece of HTML through TinyMCE, <code>bramus_cssextras</code> will make your life easier by showing you which classes/ids can be set on the current element and will even let you set a specific class/id on that element.</p>
</div>
<h3>Can I testdrive it?</h3>
<div class="BramusBlock">
<p>Yes you can!</p>
<p style="text-align: center;"><a href='http://www.bram.us/demo/projects/bramus_cssextras/' title='bramus_cssextras demo - click to launch'><img src='http://www.bram.us/wordpress/wp-content/uploads/2007/12/clicktolaunchdemo.gif' alt='bramus_cssextras demo - click to launch' title='bramus_cssextras demo - click to launch' /></a></p>
</div>
<h3>How much does it cost? / Where can I download it?</h3>
<div class="BramusBlock">
<p><code>bramus_cssextras</code> is free <a href="http://www.bram.us/projects/tinymce-plugins/tinymce-classes-and-ids-plugin-bramus_cssextras/#license_usage">and released under a Creative Commons License</a>. The latest version (0.5.0 the time of writing) <a href="http://www.bram.us/projects/tinymce-plugins/tinymce-classes-and-ids-plugin-bramus_cssextras/#download">can be downloaded from the project page</a>.</p>
</div>
<h3>I&#8217;m still using TinyMCE 2.x, is there a TinyMCE 2.x compatible version available?</h3>
<div class="BramusBlock">
<p><code>bramus_cssextras 0.5.0</code> is TinyMCE 3.x only, older versions of <code>bramus_cssextras</code> are TinyMCE 2.x only. These older versions <a href="http://www.bram.us/projects/tinymce-plugins/tinymce-classes-and-ids-plugin-bramus_cssextras/#download">can also be downloaded from the project page</a> (version 0.4.1 is suggested).</p>
<p><em>On a sidenote, I myself don&#8217;t suggest on using TinyMCE 3.0 as it still is in beta <img src='http://www.bram.us/wordpress/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </em></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.bram.us/2007/12/13/tinymce-css-classes-and-ids-plugin-bramus_cssextras-050-hits-the-net/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>TinyMCE CSS Classes and IDs Plugin : bramus_cssextras 0.5.0 in the works</title>
		<link>http://www.bram.us/2007/12/11/tinymce-css-classes-and-ids-plugin-bramus_cssextras-050-in-the-works/</link>
		<comments>http://www.bram.us/2007/12/11/tinymce-css-classes-and-ids-plugin-bramus_cssextras-050-in-the-works/#comments</comments>
		<pubDate>Mon, 10 Dec 2007 23:24:56 +0000</pubDate>
		<dc:creator>Bramus!</dc:creator>
				<category><![CDATA[Bramus!]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[TinyMCE]]></category>
		<category><![CDATA[TinyMCE Plugins]]></category>
		<category><![CDATA[Webdevelopment]]></category>
		<guid isPermaLink="false">http://www.bram.us/2007/12/11/tinymce-css-classes-and-ids-plugin-bramus_cssextras-050-in-the-works/</guid>
		<description><![CDATA[Tonight I&#8217;ve been working on bramus_cssextras 0.5.0, a rewrite of bramus_cssextras which will make bramus_cssextras compatible with TinyMCE 3.0. The update isn&#8217;t finished yet (neither is Tiny3 ), but it&#8217;s shaping up nicely thanks to the extensive articles found on &#8230; <a href="http://www.bram.us/2007/12/11/tinymce-css-classes-and-ids-plugin-bramus_cssextras-050-in-the-works/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img alt="TinyMCE Logo" id="image250e" style="margin: 0px 10px 5px 0px; display: block; float: left" src="http://www.bram.us/wordpress/wp-content/uploads/2006/10/tinymce_logo.jpg" />Tonight I&#8217;ve been working on <code>bramus_cssextras 0.5.0</code>, a rewrite of <a href="http://www.bram.us/projects/tinymce-plugins/tinymce-classes-and-ids-plugin-bramus_cssextras/"><code>bramus_cssextras</code></a> which will make <code>bramus_cssextras</code> <strong>compatible with TinyMCE 3.0</strong>. The update isn&#8217;t finished yet (neither is Tiny3 <img src='http://www.bram.us/wordpress/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> ), but it&#8217;s shaping up nicely thanks to the extensive articles found on the <a href="http://wiki.moxiecode.com/index.php/TinyMCE:Index">TinyMCE Wiki</a>. If you&#8217;re planning on writing some TinyMCE 3.0 plugins yourself, I suggest you take a peek at the <a href="http://wiki.moxiecode.com/index.php/TinyMCE:API">TinyMCE API Reference</a>, the <a href="http://wiki.moxiecode.com/index.php/TinyMCE:Create_plugin/3.x">Guide to creating a Plugin for TinyMCE 3.0</a> and of course the sources of the plugins that ship with TinyMCE 3.0. And ooh, don&#8217;t forget to take a peek at the <a href="http://wiki.moxiecode.com/index.php/TinyMCE:Migration_guide">Migration Guide</a> if you&#8217;ve written plugins for TinyMCE 2.x before <img src='http://www.bram.us/wordpress/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.bram.us/2007/12/11/tinymce-css-classes-and-ids-plugin-bramus_cssextras-050-in-the-works/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TinyMCE CSS Classes and IDs Plugin : bramus_cssextras 0.4.1 released!</title>
		<link>http://www.bram.us/2007/11/22/tinymce-css-classes-and-ids-plugin-bramus_cssextras-041-released/</link>
		<comments>http://www.bram.us/2007/11/22/tinymce-css-classes-and-ids-plugin-bramus_cssextras-041-released/#comments</comments>
		<pubDate>Thu, 22 Nov 2007 16:52:14 +0000</pubDate>
		<dc:creator>Bramus!</dc:creator>
				<category><![CDATA[Bramus!]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[TinyMCE]]></category>
		<category><![CDATA[Webdevelopment]]></category>
		<guid isPermaLink="false">http://www.bram.us/2007/11/22/tinymce-css-classes-and-ids-plugin-bramus_cssextras-041-released/</guid>
		<description><![CDATA[bramus_cssextras has made it to version 0.4.1! This version holds one major bugfix where bramus_cssextras wasn&#8217;t able to load multiple CSS files set through content_css (Thanks to Martin for notifying me!) and a minor improvement so that classes applicable on &#8230; <a href="http://www.bram.us/2007/11/22/tinymce-css-classes-and-ids-plugin-bramus_cssextras-041-released/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img alt="TinyMCE Logo" id="image250e" style="margin: 0px 10px 5px 0px; display: block; float: left" src="http://www.bram.us/wordpress/wp-content/uploads/2006/10/tinymce_logo.jpg" /><a href="http://www.bram.us/projects/tinymce-plugins/tinymce-classes-and-ids-plugin-bramus_cssextras/"><code>bramus_cssextras</code></a> has made it to <a href="http://www.bram.us/projects/tinymce-plugins/tinymce-classes-and-ids-plugin-bramus_cssextras/#download">version 0.4.1</a>! This version holds one major bugfix where <code>bramus_cssextras</code> wasn&#8217;t able to load multiple CSS files set through <code>content_css</code> (Thanks to <a href="http://www.bram.us/projects/tinymce-plugins/tinymce-classes-and-ids-plugin-bramus_cssextras/#comment-89820">Martin for notifying me</a>!) and a minor improvement so that classes applicable on an element are only shown once in the dropdown even if they&#8217;re specified multiple times (versions pre 0.4.1 would &#8211; <em>for example</em> &#8211; show the classname &ldquo;<code>test</code>&rdquo; 5 times if that class was specified 5 times in the CSS file) &#8211; <a href="http://www.bram.us/projects/tinymce-plugins/tinymce-classes-and-ids-plugin-bramus_cssextras/#download">Go Download</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bram.us/2007/11/22/tinymce-css-classes-and-ids-plugin-bramus_cssextras-041-released/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>My TinyMCE MCFileManager/MCImageManager trick: When media is file, not image (or vice versa)</title>
		<link>http://www.bram.us/2007/11/12/my-tinymce-mcfilemanagermcimagemanager-trick-when-media-is-file-not-image-or-vice-versa/</link>
		<comments>http://www.bram.us/2007/11/12/my-tinymce-mcfilemanagermcimagemanager-trick-when-media-is-file-not-image-or-vice-versa/#comments</comments>
		<pubDate>Mon, 12 Nov 2007 22:10:06 +0000</pubDate>
		<dc:creator>Bramus!</dc:creator>
				<category><![CDATA[Another Dailie]]></category>
		<category><![CDATA[Bramus!]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[TinyMCE]]></category>
		<category><![CDATA[Webdevelopment]]></category>
		<guid isPermaLink="false">http://www.bram.us/2007/11/12/my-tinymce-mcfilemanagermcimagemanager-trick-when-media-is-file-not-image-or-vice-versa/</guid>
		<description><![CDATA[At work (I switched fulltime jobs a little while ago, remember?) we use MCFileManager and MCImageManager as the file- and imagemanager for TinyMCE. The former &#8211; quite obviously &#8211; handles files and the latter images &#8230; but what about media &#8230; <a href="http://www.bram.us/2007/11/12/my-tinymce-mcfilemanagermcimagemanager-trick-when-media-is-file-not-image-or-vice-versa/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img alt="TinyMCE Logo" id="image250" style="margin: 0px 10px 5px 0px; display: block; float: left" src="http://www.bram.us/wordpress/wp-content/uploads/2006/10/tinymce_logo.jpg" />At <a href="http://www.netlash.com/">work</a> (I switched <em>fulltime</em> jobs a little while ago, <a href="http://www.bram.us/2007/09/19/my-changes-of-life/">remember</a>?) we use <a href="http://tinymce.moxiecode.com/paypal/item_filemanager.php">MCFileManager</a> and <a href="http://tinymce.moxiecode.com/paypal/item_imagemanager.php">MCImageManager</a> as the file- and imagemanager for <a href="http://tinymce.moxiecode.com/">TinyMCE</a>. The former &#8211; quite obviously &#8211; handles files and the latter images &#8230; but what about media (flash, quicktime, etc.)? At work MCImageManager popped up for managing media, yet we wanted MCFileManager to kick in &#8230; <strong>*BOOM*</strong> the start of an investigation to making MCFileManager handle media files.<br style="clear: both;" /></p>
<p><span id="more-1148"></span></p>
<p class="alert"><strong>WARNING</strong>: This post is written for MCImageManager and MCFileManager 3.0.2. As of version 3.0.5 of these plugins, <a href="http://wiki.moxiecode.com/index.php/MCFileManager:TinyMCE_Options/filemanager_handle">this is configurable through the TinyMCE Config</a></p>
<h2>All.your.sourcecode.are.belong.to.bram.us!</h2>
<div class="BramusBlock">
<p>As I hadn&#8217;t worked with MCFileManager nor MCImageManager before I dove into the sourcecode of the plugins to see what is happening when each plugin is loaded. Turns out the plugins were written to <em>play nice</em> when used <strong>together</strong>. In laymens terms it comes down to this:</p>
<ul>
<li>The MCFileManager plugin it basically states: <em>If it&#8217;s an image and MCImageManager is loaded: use MCImageManager to handle the image; else (viz. file <em>or media</em>) use me</em><br />(<code>@see Line #50 of filemanager/js/mcfilemanager.js</code>)</li>
<li>The MCImageManager plugin states: <em>If it&#8217;s a file and MCFileManager is loaded: used MCFileManager to handle the file; else (viz. image <em>or media</em>), use me.</em><br />(<code>@see Line #50 of imagemanager/js/mcimagemanager.js</code>)</li>
</ul>
</div>
<h2>The Quick Fix</h2>
<div class="BramusBlock">
<p>The quick fix would be to edit <code>imagemanager/js/mcimagemanager.js</code>, to make it so that media is passed to MCFileManager. As I don&#8217;t like modding the sourcecode of an existing plugin because that would make upgrading a pain in the ass, I continued my quest to finding an elegant solution as the two statements above gave me an opening into tricking the plugins which one would load what.</p>
</div>
<h2>Can I kick it? Yes you can!</h2>
<div class="BramusBlock">
<p>The opening lies in the fact that both plugins can handle media. Given this I quickly looked at the config we use, right where the plugins are loaded. There I found:</p>
<pre class="brush: jscript; title: ; notranslate">tinyMCE.init({
	...
	plugins : &quot;inlinepopups,filemanager,imagemanager,paste,contextmenu,media,bramus_cssextras&quot;,
	...
});</pre>
<p>(<em>yes, <a href="http://www.netlash.com/">Netlash</a> was already using <code><a href="http://www.bram.us/projects/tinymce-plugins/tinymce-classes-and-ids-plugin-bramus_cssextras/">bramus_cssextras</a></code> even when I wasn&#8217;t working there yet <img src='http://www.bram.us/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </em>).</p>
<p>So where&#8217;s the problem? That line quite obviously <strong>loads MCFileManager first</strong> which states that MCImageManager should be used when it&#8217;s an image, right? Right, but <strong>not 100% right</strong> &#8230;</p>
</div>
<h2>1 background, 2 scenarios</h2>
<div class="BramusBlock">
<p>TinyMCE loads the plugins in serial mode: one by one (viz. the one after the other). If (for example) the first plugin loaded states that the variable <code>window.myVar</code> equals 100; and the second plugin loaded states that it&#8217;s 200, <strong>one will end up with <code>window.myVar</code> being equal to 200</strong>. Given that as a background, we end up with 2 scenarios:</p>
<h3>Scenario A: filemanager, imagemanager</h3>
<p>The first scenario is the one where MCFileManager is loaded first (viz. its <code>init</code> function is executed first), and then MCImageManager. In code that reads:</p>
<pre class="brush: jscript; title: ; notranslate">tinyMCE.init({
	...
	plugins : &quot;filemanager,imagemanager&quot;,
	...
});</pre>
<p>Now, when clicking on the browse button when placing a link, an image or media, MCImageManager is executed first as it was loaded last (flash back to the background I wrote above). MCImageManager will tell to use MCFileManager if it&#8217;s a file, and continue working if it&#8217;s something else (an image or media).</p>
<h3>Scenario B: imagemanager, filemanager</h3>
<p>The second scenario is the one where MCImageManager is loaded first (viz. its <code>init</code> function is executed first), and then MCFileManager. In code that reads:</p>
<pre class="brush: jscript; title: ; notranslate">tinyMCE.init({
	...
	plugins : &quot;imagemanager,filemanager&quot;,
	...
});</pre>
<p>Now, when clicking on the browse button when placing a link, an image or media, MCFileManager is executed first as it was loaded last. MCFileManager will tell to use MCImageManager if it&#8217;s an image, and continue working if it&#8217;s something else (a file or media).</p>
</div>
<h2>Scenario Matrix</h2>
<div class="BramusBlock">
<p>Translating the above into a little table, we end up with this nice &ldquo;scenario matrix&rdquo;:</p>
<table>
<thead>
<tr>
<th>What is loaded?</th>
<th>Scenario A</th>
<th>Scenario B</th>
</tr>
</thead>
<tbody>
<tr>
<td>file</td>
<td>MCFileManager</td>
<td>MCFileManager</td>
</tr>
<tr>
<td>img</td>
<td>MCImageManager</td>
<td>MCImageManager</td>
</tr>
<tr>
<td>media</td>
<td>MCImageManager</td>
<td>MCFileManager</td>
</tr>
</tbody>
</table>
<p>Yes, it&#8217;s the last row that&#8217;s most important of it all <img src='http://www.bram.us/wordpress/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
</div>
<h2>Summarizing it all</h2>
<div class="BramusBlock">
<p>In order to <strong>use MCImageManager to handle media</strong>, init the plugins like this:</p>
<pre class="brush: jscript; title: ; notranslate">tinyMCE.init({
	...
	plugins : &quot;filemanager,imagemanager&quot;,
	...
});</pre>
<p>In order to <strong>use MCFileManager to handle media</strong>, init the plugins like this:</p>
<pre class="brush: jscript; title: ; notranslate">tinyMCE.init({
	...
	plugins : &quot;imagemanager,filemanager&quot;,
	...
});</pre>
</div>
<p>Happy coding!</p>
<p>B!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bram.us/2007/11/12/my-tinymce-mcfilemanagermcimagemanager-trick-when-media-is-file-not-image-or-vice-versa/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TinyMCE CSS Classes and IDs Plugin : bramus_cssextras 0.4.0 released!</title>
		<link>http://www.bram.us/2007/09/10/tinymce-css-classes-and-ids-plugin-bramus_cssextras-040-released/</link>
		<comments>http://www.bram.us/2007/09/10/tinymce-css-classes-and-ids-plugin-bramus_cssextras-040-released/#comments</comments>
		<pubDate>Mon, 10 Sep 2007 13:57:01 +0000</pubDate>
		<dc:creator>Bramus!</dc:creator>
				<category><![CDATA[Bramus!]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[TinyMCE]]></category>
		<category><![CDATA[TinyMCE Plugins]]></category>
		<category><![CDATA[Webdevelopment]]></category>
		<guid isPermaLink="false">http://www.bram.us/2007/09/10/tinymce-css-classes-and-ids-plugin-bramus_cssextras-040-released/</guid>
		<description><![CDATA[bramus_cssextras has made it to version 0.4.0! As announced, changes in this release are a tiny bugfix and autogeneration of the bramus_cssextras_classesstring and bramus_cssextras_idsstring (by loading in the specified content_css file over XHR (Ajax) and then lettings some regexes run &#8230; <a href="http://www.bram.us/2007/09/10/tinymce-css-classes-and-ids-plugin-bramus_cssextras-040-released/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img alt="TinyMCE Logo" id="image250e" style="margin: 0px 10px 5px 0px; display: block; float: left" src="http://www.bram.us/wordpress/wp-content/uploads/2006/10/tinymce_logo.jpg" /><a href="http://www.bram.us/projects/tinymce-plugins/tinymce-classes-and-ids-plugin-bramus_cssextras/"><code>bramus_cssextras</code></a> has made it to <a href="http://www.bram.us/projects/tinymce-plugins/tinymce-classes-and-ids-plugin-bramus_cssextras/#download">version 0.4.0</a>! <a href="http://www.bram.us/2007/09/07/my-tinymce-classes-plugin-planned-updates/">As announced</a>, changes in this release are a <strong>tiny bugfix</strong> and autogeneration of the <code>bramus_cssextras_classesstring</code> and <code>bramus_cssextras_idsstring</code> <span style="color: #666;">(<em>by loading in the specified <code>content_css</code> file over XHR (Ajax) and then lettings some regexes run over its content</em>)</span>, making the hardest part of <a href="http://www.bram.us/projects/tinymce-plugins/tinymce-classes-and-ids-plugin-bramus_cssextras/#install_config">installing/configuring <code>bramus_cssextras</code></a> obsolete! How&#8217;s that for user experience? <img src='http://www.bram.us/wordpress/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' />  &#8211; <a href="http://www.bram.us/projects/tinymce-plugins/tinymce-classes-and-ids-plugin-bramus_cssextras/#download">Go Download</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bram.us/2007/09/10/tinymce-css-classes-and-ids-plugin-bramus_cssextras-040-released/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>My TinyMCE CSS Classes and Ids Plugin &#8211; Planned updates</title>
		<link>http://www.bram.us/2007/09/07/my-tinymce-classes-plugin-planned-updates/</link>
		<comments>http://www.bram.us/2007/09/07/my-tinymce-classes-plugin-planned-updates/#comments</comments>
		<pubDate>Fri, 07 Sep 2007 08:46:11 +0000</pubDate>
		<dc:creator>Bramus!</dc:creator>
				<category><![CDATA[Another Dailie]]></category>
		<category><![CDATA[Bramus!]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[TinyMCE]]></category>
		<category><![CDATA[TinyMCE Plugins]]></category>
		<category><![CDATA[Webdevelopment]]></category>
		<guid isPermaLink="false">http://www.bram.us/2007/09/07/my-tinymce-classes-plugin-planned-updates/</guid>
		<description><![CDATA[The hardest part of configuring bramus_cssextras is Building the bramus_cssextras_classesstring and bramus_cssextras_idsstring &#8230; now, wouldn&#8217;t it be cool to not having the create that list? Yesterday evening, while doing a little follow up on the comments posted here on bram.us &#8230; <a href="http://www.bram.us/2007/09/07/my-tinymce-classes-plugin-planned-updates/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img alt="TinyMCE Logo" id="image250d" style="margin: 0px 10px 5px 0px; display: block; float: left" src="http://www.bram.us/wordpress/wp-content/uploads/2006/10/tinymce_logo.jpg" />The hardest part of configuring <a href="http://www.bram.us/projects/tinymce-plugins/tinymce-classes-and-ids-plugin-bramus_cssextras/"><code>bramus_cssextras</code></a> is <a href="http://www.bram.us/projects/tinymce-plugins/tinymce-classes-and-ids-plugin-bramus_cssextras/#step3">Building the <code>bramus_cssextras_classesstring</code> and <code>bramus_cssextras_idsstring</code></a> &#8230; now, wouldn&#8217;t it be cool to not having the create that list?<br style="clear: both;" /></p>
<p><span id="more-1087"></span></p>
<p>Yesterday evening, while doing a little follow up on the comments posted here on bram.us I stumbled upon <a href="http://www.bram.us/projects/tinymce-plugins/tinymce-classes-and-ids-plugin-bramus_cssextras/#comment-78025">Michael&#8217;s comment</a> where he asks a likewise feature. In <a href="http://www.bram.us/projects/tinymce-plugins/tinymce-classes-and-ids-plugin-bramus_cssextras/#comment-80771">response</a> I mentioned that this only would be possible to load the content_css file over XHR (Ajax) and that &ldquo;<em>I might give it a spin</em>&rdquo; &#8230; <a href="http://www.bram.us/projects/tinymce-plugins/tinymce-classes-and-ids-plugin-bramus_cssextras/#comment-80817">One hour later</a>, this little <a href="http://www.bram.us/sandbox/bramus_cssextras_autogen/"><code>bramus_cssextras_autogen</code></a> script here popped up <img src='http://www.bram.us/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>The script was written &ldquo;<em>Quick and Dirty</em>&rdquo;, and (after having it polished a bit) will make it into the next release of <code>bramus_cssextras</code> (<em>version 0.4</em>) which will be <strong>somewhere next week</strong>.</p>
<p class="alert"><strong>UPDATE 2007.09.10</strong>: The changes described here <a href="http://www.bram.us/2007/09/10/tinymce-css-classes-and-ids-plugin-bramus_cssextras-040-released/">have been implemented</a> <img src='http://www.bram.us/wordpress/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.bram.us/2007/09/07/my-tinymce-classes-plugin-planned-updates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My Public Release &#8211; bramus_cssextras 0.3.2 released</title>
		<link>http://www.bram.us/2007/07/24/my-public-release-bramus_cssextras-032-released/</link>
		<comments>http://www.bram.us/2007/07/24/my-public-release-bramus_cssextras-032-released/#comments</comments>
		<pubDate>Tue, 24 Jul 2007 21:26:41 +0000</pubDate>
		<dc:creator>Bramus!</dc:creator>
				<category><![CDATA[Bramus!]]></category>
		<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[TinyMCE]]></category>
		<category><![CDATA[TinyMCE Plugins]]></category>
		<category><![CDATA[Webdevelopment]]></category>
		<category><![CDATA[usability]]></category>
		<guid isPermaLink="false">http://www.bram.us/2007/07/24/my-work-in-progress-bramus_cssextras-032-released/</guid>
		<description><![CDATA[A tiny post to inform you that bramus_cssextras, the TinyMCE CSS Classes and IDs Plugin made it to its first public release (version 0.3.2). Sure hope the documentation is clear, correct and above all complete (feel free to comment if &#8230; <a href="http://www.bram.us/2007/07/24/my-public-release-bramus_cssextras-032-released/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img alt="TinyMCE Logo" id="image250" style="margin: 0px 10px 5px 0px; display: block; float: left" src="http://www.bram.us/wordpress/wp-content/uploads/2006/10/tinymce_logo.jpg" />A tiny post to inform you that <a href="http://www.bram.us/projects/tinymce-plugins/tinymce-classes-and-ids-plugin-bramus_cssextras/"><code>bramus_cssextras</code>, the TinyMCE CSS Classes and IDs Plugin</a> made it to its first public release (version 0.3.2). Sure hope the documentation is clear, correct and above all complete (<em>feel free to comment if not</em>).<br style="clear: both;" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.bram.us/2007/07/24/my-public-release-bramus_cssextras-032-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My delay &#8211; bramus_classeslist is dead, long live bramus_cssextras!</title>
		<link>http://www.bram.us/2007/06/27/my-delay-bramus_classeslist-is-dead-long-live-bramus_cssextras/</link>
		<comments>http://www.bram.us/2007/06/27/my-delay-bramus_classeslist-is-dead-long-live-bramus_cssextras/#comments</comments>
		<pubDate>Wed, 27 Jun 2007 17:27:16 +0000</pubDate>
		<dc:creator>Bramus!</dc:creator>
				<category><![CDATA[Bramus!]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[TinyMCE]]></category>
		<category><![CDATA[TinyMCE Plugins]]></category>
		<category><![CDATA[Webdevelopment]]></category>
		<guid isPermaLink="false">http://www.bram.us/2007/06/27/my-delay-bramus_classeslist-is-dead-long-live-bramus_cssextras/</guid>
		<description><![CDATA[Just an update to tell you that I won&#8217;t make it to posting bramus_classeslist online by the end of the month, as I promised, since bramus_classeslist exist no more. Wait, there&#8217;s some good news too: bramus_classeslist has changed names to &#8230; <a href="http://www.bram.us/2007/06/27/my-delay-bramus_classeslist-is-dead-long-live-bramus_cssextras/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img alt="TinyMCE Logo" id="image250" style="margin: 0px 10px 5px 0px; display: block; float: left" src="http://www.bram.us/wordpress/wp-content/uploads/2006/10/tinymce_logo.jpg" />Just an update to tell you that I won&#8217;t make it to posting <code>bramus_classeslist</code> online by the end of the month, <a href="http://www.bram.us/2007/06/21/my-tinymce-classes-plugin-bramus_classeslist-the-missing-visual-link-between-the-front-and-backend/">as I promised</a>, since <code>bramus_classeslist</code> exist no more. Wait, there&#8217;s some good news too: <code>bramus_classeslist</code> has changed names to <code>bramus_cssextras</code> as its functionality has been extended to supporting the setting of <code>id</code> attributes on elements too, a quite obvious evolution.<br style="clear: both;" /></p>
<p><span id="more-848"></span></p>
<p>To summarize it: <strong><code>bramus_cssextras</code> is a TinyMCE plugin which extends TinyMCE&#8217;s functionality by providing the option to setting <code>class</code> and <code>id</code> attributes on any HTML element within TinyMCE, in a nice and easy way</strong>.</p>
<p>Hope you can wait &#8217;til July as writing documentation can be quite time-consuming <img src='http://www.bram.us/wordpress/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p class="alert"><strong>UPDATE</strong> <a href="http://www.bram.us/projects/tinymce-plugins/tinymce-classes-and-ids-plugin-bramus_cssextras/"><code>bramus_cssextras</code> has been released</a> by now <img src='http://www.bram.us/wordpress/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.bram.us/2007/06/27/my-delay-bramus_classeslist-is-dead-long-live-bramus_cssextras/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

