<commit_before>function setFrame() {
    let iframe = document.createElement('iframe');
  iframe.setAttribute('src', window.state.url);
  iframe.setAttribute('width', '100%;');
  iframe.setAttribute('height', '100%;');
  iframe.setAttribute('style', 'border-style: none !important;');
  let inner = document.getElementById("frame");
  inner.innerHTML = "";
  inner.appendChild(iframe);
  iframe.focus();
}

function doSub() {
  window.urb.subscribe(window.ship, "modulo", "/applist",
    (err) => {
      console.log(err);
    },
    (event) => {
      console.log(event);
      window.state = event;
      setFrame();
    },
    () => {
      doSub();
    }
  );
}

window.addEventListener("message", (event) => {
  let popup = document.getElementById("popup");
  let input = document.getElementById("input");

  popup.style = "position:absolute; left: 0; top: 0; display:block; width: 100%; height: 100%; margin: 0 0; background-color:white;";
  input.style = "";
  input.addEventListener("keyup", (e) => {
    if (e.keyCode !== 13) { return; }
    popup.style = "display:hidden;";
    popup.style = "visibility:hidden !important;";

    window.urb.poke(window.ship, "modulo", "modulo-command", 
      {
        go: input.value
      },
      (json) => {
        console.log(json);
      },
      (err) => {
        console.log(err);
      }
    );

  });


});

setFrame();
doSub();
<commit_msg>added popdown and autofocus to command palette<commit_after>function setFrame() {
    let iframe = document.createElement('iframe');
  iframe.setAttribute('src', window.state.url);
  iframe.setAttribute('width', '100%;');
  iframe.setAttribute('height', '100%;');
  iframe.setAttribute('style', 'border-style: none !important;');
  let inner = document.getElementById("frame");
  inner.innerHTML = "";
  inner.appendChild(iframe);
  iframe.focus();
}

function doSub() {
  window.urb.subscribe(window.ship, "modulo", "/applist",
    (err) => {
      console.log(err);
    },
    (event) => {
      console.log(event);
      window.state = event;
      setFrame();
    },
    () => {
      doSub();
    }
  );
}

var palette = false;

window.addEventListener("message", (event) => {
  let popup = document.getElementById("popup");
  let input = document.getElementById("input");

  if (palette) {
    palette = false;
    popup.style = "display:hidden;";
    input.style = "visibility:hidden !important;";
    input.value = "";
  } else {
    palette = true;

    popup.style = "position:absolute; left: 0; top: 0; display:block; width: 100%; height: 100%; margin: 0 0; background-color:white;";
    input.style = "";
    input.focus();
    input.addEventListener("keyup", (e) => {
      if (e.keyCode !== 13) { return; }
      popup.style = "display:hidden;";
      popup.style = "visibility:hidden !important;";

      window.urb.poke(window.ship, "modulo", "modulo-command", 
        {
          go: input.value
        },
        (json) => {
          console.log(json);
        },
        (err) => {
          console.log(err);
        }
      );

    });
  }
});

setFrame();
doSub();

{'fraction_non_alphanumeric': 0.1878238341968912, 'fraction_numerical': 0.011658031088082901, 'mean_word_length': 2.9350318471337578, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, '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': '3264754', 'n_tokens_mistral': 1049, 'n_tokens_neox': 972, 'n_words': 183}