? contrib/views_slideshow_cycle/js/jquery.cycle.all.min.js
Index: views_slideshow.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views_slideshow/views_slideshow.module,v
retrieving revision 1.11.2.2.2.12.2.5
diff -u -p -r1.11.2.2.2.12.2.5 views_slideshow.module
--- views_slideshow.module 29 Dec 2010 00:49:13 -0000 1.11.2.2.2.12.2.5
+++ views_slideshow.module 1 Jan 2011 09:38:46 -0000
@@ -105,9 +105,9 @@ function views_slideshow_init() {
function views_slideshow_views_slideshow_js_method_register() {
return array(
- 'views_slideshow_pager_fields',
- 'views_slideshow_controls_text',
- 'views_slideshow_slide_counter',
+ 'viewsSlideshowPagerFields',
+ 'viewsSlideshowControlsText',
+ 'viewsSlideshowSlideCounter',
);
}
@@ -320,7 +320,7 @@ function views_slideshow_views_slideshow
$locations = array('top', 'bottom');
foreach ($locations as $location) {
foreach ($widgets as $widget_id => $widget_name) {
- $options['widgets']['contains'][$location]['contains'][$widget_id . '_enable'] = array('default' => 0);
+ $options['widgets']['contains'][$location]['contains'][$widget_id]['enable'] = array('default' => 0);
$options['widgets']['contains'][$location]['contains'][$widget_id]['contains']['weight'] = array('default' => 1);
}
}
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.2.9.2.7
diff -u -p -r1.1.2.1.2.9.2.7 views_slideshow_plugin_style_slideshow.inc
--- views_slideshow_plugin_style_slideshow.inc 21 Dec 2010 08:57:38 -0000 1.1.2.1.2.9.2.7
+++ views_slideshow_plugin_style_slideshow.inc 1 Jan 2011 09:38:46 -0000
@@ -112,7 +112,7 @@ class views_slideshow_plugin_style_slide
/**
* Widgets
*/
- $form['widgets'] = array(
+ $form['widgets_header'] = array(
'#value' => '
' . t('Widgets') . '
',
);
@@ -142,10 +142,10 @@ class views_slideshow_plugin_style_slide
foreach ($location as $location_id => $location_name) {
$widget_dependency = 'edit-style-options-widgets-' . $location_id . '-' . str_replace('_', '-', $widget_id);
// Use Widget Checkbox
- $form['widgets'][$location_id][$widget_id . '_enable'] = array(
+ $form['widgets'][$location_id][$widget_id]['enable'] = array(
'#type' => 'checkbox',
'#title' => t($widget_name),
- '#default_value' => $this->options['widgets'][$location_id][$widget_id . '_enable'],
+ '#default_value' => $this->options['widgets'][$location_id][$widget_id]['enable'],
'#description' => t('Should a !name be rendered at the !location of the slides.', array('!name' => $widget_name, '!location' => $location_name)),
);
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.11
diff -u -p -r1.1.2.11 views_slideshow_cycle.module
--- contrib/views_slideshow_cycle/views_slideshow_cycle.module 29 Dec 2010 04:43:08 -0000 1.1.2.11
+++ contrib/views_slideshow_cycle/views_slideshow_cycle.module 1 Jan 2011 09:38:46 -0000
@@ -82,6 +82,6 @@ function views_slideshow_cycle_help($pat
function views_slideshow_cycle_views_slideshow_js_method_register() {
return array(
- 'views_slideshow_cycle',
+ 'viewsSlideshowCycle',
);
}
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.17
diff -u -p -r1.1.2.17 views_slideshow_cycle.views_slideshow.inc
--- contrib/views_slideshow_cycle/views_slideshow_cycle.views_slideshow.inc 29 Dec 2010 04:43:08 -0000 1.1.2.17
+++ contrib/views_slideshow_cycle/views_slideshow_cycle.views_slideshow.inc 1 Jan 2011 09:38:46 -0000
@@ -369,6 +369,7 @@ function views_slideshow_cycle_views_sli
'#type' => 'select',
'#title' => t('Advanced Options'),
'#options' => $cycle_options,
+ '#process' => array('views_slideshow_cycle_form_options_js'),
);
$form['views_slideshow_cycle']['advanced_options_entry'] = array(
@@ -385,89 +386,14 @@ function views_slideshow_cycle_views_sli
$form['views_slideshow_cycle']['advanced_options_table'] = array(
'#value' => ''
);
-
- $form['views_slideshow_cycle']['advanced_options_js'] = array(
- '#value' => "
-
- "
- );
}
}
+function views_slideshow_cycle_form_options_js($element, &$form_state, &$form) {
+ drupal_add_js(drupal_get_path('module', 'views_slideshow_cycle') . '/js/formoptions.js');
+ return $element;
+}
+
function views_slideshow_cycle_views_slideshow_options_form_validate(&$form, &$form_state, &$view) {
if (!is_numeric($form_state['values']['style_options']['views_slideshow_cycle']['speed'])) {
form_error($form['views_slideshow_cycle']['speed'], t('!setting must be numeric!', array('Speed')));
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.2
diff -u -p -r1.1.2.2 views_slideshow_cycle.js
--- contrib/views_slideshow_cycle/js/views_slideshow_cycle.js 29 Dec 2010 04:43:08 -0000 1.1.2.2
+++ contrib/views_slideshow_cycle/js/views_slideshow_cycle.js 1 Jan 2011 09:38:46 -0000
@@ -5,437 +5,441 @@
* A simple jQuery Cycle Div Slideshow Rotator.
*/
-/**
- * This will set our initial behavior, by starting up each individual slideshow.
- */
-Drupal.behaviors.viewsSlideshowCycle = function (context) {
- $('.views_slideshow_cycle_main:not(.viewsSlideshowCycle-processed)', context).addClass('viewsSlideshowCycle-processed').each(function() {
- var fullId = '#' + $(this).attr('id');
- var settings = Drupal.settings.viewsSlideshowCycle[fullId];
- settings.targetId = '#' + $(fullId + " :first").attr('id');
- settings.slideshowId = settings.targetId.replace('#views_slideshow_cycle_teaser_section_', '');
- settings.paused = false;
-
- settings.opts = {
- speed:settings.speed,
- timeout:settings.timeout,
- delay:settings.delay,
- sync:settings.sync,
- random:settings.random,
- nowrap:settings.nowrap,
- after:function(curr, next, opts) {
- // Need to do some special handling on first load.
- var slideNum = opts.currSlide;
- if (typeof settings.processedAfter == 'undefined' || !settings.processedAfter) {
- settings.processedAfter = 1;
- slideNum = (typeof settings.opts.startingSlide == 'undefined') ? 0 : settings.opts.startingSlide;
+(function ($) {
+
+ /**
+ * This will set our initial behavior, by starting up each individual slideshow.
+ */
+ Drupal.behaviors.viewsSlideshowCycle = function (context) {
+ $('.views_slideshow_cycle_main:not(.viewsSlideshowCycle-processed)', context).addClass('viewsSlideshowCycle-processed').each(function() {
+ var fullId = '#' + $(this).attr('id');
+ var settings = Drupal.settings.viewsSlideshowCycle[fullId];
+ settings.targetId = '#' + $(fullId + " :first").attr('id');
+ settings.slideshowId = settings.targetId.replace('#views_slideshow_cycle_teaser_section_', '');
+ settings.paused = false;
+
+ settings.opts = {
+ speed:settings.speed,
+ timeout:settings.timeout,
+ delay:settings.delay,
+ sync:settings.sync,
+ random:settings.random,
+ nowrap:settings.nowrap,
+ after:function(curr, next, opts) {
+ // Need to do some special handling on first load.
+ var slideNum = opts.currSlide;
+ if (typeof settings.processedAfter == 'undefined' || !settings.processedAfter) {
+ settings.processedAfter = 1;
+ slideNum = (typeof settings.opts.startingSlide == 'undefined') ? 0 : settings.opts.startingSlide;
+ }
+
+ Drupal.viewsSlideshow.transitionEnd(settings.slideshowId, '', slideNum);
+ },
+ before:function(curr, next, opts) {
+ // Remember last slide.
+ if (settings.remember_slide) {
+ createCookie(settings.vss_id, opts.currSlide + 1, settings.remember_slide_days);
+ }
+
+ // Make variable height.
+ if (!settings.fixed_height) {
+ //get the height of the current slide
+ var $ht = $(this).height();
+ //set the container's height to that of the current slide
+ $(this).parent().animate({height: $ht});
+ }
+
+ // Need to do some special handling on first load.
+ var slideNum = opts.nextSlide;
+ if (typeof settings.processedBefore == 'undefined' || !settings.processedBefore) {
+ settings.processedBefore = 1;
+ slideNum = (typeof settings.opts.startingSlide == 'undefined') ? 0 : settings.opts.startingSlide;
+ }
+
+ Drupal.viewsSlideshow.transitionBegin(settings.slideshowId, '', slideNum);
+ },
+ cleartype:(settings.cleartype)? true : false,
+ cleartypeNoBg:(settings.cleartypenobg)? true : false
+ }
+
+ // Set the starting slide if we are supposed to remember the slide
+ if (settings.remember_slide) {
+ var startSlide = readCookie(settings.vss_id);
+ if (startSlide == null) {
+ startSlide = 0;
}
-
- viewsSlideshowTransitionEnd(settings.slideshowId, '', slideNum);
- },
- before:function(curr, next, opts) {
- // Remember last slide.
- if (settings.remember_slide) {
- createCookie(settings.vss_id, opts.currSlide + 1, settings.remember_slide_days);
+ settings.opts.startingSlide = startSlide;
+ }
+
+ if (settings.effect == 'none') {
+ settings.opts.speed = 1;
+ }
+ else {
+ settings.opts.fx = settings.effect;
+ }
+
+ // Pause on hover.
+ if (settings.pause) {
+ $('#views_slideshow_cycle_teaser_section_' + settings.vss_id).hover(function() {
+ Drupal.viewsSlideshow.pause(settings.slideshowId, '');
+ }, function() {
+ if (!settings.paused) {
+ Drupal.viewsSlideshow.play(settings.slideshowId, '');
+ }
+ });
+ }
+
+ // Pause on clicking of the slide.
+ if (settings.pause_on_click) {
+ $('#views_slideshow_cycle_teaser_section_' + settings.vss_id).click(function() {
+ Drupal.viewsSlideshow.pause(settings.slideshowId, '');
+ });
+ }
+
+ 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]);
}
-
- // Make variable height.
- if (!settings.fixed_height) {
- //get the height of the current slide
- var $ht = $(this).height();
- //set the container's height to that of the current slide
- $(this).parent().animate({height: $ht});
+ else if (advancedOptions[option].toLowerCase() == 'true') {
+ advancedOptions[option] = true;
}
-
- // Need to do some special handling on first load.
- var slideNum = opts.nextSlide;
- if (typeof settings.processedBefore == 'undefined' || !settings.processedBefore) {
- settings.processedBefore = 1;
- slideNum = (typeof settings.opts.startingSlide == 'undefined') ? 0 : settings.opts.startingSlide;
+ else if (advancedOptions[option].toLowerCase() == 'false') {
+ advancedOptions[option] = false;
}
- viewsSlideshowTransitionBegin(settings.slideshowId, '', slideNum);
- },
- cleartype:(settings.cleartype)? true : false,
- cleartypeNoBg:(settings.cleartypenobg)? true : false
- }
-
- // Set the starting slide if we are supposed to remember the slide
- if (settings.remember_slide) {
- var startSlide = readCookie(settings.vss_id);
- if (startSlide == null) {
- startSlide = 0;
- }
- settings.opts.startingSlide = startSlide;
- }
-
- if (settings.effect == 'none') {
- settings.opts.speed = 1;
- }
- else {
- settings.opts.fx = settings.effect;
- }
-
- // Pause on hover.
- if (settings.pause) {
- $('#views_slideshow_cycle_teaser_section_' + settings.vss_id).hover(function() {
- viewsSlideshowPause(settings.slideshowId, '');
- }, function() {
- if (!settings.paused) {
- viewsSlideshowPlay(settings.slideshowId, '');
+ 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;
}
- });
- }
-
- // Pause on clicking of the slide.
- if (settings.pause_on_click) {
- $('#views_slideshow_cycle_teaser_section_' + settings.vss_id).click(function() {
- viewsSlideshowPause(settings.slideshowId, '');
- });
- }
-
- 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]);
}
- else if (advancedOptions[option].toLowerCase() == 'true') {
- advancedOptions[option] = true;
- }
- else if (advancedOptions[option].toLowerCase() == 'false') {
- advancedOptions[option] = false;
+
+
+ $(settings.targetId).cycle(settings.opts);
+
+ // Start Paused
+ if (settings.start_paused) {
+ Drupal.viewsSlideshow.pause(settings.slideshowId, '');
}
- 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]);
+ // Pause if hidden.
+ if (settings.pause_when_hidden) {
+ var checkPause = function(settings) {
+ // If the slideshow is visible and it is paused then resume.
+ // otherwise if the slideshow is not visible and it is not paused then
+ // pause it.
+ var visible = viewsSlideshowCycleIsVisible(settings.targetId, settings.pause_when_hidden_type, settings.amount_allowed_visible);
+ if (visible && settings.paused) {
+ Drupal.viewsSlideshow.play(settings.slideshowId, '');
}
- 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]);
+ else if (!visible && !settings.paused) {
+ Drupal.viewsSlideshow.pause(settings.slideshowId, '');
}
- break;
+ }
+
+ // Check when scrolled.
+ $(window).scroll(function() {
+ checkPause(settings);
+ });
+
+ // Check when the window is resized.
+ $(window).resize(function() {
+ checkPause(settings);
+ });
+ }Drupal.viewsSlideshowCycle = Drupal.viewsSlideshowCycle || {};
+ });
+ }
+
+ Drupal.viewsSlideshowCycle = Drupal.viewsSlideshowCycle || {};
+
+ Drupal.viewsSlideshowCycle.pause = function (slideshowID) {
+ $('#views_slideshow_cycle_teaser_section_' + slideshowID).cycle('pause');
+ }
+
+ Drupal.viewsSlideshowCycle.play = function (slideshowID) {
+ $('#views_slideshow_cycle_teaser_section_' + slideshowID).cycle('resume');
+ }
+
+ Drupal.viewsSlideshowCycle.previousSlide = function (slideshowID) {
+ $('#views_slideshow_cycle_teaser_section_' + slideshowID).cycle('prev');
+ }
+
+ Drupal.viewsSlideshowCycle.nextSlide = function (slideshowID) {
+ $('#views_slideshow_cycle_teaser_section_' + slideshowID).cycle('next');
+ }
+
+ Drupal.viewsSlideshowCycle.goToSlide = function (slideshowID, slideNum) {
+ $('#views_slideshow_cycle_teaser_section_' + slideshowID).cycle(slideNum);
+ }
+
+ // Verify that the value is a number.
+ function IsNumeric(sText) {
+ var ValidChars = "0123456789";
+ var IsNumber=true;
+ var Char;
+
+ for (var i=0; i < sText.length && IsNumber == true; i++) {
+ Char = sText.charAt(i);
+ if (ValidChars.indexOf(Char) == -1) {
+ IsNumber = false;
}
}
-
-
- $(settings.targetId).cycle(settings.opts);
-
- // Start Paused
- if (settings.start_paused) {
- viewsSlideshowPause(settings.slideshowId, '');
+ return IsNumber;
+ }
+
+ /**
+ * Cookie Handling Functions
+ */
+ function createCookie(name,value,days) {
+ if (days) {
+ var date = new Date();
+ date.setTime(date.getTime()+(days*24*60*60*1000));
+ var expires = "; expires="+date.toGMTString();
}
-
- // Pause if hidden.
- if (settings.pause_when_hidden) {
- var checkPause = function(settings) {
- // If the slideshow is visible and it is paused then resume.
- // otherwise if the slideshow is not visible and it is not paused then
- // pause it.
- var visible = viewsSlideshowCycleIsVisible(settings.targetId, settings.pause_when_hidden_type, settings.amount_allowed_visible);
- if (visible && settings.paused) {
- viewsSlideshowPlay(settings.slideshowId, '');
- }
- else if (!visible && !settings.paused) {
- viewsSlideshowPause(settings.slideshowId, '');
- }
+ else {
+ var expires = "";
+ }
+ document.cookie = name+"="+value+expires+"; path=/";
+ }
+
+ function readCookie(name) {
+ var nameEQ = name + "=";
+ var ca = document.cookie.split(';');
+ for(var i=0;i < ca.length;i++) {
+ var c = ca[i];
+ while (c.charAt(0)==' ') c = c.substring(1,c.length);
+ if (c.indexOf(nameEQ) == 0) {
+ return c.substring(nameEQ.length,c.length);
}
-
- // Check when scrolled.
- $(window).scroll(function() {
- checkPause(settings);
- });
-
- // Check when the window is resized.
- $(window).resize(function() {
- checkPause(settings);
- });
- }
- });
-}
-
-views_slideshow_cycle_viewsSlideshowPause = function (slideshowID) {
- $('#views_slideshow_cycle_teaser_section_' + slideshowID).cycle('pause');
-}
-
-views_slideshow_cycle_viewsSlideshowPlay = function (slideshowID) {
- $('#views_slideshow_cycle_teaser_section_' + slideshowID).cycle('resume');
-}
-
-views_slideshow_cycle_viewsSlideshowPreviousSlide = function (slideshowID) {
- $('#views_slideshow_cycle_teaser_section_' + slideshowID).cycle('prev');
-}
-
-views_slideshow_cycle_viewsSlideshowNextSlide = function (slideshowID) {
- $('#views_slideshow_cycle_teaser_section_' + slideshowID).cycle('next');
-}
-
-views_slideshow_cycle_viewsSlideshowGoToSlide = function (slideshowID, slideNum) {
- $('#views_slideshow_cycle_teaser_section_' + slideshowID).cycle(slideNum);
-}
-
-// Verify that the value is a number.
-function IsNumeric(sText) {
- var ValidChars = "0123456789";
- var IsNumber=true;
- var Char;
-
- for (var i=0; i < sText.length && IsNumber == true; i++) {
- Char = sText.charAt(i);
- if (ValidChars.indexOf(Char) == -1) {
- IsNumber = false;
- }
- }
- return IsNumber;
-}
-
-/**
- * Cookie Handling Functions
- */
-function createCookie(name,value,days) {
- if (days) {
- var date = new Date();
- date.setTime(date.getTime()+(days*24*60*60*1000));
- var expires = "; expires="+date.toGMTString();
- }
- else {
- var expires = "";
- }
- document.cookie = name+"="+value+expires+"; path=/";
-}
-
-function readCookie(name) {
- var nameEQ = name + "=";
- var ca = document.cookie.split(';');
- for(var i=0;i < ca.length;i++) {
- var c = ca[i];
- while (c.charAt(0)==' ') c = c.substring(1,c.length);
- if (c.indexOf(nameEQ) == 0) {
- return c.substring(nameEQ.length,c.length);
- }
- }
- return null;
-}
-
-function eraseCookie(name) {
- createCookie(name,"",-1);
-}
-
-/**
- * Checks to see if the slide is visible enough.
- * elem = element to check.
- * type = The way to calculate how much is visible.
- * amountVisible = amount that should be visible. Either in percent or px. If
- * it's not defined then all of the slide must be visible.
- *
- * Returns true or false
- */
-function viewsSlideshowCycleIsVisible(elem, type, amountVisible) {
- // Get the top and bottom of the window;
- var docViewTop = $(window).scrollTop();
- var docViewBottom = docViewTop + $(window).height();
- var docViewLeft = $(window).scrollLeft();
- var docViewRight = docViewLeft + $(window).width();
-
- // Get the top, bottom, and height of the slide;
- var elemTop = $(elem).offset().top;
- var elemHeight = $(elem).height();
- var elemBottom = elemTop + elemHeight;
- var elemLeft = $(elem).offset().left;
- var elemWidth = $(elem).width();
- var elemRight = elemLeft + elemWidth;
- var elemArea = elemHeight * elemWidth;
-
- // Calculate what's hiding in the slide.
- var missingLeft = 0;
- var missingRight = 0;
- var missingTop = 0;
- var missingBottom = 0;
-
- // Find out how much of the slide is missing from the left.
- if (elemLeft < docViewLeft) {
- missingLeft = docViewLeft - elemLeft;
- }
-
- // Find out how much of the slide is missing from the right.
- if (elemRight > docViewRight) {
- missingRight = elemRight - docViewRight;
- }
-
- // Find out how much of the slide is missing from the top.
- if (elemTop < docViewTop) {
- missingTop = docViewTop - elemTop;
- }
-
- // Find out how much of the slide is missing from the bottom.
- if (elemBottom > docViewBottom) {
- missingBottom = elemBottom - docViewBottom;
- }
-
- // If there is no amountVisible defined then check to see if the whole slide
- // is visible.
- if (type == 'full') {
- return ((elemBottom >= docViewTop) && (elemTop <= docViewBottom)
- && (elemBottom <= docViewBottom) && (elemTop >= docViewTop)
- && (elemLeft >= docViewLeft) && (elemRight <= docViewRight)
- && (elemLeft <= docViewRight) && (elemRight >= docViewLeft));
+ }
+ return null;
+ }
+
+ function eraseCookie(name) {
+ createCookie(name,"",-1);
}
- else if(type == 'vertical') {
- var verticalShowing = elemHeight - missingTop - missingBottom;
+
+ /**
+ * Checks to see if the slide is visible enough.
+ * elem = element to check.
+ * type = The way to calculate how much is visible.
+ * amountVisible = amount that should be visible. Either in percent or px. If
+ * it's not defined then all of the slide must be visible.
+ *
+ * Returns true or false
+ */
+ function viewsSlideshowCycleIsVisible(elem, type, amountVisible) {
+ // Get the top and bottom of the window;
+ var docViewTop = $(window).scrollTop();
+ var docViewBottom = docViewTop + $(window).height();
+ var docViewLeft = $(window).scrollLeft();
+ var docViewRight = docViewLeft + $(window).width();
+
+ // Get the top, bottom, and height of the slide;
+ var elemTop = $(elem).offset().top;
+ var elemHeight = $(elem).height();
+ var elemBottom = elemTop + elemHeight;
+ var elemLeft = $(elem).offset().left;
+ var elemWidth = $(elem).width();
+ var elemRight = elemLeft + elemWidth;
+ var elemArea = elemHeight * elemWidth;
+
+ // Calculate what's hiding in the slide.
+ var missingLeft = 0;
+ var missingRight = 0;
+ var missingTop = 0;
+ var missingBottom = 0;
- // If user specified a percentage then find out if the current shown percent
- // is larger than the allowed percent.
- // Otherwise check to see if the amount of px shown is larger than the
- // allotted amount.
- if (amountVisible.indexOf('%')) {
- return (((verticalShowing/elemHeight)*100) >= parseInt(amountVisible));
+ // Find out how much of the slide is missing from the left.
+ if (elemLeft < docViewLeft) {
+ missingLeft = docViewLeft - elemLeft;
}
- else {
- return (verticalShowing >= parseInt(amountVisible));
+
+ // Find out how much of the slide is missing from the right.
+ if (elemRight > docViewRight) {
+ missingRight = elemRight - docViewRight;
}
- }
- else if(type == 'horizontal') {
- var horizontalShowing = elemWidth - missingLeft - missingRight;
- // If user specified a percentage then find out if the current shown percent
- // is larger than the allowed percent.
- // Otherwise check to see if the amount of px shown is larger than the
- // allotted amount.
- if (amountVisible.indexOf('%')) {
- return (((horizontalShowing/elemWidth)*100) >= parseInt(amountVisible));
+ // Find out how much of the slide is missing from the top.
+ if (elemTop < docViewTop) {
+ missingTop = docViewTop - elemTop;
}
- else {
- return (horizontalShowing >= parseInt(amountVisible));
+
+ // Find out how much of the slide is missing from the bottom.
+ if (elemBottom > docViewBottom) {
+ missingBottom = elemBottom - docViewBottom;
}
- }
- else if(type == 'area') {
- var areaShowing = (elemWidth - missingLeft - missingRight) * (elemHeight - missingTop - missingBottom);
- // If user specified a percentage then find out if the current shown percent
- // is larger than the allowed percent.
- // Otherwise check to see if the amount of px shown is larger than the
- // allotted amount.
- if (amountVisible.indexOf('%')) {
- return (((areaShowing/elemArea)*100) >= parseInt(amountVisible));
+ // If there is no amountVisible defined then check to see if the whole slide
+ // is visible.
+ if (type == 'full') {
+ return ((elemBottom >= docViewTop) && (elemTop <= docViewBottom)
+ && (elemBottom <= docViewBottom) && (elemTop >= docViewTop)
+ && (elemLeft >= docViewLeft) && (elemRight <= docViewRight)
+ && (elemLeft <= docViewRight) && (elemRight >= docViewLeft));
}
- else {
- return (areaShowing >= parseInt(amountVisible));
+ else if(type == 'vertical') {
+ var verticalShowing = elemHeight - missingTop - missingBottom;
+
+ // If user specified a percentage then find out if the current shown percent
+ // is larger than the allowed percent.
+ // Otherwise check to see if the amount of px shown is larger than the
+ // allotted amount.
+ if (amountVisible.indexOf('%')) {
+ return (((verticalShowing/elemHeight)*100) >= parseInt(amountVisible));
+ }
+ else {
+ return (verticalShowing >= parseInt(amountVisible));
+ }
+ }
+ else if(type == 'horizontal') {
+ var horizontalShowing = elemWidth - missingLeft - missingRight;
+
+ // If user specified a percentage then find out if the current shown percent
+ // is larger than the allowed percent.
+ // Otherwise check to see if the amount of px shown is larger than the
+ // allotted amount.
+ if (amountVisible.indexOf('%')) {
+ return (((horizontalShowing/elemWidth)*100) >= parseInt(amountVisible));
+ }
+ else {
+ return (horizontalShowing >= parseInt(amountVisible));
+ }
+ }
+ else if(type == 'area') {
+ var areaShowing = (elemWidth - missingLeft - missingRight) * (elemHeight - missingTop - missingBottom);
+
+ // If user specified a percentage then find out if the current shown percent
+ // is larger than the allowed percent.
+ // Otherwise check to see if the amount of px shown is larger than the
+ // allotted amount.
+ if (amountVisible.indexOf('%')) {
+ return (((areaShowing/elemArea)*100) >= parseInt(amountVisible));
+ }
+ else {
+ return (areaShowing >= parseInt(amountVisible));
+ }
}
}
-}
-
+})(jQuery);
Index: js/views_slideshow.js
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views_slideshow/js/views_slideshow.js,v
retrieving revision 1.3.4.4
diff -u -p -r1.3.4.4 views_slideshow.js
--- js/views_slideshow.js 21 Dec 2010 23:26:48 -0000 1.3.4.4
+++ js/views_slideshow.js 1 Jan 2011 09:38:47 -0000
@@ -1,186 +1,195 @@
-Drupal.behaviors.viewsSlideshow = function (context) {
+(function ($) {
+ Drupal.viewsSlideshow = Drupal.viewsSlideshow || {};
- // Process previous link
- $('.views_slideshow_controls_text_previous:not(.views-slideshow-controls-text-previous-processed)', context).addClass('views-slideshow-controls-text-previous-processed').each(function() {
- var uniqueID = $(this).attr('id').replace('views_slideshow_controls_text_previous_', '');
- $(this).click(function() {
- viewsSlideshowPreviousSlide(uniqueID, '');
- return false;
+ Drupal.behaviors.viewsSlideshow = function (context) {
+ // Process previous link
+ $('.views_slideshow_controls_text_previous:not(.views-slideshow-controls-text-previous-processed)', context).addClass('views-slideshow-controls-text-previous-processed').each(function() {
+ var uniqueID = $(this).attr('id').replace('views_slideshow_controls_text_previous_', '');
+ $(this).click(function() {
+ Drupal.viewsSlideshow.previousSlide(uniqueID, '');
+ return false;
+ });
});
- });
-
- // Process next link
- $('.views_slideshow_controls_text_next:not(.views-slideshow-controls-text-next-processed)', context).addClass('views-slideshow-controls-text-next-processed').each(function() {
- var uniqueID = $(this).attr('id').replace('views_slideshow_controls_text_next_', '');
- $(this).click(function() {
- viewsSlideshowNextSlide(uniqueID, '');
- return false;
+
+ // Process next link
+ $('.views_slideshow_controls_text_next:not(.views-slideshow-controls-text-next-processed)', context).addClass('views-slideshow-controls-text-next-processed').each(function() {
+ var uniqueID = $(this).attr('id').replace('views_slideshow_controls_text_next_', '');
+ $(this).click(function() {
+ Drupal.viewsSlideshow.nextSlide(uniqueID, '');
+ return false;
+ });
});
- });
-
- // Process pause link
- $('.views_slideshow_controls_text_pause:not(.views-slideshow-controls-text-pause-processed)', context).addClass('views-slideshow-controls-text-pause-processed').each(function() {
- var uniqueID = $(this).attr('id').replace('views_slideshow_controls_text_pause_', '');
- $(this).click(function() {
- if (Drupal.settings.viewsSlideshow[uniqueID].paused) {
- viewsSlideshowPlay(uniqueID, '');
- }
- else {
- viewsSlideshowPause(uniqueID, '');
+
+ // Process pause link
+ $('.views_slideshow_controls_text_pause:not(.views-slideshow-controls-text-pause-processed)', context).addClass('views-slideshow-controls-text-pause-processed').each(function() {
+ var uniqueID = $(this).attr('id').replace('views_slideshow_controls_text_pause_', '');
+ $(this).click(function() {
+ if (Drupal.settings.viewsSlideshow[uniqueID].paused) {
+ Drupal.viewsSlideshow.play(uniqueID, '');
+ }
+ else {
+ Drupal.viewsSlideshow.pause(uniqueID, '');
+ }
+ return false;
+ });
+ });
+
+ // Process pause on hover for pager.
+ $('.views_slideshow_pager_field:not(.views-slideshow-pager-field-processed)', context).addClass('views-slideshow-pager-field-processed').each(function() {
+ // Parse out the location and unique id from the full id.
+ var pagerInfo = $(this).attr('id').split('_');
+ var location = pagerInfo[2];
+ pagerInfo.splice(0, 3);
+ var uniqueID = pagerInfo.join('_');
+
+ // Add the activate and pause on pager hover event to each pager item.
+ if (Drupal.settings.viewsSlideshowPagerFields[uniqueID][location].activatePauseOnHover) {
+ $(this).children().each(function(index, pagerItem) {
+ $(pagerItem).hover(function() {
+ Drupal.viewsSlideshow.goToSlide(uniqueID, '', index);
+ Drupal.viewsSlideshow.pause(uniqueID, '');
+ },
+ function() {
+ Drupal.viewsSlideshow.play(uniqueID, '');
+ });
+ });
}
- return false;
});
- });
+ }
+
+ Drupal.viewsSlideshowControlsText = Drupal.viewsSlideshowControlsText || {};
- // Process pause on hover for pager.
- $('.views_slideshow_pager_field:not(.views-slideshow-pager-field-processed)', context).addClass('views-slideshow-pager-field-processed').each(function() {
- // Parse out the location and unique id from the full id.
- var pagerInfo = $(this).attr('id').split('_');
- var location = pagerInfo[2];
- pagerInfo.splice(0, 3);
- var uniqueID = pagerInfo.join('_');
+ /**
+ * Implement hook_viewsSlideshowPause for text controls.
+ */
+ Drupal.viewsSlideshowControlsText.pause = function (slideshowID) {
+ var pauseText = Drupal.theme.prototype['viewsSlideshowControlsPause'] ? Drupal.theme('viewsSlideshowControlsPause') : '';
+ $('#views_slideshow_controls_text_pause_' + slideshowID).text(pauseText);
+ }
+
+ /**
+ * Implement hook_viewsSlideshowPlay for text controls.
+ */
+ Drupal.viewsSlideshowControlsText.play = function (slideshowID) {
+ var playText = Drupal.theme.prototype['viewsSlideshowControlsPlay'] ? Drupal.theme('viewsSlideshowControlsPlay') : '';
+ $('#views_slideshow_controls_text_pause_' + slideshowID).text(playText);
+ }
+
+ // Theme control pause.
+ Drupal.theme.prototype.viewsSlideshowControlsPause = function () {
+ return Drupal.t('Resume');
+ }
+
+ // Theme control pause.
+ Drupal.theme.prototype.viewsSlideshowControlsPlay = function () {
+ return Drupal.t('Pause');
+ }
+
+ Drupal.viewsSlideshowPagerFields = Drupal.viewsSlideshowPagerFields || {};
+
+ /**
+ * Implement hook_viewsSlidshowTransitionBegin for pager fields pager.
+ */
+ Drupal.viewsSlideshowPagerFields.transitionBegin = function (slideshowID, slideNum) {
+ // Remove active class from pagers
+ $('[id^="views_slideshow_pager_field_item_' + slideshowID + '"]').removeClass('active');
- // Add the activate and pause on pager hover event to each pager item.
- if (Drupal.settings.viewsSlideshowPagerFields[uniqueID][location].activatePauseOnHover) {
- $(this).children().each(function(index, pagerItem) {
- $(pagerItem).hover(function() {
- viewsSlideshowGoToSlide(uniqueID, '', index);
- viewsSlideshowPause(uniqueID, '');
- },
- function() {
- viewsSlideshowPlay(uniqueID, '');
- });
- });
+ // Add active class to active pager.
+ $('#views_slideshow_pager_field_item_' + slideshowID + '_' + slideNum).addClass('active');
+ }
+
+ Drupal.viewsSlideshowSlideCounter = Drupal.viewsSlideshowSlideCounter || {};
+
+ /**
+ * Implement hook_viewsSlidshowTransitionBegin for pager fields pager.
+ */
+ Drupal.viewsSlideshowSlideCounter.transitionBegin = function (slideshowID, slideNum) {
+ $('#views_slideshow_slide_counter_' + slideshowID + ' .num').text(slideNum + 1);
+ }
+
+ /**
+ * Call this function to pause the slideshow.
+ */
+ Drupal.viewsSlideshow.pause = function (slideshowID, callingMethod) {
+ Drupal.settings.viewsSlideshow[slideshowID].paused = 1;
+ var methods = Drupal.settings.viewsSlideshow[slideshowID]['methods'];
+ for (i = 0; i < methods.length; i++) {
+ if (typeof Drupal[methods[i]].pause == 'function' && methods[i] != callingMethod) {
+ Drupal[methods[i]].pause(slideshowID);
+ }
+ }
+ }
+
+ /**
+ * Call this function to play the slideshow.
+ */
+ Drupal.viewsSlideshow.play = function (slideshowID, callingMethod) {
+ Drupal.settings.viewsSlideshow[slideshowID].paused = 0;
+ var methods = Drupal.settings.viewsSlideshow[slideshowID]['methods'];
+ for (i = 0; i < methods.length; i++) {
+ if (typeof Drupal[methods[i]].play == 'function' && methods[i] != callingMethod) {
+ Drupal[methods[i]].play(slideshowID);
+ }
+ }
+ }
+
+ /**
+ * Call this function to move the slideshow to the next slide.
+ */
+ Drupal.viewsSlideshow.nextSlide = function (slideshowID, callingMethod) {
+ var methods = Drupal.settings.viewsSlideshow[slideshowID]['methods'];
+ for (i = 0; i < methods.length; i++) {
+ if (typeof Drupal[methods[i]].nextSlide == 'function' && methods[i] != callingMethod) {
+ Drupal[methods[i]].nextSlide(slideshowID);
+ }
+ }
+ }
+
+ /**
+ * Call this function to move the slideshow to the previous slide.
+ */
+ Drupal.viewsSlideshow.previousSlide = function (slideshowID, callingMethod) {
+ var methods = Drupal.settings.viewsSlideshow[slideshowID]['methods'];
+ for (i = 0; i < methods.length; i++) {
+ if (typeof Drupal[methods[i]].previousSlide == 'function' && methods[i] != callingMethod) {
+ Drupal[methods[i]].previousSlide(slideshowID);
+ }
}
- });
-}
-
-/**
- * Implement hook_viewsSlideshowPause for text controls.
- */
-function views_slideshow_controls_text_viewsSlideshowPause(slideshowID) {
- var pauseText = Drupal.theme.prototype['viewsSlideshowControlsPause'] ? Drupal.theme('viewsSlideshowControlsPause') : '';
- $('#views_slideshow_controls_text_pause_' + slideshowID).text(pauseText);
-}
-
-/**
- * Implement hook_viewsSlideshowPlay for text controls.
- */
-function views_slideshow_controls_text_viewsSlideshowPlay(slideshowID) {
- var playText = Drupal.theme.prototype['viewsSlideshowControlsPlay'] ? Drupal.theme('viewsSlideshowControlsPlay') : '';
- $('#views_slideshow_controls_text_pause_' + slideshowID).text(playText);
-}
-
-// Theme control pause.
-Drupal.theme.prototype.viewsSlideshowControlsPause = function () {
- return Drupal.t('Resume');
-}
-
-// Theme control pause.
-Drupal.theme.prototype.viewsSlideshowControlsPlay = function () {
- return Drupal.t('Pause');
-}
-
-/**
- * Implement hook_viewsSlidshowTransitionBegin for pager fields pager.
- */
-function views_slideshow_pager_fields_viewsSlideshowTransitionBegin(slideshowID, slideNum) {
- // Remove active class from pagers
- $('[id^="views_slideshow_pager_field_item_' + slideshowID + '"]').removeClass('active');
-
- // Add active class to active pager.
- $('#views_slideshow_pager_field_item_' + slideshowID + '_' + slideNum).addClass('active');
-}
-
-/**
- * Implement hook_viewsSlidshowTransitionBegin for pager fields pager.
- */
-function views_slideshow_slide_counter_viewsSlideshowTransitionBegin(slideshowID, slideNum) {
- $('#views_slideshow_slide_counter_' + slideshowID + ' .num').text(slideNum + 1);
-}
-
-/**
- * Call this function to pause the slideshow.
- */
-viewsSlideshowPause = function (slideshowID, callingMethod) {
- Drupal.settings.viewsSlideshow[slideshowID].paused = 1;
- var methods = Drupal.settings.viewsSlideshow[slideshowID]['methods'];
- for (i = 0; i < methods.length; i++) {
- if (typeof window[methods[i] + '_viewsSlideshowPause'] == 'function' && methods[i] != callingMethod) {
- window[methods[i] + '_viewsSlideshowPause'](slideshowID);
- }
- }
-}
-
-/**
- * Call this function to play the slideshow.
- */
-viewsSlideshowPlay = function (slideshowID, callingMethod) {
- Drupal.settings.viewsSlideshow[slideshowID].paused = 0;
- var methods = Drupal.settings.viewsSlideshow[slideshowID]['methods'];
- for (i = 0; i < methods.length; i++) {
- if (typeof window[methods[i] + '_viewsSlideshowPlay'] == 'function' && methods[i] != callingMethod) {
- window[methods[i] + '_viewsSlideshowPlay'](slideshowID);
- }
- }
-}
-
-/**
- * Call this function to move the slideshow to the next slide.
- */
-viewsSlideshowNextSlide = function (slideshowID, callingMethod) {
- var methods = Drupal.settings.viewsSlideshow[slideshowID]['methods'];
- for (i = 0; i < methods.length; i++) {
- if (typeof window[methods[i] + '_viewsSlideshowNextSlide'] == 'function' && methods[i] != callingMethod) {
- window[methods[i] + '_viewsSlideshowNextSlide'](slideshowID);
- }
- }
-}
-
-/**
- * Call this function to move the slideshow to the previous slide.
- */
-viewsSlideshowPreviousSlide = function (slideshowID, callingMethod) {
- var methods = Drupal.settings.viewsSlideshow[slideshowID]['methods'];
- for (i = 0; i < methods.length; i++) {
- if (typeof window[methods[i] + '_viewsSlideshowPreviousSlide'] == 'function' && methods[i] != callingMethod) {
- window[methods[i] + '_viewsSlideshowPreviousSlide'](slideshowID);
- }
- }
-}
-
-/**
- * Call this function to go to a specific slide number.
- */
-viewsSlideshowGoToSlide = function (slideshowID, callingMethod, slideNum) {
- var methods = Drupal.settings.viewsSlideshow[slideshowID]['methods'];
- for (i = 0; i < methods.length; i++) {
- if (typeof window[methods[i] + '_viewsSlideshowGoToSlide'] == 'function' && methods[i] != callingMethod) {
- window[methods[i] + '_viewsSlideshowGoToSlide'](slideshowID, slideNum);
- }
- }
-}
-
-/**
- * Call this function when the slideshow transition begins.
- */
-viewsSlideshowTransitionBegin = function (slideshowID, callingMethod, slideNum) {
- var methods = Drupal.settings.viewsSlideshow[slideshowID]['methods'];
- for (i = 0; i < methods.length; i++) {
- if (typeof window[methods[i] + '_viewsSlideshowTransitionBegin'] == 'function' && methods[i] != callingMethod) {
- window[methods[i] + '_viewsSlideshowTransitionBegin'](slideshowID, slideNum);
- }
- }
-}
-
-/**
- * Call this function when the slideshow transition ends.
- */
-function viewsSlideshowTransitionEnd(slideshowID, callingMethod, slideToNum) {
- var methods = Drupal.settings.viewsSlideshow[slideshowID]['methods'];
- for (i = 0; i < methods.length; i++) {
- if (typeof window[methods[i] + '_viewsSlideshowTransitionEnd'] == 'function' && methods[i] != callingMethod) {
- window[methods[i] + '_viewsSlideshowTransitionEnd'](slideshowID, slideToNum);
+ }
+
+ /**
+ * Call this function to go to a specific slide number.
+ */
+ Drupal.viewsSlideshow.goToSlide = function (slideshowID, callingMethod, slideNum) {
+ var methods = Drupal.settings.viewsSlideshow[slideshowID]['methods'];
+ for (i = 0; i < methods.length; i++) {
+ if (typeof Drupal[methods[i]].goToSlide == 'function' && methods[i] != callingMethod) {
+ Drupal[methods[i]].goToSlide(slideshowID, slideNum);
+ }
+ }
+ }
+
+ /**
+ * Call this function when the slideshow transition begins.
+ */
+ Drupal.viewsSlideshow.transitionBegin = function (slideshowID, callingMethod, slideNum) {
+ var methods = Drupal.settings.viewsSlideshow[slideshowID]['methods'];
+ for (i = 0; i < methods.length; i++) {
+ if (typeof Drupal[methods[i]].transitionBegin == 'function' && methods[i] != callingMethod) {
+ Drupal[methods[i]].transitionBegin(slideshowID, slideNum);
+ }
+ }
+ }
+
+ /**
+ * Call this function when the slideshow transition ends.
+ */
+ Drupal.viewsSlideshow.transitionEnd = function (slideshowID, callingMethod, slideToNum) {
+ var methods = Drupal.settings.viewsSlideshow[slideshowID]['methods'];
+ for (i = 0; i < methods.length; i++) {
+ if (typeof Drupal[methods[i]].transitionEnd == 'function' && methods[i] != callingMethod) {
+ Drupal[methods[i]].transitionEnd(slideshowID, slideToNum);
+ }
}
}
-}
+})(jQuery);
Index: theme/views_slideshow.theme.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views_slideshow/theme/Attic/views_slideshow.theme.inc,v
retrieving revision 1.1.2.5
diff -u -p -r1.1.2.5 views_slideshow.theme.inc
--- theme/views_slideshow.theme.inc 29 Dec 2010 01:10:38 -0000 1.1.2.5
+++ theme/views_slideshow.theme.inc 1 Jan 2011 09:38:47 -0000
@@ -53,12 +53,12 @@ function template_preprocess_views_slide
foreach($widgets as $widget_id => $widget_name) {
// Put our widgets in the right location.
- if ($options['widgets']['top'][$widget_id . '_enable']) {
+ if ($options['widgets']['top'][$widget_id]['enable']) {
$widget_weight = ($options['widgets']['top'][$widget_id]['weight'] > count($widgets)) ? count($widgets) : $options['widgets']['top'][$widget_id]['weight'];
$weight['top'][$widget_weight][] = $widget_id;
}
- if ($options['widgets']['bottom'][$widget_id . '_enable']) {
+ if ($options['widgets']['bottom'][$widget_id]['enable']) {
$widget_weight = ($options['widgets']['bottom'][$widget_id]['weight'] > count($widgets)) ? count($widgets) : $options['widgets']['bottom'][$widget_id]['weight'];
$weight['bottom'][$widget_weight][] = $widget_id;
}
@@ -129,7 +129,7 @@ function template_preprocess_views_slide
drupal_add_js($js_vars, 'setting');
// Add our class to the wrapper.
- $vars['attributes']['class'] .= ' views_slideshow_pager_field';
+ $vars['attributes']['class'] = (isset($vars['attributes']['class'])) ? $vars['attributes']['class'] . ' views_slideshow_pager_field' : 'views_slideshow_pager_field';
// Render all the fields.
$vars['rendered_field_items'] = '';