Skip to content

Commit

Permalink
refactor code duplication of markdown renderers
Browse files Browse the repository at this point in the history
  • Loading branch information
toonijn committed Jul 23, 2020
1 parent 3f50688 commit 238828e
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 231 deletions.
2 changes: 1 addition & 1 deletion notebook/static/notebook/js/outputarea.js
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ define([
clean_tables: true
}, function (err, html) {
toinsert.append(html);
})
});
dblclick_to_reset_size(toinsert.find('img'));
element.append(toinsert);
return toinsert;
Expand Down
185 changes: 0 additions & 185 deletions notebook/static/tree/js/directoryreadme.js

This file was deleted.

5 changes: 1 addition & 4 deletions notebook/static/tree/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ requirejs([
'tree/js/terminallist',
'tree/js/newnotebook',
'tree/js/shutdownbutton',
'tree/js/directoryreadme',
'auth/js/loginwidget',
'bidi/bidi',
], function(
Expand All @@ -55,7 +54,6 @@ requirejs([
terminallist,
newnotebook,
shutdownbutton,
directoryreadme,
loginwidget,
bidi){
"use strict";
Expand Down Expand Up @@ -102,8 +100,7 @@ requirejs([
var kernel_list = new kernellist.KernelList('#running_list', $.extend({
session_list: session_list},
common_options));
var directory_readme = new directoryreadme.DirectoryReadme('#directory_readme', notebook_list);


var terminal_list;
if (utils.get_body_data("terminalsAvailable") === "True") {
terminal_list = new terminallist.TerminalList('#terminal_list', common_options);
Expand Down
2 changes: 1 addition & 1 deletion notebook/static/tree/js/notebooklist.js
Original file line number Diff line number Diff line change
Expand Up @@ -1311,7 +1311,7 @@ define([
var element = $(this);
if (element.data("path") === path) {
element.remove();
events.trigger('notebook_deleted.NotebookList', [path]);
events.trigger('notebook_deleted.NotebookList');
that._selection_changed();
}
});
Expand Down
19 changes: 0 additions & 19 deletions notebook/static/tree/less/tree.less
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,6 @@
// The left padding of the selector button's contents.
@dashboard-selectorbtn-lpad: 7px;

// The horizontal padding of the readme.
@dashboard_readme_lr_pad: 21px;
// The vertical padding of the readme.
@dashboard_readme_top_pad: 7px;
@dashboard_readme_bottom_pad: 14px;

ul#tabs {
margin-bottom: @dashboard_tb_pad;
}
Expand Down Expand Up @@ -463,16 +457,3 @@ outline-width:1px;
margin: 3px;
font-size:10px;
}

#directory_readme {
.readme_header {
padding-top: @dashboard_tb_pad;
padding-bottom: @dashboard_tb_pad;
padding-left: @dashboard_lr_pad;
padding-right: @dashboard_lr_pad;
}

.readme_content {
padding: @dashboard_readme_top_pad @dashboard_readme_lr_pad @dashboard_readme_bottom_pad;
}
}
18 changes: 0 additions & 18 deletions notebook/templates/tree.html
Original file line number Diff line number Diff line change
@@ -1,22 +1,5 @@
{% extends "page.html" %}

{% block stylesheet %}

{% if mathjax_url %}
<script type="text/javascript" src="{{mathjax_url}}?config={{mathjax_config}}&delayStartupUntil=configured" charset="utf-8"></script>
{% endif %}
<script type="text/javascript">
// MathJax disabled, set as null to distinguish from *missing* MathJax,
// where it will be undefined, and should prompt a dialog later.
window.mathjax_url = "{{mathjax_url}}";
</script>

<link rel="stylesheet" href="{{ static_url("components/codemirror/lib/codemirror.css") }}">

{{super()}}

{% endblock %}

{% block title %}{{page_title}}{% endblock %}


Expand Down Expand Up @@ -169,7 +152,6 @@
</div>
</div>
</div>
<div id="directory_readme"></div>
</div>
<div id="running" class="tab-pane">
<div id="running_toolbar" class="row">
Expand Down
4 changes: 1 addition & 3 deletions notebook/tree/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@ def get(self, path=''):
breadcrumbs=breadcrumbs,
terminals_available=self.settings['terminals_available'],
server_root=self.settings['server_root_dir'],
shutdown_button=self.settings.get('shutdown_button', False),
mathjax_url=self.mathjax_url,
mathjax_config=self.mathjax_config
shutdown_button=self.settings.get('shutdown_button', False)
))
elif cm.file_exists(path):
# it's not a directory, we have redirecting to do
Expand Down

0 comments on commit 238828e

Please sign in to comment.