Archived
1
0
Fork 0

add inline JavaScript variable to indicate slider direction (addresses #46)

This commit is contained in:
Jan Dittberner 2009-07-11 19:14:13 +00:00
parent dca42f4185
commit f61853700d
2 changed files with 11 additions and 4 deletions

View file

@ -56,14 +56,17 @@ $styles = array('css/jquery.lightbox.css');
$template = $theme->getTemplate();
if ($theme->themetype == 'horizontal') {
$inlinestyles = sprintf("\n#scrollable { width:%dpx; }\n", $thumbinfo[0]);
$inlinestyles = sprintf("#scrollable { width:%dpx; }\n", $thumbinfo[0]);
$inlinescript = "var themetype='horizontal';";
} else {
$inlinestyles = sprintf("\n#scrollable { height:%dpx; }\n", $thumbinfo[0]);
$inlinestyles = sprintf("#scrollable { height:%dpx; }\n", $thumbinfo[0]);
$inlinescript = "var themetype='vertical';";
}
$template->assign('scripts', $scripts);
$template->assign('styles', $styles);
$template->assign('inlinestyle', $inlinestyles);
$template->assign('inlinescript', $inlinescript);
$template->assign('title', getGalleryTitle($thumbinfo));
$template->assign('gallerylinks', getGalleryLinks());
$template->assign('thumbnails', getAllThumbnails($thumbinfo));

View file

@ -24,12 +24,16 @@ a:active {
}
</style>
<?php foreach ($content['styles'] as $style) { ?>
<link rel="stylesheet" type="text/css" href="<?php echo $style; ?>" />
<link rel="stylesheet" type="text/css" href="<?php echo $style; ?>" />
<?php } ?>
<link rel="stylesheet" type="text/css" href="<?php echo $content['themepath']; ?>/css/main.css" />
<link rel="stylesheet" type="text/css" href="<?php echo $content['themepath']; ?>/css/format.css" />
<script type="text/javascript"><!--
<?php echo $content['inlinescript']; ?>
//--></script>
<?php foreach ($content['scripts'] as $script) { ?>
<script type="text/javascript" src="<?php echo $script; ?>"></script>
<script type="text/javascript" src="<?php echo $script; ?>"></script>
<?php } ?>
</head>
<body>