<commit_before>  $.noConflict();     //  to avoid jQuery
  // Code that uses other library's $ can follow here.
  var meeting_day = '';
  var end_time_clone = '';
  var event;
  var draggedEventIsPastDay = false;

  jQuery(document).ready(function($) {
      if (!window.console)
          console = {
              log : function() {
              }
          };
      //work around for errors in IE if the console is not open
      end_time_clone = $('#end_time option').clone();
      /*
      Author: <EMAIL>
      Description: get events in json format
      */
      getEventsJSON = function(offset) {
          meeting_room = $('#meeting_rooms').val();
          project_id = $('#project_id').val();
          var current_date = new Date();
          current_date.setDate(current_date.getDate() - 14);
          var today = $.datepicker.formatDate("yy-mm-dd", current_date);
          //  selected meeting room
          $.ajax({
              url : baseUrl + '/issues.json',
              dataType : 'json',
              data : 'key=' + api_key + '&project_id=' + project_id + '&cf_' + fieldIdRoom + '=' + encodeURIComponent(meeting_room) + '&start_date=' + encodeURIComponent('>=') + today + '&status_id=' + encodeURIComponent('*') + '&limit=' + 100 + '&offset=' + offset,
              beforeSend : function(xhr) {
                  showSpinner();
              },
              success : function(data, textStatus, jqXHR) {
                  console.log('Get JSON success');
                  if (buildEventsJSON(data, data.offset == 0)) {
                      if (data.offset == 0) {
                          $('#calendar').fullCalendar('removeEvents');
                          $('#calendar').fullCalendar('addEventSource', eventsJSON);
                      }

                      $('#calendar').fullCalendar('refetchEvents');
                      $('#calendar').fullCalendar('rerenderEvents');

                      hideSpinner();

                      if (data.total_count > (data.offset + data.limit)) {
                          getEventsJSON(data.offset + data.limit);
                      }
                  }
              },
              error : function(jqXHR, textStatus, errorThrown) {
                  hideSpinner();
                  alert(textStatus + ": " + errorThrown);
              }
          });
          return true;
      }
      /*
      Author: <EMAIL>
      Description: build events json for fullcalendar
      */
      var buildEventsJSON = function(eventsRawJSON, clear) {
          window.console.log('Building Meetings JSON');
          count = eventsRawJSON.issues.length;
          event = eventsRawJSON.issues;
          if (clear) {
              eventsJSON = [];
          }
          //  events to be rendered on fullcalendar
          // building events json for fullcalendar
          for (var i = 0; i < count; i++) {
              var eventIndexRoom = 0;
              var eventIndexStart = 1;
              var eventIndexEnd = 5;
              for (var j = 0; j < event[i].custom_fields.length; j++)
              {
                  if (event[i].custom_fields[j]["id"] == fieldIdRoom)
                      eventIndexRoom = j;
                  if (event[i].custom_fields[j]["id"] == fieldIdStart)
                      eventIndexStart = j;
                  if (event[i].custom_fields[j]["id"] == fieldIdEnd)
                      eventIndexEnd = j;
              }

              var eventClassName = '';
              var event_id = event[i].id;
              author_name = event[i].author.name;
              start_time_arr = event[i].custom_fields[eventIndexStart].value.split(':');
              end_time_arr = event[i].custom_fields[eventIndexEnd].value.split(':');
              meeting_room = event[i].custom_fields[eventIndexRoom].value;
              meeting_day_arr = event[i].start_date.split('-');
              var start_time = new Date(meeting_day_arr[0], meeting_day_arr[1] - 1, meeting_day_arr[2], start_time_arr[0], start_time_arr[1]);
              var end_time = new Date(meeting_day_arr[0], meeting_day_arr[1] - 1, meeting_day_arr[2], end_time_arr[0], end_time_arr[1]);
              var assigned_to_id = event[i].author.id;
              if (event[i].assigned_to)
                  assigned_to_id = event[i].assigned_to.id;
              var assigned_to_name = event[i].author.name;
              if (event[i].assigned_to)
                  assigned_to_name = event[i].assigned_to.name;
              var category_id = 0;
              var category_name = '';
              if (event[i].category) {
                  category_id = event[i].category.id;
                  category_name = event[i].category.name;
              }
              var eventsub = '';
              var repl
              var limit
              var title = event[i].subject;
              if (title.length >= '36') {
                 title = stripSubject(title, 36) + " ...";
              }
              eventClassName = 'category_' + category_id;
              if (isCurrentUser(event[i].author.id, assigned_to_id)) {
                  eventClassName = 'myEvents ' + eventClassName;
              }
              eventsJSON.push({
                  title : title,
                  author : author_name,
                  start : start_time,
                  end : end_time,
                  subject : event[i].subject,
                  start_date : event[i].start_date,
                  due_date : event[i].due_date,
                  starttime : +start_time_arr[0] + ':' + start_time_arr[1],
                  endtime : +end_time_arr[0] + ':' + end_time_arr[1],
                  event_id : event_id,
                  event_author_id : event[i].author.id,
                  assigned_to_id : assigned_to_id,
                  assigned_to_name : assigned_to_name,
                  category_id: category_id,
                  category_name: category_name,
                  className : eventClassName,
                  cache : true,
                  allDay : false
              });
          }
          return true;
      }
      /*
      Author: <EMAIL>
      Description: checking whether event overlaps with exisiting events
      */
      var isOverlapping = function(eventStart, eventEnd) {<commit_msg>Add tracker status CSS class names<commit_after>  $.noConflict();     //  to avoid jQuery
  // Code that uses other library's $ can follow here.
  var meeting_day = '';
  var end_time_clone = '';
  var event;
  var draggedEventIsPastDay = false;

  jQuery(document).ready(function($) {
      if (!window.console)
          console = {
              log : function() {
              }
          };
      //work around for errors in IE if the console is not open
      end_time_clone = $('#end_time option').clone();
      /*
      Author: <EMAIL>
      Description: get events in json format
      */
      getEventsJSON = function(offset) {
          meeting_room = $('#meeting_rooms').val();
          project_id = $('#project_id').val();
          var current_date = new Date();
          current_date.setDate(current_date.getDate() - 14);
          var today = $.datepicker.formatDate("yy-mm-dd", current_date);
          //  selected meeting room
          $.ajax({
              url : baseUrl + '/issues.json',
              dataType : 'json',
              data : 'key=' + api_key + '&project_id=' + project_id + '&cf_' + fieldIdRoom + '=' + encodeURIComponent(meeting_room) + '&start_date=' + encodeURIComponent('>=') + today + '&status_id=' + encodeURIComponent('*') + '&limit=' + 100 + '&offset=' + offset,
              beforeSend : function(xhr) {
                  showSpinner();
              },
              success : function(data, textStatus, jqXHR) {
                  console.log('Get JSON success');
                  if (buildEventsJSON(data, data.offset == 0)) {
                      if (data.offset == 0) {
                          $('#calendar').fullCalendar('removeEvents');
                          $('#calendar').fullCalendar('addEventSource', eventsJSON);
                      }

                      $('#calendar').fullCalendar('refetchEvents');
                      $('#calendar').fullCalendar('rerenderEvents');

                      hideSpinner();

                      if (data.total_count > (data.offset + data.limit)) {
                          getEventsJSON(data.offset + data.limit);
                      }
                  }
              },
              error : function(jqXHR, textStatus, errorThrown) {
                  hideSpinner();
                  alert(textStatus + ": " + errorThrown);
              }
          });
          return true;
      }
      /*
      Author: <EMAIL>
      Description: build events json for fullcalendar
      */
      var buildEventsJSON = function(eventsRawJSON, clear) {
          window.console.log('Building Meetings JSON');
          count = eventsRawJSON.issues.length;
          event = eventsRawJSON.issues;
          if (clear) {
              eventsJSON = [];
          }
          //  events to be rendered on fullcalendar
          // building events json for fullcalendar
          for (var i = 0; i < count; i++) {
              var eventIndexRoom = 0;
              var eventIndexStart = 1;
              var eventIndexEnd = 5;
              for (var j = 0; j < event[i].custom_fields.length; j++)
              {
                  if (event[i].custom_fields[j]["id"] == fieldIdRoom)
                      eventIndexRoom = j;
                  if (event[i].custom_fields[j]["id"] == fieldIdStart)
                      eventIndexStart = j;
                  if (event[i].custom_fields[j]["id"] == fieldIdEnd)
                      eventIndexEnd = j;
              }

              var eventClassName = '';
              var event_id = event[i].id;
              author_name = event[i].author.name;
              start_time_arr = event[i].custom_fields[eventIndexStart].value.split(':');
              end_time_arr = event[i].custom_fields[eventIndexEnd].value.split(':');
              meeting_room = event[i].custom_fields[eventIndexRoom].value;
              meeting_day_arr = event[i].start_date.split('-');
              var start_time = new Date(meeting_day_arr[0], meeting_day_arr[1] - 1, meeting_day_arr[2], start_time_arr[0], start_time_arr[1]);
              var end_time = new Date(meeting_day_arr[0], meeting_day_arr[1] - 1, meeting_day_arr[2], end_time_arr[0], end_time_arr[1]);
              var assigned_to_id = event[i].author.id;
              if (event[i].assigned_to)
                  assigned_to_id = event[i].assigned_to.id;
              var assigned_to_name = event[i].author.name;
              if (event[i].assigned_to)
                  assigned_to_name = event[i].assigned_to.name;
              var category_id = 0;
              var category_name = '';
              if (event[i].category) {
                  category_id = event[i].category.id;
                  category_name = event[i].category.name;
              }
              var eventsub = '';
              var repl
              var limit
              var title = event[i].subject;
              if (title.length >= '36') {
                 title = stripSubject(title, 36) + " ...";
              }
              eventClassName = 'category_' + category_id;
              eventClassName = eventClassName + ' tracker_status_' + event[i].status.id;
              if (isCurrentUser(event[i].author.id, assigned_to_id)) {
                  eventClassName = 'myEvents ' + eventClassName;
              }
              eventsJSON.push({
                  title : title,
                  author : author_name,
                  start : start_time,
                  end : end_time,
                  subject : event[i].subject,
                  start_date : event[i].start_date,
                  due_date : event[i].due_date,
                  starttime : +start_time_arr[0] + ':' + start_time_arr[1],
                  endtime : +end_time_arr[0] + ':' + end_time_arr[1],
                  event_id : event_id,
                  event_author_id : event[i].author.id,
                  assigned_to_id : assigned_to_id,
                  assigned_to_name : assigned_to_name,
                  category_id: category_id,
                  category_name: category_name,
                  className : eventClassName,
                  cache : true,
                  allDay : false
              });
          }
          return true;
      }
      /*
      Author: <EMAIL>
      Description: checking whether event overlaps with exisiting events
      */
      var isOverlapping = function(eventStart, eventEnd) {
{'fraction_non_alphanumeric': 0.11727616645649433, 'fraction_numerical': 0.005201765447667087, 'mean_word_length': 1.5236674622116149, 'pattern_counts': {'":': 2, '<': 13, '<?xml version=': 0, '>': 15, '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': '5509562', 'n_tokens_mistral': 3481, 'n_tokens_neox': 3366, 'n_words': 687}