<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="/stylesheets/rss.css" type="text/css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Dev411 Blog: Category scriptaculous</title>
    <link>http://www.dev411.com/blog/tag/scriptaculous</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>John Wang on Technology</description>
    <item>
      <title>Online Dojo JavaScript Compressor</title>
      <description>&lt;p&gt;I just put together an &lt;a href="/dojo/javascript_compressor"&gt;online JavaScript Compressor&lt;/a&gt; interface to &lt;a href="http://dojotoolkit.org/docs/compressor_system.html"&gt;Dojo Toolkit's JavaScript Compressor&lt;/a&gt;, &lt;span class="fix"&gt;custom_rhino.jar&lt;/span&gt;. The JavaScript Compressor is used in the final stage of the Dojo Toolkit build process so gets a lot of use. Although there is already an online version, &lt;a href="http://alex.dojotoolkit.org/shrinksafe/"&gt;ShrinkSafe&lt;/a&gt;, I put another version together because:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;It would be nice to have a web app that makes custom Dojo builds people don't have to install the JDK and ant to get a custom Dojo build. This is the primary reason and the compressor is a first step in that direction.&lt;/li&gt;
	&lt;li&gt;There have been &lt;a href="http://www.huddletogether.com/forum/comments.php?DiscussionID=160"&gt;some reports&lt;/a&gt; that the JS produced by ShrinkSafe doesn't work (maybe it's using an outdated &lt;span class="fix"&gt;custom_rhino.jar&lt;/span&gt;?). I want an Dojo-based online system to use myself.&lt;/li&gt;
	&lt;li&gt;It's nice to have more Dojo, Prototype and Scriptaculous integration tests. I used the client code from ShrinkSafe which uses Dojo to add additional file and do Drag-and-Drop along with the Lucid theme which relies on Prototype and Scriptaculous. I learned that &lt;span class="fix"&gt;dojo.js&lt;/span&gt; 0.3.1 needs to be loaded before &lt;span class="fix"&gt;scriptaculous.js&lt;/span&gt; 1.6.1 or Scriptaculous will break Dojo (I updated the &lt;a href="http://www.dev411.com/blog/2006/06/13/dojo-and-prototype-together"&gt;Dojo and Prototype Together&lt;/a&gt; article). My minimal use of the Lucid theme actually doesn't need &lt;span class="fix"&gt;scriptaculous.js&lt;/span&gt; so I can get away with loading just &lt;span class="fix"&gt;dojo.js&lt;/span&gt; 0.3.1, &lt;span class="fix"&gt;prototype.js&lt;/span&gt; 1.5.0 rc0, &lt;span class="fix"&gt;effects.js&lt;/span&gt; (part of Scriptaculous 1.6.1) and &lt;span class="fix"&gt;lucid.js&lt;/span&gt;. &lt;span class="fix"&gt;lucid.js&lt;/span&gt; is part of the Lucid theme.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The JavaScript compressor eats its own dogfood and uses &lt;span class="fix"&gt;prototype.js&lt;/span&gt;, &lt;span class="fix"&gt;effects.js&lt;/span&gt; and &lt;span class="fix"&gt;lucid.js&lt;/span&gt; compressed into a single-line, single file. Here are the compression sizes and ratios for the files. Generally you save about 30%.&lt;/p&gt;

&lt;table id="article_jscompress"&gt;
&lt;tr&gt;
	&lt;th&gt;script&lt;/th&gt;
	&lt;th&gt;uncompressed&lt;/th&gt;
	&lt;th&gt;compressed&lt;br /&gt;multiline&lt;/th&gt;
	&lt;th&gt;ratio&lt;/th&gt;
	&lt;th&gt;compressed&lt;br /&gt;single line&lt;/th&gt;
	&lt;th&gt;ratio&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
	&lt;td&gt;prototype.js&lt;/td&gt;
	&lt;td&gt;55,149&lt;/td&gt;
	&lt;td&gt;38,696&lt;/td&gt;
	&lt;td&gt;70%&lt;/td&gt;
	&lt;td&gt;37,154&lt;/td&gt;
	&lt;td&gt;67%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
	&lt;td&gt;effects.js&lt;/td&gt;
	&lt;td&gt;32,908&lt;/td&gt;
	&lt;td&gt;23,244&lt;/td&gt;
	&lt;td&gt;71%&lt;/td&gt;
	&lt;td&gt;22,527&lt;/td&gt;
	&lt;td&gt;68%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
	&lt;td&gt;lucid.js&lt;/td&gt;
	&lt;td&gt;7,253&lt;/td&gt;
	&lt;td&gt;4,917&lt;/td&gt;
	&lt;td&gt;68%&lt;/td&gt;
	&lt;td&gt;4,741&lt;/td&gt;
	&lt;td&gt;65%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
	&lt;td&gt;All files&lt;/td&gt;
	&lt;td&gt;95,310&lt;/td&gt;
	&lt;td&gt;67,570&lt;/td&gt;
	&lt;td&gt;71%&lt;/td&gt;
	&lt;td&gt;65,137&lt;/td&gt;
	&lt;td&gt;68%&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;A number of people are using &lt;a href="http://www.javascriptcompressor.com"&gt;JavaScriptCompressor.com&lt;/a&gt; which is running &lt;a href="http://dean.edwards.name/download/#packer"&gt;Dean Edwards' .NET JavaScript compression code&lt;/a&gt;. This can be used after Dojo's compressor for even more compression.&lt;/p&gt;

