<commit_before>var currentStep = 0;
var lastStep = 0;
var isHash = window.location.hash === "#success";
var tagsInputInitialized = false;
var isModalReady = true;
var hasSecretKeyInputChanged = false;
const REG_STEP_DELETE = -1; // currentStep value for delete confirmation fieldset
const REG_STEP_NO_PLACE = 3; // fieldset ID in registration form for users with no place
const REG_STEP_HAS_PLACE = 4; // fieldset ID in registration form for users with a place

$(document).ready(function(){
    lastStep = $('#registration-form fieldset:not(#confirmDelete)').length-1;

    // Load city data when modal is opened.
    $('#registerModal').on('shown.bs.modal', function() {
        hideErrorMessage();
        hideSuccessMessage();
        $('#registration-form .modal-header').removeClass('bg-danger');
        if(!tagsInputInitialized && $('#pref-locations').length > 0) {
            readAndInitCityTags();
            tagsInputInitialized = true;
        }
    });
    // Show modal on page load if '#success' is in url.
    if(isHash) {
        $('#registerModal').modal("show");
    }<commit_msg>Fixed bug: delete confirmation dialog header would turn blue if user clicked outside of modal to dismiss and then clicked button to open modal again.<commit_after>var currentStep = 0;
var lastStep = 0;
var isHash = window.location.hash === "#success";
var tagsInputInitialized = false;
var isModalReady = true;
var hasSecretKeyInputChanged = false;
const REG_STEP_DELETE = -1; // currentStep value for delete confirmation fieldset
const REG_STEP_NO_PLACE = 3; // fieldset ID in registration form for users with no place
const REG_STEP_HAS_PLACE = 4; // fieldset ID in registration form for users with a place

$(document).ready(function(){
    lastStep = $('#registration-form fieldset:not(#confirmDelete)').length-1;

    // Load city data when modal is opened.
    $('#registerModal').on('shown.bs.modal', function() {
        hideErrorMessage();
        hideSuccessMessage();
        if(currentStep !== REG_STEP_DELETE)
            $('#registration-form .modal-header').removeClass('bg-danger');
        if(!tagsInputInitialized && $('#pref-locations').length > 0) {
            readAndInitCityTags();
            tagsInputInitialized = true;
        }
    });
    // Show modal on page load if '#success' is in url.
    if(isHash) {
        $('#registerModal').modal("show");
    }
{'fraction_non_alphanumeric': 0.125314333612741, 'fraction_numerical': 0.00586756077116513, 'mean_word_length': 3.495291902071563, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '2803503', 'n_tokens_mistral': 662, 'n_tokens_neox': 650, 'n_words': 204}