<?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>Daniel Skinner: News and Articles on Web Development &#187; Web Development</title>
	<atom:link href="http://www.daniel-skinner.co.uk/category/web-development/feed" rel="self" type="application/rss+xml" />
	<link>http://www.daniel-skinner.co.uk</link>
	<description>Daniel Skinner&#039;s Blog: Web Development news and articles</description>
	<lastBuildDate>Wed, 18 Mar 2009 15:11:23 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Install phpUnderControl on CentOS 5</title>
		<link>http://www.daniel-skinner.co.uk/php-under-control-svn-centos-5/12/06/2008</link>
		<comments>http://www.daniel-skinner.co.uk/php-under-control-svn-centos-5/12/06/2008#comments</comments>
		<pubDate>Thu, 12 Jun 2008 15:19:56 +0000</pubDate>
		<dc:creator>Daniel Skinner</dc:creator>
				<category><![CDATA[Guides]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[phpundercontrol]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://www.daniel-skinner.co.uk/?p=26</guid>
		<description><![CDATA[If you follow this guide you should start with a basic CentOS 5 installation with Subversion setup correctly and end up with a working installation of phpUnderControl.]]></description>
			<content:encoded><![CDATA[<p>A while back now I started setting up a server to use as a development machine. From a standard CentOS 5 installation I have installed <a title="CentOS SVN" href="http://www.daniel-skinner.co.uk/setup-subversion-and-trac-on-centos-5/06/01/2008">SubVersion and Trac</a>. Now I have finally got round to installing <a title="phpUnderControl" href="http://www.phpundercontrol.org/">phpUnderControl</a> for continuous integration and build management.</p>
<p>As usual, there are many great guides already on the net but getting everything to work usually requires a few of these references and a few additional changes. I will point out where I got the information from where applicable but the aim of this guide is to be complete and comprehensive.</p>
<p>If you follow this guide you should start with a basic <a title="CentOS 5 SVN and Trac" href="http://www.daniel-skinner.co.uk/setup-subversion-and-trac-on-centos-5/06/01/2008">CentOS 5 installation with Subversion</a> setup correctly and end up with a working installation of phpUnderControl.</p>
<p><span id="more-26"></span></p>
<h2>The Environment</h2>
<p>I am aiming for the following:</p>
<ul>
<li>CentOS 5 with SubVersion installed</li>
<li>PHP 5.2.X installed</li>
<li>CruiseControl binary installed, running on Sun JDK 6</li>
<li>phpUnderControl installed</li>
<li>A working build process for the example project</li>
</ul>
<h2>Here it is&#8230;</h2>
<h3>Upgrade CentOS 5 with PHP5.2</h3>
<p>To get PHP5.2 installed on CentOS 5 (required for phpUC) we need to add an additional repository that has it. I am going to use the <a href="http://www.jasonlitka.com/yum-repository/">Yum Repository</a> provided by <a href="http://www.jasonlitka.com/">Jason Litka</a>. Detailed instructions can be found at his site. In summary, for CentOS 5 this consists of:</p>
<pre>rpm --import http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka
vi /etc/yum.repos.d/utterramblings.repo</pre>
<p>Add the following lines:</p>
<pre>[utterramblings]
name=Jason's Utter Ramblings Repo
baseurl=http://www.jasonlitka.com/media/EL$releasever/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka</pre>
<p>Now Yum can update PHP to 5.2. We also need a few other dependencies for phpUC:</p>
<pre>yum install -y php php-pear php-xml</pre>
<p>And the latest version of pear:</p>
<pre>pear channel-update pear.php.net
pear upgrade pear</pre>
<h3>Get phpUnderControl</h3>
<p>Using pear to install phpUC:</p>
<pre>pear config-set preferred_state beta
pear channel-discover components.ez.no
pear channel-discover pear.phpunit.de
pear install --alldeps phpunit/phpUnderControl</pre>
<p>This will install phpUC and all required dependencies. It&#8217;s a good idea to set pear back to only installing stable (i.e. non beta) packages:</p>
<pre>pear config-set preferred_state stable</pre>
<h3>Sun Java JDK 6</h3>
<p>phpUC needs CruiseControl and CruiseControl needs Sun JDK. Again, a full guide for getting this done can be found on the <a title="Java on CentOS" href="http://www.jasonlitka.com/">CentOS wiki</a>. The steps I took are:</p>
<p>Set up rpmbuild:</p>
<pre>vi ~/.rpmmacros</pre>
<p>Make sure the file contents is:</p>
<pre>%_topdir /home/&lt;username&gt;/rpmbuild
%_tmppath %{_topdir}/tmp</pre>
<p>with &lt;username&gt; replaced with your logon name (if you are using root the path would be /root/rpmbuild).</p>
<pre>mkdir -p ~/rpmbuild/{SOURCES,SRPMS,SPECS,RPMS,tmp,BUILD}
yum install -y rpm-build gcc gcc-c++ redhat-rpm-config jpackage-utils</pre>
<p>Download JDK6 Update 6 (or the latest version) from <a href="http://java.sun.com">java.sun.com</a>. Get the .rpm.bin version. The file I got was called jdk-6u6-linux-i586-rpm.bin.</p>
<pre>chmod +x jdk-6u6-linux-i586-rpm.bin
./jdk-6u6-linux-i586-rpm.bin
wget http://mirrors.dotsrc.org/jpackage/1.7/generic/non-free/RPMS/java-1.6.0-sun-compat-1.6.0.06-1jpp.i586.rpm
rpm -Uvh jdk-6u1-linux-i586.rpm java-1.6.0-sun-compat-1.6.0.01-1jpp.i586.rpm</pre>
<p>With the JDK successfully installed (hopefully) we use Alternatives to select the Sun JDK:</p>
<p>/usr/sbin/alternatives &#8211;config java</p>
<p>Make sure the selected version is along the lines of /usr/lib/jvm/jre-1.6.0-sun/bin/java.</p>
<p>At this point java -version should give something like:</p>
<pre>java version "1.6.0_06"
Java(TM) SE Runtime Environment (build 1.6.0_06-b02)
Java HotSpot(TM) Client VM (build 10.0-b22, mixed mode, sharing)</pre>
<p>Now to add some environment variables:</p>
<pre>vi /etc/profile.d/java.sh</pre>
<p>Add the following:</p>
<pre>export JAVA_HOME="/usr/java/jdk1.6.0_06"
export JAVA_PATH="$JAVA_HOME"
export PATH="$PATH:$JAVA_HOME"</pre>
<p>Note that JAVA_HOME is not set to &#8220;/usr/java/jdk1.6.0_06/bin&#8221;. I don&#8217;t think this is the standard but it&#8217;s an easy way to get CruiseControl to work (<a href="http://www.centos.org/modules/newbb/viewtopic.php?viewmode=flat&amp;topic_id=5717&amp;forum=28">see here</a>).</p>
<p>You will also need to restart your session for these changes to take effect or just export the variables directly to the prompt.</p>
<h3>Get CruiseControl</h3>
<p>Download the latest <a title="CruiseControl" href="http://sourceforge.net/project/showfiles.php?group_id=23523&amp;package_id=16338">2.7.X CruiseControl binary</a>. My version is cruisecontrol-bin-2.7.2.zip.</p>
<pre>unzip cruisecontrol-bin-2.7.2.zip -d /opt
ln -s /opt/cruisecontrol-bin-2.7.2/ /opt/cruisecontrol</pre>
<p>CruiseControl is bow installed in /opt/cruisecontrol-bin-2.7.2/ which is symlinked by /opt/cruisecontrol/</p>
<h3>Setup phpUnderControl and CruiseControl</h3>
<p>A more thorough guide can be found in the <a title="phpUnderControl" href="http://www.phpundercontrol.org/documentation.html">phpUnderControl Documentation</a>.</p>
<p>To patch the CruiseControl installation you should be able to simply to:</p>
<pre>phpuc install /opt/cruisecontrol</pre>
<p>If not, try this:</p>
<pre>cd /opt/
<code>svn co svn://www.phpunit.de/browser/phpUnderControl/tags/0.4.2 phpundercontrol
phpundercontrol/bin/phpuc.php install /opt/cruisecontrol</code></pre>
<p>And that&#8217;s pretty much it! I&#8217;ll just set up the example project so you can see it all in action:</p>
<pre>phpuc example /opt/cruisecontrol</pre>
<p>And to start cruisecontrol:</p>
<pre>cd /opt/cruisecontrol/
./cruisecontrol.sh</pre>
<p>Give it a while to setup. Once it&#8217;s all done you should be able to access the interface at:</p>
<p>http://localhost:8080/</p>
<p>By now you should have a working phpUC setup on your CentOS 5 machine and the example project failing the build process. Setting up your own projects is a bit more involved &#8211; follow the guide in the documentation for more details. As for the best way to make use of phpUC and optimal project layouts etc. I will have to get back to you as I haven&#8217;t yet played around much.</p>
<p>Please let me know if this helped you. If you come across any problems I will be happy to try and help.</p>
<h2>Resources</h2>
<ul>
<li>Setting up <a title="CentOS 5 SVN and Trac" href="http://www.daniel-skinner.co.uk/setup-subversion-and-trac-on-centos-5/06/01/2008">S</a><a title="CentOS 5 SVN and Trac" href="http://www.daniel-skinner.co.uk/setup-subversion-and-trac-on-centos-5/06/01/2008">VN (and optionally Trac) on CentOS 5</a></li>
<li>Alternative <a title="Install PHPUnderControl on CentOS 5.1" href="http://f13o.blogspot.com/2008/06/install-phpundercontrol-on-centos-51.html">PHP5.2 and phpUC Setup</a></li>
<li><a title="Yum Repository" href="http://www.jasonlitka.com/yum-repository/">Jason Litka&#8217;s Yum Repository</a></li>
<li>Detailed guide to installing <a title="Java on CentOS" href="http://wiki.centos.org/HowTos/JavaOnCentOS">Java on CentOS</a></li>
<li><a href="http://www.phpundercontrol.org/documentation.html">phpUnderControl documentation</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.daniel-skinner.co.uk/php-under-control-svn-centos-5/12/06/2008/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>MooTools and Swiff: Slideshow / Thumbnail Gallery</title>
		<link>http://www.daniel-skinner.co.uk/mootools-and-swiff-slideshow-thumbnail-gallery/17/05/2008</link>
		<comments>http://www.daniel-skinner.co.uk/mootools-and-swiff-slideshow-thumbnail-gallery/17/05/2008#comments</comments>
		<pubDate>Sat, 17 May 2008 20:05:23 +0000</pubDate>
		<dc:creator>Daniel Skinner</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[mootools]]></category>
		<category><![CDATA[slideshow]]></category>
		<category><![CDATA[swf]]></category>
		<category><![CDATA[swiff]]></category>

		<guid isPermaLink="false">http://www.daniel-skinner.co.uk/mootools-and-swiff-slideshow-thumbnail-gallery/17/05/2008</guid>
		<description><![CDATA[I have recently launched a website for the Bramham Lodge Residential Development in Bramham Village.
The site features a neat Slideshow / Thumbnail Gallery implementation using MooTools and Flash (utilising the Swiff utility of MooTools 1.2).
A demo can be seen on the Bramham Lodge Apartment page.
The SlideShow makes use of Flash to create easily customisable image [...]]]></description>
			<content:encoded><![CDATA[<p>I have recently launched a website for the <a href="http://www.wbaileybramham.co.uk" title="Bramham Lodge Luxury Gated Housing">Bramham Lodge Residential Development</a> in <a href="http://www.wbaileybramham.co.uk/bramham-village/" title="Bramham Village, West Yorkshire">Bramham Village</a>.</p>
<p>The site features a neat Slideshow / Thumbnail Gallery implementation using MooTools and Flash (utilising the Swiff utility of MooTools 1.2).</p>
<p>A demo can be seen on the <a href="http://www.wbaileybramham.co.uk/bramham-lodge-plots/plot1/" title="Bramham Lodge Historical Listed Building Renovation">Bramham Lodge Apartment page</a>.</p>
<p>The SlideShow makes use of Flash to create easily customisable image transition effects that are not possible with JavaScript alone. A collection of MooTools classes are employed to mange the Swiff interface and control the slideshow.</p>
<p><strong>Key Features</strong></p>
<ul>
<li>Images are not hard-coded into flash: no need to recompile the SWF when  adding/removing or re-ordering the gallery as all data is presented in the <acronym title="eXtensible HyperText Markup Language">XHTML</acronym> markup.</li>
<li>Extensible and customisable: The slideshow class makes use of MooTools Events so that add-on classes can be created for bolt-on features whilst being kept separate from the core functionality.</li>
<li>Accessible: No content is hard-coded into flash, search engines are able to index all the information.</li>
</ul>
<p>The modular nature of the code and the ability to change the implementation using bolt-on functionality has allowed me to re-use the same set of classes on an upcoming project in a completely different fashion, making use of the great features of Flash without sacrificing indexable content and accessibility.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.daniel-skinner.co.uk/mootools-and-swiff-slideshow-thumbnail-gallery/17/05/2008/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>External CSS won&#8217;t load in IE7</title>
		<link>http://www.daniel-skinner.co.uk/external-css-wont-load-in-ie7/05/04/2008</link>
		<comments>http://www.daniel-skinner.co.uk/external-css-wont-load-in-ie7/05/04/2008#comments</comments>
		<pubDate>Sat, 05 Apr 2008 02:04:29 +0000</pubDate>
		<dc:creator>Daniel Skinner</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[charset]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[encoding]]></category>
		<category><![CDATA[ie7]]></category>
		<category><![CDATA[utf8]]></category>

		<guid isPermaLink="false">http://www.daniel-skinner.co.uk/external-css-wont-load-in-ie7/05/04/2008</guid>
		<description><![CDATA[I just spent a while wondering why IE7 wouldn&#8217;t make use of an external stylesheet when it worked in Firefox no problems.
The page is in UTF-8 and the .css file was also encoded in UTF-8 but IE7 simply refused to render the page using the CSS rules.
I have no idea  what the problem is but [...]]]></description>
			<content:encoded><![CDATA[<p>I just spent a while wondering why IE7 wouldn&#8217;t make use of an external stylesheet when it worked in Firefox no problems.</p>
<p>The page is in UTF-8 and the .css file was also encoded in UTF-8 but IE7 simply refused to render the page using the CSS rules.</p>
<p>I have no idea  what the problem is but if you are having similar issues try putting <strong>@charset “UTF-8″;</strong> at the top of your external stylesheet &#8211; it worked for me.</p>
<p>Does anyone know what the underlying issue is?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.daniel-skinner.co.uk/external-css-wont-load-in-ie7/05/04/2008/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Link Targets in XHTML</title>
		<link>http://www.daniel-skinner.co.uk/link-targets-in-xhtml/15/03/2008</link>
		<comments>http://www.daniel-skinner.co.uk/link-targets-in-xhtml/15/03/2008#comments</comments>
		<pubDate>Sat, 15 Mar 2008 13:33:56 +0000</pubDate>
		<dc:creator>Daniel Skinner</dc:creator>
				<category><![CDATA[Guides]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[mootools]]></category>
		<category><![CDATA[xhtml]]></category>

		<guid isPermaLink="false">http://www.daniel-skinner.co.uk/link-targets-in-xhtml/15/03/2008</guid>
		<description><![CDATA[I always prefer to build websites in valid XHTML as it allows for a stricter, more maintainable envorinment to build websites than traditional HTML. However, there are a few features of HTML I like to make use of.
For example, making links open in new windows using the target attribute is unsupported by XHTML.

There are two [...]]]></description>
			<content:encoded><![CDATA[<p>I always prefer to build websites in <strong>valid <acronym title="eXtensible HyperText Markup Language">XHTML</acronym></strong> as it allows for a stricter, more maintainable envorinment to build websites than traditional <acronym title="HyperText Markup Language">HTML</acronym>. However, there are a few features of HTML I like to make use of.</p>
<p>For example, making links open in new windows using the <code>target</code> attribute is unsupported by XHTML.</p>
<p><span id="more-14"></span></p>
<p>There are two solutions I know of to get around this:</p>
<h4>1. JavaScript</h4>
<p>The DOM specification allows the use of the <code>target</code> attrbriute. So, mark each link you want to open in a new window using <code>rel="external"</code>. When the page loads use JavaScript to find all these links and add a <code>target="_blank"</code> to each using DOM.</p>
<p>In <strong>MooTools</strong> the code would look like:</p>
<pre type="javascript">
window.addEvent('domready', function() {
    // rel="external" links open in new window
    $$('a[href][rel="external"]').each(function(anchor) {
        anchor.setProperty('target', '_blank');
    });
});</pre>
<p>For a raw JavaScript solution and more information on this approach see this <a href="http://www.sitepoint.com/article/standards-compliant-world" title="Sitepoint Article: New Windows for links in XHTML" rel="nofollow external">Sitepoint article</a>.</p>
<h4>2. Extending XHTML</h4>
<p>Simply extend XHTML to support the <code>target</code> attribute and continue using <code>target="_blank"</code> whilst still producing perfectly valid XHTML!</p>
<p>Essentially you extend the default XHTML <acronym title="Document Type Definition">DTD</acronym> to enable the XHTML Target Module (which is not enabled by default) and then modify the page DOCTYPE definition to point to the extended <acronym title="Document Type Definition">DTD</acronym>.</p>
<p>The full details and how to implement it can be found here at <a href="http://www.texastar.com/tips/2004/target_blank.shtml" title="TexaStar: XHTML Modularization" rel="nofollow external">TexaStar</a>.</p>
<p>Currently I am using the JavaScript workaround. However, modifying the XHTML definition to make it work for me is a very elegant solution that I would look to implement in the future.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.daniel-skinner.co.uk/link-targets-in-xhtml/15/03/2008/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Chaining with MooTools 1.2 &#8211; Tutorial</title>
		<link>http://www.daniel-skinner.co.uk/chaining-with-mootools-12-tutorial/31/01/2008</link>
		<comments>http://www.daniel-skinner.co.uk/chaining-with-mootools-12-tutorial/31/01/2008#comments</comments>
		<pubDate>Thu, 31 Jan 2008 22:30:11 +0000</pubDate>
		<dc:creator>Daniel Skinner</dc:creator>
				<category><![CDATA[Guides]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[chain]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[mootools]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.daniel-skinner.co.uk/chaining-with-mootools-12-tutorial/31/01/2008</guid>
		<description><![CDATA[A short tutorial on how to use Chaining in MooTools.]]></description>
			<content:encoded><![CDATA[<p>This guide will show how powerful the <strong>MooTools Chain class</strong> is. In MooTools chaining facilitates the execution of a stack of functions sequentially and is extremely powerful. I have only tested this in <strong>MooTools v1.2 beta 2</strong>.</p>
<p>I will be posting more of these short guides on using MooTools in the upcoming weeks. Each will focus on a small problem and solve it with MooTools with the aim of being a useful way to learn the framework.</p>
<p><span id="more-15"></span></p>
<h3>Chaining you say!</h3>
<p><strong>Chaining</strong> is very powerful and whilst it is similar to <code>Effect.Queue</code> in Script.aculo.us, it can do much more! The aim of this brief tutorial is to show you how to use <strong>MooTools Chaining</strong> in the context of queueing effects coupled with other arbitrary actions. However, you will see that you can easily apply Chaining to do much more than that.</p>
<p>From the MooTools 1.2 Docs:</p>
<blockquote><p>A Utility Class which executes functions one after another, with each function firing after completion of the previous. Its methods can be implemented with <code><a href="http://docs12b.mootools.net/Class/Class/#Class:implement" title="MooTools Documentation: Class:implement" rel="external nofollow">Class:implement</a></code> into any <code><a href="http://docs12b.mootools.net/Class/Class" title="MooTools Documentation: Class" rel="external nofollow">Class</a></code>, and it is currently implemented in <code>Fx</code> and <code>Request</code>. In <code>Fx</code>, for example, it is used to create custom, complex animations.</p></blockquote>
<p><code>Chain</code> can be used as a stand-alone class but becomes much more powerful if you implement it into classes of your own.</p>
<p>In this tutorial I will be creating a class which implements <code>Chain</code>. The <code>Chain</code> class belongs to the <code>Class.Extras</code> component so you will need to make sure that you select <code>Class.Extras</code> and all its dependencies when downloading MooTools.</p>
<h3>Implementing Chain</h3>
<p>First of all we need to implement the methods and properties of the <code>Chain</code> class into our own class:</p>
<pre lang="javascript">var ChainExample = new Class({

  Implements: [Chain]

});</pre>
<p>Our class now has the following methods available to it:</p>
<ul>
<li><strong><code>Chain::chain</code></strong> &#8211; Pass any number of functions to add them to the bottom of the call stack.</li>
<li><strong><code>Chain::callChain</code></strong> &#8211; Pops a function off the top of the call stack and executes it.</li>
<li><strong><code>Chain::clearChain</code></strong> &#8211; Removes all functions from the call stack without executing any.</li>
</ul>
<h3>Using Chain to Execute Actions in Order</h3>
<p>Now we have implemented <code>Chain</code> into our <code>ChainExample</code> class we are ready to make use of the functionality it provides.</p>
<p>The <code>ChainExample</code> class will add events to three button elements. When a button element is clicked a corresponding panel will appear. Before this happens all other panels will be faded out. Chaining is used to make sure that these events happen in the order we want.</p>
<p>The full code for <code>ChainExample</code> is:</p>
<pre lang="javascript">
/**

 * Add events to buttons. Clicking a button will hide all panels before showing the panel corresponding to that button

 */

var ChainExample = new Class({

    Implements: [Chain],

    /**

     * Define the element ID of the button and the element ID of the corresponding panel

     */

    actions: new Hash({

        'button-one': 'panel-one',

        'button-two': 'panel-two',

        'button-three': 'panel-three'

    }),

    /**

     * An Array to store an effect instance for each panel

     */

    effects: [],

    initialize: function()

    {

        /**

         * Add an onclick event to each button. Clicking a button calls the showPanel method

         */

        this.actions.getKeys().each(function(buttonId) {

            $(buttonId).addEvent('click', this.showPanel.bindWithEvent(this));

        },this);

        /**

         * Create an Fx object for each panel

         */

         this.actions.getValues().each(function(panelId) {

            this.effects[panelId] = new Fx.Tween($(panelId), 'opacity', { duration: 'short', onComplete: function() { this.callChain();}.bind(this)});

         }, this);         /**

          * Initialize by hiding all panels, note the call to callChain to cause stuff to happen

          */

        this.hideAll();

        this.callChain();

    },

    /**

     * Add the a actions required to hide all panels to the Chain call stack

     */

    hideAll: function()

    {

        /**

         * loop each panel and Chain: 1. fade the panel, 2. set the display property to "none" after the effect has finished.

         *

         * Note that this function does not actually cause anything to happen, it simply adds actions to the Chain

         */

        this.actions.getValues().each(function(panelId) {

            this.chain(

                function() { this.effects[panelId].start(0); },

                function() { $(panelId).setStyles({'display': 'none'}); this.callChain(); }

            );

        },this);

    },

    /**

     * Handle a button click by fading and hiding all open panels and then appearing the corresponding panel

     */

    showPanel: function(event)

    {

        this.hideAll();

        var panel = this.actions.get(event.target.get('id'));

        this.chain(

            function() { $(panel).setStyles({'display': 'block', 'opacity': '0'}); this.callChain(); },

            function() { this.effects[panel].start(1); }

        );

        this.callChain(); //this call starts the chain. Since each function in the call also makes a call to callChain the entire stack will be executed

    }

});

window.addEvent('domready',

    function()

    {

        var myChain = new ChainExample();

    }

);</pre>
<p>I will only go through the code relevant to chaining in detail. Lets have a look at each important part:</p>
<h4><code>ChainExample::initialize</code></h4>
<p>In the constructor we bind behaviours to the buttons and create <code>Fx</code> objects for the panels. Notice the custom <code>onComplete</code> callback provided for each <code>Fx</code> instance. This tells the internal chain stack to pop the next function and run it right after the effect has finished. We are now able to execute any function as soon as the effect completes.</p>
<h4><code>ChainExample::hideAll</code></h4>
<p>Look at this method carefully. A call to <code>ChainExample::hideAll()</code> does not actually hide the panels. The method adds to the chain stack a set of functions that will fade and hide each panel in order. To get the panels to actually hide we must execute the chain stack using <code>this.callChain()</code>.</p>
<p>Notice how the second function passed to <code>this.chain</code> invokes <code>this.callChain()</code>. The function is telling the chain stack to continue onto the next function by itself.</p>
<p>Another important thing to note is that there is no need to bind the function passed to <code>this.chain</code> as this is dealt with internally.</p>
<h4><code>ChainExample::showPanel</code></h4>
<p>This is the event handling function that will show a panel.</p>
<p>First off a call to <code>ChainExample::hideAll()</code> is made. Remember that this method doesn&#8217;t cause anything to happen immediately. At this point we have added all the steps needed to hide all the panels to the chain stack. We then proceed to add steps which will show the correct panel.</p>
<p>Once the entire chain stack is set up <code>this.callChain()</code> is executed and the entire stack will be called because each step makes its own call to <code>this.callChain()</code> once it has finished.</p>
<p>That&#8217;s the basics of <code>Chain</code>. We have created a class which allows us to combine any number of effects and arbitrary functions and ensure that the are executed in the order we want. Hence the basic idea of <code>Chain</code> is to create a stack of functions and execute them in the order you please whenever you please.</p>
<h3>Downloadable Demo</h3>
<p>I have put together a quick demo so that you can see the code in action. Download the demo <a href="http://www.destiny-denied.co.uk/files/moo-chain.zip">here</a>.</p>
<h3>Further Considerations</h3>
<p>In my example, every function in the chain stack makes a call to <code>this.callChain()</code> once is has completed.  This means that as soon as the first function is executed (by manually invoking <code>this.callChain()</code>) the entire stack will run from start to finish automatically. <code>Chain</code> can be used in a different fashion where <code>Chain::callChain()</code> is always invoked externally. As a crude modification to my example, every click on a button could invoke <code>this.callChain()</code>. Thus each button click takes one further step to completion of the actions.</p>
<p>If you need to add timings and delays consider using <code><a href="http://docs12b.mootools.net/Native/Function#Function:delay" title="MooTools Documentation: Function:Delay" rel="external nofollow">Function:delay</a></code> to delay the invocation of <code>Chain::callChain()</code>.</p>
<p>It is also possible to use multiple chains in the same class for even more complex behaviour. This would involve using separate instances of the Chain class directly.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.daniel-skinner.co.uk/chaining-with-mootools-12-tutorial/31/01/2008/feed</wfw:commentRss>
		<slash:comments>31</slash:comments>
		</item>
		<item>
		<title>Lightview by Nick Stakenburg</title>
		<link>http://www.daniel-skinner.co.uk/lightview-by-nick-stakenburg/12/01/2008</link>
		<comments>http://www.daniel-skinner.co.uk/lightview-by-nick-stakenburg/12/01/2008#comments</comments>
		<pubDate>Sat, 12 Jan 2008 14:41:59 +0000</pubDate>
		<dc:creator>Daniel Skinner</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[lightbox]]></category>
		<category><![CDATA[lightview]]></category>
		<category><![CDATA[mootools]]></category>
		<category><![CDATA[protoype]]></category>
		<category><![CDATA[scriptaculous]]></category>
		<category><![CDATA[slimbox]]></category>

		<guid isPermaLink="false">http://www.daniel-skinner.co.uk/lightview-by-nick-stakenburg/12/01/2008</guid>
		<description><![CDATA[Nick has just released Lightview (another neat project) to the public. Lightview allows you to augment your images. It provides an excellent way of creating a slideshow or simply showing a large version of a thumbnail without resorting to popups. Effects are used to create very appealing slideshows and image galleries.
From the Lightview project site:

Clean: [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.nickstakenburg.com/" title="Nick Stakenburg" rel="external">Nick</a> has just released Lightview (another neat project) to the public. <a href="http://www.nickstakenburg.com/projects/lightview/" title="Lightview by Nick Stakenburg" rel="external">Lightview</a> allows you to augment your images. It provides an excellent way of creating a slideshow or simply showing a large version of a thumbnail without resorting to popups. Effects are used to create very appealing slideshows and image galleries.</p>
<p>From the Lightview project site:</p>
<ul>
<li><span>Clean</span>: Designed to compliment your images.</li>
<li><span>Fast</span>: Images and their neighbours are preloaded.</li>
<li><span>Easy to customize</span>: You don&#8217;t even have to know CSS.</li>
<li><span>Rounded</span>: Adjustable rounded corners, without PNGs.</li>
<li><span>Smart resizing</span>: Images will always fit on your screen.</li>
<li><span>Slideshow</span>: One button slideshow.</li>
<li><span>Effects</span>: Using Scriptaculous.</li>
<li><span>Works on all modern browsers</span></li>
</ul>
<p>Lightview is similar to <a href="http://www.huddletogether.com/projects/lightbox2/" title="Lightbox 2" rel="external">Lightbox 2</a> and both are built with Prototype and Scriptaculous. However, there are a few differences I noticed:</p>
<ul>
<li>The morphing effect that Lightview uses is a refreshing change (probably because I have seen the Lightbox effects too many times!).</li>
<li>Lightview allows you to customise many of the visual aspects of the viewer programatically. For example, the background colour and corner radius.</li>
<li>Lightview supports a customisable slideshow option which Lightbox lacks.</li>
<li>Lightview uses the caption attribute of the <code>&lt;a&gt;</code> tag to give images a caption. This attribute is not valid XHTML and thus its usage will produce invalid markup.  I would suggest using a convention similar to that used by MooTools Tips: <code>title="image title :: caption"</code></li>
<li>Lightbox has been around for a while and is well tested and proven.</li>
</ul>
<p>Personally I like the look of Lightview but I wouldn&#8217;t use it because I don&#8217;t like invalid markup!</p>
<p>If you are interested in something similar for the MooTools framework, try <a href="http://www.digitalia.be/software/slimbox" title="Slimbox: Lightbox for MooTools" rel="external">Slimbox</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.daniel-skinner.co.uk/lightview-by-nick-stakenburg/12/01/2008/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Trying out MooTools 1.2 Beta 1</title>
		<link>http://www.daniel-skinner.co.uk/trying-out-mootools-12-beta-1/02/12/2007</link>
		<comments>http://www.daniel-skinner.co.uk/trying-out-mootools-12-beta-1/02/12/2007#comments</comments>
		<pubDate>Sun, 02 Dec 2007 21:45:26 +0000</pubDate>
		<dc:creator>Daniel Skinner</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[mootools]]></category>

		<guid isPermaLink="false">http://www.daniel-skinner.co.uk/trying-out-mootools-12-beta-1/02/12/2007</guid>
		<description><![CDATA[Whilst I commonly use Prototype and Script.aculo.us as my preferred JavaScript libraries, I recently decided to try out MooTools as an alternative.]]></description>
			<content:encoded><![CDATA[<p>Whilst I commonly use <a href="http://www.prototypejs.org/" title="Prototype Javascript Library" rel="external">Prototype</a> and <a href="http://script.aculo.us/" title="Script.aculo.us Effects for Prototype" rel="external">Script.aculo.us</a> as my preferred JavaScript libraries, I recently decided to try out MooTools as an alternative.</p>
<p><q>MooTools is a <em>compact</em>, <em>modular</em>, <em>Object-Oriented</em> JavaScript framework designed for the intermediate to advanced JavaScript developer. It allows you to write <em>powerful</em>, <em>flexible</em>, and <em>cross-browser</em> code with its elegant, well documented, and <em>coherent API</em></q> (<a href="http://mootools.net" title="Mootools - The Compact Javascript Framework" rel="external">mootools.net</a>).</p>
<p>I downloaded MooTools version 1.2 beta 1, which is feature complete but not fully tested. If you are interested in what&#8217;s new in 1.2, see the <a href="http://blog.mootools.net/2007/11/14/mootools-1-2-beta-1" title="Mootools 1.2 Beta 1" rel="external">MooTools blog: 1.2 beta 1</a>.</p>
<p>My first impressions of MooTools were good and whilst I haven&#8217;t mastered the &#8216;Moo way of doing things,&#8217; I got to grips with it quickly.</p>
<h3>Comparison with Prototype</h3>
<p>This is not an exhaustive comparison, it&#8217;s just my first impressions.</p>
<ul>
<li>In MooTools effects are a Core component. With Prototype you need an additional effects library (e.g Script.aculo.us).</li>
<li>When downloading MooTools you are able to select only the components you need and you are given the option of compressing the library.</li>
<li>I prefer Prototype&#8217;s documentation style. Initially I found MooTools hard to learn because the API documentation does not give sufficient examples of good practice etc&#8230;</li>
<li>I&#8217;m a fan of <a href="http://dean.edwards.name/weblog/2006/03/base/" title="Dean Edwards: Base.js" rel="external">Dean Edward&#8217;s Base</a> and MooTools has a really nice implementation of it.</li>
<li>MooTools acknowledges Prototype as an awesome library and a lot of code is based on Prototype.</li>
<li>Currently there is no central repository for MooTools extensions that I know of.</li>
</ul>
<p>Prototype 1.6.0 weighs in at 121KB. Similarly, MooTools 1.2b1 (all components, uncompressed, no documentation) is 120KB. However, there is no need for an additional effects library and you can cut down the size of the MooTools library by removing unwanted components.</p>
<p>As I learn more of MooTools I will post more advice and tips on using MooTools from a Prototype background.</p>
<h3>Resources</h3>
<ul>
<li><a href="http://mootools.net" title="MooTools" rel="external">MooTools.net</a></li>
<li><a href="http://blog.mootools.net/2007/11/14/mootools-1-2-beta-1" title="MooTools v1.2 beta 1" rel="external">What&#8217;s new in MooTools 1.2</a></li>
<li><a href="http://docs12b.mootools.net/" title="MooTools 1.2 Documentation (BETA)" rel="external">Mootools 1.2 Documentation</a></li>
<li><a href="http://greghoustondesign.com/demos/mocha/" title="MooTools Mocha UI" rel="external">MooTools Mocha UI</a> (MooTools/Canvas UI class)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.daniel-skinner.co.uk/trying-out-mootools-12-beta-1/02/12/2007/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Starbox &#8211; Rating stars for prototype</title>
		<link>http://www.daniel-skinner.co.uk/starbox-rating-stars-for-prototype/18/11/2007</link>
		<comments>http://www.daniel-skinner.co.uk/starbox-rating-stars-for-prototype/18/11/2007#comments</comments>
		<pubDate>Sun, 18 Nov 2007 22:47:37 +0000</pubDate>
		<dc:creator>Daniel Skinner</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[prototip]]></category>
		<category><![CDATA[prototype]]></category>
		<category><![CDATA[scripteka]]></category>
		<category><![CDATA[starbox]]></category>

		<guid isPermaLink="false">http://www.daniel-skinner.co.uk/starbox-rating-stars-for-prototype/18/11/2007</guid>
		<description><![CDATA[Starbox: A new Prototype based rating system]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.nickstakenburg.com/" title="Nick Stakenburg" rel="external">Nick Stakenburg</a> (creator of <a href="http://www.daniel-skinner.co.uk/prototip-1-1-0-final/11/11/2007" title="Prototip 1.1.0 Released">Prototip</a>) has just submitted a new project to <a href="http://scripteka.com/" title="Scripetka: Prototype Extensions Library" rel="external">Scripteka</a>. &#8220;Starbox&#8221; is a Prototype based rating system, allowing you to easily create all kinds of rating boxes using just one image. Additionally, you can use Script.aculo.us to add effects.</p>
<p>The Starbox rating system is a new interactive feature which allows users to submit their own rating towards a particular subject. This system is ideal for a majority of websites who wish to include a rating system, which promotes the interactivity and feedback of users. The Starbox rating system is particularly useful for websites such as Amazon, where people can write their own review based on an item.</p>
<p>Starbox is not the first rating system to be created for Prototype and there are other more mature choices available on Scripteka including <a href="http://www.edesign.nl/rater/" title="Rater 2.0" rel="external">Rater 2.0</a>, which allows for more customisation of the rating control but has larger overheads. You might also want to check out <a href="http://livepipe.net/projects/control_rating/" title="Control.Rating" rel="external">Control.Rating</a>, especially if you are using other components of <a href="http://livepipe.net/projects/control_suite/" title="LivePipe: Control suite" rel="external">Control Suite from LivePipe</a>. Personally, I like the look of Starbox and if it is as simple to use, cleanly coded and well defined as Prototip it will be my rating system of choice if I ever find the need to use one.</p>
<p>I recommend subscribing to the <a href="http://scripteka.com/feed" title="Scripteka RSS Feed" rel="external">Scripteka feed</a>, as I am sure it will become a valuable resource when looking for new extensions based on Prototype.</p>
<p>For downloads, interactive demos and more, see <a href="http://www.nickstakenburg.com/projects/starbox/" title="Starbox" rel="external">Starbox by Nick Stakenburg</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.daniel-skinner.co.uk/starbox-rating-stars-for-prototype/18/11/2007/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Prototip 1.1.0 Final Released</title>
		<link>http://www.daniel-skinner.co.uk/prototip-1-1-0-final/11/11/2007</link>
		<comments>http://www.daniel-skinner.co.uk/prototip-1-1-0-final/11/11/2007#comments</comments>
		<pubDate>Sun, 11 Nov 2007 15:17:28 +0000</pubDate>
		<dc:creator>Daniel Skinner</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[prototip]]></category>
		<category><![CDATA[prototype]]></category>
		<category><![CDATA[scripteka]]></category>

		<guid isPermaLink="false">http://www.daniel-skinner.co.uk/prototip-1-1-0-final/11/11/2007</guid>
		<description><![CDATA[Prototip 1.1.0 Final has now been released.]]></description>
			<content:encoded><![CDATA[<p>Prototip 1.1.0 Final has now been released. Prototip 1.1.0 is now guaranteed to work with the final version of Prototype 1.6.0 and extra values for the hooking property have been added since the preview release.</p>
<p>The hooking property takes a few extra values now, allowing you to hook tips to the: topMiddle; bottomMiddle; leftMiddle; and rightMiddle of elements.</p>
<p>All those using the preview release should upgrade to ensure full compatibility with Prototype.</p>
<p>More details can be found at <a href="http://www.nickstakenburg.com/projects/prototip/" rel="external" title="Prototip 1.1.0">Prototip 1.1.0 Final by Nick Stakenburg</a>.</p>
<p>Don&#8217;t forget to rate Prototip as your favourite Prototype based tooltip library on <a href="http://scripteka.com/" rel="external" title="Prototype Extensions Library">Scripteka</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.daniel-skinner.co.uk/prototip-1-1-0-final/11/11/2007/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Scripteka, Prototype 1.6 and Scriptaculous 1.8 Released!</title>
		<link>http://www.daniel-skinner.co.uk/prototype-16-and-scriptaculous-18-released/08/11/2007</link>
		<comments>http://www.daniel-skinner.co.uk/prototype-16-and-scriptaculous-18-released/08/11/2007#comments</comments>
		<pubDate>Thu, 08 Nov 2007 15:12:30 +0000</pubDate>
		<dc:creator>Daniel Skinner</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[prototip]]></category>
		<category><![CDATA[prototype]]></category>
		<category><![CDATA[scriptaculous]]></category>
		<category><![CDATA[scripteka]]></category>

		<guid isPermaLink="false">http://www.daniel-skinner.co.uk/prototype-16-and-scriptaculous-18-released/08/11/2007</guid>
		<description><![CDATA[Prototype 1.6.0 Final has now been released on the same day as Scriptaculous 1.8.0. Scripteka prototype resource goes live!]]></description>
			<content:encoded><![CDATA[<p>Prototype 1.6.0 Final has now been released on the same day as Scriptaculous 1.8.0.</p>
<p>In a previous post about <a href="http://www.daniel-skinner.co.uk/using-prototype/21/10/2007" title="Using Prototype">Prototype 1.6.0 RC1</a>, I discussed many of the improvements this release will bring. Prototype 1.6.0 is the most significant release in over two years bringing a completely rewritten Class API, new enchancements to the DOM API and more.</p>
<p>Scriptaculous 1.8.0 was also released on the same day and is fully compatible with Prototype 1.6.0 final. The latest version brings many performance improvements and bug fixes and a few new features, including support for playing .mp3 sounds! Future releases of Scriptaculous 1.x will be bug releases only. A preview version of Scriptaculous 2.0 is expected soon!</p>
<p><a href="http://www.daniel-skinner.co.uk/prototip-110-preview/29/10/2007" title="Prototip 1.1.0 Preview">Prototip 1.1.0</a> is expected to be released shortly after the final release of Prototype 1.6.0.</p>
<p>There is also a fantastic new website which recently went live called <a href="http://scripteka.com/" rel="external" title="Scripteka: Prototype extensions library">Scripteka</a>. Scripteka is a site that many users of prototype have been waiting for, a central resource for all libraires, extensions and add-ons created using the prototype framework. It features a full rating system and tagging. Scripteka is itself an application built with prototype.</p>
<p>See the full post on the <a href="http://prototypejs.org/2007/11/7/prototype-1-6-0-script-aculo-us-1-8-0-and-the-bungee-book-now-available/" rel="external" title="Prototpye 1.6.0 Release">release of Prototype 1.6.0</a> for more info.</p>
<p>See the full post on the <a href="http://mir.aculo.us/2007/11/7/script-aculo-us-1-8-prototype-1-6-and-the-book-released" rel="external" title="Scriptaculous 1.8.0 Release">release of Scriptaculous 1.8.0</a> for more info.</p>
<p>Prototip can be found at <a href="http://www.nickstakenburg.com/projects/prototip/" rel="external" title="Prototip 1.1.0">Nick Stakenburg&#8217;s Prototip</a> site.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.daniel-skinner.co.uk/prototype-16-and-scriptaculous-18-released/08/11/2007/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
