JS If Blocks plugin
Plugin details
Documentation
Install the plugin:
ruby script/plugin install svn://rubyforge.org/var/svn/js-if-blocks/trunk
Lets say you want to produce javascript that will execute blind_down visual effect to show some DOM element unless it is already visible. To accomplish this you need an IF block:
update_page do |page| page << "if( !($('#{element_id}').visible()) ) {" page.visual_effect :blind_down, element_id page << "}" end
Instead you can use +if+ method that this plugin provides:
update_page do |page| page.unless "$('#{element_id}').visible()" do page.visual_effect :blind_down, element_id end end
Also, you can make use of javascript element proxy in the expression:
update_page do |page| page.unless page[element_id].visible do page.visual_effect :blind_down, element_id end end
Further Documentation
There is currently no advanced documentation for this plugin.
New documentationEdit plugin | Back in time (1 older version) | Last edited by: scott, 7 months ago

