go(send_message,'Great, thanks! After you\'ve typed your reply, you can send it by clicking "Send", but you can also send from the keyboard by pressing `Tab` and then `Enter`.'),
go(send_message,"Nice work. In Humbug, time flows down. Your new messages will always appear at the very bottom of the screen, and we don't automatically scroll. We're always receiving messages for you -- even when you're logged out."),
go(sleep,4000),
go(send_message,"By the way, right now we are exchanging **private messages**. Private messages can go to one or more recipients, and basically are just like a normal IM."),
go(send_message,"But Humbug also has **stream messages**. A stream is kind of like a group chatroom or a mailing list. Every stream message has two parts:\n"
go(send_message,"The brief subject is important because it lets you quickly read what you care about, and ignore what you don't. (Think of how useful email subject lines are!)"),
go(send_message,"I know that's a lot to take in, but once you understand the model, Humbug can be really powerful. I'll give you a second to catch your breath, but send me a reply when you're ready to continue."),
go2(wait_for_message,180,pm_to_me),
go(sleep,1000),
go(send_message,"We've started out by adding you to a few streams by default -- those appear on the left sidebar."),
go(sleep,2000),
go(send_message,"Why don't you send a message to let everyone know you're out there? Click the 'New stream message' button on the left, and send a message to stream `"+main_stream_name+"`, subject `signups`, with a message like \"Hey, I'm now on Humbug!\". (You could also press `c` to start a new message.)"),
go(send_message,"Great work! Other people might reply to your message while the tutorial is running, but that's ok! Managing multiple things at once is one of the strengths of Humbug."),
go(sleep,3000),
go(send_message,"It's easy to make or join streams. If you click the gear on the top right of the page, and then pick 'Streams', you can create your own stream, join streams that other people have made, or set colors for your streams."),
go(sleep,3000),
go(send_message,"Go in there and set a color for `"+main_stream_name+"`. Then come back here, and tell me when you've done so."),
go(sleep,1000),
//*********
// This call is particularly interesting because unlike all the others, it isn't an async
// call at all. But that's ok! Just wrap it in a function and return null and it will work
// (though it will proceed with the next task immediately after executing the function)
function(){$("#gear-menu").addClass('open');},
//*********
go2(wait_for_message,240,pm_to_me),
go(sleep,1000),
go(send_message,"Great! A couple things to note about subjects:\n"
+"* It's tempting to overthink your choice of subject. Don't.\n"
+"* Go with your gut. Typically one word will do: `meeting`, `Python`, or `lunch`\n"
+"* Subjects are preserved across replies, so most of the time you won't even have to think about them\n"),
go(send_message,"Another valuable feature of Humbug is **narrowing**. Click on **You and Humbug Tutorial Bot** above, scroll to the bottom, and tell me when you've done so."),
go(send_message,"Great! We're now looking only at messages between us. You can tell because the background is grey, and the search bar at the top has a query in it. You can narrow on many different types of things, including:\n"
+"* A specific stream, by clicking on the stream name, or\n"
+"* A specific stream-subject pair, by clicking on the subject name\n\n"
+"Press `Esc` to get out of this narrowed view, and tell me when you've done so.\n"),
go2(wait_for_message,180,pm_to_me),
go(sleep,1000),
go(send_message,"Okay, we're almost done -- I just want to quickly mention two more things. The first: code blocks."),
go(sleep,3000),
// Markdown
go(send_message,"Humbug makes it really easy to send syntax-highlighted code blocks. Just start the block with three `~`s and the extension for your programming language, like this:\n\n"
+"~~~~~\n"
+"~~~ .py\n"
+"def fn(arg):\n"
+" print 'Hello'\n"
+"~~~\n"
+"~~~~~"),
go(sleep,4000),
go(send_message,"Go ahead and try typing in that exact text, in a response to me."),
go(send_message,"Great, you did it! There are a bunch of other features I'd love to tell you about that we don't have time for, but experiment with:\n"
+"* Keyboard shortcuts (press `?` to see them)\n"
+"* More formatting support (there's a 'Formatting' link in the composebox, above the Send button)\n"
+" (In particular, you can format one line of code by surrounding it in `` `s)\n"
+"* The search bar at the top, and\n"
+"* Our [API](https://humbughq.com/api) and [Integrations](https://humbughq.com/integrations)"),
go(sleep,12000),
// Have them go talk to people
go(send_message,"**Congratulations! The tutorial is now complete**. Enjoy Humbug!"),
go(sleep,3000),
go(send_message,"Some things you can do from here:\n"
+"* Send a private message to someone by clicking their name in the left sidebar\n"
+"* Send a new stream message, or reply to an existing one\n"
+"(One suggestion: A message to stream `"+main_stream_name+"` with subject `today` about what you will be working on today).\n"
+"* Invite your coworkers (from the gear menu)\n")