-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpopup.js
More file actions
62 lines (59 loc) · 2.24 KB
/
Copy pathpopup.js
File metadata and controls
62 lines (59 loc) · 2.24 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
$(function ($) {
$.getJSON(config.server_url + '/user/topic', function (toipcs) {
$.each(toipcs, function (i, topic) {
var data = {
topic: topic,
active: function () {
if (i == 0) {
return 'active';
} else {
return '';
}
},
display: function() {
if(topic.numberOfNew > 0) {
return topic.name + " (" + topic.numberOfNew + ")";
} else {
return topic.name;
}
}
};
var navTopicItem = ich.navTopicItem(data);
$('.topic-nav').append(navTopicItem);
var topicItem = ich.topicItem(data);
$('.topic-content').append(topicItem);
});
$('.topic-nav a').click(function (e) {
e.preventDefault();
$(this).tab('show');
var topicName = $(this).attr('data');
$.getJSON(config.server_url + '/topic/' + topicName + "?l=5", function (links) {
$('.link-item-list').empty();
$.each(links, function (i, link) {
var data = {
'link': link,
'unread': function() {
if(!link.read) {
return 'unread';
} else {
return '';
}
},
'featureImage': function() {
if(link.featureImage != null) {
return config.server_url + link.featureImage;
} else {
return config.server_url + "/assets/img/blank.gif";
}
}
};
var linkItem = ich.linkItem(data);
$('.link-item-list').append(linkItem);
})
});
});
$('.topic-nav a:first').click();
$('#login-message').hide();
$('.topic-container').show();
});
});