From e4c79c47400c65a8b596fcc1ee73c879b8e7d42b Mon Sep 17 00:00:00 2001 From: djsegal Date: Wed, 21 Mar 2018 18:06:22 -0400 Subject: [PATCH 1/5] Allow arbitrary jupyter host configs for setup --- src/providers/ijulia_setup.jl | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/providers/ijulia_setup.jl b/src/providers/ijulia_setup.jl index aa8e7c5f..686ce10e 100644 --- a/src/providers/ijulia_setup.jl +++ b/src/providers/ijulia_setup.jl @@ -16,8 +16,20 @@ function WebIO.register_renderable(T::Type) end function main() - display(HTML("")) - display(HTML("")) + display(HTML(""" + + """)) + + display(HTML("")) + display(HTML("")) comm = Comm(:webio_comm) conn = IJuliaConnection(comm) @@ -25,6 +37,7 @@ function main() data = msg.content["data"] WebIO.dispatch(conn, data) end + nothing end From 4fbbe1b8b0618a7695adf24fdfbee6ecef53d1f7 Mon Sep 17 00:00:00 2001 From: djsegal Date: Fri, 23 Mar 2018 13:22:33 -0400 Subject: [PATCH 2/5] Get webcomponents working in safari and firefox --- assets/webio/dist/bundle.js | 8 +++++++- assets/webio/unsafe_script.js | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/assets/webio/dist/bundle.js b/assets/webio/dist/bundle.js index 54be4d5a..d30e643a 100644 --- a/assets/webio/dist/bundle.js +++ b/assets/webio/dist/bundle.js @@ -3030,7 +3030,13 @@ module.exports = isArray || function (val) { if (!webComponentsSupported) { var script = document.createElement('script'); script.async = true; - script.src = '/pkg/WebIO/webio/dist/webcomponents-lite.min.js'; + + if ( document.getElementsByTagName("base").length === 0 ) { + script.src = '/pkg/WebIO/webio/dist/webcomponents-lite.min.js'; + } else { + script.src = 'pkg/WebIO/webio/dist/webcomponents-lite.min.js'; + } + document.head.appendChild(script); document.addEventListener("WebComponentsReady", function () { if (customElements.get("unsafe-script") === undefined) { diff --git a/assets/webio/unsafe_script.js b/assets/webio/unsafe_script.js index 3cb7a89d..e9e77880 100644 --- a/assets/webio/unsafe_script.js +++ b/assets/webio/unsafe_script.js @@ -26,7 +26,13 @@ if (!webComponentsSupported) { var script = document.createElement('script'); script.async = true; - script.src = '/pkg/WebIO/webio/dist/webcomponents-lite.min.js'; + + if ( document.getElementsByTagName("base").length === 0 ) { + script.src = '/pkg/WebIO/webio/dist/webcomponents-lite.min.js'; + } else { + script.src = 'pkg/WebIO/webio/dist/webcomponents-lite.min.js'; + } + document.head.appendChild(script); document.addEventListener("WebComponentsReady", function () { if (customElements.get("unsafe-script") === undefined) { From 541ece06178aee0e8b7b4082e91527cdaa4d64d9 Mon Sep 17 00:00:00 2001 From: djsegal Date: Wed, 28 Mar 2018 17:30:44 -0400 Subject: [PATCH 3/5] Get WebIO working with appmode in jupyter --- src/providers/ijulia_setup.jl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/providers/ijulia_setup.jl b/src/providers/ijulia_setup.jl index 686ce10e..94b5892a 100644 --- a/src/providers/ijulia_setup.jl +++ b/src/providers/ijulia_setup.jl @@ -20,7 +20,11 @@ function main() """)) - display(HTML("")) - display(HTML("")) + display(HTML("")) + display(HTML("")) + + display(HTML("")) comm = Comm(:webio_comm) conn = IJuliaConnection(comm) From 2cf426e414efaabdf1a1d46703f5315bb596c1bd Mon Sep 17 00:00:00 2001 From: djsegal Date: Thu, 29 Mar 2018 01:17:34 -0400 Subject: [PATCH 5/5] Replace script removal with padding collapsing --- src/providers/ijulia_setup.jl | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/providers/ijulia_setup.jl b/src/providers/ijulia_setup.jl index 943e3bd1..90579509 100644 --- a/src/providers/ijulia_setup.jl +++ b/src/providers/ijulia_setup.jl @@ -17,7 +17,7 @@ end function main() display(HTML(""" - """)) - display(HTML("")) - display(HTML("")) + display(HTML("")) + display(HTML("")) - display(HTML("")) + display(HTML(""" + + """)) comm = Comm(:webio_comm) conn = IJuliaConnection(comm)