<commit_before>// Constants
var gRegionCommentTmpl = new YAHOO.ext.DomHelper.Template(
    "<li class=\"comment\">" +
      "<dl>" +
        "<dt>" +
          "<a href=\"{user_url}\">{user_fullname}</a> " +
          "<span class=\"timestamp\">{timesince} ago.</span>" +
        "</dt>" +
        "<dd>{text}</dd>" +
      "</dl>" +
    "</li>");
gRegionCommentTmpl.compile();

var gRegionCommentDraftTmpl = new YAHOO.ext.DomHelper.Template(
    "<li class=\"comment draft\">" +
      "<dl>" +
        "<dt>" +
          "<label for=\"id_yourcomment\">" +
            "<a href=\"{user_url}\">{user_fullname}</a> " +
            "<span class=\"timestamp\">{timesince} ago.</span>" +
          "</label>" +
        "</dt>" +
        "<dd id=\"id_yourcomment\">{text}</dd>" +
      "</dl>" +
    "</li>");
gRegionCommentDraftTmpl.compile();

// State variables
var gCommentDlg = null;
var gCommentBlocks = {};
var gSelectionSensitive = true;
var gSelection = {
    image: null,
    beginX: -1,
    beginY: -1,
    endX: -1,
    endY: -1
};
var dh = YAHOO.ext.DomHelper;


ScreenshotCommentDialog = function(el) {
    ScreenshotCommentDialog.superclass.constructor.call(this, el);
}

YAHOO.extendX(ScreenshotCommentDialog, CommentDialog, {
    setCommentBlock: function(commentBlock) {
        if (this.commentBlock != commentBlock) {
            this.checkEmptyCommentBlock();
        }

        this.commentBlock = commentBlock;

        this.updateCommentsList();
        this.updateReviewCommentsList();

        var commentLabel = getEl('id_comment_label');

        // FIXME: it'd be nice to show something more useful here.
        commentLabel.dom.innertHTML = "Your comment for selected region";<commit_msg>Clobber old text when opening the comment dialog anew<commit_after>// Constants
var gRegionCommentTmpl = new YAHOO.ext.DomHelper.Template(
    "<li class=\"comment\">" +
      "<dl>" +
        "<dt>" +
          "<a href=\"{user_url}\">{user_fullname}</a> " +
          "<span class=\"timestamp\">{timesince} ago.</span>" +
        "</dt>" +
        "<dd>{text}</dd>" +
      "</dl>" +
    "</li>");
gRegionCommentTmpl.compile();

var gRegionCommentDraftTmpl = new YAHOO.ext.DomHelper.Template(
    "<li class=\"comment draft\">" +
      "<dl>" +
        "<dt>" +
          "<label for=\"id_yourcomment\">" +
            "<a href=\"{user_url}\">{user_fullname}</a> " +
            "<span class=\"timestamp\">{timesince} ago.</span>" +
          "</label>" +
        "</dt>" +
        "<dd id=\"id_yourcomment\">{text}</dd>" +
      "</dl>" +
    "</li>");
gRegionCommentDraftTmpl.compile();

// State variables
var gCommentDlg = null;
var gCommentBlocks = {};
var gSelectionSensitive = true;
var gSelection = {
    image: null,
    beginX: -1,
    beginY: -1,
    endX: -1,
    endY: -1
};
var dh = YAHOO.ext.DomHelper;


ScreenshotCommentDialog = function(el) {
    ScreenshotCommentDialog.superclass.constructor.call(this, el);
}

YAHOO.extendX(ScreenshotCommentDialog, CommentDialog, {
    setCommentBlock: function(commentBlock) {
        if (this.commentBlock != commentBlock) {
            this.checkEmptyCommentBlock();
        }

        this.commentBlock = commentBlock;

        this.updateCommentsList();
        this.updateReviewCommentsList();
        this.newCommentField.dom.value = this.commentBlock.localComment;

        var commentLabel = getEl('id_comment_label');

        // FIXME: it'd be nice to show something more useful here.
        commentLabel.dom.innertHTML = "Your comment for selected region";
{'fraction_non_alphanumeric': 0.17095224639728737, 'fraction_numerical': 0.0022605255721955355, 'mean_word_length': 2.64572605561277, 'pattern_counts': {'":': 0, '<': 55, '<?xml version=': 0, '>': 55, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5603364', 'n_tokens_mistral': 1134, 'n_tokens_neox': 1131, 'n_words': 215}