Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Add showoff:incr event for incrementing items on a slide. Fix gemspec loading issues #132

Merged
merged 4 commits into from

3 participants

@bgentry

No description provided.

@bgentry

Initialliy I tried to put this in ShowOff::Version, but because ShowOff inherits from Sinatra::Application, it would not have fixed the gemspec load issue I was experiencing.

In the future it would make sense to have a module ShowOff as the toplevel namespace and then have a class ShowOff::App < Sinatra::Application or something along those lines. The current class structure also prevented me from doing ShowOff::Pusher::Version in my own addon gem.

@will

+1 for increment event

@bgentry

anything I can do to help this get merged?

@goncalossilva goncalossilva merged commit d8e5f0f into schacon:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
View
1  README.rdoc
@@ -204,6 +204,7 @@ custom event:
* *showoff:show* will be triggered as soon as you enter a page
* *showoff:next* will be triggered when you switch to the next page
+* *showoff:incr* will be triggered when you advance to the next increment on the page
* *showoff:prev* will be triggered when you switch to the previous page
These events are triggered on the "div.content" child of the slide, so you must
View
2  lib/showoff.rb
@@ -31,8 +31,6 @@
class ShowOff < Sinatra::Application
- Version = VERSION = '0.7.0'
-
attr_reader :cached_image_size
set :views, File.dirname(__FILE__) + '/../views'
View
3  lib/showoff/version.rb
@@ -0,0 +1,3 @@
+# No namespace here since ShowOff is a class and I'd have to inherit from
+# Sinatra::Application (which we don't want to load here)
+SHOWOFF_VERSION = '0.7.0'
View
2  public/js/presenter.js
@@ -2,7 +2,7 @@
var w = null;
$(function(){
- w = window.open('/');
+ w = window.open('/' + window.location.search);
// side menu accordian crap
$("#preso").bind("showoff:loaded", function (event) {
$(".menu > ul ul").hide()
View
23 public/js/showoff.js
@@ -252,6 +252,16 @@ function determineIncremental()
})
}
+function showIncremental(incr)
+{
+ elem = incrElem.eq(incrCurr)
+ if (incrCode && elem.hasClass('command')) {
+ incrElem.eq(incrCurr).css('visibility', 'visible').jTypeWriter({duration:1.0})
+ } else {
+ incrElem.eq(incrCurr).css('visibility', 'visible')
+ }
+}
+
function prevStep()
{
@@ -277,13 +287,12 @@ function nextStep()
slidenum++
return showSlide()
} else {
- elem = incrElem.eq(incrCurr)
- if (incrCode && elem.hasClass('command')) {
- incrElem.eq(incrCurr).css('visibility', 'visible').jTypeWriter({duration:1.0})
- } else {
- incrElem.eq(incrCurr).css('visibility', 'visible')
- }
- incrCurr++
+ showIncremental(incrCurr);
+ var incrEvent = jQuery.Event("showoff:incr");
+ incrEvent.slidenum = slidenum;
+ incrEvent.incr = incrCurr;
+ $(currentSlide).find(".content").trigger(incrEvent);
+ incrCurr++;
}
}
View
6 showoff.gemspec
@@ -1,7 +1,9 @@
-require './lib/showoff'
+$:.unshift File.expand_path("../lib", __FILE__)
+require 'showoff/version'
+
Gem::Specification.new do |s|
s.name = "showoff"
- s.version = ShowOff::Version
+ s.version = SHOWOFF_VERSION
s.date = "2011-09-10"
s.summary = "The best damn presentation software a developer could ever love."
s.homepage = "http://github.com/schacon/showoff"
Something went wrong with that request. Please try again.