Skip to content

Commit

Permalink
Merge branch 'master' of github.com:carr/wrt_bastard
Browse files Browse the repository at this point in the history
  • Loading branch information
carr committed Nov 6, 2010
2 parents 9f9a03e + 4035005 commit 8fae396
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions javascripts/cache.js
Expand Up @@ -33,7 +33,7 @@ var Cache = {
},

set : function(key, data, options) {
var object = JSON.stringify( {
var object = JSON.stringify({
time : (new Date()).getTime(),
value : data
})
Expand All @@ -46,7 +46,14 @@ var Cache = {
},

clear : function(key) {
delete Cache.nonPersistent[key]
window.widget.setPreferenceForKey(null, key)
if (typeof (key) == 'string') {
delete Cache.nonPersistent[key]
window.widget.setPreferenceForKey(null, key)
} else {
for ( var i = 0; i < key.length; i++) {
delete Cache.nonPersistent[key[i]]
window.widget.setPreferenceForKey(null, key[i])
}
}
}
}

0 comments on commit 8fae396

Please sign in to comment.