</description>
      <pubDate>Fri, 28 Jul 2006 12:14:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:5e313631b8ed2a057be9cc4d29997c60</guid>
      <author>John Wang</author>
      <link>http://www.dev411.com/blog/2006/07/28/online-dojo-javascript-compressor</link>
      <category>dojo</category>
      <category>ajax</category>
      <category>scriptaculous</category>
      <category>prototype</category>
    </item>
    <item>
      <title>Prototype's future in Rails</title>
      <description>&lt;p&gt;The future of Prototype (the JavaScript AJAX library), both as a stand-alone library and as a part of Rails, is being discussed by the community on the &lt;span class="fix"&gt;rails-spinoffs&lt;/span&gt; list. The primary concerns appear to be:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Prototype is driven by one person who hasn't been very active on the list. Some patches are integrated but often without communication&lt;/li&gt;
&lt;li&gt;it is difficult for others to contribute&lt;/li&gt;
&lt;li&gt;there is no visibility into the roadmap for prototype&lt;/li&gt;
&lt;li&gt;prototype is "falling behind" relative to other libraries&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The one person vs. community aspect of the discussion reminds me of Red Hat rebuilds. When Red Hat stopped distributing free binaries, a number of projects took advantage of GPL and started providing free rebuild binaries. At first, &lt;a href="http://www.whiteboxlinux.org/"&gt;White Box Enterprise Linux (WBEL)&lt;/a&gt; was the most popular and wide-spread rebuild but it was maintained by one person who occasionally got busy. It was eventually overtaken by &lt;a href="http://www.centos.org"&gt;CentOS&lt;/a&gt; which is maintained by a community.&lt;/p&gt;

&lt;p&gt;For now, Prototype will remain popular because it comes bundled with Rails and is the basis for RJS and Scriptaculous. Thomas Fuchs has come out and said, "script.aculo.us will always depend on Prototype". Still, I wonder if community maintenance isn't a better way to go for something that's relied on by so many people. Some are even concerned that Rails itself will become less viable if it continues to attach itself to Prototype and the project management doesn't change.&lt;/p&gt;

&lt;p&gt;You can follow the thread by going to the list &lt;a href="http://wrath.rubyonrails.org/pipermail/rails-spinoffs/2006-July/thread.html"&gt;archives page&lt;/a&gt; and looking for the subject name "Documenting Prototype...". &lt;a href="http://wrath.rubyonrails.org/pipermail/rails-spinoffs/2006-July/005139.html"&gt;Greg Hill's post&lt;/a&gt; seems like a reasonable place to start.&lt;/p&gt;</description>
      <pubDate>Thu, 20 Jul 2006 17:22:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:4affdc8fb3cb2fc9e8b14d8a6252ebe3</guid>
      <author>John Wang</author>
      <link>http://www.dev411.com/blog/2006/07/20/prototypes-future-in-rails</link>
      <category>rails</category>
      <category>ajax</category>
      <category>scriptaculous</category>
      <category>prototype</category>
    </item>
    <item>
      <title>Autocomplete Survey</title>
      <description>&lt;p&gt;Here are some screen shots of various autocomplete effects in action to show what people are doing. The images and names above the images have links to the relevant sites with the domain name shown. I'll add more screen shots here as I get them. Let me know if there are any other toolkits demos or interesting implementations.&lt;/p&gt;

&lt;p&gt;Here are some observations:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;All of the screen shots and links are for toolkits except for Google which is just shown as an example.&lt;/li&gt;
&lt;li&gt;The jQuery and Scriptaculous demos do not automatically display "autocomplete" text in the input element.&lt;/li&gt;
&lt;li&gt;All of the demos, except Dojo, include text that will end up in the input field as well as extra display text that will not.&lt;/li&gt;
&lt;li&gt;Where both simple and customized demos are available, the customized one is used for the screen shot.&lt;/li&gt;
&lt;li&gt;Del.icio.us also has nice variable horizontal location/width autocomplete for tags that I don't have a screen shot for atm. Gmail also has a nice autocomplete that isn't shown.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The observations are just for the particular demos available. The libraries may have the ability to be configured in additional ways.&lt;/p&gt;

&lt;div id="article_ac" style="text-align:center"&gt;
&lt;table class="article_ac"&gt;&lt;tr&gt;
  &lt;td style="vertical-align:top"&gt;
  
&lt;div class="ac_img_wrap"&gt;
&lt;a href="http://download.dojotoolkit.org/release-0.3.0/dojo-0.3.0-widget/tests/widget/test_remote_ComboBox.html"&gt;&lt;strong&gt;Dojo&lt;/strong&gt; (dojotoolkit.org)&lt;/a&gt;
&lt;br /&gt;
&lt;a href="http://download.dojotoolkit.org/release-0.3.0/dojo-0.3.0-widget/tests/widget/test_remote_ComboBox.html"&gt;&lt;img class="img_wrap" alt="dojo autocomplete" src="/images/articles/200607/autocomplete_dojo_200.png" /&gt;&lt;/a&gt;
&lt;br /&gt;
(&lt;a href="/images/articles/200607/autocomplete_dojo.png"&gt;fullsize screen shot&lt;/a&gt;)
&lt;/div&gt;

