The Old Blog Archive, 2005-2009

Archive for January, 2007

A Belated Announcement in English: Yullio Layout Generator

(Announcement in Chinese here.)

hlb and I have created a Rails generator that churns out good-looking layouts (it’s Mollio :) ) for your controllers. Yullio Layout Generator (gem: layout_yullio_generator) is a layout generator that combines the flexibility of YUI Grids with Mollio CSS/HTML templates. Simply generate the layout with:

script/generate layout_yullio  [optional partial name]

And it places a copy of YUI Grids and Mollio CSS files in your public/ directory, instantly giving your views a great look.

This generator is a continuation of Mollio Layout Generator (gem: layout_mollio_generator). Here we combine Mollio’s good theme design with YUI Grids’ flexibility. It’s very easy to change the layout of your views. Just add the following lines in your controller:

  class MyController < ApplicationController
    yullio_page_width :doc2
    yullio_column_template :yui_t2

Here yullio_page_width is followed by YUI Grids page width styles, currently :doc, :doc2 and :doc3 are supported. Column templates follow the same naming rules. YUI calls them yui-t1 to -t7, here we replace the dash with the underline for obvious reasons. The two methods are implemented as a plug-in, which is of course copied for you by the generator. :)

Simply type “script/generator layout_yullio” for usage and description. We hope this generator will help you save time in creating layouts, further speeding up the prototyping stage of Rails app development.

Opacity Quirkiness on Mac Browsers

Dave Shea has discussed the opacity bugs found in both FireFox and Safari. This has been plaguing FireFox 2.0 on Mac for a while: whenever there is an element with a < 1.0 opacity, the page’s font rendering becomes very thin, sometimes causing hard to read pages. Currently there doesn’t seem to be any solution to it, other than not using opacity at all.

Lately I have found that opacity can affect Safari’s performance, too. If your pages contains element overlays that have opacity settings, when there are a few of them (say around 10), Safari becomes extremely slow in loading and rendering the page. If you open the page as a tab, switching to the tab will be very slow too. This badly affects the performance of JavaScript in the page, notably the Scriptaculous sortables. It has misled me to think that Scriptaculous was the culprit. After I removed the opacity settings, the sortables are as smooth as it should be. And no, running Safari on a MacBook Pro doesn’t help.

For testing, please open up both this slow version and fast version. The only difference is that the overlays in the slow version have opacity set.

WebKit and FireFox don’t have such problem.

It’s There! Rails 1.2 Released

Apparently people on the mailing list are watching closely: http://dev.rubyonrails.org/changeset/5982. RubyForge has already got 1.2.1 now. May have wait until it’s clear why 1.2.1 is released just 14 hours after 1.2 came out. There seems to be some last-minute fix to a serious database adaptor defect.

But all in all, this must be the Rails version hitherto mostly waited and expected. Along with the newly published 2nd ed of AWDwR, it seems people will be able to live off the edge for quite a while. :)

Kudos to the Rails people!

Focusing, or Drifting Away

I have written more on programming and software-related stuff since last October than I ever did. My lifelong problem and anxiety (so far) has always been that I wasn’t on/into anything particular for a long time. So three months is amazing. Will have to see where all this leads to.