? contrib/views_slideshow_cycle/js/jquery.cycle.all.min.js ? contrib/views_slideshow_cycle/js/json2.js Index: contrib/views_slideshow_cycle/views_slideshow_cycle.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/views_slideshow/contrib/views_slideshow_cycle/Attic/views_slideshow_cycle.module,v retrieving revision 1.1.2.8 diff -u -p -r1.1.2.8 views_slideshow_cycle.module --- contrib/views_slideshow_cycle/views_slideshow_cycle.module 22 Dec 2010 06:11:49 -0000 1.1.2.8 +++ contrib/views_slideshow_cycle/views_slideshow_cycle.module 28 Dec 2010 02:00:28 -0000 @@ -24,10 +24,15 @@ function views_slideshow_cycle_init() { // Otherwise, we'll add the version included with this module. if (!$js && file_exists($module_path . '/js/jquery.cycle.all.min.js')) { - drupal_add_js($module_path . '/js/jquery.cycle.all.min.js'); + drupal_add_js($module_path . '/js/jquery.cycle.all.min.js', 'module'); + } + + if (file_exists($module_path . '/js/json2.js')) { + drupal_add_js($module_path . '/js/json2.js', 'module'); } drupal_add_js($module_path . '/js/views_slideshow_cycle.js', 'module'); + drupal_add_css($module_path . '/views_slideshow_cycle.css', 'module'); } Index: contrib/views_slideshow_cycle/views_slideshow_cycle.views_slideshow.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/views_slideshow/contrib/views_slideshow_cycle/Attic/views_slideshow_cycle.views_slideshow.inc,v retrieving revision 1.1.2.16 diff -u -p -r1.1.2.16 views_slideshow_cycle.views_slideshow.inc --- contrib/views_slideshow_cycle/views_slideshow_cycle.views_slideshow.inc 22 Dec 2010 06:11:49 -0000 1.1.2.16 +++ contrib/views_slideshow_cycle/views_slideshow_cycle.views_slideshow.inc 28 Dec 2010 02:00:28 -0000 @@ -44,109 +44,7 @@ function views_slideshow_cycle_views_sli 'cleartypenobg' => array('default' => 'false'), // Advanced - 'cycle_options' => array('default' => 0), - 'advanced_use_fx' => array('default' => 0), - 'advanced_fx' => array('default' => 'fade'), - 'advanced_use_timeout' => array('default' => 0), - 'advanced_timeout' => array('default' => 4000), - 'advanced_use_timeoutFn' => array('default' => 0), - 'advanced_timeoutFn' => array('default' => NULL), - 'advanced_use_continuous' => array('default' => 0), - 'advanced_continuous' => array('default' => 0), - 'advanced_use_speed' => array('default' => 0), - 'advanced_speed' => array('default' => 1000), - 'advanced_use_speedIn' => array('default' => 0), - 'advanced_speedIn' => array('default' => NULL), - 'advanced_use_speedOut' => array('default' => 0), - 'advanced_speedOut' => array('default' => NULL), - 'advanced_use_next' => array('default' => 0), - 'advanced_next' => array('default' => NULL), - 'advanced_use_prev' => array('default' => 0), - 'advanced_prev' => array('default' => NULL), - 'advanced_use_prevNextClick' => array('default' => 0), - 'advanced_prevNextClick' => array('default' => NULL), - 'advanced_use_prevNextEvent' => array('default' => 0), - 'advanced_prevNextEvent' => array('default' => 'click.cycle'), - 'advanced_use_pager' => array('default' => 0), - 'advanced_pager' => array('default' => NULL), - 'advanced_use_pagerClick' => array('default' => 0), - 'advanced_pagerClick' => array('default' => NULL), - 'advanced_use_pagerEvent' => array('default' => 0), - 'advanced_pagerEvent' => array('default' => 'click.cycle'), - 'advanced_use_allowPagerClickBubble' => array('default' => 0), - 'advanced_allowPagerClickBubble' => array('default' => 0), - 'advanced_use_pagerAnchorBuilder' => array('default' => 0), - 'advanced_pagerAnchorBuilder' => array('default' => NULL), - 'advanced_use_before' => array('default' => 0), - 'advanced_before' => array('default' => NULL), - 'advanced_use_after' => array('default' => 0), - 'advanced_after' => array('default' => NULL), - 'advanced_use_end' => array('default' => 0), - 'advanced_end' => array('default' => NULL), - 'advanced_use_easing' => array('default' => 0), - 'advanced_easing' => array('default' => NULL), - 'advanced_use_easeIn' => array('default' => 0), - 'advanced_easeIn' => array('default' => NULL), - 'advanced_use_easeOut' => array('default' => 0), - 'advanced_easeOut' => array('default' => NULL), - 'advanced_use_shuffle' => array('default' => 0), - 'advanced_shuffle' => array('default' => NULL), - 'advanced_use_animIn' => array('default' => 0), - 'advanced_animIn' => array('default' => NULL), - 'advanced_use_animOut' => array('default' => 0), - 'advanced_animOut' => array('default' => NULL), - 'advanced_use_cssBefore' => array('default' => 0), - 'advanced_cssBefore' => array('default' => NULL), - 'advanced_use_cssAfter' => array('default' => 0), - 'advanced_cssAfter' => array('default' => NULL), - 'advanced_use_fxFn' => array('default' => 0), - 'advanced_fxFn' => array('default' => NULL), - 'advanced_use_height' => array('default' => 0), - 'advanced_height' => array('default' => 'auto'), - 'advanced_use_startingSlide' => array('default' => 0), - 'advanced_startingSlide' => array('default' => 0), - 'advanced_use_sync' => array('default' => 0), - 'advanced_sync' => array('default' => 1), - 'advanced_use_random' => array('default' => 0), - 'advanced_random' => array('default' => 0), - 'advanced_use_fit' => array('default' => 0), - 'advanced_fit' => array('default' => 0), - 'advanced_use_containerResize' => array('default' => 0), - 'advanced_containerResize' => array('default' => 1), - 'advanced_use_pause' => array('default' => 0), - 'advanced_pause' => array('default' => 0), - 'advanced_use_pauseOnPagerHover' => array('default' => 0), - 'advanced_pauseOnPagerHover' => array('default' => 0), - 'advanced_use_autostop' => array('default' => 0), - 'advanced_autostop' => array('default' => 0), - 'advanced_use_autostopCount' => array('default' => 0), - 'advanced_autostopCount' => array('default' => 0), - 'advanced_use_delay' => array('default' => 0), - 'advanced_delay' => array('default' => 0), - 'advanced_use_slideExpr' => array('default' => 0), - 'advanced_slideExpr' => array('default' => NULL), - 'advanced_use_cleartype' => array('default' => 0), - 'advanced_cleartype' => array('default' => 1), - 'advanced_use_cleartypeNoBg' => array('default' => 0), - 'advanced_cleartypeNoBg' => array('default' => 0), - 'advanced_use_nowrap' => array('default' => 0), - 'advanced_nowrap' => array('default' => 0), - 'advanced_use_fastOnEvent' => array('default' => 0), - 'advanced_fastOnEvent' => array('default' => 0), - 'advanced_use_randomizeEffects' => array('default' => 0), - 'advanced_randomizeEffects' => array('default' => 1), - 'advanced_use_rev' => array('default' => 0), - 'advanced_rev' => array('default' => 0), - 'advanced_use_manualTrump' => array('default' => 0), - 'advanced_manualTrump' => array('default' => 1), - 'advanced_use_requeueOnImageNotLoaded' => array('default' => 0), - 'advanced_requeueOnImageNotLoaded' => array('default' => 1), - 'advanced_use_requeueTimeout' => array('default' => 0), - 'advanced_requeueTimeout' => array('default' => 250), - 'advanced_use_activePagerClass' => array('default' => 0), - 'advanced_activePagerClass' => array('default' => 'activeSlide'), - 'advanced_use_updateActivePagerLink' => array('default' => 0), - 'advanced_updateActivePagerLink' => array('default' => NULL), + 'advanced_options' => array('default' => '{}'), ), ); return $options; @@ -393,93 +291,179 @@ function views_slideshow_cycle_views_sli // Advanced Options - $form['views_slideshow_cycle']['advanced_options'] = array( + $form['views_slideshow_cycle']['advanced_options_header'] = array( '#value' => '

' . t('jQuery Cycle Custom Options') . '

', ); - $form['views_slideshow_cycle']['cycle_options'] = array( - '#type' => 'checkbox', - '#title' => t('View All jQuery Cycle Options'), - '#default_value' => $view->options['views_slideshow_cycle']['cycle_options'], - ); - // All the jquery cycle options according to - // http://malsup.com/jquery/cycle/options.html - $cycle_options = array( - 'activePagerClass' => t('class name used for the active pager link'), - 'after' => t('transition callback (scope set to element that was shown): function(currSlideElement, nextSlideElement, options, forwardFlag) Do not enter the function in this box. Only enter what you would have entered within the function.'), - 'allowPagerClickBubble' => t('allows or prevents click event on pager anchors from bubbling'), - 'animIn' => t('properties that define how the slide animates in'), - 'animOut' => t('properties that define how the slide animates out'), - 'autostop' => t('true to end slideshow after X transitions (where X == slide count)'), - 'autostopCount' => t('number of transitions (optionally used with autostop to define X)'), - 'before' => t('transition callback (scope set to element to be shown): function(currSlideElement, nextSlideElement, options, forwardFlag) Do not enter the function in this box. Only enter what you would have entered within the function.'), - 'cleartype' => t('true if clearType corrections should be applied (for IE)'), - 'cleartypeNoBg' => t('set to true to disable extra cleartype fixing (leave false to force background color setting on slides)'), - 'containerResize' => t('resize container to fit largest slide'), - 'continuous' => t('true to start next transition immediately after current one completes'), - 'cssAfter' => t('properties that defined the state of the slide after transitioning out'), - 'cssBefore' => t('properties that define the initial state of the slide before transitioning in'), - 'delay' => t('additional delay (in ms) for first transition (hint: can be negative)'), - 'easing' => t('easing method for both in and out transitions'), - 'easingIn' => t('easing for "in" transition'), - 'easingOut' => t('easing for "out" transition'), - 'end' => t('callback invoked when the slideshow terminates (use with autostop or nowrap options): function(options) Do not enter the function in this box. Only enter what you would have entered within the function.'), - 'fastOnEvent' => t('force fast transitions when triggered manually (via pager or prev/next); value == time in ms'), - 'fit' => t('force slides to fit container'), - 'fx' => t('name of transition effect (or comma separated names, ex: fade,scrollUp,shuffle)'), - 'fxFn' => t('function used to control the transition: function(currSlideElement, nextSlideElement, options, afterCalback, forwardFlag) Do not enter the function in this box. Only enter what you would have entered within the function.'), - 'height' => t('container height'), - 'manualTrump' => t('causes manual transition to stop an active transition instead of being ignored'), - 'next' => t('selector for element to use as click trigger for next slide'), - 'nowrap' => t('true to prevent slideshow from wrapping'), - 'pager' => t('selector for element to use as pager container'), - 'pagerAnchorBuilder' => t('callback fn for building anchor links: function(index, DOMelement) Do not enter the function in this box. Only enter what you would have entered within the function.'), - 'pagerClick' => t('callback fn for pager clicks: function(zeroBasedSlideIndex, slideElement) Do not enter the function in this box. Only enter what you would have entered within the function.'), - 'pagerEvent' => t('name of event which drives the pager navigation'), - 'pause' => t('true to enable "pause on hover"'), - 'pauseOnPagerHover' => t('true to pause when hovering over pager link'), - 'prev' => t('selector for element to use as click trigger for previous slide'), - 'prevNextClick' => t('callback fn for prev/next clicks: function(isNext, zeroBasedSlideIndex, slideElement) Do not enter the function in this box. Only enter what you would have entered within the function.'), - 'prevNextEvent' => t('event which drives the manual transition to the previous or next slide'), - 'random' => t('true for random, false for sequence (not applicable to shuffle fx)'), - 'randomizeEffects' => t('valid when multiple effects are used; true to make the effect sequence random'), - 'requeueOnImageNotLoaded' => t('requeue the slideshow if any image slides are not yet loaded'), - 'requeueTimeout' => t('ms delay for requeue'), - 'rev' => t('causes animations to transition in reverse'), - 'shuffle' => t('coords for shuffle animation, ex: { top:15, left: 200 }'), - 'slideExpr' => t('expression for selecting slides (if something other than all children is required)'), - 'speed' => t('speed of the transition (any valid fx speed value)'), - 'speedIn' => t('speed of the "in" transition'), - 'speedOut' => t('speed of the "out" transition'), - 'startingSlide' => t('zero-based index of the first slide to be displayed'), - 'sync' => t('true if in/out transitions should occur simultaneously'), - 'timeout' => t('milliseconds between slide transitions (0 to disable auto advance)'), - 'timeoutFn' => t('callback for determining per-slide timeout value: function(currSlideElement, nextSlideElement, options, forwardFlag) Do not enter the function in this box. Only enter what you would have entered within the function.'), - 'updateActivePagerLink' => t('callback fn invoked to update the active pager link (adds/removes activePagerClass style)'), - ); - - foreach ($cycle_options as $name => $description) { - $lower_name = strtolower($name); - // fx - $form['views_slideshow_cycle']['advanced_use_' . $lower_name] = array( - '#type' => 'checkbox', - '#title' => t('Override !name setting', array('!name' => $name)), - '#default_value' => $view->options['views_slideshow_cycle']['advanced_use_' . $lower_name], - '#process' => array('views_process_dependency'), - '#dependency' => array('edit-style-options-views-slideshow-cycle-cycle-options' => array(1)), + if (!file_exists(drupal_get_path('module', 'views_slideshow_cycle') . '/js/json2.js')) { + $form['views_slideshow_cycle']['no_json_js'] = array( + '#value' => '
' . t('To use the advanced options you need to download json2.js. You can do this by clicking the download button at !url and extract json2.js to views_slideshow/contrib/views_slideshow_cycle/js', array('!url' => l('https://github.com/douglascrockford/JSON-js', 'https://github.com/douglascrockford/JSON-js', array('attributes' => array('target' => '_blank'))))) . '
', + ); + } + else { + $form['views_slideshow_cycle']['advanced_options_info'] = array( + '#value' => '

' . t('You can find a list of all the available options at !url. If one of the options you add uses a function, example fxFn, then you need to only enter what goes inside the function call. The variables that are in the documentation on the jquery cycle site will be available to you.', array('!url' => l('http://malsup.com/jquery/cycle/options.html', 'http://malsup.com/jquery/cycle/options.html'))) . '

', ); - $form['views_slideshow_cycle']['advanced_' . $lower_name] = array( + // All the jquery cycle options according to + // http://malsup.com/jquery/cycle/options.html + $cycle_options = array( + 0 => 'Select One', + 'activePagerClass' => 'activePagerClass', + 'after' => 'after', + 'allowPagerClickBubble' => 'allowPagerClickBubble', + 'animIn' => 'animIn', + 'animOut' => 'animOut', + 'autostop' => 'autostop', + 'autostopCount' => 'autostopCount', + 'before' => 'before', + 'backwards' => 'backwards', + 'bounce' => 'bounce', + 'cleartype' => 'cleartype', + 'cleartypeNoBg' => 'cleartypeNoBg', + 'containerResize' => 'containerResize', + 'continuous' => 'continuous', + 'cssAfter' => 'cssAfter', + 'cssBefore' => 'cssBefore', + 'delay' => 'delay', + 'easeIn' => 'easeIn', + 'easeOut' => 'easeOut', + 'easing' => 'easing', + 'end' => 'end', + 'fastOnEvent' => 'fastOnEvent', + 'fit' => 'fit', + 'fx' => 'fx', + 'fxFn' => 'fxFn', + 'height' => 'height', + 'manualTrump' => 'manualTrump', + 'next' => 'next', + 'nowrap' => 'nowrap', + 'onPagerEvent' => 'onPagerEvent', + 'onPrevNextEvent' => 'onPrevNextEvent', + 'pager' => 'pager', + 'pagerAnchorBuilder' => 'pagerAnchorBuilder', + 'pagerEvent' => 'pagerEvent', + 'pause' => 'pause', + 'pauseOnPagerHover' => 'pauseOnPagerHover', + 'prev' => 'prev', + 'prevNextEvent' => 'prevNextEvent', + 'random' => 'random', + 'randomizeEffects' => 'randomizeEffects', + 'requeueOnImageNotLoaded' => 'requeueOnImageNotLoaded', + 'requeueTimeout' => 'requeueTimeout', + 'rev' => 'rev', + 'shuffle' => 'shuffle', + 'slideExpr' => 'slideExpr', + 'slideResize' => 'slideResize', + 'speed' => 'speed', + 'speedIn' => 'speedIn', + 'speedOut' => 'speedOut', + 'startingSlide' => 'startingSlide', + 'sync' => 'sync', + 'timeout' => 'timeout', + 'timeoutFn' => 'timeoutFn', + 'updateActivePagerLink' => 'updateActivePagerLink', + ); + + $form['views_slideshow_cycle']['advanced_options_choices'] = array( + '#type' => 'select', + '#title' => t('Advanced Options'), + '#options' => $cycle_options, + ); + + $form['views_slideshow_cycle']['advanced_options_entry'] = array( '#type' => 'textarea', - '#title' => t('!lower_name', array('!lower_name' => $lower_name)), - '#default_value' => $view->options['views_slideshow_cycle']['advanced_' . $lower_name], - '#description' => $description, // Don't need to wrap in t() since it's done above. - '#process' => array('views_process_dependency'), - '#dependency_count' => 2, - '#dependency' => array( - 'edit-style-options-views-slideshow-cycle-cycle-options' => array(1), - 'edit-style-options-views-slideshow-cycle-advanced-use-' . $lower_name => array(1), - ), + '#title' => t('Advanced Option Value'), + '#description' => t('It is important that you click the Update link when you make any changes to the options or those changes will not be saved when you save the form.'), + ); + + $form['views_slideshow_cycle']['advanced_options'] = array( + '#type' => 'textarea', + '#default_value' => $view->options['views_slideshow_cycle']['advanced_options'], + ); + + $form['views_slideshow_cycle']['advanced_options_table'] = array( + '#value' => '
' + ); + + $form['views_slideshow_cycle']['advanced_options_js'] = array( + '#value' => " + + " ); } } Index: contrib/views_slideshow_cycle/js/views_slideshow_cycle.js =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/views_slideshow/contrib/views_slideshow_cycle/js/Attic/views_slideshow_cycle.js,v retrieving revision 1.1.2.1 diff -u -p -r1.1.2.1 views_slideshow_cycle.js --- contrib/views_slideshow_cycle/js/views_slideshow_cycle.js 22 Dec 2010 06:11:49 -0000 1.1.2.1 +++ contrib/views_slideshow_cycle/js/views_slideshow_cycle.js 28 Dec 2010 02:00:28 -0000 @@ -93,189 +93,146 @@ Drupal.behaviors.viewsSlideshowCycle = f viewsSlideshowPause(settings.slideshowId, ''); }); } - - // Advanced Settings - if (typeof(settings.advanced_fx) !== 'undefined') { settings.opts.fx = settings.advanced_fx; } - - if (typeof(settings.advanced_timeout) !== 'undefined') { settings.opts.timeout = settings.advanced_timeout; } - - if (typeof(settings.advanced_timeoutfn) !== 'undefined') { - settings.opts.timeoutFn = function(currSlideElement, nextSlideElement, options, forwardFlag) { - eval(settings.advanced_timeoutfn); - } - } - - // true to start next transition immediately after current one completes - if (typeof(settings.advanced_continuous) !== 'undefined') { settings.opts.continuous = settings.advanced_continuous; } - - // speed of the transition (any valid fx speed value) - if (typeof(settings.advanced_speed) !== 'undefined') { settings.opts.speed = settings.advanced_speed; } - - // speed of the 'in' transition - if (typeof(settings.advanced_speedin) !== 'undefined') { settings.opts.speedIn = settings.advanced_speedin; } - - // speed of the 'out' transition - if (typeof(settings.advanced_speedout) !== 'undefined') { settings.opts.speedOut = settings.advanced_speedout; } - - // selector for element to use as click trigger for next slide - if (typeof(settings.advanced_next) !== 'undefined') { settings.opts.next = settings.advanced_next; } - - // selector for element to use as click trigger for previous slide - if (typeof(settings.advanced_prev) !== 'undefined') { settings.opts.prev = settings.advanced_prev; } - - // callback fn for prev/next clicks: function(isNext, zeroBasedSlideIndex, slideElement) - if (typeof(settings.advanced_prevnextclick) !== 'undefined') { - settings.opts.prevNextClick = function(isNext, zeroBasedSlideIndex, slideElement) { - eval(settings.advanced_prevnextclick); - } - } - - // event which drives the manual transition to the previous or next slide - if (typeof(settings.advanced_prevnextevent) !== 'undefined') { settings.opts.prevNextEvent = settings.advanced_prevnextevent; } - - // selector for element to use as pager container - if (typeof(settings.advanced_pager) !== 'undefined') { settings.opts.pager = settings.advanced_pager; } - - // callback fn for pager clicks: function(zeroBasedSlideIndex, slideElement) - if (typeof(settings.advanced_pagerclick) !== 'undefined') { - settings.opts.pagerClick = function(zeroBasedSlideIndex, slideElement) { - eval(settings.advanced_pagerclick); - } - } - - // name of event which drives the pager navigation - if (typeof(settings.advanced_pagerevent) !== 'undefined') { settings.opts.pagerEvent = settings.advanced_pagerevent; } - - // allows or prevents click event on pager anchors from bubbling - if (typeof(settings.advanced_allowpagerclickbubble) !== 'undefined') { settings.opts.allowPagerClickBubble = settings.advanced_allowpagerclickbubble; } - - // callback fn for building anchor links: function(index, DOMelement) - if (typeof(settings.advanced_pageranchorbuilder) !== 'undefined') { - settings.opts.pagerAnchorBuilder = function(index, DOMelement) { - eval(settings.advanced_pageranchorbuilder); - } - } - - // transition callback (scope set to element to be shown): function(currSlideElement, nextSlideElement, options, forwardFlag) - if (typeof(settings.advanced_before) !== 'undefined') { - settings.opts.before = function(currSlideElement, nextSlideElement, options, forwardFlag) { - eval(settings.advanced_before); + + var advancedOptions = JSON.parse(settings.advanced_options); + for (var option in advancedOptions) { + advancedOptions[option] = $.trim(advancedOptions[option]); + advancedOptions[option] = advancedOptions[option].replace(/\n/g, ''); + if (!isNaN(parseInt(advancedOptions[option]))) { + advancedOptions[option] = parseInt(advancedOptions[option]); } - } - - // transition callback (scope set to element that was shown): function(currSlideElement, nextSlideElement, options, forwardFlag) - if (typeof(settings.advanced_after) !== 'undefined') { - settings.opts.after = function(currSlideElement, nextSlideElement, options, forwardFlag) { - eval(settings.advanced_after); + else if (advancedOptions[option].toLowerCase() == 'true') { + advancedOptions[option] = true; } - } - - // callback invoked when the slideshow terminates (use with autostop or nowrap options): function(options) - if (typeof(settings.advanced_end) !== 'undefined') { - settings.opts.end = function(options) { - eval(settings.advanced_end); + else if (advancedOptions[option].toLowerCase() == 'false') { + advancedOptions[option] = false; } - } - - // easing method for both in and out transitions - if (typeof(settings.advanced_easing) !== 'undefined') { settings.opts.easing = settings.advanced_easing; } - - // easing for "in" transition - if (typeof(settings.advanced_easein) !== 'undefined') { settings.opts.easeIn = settings.advanced_easein; } - - // easing for "out" transition - if (typeof(settings.advanced_easeout) !== 'undefined') { settings.opts.easeOut = settings.advanced_easeout; } - - // coords for shuffle animation, ex: { top:15, left: 200 } - if (typeof(settings.advanced_shuffle) !== 'undefined') { settings.opts.shuffle = settings.advanced_shuffle; } - - // properties that define how the slide animates in - if (typeof(settings.advanced_animin) !== 'undefined') { settings.opts.animIn = settings.advanced_animin; } - - // properties that define how the slide animates out - if (typeof(settings.advanced_animout) !== 'undefined') { settings.opts.animOut = settings.advanced_animout; } - - // properties that define the initial state of the slide before transitioning in - if (typeof(settings.advanced_cssbefore) !== 'undefined') { settings.opts.cssBefore = settings.advanced_cssbefore; } - - // properties that defined the state of the slide after transitioning out - if (typeof(settings.advanced_cssafter) !== 'undefined') { settings.opts.cssAfter = settings.advanced_cssafter; } - - // function used to control the transition: function(currSlideElement, nextSlideElement, options, afterCalback, forwardFlag) - if (typeof(settings.advanced_fxfn) !== 'undefined') { - settings.opts.fxFn = function(currSlideElement, nextSlideElement, options, afterCalback, forwardFlag) { - eval(settings.advanced_fxfn); + + switch(option) { + + // Standard Options + case "activePagerClass": + case "allowPagerClickBubble": + case "autostop": + case "autostopCount": + case "backwards": + case "bounce": + case "cleartype": + case "cleartypeNoBg": + case "containerResize": + case "continuous": + case "delay": + case "easeIn": + case "easeOut": + case "easing": + case "fastOnEvent": + case "fit": + case "fx": + case "height": + case "manualTrump": + case "next": + case "nowrap": + case "pager": + case "pagerEvent": + case "pause": + case "pauseOnPagerHover": + case "prev": + case "prevNextEvent": + case "random": + case "randomizeEffects": + case "requeueOnImageNotLoaded": + case "requeueTimeout": + case "rev": + case "slideExpr": + case "slideResize": + case "speed": + case "speedIn": + case "speedOut": + case "startingSlide": + case "sync": + case "timeout": + settings.opts[option] = advancedOptions[option]; + break; + + // These process options that look like {top:50, bottom:20} + case "animIn": + case "animOut": + case "cssBefore": + case "cssAfter": + case "shuffle": + settings.opts[option] = eval('(' + advancedOptions[option] + ')'); + break; + + // These options have their own functions. + case "after": + // transition callback (scope set to element that was shown): function(currSlideElement, nextSlideElement, options, forwardFlag) + settings.opts[option] = function(currSlideElement, nextSlideElement, options, forwardFlag) { + eval(advancedOptions[option]); + } + break; + + case "before": + // transition callback (scope set to element to be shown): function(currSlideElement, nextSlideElement, options, forwardFlag) + settings.opts[option] = function(currSlideElement, nextSlideElement, options, forwardFlag) { + eval(advancedOptions[option]); + } + break; + + case "end": + // callback invoked when the slideshow terminates (use with autostop or nowrap options): function(options) + settings.opts[option] = function(options) { + eval(advancedOptions[option]); + } + break; + + case "fxFn": + // function used to control the transition: function(currSlideElement, nextSlideElement, options, afterCalback, forwardFlag) + settings.opts[option] = function(currSlideElement, nextSlideElement, options, afterCalback, forwardFlag) { + eval(advancedOptions[option]); + } + break; + + case "onPagerEvent": + settings.opts[option] = function(zeroBasedSlideIndex, slideElement) { + eval(advancedOptions[option]); + } + break; + + case "onPrevNextEvent": + settings.opts[option] = function(isNext, zeroBasedSlideIndex, slideElement) { + eval(advancedOptions[option]); + } + break; + + case "pagerAnchorBuilder": + // callback fn for building anchor links: function(index, DOMelement) + settings.opts[option] = function(index, DOMelement) { + eval(advancedOptions[option]); + } + break; + + case "pagerClick": + // callback fn for pager clicks: function(zeroBasedSlideIndex, slideElement) + settings.opts[option] = function(zeroBasedSlideIndex, slideElement) { + eval(advancedOptions[option]); + } + break; + + case "timeoutFn": + settings.opts[option] = function(currSlideElement, nextSlideElement, options, forwardFlag) { + eval(advancedOptions[option]); + } + break; + + case "updateActivePagerLink": + // callback fn invoked to update the active pager link (adds/removes activePagerClass style) + settings.opts[option] = function(pager, currSlideIndex) { + eval(advancedOptions[option]); + } + break; } } - // container height - if (typeof(settings.advanced_height) !== 'undefined') { settings.opts.height = settings.advanced_height; } - - // zero-based index of the first slide to be displayed - if (typeof(settings.advanced_startingslide) !== 'undefined') { settings.opts.startingSlide = settings.advanced_startingslide; } - - // true if in/out transitions should occur simultaneously - if (typeof(settings.advanced_sync) !== 'undefined') { settings.opts.sync = settings.advanced_sync; } - - // true for random, false for sequence (not applicable to shuffle fx) - if (typeof(settings.advanced_random) !== 'undefined') { settings.opts.random = settings.advanced_random; } - - // force slides to fit container - if (typeof(settings.advanced_fit) !== 'undefined') { settings.opts.fit = settings.advanced_fit; } - - // resize container to fit largest slide - if (typeof(settings.advanced_containerresize) !== 'undefined') { settings.opts.containerResize = settings.advanced_containerresize; } - - // true to enable "pause on hover" - if (typeof(settings.advanced_pause) !== 'undefined') { settings.opts.pause = settings.advanced_pause; } - - // true to pause when hovering over pager link - if (typeof(settings.advanced_pauseonpagerhover) !== 'undefined') { settings.opts.pauseOnPagerHover = settings.advanced_pauseonpagerhover; } - - // true to end slideshow after X transitions (where X == slide count) - if (typeof(settings.advanced_autostop) !== 'undefined') { settings.opts.autostop = settings.advanced_autostop; } - - // number of transitions (optionally used with autostop to define X) - if (typeof(settings.advanced_autostopcount) !== 'undefined') { settings.opts.autostopCount = settings.advanced_autostopcount; } - - // additional delay (in ms) for first transition (hint: can be negative) - if (typeof(settings.advanced_delay) !== 'undefined') { settings.opts.delay = settings.advanced_delay; } - - // expression for selecting slides (if something other than all children is required) - if (typeof(settings.advanced_slideexpr) !== 'undefined') { settings.opts.slideExpr = settings.advanced_slideexpr; } - - // true if clearType corrections should be applied (for IE) - if (typeof(settings.advanced_cleartype) !== 'undefined') { settings.opts.cleartype = settings.advanced_cleartype; } - - // set to true to disable extra cleartype fixing (leave false to force background color setting on slides) - if (typeof(settings.advanced_cleartypenobg) !== 'undefined') { settings.opts.cleartypeNoBg = settings.advanced_cleartypenobg; } - - // true to prevent slideshow from wrapping - if (typeof(settings.advanced_nowrap) !== 'undefined') { settings.opts.nowrap = settings.advanced_nowrap; } - - // force fast transitions when triggered manually (via pager or prev/next); value == time in ms - if (typeof(settings.advanced_fastonevent) !== 'undefined') { settings.opts.fastOnEvent = settings.advanced_fastonevent; } - - // valid when multiple effects are used; true to make the effect sequence random - if (typeof(settings.advanced_randomizeeffects) !== 'undefined') { settings.opts.randomizeEffects = settings.advanced_randomizeeffects; } - - // causes animations to transition in reverse - if (typeof(settings.advanced_rev) !== 'undefined') { settings.opts.rev = settings.advanced_rev; } - - // causes manual transition to stop an active transition instead of being ignored - if (typeof(settings.advanced_manualtrump) !== 'undefined') { settings.opts.manualTrump = settings.advanced_manualtrump; } - - // requeue the slideshow if any image slides are not yet loaded - if (typeof(settings.advanced_requeueonimagenotloaded) !== 'undefined') { settings.opts.requeueOnImageNotLoaded = settings.advanced_requeueonimagenotloaded; } - - // ms delay for requeue - if (typeof(settings.advanced_requeuetimeout) !== 'undefined') { settings.opts.requeueTimeout = settings.advanced_requeuetimeout; } - - // class name used for the active pager link - if (typeof(settings.advanced_activepagerclass) !== 'undefined') { settings.opts.activePagerClass = settings.advanced_activepagerclass; } - - // callback fn invoked to update the active pager link (adds/removes activePagerClass style) - if (typeof(settings.advanced_updateactivepagerlink) !== 'undefined') { settings.opts.updateActivePagerLink = eval(settings.advanced_updateactivepagerlink); } $(settings.targetId).cycle(settings.opts); Index: contrib/views_slideshow_cycle/theme/views_slideshow_cycle.theme.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/views_slideshow/contrib/views_slideshow_cycle/theme/Attic/views_slideshow_cycle.theme.inc,v retrieving revision 1.1.2.4 diff -u -p -r1.1.2.4 views_slideshow_cycle.theme.inc --- contrib/views_slideshow_cycle/theme/views_slideshow_cycle.theme.inc 15 Dec 2010 20:23:21 -0000 1.1.2.4 +++ contrib/views_slideshow_cycle/theme/views_slideshow_cycle.theme.inc 28 Dec 2010 02:00:28 -0000 @@ -40,15 +40,6 @@ function template_preprocess_views_slide $new_settings[$key] = $value; } - - // Remove any unused advanced settings. - foreach ($settings as $key => $value) { - if (substr($key, 0, 13) == 'advanced_use_' && !$value) { - $setting_name = str_replace('advanced_use_', '', $key); - unset($new_settings[$key]); - unset($new_settings['advanced_' . $setting_name]); - } - } $settings = array_merge( array(