Skip to content

Commit 6b89c38

Browse files
committed
refactor code duplication of markdown renderers
1 parent 57a1c6e commit 6b89c38

File tree

7 files changed

+4
-231
lines changed

7 files changed

+4
-231
lines changed

notebook/static/notebook/js/outputarea.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,7 @@ define([
729729
clean_tables: true
730730
}, function (err, html) {
731731
toinsert.append(html);
732-
})
732+
});
733733
dblclick_to_reset_size(toinsert.find('img'));
734734
element.append(toinsert);
735735
return toinsert;

notebook/static/tree/js/directoryreadme.js

Lines changed: 0 additions & 185 deletions
This file was deleted.

notebook/static/tree/js/main.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ requirejs([
3636
'tree/js/terminallist',
3737
'tree/js/newnotebook',
3838
'tree/js/shutdownbutton',
39-
'tree/js/directoryreadme',
4039
'auth/js/loginwidget',
4140
'bidi/bidi',
4241
], function(
@@ -55,7 +54,6 @@ requirejs([
5554
terminallist,
5655
newnotebook,
5756
shutdownbutton,
58-
directoryreadme,
5957
loginwidget,
6058
bidi){
6159
"use strict";
@@ -102,8 +100,7 @@ requirejs([
102100
var kernel_list = new kernellist.KernelList('#running_list', $.extend({
103101
session_list: session_list},
104102
common_options));
105-
var directory_readme = new directoryreadme.DirectoryReadme('#directory_readme', notebook_list);
106-
103+
107104
var terminal_list;
108105
if (utils.get_body_data("terminalsAvailable") === "True") {
109106
terminal_list = new terminallist.TerminalList('#terminal_list', common_options);

notebook/static/tree/js/notebooklist.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1285,7 +1285,7 @@ define([
12851285
var element = $(this);
12861286
if (element.data("path") === path) {
12871287
element.remove();
1288-
events.trigger('notebook_deleted.NotebookList', [path]);
1288+
events.trigger('notebook_deleted.NotebookList');
12891289
that._selection_changed();
12901290
}
12911291
});

notebook/static/tree/less/tree.less

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,6 @@
1515
// The left padding of the selector button's contents.
1616
@dashboard-selectorbtn-lpad: 7px;
1717

18-
// The horizontal padding of the readme.
19-
@dashboard_readme_lr_pad: 21px;
20-
// The vertical padding of the readme.
21-
@dashboard_readme_top_pad: 7px;
22-
@dashboard_readme_bottom_pad: 14px;
23-
2418
ul#tabs {
2519
margin-bottom: @dashboard_tb_pad;
2620
}
@@ -416,16 +410,3 @@ ul#new-menu {
416410
display: inline-block;
417411
padding-top: @dashboard_tb_pad;
418412
}
419-
420-
#directory_readme {
421-
.readme_header {
422-
padding-top: @dashboard_tb_pad;
423-
padding-bottom: @dashboard_tb_pad;
424-
padding-left: @dashboard_lr_pad;
425-
padding-right: @dashboard_lr_pad;
426-
}
427-
428-
.readme_content {
429-
padding: @dashboard_readme_top_pad @dashboard_readme_lr_pad @dashboard_readme_bottom_pad;
430-
}
431-
}

notebook/templates/tree.html

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,5 @@
11
{% extends "page.html" %}
22

3-
{% block stylesheet %}
4-
5-
{% if mathjax_url %}
6-
<script type="text/javascript" src="{{mathjax_url}}?config={{mathjax_config}}&delayStartupUntil=configured" charset="utf-8"></script>
7-
{% endif %}
8-
<script type="text/javascript">
9-
// MathJax disabled, set as null to distinguish from *missing* MathJax,
10-
// where it will be undefined, and should prompt a dialog later.
11-
window.mathjax_url = "{{mathjax_url}}";
12-
</script>
13-
14-
<link rel="stylesheet" href="{{ static_url("components/codemirror/lib/codemirror.css") }}">
15-
16-
{{super()}}
17-
18-
{% endblock %}
19-
203
{% block title %}{{page_title}}{% endblock %}
214

225

@@ -159,7 +142,6 @@
159142
</div>
160143
</div>
161144
</div>
162-
<div id="directory_readme"></div>
163145
</div>
164146
<div id="running" class="tab-pane">
165147
<div id="running_toolbar" class="row">

notebook/tree/handlers.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,7 @@ def get(self, path=''):
5151
breadcrumbs=breadcrumbs,
5252
terminals_available=self.settings['terminals_available'],
5353
server_root=self.settings['server_root_dir'],
54-
shutdown_button=self.settings.get('shutdown_button', False),
55-
mathjax_url=self.mathjax_url,
56-
mathjax_config=self.mathjax_config
54+
shutdown_button=self.settings.get('shutdown_button', False)
5755
))
5856
elif cm.file_exists(path):
5957
# it's not a directory, we have redirecting to do

0 commit comments

Comments
 (0)