New javascript and stylesheet helpers

Few weeks ago, we did a change in helpers used by ubiquo to load stylesheet and javascript files. Our idea was to simplify the inclusion of plugin files and “railsify” the sintax of these helpers.

Here are some examples:

With ubiquo_stylesheet_link_tag :defaults the following files will be loaded: ubiquo.css, ubiquo_application.css, lightwindow.css, listing.css, red.css and special IE files, located in public/stylesheets/ubiquo/, and all the files installed by plugins located in public/stylesheets/ubiquo/plugins/.

For the basic work with ubiquo the option :defaults is essential. In addition, if we want change the color stylesheet file, we can call helper with the option :color, ex: ubiquo_stylesheet_link_tag :defaults, :color => ‘blue’. With this option, we are thinking to add support for custom ubiquo themes in the future. 

If we only want to load a single file located in ubiquo folder, we can do this: ubiquo_stylesheet_link_tag ‘login’. These are the basic options for the helper, any other option will be used in the internal call to the rails helper: stylesheet_link_tag.

ubiquo_javascript_include_tag works very similar of stylesheet helper. With :defaults option, the files ubiquo.js and lightwindow.js will be loaded. These files are located in public/javascripts/ubiquo. The files installed in public/javascripts/ubiquo/plugins/ are loaded too. We can also specify other files, ex: ubiquo_javascript_include_tag ‘ubiquo-calendar’, :defaults. And, as in the other helper, the rest of options will be used in the internal call to the rails helper: javascript_include_tag.

We hope that these changes are useful.