<commit_before>(function ($) {
  $.nirc = function (socket) {
    var options = {
      server:   $("#server").val(),
      port:     $("#port").val(),
      nickname: $("#nickname").val(),
      userName: $("#user").val(),
      channels: $("#channels").val(),
      ssl:      $("#ssl").is(":checked"),
      password: $("#password").val()
    }

    if (options.server == "" || options.nickname == "" || options.channels == "") {
      alert('Fields marked with * are required!');
      return;
    }
    else if (typeof(Storage) !== "undefined" && localStorage) {
      //store the options in localStorage
      var opts = $.extend({}, options); //copy to modify
      delete opts['password']; //except password, probably a bad idea
      localStorage.ircOptions = JSON.stringify(opts);
    }

    var connectForm   = $('#connect-form');
    var ircStuff      = $('#irc-stuff');
    var tabs          = $('#tabs');
    var tabViews      = $('#tab-views');
    var commandInput  = $('#command-input');
    var supportsNotifications = !!window.webkitNotifications;
    var maxLines      = 500;
    
    //Get current time
    var now = new Date();
    var getTime = now.getHours()+':'+now.getMinutes()+':'+now.getSeconds();

    var getTabView = function(title) {
      return $('.tab-view[title="'+title.toLowerCase()+'"]');
    };

    var newMsg = function (msgData) {
      var msgType   = (msgData.reciever == 'status' ? 'status' : 'channel');

      var tab       = $('.tab[title="'+msgData.receiver.toLowerCase()+'"]');
      var tabView   = getTabView(tab.attr('title'));
      var newLine   = $('<div>').addClass('line ' + msgType);
      var actualMsg = $('<span>');


      var timestamp = $("<span>").addClass('timestamp').text(getTime);
      newLine.append(timestamp);

      var actionMatch = msgData.message.match(/\u0001ACTION (.*)\u0001/);

      if (msgType == 'channel' && msgData.from !== undefined) {
        if (!tab.hasClass('active')) {
          tab.addClass('new-msgs');
        }

        var msgFrom = $('<span>').addClass(actionMatch ? '' : 'from').text(msgData.from);
        var mentionRegex = new RegExp("(^|[^a-zA-Z0-9\\[\\]{}\\^`|])" + options.nickname + "([^a-zA-Z0-9\\[\\]{}\\^`|]|$)", 'i');
        var containsMention = msgData.message.match(mentionRegex);<commit_msg>Update client.js<commit_after>(function ($) {
  $.nirc = function (socket) {
    var options = {
      server:   $("#server").val(),
      port:     $("#port").val(),
      nickname: $("#nickname").val(),
      userName: $("#user").val(),
      channels: $("#channels").val(),
      ssl:      $("#ssl").is(":checked"),
      password: $("#password").val()
    }

    if (options.server == "" || options.nickname == "" || options.channels == "") {
      alert('Fields marked with * are required!');
      return;
    }
    else if (typeof(Storage) !== "undefined" && localStorage) {
      //store the options in localStorage
      var opts = $.extend({}, options); //copy to modify
      delete opts['password']; //except password, probably a bad idea
      localStorage.ircOptions = JSON.stringify(opts);
    }

    var connectForm   = $('#connect-form');
    var ircStuff      = $('#irc-stuff');
    var tabs          = $('#tabs');
    var tabViews      = $('#tab-views');
    var commandInput  = $('#command-input');
    var supportsNotifications = !!window.webkitNotifications;
    var maxLines      = 500;
    
    //Get current time
    function currentTime(){
    	var now = new Date();
    	var getTime = now.getHours()+':'+now.getMinutes()+':'+now.getSeconds();
    	return getTime;
    }

    var getTabView = function(title) {
      return $('.tab-view[title="'+title.toLowerCase()+'"]');
    };

    var newMsg = function (msgData) {
      var msgType   = (msgData.reciever == 'status' ? 'status' : 'channel');

      var tab       = $('.tab[title="'+msgData.receiver.toLowerCase()+'"]');
      var tabView   = getTabView(tab.attr('title'));
      var newLine   = $('<div>').addClass('line ' + msgType);
      var actualMsg = $('<span>');


      var timestamp = $("<span>").addClass('timestamp').text(currentTime());
      newLine.append(timestamp);

      var actionMatch = msgData.message.match(/\u0001ACTION (.*)\u0001/);

      if (msgType == 'channel' && msgData.from !== undefined) {
        if (!tab.hasClass('active')) {
          tab.addClass('new-msgs');
        }

        var msgFrom = $('<span>').addClass(actionMatch ? '' : 'from').text(msgData.from);
        var mentionRegex = new RegExp("(^|[^a-zA-Z0-9\\[\\]{}\\^`|])" + options.nickname + "([^a-zA-Z0-9\\[\\]{}\\^`|]|$)", 'i');
        var containsMention = msgData.message.match(mentionRegex);
{'fraction_non_alphanumeric': 0.21401110636480136, 'fraction_numerical': 0.006407518154634771, 'mean_word_length': 2.7255369928400954, 'pattern_counts': {'":': 2, '<': 11, '<?xml version=': 0, '>': 11, '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': '215588', 'n_tokens_mistral': 1478, 'n_tokens_neox': 1429, 'n_words': 296}