&lt;div class="ac_img_wrap"&gt;
&lt;a href="http://proj.jquery.com/discuss/2006-July/003050/"&gt;&lt;strong&gt;jQuery&lt;/strong&gt; (jquery.com)&lt;/a&gt;
&lt;br /&gt;
&lt;a href="http://proj.jquery.com/discuss/2006-July/003050/"&gt;&lt;img class="img_wrap" alt="jquery autocomplete" src="/images/articles/200607/autocomplete_jquery_200.png" /&gt;&lt;/a&gt;
&lt;br /&gt;
(&lt;a href="/images/articles/200607/autocomplete_jquery_orig.png"&gt;fullsize screen shot&lt;/a&gt;)
&lt;/div&gt;

&lt;div class="ac_img_wrap"&gt;
&lt;a href="http://developer.yahoo.com/yui/autocomplete/"&gt;&lt;strong&gt;Yahoo UI&lt;/strong&gt; (yahoo.com)&lt;/a&gt;
&lt;br /&gt;
&lt;a href="http://developer.yahoo.com/yui/autocomplete/"&gt;&lt;img  class="img_wrap" alt="yahoo ui autocomplete" src="/images/articles/200607/autocomplete_yahooui_200.png" /&gt;&lt;/a&gt;
&lt;br /&gt;
(&lt;a href="/images/articles/200607/autocomplete_yahooui.png"&gt;fullsize screen shot&lt;/a&gt;)
&lt;/div&gt;

  &lt;/td&gt;&lt;td style="vertical-align:top"&gt;

&lt;div class="ac_img_wrap"&gt;
&lt;a href="http://labs.google.com/suggest/"&gt;&lt;strong&gt;Google&lt;/strong&gt; (google.com)&lt;/a&gt;
&lt;br /&gt;
&lt;a href="http://labs.google.com/suggest/"&gt;&lt;img class="img_wrap" alt="google suggest autocomplete" src="/images/articles/200607/autocomplete_google_200.png" /&gt;&lt;/a&gt;
&lt;br /&gt;
(&lt;a href="/images/articles/200607/autocomplete_google.png"&gt;fullsize screen shot&lt;/a&gt;)
&lt;/div&gt;

&lt;div class="ac_img_wrap"&gt;
&lt;a href="http://demo.script.aculo.us/ajax/autocompleter_customized"&gt;&lt;strong&gt;Scriptaculous&lt;/strong&gt; (script.aculo.us)&lt;/a&gt;
&lt;br /&gt;
&lt;a href="http://demo.script.aculo.us/ajax/autocompleter_customized"&gt;&lt;img class="img_wrap" alt="scriptaculous autocomplete" src="/images/articles/200607/autocomplete_scriptaculous_200.png" /&gt;&lt;/a&gt;
&lt;br /&gt;
(&lt;a href="/images/articles/200607/autocomplete_scriptaculous.png"&gt;fullsize screen shot&lt;/a&gt;)
&lt;/div&gt;
  
  &lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;

&lt;p&gt;NOTE: The jQuery screen shot has been edited to size it better from the demo page: (a) the number of results was reduced and (b) the width has been reduced because there's a lot of blank space in the demo. The &lt;a href="/images/articles/200607/autocomplete_jquery_orig.png"&gt;original jQuery screen shot&lt;/a&gt; is also available.&lt;/p&gt;

&lt;p&gt;UPDATE: CAPXOUS has an interesting paged autocomplete variation which adds Next and Prev links when applicable. The one minor issue I ran into when using this is that it would switch location (above/below the input) if it was near a browser edge and the number of items changed as shown below. I found this a bit disconcerting. I wonder if there's a way to making it always used the side for the larger list? CAPXOUS can also show info that's searched on but not shown but this was less interesting than the paging. One final note, unlike the other JS libraries listed above which are free open source software (FOSS), CAPXOUS is commecial requires a license fee. Pretty interesting idea.&lt;/p&gt;

&lt;table class="article_ac"&gt;&lt;tr&gt;
  &lt;td style="vertical-align:top;text-align:center"&gt;
  
&lt;div class="ac_img_wrap"&gt;
&lt;a href="http://capxous.com/"&gt;&lt;strong&gt;CAPXOUS&lt;/strong&gt; (capxious.com)&lt;/a&gt;
&lt;br /&gt;
&lt;a href="http://capxous.com/"&gt;&lt;img class="img_wrap" alt="capxous autocomplete" src="/images/articles/200607/autocomplete_capxous.png" /&gt;&lt;/a&gt;
&lt;br /&gt;
(&lt;a href="/images/articles/200607/autocomplete_capxious.png"&gt;fullsize screen shot&lt;/a&gt;)
&lt;/div&gt;
  &lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;

