<?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>Joe Song &#187; Development</title> <atom:link href="http://joesong.com/tag/development/feed/" rel="self" type="application/rss+xml" /><link>http://joesong.com</link> <description>Development, music.</description> <lastBuildDate>Tue, 22 Jun 2010 04:37:09 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.0</generator> <item><title>Overriding Drupal Login Form Messages via Localization</title><link>http://joesong.com/2010/03/overriding-drupal-login-form-messages-via-localization/</link> <comments>http://joesong.com/2010/03/overriding-drupal-login-form-messages-via-localization/#comments</comments> <pubDate>Fri, 19 Mar 2010 16:22:32 +0000</pubDate> <dc:creator>josephsong</dc:creator> <category><![CDATA[Development]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[drupal]]></category> <category><![CDATA[drupal 6]]></category> <category><![CDATA[forms]]></category> <category><![CDATA[localization]]></category> <category><![CDATA[programming]]></category><guid
isPermaLink="false">http://joesong.com/?p=991</guid> <description><![CDATA[Altering form messages in Drupal via i10n.]]></description> <content:encoded><![CDATA[<h3>Sx</h3><p>We want something besides the default messaging for user forms in Drupal. They are still in English, but just custom to our application. Also, we don&#8217;t need to override all of them, just a few. And, we are using Drupal 6.</p><h3>Dx</h3><p>Drupal is set up to automatically translate form messaging. Using this mechanism, we can cleanly alter the messages to appear just as we would like them to appear. We create a custom language and set it as the default. We only make the few translations that we need and Drupal falls back on the default English for stuff we don&#8217;t translate.</p><p>To setup the custom language:</p><ol
class="default_list"><li>Make sure the Locale module is enabled and that you have permissions to use it (both to Administer Languages and for the Translate Interface)</li><li>Go to Site Configuration -&gt; Languages -&gt; Add Language</li><li>Open the Custom Language form</li><li>Fill in the form with something like:<br
/> Language code: en-MySite<br
/> Language name in English: MySite<br
/> Native language name: MySite<br
/> Path prefix: mysite (this is only a placeholder and won&#8217;t be needed later)<br
/> Language domain: [blank]<br
/> Direction: Left to right</li><li>Click the Add custom language</li><li>Go to Site Configuration -&gt; Languages and choose en-MySite as the default language, click Save Configuration</li></ol><p>To make the faux translations:</p><ol
class="default_list"><li>Go to Site Building -&gt; Translate Interface -&gt; Search</li><li>Search for a particular string by something it contains, say, &#8220;username&#8221;.</li><li>Find your string in the search results and click edit. Enter your translation and submit it.</li><li>Repeat for other strings as necessary.</li></ol><h3>Tx</h3><p>So, we end up with a clean faux translation of the default strings into your application-specific copy.</p> ]]></content:encoded> <wfw:commentRss>http://joesong.com/2010/03/overriding-drupal-login-form-messages-via-localization/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>HTML and CSS Development Guidelines</title><link>http://joesong.com/2010/02/html-and-css-development-guidelines/</link> <comments>http://joesong.com/2010/02/html-and-css-development-guidelines/#comments</comments> <pubDate>Thu, 18 Feb 2010 17:23:29 +0000</pubDate> <dc:creator>josephsong</dc:creator> <category><![CDATA[CSS]]></category> <category><![CDATA[Development]]></category> <category><![CDATA[HTML]]></category> <category><![CDATA[html]]></category> <category><![CDATA[optimization]]></category> <category><![CDATA[performance]]></category> <category><![CDATA[programming]]></category> <category><![CDATA[progressive enhancement]]></category><guid
isPermaLink="false">http://joesong.com/?p=925</guid> <description><![CDATA[Some rules for HTML and CSS development based on success in the field.]]></description> <content:encoded><![CDATA[<p>*NOTE &#8211; Feb 18, 2010: this is a work in progress. Very likely, there are points not yet included.</p><h2>Philosophical Approach</h2><p>The approach can be summed up in two points:</p><ol
class="default_list"><li>Write enough markup and style definitions to make it clear to other developers what is happening.</li><li>Write as little markup and style definitions as possible.</li></ol><p>Let’s talk about what these mean.</p><h5>Write enough markup and style definitions to make it clear to other developers what is happening.</h5><p>We follow the principles of semantic web development which involves using markup to describe the data or content of a web page. In practice, this means things like using <code>ol</code> and <code>ul</code> tags to make lists of items instead of text delineated with <code>br</code> tags, and giving page elements class names that describe their function (eg “<code>article-wrapper</code>”) instead of class names that describe their appearance (eg “<code>blue-background</code>”).</p><h5>Write as little markup and as few style definitions as possible.</h5><p>Small file size and shallow markup heirarchy make the site faster to load and easier to maintain. To that end, we write as little markup and as few style as possible to make the page appear and function as necessary. In practice, this means things like using <code>padding</code> and <code>margin</code> to create space between elements instead of using <code>br</code> or empty <code>p</code> tags, and writing reusable CSS classes that add common traits (eg <code>background-color</code>) and can be used in conjunction with other reusable CSS classes that provide other common traits (eg <code>font-size</code>).</p><h2>Rules</h2><p>We have a few easy-to-follow rules for HTML and CSS development that have evolved from years of experience.</p><h5>Rules for writing HTML</h5><ul
class="default_list"><li>Block-level elements      are  never be self-closing, even      when empty.<br
/> <code>&lt;div /&gt;</code> should always be written as <code>&lt;div&gt;&lt;/div&gt;</code>, but but <code>&lt;img /&gt;</code> or <code>&lt;span /&gt;</code> is proper.</li><li>Markup always validates      unless there is a very good reason (eg for cross-browser support or CMS      limitations).<br
/> There are many validators but W3C’s is preferred: <a
href="http://validator.w3.org/">http://validator.w3.org/</a></li><li>Documents are written for      HTML 5.<br
/> Documents should use the the <code>&lt;!DOCTYPE html&gt;</code> declaration.</li><li>Tables are used only for      tabular data, not for layout.</li><li>Stylesheets are included      in the <code>&lt;head&gt;</code> of the page.</li><li>Stylesheets are included      using <code>&lt;link /&gt;</code> tags, not <code>@import</code> statements.<br
/> It is permissable, however, to use <code>@import</code> statements within an external stylesheet.</li><li>Markup should be indented      using tabs, not spaces, so that the indentation matches the markup      heirarchy.</li><li>CSS and JavaScript are      included in external files, not written inline in the page.</li><li>External JavaScript files      are included at the bottom of the page just before the <code>&lt;/body&gt;</code>.</li></ul><h5>Rules for writing CSS</h5><ul
class="default_list"><li>CSS is written a compact      format characterized by the selector and all definitions on one line.<br
/> Use <a
href="http://www.codebeautifier.com/">http://www.codebeautifier.com/</a> to switch between formats; the format described here is called ‘High’ compression.<br
/> <strong><em>Improper:<br
/> </em></strong></p><pre class="brush: css;">.my-class {
	width: 300px;
	height: 300px;
}</pre><p><strong><em>Proper:</em></strong></p><pre class="brush: css;">.my-class { width: 300px; height: 300px; }</pre></li><li>Selectors use hyphens to      delineate words, not camel case or underscores.<br
/> Improper: <code>.myClass</code> or <code>#my_element</code>.      Proper: <code>.better-class</code></li><li>Hacks to make pages work      correctly in Internet Explorer are included in a separate IE-specific      stylesheet and included on the page using conditional comments.</li><li>During development, sites      use a global stylesheet for universal definitions and separate sheets for      independent areas or features of the site.</li><li>Use of style attributes in markup is avoided.</li><li>When possible (that is,      when specific instances are known), <code>.png</code> transparency should be fixed for      specific elements using the IE-6 specific stylesheet instead of using an <code>.htc</code> file as a behavior.<br
/> <strong><em>Improper:</em></strong></p><pre class="brush: css;">a { behavior: url(iepngfix.htc); }</pre><p><strong><em>Proper:<br
/> </em></strong></p><pre class="brush: css;">a#button { background: none; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,      sizingMethod=crop, src='../images/button.png'); }</pre></li><li>The default font size is      declared in pixels for the <code>&lt;body&gt;</code> and      the declared for other elements as percentages.<pre class="brush: css;">body { font-size: 13px; }
h1 { font-size: 125%; }</pre></li></ul> ]]></content:encoded> <wfw:commentRss>http://joesong.com/2010/02/html-and-css-development-guidelines/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>BedlamTheatre.org</title><link>http://joesong.com/2010/02/bedlamtheatre-org/</link> <comments>http://joesong.com/2010/02/bedlamtheatre-org/#comments</comments> <pubDate>Tue, 02 Feb 2010 05:01:17 +0000</pubDate> <dc:creator>josephsong</dc:creator> <category><![CDATA[Portfolio]]></category> <category><![CDATA[Development]]></category> <category><![CDATA[development lead]]></category> <category><![CDATA[minneapolis]]></category> <category><![CDATA[mysql]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[wordpress]]></category><guid
isPermaLink="false">http://joesong.com/?p=677</guid> <description><![CDATA[The new site of the boldest theater in town.]]></description> <content:encoded><![CDATA[<p><a
href="http://joesong.com/wp-content/uploads/2010/02/bedlam.png"><img
class="alignright size-thumbnail wp-image-679" title="BedlamTheatre.org" src="http://joesong.com/wp-content/uploads/2010/02/bedlam-150x150.png" alt="" width="150" height="150" /></a><strong>The Site:</strong> The new site (version 2) for the boldest live theater in town.<br
/> <a
href="http://bedlamtheatre.org" target="_blank">http://bedlamtheatre.org</a></p><p><strong>The Client:</strong> Bedlam creates some of the most interesting and original theater in Minneapolis. They run their own production and, in addition, rent their space to other groups. This means they have a large number of events to keep track of and promote,  and they needed a site that could accommodate them all.</p><p><strong>My Role:</strong> Having designed, built and maintained their version 1 site, I was keenly aware of the workflow issues and front-end pros and cons that they were experiencing. I worked with them to find the new look and feel of the site and to expand the functionality. In the end, the new site was built on WordPress, with collaborative design and unique plugins.</p><p><strong>The Technology:</strong> One of the initial hurdles of this site was importing the existing years of data into WordPress, including media and event dates. I created a unique plugin for them called TheatreEvents and wrote a custom import script that inserted the new posts and attachments and populated the data. The plugin features direct hooking into the admin interface so that event data entry is in the same form as post entry.  On the front-end, the plugin allows for sorting by the event dates and custom week and month views. The plugin will be released publicly soon.</p><p><strong>The Highlights:</strong> Weekly calendar in the sidebar of most pages with Ajax navigation. <a
href="http://bedlamtheatre.org/2010/02/" target="_blank">Monthly calendar</a> of events.</p> ]]></content:encoded> <wfw:commentRss>http://joesong.com/2010/02/bedlamtheatre-org/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>WestlawNext.com</title><link>http://joesong.com/2010/01/westlawnext-com/</link> <comments>http://joesong.com/2010/01/westlawnext-com/#comments</comments> <pubDate>Sun, 31 Jan 2010 23:00:25 +0000</pubDate> <dc:creator>josephsong</dc:creator> <category><![CDATA[Portfolio]]></category> <category><![CDATA[CSS]]></category> <category><![CDATA[Development]]></category> <category><![CDATA[javascript]]></category> <category><![CDATA[jQuery]]></category> <category><![CDATA[OLSON]]></category> <category><![CDATA[programming]]></category><guid
isPermaLink="false">http://joesong.com/?p=683</guid> <description><![CDATA[Product launch site for the biggest name in legal research.]]></description> <content:encoded><![CDATA[<p><a
href="http://joesong.com/wp-content/uploads/2010/02/westlawnext.png"><img
class="alignright size-thumbnail wp-image-686" title="WestlawNext.com" src="http://joesong.com/wp-content/uploads/2010/02/westlawnext-150x150.png" alt="" width="150" height="150" /></a><strong>The Site:</strong> Thomson Reuters, the leading provider of legal and business research products, needed a site to promote the launch of their newest product, WestlawNext.<br
/> <a
href="http://westlawnext.com" target="_blank">http://westlawnext.com</a></p><p><strong>The Client:</strong> Thomson Reuters&#8217; clients are savvy and busy. They knew that if the site was going to reach them, it had to be fast, solid and engaging.</p><p><strong>My Role:</strong> Developer in small, focused group to create the prototype and an on-site advisor during integration with their existing systems.</p><p><strong>The Technology:</strong> The client needed to integrate the site into their CMS but they had asked us to create and test a prototype site before handing it over. We built the original with very limited PHP since we knew TR would be using .NET in the end but PHP allowed our team to quickly build the prototype. The site uses a custom Flash video player and also has a limited but useful mobile version. This mobile version was very important to the client as the majority of their customers regularly use BlackBerrys and other mobile devices. During integration a few technical hurdles appeared from use of their legacy systems but because I was on-site at the time, launch was not affected.</p><p><strong>The Highlights:</strong> <a
href="http://west.thomson.com/westlawnext/seeit/default.aspx" target="_blank">Multiple video players</a> used in conjunction with jQuery UI tabs. Animated main navigation.</p> ]]></content:encoded> <wfw:commentRss>http://joesong.com/2010/01/westlawnext-com/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Avoiding flickering in jQuery when animating elements which contain Flash</title><link>http://joesong.com/2010/01/avoiding-flickering-in-jquery-when-animating-elements-which-contain-flash/</link> <comments>http://joesong.com/2010/01/avoiding-flickering-in-jquery-when-animating-elements-which-contain-flash/#comments</comments> <pubDate>Mon, 18 Jan 2010 21:28:55 +0000</pubDate> <dc:creator>josephsong</dc:creator> <category><![CDATA[CSS]]></category> <category><![CDATA[Development]]></category> <category><![CDATA[JavaScript]]></category> <category><![CDATA[javascript]]></category> <category><![CDATA[jQuery]]></category><guid
isPermaLink="false">http://joesong.com/?p=648</guid> <description><![CDATA[jQuery slideToggle or slideDown will cause a Flash movie to flicker if the movie is inside the animated element. A short note on how to fix it.]]></description> <content:encoded><![CDATA[<p>So, we had this issue when were were using slideToggle (and it would apply to slideDown) where the Flash movie contained inside the element we were animating would flicker once the animation is complete.</p><p>What&#8217;s happening: While animating, jQuery needs to add a few style definitions if they are not already declared. Among these is the &#8216;overflow&#8217; property. jQuery sets this to &#8216;hidden&#8217; in order to show the animation and then removes this declaration upon completion of the animation. When the declaration is removed, Flash gets the signal to re-render the movie (because, possibly, the layout of the page has changed).</p><p>How to fix it: declare &#8216;overflow:hidden&#8217; in the CSS for the element. Voilá, the flickering is gone.</p> ]]></content:encoded> <wfw:commentRss>http://joesong.com/2010/01/avoiding-flickering-in-jquery-when-animating-elements-which-contain-flash/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>External Links in New Window. Passive and with MooTools.</title><link>http://joesong.com/2009/11/external-links-in-new-window-passive-and-with-mootools/</link> <comments>http://joesong.com/2009/11/external-links-in-new-window-passive-and-with-mootools/#comments</comments> <pubDate>Wed, 04 Nov 2009 15:50:55 +0000</pubDate> <dc:creator>josephsong</dc:creator> <category><![CDATA[Development]]></category> <category><![CDATA[JavaScript]]></category> <category><![CDATA[javascript]]></category> <category><![CDATA[mootools]]></category> <category><![CDATA[passive]]></category> <category><![CDATA[programming]]></category><guid
isPermaLink="false">http://joesong.com/?p=571</guid> <description><![CDATA[Sx All external links from the site should open in a new window. Do not want to write this on a link-by-link basis. Should be light and unobtrusive. Using MooTools. Dx We can easily know what domain the script lives on. Other domains are easily distinguished. Links come and go and are loaded in, sometimes, by [...]]]></description> <content:encoded><![CDATA[<h3>Sx</h3><p>All external links from the site should open in a new window. Do not want to write this on a link-by-link basis. Should be light and unobtrusive. Using MooTools.</p><h3>Dx</h3><p>We can easily know what domain the script lives on. Other domains are easily distinguished. Links come and go and are loaded in, sometimes, by other links. We will use one of my favorite patterns, which I am calling the Passive Click Pattern (got a better or more widely-used name?) to listen to all clicks anywhere on the document.body. In this case, if the click is on a link and the link is external, then we will set the target of the link to &#8216;_blank&#8217;.  Paramount to using the PCP (OMG, I did not realize that was the acronym) is the pattern of not <em>stopping </em>clicks in other patterns but just using <em>preventDefault</em>. That way, the click can flow through the DOM and be heard by multiple listeners.</p><p>This solution requires only the most core of MooTools and is built against version 1.2.3.</p><h3>Tx</h3><pre class="brush: jscript;">
window.addEvent('domready', function(){
	var currentDomain = window.location.host;
	$(document.body).addEvent('click', function(evt) {
		$trgt = $(evt.target);
		if ($trgt.get('tag') !== 'a') {
			$trgt = $trgt.getParent();
		}
		// if the target is a link AND the link is absolute AND the link goes to a different domain,
		// then set the target to _blank to open in new page
		if ($trgt &amp;&amp;
				$trgt.get('tag') === 'a' &amp;&amp;
				$trgt.get('href').test('http') &amp;&amp;
				!$trgt.get('href').test(currentDomain)) {
			$trgt.set('target', '_blank');
		}
	});
});
</pre><h3>EDIT:</h3><p>A more fitting name for this pattern is &#8220;Passive EVENT Pattern&#8221; since it can be applied to more than just clicks. Form submissions, for instance, or key entry.</p><p>Plus, then you can say your application is PEPpy. #amirightfolks</p> ]]></content:encoded> <wfw:commentRss>http://joesong.com/2009/11/external-links-in-new-window-passive-and-with-mootools/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Style.Target.com</title><link>http://joesong.com/2009/08/style-target-com/</link> <comments>http://joesong.com/2009/08/style-target-com/#comments</comments> <pubDate>Sat, 29 Aug 2009 01:25:18 +0000</pubDate> <dc:creator>josephsong</dc:creator> <category><![CDATA[Portfolio]]></category> <category><![CDATA[Development]]></category> <category><![CDATA[OLSON]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[programming]]></category> <category><![CDATA[progressive enhancement]]></category> <category><![CDATA[wordpress]]></category><guid
isPermaLink="false">http://joesong.com/?p=614</guid> <description><![CDATA[Design-driven WordPress theme for Target's most stylish clothing and accessories.]]></description> <content:encoded><![CDATA[<p><a
href="http://joesong.com/wp-content/uploads/2010/01/style_target_com.png"><img
class="size-thumbnail wp-image-615 alignright" title="style_target_com" src="http://joesong.com/wp-content/uploads/2010/01/style_target_com-150x150.png" alt="Style.Target.com" width="150" height="150" /></a><strong>The Site:</strong> Flexible and stylish boutique for promotion of Target&#8217;s most stylish clothing and accessories. <br
/> <a
href="http://style.target.com" target="_blank">http://style.target.com</a></p><p><strong>The Client:</strong> Already well known for their design-on-a-dime offerings, Target needed a site to regularly update with new product announcements, features about their relationships with top designers and frugal fashion tips.</p><p><strong>My Role:</strong> Implementation of ongoing content and evolving design of blog. Each post has a slightly new feel that keeps the whole blog fresh.</p><p><strong>The Technology:</strong> The site is built on WordPress but uses custom short codes and fields. In this way, the project is able to keep WordPress&#8217; ease of use while using unique design features.</p><p><strong>The Highlights: </strong><a
href="http://style.target.com/?category_name=Designers">Designer&#8217;s directory</a> from which users can quickly access any designer&#8217;s Target collection. Integration of Target&#8217;s universal header and footer navigation, including seasonal updates, into the WordPress theme.</p> ]]></content:encoded> <wfw:commentRss>http://joesong.com/2009/08/style-target-com/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>LegalCurrent.com</title><link>http://joesong.com/2009/05/legalcurrent-com/</link> <comments>http://joesong.com/2009/05/legalcurrent-com/#comments</comments> <pubDate>Fri, 15 May 2009 02:09:20 +0000</pubDate> <dc:creator>josephsong</dc:creator> <category><![CDATA[Portfolio]]></category> <category><![CDATA[Development]]></category> <category><![CDATA[development lead]]></category> <category><![CDATA[OLSON]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[wordpress]]></category><guid
isPermaLink="false">http://joesong.com/?p=623</guid> <description><![CDATA[Information about, commentary on and current events in the practice of law. Custom WordPress theme for Thomson Reuters.]]></description> <content:encoded><![CDATA[<p><a
href="http://joesong.com/wp-content/uploads/2010/01/legalcurrent_com.png"><img
class="size-thumbnail wp-image-624 alignright" title="legalcurrent_com" src="http://joesong.com/wp-content/uploads/2010/01/legalcurrent_com-150x150.png" alt="LegalCurrent.com" width="150" height="150" /></a><strong>The Site:</strong> Information about, commentary on and current events in the practice of law. A custom WordPress theme for Thomson Reuters.<br
/> <a
href="http://legalcurrent.com/">http://legalcurrent.com</a></p><p><strong>The Client:</strong> Thomson Reuters is the world’s leading source of intelligent information for businesses and professionals. They needed a blog to maintain contact and conversation with legal professionals.</p><p><strong>My Role: </strong>Development lead for custom WordPress theme.</p><p><strong>The Technology:</strong> The data is driven through a WordPress installation but the theme is setup to enable a number of special features. The site uses native category functionality to populate special areas of the site while keeping those specific categories out of the blog flow, e.g. Featured media and Headnote of the Day</p><p><strong>The Highlights:</strong> Custom design, unique widgets and features.</p> ]]></content:encoded> <wfw:commentRss>http://joesong.com/2009/05/legalcurrent-com/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Mootools 1.2 Horizontal Accordion &#8211; the secret revealed</title><link>http://joesong.com/2009/04/mootools-12-horizontal-accordion-the-secret-revealed/</link> <comments>http://joesong.com/2009/04/mootools-12-horizontal-accordion-the-secret-revealed/#comments</comments> <pubDate>Wed, 15 Apr 2009 18:44:42 +0000</pubDate> <dc:creator>josephsong</dc:creator> <category><![CDATA[Development]]></category> <category><![CDATA[JavaScript]]></category> <category><![CDATA[javascript]]></category> <category><![CDATA[mootools]]></category> <category><![CDATA[programming]]></category><guid
isPermaLink="false">http://joesong.com/?p=445</guid> <description><![CDATA[Sometimes the API docs are wrong. Since I couldn&#8217;t find out how to do it, I&#8217;ll post the secret here. To make the horizontal accordion work in Mootools 1.2 you have to specify a fixed width. The API docs say it is a Boolean, but it ain&#8217;t. It is what the plugin uses to determine [...]]]></description> <content:encoded><![CDATA[<p>Sometimes the API docs are wrong.</p><p>Since I couldn&#8217;t find out how to do it, I&#8217;ll post the secret here. To make the horizontal accordion work in Mootools 1.2 you have to specify a fixed width. The API docs say it is a Boolean, but it ain&#8217;t. It is what the plugin uses to determine the size of open panels.</p><p>Markup:</p><pre class="brush: xml;">
&lt;ul id=&quot;get-started-steps&quot;&gt;
	&lt;li class=&quot;get-started-step&quot;&gt; &lt;a class=&quot;trigger left&quot; href=&quot;#&quot;&gt;Step 1&lt;/a&gt;
		&lt;div class=&quot;get-started-content left&quot;&gt;step 1 content&lt;/div&gt;
	&lt;/li&gt;
	&lt;li class=&quot;get-started-step&quot;&gt; &lt;a class=&quot;trigger left&quot; href=&quot;#&quot;&gt;Step 2&lt;/a&gt;
		&lt;div class=&quot;get-started-content left&quot;&gt;step 2 content&lt;/div&gt;
	&lt;/li&gt;
	&lt;li class=&quot;get-started-step&quot;&gt; &lt;a class=&quot;trigger left&quot; href=&quot;#&quot;&gt;Step 3&lt;/a&gt;
		&lt;div class=&quot;get-started-content left&quot;&gt;step 3 content&lt;/div&gt;
	&lt;/li&gt;
