-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.html
74 lines (72 loc) · 1.5 KB
/
test.html
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
<html>
<head>
<meta charset="utf-8"/>
<script type="text/javascript" src="./js/account.js"></script>
<script type="text/javascript" src="./js/moment.min.js"></script>
<script type="text/javascript" src="./js/events.js"></script>
</head>
<body>
test
</body>
</html>
<script>
// test
var account = new Account();
/*
account.isLogin(function(name){
if(name==""){
console.log("Not yet login");
}
else{
console.log(name+" already login");
}
// login
var name = "jorden";
var password = "password";
account.login(name, password, afterLogin);
});
*/
afterLogin(1);
function afterLogin(fg){ // do something afterLogin
if(fg==-2){
console.log("Name cannot found");
}
else if(fg==-1){
console.log("Wrong password");
}
else if(fg==1){
console.log("Login success");
// load event
events = new Events();
events.load(function(){ //after
console.log(events);
//console.log(events.arr[0]);
var testent = events.arr[0];
//testent.remove(function(){});
/*
testent.obj.title = "change title";
console.log(testent);
testent.save(function(){});
/*
var testEvent = events.arr[0];
testEvent.obj.title = "yoyoyo";
testEvent.save();
console.log(events.arr[0]);
*/
});
}
/*
//logout
account.logout(function(){ // after logout
// check again
account.isLogin(function(name){
if(name===""){
console.log("success logout");
}
else{
console.log("still login");
}
});
});*/
}
</script>