package Spork::Template::Mason;
use strict;
use warnings;
use vars qw($VERSION);
use Spoon::Template::Mason '-base';
use Spoon::Installer '-base';
$VERSION = 0.04;
sub plugins { {} }
sub extract_to
{
my $self = shift;
$self->hub->config->template_directory;
}
sub path
{
my $self = shift;
$self->hub->config->template_path ||
[ $self->hub->config->template_directory ];
}
1;
__DATA__
__autohandler__
<& top.mas, %ARGS &>
% $m->call_next;
<& bottom.mas, %ARGS &>
__top.mas__
<% $image_html %>
<% $slide_content %>
% unless ($last) {
continued...
% }
<%args>
$image_html
$slide_content
$last
%args>
__slide.css__
/* BEGIN slide.css */
hr {
color: #202040;
height: 0px;
border-top: 0px;
border-bottom: 3px #202040 ridge;
border-left: 0px;
border-right: 0px;
}
a:link {
color: #123422;
text-decoration: none;
}
a:visited {
color: #123333;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
p {
font-size: 24pt;
margin: 6pt;
}
div p {
font-size: 18pt;
margin-top: 12pt;
margin-bottom: 12pt;
margin-left: 6pt;
margin-right: 6pt;
}
small {
font-size: 9pt;
font-style: italic;
}
#topbar {
background: <% $banner_bgcolor %>;
color: blue;
position:absolute;
right: 5px;
left: 5px;
top: 5px;
}
#bottombar {
background: <% $banner_bgcolor %>;
color: blue;
position: fixed;
right: 5px;
left: 5px;
bottom: 5px;
height: 50px;
z-index: 0;
}
.top_spacer {
height: 0px;
margin: 0px 0px 0px 0px;
padding: 1px 0px 0px 0px;
}
.spacer {
bottom: 5px;
height: 50px;
}
#content {
background:#fff;
margin-left: 20px;
margin-right:20px;
margin-top: 80px;
}
#logo {
position: fixed;
right: 40px;
bottom: 51px;
width: 130px;
height: 150px;
z-index:3;
% if ( defined $logo_image ) {
background-image: url(<% $images_directory %>/<% $logo_image %>);
% }
background-repeat: no-repeat;
}
/* END index.css */
<%args>
$banner_bgcolor
$images_directory => ''
$logo_image => undef
%args>
<%flags>
inherit => undef
%flags>
__controls.js__
// BEGIN controls.js
function nextSlide() {
window.location = '<% $next_slide %>';
}
function prevSlide() {
window.location = '<% $prev_slide %>';
}
function indexSlide() {
window.location = 'index.html';
}
function startSlide() {
window.location = 'start.html';
}
function closeSlide() {
window.close();
}
function handleKey(e) {
var key;
if (e == null) {
// IE
key = event.keyCode
}
else {
// Mozilla
if (e.altKey || e.ctrlKey) {
return true
}
key = e.which
}
switch(key) {
case 8: prevSlide(); break
case 13: nextSlide(); break
case 32: nextSlide(); break
case 81: closeSlide(); break
case 105: indexSlide(); break
case 110: nextSlide(); break
case 112: prevSlide(); break
case 115: startSlide(); break
default: //xxx(e.which)
}
}
document.onkeypress = handleKey
% if ($mouse_controls) {
document.onclick = nextSlide
% }
// END controls.js
<%args>
$prev_slide => ''
$next_slide => ''
$mouse_controls
%args>
__END__
=head1 NAME
Spork::Template::Mason - Spork templating with Mason
=head1 SYNOPSIS
# in your config.yaml file
template_class: Spork::Template::Mason
files_class: Spork::Template::Mason
=head1 DESCRIPTION
At present, this module's only purpose it to provide a default set of
Mason templates for Spork. These templates are more or less identical
to the TT2 templates included in the main Spork distro. You'll
probably want to customize these.
=head1 USAGE
Just set "template_class" and "files_class" in your F