Version Description
- 2013-07-20
Download this release
Release Info
Developer | kosinix |
Plugin | Cyclone Slider |
Version | 2.5.4 |
Comparing to | |
See all releases |
Code changes from version 2.5.3 to 2.5.4
- README.txt +8 -2
- classes/class-cyclone-slider-builder.php +547 -0
- classes/class-cyclone-slider-data.php +350 -0
- {inc → classes}/class-cyclone-slider-widget.php +0 -0
- classes/class-cyclone-slider.php +209 -0
- {inc → classes}/class-cyclone-templates.php +0 -0
- {inc → classes}/class-image-resizer.php +0 -0
- {inc → classes}/class-nextgen-integration.php +0 -0
- cyclone-slider.php +14 -7
- inc/admin-parts/box.php +1 -1
- inc/class-cyclone-slider.php +0 -1025
- inc/functions.php +18 -20
- js/cyclone-slider.min.js +7 -4
- js/jquery.cycle2.video.min.js +2 -0
- lang/cycloneslider-fr_FR.mo +0 -0
- lang/cycloneslider-fr_FR.po +470 -0
- template-assets.php +8 -4
README.txt
CHANGED
@@ -2,9 +2,9 @@
|
|
2 |
Contributors: kosinix
|
3 |
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.
|
6 |
Tested up to: 3.5.1
|
7 |
-
Stable tag: 2.5.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -89,6 +89,9 @@ Inside your theme create a folder named "cycloneslider". Add your templates insi
|
|
89 |
|
90 |
== Changelog ==
|
91 |
|
|
|
|
|
|
|
92 |
= 2.5.3 - 2013-05-10 =
|
93 |
* Bug fix for child themes where slider is not working
|
94 |
|
@@ -175,6 +178,9 @@ Inside your theme create a folder named "cycloneslider". Add your templates insi
|
|
175 |
|
176 |
== Upgrade Notice ==
|
177 |
|
|
|
|
|
|
|
178 |
= 2.5.3 - 2013-05-10 =
|
179 |
* Bug fix for child themes where slider is not working
|
180 |
|
2 |
Contributors: kosinix
|
3 |
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.5
|
6 |
Tested up to: 3.5.1
|
7 |
+
Stable tag: 2.5.3
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
89 |
|
90 |
== Changelog ==
|
91 |
|
92 |
+
= 2.5.4 - 2013-07-20 =
|
93 |
+
* Added Youtube template that pauses the video when slider is transitioning.
|
94 |
+
|
95 |
= 2.5.3 - 2013-05-10 =
|
96 |
* Bug fix for child themes where slider is not working
|
97 |
|
178 |
|
179 |
== Upgrade Notice ==
|
180 |
|
181 |
+
= 2.5.4 - 2013-07-20 =
|
182 |
+
* Added Youtube template that pauses the video when slider is transitioning.
|
183 |
+
|
184 |
= 2.5.3 - 2013-05-10 =
|
185 |
* Bug fix for child themes where slider is not working
|
186 |
|
classes/class-cyclone-slider-builder.php
ADDED
@@ -0,0 +1,547 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if(!class_exists('Cyclone_Slider_Builder')):
|
3 |
+
|
4 |
+
class Cyclone_Slider_Builder {
|
5 |
+
private $nonce_name;
|
6 |
+
private $nonce_action;
|
7 |
+
|
8 |
+
public $slider_count;
|
9 |
+
public $effects;
|
10 |
+
public $debug;
|
11 |
+
private $message_id;
|
12 |
+
public $templates;
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Initializes the plugin by setting localization, filters, and administration functions.
|
16 |
+
*/
|
17 |
+
public function __construct() {
|
18 |
+
// Intialize properties
|
19 |
+
$this->nonce_name = 'cyclone_slider_builder_nonce'; //Must match with the one in class-cyclone-slider-builder.php
|
20 |
+
$this->nonce_action = 'cyclone-slider-save'; //Must match with the one in class-cyclone-slider-builder.php
|
21 |
+
|
22 |
+
// Set defaults
|
23 |
+
$this->slider_count = 0;
|
24 |
+
$this->effects = Cyclone_Slider_Data::get_slide_effects();
|
25 |
+
$this->debug = false;
|
26 |
+
|
27 |
+
// Register admin styles and scripts
|
28 |
+
add_action( 'admin_enqueue_scripts', array( $this, 'register_wp_media' ), 9);
|
29 |
+
add_action( 'admin_enqueue_scripts', array( $this, 'register_admin_scripts' ), 10);
|
30 |
+
|
31 |
+
// Add admin menus
|
32 |
+
add_action( 'init', array( $this, 'create_post_types' ) );
|
33 |
+
|
34 |
+
// Update the messages for our custom post make it appropriate for slideshow
|
35 |
+
add_filter('post_updated_messages', array( $this, 'post_updated_messages' ) );
|
36 |
+
|
37 |
+
// Add slider metaboxes
|
38 |
+
add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ) );
|
39 |
+
|
40 |
+
// Hacky way to change text in thickbox
|
41 |
+
add_filter( 'gettext', array( $this, 'replace_text_in_thickbox' ), 10, 3 );
|
42 |
+
|
43 |
+
// Modify html of image
|
44 |
+
add_filter( 'image_send_to_editor', array( $this, 'image_send_to_editor'), 1, 8 );
|
45 |
+
|
46 |
+
// Custom columns
|
47 |
+
add_action( 'manage_cycloneslider_posts_custom_column', array( $this, 'custom_column' ), 10, 2);
|
48 |
+
add_filter( 'manage_edit-cycloneslider_columns', array( $this, 'slideshow_columns') );
|
49 |
+
|
50 |
+
// Add hook for admin footer
|
51 |
+
add_action('admin_footer', array( $this, 'admin_footer') );
|
52 |
+
|
53 |
+
// Add hook for ajax operations if logged in
|
54 |
+
add_action( 'wp_ajax_cycloneslider_get_video', array( $this, 'cycloneslider_get_video' ) );
|
55 |
+
|
56 |
+
|
57 |
+
$version = get_option('cycloneslider_version');
|
58 |
+
|
59 |
+
$this->templates = new Cyclone_Templates();
|
60 |
+
$this->templates->add_template_location(
|
61 |
+
array(
|
62 |
+
'path'=>Cyclone_Slider_Data::get_templates_folder(), //this resides in the plugin
|
63 |
+
'url'=>CYCLONE_URL.'templates/'
|
64 |
+
)
|
65 |
+
);
|
66 |
+
$this->templates->add_template_location(
|
67 |
+
array(
|
68 |
+
'path'=> realpath(get_stylesheet_directory()).DIRECTORY_SEPARATOR.'cycloneslider'.DIRECTORY_SEPARATOR,//this resides in the current theme or child theme
|
69 |
+
'url'=> get_stylesheet_directory_uri()."/cycloneslider/"
|
70 |
+
)
|
71 |
+
);
|
72 |
+
|
73 |
+
} // end constructor
|
74 |
+
|
75 |
+
|
76 |
+
/**
|
77 |
+
* Add js and css for WP media manager.
|
78 |
+
*/
|
79 |
+
public function register_wp_media(){
|
80 |
+
global $wp_version;
|
81 |
+
|
82 |
+
if('cycloneslider' == get_post_type()){ /* Load only scripts here and not on all admin pages */
|
83 |
+
|
84 |
+
if ( version_compare( $wp_version, '3.5', '<' ) ) { // Use old media manager
|
85 |
+
|
86 |
+
wp_enqueue_style('thickbox');
|
87 |
+
|
88 |
+
wp_enqueue_script('media-upload');
|
89 |
+
wp_enqueue_script('thickbox');
|
90 |
+
|
91 |
+
} else {
|
92 |
+
// Required media files for new media manager. Since WP 3.5+
|
93 |
+
wp_enqueue_media();
|
94 |
+
}
|
95 |
+
}
|
96 |
+
}
|
97 |
+
|
98 |
+
/**
|
99 |
+
* Admin js and css
|
100 |
+
*/
|
101 |
+
public function register_admin_scripts() {
|
102 |
+
|
103 |
+
if('cycloneslider' == get_post_type()){ /* Load only scripts here and not on all admin pages */
|
104 |
+
|
105 |
+
wp_enqueue_style( 'cycloneslider-admin-styles', CYCLONE_URL.'css/admin.css', array(), CYCLONE_VERSION );
|
106 |
+
|
107 |
+
//scripts
|
108 |
+
wp_dequeue_script( 'autosave' );//disable autosave
|
109 |
+
|
110 |
+
|
111 |
+
wp_enqueue_script('jquery-ui-sortable');
|
112 |
+
|
113 |
+
wp_enqueue_script( 'store', CYCLONE_URL.'js/store-json2.min.js', array('jquery'), CYCLONE_VERSION );
|
114 |
+
|
115 |
+
wp_register_script( 'cycloneslider-admin-script', CYCLONE_URL.'js/admin.js', array('jquery'), CYCLONE_VERSION );
|
116 |
+
wp_localize_script( 'cycloneslider-admin-script', 'cycloneslider_admin_vars',
|
117 |
+
array(
|
118 |
+
'title' => __( 'Select an image', 'cycloneslider' ), // This will be used as the default title
|
119 |
+
'button' => __( 'Add to Slide', 'cycloneslider' ) // This will be used as the default button text
|
120 |
+
)
|
121 |
+
);
|
122 |
+
wp_enqueue_script( 'cycloneslider-admin-script');
|
123 |
+
|
124 |
+
}
|
125 |
+
}
|
126 |
+
|
127 |
+
/**
|
128 |
+
* Create Post Types
|
129 |
+
*
|
130 |
+
* Create custom post for slideshows
|
131 |
+
*/
|
132 |
+
public function create_post_types() {
|
133 |
+
register_post_type( 'cycloneslider',
|
134 |
+
array(
|
135 |
+
'labels' => array(
|
136 |
+
'name' => __('Cyclone Slider', 'cycloneslider'),
|
137 |
+
'singular_name' => __('Slideshow', 'cycloneslider'),
|
138 |
+
'add_new' => __('Add Slideshow', 'cycloneslider'),
|
139 |
+
'add_new_item' => __('Add New Slideshow', 'cycloneslider'),
|
140 |
+
'edit_item' => __('Edit Slideshow', 'cycloneslider'),
|
141 |
+
'new_item' => __('New Slideshow', 'cycloneslider'),
|
142 |
+
'view_item' => __('View Slideshow', 'cycloneslider'),
|
143 |
+
'search_items' => __('Search Slideshows', 'cycloneslider'),
|
144 |
+
'not_found' => __('No slideshows found', 'cycloneslider'),
|
145 |
+
'not_found_in_trash' => __('No slideshows found in Trash', 'cycloneslider')
|
146 |
+
),
|
147 |
+
'supports' => array('title'),
|
148 |
+
'public' => false,
|
149 |
+
'exclude_from_search' => true,
|
150 |
+
'show_ui' => true,
|
151 |
+
'menu_position' => 100
|
152 |
+
)
|
153 |
+
);
|
154 |
+
}
|
155 |
+
|
156 |
+
/**
|
157 |
+
* Add custom messages
|
158 |
+
*
|
159 |
+
* @return array Messages for cyclone
|
160 |
+
*/
|
161 |
+
public function post_updated_messages($messages){
|
162 |
+
global $post, $post_ID;
|
163 |
+
$messages['cycloneslider'] = array(
|
164 |
+
0 => '',
|
165 |
+
1 => sprintf( __( 'Slideshow updated. Shortcode is [cycloneslider id="%s"]', 'cycloneslider' ), $post->post_name),
|
166 |
+
2 => __( 'Custom field updated.', 'cycloneslider' ),
|
167 |
+
3 => __( 'Custom field deleted.', 'cycloneslider' ),
|
168 |
+
4 => __( 'Slideshow updated.', 'cycloneslider' ),
|
169 |
+
5 => __( 'Slideshow updated.', 'cycloneslider' ),
|
170 |
+
6 => sprintf( __( 'Slideshow published. Shortcode is [cycloneslider id="%s"]', 'cycloneslider' ), $post->post_name),
|
171 |
+
7 => __( 'Slideshow saved.', 'cycloneslider' ),
|
172 |
+
8 => __( 'Slideshow updated.', 'cycloneslider' ),
|
173 |
+
9 => __( 'Slideshow updated.', 'cycloneslider' ),
|
174 |
+
10 => __( 'Slideshow updated.', 'cycloneslider' ),
|
175 |
+
101 => sprintf( __( 'Templates CSS could not be saved. Make sure %stemplates.css is writable.', 'cycloneslider' ), CYCLONE_PATH.'css'.DIRECTORY_SEPARATOR),
|
176 |
+
102 => sprintf( __( 'Templates JS could not be saved. Make sure %stemplates.js is writable.', 'cycloneslider' ), CYCLONE_PATH.'js'.DIRECTORY_SEPARATOR)
|
177 |
+
);
|
178 |
+
return $messages;
|
179 |
+
}
|
180 |
+
|
181 |
+
/**
|
182 |
+
* Show custom messages
|
183 |
+
*
|
184 |
+
* @return array The array of locations containing path and url
|
185 |
+
*/
|
186 |
+
public function throw_message($location) {
|
187 |
+
$location = add_query_arg( 'message', $this->message_id, $location );
|
188 |
+
$this->message_id = 0;
|
189 |
+
return $location;
|
190 |
+
}
|
191 |
+
|
192 |
+
/**
|
193 |
+
* Add Meta Boxes
|
194 |
+
*
|
195 |
+
* Add custom metaboxes to our custom post type
|
196 |
+
*/
|
197 |
+
public function add_meta_boxes(){
|
198 |
+
add_meta_box(
|
199 |
+
'cyclone-slides-metabox',
|
200 |
+
__('Slides', 'cycloneslider'),
|
201 |
+
array( $this, 'render_slides_meta_box' ),
|
202 |
+
'cycloneslider' ,
|
203 |
+
'normal',
|
204 |
+
'high'
|
205 |
+
);
|
206 |
+
add_meta_box(
|
207 |
+
'cyclone-slider-properties-metabox',
|
208 |
+
__('Slideshow Settings', 'cycloneslider'),
|
209 |
+
array( $this, 'render_slider_properties_meta_box' ),
|
210 |
+
'cycloneslider' ,
|
211 |
+
'side',
|
212 |
+
'low'
|
213 |
+
);
|
214 |
+
add_meta_box(
|
215 |
+
'cyclone-slider-templates-metabox',
|
216 |
+
__('Slideshow Templates', 'cycloneslider'),
|
217 |
+
array( $this, 'render_slider_templates_meta_box' ),
|
218 |
+
'cycloneslider' ,
|
219 |
+
'normal',
|
220 |
+
'low'
|
221 |
+
);
|
222 |
+
}
|
223 |
+
|
224 |
+
/**
|
225 |
+
* Metabox for slides
|
226 |
+
*/
|
227 |
+
public function render_slides_meta_box($post){
|
228 |
+
|
229 |
+
// Use nonce for verification
|
230 |
+
echo '<input type="hidden" name="'.$this->nonce_name.'" value="', wp_create_nonce( $this->nonce_action ), '" />';
|
231 |
+
|
232 |
+
$slider_settings = Cyclone_Slider_Data::get_slideshow_settings($post->ID);
|
233 |
+
$slider_metas = Cyclone_Slider_Data::get_slides($post->ID);
|
234 |
+
|
235 |
+
?>
|
236 |
+
<div class="cs-sortables" data-post-id="<?php echo $post->ID; ?>">
|
237 |
+
<?php
|
238 |
+
if(is_array($slider_metas) and count($slider_metas)>0):
|
239 |
+
|
240 |
+
foreach($slider_metas as $i=>$slider_meta):
|
241 |
+
|
242 |
+
$image_url = $this->get_slide_img_thumb($slider_meta['id']);
|
243 |
+
$image_url = apply_filters('cycloneslider_preview_url', $image_url, $slider_meta);
|
244 |
+
$box_title = apply_filters('cycloneslider_box_title', __('Slide', 'cycloneslider'), $slider_meta).' '.($i+1);
|
245 |
+
|
246 |
+
include(Cyclone_Slider_Data::get_admin_parts_folder().'box.php');
|
247 |
+
endforeach;
|
248 |
+
|
249 |
+
endif;
|
250 |
+
?>
|
251 |
+
</div><!-- end .cycloneslider-sortable -->
|
252 |
+
|
253 |
+
<input type="button" value="<?php _e('Add Slide', 'cycloneslider'); ?>" class="cs-add-slide button-secondary" />
|
254 |
+
<?php
|
255 |
+
}
|
256 |
+
|
257 |
+
/**
|
258 |
+
* Metabox for slide properties
|
259 |
+
*/
|
260 |
+
public function render_slider_properties_meta_box($post){
|
261 |
+
|
262 |
+
$slider_settings = Cyclone_Slider_Data::get_slideshow_settings($post->ID);
|
263 |
+
|
264 |
+
if($this->debug){
|
265 |
+
Cyclone_Slider_Data::debug($slider_settings);
|
266 |
+
}
|
267 |
+
|
268 |
+
include(Cyclone_Slider_Data::get_admin_parts_folder() . 'slider-properties.php');
|
269 |
+
}
|
270 |
+
|
271 |
+
/**
|
272 |
+
* Metabox for templates
|
273 |
+
*/
|
274 |
+
public function render_slider_templates_meta_box($post){
|
275 |
+
|
276 |
+
$slider_settings = Cyclone_Slider_Data::get_slideshow_settings($post->ID);
|
277 |
+
|
278 |
+
$templates = $this->templates->get_all_templates();
|
279 |
+
if($this->debug){
|
280 |
+
Cyclone_Slider_Data::debug($templates);
|
281 |
+
}
|
282 |
+
include(Cyclone_Slider_Data::get_admin_parts_folder() . 'template-selection.php');
|
283 |
+
}
|
284 |
+
|
285 |
+
|
286 |
+
|
287 |
+
|
288 |
+
|
289 |
+
/**
|
290 |
+
* Get slide image thumb from id. False on fail
|
291 |
+
*/
|
292 |
+
private function get_slide_img_thumb($attachment_id){
|
293 |
+
$attachment_id = (int) $attachment_id;
|
294 |
+
if($attachment_id > 0){
|
295 |
+
$image_url = wp_get_attachment_image_src( $attachment_id, 'medium', true );
|
296 |
+
$image_url = (is_array($image_url)) ? $image_url[0] : '';
|
297 |
+
return $image_url;
|
298 |
+
}
|
299 |
+
return false;
|
300 |
+
}
|
301 |
+
|
302 |
+
/**
|
303 |
+
* Replace text in media button for WP < 3.5
|
304 |
+
*/
|
305 |
+
public function replace_text_in_thickbox($translation, $text, $domain ) {
|
306 |
+
$http_referrer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';
|
307 |
+
$req_referrer = isset($_REQUEST['referer']) ? $_REQUEST['referer'] : '';
|
308 |
+
if(strpos($http_referrer, 'cycloneslider')!==false or $req_referrer=='cycloneslider') {
|
309 |
+
if ( 'default' == $domain and 'Insert into Post' == $text )
|
310 |
+
{
|
311 |
+
return 'Add to Slide';
|
312 |
+
}
|
313 |
+
}
|
314 |
+
return $translation;
|
315 |
+
}
|
316 |
+
|
317 |
+
// Add attachment ID as html5 data attr in thickbox
|
318 |
+
public function image_send_to_editor( $html, $id, $caption, $title, $align, $url, $size, $alt = '' ){
|
319 |
+
if(strpos($html, '<img data-id="')===false){
|
320 |
+
$html = str_replace('<img', '<img data-id="'.$id.'" ', $html);
|
321 |
+
}
|
322 |
+
return $html;
|
323 |
+
}
|
324 |
+
|
325 |
+
// Modify columns
|
326 |
+
public function slideshow_columns($columns) {
|
327 |
+
$columns = array();
|
328 |
+
$columns['title']= __('Slideshow Name', 'cycloneslider');
|
329 |
+
$columns['template']= __('Template', 'cycloneslider');
|
330 |
+
$columns['images']= __('Images', 'cycloneslider');
|
331 |
+
$columns['id']= __('Slideshow ID', 'cycloneslider');
|
332 |
+
$columns['shortcode']= __('Shortcode', 'cycloneslider');
|
333 |
+
return $columns;
|
334 |
+
}
|
335 |
+
|
336 |
+
// Add content to custom columns
|
337 |
+
public function custom_column( $column_name, $post_id ){
|
338 |
+
if ($column_name == 'template') {
|
339 |
+
$settings = Cyclone_Slider_Data::get_slideshow_settings($post_id);
|
340 |
+
echo ucwords($settings['template']);
|
341 |
+
}
|
342 |
+
if ($column_name == 'images') {
|
343 |
+
echo '<div style="text-align:center; max-width:40px;">' . Cyclone_Slider_Data::get_image_count($post_id) . '</div>';
|
344 |
+
}
|
345 |
+
if ($column_name == 'id') {
|
346 |
+
$post = get_post($post_id);
|
347 |
+
echo $post->post_name;
|
348 |
+
}
|
349 |
+
if ($column_name == 'shortcode') {
|
350 |
+
$post = get_post($post_id);
|
351 |
+
echo '[cycloneslider id="'.$post->post_name.'"]';
|
352 |
+
}
|
353 |
+
}
|
354 |
+
|
355 |
+
// Hook to admin footer
|
356 |
+
public function admin_footer() {
|
357 |
+
$this->slide_box_for_js();
|
358 |
+
}
|
359 |
+
|
360 |
+
// For js adding of box
|
361 |
+
public function slide_box_for_js(){
|
362 |
+
if(get_post_type()=='cycloneslider'){
|
363 |
+
$box_title = __('Slide *', 'cycloneslider');
|
364 |
+
$image_url = '';
|
365 |
+
$i = '{id}';
|
366 |
+
$slider_meta = Cyclone_Slider_Data::get_slide_defaults();
|
367 |
+
foreach($slider_meta as $key=>$value){
|
368 |
+
$slider_meta[$key] = '';
|
369 |
+
}
|
370 |
+
$slider_meta['type'] = 'image';
|
371 |
+
?>
|
372 |
+
<div class="cs-slide-skeleton">
|
373 |
+
<?php
|
374 |
+
include(Cyclone_Slider_Data::get_admin_parts_folder().'box.php');
|
375 |
+
?>
|
376 |
+
</div><!-- end .cycloneslider-box-template -->
|
377 |
+
<?php
|
378 |
+
}
|
379 |
+
}
|
380 |
+
|
381 |
+
// Compare the value from admin and shortcode. If shortcode value is present and not empty, use it, otherwise return admin value
|
382 |
+
public function get_comp_slider_setting($admin_val, $shortcode_val){
|
383 |
+
if($shortcode_val!==null){//make sure its really null and not just int zero 0
|
384 |
+
return $shortcode_val;
|
385 |
+
}
|
386 |
+
return $admin_val;
|
387 |
+
}
|
388 |
+
|
389 |
+
// Return array of slide urls from meta
|
390 |
+
public function get_slides_from_meta($slider_metas){
|
391 |
+
$slides = array();
|
392 |
+
if(is_array($slider_metas)){
|
393 |
+
foreach($slider_metas as $slider_meta){
|
394 |
+
$attachment_id = (int) $slider_meta['id'];
|
395 |
+
$image_url = wp_get_attachment_url($attachment_id);
|
396 |
+
$image_url = ($image_url===false) ? '' : $image_url;
|
397 |
+
$slides[] = $image_url;
|
398 |
+
}
|
399 |
+
}
|
400 |
+
return $slides;
|
401 |
+
}
|
402 |
+
|
403 |
+
|
404 |
+
|
405 |
+
|
406 |
+
|
407 |
+
|
408 |
+
|
409 |
+
|
410 |
+
|
411 |
+
/**
|
412 |
+
* YOUTUBE & VIMEO
|
413 |
+
*/
|
414 |
+
|
415 |
+
/**
|
416 |
+
* Ajax for getting videos
|
417 |
+
*/
|
418 |
+
public function cycloneslider_get_video(){
|
419 |
+
$url = $_POST['url'];
|
420 |
+
|
421 |
+
$retval = array(
|
422 |
+
'success' => false
|
423 |
+
);
|
424 |
+
|
425 |
+
if (filter_var($url, FILTER_VALIDATE_URL) !== FALSE) {
|
426 |
+
|
427 |
+
if( $video_id = $this->get_youtube_id($url) ){ //If youtube url
|
428 |
+
if( $embed = wp_oembed_get($url) ){ //Get embed, false on fail
|
429 |
+
$retval = array(
|
430 |
+
'success' => true,
|
431 |
+
'url' => $this->get_youtube_thumb($video_id),
|
432 |
+
'embed' => $embed
|
433 |
+
);
|
434 |
+
}
|
435 |
+
|
436 |
+
} else if( $video_id = $this->get_vimeo_id($url) ){ //If vimeo url
|
437 |
+
if( $embed = wp_oembed_get($url) ){ //Get embed, false on fail
|
438 |
+
$retval = array(
|
439 |
+
'success' => true,
|
440 |
+
'url' => $this->get_vimeo_thumb($video_id),
|
441 |
+
'embed' => $embed
|
442 |
+
);
|
443 |
+
}
|
444 |
+
}
|
445 |
+
}
|
446 |
+
|
447 |
+
echo json_encode($retval);
|
448 |
+
die();
|
449 |
+
}
|
450 |
+
|
451 |
+
/**
|
452 |
+
* Get video thumb url
|
453 |
+
*
|
454 |
+
* @param string $url A valid youtube or vimeo url
|
455 |
+
*/
|
456 |
+
public function get_video_thumb_from_url($url){
|
457 |
+
$url = esc_url_raw($url);
|
458 |
+
|
459 |
+
if ( $video_id = $this->get_youtube_id($url) ) { // A youtube url
|
460 |
+
|
461 |
+
return $this->get_youtube_thumb($video_id);
|
462 |
+
|
463 |
+
} else if( $video_id = $this->get_vimeo_id($url) ){ // A vimeo url
|
464 |
+
|
465 |
+
return $this->get_vimeo_thumb($video_id);
|
466 |
+
}
|
467 |
+
|
468 |
+
return false;
|
469 |
+
}
|
470 |
+
|
471 |
+
/**
|
472 |
+
* Return vimeo video id
|
473 |
+
*/
|
474 |
+
public function get_vimeo_id($url){
|
475 |
+
|
476 |
+
$parsed_url = parse_url($url);
|
477 |
+
if ($parsed_url['host'] == 'vimeo.com'){
|
478 |
+
$vimeo_id = ltrim( $parsed_url['path'], '/');
|
479 |
+
if (is_numeric($vimeo_id)) {
|
480 |
+
return $vimeo_id;
|
481 |
+
}
|
482 |
+
}
|
483 |
+
return false;
|
484 |
+
}
|
485 |
+
|
486 |
+
/**
|
487 |
+
* Get vimeo video thumbnail image
|
488 |
+
*
|
489 |
+
* @param int Vimeo ID.
|
490 |
+
* @param string Size can be: thumbnail_small, thumbnail_medium, thumbnail_large.
|
491 |
+
*
|
492 |
+
* @return string URL of thumbnail image.
|
493 |
+
*/
|
494 |
+
public function get_vimeo_thumb($video_id, $size = 'thumbnail_large'){
|
495 |
+
$vimeo = unserialize( file_get_contents('http://vimeo.com/api/v2/video/'.$video_id.'.php') );
|
496 |
+
if( isset($vimeo[0][$size]) ){
|
497 |
+
return $vimeo[0][$size];
|
498 |
+
}
|
499 |
+
return '';
|
500 |
+
}
|
501 |
+
|
502 |
+
/**
|
503 |
+
* Get youtube video thumbnail image
|
504 |
+
*
|
505 |
+
* @param int Youtube ID.
|
506 |
+
*
|
507 |
+
* @return string URL of thumbnail image.
|
508 |
+
*/
|
509 |
+
public function get_youtube_thumb($video_id){
|
510 |
+
return 'http://img.youtube.com/vi/'.$video_id.'/0.jpg';
|
511 |
+
}
|
512 |
+
|
513 |
+
/**
|
514 |
+
* Get youtube ID from different url formats
|
515 |
+
*
|
516 |
+
* @param string $url Youtube url
|
517 |
+
* @return string Youtube URL or boolean false on fail
|
518 |
+
*/
|
519 |
+
public function get_youtube_id($url){
|
520 |
+
if (filter_var($url, FILTER_VALIDATE_URL) === FALSE) {
|
521 |
+
return false;
|
522 |
+
}
|
523 |
+
$parsed_url = parse_url($url);
|
524 |
+
|
525 |
+
if(strpos($parsed_url['host'], 'youtube.com')!==false){
|
526 |
+
if(strpos($parsed_url['path'], '/watch')!==false){ // Regular url Eg. http://www.youtube.com/watch?v=9bZkp7q19f0
|
527 |
+
parse_str($parsed_url['query'], $parsed_str);
|
528 |
+
if(isset($parsed_str['v']) and !empty($parsed_str['v'])){
|
529 |
+
return $parsed_str['v'];
|
530 |
+
}
|
531 |
+
} else if(strpos($parsed_url['path'], '/v/')!==false){ // "v" URL http://www.youtube.com/v/9bZkp7q19f0?version=3&autohide=1
|
532 |
+
$id = str_replace('/v/','',$parsed_url['path']);
|
533 |
+
if( !empty($id) ){
|
534 |
+
return $id;
|
535 |
+
}
|
536 |
+
} else if(strpos($parsed_url['path'], '/embed/')!==false){ // Embed URL: http://www.youtube.com/embed/9bZkp7q19f0
|
537 |
+
return str_replace('/embed/','',$parsed_url['path']);
|
538 |
+
}
|
539 |
+
} else if(strpos($parsed_url['host'], 'youtu.be')!==false){ // Shortened URL: http://youtu.be/9bZkp7q19f0
|
540 |
+
return str_replace('/','',$parsed_url['path']);
|
541 |
+
}
|
542 |
+
|
543 |
+
return false;
|
544 |
+
}
|
545 |
+
} // end class
|
546 |
+
|
547 |
+
endif;
|
classes/class-cyclone-slider-data.php
ADDED
@@ -0,0 +1,350 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if(!class_exists('Cyclone_Slider_Data')):
|
3 |
+
|
4 |
+
/**
|
5 |
+
* Class for saving and getting data
|
6 |
+
*/
|
7 |
+
class Cyclone_Slider_Data {
|
8 |
+
|
9 |
+
private $nonce_name;
|
10 |
+
private $nonce_action;
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Initializes the class
|
14 |
+
*/
|
15 |
+
public function __construct(){
|
16 |
+
|
17 |
+
// Intialize properties
|
18 |
+
$this->nonce_name = 'cyclone_slider_builder_nonce'; //Must match with the one in class-cyclone-slider-builder.php
|
19 |
+
$this->nonce_action = 'cyclone-slider-save'; //Must match with the one in class-cyclone-slider-builder.php
|
20 |
+
|
21 |
+
// Save slides
|
22 |
+
add_action( 'save_post', array( $this, 'save_post' ) );
|
23 |
+
}
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Save post hook
|
27 |
+
*/
|
28 |
+
public function save_post($post_id){
|
29 |
+
global $cyclone_slider_saved_done;
|
30 |
+
|
31 |
+
// Stop! We have already saved..
|
32 |
+
if($cyclone_slider_saved_done){
|
33 |
+
return $post_id;
|
34 |
+
}
|
35 |
+
|
36 |
+
// Verify nonce
|
37 |
+
$nonce_name = $this->nonce_name;
|
38 |
+
if (!empty($_POST[$nonce_name])) {
|
39 |
+
if (!wp_verify_nonce($_POST[$nonce_name], $this->nonce_action)) {
|
40 |
+
return $post_id;
|
41 |
+
}
|
42 |
+
} else {
|
43 |
+
return $post_id; // Make sure we cancel on missing nonce!
|
44 |
+
}
|
45 |
+
|
46 |
+
// Check autosave
|
47 |
+
if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
|
48 |
+
return $post_id;
|
49 |
+
}
|
50 |
+
|
51 |
+
// Save slides
|
52 |
+
$this->save_slides($post_id);
|
53 |
+
|
54 |
+
// Save slideshow ettings
|
55 |
+
$this->save_settings($post_id);
|
56 |
+
|
57 |
+
update_option('cycloneslider_version', CYCLONE_VERSION);
|
58 |
+
|
59 |
+
}
|
60 |
+
|
61 |
+
/**
|
62 |
+
* Save slides sanitize if needed
|
63 |
+
*/
|
64 |
+
public function save_slides($post_id){
|
65 |
+
$slides = array();
|
66 |
+
if(isset($_POST['cycloneslider_metas'])){
|
67 |
+
|
68 |
+
$i=0;//always start from 0
|
69 |
+
foreach($_POST['cycloneslider_metas'] as $slide){
|
70 |
+
$slide = wp_parse_args($slide, self::get_slide_defaults());
|
71 |
+
$slides[$i]['id'] = (int) ($slide['id']);
|
72 |
+
$slides[$i]['type'] = sanitize_text_field($slide['type']);
|
73 |
+
|
74 |
+
$slides[$i]['link'] = esc_url_raw($slide['link']);
|
75 |
+
$slides[$i]['title'] = wp_kses_post($slide['title']);
|
76 |
+
$slides[$i]['description'] = wp_kses_post($slide['description']);
|
77 |
+
$slides[$i]['link_target'] = sanitize_text_field($slide['link_target']);
|
78 |
+
|
79 |
+
$slides[$i]['img_alt'] = sanitize_text_field($slide['img_alt']);
|
80 |
+
$slides[$i]['img_title'] = sanitize_text_field($slide['img_title']);
|
81 |
+
|
82 |
+
$slides[$i]['enable_slide_effects'] = (int) ($slide['enable_slide_effects']);
|
83 |
+
$slides[$i]['fx'] = sanitize_text_field($slide['fx']);
|
84 |
+
$slides[$i]['speed'] = sanitize_text_field($slide['speed']);
|
85 |
+
$slides[$i]['timeout'] = sanitize_text_field($slide['timeout']);
|
86 |
+
$slides[$i]['tile_count'] = sanitize_text_field($slide['tile_count']);
|
87 |
+
$slides[$i]['tile_delay'] = sanitize_text_field($slide['tile_delay']);
|
88 |
+
$slides[$i]['tile_vertical'] = sanitize_text_field($slide['tile_vertical']);
|
89 |
+
|
90 |
+
$slides[$i]['video_thumb'] = esc_url_raw($slide['video_thumb']);
|
91 |
+
$slides[$i]['video_url'] = esc_url_raw($slide['video_url']);
|
92 |
+
$slides[$i]['video'] = $slide['video'];
|
93 |
+
|
94 |
+
$slides[$i]['custom'] = $slide['custom'];
|
95 |
+
|
96 |
+
$i++;
|
97 |
+
}
|
98 |
+
|
99 |
+
|
100 |
+
}
|
101 |
+
$slides = apply_filters('cycloneslider_slides', $slides); //do filter before saving
|
102 |
+
|
103 |
+
delete_post_meta($post_id, '_cycloneslider_metas');
|
104 |
+
update_post_meta($post_id, '_cycloneslider_metas', $slides);
|
105 |
+
}
|
106 |
+
|
107 |
+
/**
|
108 |
+
* Save slideshow settings
|
109 |
+
*/
|
110 |
+
public function save_settings($post_id){
|
111 |
+
if(isset($_POST['cycloneslider_settings'])){
|
112 |
+
$_POST['cycloneslider_settings'] = wp_parse_args($_POST['cycloneslider_settings'], self::get_slideshow_defaults());
|
113 |
+
$settings = array();
|
114 |
+
$settings['template'] = sanitize_text_field($_POST['cycloneslider_settings']['template']);
|
115 |
+
$settings['fx'] = sanitize_text_field($_POST['cycloneslider_settings']['fx']);
|
116 |
+
$settings['timeout'] = (int) ($_POST['cycloneslider_settings']['timeout']);
|
117 |
+
$settings['speed'] = (int) ($_POST['cycloneslider_settings']['speed']);
|
118 |
+
$settings['width'] = (int) ($_POST['cycloneslider_settings']['width']);
|
119 |
+
$settings['height'] = (int) ($_POST['cycloneslider_settings']['height']);
|
120 |
+
$settings['hover_pause'] = sanitize_text_field($_POST['cycloneslider_settings']['hover_pause']);
|
121 |
+
$settings['show_prev_next'] = (int) ($_POST['cycloneslider_settings']['show_prev_next']);
|
122 |
+
$settings['show_nav'] = (int) ($_POST['cycloneslider_settings']['show_nav']);
|
123 |
+
$settings['tile_count'] = (int) ($_POST['cycloneslider_settings']['tile_count']);
|
124 |
+
$settings['tile_delay'] = (int) ($_POST['cycloneslider_settings']['tile_delay']);
|
125 |
+
$settings['tile_vertical'] = sanitize_text_field($_POST['cycloneslider_settings']['tile_vertical']);
|
126 |
+
$settings['random'] = (int) ($_POST['cycloneslider_settings']['random']);
|
127 |
+
$settings['resize'] = (int) ($_POST['cycloneslider_settings']['resize']);
|
128 |
+
|
129 |
+
$settings = apply_filters('cycloneslider_settings', $settings); //do filter before saving
|
130 |
+
|
131 |
+
delete_post_meta($post_id, '_cycloneslider_settings');
|
132 |
+
update_post_meta($post_id, '_cycloneslider_settings', $settings);
|
133 |
+
}
|
134 |
+
}
|
135 |
+
|
136 |
+
|
137 |
+
/**
|
138 |
+
* GLOBAL STATIC FUNCTIONS
|
139 |
+
*/
|
140 |
+
|
141 |
+
/**
|
142 |
+
* Get All Slideshows
|
143 |
+
*
|
144 |
+
* Get all saves slideshow
|
145 |
+
*
|
146 |
+
* @return array The array of slideshows
|
147 |
+
*/
|
148 |
+
public static function get_all_slideshows(){
|
149 |
+
$args = array(
|
150 |
+
'post_type' => 'cycloneslider',
|
151 |
+
'posts_per_page' => -1
|
152 |
+
);
|
153 |
+
$my_query = new WP_Query($args);
|
154 |
+
$slideshows = array();
|
155 |
+
while ( $my_query->have_posts() ) : $my_query->the_post();
|
156 |
+
$slideshows[] = $my_query->post;
|
157 |
+
endwhile;
|
158 |
+
|
159 |
+
wp_reset_postdata();
|
160 |
+
|
161 |
+
return $slideshows;
|
162 |
+
}
|
163 |
+
|
164 |
+
/**
|
165 |
+
* Get Templates in used
|
166 |
+
*
|
167 |
+
* Get all templates that are used by slideshow
|
168 |
+
*
|
169 |
+
* @return array The array of templates
|
170 |
+
*/
|
171 |
+
public static function get_templates_in_used(){
|
172 |
+
$slideshows = self::get_all_slideshows();
|
173 |
+
$templates_used = array();
|
174 |
+
foreach($slideshows as $slideshow) {
|
175 |
+
$settings = self::get_slideshow_settings($slideshow->ID);
|
176 |
+
$templates_used[$settings['template']] = $settings['template'];
|
177 |
+
}
|
178 |
+
|
179 |
+
return $templates_used;
|
180 |
+
}
|
181 |
+
|
182 |
+
/**
|
183 |
+
* Gets the slideshow settings. Defaults and filters are applied.
|
184 |
+
*
|
185 |
+
* @param int $slideshow_id Post ID of the slideshow custom post.
|
186 |
+
* @return array The array of slideshow settings
|
187 |
+
*/
|
188 |
+
public static function get_slideshow_settings($slideshow_id) {
|
189 |
+
$meta = get_post_custom($slideshow_id);
|
190 |
+
$slideshow_settings = array();
|
191 |
+
if(isset($meta['_cycloneslider_settings'][0]) and !empty($meta['_cycloneslider_settings'][0])){
|
192 |
+
$slideshow_settings = maybe_unserialize($meta['_cycloneslider_settings'][0]);
|
193 |
+
}
|
194 |
+
$slideshow_settings = wp_parse_args($slideshow_settings, self::get_slideshow_defaults() );
|
195 |
+
return apply_filters('cycloneslider_get_slideshow', $slideshow_settings);
|
196 |
+
}
|
197 |
+
|
198 |
+
/**
|
199 |
+
* Gets the slides. Defaults and filters are applied.
|
200 |
+
*
|
201 |
+
* @param int $slideshow_id Post ID of the slideshow custom post.
|
202 |
+
* @return array The array of slides settings
|
203 |
+
*/
|
204 |
+
public static function get_slides($slideshow_id){
|
205 |
+
$meta = get_post_custom($slideshow_id);
|
206 |
+
|
207 |
+
if(isset($meta['_cycloneslider_metas'][0]) and !empty($meta['_cycloneslider_metas'][0])){
|
208 |
+
$slides = maybe_unserialize($meta['_cycloneslider_metas'][0]);
|
209 |
+
$defaults = self::get_slide_defaults();
|
210 |
+
|
211 |
+
foreach($slides as $i=>$slide){
|
212 |
+
$slides[$i] = wp_parse_args($slide, $defaults);
|
213 |
+
}
|
214 |
+
|
215 |
+
return apply_filters('cycloneslider_get_slides', $slides);
|
216 |
+
}
|
217 |
+
return false;
|
218 |
+
}
|
219 |
+
|
220 |
+
/**
|
221 |
+
* Gets the slideshow default settings.
|
222 |
+
*
|
223 |
+
* @return array The array of slideshow defaults
|
224 |
+
*/
|
225 |
+
public static function get_slideshow_defaults(){
|
226 |
+
return array(
|
227 |
+
'template' => 'default',
|
228 |
+
'fx' => 'fade',
|
229 |
+
'timeout' => '4000',
|
230 |
+
'speed' => '1000',
|
231 |
+
'width' => '960',
|
232 |
+
'height' => '300',
|
233 |
+
'hover_pause' => 'true',
|
234 |
+
'show_prev_next' => '1',
|
235 |
+
'show_nav' => '1',
|
236 |
+
'tile_count' => '7',
|
237 |
+
'tile_delay' => '100',
|
238 |
+
'tile_vertical' => 'true',
|
239 |
+
'random' => 0,
|
240 |
+
'resize' => 1
|
241 |
+
);
|
242 |
+
}
|
243 |
+
|
244 |
+
/**
|
245 |
+
* Gets the slide default settings.
|
246 |
+
*
|
247 |
+
* @return array The array of slide defaults
|
248 |
+
*/
|
249 |
+
public static function get_slide_defaults(){
|
250 |
+
return array(
|
251 |
+
'enable_slide_effects'=>0,
|
252 |
+
'type' => 'image',
|
253 |
+
'id' => '',
|
254 |
+
'link' => '',
|
255 |
+
'title' => '',
|
256 |
+
'description' => '',
|
257 |
+
'link_target' => '_self',
|
258 |
+
'fx' => 'default',
|
259 |
+
'speed' => '',
|
260 |
+
'timeout' => '',
|
261 |
+
'tile_count' => '7',
|
262 |
+
'tile_delay' => '100',
|
263 |
+
'tile_vertical' => 'true',
|
264 |
+
'img_alt' => '',
|
265 |
+
'img_title' => '',
|
266 |
+
'video_thumb' => '',
|
267 |
+
'video_url' => '',
|
268 |
+
'video' => '',
|
269 |
+
'custom' => ''
|
270 |
+
);
|
271 |
+
}
|
272 |
+
|
273 |
+
/**
|
274 |
+
* Gets the slide effects.
|
275 |
+
*
|
276 |
+
* @return array The array of slide effects
|
277 |
+
*/
|
278 |
+
public static function get_slide_effects(){
|
279 |
+
return array(
|
280 |
+
'fade'=>'Fade',
|
281 |
+
'fadeout'=>'Fade Out',
|
282 |
+
'none'=>'None',
|
283 |
+
'scrollHorz'=>'Scroll Horizontally',
|
284 |
+
'tileBlind'=>'Tile Blind',
|
285 |
+
'tileSlide'=>'Tile Slide'
|
286 |
+
);
|
287 |
+
}
|
288 |
+
|
289 |
+
/**
|
290 |
+
* Gets the path to plugin
|
291 |
+
*
|
292 |
+
* @return string Path to plugin in the filesystem with trailing slash
|
293 |
+
*/
|
294 |
+
public static function path(){
|
295 |
+
return CYCLONE_PATH;
|
296 |
+
}
|
297 |
+
|
298 |
+
/**
|
299 |
+
* Gets the URL to plugin
|
300 |
+
*
|
301 |
+
* @return string URL to plugin with trailing slash
|
302 |
+
*/
|
303 |
+
public static function url(){
|
304 |
+
return CYCLONE_URL;
|
305 |
+
}
|
306 |
+
|
307 |
+
/**
|
308 |
+
* Gets the path to folder of admin user interface parts with trailing slash
|
309 |
+
*
|
310 |
+
* @return string Path to folder
|
311 |
+
*/
|
312 |
+
public static function get_admin_parts_folder(){
|
313 |
+
return self::path() . 'inc'.DIRECTORY_SEPARATOR.'admin-parts'.DIRECTORY_SEPARATOR;
|
314 |
+
}
|
315 |
+
|
316 |
+
/**
|
317 |
+
* Gets the path to templates folder
|
318 |
+
*
|
319 |
+
* @return string Path to templates inside the plugin with trailing slash
|
320 |
+
*/
|
321 |
+
public static function get_templates_folder(){
|
322 |
+
return self::path() . 'templates'.DIRECTORY_SEPARATOR;
|
323 |
+
}
|
324 |
+
|
325 |
+
/**
|
326 |
+
* Gets the number of images of slideshow
|
327 |
+
*
|
328 |
+
* @param int Slideshow id
|
329 |
+
* @return int Total images or zero
|
330 |
+
*/
|
331 |
+
public static function get_image_count($slideshow_id){
|
332 |
+
$meta = get_post_custom($slideshow_id);
|
333 |
+
|
334 |
+
if(isset($meta['_cycloneslider_metas'][0]) and !empty($meta['_cycloneslider_metas'][0])){
|
335 |
+
$slides = maybe_unserialize($meta['_cycloneslider_metas'][0]);
|
336 |
+
|
337 |
+
return count($slides);
|
338 |
+
}
|
339 |
+
return 0;
|
340 |
+
}
|
341 |
+
|
342 |
+
/**
|
343 |
+
* Print with a twist
|
344 |
+
*/
|
345 |
+
public static function debug($out){
|
346 |
+
echo '<pre>'.print_r($out, true).'</pre>';
|
347 |
+
}
|
348 |
+
}
|
349 |
+
|
350 |
+
endif;
|
{inc → classes}/class-cyclone-slider-widget.php
RENAMED
File without changes
|
classes/class-cyclone-slider.php
ADDED
@@ -0,0 +1,209 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if(!class_exists('Cyclone_Slider')):
|
3 |
+
|
4 |
+
class Cyclone_Slider {
|
5 |
+
public $slider_count;
|
6 |
+
public $debug;
|
7 |
+
private $message_id;
|
8 |
+
public $templates;
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Initializes the plugin by setting localization, filters, and administration functions.
|
12 |
+
*/
|
13 |
+
public function __construct() {
|
14 |
+
// Set defaults
|
15 |
+
$this->slider_count = 0;
|
16 |
+
$this->debug = false;
|
17 |
+
|
18 |
+
// Register frontend styles and scripts
|
19 |
+
add_action( 'wp_enqueue_scripts', array( $this, 'register_plugin_scripts' ), 100 );
|
20 |
+
|
21 |
+
|
22 |
+
// Our shortcode
|
23 |
+
add_shortcode('cycloneslider', array( $this, 'cycloneslider_shortcode') );
|
24 |
+
|
25 |
+
|
26 |
+
|
27 |
+
} // end constructor
|
28 |
+
|
29 |
+
|
30 |
+
/**
|
31 |
+
* Registers and enqueues frontend-specific scripts.
|
32 |
+
*/
|
33 |
+
public function register_plugin_scripts() {
|
34 |
+
$theme_folder = basename(get_stylesheet_directory());
|
35 |
+
|
36 |
+
/*** Styles ***/
|
37 |
+
wp_enqueue_style( 'cyclone-templates-styles', CYCLONE_URL.'template-assets.php?type=css&theme='.$theme_folder, array(), CYCLONE_VERSION );
|
38 |
+
|
39 |
+
/*** Scripts ***/
|
40 |
+
wp_enqueue_script( 'cyclone-slider', CYCLONE_URL.'js/cyclone-slider.min.js', array('jquery'), CYCLONE_VERSION ); //Consolidated cycle2 script and plugins
|
41 |
+
|
42 |
+
wp_enqueue_script( 'cyclone-templates-scripts', CYCLONE_URL.'template-assets.php?type=js&theme='.$theme_folder, array('jquery'), CYCLONE_VERSION );//Contains our combined css from ALL templates
|
43 |
+
|
44 |
+
}
|
45 |
+
|
46 |
+
|
47 |
+
// Compare the value from admin and shortcode. If shortcode value is present and not empty, use it, otherwise return admin value
|
48 |
+
public function get_comp_slider_setting($admin_val, $shortcode_val){
|
49 |
+
if($shortcode_val!==null){//make sure its really null and not just int zero 0
|
50 |
+
return $shortcode_val;
|
51 |
+
}
|
52 |
+
return $admin_val;
|
53 |
+
}
|
54 |
+
|
55 |
+
/* Our shortcode function.
|
56 |
+
Slider settings comes from both admin settings and shortcode attributes.
|
57 |
+
Shortcode attributes, if present, will override the admin settings.
|
58 |
+
*/
|
59 |
+
public function cycloneslider_shortcode($shortcode_settings) {
|
60 |
+
// Process shortcode settings and return only allowed vars
|
61 |
+
$shortcode_settings = shortcode_atts(
|
62 |
+
array(
|
63 |
+
'id' => 0,
|
64 |
+
'template' => null,
|
65 |
+
'fx' => null,
|
66 |
+
'speed' => null,
|
67 |
+
'timeout' => null,
|
68 |
+
'width' => null,
|
69 |
+
'height' => null,
|
70 |
+
'hover_pause' => null,
|
71 |
+
'show_prev_next' => null,
|
72 |
+
'show_nav' => null,
|
73 |
+
'tile_count' => null,
|
74 |
+
'tile_delay' => null,
|
75 |
+
'tile_vertical' => null,
|
76 |
+
'random' => null,
|
77 |
+
'resize' => null
|
78 |
+
),
|
79 |
+
$shortcode_settings
|
80 |
+
);
|
81 |
+
$slider_id = esc_attr($shortcode_settings['id']);// Slideshow slug
|
82 |
+
|
83 |
+
$cycle_options = array();
|
84 |
+
$this->slider_count++;//make each call to shortcode unique
|
85 |
+
// Get slideshow by id
|
86 |
+
$args = array(
|
87 |
+
'post_type' => 'cycloneslider',
|
88 |
+
'order'=>'ASC',
|
89 |
+
'posts_per_page' => 1,
|
90 |
+
'name'=> $slider_id
|
91 |
+
);
|
92 |
+
|
93 |
+
$args = apply_filters('cycloneslider_wp_query_args', $args);
|
94 |
+
|
95 |
+
$my_query = new WP_Query($args);
|
96 |
+
|
97 |
+
if($my_query->have_posts()):
|
98 |
+
while ( $my_query->have_posts() ) : $my_query->the_post();
|
99 |
+
|
100 |
+
$meta = get_post_custom();
|
101 |
+
$admin_settings = Cyclone_Slider_Data::get_slideshow_settings(get_the_ID());
|
102 |
+
$slider_metas = Cyclone_Slider_Data::get_slides(get_the_ID());
|
103 |
+
|
104 |
+
$image_count = 0; // Number of image slides
|
105 |
+
$video_count = 0; // Number of video slides
|
106 |
+
$custom_count = 0; // Number of custom slides
|
107 |
+
foreach($slider_metas as $i=>$slider_meta){
|
108 |
+
$slider_metas[$i]['title'] = __($slider_meta['title']);
|
109 |
+
$slider_metas[$i]['description'] = __($slider_meta['description']);
|
110 |
+
if($slider_metas[$i]['type']=='image'){
|
111 |
+
$image_count++;
|
112 |
+
} else if($slider_metas[$i]['type']=='video'){
|
113 |
+
$video_count++;
|
114 |
+
} else if($slider_metas[$i]['type']=='custom'){
|
115 |
+
$custom_count++;
|
116 |
+
}
|
117 |
+
}
|
118 |
+
$slides = $this->get_slides_from_meta($slider_metas);
|
119 |
+
|
120 |
+
$template = $this->get_comp_slider_setting($admin_settings['template'], $shortcode_settings['template']);
|
121 |
+
$template = esc_attr($template===null ? 'default' : $template);//fallback to default
|
122 |
+
$slider_settings['fx'] = esc_attr($this->get_comp_slider_setting($admin_settings['fx'], $shortcode_settings['fx']));
|
123 |
+
$slider_settings['speed'] = (int) $this->get_comp_slider_setting($admin_settings['speed'], $shortcode_settings['speed']);
|
124 |
+
$slider_settings['timeout'] = (int) $this->get_comp_slider_setting($admin_settings['timeout'], $shortcode_settings['timeout']);
|
125 |
+
$slider_settings['width'] = (int) $this->get_comp_slider_setting($admin_settings['width'], $shortcode_settings['width']);
|
126 |
+
$slider_settings['height'] = (int) $this->get_comp_slider_setting($admin_settings['height'], $shortcode_settings['height']);
|
127 |
+
$slider_settings['hover_pause'] = $this->get_comp_slider_setting($admin_settings['hover_pause'], $shortcode_settings['hover_pause']);
|
128 |
+
$slider_settings['show_prev_next'] = (int) $this->get_comp_slider_setting($admin_settings['show_prev_next'], $shortcode_settings['show_prev_next']);
|
129 |
+
$slider_settings['show_nav'] = (int) $this->get_comp_slider_setting($admin_settings['show_nav'], $shortcode_settings['show_nav']);
|
130 |
+
|
131 |
+
$slider_settings['tile_count'] = $this->get_comp_slider_setting($admin_settings['tile_count'], $shortcode_settings['tile_count']);
|
132 |
+
$slider_settings['tile_delay'] = $this->get_comp_slider_setting($admin_settings['tile_delay'], $shortcode_settings['tile_delay']);
|
133 |
+
$slider_settings['tile_vertical'] = $this->get_comp_slider_setting($admin_settings['tile_vertical'], $shortcode_settings['tile_vertical']);
|
134 |
+
|
135 |
+
$slider_settings['random'] = $this->get_comp_slider_setting($admin_settings['random'], $shortcode_settings['random']);
|
136 |
+
$slider_settings['resize'] = $this->get_comp_slider_setting($admin_settings['resize'], $shortcode_settings['resize']);
|
137 |
+
|
138 |
+
$slider_settings['template'] = $template;
|
139 |
+
|
140 |
+
if($slider_settings['random']){
|
141 |
+
shuffle($slider_metas);
|
142 |
+
}
|
143 |
+
|
144 |
+
$slider = $this->get_slider_template($slider_id, $template, $slides, $slider_metas, $slider_settings, $this->slider_count, $image_count, $video_count, $custom_count);
|
145 |
+
|
146 |
+
endwhile;
|
147 |
+
|
148 |
+
wp_reset_postdata();
|
149 |
+
|
150 |
+
else:
|
151 |
+
$slider = sprintf(__('[Slideshow "%s" not found]', 'cycloneslider'), $slider_id);
|
152 |
+
endif;
|
153 |
+
|
154 |
+
return $slider;
|
155 |
+
}
|
156 |
+
|
157 |
+
// Get slideshow template
|
158 |
+
public function get_slider_template($slider_id, $template_name, $slides, $slider_metas, $slider_settings, $slider_count, $image_count, $video_count, $custom_count){
|
159 |
+
|
160 |
+
$template = get_stylesheet_directory()."/cycloneslider/{$template_name}/slider.php";
|
161 |
+
if(@is_file($template)){
|
162 |
+
ob_start();
|
163 |
+
include($template);
|
164 |
+
$html = ob_get_clean();
|
165 |
+
return $html = $this->trim_white_spaces($html);
|
166 |
+
}
|
167 |
+
|
168 |
+
$template = Cyclone_Slider_Data::get_templates_folder()."{$template_name}/slider.php";
|
169 |
+
if(@is_file($template)) {
|
170 |
+
ob_start();
|
171 |
+
include($template);
|
172 |
+
$html = ob_get_clean();
|
173 |
+
return $html = $this->trim_white_spaces($html);
|
174 |
+
}
|
175 |
+
|
176 |
+
return sprintf(__('[Template "%s" not found]', 'cycloneslider'), $template_name);
|
177 |
+
}
|
178 |
+
|
179 |
+
public function trim_white_spaces($buffer){
|
180 |
+
$search = array(
|
181 |
+
'/\>[^\S ]+/s', //strip whitespaces after tags, except space
|
182 |
+
'/[^\S ]+\</s', //strip whitespaces before tags, except space
|
183 |
+
'/(\s)+/s' // shorten multiple whitespace sequences
|
184 |
+
);
|
185 |
+
$replace = array(
|
186 |
+
'>',
|
187 |
+
'<',
|
188 |
+
'\\1'
|
189 |
+
);
|
190 |
+
return preg_replace($search, $replace, $buffer);
|
191 |
+
}
|
192 |
+
|
193 |
+
// Return array of slide urls from meta
|
194 |
+
public function get_slides_from_meta($slider_metas){
|
195 |
+
$slides = array();
|
196 |
+
if(is_array($slider_metas)){
|
197 |
+
foreach($slider_metas as $slider_meta){
|
198 |
+
$attachment_id = (int) $slider_meta['id'];
|
199 |
+
$image_url = wp_get_attachment_url($attachment_id);
|
200 |
+
$image_url = ($image_url===false) ? '' : $image_url;
|
201 |
+
$slides[] = $image_url;
|
202 |
+
}
|
203 |
+
}
|
204 |
+
return $slides;
|
205 |
+
}
|
206 |
+
|
207 |
+
} // end class
|
208 |
+
|
209 |
+
endif;
|
{inc → classes}/class-cyclone-templates.php
RENAMED
File without changes
|
{inc → classes}/class-image-resizer.php
RENAMED
File without changes
|
{inc → classes}/class-nextgen-integration.php
RENAMED
File without changes
|
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.5.
|
7 |
Author: Nico Amarilla
|
8 |
Author URI: http://www.codefleet.net/
|
9 |
License:
|
@@ -25,7 +25,7 @@ License:
|
|
25 |
|
26 |
*/
|
27 |
if(!defined('CYCLONE_VERSION')){
|
28 |
-
define('CYCLONE_VERSION', '2.5.
|
29 |
}
|
30 |
if(!defined('CYCLONE_PATH')){
|
31 |
define('CYCLONE_PATH', realpath(plugin_dir_path(__FILE__)) . DIRECTORY_SEPARATOR );
|
@@ -34,15 +34,22 @@ if(!defined('CYCLONE_URL')){
|
|
34 |
define('CYCLONE_URL', plugin_dir_url(__FILE__) );
|
35 |
}
|
36 |
|
37 |
-
require_once(CYCLONE_PATH.'
|
38 |
-
require_once(CYCLONE_PATH.'
|
|
|
|
|
39 |
require_once(CYCLONE_PATH.'inc/functions.php');
|
40 |
-
require_once(CYCLONE_PATH.'
|
41 |
-
require_once(CYCLONE_PATH.'
|
42 |
-
require_once(CYCLONE_PATH.'
|
43 |
|
44 |
$cyclone_slider_saved_done = false; //Global variable to limit save_post execution to only once
|
45 |
|
46 |
if(class_exists('Cyclone_Slider')):
|
|
|
|
|
|
|
|
|
|
|
47 |
$cyclone_slider_plugin_instance = new Cyclone_Slider(); //Store the plugin instance to a global object so that other plugins can use remove_action and remove_filter against cyclones class functions if needed.
|
48 |
endif;
|
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.5.4
|
7 |
Author: Nico Amarilla
|
8 |
Author URI: http://www.codefleet.net/
|
9 |
License:
|
25 |
|
26 |
*/
|
27 |
if(!defined('CYCLONE_VERSION')){
|
28 |
+
define('CYCLONE_VERSION', '2.5.4' );
|
29 |
}
|
30 |
if(!defined('CYCLONE_PATH')){
|
31 |
define('CYCLONE_PATH', realpath(plugin_dir_path(__FILE__)) . DIRECTORY_SEPARATOR );
|
34 |
define('CYCLONE_URL', plugin_dir_url(__FILE__) );
|
35 |
}
|
36 |
|
37 |
+
require_once(CYCLONE_PATH.'classes/class-cyclone-slider-data.php');
|
38 |
+
require_once(CYCLONE_PATH.'classes/class-cyclone-templates.php');
|
39 |
+
require_once(CYCLONE_PATH.'classes/class-cyclone-slider-builder.php');
|
40 |
+
require_once(CYCLONE_PATH.'classes/class-cyclone-slider.php');
|
41 |
require_once(CYCLONE_PATH.'inc/functions.php');
|
42 |
+
require_once(CYCLONE_PATH.'classes/class-cyclone-slider-widget.php');
|
43 |
+
require_once(CYCLONE_PATH.'classes/class-image-resizer.php');
|
44 |
+
require_once(CYCLONE_PATH.'classes/class-nextgen-integration.php');
|
45 |
|
46 |
$cyclone_slider_saved_done = false; //Global variable to limit save_post execution to only once
|
47 |
|
48 |
if(class_exists('Cyclone_Slider')):
|
49 |
+
|
50 |
+
load_plugin_textdomain( 'cycloneslider', false, 'cyclone-slider-2/lang' );
|
51 |
+
|
52 |
+
$cyclone_slider_data = new Cyclone_Slider_Data();
|
53 |
+
$cyclone_slider_builder = new Cyclone_Slider_Builder();
|
54 |
$cyclone_slider_plugin_instance = new Cyclone_Slider(); //Store the plugin instance to a global object so that other plugins can use remove_action and remove_filter against cyclones class functions if needed.
|
55 |
endif;
|
inc/admin-parts/box.php
CHANGED
@@ -30,7 +30,7 @@
|
|
30 |
</div>
|
31 |
<?php
|
32 |
if($this->debug){
|
33 |
-
|
34 |
}
|
35 |
?>
|
36 |
<div class="clear"></div>
|
30 |
</div>
|
31 |
<?php
|
32 |
if($this->debug){
|
33 |
+
Cyclone_Slider_Data::debug($slider_meta);
|
34 |
}
|
35 |
?>
|
36 |
<div class="clear"></div>
|
inc/class-cyclone-slider.php
DELETED
@@ -1,1025 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
if(!class_exists('Cyclone_Slider')):
|
3 |
-
class Cyclone_Slider {
|
4 |
-
public $slider_count;
|
5 |
-
public $effects;
|
6 |
-
public $debug;
|
7 |
-
private $message_id;
|
8 |
-
public $templates;
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Initializes the plugin by setting localization, filters, and administration functions.
|
12 |
-
*/
|
13 |
-
public function __construct() {
|
14 |
-
// Set defaults
|
15 |
-
$this->slider_count = 0;
|
16 |
-
$this->effects = self::get_slide_effects();
|
17 |
-
$this->debug = false;
|
18 |
-
|
19 |
-
load_plugin_textdomain( 'cycloneslider', false, 'cyclone-slider-2/lang' );
|
20 |
-
|
21 |
-
// Register admin styles and scripts
|
22 |
-
add_action( 'admin_enqueue_scripts', array( $this, 'register_wp_media' ), 9);
|
23 |
-
add_action( 'admin_enqueue_scripts', array( $this, 'register_admin_scripts' ), 10);
|
24 |
-
|
25 |
-
// Register frontend styles and scripts
|
26 |
-
add_action( 'wp_enqueue_scripts', array( $this, 'register_plugin_scripts' ), 100 );
|
27 |
-
|
28 |
-
|
29 |
-
// Add admin menus
|
30 |
-
add_action( 'init', array( $this, 'create_post_types' ) );
|
31 |
-
|
32 |
-
// Update the messages for our custom post make it appropriate for slideshow
|
33 |
-
add_filter('post_updated_messages', array( $this, 'post_updated_messages' ) );
|
34 |
-
|
35 |
-
// Add slider metaboxes
|
36 |
-
add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ) );
|
37 |
-
|
38 |
-
// Save slides
|
39 |
-
add_action( 'save_post', array( $this, 'save_post' ) );
|
40 |
-
|
41 |
-
// Hacky way to change text in thickbox
|
42 |
-
add_filter( 'gettext', array( $this, 'replace_text_in_thickbox' ), 10, 3 );
|
43 |
-
|
44 |
-
// Modify html of image
|
45 |
-
add_filter( 'image_send_to_editor', array( $this, 'image_send_to_editor'), 1, 8 );
|
46 |
-
|
47 |
-
// Custom columns
|
48 |
-
add_action( 'manage_cycloneslider_posts_custom_column', array( $this, 'custom_column' ), 10, 2);
|
49 |
-
add_filter( 'manage_edit-cycloneslider_columns', array( $this, 'slideshow_columns') );
|
50 |
-
|
51 |
-
// Add hook for admin footer
|
52 |
-
add_action('admin_footer', array( $this, 'admin_footer') );
|
53 |
-
|
54 |
-
// Our shortcode
|
55 |
-
add_shortcode('cycloneslider', array( $this, 'cycloneslider_shortcode') );
|
56 |
-
|
57 |
-
// Add hook for ajax operations if logged in
|
58 |
-
add_action( 'wp_ajax_cycloneslider_get_video', array( $this, 'cycloneslider_get_video' ) );
|
59 |
-
|
60 |
-
|
61 |
-
$version = get_option('cycloneslider_version');
|
62 |
-
|
63 |
-
$this->templates = new Cyclone_Templates();
|
64 |
-
$this->templates->add_template_location(
|
65 |
-
array(
|
66 |
-
'path'=>self::get_templates_folder(), //this resides in the plugin
|
67 |
-
'url'=>self::url().'templates/'
|
68 |
-
)
|
69 |
-
);
|
70 |
-
$this->templates->add_template_location(
|
71 |
-
array(
|
72 |
-
'path'=> realpath(get_stylesheet_directory()).DIRECTORY_SEPARATOR.'cycloneslider'.DIRECTORY_SEPARATOR,//this resides in the current theme or child theme
|
73 |
-
'url'=> get_stylesheet_directory_uri()."/cycloneslider/"
|
74 |
-
)
|
75 |
-
);
|
76 |
-
|
77 |
-
} // end constructor
|
78 |
-
|
79 |
-
|
80 |
-
/**
|
81 |
-
* Add js and css for WP media manager.
|
82 |
-
*/
|
83 |
-
public function register_wp_media(){
|
84 |
-
global $wp_version;
|
85 |
-
|
86 |
-
if('cycloneslider' == get_post_type()){ /* Load only scripts here and not on all admin pages */
|
87 |
-
|
88 |
-
if ( version_compare( $wp_version, '3.5', '<' ) ) { // Use old media manager
|
89 |
-
|
90 |
-
wp_enqueue_style('thickbox');
|
91 |
-
|
92 |
-
wp_enqueue_script('media-upload');
|
93 |
-
wp_enqueue_script('thickbox');
|
94 |
-
|
95 |
-
} else {
|
96 |
-
// Required media files for new media manager. Since WP 3.5+
|
97 |
-
wp_enqueue_media();
|
98 |
-
}
|
99 |
-
}
|
100 |
-
}
|
101 |
-
|
102 |
-
/**
|
103 |
-
* Admin js and css
|
104 |
-
*/
|
105 |
-
public function register_admin_scripts() {
|
106 |
-
|
107 |
-
if('cycloneslider' == get_post_type()){ /* Load only scripts here and not on all admin pages */
|
108 |
-
|
109 |
-
wp_enqueue_style( 'cycloneslider-admin-styles', self::url().'css/admin.css', array(), CYCLONE_VERSION );
|
110 |
-
|
111 |
-
//scripts
|
112 |
-
wp_dequeue_script( 'autosave' );//disable autosave
|
113 |
-
|
114 |
-
|
115 |
-
wp_enqueue_script('jquery-ui-sortable');
|
116 |
-
|
117 |
-
wp_enqueue_script( 'store', self::url().'js/store-json2.min.js', array('jquery'), CYCLONE_VERSION );
|
118 |
-
|
119 |
-
wp_register_script( 'cycloneslider-admin-script', self::url().'js/admin.js', array('jquery'), CYCLONE_VERSION );
|
120 |
-
wp_localize_script( 'cycloneslider-admin-script', 'cycloneslider_admin_vars',
|
121 |
-
array(
|
122 |
-
'title' => __( 'Select an image', 'cycloneslider' ), // This will be used as the default title
|
123 |
-
'button' => __( 'Add to Slide', 'cycloneslider' ) // This will be used as the default button text
|
124 |
-
)
|
125 |
-
);
|
126 |
-
wp_enqueue_script( 'cycloneslider-admin-script');
|
127 |
-
|
128 |
-
}
|
129 |
-
}
|
130 |
-
|
131 |
-
/**
|
132 |
-
* Registers and enqueues frontend-specific scripts.
|
133 |
-
*/
|
134 |
-
public function register_plugin_scripts() {
|
135 |
-
$theme_folder = basename(get_stylesheet_directory());
|
136 |
-
|
137 |
-
/*** Styles ***/
|
138 |
-
wp_enqueue_style( 'cyclone-templates-styles', self::url().'template-assets.php?type=css&theme='.$theme_folder, array(), CYCLONE_VERSION );
|
139 |
-
|
140 |
-
/*** Scripts ***/
|
141 |
-
wp_enqueue_script( 'cyclone-slider', self::url().'js/cyclone-slider.min.js', array('jquery'), CYCLONE_VERSION ); //Consolidated cycle2 script and plugins
|
142 |
-
|
143 |
-
wp_enqueue_script( 'cyclone-templates-scripts', self::url().'template-assets.php?type=js&theme='.$theme_folder, array('jquery'), CYCLONE_VERSION );//Contains our combined css from ALL templates
|
144 |
-
|
145 |
-
}
|
146 |
-
|
147 |
-
/**
|
148 |
-
* Create Post Types
|
149 |
-
*
|
150 |
-
* Create custom post for slideshows
|
151 |
-
*/
|
152 |
-
public function create_post_types() {
|
153 |
-
register_post_type( 'cycloneslider',
|
154 |
-
array(
|
155 |
-
'labels' => array(
|
156 |
-
'name' => __('Cyclone Slider', 'cycloneslider'),
|
157 |
-
'singular_name' => __('Slideshow', 'cycloneslider'),
|
158 |
-
'add_new' => __('Add Slideshow', 'cycloneslider'),
|
159 |
-
'add_new_item' => __('Add New Slideshow', 'cycloneslider'),
|
160 |
-
'edit_item' => __('Edit Slideshow', 'cycloneslider'),
|
161 |
-
'new_item' => __('New Slideshow', 'cycloneslider'),
|
162 |
-
'view_item' => __('View Slideshow', 'cycloneslider'),
|
163 |
-
'search_items' => __('Search Slideshows', 'cycloneslider'),
|
164 |
-
'not_found' => __('No slideshows found', 'cycloneslider'),
|
165 |
-
'not_found_in_trash' => __('No slideshows found in Trash', 'cycloneslider')
|
166 |
-
),
|
167 |
-
'supports' => array('title'),
|
168 |
-
'public' => false,
|
169 |
-
'exclude_from_search' => true,
|
170 |
-
'show_ui' => true,
|
171 |
-
'menu_position' => 100
|
172 |
-
)
|
173 |
-
);
|
174 |
-
}
|
175 |
-
|
176 |
-
/**
|
177 |
-
* Add custom messages
|
178 |
-
*
|
179 |
-
* @return array Messages for cyclone
|
180 |
-
*/
|
181 |
-
public function post_updated_messages($messages){
|
182 |
-
global $post, $post_ID;
|
183 |
-
$messages['cycloneslider'] = array(
|
184 |
-
0 => '',
|
185 |
-
1 => sprintf( __( 'Slideshow updated. Shortcode is [cycloneslider id="%s"]', 'cycloneslider' ), $post->post_name),
|
186 |
-
2 => __( 'Custom field updated.', 'cycloneslider' ),
|
187 |
-
3 => __( 'Custom field deleted.', 'cycloneslider' ),
|
188 |
-
4 => __( 'Slideshow updated.', 'cycloneslider' ),
|
189 |
-
5 => __( 'Slideshow updated.', 'cycloneslider' ),
|
190 |
-
6 => sprintf( __( 'Slideshow published. Shortcode is [cycloneslider id="%s"]', 'cycloneslider' ), $post->post_name),
|
191 |
-
7 => __( 'Slideshow saved.', 'cycloneslider' ),
|
192 |
-
8 => __( 'Slideshow updated.', 'cycloneslider' ),
|
193 |
-
9 => __( 'Slideshow updated.', 'cycloneslider' ),
|
194 |
-
10 => __( 'Slideshow updated.', 'cycloneslider' ),
|
195 |
-
101 => sprintf( __( 'Templates CSS could not be saved. Make sure %stemplates.css is writable.', 'cycloneslider' ), self::path().'css'.DIRECTORY_SEPARATOR),
|
196 |
-
102 => sprintf( __( 'Templates JS could not be saved. Make sure %stemplates.js is writable.', 'cycloneslider' ), self::path().'js'.DIRECTORY_SEPARATOR)
|
197 |
-
);
|
198 |
-
return $messages;
|
199 |
-
}
|
200 |
-
|
201 |
-
/**
|
202 |
-
* Show custom messages
|
203 |
-
*
|
204 |
-
* @return array The array of locations containing path and url
|
205 |
-
*/
|
206 |
-
public function throw_message($location) {
|
207 |
-
$location = add_query_arg( 'message', $this->message_id, $location );
|
208 |
-
$this->message_id = 0;
|
209 |
-
return $location;
|
210 |
-
}
|
211 |
-
|
212 |
-
/**
|
213 |
-
* Add Meta Boxes
|
214 |
-
*
|
215 |
-
* Add custom metaboxes to our custom post type
|
216 |
-
*/
|
217 |
-
public function add_meta_boxes(){
|
218 |
-
add_meta_box(
|
219 |
-
'cyclone-slides-metabox',
|
220 |
-
__('Slides', 'cycloneslider'),
|
221 |
-
array( $this, 'render_slides_meta_box' ),
|
222 |
-
'cycloneslider' ,
|
223 |
-
'normal',
|
224 |
-
'high'
|
225 |
-
);
|
226 |
-
add_meta_box(
|
227 |
-
'cyclone-slider-properties-metabox',
|
228 |
-
__('Slideshow Settings', 'cycloneslider'),
|
229 |
-
array( $this, 'render_slider_properties_meta_box' ),
|
230 |
-
'cycloneslider' ,
|
231 |
-
'side',
|
232 |
-
'low'
|
233 |
-
);
|
234 |
-
add_meta_box(
|
235 |
-
'cyclone-slider-templates-metabox',
|
236 |
-
__('Slideshow Templates', 'cycloneslider'),
|
237 |
-
array( $this, 'render_slider_templates_meta_box' ),
|
238 |
-
'cycloneslider' ,
|
239 |
-
'normal',
|
240 |
-
'low'
|
241 |
-
);
|
242 |
-
}
|
243 |
-
|
244 |
-
/**
|
245 |
-
* Metabox for slides
|
246 |
-
*/
|
247 |
-
public function render_slides_meta_box($post){
|
248 |
-
|
249 |
-
// Use nonce for verification
|
250 |
-
echo '<input type="hidden" name="cycloneslider_metabox_nonce" value="', wp_create_nonce(basename(__FILE__)), '" />';
|
251 |
-
|
252 |
-
$slider_settings = self::get_slideshow_settings($post->ID);
|
253 |
-
$slider_metas = self::get_slides($post->ID);
|
254 |
-
|
255 |
-
?>
|
256 |
-
<div class="cs-sortables" data-post-id="<?php echo $post->ID; ?>">
|
257 |
-
<?php
|
258 |
-
if(is_array($slider_metas) and count($slider_metas)>0):
|
259 |
-
|
260 |
-
foreach($slider_metas as $i=>$slider_meta):
|
261 |
-
|
262 |
-
$image_url = $this->get_slide_img_thumb($slider_meta['id']);
|
263 |
-
$image_url = apply_filters('cycloneslider_preview_url', $image_url, $slider_meta);
|
264 |
-
$box_title = apply_filters('cycloneslider_box_title', __('Slide', 'cycloneslider'), $slider_meta).' '.($i+1);
|
265 |
-
|
266 |
-
include(self::get_admin_parts_folder().'box.php');
|
267 |
-
endforeach;
|
268 |
-
|
269 |
-
endif;
|
270 |
-
?>
|
271 |
-
</div><!-- end .cycloneslider-sortable -->
|
272 |
-
|
273 |
-
<input type="button" value="<?php _e('Add Slide', 'cycloneslider'); ?>" class="cs-add-slide button-secondary" />
|
274 |
-
<?php
|
275 |
-
}
|
276 |
-
|
277 |
-
/**
|
278 |
-
* Metabox for slide properties
|
279 |
-
*/
|
280 |
-
public function render_slider_properties_meta_box($post){
|
281 |
-
// Use nonce for verification
|
282 |
-
echo '<input type="hidden" name="cycloneslider_metabox_nonce" value="', wp_create_nonce(basename(__FILE__)), '" />';
|
283 |
-
|
284 |
-
$slider_settings = self::get_slideshow_settings($post->ID);
|
285 |
-
|
286 |
-
if($this->debug){
|
287 |
-
self::debug($slider_settings);
|
288 |
-
}
|
289 |
-
|
290 |
-
include(self::get_admin_parts_folder() . 'slider-properties.php');
|
291 |
-
}
|
292 |
-
|
293 |
-
/**
|
294 |
-
* Metabox for templates
|
295 |
-
*/
|
296 |
-
public function render_slider_templates_meta_box($post){
|
297 |
-
// Use nonce for verification
|
298 |
-
echo '<input type="hidden" name="cycloneslider_metabox_nonce" value="', wp_create_nonce(basename(__FILE__)), '" />';
|
299 |
-
|
300 |
-
$slider_settings = self::get_slideshow_settings($post->ID);
|
301 |
-
|
302 |
-
$templates = $this->templates->get_all_templates();
|
303 |
-
if($this->debug){
|
304 |
-
self::debug($templates);
|
305 |
-
}
|
306 |
-
include(self::get_admin_parts_folder() . 'template-selection.php');
|
307 |
-
}
|
308 |
-
|
309 |
-
/**
|
310 |
-
* Save post hook
|
311 |
-
*/
|
312 |
-
public function save_post($post_id){
|
313 |
-
global $cyclone_slider_saved_done;
|
314 |
-
|
315 |
-
// Stop! We have already saved..
|
316 |
-
if($cyclone_slider_saved_done){
|
317 |
-
return $post_id;
|
318 |
-
}
|
319 |
-
|
320 |
-
// Verify nonce
|
321 |
-
$nonce_name = 'cycloneslider_metabox_nonce';
|
322 |
-
if (!empty($_POST[$nonce_name])) {
|
323 |
-
if (!wp_verify_nonce($_POST[$nonce_name], basename(__FILE__))) {
|
324 |
-
return $post_id;
|
325 |
-
}
|
326 |
-
} else {
|
327 |
-
return $post_id; // Make sure we cancel on missing nonce!
|
328 |
-
}
|
329 |
-
|
330 |
-
// Check autosave
|
331 |
-
if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
|
332 |
-
return $post_id;
|
333 |
-
}
|
334 |
-
|
335 |
-
do_action('cycloneslider_before_save', $post_id);
|
336 |
-
|
337 |
-
// Save slides
|
338 |
-
$this->save_slides($post_id);
|
339 |
-
|
340 |
-
// Save slideshow ettings
|
341 |
-
$this->save_settings($post_id);
|
342 |
-
|
343 |
-
update_option('cycloneslider_version', CYCLONE_VERSION);
|
344 |
-
}
|
345 |
-
|
346 |
-
/**
|
347 |
-
* Save slides sanitize if needed
|
348 |
-
*/
|
349 |
-
public function save_slides($post_id){
|
350 |
-
$slides = array();
|
351 |
-
if(isset($_POST['cycloneslider_metas'])){
|
352 |
-
|
353 |
-
$i=0;//always start from 0
|
354 |
-
foreach($_POST['cycloneslider_metas'] as $slide){
|
355 |
-
$slide = wp_parse_args($slide, self::get_slide_defaults());
|
356 |
-
$slides[$i]['id'] = (int) ($slide['id']);
|
357 |
-
$slides[$i]['type'] = sanitize_text_field($slide['type']);
|
358 |
-
|
359 |
-
$slides[$i]['link'] = esc_url_raw($slide['link']);
|
360 |
-
$slides[$i]['title'] = wp_kses_post($slide['title']);
|
361 |
-
$slides[$i]['description'] = wp_kses_post($slide['description']);
|
362 |
-
$slides[$i]['link_target'] = sanitize_text_field($slide['link_target']);
|
363 |
-
|
364 |
-
$slides[$i]['img_alt'] = sanitize_text_field($slide['img_alt']);
|
365 |
-
$slides[$i]['img_title'] = sanitize_text_field($slide['img_title']);
|
366 |
-
|
367 |
-
$slides[$i]['enable_slide_effects'] = (int) ($slide['enable_slide_effects']);
|
368 |
-
$slides[$i]['fx'] = sanitize_text_field($slide['fx']);
|
369 |
-
$slides[$i]['speed'] = sanitize_text_field($slide['speed']);
|
370 |
-
$slides[$i]['timeout'] = sanitize_text_field($slide['timeout']);
|
371 |
-
$slides[$i]['tile_count'] = sanitize_text_field($slide['tile_count']);
|
372 |
-
$slides[$i]['tile_delay'] = sanitize_text_field($slide['tile_delay']);
|
373 |
-
$slides[$i]['tile_vertical'] = sanitize_text_field($slide['tile_vertical']);
|
374 |
-
|
375 |
-
$slides[$i]['video_thumb'] = esc_url_raw($slide['video_thumb']);
|
376 |
-
$slides[$i]['video_url'] = esc_url_raw($slide['video_url']);
|
377 |
-
$slides[$i]['video'] = $slide['video'];
|
378 |
-
|
379 |
-
$slides[$i]['custom'] = $slide['custom'];
|
380 |
-
|
381 |
-
$i++;
|
382 |
-
}
|
383 |
-
|
384 |
-
|
385 |
-
}
|
386 |
-
$slides = apply_filters('cycloneslider_slides', $slides); //do filter before saving
|
387 |
-
|
388 |
-
delete_post_meta($post_id, '_cycloneslider_metas');
|
389 |
-
update_post_meta($post_id, '_cycloneslider_metas', $slides);
|
390 |
-
}
|
391 |
-
|
392 |
-
/**
|
393 |
-
* Save slideshow settings
|
394 |
-
*/
|
395 |
-
public function save_settings($post_id){
|
396 |
-
if(isset($_POST['cycloneslider_settings'])){
|
397 |
-
$_POST['cycloneslider_settings'] = wp_parse_args($_POST['cycloneslider_settings'], self::get_slideshow_defaults());
|
398 |
-
$settings = array();
|
399 |
-
$settings['template'] = sanitize_text_field($_POST['cycloneslider_settings']['template']);
|
400 |
-
$settings['fx'] = sanitize_text_field($_POST['cycloneslider_settings']['fx']);
|
401 |
-
$settings['timeout'] = (int) ($_POST['cycloneslider_settings']['timeout']);
|
402 |
-
$settings['speed'] = (int) ($_POST['cycloneslider_settings']['speed']);
|
403 |
-
$settings['width'] = (int) ($_POST['cycloneslider_settings']['width']);
|
404 |
-
$settings['height'] = (int) ($_POST['cycloneslider_settings']['height']);
|
405 |
-
$settings['hover_pause'] = sanitize_text_field($_POST['cycloneslider_settings']['hover_pause']);
|
406 |
-
$settings['show_prev_next'] = (int) ($_POST['cycloneslider_settings']['show_prev_next']);
|
407 |
-
$settings['show_nav'] = (int) ($_POST['cycloneslider_settings']['show_nav']);
|
408 |
-
$settings['tile_count'] = (int) ($_POST['cycloneslider_settings']['tile_count']);
|
409 |
-
$settings['tile_delay'] = (int) ($_POST['cycloneslider_settings']['tile_delay']);
|
410 |
-
$settings['tile_vertical'] = sanitize_text_field($_POST['cycloneslider_settings']['tile_vertical']);
|
411 |
-
$settings['random'] = (int) ($_POST['cycloneslider_settings']['random']);
|
412 |
-
$settings['resize'] = (int) ($_POST['cycloneslider_settings']['resize']);
|
413 |
-
|
414 |
-
$settings = apply_filters('cycloneslider_settings', $settings); //do filter before saving
|
415 |
-
|
416 |
-
delete_post_meta($post_id, '_cycloneslider_settings');
|
417 |
-
update_post_meta($post_id, '_cycloneslider_settings', $settings);
|
418 |
-
}
|
419 |
-
}
|
420 |
-
|
421 |
-
/**
|
422 |
-
* Get slide image thumb from id. False on fail
|
423 |
-
*/
|
424 |
-
private function get_slide_img_thumb($attachment_id){
|
425 |
-
$attachment_id = (int) $attachment_id;
|
426 |
-
if($attachment_id > 0){
|
427 |
-
$image_url = wp_get_attachment_image_src( $attachment_id, 'medium', true );
|
428 |
-
$image_url = (is_array($image_url)) ? $image_url[0] : '';
|
429 |
-
return $image_url;
|
430 |
-
}
|
431 |
-
return false;
|
432 |
-
}
|
433 |
-
|
434 |
-
/**
|
435 |
-
* Replace text in media button for WP < 3.5
|
436 |
-
*/
|
437 |
-
public function replace_text_in_thickbox($translation, $text, $domain ) {
|
438 |
-
$http_referrer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';
|
439 |
-
$req_referrer = isset($_REQUEST['referer']) ? $_REQUEST['referer'] : '';
|
440 |
-
if(strpos($http_referrer, 'cycloneslider')!==false or $req_referrer=='cycloneslider') {
|
441 |
-
if ( 'default' == $domain and 'Insert into Post' == $text )
|
442 |
-
{
|
443 |
-
return 'Add to Slide';
|
444 |
-
}
|
445 |
-
}
|
446 |
-
return $translation;
|
447 |
-
}
|
448 |
-
|
449 |
-
// Add attachment ID as html5 data attr in thickbox
|
450 |
-
public function image_send_to_editor( $html, $id, $caption, $title, $align, $url, $size, $alt = '' ){
|
451 |
-
if(strpos($html, '<img data-id="')===false){
|
452 |
-
$html = str_replace('<img', '<img data-id="'.$id.'" ', $html);
|
453 |
-
}
|
454 |
-
return $html;
|
455 |
-
}
|
456 |
-
|
457 |
-
// Modify columns
|
458 |
-
public function slideshow_columns($columns) {
|
459 |
-
$columns = array();
|
460 |
-
$columns['title']= __('Slideshow Name', 'cycloneslider');
|
461 |
-
$columns['template']= __('Template', 'cycloneslider');
|
462 |
-
$columns['images']= __('Images', 'cycloneslider');
|
463 |
-
$columns['id']= __('Slideshow ID', 'cycloneslider');
|
464 |
-
$columns['shortcode']= __('Shortcode', 'cycloneslider');
|
465 |
-
return $columns;
|
466 |
-
}
|
467 |
-
|
468 |
-
// Add content to custom columns
|
469 |
-
public function custom_column( $column_name, $post_id ){
|
470 |
-
if ($column_name == 'template') {
|
471 |
-
$settings = self::get_slideshow_settings($post_id);
|
472 |
-
echo ucwords($settings['template']);
|
473 |
-
}
|
474 |
-
if ($column_name == 'images') {
|
475 |
-
echo '<div style="text-align:center; max-width:40px;">' . self::get_image_count($post_id) . '</div>';
|
476 |
-
}
|
477 |
-
if ($column_name == 'id') {
|
478 |
-
$post = get_post($post_id);
|
479 |
-
echo $post->post_name;
|
480 |
-
}
|
481 |
-
if ($column_name == 'shortcode') {
|
482 |
-
$post = get_post($post_id);
|
483 |
-
echo '[cycloneslider id="'.$post->post_name.'"]';
|
484 |
-
}
|
485 |
-
}
|
486 |
-
|
487 |
-
// Hook to admin footer
|
488 |
-
public function admin_footer() {
|
489 |
-
$this->slide_box_for_js();
|
490 |
-
}
|
491 |
-
|
492 |
-
// For js adding of box
|
493 |
-
public function slide_box_for_js(){
|
494 |
-
if(get_post_type()=='cycloneslider'){
|
495 |
-
$box_title = __('Slide *', 'cycloneslider');
|
496 |
-
$image_url = '';
|
497 |
-
$i = '{id}';
|
498 |
-
$slider_meta = self::get_slide_defaults();
|
499 |
-
foreach($slider_meta as $key=>$value){
|
500 |
-
$slider_meta[$key] = '';
|
501 |
-
}
|
502 |
-
$slider_meta['type'] = 'image';
|
503 |
-
?>
|
504 |
-
<div class="cs-slide-skeleton">
|
505 |
-
<?php
|
506 |
-
include(self::get_admin_parts_folder().'box.php');
|
507 |
-
?>
|
508 |
-
</div><!-- end .cycloneslider-box-template -->
|
509 |
-
<?php
|
510 |
-
}
|
511 |
-
}
|
512 |
-
|
513 |
-
// Compare the value from admin and shortcode. If shortcode value is present and not empty, use it, otherwise return admin value
|
514 |
-
public function get_comp_slider_setting($admin_val, $shortcode_val){
|
515 |
-
if($shortcode_val!==null){//make sure its really null and not just int zero 0
|
516 |
-
return $shortcode_val;
|
517 |
-
}
|
518 |
-
return $admin_val;
|
519 |
-
}
|
520 |
-
|
521 |
-
/* Our shortcode function.
|
522 |
-
Slider settings comes from both admin settings and shortcode attributes.
|
523 |
-
Shortcode attributes, if present, will override the admin settings.
|
524 |
-
*/
|
525 |
-
public function cycloneslider_shortcode($shortcode_settings) {
|
526 |
-
// Process shortcode settings and return only allowed vars
|
527 |
-
$shortcode_settings = shortcode_atts(
|
528 |
-
array(
|
529 |
-
'id' => 0,
|
530 |
-
'template' => null,
|
531 |
-
'fx' => null,
|
532 |
-
'speed' => null,
|
533 |
-
'timeout' => null,
|
534 |
-
'width' => null,
|
535 |
-
'height' => null,
|
536 |
-
'hover_pause' => null,
|
537 |
-
'show_prev_next' => null,
|
538 |
-
'show_nav' => null,
|
539 |
-
'tile_count' => null,
|
540 |
-
'tile_delay' => null,
|
541 |
-
'tile_vertical' => null,
|
542 |
-
'random' => null,
|
543 |
-
'resize' => null
|
544 |
-
),
|
545 |
-
$shortcode_settings
|
546 |
-
);
|
547 |
-
$slider_id = esc_attr($shortcode_settings['id']);// Slideshow slug
|
548 |
-
|
549 |
-
$cycle_options = array();
|
550 |
-
$this->slider_count++;//make each call to shortcode unique
|
551 |
-
// Get slideshow by id
|
552 |
-
$args = array(
|
553 |
-
'post_type' => 'cycloneslider',
|
554 |
-
'order'=>'ASC',
|
555 |
-
'posts_per_page' => 1,
|
556 |
-
'name'=> $slider_id
|
557 |
-
);
|
558 |
-
|
559 |
-
$args = apply_filters('cycloneslider_wp_query_args', $args);
|
560 |
-
|
561 |
-
$my_query = new WP_Query($args);
|
562 |
-
|
563 |
-
if($my_query->have_posts()):
|
564 |
-
while ( $my_query->have_posts() ) : $my_query->the_post();
|
565 |
-
|
566 |
-
$meta = get_post_custom();
|
567 |
-
$admin_settings = self::get_slideshow_settings(get_the_ID());
|
568 |
-
$slider_metas = self::get_slides(get_the_ID());
|
569 |
-
|
570 |
-
$image_count = 0; // Number of image slides
|
571 |
-
$video_count = 0; // Number of video slides
|
572 |
-
$custom_count = 0; // Number of custom slides
|
573 |
-
foreach($slider_metas as $i=>$slider_meta){
|
574 |
-
$slider_metas[$i]['title'] = __($slider_meta['title']);
|
575 |
-
$slider_metas[$i]['description'] = __($slider_meta['description']);
|
576 |
-
if($slider_metas[$i]['type']=='image'){
|
577 |
-
$image_count++;
|
578 |
-
} else if($slider_metas[$i]['type']=='video'){
|
579 |
-
$video_count++;
|
580 |
-
} else if($slider_metas[$i]['type']=='custom'){
|
581 |
-
$custom_count++;
|
582 |
-
}
|
583 |
-
}
|
584 |
-
$slides = $this->get_slides_from_meta($slider_metas);
|
585 |
-
|
586 |
-
$template = $this->get_comp_slider_setting($admin_settings['template'], $shortcode_settings['template']);
|
587 |
-
$template = esc_attr($template===null ? 'default' : $template);//fallback to default
|
588 |
-
$slider_settings['fx'] = esc_attr($this->get_comp_slider_setting($admin_settings['fx'], $shortcode_settings['fx']));
|
589 |
-
$slider_settings['speed'] = (int) $this->get_comp_slider_setting($admin_settings['speed'], $shortcode_settings['speed']);
|
590 |
-
$slider_settings['timeout'] = (int) $this->get_comp_slider_setting($admin_settings['timeout'], $shortcode_settings['timeout']);
|
591 |
-
$slider_settings['width'] = (int) $this->get_comp_slider_setting($admin_settings['width'], $shortcode_settings['width']);
|
592 |
-
$slider_settings['height'] = (int) $this->get_comp_slider_setting($admin_settings['height'], $shortcode_settings['height']);
|
593 |
-
$slider_settings['hover_pause'] = $this->get_comp_slider_setting($admin_settings['hover_pause'], $shortcode_settings['hover_pause']);
|
594 |
-
$slider_settings['show_prev_next'] = (int) $this->get_comp_slider_setting($admin_settings['show_prev_next'], $shortcode_settings['show_prev_next']);
|
595 |
-
$slider_settings['show_nav'] = (int) $this->get_comp_slider_setting($admin_settings['show_nav'], $shortcode_settings['show_nav']);
|
596 |
-
|
597 |
-
$slider_settings['tile_count'] = $this->get_comp_slider_setting($admin_settings['tile_count'], $shortcode_settings['tile_count']);
|
598 |
-
$slider_settings['tile_delay'] = $this->get_comp_slider_setting($admin_settings['tile_delay'], $shortcode_settings['tile_delay']);
|
599 |
-
$slider_settings['tile_vertical'] = $this->get_comp_slider_setting($admin_settings['tile_vertical'], $shortcode_settings['tile_vertical']);
|
600 |
-
|
601 |
-
$slider_settings['random'] = $this->get_comp_slider_setting($admin_settings['random'], $shortcode_settings['random']);
|
602 |
-
$slider_settings['resize'] = $this->get_comp_slider_setting($admin_settings['resize'], $shortcode_settings['resize']);
|
603 |
-
|
604 |
-
if($slider_settings['random']){
|
605 |
-
shuffle($slider_metas);
|
606 |
-
}
|
607 |
-
|
608 |
-
$slider = $this->get_slider_template($slider_id, $template, $slides, $slider_metas, $slider_settings, $this->slider_count, $image_count, $video_count, $custom_count);
|
609 |
-
|
610 |
-
endwhile;
|
611 |
-
|
612 |
-
wp_reset_postdata();
|
613 |
-
|
614 |
-
else:
|
615 |
-
$slider = sprintf(__('[Slideshow "%s" not found]', 'cycloneslider'), $slider_id);
|
616 |
-
endif;
|
617 |
-
|
618 |
-
return $slider;
|
619 |
-
}
|
620 |
-
|
621 |
-
// Get slideshow template
|
622 |
-
public function get_slider_template($slider_id, $template_name, $slides, $slider_metas, $slider_settings, $slider_count, $image_count, $video_count, $custom_count){
|
623 |
-
|
624 |
-
$template = get_stylesheet_directory()."/cycloneslider/{$template_name}/slider.php";
|
625 |
-
if(@is_file($template)){
|
626 |
-
ob_start();
|
627 |
-
include($template);
|
628 |
-
$html = ob_get_clean();
|
629 |
-
return $html = $this->trim_white_spaces($html);
|
630 |
-
}
|
631 |
-
|
632 |
-
$template = self::get_templates_folder()."{$template_name}/slider.php";
|
633 |
-
if(@is_file($template)) {
|
634 |
-
ob_start();
|
635 |
-
include($template);
|
636 |
-
$html = ob_get_clean();
|
637 |
-
return $html = $this->trim_white_spaces($html);
|
638 |
-
}
|
639 |
-
|
640 |
-
return sprintf(__('[Template "%s" not found]', 'cycloneslider'), $template_name);
|
641 |
-
}
|
642 |
-
|
643 |
-
public function trim_white_spaces($buffer){
|
644 |
-
$search = array(
|
645 |
-
'/\>[^\S ]+/s', //strip whitespaces after tags, except space
|
646 |
-
'/[^\S ]+\</s', //strip whitespaces before tags, except space
|
647 |
-
'/(\s)+/s' // shorten multiple whitespace sequences
|
648 |
-
);
|
649 |
-
$replace = array(
|
650 |
-
'>',
|
651 |
-
'<',
|
652 |
-
'\\1'
|
653 |
-
);
|
654 |
-
return preg_replace($search, $replace, $buffer);
|
655 |
-
}
|
656 |
-
|
657 |
-
// Return array of slide urls from meta
|
658 |
-
public function get_slides_from_meta($slider_metas){
|
659 |
-
$slides = array();
|
660 |
-
if(is_array($slider_metas)){
|
661 |
-
foreach($slider_metas as $slider_meta){
|
662 |
-
$attachment_id = (int) $slider_meta['id'];
|
663 |
-
$image_url = wp_get_attachment_url($attachment_id);
|
664 |
-
$image_url = ($image_url===false) ? '' : $image_url;
|
665 |
-
$slides[] = $image_url;
|
666 |
-
}
|
667 |
-
}
|
668 |
-
return $slides;
|
669 |
-
}
|
670 |
-
|
671 |
-
|
672 |
-
|
673 |
-
|
674 |
-
/**
|
675 |
-
* GLOBAL STATIC FUNCTIONS
|
676 |
-
*/
|
677 |
-
|
678 |
-
/**
|
679 |
-
* Get All Slideshows
|
680 |
-
*
|
681 |
-
* Get all saves slideshow
|
682 |
-
*
|
683 |
-
* @return array The array of slideshows
|
684 |
-
*/
|
685 |
-
public static function get_all_slideshows(){
|
686 |
-
$args = array(
|
687 |
-
'post_type' => 'cycloneslider',
|
688 |
-
'posts_per_page' => -1
|
689 |
-
);
|
690 |
-
$my_query = new WP_Query($args);
|
691 |
-
$slideshows = array();
|
692 |
-
while ( $my_query->have_posts() ) : $my_query->the_post();
|
693 |
-
$slideshows[] = $my_query->post;
|
694 |
-
endwhile;
|
695 |
-
|
696 |
-
wp_reset_postdata();
|
697 |
-
|
698 |
-
return $slideshows;
|
699 |
-
}
|
700 |
-
|
701 |
-
/**
|
702 |
-
* Get Templates in used
|
703 |
-
*
|
704 |
-
* Get all templates that are used by slideshow
|
705 |
-
*
|
706 |
-
* @return array The array of templates
|
707 |
-
*/
|
708 |
-
public static function get_templates_in_used(){
|
709 |
-
$slideshows = self::get_all_slideshows();
|
710 |
-
$templates_used = array();
|
711 |
-
foreach($slideshows as $slideshow) {
|
712 |
-
$settings = self::get_slideshow_settings($slideshow->ID);
|
713 |
-
$templates_used[$settings['template']] = $settings['template'];
|
714 |
-
}
|
715 |
-
|
716 |
-
return $templates_used;
|
717 |
-
}
|
718 |
-
|
719 |
-
/**
|
720 |
-
* Gets the slideshow settings. Defaults and filters are applied.
|
721 |
-
*
|
722 |
-
* @param int $slideshow_id Post ID of the slideshow custom post.
|
723 |
-
* @return array The array of slideshow settings
|
724 |
-
*/
|
725 |
-
public static function get_slideshow_settings($slideshow_id) {
|
726 |
-
$meta = get_post_custom($slideshow_id);
|
727 |
-
$slideshow_settings = array();
|
728 |
-
if(isset($meta['_cycloneslider_settings'][0]) and !empty($meta['_cycloneslider_settings'][0])){
|
729 |
-
$slideshow_settings = maybe_unserialize($meta['_cycloneslider_settings'][0]);
|
730 |
-
}
|
731 |
-
$slideshow_settings = wp_parse_args($slideshow_settings, self::get_slideshow_defaults() );
|
732 |
-
return apply_filters('cycloneslider_get_slideshow', $slideshow_settings);
|
733 |
-
}
|
734 |
-
|
735 |
-
/**
|
736 |
-
* Gets the slides. Defaults and filters are applied.
|
737 |
-
*
|
738 |
-
* @param int $slideshow_id Post ID of the slideshow custom post.
|
739 |
-
* @return array The array of slides settings
|
740 |
-
*/
|
741 |
-
public static function get_slides($slideshow_id){
|
742 |
-
$meta = get_post_custom($slideshow_id);
|
743 |
-
|
744 |
-
if(isset($meta['_cycloneslider_metas'][0]) and !empty($meta['_cycloneslider_metas'][0])){
|
745 |
-
$slides = maybe_unserialize($meta['_cycloneslider_metas'][0]);
|
746 |
-
$defaults = self::get_slide_defaults();
|
747 |
-
|
748 |
-
foreach($slides as $i=>$slide){
|
749 |
-
$slides[$i] = wp_parse_args($slide, $defaults);
|
750 |
-
}
|
751 |
-
|
752 |
-
return apply_filters('cycloneslider_get_slides', $slides);
|
753 |
-
}
|
754 |
-
return false;
|
755 |
-
}
|
756 |
-
|
757 |
-
/**
|
758 |
-
* Gets the slideshow default settings.
|
759 |
-
*
|
760 |
-
* @return array The array of slideshow defaults
|
761 |
-
*/
|
762 |
-
public static function get_slideshow_defaults(){
|
763 |
-
return array(
|
764 |
-
'template' => 'default',
|
765 |
-
'fx' => 'fade',
|
766 |
-
'timeout' => '4000',
|
767 |
-
'speed' => '1000',
|
768 |
-
'width' => '960',
|
769 |
-
'height' => '300',
|
770 |
-
'hover_pause' => 'true',
|
771 |
-
'show_prev_next' => '1',
|
772 |
-
'show_nav' => '1',
|
773 |
-
'tile_count' => '7',
|
774 |
-
'tile_delay' => '100',
|
775 |
-
'tile_vertical' => 'true',
|
776 |
-
'random' => 0,
|
777 |
-
'resize' => 1
|
778 |
-
);
|
779 |
-
}
|
780 |
-
|
781 |
-
/**
|
782 |
-
* Gets the slide default settings.
|
783 |
-
*
|
784 |
-
* @return array The array of slide defaults
|
785 |
-
*/
|
786 |
-
public static function get_slide_defaults(){
|
787 |
-
return array(
|
788 |
-
'enable_slide_effects'=>0,
|
789 |
-
'type' => 'image',
|
790 |
-
'id' => '',
|
791 |
-
'link' => '',
|
792 |
-
'title' => '',
|
793 |
-
'description' => '',
|
794 |
-
'link_target' => '_self',
|
795 |
-
'fx' => 'default',
|
796 |
-
'speed' => '',
|
797 |
-
'timeout' => '',
|
798 |
-
'tile_count' => '7',
|
799 |
-
'tile_delay' => '100',
|
800 |
-
'tile_vertical' => 'true',
|
801 |
-
'img_alt' => '',
|
802 |
-
'img_title' => '',
|
803 |
-
'video_thumb' => '',
|
804 |
-
'video_url' => '',
|
805 |
-
'video' => '',
|
806 |
-
'custom' => ''
|
807 |
-
);
|
808 |
-
}
|
809 |
-
|
810 |
-
/**
|
811 |
-
* Gets the slide effects.
|
812 |
-
*
|
813 |
-
* @return array The array of slide effects
|
814 |
-
*/
|
815 |
-
public static function get_slide_effects(){
|
816 |
-
return array(
|
817 |
-
'fade'=>'Fade',
|
818 |
-
'fadeout'=>'Fade Out',
|
819 |
-
'none'=>'None',
|
820 |
-
'scrollHorz'=>'Scroll Horizontally',
|
821 |
-
'tileBlind'=>'Tile Blind',
|
822 |
-
'tileSlide'=>'Tile Slide'
|
823 |
-
);
|
824 |
-
}
|
825 |
-
|
826 |
-
/**
|
827 |
-
* Gets the path to plugin
|
828 |
-
*
|
829 |
-
* @return string Path to plugin in the filesystem with trailing slash
|
830 |
-
*/
|
831 |
-
public static function path(){
|
832 |
-
return CYCLONE_PATH;
|
833 |
-
}
|
834 |
-
|
835 |
-
/**
|
836 |
-
* Gets the URL to plugin
|
837 |
-
*
|
838 |
-
* @return string URL to plugin with trailing slash
|
839 |
-
*/
|
840 |
-
public static function url(){
|
841 |
-
return CYCLONE_URL;
|
842 |
-
}
|
843 |
-
|
844 |
-
/**
|
845 |
-
* Gets the path to folder of admin user interface parts with trailing slash
|
846 |
-
*
|
847 |
-
* @return string Path to folder
|
848 |
-
*/
|
849 |
-
public static function get_admin_parts_folder(){
|
850 |
-
return self::path() . 'inc'.DIRECTORY_SEPARATOR.'admin-parts'.DIRECTORY_SEPARATOR;
|
851 |
-
}
|
852 |
-
|
853 |
-
/**
|
854 |
-
* Gets the path to templates folder
|
855 |
-
*
|
856 |
-
* @return string Path to templates inside the plugin with trailing slash
|
857 |
-
*/
|
858 |
-
public static function get_templates_folder(){
|
859 |
-
return self::path() . 'templates'.DIRECTORY_SEPARATOR;
|
860 |
-
}
|
861 |
-
|
862 |
-
/**
|
863 |
-
* Gets the number of images of slideshow
|
864 |
-
*
|
865 |
-
* @param int Slideshow id
|
866 |
-
* @return int Total images or zero
|
867 |
-
*/
|
868 |
-
public static function get_image_count($slideshow_id){
|
869 |
-
$meta = get_post_custom($slideshow_id);
|
870 |
-
|
871 |
-
if(isset($meta['_cycloneslider_metas'][0]) and !empty($meta['_cycloneslider_metas'][0])){
|
872 |
-
$slides = maybe_unserialize($meta['_cycloneslider_metas'][0]);
|
873 |
-
|
874 |
-
return count($slides);
|
875 |
-
}
|
876 |
-
return 0;
|
877 |
-
}
|
878 |
-
|
879 |
-
/**
|
880 |
-
* Print with a twist
|
881 |
-
*/
|
882 |
-
public static function debug($out){
|
883 |
-
echo '<pre>'.print_r($out, true).'</pre>';
|
884 |
-
}
|
885 |
-
|
886 |
-
|
887 |
-
|
888 |
-
|
889 |
-
/**
|
890 |
-
* YOUTUBE & VIMEO
|
891 |
-
*/
|
892 |
-
|
893 |
-
/**
|
894 |
-
* Ajax for getting videos
|
895 |
-
*/
|
896 |
-
public function cycloneslider_get_video(){
|
897 |
-
$url = $_POST['url'];
|
898 |
-
|
899 |
-
$retval = array(
|
900 |
-
'success' => false
|
901 |
-
);
|
902 |
-
|
903 |
-
if (filter_var($url, FILTER_VALIDATE_URL) !== FALSE) {
|
904 |
-
|
905 |
-
if( $video_id = $this->get_youtube_id($url) ){ //If youtube url
|
906 |
-
if( $embed = wp_oembed_get($url) ){ //Get embed, false on fail
|
907 |
-
$retval = array(
|
908 |
-
'success' => true,
|
909 |
-
'url' => $this->get_youtube_thumb($video_id),
|
910 |
-
'embed' => $embed
|
911 |
-
);
|
912 |
-
}
|
913 |
-
|
914 |
-
} else if( $video_id = $this->get_vimeo_id($url) ){ //If vimeo url
|
915 |
-
if( $embed = wp_oembed_get($url) ){ //Get embed, false on fail
|
916 |
-
$retval = array(
|
917 |
-
'success' => true,
|
918 |
-
'url' => $this->get_vimeo_thumb($video_id),
|
919 |
-
'embed' => $embed
|
920 |
-
);
|
921 |
-
}
|
922 |
-
}
|
923 |
-
}
|
924 |
-
|
925 |
-
echo json_encode($retval);
|
926 |
-
die();
|
927 |
-
}
|
928 |
-
|
929 |
-
/**
|
930 |
-
* Get video thumb url
|
931 |
-
*
|
932 |
-
* @param string $url A valid youtube or vimeo url
|
933 |
-
*/
|
934 |
-
public function get_video_thumb_from_url($url){
|
935 |
-
$url = esc_url_raw($url);
|
936 |
-
|
937 |
-
if ( $video_id = $this->get_youtube_id($url) ) { // A youtube url
|
938 |
-
|
939 |
-
return $this->get_youtube_thumb($video_id);
|
940 |
-
|
941 |
-
} else if( $video_id = $this->get_vimeo_id($url) ){ // A vimeo url
|
942 |
-
|
943 |
-
return $this->get_vimeo_thumb($video_id);
|
944 |
-
}
|
945 |
-
|
946 |
-
return false;
|
947 |
-
}
|
948 |
-
|
949 |
-
/**
|
950 |
-
* Return vimeo video id
|
951 |
-
*/
|
952 |
-
public function get_vimeo_id($url){
|
953 |
-
|
954 |
-
$parsed_url = parse_url($url);
|
955 |
-
if ($parsed_url['host'] == 'vimeo.com'){
|
956 |
-
$vimeo_id = ltrim( $parsed_url['path'], '/');
|
957 |
-
if (is_numeric($vimeo_id)) {
|
958 |
-
return $vimeo_id;
|
959 |
-
}
|
960 |
-
}
|
961 |
-
return false;
|
962 |
-
}
|
963 |
-
|
964 |
-
/**
|
965 |
-
* Get vimeo video thumbnail image
|
966 |
-
*
|
967 |
-
* @param int Vimeo ID.
|
968 |
-
* @param string Size can be: thumbnail_small, thumbnail_medium, thumbnail_large.
|
969 |
-
*
|
970 |
-
* @return string URL of thumbnail image.
|
971 |
-
*/
|
972 |
-
public function get_vimeo_thumb($video_id, $size = 'thumbnail_large'){
|
973 |
-
$vimeo = unserialize( file_get_contents('http://vimeo.com/api/v2/video/'.$video_id.'.php') );
|
974 |
-
if( isset($vimeo[0][$size]) ){
|
975 |
-
return $vimeo[0][$size];
|
976 |
-
}
|
977 |
-
return '';
|
978 |
-
}
|
979 |
-
|
980 |
-
/**
|
981 |
-
* Get youtube video thumbnail image
|
982 |
-
*
|
983 |
-
* @param int Youtube ID.
|
984 |
-
*
|
985 |
-
* @return string URL of thumbnail image.
|
986 |
-
*/
|
987 |
-
public function get_youtube_thumb($video_id){
|
988 |
-
return 'http://img.youtube.com/vi/'.$video_id.'/0.jpg';
|
989 |
-
}
|
990 |
-
|
991 |
-
/**
|
992 |
-
* Get youtube ID from different url formats
|
993 |
-
*
|
994 |
-
* @param string $url Youtube url
|
995 |
-
* @return string Youtube URL or boolean false on fail
|
996 |
-
*/
|
997 |
-
public function get_youtube_id($url){
|
998 |
-
if (filter_var($url, FILTER_VALIDATE_URL) === FALSE) {
|
999 |
-
return false;
|
1000 |
-
}
|
1001 |
-
$parsed_url = parse_url($url);
|
1002 |
-
|
1003 |
-
if(strpos($parsed_url['host'], 'youtube.com')!==false){
|
1004 |
-
if(strpos($parsed_url['path'], '/watch')!==false){ // Regular url Eg. http://www.youtube.com/watch?v=9bZkp7q19f0
|
1005 |
-
parse_str($parsed_url['query'], $parsed_str);
|
1006 |
-
if(isset($parsed_str['v']) and !empty($parsed_str['v'])){
|
1007 |
-
return $parsed_str['v'];
|
1008 |
-
}
|
1009 |
-
} else if(strpos($parsed_url['path'], '/v/')!==false){ // "v" URL http://www.youtube.com/v/9bZkp7q19f0?version=3&autohide=1
|
1010 |
-
$id = str_replace('/v/','',$parsed_url['path']);
|
1011 |
-
if( !empty($id) ){
|
1012 |
-
return $id;
|
1013 |
-
}
|
1014 |
-
} else if(strpos($parsed_url['path'], '/embed/')!==false){ // Embed URL: http://www.youtube.com/embed/9bZkp7q19f0
|
1015 |
-
return str_replace('/embed/','',$parsed_url['path']);
|
1016 |
-
}
|
1017 |
-
} else if(strpos($parsed_url['host'], 'youtu.be')!==false){ // Shortened URL: http://youtu.be/9bZkp7q19f0
|
1018 |
-
return str_replace('/','',$parsed_url['path']);
|
1019 |
-
}
|
1020 |
-
|
1021 |
-
return false;
|
1022 |
-
}
|
1023 |
-
} // end class
|
1024 |
-
|
1025 |
-
endif;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inc/functions.php
CHANGED
@@ -116,29 +116,27 @@ function cyclone_settings($slider_settings, $slider_id='', $cycle2_settings=arra
|
|
116 |
* @return string Data attributes for slide.
|
117 |
*/
|
118 |
function cyclone_slide_settings($slider_meta, $slider_settings=array(), $slider_id='', $slider_count=1){
|
119 |
-
$out = '';
|
120 |
-
if(empty($slider_meta['enable_slide_effects'])){
|
121 |
-
return $out;
|
122 |
-
}
|
123 |
-
|
124 |
$cycle2_settings = array();
|
125 |
-
if($slider_meta['
|
126 |
-
$
|
127 |
-
|
128 |
-
if(!empty($slider_meta['speed'])) {
|
129 |
-
$cycle2_settings['data-cycle-speed'] = $slider_meta['speed'];
|
130 |
-
}
|
131 |
-
if(!empty($slider_meta['timeout'])) {
|
132 |
-
$cycle2_settings['data-cycle-timeout'] = $slider_meta['timeout'];
|
133 |
-
}
|
134 |
-
if($slider_meta['fx']=='tileBlind' or $slider_meta['fx']=='tileSlide'){
|
135 |
-
if(!empty($slider_meta['tile_count'])) {
|
136 |
-
$cycle2_settings['data-cycle-tile-count'] = $slider_meta['tile_count'];
|
137 |
}
|
138 |
-
if(!empty($slider_meta['
|
139 |
-
$cycle2_settings['data-cycle-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
140 |
}
|
141 |
-
|
142 |
}
|
143 |
$cycle2_settings = apply_filters('cyclone_cycle2_slide_settings_array', $cycle2_settings, $slider_meta, $slider_settings);
|
144 |
|
116 |
* @return string Data attributes for slide.
|
117 |
*/
|
118 |
function cyclone_slide_settings($slider_meta, $slider_settings=array(), $slider_id='', $slider_count=1){
|
|
|
|
|
|
|
|
|
|
|
119 |
$cycle2_settings = array();
|
120 |
+
if(!empty($slider_meta['enable_slide_effects'])){
|
121 |
+
if($slider_meta['fx']!='default') {
|
122 |
+
$cycle2_settings['data-cycle-fx'] = $slider_meta['fx'];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
123 |
}
|
124 |
+
if(!empty($slider_meta['speed'])) {
|
125 |
+
$cycle2_settings['data-cycle-speed'] = $slider_meta['speed'];
|
126 |
+
}
|
127 |
+
if(!empty($slider_meta['timeout'])) {
|
128 |
+
$cycle2_settings['data-cycle-timeout'] = $slider_meta['timeout'];
|
129 |
+
}
|
130 |
+
if($slider_meta['fx']=='tileBlind' or $slider_meta['fx']=='tileSlide'){
|
131 |
+
if(!empty($slider_meta['tile_count'])) {
|
132 |
+
$cycle2_settings['data-cycle-tile-count'] = $slider_meta['tile_count'];
|
133 |
+
}
|
134 |
+
if(!empty($slider_meta['tile_delay'])) {
|
135 |
+
$cycle2_settings['data-cycle-tile-delay'] = $slider_meta['tile_delay'];
|
136 |
+
}
|
137 |
+
$cycle2_settings['data-cycle-tile-vertical'] = $slider_meta['tile_vertical'];
|
138 |
}
|
139 |
+
|
140 |
}
|
141 |
$cycle2_settings = apply_filters('cyclone_cycle2_slide_settings_array', $cycle2_settings, $slider_meta, $slider_settings);
|
142 |
|
js/cyclone-slider.min.js
CHANGED
@@ -1,12 +1,15 @@
|
|
1 |
-
|
2 |
-
* jQuery Cycle2;
|
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="20130323";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,d;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.API.pause(!0)},function(){b.API.resume(!0)})),b.timeout&&(d=b.API.getSlideOpts(b.nextSlide),b.API.queueTransition(d)),b._initialized=!0,b.API.updateView(!0),b.API.trigger("cycle-initialized",[b]),b.API.postInitSlideshow()},pause:function(b){var c=this.opts(),d=c.API.getSlideOpts(),e=c.hoverPaused||c.paused,f;b?c.hoverPaused=!0:c.paused=!0,e||(c.container.addClass("cycle-paused"),c.API.trigger("cycle-paused",[c]).log("cycle-paused"),d.timeout&&(clearTimeout(c.timeoutId),c.timeoutId=0,f=a.now(),c._remainingTimeout-=f-c._lastQueue,c._remainingTimeout<0&&(c._remainingTimeout=undefined)))},resume:function(a){var b=this.opts(),c=!b.hoverPaused&&!b.paused,d;a?b.hoverPaused=!1:b.paused=!1,c||(b.container.removeClass("cycle-paused"),b.API.queueTransition(b.API.getSlideOpts(),b._remainingTimeout),b.API.trigger("cycle-resumed",[b,b._remainingTimeout]).log("cycle-resumed"))},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.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(b,c){var d=this.opts(),e=c!==undefined?c:b.timeout;if(d.nextSlide===0&&--d.loop===0){d.API.log("terminating; loop=0"),d.timeout=0,e?setTimeout(function(){d.API.trigger("cycle-finished",[d])},e):d.API.trigger("cycle-finished",[d]),d.nextSlide=d.currSlide;return}e&&(d._lastQueue=a.now(),c===undefined&&(d._remainingTimeout=b.timeout),!d.paused&&!d.hoverPaused&&(d.timeoutId=setTimeout(function(){d.API.prepareTx(!1,!d.reverse)},e)))},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];if(!a){b.API.trigger("cycle-update-view-before",[b,c,d]);if(b.updateView<0)return}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,a]),b.API.trigger("cycle-update-view-after",[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){function b(e,f){function k(){f._autoHeightRatio?f.container.height(f.container.width()/i):(clearTimeout(j),j=setTimeout(function(){b(e,f)},50))}var g=f.autoHeight,h,i,j;c(e,f),a(window).on("resize orientationchange",k),f._autoHeightOnResize=k,g==="calc"||a.type(g)=="number"&&g>=0?(g==="calc"?g=d(f):g>=f.slides.length&&(g=0),h=a(f.slides[g]).clone(),h.removeAttr("id name rel").find("[id],[name],[rel]").removeAttr("id name rel"),h.css({position:"static",visibility:"hidden",display:"block"}).prependTo(f.container).addClass("cycle-sentinel cycle-slide"),h.find("*").css("visibility","hidden"),f._sentinel=h):a.type(g)=="string"&&/\d+\:\d+/.test(g)&&(i=g.match(/(\d+)\:(\d+)/),i=i[1]/i[2],f._autoHeightRatio=i,setTimeout(function(){a(window).triggerHandler("resize")},15))}function c(b,c){c._sentinel&&(c._sentinel.remove(),c._sentinel=null),c._autoHeightOnResize&&(a(window).off("resize orientationchange",c._autoHeightOnResize),c._autoHeightOnResize=null)}function d(b){var c=0,d=-1;return b.slides.each(function(b){var e=a(this).height();e>d&&(d=e,c=b)}),c}"use strict",a.extend(a.fn.cycle.defaults,{autoHeight:0}),a(document).on("cycle-initialized cycle-slide-added cycle-slide-removed",b),a(document).on("cycle-destroyed",c)}(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>",captionModule:"caption"}),a(document).on("cycle-update-view",function(b,c,d,e){if(c.captionModule!=="caption")return;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")},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 i(b){var g;c.loader=="wait"?(f.push(b),h===0&&(f.sort(j),d.apply(c.API,[f,e]),c.container.removeClass("cycle-loading"))):(g=a(c.slides[c.currSlide]),d.apply(c.API,[b,e]),g.show(),c.container.removeClass("cycle-loading"))}function j(a,b){return a.data("index")-b.data("index")}var f=[];if(a.type(b)=="string")b=a.trim(b);else if(a.type(b)==="array")for(var g=0;g<b.length;g++)b[g]=a(b[g])[0];b=a(b);var h=b.length;if(!h)return;b.hide().appendTo("body").each(function(b){function l(){--g===0&&(--h,i(j))}var g=0,j=a(this),k=j.is("img")?j:j.find("img");j.data("index",b),k=k.filter(":not(.cycle-loader-ignore)").filter(':not([src=""])');if(!k.length){--h,f.push(j);return}g=k.length,k.each(function(){this.complete?l():a(this).load(function(){l()}).error(function(){--g===0&&(c.API.log("slide skipped; img not loaded:",this.src),--h===0&&c.loader=="wait"&&d.apply(c.API,[f,e]))})})}),h&&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").on(b.nextEvent,function(a){a.preventDefault(),b.API.next()}),b.API.getComponent("prev").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(a,b){b.API.getComponent("prev").off(b.nextEvent),b.API.getComponent("next").off(b.prevEvent),b.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-1]||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);
|
7 |
|
8 |
/*! Plugin for Cycle2; Copyright (c) 2012 M. Alsup; ver: 20130108 */
|
9 |
(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);
|
10 |
|
11 |
/*! Plugin for Cycle2; Copyright (c) 2012 M. Alsup; ver: 20121120 */
|
12 |
-
(function(a){"use strict",a.fn.cycle.transitions.tileSlide=a.fn.cycle.transitions.tileBlind={before:function(b,c,d,e){b.API.stackSlides(c,d,e),a(c).show(),b.container.css("overflow","hidden"),b.tileDelay=b.tileDelay||b.fx=="tileSlide"?100:125,b.tileCount=b.tileCount||7,b.tileVertical=b.tileVertical!==!1,b.container.data("cycleTileInitialized")||(b.container.on("cycle-destroyed",a.proxy(this.onDestroy,b.API)),b.container.data("cycleTileInitialized",!0))},transition:function(b,c,d,e,f){function w(a){g.eq(a).animate(s,{duration:b.speed,easing:b.easing,complete:function(){(e?o-1===a:0===a)&&b._tileAniCallback()}}),setTimeout(function(){(e?o-1!==a:0!==a)&&w(e?a+1:a-1)},b.tileDelay)}b.slides.not(c).not(d).hide();var g=a(),h=a(c),i=a(d),j,k,l,m,n,o=b.tileCount,p=b.tileVertical,q=b.container.height(),r=b.container.width();p?(k=Math.floor(r/o),m=r-k*(o-1),l=n=q):(k=m=r,l=Math.floor(q/o),n=q-l*(o-1)),b.container.find(".cycle-tiles-container").remove();var s,t={left:0,top:0,overflow:"hidden",position:"absolute",margin:0,padding:0};p?s=b.fx=="tileSlide"?{top:q}:{width:0}:s=b.fx=="tileSlide"?{left:r}:{height:0};var u=a('<div class="cycle-tiles-container"></div>');u.css({zIndex:h.css("z-index"),overflow:"visible",position:"absolute",top:0}),u.insertBefore(d);for(var v=0;v<o;v++)j=a("<div></div>").css(t).css({width:o-1===v?m:k,height:o-1===v?n:l,marginLeft:p?v*k:0,marginTop:p?0:v*l}).append(h.clone().css({position:"relative",maxWidth:"none",width:h.width(),margin:0,padding:0,marginLeft:p?-(v*k):0,marginTop:p?0:-(v*l)})),g=g.add(j);u.append(g),h.hide(),i.show().css("opacity",1),w(e?0:o-1),b._tileAniCallback=function(){i.show(),h.hide(),u.remove(),f()}},stopTransition:function(a){a.container.find("*").stop(!0,!0),a._tileAniCallback&&a._tileAniCallback()},onDestroy:function(a){var b=this.opts();b.container.find(".cycle-tiles-container").remove()}}})(jQuery);
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
* jQuery Cycle2; v20130525
|
3 |
* http://jquery.malsup.com/cycle2/
|
4 |
* Copyright (c) 2013 M. Alsup; Dual licensed: MIT/GPL
|
5 |
*/
|
6 |
+
(function(e){"use strict";function t(e){return(e||"").toLowerCase()}var i="20130409";e.fn.cycle=function(i){var n;return 0!==this.length||e.isReady?this.each(function(){var n,s,o,c,r=e(this),l=e.fn.cycle.log;if(!r.data("cycle.opts")){(r.data("cycle-log")===!1||i&&i.log===!1||s&&s.log===!1)&&(l=e.noop),l("--c2 init--"),n=r.data();for(var a in n)n.hasOwnProperty(a)&&/^cycle[A-Z]+/.test(a)&&(c=n[a],o=a.match(/^cycle(.*)/)[1].replace(/^[A-Z]/,t),l(o+":",c,"("+typeof c+")"),n[o]=c);s=e.extend({},e.fn.cycle.defaults,n,i||{}),s.timeoutId=0,s.paused=s.paused||!1,s.container=r,s._maxZ=s.maxZ,s.API=e.extend({_container:r},e.fn.cycle.API),s.API.log=l,s.API.trigger=function(e,t){return s.container.trigger(e,t),s.API},r.data("cycle.opts",s),r.data("cycle.API",s.API),s.API.trigger("cycle-bootstrap",[s,s.API]),s.API.addInitialSlides(),s.API.preInitSlideshow(),s.slides.length&&s.API.initSlideshow()}}):(n={s:this.selector,c:this.context},e.fn.cycle.log("requeuing slideshow (dom not ready)"),e(function(){e(n.s,n.c).cycle(i)}),this)},e.fn.cycle.API={opts:function(){return this._container.data("cycle.opts")},addInitialSlides:function(){var t=this.opts(),i=t.slides;t.slideCount=0,t.slides=e(),i=i.jquery?i:t.container.find(i),t.random&&i.sort(function(){return Math.random()-.5}),t.API.add(i)},preInitSlideshow:function(){var t=this.opts();t.API.trigger("cycle-pre-initialize",[t]);var i=e.fn.cycle.transitions[t.fx];i&&e.isFunction(i.preInit)&&i.preInit(t),t._preInitialized=!0},postInitSlideshow:function(){var t=this.opts();t.API.trigger("cycle-post-initialize",[t]);var i=e.fn.cycle.transitions[t.fx];i&&e.isFunction(i.postInit)&&i.postInit(t)},initSlideshow:function(){var t,i=this.opts(),n=i.container;i.API.calcFirstSlide(),"static"==i.container.css("position")&&i.container.css("position","relative"),e(i.slides[i.currSlide]).css("opacity",1).show(),i.API.stackSlides(i.slides[i.currSlide],i.slides[i.nextSlide],!i.reverse),i.pauseOnHover&&(i.pauseOnHover!==!0&&(n=e(i.pauseOnHover)),n.hover(function(){i.API.pause(!0)},function(){i.API.resume(!0)})),i.timeout&&(t=i.API.getSlideOpts(i.nextSlide),i.API.queueTransition(t,t.timeout+i.delay)),i._initialized=!0,i.API.updateView(!0),i.API.trigger("cycle-initialized",[i]),i.API.postInitSlideshow()},pause:function(t){var i=this.opts(),n=i.API.getSlideOpts(),s=i.hoverPaused||i.paused;t?i.hoverPaused=!0:i.paused=!0,s||(i.container.addClass("cycle-paused"),i.API.trigger("cycle-paused",[i]).log("cycle-paused"),n.timeout&&(clearTimeout(i.timeoutId),i.timeoutId=0,i._remainingTimeout-=e.now()-i._lastQueue,(0>i._remainingTimeout||isNaN(i._remainingTimeout))&&(i._remainingTimeout=void 0)))},resume:function(e){var t=this.opts(),i=!t.hoverPaused&&!t.paused;e?t.hoverPaused=!1:t.paused=!1,i||(t.container.removeClass("cycle-paused"),t.API.queueTransition(t.API.getSlideOpts(),t._remainingTimeout),t.API.trigger("cycle-resumed",[t,t._remainingTimeout]).log("cycle-resumed"))},add:function(t,i){var n,s=this.opts(),o=s.slideCount,c=!1;"string"==e.type(t)&&(t=e.trim(t)),e(t).each(function(){var t,n=e(this);i?s.container.prepend(n):s.container.append(n),s.slideCount++,t=s.API.buildSlideOpts(n),s.slides=i?e(n).add(s.slides):s.slides.add(n),s.API.initSlide(t,n,--s._maxZ),n.data("cycle.opts",t),s.API.trigger("cycle-slide-added",[s,t,n])}),s.API.updateView(!0),c=s._preInitialized&&2>o&&s.slideCount>=1,c&&(s._initialized?s.timeout&&(n=s.slides.length,s.nextSlide=s.reverse?n-1:1,s.timeoutId||s.API.queueTransition(s)):s.API.initSlideshow())},calcFirstSlide:function(){var e,t=this.opts();e=parseInt(t.startingSlide||0,10),(e>=t.slides.length||0>e)&&(e=0),t.currSlide=e,t.reverse?(t.nextSlide=e-1,0>t.nextSlide&&(t.nextSlide=t.slides.length-1)):(t.nextSlide=e+1,t.nextSlide==t.slides.length&&(t.nextSlide=0))},calcNextSlide:function(){var e,t=this.opts();t.reverse?(e=0>t.nextSlide-1,t.nextSlide=e?t.slideCount-1:t.nextSlide-1,t.currSlide=e?0:t.nextSlide+1):(e=t.nextSlide+1==t.slides.length,t.nextSlide=e?0:t.nextSlide+1,t.currSlide=e?t.slides.length-1:t.nextSlide-1)},calcTx:function(t,i){var n,s=t;return i&&s.manualFx&&(n=e.fn.cycle.transitions[s.manualFx]),n||(n=e.fn.cycle.transitions[s.fx]),n||(n=e.fn.cycle.transitions.fade,s.API.log('Transition "'+s.fx+'" not found. Using fade.')),n},prepareTx:function(e,t){var i,n,s,o,c,r=this.opts();return 2>r.slideCount?(r.timeoutId=0,void 0):(!e||r.busy&&!r.manualTrump||(r.API.stopTransition(),r.busy=!1,clearTimeout(r.timeoutId),r.timeoutId=0),r.busy||(0!==r.timeoutId||e)&&(n=r.slides[r.currSlide],s=r.slides[r.nextSlide],o=r.API.getSlideOpts(r.nextSlide),c=r.API.calcTx(o,e),r._tx=c,e&&void 0!==o.manualSpeed&&(o.speed=o.manualSpeed),r.nextSlide!=r.currSlide&&(e||!r.paused&&!r.hoverPaused&&r.timeout)?(r.API.trigger("cycle-before",[o,n,s,t]),c.before&&c.before(o,n,s,t),i=function(){r.busy=!1,r.container.data("cycle.opts")&&(c.after&&c.after(o,n,s,t),r.API.trigger("cycle-after",[o,n,s,t]),r.API.queueTransition(o),r.API.updateView(!0))},r.busy=!0,c.transition?c.transition(o,n,s,t,i):r.API.doTransition(o,n,s,t,i),r.API.calcNextSlide(),r.API.updateView()):r.API.queueTransition(o)),void 0)},doTransition:function(t,i,n,s,o){var c=t,r=e(i),l=e(n),a=function(){l.animate(c.animIn||{opacity:1},c.speed,c.easeIn||c.easing,o)};l.css(c.cssBefore||{}),r.animate(c.animOut||{},c.speed,c.easeOut||c.easing,function(){r.css(c.cssAfter||{}),c.sync||a()}),c.sync&&a()},queueTransition:function(t,i){var n=this.opts(),s=void 0!==i?i:t.timeout;return 0===n.nextSlide&&0===--n.loop?(n.API.log("terminating; loop=0"),n.timeout=0,s?setTimeout(function(){n.API.trigger("cycle-finished",[n])},s):n.API.trigger("cycle-finished",[n]),n.nextSlide=n.currSlide,void 0):(s&&(n._lastQueue=e.now(),void 0===i&&(n._remainingTimeout=t.timeout),n.paused||n.hoverPaused||(n.timeoutId=setTimeout(function(){n.API.prepareTx(!1,!n.reverse)},s))),void 0)},stopTransition:function(){var e=this.opts();e.slides.filter(":animated").length&&(e.slides.stop(!1,!0),e.API.trigger("cycle-transition-stopped",[e])),e._tx&&e._tx.stopTransition&&e._tx.stopTransition(e)},advanceSlide:function(e){var t=this.opts();return clearTimeout(t.timeoutId),t.timeoutId=0,t.nextSlide=t.currSlide+e,0>t.nextSlide?t.nextSlide=t.slides.length-1:t.nextSlide>=t.slides.length&&(t.nextSlide=0),t.API.prepareTx(!0,e>=0),!1},buildSlideOpts:function(i){var n,s,o=this.opts(),c=i.data()||{};for(var r in c)c.hasOwnProperty(r)&&/^cycle[A-Z]+/.test(r)&&(n=c[r],s=r.match(/^cycle(.*)/)[1].replace(/^[A-Z]/,t),o.API.log("["+(o.slideCount-1)+"]",s+":",n,"("+typeof n+")"),c[s]=n);c=e.extend({},e.fn.cycle.defaults,o,c),c.slideNum=o.slideCount;try{delete c.API,delete c.slideCount,delete c.currSlide,delete c.nextSlide,delete c.slides}catch(l){}return c},getSlideOpts:function(t){var i=this.opts();void 0===t&&(t=i.currSlide);var n=i.slides[t],s=e(n).data("cycle.opts");return e.extend({},i,s)},initSlide:function(t,i,n){var s=this.opts();i.css(t.slideCss||{}),n>0&&i.css("zIndex",n),isNaN(t.speed)&&(t.speed=e.fx.speeds[t.speed]||e.fx.speeds._default),t.sync||(t.speed=t.speed/2),i.addClass(s.slideClass)},updateView:function(e){var t=this.opts();if(t._initialized){var i=t.API.getSlideOpts(),n=t.slides[t.currSlide];!e&&(t.API.trigger("cycle-update-view-before",[t,i,n]),0>t.updateView)||(t.slideActiveClass&&t.slides.removeClass(t.slideActiveClass).eq(t.currSlide).addClass(t.slideActiveClass),e&&t.hideNonActive&&t.slides.filter(":not(."+t.slideActiveClass+")").hide(),t.API.trigger("cycle-update-view",[t,i,n,e]),t.API.trigger("cycle-update-view-after",[t,i,n]))}},getComponent:function(t){var i=this.opts(),n=i[t];return"string"==typeof n?/^\s*[\>|\+|~]/.test(n)?i.container.find(n):e(n):n.jquery?n:e(n)},stackSlides:function(t,i,n){var s=this.opts();t||(t=s.slides[s.currSlide],i=s.slides[s.nextSlide],n=!s.reverse),e(t).css("zIndex",s.maxZ);var o,c=s.maxZ-2,r=s.slideCount;if(n){for(o=s.currSlide+1;r>o;o++)e(s.slides[o]).css("zIndex",c--);for(o=0;s.currSlide>o;o++)e(s.slides[o]).css("zIndex",c--)}else{for(o=s.currSlide-1;o>=0;o--)e(s.slides[o]).css("zIndex",c--);for(o=r-1;o>s.currSlide;o--)e(s.slides[o]).css("zIndex",c--)}e(i).css("zIndex",s.maxZ-1)},getSlideIndex:function(e){return this.opts().slides.index(e)}},e.fn.cycle.log=function(){window.console&&console.log&&console.log("[cycle2] "+Array.prototype.join.call(arguments," "))},e.fn.cycle.version=function(){return"Cycle2: "+i},e.fn.cycle.transitions={custom:{},none:{before:function(e,t,i,n){e.API.stackSlides(i,t,n),e.cssBefore={opacity:1,display:"block"}}},fade:{before:function(t,i,n,s){var o=t.API.getSlideOpts(t.nextSlide).slideCss||{};t.API.stackSlides(i,n,s),t.cssBefore=e.extend(o,{opacity:0,display:"block"}),t.animIn={opacity:1},t.animOut={opacity:0}}},fadeout:{before:function(t,i,n,s){var o=t.API.getSlideOpts(t.nextSlide).slideCss||{};t.API.stackSlides(i,n,s),t.cssBefore=e.extend(o,{opacity:1,display:"block"}),t.animOut={opacity:0}}},scrollHorz:{before:function(e,t,i,n){e.API.stackSlides(t,i,n);var s=e.container.css("overflow","hidden").width();e.cssBefore={left:n?s:-s,top:0,opacity:1,display:"block"},e.cssAfter={zIndex:e._maxZ-2,left:0},e.animIn={left:0},e.animOut={left:n?-s:s}}}},e.fn.cycle.defaults={allowWrap:!0,autoSelector:".cycle-slideshow[data-cycle-auto-init!=false]",delay:0,easing:null,fx:"fade",hideNonActive:!0,loop:0,manualFx:void 0,manualSpeed:void 0,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},e(document).ready(function(){e(e.fn.cycle.defaults.autoSelector).cycle()})})(jQuery),function(e){"use strict";function t(t,n){var s,o,c,r=n.autoHeight;if("container"==r)o=e(n.slides[n.currSlide]).outerHeight(),n.container.height(o);else if(n._autoHeightRatio)n.container.height(n.container.width()/n._autoHeightRatio);else if("calc"===r||"number"==e.type(r)&&r>=0){if(c="calc"===r?i(t,n):r>=n.slides.length?0:r,c==n._sentinelIndex)return;n._sentinelIndex=c,n._sentinel&&n._sentinel.remove(),s=e(n.slides[c].cloneNode(!0)),s.removeAttr("id name rel").find("[id],[name],[rel]").removeAttr("id name rel"),s.css({position:"static",visibility:"hidden",display:"block"}).prependTo(n.container).addClass("cycle-sentinel cycle-slide").removeClass("cycle-slide-active"),s.find("*").css("visibility","hidden"),n._sentinel=s}}function i(t,i){var n=0,s=-1;return i.slides.each(function(t){var i=e(this).height();i>s&&(s=i,n=t)}),n}function n(t,i,n,s){var o=e(s).outerHeight(),c=i.sync?i.speed/2:i.speed;i.container.animate({height:o},c)}function s(i,o){o._autoHeightOnResize&&(e(window).off("resize orientationchange",o._autoHeightOnResize),o._autoHeightOnResize=null),o.container.off("cycle-slide-added cycle-slide-removed",t),o.container.off("cycle-destroyed",s),o.container.off("cycle-before",n),o._sentinel&&(o._sentinel.remove(),o._sentinel=null)}e.extend(e.fn.cycle.defaults,{autoHeight:0}),e(document).on("cycle-initialized",function(i,o){function c(){t(i,o)}var r,l=o.autoHeight,a=e.type(l),d=null;("string"===a||"number"===a)&&(o.container.on("cycle-slide-added cycle-slide-removed",t),o.container.on("cycle-destroyed",s),"container"==l?o.container.on("cycle-before",n):"string"===a&&/\d+\:\d+/.test(l)&&(r=l.match(/(\d+)\:(\d+)/),r=r[1]/r[2],o._autoHeightRatio=r),"number"!==a&&(o._autoHeightOnResize=function(){clearTimeout(d),d=setTimeout(c,50)},e(window).on("resize orientationchange",o._autoHeightOnResize)),setTimeout(c,30))})}(jQuery),function(e){"use strict";e.extend(e.fn.cycle.defaults,{caption:"> .cycle-caption",captionTemplate:"{{slideNum}} / {{slideCount}}",overlay:"> .cycle-overlay",overlayTemplate:"<div>{{title}}</div><div>{{desc}}</div>",captionModule:"caption"}),e(document).on("cycle-update-view",function(t,i,n,s){"caption"===i.captionModule&&e.each(["caption","overlay"],function(){var e=this,t=n[e+"Template"],o=i.API.getComponent(e);o.length&&t?(o.html(i.API.tmpl(t,n,i,s)),o.show()):o.hide()})}),e(document).on("cycle-destroyed",function(t,i){var n;e.each(["caption","overlay"],function(){var e=this,t=i[e+"Template"];i[e]&&t&&(n=i.API.getComponent("caption"),n.empty())})})}(jQuery),function(e){"use strict";var t=e.fn.cycle;e.fn.cycle=function(i){var n,s,o,c=e.makeArray(arguments);return"number"==e.type(i)?this.cycle("goto",i):"string"==e.type(i)?this.each(function(){var r;return n=i,o=e(this).data("cycle.opts"),void 0===o?(t.log('slideshow must be initialized before sending commands; "'+n+'" ignored'),void 0):(n="goto"==n?"jump":n,s=o.API[n],e.isFunction(s)?(r=e.makeArray(c),r.shift(),s.apply(o.API,r)):(t.log("unknown command: ",n),void 0))}):t.apply(this,arguments)},e.extend(e.fn.cycle,t),e.extend(t.API,{next:function(){var e=this.opts();if(!e.busy||e.manualTrump){var t=e.reverse?-1:1;e.allowWrap===!1&&e.currSlide+t>=e.slideCount||(e.API.advanceSlide(t),e.API.trigger("cycle-next",[e]).log("cycle-next"))}},prev:function(){var e=this.opts();if(!e.busy||e.manualTrump){var t=e.reverse?1:-1;e.allowWrap===!1&&0>e.currSlide+t||(e.API.advanceSlide(t),e.API.trigger("cycle-prev",[e]).log("cycle-prev"))}},destroy:function(){this.stop();var t=this.opts(),i=e.isFunction(e._data)?e._data:e.noop;clearTimeout(t.timeoutId),t.timeoutId=0,t.API.stop(),t.API.trigger("cycle-destroyed",[t]).log("cycle-destroyed"),t.container.removeData(),i(t.container[0],"parsedAttrs",!1),t.retainStylesOnDestroy||(t.container.removeAttr("style"),t.slides.removeAttr("style"),t.slides.removeClass("cycle-slide-active")),t.slides.each(function(){e(this).removeData(),i(this,"parsedAttrs",!1)})},jump:function(e){var t,i=this.opts();if(!i.busy||i.manualTrump){var n=parseInt(e,10);if(isNaN(n)||0>n||n>=i.slides.length)return i.API.log("goto: invalid slide index: "+n),void 0;if(n==i.currSlide)return i.API.log("goto: skipping, already on slide",n),void 0;i.nextSlide=n,clearTimeout(i.timeoutId),i.timeoutId=0,i.API.log("goto: ",n," (zero-index)"),t=i.currSlide<i.nextSlide,i.API.prepareTx(!0,t)}},stop:function(){var t=this.opts(),i=t.container;clearTimeout(t.timeoutId),t.timeoutId=0,t.API.stopTransition(),t.pauseOnHover&&(t.pauseOnHover!==!0&&(i=e(t.pauseOnHover)),i.off("mouseenter mouseleave")),t.API.trigger("cycle-stopped",[t]).log("cycle-stopped")},reinit:function(){var e=this.opts();e.API.destroy(),e.container.cycle()},remove:function(t){for(var i,n,s=this.opts(),o=[],c=1,r=0;s.slides.length>r;r++)i=s.slides[r],r==t?n=i:(o.push(i),e(i).data("cycle.opts").slideNum=c,c++);n&&(s.slides=e(o),s.slideCount--,e(n).remove(),t==s.currSlide&&s.API.advanceSlide(1),s.API.trigger("cycle-slide-removed",[s,t,n]).log("cycle-slide-removed"),s.API.updateView())}}),e(document).on("click.cycle","[data-cycle-cmd]",function(t){t.preventDefault();var i=e(this),n=i.data("cycle-cmd"),s=i.data("cycle-context")||".cycle-slideshow";e(s).cycle(n,i.data("cycle-arg"))})}(jQuery),function(e){"use strict";function t(t,i){var n;return t._hashFence?(t._hashFence=!1,void 0):(n=window.location.hash.substring(1),t.slides.each(function(s){return e(this).data("cycle-hash")==n?(i===!0?t.startingSlide=s:(t.nextSlide=s,t.API.prepareTx(!0,!1)),!1):void 0}),void 0)}e(document).on("cycle-pre-initialize",function(i,n){t(n,!0),n._onHashChange=function(){t(n,!1)},e(window).on("hashchange",n._onHashChange)}),e(document).on("cycle-update-view",function(e,t,i){i.hash&&(t._hashFence=!0,window.location.hash=i.hash)}),e(document).on("cycle-destroyed",function(t,i){i._onHashChange&&e(window).off("hashchange",i._onHashChange)})}(jQuery),function(e){"use strict";e.extend(e.fn.cycle.defaults,{loader:!1}),e(document).on("cycle-bootstrap",function(t,i){function n(t,n){function o(t){var o;"wait"==i.loader?(r.push(t),0===a&&(r.sort(c),s.apply(i.API,[r,n]),i.container.removeClass("cycle-loading"))):(o=e(i.slides[i.currSlide]),s.apply(i.API,[t,n]),o.show(),i.container.removeClass("cycle-loading"))}function c(e,t){return e.data("index")-t.data("index")}var r=[];if("string"==e.type(t))t=e.trim(t);else if("array"===e.type(t))for(var l=0;t.length>l;l++)t[l]=e(t[l])[0];t=e(t);var a=t.length;a&&(t.hide().appendTo("body").each(function(t){function c(){0===--l&&(--a,o(d))}var l=0,d=e(this),u=d.is("img")?d:d.find("img");return d.data("index",t),u=u.filter(":not(.cycle-loader-ignore)").filter(':not([src=""])'),u.length?(l=u.length,u.each(function(){this.complete?c():e(this).load(function(){c()}).error(function(){0===--l&&(i.API.log("slide skipped; img not loaded:",this.src),0===--a&&"wait"==i.loader&&s.apply(i.API,[r,n]))})}),void 0):(--a,r.push(d),void 0)}),a&&i.container.addClass("cycle-loading"))}var s;i.loader&&(s=i.API.add,i.API.add=n)})}(jQuery),function(e){"use strict";function t(t,i,n){var s,o=t.API.getComponent("pager");o.each(function(){var o=e(this);if(i.pagerTemplate){var c=t.API.tmpl(i.pagerTemplate,i,t,n[0]);s=e(c).appendTo(o)}else s=o.children().eq(t.slideCount-1);s.on(t.pagerEvent,function(e){e.preventDefault(),t.API.page(o,e.currentTarget)})})}function i(e,t){var i=this.opts();if(!i.busy||i.manualTrump){var n=e.children().index(t),s=n,o=s>i.currSlide;i.currSlide!=s&&(i.nextSlide=s,i.API.prepareTx(!0,o),i.API.trigger("cycle-pager-activated",[i,e,t]))}}e.extend(e.fn.cycle.defaults,{pager:"> .cycle-pager",pagerActiveClass:"cycle-pager-active",pagerEvent:"click.cycle",pagerTemplate:"<span>•</span>"}),e(document).on("cycle-bootstrap",function(e,i,n){n.buildPagerLink=t}),e(document).on("cycle-slide-added",function(e,t,n,s){t.pager&&(t.API.buildPagerLink(t,n,s),t.API.page=i)}),e(document).on("cycle-slide-removed",function(t,i,n){if(i.pager){var s=i.API.getComponent("pager");s.each(function(){var t=e(this);e(t.children()[n]).remove()})}}),e(document).on("cycle-update-view",function(t,i){var n;i.pager&&(n=i.API.getComponent("pager"),n.each(function(){e(this).children().removeClass(i.pagerActiveClass).eq(i.currSlide).addClass(i.pagerActiveClass)}))}),e(document).on("cycle-destroyed",function(e,t){var i=t.API.getComponent("pager");i&&(i.children().off(t.pagerEvent),t.pagerTemplate&&i.empty())})}(jQuery),function(e){"use strict";e.extend(e.fn.cycle.defaults,{next:"> .cycle-next",nextEvent:"click.cycle",disabledClass:"disabled",prev:"> .cycle-prev",prevEvent:"click.cycle",swipe:!1}),e(document).on("cycle-initialized",function(e,t){if(t.API.getComponent("next").on(t.nextEvent,function(e){e.preventDefault(),t.API.next()}),t.API.getComponent("prev").on(t.prevEvent,function(e){e.preventDefault(),t.API.prev()}),t.swipe){var i=t.swipeVert?"swipeUp.cycle":"swipeLeft.cycle swipeleft.cycle",n=t.swipeVert?"swipeDown.cycle":"swipeRight.cycle swiperight.cycle";t.container.on(i,function(){t.API.next()}),t.container.on(n,function(){t.API.prev()})}}),e(document).on("cycle-update-view",function(e,t){if(!t.allowWrap){var i=t.disabledClass,n=t.API.getComponent("next"),s=t.API.getComponent("prev"),o=t._prevBoundry||0,c=t._nextBoundry||t.slideCount-1;t.currSlide==c?n.addClass(i).prop("disabled",!0):n.removeClass(i).prop("disabled",!1),t.currSlide===o?s.addClass(i).prop("disabled",!0):s.removeClass(i).prop("disabled",!1)}}),e(document).on("cycle-destroyed",function(e,t){t.API.getComponent("prev").off(t.nextEvent),t.API.getComponent("next").off(t.prevEvent),t.container.off("swipeleft.cycle swiperight.cycle swipeLeft.cycle swipeRight.cycle swipeUp.cycle swipeDown.cycle")})}(jQuery),function(e){"use strict";e.extend(e.fn.cycle.defaults,{progressive:!1}),e(document).on("cycle-pre-initialize",function(t,i){if(i.progressive){var n,s,o=i.API,c=o.next,r=o.prev,l=o.prepareTx,a=e.type(i.progressive);if("array"==a)n=i.progressive;else if(e.isFunction(i.progressive))n=i.progressive(i);else if("string"==a){if(s=e(i.progressive),n=e.trim(s.html()),!n)return;if(/^(\[)/.test(n))try{n=e.parseJSON(n)}catch(d){return o.log("error parsing progressive slides",d),void 0}else n=n.split(RegExp(s.data("cycle-split")||"\n")),n[n.length-1]||n.pop()}l&&(o.prepareTx=function(e,t){var s,o;return e||0===n.length?(l.apply(i.API,[e,t]),void 0):(t&&i.currSlide==i.slideCount-1?(o=n[0],n=n.slice(1),i.container.one("cycle-slide-added",function(e,t){setTimeout(function(){t.API.advanceSlide(1)},50)}),i.API.add(o)):t||0!==i.currSlide?l.apply(i.API,[e,t]):(s=n.length-1,o=n[s],n=n.slice(0,s),i.container.one("cycle-slide-added",function(e,t){setTimeout(function(){t.currSlide=1,t.API.advanceSlide(-1)},50)}),i.API.add(o,!0)),void 0)}),c&&(o.next=function(){var e=this.opts();if(n.length&&e.currSlide==e.slideCount-1){var t=n[0];n=n.slice(1),e.container.one("cycle-slide-added",function(e,t){c.apply(t.API),t.container.removeClass("cycle-loading")}),e.container.addClass("cycle-loading"),e.API.add(t)}else c.apply(e.API)}),r&&(o.prev=function(){var e=this.opts();if(n.length&&0===e.currSlide){var t=n.length-1,i=n[t];n=n.slice(0,t),e.container.one("cycle-slide-added",function(e,t){t.currSlide=1,t.API.advanceSlide(-1),t.container.removeClass("cycle-loading")}),e.container.addClass("cycle-loading"),e.API.add(i,!0)}else r.apply(e.API)})}})}(jQuery),function(e){"use strict";e.extend(e.fn.cycle.defaults,{tmplRegex:"{{((.)?.*?)}}"}),e.extend(e.fn.cycle.API,{tmpl:function(t,i){var n=RegExp(i.tmplRegex||e.fn.cycle.defaults.tmplRegex,"g"),s=e.makeArray(arguments);return s.shift(),t.replace(n,function(t,i){var n,o,c,r,l=i.split(".");for(n=0;s.length>n;n++)if(c=s[n]){if(l.length>1)for(r=c,o=0;l.length>o;o++)c=r,r=r[l[o]]||i;else r=c[i];if(e.isFunction(r))return r.apply(c,s);if(void 0!==r&&null!==r&&r!=i)return r}return i})}})}(jQuery);
|
7 |
|
8 |
/*! Plugin for Cycle2; Copyright (c) 2012 M. Alsup; ver: 20130108 */
|
9 |
(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);
|
10 |
|
11 |
/*! Plugin for Cycle2; Copyright (c) 2012 M. Alsup; ver: 20121120 */
|
12 |
+
(function(a){"use strict",a.fn.cycle.transitions.tileSlide=a.fn.cycle.transitions.tileBlind={before:function(b,c,d,e){b.API.stackSlides(c,d,e),a(c).show(),b.container.css("overflow","hidden"),b.tileDelay=b.tileDelay||b.fx=="tileSlide"?100:125,b.tileCount=b.tileCount||7,b.tileVertical=b.tileVertical!==!1,b.container.data("cycleTileInitialized")||(b.container.on("cycle-destroyed",a.proxy(this.onDestroy,b.API)),b.container.data("cycleTileInitialized",!0))},transition:function(b,c,d,e,f){function w(a){g.eq(a).animate(s,{duration:b.speed,easing:b.easing,complete:function(){(e?o-1===a:0===a)&&b._tileAniCallback()}}),setTimeout(function(){(e?o-1!==a:0!==a)&&w(e?a+1:a-1)},b.tileDelay)}b.slides.not(c).not(d).hide();var g=a(),h=a(c),i=a(d),j,k,l,m,n,o=b.tileCount,p=b.tileVertical,q=b.container.height(),r=b.container.width();p?(k=Math.floor(r/o),m=r-k*(o-1),l=n=q):(k=m=r,l=Math.floor(q/o),n=q-l*(o-1)),b.container.find(".cycle-tiles-container").remove();var s,t={left:0,top:0,overflow:"hidden",position:"absolute",margin:0,padding:0};p?s=b.fx=="tileSlide"?{top:q}:{width:0}:s=b.fx=="tileSlide"?{left:r}:{height:0};var u=a('<div class="cycle-tiles-container"></div>');u.css({zIndex:h.css("z-index"),overflow:"visible",position:"absolute",top:0}),u.insertBefore(d);for(var v=0;v<o;v++)j=a("<div></div>").css(t).css({width:o-1===v?m:k,height:o-1===v?n:l,marginLeft:p?v*k:0,marginTop:p?0:v*l}).append(h.clone().css({position:"relative",maxWidth:"none",width:h.width(),margin:0,padding:0,marginLeft:p?-(v*k):0,marginTop:p?0:-(v*l)})),g=g.add(j);u.append(g),h.hide(),i.show().css("opacity",1),w(e?0:o-1),b._tileAniCallback=function(){i.show(),h.hide(),u.remove(),f()}},stopTransition:function(a){a.container.find("*").stop(!0,!0),a._tileAniCallback&&a._tileAniCallback()},onDestroy:function(a){var b=this.opts();b.container.find(".cycle-tiles-container").remove()}}})(jQuery);
|
13 |
+
|
14 |
+
/* Plugin for Cycle2; Copyright (c) 2012 M. Alsup; v20130708 */
|
15 |
+
(function(e){"use strict";function t(){try{this.playVideo()}catch(e){}}function i(){try{this.pauseVideo()}catch(e){}}var n='<div class=cycle-youtube><object width="640" height="360"><param name="movie" value="{{url}}"></param><param name="allowFullScreen" value="{{allowFullScreen}}"></param><param name="allowscriptaccess" value="always"></param><embed src="{{url}}" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="{{allowFullScreen}}"></embed></object></div>';e.extend(e.fn.cycle.defaults,{youtubeAllowFullScreen:!0,youtubeAutostart:!1,youtubeAutostop:!0}),e(document).on("cycle-bootstrap",function(s,o){o.youtube&&(o.hideNonActive=!1,o.container.find(o.slides).each(function(t){if(this.href){var i,s=e(this),l=s.attr("href"),c=o.youtubeAllowFullScreen?"true":"false";l+=(/\?/.test(l)?"&":"?")+"enablejsapi=1",o.youtubeAutostart&&o.startingSlide===t&&(l+="&autoplay=1"),i=o.API.tmpl(n,{url:l,allowFullScreen:c}),s.replaceWith(i)}}),o.slides=o.slides.replace(/(\b>?a\b)/,"div.cycle-youtube"),o.youtubeAutostart&&o.container.on("cycle-initialized cycle-after",function(i,n){var s="cycle-initialized"==i.type?n.currSlide:n.nextSlide;e(n.slides[s]).find("object,embed").each(t)}),o.youtubeAutostop&&o.container.on("cycle-before",function(t,n){e(n.slides[n.currSlide]).find("object,embed").each(i)}))})})(jQuery);
|
js/jquery.cycle2.video.min.js
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
/* Plugin for Cycle2; Copyright (c) 2012 M. Alsup; v20130708 */
|
2 |
+
(function(e){"use strict";function t(){try{this.playVideo()}catch(e){}}function i(){try{this.pauseVideo()}catch(e){}}var n='<div class=cycle-youtube><object width="640" height="360"><param name="movie" value="{{url}}"></param><param name="allowFullScreen" value="{{allowFullScreen}}"></param><param name="allowscriptaccess" value="always"></param><embed src="{{url}}" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="{{allowFullScreen}}"></embed></object></div>';e.extend(e.fn.cycle.defaults,{youtubeAllowFullScreen:!0,youtubeAutostart:!1,youtubeAutostop:!0}),e(document).on("cycle-bootstrap",function(s,o){o.youtube&&(o.hideNonActive=!1,o.container.find(o.slides).each(function(t){if(this.href){var i,s=e(this),l=s.attr("href"),c=o.youtubeAllowFullScreen?"true":"false";l+=(/\?/.test(l)?"&":"?")+"enablejsapi=1",o.youtubeAutostart&&o.startingSlide===t&&(l+="&autoplay=1"),i=o.API.tmpl(n,{url:l,allowFullScreen:c}),s.replaceWith(i)}}),o.slides=o.slides.replace(/(\b>?a\b)/,"div.cycle-youtube"),o.youtubeAutostart&&o.container.on("cycle-initialized cycle-after",function(i,n){var s="cycle-initialized"==i.type?n.currSlide:n.nextSlide;e(n.slides[s]).find("object,embed").each(t)}),o.youtubeAutostop&&o.container.on("cycle-before",function(t,n){e(n.slides[n.currSlide]).find("object,embed").each(i)}))})})(jQuery);
|
lang/cycloneslider-fr_FR.mo
ADDED
Binary file
|
lang/cycloneslider-fr_FR.po
ADDED
@@ -0,0 +1,470 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
msgid ""
|
2 |
+
msgstr ""
|
3 |
+
"Project-Id-Version: Cyclone Slider\n"
|
4 |
+
"Report-Msgid-Bugs-To: \n"
|
5 |
+
"POT-Creation-Date: 2013-03-21 07:42+0800\n"
|
6 |
+
"PO-Revision-Date: 2013-05-13 17:19+0100\n"
|
7 |
+
"Last-Translator: Aubin BERTHE <aubin@mak2com.com>\n"
|
8 |
+
"Language-Team: kosinix <kosinix@codefleet.net>\n"
|
9 |
+
"MIME-Version: 1.0\n"
|
10 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
+
"Content-Transfer-Encoding: 8bit\n"
|
12 |
+
"X-Poedit-KeywordsList: __;_e;_x\n"
|
13 |
+
"X-Poedit-Basepath: .\n"
|
14 |
+
"X-Poedit-SourceCharset: utf-8\n"
|
15 |
+
"Language: de_DE\n"
|
16 |
+
"X-Generator: Poedit 1.5.5\n"
|
17 |
+
"X-Poedit-SearchPath-0: D:\\webserver\\htdocs\\wp1\\wp-content\\plugins"
|
18 |
+
"\\cyclone-slider-2\n"
|
19 |
+
|
20 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/class-cyclone-slider-widget.php:15
|
21 |
+
msgid "Cyclone Slider Widget"
|
22 |
+
msgstr "Module de diaporama"
|
23 |
+
|
24 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/class-cyclone-slider-widget.php:16
|
25 |
+
msgid "Widget for displaying slideshows."
|
26 |
+
msgstr "Module pour afficher des diaporamas"
|
27 |
+
|
28 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/class-cyclone-slider-widget.php:62
|
29 |
+
msgid "Select a Slideshow:"
|
30 |
+
msgstr "Sélectionner un diaporama"
|
31 |
+
|
32 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/class-cyclone-slider-widget.php:77
|
33 |
+
msgid "No slideshows found."
|
34 |
+
msgstr "Aucuns diaporamas"
|
35 |
+
|
36 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/class-cyclone-slider.php:103
|
37 |
+
msgid "Select an image"
|
38 |
+
msgstr "Sélectionnez une image"
|
39 |
+
|
40 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/class-cyclone-slider.php:104
|
41 |
+
msgid "Add to Slide"
|
42 |
+
msgstr "Ajouter au diaporama"
|
43 |
+
|
44 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/class-cyclone-slider.php:135
|
45 |
+
msgid "Cyclone Slider"
|
46 |
+
msgstr "Diaporama"
|
47 |
+
|
48 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/class-cyclone-slider.php:136
|
49 |
+
msgid "Slideshow"
|
50 |
+
msgstr "Diaporama"
|
51 |
+
|
52 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/class-cyclone-slider.php:137
|
53 |
+
msgid "Add Slideshow"
|
54 |
+
msgstr "Ajoutez un diaporama"
|
55 |
+
|
56 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/class-cyclone-slider.php:138
|
57 |
+
msgid "Add New Slideshow"
|
58 |
+
msgstr "Ajouter un nouveau diaporama"
|
59 |
+
|
60 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/class-cyclone-slider.php:139
|
61 |
+
msgid "Edit Slideshow"
|
62 |
+
msgstr "Editer le diaporama"
|
63 |
+
|
64 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/class-cyclone-slider.php:140
|
65 |
+
msgid "New Slideshow"
|
66 |
+
msgstr "Nouveau diaporama"
|
67 |
+
|
68 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/class-cyclone-slider.php:141
|
69 |
+
msgid "View Slideshow"
|
70 |
+
msgstr "Voir le diaporama"
|
71 |
+
|
72 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/class-cyclone-slider.php:142
|
73 |
+
msgid "Search Slideshows"
|
74 |
+
msgstr "Rechercher des diaporamas"
|
75 |
+
|
76 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/class-cyclone-slider.php:143
|
77 |
+
msgid "No slideshows found"
|
78 |
+
msgstr "Pas de diaporama trouvé"
|
79 |
+
|
80 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/class-cyclone-slider.php:144
|
81 |
+
msgid "No slideshows found in Trash"
|
82 |
+
msgstr "Pas de diaporama trouvé"
|
83 |
+
|
84 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/class-cyclone-slider.php:164
|
85 |
+
#, php-format
|
86 |
+
msgid "Slideshow updated. Shortcode is [cycloneslider id=\"%s\"]"
|
87 |
+
msgstr "Diaporama mis à jours. Son shortcode est [cycloneslider id=\"%s\"]"
|
88 |
+
|
89 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/class-cyclone-slider.php:165
|
90 |
+
msgid "Custom field updated."
|
91 |
+
msgstr "Champ mis à jours"
|
92 |
+
|
93 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/class-cyclone-slider.php:166
|
94 |
+
msgid "Custom field deleted."
|
95 |
+
msgstr "Champ supprimé"
|
96 |
+
|
97 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/class-cyclone-slider.php:167
|
98 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/class-cyclone-slider.php:168
|
99 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/class-cyclone-slider.php:171
|
100 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/class-cyclone-slider.php:172
|
101 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/class-cyclone-slider.php:173
|
102 |
+
msgid "Slideshow updated."
|
103 |
+
msgstr "Diaporama mis à jour"
|
104 |
+
|
105 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/class-cyclone-slider.php:169
|
106 |
+
#, php-format
|
107 |
+
msgid "Slideshow published. Shortcode is [cycloneslider id=\"%s\"]"
|
108 |
+
msgstr "Diaporama publié. Son shortcode est [cycloneslider id=\"%s\"]"
|
109 |
+
|
110 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/class-cyclone-slider.php:170
|
111 |
+
msgid "Slideshow saved."
|
112 |
+
msgstr "Diaporama sauvegardé"
|
113 |
+
|
114 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/class-cyclone-slider.php:174
|
115 |
+
#, php-format
|
116 |
+
msgid ""
|
117 |
+
"Templates CSS could not be saved. Make sure %stemplates.css is writable."
|
118 |
+
msgstr ""
|
119 |
+
"Thème CSS non sauvegardé. Assurez-vous que le fichier %stemplates.css puisse "
|
120 |
+
"être modifié."
|
121 |
+
|
122 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/class-cyclone-slider.php:175
|
123 |
+
#, php-format
|
124 |
+
msgid "Templates JS could not be saved. Make sure %stemplates.js is writable."
|
125 |
+
msgstr ""
|
126 |
+
"Thème JS non sauvegardé. Assurez-vous que le fichier %stemplates.js puisse "
|
127 |
+
"être modifié."
|
128 |
+
|
129 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/class-cyclone-slider.php:199
|
130 |
+
msgid "Slides"
|
131 |
+
msgstr "Diapos"
|
132 |
+
|
133 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/class-cyclone-slider.php:207
|
134 |
+
msgid "Slideshow Settings"
|
135 |
+
msgstr "Réglages du diaporama"
|
136 |
+
|
137 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/class-cyclone-slider.php:215
|
138 |
+
msgid "Slideshow Templates"
|
139 |
+
msgstr "Thèmes de diaporama"
|
140 |
+
|
141 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/class-cyclone-slider.php:243
|
142 |
+
msgid "Slide"
|
143 |
+
msgstr "Diapo"
|
144 |
+
|
145 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/class-cyclone-slider.php:252
|
146 |
+
msgid "Add Slide"
|
147 |
+
msgstr "Ajouter une diapo"
|
148 |
+
|
149 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/class-cyclone-slider.php:504
|
150 |
+
msgid "Slideshow Name"
|
151 |
+
msgstr "Nom du diaporama"
|
152 |
+
|
153 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/class-cyclone-slider.php:505
|
154 |
+
msgid "Template"
|
155 |
+
msgstr "Thème"
|
156 |
+
|
157 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/class-cyclone-slider.php:506
|
158 |
+
msgid "Images"
|
159 |
+
msgstr "Images"
|
160 |
+
|
161 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/class-cyclone-slider.php:507
|
162 |
+
msgid "Slideshow ID"
|
163 |
+
msgstr "Diaporama ID"
|
164 |
+
|
165 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/class-cyclone-slider.php:508
|
166 |
+
msgid "Shortcode"
|
167 |
+
msgstr "Shortcode"
|
168 |
+
|
169 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/class-cyclone-slider.php:539
|
170 |
+
msgid "Slide *"
|
171 |
+
msgstr "Diapo *"
|
172 |
+
|
173 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/class-cyclone-slider.php:659
|
174 |
+
msgid "[Slideshow not found]"
|
175 |
+
msgstr "[Diaporama non trouvé]"
|
176 |
+
|
177 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/class-cyclone-slider.php:684
|
178 |
+
#, php-format
|
179 |
+
msgid "[Template \"%s\" not found]"
|
180 |
+
msgstr "[Thème \"%s\" non trouvé]"
|
181 |
+
|
182 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/class-nextgen-integration.php:33
|
183 |
+
msgid "NextGEN Integration"
|
184 |
+
msgstr "NextGEN Integration"
|
185 |
+
|
186 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/class-nextgen-integration.php:49
|
187 |
+
msgid "Choose a NextGEN Gallery"
|
188 |
+
msgstr "Choose a NextGEN Gallery"
|
189 |
+
|
190 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/class-nextgen-integration.php:59
|
191 |
+
msgid "Import"
|
192 |
+
msgstr "Importer"
|
193 |
+
|
194 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/class-nextgen-integration.php:61
|
195 |
+
msgid ""
|
196 |
+
"Select a gallery to import images from. Images will be added as new slides."
|
197 |
+
msgstr ""
|
198 |
+
"Selectionnez une galerie pour importer les images. Les images devront être "
|
199 |
+
"ajoutées comme des nouvelles diapos "
|
200 |
+
|
201 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/box.php:17
|
202 |
+
msgid "Drag"
|
203 |
+
msgstr "Glisser"
|
204 |
+
|
205 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/box.php:18
|
206 |
+
msgid "Toggle"
|
207 |
+
msgstr "Basculer"
|
208 |
+
|
209 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/box.php:19
|
210 |
+
msgid "Delete"
|
211 |
+
msgstr "Supprimer"
|
212 |
+
|
213 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/box.php:26
|
214 |
+
msgid "Image"
|
215 |
+
msgstr "Image"
|
216 |
+
|
217 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/box.php:27
|
218 |
+
msgid "Video"
|
219 |
+
msgstr "Vidéo"
|
220 |
+
|
221 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/box.php:28
|
222 |
+
msgid "Custom"
|
223 |
+
msgstr "Personnalisé"
|
224 |
+
|
225 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/box.php:45
|
226 |
+
msgid "Get Image"
|
227 |
+
msgstr "Importer une image"
|
228 |
+
|
229 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/box.php:48
|
230 |
+
msgid "Slide Properties:"
|
231 |
+
msgstr "Propriétés de la diapo"
|
232 |
+
|
233 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/box.php:50
|
234 |
+
msgid "Link"
|
235 |
+
msgstr "Lien"
|
236 |
+
|
237 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/box.php:53
|
238 |
+
msgid "Link URL:"
|
239 |
+
msgstr "Lien"
|
240 |
+
|
241 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/box.php:57
|
242 |
+
msgid "Open Link in:"
|
243 |
+
msgstr "Ouvrir le lien dans :"
|
244 |
+
|
245 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/box.php:59
|
246 |
+
msgid "Same Window"
|
247 |
+
msgstr "Même fenêtre"
|
248 |
+
|
249 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/box.php:60
|
250 |
+
msgid "New Tab or Window"
|
251 |
+
msgstr "Nouvel onglet ou fenêtre"
|
252 |
+
|
253 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/box.php:66
|
254 |
+
msgid "Title"
|
255 |
+
msgstr "Titre"
|
256 |
+
|
257 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/box.php:74
|
258 |
+
msgid "Description"
|
259 |
+
msgstr "Description"
|
260 |
+
|
261 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/box.php:83
|
262 |
+
msgid "Image Attributes"
|
263 |
+
msgstr "Attributs de l'image"
|
264 |
+
|
265 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/box.php:86
|
266 |
+
msgid "Alternate Text:"
|
267 |
+
msgstr "Texte alternatif"
|
268 |
+
|
269 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/box.php:90
|
270 |
+
msgid "Title Text:"
|
271 |
+
msgstr "Titre"
|
272 |
+
|
273 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/box.php:96
|
274 |
+
msgid "Slide Transition Effects"
|
275 |
+
msgstr "Effets de transition"
|
276 |
+
|
277 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/box.php:100
|
278 |
+
msgid "Disable"
|
279 |
+
msgstr "Désactivé"
|
280 |
+
|
281 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/box.php:101
|
282 |
+
msgid "Enable Slide Effects"
|
283 |
+
msgstr "Permettre les effets de transition"
|
284 |
+
|
285 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/box.php:107
|
286 |
+
msgid "Transition Effects:"
|
287 |
+
msgstr "Effets de transition"
|
288 |
+
|
289 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/box.php:118
|
290 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/slider-properties.php:32
|
291 |
+
msgid "Transition Effects Speed:"
|
292 |
+
msgstr "Temps de l'effet de transtion"
|
293 |
+
|
294 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/box.php:120
|
295 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/box.php:127
|
296 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/slider-properties.php:34
|
297 |
+
msgid "Milliseconds"
|
298 |
+
msgstr "Millisecondes"
|
299 |
+
|
300 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/box.php:125
|
301 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/slider-properties.php:26
|
302 |
+
msgid "Next Slide Delay:"
|
303 |
+
msgstr "Temps avant la prochaine diapo"
|
304 |
+
|
305 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/box.php:135
|
306 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/slider-properties.php:12
|
307 |
+
msgid "Tile Count:"
|
308 |
+
msgstr "Nombre de carreaux"
|
309 |
+
|
310 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/box.php:137
|
311 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/slider-properties.php:14
|
312 |
+
msgid "The number of tiles to use in the transition."
|
313 |
+
msgstr "Nombre de carreaux à utiliser pour les transitions"
|
314 |
+
|
315 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/box.php:141
|
316 |
+
msgid "Tile Delay:"
|
317 |
+
msgstr "Délais"
|
318 |
+
|
319 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/box.php:143
|
320 |
+
msgid "Milliseconds to delay each individual tile transition."
|
321 |
+
msgstr "Delais de transition en millisecondes"
|
322 |
+
|
323 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/box.php:147
|
324 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/slider-properties.php:17
|
325 |
+
msgid "Tile Position:"
|
326 |
+
msgstr "Position"
|
327 |
+
|
328 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/box.php:149
|
329 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/slider-properties.php:19
|
330 |
+
msgid "Vertical"
|
331 |
+
msgstr "Vertical"
|
332 |
+
|
333 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/box.php:150
|
334 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/slider-properties.php:20
|
335 |
+
msgid "Horizontal"
|
336 |
+
msgstr "Horizontal"
|
337 |
+
|
338 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/box.php:170
|
339 |
+
msgid "Video URL:"
|
340 |
+
msgstr "Lien vidéo"
|
341 |
+
|
342 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/box.php:172
|
343 |
+
msgid "Copy and paste a Youtube or Vimeo URL and hit the Get Video button."
|
344 |
+
msgstr "copier et coller un lien Youtube ou Vimeo"
|
345 |
+
|
346 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/box.php:176
|
347 |
+
msgid "Get Video"
|
348 |
+
msgstr "Modifier vidéo"
|
349 |
+
|
350 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/box.php:181
|
351 |
+
msgid "Embed Code"
|
352 |
+
msgstr "Code HTML"
|
353 |
+
|
354 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/box.php:183
|
355 |
+
msgid ""
|
356 |
+
"You can place your embed code directly here. Or you can use the Get Video "
|
357 |
+
"button to generate the embed code."
|
358 |
+
msgstr "Vous pouvez placer du code directement ici"
|
359 |
+
|
360 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/box.php:185
|
361 |
+
msgid ""
|
362 |
+
"<strong>Note:</strong> The Slide Properties and Tile effects are not "
|
363 |
+
"supported for videos."
|
364 |
+
msgstr ""
|
365 |
+
"Note : les propriétés du diaporama ne sont pas supportés pour les vidéos"
|
366 |
+
|
367 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/box.php:187
|
368 |
+
msgid ""
|
369 |
+
"<strong>Note:</strong> Append &wmode=transparent to the embed code src "
|
370 |
+
"attribute to make HTML elements appear on top of Flash."
|
371 |
+
msgstr ""
|
372 |
+
"Note : ajouter à l'attribut &wmode=transparent pour que les éléments HTML "
|
373 |
+
"apparaissent au dessus de Flash."
|
374 |
+
|
375 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/box.php:193
|
376 |
+
msgid "Custom HTML"
|
377 |
+
msgstr "Code HTML personnalisé"
|
378 |
+
|
379 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/slider-properties.php:3
|
380 |
+
msgid "Transition Effects to Use:"
|
381 |
+
msgstr "Effet de transition à utiliser"
|
382 |
+
|
383 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/slider-properties.php:28
|
384 |
+
msgid "Milliseconds. 0 to disable auto advance."
|
385 |
+
msgstr "Millisecondes. 0 ou désactiver le défilement automatique"
|
386 |
+
|
387 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/slider-properties.php:38
|
388 |
+
msgid "Width:"
|
389 |
+
msgstr "Largeur :"
|
390 |
+
|
391 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/slider-properties.php:40
|
392 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/slider-properties.php:46
|
393 |
+
msgid "pixels."
|
394 |
+
msgstr "pixels."
|
395 |
+
|
396 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/slider-properties.php:44
|
397 |
+
msgid "Height:"
|
398 |
+
msgstr "Hauteur :"
|
399 |
+
|
400 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/slider-properties.php:50
|
401 |
+
msgid "Pause on Hover?"
|
402 |
+
msgstr "Pause au survol"
|
403 |
+
|
404 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/slider-properties.php:52
|
405 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/slider-properties.php:60
|
406 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/slider-properties.php:68
|
407 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/slider-properties.php:78
|
408 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/slider-properties.php:87
|
409 |
+
msgid "Yes"
|
410 |
+
msgstr "Oui"
|
411 |
+
|
412 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/slider-properties.php:53
|
413 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/slider-properties.php:61
|
414 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/slider-properties.php:69
|
415 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/slider-properties.php:77
|
416 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/slider-properties.php:86
|
417 |
+
msgid "No"
|
418 |
+
msgstr "Non"
|
419 |
+
|
420 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/slider-properties.php:58
|
421 |
+
msgid "Show Prev/Next Buttons?"
|
422 |
+
msgstr "Afficher les boutons précédent et suivant ?"
|
423 |
+
|
424 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/slider-properties.php:66
|
425 |
+
msgid "Show Navigation?"
|
426 |
+
msgstr "Afficher la navigation ?"
|
427 |
+
|
428 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/slider-properties.php:71
|
429 |
+
msgid "The thumbnails or dots depending on template."
|
430 |
+
msgstr "Les miniatures dépendent du template"
|
431 |
+
|
432 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/slider-properties.php:75
|
433 |
+
msgid "Random Slide Order?"
|
434 |
+
msgstr "Ordre des diapos aléatoire ?"
|
435 |
+
|
436 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/slider-properties.php:80
|
437 |
+
msgid "Randomize order of slides on every page visit."
|
438 |
+
msgstr "Faire un ordre des diapos aléatoires sur chaque page visité"
|
439 |
+
|
440 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/slider-properties.php:84
|
441 |
+
msgid "Resize Images?"
|
442 |
+
msgstr "Retailler l'image ?"
|
443 |
+
|
444 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/slider-properties.php:89
|
445 |
+
msgid ""
|
446 |
+
"Yes - resize images to slideshow dimension. <br>No - use the original "
|
447 |
+
"uploaded image."
|
448 |
+
msgstr ""
|
449 |
+
"Oui - Retailler les images à la dimension du diaporama. <br /> Non - "
|
450 |
+
"utiliser la taille original de l'image importée"
|
451 |
+
|
452 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/template-selection.php:38
|
453 |
+
msgid ""
|
454 |
+
"Select a template to use. Check the template icons to see what slide type it "
|
455 |
+
"supports."
|
456 |
+
msgstr ""
|
457 |
+
"Choisissez le thème à utiliser. Vérifier les icônes du thème pour savoir les "
|
458 |
+
"options qu'il supporte."
|
459 |
+
|
460 |
+
#: D:\webserver\htdocs\wp1\wp-content\plugins\cyclone-slider-2/inc/admin-parts/template-selection.php:40
|
461 |
+
msgid "Get more templates.."
|
462 |
+
msgstr "Plus de thèmes..."
|
463 |
+
|
464 |
+
#, fuzzy
|
465 |
+
#~ msgid "Slide Elements:"
|
466 |
+
#~ msgstr "Zusätzliche Gleitelemente:"
|
467 |
+
|
468 |
+
#, fuzzy
|
469 |
+
#~ msgid "Slide Effects"
|
470 |
+
#~ msgstr "Slider-Einstellungen"
|
template-assets.php
CHANGED
@@ -40,7 +40,8 @@ function theme_url($theme){
|
|
40 |
function compile_css($templates){
|
41 |
$ds = DIRECTORY_SEPARATOR;
|
42 |
$content = '';
|
43 |
-
|
|
|
44 |
if(file_exists(APP_PATH."css{$ds}common.min.css")){
|
45 |
$content .= file_get_contents(APP_PATH."css{$ds}common.min.css");
|
46 |
} else {
|
@@ -52,7 +53,7 @@ function compile_css($templates){
|
|
52 |
foreach($template_folders as $name=>$folder){
|
53 |
$style = $folder['path']."{$ds}style.min.css"; //Minified version
|
54 |
$style2 = $folder['path']."{$ds}style.css"; //Unminified version, for old templates to work
|
55 |
-
if(file_exists($style)){
|
56 |
$content .= "\r\n".str_replace('$tpl', $folder['url'], file_get_contents($style));//apply url and print css
|
57 |
} else if(file_exists($style2)){
|
58 |
$content .= "\r\n".str_replace('$tpl', $folder['url'], file_get_contents($style2));//apply url and print css
|
@@ -68,6 +69,7 @@ function compile_css($templates){
|
|
68 |
function compile_js($templates){
|
69 |
$ds = DIRECTORY_SEPARATOR;
|
70 |
$content = '';
|
|
|
71 |
|
72 |
$template_folders = $templates->get_all_templates();
|
73 |
|
@@ -75,7 +77,8 @@ function compile_js($templates){
|
|
75 |
|
76 |
$js = $folder['path']."{$ds}script.min.js"; //Minified version
|
77 |
$js2 = $folder['path']."{$ds}script.js"; //Unminified version, for old templates to work
|
78 |
-
|
|
|
79 |
$content .= file_get_contents($js)."\r\n";//Pull contents
|
80 |
} else if(file_exists($js2)){
|
81 |
$content .= file_get_contents($js2)."\r\n";
|
@@ -93,7 +96,8 @@ function compile_js($templates){
|
|
93 |
$theme = isset($_GET['theme']) ? htmlentities(strip_tags($_GET['theme'])) : 'twentytwelve';
|
94 |
$type = isset($_GET['type']) ? htmlentities(strip_tags($_GET['type'])) : '';
|
95 |
|
96 |
-
|
|
|
97 |
|
98 |
$templates = new Cyclone_Templates();
|
99 |
$templates->add_template_location(
|
40 |
function compile_css($templates){
|
41 |
$ds = DIRECTORY_SEPARATOR;
|
42 |
$content = '';
|
43 |
+
$minify = isset($_GET['minify']) ? (int) $_GET['minify'] : '1';
|
44 |
+
|
45 |
if(file_exists(APP_PATH."css{$ds}common.min.css")){
|
46 |
$content .= file_get_contents(APP_PATH."css{$ds}common.min.css");
|
47 |
} else {
|
53 |
foreach($template_folders as $name=>$folder){
|
54 |
$style = $folder['path']."{$ds}style.min.css"; //Minified version
|
55 |
$style2 = $folder['path']."{$ds}style.css"; //Unminified version, for old templates to work
|
56 |
+
if(file_exists($style) and $minify != '0'){
|
57 |
$content .= "\r\n".str_replace('$tpl', $folder['url'], file_get_contents($style));//apply url and print css
|
58 |
} else if(file_exists($style2)){
|
59 |
$content .= "\r\n".str_replace('$tpl', $folder['url'], file_get_contents($style2));//apply url and print css
|
69 |
function compile_js($templates){
|
70 |
$ds = DIRECTORY_SEPARATOR;
|
71 |
$content = '';
|
72 |
+
$minify = isset($_GET['minify']) ? (int) $_GET['minify'] : '1';
|
73 |
|
74 |
$template_folders = $templates->get_all_templates();
|
75 |
|
77 |
|
78 |
$js = $folder['path']."{$ds}script.min.js"; //Minified version
|
79 |
$js2 = $folder['path']."{$ds}script.js"; //Unminified version, for old templates to work
|
80 |
+
|
81 |
+
if(file_exists($js) and $minify != '0'){
|
82 |
$content .= file_get_contents($js)."\r\n";//Pull contents
|
83 |
} else if(file_exists($js2)){
|
84 |
$content .= file_get_contents($js2)."\r\n";
|
96 |
$theme = isset($_GET['theme']) ? htmlentities(strip_tags($_GET['theme'])) : 'twentytwelve';
|
97 |
$type = isset($_GET['type']) ? htmlentities(strip_tags($_GET['type'])) : '';
|
98 |
|
99 |
+
|
100 |
+
require_once(APP_PATH.'classes'.DIRECTORY_SEPARATOR.'class-cyclone-templates.php');
|
101 |
|
102 |
$templates = new Cyclone_Templates();
|
103 |
$templates->add_template_location(
|