First version of the tooltips widget

Posted by Paolo Sat, 13 Oct 2007 17:48:00 GMT

Hey guys, today I’ve got a little gift for you! A new widget is ready to be tested by the crowd: Tooltips!

So you want to write something like this:

My first tooltip: 

<% tooltip do %>
  <b>Woot, woot, woot!</b><br/>
  Wow, those lousy tooltips are finally ready!<br/>
<% end %>

And get something like this:

All this goodness is available to you just doing:

ruby script/plugin install svn://svn.seesaw.it/widgets/trunk

Btw, there is some magic happening here, let’s see:

  1. Where is the question mark image taken from? It’s automatically copied into your public/images/widgets folder during plugin installation!
  2. Where is the javascript file that handles everything taken from? It’s automatically copied into your public/javascripts/widgets folder during installation, and you don’t even need to include it with javascript_include_tag because I’ve hacked it for you!
  3. Where’s the CSS? It’s automagically inlined in your HTML, you can customize it of course.

It’s an early stage release so please report any bug you will find.

NB: As I said some code gets executed on plugin installation so please install with script/plugin install, just unpacking the plugin under vendor/plugins doesn’t work as expected (you’ll miss necessary images and javascripts).

Have fun!

Posted in  | Tags ,  | 5 comments | no trackbacks

Trackbacks

Use the following link to trackback from your own site:
http://blog.seesaw.it/articles/trackback/254114

Comments

  1. Avatar deduce said about 3 hours later:

    cool, it’s easy to use.

    I’ll introduce your widget in Traditional Chinese and I’ll use it on my rails app. some other days. :p

  2. Avatar Jack Danger said 3 days later:

    I’d love to use this but is there any way you could update it to not require ERB blocks? I’d like to be able to use with a helper my app relies on:

    module ApplicationHelper
      def balloon_tip(name)
        content = BalloonTip.find_by_name(name).content
        tooltip { content }
      end
    end
    
    Any chance you can make this widget work in straight Ruby?
  3. Avatar stephen said 4 days later:

    I use Piston to manage plugins and it doesn’t run the install hook. I added this rake task in the widgets plugin. You could add it to your codebase:

    file: vendor/plugins/widgets/tasks/widgets_tasks.rake
    
      # desc "Explaining what the task does" 
      # task :widgets do
      #   # Task goes here
      # end
    
      namespace :widgets do
        desc "Run the plugin install script (if you didn't install via script/plugin install)" 
        task :install_assets => :environment do
          load File.join(File.dirname(__FILE__), '../install.rb')
        end
      end
    

    After loading the plugin with Piston I can then just run this task:

    
      rake widgets:install_assets
    
  4. Avatar Sanjay said 16 days later:

    Hiya. I love the plugin.

    Here’s the behaviour I couldn’t figure out:

    I’d like to have tabs highlighted when they are on a different controller. Here’s an example:

    I have two controllers: food and recipes

    Food is a tab

    But if you are in the recipes controller, I would still like to have the Food tab highlighted.

    is this possible? Sanjay

  5. Avatar Shiraz said 219 days later:

    Hi,

    In using this tool tip widget I encounter the following problem: how do I extend it so one doesn’t have to click on the tooltip icon but can get a tooltip by simply mousovering the icon?

Comments are disabled


SeeSaw srl - Via Monte Pasubio, 8 37126 Verona - tel +39 045 4857457 fax 045 4851151 P.Iva 03609790237