<commit_before>function plus(){
    document.getElementById('number').innerHTML = parseInt(document.getElementById('number').innerHTML) + 1;
}

function reset(){
    if(confirm('Reset?')){
        localStorage.removeItem('plus-0');
        document.getElementById('number').innerHTML = 0;
    }
}

var unlocked = true;
document.getElementById('number').innerHTML = localStorage.getItem('plus-0') === null
  ? 0
  : localStorage.getItem('plus-0');

window.onbeforeunload = function(e){
    if(parseInt(document.getElementById('number').innerHTML) > 0){
        localStorage.setItem(
          'plus-0',
          document.getElementById('number').innerHTML
        );
    }
}

window.onkeydown = function(e){
    if(unlocked){
        unlocked = false;
        plus();
    }
};

window.onkeyup = function(e){
    unlocked = true;
};<commit_msg>changed localStorage key to Plus.htm-number, improved formatting<commit_after>function plus(){
    document.getElementById('number').innerHTML =
      parseInt(document.getElementById('number').innerHTML) + 1;
}

function reset(){
    if(confirm('Reset?')){
        localStorage.removeItem('Plus.htm-number');
        document.getElementById('number').innerHTML = 0;
    }
}

var unlocked = true;
document.getElementById('number').innerHTML =
  localStorage.getItem('Plus.htm-number') === null
    ? 0
    : localStorage.getItem('Plus.htm-number');

window.onbeforeunload = function(e){
    if(parseInt(document.getElementById('number').innerHTML) > 0){
        localStorage.setItem(
          'Plus.htm-number',
          document.getElementById('number').innerHTML
        );
    }
}

window.onkeydown = function(e){
    if(unlocked){
        unlocked = false;
        plus();
    }
};

window.onkeyup = function(e){
    unlocked = true;
};
{'fraction_non_alphanumeric': 0.15742296918767507, 'fraction_numerical': 0.0067226890756302525, 'mean_word_length': 3.4098765432098768, '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': '3563759', 'n_tokens_mistral': 521, 'n_tokens_neox': 514, 'n_words': 78}