-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpopup.html
67 lines (62 loc) · 1.8 KB
/
popup.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>白饭</title>
<link href='http://fonts.googleapis.com/css?family=Inconsolata' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="style.css" />
<script src='js/util.js'></script>
</head>
<body>
<header>
<h1>白饭</h1>
<nav id="J_nav"></nav>
<p id="global_msg">白白胖胖爱吃饭</p>
</header>
<script type="text/javascript" charset="utf-8">
var config = {
defaultOrder : 0,
username : localStorage['username'],
password : localStorage['password'],
API : 'http://api2.fanfou.com/',
isType : null,
sid : null,
timer : 2, //定时获取新消息,单位分钟唷
typeArr : ['home', 'replies', 'messages', 'favorites'],
pageArr : [2,2,2,2]
};
config.urlArr = [
config.API +'statuses/friends_timeline.json?format=html',
config.API +'statuses/replies.json?format=html',
config.API +'statuses/direct_messages.json?format=html',
config.API +'statuses/favorites.json?format=html'
];
//get default msg
window.onload = function(){
verify(); //验证登陆
createNav(); //创建导航栏
switchTimeline(); //获取默认消息列表
// showStatusForm();
keybind(); //绑顶快捷键
getNewTimeline();
document.onclick = function(e){
e.stopPropagation();
var el = e.target;
if (el.getAttribute('class') == 'reply') {
var li = el.parentNode.parentNode.parentNode;
reply_id = li.getAttribute('data-id'),
auth = li.getAttribute('data-user');
msg = '@'+auth+' ';
// msg = '@'+auth+' '+li.getElementsByClassName('msg')[0].innerHTML;
showStatusForm(reply_id, msg);
}else if(el.getAttribute('class')== 'former') {
var uid = el.href.replace(/http:\/\/fanfou.com\//g,'');
console.log(uid);
var _url = config.API+'statuses/user_timeline.json?id='+uid;
sendReq({url:_url});
}
}
}
</script>
</body>
</html>