From 775bc5c77ed9d870073d30e5f633ffe3df72b447 Mon Sep 17 00:00:00 2001 From: John Bintz Date: Fri, 23 Mar 2012 17:33:58 -0400 Subject: [PATCH] pre-gh pages creation --- _site/assets/application.js | 24 ++++++++++++++++++++---- _site/index.html | 6 +++--- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/_site/assets/application.js b/_site/assets/application.js index d124830..1f7e22d 100644 --- a/_site/assets/application.js +++ b/_site/assets/application.js @@ -23,7 +23,8 @@ Attentive.Presentation = (function() { this.advanceTo = __bind(this.advanceTo, this); this.advance = __bind(this.advance, this); this.handleKeyDown = __bind(this.handleKeyDown, this); - this.handleClick = __bind(this.handleClick, this); + this.handleMouseUp = __bind(this.handleMouseUp, this); + this.handleMouseDown = __bind(this.handleMouseDown, this); this.handlePopState = __bind(this.handlePopState, this); this.length = this.allSlides().length; this.priorSlide = null; @@ -50,8 +51,9 @@ Attentive.Presentation = (function() { var imageWait, _this = this; this.timer.render(); - document.addEventListener('click', this.handleClick, false); document.addEventListener('keydown', this.handleKeyDown, false); + document.addEventListener('mousedown', this.handleMouseDown, false); + document.addEventListener('mouseup', this.handleMouseUp, false); window.addEventListener('resize', _.throttle(this.calculate, 500), false); imageWait = null; imageWait = function() { @@ -83,8 +85,22 @@ Attentive.Presentation = (function() { return this.advanceTo(this.slideFromLocation()); }; - Presentation.prototype.handleClick = function(e) { - if (e.target.tagName !== 'A') return this.advance(); + Presentation.prototype.handleMouseDown = function(e) { + return this.startSwipeX = e.x; + }; + + Presentation.prototype.handleMouseUp = function(e) { + var distance; + distance = this.startSwipeX - e.x; + if (Math.abs(distance) > 10) { + if (distance < 0) { + return this.advance(-1); + } else { + return this.advance(1); + } + } else { + if (e.target.tagName !== 'A') return this.advance(); + } }; Presentation.prototype.handleKeyDown = function(e) { diff --git a/_site/index.html b/_site/index.html index 4a6d6c3..2d5570c 100644 --- a/_site/index.html +++ b/_site/index.html @@ -5142,17 +5142,17 @@ rack.errors -
#<Object:0x00000101971920>
+
#<Object:0x000001009d7f78>
rack.input -
#<StringIO:0x00000100b3b568>
+
#<StringIO:0x00000100bb2028>
rack.logger -
#<Logger:0x0000010099a100 @progname=nil, @level=1, @default_formatter=#<Logger::Formatter:0x0000010099a0d8 @datetime_format=nil>, @formatter=nil, @logdev=#<Logger::LogDevice:0x00000100999f20 @shift_size=nil, @shift_age=nil, @filename=nil, @dev=#<StringIO:0x00000100b3b658>, @mutex=#<Logger::LogDevice::LogDeviceMutex:0x00000100999e30 @mon_owner=nil, @mon_count=0, @mon_mutex=#<Mutex:0x00000100999c28>>>>
+
#<Logger:0x0000010116e7f0 @progname=nil, @level=1, @default_formatter=#<Logger::Formatter:0x0000010116e7c8 @datetime_format=nil>, @formatter=nil, @logdev=#<Logger::LogDevice:0x0000010116e688 @shift_size=nil, @shift_age=nil, @filename=nil, @dev=#<StringIO:0x00000100bb20f0>, @mutex=#<Logger::LogDevice::LogDeviceMutex:0x0000010116e520 @mon_owner=nil, @mon_count=0, @mon_mutex=#<Mutex:0x0000010116e368>>>>