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 22 Aug 2009 06:08:07 -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); @@ -44,44 +44,10 @@ define('VIEWS_SLIDESHOW_DEFAULT_TEASERS_ */ function views_slideshow_theme($existing, $type, $theme, $path) { return array( - 'views_slideshow_single_frame' => array( - 'arguments' => array('view' => NULL, 'options' => array(), 'rows' => array(), 'title' => ''), - 'template' => 'views-slideshow-single-frame', - 'file' => 'views_slideshow.theme.inc', - ), - 'views_slideshow_thumbnail_hover' => array( - 'arguments' => array('view' => NULL, 'options' => array(), 'rows' => array(), 'title' => ''), - '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', - ), 'views_slideshow_main_section' => array( 'arguments' => array('id' => NULL, 'hidden_elements' => NULL), 'file' => 'views_slideshow.theme.inc', ), - 'views_slideshow_breakout_teaser' => array( - 'arguments' => array('item' => NULL, 'id' => NULL, 'count' => NULL), - 'file' => 'views_slideshow.theme.inc', - ), - 'views_slideshow_no_display_section' => array( - 'arguments' => array('view' => NULL, 'rows' => NULL, 'id' => NULL, 'mode' => NULL, 'teaser' => TRUE), - 'file' => 'views_slideshow.theme.inc', - ), - 'views_slideshow_no_display_teaser' => array( - 'arguments' => array('item' => NULL, 'id' => NULL, 'count' => NULL), - 'file' => 'views_slideshow.theme.inc', - ), - 'views_slideshow_breakout_teasers' => array( - 'arguments' => array('items' => NULL, 'id' => 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 22 Aug 2009 06:08:07 -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\n"; return $output; } - -/** - * These are the slideshow elements themselves; not actually displayed, but used to give the html to the main element. - */ -function theme_views_slideshow_no_display_section($view, $rows, $id, $mode, $teaser = TRUE) { - $output = '
' . "\n"; - if ($mode == VIEWS_SLIDESHOW_MODE_THUMBNAIL_HOVER) { - foreach ($view->result as $count => $node) { - $output .= theme('views_slideshow_no_display_teaser', node_view(node_load($node->nid), $teaser, FALSE, FALSE), $id, $count); - } - } - 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); - } - } - $output .= "
\n\n"; - return $output; -} - -/** - * 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 "; - $output .= $item . "\n"; - $output .= '
' . "\n\n"; - return $output; -} - -/** - * 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"; - $js = "$(document).ready(function() {\n"; - foreach ($items as $count => $item) { - $output .= theme('views_slideshow_breakout_teaser', $item, $id, $count); - $js .= theme('views_slideshow_breakout_teaser_js', $id, $count); - } - $js .= "})\n"; - drupal_add_js($js, 'inline'); - - $output .= "
\n\n"; - - return $output; -} - -/** - * The mouseover event code for each breakout teaser. - */ -function theme_views_slideshow_breakout_teaser_js($id, $count) { - // Return the js to set the main div to this teaser's element. - $hover = (module_invoke('jq', 'add', 'hoverIntent')) ? 'hoverIntent' : 'hover'; - - $js = ' - $("#views_slideshow_div_breakout_teaser_' . $id . '_' . $count . '").' . $hover . '( - function() { - views_slideshow_switch("' . $id . '", ' . $count . '); - views_slideshow_pause("' . $id . '"); - }, - function() { - views_slideshow_resume("' . $id . '"); - }); -'; - return $js; -} - -/** - * An individual breakout teaser. - */ -function theme_views_slideshow_breakout_teaser($item, $id, $count) { - $class = $count ? '' : ' views_slideshow_active_teaser'; - $output = '
' . "\n "; - $output .= $item . "\n"; - $output .= '
' . "\n\n"; - return $output; -} 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.2.1 diff -u -p -r1.1.2.2.2.1 views_slideshow.views_slideshow.inc --- views_slideshow.views_slideshow.inc 23 Jun 2009 22:03:06 -0000 1.1.2.2.2.1 +++ views_slideshow.views_slideshow.inc 22 Aug 2009 06:08:07 -0000 @@ -1,104 +1,13 @@ 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'), -// ); + $options['mode'] = array('default' => VIEWS_SLIDESHOW_DEFAULT_MODE); + return $options; } 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 22 Aug 2009 06:08:08 -0000 @@ -43,4 +43,12 @@ 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 22 Aug 2009 06:08:08 -0000 @@ -7,7 +7,18 @@ */ // 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); + $hidden_elements = theme('views_slideshow_singleframe_no_display_section', $view, $rows, $id, $options['mode'], $teaser); + if ($options['singleframe']['controls'] == 1) { + theme('views_slideshow_singleframe_controls',$id,$view,$options); + } + if ($options['singleframe']['pager'] == 1) { + print theme('views_slideshow_singleframe_pager', $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); + } + if ($options['singleframe']['pager'] == 2) { + print theme('views_slideshow_singleframe_pager', $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.2.1 diff -u -p -r1.1.2.1.2.1 views_slideshow.js --- contrib/views_slideshow_singleframe/views_slideshow.js 23 Jun 2009 22:03:06 -0000 1.1.2.1.2.1 +++ contrib/views_slideshow_singleframe/views_slideshow.js 22 Aug 2009 06:08:08 -0000 @@ -1,4 +1,4 @@ -// $Id: views_slideshow.js,v 1.1.2.1.2.1 2009/06/23 22:03:06 aaron Exp $ +// $Id: views_slideshow.js,v 1.1.2.1 2009/04/16 02:04:52 aaron Exp $ /** * @file @@ -11,122 +11,35 @@ 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==1, + random:settings.random==1, + pause:settings.pause==1, + prev:(settings.controls > 0)?'#views_slideshow_prev_' + settings.id:null, + next:(settings.controls > 0)?'#views_slideshow_next_' + settings.id:null, + pager:(settings.pager > 0)?'#views_slideshow_pager_' + settings.id:null + }); + + if (settings.controls > 0) { + $('#views_slideshow_playpause_' + settings.id).click(function(e) { + if (settings.paused) { + $(settings.targetId).cycle('resume'); + $('#views_slideshow_playpause_' + settings.id).addClass('views_slideshow_pause').removeClass('views_slideshow_play').text('Pause'); + settings.paused = false; + } + else { + $(settings.targetId).cycle('pause'); + $('#views_slideshow_playpause_' + settings.id).addClass('views_slideshow_play').removeClass('views_slideshow_pause').text('Resume'); + settings.paused = true; + } + e.preventDefault(); + }); } }); -} - -/** - * 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 22 Aug 2009 06:08:08 -0000 @@ -16,6 +16,22 @@ 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', + ), + 'views_slideshow_singleframe_pager' => array( + 'arguments' => array('id' => '', 'view' => NULL, 'options' => array()), + 'file' => 'views_slideshow_singleframe.theme.inc', + ), + 'views_slideshow_singleframe_no_display_section' => array( + 'arguments' => array('view' => NULL, 'rows' => NULL, 'id' => NULL, 'mode' => NULL, 'teaser' => TRUE), + 'file' => 'views_slideshow_singleframe.theme.inc', + ), + 'views_slideshow_singleframe_no_display_teaser' => array( + 'arguments' => array('item' => NULL, 'id' => NULL, 'count' => NULL), + '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.2.1 diff -u -p -r1.1.2.1.2.1 views_slideshow_singleframe.theme.inc --- contrib/views_slideshow_singleframe/views_slideshow_singleframe.theme.inc 23 Jun 2009 22:03:06 -0000 1.1.2.1.2.1 +++ contrib/views_slideshow_singleframe/views_slideshow_singleframe.theme.inc 22 Aug 2009 06:08:08 -0000 @@ -1,5 +1,5 @@ $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'], + $settings = array_merge( + array( + 'num_divs' => $num_divs, + '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');*/ +} + + +/** + * These are the slideshow elements themselves; not actually displayed, but used to give the html to the main element. + */ +function theme_views_slideshow_singleframe_no_display_section($view, $rows, $id, $mode, $teaser = TRUE) { + // 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'); + } + + $output = '
' . "\n"; + + foreach ($rows as $count => $item) { + $output .= theme('views_slideshow_singleframe_no_display_teaser', $item, $id, $count); + } + $output .= "
\n\n"; + return $output; +} + +/** + * The html that will be placed into the element in its turn during its frame. + */ +function theme_views_slideshow_singleframe_no_display_teaser($item, $id, $count) { + $class = 'class="views_slideshow_slide' . ($count ? ' views_slideshow_hidden"' : '"'); + $output = '
' . "\n "; + $output .= $item . "\n"; + $output .= '
' . "\n\n"; + return $output; +} + +function theme_views_slideshow_singleframe_controls($id, $view, $options) { + $output = '
' . "\n"; + $output .= '' . t('Previous') . "\n"; + $output .= '' . t('Pause') . "\n"; + $output .= '' . t('Next') . "\n"; + $output .= "
\n"; + return $output; +} + +function theme_views_slideshow_singleframe_pager($id, $view, $options) { + $output = '
'; + return $output; } Index: contrib/views_slideshow_singleframe/views_slideshow_singleframe.views_slideshow.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/views_slideshow/contrib/views_slideshow_singleframe/Attic/views_slideshow_singleframe.views_slideshow.inc,v retrieving revision 1.1.2.1 diff -u -p -r1.1.2.1 views_slideshow_singleframe.views_slideshow.inc --- contrib/views_slideshow_singleframe/views_slideshow_singleframe.views_slideshow.inc 16 Apr 2009 02:04:52 -0000 1.1.2.1 +++ contrib/views_slideshow_singleframe/views_slideshow_singleframe.views_slideshow.inc 22 Aug 2009 06:08:08 -0000 @@ -14,74 +14,115 @@ function views_slideshow_singleframe_vie } function views_slideshow_singleframe_views_slideshow_option_definition() { - $options['singleframe'] = array(); - $options['singleframe']['hover'] = array('default' => (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); - $form['singleframe'] = array( '#type' => 'fieldset', '#title' => t('SingleFrame rotator options'), '#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']['controls'] : 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.'), + ); + $form['singleframe']['pager'] = array( + '#type' => 'select', + '#title' => t('Pager'), + '#options' => array(0 => t('None'),1 => t('Top'),2 => t('Bottom')), + '#default_value' => (isset($view->options['singleframe']['pager'])) ? $view->options['singleframe']['pager'] : 0, + '#description' => t('Determine if a pager for the slideshow (1|2|3) 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 22 Aug 2009 06:08:08 -0000 @@ -7,30 +7,34 @@ */ $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']) { + $view_teasers = theme('views_slideshow_thumbnailhover_breakout_teasers', $rows, $id); + if (!$options['thumbnailhover']['teasers_last']) { $output .= $view_teasers; } // 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); + $hidden_elements = theme('views_slideshow_thumbnailhover_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.2 diff -u -p -r1.1.2.2 views_slideshow.js --- contrib/views_slideshow_thumbnailhover/views_slideshow.js 10 Jun 2009 20:39:58 -0000 1.1.2.2 +++ contrib/views_slideshow_thumbnailhover/views_slideshow.js 22 Aug 2009 06:08:08 -0000 @@ -1,4 +1,4 @@ -// $Id: views_slideshow.js,v 1.1.2.2 2009/06/10 20:39:58 aaron Exp $ +// $Id: views_slideshow.js,v 1.1.2.1 2009/04/20 22:51:08 aaron Exp $ /** * @file @@ -11,123 +11,66 @@ Drupal.behaviors.viewsSlideshowThumbnailHover = function (context) { $('.views_slideshow_main:not(.viewsSlideshowThumbnailHover-processed)', context).addClass('viewsSlideshowThumbnailHover-processed').each(function() { var fullId = '#' + $(this).attr('id'); - - // Make sure we're working from - Drupal.settings.viewsSlideshowThumbnailHover[fullId]._current_div = Drupal.settings.viewsSlideshowThumbnailHover[fullId]._current_div ? Drupal.settings.viewsSlideshowThumbnailHover[fullId]._current_div : 0; - var settings = Drupal.settings.viewsSlideshowThumbnailHover[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 = '#' + $(fullId + " :first").attr('id'); + settings.opts = { + fx:settings.effect, + speed:settings.speed, + timeout:settings.timeout, + sync:settings.sync==1, + random:settings.random==1, + pause:settings.pause==1, + pager:(settings.pager_event == 'hoverIntent') ? null : '#views_slideshow_breakout_teasers_' + settings.id, + pagerAnchorBuilder:(settings.pager_event == 'hoverIntent') ? null : function(idx, slide) { + return '#views_slideshow_div_breakout_teaser_' + settings.id + '_' + idx; + }, + before:(settings.pager_event == 'hoverIntent') ? function(current,next) { + var currId = (currId=$(current).attr('id')).substring(currId.lastIndexOf('_')+1) + var nextId = (nextId=$(next).attr('id')).substring(nextId.lastIndexOf('_')+1) + $('#views_slideshow_div_breakout_teaser_' + settings.id + '_' + currId).removeClass('activeSlide'); + $('#views_slideshow_div_breakout_teaser_' + settings.id + '_' + nextId).addClass('activeSlide'); + } : null, + pagerEvent: (settings.pager_event == 'hoverIntent') ? null : settings.pager_event, + prev:(settings.controls > 0)?'#views_slideshow_prev_' + settings.id:null, + next:(settings.controls > 0)?'#views_slideshow_next_' + settings.id:null + }; + + $(settings.targetId).cycle(settings.opts); + + if (settings.pager_event == 'hoverIntent') { + $('#views_slideshow_breakout_teasers_' + settings.id + ' .views_slideshow_div_breakout_teaser').each(function(i,obj) { + $(obj).hoverIntent( + function() { + $('.views_slideshow_div_breakout_teaser').removeClass('activeSlide'); + var id = $(this).attr('id'); + id = parseInt(id.substring(id.lastIndexOf('_')+1)); + $(settings.targetId).cycle(id); + $('#views_slideshow_div_breakout_teaser_' + settings.id + '_' + id).addClass('activeSlide'); + $(settings.targetId).cycle('stop'); + }, + function() { + var id = $(this).attr('id'); + settings.opts.startingSlide = parseInt(id.substring(id.lastIndexOf('_')+1)); + $(settings.targetId).cycle(settings.opts); + } + ); + }); + } + + if (settings.controls > 0) { + $('#views_slideshow_playpause_' + settings.id).click(function(e) { + if (settings.paused) { + $(settings.targetId).cycle('resume'); + $('#views_slideshow_playpause_' + settings.id).addClass('views_slideshow_pause').removeClass('views_slideshow_play').text('Pause'); + settings.paused = false; + } + else { + $(settings.targetId).cycle('pause'); + $('#views_slideshow_playpause_' + settings.id).addClass('views_slideshow_play').removeClass('views_slideshow_pause').text('Resume'); + settings.paused = true; } - ); + e.preventDefault(); + }); } }); -} - -/** - * Set the timer on or off. - */ -function views_slideshow_timer(slideshow_main, slideshow_status) { - // Stop the current timer. - clearTimeout(Drupal.settings.viewsSlideshowThumbnailHover[slideshow_main]._timer_id); - - // Start a new timer, if slideshow_status is true, unless we're currently paused. - if (slideshow_status && !Drupal.settings.viewsSlideshowThumbnailHover[slideshow_main]._pause) { // !slideshow_data[slideshow_main]._pause) { - // Our timer will call views_slideshow_switch, which fades out the current slide. - Drupal.settings.viewsSlideshowThumbnailHover[slideshow_main]._timer_id = setTimeout("views_slideshow_switch('" + slideshow_main + "', views_slideshow_next_div('" + slideshow_main + "'))", Drupal.settings.viewsSlideshowThumbnailHover[slideshow_main].timer_delay); - } -} - -function views_slideshow_pause(slideshow_main) { - Drupal.settings.viewsSlideshowThumbnailHover[slideshow_main]._pause = true; - views_slideshow_timer(slideshow_main, false); -} - -function views_slideshow_resume(slideshow_main) { - Drupal.settings.viewsSlideshowThumbnailHover[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.viewsSlideshowThumbnailHover[slideshow_main].fade) { - // Fade out -- at the end, switch to the next slide in the slideshow. - $(slideshow_main).fadeTo(Drupal.settings.viewsSlideshowThumbnailHover[slideshow_main].fade_speed, Drupal.settings.viewsSlideshowThumbnailHover[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.viewsSlideshowThumbnailHover[slideshow_main].num_divs) { - new_div_number = 0; - } - else if (new_div_number < 0) { - new_div_number = Drupal.settings.viewsSlideshowThumbnailHover[slideshow_main].num_divs - 1; - } - - // Grab the ID's for the two slides. - _old_breakout = Drupal.settings.viewsSlideshowThumbnailHover[slideshow_main].div_prefix + Drupal.settings.viewsSlideshowThumbnailHover[slideshow_main].id + "_" + Drupal.settings.viewsSlideshowThumbnailHover[slideshow_main]._current_div; - _new_breakout = Drupal.settings.viewsSlideshowThumbnailHover[slideshow_main].div_prefix + Drupal.settings.viewsSlideshowThumbnailHover[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.viewsSlideshowThumbnailHover[slideshow_main]._current_div = new_div_number; - - // Check to see if we faded here or not. - if (Drupal.settings.viewsSlideshowThumbnailHover[slideshow_main].fade) { - // Fade in -- at the end, turn on our timer. - $(slideshow_main).fadeTo(Drupal.settings.viewsSlideshowThumbnailHover[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.viewsSlideshowThumbnailHover[slideshow_main].sort) { - // Select the next div, in forward or reverse order. - new_div_number = Drupal.settings.viewsSlideshowThumbnailHover[slideshow_main]._current_div + Drupal.settings.viewsSlideshowThumbnailHover[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.viewsSlideshowThumbnailHover[slideshow_main].num_divs); - } while (Drupal.settings.viewsSlideshowThumbnailHover[slideshow_main].num_divs > 1 && (new_div_number == Drupal.settings.viewsSlideshowThumbnailHover[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 22 Aug 2009 06:08:08 -0000 @@ -21,6 +21,26 @@ 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', + ), + 'views_slideshow_thumbnailhover_breakout_teaser' => array( + 'arguments' => array('item' => NULL, 'id' => NULL, 'count' => NULL), + 'file' => 'views_slideshow_thumbnailhover.theme.inc', + ), + 'views_slideshow_thumbnailhover_no_display_section' => array( + 'arguments' => array('view' => NULL, 'rows' => NULL, 'id' => NULL, 'mode' => NULL, 'teaser' => TRUE), + 'file' => 'views_slideshow_thumbnailhover.theme.inc', + ), + 'views_slideshow_thumbnailhover_no_display_teaser' => array( + 'arguments' => array('item' => NULL, 'id' => NULL, 'count' => NULL), + 'file' => 'views_slideshow_thumbnailhover.theme.inc', + ), + 'views_slideshow_thumbnailhover_breakout_teasers' => array( + 'arguments' => array('items' => NULL, 'id' => NULL), + '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.2.1 diff -u -p -r1.1.2.1.2.1 views_slideshow_thumbnailhover.theme.inc --- contrib/views_slideshow_thumbnailhover/views_slideshow_thumbnailhover.theme.inc 23 Jun 2009 22:03:06 -0000 1.1.2.1.2.1 +++ contrib/views_slideshow_thumbnailhover/views_slideshow_thumbnailhover.theme.inc 22 Aug 2009 06:08:08 -0000 @@ -1,5 +1,5 @@ $num_divs, + 'teasers_last' => $teasers_last, + 'id_prefix' => '#views_slideshow_main_', + 'div_prefix' => '#views_slideshow_div_', + 'id' => $vars['id'], + ), + $options['thumbnailhover'] + ); + + drupal_add_js(array('viewsSlideshowThumbnailHover' => array('#views_slideshow_main_'. $vars['id'] => $settings)), 'setting'); + if ($settings['pager_event'] == 'hoverIntent') { if (module_exists('jq')) { - $hover = jq_add('hoverIntent') ? 'hoverIntent' : 'hover'; + jq_add('hoverIntent'); } - else if (module_exists('hoverintent')) { - $hover = hoverintent_add() ? 'hoverIntent' : 'hover'; + if (module_exists('hoverintent')) { + hoverintent_add(); } } +} - $num_divs = sizeof($vars['rows']); - $fade = $options['fade'] ? 'true' : 'false'; - $teasers_last = $options['teasers_last'] ? 'true' : 'false'; - $settings = 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'], - ); +/** + * These are the slideshow elements themselves; not actually displayed, but used to give the html to the main element. + */ +function theme_views_slideshow_thumbnailhover_no_display_section($view, $rows, $id, $mode, $teaser = TRUE) { + // 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'); + } + $output = '
' . "\n"; + foreach ($view->result as $count => $node) { + $output .= theme('views_slideshow_thumbnailhover_no_display_teaser', node_view(node_load($node->nid), $teaser, FALSE, FALSE), $id, $count); + } + $output .= "
\n\n"; + return $output; +} + +/** + * The html that will be placed into the element in its turn during its frame. + */ +function theme_views_slideshow_thumbnailhover_no_display_teaser($item, $id, $count) { + $class = 'class="views_slideshow_slide' . ($count ? ' views_slideshow_hidden"' : '"'); + $output = '
' . "\n "; + $output .= $item . "\n"; + $output .= '
' . "\n\n"; + return $output; +} + +/** + * These are teasers that may be pointed at with a mouse to change the element directly. + */ +function theme_views_slideshow_thumbnailhover_breakout_teasers($items, $id) { + $output = '
' . "\n"; + $js = "$(document).ready(function() {\n"; + foreach ($items as $count => $item) { + $output .= theme('views_slideshow_thumbnailhover_breakout_teaser', $item, $id, $count); + $js .= theme('views_slideshow_thumbnailhover_breakout_teaser_js', $id, $count); + } + $js .= "})\n"; + drupal_add_js($js, 'inline'); + + $output .= "
\n\n"; + + return $output; +} + +/** + * An individual breakout teaser. + */ +function theme_views_slideshow_thumbnailhover_breakout_teaser($item, $id, $count) { + $class = $count ? '' : ' views_slideshow_active_teaser'; + $output = '
' . "\n "; + $output .= $item . "\n"; + $output .= '
' . "\n\n"; + return $output; +} - 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_thumbnailhover_controls($id, $view, $options) { + $output = '
' . "\n"; + $output .= '' . t('Previous') . "\n"; + $output .= '' . t('Pause') . "\n"; + $output .= '' . t('Next') . "\n"; + $output .= "
\n"; + return $output; } Index: contrib/views_slideshow_thumbnailhover/views_slideshow_thumbnailhover.views_slideshow.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/views_slideshow/contrib/views_slideshow_thumbnailhover/Attic/views_slideshow_thumbnailhover.views_slideshow.inc,v retrieving revision 1.1.2.1.2.1 diff -u -p -r1.1.2.1.2.1 views_slideshow_thumbnailhover.views_slideshow.inc --- contrib/views_slideshow_thumbnailhover/views_slideshow_thumbnailhover.views_slideshow.inc 23 Jun 2009 22:03:06 -0000 1.1.2.1.2.1 +++ contrib/views_slideshow_thumbnailhover/views_slideshow_thumbnailhover.views_slideshow.inc 22 Aug 2009 06:08:08 -0000 @@ -1,5 +1,5 @@ module_exists('hoverintent') ? 'hoverIntent' : 'hover', - 'timer_delay' => 5000, - 'sort' => 1, - 'fade' => TRUE, - 'fade_speed' => 'slow', - 'fade_value' => 0.25, - 'hover_breakout' => 'teaser', - 'teasers_last' => TRUE, + '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); - $form['thumbnailhover'] = array( '#type' => 'fieldset', '#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.'), + '#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.'), ); - $options = array( - 'slow' => t('Slow'), - 'normal' => t('Normal'), - 'fast' => t('Fast'), + $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']['speed'] = array( + '#type' => 'textfield', + '#title' => t('Speed'), + '#default_value' => $view->options['thumbnailhover']['speed'], + '#description' => t('Time in milliseconds that each transition lasts. Numeric only!'), ); - $form['thumbnailhover']['fade_speed'] = array( + $form['thumbnailhover']['random'] = array( '#type' => 'radios', - '#title' => t('Fade speed'), + '#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['thumbnailhover']['pause'] = array( + '#type' => 'radios', + '#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.'), + ); + $options = array('mouseover' => t('Hover'), 'click' => t('Click')); + if ((module_exists('jq') && jq_add('hoverIntent')) || (module_exists('hoverintent') && hoverintent_add())) { + $options['hoverIntent'] = 'hoverIntent'; + } + $form['thumbnailhover']['pager_event'] = array( + '#type' => 'select', + '#title' => t('Pager Event'), '#options' => $options, - '#default_value' => $view->options['thumbnailhover']['fade_speed'], + '#default_value' => (isset($view->options['thumbnailhover']['pager_event']) ? $view->options['thumbnailhover']['pager_event'] : 'hover'), + '#description' => t('Which event should be used to select an image from the breakout list.'), ); - $form['thumbnailhover']['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['thumbnailhover']['fade_value'], + $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']['controls'] : 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( - 'teaser' => t('Teaser'), - 'full' => t('Full'), - ); - $form['thumbnailhover']['hover_breakout'] = array( - '#type' => 'radios', - '#title' => t('Hover breakout'), + '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['thumbnailhover']['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