// Generated by CoffeeScript 1.4.0 (function() { var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; $(function() { var Presentation; Presentation = (function() { function Presentation(target) { this.target = target; this.stopPresentation = __bind(this.stopPresentation, this); this.startPresentation = __bind(this.startPresentation, this); this.target = $(this.target); this.id = this.target.parents('.entry').data('uuid'); this.target.attr('id', "presentation-" + this.id); this.target.addClass('prepared'); this.target.data('self', this); this.resizeImage(300); this.slides = this.createSlides(this.target.find('div.slide')); this.setStartButton(); } Presentation.prototype.resizeImage = function(w) { var img, _i, _len, _ref, _results; _ref = this.target.find('img'); _results = []; for (_i = 0, _len = _ref.length; _i < _len; _i++) { img = _ref[_i]; $(img).data('orig-width', $(img).width()); _results.push($(img).attr('width', Math.min($(img).width(), w))); } return _results; }; Presentation.prototype.resetSizeImage = function() { var img, _i, _len, _ref, _results; _ref = this.target.find('img'); _results = []; for (_i = 0, _len = _ref.length; _i < _len; _i++) { img = _ref[_i]; _results.push($(img).attr('width', $(img).data('orig-width'))); } return _results; }; Presentation.prototype.createSlides = function(slideDivs) { var idx, slide, slides; return slides = (function() { var _i, _len, _results; _results = []; for (idx = _i = 0, _len = slideDivs.length; _i < _len; idx = ++_i) { slide = slideDivs[idx]; _results.push(this.createSlide(slide, idx)); } return _results; }).call(this); }; Presentation.prototype.createSlide = function(div, idx) { var $page; $page = $(div).data('pid', idx); $page.append(this.createFooter(idx)); return $page; }; Presentation.prototype.setStartButton = function() { var $startButton; $startButton = $('