1(function ($) { 2 3 /** 4 * Get the total displacement of given region. 5 * 6 * @param region 7 * Region name. Either "top" or "bottom". 8 * 9 * @return 10 * The total displacement of given region in pixels. 11 */ 12 if (Drupal.overlay) { 13 Drupal.overlay.getDisplacement = function (region) { 14 var displacement = 0; 15 var lastDisplaced = $('.overlay-displace-' + region + ':last'); 16 if (lastDisplaced.length) { 17 displacement = lastDisplaced.offset().top + lastDisplaced.outerHeight(); 18 19 // In modern browsers (including IE9), when box-shadow is defined, use the 20 // normal height. 21 var cssBoxShadowValue = lastDisplaced.css('box-shadow'); 22 var boxShadow = (typeof cssBoxShadowValue !== 'undefined' && cssBoxShadowValue !== 'none'); 23 // In IE8 and below, we use the shadow filter to apply box-shadow styles to 24 // the toolbar. It adds some extra height that we need to remove. 25 if (!boxShadow && /DXImageTransform\.Microsoft\.Shadow/.test(lastDisplaced.css('filter'))) { 26 displacement -= lastDisplaced[0].filters.item('DXImageTransform.Microsoft.Shadow').strength; 27 displacement = Math.max(0, displacement); 28 } 29 } 30 return displacement; 31 }; 32 }; 33 34})(jQuery); 35; 36Drupal.settings.spotlight_settings = Drupal.settings.spotlight_settings || {}; 37 38(function ($) { 39 40 /** 41 * Form behavior for Spotlight 42 */ 43 Drupal.behaviors.panopolySpotlight = { 44 attach: function (context, settings) { 45 if ($('.field-name-field-basic-spotlight-items', context).length) { 46 $('.field-name-field-basic-spotlight-items', context).each(function() { 47 var rotation_time = $(this).find('.panopoly-spotlight-buttons-wrapper').data('rotation-time'), 48 $widget = $(this), 49 $slides = $widget.find('.panopoly-spotlight'), 50 $controls = $widget.find('.panopoly-spotlight-buttons-wrapper li'), 51 current = 0, 52 timer = null; 53 54 function start() { 55 if (timer === null) { 56 timer = setTimeout(rotate, rotation_time); 57 } 58 } 59 60 function stop() { 61 if (timer !== null) { 62 clearTimeout(timer); 63 timer = null; 64 } 65 } 66 67 function rotate() { 68 // Increment the current slide. 69 current++; 70 if (current >= $controls.length) { 71 current = 0; 72 } 73 74 // Click the control for the next slide. 75 $controls.eq(current).children('a').trigger('click.panopoly-widgets-spotlight'); 76 } 77 78 // Navigation is hidden by default, display it if JavaScript is enabled. 79 $widget.find('.panopoly-spotlight-buttons-wrapper').css('display', 'block'); 80 81 // Hide all the slides but the first one. 82 $slides.hide(); 83 $slides.eq(0).show(); 84 $controls.eq(0).addClass('active'); 85 86 // Bind the event for the slide numbers. 87 $controls.once('panopoly-spotlight').children('a').bind('click.panopoly-widgets-spotlight', function (event) { 88 var selector = $(this).attr('href'); 89 if (selector.indexOf('#') === 0) { 90 event.preventDefault(); 91 92 // Mark the slide number as active. 93 $controls.removeClass('active'); 94 $(this).parent().addClass('active'); 95 96 // Hide all slides but the selected one. 97 $slides.hide(); 98 $slides.filter(selector).show(); 99 100 // Start the timer over if it's running. 101 if (timer !== null) { 102 stop(); 103 start(); 104 } 105 106 return false; 107 } 108 }); 109 110 // Bind events to all the extra buttonts. 111 $widget.find('.panopoly-spotlight-pause-play').once('panopoly-spotlight').bind('click.panopoly-widgets-spotlight', function(event) { 112 event.preventDefault(); 113 if ($(this).hasClass('paused')) { 114 start(); 115 $(this).text(Drupal.t('Pause')); 116 $(this).removeClass('paused'); 117 } 118 else { 119 stop(); 120 $(this).text(Drupal.t('Play')); 121 $(this).addClass('paused'); 122 } 123 }); 124 if ($widget.find('.panopoly-spotlight-previous').length && $widget.find('.panopoly-spotlight-next').length) { 125 $widget.find('.panopoly-spotlight-previous').once('panopoly-spotlight').bind('click.panopoly-widgets-spotlight', function (event) { 126 event.preventDefault(); 127 $widget.find('.panopoly-spotlight-pause-play:not(.paused)').trigger('click.panopoly-widgets-spotlight'); 128 var activeControl = $($controls.filter('.active')); 129 130 if (activeControl.prev().length != 0) { 131 activeControl.prev().children('a').trigger('click.panopoly-widgets-spotlight'); 132 } 133 else { 134 $controls.last().children('a').trigger('click.panopoly-widgets-spotlight'); 135 } 136 }); 137 $widget.find('.panopoly-spotlight-next').once('panopoly-spotlight').bind('click.panopoly-widgets-spotlight', function (event) { 138 event.preventDefault(); 139 $widget.find('.panopoly-spotlight-pause-play:not(.paused)').trigger('click.panopoly-widgets-spotlight'); 140 var activeControl = $($controls.filter('.active')); 141 142 if (activeControl.next().length != 0) { 143 activeControl.next().children('a').trigger('click.panopoly-widgets-spotlight'); 144 } 145 else { 146 $controls.first().children('a').trigger('click.panopoly-widgets-spotlight'); 147 } 148 }); 149 } 150 151 start(); 152 }); 153 } 154 } 155 }; 156 157})(jQuery); 158;
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.