Sha256: 508fc37de690b5cbb1b2dab64521cbd93ac04daf20e2e0ce0812325c8788295e

Contents?: true

Size: 818 Bytes

Versions: 15

Compression:

Stored size: 818 Bytes

Contents

// Generated by CoffeeScript 1.3.3
(function() {

  window.Glow = {
    flash: function(type, message) {
      return $(document).trigger('glow:flash', {
        type: type,
        message: message
      });
    }
  };

  $(document).ajaxComplete(function(evt, xhr, options) {
    var message, type;
    type = xhr.getResponseHeader('X-Message-Type');
    message = xhr.getResponseHeader('X-Message');
    if (type && message) {
      return Glow.flash(type, $('<div/>').html(message).text());
    }
  });

  window.Flash = {
    fire: Glow.flash,
    success: function(message) {
      return Glow.flash('success', message);
    },
    notice: function(message) {
      return Glow.flash('notice', message);
    },
    error: function(message) {
      return Glow.flash('error', message);
    }
  };

}).call(this);

Version data entries

15 entries across 6 versions & 1 rubygems

Version Path
glow-0.0.16 vendor/assets/javascripts/glow.js
glow-0.0.16 spec/dummy/public/javascripts/glow.js
glow-0.0.16 spec/dummy/app/assets/javascripts/glow.js
glow-0.0.15 spec/dummy/app/assets/javascripts/glow.js
glow-0.0.15 vendor/assets/javascripts/glow.js
glow-0.0.15 spec/dummy/public/javascripts/glow.js
glow-0.0.14 spec/dummy/public/javascripts/glow.js
glow-0.0.14 spec/dummy/app/assets/javascripts/glow.js
glow-0.0.14 vendor/assets/javascripts/glow.js
glow-0.0.13 vendor/assets/javascripts/glow.js
glow-0.0.13 test/rails3/public/javascripts/glow.js
glow-0.0.12 vendor/assets/javascripts/glow.js
glow-0.0.12 test/rails3/public/javascripts/glow.js
glow-0.0.11 test/rails3/public/javascripts/glow.js
glow-0.0.11 vendor/assets/javascripts/glow.js