eg/tryhy: add blinking cursor

This commit is contained in:
Johan Euphrosine 2013-11-02 01:12:11 -07:00
parent c02a1c6b4a
commit b099925eb2
2 changed files with 18 additions and 0 deletions

View File

@ -20,3 +20,19 @@ div.console div.jquery-console-welcome
{ color:#52666f; font-family:monospace;
padding:0.1em; }
div.console span.jquery-console-prompt-label { font-weight:bold }
span.jquery-console-cursor.running {
-webkit-animation-duration: 0.1s;
-webkit-animation-name: blink;
-webkit-animation-iteration-count: infinite;
-webkit-animation-direction: alternate;
}
@-webkit-keyframes blink {
from {
opacity: 1.0
}
to {
opacity: 0.5
}
}

View File

@ -7,6 +7,7 @@ $(document).ready(function(){
else return true;
},
commandHandle:function(line, report){
$('.jquery-console-cursor').addClass('running');
$.ajax({
type: 'POST',
url: '/eval',
@ -14,6 +15,7 @@ $(document).ready(function(){
contentType: 'application/json',
dataType: 'json',
success: function(data) {
$('.jquery-console-cursor').removeClass('running');
report([{msg : data.stdout, className:'jquery-console-message-value'},
{msg : data.stderr, className:'jquery-console-message-error'}]);
}