Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Activated "uparrow" history browsing! simple!

  • Loading branch information...
commit a23e40e1185c019e9950328baab7501097c4990c 1 parent 6abdb49
@jamesgao authored
Showing with 12 additions and 3 deletions.
  1. +12 −3 IPython/frontend/html/js/notebook.js
View
15 IPython/frontend/html/js/notebook.js
@@ -165,6 +165,7 @@ Manager.prototype.order = function (idx) {
}
function Message(msg_id, obj) {
+ this.msg_id = msg_id
this.num = msg_id == -1?exec_count+1:exec_count
this.obj = $(document.createElement("div"))
this.obj.addClass("message")
@@ -199,9 +200,13 @@ Message.prototype.activate = function () {
this.text.focus()
var thisObj = this
- this.text.keypress(function(e) {
+ this.text.keydown(function(e) {
if (e.which == 13)
thisObj.submit(e.target.value)
+ else if (e.which == 38) {
+ manager.order(-1).activate()
+ manager.ondeck.remove()
+ }
})
}
Message.prototype.submit = function (code) {
@@ -210,7 +215,11 @@ Message.prototype.submit = function (code) {
comet.stop()
execute(code, function(json) {
thisObj.active = false
- manager.set(json.parent_header.msg_id)
+ if (manager.ondeck != null)
+ manager.set(json.parent_header.msg_id)
+ else
+ //TODO: Fix ordering!
+ manager.messages[json.parent_header.msg_id] = thisObj
comet.start()
})
}
@@ -226,5 +235,5 @@ Message.prototype.setOutput = function(value, header) {
var o = "Out [<span class='cbold'>"+this.num+"</span>]:"
this.out_head.html(o)
}
- this.output.append(value)
+ this.output.html(value)
}
Please sign in to comment.
Something went wrong with that request. Please try again.