Version Description
- 2013-02-14
Download this release
Release Info
Developer | kosinix |
Plugin | Cyclone Slider |
Version | 2.2.3 |
Comparing to | |
See all releases |
Code changes from version 2.2.2 to 2.2.3
- README.txt +11 -1
- cyclone-slider.php +1 -1
- inc/admin-parts/slider-properties.php +11 -8
- inc/class-cyclone-slider.php +91 -55
- inc/class-nextgen-integration.php +2 -2
- js/admin.js +4 -1
- js/jquery.cycle2.carousel.min.js +2 -2
- js/jquery.cycle2.min.js +6 -6
README.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: http://www.codefleet.net/donate/
|
|
4 |
Tags: slider, slideshow, jquery, cycle 2, responsive, multilingual support, custom post, cyclone slider
|
5 |
Requires at least: 3.3.2
|
6 |
Tested up to: 3.5.1
|
7 |
-
Stable tag: 2.2.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -87,6 +87,11 @@ Inside your theme create a folder named "cycloneslider". Add your templates insi
|
|
87 |
|
88 |
== Changelog ==
|
89 |
|
|
|
|
|
|
|
|
|
|
|
90 |
= 2.2.2 - 2013-02-05 =
|
91 |
* Updated language files.
|
92 |
* Bug Fix. Post Type Switcher fix via jquery.
|
@@ -128,6 +133,11 @@ Inside your theme create a folder named "cycloneslider". Add your templates insi
|
|
128 |
|
129 |
== Upgrade Notice ==
|
130 |
|
|
|
|
|
|
|
|
|
|
|
131 |
= 2.2.2 - 2013-02-05 =
|
132 |
* Updated language files.
|
133 |
* Bug Fix. Post Type Switcher fix via jquery.
|
4 |
Tags: slider, slideshow, jquery, cycle 2, responsive, multilingual support, custom post, cyclone slider
|
5 |
Requires at least: 3.3.2
|
6 |
Tested up to: 3.5.1
|
7 |
+
Stable tag: 2.2.2
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
87 |
|
88 |
== Changelog ==
|
89 |
|
90 |
+
= 2.2.3 - 2013-02-14 =
|
91 |
+
* Added option for random slide order on every page visit.
|
92 |
+
* Refactored some code.
|
93 |
+
* Added image count to all slideshow screen.
|
94 |
+
|
95 |
= 2.2.2 - 2013-02-05 =
|
96 |
* Updated language files.
|
97 |
* Bug Fix. Post Type Switcher fix via jquery.
|
133 |
|
134 |
== Upgrade Notice ==
|
135 |
|
136 |
+
= 2.2.3 - 2013-02-14 =
|
137 |
+
* Added option for random slide order on every page visit.
|
138 |
+
* Refactored some code.
|
139 |
+
* Added image count to all slideshow screen.
|
140 |
+
|
141 |
= 2.2.2 - 2013-02-05 =
|
142 |
* Updated language files.
|
143 |
* Bug Fix. Post Type Switcher fix via jquery.
|
cyclone-slider.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Cyclone Slider 2
|
4 |
Plugin URI: http://www.codefleet.net/cyclone-slider-2/
|
5 |
Description: Create responsive slideshows with ease. Built for both developers and non-developers.
|
6 |
-
Version: 2.2.
|
7 |
Author: Nico Amarilla
|
8 |
Author URI: http://www.codefleet.net/
|
9 |
License:
|
3 |
Plugin Name: Cyclone Slider 2
|
4 |
Plugin URI: http://www.codefleet.net/cyclone-slider-2/
|
5 |
Description: Create responsive slideshows with ease. Built for both developers and non-developers.
|
6 |
+
Version: 2.2.3
|
7 |
Author: Nico Amarilla
|
8 |
Author URI: http://www.codefleet.net/
|
9 |
License:
|
inc/admin-parts/slider-properties.php
CHANGED
@@ -14,13 +14,6 @@
|
|
14 |
<span class="note"><?php _e('The number of tiles to use in the transition.', 'cycloneslider'); ?></span>
|
15 |
<div class="clear"></div>
|
16 |
<br />
|
17 |
-
<!--
|
18 |
-
<label for="cycloneslider_settings_tile_delay"><?php _e('Tile Delay:', 'cycloneslider'); ?> </label>
|
19 |
-
<input id="cycloneslider_settings_tile_delay" type="text" name="cycloneslider_settings[tile_delay]" value="<?php echo esc_attr($slider_settings['tile_delay']); ?>" />
|
20 |
-
<span class="note"><?php _e('The number of milliseconds to delay each individual tile transition.', 'cycloneslider'); ?></span>
|
21 |
-
<div class="clear"></div>
|
22 |
-
<br />
|
23 |
-
-->
|
24 |
<label for="cycloneslider_settings_tile_vertical"><?php _e('Tile Position:', 'cycloneslider'); ?> </label>
|
25 |
<select id="cycloneslider_settings_tile_vertical" name="cycloneslider_settings[tile_vertical]">
|
26 |
<option <?php echo ('true'==$slider_settings['tile_vertical']) ? 'selected="selected"' : ''; ?> value="true"><?php _e('Vertical', 'cycloneslider'); ?></option>
|
@@ -69,11 +62,21 @@
|
|
69 |
</select>
|
70 |
<div class="clear"></div>
|
71 |
</div>
|
72 |
-
<div class="cycloneslider-field
|
73 |
<label for="cycloneslider_settings_show_nav"><?php _e('Show Navigation?', 'cycloneslider'); ?></label>
|
74 |
<select id="cycloneslider_settings_show_nav" name="cycloneslider_settings[show_nav]">
|
75 |
<option <?php echo (1==$slider_settings['show_nav']) ? 'selected="selected"' : ''; ?> value="1"><?php _e('Yes', 'cycloneslider'); ?></option>
|
76 |
<option <?php echo (0==$slider_settings['show_nav']) ? 'selected="selected"' : ''; ?> value="0"><?php _e('No', 'cycloneslider'); ?></option>
|
77 |
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
<div class="clear"></div>
|
79 |
</div>
|
14 |
<span class="note"><?php _e('The number of tiles to use in the transition.', 'cycloneslider'); ?></span>
|
15 |
<div class="clear"></div>
|
16 |
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
<label for="cycloneslider_settings_tile_vertical"><?php _e('Tile Position:', 'cycloneslider'); ?> </label>
|
18 |
<select id="cycloneslider_settings_tile_vertical" name="cycloneslider_settings[tile_vertical]">
|
19 |
<option <?php echo ('true'==$slider_settings['tile_vertical']) ? 'selected="selected"' : ''; ?> value="true"><?php _e('Vertical', 'cycloneslider'); ?></option>
|
62 |
</select>
|
63 |
<div class="clear"></div>
|
64 |
</div>
|
65 |
+
<div class="cycloneslider-field">
|
66 |
<label for="cycloneslider_settings_show_nav"><?php _e('Show Navigation?', 'cycloneslider'); ?></label>
|
67 |
<select id="cycloneslider_settings_show_nav" name="cycloneslider_settings[show_nav]">
|
68 |
<option <?php echo (1==$slider_settings['show_nav']) ? 'selected="selected"' : ''; ?> value="1"><?php _e('Yes', 'cycloneslider'); ?></option>
|
69 |
<option <?php echo (0==$slider_settings['show_nav']) ? 'selected="selected"' : ''; ?> value="0"><?php _e('No', 'cycloneslider'); ?></option>
|
70 |
</select>
|
71 |
+
<span class="note"><?php _e('The thumbnails or dots depending on template.', 'cycloneslider'); ?></span>
|
72 |
+
<div class="clear"></div>
|
73 |
+
</div>
|
74 |
+
<div class="cycloneslider-field last">
|
75 |
+
<label for="cycloneslider_settings_randomize"><?php _e('Random Slide Order?', 'cycloneslider'); ?></label>
|
76 |
+
<select id="cycloneslider_settings_randomize" name="cycloneslider_settings[random]">
|
77 |
+
<option <?php echo (0==$slider_settings['random']) ? 'selected="selected"' : ''; ?> value="0"><?php _e('No', 'cycloneslider'); ?></option>
|
78 |
+
<option <?php echo (1==$slider_settings['random']) ? 'selected="selected"' : ''; ?> value="1"><?php _e('Yes', 'cycloneslider'); ?></option>
|
79 |
+
</select>
|
80 |
+
<span class="note"><?php _e('Randomize order of slides on every page visit.', 'cycloneslider'); ?></span>
|
81 |
<div class="clear"></div>
|
82 |
</div>
|
inc/class-cyclone-slider.php
CHANGED
@@ -11,36 +11,29 @@ if(!class_exists('Cyclone_Slider')):
|
|
11 |
function __construct() {
|
12 |
// Set defaults
|
13 |
$this->slider_count = 0;
|
14 |
-
$this->effects =
|
15 |
-
'fade'=>'Fade',
|
16 |
-
'fadeout'=>'Fade Out',
|
17 |
-
'none'=>'None',
|
18 |
-
'scrollHorz'=>'Scroll Horizontally',
|
19 |
-
'tileBlind'=>'Tile Blind',
|
20 |
-
'tileSlide'=>'Tile Slide'
|
21 |
-
);
|
22 |
$this->debug = false;
|
23 |
|
24 |
load_plugin_textdomain( 'cycloneslider', false, 'cyclone-slider-2/lang' );
|
25 |
|
26 |
// Register admin styles and scripts
|
27 |
-
add_action( 'admin_enqueue_scripts', array(
|
28 |
|
29 |
// Register frontend styles and scripts
|
30 |
-
add_action( 'wp_enqueue_scripts', array(
|
31 |
|
32 |
|
33 |
// Add admin menus
|
34 |
-
add_action( 'init', array(
|
35 |
|
36 |
// Update the messages for our custom post make it appropriate for slideshow
|
37 |
-
add_filter('post_updated_messages', array(
|
38 |
|
39 |
// Add slider metaboxes
|
40 |
-
add_action( 'add_meta_boxes', array(
|
41 |
|
42 |
// Save slides
|
43 |
-
add_action( 'save_post', array(
|
44 |
|
45 |
// Hacky way to change text in thickbox
|
46 |
add_filter( 'gettext', array( $this, 'replace_text_in_thickbox' ), 10, 3 );
|
@@ -78,7 +71,7 @@ if(!class_exists('Cyclone_Slider')):
|
|
78 |
//styles
|
79 |
wp_enqueue_style('thickbox');
|
80 |
|
81 |
-
wp_register_style( 'cycloneslider-admin-styles',
|
82 |
wp_enqueue_style( 'cycloneslider-admin-styles' );
|
83 |
|
84 |
//scripts
|
@@ -89,9 +82,9 @@ if(!class_exists('Cyclone_Slider')):
|
|
89 |
wp_enqueue_script('media-upload');
|
90 |
wp_enqueue_script('thickbox');
|
91 |
|
92 |
-
wp_register_script( 'jquery-cookie',
|
93 |
wp_enqueue_script( 'jquery-cookie' );
|
94 |
-
wp_register_script( 'cycloneslider-admin-script',
|
95 |
wp_enqueue_script( 'cycloneslider-admin-script' );
|
96 |
|
97 |
}
|
@@ -107,13 +100,13 @@ if(!class_exists('Cyclone_Slider')):
|
|
107 |
wp_enqueue_style( 'cyclone-slider-plugin-styles' );
|
108 |
|
109 |
/*** Scripts ***/
|
110 |
-
wp_register_script( 'cycle2',
|
111 |
wp_enqueue_script( 'cycle2' );
|
112 |
|
113 |
-
wp_register_script( 'cycle2-tile',
|
114 |
wp_enqueue_script( 'cycle2-tile' );
|
115 |
|
116 |
-
wp_register_script( 'cycle2-carousel',
|
117 |
wp_enqueue_script( 'cycle2-carousel' );
|
118 |
|
119 |
$cyclone_js= add_query_arg(array('cyclone_templates_js' => 1), home_url( '/' ));
|
@@ -174,7 +167,7 @@ if(!class_exists('Cyclone_Slider')):
|
|
174 |
add_meta_box(
|
175 |
'cyclone-slides-metabox',
|
176 |
__('Slides', 'cycloneslider'),
|
177 |
-
array(
|
178 |
'cycloneslider' ,
|
179 |
'normal',
|
180 |
'high'
|
@@ -182,7 +175,7 @@ if(!class_exists('Cyclone_Slider')):
|
|
182 |
add_meta_box(
|
183 |
'cyclone-slider-properties-metabox',
|
184 |
__('Slideshow Settings', 'cycloneslider'),
|
185 |
-
array(
|
186 |
'cycloneslider' ,
|
187 |
'side',
|
188 |
'low'
|
@@ -190,7 +183,7 @@ if(!class_exists('Cyclone_Slider')):
|
|
190 |
add_meta_box(
|
191 |
'cyclone-slider-templates-metabox',
|
192 |
__('Slideshow Templates', 'cycloneslider'),
|
193 |
-
array(
|
194 |
'cycloneslider' ,
|
195 |
'normal',
|
196 |
'low'
|
@@ -211,8 +204,8 @@ if(!class_exists('Cyclone_Slider')):
|
|
211 |
// Use nonce for verification
|
212 |
echo '<input type="hidden" name="cycloneslider_metabox_nonce" value="', wp_create_nonce(basename(__FILE__)), '" />';
|
213 |
|
214 |
-
$slider_settings =
|
215 |
-
$slider_metas =
|
216 |
|
217 |
if($this->debug){
|
218 |
echo '<pre>';
|
@@ -232,7 +225,7 @@ if(!class_exists('Cyclone_Slider')):
|
|
232 |
$image_url = apply_filters('cycloneslider_preview_url', $image_url, $slider_meta);
|
233 |
$box_title = apply_filters('cycloneslider_box_title', __('Slide', 'cycloneslider'), $slider_meta);
|
234 |
|
235 |
-
include(
|
236 |
endforeach;
|
237 |
|
238 |
endif;
|
@@ -247,7 +240,7 @@ if(!class_exists('Cyclone_Slider')):
|
|
247 |
// Use nonce for verification
|
248 |
echo '<input type="hidden" name="cycloneslider_metabox_nonce" value="', wp_create_nonce(basename(__FILE__)), '" />';
|
249 |
|
250 |
-
$slider_settings =
|
251 |
|
252 |
if($this->debug){
|
253 |
echo '<pre>';
|
@@ -255,14 +248,14 @@ if(!class_exists('Cyclone_Slider')):
|
|
255 |
echo '</pre>';
|
256 |
}
|
257 |
|
258 |
-
include(
|
259 |
}
|
260 |
|
261 |
function render_slider_templates_meta_box($post){
|
262 |
// Use nonce for verification
|
263 |
echo '<input type="hidden" name="cycloneslider_metabox_nonce" value="', wp_create_nonce(basename(__FILE__)), '" />';
|
264 |
|
265 |
-
$slider_settings =
|
266 |
|
267 |
$templates = $this->get_all_templates();
|
268 |
if($this->debug){
|
@@ -283,7 +276,7 @@ if(!class_exists('Cyclone_Slider')):
|
|
283 |
<?php
|
284 |
} else {
|
285 |
?>
|
286 |
-
<img src="<?php echo
|
287 |
<?php
|
288 |
}
|
289 |
?>
|
@@ -332,7 +325,7 @@ if(!class_exists('Cyclone_Slider')):
|
|
332 |
$this->save_settings($post_id);
|
333 |
|
334 |
|
335 |
-
remove_action( 'save_post', array(
|
336 |
}
|
337 |
|
338 |
//sanitize and save
|
@@ -343,7 +336,7 @@ if(!class_exists('Cyclone_Slider')):
|
|
343 |
|
344 |
$i=0;//always start from 0
|
345 |
foreach($_POST['cycloneslider_metas'] as $slide){
|
346 |
-
$slide = wp_parse_args($slide,
|
347 |
$slides[$i]['id'] = (int) ($slide['id']);
|
348 |
$slides[$i]['type'] = sanitize_text_field($slide['type']);
|
349 |
|
@@ -376,7 +369,7 @@ if(!class_exists('Cyclone_Slider')):
|
|
376 |
//sanitize and save
|
377 |
function save_settings($post_id){
|
378 |
if(isset($_POST['cycloneslider_settings'])){
|
379 |
-
$_POST['cycloneslider_settings'] = wp_parse_args($_POST['cycloneslider_settings'],
|
380 |
$settings = array();
|
381 |
$settings['template'] = sanitize_text_field($_POST['cycloneslider_settings']['template']);
|
382 |
$settings['fx'] = sanitize_text_field($_POST['cycloneslider_settings']['fx']);
|
@@ -390,6 +383,7 @@ if(!class_exists('Cyclone_Slider')):
|
|
390 |
$settings['tile_count'] = (int) ($_POST['cycloneslider_settings']['tile_count']);
|
391 |
$settings['tile_delay'] = (int) ($_POST['cycloneslider_settings']['tile_delay']);
|
392 |
$settings['tile_vertical'] = sanitize_text_field($_POST['cycloneslider_settings']['tile_vertical']);
|
|
|
393 |
|
394 |
$settings = apply_filters('cycloneslider_settings', $settings); //do filter before saving
|
395 |
|
@@ -423,6 +417,7 @@ if(!class_exists('Cyclone_Slider')):
|
|
423 |
function slideshow_columns($columns) {
|
424 |
$columns = array();
|
425 |
$columns['title']= __('Slideshow Name', 'cycloneslider');
|
|
|
426 |
$columns['id']= __('Slideshow ID', 'cycloneslider');
|
427 |
$columns['shortcode']= __('Shortcode', 'cycloneslider');
|
428 |
return $columns;
|
@@ -430,6 +425,9 @@ if(!class_exists('Cyclone_Slider')):
|
|
430 |
|
431 |
// Add content to custom columns
|
432 |
function custom_column( $column_name, $post_id ){
|
|
|
|
|
|
|
433 |
if ($column_name == 'id') {
|
434 |
$post = get_post($post_id);
|
435 |
echo $post->post_name;
|
@@ -451,7 +449,7 @@ if(!class_exists('Cyclone_Slider')):
|
|
451 |
$box_title = __('Slide', 'cycloneslider');
|
452 |
$image_url = '';
|
453 |
$i = '{id}';
|
454 |
-
$slider_meta =
|
455 |
foreach($slider_meta as $key=>$value){
|
456 |
$slider_meta[$key] = '';
|
457 |
}
|
@@ -459,7 +457,7 @@ if(!class_exists('Cyclone_Slider')):
|
|
459 |
?>
|
460 |
<div class="cycloneslider-box-template">
|
461 |
<?php
|
462 |
-
include(
|
463 |
?>
|
464 |
</div><!-- end .cycloneslider-box-template -->
|
465 |
<?php
|
@@ -494,7 +492,8 @@ if(!class_exists('Cyclone_Slider')):
|
|
494 |
'show_nav' => null,
|
495 |
'tile_count' => null,
|
496 |
'tile_delay' => null,
|
497 |
-
'tile_vertical' => null
|
|
|
498 |
),
|
499 |
$shortcode_settings
|
500 |
);
|
@@ -503,20 +502,27 @@ if(!class_exists('Cyclone_Slider')):
|
|
503 |
$cycle_options = array();
|
504 |
$this->slider_count++;//make each call to shortcode unique
|
505 |
// Get slideshow by id
|
506 |
-
$
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
'name'=> $slider_id
|
512 |
-
)
|
513 |
);
|
|
|
|
|
|
|
|
|
|
|
514 |
if($my_query->have_posts()):
|
515 |
while ( $my_query->have_posts() ) : $my_query->the_post();
|
516 |
|
517 |
$meta = get_post_custom();
|
518 |
-
$admin_settings =
|
519 |
-
$slider_metas =
|
|
|
|
|
|
|
|
|
520 |
|
521 |
foreach($slider_metas as $i=>$slider_meta){
|
522 |
$slider_metas[$i]['title'] = __($slider_meta['title']);
|
@@ -539,6 +545,8 @@ if(!class_exists('Cyclone_Slider')):
|
|
539 |
$slider_settings['tile_delay'] = $this->get_comp_slider_setting($admin_settings['tile_delay'], $shortcode_settings['tile_delay']);
|
540 |
$slider_settings['tile_vertical'] = $this->get_comp_slider_setting($admin_settings['tile_vertical'], $shortcode_settings['tile_vertical']);
|
541 |
|
|
|
|
|
542 |
$slider = $this->get_slider_template($slider_id, $template, $slides, $slider_metas, $slider_settings, $this->slider_count);
|
543 |
|
544 |
endwhile;
|
@@ -563,7 +571,7 @@ if(!class_exists('Cyclone_Slider')):
|
|
563 |
return $html = $this->trim_white_spaces($html);
|
564 |
}
|
565 |
|
566 |
-
$template =
|
567 |
if(@is_file($template)) {
|
568 |
ob_start();
|
569 |
include($template);
|
@@ -615,8 +623,8 @@ if(!class_exists('Cyclone_Slider')):
|
|
615 |
$ds = DIRECTORY_SEPARATOR;
|
616 |
header("Content-type: text/css");
|
617 |
|
618 |
-
if(file_exists(
|
619 |
-
echo file_get_contents(
|
620 |
}
|
621 |
|
622 |
$template_folders = $this->get_all_templates();
|
@@ -654,8 +662,8 @@ if(!class_exists('Cyclone_Slider')):
|
|
654 |
$ds = DIRECTORY_SEPARATOR;
|
655 |
$template_locations = array();
|
656 |
$template_locations[0] = array(
|
657 |
-
'path'=>
|
658 |
-
'url'=>
|
659 |
);
|
660 |
$template_locations[1] = array(
|
661 |
'path'=> realpath(get_stylesheet_directory())."{$ds}cycloneslider{$ds}",//this resides in the current theme or child theme
|
@@ -699,7 +707,7 @@ if(!class_exists('Cyclone_Slider')):
|
|
699 |
if(isset($meta['_cycloneslider_settings'][0]) and !empty($meta['_cycloneslider_settings'][0])){
|
700 |
$slideshow_settings = maybe_unserialize($meta['_cycloneslider_settings'][0]);
|
701 |
}
|
702 |
-
$slideshow_settings = wp_parse_args($slideshow_settings,
|
703 |
return apply_filters('cycloneslider_get_slideshow', $slideshow_settings);
|
704 |
}
|
705 |
|
@@ -714,7 +722,7 @@ if(!class_exists('Cyclone_Slider')):
|
|
714 |
|
715 |
if(isset($meta['_cycloneslider_metas'][0]) and !empty($meta['_cycloneslider_metas'][0])){
|
716 |
$slides = maybe_unserialize($meta['_cycloneslider_metas'][0]);
|
717 |
-
$defaults =
|
718 |
|
719 |
foreach($slides as $i=>$slide){
|
720 |
$slides[$i] = wp_parse_args($slide, $defaults);
|
@@ -743,7 +751,8 @@ if(!class_exists('Cyclone_Slider')):
|
|
743 |
'show_nav' => '1',
|
744 |
'tile_count' => '7',
|
745 |
'tile_delay' => '100',
|
746 |
-
'tile_vertical' => 'true'
|
|
|
747 |
);
|
748 |
}
|
749 |
|
@@ -772,6 +781,22 @@ if(!class_exists('Cyclone_Slider')):
|
|
772 |
);
|
773 |
}
|
774 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
775 |
/**
|
776 |
* Gets the path to plugin
|
777 |
*
|
@@ -796,7 +821,7 @@ if(!class_exists('Cyclone_Slider')):
|
|
796 |
* @return string Path to folder
|
797 |
*/
|
798 |
public static function get_admin_parts_folder(){
|
799 |
-
return
|
800 |
}
|
801 |
|
802 |
/**
|
@@ -805,8 +830,19 @@ if(!class_exists('Cyclone_Slider')):
|
|
805 |
* @return string Path to templates inside the plugin with trailing slash
|
806 |
*/
|
807 |
public static function get_templates_folder(){
|
808 |
-
return
|
809 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
810 |
} // end class
|
811 |
|
812 |
endif;
|
11 |
function __construct() {
|
12 |
// Set defaults
|
13 |
$this->slider_count = 0;
|
14 |
+
$this->effects = self::get_slide_effects();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
$this->debug = false;
|
16 |
|
17 |
load_plugin_textdomain( 'cycloneslider', false, 'cyclone-slider-2/lang' );
|
18 |
|
19 |
// Register admin styles and scripts
|
20 |
+
add_action( 'admin_enqueue_scripts', array( $this, 'register_admin_scripts' ), 10);
|
21 |
|
22 |
// Register frontend styles and scripts
|
23 |
+
add_action( 'wp_enqueue_scripts', array( $this, 'register_plugin_scripts' ), 100 );
|
24 |
|
25 |
|
26 |
// Add admin menus
|
27 |
+
add_action( 'init', array( $this, 'create_post_types' ) );
|
28 |
|
29 |
// Update the messages for our custom post make it appropriate for slideshow
|
30 |
+
add_filter('post_updated_messages', array( $this, 'post_updated_messages' ) );
|
31 |
|
32 |
// Add slider metaboxes
|
33 |
+
add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ) );
|
34 |
|
35 |
// Save slides
|
36 |
+
add_action( 'save_post', array( $this, 'save_post' ) );
|
37 |
|
38 |
// Hacky way to change text in thickbox
|
39 |
add_filter( 'gettext', array( $this, 'replace_text_in_thickbox' ), 10, 3 );
|
71 |
//styles
|
72 |
wp_enqueue_style('thickbox');
|
73 |
|
74 |
+
wp_register_style( 'cycloneslider-admin-styles', self::url().'css/admin.css' );
|
75 |
wp_enqueue_style( 'cycloneslider-admin-styles' );
|
76 |
|
77 |
//scripts
|
82 |
wp_enqueue_script('media-upload');
|
83 |
wp_enqueue_script('thickbox');
|
84 |
|
85 |
+
wp_register_script( 'jquery-cookie', self::url().'js/jquery-cookie.js' );
|
86 |
wp_enqueue_script( 'jquery-cookie' );
|
87 |
+
wp_register_script( 'cycloneslider-admin-script', self::url().'js/admin.js' );
|
88 |
wp_enqueue_script( 'cycloneslider-admin-script' );
|
89 |
|
90 |
}
|
100 |
wp_enqueue_style( 'cyclone-slider-plugin-styles' );
|
101 |
|
102 |
/*** Scripts ***/
|
103 |
+
wp_register_script( 'cycle2', self::url().'js/jquery.cycle2.min.js', array('jquery') );
|
104 |
wp_enqueue_script( 'cycle2' );
|
105 |
|
106 |
+
wp_register_script( 'cycle2-tile', self::url().'js/jquery.cycle2.tile.min.js', array('cycle2') );
|
107 |
wp_enqueue_script( 'cycle2-tile' );
|
108 |
|
109 |
+
wp_register_script( 'cycle2-carousel', self::url().'js/jquery.cycle2.carousel.min.js', array('cycle2') );
|
110 |
wp_enqueue_script( 'cycle2-carousel' );
|
111 |
|
112 |
$cyclone_js= add_query_arg(array('cyclone_templates_js' => 1), home_url( '/' ));
|
167 |
add_meta_box(
|
168 |
'cyclone-slides-metabox',
|
169 |
__('Slides', 'cycloneslider'),
|
170 |
+
array( $this, 'render_slides_meta_box' ),
|
171 |
'cycloneslider' ,
|
172 |
'normal',
|
173 |
'high'
|
175 |
add_meta_box(
|
176 |
'cyclone-slider-properties-metabox',
|
177 |
__('Slideshow Settings', 'cycloneslider'),
|
178 |
+
array( $this, 'render_slider_properties_meta_box' ),
|
179 |
'cycloneslider' ,
|
180 |
'side',
|
181 |
'low'
|
183 |
add_meta_box(
|
184 |
'cyclone-slider-templates-metabox',
|
185 |
__('Slideshow Templates', 'cycloneslider'),
|
186 |
+
array( $this, 'render_slider_templates_meta_box' ),
|
187 |
'cycloneslider' ,
|
188 |
'normal',
|
189 |
'low'
|
204 |
// Use nonce for verification
|
205 |
echo '<input type="hidden" name="cycloneslider_metabox_nonce" value="', wp_create_nonce(basename(__FILE__)), '" />';
|
206 |
|
207 |
+
$slider_settings = self::get_slideshow_settings($post->ID);
|
208 |
+
$slider_metas = self::get_slides($post->ID);
|
209 |
|
210 |
if($this->debug){
|
211 |
echo '<pre>';
|
225 |
$image_url = apply_filters('cycloneslider_preview_url', $image_url, $slider_meta);
|
226 |
$box_title = apply_filters('cycloneslider_box_title', __('Slide', 'cycloneslider'), $slider_meta);
|
227 |
|
228 |
+
include(self::get_admin_parts_folder().'box.php');
|
229 |
endforeach;
|
230 |
|
231 |
endif;
|
240 |
// Use nonce for verification
|
241 |
echo '<input type="hidden" name="cycloneslider_metabox_nonce" value="', wp_create_nonce(basename(__FILE__)), '" />';
|
242 |
|
243 |
+
$slider_settings = self::get_slideshow_settings($post->ID);
|
244 |
|
245 |
if($this->debug){
|
246 |
echo '<pre>';
|
248 |
echo '</pre>';
|
249 |
}
|
250 |
|
251 |
+
include(self::get_admin_parts_folder() . 'slider-properties.php');
|
252 |
}
|
253 |
|
254 |
function render_slider_templates_meta_box($post){
|
255 |
// Use nonce for verification
|
256 |
echo '<input type="hidden" name="cycloneslider_metabox_nonce" value="', wp_create_nonce(basename(__FILE__)), '" />';
|
257 |
|
258 |
+
$slider_settings = self::get_slideshow_settings($post->ID);
|
259 |
|
260 |
$templates = $this->get_all_templates();
|
261 |
if($this->debug){
|
276 |
<?php
|
277 |
} else {
|
278 |
?>
|
279 |
+
<img src="<?php echo self::url();?>images/screenshot.png" alt="" />
|
280 |
<?php
|
281 |
}
|
282 |
?>
|
325 |
$this->save_settings($post_id);
|
326 |
|
327 |
|
328 |
+
remove_action( 'save_post', array( $this, 'save_post' ) );
|
329 |
}
|
330 |
|
331 |
//sanitize and save
|
336 |
|
337 |
$i=0;//always start from 0
|
338 |
foreach($_POST['cycloneslider_metas'] as $slide){
|
339 |
+
$slide = wp_parse_args($slide, self::get_slide_defaults());
|
340 |
$slides[$i]['id'] = (int) ($slide['id']);
|
341 |
$slides[$i]['type'] = sanitize_text_field($slide['type']);
|
342 |
|
369 |
//sanitize and save
|
370 |
function save_settings($post_id){
|
371 |
if(isset($_POST['cycloneslider_settings'])){
|
372 |
+
$_POST['cycloneslider_settings'] = wp_parse_args($_POST['cycloneslider_settings'], self::get_slideshow_defaults());
|
373 |
$settings = array();
|
374 |
$settings['template'] = sanitize_text_field($_POST['cycloneslider_settings']['template']);
|
375 |
$settings['fx'] = sanitize_text_field($_POST['cycloneslider_settings']['fx']);
|
383 |
$settings['tile_count'] = (int) ($_POST['cycloneslider_settings']['tile_count']);
|
384 |
$settings['tile_delay'] = (int) ($_POST['cycloneslider_settings']['tile_delay']);
|
385 |
$settings['tile_vertical'] = sanitize_text_field($_POST['cycloneslider_settings']['tile_vertical']);
|
386 |
+
$settings['random'] = (int) ($_POST['cycloneslider_settings']['random']);
|
387 |
|
388 |
$settings = apply_filters('cycloneslider_settings', $settings); //do filter before saving
|
389 |
|
417 |
function slideshow_columns($columns) {
|
418 |
$columns = array();
|
419 |
$columns['title']= __('Slideshow Name', 'cycloneslider');
|
420 |
+
$columns['images']= __('Images', 'cycloneslider');
|
421 |
$columns['id']= __('Slideshow ID', 'cycloneslider');
|
422 |
$columns['shortcode']= __('Shortcode', 'cycloneslider');
|
423 |
return $columns;
|
425 |
|
426 |
// Add content to custom columns
|
427 |
function custom_column( $column_name, $post_id ){
|
428 |
+
if ($column_name == 'images') {
|
429 |
+
echo '<div style="text-align:center; max-width:40px;">' . count(self::get_image_count($post_id)) . '</div>';
|
430 |
+
}
|
431 |
if ($column_name == 'id') {
|
432 |
$post = get_post($post_id);
|
433 |
echo $post->post_name;
|
449 |
$box_title = __('Slide', 'cycloneslider');
|
450 |
$image_url = '';
|
451 |
$i = '{id}';
|
452 |
+
$slider_meta = self::get_slide_defaults();
|
453 |
foreach($slider_meta as $key=>$value){
|
454 |
$slider_meta[$key] = '';
|
455 |
}
|
457 |
?>
|
458 |
<div class="cycloneslider-box-template">
|
459 |
<?php
|
460 |
+
include(self::get_admin_parts_folder().'box.php');
|
461 |
?>
|
462 |
</div><!-- end .cycloneslider-box-template -->
|
463 |
<?php
|
492 |
'show_nav' => null,
|
493 |
'tile_count' => null,
|
494 |
'tile_delay' => null,
|
495 |
+
'tile_vertical' => null,
|
496 |
+
'random' => null
|
497 |
),
|
498 |
$shortcode_settings
|
499 |
);
|
502 |
$cycle_options = array();
|
503 |
$this->slider_count++;//make each call to shortcode unique
|
504 |
// Get slideshow by id
|
505 |
+
$args = array(
|
506 |
+
'post_type' => 'cycloneslider',
|
507 |
+
'order'=>'ASC',
|
508 |
+
'posts_per_page' => 1,
|
509 |
+
'name'=> $slider_id
|
|
|
|
|
510 |
);
|
511 |
+
|
512 |
+
$args = apply_filters('cycloneslider_wp_query_args', $args);
|
513 |
+
|
514 |
+
$my_query = new WP_Query($args);
|
515 |
+
|
516 |
if($my_query->have_posts()):
|
517 |
while ( $my_query->have_posts() ) : $my_query->the_post();
|
518 |
|
519 |
$meta = get_post_custom();
|
520 |
+
$admin_settings = self::get_slideshow_settings(get_the_ID());
|
521 |
+
$slider_metas = self::get_slides(get_the_ID());
|
522 |
+
|
523 |
+
if($admin_settings['random']){
|
524 |
+
shuffle($slider_metas);
|
525 |
+
}
|
526 |
|
527 |
foreach($slider_metas as $i=>$slider_meta){
|
528 |
$slider_metas[$i]['title'] = __($slider_meta['title']);
|
545 |
$slider_settings['tile_delay'] = $this->get_comp_slider_setting($admin_settings['tile_delay'], $shortcode_settings['tile_delay']);
|
546 |
$slider_settings['tile_vertical'] = $this->get_comp_slider_setting($admin_settings['tile_vertical'], $shortcode_settings['tile_vertical']);
|
547 |
|
548 |
+
$slider_settings['random'] = $this->get_comp_slider_setting($admin_settings['random'], $shortcode_settings['random']);
|
549 |
+
|
550 |
$slider = $this->get_slider_template($slider_id, $template, $slides, $slider_metas, $slider_settings, $this->slider_count);
|
551 |
|
552 |
endwhile;
|
571 |
return $html = $this->trim_white_spaces($html);
|
572 |
}
|
573 |
|
574 |
+
$template = self::get_templates_folder()."{$template_name}/slider.php";
|
575 |
if(@is_file($template)) {
|
576 |
ob_start();
|
577 |
include($template);
|
623 |
$ds = DIRECTORY_SEPARATOR;
|
624 |
header("Content-type: text/css");
|
625 |
|
626 |
+
if(file_exists(self::path()."css{$ds}common.css")){
|
627 |
+
echo file_get_contents(self::path()."css{$ds}common.css");
|
628 |
}
|
629 |
|
630 |
$template_folders = $this->get_all_templates();
|
662 |
$ds = DIRECTORY_SEPARATOR;
|
663 |
$template_locations = array();
|
664 |
$template_locations[0] = array(
|
665 |
+
'path'=>self::get_templates_folder(), //this resides in the plugin
|
666 |
+
'url'=>self::url().'templates/'
|
667 |
);
|
668 |
$template_locations[1] = array(
|
669 |
'path'=> realpath(get_stylesheet_directory())."{$ds}cycloneslider{$ds}",//this resides in the current theme or child theme
|
707 |
if(isset($meta['_cycloneslider_settings'][0]) and !empty($meta['_cycloneslider_settings'][0])){
|
708 |
$slideshow_settings = maybe_unserialize($meta['_cycloneslider_settings'][0]);
|
709 |
}
|
710 |
+
$slideshow_settings = wp_parse_args($slideshow_settings, self::get_slideshow_defaults() );
|
711 |
return apply_filters('cycloneslider_get_slideshow', $slideshow_settings);
|
712 |
}
|
713 |
|
722 |
|
723 |
if(isset($meta['_cycloneslider_metas'][0]) and !empty($meta['_cycloneslider_metas'][0])){
|
724 |
$slides = maybe_unserialize($meta['_cycloneslider_metas'][0]);
|
725 |
+
$defaults = self::get_slide_defaults();
|
726 |
|
727 |
foreach($slides as $i=>$slide){
|
728 |
$slides[$i] = wp_parse_args($slide, $defaults);
|
751 |
'show_nav' => '1',
|
752 |
'tile_count' => '7',
|
753 |
'tile_delay' => '100',
|
754 |
+
'tile_vertical' => 'true',
|
755 |
+
'random' => 0
|
756 |
);
|
757 |
}
|
758 |
|
781 |
);
|
782 |
}
|
783 |
|
784 |
+
/**
|
785 |
+
* Gets the slide effects.
|
786 |
+
*
|
787 |
+
* @return array The array of slide effects
|
788 |
+
*/
|
789 |
+
public static function get_slide_effects(){
|
790 |
+
return array(
|
791 |
+
'fade'=>'Fade',
|
792 |
+
'fadeout'=>'Fade Out',
|
793 |
+
'none'=>'None',
|
794 |
+
'scrollHorz'=>'Scroll Horizontally',
|
795 |
+
'tileBlind'=>'Tile Blind',
|
796 |
+
'tileSlide'=>'Tile Slide'
|
797 |
+
);
|
798 |
+
}
|
799 |
+
|
800 |
/**
|
801 |
* Gets the path to plugin
|
802 |
*
|
821 |
* @return string Path to folder
|
822 |
*/
|
823 |
public static function get_admin_parts_folder(){
|
824 |
+
return self::path() . 'inc'.DIRECTORY_SEPARATOR.'admin-parts'.DIRECTORY_SEPARATOR;
|
825 |
}
|
826 |
|
827 |
/**
|
830 |
* @return string Path to templates inside the plugin with trailing slash
|
831 |
*/
|
832 |
public static function get_templates_folder(){
|
833 |
+
return self::path() . 'templates'.DIRECTORY_SEPARATOR;
|
834 |
}
|
835 |
+
|
836 |
+
/**
|
837 |
+
* Gets the number of images of slideshow
|
838 |
+
*
|
839 |
+
* @return int Total images
|
840 |
+
*/
|
841 |
+
public static function get_image_count($id){
|
842 |
+
return self::get_slides($id);
|
843 |
+
}
|
844 |
+
|
845 |
+
|
846 |
} // end class
|
847 |
|
848 |
endif;
|
inc/class-nextgen-integration.php
CHANGED
@@ -12,7 +12,7 @@ if(!class_exists('Nextgen_Integration')):
|
|
12 |
function __construct() {
|
13 |
|
14 |
// Add metaboxes
|
15 |
-
add_action( 'add_meta_boxes', array(
|
16 |
|
17 |
// Append nextgen slides
|
18 |
add_filter('cycloneslider_slides', array($this, 'nextgen_slides'));
|
@@ -31,7 +31,7 @@ if(!class_exists('Nextgen_Integration')):
|
|
31 |
add_meta_box(
|
32 |
'cyclone-nextgen-metabox',
|
33 |
__('NextGEN Integration', 'cycloneslider'),
|
34 |
-
array(
|
35 |
'cycloneslider' ,
|
36 |
'normal',
|
37 |
'low'
|
12 |
function __construct() {
|
13 |
|
14 |
// Add metaboxes
|
15 |
+
add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ), 100 );
|
16 |
|
17 |
// Append nextgen slides
|
18 |
add_filter('cycloneslider_slides', array($this, 'nextgen_slides'));
|
31 |
add_meta_box(
|
32 |
'cyclone-nextgen-metabox',
|
33 |
__('NextGEN Integration', 'cycloneslider'),
|
34 |
+
array( $this, 'render_nextgen_meta_box' ),
|
35 |
'cycloneslider' ,
|
36 |
'normal',
|
37 |
'low'
|
js/admin.js
CHANGED
@@ -6,6 +6,7 @@ jQuery(document).ready(function($){
|
|
6 |
$('#misc-publishing-actions').hide();
|
7 |
$('.inline-edit-date').prev().hide();
|
8 |
|
|
|
9 |
$('#pts_post_type').html('<option value="cycloneslider">Cycloneslider</option>');
|
10 |
|
11 |
/*** Template Chooser ***/
|
@@ -96,7 +97,9 @@ jQuery(document).ready(function($){
|
|
96 |
$('.cycloneslider-field-body').each(function(i){
|
97 |
$(this).data('cycloneslider_id',i);
|
98 |
});
|
99 |
-
|
|
|
|
|
100 |
e.preventDefault();
|
101 |
});
|
102 |
|
6 |
$('#misc-publishing-actions').hide();
|
7 |
$('.inline-edit-date').prev().hide();
|
8 |
|
9 |
+
/*** Post type switcher quick fix ***/
|
10 |
$('#pts_post_type').html('<option value="cycloneslider">Cycloneslider</option>');
|
11 |
|
12 |
/*** Template Chooser ***/
|
97 |
$('.cycloneslider-field-body').each(function(i){
|
98 |
$(this).data('cycloneslider_id',i);
|
99 |
});
|
100 |
+
|
101 |
+
$(".cycloneslider_metas_enable_slide_effects").trigger('change');
|
102 |
+
|
103 |
e.preventDefault();
|
104 |
});
|
105 |
|
js/jquery.cycle2.carousel.min.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1 |
-
/*! Plugin for Cycle2; Copyright (c) 2012 M. Alsup; ver:
|
2 |
-
(function(a){"use strict",a(document).on("cycle-bootstrap",function(a,b,c){if(b.fx!=="carousel")return;c.getSlideIndex=function(a){var b=this.opts()._carouselWrap.children(),c=b.index(a);return c%b.length},c.next=function(){var a=b.reverse?-1:1;if(b.allowWrap===!1&&b.currSlide+a>b.slideCount-b.carouselVisible)return;b.API.advanceSlide(a),b.API.trigger("cycle-next",[b]).log("cycle-next")}}),a.fn.cycle.transitions.carousel={preInit:function(b){b.hideNonActive=!1,b.container.on("cycle-destroyed",a.proxy(this.onDestroy,b.API)),b.API.stopTransition=this.stopTransition;for(var c=0;c<b.startingSlide;c++)b.container.append(b.slides[0])},postInit:function(b){var c,d,e=b.carouselVertical;b.carouselVisible&&b.carouselVisible>b.slideCount&&(b.carouselVisible=b.slideCount-1);var f=b.carouselVisible||b.slides.length,g={display:e?"block":"inline-block",position:"static"};b.container.css({position:"relative",overflow:"hidden"}),b.slides.css(g),b._currSlide=b.currSlide,d=a('<div class="cycle-carousel-wrap"></div').prependTo(b.container).css({margin:0,padding:0,top:0,left:0,position:"absolute"}).append(b.slides),b._carouselWrap=d,e||d.css("white-space","nowrap"),b.allowWrap!==!1&&(b.slides.slice(0,b.slideCount).clone().css(g).appendTo(d),b.carouselVisible===undefined&&b.slides.slice(0,b.slideCount).clone().css(g).appendTo(d),b.slides.slice(0,b.slideCount).clone().css(g).prependTo(d),b.carouselVisible===undefined&&b.slides.slice(0,b.slideCount).clone().css(g).prependTo(d)),b.pager&&b.allowWrap===!1&&(c=b.slideCount-f,a(b.pager).children().filter(":gt("+c+")").hide()),b._nextBoundry=b.slideCount-b.carouselVisible,this.prepareDimensions(b)},prepareDimensions:function(b){var c,d,e,f,g=b.carouselVertical,h=b.carouselVisible||b.slides.length;b.carouselFluid&&b.carouselVisible?b._carouselResizeThrottle||this.fluidSlides(b):b.carouselVisible&&b.carouselSlideDimension?(c=h*b.carouselSlideDimension,b.container[g?"height":"width"](c)):b.carouselVisible&&(c=h*a(b.slides[0])[g?"outerHeight":"outerWidth"](!0),b.container[g?"height":"width"](c)),d=b.carouselOffset||0;if(b.allowWrap!==!1)if(b.carouselSlideDimension)d-=(b.slideCount+b.currSlide)*b.carouselSlideDimension;else{f=b._carouselWrap.children();for(var i=0;i<b.slideCount+b.currSlide;i++)d-=a(f[i])[g?"outerHeight":"outerWidth"](!0)}b._carouselWrap.css(g?"top":"left",d)},fluidSlides:function(b){function g(){clearTimeout(c),c=setTimeout(h,20)}function h(){b._carouselWrap.stop(!1,!0);var a=b.container.width()/b.carouselVisible;a=Math.ceil(a-e),b._carouselWrap.children().width(a),b._sentinel&&b._sentinel.width(a),f(b)}var c,d=b.slides.eq(0),e=d.outerWidth()-d.width(),f=this.prepareDimensions;a(window).on("resize",g),b._carouselResizeThrottle=g,h()},transition:function(b,c,d,e,f){var g,h={},i=b.nextSlide-b.currSlide,j=b.carouselVertical,k=b.speed;if(b.allowWrap===!1){e=i>0;var l=b._currSlide,m=b.slideCount-b.carouselVisible;i>0&&b.nextSlide>m&&l==m?i=0:i>0&&b.nextSlide>m?i=b.nextSlide-l-(b.nextSlide-m):i<0&&b.currSlide>m&&b.nextSlide>m?i=0:i<0&&b.currSlide>m?i+=b.currSlide-m:l=b.currSlide,g=this.getScroll(b,j,l,i),b.API.opts()._currSlide=b.nextSlide>m?m:b.nextSlide}else e&&b.nextSlide===0?(g=this.getDim(b,b.currSlide,j),f=this.genCallback(b,e,j,f)):!e&&b.nextSlide==b.slideCount-1?(g=this.getDim(b,b.currSlide,j),f=this.genCallback(b,e,j,f)):g=this.getScroll(b,j,b.currSlide,i);h[j?"top":"left"]=e?"-="+g:"+="+g,b.throttleSpeed&&(k=g/a(b.slides[0])[j?"height":"width"]()*b.speed),b._carouselWrap.animate(h,k,b.easing,f)},getDim:function(b,c,d){var e=a(b.slides[c]);return e[d?"outerHeight":"outerWidth"](!0)},getScroll:function(a,b,c,d){var e,f=0;if(d>0)for(e=c;e<c+d;e++)f+=this.getDim(a,e,b);else for(e=c;e>c+d;e--)f+=this.getDim(a,e,b);return f},genCallback:function(b,c,d,e){return function(){var c=a(b.slides[b.nextSlide]).position(),f=0-c[d?"top":"left"]
|
1 |
+
/*! Plugin for Cycle2; Copyright (c) 2012 M. Alsup; ver: 20130108 */
|
2 |
+
(function(a){"use strict",a(document).on("cycle-bootstrap",function(a,b,c){if(b.fx!=="carousel")return;c.getSlideIndex=function(a){var b=this.opts()._carouselWrap.children(),c=b.index(a);return c%b.length},c.next=function(){var a=b.reverse?-1:1;if(b.allowWrap===!1&&b.currSlide+a>b.slideCount-b.carouselVisible)return;b.API.advanceSlide(a),b.API.trigger("cycle-next",[b]).log("cycle-next")}}),a.fn.cycle.transitions.carousel={preInit:function(b){b.hideNonActive=!1,b.container.on("cycle-destroyed",a.proxy(this.onDestroy,b.API)),b.API.stopTransition=this.stopTransition;for(var c=0;c<b.startingSlide;c++)b.container.append(b.slides[0])},postInit:function(b){var c,d,e=b.carouselVertical;b.carouselVisible&&b.carouselVisible>b.slideCount&&(b.carouselVisible=b.slideCount-1);var f=b.carouselVisible||b.slides.length,g={display:e?"block":"inline-block",position:"static"};b.container.css({position:"relative",overflow:"hidden"}),b.slides.css(g),b._currSlide=b.currSlide,d=a('<div class="cycle-carousel-wrap"></div').prependTo(b.container).css({margin:0,padding:0,top:0,left:0,position:"absolute"}).append(b.slides),b._carouselWrap=d,e||d.css("white-space","nowrap"),b.allowWrap!==!1&&(b.slides.slice(0,b.slideCount).clone().css(g).appendTo(d),b.carouselVisible===undefined&&b.slides.slice(0,b.slideCount).clone().css(g).appendTo(d),b.slides.slice(0,b.slideCount).clone().css(g).prependTo(d),b.carouselVisible===undefined&&b.slides.slice(0,b.slideCount).clone().css(g).prependTo(d),d.find(".cycle-slide-active").removeClass("cycle-slide-active"),b.slides.eq(b.startingSlide).addClass("cycle-slide-active")),b.pager&&b.allowWrap===!1&&(c=b.slideCount-f,a(b.pager).children().filter(":gt("+c+")").hide()),b._nextBoundry=b.slideCount-b.carouselVisible,this.prepareDimensions(b)},prepareDimensions:function(b){var c,d,e,f,g=b.carouselVertical,h=b.carouselVisible||b.slides.length;b.carouselFluid&&b.carouselVisible?b._carouselResizeThrottle||this.fluidSlides(b):b.carouselVisible&&b.carouselSlideDimension?(c=h*b.carouselSlideDimension,b.container[g?"height":"width"](c)):b.carouselVisible&&(c=h*a(b.slides[0])[g?"outerHeight":"outerWidth"](!0),b.container[g?"height":"width"](c)),d=b.carouselOffset||0;if(b.allowWrap!==!1)if(b.carouselSlideDimension)d-=(b.slideCount+b.currSlide)*b.carouselSlideDimension;else{f=b._carouselWrap.children();for(var i=0;i<b.slideCount+b.currSlide;i++)d-=a(f[i])[g?"outerHeight":"outerWidth"](!0)}b._carouselWrap.css(g?"top":"left",d)},fluidSlides:function(b){function g(){clearTimeout(c),c=setTimeout(h,20)}function h(){b._carouselWrap.stop(!1,!0);var a=b.container.width()/b.carouselVisible;a=Math.ceil(a-e),b._carouselWrap.children().width(a),b._sentinel&&b._sentinel.width(a),f(b)}var c,d=b.slides.eq(0),e=d.outerWidth()-d.width(),f=this.prepareDimensions;a(window).on("resize",g),b._carouselResizeThrottle=g,h()},transition:function(b,c,d,e,f){var g,h={},i=b.nextSlide-b.currSlide,j=b.carouselVertical,k=b.speed;if(b.allowWrap===!1){e=i>0;var l=b._currSlide,m=b.slideCount-b.carouselVisible;i>0&&b.nextSlide>m&&l==m?i=0:i>0&&b.nextSlide>m?i=b.nextSlide-l-(b.nextSlide-m):i<0&&b.currSlide>m&&b.nextSlide>m?i=0:i<0&&b.currSlide>m?i+=b.currSlide-m:l=b.currSlide,g=this.getScroll(b,j,l,i),b.API.opts()._currSlide=b.nextSlide>m?m:b.nextSlide}else e&&b.nextSlide===0?(g=this.getDim(b,b.currSlide,j),f=this.genCallback(b,e,j,f)):!e&&b.nextSlide==b.slideCount-1?(g=this.getDim(b,b.currSlide,j),f=this.genCallback(b,e,j,f)):g=this.getScroll(b,j,b.currSlide,i);h[j?"top":"left"]=e?"-="+g:"+="+g,b.throttleSpeed&&(k=g/a(b.slides[0])[j?"height":"width"]()*b.speed),b._carouselWrap.animate(h,k,b.easing,f)},getDim:function(b,c,d){var e=a(b.slides[c]);return e[d?"outerHeight":"outerWidth"](!0)},getScroll:function(a,b,c,d){var e,f=0;if(d>0)for(e=c;e<c+d;e++)f+=this.getDim(a,e,b);else for(e=c;e>c+d;e--)f+=this.getDim(a,e,b);return f},genCallback:function(b,c,d,e){return function(){var c=a(b.slides[b.nextSlide]).position(),f=0-c[d?"top":"left"]+(b.carouselOffset||0);b._carouselWrap.css(b.carouselVertical?"top":"left",f),e()}},stopTransition:function(){var a=this.opts();a.slides.stop(!1,!0),a._carouselWrap.stop(!1,!0)},onDestroy:function(b){var c=this.opts();c._carouselResizeThrottle&&a(window).off("resize",c._carouselResizeThrottle),c.slides.prependTo(c.container),c._carouselWrap.remove()}}})(jQuery);
|
js/jquery.cycle2.min.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
-
/*!
|
2 |
-
* jQuery Cycle2; ver:
|
3 |
-
* http://jquery.malsup.com/cycle2/
|
4 |
-
* Copyright (c)
|
5 |
-
*/
|
6 |
-
(function(a){function c(){window.console&&console.log&&console.log("[cycle2] "+Array.prototype.join.call(arguments," "))}function d(a){return(a||"").toLowerCase()}"use strict";var b="20121219";a.fn.cycle=function(b){var e;return this.length===0&&!a.isReady?(e={s:this.selector,c:this.context},c("requeuing slideshow (dom not ready)"),a(function(){a(e.s,e.c).cycle(b)}),this):this.each(function(){var e,f,g,h,i=a(this);if(i.data("cycle.opts"))return;if(i.data("cycle-log")===!1||b&&b.log===!1||f&&f.log===!1)c=a.noop;c("--c2 init--"),e=i.data();for(var j in e)e.hasOwnProperty(j)&&/^cycle[A-Z]+/.test(j)&&(h=e[j],g=j.match(/^cycle(.*)/)[1].replace(/^[A-Z]/,d),c(g+":",h,"("+typeof h+")"),e[g]=h);f=a.extend({},a.fn.cycle.defaults,e,b||{}),f.timeoutId=0,f.paused=f.paused||!1,f.container=i,f._maxZ=f.maxZ,f.API=a.extend({_container:i},a.fn.cycle.API),f.API.log=c,f.API.trigger=function(a,b){return f.container.trigger(a,b),f.API},i.data("cycle.opts",f),i.data("cycle.API",f.API),f.API.trigger("cycle-bootstrap",[f,f.API]),f.API.addInitialSlides(),f.API.preInitSlideshow(),f.slides.length&&f.API.initSlideshow()})},a.fn.cycle.API={opts:function(){return this._container.data("cycle.opts")},addInitialSlides:function(){var b=this.opts(),c=b.slides;b.slideCount=0,b.slides=a(),c=c.jquery?c:b.container.find(c),b.random&&c.sort(function(){return Math.random()-.5}),b.API.add(c)},preInitSlideshow:function(){var b=this.opts();b.API.trigger("cycle-pre-initialize",[b]);var c=a.fn.cycle.transitions[b.fx];c&&a.isFunction(c.preInit)&&c.preInit(b),b._preInitialized=!0},postInitSlideshow:function(){var b=this.opts();b.API.trigger("cycle-post-initialize",[b]);var c=a.fn.cycle.transitions[b.fx];c&&a.isFunction(c.postInit)&&c.postInit(b)},initSlideshow:function(){var b=this.opts(),c=b.container;b.API.calcFirstSlide(),b.container.css("position")=="static"&&b.container.css("position","relative"),a(b.slides[b.currSlide]).css("opacity",1).show(),b.API.stackSlides(b.slides[b.currSlide],b.slides[b.nextSlide],!b.reverse),b.pauseOnHover&&(b.pauseOnHover!==!0&&(c=a(b.pauseOnHover)),c.hover(function(){b.hoverPaused=!0,b.paused||b.API.trigger("cycle-paused",[b])},function(){b.hoverPaused=!1,b.paused||b.API.trigger("cycle-resumed",[b])})),b.timeout&&(b.timeoutId=setTimeout(function(){b.API.prepareTx(!1,!b.reverse)},b.timeout+b.delay)),b._initialized=!0,b.API.updateView(!0),b.container.on("cycle-paused cycle-resumed",function(a){b.container[a.type==="cycle-paused"?"addClass":"removeClass"]("cycle-paused")}),b.API.trigger("cycle-initialized",[b]),b.API.postInitSlideshow()},add:function(b,c){var d=this.opts(),e=d.slideCount,f=!1,g;a(b).each(function(b){var e,f=a(this);c?d.container.prepend(f):d.container.append(f),d.slideCount++,e=d.API.buildSlideOpts(f),c?d.slides=a(f).add(d.slides):d.slides=d.slides.add(f),d.API.initSlide(e,f,--d._maxZ),f.data("cycle.opts",e),d.API.trigger("cycle-slide-added",[d,e,f])}),d.API.updateView(!0),f=d._preInitialized&&e<2&&d.slideCount>=1,f&&(d._initialized?d.timeout&&(g=d.slides.length,d.nextSlide=d.reverse?g-1:1):d.API.initSlideshow())},calcFirstSlide:function(){var a=this.opts(),b;b=parseInt(a.startingSlide||0,10);if(b>=a.slides.length||b<0)b=0;a.currSlide=b,a.reverse?(a.nextSlide=b-1,a.nextSlide<0&&(a.nextSlide=a.slides.length-1)):(a.nextSlide=b+1,a.nextSlide==a.slides.length&&(a.nextSlide=0))},calcNextSlide:function(){var a=this.opts(),b;a.reverse?(b=a.nextSlide-1<0,a.nextSlide=b?a.slideCount-1:a.nextSlide-1,a.currSlide=b?0:a.nextSlide+1):(b=a.nextSlide+1==a.slides.length,a.nextSlide=b?0:a.nextSlide+1,a.currSlide=b?a.slides.length-1:a.nextSlide-1)},calcTx:function(b,d){var e=b,f;return d&&e.manualFx&&(f=a.fn.cycle.transitions[e.manualFx]),f||(f=a.fn.cycle.transitions[e.fx]),f||(f=a.fn.cycle.transitions.fade,c('Transition "'+e.fx+'" not found. Using fade.')),f},prepareTx:function(a,b){var c=this.opts(),d,e,f,g,h;if(c.slideCount<2){c.timeoutId=0;return}a&&(c.API.stopTransition(),c.busy=!1,clearTimeout(c.timeoutId),c.timeoutId=0);if(c.busy)return;if(c.timeoutId===0&&!a)return;e=c.slides[c.currSlide],f=c.slides[c.nextSlide],g=c.API.getSlideOpts(c.nextSlide),h=c.API.calcTx(g,a),c._tx=h,a&&g.manualSpeed!==undefined&&(g.speed=g.manualSpeed),c.nextSlide!=c.currSlide&&(a||!c.paused&&!c.hoverPaused&&c.timeout)?(c.API.trigger("cycle-before",[g,e,f,b]),h.before&&h.before(g,e,f,b),d=function(){c.busy=!1,h.after&&h.after(g,e,f,b),c.API.trigger("cycle-after",[g,e,f,b]),c.API.queueTransition(g),c.API.updateView(!0)},c.busy=!0,h.transition?h.transition(g,e,f,b,d):c.API.doTransition(g,e,f,b,d),c.API.calcNextSlide(),c.updateView<0&&c.API.updateView()):c.API.queueTransition(g)},doTransition:function(b,c,d,e,f){var g=b,h=a(c),i=a(d),j=function(){i.animate(g.animIn||{opacity:1},g.speed,g.easeIn||g.easing,f)};i.css(g.cssBefore||{}),h.animate(g.animOut||{},g.speed,g.easeOut||g.easing,function(){h.css(g.cssAfter||{}),g.sync||j()}),g.sync&&j()},queueTransition:function(a){var b=this.opts();if(b.nextSlide===0&&--b.loop===0){b.API.log("terminating; loop=0"),b.timeout=0,b.API.trigger("cycle-finished",[b]),b.nextSlide=b.currSlide;return}a.timeout&&(b.timeoutId=setTimeout(function(){b.API.prepareTx(!1,!b.reverse)},a.timeout))},stopTransition:function(){var a=this.opts();a.slides.filter(":animated").length&&(a.slides.stop(!1,!0),a.API.trigger("cycle-transition-stopped",[a])),a._tx&&a._tx.stopTransition&&a._tx.stopTransition(a)},advanceSlide:function(a){var b=this.opts();return clearTimeout(b.timeoutId),b.timeoutId=0,b.nextSlide=b.currSlide+a,b.nextSlide<0?b.nextSlide=b.slides.length-1:b.nextSlide>=b.slides.length&&(b.nextSlide=0),b.API.prepareTx(!0,a>=0),!1},buildSlideOpts:function(b){var e=this.opts(),f,g,h=b.data()||{};for(var i in h)h.hasOwnProperty(i)&&/^cycle[A-Z]+/.test(i)&&(f=h[i],g=i.match(/^cycle(.*)/)[1].replace(/^[A-Z]/,d),c("["+(e.slideCount-1)+"]",g+":",f,"("+typeof f+")"),h[g]=f);h=a.extend({},a.fn.cycle.defaults,e,h),h.slideNum=e.slideCount;try{delete h.API,delete h.slideCount,delete h.currSlide,delete h.nextSlide,delete h.slides}catch(j){}return h},getSlideOpts:function(b){var c=this.opts();b===undefined&&(b=c.currSlide);var d=c.slides[b],e=a(d).data("cycle.opts");return a.extend({},c,e)},initSlide:function(b,c,d){var e=this.opts();c.css(b.slideCss||{}),d>0&&c.css("zIndex",d),isNaN(b.speed)&&(b.speed=a.fx.speeds[b.speed]||a.fx.speeds._default),b.sync||(b.speed=b.speed/2),c.addClass(e.slideClass)},updateView:function(a){var b=this.opts();if(!b._initialized)return;var c=b.API.getSlideOpts(),d=b.slides[b.currSlide];b.slideActiveClass&&b.slides.removeClass(b.slideActiveClass).eq(b.currSlide).addClass(b.slideActiveClass),a&&b.hideNonActive&&b.slides.filter(":not(."+b.slideActiveClass+")").hide(),b.API.trigger("cycle-update-view",[b,c,d])},getComponent:function(b){var c=this.opts(),d=c[b];return typeof d=="string"?/^\s*\>/.test(d)?c.container.find(d):a(d):d.jquery?d:a(d)},stackSlides:function(b,c,d){var e=this.opts();b||(b=e.slides[e.currSlide],c=e.slides[e.nextSlide],d=!e.reverse),a(b).css("zIndex",e.maxZ);var f,g=e.maxZ-2,h=e.slideCount;if(d){for(f=e.currSlide+1;f<h;f++)a(e.slides[f]).css("zIndex",g--);for(f=0;f<e.currSlide;f++)a(e.slides[f]).css("zIndex",g--)}else{for(f=e.currSlide-1;f>=0;f--)a(e.slides[f]).css("zIndex",g--);for(f=h-1;f>e.currSlide;f--)a(e.slides[f]).css("zIndex",g--)}a(c).css("zIndex",e.maxZ-1)},getSlideIndex:function(a){return this.opts().slides.index(a)}},a.fn.cycle.log=c,a.fn.cycle.version=function(){return"Cycle2: "+b},a.fn.cycle.transitions={custom:{},none:{before:function(a,b,c,d){a.API.stackSlides(c,b,d),a.cssBefore={opacity:1,display:"block"}}},fade:{before:function(b,c,d,e){var f=b.API.getSlideOpts(b.nextSlide).slideCss||{};b.API.stackSlides(c,d,e),b.cssBefore=a.extend(f,{opacity:0,display:"block"}),b.animIn={opacity:1},b.animOut={opacity:0}}},fadeout:{before:function(b,c,d,e){var f=b.API.getSlideOpts(b.nextSlide).slideCss||{};b.API.stackSlides(c,d,e),b.cssBefore=a.extend(f,{opacity:1,display:"block"}),b.animOut={opacity:0}}},scrollHorz:{before:function(a,b,c,d){a.API.stackSlides(b,c,d);var e=a.container.css("overflow","hidden").width();a.cssBefore={left:d?e:-e,top:0,opacity:1,display:"block"},a.cssAfter={zIndex:a._maxZ-2,left:0},a.animIn={left:0},a.animOut={left:d?-e:e}}}},a.fn.cycle.defaults={allowWrap:!0,autoSelector:".cycle-slideshow[data-cycle-auto-init!=false]",delay:0,easing:null,fx:"fade",hideNonActive:!0,loop:0,manualFx:undefined,manualSpeed:undefined,maxZ:100,pauseOnHover:!1,reverse:!1,slideActiveClass:"cycle-slide-active",slideClass:"cycle-slide",slideCss:{position:"absolute",top:0,left:0},slides:"> img",speed:500,startingSlide:0,sync:!0,timeout:4e3,updateView:-1},a(document).ready(function(){a(a.fn.cycle.defaults.autoSelector).cycle()})})(jQuery),function(a){"use strict",a.extend(a.fn.cycle.defaults,{autoHeight:0}),a(document).on("cycle-initialized",function(b,c){function h(){c.container.height(c.container.width()/g)}var d=c.autoHeight,e=-1,f,g;d==="calc"||a.type(d)=="number"&&d>=0?(d==="calc"?c.slides.each(function(b){var c=a(this).height();c>e&&(e=c,d=b)}):d>=c.slides.length&&(d=0),f=a(c.slides[d]).clone(),f.removeAttr("id").find("[id]").removeAttr("id"),f.removeAttr("name").find("[name]").removeAttr("name"),f.css({position:"static",visibility:"hidden",display:"block"}).prependTo(c.container).removeClass().addClass("cycle-sentinel cycle-slide"),f.find("*").css("visibility","hidden"),c._sentinel=f):a.type(d)=="string"&&/\d+\:\d+/.test(d)&&(g=d.match(/(\d+)\:(\d+)/),g=g[1]/g[2],a(window).on("resize",h),c._autoHeightOnResize=h,setTimeout(function(){a(window).triggerHandler("resize")},15))}),a(document).on("cycle-destroyed",function(b,c){c._sentinel&&c._sentinel.remove(),c._autoHeightOnResize&&a(window).off("resize",c._autoHeightOnResize)})}(jQuery),function(a){"use strict",a.extend(a.fn.cycle.defaults,{caption:"> .cycle-caption",captionTemplate:"{{slideNum}} / {{slideCount}}",overlay:"> .cycle-overlay",overlayTemplate:"<div>{{title}}</div><div>{{desc}}</div>"}),a(document).on("cycle-update-view",function(b,c,d,e){var f;a.each(["caption","overlay"],function(){var a=this,b=d[a+"Template"],f=c.API.getComponent(a);f.length&&b?(f.html(c.API.tmpl(b,d,c,e)),f.show()):f.hide()})}),a(document).on("cycle-destroyed",function(b,c){var d;a.each(["caption","overlay"],function(){var a=this,b=c[a+"Template"];c[a]&&b&&(d=c.API.getComponent("caption"),d.empty())})})}(jQuery),function(a){"use strict";var b=a.fn.cycle;a.fn.cycle=function(c){var d,e,f,g=a.makeArray(arguments);return a.type(c)=="number"?this.cycle("goto",c):a.type(c)=="string"?this.each(function(){var h;d=c,f=a(this).data("cycle.opts");if(f===undefined){b.log('slideshow must be initialized before sending commands; "'+d+'" ignored');return}d=d=="goto"?"jump":d,e=f.API[d];if(a.isFunction(e))return h=a.makeArray(g),h.shift(),e.apply(f.API,h);b.log("unknown command: ",d)}):b.apply(this,arguments)},a.extend(a.fn.cycle,b),a.extend(b.API,{next:function(){var a=this.opts(),b=a.reverse?-1:1;if(a.allowWrap===!1&&a.currSlide+b>=a.slideCount)return;a.API.advanceSlide(b),a.API.trigger("cycle-next",[a]).log("cycle-next")},prev:function(){var a=this.opts(),b=a.reverse?1:-1;if(a.allowWrap===!1&&a.currSlide+b<0)return;a.API.advanceSlide(b),a.API.trigger("cycle-prev",[a]).log("cycle-prev")},destroy:function(){var a=this.opts();clearTimeout(a.timeoutId),a.timeoutId=0,a.API.stop(),a.API.trigger("cycle-destroyed",[a]).log("cycle-destroyed"),a.container.removeData("cycle.opts")},jump:function(a){var b,c=this.opts(),d=parseInt(a,10);if(isNaN(d)||d<0||d>=c.slides.length){c.API.log("goto: invalid slide index: "+d);return}if(d==c.currSlide){c.API.log("goto: skipping, already on slide",d);return}c.nextSlide=d,clearTimeout(c.timeoutId),c.timeoutId=0,c.API.log("goto: ",d," (zero-index)"),b=c.currSlide<c.nextSlide,c.API.prepareTx(!0,b)},stop:function(){var b=this.opts(),c=b.container;clearTimeout(b.timeoutId),b.timeoutId=0,b.API.stopTransition(),b.pauseOnHover&&(b.pauseOnHover!==!0&&(c=a(b.pauseOnHover)),c.off("mouseenter mouseleave")),b.API.trigger("cycle-stopped",[b]).log("cycle-stopped")},pause:function(){var a=this.opts();a.paused=!0,a.API.trigger("cycle-paused",[a]).log("cycle-paused")},resume:function(){var a=this.opts();a.paused=!1,a.API.trigger("cycle-resumed",[a]).log("cycle-resumed")},reinit:function(){var a=this.opts();a.API.destroy(),a.container.cycle()},remove:function(b){var c=this.opts(),d,e,f=[],g=1;for(var h=0;h<c.slides.length;h++)d=c.slides[h],h==b?e=d:(f.push(d),a(d).data("cycle.opts").slideNum=g,g++);e&&(c.slides=a(f),c.slideCount--,a(e).remove(),b==c.currSlide&&c.API.advanceSlide(1),c.API.trigger("cycle-slide-removed",[c,b,e]).log("cycle-slide-removed"),c.API.updateView())}}),a(document).on("click.cycle","[data-cycle-cmd]",function(b){b.preventDefault();var c=a(this),d=c.data("cycle-cmd"),e=c.data("cycle-context")||".cycle-slideshow";a(e).cycle(d,c.data("cycle-arg"))})}(jQuery),function(a){function b(b,c){var d;if(b._hashFence){b._hashFence=!1;return}d=window.location.hash.substring(1),b.slides.each(function(e){if(a(this).data("cycle-hash")==d)return c===!0?b.startingSlide=e:(b.nextSlide=e,b.API.prepareTx(!0,!1)),!1})}"use strict",a(document).on("cycle-pre-initialize",function(c,d){b(d,!0),d._onHashChange=function(){b(d,!1)},a(window).on("hashchange",d._onHashChange)}),a(document).on("cycle-update-view",function(a,b,c){c.hash&&(b._hashFence=!0,window.location.hash=c.hash)}),a(document).on("cycle-destroyed",function(b,c){c._onHashChange&&a(window).off("hashchange",c._onHashChange)})}(jQuery),function(a){"use strict",a.extend(a.fn.cycle.defaults,{loader:!1}),a(document).on("cycle-bootstrap",function(b,c){function e(b,e){function h(b){var h;c.loader=="wait"?(f.push(b),g===0&&(f.sort(i),d.apply(c.API,[f,e]),c.container.removeClass("cycle-loading"))):(h=a(c.slides[c.currSlide]),d.apply(c.API,[b,e]),h.show(),c.container.removeClass("cycle-loading"))}function i(a,b){return a.data("index")-b.data("index")}var f=[];b=a(b);var g=b.length;b.hide().appendTo("body").each(function(b){function l(){--i===0&&(--g,h(j))}var i=0,j=a(this),k=j.is("img")?j:j.find("img");j.data("index",b),k=k.filter(":not(.cycle-loader-ignore)");if(!k.length){--g,f.push(j);return}i=k.length,k.each(function(){this.complete?l():a(this).load(function(){l()}).error(function(){--i===0&&(c.API.log("slide skipped; img not loaded:",this.src),--g===0&&c.loader=="wait"&&d.apply(c.API,[f,e]))})})}),g&&c.container.addClass("cycle-loading")}var d;if(!c.loader)return;d=c.API.add,c.API.add=e})}(jQuery),function(a){function b(b,c,d){var e,f=b.API.getComponent("pager");f.each(function(){var f=a(this);if(c.pagerTemplate){var g=b.API.tmpl(c.pagerTemplate,c,b,d[0]);e=a(g).appendTo(f)}else e=f.children().eq(b.slideCount-1);e.on(b.pagerEvent,function(a){a.preventDefault(),b.API.page(f,a.currentTarget)})})}function c(a,b){var c=this.opts(),d=a.children().index(b),e=d,f=c.currSlide<e;if(c.currSlide==e)return;c.nextSlide=e,c.API.prepareTx(!0,f),c.API.trigger("cycle-pager-activated",[c,a,b])}"use strict",a.extend(a.fn.cycle.defaults,{pager:"> .cycle-pager",pagerActiveClass:"cycle-pager-active",pagerEvent:"click.cycle",pagerTemplate:"<span>•</span>"}),a(document).on("cycle-bootstrap",function(a,c,d){d.buildPagerLink=b}),a(document).on("cycle-slide-added",function(a,b,d,e){b.pager&&(b.API.buildPagerLink(b,d,e),b.API.page=c)}),a(document).on("cycle-slide-removed",function(b,c,d,e){if(c.pager){var f=c.API.getComponent("pager");f.each(function(){var b=a(this);a(b.children()[d]).remove()})}}),a(document).on("cycle-update-view",function(b,c,d){var e;c.pager&&(e=c.API.getComponent("pager"),e.each(function(){a(this).children().removeClass(c.pagerActiveClass).eq(c.currSlide).addClass(c.pagerActiveClass)}))}),a(document).on("cycle-destroyed",function(a,b){var c;b.pager&&b.pagerTemplate&&(c=b.API.getComponent("pager"),c.empty())})}(jQuery),function(a){"use strict",a.extend(a.fn.cycle.defaults,{next:"> .cycle-next",nextEvent:"click.cycle",disabledClass:"disabled",prev:"> .cycle-prev",prevEvent:"click.cycle",swipe:!1}),a(document).on("cycle-initialized",function(a,b){b.API.getComponent("next").off(b.nextEvent).on(b.nextEvent,function(a){a.preventDefault(),b.API.next()}),b.API.getComponent("prev").off(b.prevEvent).on(b.prevEvent,function(a){a.preventDefault(),b.API.prev()});if(b.swipe){var c=b.swipeVert?"swipeUp.cycle":"swipeLeft.cycle swipeleft.cycle",d=b.swipeVert?"swipeDown.cycle":"swipeRight.cycle swiperight.cycle";b.container.on(c,function(a){b.API.next()}),b.container.on(d,function(){b.API.prev()})}}),a(document).on("cycle-update-view",function(a,b,c,d){if(b.allowWrap)return;var e=b.disabledClass,f=b.API.getComponent("next"),g=b.API.getComponent("prev"),h=b._prevBoundry||0,i=b._nextBoundry||b.slideCount-1;b.currSlide==i?f.addClass(e).prop("disabled",!0):f.removeClass(e).prop("disabled",!1),b.currSlide===h?g.addClass(e).prop("disabled",!0):g.removeClass(e).prop("disabled",!1)}),a(document).on("cycle-destroyed",function(b,c){a(c.next).off(c.nextEvent),a(c.prev).off(c.prevEvent),c.container.off("swipeleft.cycle swiperight.cycle swipeLeft.cycle swipeRight.cycle swipeUp.cycle swipeDown.cycle")})}(jQuery),function(a){"use strict",a.extend(a.fn.cycle.defaults,{progressive:!1}),a(document).on("cycle-pre-initialize",function(b,c){if(!c.progressive)return;var d=c.API,e=d.next,f=d.prev,g=d.prepareTx,h,i=a.type(c.progressive);if(i=="array")h=c.progressive;else if(a.isFunction(c.progressive))h=c.progressive(c);else if(i=="string"){h=a(c.progressive).html();if(!a.trim(h))return;try{h=a.parseJSON(h)}catch(j){d.log("error parsing progressive slides",j);return}}g&&(d.prepareTx=function(a,b){var d,e;if(a||h.length===0){g.apply(c.API,[a,b]);return}b&&c.currSlide==c.slideCount-1?(e=h[0],h=h.slice(1),c.container.one("cycle-slide-added",function(a,b){b.API.advanceSlide(1)}),c.API.add(e)):!b&&c.currSlide===0?(d=h.length-1,e=h[d],h=h.slice(0,d),c.container.one("cycle-slide-added",function(a,b){b.currSlide=1,b.API.advanceSlide(-1)}),c.API.add(e,!0)):g.apply(c.API,[a,b])}),e&&(d.next=function(){var a=this.opts();if(h.length&&a.currSlide==a.slideCount-1){var b=h[0];h=h.slice(1),a.container.one("cycle-slide-added",function(a,b){e.apply(b.API),b.container.removeClass("cycle-loading")}),a.container.addClass("cycle-loading"),a.API.add(b)}else e.apply(a.API)}),f&&(d.prev=function(){var a=this.opts();if(h.length&&a.currSlide===0){var b=h.length-1,c=h[b];h=h.slice(0,b),a.container.one("cycle-slide-added",function(a,b){b.currSlide=1,b.API.advanceSlide(-1),b.container.removeClass("cycle-loading")}),a.container.addClass("cycle-loading"),a.API.add(c,!0)}else f.apply(a.API)})})}(jQuery),function(a){"use strict",a.extend(a.fn.cycle.defaults,{tmplRegex:"{{((.)?.*?)}}"}),a.extend(a.fn.cycle.API,{tmpl:function(b,c){var d=new RegExp(c.tmplRegex||a.fn.cycle.defaults.tmplRegex,"g"),e=a.makeArray(arguments);return e.shift(),b.replace(d,function(b,c){var d,f,g,h,i=c.split(".");for(d=0;d<e.length;d++){g=e[d];if(i.length>1){h=g;for(f=0;f<i.length;f++)g=h,h=h[i[f]]||c}else h=g[c];if(a.isFunction(h))return h.apply(g,e);if(h!==undefined&&h!==null&&h!=c)return h}return c})}})}(jQuery);
|
1 |
+
/*!
|
2 |
+
* jQuery Cycle2; ver: 20130206
|
3 |
+
* http://jquery.malsup.com/cycle2/
|
4 |
+
* Copyright (c) 2013 M. Alsup; Dual licensed: MIT/GPL
|
5 |
+
*/
|
6 |
+
(function(a){function c(a){return(a||"").toLowerCase()}"use strict";var b="20130205";a.fn.cycle=function(b){var d;return this.length===0&&!a.isReady?(d={s:this.selector,c:this.context},a.fn.cycle.log("requeuing slideshow (dom not ready)"),a(function(){a(d.s,d.c).cycle(b)}),this):this.each(function(){var d,e,f,g,h=a(this),i=a.fn.cycle.log;if(h.data("cycle.opts"))return;if(h.data("cycle-log")===!1||b&&b.log===!1||e&&e.log===!1)i=a.noop;i("--c2 init--"),d=h.data();for(var j in d)d.hasOwnProperty(j)&&/^cycle[A-Z]+/.test(j)&&(g=d[j],f=j.match(/^cycle(.*)/)[1].replace(/^[A-Z]/,c),i(f+":",g,"("+typeof g+")"),d[f]=g);e=a.extend({},a.fn.cycle.defaults,d,b||{}),e.timeoutId=0,e.paused=e.paused||!1,e.container=h,e._maxZ=e.maxZ,e.API=a.extend({_container:h},a.fn.cycle.API),e.API.log=i,e.API.trigger=function(a,b){return e.container.trigger(a,b),e.API},h.data("cycle.opts",e),h.data("cycle.API",e.API),e.API.trigger("cycle-bootstrap",[e,e.API]),e.API.addInitialSlides(),e.API.preInitSlideshow(),e.slides.length&&e.API.initSlideshow()})},a.fn.cycle.API={opts:function(){return this._container.data("cycle.opts")},addInitialSlides:function(){var b=this.opts(),c=b.slides;b.slideCount=0,b.slides=a(),c=c.jquery?c:b.container.find(c),b.random&&c.sort(function(){return Math.random()-.5}),b.API.add(c)},preInitSlideshow:function(){var b=this.opts();b.API.trigger("cycle-pre-initialize",[b]);var c=a.fn.cycle.transitions[b.fx];c&&a.isFunction(c.preInit)&&c.preInit(b),b._preInitialized=!0},postInitSlideshow:function(){var b=this.opts();b.API.trigger("cycle-post-initialize",[b]);var c=a.fn.cycle.transitions[b.fx];c&&a.isFunction(c.postInit)&&c.postInit(b)},initSlideshow:function(){var b=this.opts(),c=b.container;b.API.calcFirstSlide(),b.container.css("position")=="static"&&b.container.css("position","relative"),a(b.slides[b.currSlide]).css("opacity",1).show(),b.API.stackSlides(b.slides[b.currSlide],b.slides[b.nextSlide],!b.reverse),b.pauseOnHover&&(b.pauseOnHover!==!0&&(c=a(b.pauseOnHover)),c.hover(function(){b.hoverPaused=!0,b.paused||b.API.trigger("cycle-paused",[b])},function(){b.hoverPaused=!1,b.paused||b.API.trigger("cycle-resumed",[b])})),b.timeout&&(b.timeoutId=setTimeout(function(){b.API.prepareTx(!1,!b.reverse)},b.timeout+b.delay)),b._initialized=!0,b.API.updateView(!0),b.container.on("cycle-paused cycle-resumed",function(a){b.container[a.type==="cycle-paused"?"addClass":"removeClass"]("cycle-paused")}),b.API.trigger("cycle-initialized",[b]),b.API.postInitSlideshow()},add:function(b,c){var d=this.opts(),e=d.slideCount,f=!1,g;a.type(b)=="string"&&(b=a.trim(b)),a(b).each(function(b){var e,f=a(this);c?d.container.prepend(f):d.container.append(f),d.slideCount++,e=d.API.buildSlideOpts(f),c?d.slides=a(f).add(d.slides):d.slides=d.slides.add(f),d.API.initSlide(e,f,--d._maxZ),f.data("cycle.opts",e),d.API.trigger("cycle-slide-added",[d,e,f])}),d.API.updateView(!0),f=d._preInitialized&&e<2&&d.slideCount>=1,f&&(d._initialized?d.timeout&&(g=d.slides.length,d.nextSlide=d.reverse?g-1:1,d.timeoutId||d.API.queueTransition(d)):d.API.initSlideshow())},calcFirstSlide:function(){var a=this.opts(),b;b=parseInt(a.startingSlide||0,10);if(b>=a.slides.length||b<0)b=0;a.currSlide=b,a.reverse?(a.nextSlide=b-1,a.nextSlide<0&&(a.nextSlide=a.slides.length-1)):(a.nextSlide=b+1,a.nextSlide==a.slides.length&&(a.nextSlide=0))},calcNextSlide:function(){var a=this.opts(),b;a.reverse?(b=a.nextSlide-1<0,a.nextSlide=b?a.slideCount-1:a.nextSlide-1,a.currSlide=b?0:a.nextSlide+1):(b=a.nextSlide+1==a.slides.length,a.nextSlide=b?0:a.nextSlide+1,a.currSlide=b?a.slides.length-1:a.nextSlide-1)},calcTx:function(b,c){var d=b,e;return c&&d.manualFx&&(e=a.fn.cycle.transitions[d.manualFx]),e||(e=a.fn.cycle.transitions[d.fx]),e||(e=a.fn.cycle.transitions.fade,d.API.log('Transition "'+d.fx+'" not found. Using fade.')),e},prepareTx:function(a,b){var c=this.opts(),d,e,f,g,h;if(c.slideCount<2){c.timeoutId=0;return}a&&(!c.busy||c.manualTrump)&&(c.API.stopTransition(),c.busy=!1,clearTimeout(c.timeoutId),c.timeoutId=0);if(c.busy)return;if(c.timeoutId===0&&!a)return;e=c.slides[c.currSlide],f=c.slides[c.nextSlide],g=c.API.getSlideOpts(c.nextSlide),h=c.API.calcTx(g,a),c._tx=h,a&&g.manualSpeed!==undefined&&(g.speed=g.manualSpeed),c.nextSlide!=c.currSlide&&(a||!c.paused&&!c.hoverPaused&&c.timeout)?(c.API.trigger("cycle-before",[g,e,f,b]),h.before&&h.before(g,e,f,b),d=function(){c.busy=!1;if(!c.container.data("cycle.opts"))return;h.after&&h.after(g,e,f,b),c.API.trigger("cycle-after",[g,e,f,b]),c.API.queueTransition(g),c.API.updateView(!0)},c.busy=!0,h.transition?h.transition(g,e,f,b,d):c.API.doTransition(g,e,f,b,d),c.API.calcNextSlide(),c.updateView<0&&c.API.updateView()):c.API.queueTransition(g)},doTransition:function(b,c,d,e,f){var g=b,h=a(c),i=a(d),j=function(){i.animate(g.animIn||{opacity:1},g.speed,g.easeIn||g.easing,f)};i.css(g.cssBefore||{}),h.animate(g.animOut||{},g.speed,g.easeOut||g.easing,function(){h.css(g.cssAfter||{}),g.sync||j()}),g.sync&&j()},queueTransition:function(a){var b=this.opts();if(b.nextSlide===0&&--b.loop===0){b.API.log("terminating; loop=0"),b.timeout=0,b.API.trigger("cycle-finished",[b]),b.nextSlide=b.currSlide;return}a.timeout&&(b.timeoutId=setTimeout(function(){b.API.prepareTx(!1,!b.reverse)},a.timeout))},stopTransition:function(){var a=this.opts();a.slides.filter(":animated").length&&(a.slides.stop(!1,!0),a.API.trigger("cycle-transition-stopped",[a])),a._tx&&a._tx.stopTransition&&a._tx.stopTransition(a)},advanceSlide:function(a){var b=this.opts();return clearTimeout(b.timeoutId),b.timeoutId=0,b.nextSlide=b.currSlide+a,b.nextSlide<0?b.nextSlide=b.slides.length-1:b.nextSlide>=b.slides.length&&(b.nextSlide=0),b.API.prepareTx(!0,a>=0),!1},buildSlideOpts:function(b){var d=this.opts(),e,f,g=b.data()||{};for(var h in g)g.hasOwnProperty(h)&&/^cycle[A-Z]+/.test(h)&&(e=g[h],f=h.match(/^cycle(.*)/)[1].replace(/^[A-Z]/,c),d.API.log("["+(d.slideCount-1)+"]",f+":",e,"("+typeof e+")"),g[f]=e);g=a.extend({},a.fn.cycle.defaults,d,g),g.slideNum=d.slideCount;try{delete g.API,delete g.slideCount,delete g.currSlide,delete g.nextSlide,delete g.slides}catch(i){}return g},getSlideOpts:function(b){var c=this.opts();b===undefined&&(b=c.currSlide);var d=c.slides[b],e=a(d).data("cycle.opts");return a.extend({},c,e)},initSlide:function(b,c,d){var e=this.opts();c.css(b.slideCss||{}),d>0&&c.css("zIndex",d),isNaN(b.speed)&&(b.speed=a.fx.speeds[b.speed]||a.fx.speeds._default),b.sync||(b.speed=b.speed/2),c.addClass(e.slideClass)},updateView:function(a){var b=this.opts();if(!b._initialized)return;var c=b.API.getSlideOpts(),d=b.slides[b.currSlide];b.slideActiveClass&&b.slides.removeClass(b.slideActiveClass).eq(b.currSlide).addClass(b.slideActiveClass),a&&b.hideNonActive&&b.slides.filter(":not(."+b.slideActiveClass+")").hide(),b.API.trigger("cycle-update-view",[b,c,d])},getComponent:function(b){var c=this.opts(),d=c[b];return typeof d=="string"?/^\s*\>/.test(d)?c.container.find(d):a(d):d.jquery?d:a(d)},stackSlides:function(b,c,d){var e=this.opts();b||(b=e.slides[e.currSlide],c=e.slides[e.nextSlide],d=!e.reverse),a(b).css("zIndex",e.maxZ);var f,g=e.maxZ-2,h=e.slideCount;if(d){for(f=e.currSlide+1;f<h;f++)a(e.slides[f]).css("zIndex",g--);for(f=0;f<e.currSlide;f++)a(e.slides[f]).css("zIndex",g--)}else{for(f=e.currSlide-1;f>=0;f--)a(e.slides[f]).css("zIndex",g--);for(f=h-1;f>e.currSlide;f--)a(e.slides[f]).css("zIndex",g--)}a(c).css("zIndex",e.maxZ-1)},getSlideIndex:function(a){return this.opts().slides.index(a)}},a.fn.cycle.log=function(){window.console&&console.log&&console.log("[cycle2] "+Array.prototype.join.call(arguments," "))},a.fn.cycle.version=function(){return"Cycle2: "+b},a.fn.cycle.transitions={custom:{},none:{before:function(a,b,c,d){a.API.stackSlides(c,b,d),a.cssBefore={opacity:1,display:"block"}}},fade:{before:function(b,c,d,e){var f=b.API.getSlideOpts(b.nextSlide).slideCss||{};b.API.stackSlides(c,d,e),b.cssBefore=a.extend(f,{opacity:0,display:"block"}),b.animIn={opacity:1},b.animOut={opacity:0}}},fadeout:{before:function(b,c,d,e){var f=b.API.getSlideOpts(b.nextSlide).slideCss||{};b.API.stackSlides(c,d,e),b.cssBefore=a.extend(f,{opacity:1,display:"block"}),b.animOut={opacity:0}}},scrollHorz:{before:function(a,b,c,d){a.API.stackSlides(b,c,d);var e=a.container.css("overflow","hidden").width();a.cssBefore={left:d?e:-e,top:0,opacity:1,display:"block"},a.cssAfter={zIndex:a._maxZ-2,left:0},a.animIn={left:0},a.animOut={left:d?-e:e}}}},a.fn.cycle.defaults={allowWrap:!0,autoSelector:".cycle-slideshow[data-cycle-auto-init!=false]",delay:0,easing:null,fx:"fade",hideNonActive:!0,loop:0,manualFx:undefined,manualSpeed:undefined,manualTrump:!0,maxZ:100,pauseOnHover:!1,reverse:!1,slideActiveClass:"cycle-slide-active",slideClass:"cycle-slide",slideCss:{position:"absolute",top:0,left:0},slides:"> img",speed:500,startingSlide:0,sync:!0,timeout:4e3,updateView:-1},a(document).ready(function(){a(a.fn.cycle.defaults.autoSelector).cycle()})})(jQuery),function(a){"use strict",a.extend(a.fn.cycle.defaults,{autoHeight:0}),a(document).on("cycle-initialized",function(b,c){function h(){c.container.height(c.container.width()/g)}var d=c.autoHeight,e=-1,f,g;d==="calc"||a.type(d)=="number"&&d>=0?(d==="calc"?c.slides.each(function(b){var c=a(this).height();c>e&&(e=c,d=b)}):d>=c.slides.length&&(d=0),f=a(c.slides[d]).clone(),f.removeAttr("id name rel").find("[id],[name],[rel]").removeAttr("id name rel"),f.css({position:"static",visibility:"hidden",display:"block"}).prependTo(c.container).removeClass().addClass("cycle-sentinel cycle-slide"),f.find("*").css("visibility","hidden"),c._sentinel=f):a.type(d)=="string"&&/\d+\:\d+/.test(d)&&(g=d.match(/(\d+)\:(\d+)/),g=g[1]/g[2],a(window).on("resize",h),c._autoHeightOnResize=h,setTimeout(function(){a(window).triggerHandler("resize")},15))}),a(document).on("cycle-destroyed",function(b,c){c._sentinel&&c._sentinel.remove(),c._autoHeightOnResize&&a(window).off("resize",c._autoHeightOnResize)})}(jQuery),function(a){"use strict",a.extend(a.fn.cycle.defaults,{caption:"> .cycle-caption",captionTemplate:"{{slideNum}} / {{slideCount}}",overlay:"> .cycle-overlay",overlayTemplate:"<div>{{title}}</div><div>{{desc}}</div>"}),a(document).on("cycle-update-view",function(b,c,d,e){var f;a.each(["caption","overlay"],function(){var a=this,b=d[a+"Template"],f=c.API.getComponent(a);f.length&&b?(f.html(c.API.tmpl(b,d,c,e)),f.show()):f.hide()})}),a(document).on("cycle-destroyed",function(b,c){var d;a.each(["caption","overlay"],function(){var a=this,b=c[a+"Template"];c[a]&&b&&(d=c.API.getComponent("caption"),d.empty())})})}(jQuery),function(a){"use strict";var b=a.fn.cycle;a.fn.cycle=function(c){var d,e,f,g=a.makeArray(arguments);return a.type(c)=="number"?this.cycle("goto",c):a.type(c)=="string"?this.each(function(){var h;d=c,f=a(this).data("cycle.opts");if(f===undefined){b.log('slideshow must be initialized before sending commands; "'+d+'" ignored');return}d=d=="goto"?"jump":d,e=f.API[d];if(a.isFunction(e))return h=a.makeArray(g),h.shift(),e.apply(f.API,h);b.log("unknown command: ",d)}):b.apply(this,arguments)},a.extend(a.fn.cycle,b),a.extend(b.API,{next:function(){var a=this.opts();if(a.busy&&!a.manualTrump)return;var b=a.reverse?-1:1;if(a.allowWrap===!1&&a.currSlide+b>=a.slideCount)return;a.API.advanceSlide(b),a.API.trigger("cycle-next",[a]).log("cycle-next")},prev:function(){var a=this.opts();if(a.busy&&!a.manualTrump)return;var b=a.reverse?1:-1;if(a.allowWrap===!1&&a.currSlide+b<0)return;a.API.advanceSlide(b),a.API.trigger("cycle-prev",[a]).log("cycle-prev")},destroy:function(){var a=this.opts();clearTimeout(a.timeoutId),a.timeoutId=0,a.API.stop(),a.API.trigger("cycle-destroyed",[a]).log("cycle-destroyed"),a.container.removeData("cycle.opts"),a.retainStylesOnDestroy||(a.container.removeAttr("style"),a.slides.removeAttr("style"),a.slides.removeClass("cycle-slide-active"))},jump:function(a){var b,c=this.opts();if(c.busy&&!c.manualTrump)return;var d=parseInt(a,10);if(isNaN(d)||d<0||d>=c.slides.length){c.API.log("goto: invalid slide index: "+d);return}if(d==c.currSlide){c.API.log("goto: skipping, already on slide",d);return}c.nextSlide=d,clearTimeout(c.timeoutId),c.timeoutId=0,c.API.log("goto: ",d," (zero-index)"),b=c.currSlide<c.nextSlide,c.API.prepareTx(!0,b)},stop:function(){var b=this.opts(),c=b.container;clearTimeout(b.timeoutId),b.timeoutId=0,b.API.stopTransition(),b.pauseOnHover&&(b.pauseOnHover!==!0&&(c=a(b.pauseOnHover)),c.off("mouseenter mouseleave")),b.API.trigger("cycle-stopped",[b]).log("cycle-stopped")},pause:function(){var a=this.opts();a.paused=!0,a.API.trigger("cycle-paused",[a]).log("cycle-paused")},resume:function(){var a=this.opts();a.paused=!1,a.API.trigger("cycle-resumed",[a]).log("cycle-resumed")},reinit:function(){var a=this.opts();a.API.destroy(),a.container.cycle()},remove:function(b){var c=this.opts(),d,e,f=[],g=1;for(var h=0;h<c.slides.length;h++)d=c.slides[h],h==b?e=d:(f.push(d),a(d).data("cycle.opts").slideNum=g,g++);e&&(c.slides=a(f),c.slideCount--,a(e).remove(),b==c.currSlide&&c.API.advanceSlide(1),c.API.trigger("cycle-slide-removed",[c,b,e]).log("cycle-slide-removed"),c.API.updateView())}}),a(document).on("click.cycle","[data-cycle-cmd]",function(b){b.preventDefault();var c=a(this),d=c.data("cycle-cmd"),e=c.data("cycle-context")||".cycle-slideshow";a(e).cycle(d,c.data("cycle-arg"))})}(jQuery),function(a){function b(b,c){var d;if(b._hashFence){b._hashFence=!1;return}d=window.location.hash.substring(1),b.slides.each(function(e){if(a(this).data("cycle-hash")==d)return c===!0?b.startingSlide=e:(b.nextSlide=e,b.API.prepareTx(!0,!1)),!1})}"use strict",a(document).on("cycle-pre-initialize",function(c,d){b(d,!0),d._onHashChange=function(){b(d,!1)},a(window).on("hashchange",d._onHashChange)}),a(document).on("cycle-update-view",function(a,b,c){c.hash&&(b._hashFence=!0,window.location.hash=c.hash)}),a(document).on("cycle-destroyed",function(b,c){c._onHashChange&&a(window).off("hashchange",c._onHashChange)})}(jQuery),function(a){"use strict",a.extend(a.fn.cycle.defaults,{loader:!1}),a(document).on("cycle-bootstrap",function(b,c){function e(b,e){function h(b){var h;c.loader=="wait"?(f.push(b),g===0&&(f.sort(i),d.apply(c.API,[f,e]),c.container.removeClass("cycle-loading"))):(h=a(c.slides[c.currSlide]),d.apply(c.API,[b,e]),h.show(),c.container.removeClass("cycle-loading"))}function i(a,b){return a.data("index")-b.data("index")}var f=[];typeof b=="string"&&(b=a.trim(b)),b=a(b);var g=b.length;b.hide().appendTo("body").each(function(b){function l(){--i===0&&(--g,h(j))}var i=0,j=a(this),k=j.is("img")?j:j.find("img");j.data("index",b),k=k.filter(":not(.cycle-loader-ignore)");if(!k.length){--g,f.push(j);return}i=k.length,k.each(function(){this.complete?l():a(this).load(function(){l()}).error(function(){--i===0&&(c.API.log("slide skipped; img not loaded:",this.src),--g===0&&c.loader=="wait"&&d.apply(c.API,[f,e]))})})}),g&&c.container.addClass("cycle-loading")}var d;if(!c.loader)return;d=c.API.add,c.API.add=e})}(jQuery),function(a){function b(b,c,d){var e,f=b.API.getComponent("pager");f.each(function(){var f=a(this);if(c.pagerTemplate){var g=b.API.tmpl(c.pagerTemplate,c,b,d[0]);e=a(g).appendTo(f)}else e=f.children().eq(b.slideCount-1);e.on(b.pagerEvent,function(a){a.preventDefault(),b.API.page(f,a.currentTarget)})})}function c(a,b){var c=this.opts();if(c.busy&&!c.manualTrump)return;var d=a.children().index(b),e=d,f=c.currSlide<e;if(c.currSlide==e)return;c.nextSlide=e,c.API.prepareTx(!0,f),c.API.trigger("cycle-pager-activated",[c,a,b])}"use strict",a.extend(a.fn.cycle.defaults,{pager:"> .cycle-pager",pagerActiveClass:"cycle-pager-active",pagerEvent:"click.cycle",pagerTemplate:"<span>•</span>"}),a(document).on("cycle-bootstrap",function(a,c,d){d.buildPagerLink=b}),a(document).on("cycle-slide-added",function(a,b,d,e){b.pager&&(b.API.buildPagerLink(b,d,e),b.API.page=c)}),a(document).on("cycle-slide-removed",function(b,c,d,e){if(c.pager){var f=c.API.getComponent("pager");f.each(function(){var b=a(this);a(b.children()[d]).remove()})}}),a(document).on("cycle-update-view",function(b,c,d){var e;c.pager&&(e=c.API.getComponent("pager"),e.each(function(){a(this).children().removeClass(c.pagerActiveClass).eq(c.currSlide).addClass(c.pagerActiveClass)}))}),a(document).on("cycle-destroyed",function(a,b){var c;b.pager&&b.pagerTemplate&&(c=b.API.getComponent("pager"),c.empty())})}(jQuery),function(a){"use strict",a.extend(a.fn.cycle.defaults,{next:"> .cycle-next",nextEvent:"click.cycle",disabledClass:"disabled",prev:"> .cycle-prev",prevEvent:"click.cycle",swipe:!1}),a(document).on("cycle-initialized",function(a,b){b.API.getComponent("next").off(b.nextEvent).on(b.nextEvent,function(a){a.preventDefault(),b.API.next()}),b.API.getComponent("prev").off(b.prevEvent).on(b.prevEvent,function(a){a.preventDefault(),b.API.prev()});if(b.swipe){var c=b.swipeVert?"swipeUp.cycle":"swipeLeft.cycle swipeleft.cycle",d=b.swipeVert?"swipeDown.cycle":"swipeRight.cycle swiperight.cycle";b.container.on(c,function(a){b.API.next()}),b.container.on(d,function(){b.API.prev()})}}),a(document).on("cycle-update-view",function(a,b,c,d){if(b.allowWrap)return;var e=b.disabledClass,f=b.API.getComponent("next"),g=b.API.getComponent("prev"),h=b._prevBoundry||0,i=b._nextBoundry||b.slideCount-1;b.currSlide==i?f.addClass(e).prop("disabled",!0):f.removeClass(e).prop("disabled",!1),b.currSlide===h?g.addClass(e).prop("disabled",!0):g.removeClass(e).prop("disabled",!1)}),a(document).on("cycle-destroyed",function(b,c){a(c.next).off(c.nextEvent),a(c.prev).off(c.prevEvent),c.container.off("swipeleft.cycle swiperight.cycle swipeLeft.cycle swipeRight.cycle swipeUp.cycle swipeDown.cycle")})}(jQuery),function(a){"use strict",a.extend(a.fn.cycle.defaults,{progressive:!1}),a(document).on("cycle-pre-initialize",function(b,c){if(!c.progressive)return;var d=c.API,e=d.next,f=d.prev,g=d.prepareTx,h=a.type(c.progressive),i,j;if(h=="array")i=c.progressive;else if(a.isFunction(c.progressive))i=c.progressive(c);else if(h=="string"){j=a(c.progressive),i=a.trim(j.html());if(!i)return;if(/^(\[)/.test(i))try{i=a.parseJSON(i)}catch(k){d.log("error parsing progressive slides",k);return}else i=i.split(new RegExp(j.data("cycle-split")||"\n")),i[i.length-0]||i.pop()}g&&(d.prepareTx=function(a,b){var d,e;if(a||i.length===0){g.apply(c.API,[a,b]);return}b&&c.currSlide==c.slideCount-1?(e=i[0],i=i.slice(1),c.container.one("cycle-slide-added",function(a,b){setTimeout(function(){b.API.advanceSlide(1)},50)}),c.API.add(e)):!b&&c.currSlide===0?(d=i.length-1,e=i[d],i=i.slice(0,d),c.container.one("cycle-slide-added",function(a,b){setTimeout(function(){b.currSlide=1,b.API.advanceSlide(-1)},50)}),c.API.add(e,!0)):g.apply(c.API,[a,b])}),e&&(d.next=function(){var a=this.opts();if(i.length&&a.currSlide==a.slideCount-1){var b=i[0];i=i.slice(1),a.container.one("cycle-slide-added",function(a,b){e.apply(b.API),b.container.removeClass("cycle-loading")}),a.container.addClass("cycle-loading"),a.API.add(b)}else e.apply(a.API)}),f&&(d.prev=function(){var a=this.opts();if(i.length&&a.currSlide===0){var b=i.length-1,c=i[b];i=i.slice(0,b),a.container.one("cycle-slide-added",function(a,b){b.currSlide=1,b.API.advanceSlide(-1),b.container.removeClass("cycle-loading")}),a.container.addClass("cycle-loading"),a.API.add(c,!0)}else f.apply(a.API)})})}(jQuery),function(a){"use strict",a.extend(a.fn.cycle.defaults,{tmplRegex:"{{((.)?.*?)}}"}),a.extend(a.fn.cycle.API,{tmpl:function(b,c){var d=new RegExp(c.tmplRegex||a.fn.cycle.defaults.tmplRegex,"g"),e=a.makeArray(arguments);return e.shift(),b.replace(d,function(b,c){var d,f,g,h,i=c.split(".");for(d=0;d<e.length;d++){g=e[d];if(!g)continue;if(i.length>1){h=g;for(f=0;f<i.length;f++)g=h,h=h[i[f]]||c}else h=g[c];if(a.isFunction(h))return h.apply(g,e);if(h!==undefined&&h!==null&&h!=c)return h}return c})}})}(jQuery);
|