</description>
      <pubDate>Mon, 17 Jul 2006 23:15:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:6cd5c46165d0c7e0eb3ef4a70efb0344</guid>
      <author>John Wang</author>
      <link>http://www.dev411.com/blog/2006/07/17/autocomplete-survey</link>
      <category>yui</category>
      <category>jquery</category>
      <category>dojo</category>
      <category>google</category>
      <category>autocomplete</category>
      <category>ajax</category>
      <category>scriptaculous</category>
    </item>
    <item>
      <title>Scriptaculous article slider for Typo themes</title>
      <description>&lt;p&gt;Several Typo themes have nice DHTML effects and I thought it would be useful to extract some of these for use in other themes. In particular I am interested in adding &lt;a href="http://www.typogarden.org/articles/2005/11/16/modernist-theme"&gt;Modernist&lt;/a&gt;'s DHTML &lt;a href="http://script.aculo.us"&gt;Scriptaculous&lt;/a&gt; ScrollTo article slider to my modded Azure theme. You can see this in action at &lt;a href="http://poocs.net"&gt;poocs.net&lt;/a&gt; which is currently running Modernist. This article covers the steps necessary to repurpose the DHTML article slider and involves templates, CSS and images. I've shown how Modernist does it and, where applicable, how I prefer to do it. It turns out to be pretty easy.&lt;/p&gt;

&lt;p&gt;I've added this feature to my test system, however it's not here yet because I've decided to create a custom Dev411_Azure theme to handle the views (and controller/helper patches) for the growing number of mods I'm using rather than to continue manually hacking files under &lt;span class="fix"&gt;themes/azure&lt;/span&gt; and &lt;span class="fix"&gt;app&lt;/span&gt;. This should be here before long.&lt;/p&gt;

&lt;p&gt;The things discussed here are the changes necessary to add the DHTML slider to a theme of your choice. For the files below the path part &lt;span class="fix"&gt;...&lt;/span&gt; should be along the lines of &lt;span class="fix"&gt;"themes/#{mytheme}"&lt;/span&gt; but can be simply &lt;span class="fix"&gt;app&lt;/span&gt; if you don't mind losing your changes when the admin console is used to change themes.&lt;/p&gt;

&lt;p&gt;I'll show where my preferences deviate from Modernist's implementation. My pet peeve is the use of the extra &lt;span class="fix"&gt;@ta&lt;/span&gt; instance varaible since it's unnecessary and the name isn't self-explanatory. I'll use &lt;span class="fix"&gt;each_with_index&lt;/span&gt; with &lt;span class="fix"&gt;article_index&lt;/span&gt; as the index name.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;.../views/articles/index.rhtml&lt;/strong&gt;: in order to know the which article is next, Modernist introduces a counter called &lt;span class="fix"&gt;@ta&lt;/span&gt; in the &lt;span class="fix"&gt;index.rhtml&lt;/span&gt; file. I'll probably name this something more intuitive like &lt;span class="fix"&gt;@article_index&lt;/span&gt; but here's the code from:
&lt;span class="fix"&gt;themes/modernist/views/articles/index.rhtml&lt;/span&gt; &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Modernist:&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;&lt;span class="highlight"&gt;&amp;lt;% @ta=0 %&amp;gt;&lt;/span&gt;
&amp;lt;% for article in @articles -%&amp;gt;
  &amp;lt;%= render_partial "article", article %&amp;gt;
  &lt;span class="highlight"&gt;&amp;lt;% @ta+=1 %&amp;gt;&lt;/span&gt;
&amp;lt;% end -%&amp;gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;My preference:&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;&lt;span class="highlight"&gt;&amp;lt;% @articles.each_with_index do |article,article_index| -%&amp;gt;&lt;/span&gt;
  &amp;lt;%= render :partial =&amp;gt; "article",
             :object  =&amp;gt; article,
             :locals  =&amp;gt; { &lt;span class="highlight"&gt;:article_index =&amp;gt; article_index&lt;/span&gt; }
  %&amp;gt;
&amp;lt;% end -%&amp;gt;&lt;/pre&gt;

&lt;ul&gt;
&lt;li&gt;use &lt;span class="fix"&gt;each_with_index&lt;/span&gt; instead of creating an extra counter since the index is already available&lt;/il&gt;
&lt;li&gt;use &lt;span class="fix"&gt;render&lt;/span&gt; instead of &lt;span class="fix"&gt;render_partial&lt;/span&gt; just because the former was indicated as preferred on the &lt;span class="fix"&gt;#typo&lt;/span&gt; channel&lt;/li&gt;
&lt;li&gt;use self-explanatory variable names: &lt;span class="fix"&gt;article_index&lt;/span&gt; instead of &lt;span class="fix"&gt;ta&lt;/span&gt;
&lt;li&gt;&lt;p&gt;I would actually prefer to send the article object to the render method as a local variable since that's what it seems to be and I don't see a reason to treat it differently.&lt;/p&gt;

&lt;pre&gt;:locals =&gt; {
    :article =&gt; article
    :article_index =&gt; article_index
}&lt;/pre&gt;

