Fix safari bug setting not loaded

This commit is contained in:
Buu Nguyen 2014-11-20 19:55:12 -08:00
parent edbcbc31c7
commit 2e8ae69f04
5 changed files with 6 additions and 14 deletions

BIN
dist/chrome.crx vendored

Binary file not shown.

BIN
dist/chrome.zip vendored

Binary file not shown.

BIN
dist/firefox.xpi vendored

Binary file not shown.

BIN
dist/opera.nex vendored

Binary file not shown.

View File

@ -1,26 +1,18 @@
function Storage() {}
Storage.prototype.set = function(key, val, local, cb) {
if (typeof local === 'function') {
cb = local
local = false
}
cb = cb || function() {}
if (typeof local === 'function') cb = local
localStorage.setItem(key, JSON.stringify(val))
cb()
if (cb) cb()
}
Storage.prototype.get = function(key, local, cb) {
if (typeof local === 'function') {
cb = local
local = false
}
if (typeof local === 'function') cb = local
cb = cb || function() {}
cb(parse(localStorage.getItem(key)))
var val = parse(localStorage.getItem(key))
if (cb) cb(val)
else return val
function parse(val) {
try {