public
Description: Easily add progress indicators for rails
Homepage: http://code.google.com/p/indicator/
Clone URL: git://github.com/timcharper/indicator.git
name age message
file MIT-LICENSE Thu Aug 02 21:06:40 -0700 2007 first import git-svn-id: http://indicator.goog... [timcharper]
file README.textile Sat Nov 22 02:41:09 -0800 2008 updated documentation [timcharper]
file init.rb Mon Sep 29 22:37:35 -0700 2008 implemented "overlay" style. javascript functi... [timcharper]
directory lib/ Sat Nov 22 02:39:35 -0800 2008 remove to_dom_id [timcharper]
directory public/ Sat Nov 22 02:33:04 -0800 2008 by default, hide to indicate [timcharper]
README.textile

Progress Indicator Helpers v0.1

By Tim Harper (tim c harper at g mail dot com)

OVERVIEW

This plugin provides you with several helpful methods to quickly enable your ajax calls to have progress indicators.

USAGE

  <%= javascript_include_tag "prototype", "indicator" %>
  <%
  sqf = Sqf.find(:first)
  %>
  
  <div>
  <label>MLS #</label><%= text_field 'sqf', 'mls_number' %><br />
  <%= 
  observe_field("sqf_mls_number", 
    :indicate_and_update => dom_id(sql, "row"),
    :with => "mls_number",
    :url => "/sqfs/scan_data",
    :on => "blur"
    )%>
  </div>
  
  <div id="<%= dom_id(sql, "row") %>" class="overlay_to_indicate">
    Here's where the mls data will come back when you change the item above
  </div>
  <% end %>

MORE INFO

remote_function and friends

remote_function (and therefore link_to_remote, remote_form_for, etc.) is extended to support “indicate” and “indicate_and_update”

  observe_field("sqf_mls_number", 
    :indicate_ => dom_id(sql, "row"),
    :with => "mls_number",
    :url => "/sqfs/scan_data",
    :on => "blur"
    )

Target element classes:

If the target div has the class “overlay_to_indicate”, it will put a transluscent layer over the element with a spinner on the front. Additionally, it will disable every form field in the element (and reenable only the ones that were disabled when done).

Otherwise, the default behavior is to hide the element, and show it again when done.