&lt;p&gt;instead of as &lt;span class="fix"&gt;:object&lt;/span&gt; but I can't be sure that will always work since &lt;span class="fix"&gt;article&lt;/span&gt; is also the name of the template and there's some magic there.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;.../views/articles/_article.rhtml&lt;/strong&gt;: there are two pertinent changes in this file: (a) the Scriptaculous &lt;span class="fix"&gt;ScrollTo &lt;/span&gt; controls and (b) adding a DOM &lt;span class="fix"&gt;id&lt;/span&gt; to the article header that can be navigated to.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;ScrollTo controls&lt;/strong&gt;: In the Modernist theme, the Scriptaculous controls are embedded directly in &lt;span class="fix"&gt;_article.rhtml&lt;/span&gt; as follows. Another option is to put it in a separate &lt;span class="fix"&gt;_article_flip.rhtml&lt;/span&gt; template include but I'm not sure if this will be automatically copied in by Typo's theme admin manager. In any event, the following should be added to the top of &lt;span class="fix"&gt;_article.rhtml&lt;/span&gt; either directly or as an include. Notice the innerHTML of the links below is a space. The links will be rendered as graphics once the CSS is enabled.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Modernist:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&amp;lt;div class="flip"&amp;gt;
&amp;lt;a href="#header" onclick="new Effect.ScrollTo('header'); 
  return false" class="flip-top"
  title="Scroll to the top"&amp;gt; &amp;lt;/a&amp;gt;
&amp;lt;% if &lt;span class="highlight"&gt;@ta&lt;/span&gt; &amp;lt; (@articles.size-1) %&amp;gt;
&amp;lt;a href="#post-&amp;lt;%= &lt;span class="highlight"&gt;@ta&lt;/span&gt;+1 %&amp;gt;"
  onclick="new Effect.ScrollTo('post-&amp;lt;%= &lt;span class="highlight"&gt;@ta&lt;/span&gt;+1 %&amp;gt;');
  return false" class="flip-next"
  title="Scroll to the next post"&amp;gt; &amp;lt;/a&amp;gt;
&amp;lt;% end %&amp;gt;
&amp;lt;a href="#menu" onclick="new Effect.ScrollTo('menu');
  return false" class="flip-menu"
  title="Scroll to the menu"&amp;gt; &amp;lt;/a&amp;gt;
&amp;lt;/div&amp;gt;&lt;/pre&gt;

&lt;p&gt;The Modernist theme places the menu at the bottom of the page so having a control go to &lt;span class="fix"&gt;menu&lt;/span&gt; makes sense. For a more traditional theme like Azure, I added a &lt;span class="fix"&gt;&amp;lt;div id="bottom"&amp;gt;&lt;/span&gt; around &lt;span class="fix"&gt;&amp;lt;p id="pagination"&lt;/span&gt; to indicate the bottom and changed the last link above accordingly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;My preference:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;Change the &lt;span class="fix"&gt;@ta&lt;/span&gt; references to &lt;span class="fix"&gt;article_index&lt;/span&gt; as above&lt;/li&gt;&lt;/ul&gt;

&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;article anchor&lt;/strong&gt;: The next change is to add a DOM &lt;span class="fix"&gt;id&lt;/span&gt; with the article index to each article's title:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Modernist:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&amp;lt;h3&lt;span class="highlight"&gt; id="post-&amp;lt;%= @ta %&amp;gt;"&lt;/span&gt;&amp;gt;
  &amp;lt;%= article_link article.title, article %&amp;gt;
  &amp;lt;%= author_link(article) %&amp;gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;My preference:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&amp;lt;h3&lt;span class="highlight"&gt; id="post-&amp;lt;%= article_index %&amp;gt;"&lt;/span&gt;&amp;gt;&lt;/pre&gt;


&lt;/ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;CSS&lt;/strong&gt;: Copy the CSS definitions that begin with &lt;span class="fix"&gt;.flip&lt;/span&gt; to one of your CSS files:&lt;/p&gt;

&lt;pre&gt;.flip {
        float: left;
        position: absolute;
        opacity: 0.9;
        margin: 0 0 0 -65px;
}

.flip a {
        display: block;
        width: 25px;
        height: 16px;
        padding: 4px;
        background-position: center center;
        background-repeat: no-repeat;
}

.flip-menu { background-image:
  url('/images/theme/flip-bottom-0.gif'); }
.flip-next { background-image:
  url('/images/theme/flip-down-0.gif'); }
.flip-top { background-image:
  url('/images/theme/flip-top-0.gif'); }
.flip-comments { background-image:
  url('/images/theme/flip-comments-0.gif'); }
.flip-post { background-image:
  url('/images/theme/flip-post-0.gif'); }
.flip-menu:hover { background-image:
  url('/images/theme/flip-bottom-1.gif'); }
.flip-next:hover { background-image:
  url('/images/theme/flip-down-1.gif'); }
.flip-top:hover { background-image:
  url('/images/theme/flip-top-1.gif'); }
.flip-comments:hover { background-image:
  url('/images/theme/flip-comments-1.gif'); }
.flip-post:hover { background-image:
  url('/images/theme/flip-post-1.gif'); }&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;control images&lt;/strong&gt;: the last step is to copy the control images to the right location. These are the &lt;span class="fix"&gt;flip-post-[01].gif&lt;/span&gt; images referenced in the CSS. Copy these to the correct directory.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That's it, you should be able to get up and running.&lt;/p&gt;
