<?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>bradKELLETT &#187; idle</title>
	<atom:link href="http://bradkellett.com/p/tag/idle/feed/" rel="self" type="application/rss+xml" />
	<link>http://bradkellett.com</link>
	<description></description>
	<lastBuildDate>Tue, 07 Feb 2012 04:45:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>MooTools Idle Tracker Class</title>
		<link>http://bradkellett.com/p/mootools-idle-tracker-class/</link>
		<comments>http://bradkellett.com/p/mootools-idle-tracker-class/#comments</comments>
		<pubDate>Thu, 17 Dec 2009 05:46:48 +0000</pubDate>
		<dc:creator>Brad Kellett</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[activity]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[idle]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[mootools]]></category>

		<guid isPermaLink="false">http://bradkellett.com/?p=581</guid>
		<description><![CDATA[In web applications, there are times when you may want to track activity of a user within your page &#8211; perhaps your project includes a realtime component that you want to pause when the user isn&#8217;t actually working with the page, for example. This is pretty easy to take care of, but there are a [...]]]></description>
			<content:encoded><![CDATA[<p>In web applications, there are times when you may want to track activity of a user within your page &#8211; perhaps your project includes a realtime component that you want to pause when the user isn&#8217;t actually working with the page, for example. This is pretty easy to take care of, but there are a few little quirks, so to simplify it all I&#8217;ve released a MooTools class to take care of it for you.</p>
<p>The class is super simple to use, all that is required is for it to be instantiated and it&#8217;ll get on with it. You can specify how many seconds of no activity on your page before the user is classed as idle, as well as a couple of more technical options, then just attach a function to the <em>onIdle</em> and <em>onIdleReturn</em> events of the class. For example:</p>
<div class="codesnip-container" >
<div class="javascript codesnip" style="font-family:monospace;">
<ol>
<li class="li1">
<div class="de1"><span class="kw2">var</span> tracker <span class="sy0">=</span> <span class="kw2">new</span> IdleTracker<span class="br0">&#40;</span><span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; idleTime<span class="sy0">:</span> 2<span class="sy0">,</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; onIdle<span class="sy0">:</span> <span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// User is idle</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span><span class="sy0">,</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; onIdleReturn<span class="sy0">:</span> <span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// User has returned</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
</ol>
</div>
</div>
<p>You can get full details and download the class from <a href="http://github.com/bck/javascript/tree/master/mootools-idletracker">my GitHub account</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://bradkellett.com/p/mootools-idle-tracker-class/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

