-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontent.html
More file actions
89 lines (87 loc) · 2.48 KB
/
content.html
File metadata and controls
89 lines (87 loc) · 2.48 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<!doctype html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="markdown.css" />
<link rel="stylesheet" type="text/css" href="jquery.mobile-1.0b3\jquery.mobile-1.0b3.min.css" />
<script src="jquery.js"></script>
<script src="jquery.mobile-1.0b3\jquery.mobile-1.0b3.min.js"></script>
<script src="markdown.js"></script>
<style>
html {
margin: 0; padding: 0;
height:100%;
}
.loading {
background: url(loading.gif) no-repeat 50% 50%;
text-align: center;
}
#message-list {
float: left;
width: 400px;
height:100%;
overflow-y: scroll;
}
#message-list .ui-listview-filter {
margin:0px;
}
</style>
<script>
$(function() {
var bkg = chrome.extension.getBackgroundPage();
$('a').live('click', function(){
var url = $(this).attr('href');
bkg.goTo(url);
window.close();
});
bkg.getMessages(function(messages) {
var list = $('#message-list ul');
var lastDate = null;
$.each(messages, function() {
var message = this;
var contentWrapper = $('<div />').addClass('content');
var messageElement;
if(this.date != lastDate) {
list.append('<li data-role="list-divider">'+this.date+'</li>');
lastDate = this.date;
}
messageElement = $('<li />')
.addClass('message')
.attr('data-theme', message.read ? 'c' : 'e')
.append(
$('<a />').attr('href', this.getURL()).text(this.title).append(
/*$('<span />')
.addClass('toggle')
.text('load')
.one('click', function() {
message.loadContent(function(content) {
console.log(message);
content.forEach(function(c) {
$('<section />').addClass('markdown')
.html(markdown.toHTML(c))
.appendTo(contentWrapper);
});
});
$(this).remove();
messageElement.append(contentWrapper).append($('<footer />').text(message.date));
}),*/
'<p class="ui-li-aside" style="width:auto"><strong>' + this.from.name + '</strong></p>'
)
).appendTo(list);
});
$(list).listview('refresh');
});
});
</script>
</head>
<body>
<span id="count"></span>
<div id="message-list" class="content">
<ul data-role="listview" data-filter="true" data-filter-theme="b">
</ul>
</div>
<div id="message-view">
Test
<div>
</div>
</body>
</html>