1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2024-12-02 11:08:34 +01:00
vichan/js/update_boards.js

21 lines
505 B
JavaScript
Raw Normal View History

2014-10-07 03:01:01 +02:00
$(document).ready(function(){
window.boards = new Array();
function handle_boards(data) {
$.each(data, function(k, v) {
2014-10-29 07:22:13 +01:00
if (v.uri != 'meta' && v.uri != 'b') {
2014-12-14 12:28:19 +01:00
boards.push('<a href="/'+v.uri+(window.active_page === 'catalog' ? '/catalog.html' : '/index.html')+'">'+v.uri+'</a>');
2014-10-07 03:01:01 +02:00
}
})
if (boards[0]) {
$('.sub[data-description="2"]').after('<span class="sub" data-description="3"> [ '+boards.slice(0,15).join(" / ")+' ] </span>');
2014-10-07 03:01:01 +02:00
}
}
$.getJSON("/boards-top20.json", handle_boards)
2014-10-07 03:01:01 +02:00
});