[Pkg-owncloud-commits] [owncloud] 261/394: use jQuery.parseJSON fallback for IE6/7/8
David Prévot
taffit at alioth.debian.org
Fri Nov 8 23:12:21 UTC 2013
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to annotated tag v4.5.10
in repository owncloud.
commit ac98ac34ea07fb0482743944897099d57e8be018
Author: Jörn Friedrich Dreyer <jfd at butonic.de>
Date: Wed Jan 2 17:11:39 2013 +0100
use jQuery.parseJSON fallback for IE6/7/8
---
core/js/js.js | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/core/js/js.js b/core/js/js.js
index de24995..e3590c1 100644
--- a/core/js/js.js
+++ b/core/js/js.js
@@ -306,8 +306,15 @@ if(typeof localStorage !=='undefined' && localStorage !== null){
return localStorage.setItem(OC.localStorage.namespace+name,JSON.stringify(item));
},
getItem:function(name){
- if(localStorage.getItem(OC.localStorage.namespace+name)===null){return null;}
- return JSON.parse(localStorage.getItem(OC.localStorage.namespace+name));
+ var item = localStorage.getItem(OC.localStorage.namespace+name);
+ if(item===null){
+ return null;
+ } else if (typeof JSON === 'undefined') {
+ //fallback to jquery for IE6/7/8
+ return $.parseJSON(item);
+ } else {
+ return JSON.parse(item);
+ }
}
};
}else{
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list