</description>
      <pubDate>Wed, 12 Jul 2006 01:48:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:4062f3dbcec251fe52a4d8393d7f1511</guid>
      <author>John Wang</author>
      <link>http://www.dev411.com/blog/2006/07/12/scriptaculous-article-slider-for-typo-themes</link>
      <category>typo</category>
      <category>hacks</category>
      <category>dhtml</category>
      <category>scriptaculous</category>
    </item>
    <item>
      <title>Typo Themes Viewer 0.2</title>
      <description>&lt;p&gt;I updated the &lt;a href="/typo/themes/"&gt;Typo Themes Viewer&lt;/a&gt; with the following features:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.thelucid.com"&gt;Lucid theme&lt;/a&gt;: No longer a &lt;a href="/blog/2006/06/21/typo-theme-viewer"&gt;drab gray&lt;/a&gt; :) The theme viewer currently uses a fluid layout for non-IE browsers and a fixed layout for IE since I ran into some issues using the fluid layout on IE. Even with the wider left and right margins, I can still get 6 thumbnails across on my 1400x1050 screen for easy viewing.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.huddletogether.com/projects/lightbox2/"&gt;Lightbox image viewer&lt;/a&gt;: The Scriptaculous Sortable effect has been removed and replaced with Lightbox (which relies on Scriptaculous). When you click on the thumbnail now a medium sized graphic will appear. Let me know how it works for you.&lt;/li&gt;&lt;/ul&gt;

&lt;p&gt;As before, I'm more than happy to add new themes as they become available. Just post a comment here with the uri(s).&lt;/p&gt;
&lt;p&gt;The new look:&lt;/p&gt;
&lt;div style="text-align:center"&gt;&lt;a href="/typo/themes/"&gt;&lt;img alt="Typo Themes Viewer" src="/images/articles/200606/typothemes0.2a_400.png" style="border:0" /&gt;&lt;/a&gt;&lt;/div&gt;

&lt;p&gt;Using Lightbox:&lt;/p&gt;
&lt;div style="text-align:center"&gt;&lt;a href="/typo/themes/"&gt;&lt;img alt="Typo Themes Viewer with Lightbox" src="/images/articles/200606/typothemes0.2b_400.png" style="border:0" /&gt;&lt;/a&gt;&lt;/div&gt;

&lt;p&gt;On a final note, Lightbox 1.x allowed you to close the lightboxed image by clicking on it. In Lightbox 2.x, this has been disbled to allow the group feature to function. If you are only using single images or run separate copies of lightbox.js for singles and groups you can make the following mod to allow closing by clicking on the single lightboxed image:&lt;/p&gt;

&lt;pre&gt;// look for the following line:
objImageContainer.appendChild(objLightboxImage);
// then add this after:
&lt;span class="highlight"&gt;objImageContainer.onclick
  = function() { myLightbox.end(); return false; };&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;Thanks to Tyler Mulligan for this solution.&lt;/p&gt;

</description>
      <pubDate>Sat, 01 Jul 2006 18:41:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:516d79913fbffe2eb9a8afd77de71dfe</guid>
      <author>John Wang</author>
      <link>http://www.dev411.com/blog/2006/07/01/typo-themes-viewer-0-2</link>
      <category>typo</category>
      <category>scriptaculous</category>
    </item>
    <item>
      <title>Dojo and Prototype Together</title>
      <description>&lt;p&gt;I just wanted to report and let everyone know with &lt;a href="http://prototype.conio.net"&gt;Prototype&lt;/a&gt; 1.5.x, &lt;a href="http://www.dojotoolkit.org"&gt;Dojo Toolkit&lt;/a&gt; and Prototype should now be interoperable. Earlier versions of prototype.js extended the JavaScript Object prototype that would break third-party JavaScript but this is no longer being done. A few people, including myself, have been using them together without any problems. The prototype website still offers 1.4.0 as the current version, however 1.5.0 rc0 is included with &lt;a href="http://script.aculo.us"&gt;Scriptaculous&lt;/a&gt; 1.6.1. I'm currently using prototype 1.5.0 rc0 with Dojo 0.3.1 and Scriptaculous 1.5 rc4. Although Scriptaculous 1.6.1 is available, it breaks autocomplete for me and I haven't had time to track down what changed yet. Hopefully soon.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;UPDATE:&lt;/strong&gt; The Scriptaculous 1.6.1 issue has been reported to RoR as &lt;a href="http://dev.rubyonrails.org/ticket/5673"&gt;ticket #5673&lt;/a&gt;. This has since been fixed with Scriptaculous 1.6.2. I'm now using Dojo 0.3.1, Prototype 1.5.0 rc0 and Scriptaculous 1.6.2.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;UPDATE 2:&lt;/strong&gt; When running &lt;span class="fix"&gt;dojo.js&lt;/span&gt; and &lt;span class="fix"&gt;scriptaculous.js&lt;/span&gt; together, make sure you load &lt;span class="fix"&gt;dojo.js&lt;/span&gt; first. Loading &lt;span class="fix"&gt;scriptaculous.js&lt;/span&gt; first will cause Dojo to fail.&lt;/p&gt;

