<?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>delusionworld blog</title>
	<atom:link href="http://www.delusionworld.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.delusionworld.com</link>
	<description>my MooTools, TYPO3 and FLOW3 experiences</description>
	<lastBuildDate>Fri, 24 Jun 2011 21:22:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>Getting Started with TYPO3v5 Phoenix (on Windows)</title>
		<link>http://www.delusionworld.com/typo3/getting-started-with-typo3v5-phoenix-on-windows/</link>
		<comments>http://www.delusionworld.com/typo3/getting-started-with-typo3v5-phoenix-on-windows/#comments</comments>
		<pubDate>Fri, 24 Jun 2011 10:56:42 +0000</pubDate>
		<dc:creator>daKmoR</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[TYPO3]]></category>
		<category><![CDATA[WebDevelopment]]></category>
		<category><![CDATA[getting started]]></category>
		<category><![CDATA[phoenix]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[typo3v5]]></category>

		<guid isPermaLink="false">http://www.delusionworld.com/?p=166</guid>
		<description><![CDATA[2.1 Requirements PHP 5.3.3 or newer (but not PHP 6) Modules: mbstring, pdo_sqlite Configuration: magic_quotes_gpc = off Apache Apache modules: mod_rewrite Apache configuration: AllowOverride FileInfo # If you don&#8217;t have running setup for this I would recommend xampp =&#62; http://www.apachefriends.org/en/xampp-windows.html # I&#8217;m for example just had to update to the latest version which comes with [...]]]></description>
			<content:encoded><![CDATA[<p><strong>2.1 Requirements</strong></p>
<ul>
<li>PHP 5.3.3 or newer (but not PHP 6)
<ul>
<li>Modules: mbstring, pdo_sqlite</li>
<li>Configuration: magic_quotes_gpc = off</li>
</ul>
</li>
<li>Apache
<ul>
<li>Apache modules: mod_rewrite</li>
<li>Apache configuration: AllowOverride FileInfo</li>
</ul>
</li>
</ul>
<p># If you don&#8217;t have running setup for this I would recommend xampp =&gt; <a href="http://www.apachefriends.org/en/xampp-windows.html">http://www.apachefriends.org/en/xampp-windows.html</a></p>
<p># I&#8217;m for example just had to update to the latest version which comes with PHP 5.3.5</p>
<p><strong>2.2 Getting TYPO3 Phoenix Files</strong></p>
<p><strong>2.2.1 Git</strong></p>
<p># you need an installed git for this &#8211; I would recommend cygwin (<a href="http://www.cygwin.com/">http://www.cygwin.com/</a>)</p>
<p># an alternative is msysgit (<a href="http://code.google.com/p/msysgit/">http://code.google.com/p/msysgit/</a>)</p>
<p>Go to your htdocs directory (in my case D:/www) and execute the following commands:</p>
<p><code>git clone --recursive git://git.typo3.org/TYPO3v5/Distributions/Base.git TYPO3v5<br />
cd TYPO3v5<br />
git submodule foreach 'git checkout master; git pull'</code></p>
<p><strong>2.2.2 Bash Files (Windows only)</strong></p>
<p>Furthermore you need the two bat files for Windows &#8211; you get them here<br />
<a href="http://forge.typo3.org/issues/show/4426"> http://forge.typo3.org/issues/show/4426</a><br />
or as direct link as<br />
<a href="http://forge.typo3.org/attachments/17838/flow3.bat"> http://forge.typo3.org/attachments/17838/flow3.bat</a><br />
<a href="http://forge.typo3.org/attachments/17839/flow3_dev.bat"> http://forge.typo3.org/attachments/17839/flow3_dev.bat</a></p>
<p>you need to place these two bat files into the TYPO3v5 folder and modify the &#8220;php&#8221; line&#8230; in my case it was<br />
<code>- SET PHP=php.exe<br />
+ SET PHP=D:/Applications/xampp/php/php.exe -c D:/Applications/xampp/php/php.ini</code></p>
<p><strong>2.2.3 Symlinks (Windows only)</strong></p>
<p style="text-align: center;"><a href="http://www.delusionworld.com/wp-content/uploads/2011/06/SymbolicLinks.jpg"><img class="size-medium wp-image-169 aligncenter" title="SymbolicLinks" src="http://www.delusionworld.com/wp-content/uploads/2011/06/SymbolicLinks-300x236.jpg" alt="" width="300" height="236" /></a></p>
<p># in order to use Symlinks with Windows you need the Link Shell Extension (<a href="http://schinagl.priv.at/nt/hardlinkshellext/hardlinkshellext.html">http://schinagl.priv.at/nt/hardlinkshellext/hardlinkshellext.html</a>)</p>
<p>You need to replace the two textfile flow3 and flow3_dev with real symlinks</p>
<p>flow3     =&gt; Packages/Framework/FLOW3/Scripts/flow3<br />
flow3_dev =&gt; Packages/Framework/FLOW3/Scripts/flow3_dev</p>
<p># I just deleted the two files and created the symbolic links like in the screenshot</p>
<p><strong>2.3. Installation of TYPO3 Phoenix</strong></p>
<p>Finally as you got all the needed files in the right places you can actually install TYPO3 Phoenix.</p>
<p># If at any point you changed some settings but it won&#8217;t take them try clearing the cache with the following command inside the TYPO3v5 folder<br />
<code>flow3_dev flow3:cache:flush</code></p>
<p># for me it looks like this<br />
# D:\www\TYPO3v5&gt;flow3_dev flow3:cache:flush<br />
# Flushed all caches.</p>
<p>1) rename Configuration/Settings.yaml.example to Settings.yaml<br />
# you can adjust your mysql settings here, but we just leave it to the default as we have those settings</p>
<p>2) uncomment the following two lines and adopt the path for the php Binary inside Settings.yaml<br />
<code>#  core:<br />
#    phpBinaryPathAndFilename: 'D:/Applications/xampp/php/php.exe'</code></p>
<p>3) create Database &#8220;phoenix&#8221; for user root<br />
# I used phpmyadmin for this; Doctrine will automatically create the tables for you</p>
<p>4) Exceute the following command inside the TYPO3v5 folder to import the demo page<br />
<code>flow3_dev typo3:site:import &lt; Packages/Sites/PhoenixDemoTypo3Org/Resources/Private/Content/Sites.xml</code></p>
<p>5) Exceute the following command inside the TYPO3v5 folder to create an admin user with the password &#8220;password&#8221;<br />
<code>echo admin#password | flow3_dev typo3:setup:createAdministrator</code></p>
<p># you can just skip this, as on the demo page you can simple create a demo use with one click</p>
<p>6) hit your Browser with http://localhost/TYPO3v5/Web/</p>
<p>As a Note: It is highly recommended to change the document root of the webserver to the Web subfolder of the distribution!<br />
(we just skipped this step as it would need to modify the hosts file create a vhost etc&#8230; for a &#8220;real&#8221; page you should definitely do this)</p>
<p>Another Note: TYPO3v5 currently seems to have some problems with the backend if you install it in a subdirectory AND open it from the root page&#8230; so just open the BE from a subpage then it works just fine <img src='http://www.delusionworld.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>2.3.1 keep in synch with git changes</strong></p>
<p>Exceute the following commands inside the TYPO3v5 folder<br />
<code>git pull<br />
git submodule foreach 'git checkout master; git pull'</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.delusionworld.com/typo3/getting-started-with-typo3v5-phoenix-on-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fluid translate with link</title>
		<link>http://www.delusionworld.com/typo3/fluid/fluid-translate-with-link/</link>
		<comments>http://www.delusionworld.com/typo3/fluid/fluid-translate-with-link/#comments</comments>
		<pubDate>Fri, 06 May 2011 15:19:37 +0000</pubDate>
		<dc:creator>daKmoR</dc:creator>
				<category><![CDATA[Fluid]]></category>

		<guid isPermaLink="false">http://www.delusionworld.com/?p=158</guid>
		<description><![CDATA[If you want to translate some text with Fluid it&#8217;s easy. Just use the translate view Helper. Sometimes it even better to have some &#8220;markers&#8221; inside the translation so you won&#8217;t loose the context. The following example shows how you can insert a translated link inside a translation (quite sick &#8211; I know&#8230;) &#60;f:translate key=&#34;text&#34; [...]]]></description>
			<content:encoded><![CDATA[<p>If you want to translate some text with Fluid it&#8217;s easy. Just use the translate view Helper. Sometimes it even better to have some &#8220;markers&#8221; inside the translation so you won&#8217;t loose the context.<br />
The following example shows how you can insert a translated link inside a translation (quite sick &#8211; I know&#8230;)</p>
<pre class="brush: xml; title: ;">
&lt;f:translate key=&quot;text&quot; htmlEscape=&quot;false&quot; arguments=&quot;{0: '{f:translate(key: \'here\') -&gt; f:link.action(action: \'show\')}'}&quot; /&gt;
//locallang.xml
&lt;label index=&quot;here&quot;&gt;this link&lt;/label&gt;
&lt;label index=&quot;text&quot;&gt;You can use %1$s to register.&lt;/label&gt;
//output will be: You can use &lt;a href=&quot;...&quot;&gt;this link&lt;/a&gt; to register.
</pre>
<p>The following code would also work but it&#8217;s much harder for the translators to understand what each label means.</p>
<pre class="brush: xml; title: ;">
&lt;f:translate key=&quot;text_pre&quot; /&gt;
&lt;f:link.action action=&quot;show&quot; /&gt;&lt;f:translate key=&quot;here&quot; /&gt;&lt;/f:link&gt;
&lt;f:translate key=&quot;text_post&quot; /&gt;
//locallang.xml
&lt;label index=&quot;here&quot;&gt;this link&lt;/label&gt;
&lt;label index=&quot;text_pre&quot;&gt;You can use &lt;/label&gt;
&lt;label index=&quot;text_post&quot;&gt; to register.&lt;/label&gt;
//output will be: You can use &lt;a href=&quot;...&quot;&gt;this link&lt;/a&gt; to register.
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.delusionworld.com/typo3/fluid/fluid-translate-with-link/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>cross browser shadows and fonts with css only</title>
		<link>http://www.delusionworld.com/webdev/cross-browser-shadows-and-fonts-with-css-only/</link>
		<comments>http://www.delusionworld.com/webdev/cross-browser-shadows-and-fonts-with-css-only/#comments</comments>
		<pubDate>Sun, 01 Nov 2009 11:57:18 +0000</pubDate>
		<dc:creator>daKmoR</dc:creator>
				<category><![CDATA[WebDev]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[fonts]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[shadow]]></category>

		<guid isPermaLink="false">http://www.delusionworld.com/?p=144</guid>
		<description><![CDATA[cross browser css only shadow If you are like me you probably have have seen a million ways of implementing shadows but none seems really serious. I mean there are quite fancy ways of archiving it. You can use a lot of pictures and wrap the content in a lot of divs. You can use [...]]]></description>
			<content:encoded><![CDATA[<h2>cross browser css only shadow</h2>
<p>If you are like me you probably have have seen a million ways of implementing shadows but none seems really serious. I mean there are quite fancy ways of archiving it. You can use a lot of pictures and wrap the content in a lot of divs. You can use javascript to generate millions of spans/divs to display a smooth shadow with html elements and css colors. You can use canvas (all browser except IE) and VML (IE) for this. And I guess there are even more crazy ways of archiving this.</p>
<p>AS you probably have guessed all these methods are fare from being perfect and pretty complicated to use compared to a css only solution. I&#8217;m really surprised that I haven&#8217;t seen this solution anywhere else in all my researches.</p>
<p>So how does it work. It&#8217;s simple as hell &#8211; it&#8217;s just css!!</p>
<pre class="brush: css; title: ;">
/* the following shadow works in IE5.5-8, FF2-3, Safari3, Chrome */
.shadow {
	box-shadow: 3px 5px 6px #888;
	-moz-box-shadow: 3px 5px 6px #888;
	-webkit-box-shadow: 3px 5px 6px #888;
	filter:progid:DXImageTransform.Microsoft.Shadow(color=#888888, direction=135, strength=7);
}
</pre>
<p>Using that you get a nice shadow in all browser you currently need (means IE, FF, Safari, Chrome). The IE shadow probably looks a little different however it still way better than no shadow or any fancy above solution (in my opinion).<br />
Make sure to check out the <a href="http://www.delusionworld.com/files/cross-browser-shadows-and-fonts-with-css-only/cssOnlyShadow.html"><strong>DEMO</strong></a>.</p>
<p>Here is comparison between the css only shadows in IE and the rest:<br />
<a href="http://www.delusionworld.com/wp-content/uploads/2009/10/cssOnlyShadowComparision.jpg"><img src="http://www.delusionworld.com/wp-content/uploads/2009/10/cssOnlyShadowComparision.jpg" alt="cssOnlyShadowComparision" title="cssOnlyShadowComparision" width="574" height="484" class="alignleft size-full wp-image-150" /></a></p>
<h2>cross browser css only fonts</h2>
<p>Yet again a quite hard to believe mystery. I always thought that using custom fonts on my webpage is next to impossible. And looking at some quite complex technical solutions like:</p>
<ul>
<li><a href="http://cufon.shoqolate.com/generate/">cufon</a> [generates canvas/VML]</li>
<li><a href="http://facelift.mawhorter.net/">facelift</a> [generates images]</li>
<li><a href="http://novemberborn.net/sifr">sifr</a> [generates flash]</li>
</ul>
<p>I was pretty sure there was no easy solution to this problem. Guess what I just found a &#8220;css only&#8221; solution. </p>
<p>All you need is a *.eot (IE) and a *.ttf (rest) file of your desired font. You can get a bunch of fonts in these formats at <a href="http://www.fontsquirrel.com/">http://www.fontsquirrel.com/</a>. All fonts you can find there are 100% free for commercial use. If you want to use a non free front where you can&#8217;t get those 2 required formats you can still use on of the above methods.<br />
After you have those two files you simple need to add this css</p>
<pre class="brush: css; title: ;">
/* get fonts from: http://www.fontsquirrel.com/ */

@font-face {
	font-family: 'Bloody Normal';
	/* IE */
	src: url('fonts/BLOODY.eot');
	/* for other Browser you can define multiple formats but usually truetype alone is enough */
	src: local('Bloody Normal'), local('Bloody'),
		url('fonts/BLOODY.woff') format('woff'),
		url('fonts/BLOODY.svg#Bloody') format('svg'),
		url('fonts/BLOODY.TTF') format('truetype');
}

@font-face {
	font-family: 'Droid Sans Regular';
	src: url('fonts/DroidSans.eot');
	src: local('Droid Sans Regular'), url('fonts/DroidSans.ttf') format('truetype');
}

h1 { font-family: 'Bloody Normal'; }
</pre>
<p>Now you can use the font in your css as with the above H1 or you can use it inline with</p>
<pre class="brush: xml; title: ;">
&lt;p style=&quot;font-family: 'Droid Sans Regular';&quot;&gt;
</pre>
<p>This method works again in all tested browsers (Firefox, Internet Explorer, Safari, Chrome).</p>
<p>Just check out the <a href="http://www.delusionworld.com/files/cross-browser-shadows-and-fonts-with-css-only/cssOnlyFont.html"><strong>DEMO</strong></a>.</p>
<h2>Conclusion</h2>
<p>The here provides solutions for shadows and fonts are extremely easy to use and don&#8217;t need any complex technical &#8220;workaround&#8221;. It&#8217;s just pure CSS (with specific CSS for each browser group) and still works in all current browsers you need (Firefox, IE, Safari, Chrome). I&#8217;m still really surprised to never have heard from this before. Life would have been so much easier if I knew this a year ago. Funny thing is that these solutions work in browser far older than a year. So this solutions could have been used a long time ago but I have never seen it before.</p>
<p>What do you think about these solutions? why aren&#8217;t they being used? do people simple don&#8217;t know them or is there any problem I didn&#8217;t stumbled upon?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.delusionworld.com/webdev/cross-browser-shadows-and-fonts-with-css-only/feed/</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
		<item>
		<title>use MooTools in TYPO3 with MPR</title>
		<link>http://www.delusionworld.com/mootools/use-mootools-in-typo3-with-mpr/</link>
		<comments>http://www.delusionworld.com/mootools/use-mootools-in-typo3-with-mpr/#comments</comments>
		<pubDate>Fri, 31 Jul 2009 22:23:54 +0000</pubDate>
		<dc:creator>daKmoR</dc:creator>
				<category><![CDATA[MooTools]]></category>
		<category><![CDATA[TYPO3]]></category>

		<guid isPermaLink="false">http://www.delusionworld.com/?p=128</guid>
		<description><![CDATA[Finally I can present you the combination of my two favorite Open Source Worlds. Meaning MooTools and TYPO3. MPM comes with a nice TYPO3 Mod where you can look through all the currently installed MooTools Packages with Demos, Doku, Search&#8230; all you need to get it working quite fast So let&#8217;s talk about the reason&#8230; [...]]]></description>
			<content:encoded><![CDATA[<p>Finally I can present you the combination of my two favorite Open Source Worlds. Meaning <strong>MooTools </strong>and <strong>TYPO3</strong>.</p>
<p>MPM comes with a nice TYPO3 Mod where you can look through all the currently installed MooTools Packages with Demos, Doku, Search&#8230; all you need to get it working quite fast <img src='http://www.delusionworld.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
<a href="http://www.delusionworld.com/wp-content/uploads/2009/07/MPRinTYPO3.png"><img src="http://www.delusionworld.com/wp-content/uploads/2009/07/MPRinTYPO3-300x189.png" alt="MPRinTYPO3" title="MPRinTYPO3" width="300" height="189" class="alignleft size-medium wp-image-138" style="border: 4px solid #eee;" /></a></p>
<p>So let&#8217;s talk about the <strong>reason</strong>&#8230; I mean I&#8217;m a pretty lazy guy. I don&#8217;t like to do stuff manually if there is any possibility to do it with some sort of automatism. And working on a big TYPO3 site with <strong>multiple MooTools Plugins</strong> can be quite a <strong>pain in the ass</strong>. Every Plugins has it&#8217;s <strong>own MooTools version</strong> and tries to include it. They (usually) don&#8217;t share a common library or don&#8217;t want to require other extensions. I can understand that but it makes my life sometimes harder&#8230; and that&#8217;s something I don&#8217;t like.</p>
<p>So here we come <strong>MPR </strong>as an <strong>TYPO3 extension</strong>. Using MooTools whenever you want to &#8211; no need to think about dependencies or graphics and that stuff.</p>
<div style="background: #eee; font-size: 10px; padding: 5px;">First I wanna say I don&#8217;t want to offend the authors of rgsmoothscroll &#8211; back then it was the best/only way to include MooTools stuff, but now with good use of MPR it could be much easier.</div>
<p>Let&#8217;s see a simple <strong>example</strong>. Maybe you know the extension <strong>rgsmoothscroll </strong>it gives you the smooth scrolling experience for anchor links within one page. It uses the Plugin SmoothScroll (now <strong>Fx.SmoothScroll</strong>) from MooTools More. You can seen an example of it at the <a href="http://mpm.mooforum.net/Mpm.php?mode=demo&#038;file=../mpr/More/Fx/Demos/Fx.SmoothScroll.html">MPR demo page</a> or in your TYPO3 BE Mod (see Screenshot above). Now let&#8217;s take a small look at some of the files in this extension<br />
<em>ext_localconf.php</em> [1 KB] &#8211; register plugin<br />
<em>ext_tables.php</em> [1 KB] &#8211; register statics<br />
<em>res/mootools-1.11.js</em> [21 KB] &#8211; compressed MooTools 1.11<br />
<em>static/constants.txt</em> [1 KB] &#8211; statics for transition, mode, duration, fps<br />
<em>static/setup.txt</em> [1 KB] &#8211; set options from constants and insert plugin on page.91<br />
<em>pi1/class.tx_rgsmoothscroll_pi1.php</em> [4 KB]</p>
<pre class="brush: jscript; title: ;">
// [...] could use EXT:t3mootools to build a costum core
// include necessary js
$header .=  '&lt;script type=&quot;text/javascript&quot; src=&quot;'.$this-&gt;getPath($this-&gt;conf['pathToMootools']).'&quot;&gt;&lt;/script&gt;';

$header .= '&lt;script type=&quot;text/javascript&quot;&gt;
	var Page = {
		initialize: function() {
			new SmoothScroll({
				transition: Fx.Transitions.'.$transition.',
				fps: '.intval($conf['fps']).',
				duration: '.intval($conf['duration']).'
			});
		}
	}
	window.addEvent(&quot;domready&quot;, Page.initialize);&lt;/script&gt;';

// include the js in the header
$GLOBALS['TSFE']-&gt;additionalHeaderData['rgsmoothscroll'] = $header;
</pre>
<p>So let&#8217;s explain this a little. First we need to <strong>get all the need JS</strong> this is a <strong>MooTools 1.11</strong> so if I want to use the <strong>MooTools 1.2</strong> features then I have a little problem as I would need to build my own MooTools version and I would need to check out what&#8217;s needed&#8230; it&#8217;s not real a problem but it&#8217;s rather <strong>cumbersome</strong>. I believe the <strong>extension </strong>itself <strong>should not need to care</strong> about the core or MooTools plugin. It should just say I need Smoothscroll and then use it. If the code get&#8217;s included on page render or loaded dynamically shouldn&#8217;t be it conserns. OK let&#8217;s go on &#8211; then we have the <strong>script block</strong> where it starts the <strong>SmoothScroll with all options</strong>. Again it work but it&#8217;s probably not the best way. I mean why give all options &#8211; they are <strong>already well set in the class</strong> itself and if there is another option added in the class you have to mirror it in your extension. Or let&#8217;s say an default value get&#8217;s changed because the funtion of the class is a little modified you would have to update the extension default also&#8230; <strong>doubling data isn&#8217;t good</strong> because you will always have to update at two places&#8230; So I believe options should only be set if you want it expliciply. By default it should use the class defaults and not it own default.</p>
<p>So now let&#8217;s give the &#8220;same&#8221; functionality but with the use of MPR.<br />
ext_localconf.php [1 KB]</p>
<pre class="brush: php; title: ;">
t3lib_extMgm::addTypoScript($_EXTKEY,'setup','
page.headerData.989 = TEXT
page.headerData.989.value (
	&lt;script type=&quot;text/javascript&quot;&gt;
		$require(\'Core/Utilities/DomReady.js\');
		$require(\'More/Fx/Fx.SmoothScroll.js\');

		window.addEvent(\'domready\', function() {
			new Fx.SmoothScroll();
		});
	&lt;/script&gt;
)
',43);
</pre>
<p>now what&#8217;s that just one file? yeah it&#8217;s all you need and in fact <strong>I wouldn&#8217;t create an extension for that</strong> but just for the sake of explaination. All we do is to add a script block somewhere on the page. In this block we say that we want to <strong>use </strong>the <strong>DomReady </strong>stuff and the <strong>SmoothScroll </strong>stuff. The we just start SmoothScroll with the default options. No need to care about any other js stuff. No need to include any core or any other css <strong>all </strong>the <strong>info</strong> is <strong>inside </strong>the &#8220;<strong>MooTools Packages</strong>&#8221; itself.<br />
One problem we have with this solution is that if you want to change some options for SmoothScroll you will have to rewrite the whole block&#8230; so I guess we need a <strong>different solution </strong>to the &#8220;<strong>map MooTools option into TS</strong>&#8221; problem&#8230; but more on this <strong>will follow</strong>&#8230;.</p>
<p>So now we see that with MPR it&#8217;s pretty simple to use plugins without even using any extension. Just write the script block prepare some html (if needed) and you are done. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.delusionworld.com/mootools/use-mootools-in-typo3-with-mpr/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>MPR has been split into MPR and MPM</title>
		<link>http://www.delusionworld.com/mootools/mpr-has-been-split-into-mpr-and-mpm/</link>
		<comments>http://www.delusionworld.com/mootools/mpr-has-been-split-into-mpr-and-mpm/#comments</comments>
		<pubDate>Wed, 01 Jul 2009 21:52:19 +0000</pubDate>
		<dc:creator>daKmoR</dc:creator>
				<category><![CDATA[MooTools]]></category>

		<guid isPermaLink="false">http://www.delusionworld.com/?p=123</guid>
		<description><![CDATA[It&#8217;s been quite a while. Honestly I didn&#8217;t had as much time for MooTools as I wanted. Nevertheless there has been some changes. The most important one is surely that MPR has been split into 2 separate Projects. It consists now of: MPR (MooTools Package Repository) MPM (MooTools Package Manager) The reason for this change [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been quite a while. Honestly I didn&#8217;t had as much time for MooTools as I wanted. Nevertheless there has been some changes. The most important one is surely that MPR has been split into 2 separate Projects. It consists now of: </p>
<ul>
<li>MPR (MooTools Package Repository)</li>
<li>MPM (MooTools Package Manager)</li>
</ul>
<p>The reason for this change lies in the nature of a Package Repository. First you have the actual data (MPR), secondly you need some local Application to organize these data (MPM) and finally you need an online server (to be build) to store and order these files globally.</p>
<p>To reflect those changes the url got changed to: <a href="http://mpm.mooforum.net/Mpm.php">http://mpm.mooforum.net/Mpm.php</a></p>
<p>One other important reason for this change is that if you want to use MPR in an existing system like a CMS or a Blog System you most likely just want to write individual Manager for them (maybe based on MPM, but what if your CMS uses something else than PHP?) but MPR can always stay the same as it&#8217;s just the data. And by using a generic Package System you easily can distribute your Packages even between different Managers&#8230; (ok that&#8217;s a future dream but whatever who knows what the future brings.)</p>
<p>And what I&#8217;m currently doing is writing demos for MPR Mootools More as there are so many nice functions. I mean every time I look through the documentation or the code I find some nice new stuff. The only problem with that is by just looking at the text &#8211; it&#8217;s most of the time pretty hard to see what this code is really capable of. Without a good demo even the best code is nothing but just text to lazy people like me *hehe* I need some place to click around or see some stuff moving.</p>
<p>I mean a demo should show the most common usage of a function. I will try to do some blogging about my ongoing work&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.delusionworld.com/mootools/mpr-has-been-split-into-mpr-and-mpm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NetBeans PHP ignore folder</title>
		<link>http://www.delusionworld.com/webdev/netbeans-php-ignore-folder/</link>
		<comments>http://www.delusionworld.com/webdev/netbeans-php-ignore-folder/#comments</comments>
		<pubDate>Tue, 26 May 2009 12:17:53 +0000</pubDate>
		<dc:creator>daKmoR</dc:creator>
				<category><![CDATA[WebDev]]></category>
		<category><![CDATA[NetBeans]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.delusionworld.com/?p=109</guid>
		<description><![CDATA[As I&#8217;m currently write a little more PHP code than usually I may need a &#8220;better&#8221; IDE for development. I&#8217;m not sure if you know NetBeans but it looks pretty promising. One thing that bugged me from the beginning was that I have a folder &#8220;Data&#8221; where I write temporary files and NetBeans kept complaining [...]]]></description>
			<content:encoded><![CDATA[<p>As I&#8217;m currently write a little more PHP code than usually I may need a &#8220;better&#8221; IDE for development. I&#8217;m not sure if you know <a href="http://www.netbeans.org/">NetBeans</a> but it looks pretty promising.</p>
<p>One thing that bugged me from the beginning was that I have a folder &#8220;Data&#8221; where I write temporary files and NetBeans kept complaining about those files. I though it would be an easy rightlick->ignore folder. Well yeah it wasn&#8217;t. It took me about half an hour to find a way to <strong>ignore folders in NetBeans PHP.</strong></p>
<p><strong>Here is my solution:</strong><br />
Goto: <em>Tools</em>-><em>Options</em>-><em>Miscellaneous</em>-><em>Files</em><br />
Edit the <em>Ignore Files Pattern</em>: </p>
<pre class="brush: jscript; title: ;">^(##INSERT_FOLDER_HERE##|CVS|SCCS|vssver.?\.scc|#.*#|%.*%|_svn)$|~$|^\.(?!htaccess$).*$</pre>
<p>(replace the <em>##INSERT_FOLDER_HERE##</em> with your folder name [example.: "Data"])<br />
it&#8217;s a <strong>regular expression</strong> so if you know how to handle it -> your lucky; if not try it and/or ask for help</p>
<p>Here is a picture how it could look:<br />
<a href="http://www.delusionworld.com/wp-content/uploads/2009/05/netbeansignorefolder.png"><img src="http://www.delusionworld.com/wp-content/uploads/2009/05/netbeansignorefolder.png" alt="NetBeans ignore folder" title="NetBeans ignore folder" width="585" height="335" class="alignleft size-full wp-image-110" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.delusionworld.com/webdev/netbeans-php-ignore-folder/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>MooTools Plugin CanvasOverlay</title>
		<link>http://www.delusionworld.com/mootools/mootools-plugin-canvasoverlay/</link>
		<comments>http://www.delusionworld.com/mootools/mootools-plugin-canvasoverlay/#comments</comments>
		<pubDate>Tue, 21 Apr 2009 11:18:59 +0000</pubDate>
		<dc:creator>daKmoR</dc:creator>
				<category><![CDATA[MooTools]]></category>
		<category><![CDATA[Canvas]]></category>
		<category><![CDATA[Imagemap]]></category>
		<category><![CDATA[MPR]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[Repository]]></category>

		<guid isPermaLink="false">http://www.delusionworld.com/?p=107</guid>
		<description><![CDATA[Uses canvas to dynamically create overlays (with fill, border, glow) for Images with imagemaps MPR Demo MPR Docu it&#8217;s basically a jQuery port from: http://davidlynch.org/js/maphilight/docs/ it doesn&#8217;t support IE as it doesn&#8217;t have canvas and I didn&#8217;t wanted to hack around with VML&#8230; :p]]></description>
			<content:encoded><![CDATA[<p>Uses canvas to dynamically create overlays (with fill, border, glow) for Images with imagemaps</p>
<p><a href="http://mpr.mooforum.net/MprAdmin.php?mode=demo&#038;file=./Visual/CanvasOverlays/Demos/CanvasOverlays.html">MPR Demo</a><br />
<a href="http://mpr.mooforum.net/MprAdmin.php?mode=docu&#038;file=./Visual/CanvasOverlays/Docu/CanvasOverlays.md">MPR Docu</a></p>
<p>it&#8217;s basically a jQuery port from:<br />
<a href="http://davidlynch.org/js/maphilight/docs/">http://davidlynch.org/js/maphilight/docs/</a></p>
<p>it doesn&#8217;t support IE as it doesn&#8217;t have canvas and I didn&#8217;t wanted to hack around with VML&#8230; :p</p>
]]></content:encoded>
			<wfw:commentRss>http://www.delusionworld.com/mootools/mootools-plugin-canvasoverlay/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MPR Best Practice &#8211; Plugin MultiOverlays</title>
		<link>http://www.delusionworld.com/mootools/mpr-best-practice-plugin-multioverlays/</link>
		<comments>http://www.delusionworld.com/mootools/mpr-best-practice-plugin-multioverlays/#comments</comments>
		<pubDate>Sun, 19 Apr 2009 13:04:44 +0000</pubDate>
		<dc:creator>daKmoR</dc:creator>
				<category><![CDATA[MooTools]]></category>
		<category><![CDATA[Milkbox]]></category>
		<category><![CDATA[MultiOverlays]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[Repository]]></category>

		<guid isPermaLink="false">http://www.delusionworld.com/?p=93</guid>
		<description><![CDATA[So now we have this local part of MPR to help us using MooTools Plugins. But howto create such Plugins and what should you use&#8230; (bad) Examples At first let me show you some examples why it&#8217;s not so easy currently to work with MooTools. I think the main reason is that it&#8217;s pretty hard [...]]]></description>
			<content:encoded><![CDATA[<p>So now we have this local part of MPR to help us using MooTools Plugins. But <strong>howto create</strong> such Plugins and what should you use&#8230;</p>
<h2>(bad) Examples</h2>
<p>At first let me show you some examples why it&#8217;s not so easy currently to work with MooTools. I think the main reason is that <strong>it&#8217;s pretty hard to use multiple files</strong> (js, css, img&#8230;) so people <strong>try to do everything in ONE file</strong>.</p>
<h3>Example <a href="http://mpr.mooforum.net/MprAdmin.php?mode=demo&#038;file=./Galleries/Milkbox/Demos/Milkbox.html">Milkbox</a>:</h3>
<p>Whenever you add it you will <strong>automatically add an Event to domready</strong> to create a milkbox with the default params&#8230; But what if I don&#8217;t want to use it on a page, I <strong>can&#8217;t easily disable it</strong> as I would <strong>need to edit the file</strong>.<br />
[don't get me wrong - milkbox is cool, I'm just saying it might be even better this way...]<br />
It would be nicer if separate in more files:</p>
<ul>
<li>Milkbox.js // class Milkbox &#8211; with the milkbox effect</li>
<li>Milkboxes.js // class Milkboxes &#8211; create multiple Milkboxes and has the logic for &#8220;galleries&#8221;</li>
<li>AutoMilkboxes.js // will require Milkboxes and will add it&#8217;s creation to the domready event</li>
</ul>
<p>With that now we can decide what we want to include. For the <strong>&#8220;basic&#8221; user</strong> its just $require( AutoMilkbox ); and people who know can decide if they either want one or multiple milkboxes. However as I said above <strong>using 3 files for one plugin</strong> without MPR is pretty inconvenient so people don&#8217;t do it. [and by inconvenient I mean <strong>it's freaking crazy</strong> to use 3 script tags for one little plugin - no no no; and yeah we all don't want to build our own script.json for each plugin... (little side kick to the devs..) :p]<br />
<strong>Now you can, just use MPR <img src='http://www.delusionworld.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </strong></p>
<h3>Example <a href="http://www.clientcide.com/wiki/cnet-libraries/07-ui/11-waiter">clientcide Waiter</a>:</h3>
<p>[again, the waiter is cool, but it might be better this way]<br />
As you can see in it&#8217;s docs there if you have this &#8221; baseHref: &#8216;&#8230;&#8217; &#8221; which means that if you use the class the <strong>image will be by default loaded</strong> from this location: <a href="http://www.cnet.com/html/rb/assets/global/waiter/waiter.gif">http://www.cnet.com/html/rb/assets/global/waiter/waiter.gif</a> I think this is another &#8220;hack&#8221; around the <strong>MooTools policy</strong> &#8220;<em>don&#8217;t use more than one file in your Plugin</em>&#8221; *<em>hehe</em> offending people here&#8230;*.<br />
I mean what happens if this file gets forgotten? server upgrade &#8211; do we still need this waiter.gif? no, just delete it&#8230; :p ok that might be not the actual process but there is surely the<strong> possibility</strong> that <strong>this file will just vanish</strong> without a notice&#8230; why not deliver the file with the Plugin?<br />
It would gives me again a few benefits</p>
<ul>
<li>I can easily replace the image to my own (no need to change any js/css; just replace the file)</li>
<li>I can define/override the url in my css (if uses as background image) so again no need to change any javascript</li>
<li>What if I have multiple image files? I mean if I have a Plugin that uses some images from the cnet server; some from the plugin server; and some from my own server.. pretty hard to maintain right?</li>
</ul>
<h2>use of MPR within the Plugin <a href="http://mpr.mooforum.net/MprAdmin.php?mode=demo&#038;file=./Visual/MultiOverlays/Demos/MultiOverlays.html">MultiOverlays</a></h2>
<p>So now let&#8217;s take a closer look at a Plugin and a way I think it should be done. </p>
<h3>File MultiOverlay.js</h3>
<pre class="brush: jscript; title: ;">
$require(MPR.path + 'Core/Fx.Tween/Fx.Tween.js');
$require(MPR.path + 'More/Class.Occlude/Class.Occlude.js');
var MultiOverlay = new Class({
  ...
});
</pre>
<p>ok, here we define the <strong>requirements and the logic</strong> for one MultiOverlay. now if you want to use it I need to use it with an id and create the Class instance myself. If you know how it&#8217;s easy&#8230;</p>
<pre class="brush: jscript; title: ;">var myMultiOverlay = new MultiOverlay( $('imageWithId') );</pre>
<h3>File MultiOverlays.js</h3>
<p>this file is so short I will post it&#8217;s full code here&#8230;</p>
<pre class="brush: jscript; title: ;">
$require(MPR.path + 'Visual/MultiOverlays/MultiOverlay.js');
var MultiOverlays = new Class({
	multiOverlays: [],
	initialize: function(elements, options) {
		$$(elements).each( function(el) {
			this.multiOverlays.include( new MultiOverlay(el, options) );
		}, this);
	},
	getMultiOverlays: function() {
		return this.multiOverlays;
	}
});
</pre>
<p>So what do we get here, it just gives you the possibility to create <strong>Multiple MultiOverlay(s)</strong>&#8230; So now you can give the image(s) a class and for each image it will create a MultiOverlay instance which get&#8217;s saved in an array (if you may need it any time later&#8230;)</p>
<h3>File AutoMultiOverlays.js</h3>
<p>again such a short file&#8230; here is it&#8217;s code&#8230;</p>
<pre class="brush: jscript; title: ;">
$require(MPR.path + 'Visual/MultiOverlays/MultiOverlays.js');
var Auto = Auto || {};
window.addEvent('domready', function() {
	Auto.MultiOverlays = new MultiOverlays( '.MultiOverlay' );
});
</pre>
<p>basically it just creates a <strong>new MultiOverlays</strong> with a <strong>hard coded &#8220;default&#8221; value</strong>&#8230; so if you require this file you don&#8217;t need to write any javascript code at all, just give the CSS-class to your images and your done! <strong>It&#8217;s the easiest way you can do it&#8230; </strong>[here the value get's saved in the Auto variable as I might still want to use it later... the Auto variable is globally here]</p>
<h3>So why all this files?</h3>
<p>As I said above I think it&#8217;s vital to <strong>separate logic</strong> to where it belongs. And for me that means if I want to have a single MultiOverlay I should be able to. So the logic for Multiple MultiOverlays shouldn&#8217;t be in it, as it&#8217;s just more stuff I don&#8217;t need&#8230; :p<br />
And while we are at it, now that we need a Folder for it let&#8217;s add the <a href="http://mpr.mooforum.net/MprAdmin.php?mode=docu&#038;file=./Visual/MultiOverlays/Docu/MultiOverlays.md">Docu</a>. So now we got <strong>demos, docu, Resources</strong>(css, images) all in a single <a href="http://mpr.mooforum.net/MprAdmin.php?mode=zip&#038;file=Visual/MultiOverlays">Plugin Zip file</a>.<br />
It&#8217;s just <strong>easy to send</strong> it to someone and <strong>he get&#8217;s everything</strong> &#8211; I don&#8217;t need to explain what css image files he has to manually include&#8230; If you have a local MPR you can just <strong>install it in the admin area</strong>&#8230;.  (talking about easy&#8230; <img src='http://www.delusionworld.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  )</p>
<p>What do you want to hear next? more MPR best Pratice?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.delusionworld.com/mootools/mpr-best-practice-plugin-multioverlays/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MPR</title>
		<link>http://www.delusionworld.com/mootools/mpr/</link>
		<comments>http://www.delusionworld.com/mootools/mpr/#comments</comments>
		<pubDate>Wed, 15 Apr 2009 11:25:01 +0000</pubDate>
		<dc:creator>daKmoR</dc:creator>
				<category><![CDATA[MooTools]]></category>
		<category><![CDATA[MPR]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[Repository]]></category>

		<guid isPermaLink="false">http://www.delusionworld.com/?p=87</guid>
		<description><![CDATA[I now finally have finished my first alpha for the local part of MPR. It should help you to use, create and share MooTools Plugins. For that it uses a well defined folder structure with defined filenames. I guess I will create a screencast in the near feature&#8230; for now just check out the demo: [...]]]></description>
			<content:encoded><![CDATA[<p>I now finally have finished my first alpha for the local part of MPR. It should help you to use, create and share MooTools Plugins. For that it uses a well defined folder structure with defined filenames.<br />
I guess I will create a screencast in the near feature&#8230;</p>
<p>for now just check out the demo:<br />
<a href="http://mpr.mooforum.net/">http://mpr.mooforum.net/</a><br />
(make sure to check out the search at the top right!) [no more missing search for docs... <img src='http://www.delusionworld.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ]</p>
<p>if you&#8217;re interested check out the git project:<br />
<a href="http://github.com/daKmoR/mpr/tree/master">http://github.com/daKmoR/mpr/tree/master</a></p>
<p>I will try to port quite some plugins to MPR (usually it only means finding out the requirements and probably writing some docs/specs&#8230;). With that I guess it should be much easier to use multiple plugins.</p>
<p>If you have a Plugin you want to be integrated just send me the zip file.<br />
If you want to see your Plugin inside MPR but you don&#8217;t know how &#8211; just let me know and I will try to help&#8230;</p>
<p>If you want to know more about MPR you can see/read stuff here:<br />
<a href="http://www.delusionworld.com/mootools/mpr-preparation-part-1/">http://www.delusionworld.com/mootools/mpr-preparation-part-1/</a><br />
<a href="http://www.delusionworld.com/mootools/mpr-preparation-part-2/">http://www.delusionworld.com/mootools/mpr-preparation-part-2/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.delusionworld.com/mootools/mpr/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>General MooTools UI</title>
		<link>http://www.delusionworld.com/mootools/general-mootools-ui/</link>
		<comments>http://www.delusionworld.com/mootools/general-mootools-ui/#comments</comments>
		<pubDate>Tue, 10 Mar 2009 13:41:46 +0000</pubDate>
		<dc:creator>daKmoR</dc:creator>
				<category><![CDATA[MooTools]]></category>
		<category><![CDATA[progressive Enhancement]]></category>
		<category><![CDATA[Repository]]></category>
		<category><![CDATA[UI]]></category>

		<guid isPermaLink="false">http://www.delusionworld.com/?p=65</guid>
		<description><![CDATA[While I was trying to fully utilize progressive Enhancement I had another idea. Why not separate functionality and layout even while writing javascript/MooTools. That way it would be far easier to create different layouts for the same functionality without the need to reproduce code. Again let&#8217;s just look at an example: simple tabs (my favorite [...]]]></description>
			<content:encoded><![CDATA[<p>While I was trying to fully utilize progressive Enhancement I had another idea. Why not <strong>separate functionality and layout</strong> even while writing javascript/MooTools. That way it would be far easier to <strong>create different layouts for the same functionality</strong> without the need to reproduce code. Again let&#8217;s just look at an example:<br />
<a href="http://www.delusionworld.com/files/general-mootools-ui/mootools-tabs.html">simple tabs</a> (my favorite example&#8230; :p)</p>
<pre class="brush: jscript; title: ;">
var myTabs = new FlowTabs.inline( $$('.FlowTabs &gt; h4'), $$('.FlowTabs &gt; div') );
</pre>
<p><em>If you look at the source you will find an &#8220;$require(&#8230;);&#8221; it&#8217;s just the same as including the file directly with script or link tag.</em> You can find more info about that in my previous posts about MPR. So what do we get with this code &#8211; <strong>It just gives us the functionality</strong> and looks pretty shitty, as only the necessary things are defined. Now let&#8217;s take at an example where we use the UI. <a href="http://www.delusionworld.com/files/general-mootools-ui/mootools-ui-tabs.html">simple ui tabs</a></p>
<pre class="brush: jscript; title: ;">
UI.render('Plain');
</pre>
<p>So it looks now a little bit nicer, but that can all be done with CSS &#8211; and you are right as if we look at the source of the UI.Plain.Tabs it does nothing &#8211; it <strong>just includes 2 css files</strong>&#8230;.</p>
<pre class="brush: jscript; title: ;">
$require(MPR.path + 'Ui/Plain/Plain.js');

$require(MPR.path + 'Snippets/Css/Resources/clearfix.css');
$require(MPR.path + 'Ui/Plain/Resources/Plain.Tabs.css');

Ui.Plain.Tabs = new Class({
	Implements: [Options],
	options: {
	},

	initialize: function(options) {
		this.setOptions(options);
	}
});
</pre>
<p>How boring is that?!?! Seems like we <strong>need a little more complicated example</strong>. I guess most of you know the MochaUI &#8211; how about adopting some style from it&#8230;</p>
<h2>MochaUI Tabs</h2>
<p><a href="http://www.delusionworld.com/files/general-mootools-ui/mootools-ui-tabs-mocha.html">mocha ui tabs</a></p>
<pre class="brush: jscript; title: ;">
$require(MPR.path + 'Ui/Mocha/Mocha.Tabs.js');
UI.render('Mocha');
</pre>
<p>only those 2 lines changed &#8211; we now load a different UI class and render a different theme called &#8216;Mocha&#8217;&#8230; so let&#8217;s look at it&#8217;s functions</p>
<pre class="brush: jscript; title: ;">
initialize: function(tabs, options) {
	this.setOptions(options);
	this.attach(tabs);
},

attach: function(tabs) {
	if ( $type(tabs) == 'string' ) tabs = $$(tabs);
	if ( $type(tabs) == 'element' ) tabs = [tabs];

	tabs.each( function(el) {
		var inside = new Element('span', { html: el.get('html') } );
		el.empty();
		el.grab(inside);
	}, this);
}
</pre>
<p>It&#8217;s again not really funny as it <strong>just creates an span inside every tab</strong> &#8211; we could have easily put this inside the &#8220;original&#8221; Tab Class. However what if the<strong> problem is a little bit more complex</strong> and the <strong>layout is also quite heavy on it&#8217;s own</strong>. Wouldn&#8217;t it be nice to separate these problems&#8230; Yeah I guess with just words you won&#8217;t believe me. So I will show you something more complex afterward.<br />
But for now <strong>let&#8217;s find out how the UI knows what theme to render and with which parameters</strong>. For that we need to look at the FlowTabs.inline.js file&#8230; at the bottom you will find:</p>
<pre class="brush: jscript; title: ;">
if ( typeof(UI) !== 'undefined' ) UI.registerClass({ 'Tabs': { 'param': '.ui-tab', 'name': 'FlowTabs.inline' } });
</pre>
<p>So what this does is basically it <strong>registers the FlowTabs Class as a Tabs Class</strong> with it&#8217;s default parameter and it&#8217;s name&#8230; Now when the UI is rendered it calls UI.<em>theme</em>.Tabs(<em>param</em>) and that&#8217;s exactly what we created earlier: &#8220;Ui.Mocha.Tabs = new Class({&#8221;</p>
<p>So let&#8217;s <strong>summaries this a little</strong>&#8230; until now it works like:</p>
<ul>
<li>create all Tabs + Content</li>
<li>call the UI Class that will look for predefined classes and it will modify the layout accordingly</li>
</ul>
<p>That&#8217;s pretty straight forward and in many situations this will work pretty well. <strong>However what about dynamically created tabs</strong> after the initial creation. I don&#8217;t know maybe loading with ajax or as a user populates some fields&#8230; So my FlowTabs class my support creating these Tabs on the fly but I somehow need to tell the UI that new Tabs are created and they need to be styled.</p>
<p>So now how do we do that:<br />
FlowTabs.inline.js in the attach function (creating of the tabs) we just fire an Event and give it some things to work with:</p>
<pre class="brush: jscript; title: ;">
this.fireEvent('onUiAttach', [el, j-1, content[i], this.tabsContainer]);
</pre>
<p>now what we need to do is use this onUiAttach Event. For that we just define this.options.refactor</p>
<pre class="brush: jscript; title: ;">
Ui.Mocha.Tabs = new Class({
	Implements: [Options],
	options: {
		refactor: {
			options: {
				onUiAttach: function(el, i) {
					if ( (typeof(UI) !== 'undefined') &amp;&amp; ( typeof(UI.Uis.Tabs) !== 'undefined' ) ) {
						UI.Uis.Tabs.attach( $(el) );
					}
				}
			}
		}
	},
</pre>
<p>If this is provided the <strong>UI will either refactor the class</strong> (if it hasn&#8217;t been instantiated) or it <strong>will set it options</strong> if the class has already been instantiated. [This doesn't seem to work currently - so note at the end]  To detect that we have another function in FlowTabs.inline that will be called on initialize:</p>
<pre class="brush: jscript; title: ;">
registerUi: function() {
	if ( typeof(UI) !== 'undefined' )
		UI.registerClass({ 'Tabs': { 'param': '.' + this.options.ui.tab['class'], 'name': 'FlowTabs.inline', 'class': this } });
}
</pre>
<p>it&#8217;s <strong>basically the same as the registration above</strong>, only that we now get the param from the option &#8211; this will help for example if we want to change the classes of the tabs; with that we don&#8217;t need to change them on the Tab creation script and on the Tab UI script&#8230; it will be automatically updated on the UI script. <strong>And we give the ui as &#8216;class&#8217; this</strong> (that&#8217;s pretty important!).</p>
<p>So now with all that it doesn&#8217;t matter when the UI [UI.render('Mocha');] is called as:</p>
<ul>
<li>If you call it at the beginning before all the tabs are created it basically does nothing except that it refactors every Class that it might need. So these classes then automatically do the right thing when the Event onUiAttach is fired.</li>
<li>If you call it at the end it will create all the necessary layout and set the options for every Class that&#8217;s registered so further elements that get attached get the layout automatically.</li>
</ul>
<p>I still prefer to call the UI at the and as it might need a little bit less performance. [so also note at the end]</p>
<h2>FlowWindows</h2>
<p>So now <strong>let&#8217;s go for an more complex example</strong>. Let&#8217;s talk about windows&#8230; I think there are quite a few implementations out there&#8230; MochaUI for example &#8211; it&#8217;s Window Class is really cool. However it&#8217;s also really really big. So what if I just want a little div to resize and drag around. <strong>I think functionality and UI should be separated</strong>. I mean now I needed to write my own class as I didn&#8217;t &#8220;wanted&#8221; to use a complex layout as MochaUI&#8230;. the functionality would be great but <strong>you can&#8217;t get MochaUI Window without the Layout</strong>&#8230;<br />
So basically that&#8217;s what I came up: <a href="http://www.delusionworld.com/files/general-mootools-ui/mootools-windows.html">simple windows</a>. (I looked up some things at MochaUI window so it wasn&#8217;t that hard&#8230; :p)</p>
<p>If you look at it you see:</p>
<pre class="brush: jscript; title: ;">
$require(MPR.path + 'Windows/FlowWindows/FlowWindows.js');
[...]
var myWindows = new FlowWindows( $$('.FlowWindow &gt; h3')[0], $$('.FlowWindow &gt; div')[0] );
myWindows.attach( $$('.FlowWindow &gt; h3')[0], $$('.FlowWindow &gt; div')[0] );
</pre>
<p>So this just creates all the divs needed for all the handlers to resize, the header, the controlls&#8230; <strong>all you need for a nice window</strong>&#8230; but it&#8217;s ugly. yeah sure it&#8217;s<strong> just for functionality</strong> no UI at all. Now let&#8217;s get some UI &#8211; <a href="http://www.delusionworld.com/files/general-mootools-ui/mootools-ui-windows.html">the plain UI</a> is not really something special (again no change with js &#8211; just css). To use it &#8211; there are just some small differences&#8230;</p>
<pre class="brush: jscript; title: ;">
$require(MPR.path + 'Ui/Plain/Plain.Full.js');
[...]
UI.render('Plain');
</pre>
<p>we include <strong>Plain.Full which will give me all available UI elements of Plain</strong> &#8211; currently Tabs and Windows. In the end we just need to start UI.render &#8230;</p>
<p>So now comes the nice stuff, if I want to just change the style of the Tabs and the Windows I <strong>don&#8217;t need to change any of the Functionality Classes</strong>. I just need to change the UI with:</p>
<pre class="brush: jscript; title: ;">
$require(MPR.path + 'Ui/Mocha/Mocha.Full.js');
[...]
UI.render('Mocha');
</pre>
<p>and we get <a href="http://www.delusionworld.com/files/general-mootools-ui/mootools-ui-windows-mocha.html">Mocha Layout</a> for Tabs and Windows.</p>
<p>The<strong> Mocha.Windows is a little bit more complicated</strong> as it needed a Canvas which gets updated on every size change. But in the end it&#8217;s really flexible and the best thing is if you want to change the functionality you don&#8217;t have to think (to much) about they layout. Moreover this also works the other way around. It&#8217;s far easiere to create just the layout for a specific structure than to create all the functionality&#8230;</p>
<p>one other thing that might come in handy is that you can start the UI without any functionality classes&#8230;.<a href="http://www.delusionworld.com/files/general-mootools-ui/mootools-ui-only-mocha.html">Mocha UI only</a>. The html markup has to be created accordingly by a server scripting language or so&#8230; Starting the UI is again pretty simple</p>
<pre class="brush: jscript; title: ;">
$require(MPR.path + 'Ui/Mocha/Mocha.Full.js');
window.addEvent('domready', function() {

	//say we want to use the WindowsUI and the TabsUI
	UI.render('Mocha', {
		'Windows': {
			'param': '.ui-window'
		},
		'Tabs': {
			'param': '.ui-tab'
		}
	});

});
</pre>
<p>I currently can only think of one rule you need to follow (maybe I get some more ofer time&#8230;):</p>
<ul>
<li>include the UI classes always after the functionality classes</li>
</ul>
<p>Limitation:</p>
<ul>
<li>the setOptions method (if the UI is called at the end) only support options while with refactor you can override and define new functions.
</ul>
<h2>Note at the end:</h2>
<p>The setOptions doesn&#8217;t seem to work for subclasses if&#8230; yeah right if I knew that I would fix it, but for now the UI should be called at the top if you need some complex update functions like for MochaUI Window (for all the other stuff it also works at the end) [I guess the problem lies somewhere in between <a href="http://www.delusionworld.com/files/MPR/Ui/Ui.js">the UI - fireEvent('onUiInit');</a> and <a href="http://www.delusionworld.com/files/MPR/Ui/Mocha/Mocha.Windows.js">the UI.Mocha - this.options.refactor.options.onUiInit</a>. If you catch any error - I'm open for suggestions...]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.delusionworld.com/mootools/general-mootools-ui/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

