uimod_embed.js 785 B

123456789101112131415161718192021
  1. // Copyright (c) Jupyter Development Team
  2. // Copyright (c) 2014, Ramalingam Saravanan <sarava@sarava.net>
  3. // Distributed under the terms of the Simplified BSD License.
  4. window.addEventListener(
  5. "load",
  6. function () {
  7. var containers = document.getElementsByClassName("terminado-container");
  8. var container, rows, cols, protocol, ws_url;
  9. for (var i = 0; i < containers.length; i++) {
  10. container = containers[i];
  11. rows = parseInt(container.dataset.rows);
  12. cols = parseInt(container.dataset.cols);
  13. protocol = window.location.protocol.indexOf("https") === 0 ? "wss" : "ws";
  14. ws_url =
  15. protocol + "://" + window.location.host + container.dataset.wsUrl;
  16. make_terminal(container, { rows: rows, cols: cols }, ws_url);
  17. }
  18. },
  19. false,
  20. );