Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Lift MSG_OUTPUT_READY handling out of process_inbox

  • Loading branch information...
commit 4ff5269647cdde352d3dc4ab36f454cf44960e22 1 parent 60420c6
@jcorbin jcorbin authored
Showing with 14 additions and 15 deletions.
  1. +14 −15 ui/website/repl.js
View
29 ui/website/repl.js
@@ -368,6 +368,20 @@ var message_handlers = [];
message_handlers[MSG_OUTPUT_NULL] = function(msg) {}; // do nothing
+message_handlers[MSG_OUTPUT_READY] = function(msg) {
+ // remove the initializing message
+ $("#terminal").html("");
+
+ // enable input
+ $("#prompt").show();
+ $("#terminal-input").removeAttr("disabled");
+ $("#terminal-input").show();
+ $("#terminal-input").focus();
+
+ // reset the size of the input box
+ set_input_width();
+};
+
// process the messages in the inbox
function process_inbox() {
// iterate through the messages
@@ -378,21 +392,6 @@ function process_inbox() {
if (typeof handler == "function")
handler(msg);
- // MSG_OUTPUT_READY
- if (type == MSG_OUTPUT_READY) {
- // remove the initializing message
- $("#terminal").html("");
-
- // enable input
- $("#prompt").show();
- $("#terminal-input").removeAttr("disabled");
- $("#terminal-input").show();
- $("#terminal-input").focus();
-
- // reset the size of the input box
- set_input_width();
- }
-
// MSG_OUTPUT_MESSAGE
if (type == MSG_OUTPUT_MESSAGE) {
// print the message
Please sign in to comment.
Something went wrong with that request. Please try again.