-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathusers.js
More file actions
75 lines (65 loc) · 1.71 KB
/
Copy pathusers.js
File metadata and controls
75 lines (65 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
yc.oauth = {};
yc.oauth.weibo = function(){
this.login = function( callback){
thisb = this;
WB2.login( function(){
thisb.getUserInfo(function( o){
callback(o);
});
});
} ,
this.logout = function( callback){
WB2.logout( callback);
} ,
this.checkLogin = function( ){
return WB2.checkLogin();
} ,
this.getUserInfo = function( callback){
WB2.anyWhere(
function(W)
{
W.parseCMD("/account/get_uid.json", function(sResult, bStatus){
W.parseCMD("/users/show.json", function(sResult2, bStatus2){
callback( {id:sResult2.id , service:'weibo'}) ;
},{
uid : sResult.uid
},{
method: 'get'
});
},{
},{
method: 'get'
});
}
);
} ,
this.publish = function( string){
WB2.anyWhere(
function(W)
{
W.parseCMD("/statuses/update.json", function(sResult, bStatus){
},{
status : string
},{
method: 'POST'
});
}
);
}
}
function loginCallback(data){
icell_userInfo = data;
if(!icell_userInfo){
// $("#ui-levels-selector-login").append("<span id='login_error_msg' stype='color:red;'>login error</span>");
alert("login error");
return;
}
var username = icell_userInfo;
// $("#login_error_msg").remove();
// $("#ui-levels-selector-login").html("<h3>"+username+"</h3>");
// $("#ui-levels-selector-menu").stop(false,true).slideDown(600);
}
function unEncryptUserInfo(icell_userInfo){
var userInfo = icell_userInfo.split('#');
return {'uid':userInfo[0],'service':userInfo[1]};
}