<?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"
	>

<channel>
	<title>Andrew Sellick &#187; Prototype</title>
	<atom:link href="http://www.andrewsellick.com/category/prototype/feed" rel="self" type="application/rss+xml" />
	<link>http://www.andrewsellick.com</link>
	<description>andrewsellick.com</description>
	<pubDate>Sat, 15 Nov 2008 00:35:18 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.2</generator>
	<language>en</language>
			<item>
		<title>Script of the week</title>
		<link>http://www.andrewsellick.com/69/script-of-the-week-5</link>
		<comments>http://www.andrewsellick.com/69/script-of-the-week-5#comments</comments>
		<pubDate>Thu, 04 Oct 2007 23:06:24 +0000</pubDate>
		<dc:creator>andy</dc:creator>
		
		<category><![CDATA[JavaScript]]></category>

		<category><![CDATA[Prototype]]></category>

		<category><![CDATA[script.aculo.us]]></category>

		<guid isPermaLink="false">http://www.andrewsellick.com/69/script-of-the-week-5</guid>
		<description><![CDATA[It&#8217;s been a while since I last posted a script of the week, however, as soon as I found this script I knew I had to put it on my site.&#160; Well this week it is a script called LightWindow that claims the prize.&#160; Before you all moan at yet another light-&#8217;whatever&#8217; as it is [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been a while since I last posted a script of the week, however, as soon as I found this script I knew I had to put it on my site.&nbsp; Well this week it is a script called <a href="http://stickmanlabs.com/lightwindow/" target="_blank">LightWindow</a> that claims the prize.&nbsp; Before you all moan at yet another light-&#8217;whatever&#8217; as it is so well put on the LightWindow site please read on as this one is really worth a look.</p>
<p>Now I have seen a lot of LightBox esq effects out there but this one wins the prize.  Not for aesthetics as on that front it is just the same as the others, however, if you look at the media types that LightWindow is compatible with you gain an understanding as to why exactly it is that this script is so impressive (In fact LightWindow claims to support every media type).  Couple this with superior Browser compatibility and the sheer versatility and flexibility and you have a winning package.</p>
<p>The code is slightly heavy at 63KB and when taking in to account that it also uses Prototype and Script.aculo.us you can gather that it is a big bit of kit, however, the scalability of this code leads me to believe it is totally worth it.</p>
<p>Finally the list of features that LightWindow offers is phenomenal and well worth a browse.  Have a look for your self at the <a href="http://stickmanlabs.com/lightwindow/#features" target="_blank">LightWindow feature list</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.andrewsellick.com/69/script-of-the-week-5/feed</wfw:commentRss>
		</item>
		<item>
		<title>Simple JavaScript Idle State using Prototype</title>
		<link>http://www.andrewsellick.com/67/simple-javascript-idle-state-using-prototype</link>
		<comments>http://www.andrewsellick.com/67/simple-javascript-idle-state-using-prototype#comments</comments>
		<pubDate>Wed, 03 Oct 2007 13:17:29 +0000</pubDate>
		<dc:creator>andy</dc:creator>
		
		<category><![CDATA[JavaScript]]></category>

		<category><![CDATA[Prototype]]></category>

		<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://www.andrewsellick.com/67/simple-javascript-idle-state-using-prototype</guid>
		<description><![CDATA[This is a fairly simple piece of code, however, I decided it was worth putting up on the site for everybody to see.
Anyway the code itself aims to fire a function when there has been no mouse movement for a predefined length of time and reset the count every time the mouse is moved.
code
The code [...]]]></description>
			<content:encoded><![CDATA[<p>This is a fairly simple piece of code, however, I decided it was worth putting up on the site for everybody to see.</p>
<p>Anyway the code itself aims to fire a function when there has been no mouse movement for a predefined length of time and reset the count every time the mouse is moved.</p>
<h3>code</h3>
<p>The code is very simple, therefore, only the JavaScript is worth talking about for this example, so that is going to be the focus of this article.&nbsp; Have a look for yourself below.</p>
<p>Right then here we go:</p>
<h4>JavaScript<br />
</h4>
<div class="code">var idleTime&nbsp;&nbsp; &nbsp;= 5000;<br />
var timeOut&nbsp;&nbsp; &nbsp; = &#8221;;</p>
<p>function init() {<br />
&nbsp;&nbsp; &nbsp;<br />
&nbsp;&nbsp;&nbsp; Event.observe(document.body, &#8216;mousemove&#8217;, resetIdle, true);<br />
&nbsp;&nbsp;&nbsp; <br />
&nbsp;&nbsp;&nbsp; setIdle();<br />
&nbsp;&nbsp;&nbsp; <br />
}</p>
<p>function onIdleFunction(){<br />
&nbsp;&nbsp;&nbsp; <br />
&nbsp;&nbsp;&nbsp; alert(&#8217;Your browser has been idle for &#8216; + (idleTime/1000) +&#8217; seconds.&#8217;);<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br />
}</p>
<p>function resetIdle(){<br />
&nbsp;&nbsp;&nbsp; <br />
&nbsp;&nbsp;&nbsp; window.clearTimeout( timeOut );<br />
&nbsp;&nbsp;&nbsp; setIdle();<br />
&nbsp;&nbsp;&nbsp; <br />
}</p>
<p>function setIdle(){<br />
&nbsp;&nbsp;&nbsp; <br />
&nbsp;&nbsp;&nbsp; timeOut = window.setTimeout( &quot;onIdleFunction()&quot;, idleTime );<br />
&nbsp;&nbsp;&nbsp; <br />
}</p>
<p>Event.observe(window, &#8216;load&#8217;, init, false); 
</div>
<p>
At the top of the code there is a variable called &quot;idleTime&quot;, this variable sets the idle state time (in milliseconds) that the browser mouse be idble for, before firing the function.&nbsp; Change this as you wish.</p>
<p>Next we have the &quot;init&quot; function which is called on page load by an event listener at the bottom of the sample code.&nbsp; This itself sets a mouse move event listener (which resets the idle state when fired) on the document body and also calls the idle state function.</p>
<p>We then have an &quot;onIdleFunction&quot; which is where you put the code you wish to be fired when the page is idle.&nbsp; In this example we&#8217;re just alerting out that the page has been idle.</p>
<p>Finally we have two functions, resetIdle and setIdle, which really do exactly what it says on the tin.&nbsp; The first resets the idle state (on mouse movement) and the second sets the idle state.</p>
<p>Well that&#8217;s about it so have a look for yourself at the demo and code below.</p>
<h3>demo</h3>
<p>Feel free to view the <a target="_blank" href="http://www.andrewsellick.com/examples/idleState/">Simple JavaScript Idle State using Prototype Demo</a>.</p>
<h3>download</h3>
<p>Also please have a look at the <a target="_blank" href="http://www.andrewsellick.com/examples/idleState/idleState.rar">Simple JavaScript Idle State using Prototype Code</a>.</p>
<h3>note</h3>
<p>The Idle State at present only uses mouse movement for detect inactivity.&nbsp; This will be problematic when considering devices that do not have mice (as it will not work), however, the code can be easily adapted to check for other forms of activity.</p>
<p>It is also worth while mentioning that the mouse move event is applied to the document body and therefore you must make sure that the height and width of the body and html are set to 100% for this to work, otherwise the event listener will not work.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.andrewsellick.com/67/simple-javascript-idle-state-using-prototype/feed</wfw:commentRss>
		</item>
		<item>
		<title>Prototype Diagram</title>
		<link>http://www.andrewsellick.com/55/prototype-diagram</link>
		<comments>http://www.andrewsellick.com/55/prototype-diagram#comments</comments>
		<pubDate>Tue, 31 Jul 2007 13:06:24 +0000</pubDate>
		<dc:creator>andy</dc:creator>
		
		<category><![CDATA[JavaScript]]></category>

		<category><![CDATA[Prototype]]></category>

		<guid isPermaLink="false">http://www.andrewsellick.com/55/prototype-diagram</guid>
		<description><![CDATA[I&#8217;m sure plenty of you have seen this before as I know I have been using it for a long time but nether the less I thought I would post it anyway.
Jonathan Snook has created a very handy visual representation for the Prototype Framework.&#160; It&#8217;s an amazingly useful tool to have whilst developing and I [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m sure plenty of you have seen this before as I know I have been using it for a long time but nether the less I thought I would post it anyway.</p>
<p>Jonathan Snook has created a very handy visual representation for the Prototype Framework.&nbsp; It&#8217;s an amazingly useful tool to have whilst developing and I recommend it to anyone that wishes to use Prototype.</p>
<p>Anyway here is <a href="http://www.snook.ca/archives/javascript/prototype_disse/" target="_blank">Snook&#8217;s Prototype Diagram</a>.&nbsp; Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.andrewsellick.com/55/prototype-diagram/feed</wfw:commentRss>
		</item>
		<item>
		<title>Prototype &#038; script.aculo.us Image Cropper</title>
		<link>http://www.andrewsellick.com/5/prototype-scriptaculous-image-cropper</link>
		<comments>http://www.andrewsellick.com/5/prototype-scriptaculous-image-cropper#comments</comments>
		<pubDate>Mon, 26 Feb 2007 10:39:59 +0000</pubDate>
		<dc:creator>andy</dc:creator>
		
		<category><![CDATA[JavaScript]]></category>

		<category><![CDATA[Prototype]]></category>

		<category><![CDATA[script.aculo.us]]></category>

		<guid isPermaLink="false">http://www.andrewsellick.com/?p=5</guid>
		<description><![CDATA[Another short article just to document an amazing example of a JavaScript image cropper tool.  Based on Prototype and script.aculo.us this example stylishly demonstrates a range of features including minimum image widths and heights, fixed ratios, a crop with preview and the ability to nudge the selected image region by use of the keyword [...]]]></description>
			<content:encoded><![CDATA[<p>Another short article just to document an amazing example of a JavaScript image cropper tool.  Based on Prototype and script.aculo.us this example stylishly demonstrates a range of features including minimum image widths and heights, fixed ratios, a crop with preview and the ability to nudge the selected image region by use of the keyword arrow keys.  This tool could be integrated into any CMS providing the wow factor for all end users.</p>
<p><strong>Links</strong>:</p>
<ul>
<li><a href="http://www.defusion.org.uk/code/javascript-image-cropper-ui-using-prototype-scriptaculous/" title="http://www.defusion.org.uk/code/javascript-image-cropper-ui-using-prototype-scriptaculous/">Image Cropper Code and Explanation</a>.</li>
<li><a href="http://www.defusion.org.uk/demos/060519/cropper.php" title="http://www.defusion.org.uk/demos/060519/cropper.php">Image Cropper Example</a>.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.andrewsellick.com/5/prototype-scriptaculous-image-cropper/feed</wfw:commentRss>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.783 seconds -->
