<commit_before>function hideClick(name) {
  let v = document.getElementsByClassName(name);
  let i = 0;
  for (i = 0; i < v.length; i++) {
    v[i].style.display = 'none';
  }
  v = document.getElementsByClassName('li'+name);
  for (i=0;i<v.length;i++) {
      v[i].classList.remove('live');
    }
}
function showClick(name) {
  let v = document.getElementsByClassName(name);
  let i = 0;
  for (i = 0; i < v.length; i++) {
    v[i].style.marginLeft = "39.33px"
    v[i].style.marginTop = "-8px";
    v[i].style.display = 'inline-block';
    v[i].style.width = "575px";
    v[i].style.border = "ridge";
    v[i].style.borderColor = "silver";
    v[i].style.borderWidth = "7px";
    console.log(v[i].classList);
  }
  v = document.getElementsByClassName('li'+name);
  for (i=0;i<v.length;i++) {
      v[i].classList.add('live');
    }
}

function addli(ul, onclik, txt) {
  let li = document.createElement('li');
  let a = document.createElement('a');
  li.className = 'li'+txt;
  a.onclick = onclik;
  a.href = '#';
  a.textContent = txt;
  li.appendChild(a);
  ul.appendChild(li);
}

function onrun() {

  let tabs = document.getElementsByClassName("tabview");
  for (i = 0; i < tabs.length; i++) {
    let ul = document.createElement('ul');
    ul.className = "tabs";
    addli(ul, function(){hideClick('.net');hideClick('C++');showClick('node.js');return false;}, 'node.js');
    addli(ul, function(){hideClick('node.js');hideClick('C++');showClick('.net');return false;}, '.net');
    addli(ul, function(){hideClick('.net');hideClick('node.js');showClick('C++');return false;}, 'C++');
    tabs[i].insertBefore(ul,tabs[i].firstChild);
  }
  hideClick('node.js');
  hideClick('C++');
  showClick('.net');
}<commit_msg>Tab scrolling fix<commit_after>function onClick() {
    let elementOffset = this.offsetTop;
    let tabsToHide = ["node.js", ".net", "C++"];
    tabsToHide.splice(tabsToHide.indexOf(this.text), 1);
    tabsToHide.forEach(hideTab);
    showTab(this.text);
    window.scrollBy(0, (this.offsetTop - elementOffset));
}

function hideTab(name) {
    let elementsToHide = document.getElementsByClassName(name);
    for (let i = 0; i < elementsToHide.length; i++) {
        elementsToHide[i].style.display = 'none';
    }
    elementsToHide = document.getElementsByClassName('li' + name);
    for (let i = 0; i < elementsToHide.length; i++) {
        elementsToHide[i].className = ('li' + name)
    }
}

function showTab(name) {
    let v = document.getElementsByClassName(name);
    for (let i = 0; i < v.length; i++) {
        v[i].style.marginLeft = "39.33px"
        v[i].style.marginTop = "-8px";
        v[i].style.display = 'inline-block';
        v[i].style.width = "575px";
        v[i].style.border = "ridge";
        v[i].style.borderColor = "silver";
        v[i].style.borderWidth = "7px";
    }
    v = document.getElementsByClassName('li' + name);
    for (i = 0; i < v.length; i++) {
        v[i].classList.add('live');
    }
}

function addli(ul, txt) {
    let li = document.createElement('li');
    let a = document.createElement('a');
    li.className = 'li' + txt;
    a.onclick = onClick;
    a.textContent = txt;
    li.appendChild(a);
    ul.appendChild(li);
}

function onrun() {
    let tabs = document.getElementsByClassName("tabview");
    for (let i = 0; i < tabs.length; i++) {
        let ul = document.createElement('ul');
        ul.className = "tabs";
        addli(ul, 'node.js');
        addli(ul, '.net');
        addli(ul, 'C++');
        tabs[i].insertBefore(ul, tabs[i].firstChild);
    }
    hideTab('node.js');
    hideTab('C++');
    showTab('.net');
}
{'fraction_non_alphanumeric': 0.19950124688279303, 'fraction_numerical': 0.00886672208367969, 'mean_word_length': 3.272189349112426, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 3, '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': '6157799', 'n_tokens_mistral': 1315, 'n_tokens_neox': 1286, 'n_words': 234}