Skip to content

Commit

Permalink
More fixes for issue #6 : for parity with D7.x-3.6 version.
Browse files Browse the repository at this point in the history
  • Loading branch information
Graham-72 committed Feb 23, 2017
1 parent fb6ddbb commit 8608804
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 9 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ the json2.js library, see http://javascript.crockford.com/jsmin.html
## Status
This port is working with the jQuery cycle library. It has not been
tested with the json2 library.
In release 1.x-3.2.1 some changes committed to the Drupal version 7.x-3.2
In release 1.x-3.2.2 some changes committed to the Drupal version up to 7.x-3.6
have been incorporated.

## Installation
Expand All @@ -38,8 +38,8 @@ This project is GPL v2 software. See the LICENSE.txt file in this directory for
## Current Maintainers

### For Drupal:
+ zhou xiukun (xiukun.zhou)
+ wangqizhong
+ Nick Wilde (NickWilde)
+ Vincent Bouchet (vbouchet)
+ Adam Moore (redndahead)
+ Richard Burford (psynaptic)

Expand Down
5 changes: 4 additions & 1 deletion contrib/views_slideshow_cycle/js/views_slideshow_cycle.js
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,10 @@
Backdrop.viewsSlideshowCycle.advancedOptionCleanup = function(value) {
value = $.trim(value);
value = value.replace(/\n/g, '');
if (!isNaN(parseInt(value))) {
if (value.match(/^[\d.]+%$/)) {
// noop
}
else if (!isNaN(parseInt(value))) {
value = parseInt(value);
}
else if (value.toLowerCase() == 'true') {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<div id="views_slideshow_cycle_div_<?php print $variables['vss_id']; ?>_<?php print $variables['count']; ?>" class="<?php print implode(' ',$classes); ?>">
<div id="views_slideshow_cycle_div_<?php print $variables['vss_id']; ?>_<?php print $variables['count']; ?>" class="<?php print implode(' ',$classes); ?>" <?php print $aria; ?>>
<?php print $rendered_items; ?>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,22 @@ function _views_slideshow_cycle_preprocess_views_slideshow_cycle_main_frame(&$va

$vars['items_per_slide'] = $items_per_slide;

//backdrop_set_message(var_export($vars['options']['widgets'],TRUE));
$widgets = $vars['options']['widgets'];
if (isset($options['top']['views_slideshow_pager']['enabled']) && $options['top']['views_slideshow_pager']['enabled']) {
$aria = "aria-labelledby='views_slideshow_pager_field_item_top_${vss_id}_";
}
else {
$aria = "aria-labelledby='views_slideshow_pager_field_item_bottom_${vss_id}_";
}

$items = array();
$slideshow_count = 0;
$rendered_rows = '';
foreach ($rows as $count => $item) {
$items[] = $item;
if (count($items) == $items_per_slide || $count == (count($rows)-1)) {
$rendered_rows .= theme(views_theme_functions('views_slideshow_cycle_main_frame_row', $vars['view'], $vars['view']->display[$vars['view']->current_display]), array('vss_id' => $vss_id, 'items' => $items, 'count' => $slideshow_count, 'view' => $vars['view']));
$rendered_rows .= theme(views_theme_functions('views_slideshow_cycle_main_frame_row', $vars['view'], $vars['view']->display[$vars['view']->current_display]), array('vss_id' => $vss_id, 'items' => $items, 'count' => $slideshow_count, 'view' => $vars['view'], 'aria' => $aria . $slideshow_count . "'",));
$items = array();
$slideshow_count++;
}
Expand Down
8 changes: 7 additions & 1 deletion contrib/views_slideshow_cycle/views_slideshow_cycle.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@
.views_slideshow_cycle_hidden,
.views_slideshow_cycle_controls,
.views_slideshow_cycle_image_count {
display: none;
display: block;
}

.views-slideshow-cycle-main-frame,
.views-slideshow-cycle-main-frame div,
.views-slideshow-cycle-main-frame img {
max-width: 100%;
}

/* Pager Settings */
Expand Down
2 changes: 1 addition & 1 deletion theme/views-slideshow-pager-field-item.tpl.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<div id="views_slideshow_pager_field_item_<?php print $variables['location']; ?>_<?php print $variables['vss_id']; ?>_<?php print $variables['count']; ?>" class="<?php print implode(' ',$classes); ?>">
<div id="views_slideshow_pager_field_item_<?php print $variables['location']; ?>_<?php print $variables['vss_id']; ?>_<?php print $variables['count']; ?>" class="<?php print implode(' ',$classes); ?>" aria-controls="views_slideshow_cycle_div_<?php print $variables['vss_id']; ?>_<?php print $variables['count']; ?>">
<?php print $item; ?>
</div>
2 changes: 1 addition & 1 deletion theme/views_slideshow.theme.inc
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ function _views_slideshow_preprocess_views_slideshow(&$vars) {
/**
* Process Slideshow
*/
$slides = theme(views_theme_functions($main_frame_module . '_main_frame', $view, $view->display[$view->current_display]), array('vss_id' => $vss_id, 'view' => $view, 'settings' => $settings, 'rows' => $rows));
$slides = theme(views_theme_functions($main_frame_module . '_main_frame', $view, $view->display[$view->current_display]), array('vss_id' => $vss_id, 'view' => $view, 'settings' => $settings, 'rows' => $rows, 'options' => $options,));
$vars['slideshow'] = theme(views_theme_functions('views_slideshow_main_section', $view, $view->display[$view->current_display]), array('vss_id' => $vss_id, 'slides' => $slides, 'plugin' => $main_frame_module));
}
}
Expand Down

0 comments on commit 8608804

Please sign in to comment.