// Make sure request.params.BlogID has a value
if ( !StructKeyExists(request.params,"blogID") )
request.params.blogID = 0;
// get this blogs data
blogData = application.ptBlog2.blogDAO.getBlog(request.params.blogID);
// get the configuration for the blog application
blogConfig = application.ptBlog2.getAppConfig();
blogPostFormID = application.ptBlog2.getPostFormID();
application.ptBlog2.renderBlogStyles();
//Server.CommonSpot.UDF.Resources.loadUnregisteredResource("/ADF/apps/pt_blog/style/main.css","stylesheet","head","tertiary");
application.ptBlog2.scripts.loadjQuery(noConflict=1);
// TODO: Set a global application variable for the UI theme
application.ptBlog2.scripts.loadjQueryUI();
application.ptBlog2.scripts.loadADFLightbox();
jQuery(document).ready( function(jQuery){
jQuery("##add_post").hover(
function(){
jQuery(this).addClass("ui-state-hover");
},
function(){
jQuery(this).removeClass("ui-state-hover");
}
)
// Loop over all the 'ui-icon-plus' class divs
// and add the openComments on the onclick
jQuery('span.ui-icon-plus').each(function(){
jQuery(this).click(function(){
openComments(jQuery(this));
jQuery(this).unbind('click');
});
});
});
function openComments(spanObj){
var postUUID = jQuery(spanObj).parent().attr('id');
var rowObj = jQuery(spanObj).closest('tr');
// Remove ANY OPEN comment row
jQuery('span.ui-icon-minus').each(function(){
closeComments(jQuery(this));
});
// Get the comment data for the post
jQuery.post("#application.ADF.ajaxProxy#",
{ bean: "commentsService",
method: "getDashboardData",
postID: postUUID
},
function( response ){
jQuery(rowObj).after(response);
// Then show the comments to expand slowly
jQuery('tr.commentRow-'+postUUID+' div.commentBlock').slideDown('slow');
// Init the LB for the edit link
initADFLB();
// Change the comments expand/collapse icon
jQuery(spanObj).removeClass('ui-icon-plus');
jQuery(spanObj).addClass('ui-icon-minus');
// Add the collapse action to the link
jQuery(spanObj).unbind();
jQuery(spanObj).bind('click', function() {
closeComments(spanObj);
//jQuery(spanObj).unbind('click');
})
}
);
}
function closeComments(spanObj){
var postUUID = jQuery(spanObj).parent().attr('id');
jQuery('tr.commentRow-'+postUUID+' div.commentBlock').slideUp('slow', function() {
jQuery('tr.commentRow-'+postUUID).remove();
});
// Change the comments expand/collapse icon
jQuery(spanObj).removeClass('ui-icon-minus');
jQuery(spanObj).addClass('ui-icon-plus');
// Add the collapse action to the link
jQuery(spanObj).unbind();
jQuery(spanObj).bind('click', function() {
openComments(spanObj);
jQuery(spanObj).unbind('click');
})
}
// Load the inline JS as a JS Resource
application.ADF.scripts.addFooterJS(blogAppBlogDashboardFooterJS, "SECONDARY"); // PRIMARY, SECONDARY, TERTIARY