<?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>Ajax Bestiary &#187; Widget</title>
	<atom:link href="http://www.ajaxbestiary.com/category/widget/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ajaxbestiary.com</link>
	<description>AJAX Development, News, Techniques &#38; More</description>
	<lastBuildDate>Wed, 01 Feb 2012 12:46:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Hovercard &#8211; tooltips on steroids</title>
		<link>http://www.ajaxbestiary.com/2011/12/08/hovercard-tooltips-on-steroids/</link>
		<comments>http://www.ajaxbestiary.com/2011/12/08/hovercard-tooltips-on-steroids/#comments</comments>
		<pubDate>Thu, 08 Dec 2011 22:08:10 +0000</pubDate>
		<dc:creator>Dave Mahon</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Widget]]></category>

		<guid isPermaLink="false">http://www.ajaxbestiary.com/?p=530</guid>
		<description><![CDATA[Hovercard is a jQuery plugin that lets you hover what amounts to a tooltip. Except unlike your normal tooltip, this one supports event callbacks and lets you use arbitrary HTML and use as much space as you need. They also provide support for Twitter and Facebook integration out of the box! Suggested uses include virtual [...]]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<p><a href="http://designwithpc.com/Plugins/Hovercard">Hovercard</a> is a jQuery plugin that lets you hover what amounts to a tooltip. Except unlike your normal tooltip, this one supports event callbacks and lets you use arbitrary HTML and use as much space as you need.</p>
<p>They also provide support for Twitter and Facebook integration out of the box!</p>
<p>Suggested uses include virtual business cards, price comparisons and editing in place. Personally, my mind leaps to a web-based implementation of Civilization &#8211; it&#8217;s instant feedback on any cell in the world.</p>
<p>Check out their sample screenshot and imagine what you could do with it.<br />
<img src="http://www.ajaxbestiary.com/wp-content/uploads/2011/12/inplace-preview.png" alt="Hovercard Sample Screenshot" title="inplace-preview.png" border="0" width="450" height="222" /></p>
<p><img src="http://www.ajaxbestiary.com/?voyeur=1"></p>
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://www.ajaxbestiary.com/2011/12/08/hovercard-tooltips-on-steroids/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting and setting values for jQuery widgets</title>
		<link>http://www.ajaxbestiary.com/2009/12/11/getting-and-setting-values-for-jquery-widgets/</link>
		<comments>http://www.ajaxbestiary.com/2009/12/11/getting-and-setting-values-for-jquery-widgets/#comments</comments>
		<pubDate>Fri, 11 Dec 2009 22:30:34 +0000</pubDate>
		<dc:creator>Dave Mahon</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Widget]]></category>
		<category><![CDATA[Widgets]]></category>

		<guid isPermaLink="false">http://www.ajaxbestiary.com/?p=397</guid>
		<description><![CDATA[If you come from an OOP background you’re likely used to defining class variables like this: class MyClass &#123; var internalValue1; var internalValue2; function constructor&#40;&#41; &#123; … &#125; &#125; The values which are to be stored in your object are simple, straightforward, likely to be typed, and the compiler will detect typos in the variable [...]]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<p>If you come from an OOP background you’re likely used to defining class variables like this:</p>
<p><code></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">class</span> MyClass <span style="color: #009900;">&#123;</span>
   <span style="color: #003366; font-weight: bold;">var</span> internalValue1<span style="color: #339933;">;</span>
   <span style="color: #003366; font-weight: bold;">var</span> internalValue2<span style="color: #339933;">;</span>
   <span style="color: #003366; font-weight: bold;">function</span> constructor<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>  … <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p></code></p>
<p>The values which are to be stored in your object are simple, straightforward, likely to be typed, and the compiler will detect typos in the variable names. JavaScript, as a loosely types language which treats its objects more like collections than discrete objects, can’t really offer us those protections. Conversely, that also means that we have a great deal of flexibility.</p>
<p>In essence, we can dynamically subclass our objects, which you have to admit is a neat trick.</p>
<p>So, for jQuery.UI widgets, the variables stored within our widget are not defined until we assign them. The act of assignment defines the variable name, which can then be called upon at will.</p>
<p>Assignment is simply:</p>
<p><code></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">this</span>._setData<span style="color: #009900;">&#40;</span>‘variablename’<span style="color: #339933;">,</span> variablevalue<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p></code></p>
<p>Retrieval of this value is similarly straightforward:</p>
<p><code></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">this</span>._getData<span style="color: #009900;">&#40;</span>‘variablename’<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p></code></p>
<p>This does mean that the old problem of misnamed variables is alive and well. It also means that you need to be prepared to handle an undefined response to the _getData call.</p>
<p><img src="http://www.ajaxbestiary.com/?voyeur=1"></p>
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://www.ajaxbestiary.com/2009/12/11/getting-and-setting-values-for-jquery-widgets/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Event handling in jQuery widgets</title>
		<link>http://www.ajaxbestiary.com/2009/12/08/event-handling-in-jquery-widgets/</link>
		<comments>http://www.ajaxbestiary.com/2009/12/08/event-handling-in-jquery-widgets/#comments</comments>
		<pubDate>Tue, 08 Dec 2009 18:00:57 +0000</pubDate>
		<dc:creator>Dave Mahon</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Widget]]></category>

		<guid isPermaLink="false">http://www.ajaxbestiary.com/?p=390</guid>
		<description><![CDATA[This is simple – provided you understand that the reference the keyword this refers to changes depending on when it is called. When called during initialization, this refers to the widget you’re initializing. When the event itself is triggered, this refers to the DOM node node and not the widget. As such, we need to [...]]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<p>This is simple – provided you understand that the reference the keyword <strong>this</strong> refers to changes depending on when it is called.</p>
<p>When called during initialization, <strong>this</strong> refers to the widget you’re initializing. When the event itself is triggered, <strong>this</strong> refers to the DOM node node and not the widget.</p>
<p>As such, we need to introduce a new variable during initialization which the jQuery.UI library calls <strong>self</strong> which is, of course, equal to the initialization <strong>this</strong>, not triggered <strong>this</strong>. (Those of you familiar with Object Oriented Programming and by-reference calls should have no issue with this concept).</p>
<p><code></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>$.<span style="color: #660066;">widget</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;ui.clicker&quot;</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span>
   _init<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>
      self <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">;</span>
      <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">element</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</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>
         self.<span style="color: #660066;">increment</span><span style="color: #009900;">&#40;</span>self<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
         self.<span style="color: #660066;">render</span><span style="color: #009900;">&#40;</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>
      <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">render</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
   increment<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>target<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      target.<span style="color: #660066;">value</span><span style="color: #009900;">&#40;</span>target.<span style="color: #660066;">value</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #006600; font-style: italic;">//The exact handling of target.value will be shown another day</span>
   <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
   render<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;">element</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">value</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
   value<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>val<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      …
   <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p></code></p>
<p>You’ll note that we have to pass <strong>self</strong> to the increment method or the widget won’t actually be able to find itself, but the render method, which was called during initialization, is henceforth always able to correctly reference <strong>this</strong> (the widget)!</p>
<p><img src="http://www.ajaxbestiary.com/?voyeur=1"></p>
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://www.ajaxbestiary.com/2009/12/08/event-handling-in-jquery-widgets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Helpful error handling in jQuery</title>
		<link>http://www.ajaxbestiary.com/2009/12/02/helpful-error-handling-in-jquery/</link>
		<comments>http://www.ajaxbestiary.com/2009/12/02/helpful-error-handling-in-jquery/#comments</comments>
		<pubDate>Wed, 02 Dec 2009 22:10:02 +0000</pubDate>
		<dc:creator>Dave Mahon</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Widget]]></category>
		<category><![CDATA[console]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[error handling]]></category>

		<guid isPermaLink="false">http://www.ajaxbestiary.com/?p=378</guid>
		<description><![CDATA[If you’re going to build a reusable tool, you’re going to want to be able to detect, handle and report error messages in a nice, clean way. It will make you and any other dev happy. The cleanest way of handling genuine errors for developers using your tool &#8211; namely, invalid input sent to a [...]]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<p>If you’re going to build a reusable tool, you’re going to want to be able to detect, handle and report error messages in a nice, clean way. It will make you and any other dev happy.</p>
<p>The cleanest way of handling genuine errors for developers using your tool &#8211; namely, invalid input sent to a function in the library – is to log it to the console. Doing so is refreshingly straightforward:</p>
<p><code></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> err <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Error<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
err.<span style="color: #000066;">name</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;jQuery.widget.UI.clicker.range()&quot;</span><span style="color: #339933;">;</span>
err.<span style="color: #660066;">message</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;Both values must be numeric to assign range&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">throw</span><span style="color: #009900;">&#40;</span>err<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p></code></p>
<p>This snippet comes straight from the widget I threw together. I encourage you to make the name as detailed as possible. It will make debugging so much easier. You can even pinpoint the exact point of error if the problem was say, an invalid query syntax. (Handy during the development phase; not so much in a production environment!)</p>
<p><img src="http://www.ajaxbestiary.com/?voyeur=1"></p>
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://www.ajaxbestiary.com/2009/12/02/helpful-error-handling-in-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Custom stateful jQuery widgets</title>
		<link>http://www.ajaxbestiary.com/2009/11/30/custom-stateful-jquery-widgets/</link>
		<comments>http://www.ajaxbestiary.com/2009/11/30/custom-stateful-jquery-widgets/#comments</comments>
		<pubDate>Tue, 01 Dec 2009 00:28:27 +0000</pubDate>
		<dc:creator>Dave Mahon</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Widget]]></category>
		<category><![CDATA[Widget Factory]]></category>

		<guid isPermaLink="false">http://www.ajaxbestiary.com/?p=370</guid>
		<description><![CDATA[The widget library included in jQuery UI is pretty cool, but sometimes you need to roll your own custom object. If it didn’t have to be reusable, you could always just use a whole slew of bind methods on a specific page. Likewise, if network bandwidth and latency weren’t an issue, you could just store everything server-side and make heavy use of XHR.]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<p>The widget library included in <a href="http://docs.jquery.com/UI">jQuery UI</a> is pretty cool, but sometimes you need to roll your own custom object. If it didn’t have to be reusable, you could always just use a whole slew of <a href="http://docs.jquery.com/Events/bind#typedatafn">bind methods</a> on a specific page. Likewise, if network bandwidth and latency weren’t an issue, you could just store everything server-side and make heavy use of XmlHttpRequest.</p>
<p>Of course we don’t live in that ideal world and so we need to store data locally and our objects inevitably need to be reused. Enter the <a href="http://nemikor.com/presentations/jQuery-UI-Widget-Factory.pdf">jQuery Widget Factory</a>. This nifty feature set included in jQuery UI satisfies all of these needs.</p>
<p>Further, implementing custom widgets is pretty easy. First, we’ll initialize the widget:</p>
<p><code></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$.<span style="color: #660066;">widget</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'ui.widgetname'</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span> _init<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: #009900;">&#125;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p></code></p>
<p>Then we’ll set any defaults:</p>
<p><code></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$.<span style="color: #660066;">ui</span>.<span style="color: #660066;">widgetname</span>.<span style="color: #660066;">defaults</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span> … <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></pre></div></div>

<p></code></p>
<p>Obviously, this can and should be in its own file. Then on the specific web page, we can instantiate the widget:</p>
<p><code></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span>target<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">widgetname</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p></code></p>
<p>This affords us the flexibility to reuse the widget multiple times on the same page and across pages and sites. Tomorrow we’ll start working up a rather basic example of this.</p>
<p>Before then, note that we use the widgetname consistently in its definition and instantiation, so choose the name wisely. Collisions in the $.ui namespace seem unlikely, but in very complex applications, that is always a possibility.</p>
<p>You’ll also note that in the widget’s definition we included only an _init function. This is the generic constructor for the widget and the only required method; feel free to add more as needed. The underscore prefix declares the method “private” and can be used to prefix any function in the widget declaration. This being JavaScript, we know that hidden named functions are quite impossible, but it does conceal the method from the now deprecated <code>$(element).plugin('function')</code>.</p>
<p><img src="http://www.ajaxbestiary.com/?voyeur=1"></p>
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://www.ajaxbestiary.com/2009/11/30/custom-stateful-jquery-widgets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Great Pure CSS Timeline Implementation</title>
		<link>http://www.ajaxbestiary.com/2009/07/12/a-great-pure-css-timeline-implementation/</link>
		<comments>http://www.ajaxbestiary.com/2009/07/12/a-great-pure-css-timeline-implementation/#comments</comments>
		<pubDate>Sun, 12 Jul 2009 11:21:38 +0000</pubDate>
		<dc:creator>Don Albrecht</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Widget]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[timeline]]></category>

		<guid isPermaLink="false">http://www.ajaxbestiary.com/?p=455</guid>
		<description><![CDATA[Matt Bango has published a pretty awesome pure css timeline visualization.  Best part about it is that he&#8217;s documented it QUITE well. A few key concepts: The width of the nodes is pre-populated in the CSS The display is based on a pair of UL&#8217;s one for the timeline elements and one for the intervals [...]]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<p>Matt Bango has published a pretty awesome pure css timeline visualization.  Best part about it is that he&#8217;s documented it QUITE well.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" title="MattBango CSS.png" src="http://www.ajaxbestiary.com/wp-content/uploads/2011/11/MattBango-CSS.png" alt="Pure CSS Timeline" width="400" height="119" border="0" /></p>
<p>A few key concepts:</p>
<ul>
<li>The width of the nodes is pre-populated in the CSS</li>
<li>The display is based on a pair of UL&#8217;s one for the timeline elements and one for the intervals at the bottom.</li>
<li>Width is allowed to be specified in a style attribute on the individual nodes</li>
</ul>
<p>There&#8217;s some pretty clear opportunities to automate the creation of this widget in javascript that I hope to circle back to some day.  In the mean time, you can check out the article and demo here:</p>
<p><a href="http://meyerweb.com/eric/thoughts/2008/01/21/structured-timeline/">http://mattbango.com/notebook/web-development/pure-css-timeline/</a></p>
<p><img src="http://www.ajaxbestiary.com/?voyeur=1"></p>
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://www.ajaxbestiary.com/2009/07/12/a-great-pure-css-timeline-implementation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simile Timeline, An Advanced Timeline VIsualization</title>
		<link>http://www.ajaxbestiary.com/2009/06/19/simile-timeline-an-advanced-timeline-visualization/</link>
		<comments>http://www.ajaxbestiary.com/2009/06/19/simile-timeline-an-advanced-timeline-visualization/#comments</comments>
		<pubDate>Fri, 19 Jun 2009 12:28:41 +0000</pubDate>
		<dc:creator>Don Albrecht</dc:creator>
				<category><![CDATA[Misc Toolkits]]></category>
		<category><![CDATA[Widget]]></category>
		<category><![CDATA[simile]]></category>
		<category><![CDATA[timeline]]></category>
		<category><![CDATA[visualization]]></category>

		<guid isPermaLink="false">http://www.ajaxbestiary.com/?p=464</guid>
		<description><![CDATA[As Timelines go, this is probably the most advanced widget I&#8217;ve come across.  It&#8217;s designed to facilitate theming, huge time ranges, various levels of detail, large variations in resolution and even data mashups. So, how does it work? Reading through the project wiki, they call out the way individual lanes of the timeline are built [...]]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<p>As Timelines go, this is probably the most advanced widget I&#8217;ve come across.  It&#8217;s designed to facilitate theming, huge time ranges, various levels of detail, large variations in resolution and even data mashups.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" title="Simile Timeline.png" src="http://www.ajaxbestiary.com/wp-content/uploads/2011/11/Simile-Timeline.png" alt="Simile Timeline" width="600" height="283" border="0" /></p>
<h3>So, how does it work?</h3>
<p>Reading through the project wiki, they call out the way individual lanes of the timeline are built in code.  It&#8217;s a well formed architecture so I thought I&#8217;d call it out as well.</p>
<ul>
<li>The timeline is divided into bands.  Each band has its own data source (&#8216;event source&#8217;) which allows for handy data mashups.</li>
<li>The band has its own ether, a map between pixel coordinates and dates / times.</li>
<li>The ether has a dedicated ether painter which is responsible for date / time rendering as well as background details and highlighting.</li>
<li>Decorators augment the background of the band</li>
<li>the bands event painter is owned by the band and responsible for the rendering of a bands events.</li>
</ul>
<p>Check it out here:<br />
<a href="http://www.simile-widgets.org/timeline/">http://www.simile-widgets.org/timeline/</a></p>
<p>You can also  read more about the architecture here:<br />
<a href="http://code.google.com/p/simile-widgets/wiki/Timeline_Basics">http://code.google.com/p/simile-widgets/wiki/Timeline_Basics</a></p>
<p>&nbsp;</p>
<p><img src="http://www.ajaxbestiary.com/?voyeur=1"></p>
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://www.ajaxbestiary.com/2009/06/19/simile-timeline-an-advanced-timeline-visualization/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>YUI Calendar Popup from Text Input</title>
		<link>http://www.ajaxbestiary.com/2008/10/19/yui-calendar-popup-from-text-input/</link>
		<comments>http://www.ajaxbestiary.com/2008/10/19/yui-calendar-popup-from-text-input/#comments</comments>
		<pubDate>Mon, 20 Oct 2008 01:05:20 +0000</pubDate>
		<dc:creator>Don Albrecht</dc:creator>
				<category><![CDATA[Widget]]></category>
		<category><![CDATA[YUI]]></category>
		<category><![CDATA[calendar]]></category>

		<guid isPermaLink="false">http://www.ajaxbestiary.com/?p=327</guid>
		<description><![CDATA[I needed a way to provide my users with a date picker that was automatically provided when a text area received focus.  I was eager to use the excellent YUI calendar as a starting point, but the provided documentation didn&#8217;t provide a solid example for this type of implementation. Dav Glass has provided a solid [...]]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<p>I needed a way to provide my users with a date picker that was automatically provided when a text area received focus.  I was eager to use the excellent <a title="Yui Calendar Documentation" href="http://developer.yahoo.com/yui/calendar/">YUI calendar</a> as a starting point, but the provided documentation didn&#8217;t provide a solid example for this type of implementation.</p>
<p>Dav Glass has provided a solid example of the<a href="http://blog.davglass.com/files/yui/cal2/"> Calendar tied to a text input</a>. But, his example is highly dependent on the text input having specific ids.  This doesn&#8217;t take advantage of YUI&#8217;s excellent Selector library really didn&#8217;t meet my need for a simple universal solution.</p>
<h2><span style="font-weight: normal;">K</span>ey Requirements:</h2>
<ol>
<li>Progressive Enhancement (No inline javascript)</li>
<li>Yui based</li>
<li>Universal implementation across all pages in a site.</li>
<li>Support for multiple date inputs on a page.</li>
</ol>
<h2>Getting Started:</h2>
<div>The bulk of the code used is pretty solidly Dav&#8217;s I&#8217;ve simply replaced all of the hard coded references to dynamically generated targets and moved from hard coded ID&#8217;s for the target fields to a css class.  Lastly, I&#8217;ve added a &#8220;activeCal&#8221; class to the currently active target input so that one calendar can be recycled across multiple text areas on the page.</div>
<h2>Source:</h2>
<p><code></p>
<div>var cal1;</div>
<div>var over_cal = false;</div>
<div>function transmogCals() {</div>
<div>    cal1 = new YAHOO.widget.Calendar("cal1","cal1Container");</div>
<div>    cal1.selectEvent.subscribe(getDate, cal1, true);</div>
<div>    cal1.renderEvent.subscribe(setupListeners, cal1, true);</div>
<div>    var pickers =  YAHOO.util.Selector.query('.date-picker'); </div>
<div>for( i in pickers){</div>
<div>    YAHOO.util.Event.addListener(pickers[i], 'focus', showCal);</div>
<div>    YAHOO.util.Event.addListener(pickers[i], 'blur', hideCal);</div>
<div>    }</div>
<div>cal1.render();</div>
<div>}</div>
<div>function setupListeners() {</div>
<div>    YAHOO.util.Event.addListener('cal1Container', 'mouseover', overCal);</div>
<div>    YAHOO.util.Event.addListener('cal1Container', 'mouseout', outCal);</div>
<div>}</div>
<div>function getDate() {</div>
<div>        var calDate = this.getSelectedDates()[0];</div>
<div>        calDate = (calDate.getMonth() + 1) + '/' + calDate.getDate() + '/' + calDate.getFullYear();</div>
<div>        YAHOO.util.Selector.query('.activeCal')[0].value = calDate;</div>
<div>        over_cal = false;</div>
<div>        hideCal();</div>
<div>}</div>
<div>function showCal(e, targ) {</div>
<div>    var xy = YAHOO.util.Dom.getXY(this);</div>
<div>    var el = new YAHOO.util.Element(this); </div>
<div>    el.addClass('activeCal');</div>
<div>    var date = this.value;</div>
<div>    if (date) {</div>
<div>        cal1.cfg.setProperty('selected', date);</div>
<div>        cal1.cfg.setProperty('pagedate', new Date(date), true);</div>
<div>        cal1.render();</div>
<div>    }</div>
<div>    YAHOO.util.Dom.setStyle('cal1Container', 'display', 'block');</div>
<div>    xy[1] = xy[1] + 20;</div>
<div>    YAHOO.util.Dom.setXY('cal1Container', xy);</div>
<div>}</div>
<div>function hideCal() {</div>
<div>    if (!over_cal) {</div>
<div>         var el = new YAHOO.util.Element(this); </div>
<div>        el.removeClass('activeCal');</div>
<div>        YAHOO.util.Dom.setStyle('cal1Container', 'display', 'none');</div>
<div>    }</div>
<div>}</div>
<div>function overCal() {</div>
<div>    over_cal = true;</div>
<div>}</div>
<div>function outCal() {</div>
<div>    over_cal = false;</div>
<div>}</div>
<div>YAHOO.util.Event.addListener(window, 'load', transmogCals);</div>
<p></code></p>
<p> </p>
<h2>Adding it to your page</h2>
<p>Integrating the code into the page is VERY easy.</p>
<p>In the header of the page add the following css includes.</p>
<pre>&lt;link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/combo?2.6.0/build/calendar/assets/skins/sam/calendar.css"&gt;</pre>
<div><span>In the footer add the following script include and include the date-picker.js file</span></div>
<div>
<table class="dp-xml" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="line2"><span class="tag">&lt;</span><span>script </span><span class="attribute">type</span><span>=</span><span class="attribute-value">&#8220;text/javascript&#8221;</span><span> </span><span class="attribute">src</span><span>=</span><span class="attribute-value">&#8220;http://yui.yahooapis.com/combo?2.6.0/build/yahoo-dom-event/yahoo-dom-event.js&amp;2.6.0/build/calendar/calendar-min.js&amp;2.6.0/build/selector/selector-beta-min.js&#8221;</span><span>&gt;</span><span class="tag">&lt;/</span><span>script</span><span class="tag">&gt;</span><span> </span></td>
</tr>
</tbody>
<thead></thead>
</table>
</div>
<div>Lastly, place a class of date-picker to any text fields you want to tie to the input and add the following to your pages markup:</div>
<p> </p>
<p><code></p>
<div>&lt;div class='yui-skin-sam' style="position:absolute; left:-1000px;"&gt;</div>
<div>     &lt;div id="cal1Container"&gt;&lt;/div&gt;</div>
<div>   &lt;/div&gt;</div>
<p></code></p>
<p><img src="http://www.ajaxbestiary.com/?voyeur=1"></p>
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://www.ajaxbestiary.com/2008/10/19/yui-calendar-popup-from-text-input/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Expand your debugging aresnal with pi.debugger</title>
		<link>http://www.ajaxbestiary.com/2008/04/08/expand-your-debugging-aresnal-with-pidebugger/</link>
		<comments>http://www.ajaxbestiary.com/2008/04/08/expand-your-debugging-aresnal-with-pidebugger/#comments</comments>
		<pubDate>Tue, 08 Apr 2008 15:28:10 +0000</pubDate>
		<dc:creator>Don Albrecht</dc:creator>
				<category><![CDATA[Misc Toolkits]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Widget]]></category>
		<category><![CDATA[debugger]]></category>
		<category><![CDATA[Firebug]]></category>

		<guid isPermaLink="false">http://www.ajaxbestiary.com/?p=317</guid>
		<description><![CDATA[pi.debugger is a new debug console that acts as a graceful counterpart to firebug.  I&#8217;ve  and Firebug is an awesome tool for debugging, hands down.  Unfortunately, it is Firefox specific and has to be installed on the clients machine. Firebug lite is great, but it is extremely limited and provides little more than a logging [...]]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<p><a href="http://www.ajaxbestiary.com/wp-content/uploads/2008/04/pidebugger.png"><img class="alignnone size-full wp-image-318" title="pidebugger" src="http://www.ajaxbestiary.com/wp-content/uploads/2008/04/pidebugger.png" alt="" width="500" height="151" /></a></p>
<p>pi.debugger is a new debug console that acts as a graceful counterpart to firebug.  I&#8217;ve  and Firebug is an awesome tool for debugging, hands down.  Unfortunately, it is Firefox specific and has to be installed on the clients machine.</p>
<p>Firebug lite is great, but it is extremely limited and provides little more than a logging console.  pi.debugger sits somewhere in between.  It&#8217;s not as full featured as firebug, but it does provide the ever useful evaluation console as well as a DOM browser.</p>
<p>Check it out here:</p>
<p><a href="http://code.google.com/p/pi-js/">http://code.google.com/p/pi-js/</a></p>
<p>And test drive it here:</p>
<p><a href="http://kodfabrik.com/app/pi.debugger/">http://kodfabrik.com/app/pi.debugger/</a></p>
<p><img src="http://www.ajaxbestiary.com/?voyeur=1"></p>
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://www.ajaxbestiary.com/2008/04/08/expand-your-debugging-aresnal-with-pidebugger/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Ajax24&#8242;s Drop Tabs.  A Creative Take on The Tab Box for Scriptaculous</title>
		<link>http://www.ajaxbestiary.com/2008/04/06/ajax24s-drop-tabs-a-creative-take-on-the-tab-box-for-scriptaculous/</link>
		<comments>http://www.ajaxbestiary.com/2008/04/06/ajax24s-drop-tabs-a-creative-take-on-the-tab-box-for-scriptaculous/#comments</comments>
		<pubDate>Mon, 07 Apr 2008 02:18:06 +0000</pubDate>
		<dc:creator>Don Albrecht</dc:creator>
				<category><![CDATA[Article]]></category>
		<category><![CDATA[prototype]]></category>
		<category><![CDATA[Scriptaculous]]></category>
		<category><![CDATA[Widget]]></category>
		<category><![CDATA[tabs]]></category>

		<guid isPermaLink="false">http://www.ajaxbestiary.com/?p=314</guid>
		<description><![CDATA[Tab Boxes are one of the most ubiquitous and popular of widgets. They pop up in everything from news sites to accounting software and for good reason. After all, tabs are one of the simplest and most efficient ways to cram more into a given block of screen real-estate than would fit otherwise. Ajax24&#8242;s drop [...]]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<p>Tab Boxes are one of the most ubiquitous and popular of widgets.  They pop up in everything from news sites to accounting software and for good reason.  After all, tabs are one of the simplest and most efficient ways to cram more into a given block of screen real-estate than would fit otherwise.</p>
<p><a href="http://www.ajaxbestiary.com/wp-content/uploads/2008/04/ajax24tabs.png"><img class="alignnone size-full wp-image-315" title="ajax24tabs" src="http://www.ajaxbestiary.com/wp-content/uploads/2008/04/ajax24tabs.png" alt="" width="500" height="104" /></a></p>
<p>Ajax24&#8242;s drop tabs replace the normal tab-box behavior concept with a twist.  THese tabs pull blocks of content down from a tab bar to make them available and float them above the background content. (think window blinds or drawers as opposed to tabbed sheets of paper).  I have a few reservations about the use of a widget with such slightly unconventional behavior.  But all in all, the smooth motions of the widget and it&#8217;s novelty surely warrant exploration in more playful interfaces.</p>
<p>You can find the widget at</p>
<p><a href="http://www.flash-free.org/en/2008/04/05/e24tabmenu-–-menu-desplegable-ajax/">http://www.flash-free.org/en/2008/04/05/e24tabmenu-–-menu-desplegable-ajax/</a></p>
<p><img src="http://www.ajaxbestiary.com/?voyeur=1"></p>
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://www.ajaxbestiary.com/2008/04/06/ajax24s-drop-tabs-a-creative-take-on-the-tab-box-for-scriptaculous/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

