<?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>Web 3.0, 6 Bladed Razors, 7 Minute Abs &#187; Mootools</title>
	<atom:link href="http://www.zachleat.com/web/tag/mootools/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.zachleat.com/web</link>
	<description></description>
	<lastBuildDate>Fri, 30 Jul 2010 01:59:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>maLArquee, Bringing Back the Marquee</title>
		<link>http://www.zachleat.com/web/2007/08/20/malarquee-bringing-back-the-marquee/</link>
		<comments>http://www.zachleat.com/web/2007/08/20/malarquee-bringing-back-the-marquee/#comments</comments>
		<pubDate>Tue, 21 Aug 2007 02:41:51 +0000</pubDate>
		<dc:creator>Zach Leatherman</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Malarquee]]></category>
		<category><![CDATA[Mootools]]></category>
		<category><![CDATA[NTP]]></category>

		<guid isPermaLink="false">http://www.zachleat.com/web/2007/08/20/malarquee-bringing-back-the-marquee/</guid>
		<description><![CDATA[What did you spend your Saturday afternoon on? Did you kick up your feet in your hammock with a nice glass of lemonade in the shade of your favorite tree and read the HTML specification? Me too! Who knew that we&#8217;d have so much in common? Since you&#8217;re obviously like me, you&#8217;ve probably wondered to [...]]]></description>
			<content:encoded><![CDATA[<p>What did you spend your Saturday afternoon on?  Did you kick up your feet in your hammock with a nice glass of lemonade in the shade of your favorite tree and read the HTML specification?  Me too!  Who knew that we&#8217;d have so much in common?  Since you&#8217;re obviously like me, you&#8217;ve probably wondered to yourself: where did the marquee tag go?  Why isn&#8217;t the internet graced with scrolling text gently flowing like a babbling brook across the pixels of your web browser?  Well since you spent your Saturday reading the HTML specifications, you would know that the <code>&lt;marquee&gt;</code> tag was only supported by Internet Explorer, and wasn&#8217;t even a part of the HTML spec.  Unbelievable right?  And to think the <code>&lt;blink&gt;</code> tag I came to know and love wasn&#8217;t part of the spec either!  I&#8217;m just offended as you, let me reassure you.  </p>
<p>Well today, we&#8217;re going to solve all of that.  Today, I&#8217;m going to show you a full screen web browser marquee that will both amaze and excite you.  Here we go:</p>
<p><object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/9OiF8Hd6Db0"></param><embed src="http://www.youtube.com/v/9OiF8Hd6Db0" type="application/x-shockwave-flash" width="425" height="350"></embed></object></p>
<p><a href="http://www.zachleat.com/Projects/Malarquee">http://www.zachleat.com/Projects/Malarquee</a></p>
<h2>What is it for?</h2>
<p>There are a few obvious uses, I suppose.  You can send someone a nice greeting in an email link (it does a ROT13 encoding to mask the text inside the link).  Try one of these:</p>
<p>For a spouse: <a href="http://www.zachleat.com/Projects/Malarquee/index.html?text=V%2520jnag%2520n%2520qvibepr.">I want a divorce.</a></p>
<p>For an employee: <a href="http://www.zachleat.com/Projects/Malarquee/index.html?text=Lbh'er%2520sverq.">You&#8217;re fired.</a></p>
<p>For a doctor: <a href="http://www.zachleat.com/Projects/Malarquee/index.html?text=V'z%2520fbeel%257Cohg%2520lbh%2520unir%257Cnany%2520jnegf.">I&#8217;m sorry but you have anal warts.</a></p>
<p>For your son or daughter: <a href="http://www.zachleat.com/Projects/Malarquee/index.html?text=Lbh%2520jrer%2520nqbcgrq.">You were adopted.</a></p>
<h2>So, what else does it do?</h2>
<p>I knew you&#8217;d ask.  If you click the Options link in the top right corner, you can scroll your text across <strong>multiple web clients</strong>!  Input the number of clients you&#8217;d like to use and the number of your current client.  Hit the update and save button to refresh your page.  It will automatically parse your text accordingly (adding extra spaces at the end as blank slides if needed).  You can test this using one computer by bringing up the following two links in separate windows side by side (you can use a different web browser for each link if you&#8217;d like):</p>
<p><a href="/Projects/Malarquee/index.html?c=1&#038;n=2">maLArquee Client #1</a><br />
<a href="/Projects/Malarquee/index.html?c=2&#038;n=2">maLArquee Client #2</a></p>
<p>You could also go into a computer lab and scroll some text on a couple different computers.</p>
<h2>Why?</h2>
<p>I think it&#8217;s fun to try new things on the web, experiment a bit.  That&#8217;s also why I made <a href="http://www.zachleat.com/web/2007/06/18/wake-up-to-youtube-on-my-internet-alarm-clock/">ALARMd, an Internet Alarm Clock</a>.  For this project, I think it might be fun to try a new JavaScript library, just to get a little bit more experience with a range of different coding types.  So I decided to use <a href="http://www.mootools.net/">MooTools</a>, and wrote <a href="http://www.zachleat.com/web/2007/07/22/what-sound-does-a-cow-make-mootools/">a little review</a> on my experience, coming from a YUI and jQuery background.</p>
<h2>How does it work?</h2>
<p>Every 5 scrolls (I reserve the right to change this number at any time I so wish to conserve bandwidth), the page makes an XmlHttpRequest to the server, gets the server time, and adjusts the delay of the next scroll event to synchronize scrolling between multiple browsers.  Ideally, if every computer were the same, we could just do a single XmlHttpRequest at page load and do a standard interval for scrolling.  But we all know that every web browser is different, and just because you do a setInterval(yourFunction,1000) doesn&#8217;t mean it&#8217;s actually going to run yourFunction every second.  It might run in 1010 ms or 990 ms.  Thus, the XmlHttpRequest is needed to resynchronize all of the clients to a standard clock.</p>
<p>If there is any interest, I&#8217;ll post the code to the time.php script that returns the JSON containing the server time.</p>
<h2>What would you do different next time?</h2>
<p>I told my gracious web host about this project after I was approximately 90% complete with it, and his response was: &#8220;Did you use NTP?&#8221;, with which I replied: &#8220;What is NTP?&#8221;  Ugh.  There is even a <a href="http://jehiah.cz/archive/ntp-for-javascript">JavaScript implementation</a>.</p>
<p>In order to provide balance and order to the universe, please read <a href="http://www.mcli.dist.maricopa.edu/tut/tut17.html">the following link</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zachleat.com/web/2007/08/20/malarquee-bringing-back-the-marquee/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>What Sound Does a Cow Make?  MooTools.</title>
		<link>http://www.zachleat.com/web/2007/07/22/what-sound-does-a-cow-make-mootools/</link>
		<comments>http://www.zachleat.com/web/2007/07/22/what-sound-does-a-cow-make-mootools/#comments</comments>
		<pubDate>Sun, 22 Jul 2007 06:51:16 +0000</pubDate>
		<dc:creator>Zach Leatherman</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Reviews]]></category>
		<category><![CDATA[Mootools]]></category>

		<guid isPermaLink="false">http://www.zachleat.com/web/2007/07/22/what-sound-does-a-cow-make-mootools/</guid>
		<description><![CDATA[Frameworks, Frameworks everywhere. There are the big six: Dojo, jQuery, prototype/scriptaculous, Ext, Mootools, and YUI. (Honorable meantion to Open Rico and Mochikit) I&#8217;ve had limited experience with all of these frameworks, but have actually worked on projects involving YUI and jQuery. So when I was shopping around for a framework that I didn&#8217;t have extensive [...]]]></description>
			<content:encoded><![CDATA[<p>Frameworks, Frameworks everywhere.  There are the big six: Dojo, jQuery, prototype/scriptaculous, Ext, Mootools, and YUI.  (Honorable meantion to Open Rico and Mochikit)  I&#8217;ve had limited experience with all of these frameworks, but have actually worked on projects involving YUI and jQuery.  So when I was shopping around for a framework that I didn&#8217;t have extensive experience with for my next project, I decided to with Mootools.  They&#8217;ve been getting a lot of traffic lately for posting their <a href="http://mootools.net/slickspeed/">SlickSpeed Selectors Test</a>, so I figured why not try their wares.</p>
<p>Originally coming from the YUI Library (a strictly namespaced, well organized package), and then learning jQuery (a language with object chaining, a more object oriented approach, and a much larger community), the Mootools package definitely caught me off guard.</p>
<p>My first surprise was that it put functions EVERYWHERE!  The Core file puts approximately ten functions in the global namespace, with the only indicator that they belong to Mootools being that they had a dollar sign prefix (e.g. $extend).  Couldn&#8217;t these go into one global Mootools object?  $E, $ES?  These are given shortcuts with the normal $ and $$ functions.  It just seems all over the place.</p>
<p>That being said, there is a lot of good functionality in the base Mootools distribution.  A built in class to do Json communication (something YUI is lacking, although I&#8217;m sure it wouldn&#8217;t be too hard to port it in from Captain Crockford&#8217;s Code on his website), a class to Scroll to elements with nice transitions.  It seems like everytime I would hit a &#8220;functional&#8221; snag in my project, I could find the exact code I needed already included in the core file.</p>
<p>I love their download page!  Autopackaged code using Dean Edwards&#8217; Packer.  One small complaint is that there is no option to disable automatic include of dependencies.  They want you to package Mootools into one single file everytime (which is unwieldy, considering I have to maintain my own text file of which packages I put into the source code, if I don&#8217;t want everything), and don&#8217;t let you download just a certain package for separate inclusion.  But when the whole thing weighs in at 40KB, why does it even matter?  I would recommend just downloading all the Components together and just not worrying about it.</p>
<p>All in all, I&#8217;m quite happy with my Mootools experience.  I&#8217;ve definitely found that their SmoothScroll class and easy Color fading techniques are used pretty heavily by developers using Mootools, which gives you a sixth sense that the page you&#8217;re viewing is using the Mootools library.  Sometimes I can just tell without even looking at the source files, which in this case is a good thing, given that we&#8217;re talking about animation techniques and not raw widget style.  But I plan on writing more about my pet peeves with framework widget styles later on.</p>
<p>If you&#8217;ve been using one framework for a really long time, I would recommend checking out Mootools.  Or any other framework.  The more frameworks that you&#8217;ve tried, the better your perspective is on JavaScript in general, and what your framework&#8217;s strengths and weaknesses are.  Mix it up!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zachleat.com/web/2007/07/22/what-sound-does-a-cow-make-mootools/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>JavaScript Frameworks and JSF</title>
		<link>http://www.zachleat.com/web/2007/07/10/javascript-frameworks-and-jsf/</link>
		<comments>http://www.zachleat.com/web/2007/07/10/javascript-frameworks-and-jsf/#comments</comments>
		<pubDate>Wed, 11 Jul 2007 02:24:05 +0000</pubDate>
		<dc:creator>Zach Leatherman</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Dojo]]></category>
		<category><![CDATA[ExtJS]]></category>
		<category><![CDATA[Facelets]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[JSF]]></category>
		<category><![CDATA[Mootools]]></category>
		<category><![CDATA[Prototype]]></category>

		<guid isPermaLink="false">http://www.zachleat.com/web/2007/07/10/javascript-frameworks-and-jsf/</guid>
		<description><![CDATA[You&#8217;re programming a new web application using JSF, maybe with Facelets, maybe without. Which client-side JavaScript framework is going to work with it&#8217;s unstandardized method of assigning ID attributes to it&#8217;s elements? Here is an example of a JSF file: &#60;%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %&#62; &#60;%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %&#62; &#60;html&#62; &#60;body&#62; &#60;f:view&#62; &#60;h:form id="myForm"&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>You&#8217;re programming a new web application using JSF, maybe with Facelets, maybe without.  Which client-side JavaScript framework is going to work with it&#8217;s unstandardized method of assigning ID attributes to it&#8217;s elements?  Here is an example of a JSF file:<br />
<code><br />
&lt;%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %&gt;<br />
&lt;%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %&gt;<br />
&lt;html&gt;<br />
 &lt;body&gt;<br />
   &lt;f:view&gt;<br />
     &lt;h:form id="myForm"&gt;<br />
      &lt;h:inputText id="myText"/&gt;<br />
     &lt;/h:form&gt;<br />
   &lt;/f:view&gt;<br />
 &lt;/body&gt;<br />
&lt;/html&gt;<br />
</code></p>
<p>or maybe the same thing using Facelets:<br />
<code><br />
&lt;html xmlns="http://www.w3.org/1999/xhtml"<br />
      xmlns:h="http://java.sun.com/jsf/html"<br />
      xmlns:f="http://java.sun.com/jsf/core"&gt;<br />
 &lt;body&gt;<br />
   &lt;f:view&gt;<br />
     &lt;form jsfc="h:form" id="myForm"&gt;<br />
      &lt;input type="text" jsfc="h:inputText" id="myText"/&gt;<br />
     &lt;/form&gt;<br />
   &lt;/f:view&gt;<br />
 &lt;/body&gt;<br />
&lt;/html&gt;<br />
</code></p>
<p>These will both output the following result:<br />
<code><br />
&lt;html xmlns="http://www.w3.org/1999/xhtml"<br />
      xmlns:ui="http://java.sun.com/jsf/facelets"&gt;<br />
 &lt;body&gt;<br />
     &lt;form id="myForm"&gt;<br />
      &lt;input type="text" id="myForm:myText"/&gt;<br />
     &lt;/form&gt;<br />
 &lt;/body&gt;<br />
&lt;/html&gt;<br />
</code></p>
<p>Notice how the resulting text field has an ID attribute with the parent id prepended on.  Now the real question is, how do we select this result node using the various JavaScript frameworks that are available to us?</p>
<h1>Works, but we don&#8217;t care: Raw JavaScript or any GetById Function</h1>
<p>Obviously using <code>document.getElementById( 'myForm:myText' );</code> will function correctly.  As will any framework that has a similar &#8220;GetById&#8221; function (YAHOO.util.Dom.get, or $ in Prototype, etc)  What is more interesting to us is the behavior using the various CSS selector packages included with each JavaScript library.</p>
<h1>Does not work: <a href="http://extjs.com/deploy/ext/docs/output/Ext.DomQuery.html">DomQuery</a> in Ext 1.1 Beta 2</h1>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">Ext.<span style="color: #660066;">query</span><span style="color: #009900;">&#40;</span> <span style="color: #3366CC;">'#myForm:myText'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
Ext.<span style="color: #660066;">query</span><span style="color: #009900;">&#40;</span> <span style="color: #3366CC;">'#myForm<span style="color: #000099; font-weight: bold;">\:</span>myText'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>These two tests will throw the error <code>Ext.DomQuery.pseudos[name] is not a function</code>, which obviously means that myText is not a pseudo class like :first or :last.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">Ext.<span style="color: #660066;">query</span><span style="color: #009900;">&#40;</span> <span style="color: #3366CC;">'#myForm<span style="color: #000099; font-weight: bold;">\\</span>:myText'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Throws the error: <code>Error parsing selector, parsing failed at "\:myText"</code></p>
<h1>Works: <a href="http://docs.jquery.com/DOM/Traversing/Selectors">jQuery</a> 1.1.3</h1>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">jQuery<span style="color: #009900;">&#40;</span> <span style="color: #3366CC;">'#myForm<span style="color: #000099; font-weight: bold;">\\</span>:myText'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>As of version 1.1.3 (the latest of this writing), they have added support for the colon in ID selection when escaped with a double backslash.  Versions older than 1.1.3 will not function properly.  This is not yet in the documentation but can be viewed in the <a href="http://jquery.com/blog/2007/07/01/jquery-113-800-faster-still-20kb/">Escape selectors section of a blog post</a>.</p>
<h1>Does not Work: <a href="http://www.prototypejs.org/api/utility/dollar-dollar">Prototype</a> 1.5.1.1</h1>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$$<span style="color: #009900;">&#40;</span> <span style="color: #3366CC;">'#myForm:myText'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
$$<span style="color: #009900;">&#40;</span> <span style="color: #3366CC;">'#myForm<span style="color: #000099; font-weight: bold;">\:</span>myText'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Returns the form instead of the input element and treats myText as a pseudo class.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$$<span style="color: #009900;">&#40;</span> <span style="color: #3366CC;">'#myForm<span style="color: #000099; font-weight: bold;">\\</span>:myText'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Interprets as XPATH selectors (\\ means anywhere in the document), using myText as a pseudo selector now, so it returns ALL nodes in the document.</p>
<h1>Does not Work: <a href="http://dojotoolkit.org/node/336">Dojo query</a> 0.9.0 Beta</h1>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">dojo.<span style="color: #660066;">query</span><span style="color: #009900;">&#40;</span> <span style="color: #3366CC;">'#myForm:myText'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
dojo.<span style="color: #660066;">query</span><span style="color: #009900;">&#40;</span> <span style="color: #3366CC;">'#myForm<span style="color: #000099; font-weight: bold;">\:</span>myText'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
dojo.<span style="color: #660066;">query</span><span style="color: #009900;">&#40;</span> <span style="color: #3366CC;">'#myForm<span style="color: #000099; font-weight: bold;">\\</span>:myText'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>It&#8217;s becoming mind numbingly obvious that if the framework doesn&#8217;t specifically say that you can escape selectors, it&#8217;s not going to let you do so.  In the first two tests, Dojo performs the same as Prototype.  In the double backslash test however, Dojo returns no result nodes.</p>
<h1>Does not Work: <a href="http://docs.mootools.net/Element/Element-Selectors.js">Mootools</a> 1.11</h1>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$$<span style="color: #009900;">&#40;</span> <span style="color: #3366CC;">'#myForm:myText'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
$$<span style="color: #009900;">&#40;</span> <span style="color: #3366CC;">'#myForm<span style="color: #000099; font-weight: bold;">\:</span>myText'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
$$<span style="color: #009900;">&#40;</span> <span style="color: #3366CC;">'#myForm<span style="color: #000099; font-weight: bold;">\\</span>:myText'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>All throw the error <code>The expression is not a legal expression." code: "51</code>.</p>
<p>There you have it folks.  jQuery is the JavaScript library of choice for the discerning JSF applications developer.  Kudos to you if you&#8217;re already using it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zachleat.com/web/2007/07/10/javascript-frameworks-and-jsf/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>
