From 6e65df4c54f18730a0aa577f47dcb6064029819b Mon Sep 17 00:00:00 2001 From: Dave Aitken Date: Thu, 12 Apr 2018 14:32:41 +0100 Subject: [PATCH 1/4] Include baseUrl in download_notebook AJAX path --- src/jupyter_notebook_gist/static/common.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jupyter_notebook_gist/static/common.js b/src/jupyter_notebook_gist/static/common.js index 351f0cf..990c8b2 100644 --- a/src/jupyter_notebook_gist/static/common.js +++ b/src/jupyter_notebook_gist/static/common.js @@ -100,7 +100,7 @@ define([ force_download: force_download } utils.ajax({ - url: "/download_notebook", + url: utils.url_path_join(utils.get_body_data("baseUrl"), "/download_notebook"), type: "POST", dataType: "json", data: JSON.stringify(nb_info) From 9e1c0c05ed5602d08fccc4c959ddf8b0f07d0335 Mon Sep 17 00:00:00 2001 From: Dave Aitken Date: Thu, 12 Apr 2018 14:40:45 +0100 Subject: [PATCH 2/4] Notebook path should be relative to server path --- src/jupyter_notebook_gist/static/notebook-extension.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jupyter_notebook_gist/static/notebook-extension.js b/src/jupyter_notebook_gist/static/notebook-extension.js index ab4883b..1b2d4f2 100644 --- a/src/jupyter_notebook_gist/static/notebook-extension.js +++ b/src/jupyter_notebook_gist/static/notebook-extension.js @@ -13,7 +13,7 @@ define([ // Characters like # get decoded by the github API and will mess up // getting the file path on the server if we use URI percent encoding, // so we use base64 instead - var nb_path = window.btoa(Jupyter.notebook.base_url + Jupyter.notebook.notebook_path); + var nb_path = window.btoa(Jupyter.notebook.notebook_path); // Start OAuth dialog window.open("https://github.com/login/oauth/authorize?client_id=" + github_client_id + From cbe7973b102b739c7e3805bb048e208689ed9115 Mon Sep 17 00:00:00 2001 From: Dave Aitken Date: Thu, 12 Apr 2018 18:04:59 +0100 Subject: [PATCH 3/4] Fix typo --- src/jupyter_notebook_gist/static/tree-extension.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jupyter_notebook_gist/static/tree-extension.js b/src/jupyter_notebook_gist/static/tree-extension.js index 47523bb..7b96f3c 100644 --- a/src/jupyter_notebook_gist/static/tree-extension.js +++ b/src/jupyter_notebook_gist/static/tree-extension.js @@ -52,7 +52,7 @@ define([ "load all user gists", "fa-list", common.load_all_user_gists, - "load_add_user_gists"); + "load_all_user_gists"); } }); } From d1199d6d0204c816811c47f50b1a918b0f3044ac Mon Sep 17 00:00:00 2001 From: Dave Aitken Date: Fri, 13 Apr 2018 11:09:19 +0100 Subject: [PATCH 4/4] Handle https proto+port in get_base_path --- src/jupyter_notebook_gist/static/common.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jupyter_notebook_gist/static/common.js b/src/jupyter_notebook_gist/static/common.js index 990c8b2..f2d701c 100644 --- a/src/jupyter_notebook_gist/static/common.js +++ b/src/jupyter_notebook_gist/static/common.js @@ -11,7 +11,7 @@ define([ var port = loc.port; var base = proto + "//" + host; - if (parseInt(port) != 80) { + if ((proto == 'http' && parseInt(port) != 80) || (proto == 'https' && parseInt(port) != 443)) { base += ":" + port; } return base;