Sha256: 82c7f1af146e578a2a58764e1d2fcd46d9d1aca48d33643da825e82438bcd2dc
Contents?: true
Size: 649 Bytes
Versions: 4
Compression:
Stored size: 649 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, callback) { element = $(element); var content = ""; if (Flash.data[name]) { message = Flash.data[name].toString().replace(/\+/g, ' '); element.html(message); if (callback && typeof(callback) === 'function') { callback(element); } else { element.show(); } } };
Version data entries
4 entries across 4 versions & 1 rubygems