Skip to content

Commit

Permalink
Merge branch 'master' of github.com:sukria/Broadway
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexis Sukrieh committed Feb 22, 2011
2 parents 4fadce3 + b1a0cbc commit aa155f1
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions lib/Broadway/UI.pm
Expand Up @@ -2,7 +2,6 @@ package Broadway::UI;

use Dancer ':syntax';
use Dancer::Plugin::Ajax;

use Broadway::Slide;

sub display_slide {
Expand All @@ -11,16 +10,29 @@ sub display_slide {
return template("slide-$slide");
}

ajax '/preview' => sub {
my $next = Broadway::Slide->current + 1;
content_type "text/html; charset=UTF-8";
display_slide($next);
};

before_template sub {
my $tokens = shift;
if (request->agent =~ /Android|iPhone/i) {
debug "is_multi_touch : ".request->user_agent;
$tokens->{is_multi_touch} = 1;
}
};

get '/' => sub {
template 'slideshow';

my $tokens = {};

if (request->agent =~ /Android|iPhone/i) {
debug "is_multi_touch : ".request->user_agent;
$tokens->{is_multi_touch} = 1;
}

template 'slideshow', $tokens;
};

get '/slide/:slide' => sub {
Expand Down

0 comments on commit aa155f1

Please sign in to comment.