<commit_before>function addProjectWidget(id, projectName, projectVersion, projectIcon, projectDir) {
    console.log("addProjectWidget");
    
    var widgetId = "projectWidget_" + id.toString();
    var projectStatusId = "project-status_" + id.toString();
    var projectDetailsId = "project-details_" + id.toString();
    var projectDirId = "project-dir_" + id.toString();
    var deleteId = "delete_" + id.toString();
    var projectIconId = "projectIconId_" + id.toString();
    var projectNameLabel = "projectNameLabel_" + id.toString();
    var projectVersionLabel = "projectVersionLabel_" + id.toString();
    var widgetStatus = "widgetStatus_" + id.toString();
    var widgetStatusBottom = "widgetStatusBottom_" + id.toString();
    
    var widgetDOM = "";  
    
    // open the widget
    widgetDOM += "<div class='row widget-border' id='" + widgetId + "'>";

    widgetDOM += "<div id='" + widgetStatus + "' class='column widget-offline'>";    
    widgetDOM += "</div>";

    // project icon
    widgetDOM += "<div class='column project-icon-column'>";
    
	widgetDOM += "<div class='flip-container'>";
	widgetDOM += "<div class='flipper'>";
	
	widgetDOM += "<div class='front'>";
    widgetDOM += "<img id='" + projectIconId + "' height='64' width='64' src='" + projectIcon + "' />";
    widgetDOM += "</div>";  // front content
    
    widgetDOM += "<div class='back delete-holder' id=" + deleteId + ">";
    widgetDOM += "<button class='delete-button'>";
    widgetDOM += "<img src='img/icons/normal/delete.svg' />";
    widgetDOM += "</button>";
    widgetDOM += "</div>";  // back content
	
	widgetDOM += "</div>";  // flipper
	widgetDOM += "</div>";  // flip-container
       
    widgetDOM += "</div>";
    
    // project info
    widgetDOM += "<div class='column project-details-column' id='" + projectDetailsId + "'>";
    widgetDOM += "<div id='" + projectNameLabel + "' class='project-name'>" + projectName + "</div>";
    widgetDOM += "<div id='" + projectVersionLabel + "' class='project-version'>v" + projectVersion + "</div>";
    widgetDOM += "</div>";
    
    // indicator active project
    widgetDOM += "<div class='column project-indicator'>";
    widgetDOM += "<img id='start-icon_" + id.toString() + "' class='start-icon' src='img/icons/normal/start.svg' />";
    widgetDOM += "<img id='hr-icon_" + id.toString() + "' class='hr-icon' src='img/icons/normal/hr.svg' />";
    widgetDOM += "<img id='stop-icon_" + id.toString() + "' class='stop-icon' src='img/icons/normal/stop.svg' />";   
    widgetDOM += "</div>";
    
    // project folder
    widgetDOM += "<div class='row'>";
    
    widgetDOM += "<div id='" + widgetStatusBottom + "' class='column widget-offline'>";    
    widgetDOM += "</div>";
    
    widgetDOM += "<div class='column project-folder-column'>";
    widgetDOM += "<div class='localPath'>Local path:</div>"
    widgetDOM += "<div class='projDir'><a href='#' id='" + projectDirId + "' class='projectDirLink'>" + projectDir + "</a></div>";
    widgetDOM += "</div>";
    widgetDOM += "</div>";
    
    widgetDOM += "</div>";  // close the widget
    
    global.jQuery("#drop_zone").append(widgetDOM);
    enableMinusButton();
    global.jQuery("#guide-add").hide();
        
    global.jQuery("#" + deleteId).on("click", function(event) {
        console.log(deleteId);
        
        var temp = global.jQuery("#" + deleteId).attr("id").split("_");
        var clickedId = temp[1];
        
        removeProjectWidget(clickedId);
    });
        
    global.jQuery("#" + projectDirId).on("click", function() {
        opener(projectDir);     
    });
    
    global.jQuery("#start-icon_" + id.toString()).on("mouseover", function() {
        imgSwapper("start-icon_" + id.toString(), "img/icons/hover/start-hover.svg");
    });
    
    global.jQuery("#start-icon_" + id.toString()).on("mouseout", function() {
        if (id == global.activeWidget.projectId) {
            imgSwapper("start-icon_" + id.toString(), "img/icons/active/start-active.svg");
        } else {
            imgSwapper("start-icon_" + id.toString(), "img/icons/normal/start.svg");
        }        
    });

    global.jQuery("#start-icon_" + id.toString()).on("click", function() {
       setActiveWidget(id, projectDir);
       widgetServerOnlineState(id);
    });

    global.jQuery("#stop-icon_" + id.toString()).on("mouseover", function() {
        imgSwapper("stop-icon_" + id.toString(), "img/icons/hover/stop-hover.svg");
    });
    
    global.jQuery("#stop-icon_" + id.toString()).on("mouseout", function() {
        imgSwapper("stop-icon_" + id.toString(), "img/icons/normal/stop.svg");
    });
    
    global.jQuery("#stop-icon_" + id.toString()).on("click", function() {
        if (global.jQuery("#stop-icon_" + id.toString()).hasClass("stop-icon-active")) {
            // turn off the server
            setServerOffline();
            serverOfflineState();
            widgetSeverOfflineState(id);
        }
    });
        
    global.jQuery("#" + widgetId).on("click", function() {
        var temp = global.jQuery("#" + widgetId).attr("id").split("_");
        var id = temp[1];
        
        // only allow setting of active widget if another project widget is selected
        if (id != global.activeWidget.projectId) {   
            setActiveWidget(id, projectDir);  
        }             
    });
}

