Sha256: cec7443d81e4f2669504da066a73d1d98afccf03f4de19fee3b3c603e4ed54ff

Contents?: true

Size: 901 Bytes

Versions: 7

Compression:

Stored size: 901 Bytes

Contents

$(document).ready(function() {

  var publishCommand = function(notificationName) {
    return function(tokens) { $.publish(notificationName); };
  }

  window.TerminalCommands = {
    next : publishCommand('presentation:slide:next'),
    previous : publishCommand('presentation:slide:previous'),
    goto : function(tokens) {

      var gotoSlideNumber = undefined;

      if ( parseInt(tokens[0]) > 0 && parseInt(tokens[0]) < presentation.slideTotal()) {
        gotoSlideNumber = parseInt(tokens[0]) - 1;
      } else if (tokens[0] == 'start') {
        gotoSlideNumber = 0;
      } else if (tokens[0] == 'end') {
        gotoSlideNumber = presentation.slideTotal() - 1;
      } else {
        gotoSlideNumber = presentation.slides.findClosestToQuery(presentation.currentSlide.sequence,tokens[0]) - 1;
      }

      $.publish('presentation:slide:location:change',gotoSlideNumber);
    }
   };

});

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
parade-0.10.1 lib/public/js/parade-command-input.js
parade-0.10.0 lib/public/js/parade-command-input.js
parade-0.9.2 lib/public/js/parade-command-input.js
parade-0.9.1 lib/public/js/parade-command-input.js
parade-0.9.0 lib/public/js/parade-command-input.js
parade-0.8.2 lib/public/js/parade-command-input.js
parade-0.8.1 lib/public/js/parade-command-input.js