[jopensocial commit] r34 - trunk/src

0 views
Skip to first unread message

codesite...@google.com

unread,
Jan 28, 2009, 5:07:38 AM1/28/09
to jopen...@googlegroups.com
Author: kot...@zerobase.jp
Date: Wed Jan 28 00:56:51 2009
New Revision: 34

Modified:
trunk/src/jopensocial.js

Log:
fetchAppData ArrayKey support / updateAppdata escape json data

Modified: trunk/src/jopensocial.js
==============================================================================
--- trunk/src/jopensocial.js (original)
+++ trunk/src/jopensocial.js Wed Jan 28 00:56:51 2009
@@ -300,7 +300,7 @@
return;
}
var data = res.userData[id]||{};
- var val = key=="*"?{}:data[key];
//container.mixi?res.userData[key]:res.userData[id][key];
+ var val = (key=="*" || key instanceof Array)?{}:data[key];
//container.mixi?res.userData[key]:res.userData[id][key];
function _decode(v) {
var r;
try {
@@ -311,7 +311,7 @@
return r;
}
_cachedData[id] = _cachedData[id] || {};
- if(key=="*") {
+ if(key=="*" || key instanceof Array) {
$.each(data,function(k){
val[k] = _decode(this);
_cachedData[id][k] = val[k];
@@ -346,7 +346,7 @@
if(id&&_cachedData[id]&&_cachedData[id][key]) _cachedData[id][key] =
value;
var obj = {
userData : function() {
- return
this.newUpdatePersonAppDataRequest(opensocial.IdSpec.PersonId.VIEWER, key,
gadgets.json.stringify(value));
+ return
this.newUpdatePersonAppDataRequest(opensocial.IdSpec.PersonId.VIEWER, key,
encodeURIComponent(gadgets.json.stringify(value)));
}
};
_request(obj, function(res) {

Reply all
Reply to author
Forward
0 new messages