Sha256: 213edcf80fa7fd0ed99f4d65226345c208a917a662366a79ef2b752384e0bf51

Contents?: true

Size: 559 Bytes

Versions: 6

Compression:

Stored size: 559 Bytes

Contents

// refactoring from https://github.com/leonid-shevtsov/cacheable-flash-jquery
var Flash = new Object();

Flash.data = {};

Flash.transferFromCookies = function() {
  var data = JSON.parse(unescape($.cookie("flash")));
  if(!data) data = {};
  Flash.data = data;
  $.cookie('flash',null, {path: '/'});
};

Flash.writeDataTo = function(name, element) {
  element = $(element);
  var content = "";
  if (Flash.data[name]) {
    message = Flash.data[name].toString().replace(/\+/g, ' ');
    element.html(message);
    element.show();
  }
};

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
cacheable_flash-0.2.9 vendor/assets/javascripts/flash.js
cacheable_flash-0.2.8 vendor/assets/javascripts/flash.js
cacheable_flash-0.2.7 vendor/assets/javascripts/flash.js
cacheable_flash-0.2.5 vendor/assets/javascripts/flash.js
cacheable_flash-0.2.4 vendor/assets/javascripts/flash.js
cacheable_flash-0.2.3 vendor/assets/javascripts/flash.js