Mercurial > bugzilla-dashboard
view js/cache.js @ 61:0e50d4f77a77
widened input fields
author | Atul Varma <avarma@mozilla.com> |
---|---|
date | Sun, 25 Apr 2010 07:59:33 -0700 |
parents | b2e0ea0178fb |
children |
line wrap: on
line source
// Really simple JSON cache that uses a form field as // a back-end. function buildCache(selector) { var data = {}; var json = $(selector).val(); if (json.length) data = JSON.parse(json); return { set: function set(key, value) { data[key] = value; $(selector).val(JSON.stringify(data)); }, get: function get(key) { return data[key]; } }; }