At first it did not show ajaxthreads.php at all in firebug, but after hard refreshing it appeared.
Here are the parameters:
response headers:
Code:
Accept-RangesbytesCache-Controlmax-age=604800Content-EncodinggzipContent-Length3479Content-Typeapplication/javascriptDateWed, 11 Jul 2012 00:19:24 GMTEtag"2c20-4ffb6c85-0"ExpiresWed, 18 Jul 2012 00:19:24 GMTLast-ModifiedMon, 09 Jul 2012 23:43:01 GMTServerLiteSpeedVaryUser-Agent
Response:
Code:
$.noConflict(true)(function($) { // Define some variables var jObjects = { box : $('#ajaxprogress'), progressTitle : $('#progresstitle'), progressContent : $('#progresscontent'), postList : $('#posts'), statusText : $('span[name=dbtech_ajaxthreads_status]'), idleText : $('span[name=dbtech_ajaxthreads_idle]'), reloadLink : $('a[name=dbtech_ajaxthreads_reload]'), unIdleLink : $('a[name=dbtech_ajaxthreads_unidle]'), }, idleTime = 0, refreshTimer = null, lastUpdate = 0, pauseUpdates = false; if (ajaxThreadsOptions.autoUnidle && ajaxThreadsOptions.autoUpdate != 0) { jObjects.postList.hover(function() { // Reset timer and restart function //console.log('Resetting timer...'); resetTimer(); }); } if (ajaxThreadsOptions.manualUpdate != 0) { // Get new posts on click of reload jObjects.reloadLink.on('click', getNewPosts); } // Get new posts on click of reload jObjects.unIdleLink.on('click', function() { // Reset the timer resetTimer(); // Do an instant refresh _refreshPosts(); }); if (typeof ajax_last_post == 'undefined') { // Ensure this is set var tmp = new Date; ajax_last_post = parseInt(tmp.getTime() / 1000); console.log('ajax_last_post = ' + ajax_last_post); } else { var qrAjaxPost = qr_ajax_post, qrDoAjaxPost = qr_do_ajax_post; // ######################################################################### // We be tukken vB's AJAX QR function qr_ajax_post = function(submitaction, submitstring) { // So we can see if it's working console.log('Pausing AJAX Threads...'); // Schedule paused updates pauseUpdates = true; // Call the old backed up function qrAjaxPost(submitaction, submitstring); }; // ######################################################################### // We be tukken vB's AJAX QR Complete function qr_do_ajax_post = function(ajax) { // Call the old backed up function qrDoAjaxPost(ajax); // So we can see if it's working console.log('Un-pausing AJAX Threads...'); // Schedule paused updates pauseUpdates = false; // Un-idle us resetTimer(); }; } // ######################################################################### // Refreshes all the posts function getNewPosts() { if (pauseUpdates) { console.log('Updates paused, skipping...'); return false; } // Schedule paused updates pauseUpdates = true; var tmp = new Date; timeNow = parseInt(tmp.getTime() / 1000); if ((lastUpdate + parseInt(ajaxThreadsOptions.refreshDelay)) > timeNow) { console.log((lastUpdate + parseInt(ajaxThreadsOptions.refreshDelay)) + ' is greater than ' + timeNow); return false; } // Set last update lastUpdate = (timeNow - 1); // Set the animation _animateBox( vbphrase['dbtech_ajaxthreads_refreshing_thread'], vbphrase['dbtech_ajaxthreads_refreshing_thread_descr'], true ); var extraParams = { 'securitytoken' : SECURITYTOKEN, 'do' : 'ajax', 'action' : 'newposts', 't' : ajaxThreadsOptions.threadId, 'postids' : ajaxThreadsPostIds, 'postvisible' : ajaxThreadsPostVisible, 'lastpostdate' : ajax_last_post, }; var type = 'POST'; var jqxhr = $.ajax({ type: type, url: 'ajaxthreads.php', data: (SESSIONURL ? SESSIONURL + '&' : '') + $.param(extraParams), dataType: 'json' }) .done(function(data) { // Schedule paused updates pauseUpdates = false; if (typeof data == 'string') { try { // Parse the data data = $.parseJSON(data); } catch (e) { var errmsg = data; data = {'error' : errmsg + "\n\n" + data}; } } if (data.error) { // Animate box _animateBox( vbphrase['error'], data.error, true ); return false; } // Animate box _animateBox(false, false, false); if (data.deletedPosts) { $.each(data.deletedPosts, function(index, value) { if (ajaxThreadsOptions.vbversion == 3) { var postWrapper = $('#post' + index); } else { var postWrapper = $('#post_' + index); } // Remove from post counter ajaxThreadsOptions.postCount--; //var postWrapper = $('#dbtech_ajaxthreads_postid_' + index) // Fade the post out postWrapper.fadeOut(function() { // Remove the post in question $(this).remove(); $('#dbtech_thanks_entries_' + index).parent().remove(); }); }); } if (data.editedPosts) { $.each(data.editedPosts, function(index, value) { // Refresh the postbit _displayPost(index); }); } if (data.newPosts) { if (!$.isEmptyObject(data.newPosts)) { // Set last post for QR var tmp = new Date; ajax_last_post = parseInt(tmp.getTime() / 1000); console.log('ajax_last_post = ' + ajax_last_post); } $.each(data.newPosts, function(index, value) { if (ajaxThreadsOptions.vbversion == 3) { var postWrapper = $('#post' + index); } else { var postWrapper = $('#post_' + index); } // Add to post counter ajaxThreadsOptions.postCount++; if (postWrapper.length) { // Quick reply post return true; } if (ajaxThreadsOptions.direction == 'desc') { // stuff new fake postbit at the end jObjects.postList.append(value); } else { // stuff new fake postbit at the beginning jObjects.postList.prepend(value); } if (ajaxThreadsOptions.vbversion == 3) { var postWrapper = $('#post' + index); } else { var postWrapper = $('#post_' + index); } //var postWrapper = $('#dbtech_ajaxthreads_postid_' + index) if (ajaxThreadsOptions.vbversion == 3) { // Remove old lastpost $('#lastpost').remove(); // Create new last post node var newLastPost = string_to_node('<div id="lastpost"></div>'); if (ajaxThreadsOptions.direction == 'desc') { // stuff new fake postbit at the end jObjects.postList.append(newLastPost); } else { // stuff new fake postbit at the beginning jObjects.postList.prepend(newLastPost); } } // Hide the new post postWrapper.hide(); // Remove the post in question _displayPost(index); }); } if (data.postIds) { // Store the new post hashes ajaxThreadsPostIds = data.postIds; } if (data.postVisible) { // Store the new post hashes ajaxThreadsPostVisible = data.postVisible; } }); }; // ######################################################################### // Resets the timer function resetTimer() { // Reset idle time idleTime = 0; if (refreshTimer == null) { // Show status, hide idle jObjects.statusText.show(); jObjects.idleText.hide(); // Restart the timer _startTimer(); } }; // ######################################################################### // Refreshes a post display function _displayPost(postid) { var postCount = $('#postcount' + postid).attr('name'); var extraParams = { 'securitytoken' : SECURITYTOKEN, 'p' : postid, 'postcount' : (typeof postCount != 'undefined' ? parseInt(postCount) : ajaxThreadsOptions.postCount) }; var type = 'POST'; var jqxhr = $.ajax({ type: type, url: 'showpost.php', data: (SESSIONURL ? SESSIONURL + '&' : '') + $.param(extraParams) }) .done(function(data) { var postbit = $('postbit', data).text(), postText = $('#post_message_' + postid); if (ajaxThreadsOptions.vbversion == 3) { var postWrapper = $('#post' + postid); //var postWrapper2 = YAHOO.util.Dom.get('post' + postid); } else { var postWrapper = $('#post_' + postid); //var postWrapper2 = YAHOO.util.Dom.get('post_' + postid); } //var postWrapper = $('#dbtech_ajaxthreads_postid_' + index) if (postbit) { var newpostbit = string_to_node(postbit); if (postWrapper.is(':hidden')) { // Replace post //postWrapper2.parentNode.replaceChild(newpostbit, postWrapper2); postWrapper.replaceWith(newpostbit); // Init the postbit PostBit_Init(newpostbit, postid); if (ajaxThreadsOptions.vbversion == 3) { // Re-grab this var postWrapper = $('#post' + postid); } else { // Re-grab this var postWrapper = $('#post_' + postid); } if (ajaxThreadsOptions.vbversion > 3) { // Initialise collapse objects var links = YAHOO.util.Dom.getElementsByClassName("collapse", "a", newpostbit); for (var i = 0; i < links.length; i++) { new vBCollapse(links[i], vBCollapseFactory); } //-ch note: this replaces setting display:none property server-side apply_collapses(); } // Ensure the post is shown postWrapper.hide(); postWrapper.fadeIn(); //postWrapper.scrollIntoView(false); } else { // Fade out old post postText.fadeOut(function() { // Replace post //postWrapper2.parentNode.replaceChild(newpostbit, postWrapper2); postWrapper.replaceWith(newpostbit); // Init the postbit PostBit_Init(newpostbit, postid); // Store post text reference var postText = $('#post_message_' + postid); // Fade in the new post postText.hide(); postText.fadeIn(); }); } } }); return false; }; // ######################################################################### // Starts the timer function _startTimer() { if (ajaxThreadsOptions.autoUpdate == 0) { // We cannot proceed return false; } // Set the refresh timer refreshTimer = setInterval(_refreshPosts, (ajaxThreadsOptions.refreshDelay * 1000)); }; // ######################################################################### // Refreshes the post according to idle time function _refreshPosts() { if (idleTime >= ajaxThreadsOptions.duration && ajaxThreadsOptions.duration > 0) { // Get rid of the interval clearInterval(refreshTimer); refreshTimer = null; // Display idle message jObjects.statusText.hide(); jObjects.idleText.show(); return false; } // Update idle time idleTime += parseInt(ajaxThreadsOptions.refreshDelay); // Refresh the posts getNewPosts(); }; // ######################################################################### // Handle box animation function _animateBox(title, description, onoff) { if (onoff) { // Set CSS properties jObjects.box.css('display', 'inline-block'); jObjects.box.css('opacity', 0); } if (title) { // Set title jObjects.progressTitle.html(title); } if (description) { // Set description jObjects.progressContent.html(description); } // Set animation jObjects.box.animate({ opacity: (onoff ? 0.8 : 0) }, { duration: 700 }); }; // Begin the timer _startTimer(); });
There are no javascript errors in the error console.