Permalink
Browse files

q alias for questions. Questions display bug cleared

  • Loading branch information...
swvist committed Oct 11, 2011
1 parent fa3e739 commit 330e9198c897636f7731360c5ab218c4d18d9541
Showing with 3 additions and 2 deletions.
  1. +3 −2 js/xkcd_cli.js
View
@@ -59,7 +59,7 @@ var xkcd = {
}
};
-var xkcdDisplay = TerminalShell.commands['question'] = TerminalShell.commands['display'] = function(terminal, path) {
+var xkcdDisplay = TerminalShell.commands['q'] = TerminalShell.commands['question'] = TerminalShell.commands['display'] = function(terminal, path) {
console.log("last prev : " + xkcd.last.num);
@@ -81,7 +81,8 @@ console.log("last prev : " + xkcd.last.num);
xkcd.get(path, function(data) {
// Stuff to be dome with question data
terminal.setWorking(true);
- terminal.print($('<p>').addClass('question').text(data.question));
+ terminal.print($('<h3>').text('Question ' + data.num));
+ terminal.print($('<p class=question>' + data.question + '</p>'));
if(data.image)
terminal.print($('<img>').addClass('comic').attr('src', data.image));
terminal.print($('<ol class="answers"><li>'+ data.options[0] +'</li><li>' +data.options[1] + '</li><li>'+ data.options[2]+'</li><li>'+data.options[3]+'</li></ol>'));

0 comments on commit 330e919

Please sign in to comment.