jQuery Comments plugin

jQuery Plugn Macros

Load and display page comments with pagination. This plugin also initialies comment form for user to comment or reply other user's comment.

This plugin is integrated fully with standard Kademi coment and notification system so user can get notification on navbar when other user comment or reply on the page which user commented on.

Usage

  • Must be initialized on a div in Kademi page 
  • This div must contain a form
  • This form must contain a textbox or textarea for commenting
  • This form must contain a button for post comment or reply
 

Basic example

// User information. 'userName' and 'userUrl' are declared in jquery.user.js
var currentUser = {
    name: userName,
    href: userUrl,
    photoHref: "/profile/pic"
};

// This is for deferred logins, ie someone logs in after going to a page with comments
$('body').on('userLoggedIn', function (event, userUrl, userName) {
    currentUser.name = userName;
    currentUser.href = userUrl;
});

var comments = $("#comments");
if (comments.length > 0) {
    comments.comments({
        currentUser: currentUser,
        pageUrl: pageUrl
    });
}