Source code of Leftypol imageboard
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

34 lines
815 B

/*
* auto-reload.js
* https://github.com/savetheinternet/Tinyboard-Tools/blob/master/js/auto-reload.js
*
* Brings AJAX to Tinyboard.
*
* Released under the MIT license
* Copyright (c) 2012 Michael Save <[email protected]>
*
* Usage:
* $config['additional_javascript'][] = 'js/jquery.min.js';
* $config['additional_javascript'][] = 'js/auto-reload.js';
*
*/
$(document).ready(function(){
if($('div.banner').length == 0)
return; // not index
setInterval(function() {
$.ajax({
url: document.location,
success: function(data) {
$(data).find('div.post.reply').each(function() {
var id = $(this).attr('id');
if($('#' + id).length == 0) {
$(this).insertAfter($('div.reply:last').next()).after('<br class="clear">');
}
});
}
});
}, 6000);
});