Skip to content

Commit

Permalink
Added goto, via typing a slide number.
Browse files Browse the repository at this point in the history
  • Loading branch information
spraints committed Mar 25, 2010
1 parent 18f2562 commit 7dbdb17
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
14 changes: 14 additions & 0 deletions public/js/showoff.js
Expand Up @@ -12,6 +12,7 @@ var incrElem
var incrCurr = 0
var incrCode = false
var debugMode = false
var gotoSlidenum = 0

function setupPreso() {
if (preso_started)
Expand Down Expand Up @@ -224,6 +225,19 @@ function keyDown(event)

debug('key: ' + key)

if (key >= 48 && key <= 57) // 0 - 9
{
gotoSlidenum = gotoSlidenum * 10 + (key - 48);
return true;
}
if (key == 13 && gotoSlidenum > 0)
{
debug('go to ' + gotoSlidenum);
slidenum = gotoSlidenum - 1;
showSlide(true);
}
gotoSlidenum = 0;

if (key == 32) // space bar
{
nextStep()
Expand Down
1 change: 1 addition & 0 deletions views/index.erb
Expand Up @@ -50,6 +50,7 @@
<tr><td class="key">space, &rarr;</td><td>next slide</td></tr>
<tr><td class="key">&larr;</td><td>previous slide</td></tr>
<tr><td class="key">d</td><td>debug mode</td></tr>
<tr><td class="key">## &lt;ret&gt;</td><td>go to slide #</td></tr>
<tr><td class="key">c</td><td>table of contents (vi)</td></tr>
<tr><td class="key">f</td><td>toggle footer</td></tr>
<tr><td class="key">r</td><td>reload slides</td></tr>
Expand Down

0 comments on commit 7dbdb17

Please sign in to comment.