Sha256: 9d978137468883ccb97a20d7a5daf9a7c6bc534baf6ddcad193e3c029f04414e

Contents?: true

Size: 970 Bytes

Versions: 1

Compression:

Stored size: 970 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);
    },
    print: function() {
      window.location.href = "/print"
    }
   };

});

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
parade-0.10.2 lib/public/js/parade-command-input.js