<?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>fakedarren &#187; JavaScript</title>
	<atom:link href="http://blog.fakedarren.com/category/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.fakedarren.com</link>
	<description>Adventures in teh interwebz</description>
	<lastBuildDate>Sat, 14 Aug 2010 12:58:56 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>A rough guide to upgrading from MooTools 1.1</title>
		<link>http://blog.fakedarren.com/2010/01/a-rough-guide-to-upgrading-from-mootools-1-1/</link>
		<comments>http://blog.fakedarren.com/2010/01/a-rough-guide-to-upgrading-from-mootools-1-1/#comments</comments>
		<pubDate>Fri, 01 Jan 2010 19:34:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[MooTools]]></category>

		<guid isPermaLink="false">http://blog.fakedarren.com/?p=201</guid>
		<description><![CDATA[I've recently been working on the upgrade layer for MooTools, that allows users of MooTools 1.1 to easily upgrade to the latest version of our favourite framework. If you have a complex site, the following may not be relevant, but hopefully following the steps below will help the majority of users to update their code.]]></description>
			<content:encoded><![CDATA[<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Before you read this &#8211; please read the &lt;a href=&#8221;http://mootools.net/blog/2009/12/31/mootools-1-1-upgrade-layer-beta/&#8221;&gt;post on the official MooTools site&lt;/a&gt;.</div>
<div>Before you read this &#8211; please read the <a href="http://mootools.net/blog/2009/12/31/mootools-1-1-upgrade-layer-beta/" onclick="pageTracker._trackPageview('/outgoing/mootools.net/blog/2009/12/31/mootools-1-1-upgrade-layer-beta/?referer=');">post on the official MooTools site</a>.</div>
<p>I&#8217;ve recently been working on the <a href="http://mootools.net/download#upgrade-helper" onclick="pageTracker._trackPageview('/outgoing/mootools.net/download_upgrade-helper?referer=');">upgrade layer for MooTools</a>, that allows users of MooTools 1.1 to easily upgrade to the latest version of our favourite framework. If you have a complex site, the following may not be relevant, but hopefully following the steps below will help the majority of users to update their code.</p>
<p>This isn&#8217;t a complete guide &#8211; but these are the steps I would take. Make sure you read through <a href="http://github.com/mootools/mootools-upgrade-helper#readme" onclick="pageTracker._trackPageview('/outgoing/github.com/mootools/mootools-upgrade-helper_readme?referer=');">the readme</a> first; there are a few breaking changes and subtle API differences. But for simple sites, the following should work.</p>
<h2>Element getters and setters</h2>
<p>One frequently used part of the API from 1.1 was Element setters and getters. Previously, you had methods such as <em>$(el).getValue(val)</em> and <em>$(el).setText(text)</em>. These changed to <em>$(el).set(&#8217;value&#8217;, val)</em> and <em>$(el).set(&#8217;text&#8217;, text)</em>. This is a quite simple change and a good one to start with. The complete list of methods that need to change:</p>
<ul>
<li><em>getText()</em> and <em>setText()</em></li>
<li><em>getHTML()</em> and <em>setHTML()</em></li>
<li><em>getTag()</em></li>
<li><em>getValue()</em></li>
<li><em>setOpacity()</em></li>
</ul>
<h2>Simple Fx</h2>
<p>This is another relatively simple change to make, and again, commonly used. To upgrade is a case of:</p>
<ul>
<li><em>Fx.Base</em> becomes <em>Fx</em></li>
<li><em>Fx.Style </em>becomes <em>Fx.Tween</em> (with some differences, see <a href="http://github.com/mootools/mootools-upgrade-helper#readme" onclick="pageTracker._trackPageview('/outgoing/github.com/mootools/mootools-upgrade-helper_readme?referer=');">readme</a>)</li>
<li><em>Fx.Styles</em> becomes <em>Fx.Morph</em></li>
<li><em>el.effect()</em> becomes <em>el.tween()</em>, and <em>el.effects()</em> becomes <em>el.morph()</em> (again some subtle differences, see <a href="http://github.com/mootools/mootools-upgrade-helper#readme" onclick="pageTracker._trackPageview('/outgoing/github.com/mootools/mootools-upgrade-helper_readme?referer=');">readme</a>)</li>
</ul>
<h2>Selectors</h2>
<p>Next up is replacing <em>$E</em> and <em>$ES</em>.</p>
<ul>
<li><em>$E(selector) </em>becomes <em>document.getElement(selector)</em></li>
<li><em>$ES(selector) </em>becomes <em>document.getElements(selector)</em></li>
</ul>
<p>There was also a second optional parameter you could pass in that defined what element you wanted to search in. An example:</p>
<ul>
<li><em>$E(selector, &#8216;.myDivs&#8217;)</em> would become <em>$$(&#8217;.myDivs&#8217;).getElement(selector)</em> or</li>
<li><em>$E(selector, &#8216;#myOtherDiv&#8217;)</em> would become <em>$(&#8217;myOtherDiv).getElement(selector)</em></li>
</ul>
<h2>Ajax requests</h2>
<p>Last of the common changes to be made is to the MooTools 1.1 <em>Ajax</em> and <em>XHR</em> classes. These need to be replaced with <em>Request</em>. Have a look at the <a href="http://github.com/mootools/mootools-upgrade-helper#readme" onclick="pageTracker._trackPageview('/outgoing/github.com/mootools/mootools-upgrade-helper_readme?referer=');">readme</a> for exact changes.</p>
<h2>Fx methods</h2>
<p>We updated a few <em>Fx</em> methods earlier, now let&#8217;s just finish the job. The following changes should be made:</p>
<ul>
<li><em>myFx.custom() </em>has been changed to <em>myFx.start()</em></li>
<li><em>myFx.clearTimer() </em>and<em> myFx.stop()</em> can both now be written as <em>myFx.cancel()</em></li>
</ul>
<p>If you follow the above steps most of your code should be good to go. If you need any further help just <a href="irc://irc.freenode.net/#mootools">jump on IRC</a> and someone should be there to help. Also, please check the <a href="http://docs111.mootools.net/" onclick="pageTracker._trackPageview('/outgoing/docs111.mootools.net/?referer=');">docs for 1.1</a> and 1.2 to check you are passing the correct arguments.</p>
<p>We will also be working closely with the Joomla! dev team to convert the most popular plugins for you. Once these are done, we&#8217;ll be putting them in the Forge. You can request conversions in the <a href="http://groups.google.com/group/mootools-users/" onclick="pageTracker._trackPageview('/outgoing/groups.google.com/group/mootools-users/?referer=');">MooTools Google Group</a> but we can&#8217;t convert everything -so please don&#8217;t be offended if we don&#8217;t convert your favourite plugin.</p>
<p>Please read <a href="http://mootools.net/blog/2009/12/31/mootools-1-1-upgrade-layer-beta/" onclick="pageTracker._trackPageview('/outgoing/mootools.net/blog/2009/12/31/mootools-1-1-upgrade-layer-beta/?referer=');">the original post on the MooTools blog</a> for more details &#8211; and have fun upgrading!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fakedarren.com/2010/01/a-rough-guide-to-upgrading-from-mootools-1-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hosting a Hackathon</title>
		<link>http://blog.fakedarren.com/2009/11/hosting-a-hackathon/</link>
		<comments>http://blog.fakedarren.com/2009/11/hosting-a-hackathon/#comments</comments>
		<pubDate>Thu, 19 Nov 2009 14:06:45 +0000</pubDate>
		<dc:creator>fakedarren</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[MooTools]]></category>

		<guid isPermaLink="false">http://blog.fakedarren.com/?p=184</guid>
		<description><![CDATA[This weekend I&#8217;m absolutely delighted to be hosting a &#8216;Hackathon&#8217; for the MooTools development team here in London. Basically, devs from all over Europe are meeting up here in London for a weekend of hacking away at MooTools 2.0, our search engine, and the awesome MooShell.
We had something similar in San Francisco a couple of [...]]]></description>
			<content:encoded><![CDATA[<p>This weekend I&#8217;m absolutely delighted to be hosting a &#8216;Hackathon&#8217; for the MooTools development team here in London. Basically, devs from all over Europe are meeting up here in London for a weekend of hacking away at MooTools 2.0, our search engine, and the awesome MooShell.</p>
<p>We had something similar in San Francisco a couple of months ago which I also had the pleasure of attending. I mentioned that the guys from Europe should have one, suggested London as a venue and now here we are.<a title="Abacus e-Media" href="http://www.abacusemedia.com/" onclick="pageTracker._trackPageview('/outgoing/www.abacusemedia.com/?referer=');"> The awesome company I&#8217;m working for at the moment</a> have let us use their Regent Street office for the event and I cannot express how grateful I am about that.</p>
<p>We&#8217;re going to have quite a high turnout &#8211; about 15 of us I think &#8211; and for a lot of us it&#8217;s going to be the first time we&#8217;ve all met up. The San Francisco one and this one have and will really help the MooTools dev team get closer. Working with people in your spare time in different countries can sometimes be difficult and I think everyone meeting face to face is going to really have a positive impact on how we work together.</p>
<p>Follow the <a title="MooTools twitter feed" href="http://twitter.com/mootools" onclick="pageTracker._trackPageview('/outgoing/twitter.com/mootools?referer=');">@MooTools Twitter feed</a> for regular updates on what&#8217;s going on; we&#8217;ll have live video chat if people want to chip in and give us a hand with what we&#8217;re working on. I can&#8217;t promise (we may be busy coding!) but hopefully we&#8217;ll get a chance to go out for a drink or two and if any MooTools users are around in London you can come and meet the devs. We&#8217;ll tweet the details if that happens.</p>
<p>Also early next year, I hope to organise a more public event, for users as well as devs; we&#8217;ll be discussing this over the weekend. I&#8217;m hoping to get a sponsored bar and a couple of the devs over to do a couple of talks about our favourite JavaScript framework.</p>
<p>Totally looking forward to it. It&#8217;s going to be amazing <img src='http://blog.fakedarren.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fakedarren.com/2009/11/hosting-a-hackathon/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>A MooTools Demo thingy (and some Fx)</title>
		<link>http://blog.fakedarren.com/2009/11/a-mootools-demo-thingy-and-some-fx/</link>
		<comments>http://blog.fakedarren.com/2009/11/a-mootools-demo-thingy-and-some-fx/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 00:06:18 +0000</pubDate>
		<dc:creator>fakedarren</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[MooTools]]></category>

		<guid isPermaLink="false">http://blog.fakedarren.com/?p=39</guid>
		<description><![CDATA[I&#8217;ve spent quite a bit of time recently working on changes to the MooTools documentation. Now I have a blog up I wanted to write some demos but didn&#8217;t want it to be one long article; I wanted to break the article into sections.
So I made this little demo thingy and thought I&#8217;d see what [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve spent quite a bit of time recently working on changes to the MooTools documentation. Now I have a blog up I wanted to write some demos but didn&#8217;t want it to be one long article; I wanted to break the article into sections.</p>
<p>So I made this little demo thingy and thought I&#8217;d see what people thought of it.</p>
<h2>How it works</h2>
<p>First off I separate each &#8217;slide&#8217; with a &lt;div class=&#8221;section&#8221;&gt;. I&#8217;m also using &lt;pre&gt; tags and the excellent <a href="http://pradador.com/code/lighterjs/" onclick="pageTracker._trackPageview('/outgoing/pradador.com/code/lighterjs/?referer=');">Lighter.js</a> for code highlighting.</p>
<p>I then have a small class that lets you navigate through the &#8217;slides&#8217;. Each time a slide is shown, the HTML, CSS and JavaScript are injected into an iframe (which I called a &#8217;stage&#8217;) and you can show the stage by adding a class of &#8217;showstage&#8217; to the section.</p>
<p>The code is really messy at the moment but it is more of a proof-of-concept than a finished class. I&#8217;ll definitely clean it up, and I may in time make it into a WordPress plugin &#8211; I&#8217;d also love it to be easily used with <a href="http://mooshell.net" onclick="pageTracker._trackPageview('/outgoing/mooshell.net?referer=');">MooShell</a>.</p>
<p>Anyway, have a play and tell me what you think!</p>
<h2>A demo of the demo thingy</h2>
<div class="demo">
<div class="introduction section">
<h2>Really simple animations with .tween() and .morph()</h2>
<p>MooTools effects are really powerful and really easy to use. The easiest way to do basic animations is using the Fx.Tween and Fx.Morph element methods.</p>
<p>Let&#8217;s start off with a couple of simple boxes:</p>
<h3>HTML</h3>
<pre class="html:twilight html">
<div class="box" id="box1"></div>
<div class="box" id="box2"></div>
</pre>
<h3>CSS</h3>
<pre class="css:twilight css">
.box {
	height: 100px;
	position: absolute;
	width: 100px;
}
#box1 {
	background-color: #222;
	border: 1px solid #ccc;
	left: 20px;
	top: 40px;
}
#box2 {
	background-color: #94CC25;
	border: 1px solid #222;
	left: 450px;
	top: -3px;
}
</pre>
</div>
<div class="showstage section">
<h2>Changing a single property</h2>
<p>If you want to just change a single property of an element, like change a background colour or fade an element out, you can use a tween.</p>
<pre class="hidden html"><a id="runscript1" href="#">run script 1</a> | <a id="runscript2" href="#">run script 2</a>
<div class="box" id="box1"></div>
<div class="box" id="box2"></div>
</pre>
<h3>JavaScript</h3>
<pre class="js:twilight js">$('runscript1').addEvent('click', function(e){
	e.stop();
	$('box1').tween('background-color', '#f00');
	$('box2').tween('opacity', 0.7);
});

$('runscript2').addEvent('click', function(e){
	e.stop();
	$('box1').tween('top', 50);
	$('box2').tween('left', 300);
});</pre>
</div>
<div class="section showstage">
<h2>Use .morph() to change more than one property</h2>
<pre class="hidden html">
<a id="runscript" href="#">run script</a>
<div class="box" id="box1"></div>
<div class="box" id="box2"></div>
</pre>
<h3>JavaScript</h3>
<pre class="js:twilight js">$('runscript').addEvent('click', function(e){
	e.stop();
	$('box1').morph({
		'background-color': '#00f',
		'left': 400,
		'top': 15
	});
	$('box2').morph({
		'background-color': '#ff0',
		'border-color': '#94cc25',
		'border-width': 12,
		'left': 30,
		'top': 5
	});
});</pre>
</div>
<div class="section showstage">
<h2>Chaining</h2>
<p>If you want to chain a series of effects, the Fx.Morph class has an option called &#8216;link&#8217;. You can set it to &#8216;chain&#8217; (as well as some other options) like so:</p>
<pre class="hidden html">
<a id="runscript" href="#">run script</a>
<div class="box" id="box1"></div>
</pre>
<h3>JavaScript</h3>
<pre class="js:twilight js">$('runscript').addEvent('click', function(e){
	e.stop();
	$('box1').set('morph', {
		duration: 'long',
		link: 'chain',
		transition: 'bounce:out'
	});
	$('box1').morph({
		'background-color': '#00f',
		'left': 400,
		'top': 15
	}).morph({
		'background-color': '#ff0',
		'border-color': '#94cc25',
		'border-width': 12,
		'left': 30,
		'top': 5
	});
});</pre>
</div>
<div class="section showstage">
<h2>.fade() and .highlight() &#8211; handy helpers</h2>
<pre class="hidden html">
<a id="fadein" href="#">fade in</a> | <a id="fadeout" href="#">fade out</a> | <a id="fadetoggle" href="#">toggle fade</a> | <a id="fadehalf" href="#">fade to 0.5</a>
 |
<a id="highlight" href="#">highlight</a> | <a id="highlightred" href="#">highlight red</a>
<div class="box" id="box1"></div>
<div class="box" id="box2"></div>
</pre>
<h3>JavaScript</h3>
<pre class="js:twilight js">
$('fadein').addEvent('click', function(){
	$('box1').fade('in');
});
$('fadeout').addEvent('click', function(){
	$('box1').fade('out');
});
$('fadetoggle').addEvent('click', function(){
	$('box1').fade('toggle');
});
$('fadehalf').addEvent('click', function(){
	$('box1').fade(0.5);
});

$('highlight').addEvent('click', function(){
	$('box2').highlight();
});
$('highlightred').addEvent('click', function(){
	$('box2').highlight('#ff0000');
});
$$('A').addEvent('click', function(e){
	e.stop();
});
</pre>
</div>
<div class="section">
<h2>Find out more</h2>
<ul>
<li><a href="http://mootools.net/docs/core/Fx/Fx.Tween" onclick="pageTracker._trackPageview('/outgoing/mootools.net/docs/core/Fx/Fx.Tween?referer=');">Offical docs for Fx.Tween</a></li>
<li><a href="http://mootools.net/docs/core/Fx/Fx.Morph" onclick="pageTracker._trackPageview('/outgoing/mootools.net/docs/core/Fx/Fx.Morph?referer=');">Offical docs for Fx.Morph</a></li>
<li><a href="http://demos.mootools.net/Effects" onclick="pageTracker._trackPageview('/outgoing/demos.mootools.net/Effects?referer=');">Demo on mootools.net</a></li>
<li><a href="http://www.mootorial.com/wiki/mootorial/06-fx/01-fx.tween" onclick="pageTracker._trackPageview('/outgoing/www.mootorial.com/wiki/mootorial/06-fx/01-fx.tween?referer=');">The Mootorial</a></li>
</ul>
</div>
<div class="stage"></div>
</div>
<p><script src="/wp-content/themes/hemingway/js/demos.js" type="text/javascript"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fakedarren.com/2009/11/a-mootools-demo-thingy-and-some-fx/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
