Show More
@@ -0,0 +1,56 b'' | |||||
|
1 | ||||
|
2 | /** | |||
|
3 | * Primary styles | |||
|
4 | * | |||
|
5 | * Author: IPython Development Team | |||
|
6 | */ | |||
|
7 | ||||
|
8 | ||||
|
9 | body { | |||
|
10 | background-color: white; | |||
|
11 | /* This makes sure that the body covers the entire window and needs to | |||
|
12 | be in a different element than the display: box in wrapper below */ | |||
|
13 | position: absolute; | |||
|
14 | left: 0px; | |||
|
15 | right: 0px; | |||
|
16 | top: 0px; | |||
|
17 | bottom: 0px; | |||
|
18 | overflow: hidden; | |||
|
19 | } | |||
|
20 | ||||
|
21 | ||||
|
22 | div#header { | |||
|
23 | /* Initially hidden to prevent FLOUC */ | |||
|
24 | display: none; | |||
|
25 | position: relative; | |||
|
26 | height: 45px; | |||
|
27 | padding: 5px; | |||
|
28 | margin: 0px; | |||
|
29 | width: 100%; | |||
|
30 | } | |||
|
31 | ||||
|
32 | span#ipython_notebook { | |||
|
33 | position: absolute; | |||
|
34 | padding: 2px; | |||
|
35 | } | |||
|
36 | ||||
|
37 | span#ipython_notebook h1 { | |||
|
38 | font-family: Verdana, "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif; | |||
|
39 | font-size: 197%; | |||
|
40 | display: inline; | |||
|
41 | color: black; | |||
|
42 | } | |||
|
43 | ||||
|
44 | div#main_app { | |||
|
45 | /* Initially hidden to prevent FLOUC */ | |||
|
46 | display: none; | |||
|
47 | width: 100%; | |||
|
48 | position: relative; | |||
|
49 | } | |||
|
50 | ||||
|
51 | .ui-button .ui-button-text { | |||
|
52 | padding: 0.2em 0.8em; | |||
|
53 | font-size: 77%; | |||
|
54 | } | |||
|
55 | ||||
|
56 |
@@ -0,0 +1,73 b'' | |||||
|
1 | /** | |||
|
2 | * HTML5 ✰ Boilerplate | |||
|
3 | * | |||
|
4 | * style.css contains a reset, font normalization and some base styles. | |||
|
5 | * | |||
|
6 | * Credit is left where credit is due. | |||
|
7 | * Much inspiration was taken from these projects: | |||
|
8 | * - yui.yahooapis.com/2.8.1/build/base/base.css | |||
|
9 | * - camendesign.com/design/ | |||
|
10 | * - praegnanz.de/weblog/htmlcssjs-kickstart | |||
|
11 | */ | |||
|
12 | ||||
|
13 | ||||
|
14 | /** | |||
|
15 | * html5doctor.com Reset Stylesheet (Eric Meyer's Reset Reloaded + HTML5 baseline) | |||
|
16 | * v1.6.1 2010-09-17 | Authors: Eric Meyer & Richard Clark | |||
|
17 | * html5doctor.com/html-5-reset-stylesheet/ | |||
|
18 | */ | |||
|
19 | ||||
|
20 | html, body, div, span, object, iframe, | |||
|
21 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, | |||
|
22 | abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, samp, | |||
|
23 | small, strong, sub, sup, var, b, i, dl, dt, dd, ol, ul, li, | |||
|
24 | fieldset, form, label, legend, | |||
|
25 | table, caption, tbody, tfoot, thead, tr, th, td, | |||
|
26 | article, aside, canvas, details, figcaption, figure, | |||
|
27 | footer, header, hgroup, menu, nav, section, summary, | |||
|
28 | time, mark, audio, video { | |||
|
29 | margin: 0; | |||
|
30 | padding: 0; | |||
|
31 | border: 0; | |||
|
32 | font-size: 100%; | |||
|
33 | font: inherit; | |||
|
34 | vertical-align: baseline; | |||
|
35 | } | |||
|
36 | ||||
|
37 | article, aside, details, figcaption, figure, | |||
|
38 | footer, header, hgroup, menu, nav, section { | |||
|
39 | display: block; | |||
|
40 | } | |||
|
41 | ||||
|
42 | blockquote, q { quotes: none; } | |||
|
43 | ||||
|
44 | blockquote:before, blockquote:after, | |||
|
45 | q:before, q:after { content: ""; content: none; } | |||
|
46 | ||||
|
47 | ins { background-color: #ff9; color: #000; text-decoration: none; } | |||
|
48 | ||||
|
49 | mark { background-color: #ff9; color: #000; font-style: italic; font-weight: bold; } | |||
|
50 | ||||
|
51 | del { text-decoration: line-through; } | |||
|
52 | ||||
|
53 | abbr[title], dfn[title] { border-bottom: 1px dotted; cursor: help; } | |||
|
54 | ||||
|
55 | table { border-collapse: collapse; border-spacing: 0; } | |||
|
56 | ||||
|
57 | hr { display: block; height: 1px; border: 0; border-top: 1px solid #ccc; margin: 1em 0; padding: 0; } | |||
|
58 | ||||
|
59 | input, select { vertical-align: middle; } | |||
|
60 | ||||
|
61 | ||||
|
62 | /** | |||
|
63 | * Font normalization inspired by YUI Library's fonts.css: developer.yahoo.com/yui/ | |||
|
64 | */ | |||
|
65 | ||||
|
66 | body { font:13px/1.231 sans-serif; *font-size:small; } /* Hack retained to preserve specificity */ | |||
|
67 | select, input, textarea, button { font:99% sans-serif; } | |||
|
68 | ||||
|
69 | /* Normalize monospace sizing: | |||
|
70 | en.wikipedia.org/wiki/MediaWiki_talk:Common.css/Archive_11#Teletype_style_fix_for_Chrome */ | |||
|
71 | pre, code, kbd, samp { font-family: monospace, sans-serif; } | |||
|
72 | ||||
|
73 |
@@ -0,0 +1,64 b'' | |||||
|
1 | ||||
|
2 | /** | |||
|
3 | * Primary styles | |||
|
4 | * | |||
|
5 | * Author: IPython Development Team | |||
|
6 | */ | |||
|
7 | ||||
|
8 | ||||
|
9 | body { | |||
|
10 | background-color: white; | |||
|
11 | /* This makes sure that the body covers the entire window and needs to | |||
|
12 | be in a different element than the display: box in wrapper below */ | |||
|
13 | position: absolute; | |||
|
14 | left: 0px; | |||
|
15 | right: 0px; | |||
|
16 | top: 0px; | |||
|
17 | bottom: 0px; | |||
|
18 | overflow: auto; | |||
|
19 | } | |||
|
20 | ||||
|
21 | #content_panel { | |||
|
22 | width: 600px; | |||
|
23 | } | |||
|
24 | ||||
|
25 | #content_toolbar { | |||
|
26 | padding: 10px 5px; | |||
|
27 | } | |||
|
28 | ||||
|
29 | #header_border { | |||
|
30 | width: 100%; | |||
|
31 | height: 2px; | |||
|
32 | } | |||
|
33 | ||||
|
34 | #app_hbox { | |||
|
35 | width: 100%; | |||
|
36 | } | |||
|
37 | ||||
|
38 | #notebooks_buttons { | |||
|
39 | float: right; | |||
|
40 | } | |||
|
41 | ||||
|
42 | #project_name { | |||
|
43 | height: 25px; | |||
|
44 | line-height: 25px; | |||
|
45 | padding: 3px; | |||
|
46 | } | |||
|
47 | ||||
|
48 | .notebook_item { | |||
|
49 | height: 25px; | |||
|
50 | line-height: 25px; | |||
|
51 | padding: 3px; | |||
|
52 | } | |||
|
53 | ||||
|
54 | .notebook_item a { | |||
|
55 | text-decoration: none; | |||
|
56 | } | |||
|
57 | ||||
|
58 | .item_buttons { | |||
|
59 | float: right; | |||
|
60 | } | |||
|
61 | ||||
|
62 | .highlight_text { | |||
|
63 | color: blue; | |||
|
64 | } |
@@ -0,0 +1,30 b'' | |||||
|
1 | ||||
|
2 | //============================================================================ | |||
|
3 | // On document ready | |||
|
4 | //============================================================================ | |||
|
5 | ||||
|
6 | ||||
|
7 | $(document).ready(function () { | |||
|
8 | ||||
|
9 | $('div#header').addClass('border-box-sizing'); | |||
|
10 | $('div#header_border').addClass('border-box-sizing ui-widget ui-widget-content'); | |||
|
11 | ||||
|
12 | $('div#main_app').addClass('border-box-sizing ui-widget'); | |||
|
13 | $('div#app_hbox').addClass('hbox center'); | |||
|
14 | ||||
|
15 | $('div#content_toolbar').addClass('ui-widget ui-helper-clearfix'); | |||
|
16 | ||||
|
17 | $('#new_notebook').click(function (e) { | |||
|
18 | window.open('/new'); | |||
|
19 | }); | |||
|
20 | ||||
|
21 | IPython.notebook_list = new IPython.NotebookList('div#notebook_list'); | |||
|
22 | IPython.notebook_list.load_list(); | |||
|
23 | ||||
|
24 | // These have display: none in the css file and are made visible here to prevent FLOUC. | |||
|
25 | $('div#header').css('display','block'); | |||
|
26 | $('div#main_app').css('display','block'); | |||
|
27 | ||||
|
28 | ||||
|
29 | }); | |||
|
30 |
@@ -0,0 +1,63 b'' | |||||
|
1 | ||||
|
2 | //============================================================================ | |||
|
3 | // Cell | |||
|
4 | //============================================================================ | |||
|
5 | ||||
|
6 | var IPython = (function (IPython) { | |||
|
7 | ||||
|
8 | var NotebookList = function (selector) { | |||
|
9 | this.selector = selector; | |||
|
10 | if (this.selector !== undefined) { | |||
|
11 | this.element = $(selector); | |||
|
12 | this.style(); | |||
|
13 | this.bind_events(); | |||
|
14 | } | |||
|
15 | }; | |||
|
16 | ||||
|
17 | NotebookList.prototype.style = function () { | |||
|
18 | this.element.addClass('ui-widget ui-widget-content'); | |||
|
19 | $('div#project_name').addClass('ui-widget ui-widget-header'); | |||
|
20 | }; | |||
|
21 | ||||
|
22 | ||||
|
23 | NotebookList.prototype.bind_events = function () { | |||
|
24 | ||||
|
25 | }; | |||
|
26 | ||||
|
27 | ||||
|
28 | NotebookList.prototype.load_list = function () { | |||
|
29 | var settings = { | |||
|
30 | processData : false, | |||
|
31 | cache : false, | |||
|
32 | type : "GET", | |||
|
33 | dataType : "json", | |||
|
34 | success : $.proxy(this.list_loaded,this) | |||
|
35 | }; | |||
|
36 | $.ajax("/notebooks", settings); | |||
|
37 | }; | |||
|
38 | ||||
|
39 | ||||
|
40 | NotebookList.prototype.list_loaded = function (data, status, xhr) { | |||
|
41 | var len = data.length; | |||
|
42 | for (var i=0; i<len; i++) { | |||
|
43 | var div = $('<div/>').addClass('notebook_item ui-widget ui-widget-content ui-helper-clearfix'); | |||
|
44 | var nbname = $('<span/>').addClass('item_name').append( | |||
|
45 | $('<a/>').attr('href','/'+data[i].notebook_id). | |||
|
46 | attr('target','_blank'). | |||
|
47 | text(data[i].name) | |||
|
48 | ); | |||
|
49 | var buttons = $('<span/>').addClass('item_buttons').append( | |||
|
50 | $('<button>Delete</button>').button() | |||
|
51 | ) | |||
|
52 | div.append(nbname).append(buttons); | |||
|
53 | this.element.append(div); | |||
|
54 | } | |||
|
55 | }; | |||
|
56 | ||||
|
57 | ||||
|
58 | IPython.NotebookList = NotebookList; | |||
|
59 | ||||
|
60 | return IPython; | |||
|
61 | ||||
|
62 | }(IPython)); | |||
|
63 |
@@ -17,7 +17,14 b' from tornado import websocket' | |||||
17 | #----------------------------------------------------------------------------- |
|
17 | #----------------------------------------------------------------------------- | |
18 |
|
18 | |||
19 |
|
19 | |||
20 |
class |
|
20 | class NBBrowserHandler(web.RequestHandler): | |
|
21 | def get(self): | |||
|
22 | nbm = self.application.notebook_manager | |||
|
23 | project = nbm.notebook_dir | |||
|
24 | self.render('nbbrowser.html', project=project) | |||
|
25 | ||||
|
26 | ||||
|
27 | class NewHandler(web.RequestHandler): | |||
21 | def get(self): |
|
28 | def get(self): | |
22 | notebook_id = self.application.notebook_manager.new_notebook() |
|
29 | notebook_id = self.application.notebook_manager.new_notebook() | |
23 | self.render('notebook.html', notebook_id=notebook_id) |
|
30 | self.render('notebook.html', notebook_id=notebook_id) |
@@ -30,7 +30,7 b' from tornado import web' | |||||
30 | from .kernelmanager import KernelManager |
|
30 | from .kernelmanager import KernelManager | |
31 | from .sessionmanager import SessionManager |
|
31 | from .sessionmanager import SessionManager | |
32 | from .handlers import ( |
|
32 | from .handlers import ( | |
33 |
|
|
33 | NBBrowserHandler, NewHandler, NamedNotebookHandler, | |
34 | KernelHandler, KernelActionHandler, ZMQStreamHandler, |
|
34 | KernelHandler, KernelActionHandler, ZMQStreamHandler, | |
35 | NotebookRootHandler, NotebookHandler |
|
35 | NotebookRootHandler, NotebookHandler | |
36 | ) |
|
36 | ) | |
@@ -67,7 +67,8 b' class NotebookWebApplication(web.Application):' | |||||
67 |
|
67 | |||
68 | def __init__(self, kernel_manager, log, kernel_argv, config): |
|
68 | def __init__(self, kernel_manager, log, kernel_argv, config): | |
69 | handlers = [ |
|
69 | handlers = [ | |
70 |
(r"/", |
|
70 | (r"/", NBBrowserHandler), | |
|
71 | (r"/new", NewHandler), | |||
71 | (r"/%s" % _notebook_id_regex, NamedNotebookHandler), |
|
72 | (r"/%s" % _notebook_id_regex, NamedNotebookHandler), | |
72 | (r"/kernels", KernelHandler), |
|
73 | (r"/kernels", KernelHandler), | |
73 | (r"/kernels/%s/%s" % (_kernel_id_regex, _kernel_action_regex), KernelActionHandler), |
|
74 | (r"/kernels/%s/%s" % (_kernel_id_regex, _kernel_action_regex), KernelActionHandler), |
@@ -44,8 +44,9 b' class NotebookManager(Configurable):' | |||||
44 | dict(notebook_id=notebook,name=name) |
|
44 | dict(notebook_id=notebook,name=name) | |
45 | """ |
|
45 | """ | |
46 | names = os.listdir(self.notebook_dir) |
|
46 | names = os.listdir(self.notebook_dir) | |
47 |
names = [name.s |
|
47 | names = [name.split(u'.')[0] \ | |
48 | for name in names if name.endswith(self.filename_ext)] |
|
48 | for name in names if name.endswith(self.filename_ext)] | |
|
49 | print names | |||
49 | data = [] |
|
50 | data = [] | |
50 | for name in names: |
|
51 | for name in names: | |
51 | if name not in self.rev_mapping: |
|
52 | if name not in self.rev_mapping: | |
@@ -53,6 +54,7 b' class NotebookManager(Configurable):' | |||||
53 | else: |
|
54 | else: | |
54 | notebook_id = self.rev_mapping[name] |
|
55 | notebook_id = self.rev_mapping[name] | |
55 | data.append(dict(notebook_id=notebook_id,name=name)) |
|
56 | data.append(dict(notebook_id=notebook_id,name=name)) | |
|
57 | data = sorted(data, key=lambda item: item['name']) | |||
56 | return data |
|
58 | return data | |
57 |
|
59 | |||
58 | def new_notebook_id(self, name): |
|
60 | def new_notebook_id(self, name): | |
@@ -112,11 +114,13 b' class NotebookManager(Configurable):' | |||||
112 | with open(path,'r') as f: |
|
114 | with open(path,'r') as f: | |
113 | s = f.read() |
|
115 | s = f.read() | |
114 | try: |
|
116 | try: | |
115 | # v2 and later have xml in the .ipynb files |
|
117 | # v2 and later have xml in the .ipynb files. | |
116 | nb = current.reads(s, 'xml') |
|
118 | nb = current.reads(s, 'xml') | |
117 | except: |
|
119 | except: | |
118 | # v1 had json in the .ipynb files |
|
120 | # v1 had json in the .ipynb files. | |
119 | nb = current.reads(s, 'json') |
|
121 | nb = current.reads(s, 'json') | |
|
122 | # v1 notebooks don't have a name field, so use the filename. | |||
|
123 | nb.name = os.path.split(path)[-1].split(u'.')[0] | |||
120 | except: |
|
124 | except: | |
121 | raise web.HTTPError(404) |
|
125 | raise web.HTTPError(404) | |
122 | return last_modified, nb |
|
126 | return last_modified, nb |
@@ -100,4 +100,4 b'' | |||||
100 | -webkit-box-pack: center; |
|
100 | -webkit-box-pack: center; | |
101 | -moz-box-pack: center; |
|
101 | -moz-box-pack: center; | |
102 | box-pack: center; |
|
102 | box-pack: center; | |
103 | } No newline at end of file |
|
103 | } |
@@ -1,75 +1,3 b'' | |||||
1 | /** |
|
|||
2 | * HTML5 ✰ Boilerplate |
|
|||
3 | * |
|
|||
4 | * style.css contains a reset, font normalization and some base styles. |
|
|||
5 | * |
|
|||
6 | * Credit is left where credit is due. |
|
|||
7 | * Much inspiration was taken from these projects: |
|
|||
8 | * - yui.yahooapis.com/2.8.1/build/base/base.css |
|
|||
9 | * - camendesign.com/design/ |
|
|||
10 | * - praegnanz.de/weblog/htmlcssjs-kickstart |
|
|||
11 | */ |
|
|||
12 |
|
||||
13 |
|
||||
14 | /** |
|
|||
15 | * html5doctor.com Reset Stylesheet (Eric Meyer's Reset Reloaded + HTML5 baseline) |
|
|||
16 | * v1.6.1 2010-09-17 | Authors: Eric Meyer & Richard Clark |
|
|||
17 | * html5doctor.com/html-5-reset-stylesheet/ |
|
|||
18 | */ |
|
|||
19 |
|
||||
20 | html, body, div, span, object, iframe, |
|
|||
21 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, |
|
|||
22 | abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, samp, |
|
|||
23 | small, strong, sub, sup, var, b, i, dl, dt, dd, ol, ul, li, |
|
|||
24 | fieldset, form, label, legend, |
|
|||
25 | table, caption, tbody, tfoot, thead, tr, th, td, |
|
|||
26 | article, aside, canvas, details, figcaption, figure, |
|
|||
27 | footer, header, hgroup, menu, nav, section, summary, |
|
|||
28 | time, mark, audio, video { |
|
|||
29 | margin: 0; |
|
|||
30 | padding: 0; |
|
|||
31 | border: 0; |
|
|||
32 | font-size: 100%; |
|
|||
33 | font: inherit; |
|
|||
34 | vertical-align: baseline; |
|
|||
35 | } |
|
|||
36 |
|
||||
37 | article, aside, details, figcaption, figure, |
|
|||
38 | footer, header, hgroup, menu, nav, section { |
|
|||
39 | display: block; |
|
|||
40 | } |
|
|||
41 |
|
||||
42 | blockquote, q { quotes: none; } |
|
|||
43 |
|
||||
44 | blockquote:before, blockquote:after, |
|
|||
45 | q:before, q:after { content: ""; content: none; } |
|
|||
46 |
|
||||
47 | ins { background-color: #ff9; color: #000; text-decoration: none; } |
|
|||
48 |
|
||||
49 | mark { background-color: #ff9; color: #000; font-style: italic; font-weight: bold; } |
|
|||
50 |
|
||||
51 | del { text-decoration: line-through; } |
|
|||
52 |
|
||||
53 | abbr[title], dfn[title] { border-bottom: 1px dotted; cursor: help; } |
|
|||
54 |
|
||||
55 | table { border-collapse: collapse; border-spacing: 0; } |
|
|||
56 |
|
||||
57 | hr { display: block; height: 1px; border: 0; border-top: 1px solid #ccc; margin: 1em 0; padding: 0; } |
|
|||
58 |
|
||||
59 | input, select { vertical-align: middle; } |
|
|||
60 |
|
||||
61 |
|
||||
62 | /** |
|
|||
63 | * Font normalization inspired by YUI Library's fonts.css: developer.yahoo.com/yui/ |
|
|||
64 | */ |
|
|||
65 |
|
||||
66 | body { font:13px/1.231 sans-serif; *font-size:small; } /* Hack retained to preserve specificity */ |
|
|||
67 | select, input, textarea, button { font:99% sans-serif; } |
|
|||
68 |
|
||||
69 | /* Normalize monospace sizing: |
|
|||
70 | en.wikipedia.org/wiki/MediaWiki_talk:Common.css/Archive_11#Teletype_style_fix_for_Chrome */ |
|
|||
71 | pre, code, kbd, samp { font-family: monospace, sans-serif; } |
|
|||
72 |
|
||||
73 |
|
1 | |||
74 | /** |
|
2 | /** | |
75 | * Primary styles |
|
3 | * Primary styles | |
@@ -90,28 +18,6 b' body {' | |||||
90 | overflow: hidden; |
|
18 | overflow: hidden; | |
91 | } |
|
19 | } | |
92 |
|
20 | |||
93 |
|
||||
94 | div#header { |
|
|||
95 | /* Initially hidden to prevent FLOUC */ |
|
|||
96 | display: none; |
|
|||
97 | position: relative; |
|
|||
98 | height: 45px; |
|
|||
99 | padding: 5px; |
|
|||
100 | margin: 0px; |
|
|||
101 | width: 100%; |
|
|||
102 | } |
|
|||
103 |
|
||||
104 | span#ipython_notebook { |
|
|||
105 | position: absolute; |
|
|||
106 | padding: 2px; |
|
|||
107 | } |
|
|||
108 |
|
||||
109 | span#ipython_notebook h1 { |
|
|||
110 | font-family: Verdana, "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif; |
|
|||
111 | font-size: 197%; |
|
|||
112 | display: inline; |
|
|||
113 | } |
|
|||
114 |
|
||||
115 | span#save_widget { |
|
21 | span#save_widget { | |
116 | position: absolute; |
|
22 | position: absolute; | |
117 | left: 0px; |
|
23 | left: 0px; | |
@@ -144,13 +50,6 b' span#kernel_status {' | |||||
144 | color: black; |
|
50 | color: black; | |
145 | } |
|
51 | } | |
146 |
|
52 | |||
147 | div#notebook_app { |
|
|||
148 | /* Initially hidden to prevent FLOUC */ |
|
|||
149 | display: none; |
|
|||
150 | width: 100%; |
|
|||
151 | position: relative; |
|
|||
152 | } |
|
|||
153 |
|
||||
154 | div#left_panel { |
|
53 | div#left_panel { | |
155 | overflow-y: auto; |
|
54 | overflow-y: auto; | |
156 | top: 0px; |
|
55 | top: 0px; | |
@@ -200,12 +99,6 b' span.button_label {' | |||||
200 | margin-bottom: 0px; |
|
99 | margin-bottom: 0px; | |
201 | } |
|
100 | } | |
202 |
|
101 | |||
203 |
|
||||
204 | .ui-button .ui-button-text { |
|
|||
205 | padding: 0.2em 0.8em; |
|
|||
206 | font-size: 77%; |
|
|||
207 | } |
|
|||
208 |
|
||||
209 | #download_format { |
|
102 | #download_format { | |
210 | float: right; |
|
103 | float: right; | |
211 | font-size: 85%; |
|
104 | font-size: 85%; |
@@ -22,7 +22,7 b' var IPython = (function (IPython) {' | |||||
22 | var header_height = $('div#header').outerHeight(true); |
|
22 | var header_height = $('div#header').outerHeight(true); | |
23 | var app_height = h - header_height - 2; // content height |
|
23 | var app_height = h - header_height - 2; // content height | |
24 |
|
24 | |||
25 |
$('div#n |
|
25 | $('div#main_app').height(app_height + 2); // content+padding+border height | |
26 |
|
26 | |||
27 | $('div#left_panel').height(app_height); |
|
27 | $('div#left_panel').height(app_height); | |
28 |
|
28 |
@@ -61,14 +61,14 b' var IPython = (function (IPython) {' | |||||
61 | }); |
|
61 | }); | |
62 |
|
62 | |||
63 | this.element.bind('collapse_pager', function () { |
|
63 | this.element.bind('collapse_pager', function () { | |
64 |
var app_height = $('div#n |
|
64 | var app_height = $('div#main_app').height(); // content height | |
65 | var splitter_height = $('div#pager_splitter').outerHeight(true); |
|
65 | var splitter_height = $('div#pager_splitter').outerHeight(true); | |
66 | var new_height = app_height - splitter_height; |
|
66 | var new_height = app_height - splitter_height; | |
67 | that.element.animate({height : new_height + 'px'}, 'fast'); |
|
67 | that.element.animate({height : new_height + 'px'}, 'fast'); | |
68 | }); |
|
68 | }); | |
69 |
|
69 | |||
70 | this.element.bind('expand_pager', function () { |
|
70 | this.element.bind('expand_pager', function () { | |
71 |
var app_height = $('div#n |
|
71 | var app_height = $('div#main_app').height(); // content height | |
72 | var splitter_height = $('div#pager_splitter').outerHeight(true); |
|
72 | var splitter_height = $('div#pager_splitter').outerHeight(true); | |
73 | var pager_height = $('div#pager').outerHeight(true); |
|
73 | var pager_height = $('div#pager').outerHeight(true); | |
74 | var new_height = app_height - pager_height - splitter_height; |
|
74 | var new_height = app_height - pager_height - splitter_height; | |
@@ -94,6 +94,12 b' var IPython = (function (IPython) {' | |||||
94 | this.element.animate({scrollTop:this.element.get(0).scrollHeight}, 0); |
|
94 | this.element.animate({scrollTop:this.element.get(0).scrollHeight}, 0); | |
95 | }; |
|
95 | }; | |
96 |
|
96 | |||
|
97 | ||||
|
98 | Notebook.prototype.scroll_to_top = function () { | |||
|
99 | this.element.animate({scrollTop:0}, 0); | |||
|
100 | }; | |||
|
101 | ||||
|
102 | ||||
97 | // Cell indexing, retrieval, etc. |
|
103 | // Cell indexing, retrieval, etc. | |
98 |
|
104 | |||
99 |
|
105 | |||
@@ -296,12 +302,10 b' var IPython = (function (IPython) {' | |||||
296 | // TODO: Bounds check for i |
|
302 | // TODO: Bounds check for i | |
297 | var i = this.index_or_selected(index); |
|
303 | var i = this.index_or_selected(index); | |
298 | var cell = new IPython.CodeCell(this); |
|
304 | var cell = new IPython.CodeCell(this); | |
299 | // cell.set_input_prompt(this.next_prompt_number); |
|
|||
300 | cell.set_input_prompt(); |
|
305 | cell.set_input_prompt(); | |
301 | this.next_prompt_number = this.next_prompt_number + 1; |
|
|||
302 | this.insert_cell_before(cell, i); |
|
306 | this.insert_cell_before(cell, i); | |
303 | this.select(this.find_cell_index(cell)); |
|
307 | this.select(this.find_cell_index(cell)); | |
304 |
return |
|
308 | return cell; | |
305 | } |
|
309 | } | |
306 |
|
310 | |||
307 |
|
311 | |||
@@ -309,12 +313,10 b' var IPython = (function (IPython) {' | |||||
309 | // TODO: Bounds check for i |
|
313 | // TODO: Bounds check for i | |
310 | var i = this.index_or_selected(index); |
|
314 | var i = this.index_or_selected(index); | |
311 | var cell = new IPython.CodeCell(this); |
|
315 | var cell = new IPython.CodeCell(this); | |
312 | // cell.set_input_prompt(this.next_prompt_number); |
|
|||
313 | cell.set_input_prompt(); |
|
316 | cell.set_input_prompt(); | |
314 | this.next_prompt_number = this.next_prompt_number + 1; |
|
|||
315 | this.insert_cell_after(cell, i); |
|
317 | this.insert_cell_after(cell, i); | |
316 | this.select(this.find_cell_index(cell)); |
|
318 | this.select(this.find_cell_index(cell)); | |
317 |
return |
|
319 | return cell; | |
318 | } |
|
320 | } | |
319 |
|
321 | |||
320 |
|
322 | |||
@@ -325,7 +327,7 b' var IPython = (function (IPython) {' | |||||
325 | cell.config_mathjax(); |
|
327 | cell.config_mathjax(); | |
326 | this.insert_cell_before(cell, i); |
|
328 | this.insert_cell_before(cell, i); | |
327 | this.select(this.find_cell_index(cell)); |
|
329 | this.select(this.find_cell_index(cell)); | |
328 |
return |
|
330 | return cell; | |
329 | } |
|
331 | } | |
330 |
|
332 | |||
331 |
|
333 | |||
@@ -336,7 +338,7 b' var IPython = (function (IPython) {' | |||||
336 | cell.config_mathjax(); |
|
338 | cell.config_mathjax(); | |
337 | this.insert_cell_after(cell, i); |
|
339 | this.insert_cell_after(cell, i); | |
338 | this.select(this.find_cell_index(cell)); |
|
340 | this.select(this.find_cell_index(cell)); | |
339 |
return |
|
341 | return cell; | |
340 | } |
|
342 | } | |
341 |
|
343 | |||
342 |
|
344 | |||
@@ -517,14 +519,15 b' var IPython = (function (IPython) {' | |||||
517 | var new_cells = worksheet.cells; |
|
519 | var new_cells = worksheet.cells; | |
518 | ncells = new_cells.length; |
|
520 | ncells = new_cells.length; | |
519 | var cell_data = null; |
|
521 | var cell_data = null; | |
|
522 | var new_cell = null; | |||
520 | for (var i=0; i<ncells; i++) { |
|
523 | for (var i=0; i<ncells; i++) { | |
521 | cell_data = new_cells[i]; |
|
524 | cell_data = new_cells[i]; | |
522 | if (cell_data.cell_type == 'code') { |
|
525 | if (cell_data.cell_type == 'code') { | |
523 | this.insert_code_cell_after(); |
|
526 | new_cell = this.insert_code_cell_after(); | |
524 |
|
|
527 | new_cell.fromJSON(cell_data); | |
525 | } else if (cell_data.cell_type === 'text') { |
|
528 | } else if (cell_data.cell_type === 'text') { | |
526 | this.insert_text_cell_after(); |
|
529 | new_cell = this.insert_text_cell_after(); | |
527 |
|
|
530 | new_cell.fromJSON(cell_data); | |
528 | }; |
|
531 | }; | |
529 | }; |
|
532 | }; | |
530 | }; |
|
533 | }; | |
@@ -573,15 +576,21 b' var IPython = (function (IPython) {' | |||||
573 | } |
|
576 | } | |
574 |
|
577 | |||
575 |
|
578 | |||
576 | Notebook.prototype.load_notebook = function () { |
|
579 | Notebook.prototype.load_notebook = function (callback) { | |
|
580 | var that = this; | |||
577 | var notebook_id = IPython.save_widget.get_notebook_id(); |
|
581 | var notebook_id = IPython.save_widget.get_notebook_id(); | |
578 | // We do the call with settings so we can set cache to false. |
|
582 | // We do the call with settings so we can set cache to false. | |
579 | var settings = { |
|
583 | var settings = { | |
580 | processData : false, |
|
584 | processData : false, | |
581 | cache : false, |
|
585 | cache : false, | |
582 | type : "GET", |
|
586 | type : "GET", | |
583 | dataType : "json", |
|
587 | dataType : "json", | |
584 | success : $.proxy(this.notebook_loaded,this) |
|
588 | success : function (data, status, xhr) { | |
|
589 | that.notebook_loaded(data, status, xhr); | |||
|
590 | if (callback !== undefined) { | |||
|
591 | callback(); | |||
|
592 | }; | |||
|
593 | } | |||
585 | }; |
|
594 | }; | |
586 | IPython.save_widget.status_loading(); |
|
595 | IPython.save_widget.status_loading(); | |
587 | $.ajax("/notebooks/" + notebook_id, settings); |
|
596 | $.ajax("/notebooks/" + notebook_id, settings); | |
@@ -596,6 +605,12 b' var IPython = (function (IPython) {' | |||||
596 | IPython.save_widget.status_save(); |
|
605 | IPython.save_widget.status_save(); | |
597 | IPython.save_widget.set_notebook_name(data.name); |
|
606 | IPython.save_widget.set_notebook_name(data.name); | |
598 | this.start_kernel(); |
|
607 | this.start_kernel(); | |
|
608 | // fromJSON always selects the last cell inserted. We need to wait | |||
|
609 | // until that is done before scrolling to the top. | |||
|
610 | setTimeout(function () { | |||
|
611 | IPython.notebook.select(0); | |||
|
612 | IPython.notebook.scroll_to_top(); | |||
|
613 | }, 50); | |||
599 | }; |
|
614 | }; | |
600 |
|
615 | |||
601 | IPython.Notebook = Notebook; |
|
616 | IPython.Notebook = Notebook; |
@@ -18,7 +18,7 b' $(document).ready(function () {' | |||||
18 | }); |
|
18 | }); | |
19 |
|
19 | |||
20 | $('div#header').addClass('border-box-sizing'); |
|
20 | $('div#header').addClass('border-box-sizing'); | |
21 |
$('div#n |
|
21 | $('div#main_app').addClass('border-box-sizing ui-widget ui-widget-content'); | |
22 | $('div#notebook_panel').addClass('border-box-sizing ui-widget'); |
|
22 | $('div#notebook_panel').addClass('border-box-sizing ui-widget'); | |
23 |
|
23 | |||
24 | IPython.layout_manager = new IPython.LayoutManager(); |
|
24 | IPython.layout_manager = new IPython.LayoutManager(); | |
@@ -33,15 +33,18 b' $(document).ready(function () {' | |||||
33 |
|
33 | |||
34 | // These have display: none in the css file and are made visible here to prevent FLOUC. |
|
34 | // These have display: none in the css file and are made visible here to prevent FLOUC. | |
35 | $('div#header').css('display','block'); |
|
35 | $('div#header').css('display','block'); | |
36 |
$('div#n |
|
36 | $('div#main_app').css('display','block'); | |
37 |
|
||||
38 | IPython.notebook.load_notebook(); |
|
|||
39 |
|
37 | |||
40 | // Perform these actions after the notebook has been loaded. |
|
38 | // Perform these actions after the notebook has been loaded. | |
41 | setTimeout(function () { |
|
39 | // We wait 100 milliseconds because the notebook scrolls to the top after a load | |
42 | IPython.save_widget.update_url(); |
|
40 | // is completed and we need to wait for that to mostly finish. | |
43 | IPython.layout_manager.do_resize(); |
|
41 | IPython.notebook.load_notebook(function () { | |
44 | IPython.pager.collapse(); |
|
42 | setTimeout(function () { | |
45 | }, 100); |
|
43 | IPython.save_widget.update_url(); | |
|
44 | IPython.layout_manager.do_resize(); | |||
|
45 | IPython.pager.collapse(); | |||
|
46 | },100); | |||
|
47 | }); | |||
|
48 | ||||
46 | }); |
|
49 | }); | |
47 |
|
50 |
@@ -93,11 +93,10 b' var IPython = (function (IPython) {' | |||||
93 | PanelSection.prototype.bind_events.apply(this); |
|
93 | PanelSection.prototype.bind_events.apply(this); | |
94 | var that = this; |
|
94 | var that = this; | |
95 | this.content.find('#new_notebook').click(function () { |
|
95 | this.content.find('#new_notebook').click(function () { | |
96 | console.log('click!') |
|
96 | window.open('/new'); | |
97 | window.open('/'); |
|
|||
98 | }); |
|
97 | }); | |
99 | this.content.find('#open_notebook').click(function () { |
|
98 | this.content.find('#open_notebook').click(function () { | |
100 | alert('Not Implemented'); |
|
99 | window.open('/'); | |
101 | }); |
|
100 | }); | |
102 | this.content.find('#download_notebook').click(function () { |
|
101 | this.content.find('#download_notebook').click(function () { | |
103 | var format = that.content.find('#download_format').val(); |
|
102 | var format = that.content.find('#download_format').val(); |
@@ -1,30 +1,64 b'' | |||||
1 | <!DOCTYPE HTML> |
|
1 | <!DOCTYPE HTML> | |
|
2 | <html> | |||
2 |
|
3 | |||
3 | <head> |
|
4 | <head> | |
4 | <meta charset="utf-8"> |
|
5 | <meta charset="utf-8"> | |
5 |
|
6 | |||
|
7 | <title>IPython Notebook</title> | |||
6 |
|
8 | |||
7 | <title>IPython Notebook Browser</title> |
|
9 | <link rel="stylesheet" href="static/jquery/css/themes/aristo/jquery-wijmo.css" type="text/css" /> | |
8 | <meta name="description" content="Browser for local IPython notebooks"> |
|
10 | <!-- <link rel="stylesheet" href="static/jquery/css/themes/rocket/jquery-wijmo.css" type="text/css" /> --> | |
9 | <meta name="author" content="IPython dev team"> |
|
11 | <!-- <link rel="stylesheet" href="static/jquery/css/themes/smoothness/jquery-ui-1.8.14.custom.css" type="text/css" />--> | |
10 |
|
||||
11 | <link rel="stylesheet" href="static/css/nbbrowser.css" type="text/css" /> |
|
|||
12 | <link rel="stylesheet" href="static/jquery/css/jquery.wijmo-open.1.1.3.css" type="text/css" /> |
|
|||
13 | <link rel="stylesheet" href="static/jquery/css/themes/aristo/jquery-wijmo.css" type="text/css" /> |
|
|||
14 |
|
12 | |||
|
13 | <link rel="stylesheet" href="static/css/boilerplate.css" type="text/css" /> | |||
|
14 | <link rel="stylesheet" href="static/css/layout.css" type="text/css" /> | |||
|
15 | <link rel="stylesheet" href="static/css/base.css" type="text/css" /> | |||
|
16 | <link rel="stylesheet" href="static/css/nbbrowser.css" type="text/css" /> | |||
15 |
|
17 | |||
16 | </head> |
|
18 | </head> | |
17 |
|
19 | |||
18 | <body> |
|
20 | <body> | |
19 |
|
21 | |||
|
22 | <div id="header"> | |||
|
23 | <span id="ipython_notebook"><h1>IPython Notebook</h1></span> | |||
|
24 | </div> | |||
|
25 | ||||
|
26 | <div id="header_border"></div> | |||
|
27 | ||||
|
28 | <div id="main_app"> | |||
|
29 | ||||
|
30 | <div id="app_hbox"> | |||
|
31 | ||||
|
32 | <!-- <div id="left_panel">--> | |||
|
33 | <!-- </div>--> | |||
20 |
|
34 | |||
|
35 | <div id="content_panel"> | |||
|
36 | <div id="content_toolbar"> | |||
|
37 | <span id="notebooks_buttons"> | |||
|
38 | <button id="new_notebook">New Notebook</button> | |||
|
39 | </span> | |||
|
40 | </div> | |||
|
41 | <div id="notebook_list"> | |||
|
42 | <div id="project_name"><h2>{{project}}</h2></div> | |||
|
43 | </div> | |||
21 |
|
44 | |||
22 | <!-- JavaScript at the bottom for fast page loading --> |
|
45 | </div> | |
23 |
|
46 | |||
24 | <script src="static/jquery/js/jquery-1.5.1.min.js" type="text/javascript" charset="utf-8"></script> |
|
47 | <!-- <div id="right_panel">--> | |
25 | <script src="static/jquery/js/jquery-ui-1.8.10.custom.min.js" type="text/javascript" charset="utf-8"></script> |
|
48 | <!-- </div>--> | |
26 | <script src="static/jquery/js/jquery.wijmo-open.1.1.3.min.js" type="text/javascript" charset="utf-8"></script> |
|
49 | ||
27 | <script src="static/js/nbbrowser.js" type="text/javascript" charset="utf-8"></script> |
|
50 | </div> | |
|
51 | ||||
|
52 | </div> | |||
|
53 | ||||
|
54 | <script src="static/jquery/js/jquery-1.6.2.min.js" type="text/javascript" charset="utf-8"></script> | |||
|
55 | <script src="static/jquery/js/jquery-ui-1.8.14.custom.min.js" type="text/javascript" charset="utf-8"></script> | |||
|
56 | <script src="static/js/namespace.js" type="text/javascript" charset="utf-8"></script> | |||
|
57 | <script src="static/js/notebooklist.js" type="text/javascript" charset="utf-8"></script> | |||
|
58 | <script src="static/js/nbbrowser_main.js" type="text/javascript" charset="utf-8"></script> | |||
28 |
|
59 | |||
29 | </body> |
|
60 | </body> | |
30 | </html> No newline at end of file |
|
61 | ||
|
62 | </html> | |||
|
63 | ||||
|
64 |
@@ -22,7 +22,9 b'' | |||||
22 | <link rel="stylesheet" href="static/codemirror2/lib/codemirror.css"> |
|
22 | <link rel="stylesheet" href="static/codemirror2/lib/codemirror.css"> | |
23 | <link rel="stylesheet" href="static/codemirror2/mode/python/python.css"> |
|
23 | <link rel="stylesheet" href="static/codemirror2/mode/python/python.css"> | |
24 |
|
24 | |||
|
25 | <link rel="stylesheet" href="static/css/boilerplate.css" type="text/css" /> | |||
25 | <link rel="stylesheet" href="static/css/layout.css" type="text/css" /> |
|
26 | <link rel="stylesheet" href="static/css/layout.css" type="text/css" /> | |
|
27 | <link rel="stylesheet" href="static/css/base.css" type="text/css" /> | |||
26 | <link rel="stylesheet" href="static/css/notebook.css" type="text/css" /> |
|
28 | <link rel="stylesheet" href="static/css/notebook.css" type="text/css" /> | |
27 |
|
29 | |||
28 | </head> |
|
30 | </head> | |
@@ -39,7 +41,7 b'' | |||||
39 | <span id="kernel_status">Idle</span> |
|
41 | <span id="kernel_status">Idle</span> | |
40 | </div> |
|
42 | </div> | |
41 |
|
43 | |||
42 |
<div id="n |
|
44 | <div id="main_app"> | |
43 |
|
45 | |||
44 | <div id="left_panel"> |
|
46 | <div id="left_panel"> | |
45 |
|
47 |
General Comments 0
You need to be logged in to leave comments.
Login now