<p> function collapse() {
$(".thread-body").hide();
}
function no_reply(display) {
if (display === 'hide') {
$('#no-reply-link').attr('href', "javascript: no_reply('show')");
$('#no-reply-link').html("show all threads");
$(".thread:not(.no-reply)").hide();
} else {
$('#no-reply-link').attr('href', "javascript: no_reply('hide')");
$('#no-reply-link').html("show threads with no comments");
$(".thread:not(.no-reply)").show();
}
}
function review_flag(display) {
if (display === 'show') {
$('#review-flag-link').attr('href', "javascript: review_flag('hide')");
$('#review-flag-link').html("hide review flag threads");
$(".flag-thread").show();
} else {
$('#review-flag-link').attr('href', "javascript: review_flag('show')");
$('#review-flag-link').html("show review flag threads");
$(".flag-thread").hide();
}
}
$(function() {
$.blockUI.defaults.overlayCSS.opacity = 0;
$.blockUI.defaults.css = {
padding: 0,
margin: 0,
width: '30%',
top: '40%',
left: '35%',
textAlign: 'center',
color: '#000',
border: 0,
backgroundColor:'transparent',
cursor: 'wait'
};
$.blockUI.defaults.message = $("#loading");
$(".thread-header").live("click", function() {
if ($(this).data('loaded') !== 1) {
var dash_id = $(this).attr('id').split('~')[0];
var id = dash_id.split('-').join('/');
$.blockUI();
$.ajax({'url':'/controller/posts',
'data':{"id":id},
'dataType':'json',
'success':function(data) {
$("#" + dash_id + "_thread-posts").append(data.result.html);
}});
$(this).data('loaded', 1);
$.unblockUI();
}
$(this).next().toggle();
return false;
}).next().hide();
$('#more-form').submit(function() {
$.blockUI();
$(this).ajaxSubmit({'dataType':'json',
'type':'GET',
'success':function(json) {
$('#threads').append(json.result.html);
$.unblockUI();
}});
return false;
});
});
</p>