|
|
@@ -238,7 +238,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="footer">
|
|
|
- <#if content.isCommentEnable() && !(content.isUuUserReplied(userid) || (USER?? && content.isUserReplied(USER.id)))>
|
|
|
+ <#if content.isCommentEnable() && !(content.isUuUserReplied(userid) || (USER?? && content.isUserReplied(USER.id))) && (USER?? || userid??)>
|
|
|
<form action="${CPATH}/comment/submit" method="post" id="comment">
|
|
|
<input type="hidden" name="cid" value="${(content.id)!}" >
|
|
|
<input type="hidden" id="parent_id" name="parent_id" >
|
|
|
@@ -269,15 +269,13 @@
|
|
|
<div class="detail">
|
|
|
<div class="title">
|
|
|
<span>${comment.author!} <em>${(comment.created?string("yyyy-MM-dd"))!}</em></span>
|
|
|
- <span><img src="/jpress/static/jpress/admin/image/hands.png" alt="" onclick="vote(${comment.id})"/><em>${(comment.vote_up)!'0'}</em></span>
|
|
|
- <!--<span><img src="/jpress/static/jpress/admin/image/support.png" alt=""/><em>1</em></span>-->
|
|
|
+ <span><img class="votedUas${comment.id} <#if comment.isvoted(comment.id, userId!0, userid!0)>voted</#if>" src="/jpress/static/jpress/admin/image/hands.png" alt="" onclick="vote(${comment.id})"/><em class="em${comment.id}">${(comment.vote_up)!'0'}</em></span>
|
|
|
</div>
|
|
|
<p>${comment.text!}</p>
|
|
|
<#if comment.qc_content ??>
|
|
|
<div class="title reply">
|
|
|
<span>作者回复: <em>${(comment.qc_created?string("yyyy-MM-dd"))!}</em></span>
|
|
|
- <span><img src="/jpress/static/jpress/admin/image/hands.png" alt="" onclick="vote(${comment.qc_id})"><em>${(comment.qc_vote_up)!'0'}</em></span>
|
|
|
- <!--<span><img src="/jpress/static/jpress/admin/image/support.png" alt=""/><em>1</em></span>-->
|
|
|
+ <span><img class="votedUas${comment.qc_id} <#if comment.isvoted(comment.qc_id, userId!0, userid!0)>voted</#if>" src="/jpress/static/jpress/admin/image/hands.png" alt="" onclick="vote(${comment.qc_id})"/><em class="em${comment.qc_id}">${(comment.qc_vote_up)!'0'}</em></span>
|
|
|
</div>
|
|
|
<p>${comment.qc_content!}</p>
|
|
|
</#if>
|
|
|
@@ -297,34 +295,34 @@
|
|
|
</body>
|
|
|
<script>
|
|
|
jQuery('html').css('fontSize',$(window).width()/640 * 30);
|
|
|
- jQuery(window).load(function () {
|
|
|
- jQuery("img").each(function () {
|
|
|
- DrawImage(this, 100, 100);
|
|
|
- });
|
|
|
- });
|
|
|
- function DrawImage(ImgD, FitWidth, FitHeight) {
|
|
|
- var image = new Image();
|
|
|
- image.src = ImgD.src;
|
|
|
- if (image.width > 0 && image.height > 0) {
|
|
|
- if (image.width / image.height >= FitWidth / FitHeight) {
|
|
|
- if (image.width > FitWidth) {
|
|
|
- ImgD.width = FitWidth;
|
|
|
- ImgD.height = (image.height * FitWidth) / image.width;
|
|
|
- } else {
|
|
|
- ImgD.width = image.width;
|
|
|
- ImgD.height = image.height;
|
|
|
- }
|
|
|
- } else {
|
|
|
- if (image.height > FitHeight) {
|
|
|
- ImgD.height = FitHeight;
|
|
|
- ImgD.width = (image.width * FitHeight) / image.height;
|
|
|
- } else {
|
|
|
- ImgD.width = image.width;
|
|
|
- ImgD.height = image.height;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+// jQuery(window).load(function () {
|
|
|
+// jQuery("img").each(function () {
|
|
|
+// DrawImage(this, 100, 50);
|
|
|
+// });
|
|
|
+// });
|
|
|
+// function DrawImage(ImgD, FitWidth, FitHeight) {
|
|
|
+// var image = new Image();
|
|
|
+// image.src = ImgD.src;
|
|
|
+// if (image.width > 0 && image.height > 0) {
|
|
|
+// if (image.width / image.height >= FitWidth / FitHeight) {
|
|
|
+// if (image.width > FitWidth) {
|
|
|
+// ImgD.width = FitWidth;
|
|
|
+// ImgD.height = (image.height * FitWidth) / image.width;
|
|
|
+// } else {
|
|
|
+// ImgD.width = image.width;
|
|
|
+// ImgD.height = image.height;
|
|
|
+// }
|
|
|
+// } else {
|
|
|
+// if (image.height > FitHeight) {
|
|
|
+// ImgD.height = FitHeight;
|
|
|
+// ImgD.width = (image.width * FitHeight) / image.height;
|
|
|
+// } else {
|
|
|
+// ImgD.width = image.width;
|
|
|
+// ImgD.height = image.height;
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
// 写留言
|
|
|
$('.footer-header>div.infoMessage').click(function () {
|
|
|
$(this).next('.writeMessage').toggle()
|
|
|
@@ -334,7 +332,7 @@
|
|
|
timers = null;
|
|
|
//加载数据
|
|
|
var LoadingDataFn = function() {
|
|
|
- $.get("${CPATH}/comment/lazyLoad?contId=${(content.id)!}&pagesize=1&pagenumber="+aa, function(result){
|
|
|
+ $.get("${CPATH}/comment/lazyLoad?contId=${(content.id)!}&pagesize=3&pagenumber="+aa+"&userId=${userId!0}&uuUserId=${userid!0}", function(result){
|
|
|
var dom = '';
|
|
|
dom += result.message;
|
|
|
$('.footer-section').append(dom);
|
|
|
@@ -347,6 +345,7 @@
|
|
|
$(document).ready(function() {
|
|
|
userId = "${userId!0}"
|
|
|
uuUserId = "${userid!0}";
|
|
|
+ $('.voted').attr("src","/jpress/static/jpress/admin/image/support.png");
|
|
|
});
|
|
|
//滚动加载方法
|
|
|
$(window).scroll(function() {
|
|
|
@@ -361,6 +360,17 @@
|
|
|
|
|
|
//点赞
|
|
|
var vote = function(commentid) {
|
|
|
+ var imgObj = $(".votedUas"+commentid);
|
|
|
+ var emObj = $(".em"+commentid);
|
|
|
+ if (imgObj.hasClass("voted")) {
|
|
|
+ emObj.text(""+(parseInt(emObj.text())-1));
|
|
|
+ imgObj.removeClass("voted");
|
|
|
+ imgObj.attr("src","/jpress/static/jpress/admin/image/hands.png");
|
|
|
+ } else {
|
|
|
+ emObj.text(""+(parseInt(emObj.text())+1));
|
|
|
+ imgObj.addClass("voted");
|
|
|
+ imgObj.attr("src","/jpress/static/jpress/admin/image/support.png")
|
|
|
+ }
|
|
|
$.get("${CPATH}/comment/vote?comment_id="+commentid+"&user_id="+userId+"&uu_user_id="+uuUserId, function(result){
|
|
|
console.log(result.message);
|
|
|
});
|