From 7c2b0e2af2f99d73aee8ec7d8bc00b9eb8dbd18d Mon Sep 17 00:00:00 2001 From: Marc Wouts Date: Mon, 10 Dec 2018 23:54:28 +0100 Subject: [PATCH] Simpler UI #86 --- jupytext/nbextension/jupytext.js | 168 +++++++++++++++++++++---------- 1 file changed, 113 insertions(+), 55 deletions(-) diff --git a/jupytext/nbextension/jupytext.js b/jupytext/nbextension/jupytext.js index 151758f8a..1814d0a8a 100644 --- a/jupytext/nbextension/jupytext.js +++ b/jupytext/nbextension/jupytext.js @@ -33,6 +33,16 @@ define([ "use strict"; var show_notebook_settings_dialog = function () { + if (!('jupytext' in Jupyter.notebook.metadata)) + Jupyter.notebook.metadata.jupytext = {}; + + var jpmd = Jupyter.notebook.metadata.jupytext; + + var notebook_path = Jupyter.notebook.notebook_path; + var notebook_ext = notebook_path.split('.').pop().toLowerCase(); + var script_ext = Jupyter.notebook.metadata.language_info.file_extension; + var script_language = Jupyter.notebook.metadata.language_info.name; + script_language = script_language[0].toUpperCase() + script_language.substr(1); var modal = $('