Show the input messages and set focus correct on input required.
This commit is contained in:
@ -1160,7 +1160,7 @@ $(function() {
|
||||
}
|
||||
switch(msg.cmd) {
|
||||
case 'input':
|
||||
showPrompt();
|
||||
showPrompt(msg);
|
||||
break;
|
||||
case 'write':
|
||||
printWebsocketOutput(msg);
|
||||
@ -1249,11 +1249,13 @@ $(function() {
|
||||
executeWebsocketCommand(msg);
|
||||
};
|
||||
|
||||
var showPrompt = function() {
|
||||
if (prompt.isPresent() && prompt.hasClass('hidden')) {
|
||||
var showPrompt = function(msg) {
|
||||
var label = $('#prompt .input-group-addon');
|
||||
label.text(msg.data || label.data('prompt'));
|
||||
if (prompt.isPresent() && prompt.hasClass('hidden')) {
|
||||
prompt.removeClass('hidden');
|
||||
}
|
||||
prompt.focus();
|
||||
$('#prompt input').focus();
|
||||
}
|
||||
|
||||
var hidePrompt = function() {
|
||||
|
@ -39,7 +39,7 @@
|
||||
#output-col1
|
||||
// todo set to full width if turtle isnt used
|
||||
#prompt.input-group.hidden
|
||||
span.input-group-addon = t('exercises.editor.input')
|
||||
span.input-group-addon data-prompt=t('exercises.editor.input') = t('exercises.editor.input')
|
||||
input#prompt-input.form-control type='text'
|
||||
span.input-group-btn
|
||||
button#prompt-submit.btn.btn-primary type="button" = t('exercises.editor.send')
|
||||
|
Reference in New Issue
Block a user