{"size": 1299, "ext": "js", "max_stars_repo_path": "resources/showcomment.js", "max_stars_repo_name": "jensl/FiddleAndTweak", "max_stars_repo_stars_event_min_datetime": "2015-06-23T09:23:07.000Z", "max_stars_repo_stars_event_max_datetime": "2017-06-28T10:52:10.000Z", "max_issues_repo_path": "resources/showcomment.js", "max_issues_repo_name": "jensl/FiddleAndTweak", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "resources/showcomment.js", "max_forks_repo_name": "jensl/FiddleAndTweak", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 2, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 31.6829268293, "max_line_length": 101, "alphanum_fraction": 0.6274056967}
/* -*- mode: js; js-indent-level: 2; indent-tabs-mode: nil -*-

 Copyright 2013 Jens Lindström, Opera Software ASA

 Licensed under the Apache License, Version 2.0 (the "License"); you may not
 use this file except in compliance with the License.  You may obtain a copy of
 the License at

   http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
 License for the specific language governing permissions and limitations under
 the License.

*/

"use strict";

$(function ()
  {
    addShowEdits();

    function edit(ev)
    {
      var chain_id = parseInt($(ev.currentTarget).parents(".comment-chain").attr("id").substring(1));
      var chain = commentChainById[chain_id];
      var lines = chain.lines;

      editLines("initial", { file_id: lines.file,
                             sha1: lines.sha1,
                             lineIndex: lines.firstLine - 1,
                             lineCount: lines.lastLine - lines.firstLine + 1 });
    }

    critic.buttons.add({ title: "Edit Code",
                         onclick: edit,
                         scope: "comment" });
  });
