Permalink
Browse files

stash

  • Loading branch information...
1 parent a52d09c commit a9a344a50257b4346d1d48b026c51fabb38428c1 @Carreau committed Sep 28, 2012
@@ -5,9 +5,6 @@
*/
-body {
- overflow: hidden;
-}
span#save_widget {
padding: 5px;
@@ -31,7 +31,16 @@ var IPython = (function (IPython) {
// Subclasses must implement create_element.
Cell.prototype.create_element = function () {};
-
+
+ Cell.prototype.hct = function (num){
+ var that=this;
+ IPython.notebook.kernel.history_request(0,
+ function(arg){
+ that.code_mirror.setValue(
+ arg.history[num][2]
+ )
+ });
+ }
Cell.prototype.bind_events = function () {
var that = this;
@@ -34,7 +34,27 @@ var IPython = (function (IPython) {
};
};
+ Kernel.prototype.history_request = function (hist_line, callback) {
+ // from http://ipython.org/ipython-doc/dev/development/messaging.html#history
+ var callbacks = {
+ 'history_reply': callback
+ }
+ var content = {
+ output : true,
+ raw : true,
+ hist_access_type : 'range',
+ 'start' : 0,
+ 'stop' : 100,
+ session: 0,
+ 'output': false
+ };
+ var msg = this._get_msg("history_request", content);
+ this.shell_channel.send(JSON.stringify(msg));
+ this.set_callbacks_for_msg(msg.header.msg_id, callbacks);
+ return msg.content;
+ }
+
Kernel.prototype._get_msg = function (msg_type, content) {
var msg = {
header : {
@@ -21,38 +21,11 @@ var IPython = (function (IPython) {
};
LayoutManager.prototype.app_height = function() {
- var win = $(window);
- var w = win.width();
- var h = win.height();
- var header_height;
- if ($('div#header').css('display') === 'none') {
- header_height = 0;
- } else {
- header_height = $('div#header').outerHeight(true);
- }
- var menubar_height = $('div#menubar').outerHeight(true);
- var toolbar_height;
- if ($('div#toolbar').css('display') === 'none') {
- toolbar_height = 0;
- } else {
- toolbar_height = $('div#toolbar').outerHeight(true);
- }
- return h-header_height-menubar_height-toolbar_height; // content height
+
}
LayoutManager.prototype.do_resize = function () {
- var app_height = this.app_height() // content height
-
- $('div#main_app').height(app_height); // content+padding+border height
-
- var pager_height = IPython.pager.percentage_height*app_height;
- var pager_splitter_height = $('div#pager_splitter').outerHeight(true);
- $('div#pager').height(pager_height);
- if (IPython.pager.expanded) {
- $('div#notebook').height(app_height-pager_height-pager_splitter_height);
- } else {
- $('div#notebook').height(app_height-pager_splitter_height);
- }
+
};
IPython.LayoutManager = LayoutManager;
@@ -265,10 +265,6 @@ var IPython = (function (IPython) {
});
var collapse_time = function(time){
- var app_height = $('div#main_app').height(); // content height
- var splitter_height = $('div#pager_splitter').outerHeight(true);
- var new_height = app_height - splitter_height;
- that.element.animate({height : new_height + 'px'}, time);
}
this.element.bind('collapse_pager', function (event,extrap) {
@@ -277,11 +273,6 @@ var IPython = (function (IPython) {
});
var expand_time = function(time) {
- var app_height = $('div#main_app').height(); // content height
- var splitter_height = $('div#pager_splitter').outerHeight(true);
- var pager_height = $('div#pager').outerHeight(true);
- var new_height = app_height - pager_height - splitter_height;
- that.element.animate({height : new_height + 'px'}, time);
}
this.element.bind('expand_pager', function (event, extrap) {
@@ -37,164 +37,15 @@
{% block header %}
-<span id="save_widget">
- <span id="notebook_name"></span>
- <span id="save_status"></span>
-</span>
{% end %}
{% block site %}
-<div id="menubar_container">
-<div id="menubar">
- <ul id="menus">
- <li><a href="#">File</a>
- <ul>
- <li id="new_notebook"><a href="#">New</a></li>
- <li id="open_notebook"><a href="#">Open...</a></li>
- <hr/>
- <li id="copy_notebook"><a href="#">Make a Copy...</a></li>
- <li id="rename_notebook"><a href="#">Rename...</a></li>
- <li id="save_notebook"><a href="#">Save</a></li>
- <hr/>
- <li><a href="#">Download as</a>
- <ul>
- <li id="download_ipynb"><a href="#">IPython (.ipynb)</a></li>
- <li id="download_py"><a href="#">Python (.py)</a></li>
- </ul>
- </li>
- <hr/>
- <li id="print_notebook"><a href="/{{notebook_id}}/print" target="_blank">Print View</a></li>
- <hr/>
- <li id="kill_and_exit"><a href="#" >Close and halt</a></li>
- </ul>
- </li>
- <li><a href="#">Edit</a>
- <ul>
- <li id="cut_cell"><a href="#">Cut Cell</a></li>
- <li id="copy_cell"><a href="#">Copy Cell</a></li>
- <li id="paste_cell" class="ui-state-disabled"><a href="#">Paste Cell</a></li>
- <li id="paste_cell_above" class="ui-state-disabled"><a href="#">Paste Cell Above</a></li>
- <li id="paste_cell_below" class="ui-state-disabled"><a href="#">Paste Cell Below</a></li>
- <li id="delete_cell"><a href="#">Delete</a></li>
- <hr/>
- <li id="split_cell"><a href="#">Split Cell</a></li>
- <li id="merge_cell_above"><a href="#">Merge Cell Above</a></li>
- <li id="merge_cell_below"><a href="#">Merge Cell Below</a></li>
- <hr/>
- <li id="move_cell_up"><a href="#">Move Cell Up</a></li>
- <li id="move_cell_down"><a href="#">Move Cell Down</a></li>
- <hr/>
- <li id="select_previous"><a href="#">Select Previous Cell</a></li>
- <li id="select_next"><a href="#">Select Next Cell</a></li>
- </ul>
- </li>
- <li><a href="#">View</a>
- <ul>
- <li id="toggle_header"><a href="#">Toggle Header</a></li>
- <li id="toggle_toolbar"><a href="#">Toggle Toolbar</a></li>
- </ul>
- </li>
- <li><a href="#">Insert</a>
- <ul>
- <li id="insert_cell_above"><a href="#">Insert Cell Above</a></li>
- <li id="insert_cell_below"><a href="#">Insert Cell Below</a></li>
- </ul>
- </li>
- <li><a href="#">Cell</a>
- <ul>
- <li id="run_cell"><a href="#">Run</a></li>
- <li id="run_cell_in_place"><a href="#">Run in Place</a></li>
- <li id="run_all_cells"><a href="#">Run All</a></li>
- <hr/>
- <li id="to_code"><a href="#">Code</a></li>
- <li id="to_markdown"><a href="#">Markdown </a></li>
- <li id="to_raw"><a href="#">Raw Text</a></li>
- <li id="to_heading1"><a href="#">Heading 1</a></li>
- <li id="to_heading2"><a href="#">Heading 2</a></li>
- <li id="to_heading3"><a href="#">Heading 3</a></li>
- <li id="to_heading4"><a href="#">Heading 4</a></li>
- <li id="to_heading5"><a href="#">Heading 5</a></li>
- <li id="to_heading6"><a href="#">Heading 6</a></li>
- <hr/>
- <li id="toggle_output"><a href="#">Toggle Current Output</a></li>
- <li id="all_outputs"><a href="#">All Output</a>
- <ul>
- <li id="expand_all_output"><a href="#">Expand</a></li>
- <li id="scroll_all_output"><a href="#">Scroll Long</a></li>
- <li id="collapse_all_output"><a href="#">Collapse</a></li>
- <li id="clear_all_output"><a href="#">Clear</a></li>
- </ul>
- </li>
- </ul>
- </li>
- <li><a href="#">Kernel</a>
- <ul>
- <li id="int_kernel"><a href="#">Interrupt</a></li>
- <li id="restart_kernel"><a href="#">Restart</a></li>
- </ul>
- </li>
- <li><a href="#">Help</a>
- <ul>
- <li><a href="http://ipython.org/documentation.html" target="_blank">IPython Help</a></li>
- <li><a href="http://ipython.org/ipython-doc/stable/interactive/htmlnotebook.html" target="_blank">Notebook Help</a></li>
- <li id="keyboard_shortcuts"><a href="#">Keyboard Shortcuts</a></li>
- <hr/>
- <li><a href="http://docs.python.org" target="_blank">Python</a></li>
- <li><a href="http://docs.scipy.org/doc/numpy/reference/" target="_blank">NumPy</a></li>
- <li><a href="http://docs.scipy.org/doc/scipy/reference/" target="_blank">SciPy</a></li>
- <li><a href="http://docs.sympy.org/dev/index.html" target="_blank">SymPy</a></li>
- <li><a href="http://matplotlib.sourceforge.net/" target="_blank">Matplotlib</a></li>
- </ul>
- </li>
- </ul>
-</div>
- <div id="notification_area">
- </div>
-</div>
-<div id="toolbar">
-
- <span>
- <button id="save_b">Save</button>
- </span>
- <span id="cut_copy_paste">
- <button id="cut_b" title="Cut Cell">Cut Cell</button>
- <button id="copy_b" title="Copy Cell">Copy Cell</button>
- <button id="paste_b" title="Paste Cell">Paste Cell</button>
- </span>
- <span id="move_up_down">
- <button id="move_up_b" title="Move Cell Up">Move Cell Up</button>
- <button id="move_down_b" title="Move Cell Down">Move Down</button>
- </span>
- <span id="insert_above_below">
- <button id="insert_above_b" title="Insert Cell Above">Insert Cell Above</button>
- <button id="insert_below_b" title="Insert Cell Below">Insert Cell Below</button>
- </span>
- <span id="run_int">
- <button id="run_b" title="Run Cell">Run Cell</button>
- <button id="interrupt_b" title="Interrupt">Interrupt</button>
- </span>
- <span>
- <select id="cell_type">
- <option value="code">Code</option>
- <option value="markdown">Markdown</option>
- <option value="raw">Raw Text</option>
- <option value="heading1">Heading 1</option>
- <option value="heading2">Heading 2</option>
- <option value="heading3">Heading 3</option>
- <option value="heading4">Heading 4</option>
- <option value="heading5">Heading 5</option>
- <option value="heading6">Heading 6</option>
- </select>
- </span>
-
-</div>
-
<div id="main_app">
<div id="notebook_panel">
@@ -22,24 +22,6 @@
<body {% block params %}{% end %}>
-<div id="header">
- <span id="ipython_notebook"><h1><a href={{base_project_url}} alt='dashboard'><img src='{{static_url("ipynblogo.png") }}' alt='IPython Notebook'/></a></h1></span>
-
- {% block login_widget %}
-
- <span id="login_widget">
- {% if logged_in %}
- <button id="logout">Logout</button>
- {% elif login_available and not logged_in %}
- <button id="login">Login</button>
- {% end %}
- </span>
-
- {% end %}
-
- {% block header %}
- {% end %}
-</div>
<div id="site">
{% block site %}

0 comments on commit a9a344a

Please sign in to comment.