<commit_before>/*jshint onevar: true */
/*jshint todo: true */
/*jshint qunit: true */
/*jshint jquery: true */
/*jshint yui: true */
/*jslint plusplus: true */
/*jshint onevar: false */
/*global SciSheetsUtilEvent, $, alert, YAHOO */
/*jslint unparam: true*/
/*jslint browser: true */
/*jslint indent: 2 */
/*jslint newcap: true */

var ROW_NAME = "row";

function SciSheetsColumn(scisheet) {
  "use strict";
  this.scisheet = scisheet;
}

SciSheetsColumn.prototype.click = function (oArgs) {
  "use strict";
  var ep, scisheet;
  scisheet = this.scisheet;
  ep = new SciSheetsUtilEvent(scisheet, oArgs);
  $(ep.target).effect("highlight", 1000000);
  $(ep.target).toggle("highlight");
  if (ep.columnName  === ROW_NAME) {
    scisheet.utilClick("FirstColumnClickMenu", function (eleId) {
      var msg;
      msg = "Row Name Column clicked.";
      console.log(msg);
      $(ep.target).stop();
    });
  } else {
    scisheet.utilClick("ColumnClickMenu", function (eleId) {
      var msg, cmd, newPrompt;
      msg = "Column " + ep.columnIndex + " (" + ep.columnName + ")" + " clicked.";
      msg += " Selected " + eleId + ".";
      console.log(msg);
      cmd = scisheet.createServerCommand();
      cmd.command = eleId;
      cmd.column = ep.columnIndex;
      cmd.target = "Column";
      if (cmd.command === 'Append') {
        scisheet.utilRename(cmd, "New column name");
      }
      if (cmd.command === 'Delete') {
        scisheet.utilSendAndReload(cmd);
      }
      if (cmd.command === 'Insert') {
        scisheet.utilRename(cmd, "New column name");
      }
      if (cmd.command === 'Move') {
        scisheet.utilRename(cmd, "Insert after column");
      }
      if (cmd.command === 'Rename') {
        // Change the dialog prompt
        newPrompt = "Rename column '" + ep.columnName + "': ";
        scisheet.utilRename(cmd, newPrompt);
      }
    });
  }
};
<commit_msg>Fix bug for Name Column menu.<commit_after>/*jshint onevar: true */
/*jshint todo: true */
/*jshint qunit: true */
/*jshint jquery: true */
/*jshint yui: true */
/*jslint plusplus: true */
/*jshint onevar: false */
/*global SciSheetsUtilEvent, $, alert, YAHOO */
/*jslint unparam: true*/
/*jslint browser: true */
/*jslint indent: 2 */
/*jslint newcap: true */

var ROW_NAME = "row";

function SciSheetsColumn(scisheet) {
  "use strict";
  this.scisheet = scisheet;
}

SciSheetsColumn.prototype.click = function (oArgs) {
  "use strict";
  var ep, scisheet;
  scisheet = this.scisheet;
  ep = new SciSheetsUtilEvent(scisheet, oArgs);
  $(ep.target).effect("highlight", 1000000);
  $(ep.target).toggle("highlight");
  if (ep.columnName  === ROW_NAME) {
    scisheet.utilClick("NameColumnClickMenu", function (eleId) {
      var msg;
      msg = "Row Name Column clicked.";
      console.log(msg);
      $(ep.target).stop();
    });
  } else {
    scisheet.utilClick("ColumnClickMenu", function (eleId) {
      var msg, cmd, newPrompt;
      msg = "Column " + ep.columnIndex + " (" + ep.columnName + ")" + " clicked.";
      msg += " Selected " + eleId + ".";
      console.log(msg);
      cmd = scisheet.createServerCommand();
      cmd.command = eleId;
      cmd.column = ep.columnIndex;
      cmd.target = "Column";
      if (cmd.command === 'Append') {
        scisheet.utilRename(cmd, "New column name");
      }
      if (cmd.command === 'Delete') {
        scisheet.utilSendAndReload(cmd);
      }
      if (cmd.command === 'Insert') {
        scisheet.utilRename(cmd, "New column name");
      }
      if (cmd.command === 'Move') {
        scisheet.utilRename(cmd, "Insert after column");
      }
      if (cmd.command === 'Rename') {
        // Change the dialog prompt
        newPrompt = "Rename column '" + ep.columnName + "': ";
        scisheet.utilRename(cmd, newPrompt);
      }
    });
  }
};

{'fraction_non_alphanumeric': 0.16863983162325705, 'fraction_numerical': 0.004209418574059458, 'mean_word_length': 2.723800195886386, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5704997', 'n_tokens_mistral': 1328, 'n_tokens_neox': 1301, 'n_words': 287}