&lt;/ul&gt;
</pre><p>JS:</p><pre class="brush: jscript;">&lt;br /&gt;
new Accordion(&lt;br /&gt;
$$(’.get-started-step .trigger’),&lt;br /&gt;
$$(’.get-started-content’),&lt;br /&gt;
{&lt;br /&gt;
height: false,&lt;br /&gt;
width: true,&lt;br /&gt;
fixedWidth: 200&lt;br /&gt;
});&lt;br /&gt;
</pre><p>CSS:</p><pre class="brush: css;">&lt;br /&gt;
#get-started-steps { width: 100%; }&lt;br /&gt;
#get-started-steps li { float: left; }&lt;br /&gt;
.get-started-content { width: 200px; height: 200px; }&lt;br /&gt;
.left { float: left; }&lt;br /&gt;
</pre>]]></content:encoded> <wfw:commentRss>http://joesong.com/2009/04/mootools-12-horizontal-accordion-the-secret-revealed/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>JavaScript Namespacing</title><link>http://joesong.com/2009/02/javascript-namespacing/</link> <comments>http://joesong.com/2009/02/javascript-namespacing/#comments</comments> <pubDate>Fri, 20 Feb 2009 19:34:24 +0000</pubDate> <dc:creator>josephsong</dc:creator> <category><![CDATA[Acting]]></category> <category><![CDATA[Development]]></category> <category><![CDATA[JavaScript]]></category> <category><![CDATA[Performing]]></category> <category><![CDATA[javascript]]></category> <category><![CDATA[namespacing]]></category> <category><![CDATA[programming]]></category><guid
isPermaLink="false">http://joesong.com/?p=427</guid> <description><![CDATA[I figure if you are reading even this far you care / know about namespacing in JavaScript so I&#8217;m not going to go into WHY. However, the HOW is here. But, okay, yeah, maybe some specific WHY. We had been using a generic namespacing function that required plugging in the base name three times. Not [...]]]></description> <content:encoded><![CDATA[<p>I figure if you are reading even this far you care / know about namespacing in JavaScript so I&#8217;m not going to go into WHY.</p><p>However, the HOW is here. But, okay, yeah, maybe some specific WHY.</p><p>We had been using a generic namespacing function that required plugging in the base name three times. Not really that much work, but kind of a pain if you want to redistribute it. So, it is now reworked to be changed only in one place. It requires three variables in the default global namespace but that ain&#8217;t bad, right?</p><pre>var APPLICATION_NAMESPACE = "MYPROJECT";
var _global = this;
var _global[APPLICATION_NAMESPACE] = {};

