<commit_before>outputVisible = false;

getFirebaseRef().child("environment").on("value", snap => {
  if (snap.val() !== null) {
    document.getElementById("executeButton").classList.remove("hidden");
    if (!outputVisible) {
      toggleOutput();
    }
  }
});

function executeCode() {
  const executeButton = document.getElementById("executeButton");
  executeButton.classList.add("download-in-progress");
  executeButton.disabled = true;
  getToken().then(tok => {
    fetch(`/workspace/queueExecution?workspaceID=${getParam("workspaceID")}&idToken=${tok}`)
      .then(resp => resp.text()).then(execID => {
        getFirebaseRef().child("executions").child(execID).on("value", snap => {
          if (snap.val() !== null) {
            const pre = document.createElement("pre");
            pre.innerText = snap.val();

            const outputContainer = document.getElementById("output-container");
            outputContainer.innerHTML = "";
            outputContainer.appendChild(pre);

            executeButton.disabled = false;
            executeButton.classList.remove("download-in-progress");
            getFirebaseRef().child("executions").child(execID).off("value");
          }
        });
      });
  });
}

function toggleOutput() {
  document.getElementById("output-container").classList.toggle("hidden");
  
  if(outputVisible) {
    document.getElementById("output-minimize-button").innerText = String.fromCodePoint(0x25B2);
  } else {
    document.getElementById("output-minimize-button").innerText = String.fromCodePoint(0x25BC);
  }

  outputVisible = !outputVisible;

  tabs[currentTab].editor.layout();
}<commit_msg>Move toggleOutput call to the correct function.<commit_after>outputVisible = false;

getFirebaseRef().child("environment").on("value", snap => {
  if (snap.val() !== null) {
    document.getElementById("executeButton").classList.remove("hidden");
  }
});


function toggleOutput() {
  document.getElementById("output-container").classList.toggle("hidden");
  
  if(outputVisible) {
    document.getElementById("output-minimize-button").innerText = String.fromCodePoint(0x25B2);
  } else {
    document.getElementById("output-minimize-button").innerText = String.fromCodePoint(0x25BC);
  }

  outputVisible = !outputVisible;

  tabs[currentTab].editor.layout();
}

function executeCode() {
  const executeButton = document.getElementById("executeButton");
  executeButton.classList.add("download-in-progress");
  executeButton.disabled = true;
  getToken().then(tok => {
    fetch(`/workspace/queueExecution?workspaceID=${getParam("workspaceID")}&idToken=${tok}`)
      .then(resp => resp.text()).then(execID => {
        getFirebaseRef().child("executions").child(execID).on("value", snap => {
          if (snap.val() !== null) {
            const pre = document.createElement("pre");
            pre.innerText = snap.val();

            const outputContainer = document.getElementById("output-container");
            outputContainer.innerHTML = "";
            outputContainer.appendChild(pre);

            executeButton.disabled = false;
            executeButton.classList.remove("download-in-progress");
            getFirebaseRef().child("executions").child(execID).off("value");
            
            if (!outputVisible) {
              toggleOutput();
            }        
          }
        });
      });
  });
}
{'fraction_non_alphanumeric': 0.16024881516587677, 'fraction_numerical': 0.004146919431279621, 'mean_word_length': 3.3971354166666665, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '235728', 'n_tokens_mistral': 920, 'n_tokens_neox': 907, 'n_words': 114}