? .svn ? views_slideshow_plugins_and_cycle-2.patch ? views_slideshow_plugins_and_cycle.patch ? contrib/.svn ? contrib/views_slideshow_singleframe/.svn ? contrib/views_slideshow_thumbnailhover/.svn ? css/.svn ? js/.svn Index: views_slideshow.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/views_slideshow/views_slideshow.module,v retrieving revision 1.11.2.2 diff -u -p -r1.11.2.2 views_slideshow.module --- views_slideshow.module 16 Apr 2009 02:04:55 -0000 1.11.2.2 +++ views_slideshow.module 28 May 2009 00:23:57 -0000 @@ -7,7 +7,7 @@ */ define('VIEWS_SLIDESHOW_MODE_SINGLE_FRAME', 'singleframe'); // this will rotate through all slideshows in a single div element -define('VIEWS_SLIDESHOW_MODE_THUMBNAIL_HOVER', 'thumbnail_hover'); // this will create thumbnails of all the node teasers, with a mouse-over triggering a larger div full node view +define('VIEWS_SLIDESHOW_MODE_THUMBNAIL_HOVER', 'thumbnailhover'); // this will create thumbnails of all the node teasers, with a mouse-over triggering a larger div full node view define('VIEWS_SLIDESHOW_MODE_JCAROUSEL', 'jcarousel'); // this uses the jcarousel jquery plugin, if the jcarousel module is installed define('VIEWS_SLIDESHOW_DEFAULT_MODE', VIEWS_SLIDESHOW_MODE_SINGLE_FRAME); @@ -54,10 +54,6 @@ function views_slideshow_theme($existing 'template' => 'views-slideshow-thumbnail-hover', 'file' => 'views_slideshow.theme.inc', ), - 'views_slideshow_div_js' => array( - 'arguments' => array('rows' => NULL, 'options' => NULL, 'id' => NULL), - 'file' => 'views_slideshow.theme.inc', - ), 'views_slideshow_breakout_teaser_js' => array( 'arguments' => array('id' => NULL, 'count' => NULL), 'file' => 'views_slideshow.theme.inc', Index: views_slideshow.theme.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/views_slideshow/Attic/views_slideshow.theme.inc,v retrieving revision 1.1.2.2 diff -u -p -r1.1.2.2 views_slideshow.theme.inc --- views_slideshow.theme.inc 21 Mar 2009 00:36:39 -0000 1.1.2.2 +++ views_slideshow.theme.inc 28 May 2009 00:23:57 -0000 @@ -2,45 +2,6 @@ // $Id: views_slideshow.theme.inc,v 1.1.2.2 2009/03/21 00:36:39 aaron Exp $ /** - * This inline js sets up the timer for this slideshow. - */ -function theme_views_slideshow_div_js($rows, $options, $id) { - $hover = 'hover'; - if ($options['hover'] == 'hoverIntent') { - if (module_exists('jq')) { - $hover = jq_add('hoverIntent') ? 'hoverIntent' : 'hover'; - } - else if (module_exists('hoverintent')) { - $hover = hoverintent_add() ? 'hoverIntent' : 'hover'; - } - } - - $num_divs = sizeof($rows); - $fade = $options['fade'] ? 'true' : 'false'; - - $js = <<' . "\n"; if ($mode == VIEWS_SLIDESHOW_MODE_THUMBNAIL_HOVER) { foreach ($view->result as $count => $node) { @@ -61,18 +33,6 @@ function theme_views_slideshow_no_displa } } else { - // Add support for the jQuery Cycle plugin. - // If we have the jQ module installed, use that to add the Cycle plugin if possible. - // That allows for version control. - if (module_exists('jq')) { - $js = jq_add('cycle'); - } - - // Otherwise, we'll add the version included with this module. - if (!$js) { - drupal_add_js(drupal_get_path('module', 'views_slideshow') .'/js/jquery.cycle.all.min.js', 'module'); - } - foreach ($rows as $count => $item) { $output .= theme('views_slideshow_no_display_teaser', $item, $id, $count); } @@ -85,8 +45,8 @@ function theme_views_slideshow_no_displa * The html that will be placed into the element in its turn during its frame. */ function theme_views_slideshow_no_display_teaser($item, $id, $count) { - $hidden = $count ? 'class="views_slideshow_hidden"' : ''; - $output = '
' . "\n "; + $class = 'class="views_slideshow_slide' . ($count ? ' views_slideshow_hidden"' : '"'); + $output = '
' . "\n "; $output .= $item . "\n"; $output .= '
' . "\n\n"; return $output; @@ -96,7 +56,7 @@ function theme_views_slideshow_no_displa * These are teasers that may be pointed at with a mouse to change the element directly. */ function theme_views_slideshow_breakout_teasers($items, $id) { - $output = '
' . "\n"; + $output = '
' . "\n"; $js = "$(document).ready(function() {\n"; foreach ($items as $count => $item) { $output .= theme('views_slideshow_breakout_teaser', $item, $id, $count); @@ -127,7 +87,7 @@ function theme_views_slideshow_breakout_ views_slideshow_resume("' . $id . '"); }); '; - return $js; + return '';//$js; } /** Index: views_slideshow.views_slideshow.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/views_slideshow/Attic/views_slideshow.views_slideshow.inc,v retrieving revision 1.1.2.2 diff -u -p -r1.1.2.2 views_slideshow.views_slideshow.inc --- views_slideshow.views_slideshow.inc 16 Apr 2009 02:04:55 -0000 1.1.2.2 +++ views_slideshow.views_slideshow.inc 28 May 2009 00:23:57 -0000 @@ -6,99 +6,8 @@ * The default options available with Views Slideshow. */ -function views_slideshow_views_slideshow_modes() { - $options = array( -// VIEWS_SLIDESHOW_MODE_SINGLE_FRAME => t('Single frame'), - VIEWS_SLIDESHOW_MODE_THUMBNAIL_HOVER => t('Thumbnail hover'), -// VIEWS_SLIDESHOW_MODE_JCAROUSEL => t('jCarousel'), - ); - return $options; -} function views_slideshow_views_slideshow_option_definition() { $options['mode'] = array('default' => VIEWS_SLIDESHOW_DEFAULT_MODE); - $options['hover'] = array('default' => (module_exists('hoverintent') ? 'hoverIntent' : 'hover')); - $options['timer_delay'] = array('default' => VIEWS_SLIDESHOW_DEFAULT_TIMER_DELAY); - $options['sort'] = array('default' => VIEWS_SLIDESHOW_DEFAULT_SORT_ORDER); - $options['fade'] = array('default' => VIEWS_SLIDESHOW_DEFAULT_FADE); - $options['fade_speed'] = array('default' => VIEWS_SLIDESHOW_DEFAULT_FADE_SPEED); - $options['fade_value'] = array('default' => VIEWS_SLIDESHOW_DEFAULT_FADE_VALUE); - $options['hover_breakout'] = array('default' => VIEWS_SLIDESHOW_DEFAULT_HOVER_BREAKOUT); - $options['teasers_last'] = array('default' => VIEWS_SLIDESHOW_DEFAULT_TEASERS_LAST); return $options; } - -function views_slideshow_views_slideshow_options_form(&$form, &$form_state, &$view) { - $options = array( - VIEWS_SLIDESHOW_HOVER_BREAKOUT_TEASER => t('Teaser'), - VIEWS_SLIDESHOW_HOVER_BREAKOUT_FULL => t('Full'), - ); - $form['hover_breakout'] = array( - '#type' => 'radios', - '#title' => t('Hover breakout'), - '#options' => $options, - '#default_value' => $view->options['hover_breakout'], - '#description' => t("Hover breakout determines how to display the breakout element of the %thumbnail mode, either as a teaser or full node. It is ignored in %single mode.", array('%thumbnail' => t('Thumbnail hover'), '%single' => t('Single frame'))), - ); - $form['teasers_last'] = array( - '#type' => 'checkbox', - '#title' => t('Display teasers last'), - '#default_value' => $view->options['teasers_last'], - '#description' => t('When the mode is thumbnail hover, this determines whether to print the teasers first or second.'), - ); - $options = array('hover' => t('Hover')); - if (module_exists('hoverintent')) { - $options['hoverIntent'] = t('HoverIntent'); - } - $form['hover'] = array( - '#type' => 'radios', - '#title' => t('Mouse hover'), - '#options' => $options, - '#default_value' => $view->options['hover'], - '#description' => t('The !hoverintent, if installed, adds the %hoverintent option here. Selecting it causes a delay when the mouse hovers, to stop quick flybys from triggering the behavior. Selecting %hoverdefault chooses the default mouse behavior.', array('!hoverintent' => l(t('HoverIntent module'), 'http://drupal.org/project/hoverintent'), '%hoverintent' => t('HoverIntent'), '%hoverdefault' => t('Hover'))), - ); - $form['timer_delay'] = array( - '#type' => 'textfield', - '#title' => t('Timer delay (in milliseconds)'), - '#default_value' => $view->options['timer_delay'], - ); - $options = array( - VIEWS_SLIDESHOW_SORT_FORWARD => t('Forward'), - VIEWS_SLIDESHOW_SORT_REVERSE => t('Reverse'), - VIEWS_SLIDESHOW_SORT_RANDOM => t('Random'), - ); - $form['sort'] = array( - '#type' => 'radios', - '#title' => t('Slideshow sort order'), - '#description' => t('This option determines the sort order of the returned results within the slideshow. Note that it is not related to the View\'s sorting options, and will only affect resulting items.'), - '#options' => $options, - '#default_value' => $view->options['sort'], - ); - $form['fade'] = array( - '#type' => 'checkbox', - '#title' => t('Fade'), - '#default_value' => $view->options['fade'], - '#description' => t('If checked, then the slideshow will fade between frames. Otherwise, the Fade speed and value, below, will be ignored.'), - ); - $options = array( - VIEWS_SLIDESHOW_FADE_SPEED_SLOW => t('Slow'), - VIEWS_SLIDESHOW_FADE_SPEED_NORMAL => t('Normal'), - VIEWS_SLIDESHOW_FADE_SPEED_FAST => t('Fast'), - ); - $form['fade_speed'] = array( - '#type' => 'radios', - '#title' => t('Fade speed'), - '#options' => $options, - '#default_value' => $view->options['fade_speed'], - ); - $form['fade_value'] = array( - '#type' => 'textfield', - '#title' => t('Fade value'), - '#description' => t('The opacity to fade to, between 0 (fully transparent) and 1 (fully opaque).'), - '#default_value' => $view->options['fade_value'], - ); - $options = array( - VIEWS_SLIDESHOW_HOVER_BREAKOUT_TEASER => t('Teaser'), - VIEWS_SLIDESHOW_HOVER_BREAKOUT_FULL => t('Full'), - ); -} Index: views_slideshow_plugin_style_slideshow.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/views_slideshow/Attic/views_slideshow_plugin_style_slideshow.inc,v retrieving revision 1.1.2.1 diff -u -p -r1.1.2.1 views_slideshow_plugin_style_slideshow.inc --- views_slideshow_plugin_style_slideshow.inc 30 Mar 2009 20:46:42 -0000 1.1.2.1 +++ views_slideshow_plugin_style_slideshow.inc 28 May 2009 00:23:57 -0000 @@ -43,4 +43,11 @@ class views_slideshow_plugin_style_slide call_user_func_array($function, array(&$form, &$form_state, &$this)); } } + function options_validate(&$form, &$form_state) { + module_load_all_includes('views_slideshow.inc'); + foreach (module_implements('views_slideshow_options_form_validate') as $module) { + $function = $module .'_views_slideshow_options_form_validate'; + call_user_func_array($function, array(&$form, &$form_state, &$this)); + } + } } Index: contrib/views_slideshow_singleframe/views-slideshow-singleframe.tpl.php =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/views_slideshow/contrib/views_slideshow_singleframe/Attic/views-slideshow-singleframe.tpl.php,v retrieving revision 1.1.2.1 diff -u -p -r1.1.2.1 views-slideshow-singleframe.tpl.php --- contrib/views_slideshow_singleframe/views-slideshow-singleframe.tpl.php 16 Apr 2009 02:04:52 -0000 1.1.2.1 +++ contrib/views_slideshow_singleframe/views-slideshow-singleframe.tpl.php 28 May 2009 00:23:57 -0000 @@ -8,6 +8,11 @@ // these are hidden elements, used to cycle through the main div $hidden_elements = theme('views_slideshow_no_display_section', $view, $rows, $id, $options['mode'], $teaser); + if ($options['singleframe']['controls'] == 1) { + theme('views_slideshow_singleframe_controls',$id,$view,$options); + } print theme('views_slideshow_main_section', $id, $hidden_elements); - + if ($options['singleframe']['controls'] == 2) { + theme('views_slideshow_singleframe_controls',$id,$view,$options); + } ?> Index: contrib/views_slideshow_singleframe/views_slideshow.js =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/views_slideshow/contrib/views_slideshow_singleframe/Attic/views_slideshow.js,v retrieving revision 1.1.2.1 diff -u -p -r1.1.2.1 views_slideshow.js --- contrib/views_slideshow_singleframe/views_slideshow.js 16 Apr 2009 02:04:52 -0000 1.1.2.1 +++ contrib/views_slideshow_singleframe/views_slideshow.js 28 May 2009 00:23:57 -0000 @@ -11,123 +11,33 @@ Drupal.behaviors.viewsSlideshowSingleFrame = function (context) { $('.views_slideshow_main:not(.viewsSlideshowSingleFrame-processed)', context).addClass('viewsSlideshowSingleFrame-processed').each(function() { var fullId = '#' + $(this).attr('id'); - - // Make sure we're working from - Drupal.settings.viewsSlideshowSingleFrame[fullId]._current_div = Drupal.settings.viewsSlideshowSingleFrame[fullId]._current_div ? Drupal.settings.viewsSlideshowSingleFrame[fullId]._current_div : 0; - var settings = Drupal.settings.viewsSlideshowSingleFrame[fullId]; + settings.targetId = '#'+$(fullId+" :first").attr('id'); - // If we only have a single div, then we have nothing to do. - // Thus, only turn on our slideshow if we have more than one slide. - if (settings.num_divs > 1) { - // This turns on the timer. - views_slideshow_timer(fullId, true); - - // This sets up the mouseover & mouseout to pause on the main element. - $(fullId).hover( - function() { - views_slideshow_pause(fullId); - }, - function() { - views_slideshow_resume(fullId); - } - ); + $(settings.targetId).cycle({ + fx:settings.effect, + speed:settings.speed, + timeout:settings.timeout, + sync:settings.sync, + random:settings.random, + pause:settings.pause, + prev:(settings.controls > 0)?'#views_slideshow_prev_'+settings.id:null, + next:(settings.controls > 0)?'#views_slideshow_next_'+settings.id:null, + }); + + if (settings.controls > 0) { + $('#views_slideshow_playpause_' + settings.id).click(function() { + if (settings.paused) { + $(settings.targetId).cycle('resume'); + $('#views_slideshow_playpause_'+settings.id).text('Pause'); + settings.paused = false; + } + else { + $(settings.targetId).cycle('pause'); + $('#views_slideshow_playpause_'+settings.id).text('Resume'); + settings.paused = true; + } + }); } }); -} - -/** - * Set the timer on or off. - */ -function views_slideshow_timer(slideshow_main, slideshow_status) { - // Stop the current timer. - clearTimeout(Drupal.settings.viewsSlideshowSingleFrame[slideshow_main]._timer_id); - - // Start a new timer, if slideshow_status is true, unless we're currently paused. - if (slideshow_status && !Drupal.settings.viewsSlideshowSingleFrame[slideshow_main]._pause) { // !slideshow_data[slideshow_main]._pause) { - // Our timer will call views_slideshow_switch, which fades out the current slide. - Drupal.settings.viewsSlideshowSingleFrame[slideshow_main]._timer_id = setTimeout("views_slideshow_switch('" + slideshow_main + "', views_slideshow_next_div('" + slideshow_main + "'))", Drupal.settings.viewsSlideshowSingleFrame[slideshow_main].timer_delay); - } -} - -function views_slideshow_pause(slideshow_main) { - Drupal.settings.viewsSlideshowSingleFrame[slideshow_main]._pause = true; - views_slideshow_timer(slideshow_main, false); -} - -function views_slideshow_resume(slideshow_main) { - Drupal.settings.viewsSlideshowSingleFrame[slideshow_main]._pause = false; - views_slideshow_timer(slideshow_main, true); -} - -/** - * Fade out to the new div indicated. - */ -function views_slideshow_switch(slideshow_main, new_div) { - // Turn off our timer. - views_slideshow_timer(slideshow_main, false); - - // Check to see if we fade or not. - if (Drupal.settings.viewsSlideshowSingleFrame[slideshow_main].fade) { - // Fade out -- at the end, switch to the next slide in the slideshow. - $(slideshow_main).fadeTo(Drupal.settings.viewsSlideshowSingleFrame[slideshow_main].fade_speed, Drupal.settings.viewsSlideshowSingleFrame[slideshow_main].fade_value, function() { views_slideshow_set_div(slideshow_main, new_div); }); - } - else { - // If we don't have a fade, then just switch without fading. - views_slideshow_set_div(slideshow_main, new_div); - } -} - -/** - * Set the main div html to the new node. - * We come here at the bottom of the fade. - */ -function views_slideshow_set_div(slideshow_main, new_div_number) { - // If the new div is greater than length, wrap to the first. - // If it's less than zero, wrap to the last. - if (new_div_number >= Drupal.settings.viewsSlideshowSingleFrame[slideshow_main].num_divs) { - new_div_number = 0; - } - else if (new_div_number < 0) { - new_div_number = Drupal.settings.viewsSlideshowSingleFrame[slideshow_main].num_divs - 1; - } - - // Grab the ID's for the two slides. - _old_breakout = Drupal.settings.viewsSlideshowSingleFrame[slideshow_main].div_prefix + Drupal.settings.viewsSlideshowSingleFrame[slideshow_main].id + "_" + Drupal.settings.viewsSlideshowSingleFrame[slideshow_main]._current_div; - _new_breakout = Drupal.settings.viewsSlideshowSingleFrame[slideshow_main].div_prefix + Drupal.settings.viewsSlideshowSingleFrame[slideshow_main].id + "_" + new_div_number; - - // Hide our old slide and display the new one. - $(_old_breakout).hide(); - $(_new_breakout).show(); - - // Set the current_div number to the new node. - Drupal.settings.viewsSlideshowSingleFrame[slideshow_main]._current_div = new_div_number; - - // Check to see if we faded here or not. - if (Drupal.settings.viewsSlideshowSingleFrame[slideshow_main].fade) { - // Fade in -- at the end, turn on our timer. - $(slideshow_main).fadeTo(Drupal.settings.viewsSlideshowSingleFrame[slideshow_main].fade_speed, 1, function() { views_slideshow_timer(slideshow_main, true); }); - } - else { - // If we don't have a fade, then just turn on our timer without fading. - views_slideshow_timer(slideshow_main, true); - } -} - -/** - * Get the next node div in our sequence. - */ -function views_slideshow_next_div(slideshow_main) { - if (Drupal.settings.viewsSlideshowSingleFrame[slideshow_main].sort) { - // Select the next div, in forward or reverse order. - new_div_number = Drupal.settings.viewsSlideshowSingleFrame[slideshow_main]._current_div + Drupal.settings.viewsSlideshowSingleFrame[slideshow_main].sort; - } - else { - // Select a random div, but make sure we don't repeat ourselves, unless there's only one div. - do { - new_div_number = Math.floor(Math.random() * Drupal.settings.viewsSlideshowSingleFrame[slideshow_main].num_divs); - } while (Drupal.settings.viewsSlideshowSingleFrame[slideshow_main].num_divs > 1 && (new_div_number == Drupal.settings.viewsSlideshowSingleFrame[slideshow_main].num_divs - 1)); - } - return new_div_number; -} - +} \ No newline at end of file Index: contrib/views_slideshow_singleframe/views_slideshow_singleframe.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/views_slideshow/contrib/views_slideshow_singleframe/Attic/views_slideshow_singleframe.module,v retrieving revision 1.1.2.1 diff -u -p -r1.1.2.1 views_slideshow_singleframe.module --- contrib/views_slideshow_singleframe/views_slideshow_singleframe.module 16 Apr 2009 02:04:52 -0000 1.1.2.1 +++ contrib/views_slideshow_singleframe/views_slideshow_singleframe.module 28 May 2009 00:23:57 -0000 @@ -16,6 +16,10 @@ function views_slideshow_singleframe_the 'template' => 'views-slideshow-singleframe', 'file' => 'views_slideshow_singleframe.theme.inc', ), + 'views_slideshow_singleframe_controls' =>array( + 'arguments' => array('id' => '', 'view' => NULL, 'options' => array()), + 'file' => 'views_slideshow_singleframe.theme.inc', + ), ); } Index: contrib/views_slideshow_singleframe/views_slideshow_singleframe.theme.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/views_slideshow/contrib/views_slideshow_singleframe/Attic/views_slideshow_singleframe.theme.inc,v retrieving revision 1.1.2.1 diff -u -p -r1.1.2.1 views_slideshow_singleframe.theme.inc --- contrib/views_slideshow_singleframe/views_slideshow_singleframe.theme.inc 16 Apr 2009 02:04:52 -0000 1.1.2.1 +++ contrib/views_slideshow_singleframe/views_slideshow_singleframe.theme.inc 28 May 2009 00:23:57 -0000 @@ -15,34 +15,26 @@ function template_preprocess_views_slide drupal_add_js($base . '/views_slideshow.js', 'module'); drupal_add_css($base . '/views_slideshow.css', 'module'); - $hover = 'hover'; - if ($options['hover'] == 'hoverIntent') { - if (module_exists('jq')) { - $hover = jq_add('hoverIntent') ? 'hoverIntent' : 'hover'; - } - else if (module_exists('hoverintent')) { - $hover = hoverintent_add() ? 'hoverIntent' : 'hover'; - } - } - $num_divs = sizeof($vars['rows']); - $fade = $options['fade'] ? 'true' : 'false'; - $settings = array( + $settings = array_merge(array( 'num_divs' => $num_divs, - 'timer_delay' => $options['timer_delay'], - 'sort' => intval($options['sort']), - 'fade' => $fade, - 'fade_speed' => $options['fade_speed'], - 'fade_value' => $options['fade_value'], 'hoverFunction' => $hover, 'id_prefix' => '#views_slideshow_main_', 'div_prefix' => '#views_slideshow_div_', 'id' => $vars['id'], - ); + ), $options['singleframe']); drupal_add_js(array('viewsSlideshowSingleFrame' => array('#views_slideshow_main_'. $vars['id'] => $settings)), 'setting'); -/* $js = theme('views_slideshow_div_js', $vars['rows'], $vars['options'], $vars['id']); - drupal_add_js($js, 'inline');*/ +} + +function theme_views_slideshow_singleframe_controls($id,$view,$options) { +?> +
+ + + +
+ (module_exists('hoverintent') ? 'hoverIntent' : 'hover')); - $options['singleframe']['timer_delay'] = array('default' => 5000); - $options['singleframe']['sort'] = array('default' => 1); - $options['singleframe']['fade'] = array('default' => TRUE); - $options['singleframe']['fade_speed'] = array('default' => 'slow'); - $options['singleframe']['fade_value'] = array('default' => 0.25); + $options['singleframe'] =array( + 'contains' => array( + 'timeout' => array('default' => 5000), + 'sort' => array('default' => 1), + 'effect' => array('default' => 'fade'), + 'speed' => array('default' => 700) //normal + ) + ); return $options; } function views_slideshow_singleframe_views_slideshow_options_form(&$form, &$form_state, &$view) { - dpm($view->options); + //dpm($view->options); $form['singleframe'] = array( '#type' => 'fieldset', @@ -33,55 +34,89 @@ function views_slideshow_singleframe_vie '#collapsible' => TRUE, '#collapsed' => !($view->options['mode'] == 'singleframe'), ); - $options = array('hover' => t('Hover')); - if (module_exists('hoverintent')) { - $options['hoverIntent'] = t('HoverIntent'); - } - $form['singleframe']['hover'] = array( - '#type' => 'radios', - '#title' => t('Mouse hover'), - '#options' => $options, - '#default_value' => $view->options['singleframe']['hover'], - '#description' => t('The !hoverintent, if installed, adds the %hoverintent option here. Selecting it causes a delay when the mouse hovers, to stop quick flybys from triggering the behavior. Selecting %hoverdefault chooses the default mouse behavior.', array('!hoverintent' => l(t('HoverIntent module'), 'http://drupal.org/project/hoverintent'), '%hoverintent' => t('HoverIntent'), '%hoverdefault' => t('Hover'))), - ); - $form['singleframe']['timer_delay'] = array( + $form['singleframe']['timeout'] = array( '#type' => 'textfield', - '#title' => t('Timer delay (in milliseconds)'), - '#default_value' => $view->options['singleframe']['timer_delay'], + '#title' => t('Timer delay'), + '#default_value' => (isset($view->options['singleframe']['timeout'])) ? $view->options['singleframe']['timeout'] : 1000, + '#description' => t('Amount of time in milliseconds between transitions.') ); - $options = array( - 1 => t('Forward'), - -1 => t('Reverse'), - 0 => t('Random'), + $form['singleframe']['speed'] = array( + '#type' => 'textfield', + '#title' => t('Speed'), + '#default_value' => (isset($view->options['singleframe']['speed'])) ? $view->options['singleframe']['speed'] : 700, + '#description' => t('Time in milliseconds that each transition lasts. Numeric only!'), ); - $form['singleframe']['sort'] = array( + $form['singleframe']['random'] = array( '#type' => 'radios', - '#title' => t('Slideshow sort order'), - '#description' => t('This option determines the sort order of the returned results within the slideshow. Note that it is not related to the View\'s sorting options, and will only affect resulting items.'), - '#options' => $options, - '#default_value' => $view->options['singleframe']['sort'], + '#title' => t('Random'), + '#description' => t('This option controls the order items are displayed. The default setting, False, uses the views ordering. True will cause the images to display in a random order.'), + '#options' => array(0 => t('False'), 1 => t('True')), + '#default_value' => isset($view->options['singleframe']['random'])? $view->options['singleframe']['random'] : 0, ); - $form['singleframe']['fade'] = array( - '#type' => 'checkbox', - '#title' => t('Fade'), - '#default_value' => $view->options['singleframe']['fade'], - '#description' => t('If checked, then the slideshow will fade between frames. Otherwise, the Fade speed and value, below, will be ignored.'), + $form['singleframe']['pause'] = array( + '#type' => 'radios', + '#title' => t('Pause'), + '#options' => array(1 => t('Yes'),2 => t('No')), + '#default_value' => (isset($view->options['singleframe']['pause'])) ? $view->options['singleframe']['pause'] : 1, + '#description' => t('Pause when hovering on the slideshow image.'), + ); + $form['singleframe']['controls'] = array( + '#type' => 'select', + '#title' => t('Controls'), + '#options' => array(0 => t('None'),1 => t('Top'),2 => t('Bottom')), + '#default_value' => (isset($view->options['singleframe']['controls'])) ? $view->options['singleframe'] : 0, + '#description' => t('Determine if controls for the slideshow (start/stop/next/previous) should appear, and if so whether they should appear before or after the slideshow.'), ); $options = array( - 'slow' => t('Slow'), - 'normal' => t('Normal'), - 'fast' => t('Fast'), - ); - $form['singleframe']['fade_speed'] = array( - '#type' => 'radios', - '#title' => t('Fade speed'), + 'none' => 'none', + 'blindX' => 'blindX', + 'blindY' => 'blindY', + 'blindZ' => 'blindZ', + 'cover' => 'cover', + 'curtainX' => 'curtainX', + 'curtainY' => 'curtainY', + 'fade' => 'fade', + 'fadeZoom' => 'fadeZoom', + 'growX' => 'growX', + 'growY' => 'growY', + 'scrollUp' => 'scrollUp', + 'scrollDown' => 'scrollDown', + 'scrollLeft' => 'scrollLeft', + 'scrollRight' => 'scrollRight', + 'scrollHorz' => 'scrollHorz', + 'scrollVert' => 'scrollVert', + 'shuffle' => 'shuffle', + 'slideX' => 'slideX', + 'slideY' => 'slideY', + 'toss' => 'toss', + 'turnUp' => 'turnUp', + 'turnDown' => 'turnDown', + 'turnLeft' => 'turnLeft', + 'turnRight' => 'turnRight', + 'uncover' => 'uncover', + 'wipe' => 'wipe', + 'zoom' => 'zoom' + ); + $form['singleframe']['effect'] = array( + '#type' => 'select', + '#title' => t('Effect'), '#options' => $options, - '#default_value' => $view->options['singleframe']['fade_speed'], + '#default_value' => (isset($view->options['singleframe']['effect'])) ? $view->options['singleframe']['effect'] : 'fade', + '#description' => t('The transition effect that will be used to change between images. Not all options below may be relevant depending on the effect.'), ); - $form['singleframe']['fade_value'] = array( - '#type' => 'textfield', - '#title' => t('Fade value'), - '#description' => t('The opacity to fade to, between 0 (fully transparent) and 1 (fully opaque).'), - '#default_value' => $view->options['singleframe']['fade_value'], + $form['singleframe']['sync'] = array( + '#type' => 'radios', + '#title' => t('Sync'), + '#options' => array(1 => t('Yes'), 2 => t('No')), + '#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.'), ); } +function views_slideshow_singleframe_views_slideshow_options_form_validate(&$form, &$form_state, &$view) { + if (!is_numeric($form_state['values']['style_options']['singleframe']['speed'])) { + form_error($form['singleframe']['speed'], t('!setting must be numeric!',array('Speed'))); + } + if (!is_numeric($form_state['values']['style_options']['singleframe']['timeout'])) { + form_error($form['singleframe']['speed'], t('!setting must be numeric!',array('timeout'))); + } +} \ No newline at end of file Index: contrib/views_slideshow_thumbnailhover/views-slideshow-thumbnailhover.tpl.php =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/views_slideshow/contrib/views_slideshow_thumbnailhover/Attic/views-slideshow-thumbnailhover.tpl.php,v retrieving revision 1.1.2.1 diff -u -p -r1.1.2.1 views-slideshow-thumbnailhover.tpl.php --- contrib/views_slideshow_thumbnailhover/views-slideshow-thumbnailhover.tpl.php 20 Apr 2009 22:51:08 -0000 1.1.2.1 +++ contrib/views_slideshow_thumbnailhover/views-slideshow-thumbnailhover.tpl.php 28 May 2009 00:23:57 -0000 @@ -7,19 +7,21 @@ */ $base = drupal_get_path('module', 'views_slideshow_thumbnailhover'); - drupal_add_js($base . '/js/views_slideshow.js', 'module'); - drupal_add_css($base . '/css/views_slideshow.css', 'module'); $js = theme('views_slideshow_div_js', $rows, $options, $id); drupal_add_js($js, 'inline'); - $teaser = ($options['hover_breakout'] == 'teaser' ? TRUE : FALSE); + if ($options['thumbnailhover']['controls'] == 1) { + theme('views_slideshow_thumbnailhover_controls',$id,$view,$options); + } + + $teaser = ($options['thumbnailhover']['hover_breakout'] == 'teaser' ? TRUE : FALSE); $output = ''; $view_teasers = FALSE; // As we're using the 'thumbnail hover' mode, then we need to display all the view thumbnails. $view_teasers = theme('views_slideshow_breakout_teasers', $rows, $id); - if (!$options['teasers_last']) { + if (!$options['thumbnailhover']['teasers_last']) { $output .= $view_teasers; } @@ -27,10 +29,12 @@ $hidden_elements = theme('views_slideshow_no_display_section', $view, $rows, $id, $options['mode'], $teaser); $output .= theme('views_slideshow_main_section', $id, $hidden_elements); - if ($view_teasers && $options['teasers_last']) { + if ($view_teasers && $options['thumbnailhover']['teasers_last']) { $output .= $view_teasers; } - + if ($options['thumbnailhover']['controls'] == 2) { + theme('views_slideshow_thumbnailhover_controls',$id,$view,$options); + } print $output; ?> Index: contrib/views_slideshow_thumbnailhover/views_slideshow.js =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/views_slideshow/contrib/views_slideshow_thumbnailhover/Attic/views_slideshow.js,v retrieving revision 1.1.2.1 diff -u -p -r1.1.2.1 views_slideshow.js --- contrib/views_slideshow_thumbnailhover/views_slideshow.js 20 Apr 2009 22:51:08 -0000 1.1.2.1 +++ contrib/views_slideshow_thumbnailhover/views_slideshow.js 28 May 2009 00:23:57 -0000 @@ -8,126 +8,42 @@ /** * This will set our initial behavior, by starting up each individual slideshow. */ -Drupal.behaviors.viewsSlideshowSingleFrame = function (context) { - $('.views_slideshow_main:not(.viewsSlideshowSingleFrame-processed)', context).addClass('viewsSlideshowSingleFrame-processed').each(function() { +Drupal.behaviors.viewsSlideshowThumbnailHover = function (context) { + $('.views_slideshow_main:not(.viewsSlideshowThumbnailHover-processed)', context).addClass('viewsSlideshowThumbnailHover-processed').each(function() { var fullId = '#' + $(this).attr('id'); + var settings = Drupal.settings.viewsSlideshowThumbnailHover[fullId]; + settings.targetId = '#'+$(fullId+" :first").attr('id'); - // Make sure we're working from - Drupal.settings.viewsSlideshowSingleFrame[fullId]._current_div = Drupal.settings.viewsSlideshowSingleFrame[fullId]._current_div ? Drupal.settings.viewsSlideshowSingleFrame[fullId]._current_div : 0; - - var settings = Drupal.settings.viewsSlideshowSingleFrame[fullId]; - - // If we only have a single div, then we have nothing to do. - // Thus, only turn on our slideshow if we have more than one slide. - if (settings.num_divs > 1) { - // This turns on the timer. - views_slideshow_timer(fullId, true); - - // This sets up the mouseover & mouseout to pause on the main element. - $(fullId).hover( - function() { - views_slideshow_pause(fullId); - }, - function() { - views_slideshow_resume(fullId); - } - ); + $(settings.targetId).cycle({ + fx:settings.effect, + speed:settings.speed, + timeout:settings.timeout, + sync:settings.sync, + random:settings.random, + pause:settings.pause, + pager:'#views_slideshow_breakout_teasers_' + settings.id, + pagerAnchorBuilder:function(idx, slide) { + return '#views_slideshow_div_breakout_teaser_' + settings.id + '_' + idx; + }, + pagerEvent: 'mouseover', + prev:(settings.controls > 0)?'#views_slideshow_prev_'+settings.id:null, + next:(settings.controls > 0)?'#views_slideshow_next_'+settings.id:null, + }); + + + if (settings.controls > 0) { + $('#views_slideshow_playpause_' + settings.id).click(function() { + if (settings.paused) { + $(settings.targetId).cycle('resume'); + $('#views_slideshow_playpause_'+settings.id).text('Pause'); + settings.paused = false; + } + else { + $(settings.targetId).cycle('pause'); + $('#views_slideshow_playpause_'+settings.id).text('Resume'); + settings.paused = true; + } + }); } }); -} - -/** - * Set the timer on or off. - */ -function views_slideshow_timer(slideshow_main, slideshow_status) { - // Stop the current timer. - clearTimeout(Drupal.settings.viewsSlideshowSingleFrame[slideshow_main]._timer_id); - - // Start a new timer, if slideshow_status is true, unless we're currently paused. - if (slideshow_status && !Drupal.settings.viewsSlideshowSingleFrame[slideshow_main]._pause) { // !slideshow_data[slideshow_main]._pause) { - // Our timer will call views_slideshow_switch, which fades out the current slide. - Drupal.settings.viewsSlideshowSingleFrame[slideshow_main]._timer_id = setTimeout("views_slideshow_switch('" + slideshow_main + "', views_slideshow_next_div('" + slideshow_main + "'))", Drupal.settings.viewsSlideshowSingleFrame[slideshow_main].timer_delay); - } -} - -function views_slideshow_pause(slideshow_main) { - Drupal.settings.viewsSlideshowSingleFrame[slideshow_main]._pause = true; - views_slideshow_timer(slideshow_main, false); -} - -function views_slideshow_resume(slideshow_main) { - Drupal.settings.viewsSlideshowSingleFrame[slideshow_main]._pause = false; - views_slideshow_timer(slideshow_main, true); -} - -/** - * Fade out to the new div indicated. - */ -function views_slideshow_switch(slideshow_main, new_div) { - // Turn off our timer. - views_slideshow_timer(slideshow_main, false); - - // Check to see if we fade or not. - if (Drupal.settings.viewsSlideshowSingleFrame[slideshow_main].fade) { - // Fade out -- at the end, switch to the next slide in the slideshow. - $(slideshow_main).fadeTo(Drupal.settings.viewsSlideshowSingleFrame[slideshow_main].fade_speed, Drupal.settings.viewsSlideshowSingleFrame[slideshow_main].fade_value, function() { views_slideshow_set_div(slideshow_main, new_div); }); - } - else { - // If we don't have a fade, then just switch without fading. - views_slideshow_set_div(slideshow_main, new_div); - } -} - -/** - * Set the main div html to the new node. - * We come here at the bottom of the fade. - */ -function views_slideshow_set_div(slideshow_main, new_div_number) { - // If the new div is greater than length, wrap to the first. - // If it's less than zero, wrap to the last. - if (new_div_number >= Drupal.settings.viewsSlideshowSingleFrame[slideshow_main].num_divs) { - new_div_number = 0; - } - else if (new_div_number < 0) { - new_div_number = Drupal.settings.viewsSlideshowSingleFrame[slideshow_main].num_divs - 1; - } - - // Grab the ID's for the two slides. - _old_breakout = Drupal.settings.viewsSlideshowSingleFrame[slideshow_main].div_prefix + Drupal.settings.viewsSlideshowSingleFrame[slideshow_main].id + "_" + Drupal.settings.viewsSlideshowSingleFrame[slideshow_main]._current_div; - _new_breakout = Drupal.settings.viewsSlideshowSingleFrame[slideshow_main].div_prefix + Drupal.settings.viewsSlideshowSingleFrame[slideshow_main].id + "_" + new_div_number; - - // Hide our old slide and display the new one. - $(_old_breakout).hide(); - $(_new_breakout).show(); - - // Set the current_div number to the new node. - Drupal.settings.viewsSlideshowSingleFrame[slideshow_main]._current_div = new_div_number; - - // Check to see if we faded here or not. - if (Drupal.settings.viewsSlideshowSingleFrame[slideshow_main].fade) { - // Fade in -- at the end, turn on our timer. - $(slideshow_main).fadeTo(Drupal.settings.viewsSlideshowSingleFrame[slideshow_main].fade_speed, 1, function() { views_slideshow_timer(slideshow_main, true); }); - } - else { - // If we don't have a fade, then just turn on our timer without fading. - views_slideshow_timer(slideshow_main, true); - } -} - -/** - * Get the next node div in our sequence. - */ -function views_slideshow_next_div(slideshow_main) { - if (Drupal.settings.viewsSlideshowSingleFrame[slideshow_main].sort) { - // Select the next div, in forward or reverse order. - new_div_number = Drupal.settings.viewsSlideshowSingleFrame[slideshow_main]._current_div + Drupal.settings.viewsSlideshowSingleFrame[slideshow_main].sort; - } - else { - // Select a random div, but make sure we don't repeat ourselves, unless there's only one div. - do { - new_div_number = Math.floor(Math.random() * Drupal.settings.viewsSlideshowSingleFrame[slideshow_main].num_divs); - } while (Drupal.settings.viewsSlideshowSingleFrame[slideshow_main].num_divs > 1 && (new_div_number == Drupal.settings.viewsSlideshowSingleFrame[slideshow_main].num_divs - 1)); - } - return new_div_number; -} - +} \ No newline at end of file Index: contrib/views_slideshow_thumbnailhover/views_slideshow_thumbnailhover.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/views_slideshow/contrib/views_slideshow_thumbnailhover/Attic/views_slideshow_thumbnailhover.module,v retrieving revision 1.1.2.1 diff -u -p -r1.1.2.1 views_slideshow_thumbnailhover.module --- contrib/views_slideshow_thumbnailhover/views_slideshow_thumbnailhover.module 20 Apr 2009 22:51:08 -0000 1.1.2.1 +++ contrib/views_slideshow_thumbnailhover/views_slideshow_thumbnailhover.module 28 May 2009 00:23:57 -0000 @@ -21,6 +21,10 @@ function views_slideshow_thumbnailhover_ 'template' => 'views-slideshow-thumbnailhover', 'file' => 'views_slideshow_thumbnailhover.theme.inc', ), + 'views_slideshow_thumbnailhover_controls' =>array( + 'arguments' => array('id' => '', 'view' => NULL, 'options' => array()), + 'file' => 'views_slideshow_thumbnailhover.theme.inc', + ), ); } Index: contrib/views_slideshow_thumbnailhover/views_slideshow_thumbnailhover.theme.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/views_slideshow/contrib/views_slideshow_thumbnailhover/Attic/views_slideshow_thumbnailhover.theme.inc,v retrieving revision 1.1.2.1 diff -u -p -r1.1.2.1 views_slideshow_thumbnailhover.theme.inc --- contrib/views_slideshow_thumbnailhover/views_slideshow_thumbnailhover.theme.inc 20 Apr 2009 22:51:08 -0000 1.1.2.1 +++ contrib/views_slideshow_thumbnailhover/views_slideshow_thumbnailhover.theme.inc 28 May 2009 00:23:57 -0000 @@ -16,7 +16,7 @@ function template_preprocess_views_slide drupal_add_css($base . '/views_slideshow.css', 'module'); $hover = 'hover'; - if ($options['hover'] == 'hoverIntent') { + if ($options['thumbnailhover']['hover'] == 'hoverIntent') { if (module_exists('jq')) { $hover = jq_add('hoverIntent') ? 'hoverIntent' : 'hover'; } @@ -26,26 +26,27 @@ function template_preprocess_views_slide } $num_divs = sizeof($vars['rows']); - $fade = $options['fade'] ? 'true' : 'false'; - $teasers_last = $options['teasers_last'] ? 'true' : 'false'; + $teasers_last = $options['thumbnailhover']['teasers_last'] ? 'true' : 'false'; - $settings = array( + $settings = array_merge(array( 'num_divs' => $num_divs, - 'timer_delay' => $options['timer_delay'], - 'sort' => intval($options['sort']), - 'fade' => $fade, - 'fade_speed' => $options['fade_speed'], - 'fade_value' => $options['fade_value'], 'hoverFunction' => $hover, - 'hover_breakout' => $options['hover_breakout'], 'teasers_last' => $teasers_last, 'id_prefix' => '#views_slideshow_main_', 'div_prefix' => '#views_slideshow_div_', 'id' => $vars['id'], - ); + ), $options['thumbnailhover']); - drupal_add_js(array('viewsSlideshowSingleFrame' => array('#views_slideshow_main_'. $vars['id'] => $settings)), 'setting'); + drupal_add_js(array('viewsSlideshowThumbnailHover' => array('#views_slideshow_main_'. $vars['id'] => $settings)), 'setting'); -/* $js = theme('views_slideshow_div_js', $vars['rows'], $vars['options'], $vars['id']); - drupal_add_js($js, 'inline');*/ +} + +function theme_views_slideshow_thumbnailhover_controls($id,$view,$options) { +?> +
+ + + +
+ t('SingleFrame'), + 'thumbnailhover' => t('ThumbnailHover'), ); return $options; } function views_slideshow_thumbnailhover_views_slideshow_option_definition() { - $options['thumbnailhover'] = array(); - $options['thumbnailhover']['hover'] = array('default' => (module_exists('hoverintent') ? 'hoverIntent' : 'hover')); - $options['thumbnailhover']['timer_delay'] = array('default' => 5000); - $options['thumbnailhover']['sort'] = array('default' => 1); - $options['thumbnailhover']['fade'] = array('default' => TRUE); - $options['thumbnailhover']['fade_speed'] = array('default' => 'slow'); - $options['thumbnailhover']['fade_value'] = array('default' => 0.25); - $options['thumbnailhover']['hover_breakout'] = array('default' => 'teaser'); - $options['thumbnailhover']['teasers_last'] = array('default' => TRUE); - + $options['thumbnailhover'] = array( + 'contains' => array ( + 'default' => (module_exists('hoverintent') ? 'hoverIntent' : 'hover'), + 'timeout' => array('default' => 5000), + 'sort' => array('default' => 1), + 'effect' => array('default' => 'fade'), + 'speed' => array('default' => 300), + 'fade_value' => array('default' => 0.25), + 'hover_breakout' => array('default' => 'teaser'), + 'teasers_last' => array('default' => TRUE) + ) + ); return $options; } function views_slideshow_thumbnailhover_views_slideshow_options_form(&$form, &$form_state, &$view) { - dpm($view->options); + //dpm($view->options); $form['thumbnailhover'] = array( '#type' => 'fieldset', - '#title' => t('SingleFrame rotator options'), + '#title' => t('ThumbnailHover rotator options'), '#collapsible' => TRUE, '#collapsed' => !($view->options['mode'] == 'thumbnailhover'), ); - $options = array('hover' => t('Hover')); + if (module_exists('hoverintent')) { + $options = array('hover' => t('Hover')); $options['hoverIntent'] = t('HoverIntent'); - } - $form['thumbnailhover']['hover'] = array( - '#type' => 'radios', - '#title' => t('Mouse hover'), - '#options' => $options, - '#default_value' => $view->options['thumbnailhover']['hover'], - '#description' => t('The !hoverintent, if installed, adds the %hoverintent option here. Selecting it causes a delay when the mouse hovers, to stop quick flybys from triggering the behavior. Selecting %hoverdefault chooses the default mouse behavior.', array('!hoverintent' => l(t('HoverIntent module'), 'http://drupal.org/project/hoverintent'), '%hoverintent' => t('HoverIntent'), '%hoverdefault' => t('Hover'))), - ); - $form['thumbnailhover']['timer_delay'] = array( - '#type' => 'textfield', - '#title' => t('Timer delay (in milliseconds)'), - '#default_value' => $view->options['thumbnailhover']['timer_delay'], - ); + $form['thumbnailhover']['hover'] = array( + '#type' => 'radios', + '#title' => t('Mouse hover'), + '#options' => $options, + '#default_value' => $view->options['thumbnailhover']['hover'], + '#description' => t('The !hoverintent, if installed, adds the %hoverintent option here. Selecting it causes a delay when the mouse hovers, to stop quick flybys from triggering the behavior. Selecting %hoverdefault chooses the default mouse behavior.', array('!hoverintent' => l(t('HoverIntent module'), 'http://drupal.org/project/hoverintent'), '%hoverintent' => t('HoverIntent'), '%hoverdefault' => t('Hover'))), + ); + } $options = array( - 1 => t('Forward'), - -1 => t('Reverse'), - 0 => t('Random'), + 'teaser' => t('Teaser'), + 'full' => t('Full'), ); - $form['thumbnailhover']['sort'] = array( + $form['thumbnailhover']['hover_breakout'] = array( '#type' => 'radios', - '#title' => t('Slideshow sort order'), - '#description' => t('This option determines the sort order of the returned results within the slideshow. Note that it is not related to the View\'s sorting options, and will only affect resulting items.'), + '#title' => t('Hover breakout'), '#options' => $options, - '#default_value' => $view->options['thumbnailhover']['sort'], + '#default_value' => $view->options['thumbnailhover']['hover_breakout'], + '#description' => t("Hover breakout determines how to display the breakout element of the %thumbnail mode, either as a teaser or full node. It is ignored in %single mode.", array('%thumbnail' => t('Thumbnail hover'), '%single' => t('Single frame'))), ); - $form['thumbnailhover']['fade'] = array( + $form['thumbnailhover']['teasers_last'] = array( '#type' => 'checkbox', - '#title' => t('Fade'), - '#default_value' => $view->options['thumbnailhover']['fade'], - '#description' => t('If checked, then the slideshow will fade between frames. Otherwise, the Fade speed and value, below, will be ignored.'), - ); - $options = array( - 'slow' => t('Slow'), - 'normal' => t('Normal'), - 'fast' => t('Fast'), + '#title' => t('Display teasers last'), + '#default_value' => $view->options['thumbnailhover']['teasers_last'], + '#description' => t('When the mode is thumbnail hover, this determines whether to print the teasers first or second.'), ); - $form['thumbnailhover']['fade_speed'] = array( - '#type' => 'radios', - '#title' => t('Fade speed'), - '#options' => $options, - '#default_value' => $view->options['thumbnailhover']['fade_speed'], + $form['thumbnailhover']['timeout'] = array( + '#type' => 'textfield', + '#title' => t('Timer delay'), + '#default_value' => $view->options['thumbnailhover']['timeout'], + '#description' => t('Amount of time in milliseconds between transitions.') ); - $form['thumbnailhover']['fade_value'] = array( + $form['thumbnailhover']['speed'] = array( '#type' => 'textfield', - '#title' => t('Fade value'), - '#description' => t('The opacity to fade to, between 0 (fully transparent) and 1 (fully opaque).'), - '#default_value' => $view->options['thumbnailhover']['fade_value'], + '#title' => t('Speed'), + '#default_value' => $view->options['thumbnailhover']['speed'], + '#description' => t('Time in milliseconds that each transition lasts. Numeric only!'), ); - - $options = array( - 'teaser' => t('Teaser'), - 'full' => t('Full'), + $form['thumbnailhover']['random'] = array( + '#type' => 'radios', + '#title' => t('Random'), + '#description' => t('This option controls the order items are displayed. The default setting, False, uses the views ordering. True will cause the images to display in a random order.'), + '#options' => array(0 => t('False'), 1 => t('True')), + '#default_value' => isset($view->options['thumbnailhover']['random'])? $view->options['thumbnailhover']['random'] : 0, ); - $form['hover_breakout'] = array( + $form['thumbnailhover']['pause'] = array( '#type' => 'radios', - '#title' => t('Hover breakout'), + '#title' => t('Pause'), + '#options' => array(1 => t('Yes'),2 => t('No')), + '#default_value' => $view->options['thumbnailhover']['pause'], + '#description' => t('Pause when hovering on the slideshow image.'), + ); + $form['thumbnailhover']['controls'] = array( + '#type' => 'select', + '#title' => t('Controls'), + '#options' => array(0 => t('None'),1 => t('Top'),2 => t('Bottom')), + '#default_value' => (isset($view->options['thumbnailhover']['controls'])) ? $view->options['thumbnailhover'] : 0, + '#description' => t('Determine if controls for the slideshow (start/stop/next/previous) should appear, and if so whether they should appear before or after the slideshow.'), + ); + $options = array( + 'none' => 'none', + 'blindX' => 'blindX', + 'blindY' => 'blindY', + 'blindZ' => 'blindZ', + 'cover' => 'cover', + 'curtainX' => 'curtainX', + 'curtainY' => 'curtainY', + 'fade' => 'fade', + 'fadeZoom' => 'fadeZoom', + 'growX' => 'growX', + 'growY' => 'growY', + 'scrollUp' => 'scrollUp', + 'scrollDown' => 'scrollDown', + 'scrollLeft' => 'scrollLeft', + 'scrollRight' => 'scrollRight', + 'scrollHorz' => 'scrollHorz', + 'scrollVert' => 'scrollVert', + 'shuffle' => 'shuffle', + 'slideX' => 'slideX', + 'slideY' => 'slideY', + 'toss' => 'toss', + 'turnUp' => 'turnUp', + 'turnDown' => 'turnDown', + 'turnLeft' => 'turnLeft', + 'turnRight' => 'turnRight', + 'uncover' => 'uncover', + 'wipe' => 'wipe', + 'zoom' => 'zoom' + ); + $form['thumbnailhover']['effect'] = array( + '#type' => 'select', + '#title' => t('Effect'), '#options' => $options, - '#default_value' => $view->options['hover_breakout'], - '#description' => t("Hover breakout determines how to display the breakout element of the %thumbnail mode, either as a teaser or full node. It is ignored in %single mode.", array('%thumbnail' => t('Thumbnail hover'), '%single' => t('Single frame'))), + '#default_value' => $view->options['thumbnailhover']['effect'], + '#description' => t('The transition effect that will be used to change between images. Not all options below may be relevant depending on the effect.'), ); - $form['teasers_last'] = array( - '#type' => 'checkbox', - '#title' => t('Display teasers last'), - '#default_value' => $view->options['teasers_last'], - '#description' => t('When the mode is thumbnail hover, this determines whether to print the teasers first or second.'), + $form['thumbnailhover']['sync'] = array( + '#type' => 'radios', + '#title' => t('Sync'), + '#options' => array(1 => t('Yes'), 2 => t('No')), + '#default_value' =>$view->options['thumbnailhover']['sync'], + '#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.'), ); } +function views_slideshow_thumbnailhover_views_slideshow_options_form_validate(&$form, &$form_state, &$view) { + if (!is_numeric($form_state['values']['style_options']['thumbnailhover']['speed'])) { + form_error($form['thumbnailhover']['speed'], t('!setting must be numeric!',array('!setting' => 'Speed'))); + } + if (!is_numeric($form_state['values']['style_options']['thumbnailhover']['timeout'])) { + form_error($form['thumbnailhover']['timeout'],t('!setting must be numeric!',array('!setting' => 'Timeout'))); + } +} \ No newline at end of file