<commit_before>var EventViewPage = Backbone.View.extend({

	initialize: function(d) {
    if(d){
      this.setEventId(d);
    }
    else{
      var modalDialog = new ModalDialogView();
      modalDialog.show({
        message: 'There is no Event to View',
        type: "danger",
      });
    }
		_.bindAll(this,"render");
		this.render();
	},

  setEventId:function(d){
      var self = this;
      if(d.assetid){
        //set asset id to the model to create new event under that asset
        self.eventid = 'new';
        self.model= new  SingleEvent();
        self.model.attributes.asset['@class'] = d.aclass;
        self.model.attributes.asset['assetId'] = d.assetid;
        $('#asset_table tbody').append("<tr id="+d.assetid+"><td style=''>"+d.assetid+"</td><td style=''>"+d.aclass+"</td><td style=''>n/a</td></tr>");
        $('#editdep_panel').html('');
        self.clearform();
      }
      else if(d.eventid){
        self.eventid= d.eventid;
      }
      else{
        var modalDialog = new ModalDialogView();
          modalDialog.show({
            message: 'There is no Event to View',
            type: "danger",
          });
      }
  },

	//renders a simple map view
	render: function() {
        
        self = this;
        var classtypelist = {'.ReturnToManufacturerEvent':{'val':7,'label':'ReturnToManufacturer'},'.StorageEvent':{'val':4,'label':'Storage'},'.DeploymentEvent':{'val':1,'label':'Deployment'},'.IntegrationEvent':{'val':2,'label':'Integration'},'.TestEvent':{'val':5,'label':'Test'},'.CalibrationEvent':{'val':6,'label':'Calibration'},'.RetirementEvent':{'val':3,'label':'Retirement'}};

        self.initializeEvent();
        self.modalDialog = new ModalDialogView();
        if(self.eventid !='new'){
          var eventModel = new SingleEvent({id:self.eventid});

          self.model = eventModel;

          eventModel.fetch({
            success: function (event) {
                $('#editdep_panel').html('');

                //M@Campbell - 4/7/2015
                //---
                //Set calibration table 
                if (self.model.get('calibrationCoefficient')) { 
                    //render the tab if there is calibration coefficients
                    $('#cal-tab').show();
                    $('#cal_table tbody').empty(); 
                    
                    //keeping things tidy...
                    var ccLen = event.attributes.calibrationCoefficient.length; 
                    for ( var t = 0; t < ccLen; t++ ) {
                        var ccName = event.attributes.calibrationCoefficient[t].name;
                        var ccValue = event.attributes.calibrationCoefficient[t].values; 
                        $('#cal_table tbody').append(
                            "<tr class="+event.attributes.eventId+">" +
                            "<td style=''>"+ ccName+ "</td>" +
                            "<td style=''>"+ 
                            "<input class=cal-cof-"+event.attributes.eventId +
                                " id=" + ccName +
                                " value=" + ccValue + ">" +
                            "</td></tr>"
                            );
                    }; 
                };
                //---

                //set asset_table to assetInfo table
              $('#asset_table tbody').empty();
              $('#asset_table tbody').append("<tr id="+event.attributes.asset.assetId+"><td style=''>"+event.attributes.asset.assetInfo.name+"</td><td style=''>"+event.attributes.asset.assetInfo.type+"</td><td style=''>"+event.attributes.asset.assetInfo.owner+"</td></tr>");

              $('#name_d').val(event.attributes.eventId);
              $('#cruise_e').val(event.attributes.cruiseNumber);
              $('#cur_loc_d').val(event.attributes.currentLocationName);
              
              if(event.attributes.deploymentDepth){
                $('#depth_e').val(event.attributes.deploymentDepth);
              }
              else{
                 $('#depth_e').val('');
              }
              if(event.attributes.startDate){
                if(String(event.attributes.startDate).search('Z')>-1){
                  var dobj = String(event.attributes.startDate).split('Z')
                  var l_date = Date.parse(dobj[0]);
                }
                else if(!isNaN(event.attributes.startDate)){<commit_msg>Removed input field for values.<commit_after>var EventViewPage = Backbone.View.extend({

	initialize: function(d) {
    if(d){
      this.setEventId(d);
    }
    else{
      var modalDialog = new ModalDialogView();
      modalDialog.show({
        message: 'There is no Event to View',
        type: "danger",
      });
    }
		_.bindAll(this,"render");
		this.render();
	},

  setEventId:function(d){
      var self = this;
      if(d.assetid){
        //set asset id to the model to create new event under that asset
        self.eventid = 'new';
        self.model= new  SingleEvent();
        self.model.attributes.asset['@class'] = d.aclass;
        self.model.attributes.asset['assetId'] = d.assetid;
        $('#asset_table tbody').append("<tr id="+d.assetid+"><td style=''>"+d.assetid+"</td><td style=''>"+d.aclass+"</td><td style=''>n/a</td></tr>");
        $('#editdep_panel').html('');
        self.clearform();
      }
      else if(d.eventid){
        self.eventid= d.eventid;
      }
      else{
        var modalDialog = new ModalDialogView();
          modalDialog.show({
            message: 'There is no Event to View',
            type: "danger",
          });
      }
  },

	//renders a simple map view
	render: function() {
        
        self = this;
        var classtypelist = {'.ReturnToManufacturerEvent':{'val':7,'label':'ReturnToManufacturer'},'.StorageEvent':{'val':4,'label':'Storage'},'.DeploymentEvent':{'val':1,'label':'Deployment'},'.IntegrationEvent':{'val':2,'label':'Integration'},'.TestEvent':{'val':5,'label':'Test'},'.CalibrationEvent':{'val':6,'label':'Calibration'},'.RetirementEvent':{'val':3,'label':'Retirement'}};

        self.initializeEvent();
        self.modalDialog = new ModalDialogView();
        if(self.eventid !='new'){
          var eventModel = new SingleEvent({id:self.eventid});

          self.model = eventModel;

          eventModel.fetch({
            success: function (event) {
                $('#editdep_panel').html('');

                //M@Campbell - 4/7/2015
                //---
                //Set calibration table 
                if (self.model.get('calibrationCoefficient')) { 
                    //render the tab if there is calibration coefficients
                    $('#cal-tab').show();
                    $('#cal_table tbody').empty(); 
                    
                    //keeping things tidy...
                    var ccLen = event.attributes.calibrationCoefficient.length; 
                    for ( var t = 0; t < ccLen; t++ ) {
                        var ccName = event.attributes.calibrationCoefficient[t].name;
                        var ccValue = event.attributes.calibrationCoefficient[t].values; 
                        $('#cal_table tbody').append(
                            "<tr class="+event.attributes.eventId+">" +
                            "<td style=''>"+ ccName+ "</td>" +
                            "<td class=cal-cof-"+event.attributes.eventId +
                                " id=" + ccName +">" + ccValue +
                            "</td></tr>"
                            );
                    }; 
                };
                //---

                //set asset_table to assetInfo table
              $('#asset_table tbody').empty();
              $('#asset_table tbody').append("<tr id="+event.attributes.asset.assetId+"><td style=''>"+event.attributes.asset.assetInfo.name+"</td><td style=''>"+event.attributes.asset.assetInfo.type+"</td><td style=''>"+event.attributes.asset.assetInfo.owner+"</td></tr>");

              $('#name_d').val(event.attributes.eventId);
              $('#cruise_e').val(event.attributes.cruiseNumber);
              $('#cur_loc_d').val(event.attributes.currentLocationName);
              
              if(event.attributes.deploymentDepth){
                $('#depth_e').val(event.attributes.deploymentDepth);
              }
              else{
                 $('#depth_e').val('');
              }
              if(event.attributes.startDate){
                if(String(event.attributes.startDate).search('Z')>-1){
                  var dobj = String(event.attributes.startDate).split('Z')
                  var l_date = Date.parse(dobj[0]);
                }
                else if(!isNaN(event.attributes.startDate)){
{'fraction_non_alphanumeric': 0.1678958285319198, 'fraction_numerical': 0.0036874855957593914, 'mean_word_length': 1.7648932781140492, 'pattern_counts': {'":': 0, '<': 50, '<?xml version=': 0, '>': 50, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2977358', 'n_tokens_mistral': 2479, 'n_tokens_neox': 2363, 'n_words': 382}