-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontent.js
28 lines (25 loc) · 898 Bytes
/
content.js
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
(function main() {
function find_links() {
return $(".icon_topic_latest").parent('a').toArray().map(function (anchor) {
return {url: anchor.href, active: false};
})
}
function open_all_in_tabs(links) {
chrome.extension.sendRequest(links);
}
var links = find_links();
if (links.length > 0) {
$(".action-bar").append('<a class="open_all_in_tabs" href="#">Open all topics in tabs</a>');
$(".open_all_in_tabs").click(function (e) {
e.preventDefault();
open_all_in_tabs(links);
});
}
$("#page-footer").prepend($('#page-header .navbar').clone().find('#nav-breadcrumbs').remove().end())
$('.topiclist.topics .row').each(function (i, e) {
var $row = $(e);
var href = $row.find('.icon_topic_latest').parent('a').attr('href');
var $dl = $row.find('dl').remove();
$row.append($('<a>').attr('href', href).append($dl));
});
})();