diff -uprN /home/files/coding/drupal/views_slideshow/contrib/views_slideshow_singleframe/views_slideshow.js sites/all/modules/views_slideshow/contrib/views_slideshow_singleframe/views_slideshow.js --- /home/files/coding/drupal/views_slideshow/contrib/views_slideshow_singleframe/views_slideshow.js 2009-11-17 15:26:19.000000000 +1100 +++ sites/all/modules/views_slideshow/contrib/views_slideshow_singleframe/views_slideshow.js 2009-12-18 19:44:03.000000000 +1100 @@ -13,6 +13,21 @@ Drupal.behaviors.viewsSlideshowSingleFra var fullId = '#' + $(this).attr('id'); var settings = Drupal.settings.viewsSlideshowSingleFrame[fullId]; settings.targetId = '#' + $(fullId + " :first").attr('id'); + + var timeouts = new Array(settings.num_divs) + for (i=0; i < timeouts.length; ++i) { + if (i == timeouts.length - 1) { + timeouts[i] = parseInt(settings.timeout) + parseInt(settings.end_delay); + } + else { + timeouts[i] = parseInt(settings.timeout); + } + } + + function calculateTimeout(currElement, nextElement, opts, isForward) { + return timeouts[opts.currSlide]; + } + settings.opts = { speed:settings.speed, @@ -45,6 +60,18 @@ Drupal.behaviors.viewsSlideshowSingleFra cleartype:(settings.ie.cleartype), cleartypeNoBg:(settings.ie.cleartypenobg) } + + switch (settings.end_behaviour) { + case "wait": + settings.opts.timeoutFn = calculateTimeout; + case "stop": + settings.opts.autostop = 1; + case "redirect": + settings.opts.timeoutFn = calculateTimeout; + settings.opts.autostop = 1; + settings.opts.end = function() { + window.location = settings.end_url;} + } if (settings.pager_hover == 1) { settings.opts.pagerEvent = 'mouseover'; @@ -121,6 +148,11 @@ Drupal.behaviors.viewsSlideshowSingleFra } }); } + +function addDelayOnLastSlide(currElement, nextElement, opts, isForward) { + var index = opts.currSlide; + return timeouts[index]; +} Drupal.theme.prototype.viewsSlideshowPagerThumbnails = function (classes, idx, slide) { return '
'; diff -uprN /home/files/coding/drupal/views_slideshow/contrib/views_slideshow_singleframe/views_slideshow_singleframe.views_slideshow.inc sites/all/modules/views_slideshow/contrib/views_slideshow_singleframe/views_slideshow_singleframe.views_slideshow.inc --- /home/files/coding/drupal/views_slideshow/contrib/views_slideshow_singleframe/views_slideshow_singleframe.views_slideshow.inc 2009-10-05 15:41:09.000000000 +1100 +++ sites/all/modules/views_slideshow/contrib/views_slideshow_singleframe/views_slideshow_singleframe.views_slideshow.inc 2009-12-18 19:44:49.000000000 +1100 @@ -26,6 +26,9 @@ function views_slideshow_singleframe_vie 'cleartypenobg' => array('default' => FALSE), ), ), + 'end_behaviour' => array('default' => 'normal'), + 'end_delay' => array('default' => 0), + 'end_url' => array('default' => ''), 'advanced' => array('default' => ''), ), ); @@ -169,6 +172,31 @@ function views_slideshow_singleframe_vie '#default_value' =>(isset($view->options['singleframe']['sync'])) ? $view->options['singleframe']['sync'] : 1, '#description' => t('The sync option controls whether the slide transitions occur simultaneously. The default is yes which means that the current slide transitions out as the next slide transitions in. By setting the sync option to no you can get some interesting twists on your transitions.'), ); + $options = array( + 'normal' => t('Normal'), + 'wait' => t('Wait'), + 'stop' => t('Stop'), + 'redirect' => t('Wait then redirect') + ); + $form['singleframe']['end_behaviour'] = array( + '#type' => 'radios', + '#title' => t('End of loop behaviour'), + '#options' => $options, + '#default_value' => (isset($view->options['singleframe']['end_behaviour'])) ? $view->options['singleframe']['end_behaviour'] : 'end_behaviour_normal', + '#description' => t('Behaviour at end of loop. Normal loops back to the start, Wait waits for the time specified below, Stop stops the slideshow, Redirect waits and then sends the user to the specified URL.') + ); + $form['singleframe']['end_delay'] = array( + '#type' => 'textfield', + '#title' => t('End of loop Delay'), + '#default_value' => (isset($view->options['singleframe']['end_delay'])) ? $view->options['singleframe']['end_delay']: 0, + '#description' => t('Delay in milliseconds.') + ); + $form['singleframe']['end_url'] = array( + '#type' => 'textfield', + '#title' => t('End of loop redirect URL'), + '#default_value' => (isset($view->options['singleframe']['end_url'])) ? $view->options['singleframe']['end_url']: '', + '#description' => t('URL to redirect to.') + ); $form['singleframe']['advanced'] = array( '#type' => 'textarea', '#title' => t('Advanced Options'),