<?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>Rexxars.com &#187; Mootools</title>
	<atom:link href="http://rexxars.com/category/mootools/feed/" rel="self" type="application/rss+xml" />
	<link>http://rexxars.com</link>
	<description>A developers perspective on PHP, Android, MooTools and other awesomeness.</description>
	<lastBuildDate>Fri, 23 Jul 2010 13:47:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>MooTools IdleTimer</title>
		<link>http://rexxars.com/mootools/idletimer/</link>
		<comments>http://rexxars.com/mootools/idletimer/#comments</comments>
		<pubDate>Mon, 14 Dec 2009 10:30:29 +0000</pubDate>
		<dc:creator>Rexxars</dc:creator>
				<category><![CDATA[Mootools]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[forge]]></category>
		<category><![CDATA[idletimer]]></category>
		<category><![CDATA[plugin]]></category>

		<guid isPermaLink="false">http://rexxars.com/?p=81</guid>
		<description><![CDATA[Have you ever wanted to log a user out of your site if he is inactive for a given amount of time? Create a better user experience by dimming or hiding page elements while the user is watching a video? A couple of months ago I came across Nick Zakas&#8217; YUI approach to this problem, [...]]]></description>
			<content:encoded><![CDATA[<p>Have you ever wanted to log a user out of your site if he is inactive for a given amount of time?<br />
Create a better user experience by dimming or hiding page elements while the user is watching a video?</p>
<p><img class="alignright" title="Mootools IdleTimer" src="http://rexxars.com/project/idletimer/title.png" alt="" width="185" height="78" /></p>
<p>A couple of months ago I came across Nick Zakas&#8217; <a href="http://www.nczonline.net/blog/2009/06/02/detecting-if-the-user-is-idle-with-javascript-and-yui-3/">YUI approach</a> to this problem, and recently I found Paul Irish&#8217;s <a href="http://paulirish.com/2009/jquery-idletimer-plugin/">jQuery plugin</a> which was based on Nick&#8217;s work.</p>
<p>This is my attempt at creating a Mootools class that uses the same approach. Quite simply, it fires a timer that activates a callback after a given amount of time. The timer is reset if the user moves the mouse, presses a key, scrolls using the scroll wheel or clicks any mouse button. This has to be done over the active document, obviously.</p>
<p>Key features:</p>
<ul>
<li>Can be attached to a single element on the page or the entire document/window.</li>
<li>Lets you set up multiple instances with different timeouts and events.</li>
<li>Easily retrieve the idle status from the instance using the isIdle property.</li>
<li>Find the number of milliseconds since the user was last active.</li>
<li>Allows you to call the active() method to manually reset the idle state &#8211; useful for Flash and other overlays that lets you communicate with Javascript.</li>
<li>Easily retrieve an IdleTimer instance using element.get(&#8216;idle&#8217;, { options });</li>
<li>Free and open source. MIT-licensed.</li>
</ul>
<p>Check out the <a href="http://rexxars.com/project/idletimer/">demo page</a> for more details. The source is available on <a href="http://github.com/rexxars/IdleTimer">Github</a> as well as in the recently opened <a href="http://mootools.net/forge/">MooTools Forge</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://rexxars.com/mootools/idletimer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Selecting all checkboxes in a group with Mootools, one-liner</title>
		<link>http://rexxars.com/mootools/selecting-all-checkboxes-in-a-group-with-mootools/</link>
		<comments>http://rexxars.com/mootools/selecting-all-checkboxes-in-a-group-with-mootools/#comments</comments>
		<pubDate>Sun, 23 Aug 2009 19:07:16 +0000</pubDate>
		<dc:creator>Rexxars</dc:creator>
				<category><![CDATA[Mootools]]></category>
		<category><![CDATA[html]]></category>

		<guid isPermaLink="false">http://rexxars.com/?p=57</guid>
		<description><![CDATA[How many times have you had to do one of these things? A group of items, each with a checkbox. You want a button/checkbox to select all the checkboxes within that group. I ran across this again today, and making the javascript to do the work I was once again reminded why I love Mootools [...]]]></description>
			<content:encoded><![CDATA[<div style="float: left;">
<div id="attachment_58" class="wp-caption alignleft" style="width: 264px"><img class="size-full wp-image-58 " title="checkboxes" src="http://rexxars.com/wp-content/uploads/2009/08/checkboxes.jpg" alt="Fairly common..?" width="254" height="275" /><p class="wp-caption-text">Fairly common..?</p></div>
</div>
<p>How many times have you had to do one of these things? A group of items, each with a checkbox. You want a button/checkbox to select all the checkboxes within that group.</p>
<p>I ran across this again today, and making the javascript to do the work I was once again reminded why I love Mootools so much:</p>
<p>With just three lines of code (1 line to do the actual checking/unchecking), I had this up and running. It couldn&#8217;t have taken longer than 30 seconds to write. I love quick snippets <img src='http://rexxars.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Obviously, this wouldn&#8217;t be hard to do in jQuery or any other JS framework, but I love how elegant and intuitive Mootools does it. I shudder when I think of how many times I&#8217;ve done things similar to this in plain old Javascript.</p>
<p>Anyway, there&#8217;s a <a href="http://rexxars.com/snippets/checkbox-magic/">demo page</a> available, and here&#8217;s the code I ended up with, for anyone interested:<br />
<br style="clear: left;" /></p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p57code2'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p572"><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code" id="p57code2"><pre class="javascript" style="font-family:monospace;">$$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'li.head input[type=checkbox]'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addEvent</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'click'</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">getParent</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'ul'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">getElements</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'input[type=checkbox]'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">setProperty</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'checked'</span><span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">checked</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://rexxars.com/mootools/selecting-all-checkboxes-in-a-group-with-mootools/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
