Show More
@@ -1,60 +1,72 b'' | |||
|
1 | 1 | {% extends "page.html" %} |
|
2 | 2 | |
|
3 | 3 | {% block title %}{{page_title}}{% endblock %} |
|
4 | 4 | |
|
5 | 5 | {% block stylesheet %} |
|
6 | 6 | <link rel="stylesheet" href="{{ static_url('components/codemirror/lib/codemirror.css') }}"> |
|
7 | 7 | <link rel="stylesheet" href="{{ static_url('components/codemirror/addon/dialog/dialog.css') }}"> |
|
8 | 8 | <style> |
|
9 | 9 | #texteditor-container { |
|
10 | 10 | border-bottom: 1px solid #ccc; |
|
11 | 11 | } |
|
12 | ||
|
13 | #filename { | |
|
14 | font-size: 16pt; | |
|
15 | display: table; | |
|
16 | padding: 0px 5px; | |
|
17 | } | |
|
12 | 18 | </style> |
|
13 | 19 | |
|
14 | 20 | {{super()}} |
|
15 | 21 | {% endblock %} |
|
16 | 22 | |
|
17 | 23 | {% block params %} |
|
18 | 24 | |
|
19 | 25 | data-base-url="{{base_url}}" |
|
20 | 26 | data-file-path="{{file_path}}" |
|
21 | 27 | |
|
22 | 28 | {% endblock %} |
|
23 | 29 | |
|
30 | {% block header %} | |
|
31 | ||
|
32 | <span id="filename">{{ basename }}</span> | |
|
33 | ||
|
34 | {% endblock %} | |
|
35 | ||
|
24 | 36 | {% block site %} |
|
25 | 37 | |
|
26 | 38 | <div id="menubar-container" class="container"> |
|
27 | 39 | <div id="menubar"> |
|
28 | 40 | <div id="menus" class="navbar navbar-default" role="navigation"> |
|
29 | 41 | <div class="container-fluid"> |
|
30 | 42 | <button type="button" class="btn btn-default navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> |
|
31 | 43 | <i class="fa fa-bars"></i> |
|
32 | 44 | <span class="navbar-text">Menu</span> |
|
33 | 45 | </button> |
|
34 | 46 | <ul class="nav navbar-nav navbar-right"> |
|
35 | 47 | <li id="notification_area"></li> |
|
36 | 48 | </ul> |
|
37 | 49 | <div class="navbar-collapse collapse"> |
|
38 | 50 | <ul class="nav navbar-nav"> |
|
39 | 51 | <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">File</a> |
|
40 | 52 | <ul id="file_menu" class="dropdown-menu"> |
|
41 | 53 | <li id="save_file"><a href="#">Save</a></li> |
|
42 | 54 | </ul> |
|
43 | 55 | </li> |
|
44 | 56 | </ul> |
|
45 | 57 | </div> |
|
46 | 58 | </div> |
|
47 | 59 | </div> |
|
48 | 60 | </div> |
|
49 | 61 | </div> |
|
50 | 62 | |
|
51 | 63 | <div id="texteditor-container" class="container"></div> |
|
52 | 64 | |
|
53 | 65 | {% endblock %} |
|
54 | 66 | |
|
55 | 67 | {% block script %} |
|
56 | 68 | |
|
57 | 69 | {{super()}} |
|
58 | 70 | |
|
59 | 71 | <script src="{{ static_url("texteditor/js/main.js") }}" type="text/javascript" charset="utf-8"></script> |
|
60 | 72 | {% endblock %} |
@@ -1,27 +1,29 b'' | |||
|
1 | 1 | #encoding: utf-8 |
|
2 | 2 | """Tornado handlers for the terminal emulator.""" |
|
3 | 3 | |
|
4 | 4 | # Copyright (c) IPython Development Team. |
|
5 | 5 | # Distributed under the terms of the Modified BSD License. |
|
6 | 6 | |
|
7 | 7 | from tornado import web |
|
8 | 8 | from ..base.handlers import IPythonHandler, path_regex |
|
9 | 9 | from ..utils import url_escape |
|
10 | 10 | |
|
11 | 11 | class EditorHandler(IPythonHandler): |
|
12 | 12 | """Render the text editor interface.""" |
|
13 | 13 | @web.authenticated |
|
14 | 14 | def get(self, path): |
|
15 | 15 | path = path.strip('/') |
|
16 | 16 | if not self.contents_manager.file_exists(path): |
|
17 | 17 | raise web.HTTPError(404, u'File does not exist: %s' % path) |
|
18 | 18 | |
|
19 | basename = path.rsplit('/', 1)[-1] | |
|
19 | 20 | self.write(self.render_template('texteditor.html', |
|
20 | 21 | file_path=url_escape(path), |
|
21 | page_title=path.rsplit('/', 1)[-1] + " (editing)", | |
|
22 | basename=basename, | |
|
23 | page_title=basename + " (editing)", | |
|
22 | 24 | ) |
|
23 | 25 | ) |
|
24 | 26 | |
|
25 | 27 | default_handlers = [ |
|
26 | 28 | (r"/texteditor%s" % path_regex, EditorHandler), |
|
27 | 29 | ] No newline at end of file |
General Comments 0
You need to be logged in to leave comments.
Login now