pyrat / tooltips forked from adr1anx/tooltips

Helper for "prototip2" - javascript code for prototype framework, that simple alows create tooltips

This URL has Read+Write access

name age message
file MIT-LICENSE Wed Oct 15 08:34:05 -0700 2008 initial commit [cheef]
file README Loading commit data...
directory images/ Wed Oct 15 08:34:05 -0700 2008 initial commit [cheef]
file init.rb Wed Oct 15 08:34:05 -0700 2008 initial commit [cheef]
file install.rb Wed Oct 15 08:34:05 -0700 2008 initial commit [cheef]
directory javascripts/
directory lib/
directory spec/ Wed Oct 15 08:34:05 -0700 2008 initial commit [cheef]
directory stylesheets/ Wed Oct 15 08:34:05 -0700 2008 initial commit [cheef]
directory tasks/
file uninstall.rb Wed Oct 15 08:34:05 -0700 2008 initial commit [cheef]
README
tooltips
===============
Helper for "prototip2" - javascript code for prototype framework, that simple alows create tooltips

Warnings
===============
Original "prototip2" is shareware, please visit author page before using this plugin
http://www.nickstakenburg.com/projects/prototip2/

Features
===============
- we can simply create tooltips with helpers methods
- we can use HTML and javascripts in our tooltips

Installing
===============
1) rake tooltips:install
2) In the head of you layout past this code:
<% tooltips_include_tag do %>
  <%= yield(:tips) %>
<% end %>

Using
===============
User tooltip_tag method for creating a tip.
First param - dom id of object which will be with tip("my_id" in example).
Second param - hash with params for tip.
All valid params you can see on prototip2 author page => http://www.nickstakenburg.com/projects/prototip2/

<% tooltip_tag("my_id",                     
                    :hideAfter => 1,
                    :delay => 0.2,
                    :border => 1,
                    :radius => 1,
                    :effect => 'appear',
                    :hook => {:tip => 'topLeft', :target => 'topRight'},
                    :hideOn => {:element => 'tip', :event => 'mouseout'},
                    :offset => {:x => -21, :y => 0},
                    :className => 'default'                    
          ) do %>
  Some html and javascript code in our tip
<% end %>

Ajax 
===============
I put in a quick patch to allow an ajax call as well as a content call
<% tooltip_tag("my_id",                     
                    :ajax => { :options => {:method => 'get'}, :url => '/site/show' }
          ) %>
The ajax option is the same as on the authors page, so pass in whatever options.  Make sure you pass in the method of 
get, or it
will post and you'll get a auth token error.
-adrian

TODO
===============
- making rspec tests
- making tips by class

Prototip2 (c) Nick Stakenburg "http://www.nickstakenburg.com/projects/prototip2/"
this plugin (c) 2008 Ivan Garmatenko <cheef.che@gmail.com>, released under the MIT license,
modified by Adrian Titus <adrian@adrianx.net> to clean up deprecated functions, fix install
task, and add ajax patch.