</description>
      <pubDate>Tue, 13 Jun 2006 21:31:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:38c104ddc9167cbf60448098739c9316</guid>
      <author>John Wang</author>
      <link>http://www.dev411.com/blog/2006/06/13/dojo-and-prototype-together</link>
      <category>dojo</category>
      <category>autocomplete</category>
      <category>ajax</category>
      <category>scriptaculous</category>
      <category>prototype</category>
    </item>
    <item>
      <title>HTML::Prototype - AJAX Without JavaScript</title>
      <description>&lt;p&gt;&lt;a href="http://search.cpan.org/~esskar/HTML-Prototype-1.45/lib/HTML/Prototype.pm"&gt;HTML::Prototype&lt;/a&gt; is by far the most painless way to get started with AJAX that I've found. Simply put, you do not need to know or write any JavaScript! HTML::Prototype is a Perl module on CPAN that wraps the prototype AJAX library and Script.aculo.us effects library with Perl helper methods so you don't need to write a single line of JavaScript to get some great effects. There are also a number of modules that wrap HTML::Prototype for integration with &lt;a href="http://search.cpan.org/~sri/Catalyst-Plugin-Prototype-1.32/lib/Catalyst/Plugin/Prototype.pm"&gt;Catalyst&lt;/a&gt;, &lt;a href="http://search.cpan.org/~ceeshek/CGI-Application-Plugin-HTMLPrototype-0.20/lib/CGI/Application/Plugin/HTMLPrototype.pm"&gt;CGI::Application&lt;/a&gt;, &lt;a href="http://search.cpan.org/~bauerb/Template-Plugin-HTML-Prototype-0.01/lib/Template/Plugin/HTML/Prototype.pm"&gt;Template Toolkit&lt;/a&gt; and others.&lt;/p&gt;

&lt;p&gt;There are a number of convenient methods such as &lt;span class="fix"&gt;link_to_remote()&lt;/span&gt; and &lt;span class="fix"&gt;submit_to_remote()&lt;/span&gt; that create a link and form button to make an AJAX call and populate the innerHTML of a specified DOM element with the response body. Syntactic sugar to be sure as the JS generated by HTML::Prototype is very simple once you look at it, but the beauty is that you never have to.&lt;/p&gt;

&lt;p&gt;To truly appreciate HTML::Prototype you need to use some of Scriptaculous' more advanced widgets such as autocomplete. Sebastian Riedel put together a screencast using Catalyst that demonstrates how easy it is to use. Links to the screencast are available on the Catalyst wiki movies page:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://dev.catalyst.perl.org/wiki/Movies"&gt;http://dev.catalyst.perl.org/wiki/Movies&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Another great thing about having HTML::Prototype generate the JS syntax for you is that you can learn prototype syntax just by View Source. I picked up enough of prototype's JS syntax this way that I haven't looked at the docs yet.&lt;/p&gt;

&lt;p&gt;I've recently removed HTML::Prototype from a project in favor of using &lt;span class="fix"&gt;prototype.js&lt;/span&gt; and &lt;span class="fix"&gt;scriptaculous.js&lt;/span&gt; directly and I'm evaluating the Dojo Toolkit but HTML::Prototype let me get started with very effective, painless AJAX functionality. I used it with Catalyst::Plugin::Prototype and thought 'this is how frameworks make you productive.' Thanks to all the contributors.&lt;/p&gt;

</description>
      <pubDate>Mon, 05 Jun 2006 20:52:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:77762545b1dda44d93f114f89f64dfb0</guid>
      <author>John Wang</author>
      <link>http://www.dev411.com/blog/2006/06/05/html-prototype-ajax-without-javascript</link>
      <category>catalyst</category>
      <category>perl</category>
      <category>templatetoolkit</category>
      <category>ajax</category>
      <category>scriptaculous</category>
      <category>prototype</category>
    </item>
    <item>
      <title>Dojo's ComboBox Not Ready for Prime Time?</title>
      <description>&lt;p&gt;I've been happily developing with Prototype and Scriptaculous for a while now but was recently convinced to look at Dojo. To start, &lt;a href="http://dev411.blogspot.com/2006/06/dojo-using-dojoiobind.html"&gt;I was pretty happy with dojo.io.bind&lt;/a&gt; but &lt;a href="http://dev411.blogspot.com/2006/06/dojo-remote-script-problem.html"&gt;disappointed that I wasn't able to get the Dojo scripts to load from a remote server&lt;/a&gt;. Having gotten dojo.io.bind to work, I was off to test my first widget, Dojo's ComboBox, which offers functionality similar to the Scriptaculous autocomplete widget. I've been using Dojo 0.3.0. The &lt;a href="http://archive.dojotoolkit.org/nightly/tests/widget/test_ComboBox.html"&gt;Dojo ComboBox Nightly Test&lt;/a&gt; is often mentioned as a good place to start so I went there first. Eventually I also spent some time reading and implementing the code at &lt;a href="http://today.java.net/pub/a/today/2006/04/27/building-ajax-with-dojo-and-json.html"&gt;Java.net's AJAX with Dojo and JSON page&lt;/a&gt;. In the end I came away disappointed due to several bugs and strange behaviors listed below:&lt;/p&gt;

