<commit_before># Glow

Glowing flashes! Okay... not really. This simply adds handling of the
Fash Hash in Javascript. Depends on jQuery.

## Usage

Any flash messages set in ajax responses fire a `glow:flash`
event on `document`.

    flash[:notice] = 'Ajax man!'
    respond_to do |format|
      format.js { head :ok }
    end

Handle it any way you want:

    $(document).bind('glow:flash', function(evt, flash) {
      alert(flash.type);
      alert(flash.message);
    }

Also adds a `Flash` object that enables you to fire `glow:flash`.

    Flash.success('Yeah this worked!');
    Flash.error('Something went wrong!');
    Flash.notice('This is a flash message');

    Flash.fire('type', 'message');

This can be used to unify your Flash message handling (also in non-xhr
responses).

  <% flash.each |type, message| %>
    <%= javascript_tag "Flash.fire('#{type}', '#{message}')" %>
  <% end %>

## Installation

In your gemfile add

    gem "glow"

.

### Rails 3.0

Run

    rails generate glow:install

Then add

    javascipt_include_tag 'glow'
<commit_msg>Updates readme.<commit_after># Glow

Glowing flashes! Okay... not really. This simply adds handling of the
Fash Hash in Javascript. Depends on jQuery.

## Usage

Any flash messages set in ajax responses fire a `glow:flash`
event on `document`.

    flash[:notice] = 'Ajax man!'
    respond_to do |format|
      format.js { head :ok }
    end

Handle it any way you want:

    $(document).bind('glow:flash', function(evt, flash) {
      alert(flash.type);
      alert(flash.message);
    }

Also adds a `Flash` object that enables you to fire `glow:flash`.

    Flash.success('Yeah this worked!');
    Flash.error('Something went wrong!');
    Flash.notice('This is a flash message');

    Flash.fire('type', 'message');

This can be used to unify your Flash message handling (also in non-xhr
responses).

    <% flash.each |type, message| %>
      <%= javascript_tag "Flash.fire('#{type}', '#{message}')" %>
    <% end %>

## Installation

In your gemfile add

    gem "glow"

.

### Rails 3.0

Run

    rails generate glow:install

Then add

    javascipt_include_tag 'glow'

{'fraction_non_alphanumeric': 0.13013059701492538, 'fraction_numerical': 0.0018656716417910447, 'mean_word_length': 3.2475247524752477, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1478866', 'n_tokens_mistral': 726, 'n_tokens_neox': 675, 'n_words': 235}