diff --git a/src/jupyter_notebook_gist/static/common.js b/src/jupyter_notebook_gist/static/common.js index 351f0cf..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; @@ -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) 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 + 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"); } }); }