<commit_before>﻿function init() {
    for (var i = 1, l = DATA.storyline.length; i <= l; i++) {
        var storylineID = DATA.storyline[i - 1].id + "";
        var content = "<div data-role='collapsible' id='storyline" + i + "'><h3>" + DATA.storyline[(i - 1)].title[0].title + "</h3><p>" + DATA.storyline[(i - 1)].description[0].description + "</p><br><input type='submit' value='Start' onclick='startStoryline(\"" + storylineID + "\")' style='background-color:rgba(61,139,255,1); color:white; border-radius:2px; border-color:rgba(61,139,255,1);'/>&nbsp;&nbsp;<input type='submit' value='Preview' onclick='previewStoryline(\"" + storylineID + "\")' style='background-color:rgba(61,139,255,1); color:white; border-radius:2px; border-color:rgba(61,139,255,1);'/></div>";
        $("#storylines").append(content).collapsibleset('refresh');
    }
}

function previewStoryline(storylineID) {
    localStorage.setItem("currentStoryline", storylineID);
    location.replace("storyline_index.html");
}

function startStoryline(storylineID) {
    localStorage.setItem("currentStoryline", storylineID);
    localStorage.setItem("startIsSelected", "true");
    window.location.replace("storyline_index.html");
}<commit_msg>XM-73 HotFix, accidentally removed logic to fix an edge case. Reinserting code now. #RobertoRuffoloBenavides<commit_after>﻿function init() {
    if (localStorage.getItem("startIsSelected") == "true" && localStorage.getItem("currentStoryline") != null) {
        startStoryline(localStorage.getItem("currentStoryline"));

    }
    else if (localStorage.getItem("currentStoryline") != null) {
        previewStoryline(localStorage.getItem("currentStoryline"));
    }
    else {
        for (var i = 1, l = DATA.storyline.length; i <= l; i++) {
            var storylineID = DATA.storyline[i - 1].id + "";
            var content = "<div data-role='collapsible' id='storyline" + i + "'><h3>" + DATA.storyline[(i - 1)].title[0].title + "</h3><p>" + DATA.storyline[(i - 1)].description[0].description + "</p><br><input type='submit' value='Start' onclick='startStoryline(\"" + storylineID + "\")' style='background-color:rgba(61,139,255,1); color:white; border-radius:2px; border-color:rgba(61,139,255,1);'/>&nbsp;&nbsp;<input type='submit' value='Preview' onclick='previewStoryline(\"" + storylineID + "\")' style='background-color:rgba(61,139,255,1); color:white; border-radius:2px; border-color:rgba(61,139,255,1);'/></div>";
            $("#storylines").append(content).collapsibleset('refresh');
        }
    }
}

function previewStoryline(storylineID) {
    localStorage.setItem("currentStoryline", storylineID);
    location.replace("storyline_index.html");
}

function startStoryline(storylineID) {
    localStorage.setItem("currentStoryline", storylineID);
    localStorage.setItem("startIsSelected", "true");
    window.location.replace("storyline_index.html");
}
{'fraction_non_alphanumeric': 0.19285466527922304, 'fraction_numerical': 0.03260492542490461, 'mean_word_length': 5.228941684665227, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 21, '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': '5321915', 'n_tokens_mistral': 996, 'n_tokens_neox': 913, 'n_words': 139}