Index: lams_central/conf/language/lams/ApplicationResources.properties =================================================================== RCS file: /usr/local/cvsroot/lams_central/conf/language/lams/ApplicationResources.properties,v diff -u -r1.155 -r1.156 --- lams_central/conf/language/lams/ApplicationResources.properties 15 Dec 2015 10:19:59 -0000 1.155 +++ lams_central/conf/language/lams/ApplicationResources.properties 16 Dec 2015 11:15:22 -0000 1.156 @@ -671,7 +671,7 @@ label.showhide.prompt =Show/Hide Replies message.complete.or.cancel.reply =Please complete or cancel the current reply before starting a new reply. message.complete.or.cancel.edit =Please complete or cancel the current edit before starting a new edit. -label.show.more.messages =More posts +label.show.more.messages =More Comments label.likes=Likes label.comment.body.validation=The comment must be between 1 and 5000 characters long. label.edited=Edited Index: lams_central/conf/language/lams/ApplicationResources_en_AU.properties =================================================================== RCS file: /usr/local/cvsroot/lams_central/conf/language/lams/ApplicationResources_en_AU.properties,v diff -u -r1.121 -r1.122 --- lams_central/conf/language/lams/ApplicationResources_en_AU.properties 15 Dec 2015 10:19:59 -0000 1.121 +++ lams_central/conf/language/lams/ApplicationResources_en_AU.properties 16 Dec 2015 11:15:22 -0000 1.122 @@ -661,7 +661,7 @@ label.showhide.prompt =Show/Hide Replies message.complete.or.cancel.reply =Please complete or cancel the current reply before starting a new reply. message.complete.or.cancel.edit =Please complete or cancel the current edit before starting a new edit. -label.show.more.messages =More posts +label.show.more.messages =More Comments label.likes=Likes label.comment.body.validation=The comment must be between 1 and 5000 characters long. label.edited=Edited Index: lams_central/web/WEB-INF/tags/Comments.tag =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/WEB-INF/tags/Comments.tag,v diff -u -r1.1 -r1.2 --- lams_central/web/WEB-INF/tags/Comments.tag 15 Dec 2015 10:20:53 -0000 1.1 +++ lams_central/web/WEB-INF/tags/Comments.tag 16 Dec 2015 11:15:22 -0000 1.2 @@ -25,7 +25,7 @@ \ No newline at end of file Index: lams_central/web/comments/comments.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/comments/comments.jsp,v diff -u -r1.2 -r1.3 --- lams_central/web/comments/comments.jsp 16 Dec 2015 05:53:52 -0000 1.2 +++ lams_central/web/comments/comments.jsp 16 Dec 2015 11:15:22 -0000 1.3 @@ -43,8 +43,7 @@ }); function scrollDoneCallback() { - resizeIframe(); - + resizeIframe(); } @@ -69,7 +68,7 @@ Index: lams_central/web/comments/new.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/comments/new.jsp,v diff -u -r1.1 -r1.2 --- lams_central/web/comments/new.jsp 15 Dec 2015 10:20:53 -0000 1.1 +++ lams_central/web/comments/new.jsp 16 Dec 2015 11:15:22 -0000 1.2 @@ -43,9 +43,9 @@ var loadString = '' + response.sessionMapID + "&threadUid=" + threadUid+"&commentUid="+commentUid; $(newThreadDiv).load(loadString, function() { highlightMessage(); + resizeIframe(); }); clearNewForm(); - resizeIframe(); } else if ( response.errMessage ) { alert(response.errMessage); } else { Index: lams_central/web/comments/topicview.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/comments/topicview.jsp,v diff -u -r1.2 -r1.3 --- lams_central/web/comments/topicview.jsp 16 Dec 2015 05:53:52 -0000 1.2 +++ lams_central/web/comments/topicview.jsp 16 Dec 2015 11:15:22 -0000 1.3 @@ -41,8 +41,9 @@ var parentDiv = document.getElementById('msg'+commentUid); parentDiv.appendChild(replyDiv); - $(replyDiv).load(url); - resizeIframe(); + $(replyDiv).load(url, function() { + resizeIframe(); + }); } } @@ -59,8 +60,9 @@ var parentDiv = document.getElementById('msg'+commentUid); parentDiv.appendChild(editDiv); - $(editDiv).load(url); - resizeIframe(); + $(editDiv).load(url, function() { + resizeIframe(); + }); } } Index: lams_central/web/includes/javascript/comments.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/includes/javascript/comments.js,v diff -u -r1.1 -r1.2 --- lams_central/web/includes/javascript/comments.js 15 Dec 2015 10:20:53 -0000 1.1 +++ lams_central/web/includes/javascript/comments.js 16 Dec 2015 11:15:22 -0000 1.2 @@ -1,5 +1,5 @@ function resizeIframe() { - // parent.resizeCommentFrame(document.body.scrollHeight); Don't use at present - breaks the scrolling + parent.resizeCommentFrame(document.body.scrollHeight); } function highlightMessage() { @@ -31,8 +31,8 @@ $(threadDiv).load(loadString, function() { $('#msg'+commentUid).focus(); highlightMessage(); + resizeIframe(); }); - resizeIframe(); } } else if ( response.errMessage ) { // No valid id? Something failed. Assume it is a response message coming back. Index: lams_common/src/java/org/lamsfoundation/lams/comments/dao/hibernate/CommentDAO.java =================================================================== RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/comments/dao/hibernate/CommentDAO.java,v diff -u -r1.1 -r1.2 --- lams_common/src/java/org/lamsfoundation/lams/comments/dao/hibernate/CommentDAO.java 15 Dec 2015 10:17:27 -0000 1.1 +++ lams_common/src/java/org/lamsfoundation/lams/comments/dao/hibernate/CommentDAO.java 16 Dec 2015 11:15:33 -0000 1.2 @@ -82,19 +82,13 @@ private static final String SQL_QUERY_FIND_NEXT_THREAD_TOP = "select uid from lams_comment" + " where root_comment_uid = :rootUid and uid < :lastUid and comment_level = 1 order by uid DESC"; -// private static final String SQL_QUERY_FIND_NEXT_THREAD_MESSAGES = "from " + Comment.class.getName() -// + " where root_comment_uid = ? and comment_level > 1 and thread_comment_uid in ?"; - private static final String SQL_QUERY_FIND_NEXT_THREAD_MESSAGES = "SELECT c.*, SUM(l.vote) likes_total, l2.vote user_vote FROM lams_comment c " + " LEFT JOIN lams_comment_likes l ON c.uid = l.comment_uid " + " LEFT JOIN lams_comment_likes l2 ON c.uid = l2.comment_uid AND l2.user_id=:userId " + " WHERE c.thread_comment_uid IN (:threadIds) " + " GROUP BY c.uid"; -// private static final String SQL_QUERY_GET_COMPLETE_THREAD = "from " + Comment.class.getName() -// + " where thread_comment_uid = ?"; - private static final String SQL_QUERY_GET_COMPLETE_THREAD = "SELECT c.*, SUM(l.vote) likes_total, l2.vote user_vote FROM lams_comment c " + " LEFT JOIN lams_comment_likes l ON c.uid = l.comment_uid " @@ -132,21 +126,20 @@ @Override @SuppressWarnings("unchecked") public SortedSet getNextThreadByThreadId(final Long rootTopicId, final Long previousThreadMessageId, Integer numberOfThreads, Integer userId) { - HibernateTemplate template = this.getHibernateTemplate(); - template.setMaxResults(numberOfThreads); List threadUidList = null; if (previousThreadMessageId == null || previousThreadMessageId == 0L) { threadUidList = (List) getSession().createSQLQuery(SQL_QUERY_FIND_FIRST_THREAD_TOP) .setLong("rootUid", rootTopicId) + .setMaxResults(numberOfThreads) .list(); } else { threadUidList = (List) getSession().createSQLQuery(SQL_QUERY_FIND_NEXT_THREAD_TOP) .setLong("rootUid", rootTopicId) .setLong("lastUid", previousThreadMessageId) + .setMaxResults(numberOfThreads) .list(); } - template.setMaxResults(0); if (threadUidList != null && threadUidList.size() > 0) { SQLQuery query = getSession().createSQLQuery(SQL_QUERY_FIND_NEXT_THREAD_MESSAGES); Index: lams_common/src/java/org/lamsfoundation/lams/comments/dao/hibernate/CommentLikeDAO.java =================================================================== RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/comments/dao/hibernate/CommentLikeDAO.java,v diff -u -r1.1 -r1.2 --- lams_common/src/java/org/lamsfoundation/lams/comments/dao/hibernate/CommentLikeDAO.java 15 Dec 2015 10:17:27 -0000 1.1 +++ lams_common/src/java/org/lamsfoundation/lams/comments/dao/hibernate/CommentLikeDAO.java 16 Dec 2015 11:15:33 -0000 1.2 @@ -25,12 +25,10 @@ package org.lamsfoundation.lams.comments.dao.hibernate; -import org.apache.log4j.Logger; import org.lamsfoundation.lams.comments.dao.ICommentLikeDAO; import org.springframework.orm.hibernate3.support.HibernateDaoSupport; public class CommentLikeDAO extends HibernateDaoSupport implements ICommentLikeDAO { - private static Logger log = Logger.getLogger(CommentLikeDAO.class); private static String INSERT_LIKE = "INSERT IGNORE INTO lams_comment_likes(comment_uid, user_id, vote) VALUES (:comment,:user,:vote);"; @@ -40,8 +38,6 @@ .setParameter("user", userId) .setParameter("vote", vote) .executeUpdate(); - - log.debug("Insert returned "+status); return status == 1; } Index: lams_common/src/java/org/lamsfoundation/lams/comments/util/CommentConstants.java =================================================================== RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/comments/util/Attic/CommentConstants.java,v diff -u -r1.1 -r1.2 --- lams_common/src/java/org/lamsfoundation/lams/comments/util/CommentConstants.java 15 Dec 2015 10:17:27 -0000 1.1 +++ lams_common/src/java/org/lamsfoundation/lams/comments/util/CommentConstants.java 16 Dec 2015 11:15:33 -0000 1.2 @@ -49,7 +49,7 @@ // for paging long topics & inlining reply public static final String PAGE_LAST_ID = "pageLastId"; public static final String PAGE_SIZE = "size"; - public static final int DEFAULT_PAGE_SIZE = 4; + public static final int DEFAULT_PAGE_SIZE = 2; public static final String ATTR_NO_MORE_PAGES = "noMorePages"; public static final int MAX_BODY_LENGTH = 5000; Index: lams_tool_nb/web/WEB-INF/tags/Comments.tag =================================================================== RCS file: /usr/local/cvsroot/lams_tool_nb/web/WEB-INF/tags/Comments.tag,v diff -u -r1.1 -r1.2 --- lams_tool_nb/web/WEB-INF/tags/Comments.tag 15 Dec 2015 13:31:14 -0000 1.1 +++ lams_tool_nb/web/WEB-INF/tags/Comments.tag 16 Dec 2015 11:12:45 -0000 1.2 @@ -25,7 +25,7 @@ \ No newline at end of file