<?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>geedew &#187; Development</title>
	<atom:link href="http://www.geedew.com/category/development/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.geedew.com</link>
	<description>flirting with the accessible web</description>
	<lastBuildDate>Wed, 13 Apr 2011 22:46:59 +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>Developing a Robust Build Process Using Phing</title>
		<link>http://www.geedew.com/2011/04/13/developing-a-robust-build-process-using-phing/</link>
		<comments>http://www.geedew.com/2011/04/13/developing-a-robust-build-process-using-phing/#comments</comments>
		<pubDate>Wed, 13 Apr 2011 22:46:59 +0000</pubDate>
		<dc:creator>drew</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Phing]]></category>

		<guid isPermaLink="false">http://www.geedew.com/?p=297</guid>
		<description><![CDATA[What is Phing? Phing is a PHP build process that uses XML , ANT style syntax. At some point in development, the choice is made to begin professional work. If more than 1 developer contributes to the effort, then an (&#8230;)</p><p><a href="http://www.geedew.com/2011/04/13/developing-a-robust-build-process-using-phing/">Read the rest of this entry &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<h3>What is Phing?</h3>
<p><strong>Phing is a PHP build process that uses XML , ANT style syntax.</strong></p>
<p>At some point in development, the choice is made to begin professional work. If more than 1 developer contributes to the effort, then an the easy mode of keeping in sync with that person and, in the future, others that may join the effort is required. Because not all developers are alike, and not all hosting providers are alike, you must have a solid build process of your code.  The build process automates the routines that every developer must do, either daily, hourly, or with every code change as well as when code is pushed into client facing distributions.  Phing is an XML to PHP build process that imitates the ANT build process that many development shops are used to.  As a PHP developer, Phing is much easier for me to work with and get things done, as well as keeps things simple when needing to update the build process.</p>
<p><span id="more-297"></span></p>
<h3>Installing Phing</h3>
<p><strong>Dependencies :</strong></p>
<p><a title="Phing Setup" href="To use Phing you must have installed PHP version 5.2 or above compiled --with-libxml2, as well as --with-xsl if you want to make use of advanced functionality." target="_blank">Straight from the source</a>, &#8220;To use Phing you must have installed PHP version 5.2 or above compiled &#8211;with-libxml2, as well as &#8211;with-xsl if you want to make use of advanced functionality.&#8221; I would hope that if you are doing any serious PHP development, you would already meet these requirements.  If you are needing to upgrade your PHP, then you really should reconsider what you are using PHP for.</p>
<p>My approach to installing Phing is the simplest solution and it follows exactly what the setup guide describes by using Pear.</p>
<pre class="brush: plain; title: ; notranslate">
$ pear channel-discover pear.phing.info&lt;/span&gt;
$ pear install phing/phing
</pre>
<p>You should now be able to test Phing by simply typing &#8216;phing&#8217; from the command line. You should get an error similar to this: &#8216;Buildfile: build.xml does not exist!&#8217;</p>
<h3>Copying and Moving Files</h3>
<p> One of the most important parts of a build process is the ability to move and copy files to different places. Phing makes this easy and allows you to modify the files as you are moving them. Different reasons to have a build process will determine how you would like to set up your folder paths for Phing to manipulate. Let&#8217;s do one that is pretty powerful and pretty simple at the same time: copying all files from a folder, into a single file, located in an entirely different folder.</p>
<p><strong>build.xml</strong></p>
<pre class="brush: xml; title: ; notranslate">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;project name=&quot;MyWebapp&quot; default=&quot;default&quot; basedir=&quot;.&quot;&gt;
&lt;target name=&quot;default&quot;&gt;
 &lt;foreach param=&quot;dirname&quot; absparam=&quot;absname&quot; target=&quot;compile-folder-js&quot;&gt;
  &lt;fileset dir=&quot;./js&quot;&gt;
   &lt;type type=&quot;dir&quot; /&gt;
   &lt;depth max=&quot;0&quot; min=&quot;0&quot; /&gt;
  &lt;/fileset&gt;
 &lt;/foreach&gt;
&lt;/target&gt;
&lt;target name=&quot;compile-folder-js&quot;&gt;
  &lt;mkdir dir=&quot;./${dirname}-js&quot; /&gt;
  &lt;fileset id=&quot;filestocompile&quot; dir=&quot;js/${dirname}&quot;&gt;
   &lt;include name=&quot;**/*.js&quot; /&gt;
  &lt;/fileset&gt;
  &lt;append destFile=&quot;./${dirname}-js/${dirname}.js&quot;&gt;
   &lt;fileset refid=&quot;filestocompile&quot; /&gt;
  &lt;/append&gt;
&lt;/target&gt;
</pre>
<p>Phing works using a Build.xml file to run the commands when Phing is called.  The only requirements of this file are the project tag and a default target. We have set our default target to run code that dives into the ./js folder path; loops through every <em>folder</em> in this path and passes them to another target (compile-folder-js) for processing; one at a time.  Now we can have in our source ./js/jquery/ and ./js/modernizr/ and this will take all JavaScript files send them to the compile-folder-js target.</p>
<p>The compile-folder-js target will loop through the directory that is passed to it and grab all JavaScript files (recursive folder depth because of the **/ ) and append them to a single file under the path ./directory-js/directory.js. This is pretty great when it comes to a production versus a development site. For instance, in a development site, you may have 5 different JavaScript files, but in a Production site, after a build, you could have a single JavaScript file. However, one point to be aware of, the files will be appended in teh order the file system sends them (defaults as alphabetical order).</p>
<h3>Sanitizing Files</h3>
<p>Now that we are concatenating our JS files, we can take it further and do some sanitizing with JSLint. Adding this to our current project is fairly simple. Start by <a href="http://www.javascriptlint.com/download.htm">downloading</a> the most recent version of JSLint for your operating system. Make sure to uncompress the file and remember where you put the uncompressed file.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;project name=&quot;MyWebapp&quot; default=&quot;default&quot; basedir=&quot;.&quot;&gt;
&lt;target name=&quot;default&quot;&gt;

 &lt;property name=&quot;jslint&quot; value=&quot;./path/to/jslint/jsl-0.3.0-mac/jsl&quot; /&gt;
 &lt;echo msg=&quot;Checking JS for errors...&quot; /&gt;
 &lt;jsllint haltonfailure=&quot;true&quot; cachefile=&quot;./jslint.cache&quot; executable=&quot;${jslint}&quot; conffile=&quot;./path/to/jslint/jsl.default.conf&quot;&gt;
  &lt;fileset dir=&quot;./js&quot;&gt;
   &lt;include name=&quot;**/*.js&quot;/&gt;
  &lt;/fileset&gt;
 &lt;/jsllint&gt;

 &lt;foreach param=&quot;dirname&quot; absparam=&quot;absname&quot; target=&quot;compile-folder-js&quot;&gt;
  &lt;fileset dir=&quot;./js&quot;&gt;
   &lt;type type=&quot;dir&quot; /&gt;
   &lt;depth max=&quot;0&quot; min=&quot;0&quot; /&gt;
  &lt;/fileset&gt;
 &lt;/foreach&gt;
&lt;/target&gt;
&lt;target name=&quot;compile-folder-js&quot;&gt;
  &lt;mkdir dir=&quot;./${dirname}-js&quot; /&gt;
  &lt;fileset id=&quot;filestocompile&quot; dir=&quot;js/${dirname}&quot;&gt;
   &lt;include name=&quot;**/*.js&quot; /&gt;
  &lt;/fileset&gt;
  &lt;append destFile=&quot;./${dirname}-js/${dirname}.js&quot;&gt;
   &lt;fileset refid=&quot;filestocompile&quot; /&gt;
  &lt;/append&gt;
&lt;/target&gt;
</pre>
<p>We&#8217;ve added a JSLint check that runs through all of the JavaScript files and send them through the JSLint downloaded binary for checking.  The process will now stop if you right improper JavaScript, immediately letting you know if you have issues with your code.</p>
<h3>Compressing Files</h3>
<p>Sometimes, checking your JavaScript for errors, and moving into a single folder is just not enough. You still may want to compress them down, obfuscate them, so that they are at the absolute smallest size possible. For this, a good option is Google Closure Compiler. You can <a href="https://github.com/mathewbyrne/closure-task">get a good task</a> to help with this so that it&#8217;s a drop in solution. Just drop this new task definition into your phing path and you are set. Now our code can implement this piece to get a better JavaScript file.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;project name=&quot;MyWebapp&quot; default=&quot;default&quot; basedir=&quot;.&quot;&gt;
 &lt;taskdef name=&quot;googleclosurecompiler&quot; classname=&quot;phing.customtasks.GoogleClosureCompiler&quot; /&gt;

&lt;target name=&quot;default&quot;&gt;
 &lt;property name=&quot;jslint&quot; value=&quot;./path/to/jslint/jsl-0.3.0-mac/jsl&quot; /&gt;
 &lt;echo msg=&quot;Checking JS for errors...&quot; /&gt;
 &lt;jsllint haltonfailure=&quot;true&quot; cachefile=&quot;./jslint.cache&quot; executable=&quot;${jslint}&quot; conffile=&quot;./path/to/jslint/jsl.default.conf&quot;&gt;
  &lt;fileset dir=&quot;./js&quot;&gt;
   &lt;include name=&quot;**/*.js&quot;/&gt;
  &lt;/fileset&gt;
 &lt;/jsllint&gt;

 &lt;foreach param=&quot;dirname&quot; absparam=&quot;absname&quot; target=&quot;compile-folder-js&quot;&gt;
  &lt;fileset dir=&quot;./js&quot;&gt;
   &lt;type type=&quot;dir&quot; /&gt;
   &lt;depth max=&quot;0&quot; min=&quot;0&quot; /&gt;
  &lt;/fileset&gt;
 &lt;/foreach&gt;
&lt;/target&gt;
&lt;target name=&quot;compile-folder-js&quot;&gt;
  &lt;mkdir dir=&quot;./${dirname}-js&quot; /&gt;
  &lt;fileset id=&quot;filestocompile&quot; dir=&quot;js/${dirname}&quot;&gt;
   &lt;include name=&quot;**/*.js&quot; /&gt;
  &lt;/fileset&gt;
  &lt;append destFile=&quot;./${dirname}-js/${dirname}.js&quot;&gt;
   &lt;fileset refid=&quot;filestocompile&quot; /&gt;
  &lt;/append&gt;

 &lt;googleclosurecompiler compilationLevel=&quot;SIMPLE_OPTIMIZATIONS&quot; targetDir=&quot;./${dirname}-js/&quot; failOnError=&quot;true&quot; outputFile=&quot;${dirname}-compressed.js&quot; merge=&quot;true&quot;&gt;
  &lt;fileset dir=&quot;./${dirname}-js/}&quot;&gt;
   &lt;include name=&quot;${dirname}.js&quot; /&gt;
  &lt;/fileset&gt;
 &lt;/googleclosurecompiler&gt;
&lt;/target&gt;
</pre>
<h3>Conclusion</h3>
<p>We&#8217;ve been able to now create a worthwhile setup that allows a webapp to move,verify and compress all of its JavaScript files whenever the command &#8216;phing&#8217; is ran on the path. This is a very simple setup, but one that can really be expanded on. For instance, you can use dates or hashes appended to files so that caching is easier. You can setup a multi-directory structure for better handling of JS versions. You can even pre-gzip your code so that it is much faster for downloads and lighter weight on the server-side load.</p>
<p>Hopefully this will get you into the process of using Phing and developing a solid build process in your web coding.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.geedew.com/2011/04/13/developing-a-robust-build-process-using-phing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>An SEO friendly way to remove index.php : Codeigniter 2</title>
		<link>http://www.geedew.com/2011/04/05/remove-index-php-codeigniter/</link>
		<comments>http://www.geedew.com/2011/04/05/remove-index-php-codeigniter/#comments</comments>
		<pubDate>Wed, 06 Apr 2011 02:22:27 +0000</pubDate>
		<dc:creator>drew</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[How-To]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[index.php]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[seo]]></category>

		<guid isPermaLink="false">http://www.geedew.com/?p=290</guid>
		<description><![CDATA[If you follow the way codeigniter recommends you change and remove your index.php, you may actually cause more harm to your site than you realize]]></description>
			<content:encoded><![CDATA[<p> Something that has been around as long as Codeigniter, is the ability to modify its URLs and what they show up as in the &#8216;address bar&#8217;. However, sometimes, &#8216;pretty-urls&#8217; are not the highest thing on your list, or you weren&#8217;t aware of them when you first started your website. If you follow the way codeigniter <a href="http://codeigniter.com/user_guide/general/urls.html">recommends</a> you change and remove your index.php, you may actually cause more harm to your site than you realize. Code after the break.</p>
<h3>Update &#8211; 4/6</h3>
<p>Another nice approach is found in the comments, take a look!<br />
<span id="more-290"></span><br />
 It starts with how search engines manage what URLs your site is using. Search engines need to keep a good idea if you are trying to manipulate your results on the search by including &#8216;junk&#8217; content.  A familiar approach is to have two URLs point to the same content.  This way, you are using the same content multiple times and would expect to have a better result on the search engines (because you have so much content on the subject!). Search engines have caught on to this (<a href="http://www.google.com/support/webmasters/bin/answer.py?answer=66359">Google suggestions</a>), and they keep a signature of all the content for your pages with the URLs; if they detect the same or very similar content across different URLs they instinctively rule that content out of the equation (<a href="http://www.seobythesea.com/?p=212">SEO by the sea</a>).<br />
 Codeigniter is actually suggesting you make two URLs for the same content with their recommended solution by adding the following code into a .htaccess file at the root of your codeigniter installation.</p>
<pre class="brush: xml; title: ; notranslate">
RewriteEngine on
RewriteCond $1 !^(index.php|images|robots.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
</pre>
<p> Line by line, this is stating to &#8216;rewrite&#8217; everything that isn&#8217;t beginning with index.php in the URL so that it does not contain index.php on the server-side logic (hidden from the user).  However, if the user were to use the URL with index.php still in it, guess what; it will still work.  You now have two URLs pointing to the same content!<br />
 The SEO friendly way to do this would require a little bit of &#8216;tom foolery&#8217; with the code. Here is my .htaccess file that I use for my codeigniter sites.</p>
<pre class="brush: xml; title: ; notranslate">
Options +FollowSymLinks
DirectoryIndex index.php

&lt;IfModule mod_rewrite.c&gt;
    RewriteEngine On
    RewriteBase /

    RewriteRule ^index.php?(.*)$ $1 [L,R=301]

    RewriteCond $1 !^(home.php|css|js|images|robots.txt)
    RewriteRule ^(.*)$ /home.php/$1 [L]

&lt;IfModule !mod_rewrite.c&gt;
    # If we don't have mod_rewrite installed, all 404's
    # can be sent to index.php, and everything works as normal.
    # Submitted by: ElliotHaughin

    ErrorDocument 404 /index.php
&lt;/IfModule&gt;
</pre>
<p> First thing you will notice is that I have very similar code involved in my .htaccess that you find in the codeigniter code. </p>
<pre class="brush: xml; title: ; notranslate">
	RewriteCond $1 !^(home.php|css|js|images|robots.txt)
	RewriteRule ^(.*)$ /home.php/$1 [L]
</pre>
<p> I have changed out the index.php with home.php (which doesn&#8217;t exist yet) and I&#8217;m also allowing some CSS and JS folders through the &#8216;rewrite&#8217;. Above this code I&#8217;m adding the SEO friendly 301 redirect hook.</p>
<pre class="brush: xml; title: ; notranslate">
    RewriteRule ^index.php?(.*)$ $1 [L,R=301]
</pre>
<p> I am purposely rewriting any URL that begins with index.php to no longer begin with index.php. I also pass [R=301] which tells a browser or search engine that the old URL no longer exists and they need to use the new one from now on.<br />
 Back to the home.php; you need to create a new file called home.php and place it in the same place as index.php. The only thing that needs to be inside home.php is the following code.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php /*this file is for SEO purposes */
require('index.php');
</pre>
<p> Now, anything going to home.php will be routed to index.php internally so nothing in codeigniter needs to change.</p>
<h3>Conclusion</h3>
<p>This hasn&#8217;t solved the multiple URLs completely, as now anything pointing to home.php will be a second URL to the same content. However, you should&#8217;t have anything pointing to this URL and you can make sure that search engines cannot use this URL by adding a clause to your robots.txt.  Anybody using the older index.php URL will get a 301 redirect that lets the software they use know not to use it anymore.</p>
<p> There are probably also options to handle not needing another file (home.php) in the .htaccess file but I was unable to get the same results that I am getting with this method. Feel free to correct or update, or tell me why I&#8217;m wrong!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.geedew.com/2011/04/05/remove-index-php-codeigniter/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Box-Shadow will crash us all</title>
		<link>http://www.geedew.com/2011/04/03/box-shadow-will-crash-us-all/</link>
		<comments>http://www.geedew.com/2011/04/03/box-shadow-will-crash-us-all/#comments</comments>
		<pubDate>Sun, 03 Apr 2011 12:12:33 +0000</pubDate>
		<dc:creator>drew</dc:creator>
				<category><![CDATA[css3]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[html5]]></category>

		<guid isPermaLink="false">http://www.geedew.com/?p=276</guid>
		<description><![CDATA[Box-Shadow isn't always smart.]]></description>
			<content:encoded><![CDATA[<p>In CSS3, some of the newest features can bite you.  Recently, I discovered a serious issue with box-shadow and rendering. Box-shadow is a new feature that creates a shadow effect either outset (around a box) or inset (inside a box, like a glow). What I wanted to do, was create a soft glow on the inside of a website, using &lt;body>, so that the entire site had an easy fade.  The code that I <del datetime="2011-04-03T12:13:45+00:00">used was</del> currently use is:</p>
<pre class="brush: css; title: ; notranslate">
body {
-moz-box-shadow: inset 0 0 8px rgba(0,0,0, 0.25);
-webkit-box-shadow: inset 0 0 8px rgba(0,0,0, 0.25);
}
</pre>
<p>This code actually <del datetime="2011-04-03T12:13:45+00:00">worked</del>works, and I didn&#8217;t notice any issues.  However, the 8px fade was too abrupt; I kicked it up &#8216;just a tad&#8217; to 200px (I have large &#8216;tads&#8217;).  Big mistake as all &#8216;advanced&#8217; browsers were crumbling in my wake.  If they support box-shadow, they failed. The page loaded, but scrolling was a complete and utter failure.</p>
<p>For now, I will have to avoid doing this, especially to the large &lt;body> tag.  I will chime back in on the topic once I get some solid evidence and facts about it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.geedew.com/2011/04/03/box-shadow-will-crash-us-all/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The new Digg, V4: Quick Review</title>
		<link>http://www.geedew.com/2010/07/20/the-new-digg-v4-quick-review/</link>
		<comments>http://www.geedew.com/2010/07/20/the-new-digg-v4-quick-review/#comments</comments>
		<pubDate>Wed, 21 Jul 2010 03:21:12 +0000</pubDate>
		<dc:creator>drew</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[general]]></category>
		<category><![CDATA[Misc]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[digg]]></category>
		<category><![CDATA[news]]></category>
		<category><![CDATA[review]]></category>
		<category><![CDATA[website]]></category>

		<guid isPermaLink="false">http://www.geedew.com/?p=237</guid>
		<description><![CDATA[I&#8217;m a reader of Digg.com. What can I say? I like to hear the quirky stories sometimes and when I come across something intelligent, it makes me feel more like I&#8217;m learning. So when the new Digg was dropped into (&#8230;)</p><p><a href="http://www.geedew.com/2010/07/20/the-new-digg-v4-quick-review/">Read the rest of this entry &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m a reader of Digg.com.  What can I say? I like to hear the quirky stories sometimes and when I come across something intelligent, it makes me feel more like I&#8217;m learning.  So when the new Digg was dropped into Beta testing, you bet that I was all over that.  See some screen-shots after the jump.</p>
<p><span id="more-237"></span></p>
<p><b>Logging In</b></p>
<hr />
<p>
The new Digg can be viewed by going to <a href="http://new.digg.com">http://new.digg.com</a> which drops you into a pretty nice looking log in screen.</p>

<a href='http://www.geedew.com/2010/07/20/the-new-digg-v4-quick-review/login/' title='Login Compared to the Old Digg'><img width="150" height="56" src="http://www.geedew.com/wp-content/uploads/2010/07/Login.png" class="attachment-thumbnail" alt="New login on the left, Old Digg on the right." title="Login Compared to the Old Digg" /></a>
<a href='http://www.geedew.com/2010/07/20/the-new-digg-v4-quick-review/connections/' title='Connections'><img width="150" height="94" src="http://www.geedew.com/wp-content/uploads/2010/07/Connections.png" class="attachment-thumbnail" alt="This shows the Digg setup page for connections" title="Connections" /></a>
<a href='http://www.geedew.com/2010/07/20/the-new-digg-v4-quick-review/loadmorebug/' title='LoadMoreBug'><img width="150" height="94" src="http://www.geedew.com/wp-content/uploads/2010/07/LoadMoreBug.png" class="attachment-thumbnail" alt="Bug that shows up when loading too many" title="LoadMoreBug" /></a>
<a href='http://www.geedew.com/2010/07/20/the-new-digg-v4-quick-review/digg4home/' title='Digg4Home'><img width="150" height="56" src="http://www.geedew.com/wp-content/uploads/2010/07/Digg4Home.png" class="attachment-thumbnail" alt="Current versus New Digg" title="Digg4Home" /></a>

<p><b>Connecting</b></p>
<hr />
<p>
The first time you log in, it has a really easy to follow setup that asks some basic questions for you to connect to other social sites.  I connected them all; Twitter,Google and Facebook. </p>
<p>Apparently not a single friend of mine is currently using Digg V4, no surprise there!</p>
<p><b>Usage</b></p>
<hr />
<p>
Digg is setting itself up in a very good way.  They are re-inventing themselves with this idea.  Before, you could only get Diggs via categories like Top Ten, Technology, etc. or you could find users and view the Diggs that they Dugg.  But now, it is being setup so that you control your Digg feed, according to those users that you Digg.  In which you can then Digg items up.  So from now on Digg will be able to suggest to you, only the items that you really would like to see (mrbabyman all the way!).</p>
<p><b>Bugs</b></p>
<hr />
<p>
I did however encounter a bug, to which I filed a report.  If you try to load more items than there are currently in the system, you get an error stating that there are no more items, but the loading never quits and still shows up as a click-able link.  So there are still some kinks to work out, but I for one think this is a great way to stay ahead of the rest!</p>
<p><b>&#8211; Update &#8211;</b></p>
<p>Another bug was discovered. When clicking to add a link to your account (like adding my website to mine), if you press <enter> after typing in your web address, the form does not submit.  Instead the page refreshes and you lose your previous entry you typed in.  The only way to submit the form it to actually click the button.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.geedew.com/2010/07/20/the-new-digg-v4-quick-review/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Advanced button theming on jQuery UI Dialog</title>
		<link>http://www.geedew.com/2010/06/10/advanced-button-theming-on-jquery-ui-dialog/</link>
		<comments>http://www.geedew.com/2010/06/10/advanced-button-theming-on-jquery-ui-dialog/#comments</comments>
		<pubDate>Thu, 10 Jun 2010 15:23:23 +0000</pubDate>
		<dc:creator>drew</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[How-To]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://www.geedew.com/?p=200</guid>
		<description><![CDATA[There is a very annoying bugfeature that I have found when using jQueryUI. It&#8217;s not the themes, they work great, in fact, they are the best thing since sliced bread. But in a &#8216;Cupertino.esc&#8217; way, they provide too much simplicity (&#8230;)</p><p><a href="http://www.geedew.com/2010/06/10/advanced-button-theming-on-jquery-ui-dialog/">Read the rest of this entry &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>	There is a very annoying <del datetime="2010-06-10T14:54:13+00:00">bug</del>feature that I have found when using jQueryUI.  It&#8217;s not the themes, they work great, in fact, they are the best thing since sliced bread.  But in a &#8216;Cupertino.esc&#8217;  way, they provide too much simplicity over the functionality that I require.  This post aims to solve that in a <em>progressive enhancement</em> sorta way.  I am using jQuery 1.4.2. with jQuery UI 1.8.2, it doesn&#8217;t matter what theme  you use with this, but I prefer <em>redmond</em>.</p>
<p><span id="more-200"></span>
<p>
	Let&#8217;s take a look at the core issue.  Here is what a typical dialog looks like in jQueryUI 1.8.2 with some nice buttons.</p>
<div id="attachment_203" class="wp-caption aligncenter" style="width: 310px"><a rel="attachment wp-att-203" href="http://www.geedew.com/2010/06/10/advanced-button-theming-on-jquery-ui-dialog/screen-capture-1/"><img class="size-medium wp-image-203" title="Typical 'Redmond' jQueryUI Dialog" src="http://www.geedew.com/wordpress/wp-content/uploads/2010/06/screen-capture-1-300x191.png" alt="Typical 'Redmond' jQueryUI Dialog" width="300" height="191" /></a><p class="wp-caption-text">Perfect example of a jQueryUI Dialog</p></div>
<p>
	Here&#8217;s the simple code for this.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;article id=&quot;dialogs&quot;&gt;
	&lt;a href=&quot;javascript: void(null);&quot; id=&quot;dialogbutton&quot;&gt;Open Dialog&lt;/a&gt;
	&lt;div title=&quot;this is my test this is my test this is my test this is my test&quot; id=&quot;dialogtest&quot;&gt;
	This is a div dialog test. This is a div dialog test. This is a div dialog test. This is a div dialog test. This is a div dialog test.
	&lt;/div&gt;
&lt;/article&gt;
</pre>
<pre class="brush: jscript; title: ; notranslate">
&lt;script type=&quot;text/javascript&quot;&gt;
	$(document).ready(function() {
		/* Create a dialog */
		$(&quot;#dialogtest&quot;).dialog({
                        title: &quot;Alert!&quot;,
			modal: true,
			buttons: {
				&quot;Ok&quot;: function() {
					$(this).dialog(&quot;close&quot;);
				},
				&quot;Cancel&quot;: function() {
					$(this).dialog(&quot;close&quot;);
				}
			}
		});

		/* Add Dialog Button Functionality */
		$('#dialogbutton').click(function(){
			$('#dialogtest').dialog('open');
			return false;
		});
	});

&lt;/script&gt;
</pre>
<p>	That&#8217;s really great, I mean that code is so small and yet you can get such a great looking item out of it.  So how can I have a problem with that? Well let me tell you how the buttons are made, you have a name and then you have that name point to a function.  The name is the text of the button, the function is the action of the button.  And that&#8217;s it. Period.</p>
<p>
	Now, I find it great that I can use these simplistic featuresets and get &#8216;get by&#8217; but normally my &#8220;Cancel don&#8217;t ever touch me button&#8221; is the color red(ish) while my &#8220;Oh you need to hit me to move on&#8221; button is the color green(ish).  But you cannot do that (easily) with this current setup.  In fact it&#8217;s very sloppy to force this setup into doing that and it ends up using a great amount of code just to do one thing, add a class.</p>
<p>
	To solve this, I did what any self respecting JavaScript ninja would do, <del datetime="2010-06-10T14:23:34+00:00">I said goodbye to jQuery UI</del> I opened up the source code and took a peek, found out where I could attack (fix) the code and I did it.<br />
        So before I show you the code, I will show you how I decided buttons should/could be made.  My process is 100% backward compatible, yet more difficult and easier to mess up (the original goal of jQueryUI was obviously to make it as simple as possible).</p>
<p>	Buttons with my code changes can now be made like this</p>
<pre class="brush: jscript; title: ; notranslate">
buttons: {
	&quot;Ok&quot;:  function() {
		$(this).dialog(&quot;close&quot;);
	},
	&quot;Cancel&quot;: {
		action : function() {
			$(this).dialog(&quot;close&quot;);
		},
		type : &quot;cancel&quot;
	}
</pre>
<pre class="brush: css; title: ; notranslate">
/* This is poor CSS by design to be simple and readable */
 div.ui-dialog-buttonpane button.cancel { background:none; border:0px none;color:red; }
</pre>
<p>	and the old way of doing it will still work just fine as well.</p>
<p>	I&#8217;ve gone ahead and added a few features, namely it is now name-points-to-object instead of the old name-points-to-function mentality.  This object has two attributes: action and type.  Action is the old function() that was pointed to and it will be called when this button is clicked. Type is the new feature on the block, it&#8217;s just a CSS class that is added to the function using jQuery.addClass.  I&#8217;ve tried to keep is simple, and at the same time, make it robust and backward compatible.  Here&#8217;s a simple change that is possible using this feature.</p>
<p><a rel="attachment wp-att-210" href="http://www.geedew.com/2010/06/10/advanced-button-theming-on-jquery-ui-dialog/screen-capture-2/"><img class="aligncenter size-medium wp-image-210" title="What jQuery UI dialog buttons should be able to do" src="http://www.geedew.com/wordpress/wp-content/uploads/2010/06/screen-capture-2-300x203.png" alt="A jQuery UI with different colored buttons" width="300" height="203" /></a>
<p>
	Now my dialogs can look like this when I want them to.  This is a big usability thing (make the buttons descriptive, not just in text but in color/design and function).</p>
<p>	So the secret sauce to all of this is actually an extension of the jQueryUI 1.8.2 Dialog code (more like rewrite of some of the code).  This code can only be ran AFTER jQueryUI 1.8.2 has been created, otherwise you will get an error.  I placed this code into the jQueryUI 1.8.2 custom.js file itself for easy keeping; just drop it at the bottom of the file.</p>
<pre class="brush: jscript; title: ; notranslate">
/* TorchUI dialog button fix */
(function($) {
	var _createButtons = $.ui.dialog.prototype._createButtons;
	$.ui.dialog.prototype._createButtons = function(buttons) {
		var self = this,
		hasButtons = false,
		uiDialogButtonPane = $('&lt;div&gt;&lt;/div&gt;')
			.addClass(
				'ui-dialog-buttonpane ' +
				'ui-widget-content ' +
				'ui-helper-clearfix'
			);
		// if we already have a button pane, remove it
		self.uiDialog.find('.ui-dialog-buttonpane').remove();

		if (typeof buttons === 'object' &amp;&amp; buttons !== null) {
			$.each(buttons, function() {
				return !(hasButtons = true);
			});
		}
		if (hasButtons) {
			$.each(buttons, function(name, fn) {
                        /* Begin the code change here */
			// Check to see if fn is being passed in as a funciton, assume it's an object if not.
			 	if(!$.isFunction(fn)) {
			 		var buttonclass=fn.type;var func=fn.action; }
			 	else {
			 		var func=fn; var buttonclass=&quot;&quot;; }
				var button = $('&lt;button type=&quot;button&quot;&gt;&lt;/button&gt;')
					.text(name)
				/* Add a class to the button, if there is a class */
					.addClass(buttonclass)
					.click(function() { func.apply(self.element[0], arguments); })
					.appendTo(uiDialogButtonPane);
				if ($.fn.button) {
					button.button();
				}
			});
			uiDialogButtonPane.appendTo(self.uiDialog);
		}
	}
})(jQuery);
</pre>
<p>	If you have questions, please respond, I promise not to take them personally <img src='http://www.geedew.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.geedew.com/2010/06/10/advanced-button-theming-on-jquery-ui-dialog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery UI Dialog Accessibility</title>
		<link>http://www.geedew.com/2010/02/25/jquery-ui-dialog-accessibility/</link>
		<comments>http://www.geedew.com/2010/02/25/jquery-ui-dialog-accessibility/#comments</comments>
		<pubDate>Fri, 26 Feb 2010 02:52:17 +0000</pubDate>
		<dc:creator>drew</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[508]]></category>
		<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[BugFix]]></category>
		<category><![CDATA[Defects]]></category>
		<category><![CDATA[jQuery UI]]></category>

		<guid isPermaLink="false">http://www.geedew.com/?p=185</guid>
		<description><![CDATA[jQuery UI is an amazing product. It&#8217;s not because it offers the best features, or that it offers the best solution, it&#8217;s that it offers a large degree of support for years to come. Which is saying a lot for (&#8230;)</p><p><a href="http://www.geedew.com/2010/02/25/jquery-ui-dialog-accessibility/">Read the rest of this entry &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>    jQuery UI is an amazing product.  It&#8217;s not because it offers the best features, or that it offers the best solution, it&#8217;s that it offers a large degree of support for years to come.  Which is saying a lot for something that is nothing more than JavaScript.  It&#8217;s certainly something that many enterprises have begun to look at and look for in the development world.  At my job at Coventry Healthcare, I&#8217;m responsible for the User Interfaces and generally the User Experience across some very highly visible web applications.  One of the most recent developments in our line of business is the risk of not having an accessible site (we fall under Section 508 guidelines because of our Medicare/Medicaid users).  jQuery UI has literally allowed me to very easily create and maintain large amounts of code so that I can spend more time making sure that it follows WCAG 2.0 and WARIA (which should cover us for S508).<span id="more-185"></span>
</p>
<p class="entry-text">So recently I discovered a very nasty bug dealing with jQuery UI dialog (withe modal:true) widgets that seems to only occur in Internet Explorer.  It goes like this:  If you are using a dialog with a screen reader, your main mode of navigation is with the keyboard.  This is typically driven via the focus on elements.  In jQuery, focus is demanded on the dialog because of the modal command.  You are unable to focus on anything other than the dialog and it&#8217;s elements.  Here&#8217;s the issue however, jQuery successfully  can keep focus on the dialog in all browsers tested (FF, Safari, Chrome) so that the focus cannot leave the dialog.  However in Internet Explorer (6, 7 and 8 ) your focus can get to the address bar, simply by tabbing to it.  Once in the address bar, jQuery is no longer able to track and handle the focus, so inevitable, after tabbing through the menu, focus come back to the window.  But instead of going to the dialog, it goes to the first element that can be tabbed to, which is undoubtedly BEHIND the modal dialog.  jQuery, subsequently locks the tabbing at this point, most likely because you have focus on and element that is unable to be focused (in jQuery&#8217;s dialog algorithm).
</p>
<p class="entry-text">So I cannot have this as that would literally cut 75% of my users from being able to use just a keyboard with the sites I&#8217;m maintaining.  So I had to find a solution.  First, IE seems to be the only browser with this issue and it has something to do with the fact that the focus moves out of the DOM&#8217;s control (out of jQuery&#8217;s control).  But the focus would always at least get back to the first element that could be tabbed to, and then lock.  So I devised a plan.  What if the first element, when focused, looks for an open dialog and if it is there, focuses on that dialog?  So I tried it out, like this.
</p>
<pre class="brush: jscript; title: ; notranslate">
$(document).ready(function() {
    $(&quot;:tabbable:first&quot;).focus(function() {
           $(&quot;.ui-dialog:visible:last :tabbable:first&quot;).focus();
    })
});
</pre>
<p class="entry-text">
Amazingly enough, this is the exact solution to the issue. This is how it reads.</p>
<ol>
<li>On page load</li>
<li>Get the first element that can be tabbed to in the body</li>
<li>When this element gains focus, check for a visible dialog</li>
<li>Take the visible dialog that is last (the last one drawn in the html) and get the first element that can be tabbed in it</li>
<li>give focus to that first element.</li>
</ol>
<p class="entry-text">
Now, in IE, when focus returns to the document, it goes to the dialog box, specifically, the close icon on the dialog box, thereby not breaking the fact that there a modal open on the page.
</p>
<p class="entry-text">
Now, there are some issues with this.  For one, the code is just assuming that the last dialog in the html that is visible is the one that is to be focused on.  Quite frankly, that&#8217;s what I need it for, as I try not to overlay dialogs, and when it do, the newest one is normally always on top.  However, there are times where you may swap between two dialogs, and the one that is on top is not the last dialog in the html, you would still have this issue in this case.  But for probably the other 95% of the cases, this is a clean and easy way to &#8216;fix&#8217; the accessibility issue in IE with jQuery UI dialog modals.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.geedew.com/2010/02/25/jquery-ui-dialog-accessibility/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Droid Rooted, here&#8217;s my take.</title>
		<link>http://www.geedew.com/2009/12/08/droid-rooted-heres-my-take/</link>
		<comments>http://www.geedew.com/2009/12/08/droid-rooted-heres-my-take/#comments</comments>
		<pubDate>Wed, 09 Dec 2009 05:42:30 +0000</pubDate>
		<dc:creator>drew</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[How-To]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[droid]]></category>
		<category><![CDATA[root]]></category>
		<category><![CDATA[update]]></category>
		<category><![CDATA[verizon]]></category>

		<guid isPermaLink="false">http://www.geedew.com/?p=144</guid>
		<description><![CDATA[Before you root, you should probably upgrade to 2.01, as that will &#8216;break&#8217; your new root access. You can get that download from here, if you have not already received it OTA (Over the Air). You need to follow the (&#8230;)</p><p><a href="http://www.geedew.com/2009/12/08/droid-rooted-heres-my-take/">Read the rest of this entry &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>Before you root, you should probably upgrade to 2.01, as that will &#8216;break&#8217; your new root access. You can get that download from <a href="https://android.clients.google.com/updates/voles/signed-voles-ESD56-from-ESD20.84263456.zip">here</a>, if you have not already received it OTA (Over the Air). You need to follow the directions below, to apply the 2.01.  The directions for each download it exactly the same, except for the ADB access.</p>
<p>This &#8216;root&#8217; is strictly for developers.  It&#8217;s not going to give you any ability to do anything to your phone yet, unless you really know your *nix commands well enough not to screw something up on your phone.  So continue only if you really want this ability (the ability to really screw up your phone).<br />
<span id="more-144"></span><br />
You can follow the direct postings <a href="http://alldroid.org/viewtopic.php?f=210&#038;t=567">here.</a><br />
I&#8217;ve downloaded the file (best link is <a href="http://alldroid.org/download/file.php?id=643">here</a>).  You should also download this file, as it will be needed.</p>
<blockquote><p>md5sum of the boot partition:<br />
3e49d99b320cf5c20bedf09343c1155c /dev/mtd/mtd2
</p></blockquote>
<p>Here is the `how-to` that <a href="http://alldroid.org/memberlist.php?mode=viewprofile&#038;u=1941">embeem</a> posted, I will add to it where I see fit, just to help some of those out as to what is going on.</p>
<blockquote><p>Download the zip file</p></blockquote>
<p>You can find the link at the top of this post.</p>
<blockquote><p>
Rename to &#8220;update.zip&#8221; and copy to the sdcard</p></blockquote>
<p>It is currently named `droid-root.zip`, `update.zip` is required as that will be used internally by the script in the program.</p>
<blockquote><p>Power off the DROID and power back on while holding the X key<br />
When you see a &#8220;/!&#8221; symbol, press both vol+ and camera</p></blockquote>
<p>This isn&#8217;t magic, it&#8217;s simply a rescue mode. Slide the keyboard out to start. It&#8217;s very easy to figure out what is going on here.  You have to press and hold the volume Up key then press the camera button. </p>
<blockquote><p>Use the onscreen menu to install update.zip</p></blockquote>
<p>You must use your d-pad to do this.  just choose update.zip from the menu.</p>
<blockquote><p>Once installed you will be able to run &#8220;su&#8221; from your adb shell.</p></blockquote>
<p>This one is the kicker, best explained by <a href="http://alldroid.org/memberlist.php?mode=viewprofile&#038;u=2264">syntrix</a></p>
<blockquote><p>you have to attach your droid in debug mode in eclipse and use adb from the sdk. Again, I&#8217;m holding off on this, it&#8217;s my only phone.</p>
<p>But once you get this access, you can run commands natively, and copy files to the sd and pull them off the droid.</p></blockquote>
<p>ADB is only ran from the SDK developers tools.  In other words, you are running command from your computer, not the phone.</p>
<p>Now, to take this a step further, we can also get a terminal emulator running on the phone with root access according to <a href="http://alldroid.org/memberlist.php?mode=viewprofile&#038;u=2309">mjxg&#8217;s</a> post&#8230;</p>
<blockquote><p>
1) download this: http://www.magicandroidapps.com/su.zip<br />
2) push it to your phone</p>
<p>C:Android>adb push su /data/local<br />
595 KB/s (76200 bytes in 0.125s)</p>
<p>3) C:Android>adb shell<br />
$ su<br />
# mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system<br />
# cd /system/bin<br />
# mv su osu<br />
# cat /data/local/su > su<br />
# chmod 6755 su</p>
<p>4) verify</p>
<p># ls -l *su<br />
-rwsr-sr-x root root 76200 2008-08-01 05:00 osu<br />
-rwsr-sr-x root root 76200 2009-05-30 11:28 su</p>
<p>5) finish</p>
<p># sync<br />
# reboot</p>
<p>6) open up a terminal emulator on the phone and run `su` and enjoy</p></blockquote>
<p>With all this said, this is a remarkable, easy root access. It literally is just adding a file  (&#8216;su&#8217;) that the user has permissions to.  &#8216;SU&#8217; means, switch user, and by default, that user is root.  Giving the user access to this file, means they can run that command, and if that file has the right permissions, which is does in the update, it will run &#8216;as&#8217; root.  And tada, you can now begin to get access to the rest of the system!</p>
<p>Developers will now take over.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.geedew.com/2009/12/08/droid-rooted-heres-my-take/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bulletproof @font-face</title>
		<link>http://www.geedew.com/2009/12/07/bulletproof-font-face/</link>
		<comments>http://www.geedew.com/2009/12/07/bulletproof-font-face/#comments</comments>
		<pubDate>Tue, 08 Dec 2009 04:12:55 +0000</pubDate>
		<dc:creator>drew</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Bulletproof]]></category>
		<category><![CDATA[Font-Face]]></category>
		<category><![CDATA[Zeldman]]></category>

		<guid isPermaLink="false">http://www.geedew.com/?p=139</guid>
		<description><![CDATA[There is quite an interesting discussion going on at Jeffrey Zeldman&#8217;s blog concerning the @font-face syntax and how to make sure that it is working in all browsers. It&#8217;s interesting to see the different &#8216;hacks&#8217; that are being put together (&#8230;)</p><p><a href="http://www.geedew.com/2009/12/07/bulletproof-font-face/">Read the rest of this entry &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>There is quite an interesting discussion going on at <a href="http://www.zeldman.com/2009/12/02/bulletproof-font-face/">Jeffrey Zeldman&#8217;s blog</a> concerning the @font-face syntax and how to make sure that it is working in all browsers.  It&#8217;s interesting to see the different &#8216;hacks&#8217; that are being put together for something that should be hashed out to work well in all major browsers.  Why does this remind me of things like the wonky implementations being played out in html5?!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.geedew.com/2009/12/07/bulletproof-font-face/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Usability and a Simple JavaScript hovering menu</title>
		<link>http://www.geedew.com/2009/12/05/usability-and-a-simple-javascript-hovering-menu/</link>
		<comments>http://www.geedew.com/2009/12/05/usability-and-a-simple-javascript-hovering-menu/#comments</comments>
		<pubDate>Sun, 06 Dec 2009 02:20:11 +0000</pubDate>
		<dc:creator>drew</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[Misc]]></category>

		<guid isPermaLink="false">http://geedew.com/blog/?p=53</guid>
		<description><![CDATA[Many web developers ask &#8216;what is usability?&#8217;.  This is one of those topics that I can explain, but it may be easier to demonstrate. My this experiences have led to some principles; one of them is that if I&#8217;m going (&#8230;)</p><p><a href="http://www.geedew.com/2009/12/05/usability-and-a-simple-javascript-hovering-menu/">Read the rest of this entry &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>Many web developers ask &#8216;what is usability?&#8217;.  This is one of those topics that I can explain, but it may be easier to demonstrate. My this experiences have led to some principles; one of them is that if I&#8217;m going to build it, it must be usable.   Unfortunately, many sites that I like, that tout usability, screw up one important concept that annoys me greatly.</p>
<p>I ask myself, &#8220;when using a menu, why do I have to drag my mouse from one button to the next, and fear losing the menu if I cross it&#8217;s border anywhere?&#8221;  Some menus are just annoying because they disappear mid mouse move, some are extremely hard to use because of several layers of menus, some I have resorted to using `tabs` to get to the correct menu item.  It&#8217;s unfortunate that people can&#8217;t get this right.<br />
<span id="more-53"></span><br />
I have a simple fix that hopefully sharing it will help others.  It&#8217;s basically a menu that buffers the time you are hovering, that way if you mistakenly move your mouse into the wrong area, you have a brief period of time to correct yourself.</p>
<h2>Start with the HTML code:</h2>
<pre class="brush: xml; title: ; notranslate">
&lt;ul id=&quot;menu&quot;&gt;
	&lt;li class=&quot;nav&quot;&gt;&lt;a&gt;&lt;span&gt;ONE&lt;/span&gt;&lt;/a&gt;
	&lt;ul&gt;
		&lt;li&gt;&lt;a&gt;&lt;span&gt;one&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a&gt;&lt;span&gt;two&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a&gt;&lt;span&gt;three&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a&gt;&lt;span&gt;four&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;&lt;a&gt;&lt;span&gt;TWO&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
	&lt;li class=&quot;nav&quot;&gt;&lt;a&gt;&lt;span&gt;THREE&lt;/span&gt;&lt;/a&gt;
	&lt;ul&gt;
		&lt;li&gt;&lt;a&gt;&lt;span&gt;one&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a&gt;&lt;span&gt;two&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a&gt;&lt;span&gt;three&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a&gt;&lt;span&gt;four&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li class=&quot;nav&quot;&gt;&lt;a&gt;&lt;span&gt;FOUR&lt;/span&gt;&lt;/a&gt;
	&lt;ul&gt;
		&lt;li&gt;&lt;a&gt;&lt;span&gt;one&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a&gt;&lt;span&gt;two&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a&gt;&lt;span&gt;three&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a&gt;&lt;span&gt;four&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
&lt;/ul&gt;
</pre>
<p>The menu is a simple list within a list.  There are essentially only four main list items; ONE, TWO, THREE and FOUR.  Each of this list items has their own list of list items generically named one, two, three and four.  I personally stick with lists as my menu&#8217;s of choice because they degrade gracefully in case of CSS/JavaScript issues.</p>
<p>This list by itself isn&#8217;t much, in fact it&#8217;s not even a menu. CSS will be needed to really make it work correctly.</p>
<pre class="brush: css; title: ; notranslate">

#menu li {
	list-style:none;
	float:right; /* Makes IE 6,7,8 act like FF */
	position: relative;}
#menu li a {
	display:block;
	width: 160px;
	height:35px;
	margin-top: 5px;}
#menu li a span{
	padding-left:10px;
	line-height:2.8em;
	color: #000000;
	font-weight:700;}
#menu li a:hover {
	font-weight:bold;}

#menu li ul li a:hover span{ color: #222222; }

	#menu li ul {
		margin:0px;
		position:absolute;
		left: 160px;
		top:-90px;}
	#menu li ul li {
		padding:0px;
		border:0px;
		border-collapse:collapse;
		margin:0px;
		height:34px;}
	#menu li ul li a{ margin:0px;padding:0px;border:0px;}
	#menu li ul li a span{
		display:block;
		padding-top:7px;
		font-weight:100;
		line-height:1em;
		font-size: 83%;}
</pre>
<p>This is some simple CSS that will make the UL/LI lists to really act like lists.  Now the only issue is that you need it to act like a list. So the final piece of code to this puzzle is to add some JavaScript.  I am using the jQuery library as my choice for creating this script, so it&#8217;s necessary to have that package (1.3+) installed for this to work. You can drop this script into the footer element inside of &#8216;script&#8217; tags so it will run.  It will run automatically on page load.</p>
<pre class="brush: jscript; title: ; notranslate">
$(document).ready(function() {
	/* Setup the Menu */
	$(&quot;#menu &gt; li &gt; ul&quot;).hide();

	$(&quot;#menu li.nav&quot;).hover(
		/* on mouseover */
		function(e) {
			hoverMenu = this;
			if(this == closingMenu) {
				clearTimeout(closeMenu);
				clearTimeout(openMenu);
				$(this).find(&quot;ul:first&quot;).show(&quot;fast&quot;);
			} else {
				var newMenuOpen = function() {
					$(hoverMenu).siblings(&quot;.nav&quot;).find(&quot;ul:first&quot;).hide();
					$(hoverMenu).find(&quot;ul:first&quot;).show(&quot;fast&quot;);
				}
				openMenu = setTimeout(newMenuOpen, 500);
			}

		},
		/* on mouseout */
		function(e) {
			closingMenu = this;
			var closeMenu = function() {
				$(closingMenu).find(&quot;ul:first&quot;).fadeOut(&quot;fast&quot;);
			}
			closeMenu = setTimeout(closeMenu, 500);
		}
	);
});
</pre>
<p> The final product is quite a nice and simple dynamic menu that adds just the right touch of usability.  Now, typically, I would never say that a menu with sub menus popping up everywhere is something of a usability menu system, it&#8217;s not.  But sometimes, a nice menu like this is needed, especially if there is a lot of information and &#8216;drill downs&#8217; that need to be accessed quickly.  In any case, you can see my <a href="http://www.geedew.com/projects/easyMenu/index.html">demo</a> here.  Leave some comments if you have any questions, and enjoy! You can also see a fully implemented version at <a href="http://x-sqared.com">Xcessorries Squared.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.geedew.com/2009/12/05/usability-and-a-simple-javascript-hovering-menu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scribd and Slide mode : Why is my height wrong?</title>
		<link>http://www.geedew.com/2009/07/29/scribd-and-slide-mode-why-is-my-height-wrong/</link>
		<comments>http://www.geedew.com/2009/07/29/scribd-and-slide-mode-why-is-my-height-wrong/#comments</comments>
		<pubDate>Thu, 30 Jul 2009 05:06:02 +0000</pubDate>
		<dc:creator>drew</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[Scribd]]></category>
		<category><![CDATA[BugFix]]></category>

		<guid isPermaLink="false">http://www.geedew.com/?p=106</guid>
		<description><![CDATA[While recently using Scribd&#8216;s services, I came across a very nasty bug, and a nice clean fix.  Scribd allows developers to tap into a great, but somewhat basic API.  One of these settings allows a developer to set a default (&#8230;)</p><p><a href="http://www.geedew.com/2009/07/29/scribd-and-slide-mode-why-is-my-height-wrong/">Read the rest of this entry &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>While recently using <a href="http://www.scribd.com/about">Scribd</a>&#8216;s services, I came across a very nasty bug, and a nice clean fix.  <a href="http://www.scribd.com/about">Scribd</a> allows developers to tap into a great, but somewhat basic <a href="http://www.scribd.com/developers/api?method_name=Javascript+API">API</a>.  One of these settings allows a developer to set a default &#8216;mode&#8217; before the <a href="http://www.scribd.com/developers/api?method_name=Javascript+API">API</a> then builds the flash calls necessary to display the document.  The issue comes up when you choose the &#8216;slide&#8217; mode as the loading view.  No matter what &#8216;height&#8217; you set, with &#8216;auto_size&#8217; set to false, the height will adjust to the wrong height.</p>
<p><span id="more-106"></span></p>
<p class="entry-text">
You can jump to the code <a href="#finishedCode">here</a>, or continue.</p>
<p class="entry-text">
I started by writing some simple code that follows the API.
</p>
<pre class="brush: jscript; title: ; notranslate">
scribd_doc.addParam( 'mode', 'slide' );
scribd_doc.addParam( 'height', 800 );
scribd_doc.addParam( 'width', 600 );
scribd_doc.addParam( 'jsapi_version', 1 );
scribd_doc.addParam( 'auto_size', false );
scribd_doc.write( 'flash_catalog' );
</pre>
<p class="entry-text">Where &#8216;flash_catalog&#8217; is the container div of the <a href="http://www.scribd.com/about">Scribd</a> PDF.</p>
<p class="entry-text">
This however led me to have a height that follows the default rules (width multiplier of 85/110) where the height matches how much space is in the window. So I progressed further with this code.</p>
<pre class="brush: jscript; title: ; notranslate">
var oniPaperReady = function(e){
 $(&quot;#flash_catalog embed&quot;)
.attr(&quot;wmode&quot;,&quot;transparent&quot;)
.hide()
.css({&quot;height&quot;:&quot;800px&quot;, &quot;width&quot;:&quot;600px&quot;})
.show();
}

scribd_doc.addEventListener( 'iPaperReady', oniPaperReady );
scribd_doc.addParam( 'mode', 'slide' );
scribd_doc.addParam( 'jsapi_version', 1 );
scribd_doc.addParam( 'auto_size', false );
scribd_doc.write( 'flash_catalog' );
</pre>
<p class="entry-text">So now I am dropping in a listener in the API to wait for the document to load.  I then hide the &#8216;embed&#8217; flash information, then add the height and width, then re-show the flash element.<?p></p>
<p class="entry-text">
You may notice, I&#8217;m using <a href="http://jquery.com/">jQuery</a>, in which you can do the same thing with regular JavaScript, although quite a bit more complicated (ask if you really really need that code).</p>
<p class="entry-text">
An astute reader would also notice one thing, I&#8217;m not adjusting for an &#8216;object&#8217; tag, only the &#8216;embed&#8217; tag (the difference for flash between different browsers).  I figured out this novice mistake while testing in Internet Explorer.  Here&#8217;s the finished code, that works, removing the nasty height issue.</p>
<div id="finishedCode">
<pre class="brush: jscript; title: ; notranslate">
var scribd_doc = scribd.Document.getDoc( #######, 'key-*******************' );

var oniPaperReady = function(e){
$(&quot;#flash_catalog embed&quot;)
.attr(&quot;wmode&quot;,&quot;transparent&quot;)
.hide()
.css({&quot;height&quot;:&quot;800px&quot;, &quot;width&quot;:&quot;600px&quot;})
.show();

$(&quot;#flash_catalog object&quot;)
.attr(&quot;wmode&quot;,&quot;transparent&quot;)
.hide()
.css({&quot;height&quot;:&quot;800px&quot;, &quot;width&quot;:&quot;600px&quot;})
.show();
}

scribd_doc.addEventListener( 'iPaperReady', oniPaperReady );
scribd_doc.addParam( 'mode', 'slide' );
scribd_doc.addParam( 'jsapi_version', 1 );
scribd_doc.addParam( 'auto_size', false );
scribd_doc.write( 'flash_catalog' );
</pre>
</div>
<p class="entry-text">The final word; I&#8217;m adding the transparent mode so that I can then have a menu that drops on top of the flash.  This works very well!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.geedew.com/2009/07/29/scribd-and-slide-mode-why-is-my-height-wrong/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

