Skip to content

Commit

Permalink
fix base url and asset path inside iframes on juliabox
Browse files Browse the repository at this point in the history
  • Loading branch information
rdeits committed May 4, 2018
1 parent b7ed98f commit 59c2646
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/iframe.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,23 @@ function iframe(dom)
var frame = this.dom.querySelector("#ifr");
var doc = frame.contentDocument
var win = frame.contentWindow
// Determine if we're running on a Jupyter hosting service
// that requires a base URL when retrieving assets
var curMatch =
window.location.href
.match(/(.*)\/notebooks\/.*\.ipynb/);
curMatch = curMatch ||
window.location.href
.match(/(.*)\/apps\/.*\.ipynb/);
if (curMatch) {
var base = doc.createElement("base");
base.setAttribute("href", curMatch[1] + '/');
doc.head.appendChild(base);
}
var webio = doc.createElement("script")
webio.src = "/pkg/WebIO/webio/dist/bundle.js"
webio.src = "pkg/WebIO/webio/dist/bundle.js"
var parent = window
function resizeIframe() {
Expand Down

0 comments on commit 59c2646

Please sign in to comment.