<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: YUI Autogrid: Correctly resize the grids</title>
	<atom:link href="http://ajaxian.com/archives/yui-autogrid-correctly-resize-the-grids/feed" rel="self" type="application/rss+xml" />
	<link>http://ajaxian.com/archives/yui-autogrid-correctly-resize-the-grids</link>
	<description>Cleaning up the web with Ajax</description>
	<lastBuildDate>Thu, 09 Feb 2012 06:55:33 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2</generator>
	<item>
		<title>By: MattSweeney</title>
		<link>http://ajaxian.com/archives/yui-autogrid-correctly-resize-the-grids/comment-page-1#comment-265496</link>
		<dc:creator>MattSweeney</dc:creator>
		<pubDate>Fri, 27 Jun 2008 18:49:58 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=3794#comment-265496</guid>
		<description>@dhtmlkitchen
Garrett,

The caching approach we use to optimized dynamic regular expressions is the culmination of a discussion that took place on an internal mailing list.

If you feel that this or any other source code has not been correctly attributed, please contact us directly and we will take every step to ensure that proper credit is given when due.</description>
		<content:encoded><![CDATA[<p>@dhtmlkitchen<br />
Garrett,</p>
<p>The caching approach we use to optimized dynamic regular expressions is the culmination of a discussion that took place on an internal mailing list.</p>
<p>If you feel that this or any other source code has not been correctly attributed, please contact us directly and we will take every step to ensure that proper credit is given when due.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris Heilmann</title>
		<link>http://ajaxian.com/archives/yui-autogrid-correctly-resize-the-grids/comment-page-1#comment-265461</link>
		<dc:creator>Chris Heilmann</dc:creator>
		<pubDate>Fri, 27 Jun 2008 08:05:00 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=3794#comment-265461</guid>
		<description>@Jordan you are very much missing the point here. Whoever wishes the time of layout tables back should also get IE4 and Netscape 4.07 and 4.5 back. Get over it, tables for layout are a hack and still advocating them means you haven&#039;t understood that HTML is structure and semantic meaning and not painting by numbers.</description>
		<content:encoded><![CDATA[<p>@Jordan you are very much missing the point here. Whoever wishes the time of layout tables back should also get IE4 and Netscape 4.07 and 4.5 back. Get over it, tables for layout are a hack and still advocating them means you haven&#8217;t understood that HTML is structure and semantic meaning and not painting by numbers.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris Heilmann</title>
		<link>http://ajaxian.com/archives/yui-autogrid-correctly-resize-the-grids/comment-page-1#comment-265460</link>
		<dc:creator>Chris Heilmann</dc:creator>
		<pubDate>Fri, 27 Jun 2008 08:02:32 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=3794#comment-265460</guid>
		<description>@dhtmlkitchen as to the performance differences: this code is executed once on initial rendering, so I&#039;d opt for readabillity rather than trying to shave off milliseconds that nobody misses.</description>
		<content:encoded><![CDATA[<p>@dhtmlkitchen as to the performance differences: this code is executed once on initial rendering, so I&#8217;d opt for readabillity rather than trying to shave off milliseconds that nobody misses.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris Heilmann</title>
		<link>http://ajaxian.com/archives/yui-autogrid-correctly-resize-the-grids/comment-page-1#comment-265458</link>
		<dc:creator>Chris Heilmann</dc:creator>
		<pubDate>Fri, 27 Jun 2008 07:58:28 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=3794#comment-265458</guid>
		<description>@dhtmlkitchen all good points. The code is also Open Source, so feel free to change that.

The accuracy of the class checking can be surely much improved, however I took this pragmatic approach as this only is meant to work with YUI grids and I&#039;d never use any other class on the main container element than the one defining the columns, just for readability.

As to constants, maybe, however I find the request to simulate a mediaqueries style syntax for this much more interesting.</description>
		<content:encoded><![CDATA[<p>@dhtmlkitchen all good points. The code is also Open Source, so feel free to change that.</p>
<p>The accuracy of the class checking can be surely much improved, however I took this pragmatic approach as this only is meant to work with YUI grids and I&#8217;d never use any other class on the main container element than the one defining the columns, just for readability.</p>
<p>As to constants, maybe, however I find the request to simulate a mediaqueries style syntax for this much more interesting.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jordan</title>
		<link>http://ajaxian.com/archives/yui-autogrid-correctly-resize-the-grids/comment-page-1#comment-265452</link>
		<dc:creator>Jordan</dc:creator>
		<pubDate>Fri, 27 Jun 2008 04:57:03 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=3794#comment-265452</guid>
		<description>So it&#039;s back to table based layouts for all of us. Ah, the flexibility of tables (layout-wise, not code-wise).</description>
		<content:encoded><![CDATA[<p>So it&#8217;s back to table based layouts for all of us. Ah, the flexibility of tables (layout-wise, not code-wise).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dhtmlkitchen</title>
		<link>http://ajaxian.com/archives/yui-autogrid-correctly-resize-the-grids/comment-page-1#comment-265451</link>
		<dc:creator>dhtmlkitchen</dc:creator>
		<pubDate>Fri, 27 Jun 2008 04:20:59 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=3794#comment-265451</guid>
		<description>if(classes.match(/yui-t[4-6]&#124;yui-right/)){}

Can be replaced with:
if(Dom.hasClass(container, &quot;yui-t[4-6]&#124;yui-right&quot;))
Where &lt;code&gt;Dom&lt;/code&gt; is &lt;code&gt;YAHOO.util.Dom&lt;/code&gt;.

Further down, I see:- container.className = sidebar === &#039;left&#039; ? &#039;yui-t3&#039; : &#039;yui-t6&#039;; 
- and then:- 
container.className = &#039;&#039;.
For general purpose javascript, it is a good idea to be polite about the className attribute by removing only the classes relevant to the script. 

This will have the benefit of using the className cache built into YAHOO.util.Dom that Matt seems to have borrowed from me (sans credit). 

This will also have the benefit of better accuracy,for className attribute rules (the &quot;(?:^&#124;\\s)&quot; + token + &quot;(?:\\s&#124;$)&quot;. The down side is that Dom.hasClass does not guarantee how it is implemented, so it could change and passing in a pattern would not work anymore. APE.dom.hasToken, on the other hand, uses a more generic approach. Method hasToken is guaranteed to search for a string token and that can contain RegExp syntax that will be cached (the original source for the caching concept that I wrote).

YAHOO.util.Dom -&gt; lookup can be reduced to 
var Dom = YAHOO.util.Dom, which will be further reduced with a compressor. It can shave milliseconds off time execution speed (barely), and can reduce download size (only slightly in this example).

It might be a good idea to add constants for the measurements. This can be passed in typical &lt;code&gt;config&lt;/code&gt; style of YUI. A conig could have a docId prefix.

The &lt;code&gt; scope&lt;/code&gt; argument ought to be renamed, as it deals with context, or thisArg for &lt;code&gt;call&lt;/code&gt;. It is not an actual scope.</description>
		<content:encoded><![CDATA[<p>if(classes.match(/yui-t[4-6]|yui-right/)){}</p>
<p>Can be replaced with:<br />
if(Dom.hasClass(container, &#8220;yui-t[4-6]|yui-right&#8221;))<br />
Where <code>Dom</code> is <code>YAHOO.util.Dom</code>.</p>
<p>Further down, I see:- container.className = sidebar === &#8216;left&#8217; ? &#8216;yui-t3&#8242; : &#8216;yui-t6&#8242;;<br />
- and then:-<br />
container.className = &#8221;.<br />
For general purpose javascript, it is a good idea to be polite about the className attribute by removing only the classes relevant to the script. </p>
<p>This will have the benefit of using the className cache built into YAHOO.util.Dom that Matt seems to have borrowed from me (sans credit). </p>
<p>This will also have the benefit of better accuracy,for className attribute rules (the &#8220;(?:^|\\s)&#8221; + token + &#8220;(?:\\s|$)&#8221;. The down side is that Dom.hasClass does not guarantee how it is implemented, so it could change and passing in a pattern would not work anymore. APE.dom.hasToken, on the other hand, uses a more generic approach. Method hasToken is guaranteed to search for a string token and that can contain RegExp syntax that will be cached (the original source for the caching concept that I wrote).</p>
<p>YAHOO.util.Dom -&gt; lookup can be reduced to<br />
var Dom = YAHOO.util.Dom, which will be further reduced with a compressor. It can shave milliseconds off time execution speed (barely), and can reduce download size (only slightly in this example).</p>
<p>It might be a good idea to add constants for the measurements. This can be passed in typical <code>config</code> style of YUI. A conig could have a docId prefix.</p>
<p>The <code> scope</code> argument ought to be renamed, as it deals with context, or thisArg for <code>call</code>. It is not an actual scope.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mikenolan</title>
		<link>http://ajaxian.com/archives/yui-autogrid-correctly-resize-the-grids/comment-page-1#comment-265441</link>
		<dc:creator>mikenolan</dc:creator>
		<pubDate>Thu, 26 Jun 2008 22:02:21 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=3794#comment-265441</guid>
		<description>We&#039;ve been using this technique for a little while but using jQuery/YUI Grids.  It works okay but is not without problems.  Designing different sized images is a bit of a pain.  We&#039;re probably going to turn it off and stick to 1024 for the next release to allow us to concentrate on developing functionality without worrying about two different layouts.</description>
		<content:encoded><![CDATA[<p>We&#8217;ve been using this technique for a little while but using jQuery/YUI Grids.  It works okay but is not without problems.  Designing different sized images is a bit of a pain.  We&#8217;re probably going to turn it off and stick to 1024 for the next release to allow us to concentrate on developing functionality without worrying about two different layouts.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris Heilmann</title>
		<link>http://ajaxian.com/archives/yui-autogrid-correctly-resize-the-grids/comment-page-1#comment-265430</link>
		<dc:creator>Chris Heilmann</dc:creator>
		<pubDate>Thu, 26 Jun 2008 17:45:39 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=3794#comment-265430</guid>
		<description>@newz2000 yes, that is a problem. You can do a lot with tiling background images horizontally though. And by not creating rounded corners with images but let IE have normal corners and use CSS :)</description>
		<content:encoded><![CDATA[<p>@newz2000 yes, that is a problem. You can do a lot with tiling background images horizontally though. And by not creating rounded corners with images but let IE have normal corners and use CSS :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: newz2000</title>
		<link>http://ajaxian.com/archives/yui-autogrid-correctly-resize-the-grids/comment-page-1#comment-265426</link>
		<dc:creator>newz2000</dc:creator>
		<pubDate>Thu, 26 Jun 2008 16:46:38 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=3794#comment-265426</guid>
		<description>A problem with layouts that change size is that it&#039;s hard to optimize the graphics for the pages. For example, if you assume an 800px wide browser you&#039;ll create the graphics small enough to fit that size. Make the size of the layout wider and the image looks puny.

Optimize your images for a 1000px layout and then shrink its width and you get images that push out the side of your column (or other similar problems).</description>
		<content:encoded><![CDATA[<p>A problem with layouts that change size is that it&#8217;s hard to optimize the graphics for the pages. For example, if you assume an 800px wide browser you&#8217;ll create the graphics small enough to fit that size. Make the size of the layout wider and the image looks puny.</p>
<p>Optimize your images for a 1000px layout and then shrink its width and you get images that push out the side of your column (or other similar problems).</p>
]]></content:encoded>
	</item>
</channel>
</rss>

