<?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 Plugins</title>
	<atom:link href="http://www.bram.us/category/projects/tinymce-plugins/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>Tue, 07 Feb 2012 23:13:58 +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 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.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>
		<item>
		<title>My TinyMCE Classes Plugin : bramus_classeslist : The missing (visual) link between the front- and backend</title>
		<link>http://www.bram.us/2007/06/21/my-tinymce-classes-plugin-bramus_classeslist-the-missing-visual-link-between-the-front-and-backend/</link>
		<comments>http://www.bram.us/2007/06/21/my-tinymce-classes-plugin-bramus_classeslist-the-missing-visual-link-between-the-front-and-backend/#comments</comments>
		<pubDate>Wed, 20 Jun 2007 23:34:38 +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/06/21/my-tinymce-classes-plugin-bramus_classeslist-the-missing-visual-link-between-the-front-and-backend/</guid>
		<description><![CDATA[When writing a backend for a site combined with TinyMCE I&#8217;ve always found it a big hassle to visually link the content of the editor with the content of the actual site. Yeah yeah, there exists something like a content_css &#8230; <a href="http://www.bram.us/2007/06/21/my-tinymce-classes-plugin-bramus_classeslist-the-missing-visual-link-between-the-front-and-backend/">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" />When writing a backend for a site combined with TinyMCE I&#8217;ve always found it a big hassle to visually link the content of the editor with the content of the actual site. Yeah yeah, there exists something like a <a href="http://wiki.moxiecode.com/index.php/TinyMCE:Configuration/content_css"><code>content_css</code> setting</a> but that&#8217;s not really it as the options are limited. Fed up with this I decided to crank a nifty plugin out of my fingers &#8230;<br style="clear: both;" /></p>
<p><span id="more-811"></span></p>
<h3>All your styles are belong to content_css!</h3>
<div class="BramusBlock">
<p>With the <code>content_css</code> setting one can actually set some styles on default elements. Font-size and line-height for paragraphs, bullets for the lists, colors for the headings, etc. When adding classes to that CSS file, TinyMCE will be smart enough to parse them out and add them to the styles dropdown lists in some plugins their dialogue window (the link and image dialogue for example).</p>
<p style="text-align: center; font-size: smaller;"><img id="image823" src="http://www.bram.us/wordpress/wp-content/uploads/2007/06/dialogue.jpg" alt="dialogue.jpg" /><br />Classes are parsed indeed &#8230; but those are classed meant for paragraphs and lists &#8230; :S</p>
<p>Yes, that&#8217;s a real nice start to visually linking the front- and backend of your site/app &#8230; but what when you want to provide some classes on non-link and non-image elements? What if you happen to have a class <code>introText</code> for your <code>p</code> elements? Or what if you have different classes for <code>ul</code> elements? How to add them without diving into the sourcecode? And what about that darn <em>bug</em> which allows one to add classes to links and images, even if the selector states that it&#8217;s for paragraphs only?!</p>
</div>
<h3>Time for some action!</h3>
<div class="BramusBlock">
<p>Given this problem I&#8217;ve been taking from project to project I finally was fed up with it I could take it no longer. One can of Coca-Cola (the non-diet version of course) and 15 minutes later the solution was there: <strong>write a plugin that takes a string which defines all allowed classes on certain elements and automatically enables the user to select one of those classes from a dropdown list when that element is selected within the editor</strong>. Easy, not? Easy indeed if I say so myself, as it&#8217;s not the first time I&#8217;ve written a plugin for TinyMCE (<em>Note to self: have to write about that one any time soon &#8230;</em>) <strong>and</strong> the <a href="http://wiki.moxiecode.com/index.php/TinyMCE:Index">TinyMCE Wiki</a> holds <a href="http://wiki.moxiecode.com/index.php/TinyMCE:Creating_Plugin">a very nice article on writing your own TinyMCE plugins</a> <strong>and</strong> the <a href="http://tinymce.moxiecode.com/tinymce/docs/tinymce_api/">TinyMCE API</a> is one big treasurechest!</p>
<p style="text-align: center; font-size: smaller;"><img id="image824" src="http://www.bram.us/wordpress/wp-content/uploads/2007/06/coke_can.jpg" alt="coke_can.jpg" /><br />Aaah, a Classic Coke!</p>
<p>First I thought of a simple string which holds all the info needed and which gets passed to the plugin. Format of that string is: &ldquo;<em>a semi-colon delimited string holding each element and its possible classes, separated by a comma between two square brackets</em>&rdquo;:</p>
<p><code>element1[class1_1,class1_2,class1_3];element2[class2_1];element3[class3_1,class3_2]</code></p>
<p>But then it hit me: what about list items? I don&#8217;t want to add class definitions to each list item individually, but to the full list. And when I&#8217;m using the editor the selected element will be the <code>li</code> itself, not the <code>ul</code>!</p>
<p>One braintwist later, the fix already was there: make it so that the string passed into the plugin contains this sequence of descendants. Not wanting to rely on the CSS Descendant Selector &#8211; which is a space &#8211; and not wanting to depend on the CSS Direct Child selector I decided to use a double colon for this as it would only confuse the user as they are no real selectors but logic structural xhtml sequences (an <code>li</code> always is inside an <code>ul</code>; why would you want to set the class of a <code>p</code> element to something special when you&#8217;ve got a <code>strong</code> element inside that <code>p</code> element selected?). Given this, the string passed into the plugin got changed to this:</p>
<p><code>element1::parentElementOfElement1[class1_1,class1_2,class1_3];element2::parentElementOfElement2[class2_1];element3::parentElementOfElement3[class3_1,class3_2]</code></p>
<p>For elements that do not rely on a parentElement I&#8217;ve decided to use <code>self</code> as the parentElementNodeName</p>
<p>A real life example would be:</p>
<p><code>li::ul[regular,regularLinks,regularLarge];p::self[articleStart];img::self[left,right]</code></p>
<p>The string above lets you &#8211; when passed into the plugin I&#8217;ve written &#8211; to set <code>regular</code> &amp; <code>regularLinks</code> &amp; <code>regularLarge</code> as className on <code>ul</code> elements (yet an <code>li</code> element will be the current selected node inside the editor), <code>articleStart</code> as className on <code>p</code> elements and <code>left</code> &amp; <code>right</code> as className on <code>img</code> elements</p>
</div>
<h3>Nice idea &#8230; but does it work?</h3>
<div class="BramusBlock">
<p>With the worked out idea in my head (and on paper, I tend to write stuff down when brainstorming) I was ready to make the catch of the day.</p>
<p style="text-align: center; font-size: smaller;"><img id="image812" src="http://www.bram.us/wordpress/wp-content/uploads/2007/06/catch_of_the_day.jpg" alt="Catch of the day!" /></p>
<p>Won&#8217;t go into details on the code here, but what I can tell you is that:</p>
<ul>
<li>The <a href="http://wiki.moxiecode.com/index.php/TinyMCE:Index">TinyMCE Wiki</a> is helpful, even when writing plugins.</li>
<li>The <a href="http://tinymce.moxiecode.com/tinymce/docs/tinymce_api/">TinyMCE API</a> is a goldmine, waiting to get dugg out</li>
<li>The source code of some of the default TinyMCE plugins are great studymaterials</li>
<li><a href="http://www.getfirebug.com/">FireBug</a> has and always will be necessary</li>
<li>The <code>initInstance()</code> function gets called for each loaded TinyMCE instance &#8230; be sure to not refill the same data over and over (as the plugin is loaded once, it&#8217;s easy to do a check if a private value is null (not inited yet: <code>build var)</code> or not (already inited: <code>return;</code>)</li>
<li>Don&#8217;t forget to assign unique ids to you elements you&#8217;re returning throug the <code>getControlHTML()</code> function. You can use <code>{$editor_id}</code> to enforce this.</li>
</ul>
</div>
<h3>We want code!</h3>
<div class="BramusBlock">
<p>As the code still is being tested heavily, and some documentation is being prepped, you&#8217;ll have to wait until the end of June (2007 that is) for the code to appear on the <a href="http://www.bram.us/projects/tinymce-plugins/">TinyMCE Plugins Page I&#8217;ve created right here at bram.us</a> &#8230; yes I know, you&#8217;ll have to wait for it, but I just couldn&#8217;t keep you from learning about this plugin <img src='http://www.bram.us/wordpress/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>In the mean time, some screenshots though (<em>look at both dropdowns along with the statusbar</em>) <img src='http://www.bram.us/wordpress/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p style="text-align: center; font-size: smaller;"><img id="image816" src="http://www.bram.us/wordpress/wp-content/uploads/2007/06/edit_001.jpg" alt="edit_001.jpg" /></p>
<p style="text-align: center; font-size: smaller;"><img id="image817" src="http://www.bram.us/wordpress/wp-content/uploads/2007/06/edit_002.jpg" alt="edit_002.jpg" /></p>
<p style="text-align: center; font-size: smaller;"><img id="image818" src="http://www.bram.us/wordpress/wp-content/uploads/2007/06/edit_003.jpg" alt="edit_003.jpg" /></p>
<p style="text-align: center; font-size: smaller;"><img id="image819" src="http://www.bram.us/wordpress/wp-content/uploads/2007/06/edit_004.jpg" alt="edit_004.jpg" /></p>
<p style="text-align: center; font-size: smaller;"><img id="image820" src="http://www.bram.us/wordpress/wp-content/uploads/2007/06/edit_005.jpg" alt="edit_005.jpg" /></p>
<p style="text-align: center; font-size: smaller;"><img id="image821" src="http://www.bram.us/wordpress/wp-content/uploads/2007/06/edit_006.jpg" alt="edit_006.jpg" /></p>
<p style="text-align: center; font-size: smaller;"><img id="image822" src="http://www.bram.us/wordpress/wp-content/uploads/2007/06/edit_007.jpg" alt="edit_007.jpg" /></p>
<p style="text-align: center; font-size: smaller;"><img id="image825" src="http://www.bram.us/wordpress/wp-content/uploads/2007/06/edit_008.jpg" alt="edit_008.jpg" /></p>
</div>
<p>Peace y&#8217;all &#8230; and don&#8217;t forget to check back by the end of June <img src='http://www.bram.us/wordpress/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p class="alert">UPDATE 2007.06.27 : <a href="http://www.bram.us/2007/06/27/my-delay-bramus_classeslist-is-dead-long-live-bramus_cssextras/" title=""><code>bramus_classeslist</code> is dead and &#8211; <em>even before it was ever released</em> &#8211; got replaced by <code>bramus_cssextras</code>!</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/06/21/my-tinymce-classes-plugin-bramus_classeslist-the-missing-visual-link-between-the-front-and-backend/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

