Skip to content

Commit

Permalink
Add urls to commands and net tutorial link.
Browse files Browse the repository at this point in the history
Allow errors to embed urls in them
  • Loading branch information
kbrock committed Jun 14, 2011
1 parent 1f1a16a commit 87d5e23
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
6 changes: 5 additions & 1 deletion public/javascripts/terminal.js
Expand Up @@ -16,7 +16,7 @@ function submitCommand(text, dontClearInput) {
if (data.response !== undefined) {
append(JSON.stringify(data.response), "response");
} else if (data.error !== undefined) {
append(data.error, "error");
append(data.error, "error", "", true);
append("Please type <a href=\"#help\">HELP</a> for a list of commands.", "noti" )
} else if (data.notification !== undefined) {
append(data.notification, "notification", "", true);
Expand Down Expand Up @@ -116,4 +116,8 @@ $(document).ready(function () {
$("#toolbar").slideDown(500, function () {
$("#input").focus();
});
$("a[href^='#']").live('click',function () {
submitCommand($(this).attr('href').substr(1).replace('%20',' ').replace('_',' '));
return false;
});
});
4 changes: 2 additions & 2 deletions try-redis.rb
Expand Up @@ -255,7 +255,7 @@ def helpdocs
[ command, doc ]
end

cmds = raw_docs.map {|c, d| c.upcase}.sort.join(", ")
cmds = raw_docs.map {|c, d| "<a href=\"#help%20#{c.downcase}\">#{c.upcase}</a>"}.sort.join(", ")
raw_docs << [ "", "Please type HELP for one of these commands: " + cmds ]

@helpdocs ||= Hash[*raw_docs.flatten]
Expand All @@ -277,7 +277,7 @@ def tutorial(index)
doc = tutorialdocs[index]

if (1 ... tutorialdocs.count - 1).include? index
doc += '<p class="tutorial_next">Type NEXT to continue the tutorial.</p>'
doc += '<p class="tutorial_next">Type <a href="#next">NEXT</a> to continue the tutorial.</p>'
end

doc
Expand Down
2 changes: 1 addition & 1 deletion tutorial/00.markdown
@@ -1,5 +1,5 @@
Welcome to **Try Redis**, a demonstration of the
[Redis](http://code.google.com/p/redis/) database!

Please type TUTORIAL to begin a brief tutorial, HELP to see a list of supported
Please type [TUTORIAL](#tutorial) to begin a brief tutorial, [HELP](#help) to see a list of supported
commands, or any valid Redis command to play with the database.

0 comments on commit 87d5e23

Please sign in to comment.