Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added jQuery substitute for comment reply function.

  • Loading branch information...
commit 6497e30f1dc0625b6e8ca42dc4b59efd8aa32112 1 parent 52f9cae
Matthias Mees authored
Showing with 8 additions and 4 deletions.
  1. +2 −3 comments.tpl
  2. +6 −1 js/2k11.js
View
5 comments.tpl
@@ -1,6 +1,5 @@
{foreach from=$comments item=comment name="comments"}
-<!-- TODO: * find a robust solution for threaded comments -->
-<!-- * jQuery code for reply function -->
+<!-- TODO: * jQuery code for reply function -->
<article id="c{$comment.id}" class="serendipity_comment{if $entry.author == $comment.author} serendipity_comment_author_self{/if} {cycle values="odd, even"} {if $comment.depth > 8}commentlevel-9{else}commentlevel-{$comment.depth}{/if}">
<h4>{if $comment.url}<a href="{$comment.url}">{/if}{$comment.author|@default:$CONST.ANONYMOUS}{if $comment.url}</a>{/if} {$CONST.ON} <time datetime="{$comment.timestamp|@formatTime:'%Y-%m-%dT%H:%M:%S%z'}" pubdate>{$comment.timestamp|@formatTime:$template_option.date_format}</time>:</h4>
@@ -18,7 +17,7 @@
| <a class="comment_source_ownerlink" href="{$comment.link_delete}" title="{$CONST.COMMENT_DELETE_CONFIRM|@sprintf:$comment.id:$comment.author}">{$CONST.DELETE}</a>
{/if}
{if $entry.allow_comments AND $comment.body != 'COMMENT_DELETED'}
- | <a class="comment_reply" href="#serendipity_CommentForm" id="serendipity_reply_{$comment.id}" onclick="document.getElementById('serendipity_replyTo').value='{$comment.id}'; {$comment_onchange}">{$CONST.REPLY}</a>
+ | <a class="comment_reply" href="#serendipity_CommentForm" id="serendipity_reply_{$comment.id}"{if $comment_onchange != ''} onclick="{$comment_onchange}"{/if}>{$CONST.REPLY}</a>
<div id="serendipity_replyform_{$comment.id}"></div>
{/if}
</footer>
View
7 js/2k11.js
@@ -5,9 +5,14 @@ jQuery(document).ready(function($) {
alert(trackbackMsg);
return false;
});
+ // Reply to comment
+ $('.comment_reply').click(function() {
+ var commentId = $(this).attr('id').replace(/serendipity_reply_/g,"");
+ $('#serendipity_replyTo').val(commentId);
+ });
// Confirm comment deletion
$('.comment_source_ownerlink').click(function() {
var deleteMsg = $(this).attr('title');
return confirm(deleteMsg);
- })
+ });
});
Please sign in to comment.
Something went wrong with that request. Please try again.