--- a/review/static/comments.js Sat Jul 03 12:05:03 2010 -0400
+++ b/review/static/comments.js Sat Jul 03 12:07:31 2010 -0400
@@ -14,15 +14,15 @@
'<textarea id="id_comment-line-form_{{ currNum }}_body" class="body"' +
'name="new-comment-body">{{ body }}</textarea>' +
'</div>' +
-
+
'<div class="field cuddly">' +
'<input type="checkbox" class="checkbox markdown-select" name="comment-markdown" id="id_comment-line-form_{{ currNum }}_markdown" {{ markdown_checked }} />' +
'<label for="id_comment-line-form_{{ currNum }}_markdown">Use Markdown to format this comment.</label>' +
'</div>' +
-
+
'<a class="submit button"><span>Post Comment</span></a>' +
'<a class="cancel-line button"><span>Cancel</span></a>' +
-
+
'<input type="hidden" name="filename" value="{{ filename }}" />' +
'<input class="lines" type="hidden" name="lines" value="{{ currNum }}" />' +
'</form>' +
@@ -37,33 +37,28 @@
}
$(function() {
-
$(".activate a").click(function(event) {
$(event.target).closest(".activate").hide();
$(event.target).closest("div").children("form").fadeIn("fast");
return false;
});
-
$(".activate-edit a").click(function(event) {
$(event.target).closest(".activate-edit").hide();
$(event.target).closest(".comment").find(".message").hide();
$(event.target).closest("div").children("form").fadeIn("fast");
return false;
});
-
$("a.cancel").click(function(event) {
$(event.target).closest(".togglebox").children(".activate").show();
$(event.target).parents("form").hide();
return false;
});
-
$("a.cancel-edit").click(function(event) {
$(event.target).closest(".toggleinline").children(".activate-edit").show();
$(event.target).closest(".comment").find(".message").show();
$(event.target).parents("form").hide();
return false;
});
-
$("a.cancel-line").live('click', function(event) {
$(event.target).closest(".diff").find(".chosen").removeClass("chosen");
$(event.target).closest("tr.comment-form").remove();
@@ -81,7 +76,6 @@
});
var lastSelected = null;
-
$(".commentable").click(function(event) {
var currNum = parseInt($(this).find(".linenumber").html());
var diff = $(this).closest(".diff");
@@ -119,7 +113,7 @@
var existing_form_line_number = parseInt(existing_form.find(".lastlinenumber").html());
var existing_body = existing_form.find(".body").val();
var markdown = existing_form.find('.markdown-select').is(':checked');
-
+
if (existing_form_line_number != last_line_number) {
existing_forms.remove();
@@ -140,6 +134,6 @@
return false;
});
-
+
$("label.infield").inFieldLabels();
});