Skip to content

Commit

Permalink
deploy: 8d046c3
Browse files Browse the repository at this point in the history
  • Loading branch information
brisvag committed Feb 23, 2024
1 parent e55dd86 commit c47384c
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: a0f004be76c52d6af5afebd8a29d7122
config: 7d00c8da7e35def71ded09978a50f7e9
tags: 645f666f9bcd5a90fca523b33c5a78b7
27 changes: 14 additions & 13 deletions _static/sphinx-thebe.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
var configureThebe = () => {
// Load thebe config in case we want to update it as some point
console.log("[sphinx-thebe]: Loading thebe config...");
thebe_config = $('script[type="text/x-thebe-config"]')[0];
thebe_config = document.querySelector("script[type=\"text/x-thebe-config\"]");

// If we already detect a Thebe cell, don't re-run
if (document.querySelectorAll("div.thebe-cell").length > 0) {
return;
}

// Update thebe buttons with loading message
$(".thebe-launch-button").each((ii, button) => {
document.querySelectorAll(".thebe-launch-button").forEach((button) => {
button.innerHTML = `
<div class="spinner">
<div class="rect1"></div>
Expand All @@ -28,14 +28,15 @@ var configureThebe = () => {
thebelab.on("status", function (evt, data) {
console.log("Status changed:", data.status, data.message);

$(".thebe-launch-button ")
.removeClass("thebe-status-" + thebeStatus)
.addClass("thebe-status-" + data.status)
.find(".loading-text")
.html(
"<span class='launch_msg'>Launching from mybinder.org: </span><span class='status'>" +
data.status +
"</span>"
const button = document.querySelector(".thebe-launch-button ");
button.classList.replace(
`thebe-status-${thebeStatus}`,
`thebe-status-${data.status}`
)
button.querySelector(".loading-text")
.innerHTML = (
`<span class='launch_msg'>Launching from mybinder.org: </span>
<span class='status'>${data.status}</span>`
);

// Now update our thebe status
Expand Down Expand Up @@ -76,8 +77,8 @@ var modifyDOMForThebe = () => {

// If we had an output, insert it just after the `pre` cell
if (codeCellOutput) {
$(codeCellOutput).attr("data-output", "");
$(codeCellOutput).insertAfter(codeCellText);
codeCellOutput.setAttribute("data-output", "");
codeCellText.insertAdjacentElement('afterend', codeCellOutput);
}
}

Expand All @@ -92,7 +93,7 @@ var initThebe = () => {
// Load thebe dynamically if it's not already loaded
if (typeof thebelab === "undefined") {
console.log("[sphinx-thebe]: Loading thebe from CDN...");
$(".thebe-launch-button ").text("Loading thebe from CDN...");
document.querySelector(".thebe-launch-button ").innerText = "Loading thebe from CDN...";

const script = document.createElement("script");
script.src = `${THEBE_JS_URL}`;
Expand Down
Loading

0 comments on commit c47384c

Please sign in to comment.