1
0

fixes #8, support for slideshow duration

This commit is contained in:
Fredrik Erlandsson 2012-01-10 12:36:16 +01:00
parent 5ed2ff0c97
commit 4047609e23
3 changed files with 9 additions and 3 deletions

View File

@ -82,6 +82,9 @@ class Admin_Theme_Options_Controller extends Admin_Controller {
$group->input("appletouchicon")
->label(t("URL (or relative path) to your apple-touch-icon.png"))
->value(module::get_var("gallery", "appletouchicon_url"));
$group->input("slideshow_time")
->label(t("Slideshow timeout (in ms)"))
->value(module::get_var("th_pear4gallery3", "slideshow_time", "5000"));
/* Advanced Options - General ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
@ -218,7 +221,7 @@ class Admin_Theme_Options_Controller extends Admin_Controller {
protected function reset_theme() {
// Default core theme settings
module::set_var("gallery", "page_size", 9);
module::set_var("gallery", "page_size", 50);
module::set_var("gallery", "resize_size", 640);
module::set_var("gallery", "thumb_size", 200);
module::set_var("gallery", "header_text", "");
@ -290,6 +293,7 @@ class Admin_Theme_Options_Controller extends Admin_Controller {
module::set_var("gallery", "appletouchicon_url", $form->edit_theme->appletouchicon->value);
$this->save_item_state("logo_path", $form->edit_theme->logo_path->value, $form->edit_theme->logo_path->value);
$this->save_item_state("slideshow_time", $form->edit_theme->slideshow_time->value != "5000", filter_var($form->edit_theme->slideshow_time->value, FILTER_VALIDATE_INT, array('options' => array('default' => 5000, 'min_range' => 1000))));
// * Advanced Options - General ******************************************

View File

@ -18,6 +18,7 @@ var hideHoverV = null;
var hovering = false;
var maxSize;
var mosaicEffect = "";
var slideshowTimeout = 5000;
function thumbPadding() {
var size, width, margin;
@ -317,7 +318,7 @@ function togglePlayPause() {
if (slideShow === null) {
$('#play_detail').hide();
$('#pause_detail').show();
slideShow = setTimeout("slideShowUpdate()", 5000);
slideShow = setTimeout("slideShowUpdate()", slideshowTimeout);
} else { //We are playing
$('#pause_detail').hide();
$('#play_detail').show();
@ -343,7 +344,7 @@ function slideShowUpdate() {
slideShowId = 0;
}
swatchImg(slideShowId);
slideShow = setTimeout("slideShowUpdate()", 5000);
slideShow = setTimeout("slideShowUpdate()", slideshowTimeout);
}
function switchMode(mode) {

View File

@ -2,6 +2,7 @@
<? /* Placeholder for infromation in mosaic view. */ ?>
<script type="text/javascript">
$(function() {
slideshowTimeout = <?=module::get_var("th_pear4gallery3", "slideshow_time", "5000")?>;
mosaicEffect = "<?
$mosaic_effect = module::get_var("th_pear4gallery3", "mosaic_effect", "blind");
if ($mosaic_effect == "none") print "";