function widgetServerOnlineState(id) {
    // update view to reflect that server is running
    global.jQuery("#widgetStatus_" + id.toString()).addClass("widget-online");
    global.jQuery("#widgetStatusBottom_" + id.toString()).addClass("widget-online");                                                                           
    global.jQuery("#start-icon_" + id.toString()).attr("src", "img/icons/active/start-active.svg");
    global.jQuery("#hr-icon_" + id.toString()).css("opacity", 1.0);
    global.jQuery("#stop-icon_" + id.toString()).css("opacity", 1.0);<commit_msg>[#124] removed the click handler for the project widget so that only the play icon can be used to set active widget and start the server<commit_after>function addProjectWidget(id, projectName, projectVersion, projectIcon, projectDir) {
    console.log("addProjectWidget");
    
    var widgetId = "projectWidget_" + id.toString();
    var projectStatusId = "project-status_" + id.toString();
    var projectDetailsId = "project-details_" + id.toString();
    var projectDirId = "project-dir_" + id.toString();
    var deleteId = "delete_" + id.toString();
    var projectIconId = "projectIconId_" + id.toString();
    var projectNameLabel = "projectNameLabel_" + id.toString();
    var projectVersionLabel = "projectVersionLabel_" + id.toString();
    var widgetStatus = "widgetStatus_" + id.toString();
    var widgetStatusBottom = "widgetStatusBottom_" + id.toString();
    
    var widgetDOM = "";  
    
    // open the widget
    widgetDOM += "<div class='row widget-border' id='" + widgetId + "'>";

    widgetDOM += "<div id='" + widgetStatus + "' class='column widget-offline'>";    
    widgetDOM += "</div>";

    // project icon
    widgetDOM += "<div class='column project-icon-column'>";
    
	widgetDOM += "<div class='flip-container'>";
	widgetDOM += "<div class='flipper'>";
	
	widgetDOM += "<div class='front'>";
    widgetDOM += "<img id='" + projectIconId + "' height='64' width='64' src='" + projectIcon + "' />";
    widgetDOM += "</div>";  // front content
    
    widgetDOM += "<div class='back delete-holder' id=" + deleteId + ">";
    widgetDOM += "<button class='delete-button'>";
    widgetDOM += "<img src='img/icons/normal/delete.svg' />";
    widgetDOM += "</button>";
    widgetDOM += "</div>";  // back content
	
	widgetDOM += "</div>";  // flipper
	widgetDOM += "</div>";  // flip-container
       
    widgetDOM += "</div>";
    
    // project info
    widgetDOM += "<div class='column project-details-column' id='" + projectDetailsId + "'>";
    widgetDOM += "<div id='" + projectNameLabel + "' class='project-name'>" + projectName + "</div>";
    widgetDOM += "<div id='" + projectVersionLabel + "' class='project-version'>v" + projectVersion + "</div>";
    widgetDOM += "</div>";
    
    // indicator active project
    widgetDOM += "<div class='column project-indicator'>";
    widgetDOM += "<img id='start-icon_" + id.toString() + "' class='start-icon' src='img/icons/normal/start.svg' />";
    widgetDOM += "<img id='hr-icon_" + id.toString() + "' class='hr-icon' src='img/icons/normal/hr.svg' />";
    widgetDOM += "<img id='stop-icon_" + id.toString() + "' class='stop-icon' src='img/icons/normal/stop.svg' />";   
    widgetDOM += "</div>";
    
    // project folder
    widgetDOM += "<div class='row'>";
    
    widgetDOM += "<div id='" + widgetStatusBottom + "' class='column widget-offline'>";    
    widgetDOM += "</div>";
    
    widgetDOM += "<div class='column project-folder-column'>";
    widgetDOM += "<div class='localPath'>Local path:</div>"
    widgetDOM += "<div class='projDir'><a href='#' id='" + projectDirId + "' class='projectDirLink'>" + projectDir + "</a></div>";
    widgetDOM += "</div>";
    widgetDOM += "</div>";
    
    widgetDOM += "</div>";  // close the widget
    
    global.jQuery("#drop_zone").append(widgetDOM);
    enableMinusButton();
    global.jQuery("#guide-add").hide();
        
    global.jQuery("#" + deleteId).on("click", function(event) {
        console.log(deleteId);
        
        var temp = global.jQuery("#" + deleteId).attr("id").split("_");
        var clickedId = temp[1];
        
        removeProjectWidget(clickedId);
    });
        
    global.jQuery("#" + projectDirId).on("click", function() {
        opener(projectDir);     
    });
    
    global.jQuery("#start-icon_" + id.toString()).on("mouseover", function() {
        imgSwapper("start-icon_" + id.toString(), "img/icons/hover/start-hover.svg");
    });
    
    global.jQuery("#start-icon_" + id.toString()).on("mouseout", function() {
        if (id == global.activeWidget.projectId) {
            imgSwapper("start-icon_" + id.toString(), "img/icons/active/start-active.svg");
        } else {
            imgSwapper("start-icon_" + id.toString(), "img/icons/normal/start.svg");
        }        
    });

    global.jQuery("#start-icon_" + id.toString()).on("click", function() {
       setActiveWidget(id, projectDir);
       widgetServerOnlineState(id);
    });

    global.jQuery("#stop-icon_" + id.toString()).on("mouseover", function() {
        imgSwapper("stop-icon_" + id.toString(), "img/icons/hover/stop-hover.svg");
    });
    
    global.jQuery("#stop-icon_" + id.toString()).on("mouseout", function() {
        imgSwapper("stop-icon_" + id.toString(), "img/icons/normal/stop.svg");
    });
    
    global.jQuery("#stop-icon_" + id.toString()).on("click", function() {
        if (global.jQuery("#stop-icon_" + id.toString()).hasClass("stop-icon-active")) {
            // turn off the server
            setServerOffline();
            serverOfflineState();
            widgetSeverOfflineState(id);
        }
    });
}

function widgetServerOnlineState(id) {
    // update view to reflect that server is running
    global.jQuery("#widgetStatus_" + id.toString()).addClass("widget-online");
    global.jQuery("#widgetStatusBottom_" + id.toString()).addClass("widget-online");                                                                           
    global.jQuery("#start-icon_" + id.toString()).attr("src", "img/icons/active/start-active.svg");
    global.jQuery("#hr-icon_" + id.toString()).css("opacity", 1.0);
    global.jQuery("#stop-icon_" + id.toString()).css("opacity", 1.0);
{'fraction_non_alphanumeric': 0.19441340782122904, 'fraction_numerical': 0.0018908465835840139, 'mean_word_length': 2.9310810810810812, 'pattern_counts': {'":': 0, '<': 85, '<?xml version=': 0, '>': 85, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3795328', 'n_tokens_mistral': 3472, 'n_tokens_neox': 3366, 'n_words': 653}