##// END OF EJS Templates
First draft of toolbar....
Brian Granger -
Show More
@@ -0,0 +1,82 b''
1 //----------------------------------------------------------------------------
2 // Copyright (C) 2008-2011 The IPython Development Team
3 //
4 // Distributed under the terms of the BSD License. The full license is in
5 // the file COPYING, distributed as part of this software.
6 //----------------------------------------------------------------------------
7
8 //============================================================================
9 // ToolBar
10 //============================================================================
11
12 var IPython = (function (IPython) {
13
14 var ToolBar = function (selector) {
15 this.selector = selector;
16 if (this.selector !== undefined) {
17 this.element = $(selector);
18 this.style();
19 this.bind_events();
20 }
21 };
22
23
24 ToolBar.prototype.style = function () {
25 this.element.addClass('border-box-sizing');
26 this.element.find('#save_b').button({
27 icons : {primary: 'ui-icon-disk'},
28 text : false
29 });
30 this.element.find('#cut_b').button({
31 icons: {primary: 'ui-icon-scissors'},
32 text : false
33 });
34 this.element.find('#copy_b').button({
35 icons: {primary: 'ui-icon-copy'},
36 text : false
37 });
38 this.element.find('#paste_b').button({
39 icons: {primary: 'ui-icon-clipboard'},
40 text : false
41 });
42 this.element.find('#cut_copy_paste').buttonset();
43 this.element.find('#move_up_b').button({
44 icons: {primary: 'ui-icon-arrowthick-1-n'},
45 text : false
46 });
47 this.element.find('#move_down_b').button({
48 icons: {primary: 'ui-icon-arrowthick-1-s'},
49 text : false
50 });
51 this.element.find('#move_up_down').buttonset();
52 this.element.find('#insert_above_b').button({
53 icons: {primary: 'ui-icon-arrowthickstop-1-n'},
54 text : false
55 });
56 this.element.find('#insert_below_b').button({
57 icons: {primary: 'ui-icon-arrowthickstop-1-s'},
58 text : false
59 });
60 this.element.find('#insert_above_below').buttonset();
61 this.element.find('#run_b').button({
62 icons: {primary: 'ui-icon-play'},
63 text : false
64 });
65 this.element.find('#interrupt_b').button({
66 icons: {primary: 'ui-icon-stop'},
67 text : false
68 });
69 this.element.find('#run_int').buttonset();
70 };
71
72
73 ToolBar.prototype.bind_events = function () {
74
75 };
76
77
78 IPython.ToolBar = ToolBar;
79
80 return IPython;
81
82 }(IPython));
@@ -55,6 +55,12 b' span#notebook_name {'
55 margin: 0.3em 0;
55 margin: 0.3em 0;
56 }
56 }
57
57
58 #toolbar {
59 /* Initially hidden to prevent FLOUC */
60 display: none;
61 padding: 3px 15px;
62 }
63
58 span#quick_help_area {
64 span#quick_help_area {
59 position: static;
65 position: static;
60 padding: 5px 0px;
66 padding: 5px 0px;
@@ -27,7 +27,8 b' var IPython = (function (IPython) {'
27 var h = win.height();
27 var h = win.height();
28 var header_height = $('div#header').outerHeight(true);
28 var header_height = $('div#header').outerHeight(true);
29 var menubar_height = $('div#menubar').outerHeight(true);
29 var menubar_height = $('div#menubar').outerHeight(true);
30 var app_height = h-header_height-menubar_height-2; // content height
30 var toolbar_height = $('div#toolbar').outerHeight(true);
31 var app_height = h-header_height-menubar_height-toolbar_height-2; // content height
31
32
32 $('div#main_app').height(app_height + 2); // content+padding+border height
33 $('div#main_app').height(app_height + 2); // content+padding+border height
33
34
@@ -88,6 +88,7 b' $(document).ready(function () {'
88 IPython.notebook = new IPython.Notebook('div#notebook');
88 IPython.notebook = new IPython.Notebook('div#notebook');
89 IPython.kernel_status_widget = new IPython.KernelStatusWidget('#kernel_status');
89 IPython.kernel_status_widget = new IPython.KernelStatusWidget('#kernel_status');
90 IPython.menubar = new IPython.MenuBar('#menubar')
90 IPython.menubar = new IPython.MenuBar('#menubar')
91 IPython.toolbar = new IPython.ToolBar('#toolbar')
91 IPython.kernel_status_widget.status_idle();
92 IPython.kernel_status_widget.status_idle();
92
93
93 IPython.layout_manager.do_resize();
94 IPython.layout_manager.do_resize();
@@ -106,6 +107,7 b' $(document).ready(function () {'
106 }
107 }
107
108
108 $('div#menubar').css('display','block');
109 $('div#menubar').css('display','block');
110 $('div#toolbar').css('display','block');
109 $('div#main_app').css('display','block');
111 $('div#main_app').css('display','block');
110
112
111 IPython.layout_manager.do_resize();
113 IPython.layout_manager.do_resize();
@@ -141,6 +141,37 b''
141
141
142 </div>
142 </div>
143
143
144 <div id="toolbar">
145
146 <span>
147 <button id="save_b">Save</button>
148 </span>
149 <span id="cut_copy_paste">
150 <button id="cut_b" title="Cut">Cut</button>
151 <button id="copy_b" title="Copy">Copy</button>
152 <button id="paste_b" title="Paste">Paste</button>
153 </span>
154 <span id="move_up_down">
155 <button id="move_up_b" title="Move Up">Move Up</button>
156 <button id="move_down_b" title="Move Down">Move Down</button>
157 </span>
158 <span id="insert_above_below">
159 <button id="insert_above_b" title="Insert Above">Insert Above</button>
160 <button id="insert_below_b" title="Insert Below">Insert Below</button>
161 </span>
162 <span id="run_int">
163 <button id="run_b" title="Run">Run</button>
164 <button id="interrupt_b" title="Interrupt">Interrupt</button>
165 </span>
166 <span>
167 <select id="cell_type">
168 <option value="code">Code</option>
169 <option value="markdown">Markdown</option>
170 </select>
171 </span>
172
173 </div>
174
144 <div id="main_app">
175 <div id="main_app">
145
176
146 <div id="notebook_panel">
177 <div id="notebook_panel">
@@ -181,6 +212,7 b''
181 <script src="/static/js/loginwidget.js" type="text/javascript" charset="utf-8"></script>
212 <script src="/static/js/loginwidget.js" type="text/javascript" charset="utf-8"></script>
182 <script src="/static/js/pager.js" type="text/javascript" charset="utf-8"></script>
213 <script src="/static/js/pager.js" type="text/javascript" charset="utf-8"></script>
183 <script src="/static/js/menubar.js" type="text/javascript" charset="utf-8"></script>
214 <script src="/static/js/menubar.js" type="text/javascript" charset="utf-8"></script>
215 <script src="/static/js/toolbar.js" type="text/javascript" charset="utf-8"></script>
184 <script src="/static/js/notebook.js" type="text/javascript" charset="utf-8"></script>
216 <script src="/static/js/notebook.js" type="text/javascript" charset="utf-8"></script>
185 <script src="/static/js/notebookmain.js" type="text/javascript" charset="utf-8"></script>
217 <script src="/static/js/notebookmain.js" type="text/javascript" charset="utf-8"></script>
186
218
General Comments 0
You need to be logged in to leave comments. Login now