&lt;ol&gt;&lt;li&gt;&lt;strong&gt;Default value:&lt;/strong&gt; Dojo does not let you set a default value via the HTML or any other way. To get a default value to show up, I've heard you can write it in with JavaScript but I'm not sure where or when yet due to the DOM onLoad transform issue described below.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Single option bug:&lt;/strong&gt; when the a resulting list only has one item, hitting the 'enter' key will not close the list. With autocomplete, the single entry will already be populated in the box but not selectable with 'enter'. You need to select the single option in the list with the down key and then hit the 'enter' key. To try this out, type in 'am' for American Samoa in the first input on the nightly test and click 'enter' to continue. I haven't found out whether this is being worked on or not.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;DOM onLoad transform:&lt;/strong&gt; Unlike other libraries, after the page has been rendered Dojo will go back and transform the DOM, replacing dojoTypes with HTML templates. This can cause some timing problems when one wants to use DOM to modify the resulting HTML templates. Dojo provides a &lt;span class="fix"&gt;dojo.addOnLoad&lt;/span&gt; capability to specify a callback function however the new DOM elements don't seem to be available yet. Perhaps something to the effect of &lt;span class="fix"&gt;dojo.afterDojoOnLoad&lt;/span&gt; is needed?

This issue can be seen when trying to remove the ComboBox downArrowNode. The ComboBox comes with a down arrow graphic by default and is assigned &lt;span class="fix"&gt;dojoattachpoint="downArrowNode"&lt;/span&gt;. With some lists, the reply possibilities are enormous and a default list isn't desirable. When nothing has been typed, it may also give the impression that the list provided is a complete list like a standard &lt;span class="fix"&gt;select&lt;/span&gt; element. I haven't found a good way to disable this yet. Setting the display property on the &lt;span class="fix"&gt;downArrowNode&lt;/span&gt; isn't a good solution because it only works after the page has been rendered. It can't be set immediately rendering the ComboBox &lt;span class="fix"&gt;input&lt;/span&gt; tag because Dojo hasn't been run yet. Setting the display property in the &lt;span class="fix"&gt;dojo.addOnLoad&lt;/span&gt; callback is also too early, i.e. the widget doesn't exist yet. Here's the JS I've been working with:&lt;pre&gt;var ac = dojo.widget.byId("ac");
ac.downArrowNode.style.display="none";&lt;/pre&gt;I've also tried setting &lt;span class="fix"&gt;downArrow&lt;/span&gt; and &lt;span class="fix"&gt;downArrowNode&lt;/span&gt; attributes to &lt;span class="fix"&gt;0&lt;/span&gt;, &lt;span class="fix"&gt;-1&lt;/span&gt; and &lt;span class="fix"&gt;false&lt;/span&gt;. So far, the only solution I found that works is to delete or comment out the &lt;span class="fix"&gt;downArrowNode&lt;/span&gt; HTML in the following file:&lt;pre&gt;dojo/src/widget/templates/HtmlComboBox.html&lt;/pre&gt;Not exactly a great solution. Is there a better way to remove the arrow?&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Client-side result filtering:&lt;/strong&gt; It seems like the Dojo javascript does it's own filtering. You give it a list in the format of an Array of Arrays where each inner array has two elements. Dojo then applies it's own filtering. This is nice if you are working off a local list such as a JS file in the Nightly Test example but if you are retrieving a list from a server, the server should have filtered the list already so there's no reason to filter it a second time. This may be partially at fault for the choppy rendering. Is there any way to disable this?&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Aribitrary location match:&lt;/strong&gt; Because Dojo does client-side result filtering, the user isn't guaranteed to see what your server delivers. One area this shows up is that it's not clear how to match any part of the string instead of just the beginning. On the nightly test page, the only results presented are ones where the input matches the start of the string so if someone types a last name and the strings have the format "$first_name $last_name" there would not be a match. The DocTool on dojo.org will match inside the string but the rendering seems choppy and I can't seem to locate it any more. I haven't gotten around to seeing how the DocTool does it. The &lt;a href="http://svn.dojotoolkit.org/dojo/trunk/docscripts/doctool.html"&gt;SVN copy of the doctool.html file&lt;/a&gt; shows the following which does not result in the desired non-start match for me:&lt;pre&gt;&amp;lt;input
    dojoType="combobox"
    id="search"
    autoComplete="false"
    value=""
    style="width: 300px;"
&amp;gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;HTML result rendering:&lt;/strong&gt; Often it's nice to show the user which part of the string matched, especially if the match is not at the beginning of the string. This is done by bolding the matching letters a la Gmail. If HTML is included in the array, it is rendered literally instead of interpreted as HTML. Because Dojo does client-side filtering, HTML mark up will also cause matching to fail. With Scriptaculous, you can add HTML mark-up to the results and it will render properly. Perhaps with Dojo, the HTML needs to be added by client-side JavaScript?&lt;/li&gt;&lt;/ol&gt;

&lt;p&gt;These are my initial observations of Dojo's ComboBox. It seems very difficult to get it to DWIW and very different than the Scriptaculous Autocomplete which just works and has been working. Scriptaculous autocomplete has been working like champ for me since prototype 1.3.1 and it's now on 1.5.0 rc0. Please let me know of any ways to accomplish the above Dojo ComboBox issues. Also let me know if you're using Dojo's ComboBox in production and / or your experiences with it.&lt;/p&gt;

</description>
      <pubDate>Sun, 04 Jun 2006 01:21:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:3ef6ce509c1a8d421b85478397dc5205</guid>
      <author>John Wang</author>
      <link>http://www.dev411.com/blog/2006/06/04/dojos-combobox-not-ready-for-prime-time</link>
      <category>dojo</category>
      <category>autocomplete</category>
      <category>ajax</category>
      <category>scriptaculous</category>
    </item>
  </channel>
</rss>
