diff --git a/images/sprite.png b/images/sprite.png index 476a742103..d5d21d28d6 100644 Binary files a/images/sprite.png and b/images/sprite.png differ diff --git a/js/jupyter.js b/js/jupyter.js index 0b8d01e32a..ad76143263 100644 --- a/js/jupyter.js +++ b/js/jupyter.js @@ -5,11 +5,11 @@ var lockEvent = false; if (method === "PUT") { // if(!lockEvent) try { - if(url.indexOf("/api/workspaces/default") > -1){ + if (url.indexOf("/api/workspaces/default") > -1) { return - } + } } catch (error) { - + }; window.top.postMessage('jupytermessage', '*'); } @@ -26,12 +26,12 @@ var lockEvent = false; if (options.method === "PUT" || (typeof url === "object" && url.method === "PUT")) { // if(!lockEvent) try { - if(url.url.indexOf("/api/workspaces/default") > -1){ - return + if (url.url.indexOf("/api/workspaces/default") > -1) { + return } - } catch (error) { - - }; + } catch (error) { + + }; window.top.postMessage('jupytermessage', '*'); } } catch (error) { @@ -57,9 +57,9 @@ function saveCode() { try { document.querySelector("[data-jupyter-action='jupyter-notebook:save-notebook']").click(); } catch (error) { - + } - + var saveEvent = new KeyboardEvent('keydown', { key: 's', @@ -85,3 +85,39 @@ function onReceiveMessage(e) { window.addEventListener('message', onReceiveMessage); + + + +function getJupyterPath() { + var el = document.querySelector('.jp-mod-running'); + if (!el) return; + + var title = el.getAttribute('title') || ''; + + var lines = title.split('\n'); + + var name = null; + var path = null; + + for (var i = 0; i < lines.length; i++) { + var line = lines[i].trim(); + + if (line.indexOf('Name:') === 0) { + name = line.replace('Name:', '').trim(); + } + + if (line.indexOf('Path:') === 0) { + path = line.replace('Path:', '').trim(); + } + } + + var fullPath = null; + if (path && name) { + fullPath = path.replace(/\/$/, '') + '/' + name; + } + + console.log(fullPath); + + sessionStorage.jupyterOpenPath = fullPath +} +setInterval(() => {getJupyterPath()},1000) diff --git a/p__tasks__index.792fcf7a.async.js b/p__tasks__index.ba1ae3f0.async.js similarity index 98% rename from p__tasks__index.792fcf7a.async.js rename to p__tasks__index.ba1ae3f0.async.js index 10f824ce2f..cd2e751a68 100644 --- a/p__tasks__index.792fcf7a.async.js +++ b/p__tasks__index.ba1ae3f0.async.js @@ -1441,7 +1441,7 @@ Arguments: `+Array.prototype.slice.call(bu).join("")+` -ms-user-select: none; /* Internet Explorer/Edge */ user-select: none; /* Non-prefixed version, currently supported by Chrome, Edge, Opera and Firefox */">