add inline JavaScript variable to indicate slider direction (addresses #46)
This commit is contained in:
		
							parent
							
								
									dca42f4185
								
							
						
					
					
						commit
						f61853700d
					
				
					 2 changed files with 11 additions and 4 deletions
				
			
		|  | @ -56,14 +56,17 @@ $styles  = array('css/jquery.lightbox.css'); | ||||||
| $template = $theme->getTemplate(); | $template = $theme->getTemplate(); | ||||||
| 
 | 
 | ||||||
| if ($theme->themetype == 'horizontal') { | 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 { | } 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('scripts', $scripts); | ||||||
| $template->assign('styles', $styles); | $template->assign('styles', $styles); | ||||||
| $template->assign('inlinestyle', $inlinestyles); | $template->assign('inlinestyle', $inlinestyles); | ||||||
|  | $template->assign('inlinescript', $inlinescript); | ||||||
| $template->assign('title', getGalleryTitle($thumbinfo)); | $template->assign('title', getGalleryTitle($thumbinfo)); | ||||||
| $template->assign('gallerylinks', getGalleryLinks()); | $template->assign('gallerylinks', getGalleryLinks()); | ||||||
| $template->assign('thumbnails', getAllThumbnails($thumbinfo)); | $template->assign('thumbnails', getAllThumbnails($thumbinfo)); | ||||||
|  |  | ||||||
|  | @ -24,12 +24,16 @@ a:active { | ||||||
| } | } | ||||||
| </style> | </style> | ||||||
| <?php foreach ($content['styles'] as $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 } ?>
 | <?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/main.css" /> | ||||||
| <link rel="stylesheet" type="text/css" href="<?php echo $content['themepath']; ?>/css/format.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) { ?>
 | <?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 } ?>
 | <?php } ?>
 | ||||||
| </head> | </head> | ||||||
| <body> | <body> | ||||||
|  |  | ||||||
		Reference in a new issue