_global[APPLICATION_NAMESPACE].namespace = function() {
    var a=arguments, o=null, i, j, d;
    for (i=0; i&lt;a.length; i=i+1) {
        d=a[i].split(".");
        o=_global[APPLICATION_NAMESPACE];

        for (j=(d[0] == APPLICATION_NAMESPACE) ? 1 : 0; j&lt;d.length; j=j+1) {
            o[d[j]]=o[d[j]] || {};
            o=o[d[j]];
        }
    }

    return o;
}</pre><p>So, <span
class="code">_global</span> here refers to <span
class="code">window</span> most of the time (but sometimes not so we need a reference to it).  <span
class="code">MYPROJECT</span> can be whatever you want it to be.</p><p>When we use the namespacing stuff we refer to the specific namespace directly using JS dot-deliminated object syntax. This function goes soft on existing objects; it will not destroy a previously created object with the same name.</p><p>The function will ignore the name of the namespace if it is the first part in there. I&#8217;m not saying that well, but these calls are functionally identical and both namespace MYPROJECT.SomeOtherPart.</p><pre>MYPROJECT.namespace("SomeOtherPart");
MYPROJECT.namespace("MYPROJECT.SomeOtherPart");</pre>]]></content:encoded> <wfw:commentRss>http://joesong.com/2009/02/javascript-namespacing/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced) (user agent is rejected)

Served from: joesong.com @ 2010-07-31 09:19:00 -->