##// END OF EJS Templates
Adding base_project_url and base_kernel_url as HTML data attribs....
Brian E. Granger -
Show More
@@ -57,7 +57,8 b' class NBBrowserHandler(AuthenticatedHandler):'
57 def get(self):
57 def get(self):
58 nbm = self.application.notebook_manager
58 nbm = self.application.notebook_manager
59 project = nbm.notebook_dir
59 project = nbm.notebook_dir
60 self.render('nbbrowser.html', project=project)
60 self.render('nbbrowser.html', project=project,
61 base_project_url=u'/', base_kernel_url=u'/')
61
62
62 class LoginHandler(AuthenticatedHandler):
63 class LoginHandler(AuthenticatedHandler):
63 def get(self):
64 def get(self):
@@ -75,7 +76,8 b' class NewHandler(AuthenticatedHandler):'
75 @web.authenticated
76 @web.authenticated
76 def get(self):
77 def get(self):
77 notebook_id = self.application.notebook_manager.new_notebook()
78 notebook_id = self.application.notebook_manager.new_notebook()
78 self.render('notebook.html', notebook_id=notebook_id)
79 self.render('notebook.html', notebook_id=notebook_id,
80 base_project_url=u'/', base_kernel_url=u'/')
79
81
80
82
81 class NamedNotebookHandler(AuthenticatedHandler):
83 class NamedNotebookHandler(AuthenticatedHandler):
@@ -84,7 +86,8 b' class NamedNotebookHandler(AuthenticatedHandler):'
84 nbm = self.application.notebook_manager
86 nbm = self.application.notebook_manager
85 if not nbm.notebook_exists(notebook_id):
87 if not nbm.notebook_exists(notebook_id):
86 raise web.HTTPError(404, u'Notebook does not exist: %s' % notebook_id)
88 raise web.HTTPError(404, u'Notebook does not exist: %s' % notebook_id)
87 self.render('notebook.html', notebook_id=notebook_id)
89 self.render('notebook.html', notebook_id=notebook_id,
90 base_project_url=u'/', base_kernel_url=u'/')
88
91
89
92
90 #-----------------------------------------------------------------------------
93 #-----------------------------------------------------------------------------
@@ -87,7 +87,7 b' var IPython = (function (IPython) {'
87
87
88
88
89 SaveWidget.prototype.get_notebook_id = function () {
89 SaveWidget.prototype.get_notebook_id = function () {
90 return this.element.find('span#notebook_id').text()
90 return $('body').data('notebookId');
91 };
91 };
92
92
93
93
@@ -17,7 +17,7 b''
17
17
18 </head>
18 </head>
19
19
20 <body>
20 <body data-base-project-url={{base_project_url}} data-base-kernel-url={{base_kernel_url}}>
21
21
22 <div id="header">
22 <div id="header">
23 <span id="ipython_notebook"><h1>IPython Notebook</h1></span>
23 <span id="ipython_notebook"><h1>IPython Notebook</h1></span>
@@ -47,13 +47,13 b''
47
47
48 </head>
48 </head>
49
49
50 <body onload='CheckMathJax();'>
50 <body data-base-project-url={{base_project_url}} data-base-kernel-url={{base_kernel_url}}
51 data-notebook-id={{notebook_id}} onload='CheckMathJax();'>
51
52
52 <div id="header">
53 <div id="header">
53 <span id="ipython_notebook"><h1>IPython Notebook</h1></span>
54 <span id="ipython_notebook"><h1>IPython Notebook</h1></span>
54 <span id="save_widget">
55 <span id="save_widget">
55 <input type="text" id="notebook_name" size="20"></textarea>
56 <input type="text" id="notebook_name" size="20"></textarea>
56 <span id="notebook_id" style="display:none">{{notebook_id}}</span>
57 <button id="save_notebook"><u>S</u>ave</button>
57 <button id="save_notebook"><u>S</u>ave</button>
58 </span>
58 </span>
59 <span id="quick_help_area">
59 <span id="quick_help_area">
General Comments 0
You need to be logged in to leave comments. Login now