Carousel Slider - Version 1.5.0

Version Description

1.5.0 is a major update. carousel_slider and all-carousels have been depreciated in this version. Check detail description befor upgrading to new version.

Download this release

Release Info

Developer sayful
Plugin Icon Carousel Slider
Version 1.5.0
Comparing to
See all releases

Code changes from version 1.4.2 to 1.5.0

LICENSE.txt CHANGED
File without changes
admin/Carousel_Slider_Admin.php CHANGED
@@ -7,56 +7,56 @@ class Carousel_Slider_Admin {
7
  private $version;
8
 
9
  public function __construct( $plugin_name, $version ) {
10
-
11
  $this->plugin_name = $plugin_name;
12
  $this->version = $version;
13
-
14
- }
15
-
16
- public function mce_plugin($plugin_array) {
17
- $plugin_array['carousel_slider'] = plugin_dir_url( __FILE__ ) . 'js/carousel-button.js';
18
- return $plugin_array;
19
  }
20
 
21
- public function mce_button($buttons) {
22
- array_push ($buttons, 'carousel_slider_button');
23
- return $buttons;
 
 
 
 
 
 
 
24
  }
25
-
26
- public function carousel_admin_color( $hook_suffix ) {
27
- wp_enqueue_style( 'wp-color-picker' );
28
- wp_enqueue_script( $this->plugin_name.'color', plugin_dir_url( __FILE__ ) . 'js/carousel-color-script.js', array( 'wp-color-picker' ), false, true );
29
  }
30
 
31
  public function carousel_post_type() {
32
-
33
  $labels = array(
34
- 'name' => _x( 'Carousels', 'Post Type General Name', 'carouselslider' ),
35
- 'singular_name' => _x( 'Carousel', 'Post Type Singular Name', 'carouselslider' ),
36
- 'menu_name' => __( 'Carousels', 'carouselslider' ),
37
- 'parent_item_colon' => __( 'Parent Carousel:', 'carouselslider' ),
38
- 'all_items' => __( 'All Carousels', 'carouselslider' ),
39
- 'view_item' => __( 'View Carousel', 'carouselslider' ),
40
- 'add_new_item' => __( 'Add New Carousel', 'carouselslider' ),
41
- 'add_new' => __( 'Add New', 'carouselslider' ),
42
- 'edit_item' => __( 'Edit Carousel', 'carouselslider' ),
43
- 'update_item' => __( 'Update Carousel', 'carouselslider' ),
44
- 'search_items' => __( 'Search Carousel', 'carouselslider' ),
45
- 'not_found' => __( 'Not found', 'carouselslider' ),
46
- 'not_found_in_trash' => __( 'Not found in Trash', 'carouselslider' ),
47
  );
48
  $args = array(
49
- 'label' => __( 'Carousel', 'carouselslider' ),
50
- 'description' => __( 'Carousel', 'carouselslider' ),
51
  'labels' => $labels,
52
- 'supports' => array( 'title', 'editor', 'thumbnail', ),
53
  'hierarchical' => false,
54
- 'public' => true,
55
  'show_ui' => true,
56
  'show_in_menu' => true,
57
  'show_in_nav_menus' => true,
58
  'show_in_admin_bar' => true,
59
- 'menu_position' => 5,
60
  'menu_icon' => 'dashicons-slides',
61
  'can_export' => true,
62
  'has_archive' => true,
@@ -65,162 +65,229 @@ class Carousel_Slider_Admin {
65
  'rewrite' => false,
66
  'capability_type' => 'post',
67
  );
68
- register_post_type( 'carousel', $args );
69
-
70
  }
71
 
72
- public function custom_image_size(){
73
- $this->options = get_option('sis_carousel_settings');
74
-
75
- if ( isset($this->options['image_size']) && $this->options['image_size'] == 'carousel-thumb') {
 
 
 
 
 
 
 
76
 
77
- if (isset($this->options['img_crop']) && $this->options['img_crop'] == 'false') {
 
 
78
 
79
- add_image_size( 'carousel-thumb', $this->options['img_width'], $this->options['img_height'] );
80
 
81
- } else {
82
- add_image_size( 'carousel-thumb', $this->options['img_width'], $this->options['img_height'], true );
83
- }
84
 
85
- }
 
 
 
 
 
 
 
86
  }
87
 
88
- public function carousel_image_box() {
89
- remove_meta_box( 'postimagediv', 'carousel', 'side' );
90
- add_meta_box('postimagediv', __('Upload Carousel Image', 'carouselslider'), 'post_thumbnail_meta_box', 'carousel', 'normal', 'high');
91
  }
92
- // Register Custom Taxonomy
93
- public function custom_taxonomy() {
94
-
95
- $labels = array(
96
- 'name' => _x( 'Carousel Categories', 'Taxonomy General Name', 'carouselslider' ),
97
- 'singular_name' => _x( 'Carousel Category', 'Taxonomy Singular Name', 'carouselslider' ),
98
- 'menu_name' => __( 'Carousel Categories', 'carouselslider' ),
99
- 'all_items' => __( 'All Carousel Categories', 'carouselslider' ),
100
- 'parent_item' => __( 'Parent Carousel Category', 'carouselslider' ),
101
- 'parent_item_colon' => __( 'Parent Carousel Category:', 'carouselslider' ),
102
- 'new_item_name' => __( 'New Carousel Category Name', 'carouselslider' ),
103
- 'add_new_item' => __( 'Add New Carousel Category', 'carouselslider' ),
104
- 'edit_item' => __( 'Edit Carousel Category', 'carouselslider' ),
105
- 'update_item' => __( 'Update Carousel Category', 'carouselslider' ),
106
- 'separate_items_with_commas' => __( 'Separate Carousel Categories with commas', 'carouselslider' ),
107
- 'search_items' => __( 'Search Carousel Categories', 'carouselslider' ),
108
- 'add_or_remove_items' => __( 'Add or remove Carousel Categories', 'carouselslider' ),
109
- 'choose_from_most_used' => __( 'Choose from the most used Carousel Categories', 'carouselslider' ),
110
- 'not_found' => __( 'Not Found', 'carouselslider' ),
111
- );
112
- $args = array(
113
- 'labels' => $labels,
114
- 'hierarchical' => false,
115
- 'public' => true,
116
- 'show_ui' => true,
117
- 'show_admin_column' => true,
118
- 'show_in_nav_menus' => true,
119
- 'show_tagcloud' => true,
120
- 'rewrite' => array( 'slug' => 'carousel-category', ),
121
- );
122
- register_taxonomy( 'carousel_category', array( 'carousel' ), $args );
123
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
124
  }
125
- public function add_meta_box() {
126
- add_meta_box(
127
- 'carousel_slider_id',
128
- __( 'Carousel Meta Box','carouselslider' ),
129
- array( $this, 'carousel_slider_meta_box_callback' ),
130
- 'carousel'
131
- );
132
- }
133
- public function save_meta_box( $post_id ) {
134
-
135
- /*
136
- * We need to verify this came from the our screen and with proper authorization,
137
- * because save_post can be triggered at other times.
138
- */
139
 
140
- // Check if our nonce is set.
141
- if ( ! isset( $_POST['carousel_slider_meta_box_nonce'] ) )
142
- return $post_id;
143
-
144
- $nonce = $_POST['carousel_slider_meta_box_nonce'];
 
 
 
145
 
146
- // Verify that the nonce is valid.
147
- if ( ! wp_verify_nonce( $nonce, 'carousel_slider_inner_custom_box' ) )
148
- return $post_id;
149
 
150
- // If this is an autosave, our form has not been submitted,
151
- // so we don't want to do anything.
152
- if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
153
- return $post_id;
154
 
155
- // Check the user's permissions.
156
- if ( 'page' == $_POST['post_type'] ) {
157
 
158
- if ( ! current_user_can( 'edit_page', $post_id ) )
159
- return $post_id;
160
-
161
- } else {
162
 
163
- if ( ! current_user_can( 'edit_post', $post_id ) )
164
- return $post_id;
165
- }
166
 
167
- /* OK, its safe for us to save the data now. */
168
 
169
- // Sanitize the user input.
170
- $link_target = sanitize_text_field( $_POST['carousel_slider_slide_link_target'] );
171
 
172
- if ((trim($_POST['carousel_slider_slide_link'])) != '') {
 
 
173
 
174
- $carousel_link = esc_url( $_POST['carousel_slider_slide_link'] );
175
 
176
- } else {
177
- $carousel_link = esc_url(get_permalink());
178
- }
179
-
180
-
 
 
 
 
 
181
 
182
- // Update the meta field.
183
- update_post_meta( $post_id, '_carousel_slider_slide_link_value', $carousel_link );
184
- update_post_meta( $post_id, '_carousel_slider_slide_link_target_value', $link_target );
 
185
  }
186
- public function carousel_slider_meta_box_callback( $post ) {
187
-
188
- // Add an nonce field so we can check for it later.
189
- wp_nonce_field( 'carousel_slider_inner_custom_box', 'carousel_slider_meta_box_nonce' );
190
-
191
- // Use get_post_meta to retrieve an existing value from the database.
192
- $carousel_link = get_post_meta( $post->ID, '_carousel_slider_slide_link_value', true );
193
- $link_target = get_post_meta( $post->ID, '_carousel_slider_slide_link_target_value', true );
194
-
195
- ?>
196
- <table class="form-table">
197
- <tr valign="top">
198
- <th scope="row">
199
- <label for="carousel_slider_slide_link">
200
- <?php _e('Carousel Link','nivo-image-slider') ?>
201
- </label>
202
- </th>
203
- <td>
204
- <input type="text" class="regular-text" id="carousel_slider_slide_link" name="carousel_slider_slide_link" value="<?php echo esc_attr( $carousel_link ); ?>" style="width:100% !important">
205
- <p><?php _e('Write slide link URL. If you want to use current slide link, just leave it blank. If you do not want any link write (#) without bracket or write desired link..','nivo-image-slider'); ?></p>
206
- </td>
207
- </tr>
208
- <tr valign="top">
209
- <th scope="row">
210
- <label for="carousel_slider_slide_link_target">
211
- <?php _e('Carousel Link Target','nivo-image-slider') ?>
212
- </label>
213
- </th>
214
- <td>
215
- <select name="carousel_slider_slide_link_target">
216
- <option value="_self" <?php selected( $link_target, '_self' ); ?>>Self</option>
217
- <option value="_blank" <?php selected( $link_target, '_blank' ); ?>>Blank</option>
218
- </select>
219
- <p><?php _e('Select Self to open the slide in the same frame as it was clicked (this is default) or select Blank open the slide in a new window or tab.','nivo-image-slider'); ?></p>
220
- </td>
221
- </tr>
222
- </table>
223
- <?php
224
- }
225
-
226
  }
7
  private $version;
8
 
9
  public function __construct( $plugin_name, $version ) {
 
10
  $this->plugin_name = $plugin_name;
11
  $this->version = $version;
12
+ $this->includes();
13
+ $this->metaboxs();
 
 
 
 
14
  }
15
 
16
+ public function admin_submenu()
17
+ {
18
+ add_submenu_page(
19
+ 'edit.php?post_type=carousels',
20
+ 'Documentation',
21
+ 'Documentation',
22
+ 'manage_options',
23
+ 'carousel-slider-documentation',
24
+ array( $this, 'submenu_page_callback')
25
+ );
26
  }
27
+ public function submenu_page_callback()
28
+ {
29
+ include 'partials/documentation.php';
 
30
  }
31
 
32
  public function carousel_post_type() {
 
33
  $labels = array(
34
+ 'name' => _x( 'Carousels', 'Post Type General Name', $this->plugin_name ),
35
+ 'singular_name' => _x( 'Carousel', 'Post Type Singular Name', $this->plugin_name ),
36
+ 'menu_name' => __( 'Carousels', $this->plugin_name ),
37
+ 'parent_item_colon' => __( 'Parent Carousel:', $this->plugin_name ),
38
+ 'all_items' => __( 'All Carousels', $this->plugin_name ),
39
+ 'view_item' => __( 'View Carousel', $this->plugin_name ),
40
+ 'add_new_item' => __( 'Add New Carousel', $this->plugin_name ),
41
+ 'add_new' => __( 'Add New', $this->plugin_name ),
42
+ 'edit_item' => __( 'Edit Carousel', $this->plugin_name ),
43
+ 'update_item' => __( 'Update Carousel', $this->plugin_name ),
44
+ 'search_items' => __( 'Search Carousel', $this->plugin_name ),
45
+ 'not_found' => __( 'Not found', $this->plugin_name ),
46
+ 'not_found_in_trash' => __( 'Not found in Trash', $this->plugin_name ),
47
  );
48
  $args = array(
49
+ 'label' => __( 'Carousel', $this->plugin_name ),
50
+ 'description' => __( 'Carousel', $this->plugin_name ),
51
  'labels' => $labels,
52
+ 'supports' => array( 'title' ),
53
  'hierarchical' => false,
54
+ 'public' => false,
55
  'show_ui' => true,
56
  'show_in_menu' => true,
57
  'show_in_nav_menus' => true,
58
  'show_in_admin_bar' => true,
59
+ 'menu_position' => 5.55525,
60
  'menu_icon' => 'dashicons-slides',
61
  'can_export' => true,
62
  'has_archive' => true,
65
  'rewrite' => false,
66
  'capability_type' => 'post',
67
  );
68
+ register_post_type( 'carousels', $args );
 
69
  }
70
 
71
+ public function add_meta_box() {
72
+
73
+ add_meta_box(
74
+ "carousel-shortcode-info",
75
+ __("Usage (Shortcode)", $this->plugin_name),
76
+ array( $this, 'render_meta_box_shortcode_info' ),
77
+ "carousels",
78
+ "side",
79
+ "high"
80
+ );
81
+ }
82
 
83
+ public function render_meta_box_shortcode_info()
84
+ {
85
+ $id = get_the_ID();
86
 
87
+ if ($id){
88
 
89
+ $id = '[carousel_slide id="'.$id.'"]';
 
 
90
 
91
+ echo '<p><b>'.__('Copy the following shortcode and paste in post or page where you want to show.', $this->plugin_name).'</b></p>';
92
+ echo '<p><pre><code>'.$id.'</code></pre></p>';
93
+ echo "<hr>";
94
+ echo '<p>'.__('If you like this plugin or if you make money using this or if you want to help me to continue my contribution on open source projects, consider to make a small donation.', $this->plugin_name).'</p>';
95
+ echo '<a target="_blank" href="http://sayfulit.com/donate">';
96
+ echo '<img src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" alt="">';
97
+ echo '</a>';
98
+ }
99
  }
100
 
101
+ public function includes()
102
+ {
103
+ require_once 'partials/MetaBox.php';
104
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
105
 
106
+ public function metaboxs()
107
+ {
108
+ $carousel_metabox = array(
109
+ 'id' => 'metabox-carousel-slide',
110
+ 'title' => __('Carousel Slider Settings', $this->plugin_name),
111
+ 'page' => array('carousels'),
112
+ 'context' => 'normal',
113
+ 'priority' => 'high',
114
+ 'fields' => array(
115
+ array(
116
+ 'id' => '_carousel_images',
117
+ 'type' => 'images',
118
+ 'name' => __('Carousel Images', $this->plugin_name),
119
+ 'desc' => __('Choose carousel images.', $this->plugin_name),
120
+ ),
121
+ array(
122
+ 'id' => '_image_size',
123
+ 'type' => 'image_sizes',
124
+ 'name' => __('Carousel Image Size', $this->plugin_name),
125
+ 'desc' => sprintf(__( 'Select "full" for full size image or your desired image size for carousel image. You can change the default size for thumbnail, medium and large from %1$s Settings >> Media %2$s.', $this->plugin_name ),'<a target="_blank" href="'.get_admin_url().'options-media.php">','</a>'),
126
+ ),
127
+ array(
128
+ 'id' => '_items',
129
+ 'type' => 'number',
130
+ 'name' => __('Carousel items', $this->plugin_name),
131
+ 'desc' => __('To set the maximum amount of items displayed at a time with the widest browser width (window >= 1200)', $this->plugin_name),
132
+ 'std' => 4
133
+ ),
134
+ array(
135
+ 'id' => '_items_small_desktop',
136
+ 'type' => 'number',
137
+ 'name' => __('Carousel items for small desktop', $this->plugin_name),
138
+ 'desc' => __('This allows you to preset the number of slides visible with (window >= 980) browser width.', $this->plugin_name),
139
+ 'std' => 4
140
+ ),
141
+ array(
142
+ 'id' => '_items_portrait_tablet',
143
+ 'type' => 'number',
144
+ 'name' => __('Carousel items for portrait Tablet', $this->plugin_name),
145
+ 'desc' => __('This allows you to preset the number of slides visible with (window >= 768) browser width.', $this->plugin_name),
146
+ 'std' => 3
147
+ ),
148
+ array(
149
+ 'id' => '_items_small_portrait_tablet',
150
+ 'type' => 'number',
151
+ 'name' => __('Carousel items for small portrait Tablet', $this->plugin_name),
152
+ 'desc' => __('This allows you to preset the number of slides visible with (window >= 600) browser width.', $this->plugin_name),
153
+ 'std' => 2
154
+ ),
155
+ array(
156
+ 'id' => '_items_portrait_mobile',
157
+ 'type' => 'number',
158
+ 'name' => __('Carousel items for portrait Mobile', $this->plugin_name),
159
+ 'desc' => __('This allows you to preset the number of slides visible with (window >= 320) browser width.', $this->plugin_name),
160
+ 'std' => 1
161
+ ),
162
+ array(
163
+ 'id' => '_slide_by',
164
+ 'type' => 'text',
165
+ 'name' => __('Slide By', $this->plugin_name),
166
+ 'desc' => __('Navigation slide by x number. Write "page" with inverted comma to slide by page. Default value is 1.', $this->plugin_name),
167
+ 'std' => 1
168
+ ),
169
+ array(
170
+ 'id' => '_margin_right',
171
+ 'type' => 'number',
172
+ 'name' => __('Margin Right(px) on item.', $this->plugin_name),
173
+ 'desc' => __('margin-right(px) on item. Default value is 10. Example: 20', $this->plugin_name),
174
+ 'std' => 10
175
+ ),
176
+ array(
177
+ 'id' => '_nav_button',
178
+ 'type' => 'checkbox',
179
+ 'name' => __('Display navigation buttons', $this->plugin_name),
180
+ 'label' => __('Display "next" and "previous" buttons', $this->plugin_name),
181
+ 'desc' => __('Check to display "next" and "previous" buttons', $this->plugin_name),
182
+ ),
183
+ array(
184
+ 'id' => '_dot_nav',
185
+ 'type' => 'checkbox',
186
+ 'name' => __('Show dots navigation', $this->plugin_name),
187
+ 'label' => __('Show dots navigation.', $this->plugin_name),
188
+ 'desc' => __('Check to show dots navigation.', $this->plugin_name),
189
+ ),
190
+ array(
191
+ 'id' => '_inifnity_loop',
192
+ 'type' => 'checkbox',
193
+ 'name' => __('Inifnity loop', $this->plugin_name),
194
+ 'label' => __('Inifnity loop.', $this->plugin_name),
195
+ 'desc' => __('Check to show inifnity loop. Duplicate last and first items to get loop illusion', $this->plugin_name),
196
+ 'std' => 'on'
197
+ ),
198
+ array(
199
+ 'id' => '_autoplay',
200
+ 'type' => 'checkbox',
201
+ 'name' => __('Autoplay', $this->plugin_name),
202
+ 'label' => __('Autoplay.', $this->plugin_name),
203
+ 'desc' => __('Check to enable autoplay', $this->plugin_name),
204
+ 'std' => 'on'
205
+ ),
206
+ array(
207
+ 'id' => '_autoplay_timeout',
208
+ 'type' => 'number',
209
+ 'name' => __('Autoplay Timeout', $this->plugin_name),
210
+ 'desc' => __('Autoplay interval timeout in millisecond. Default: 5000', $this->plugin_name),
211
+ 'std' => 5000
212
+ ),
213
+
214
+ array(
215
+ 'id' => '_autoplay_speed',
216
+ 'type' => 'number',
217
+ 'name' => __('Autoplay Speed', $this->plugin_name),
218
+ 'desc' => __('Autoplay speen in millisecond. Default: 500', $this->plugin_name),
219
+ 'std' => 500
220
+ ),
221
+ array(
222
+ 'id' => '_autoplay_pause',
223
+ 'type' => 'checkbox',
224
+ 'name' => __('Autoplay Hover Pause', $this->plugin_name),
225
+ 'label' => __('Pause on mouse hover.', $this->plugin_name),
226
+ 'desc' => __('Pause autoplay on mouse hover.', $this->plugin_name),
227
+ ),
228
+ array(
229
+ 'id' => '_nav_color',
230
+ 'type' => 'color',
231
+ 'name' => __('Navigation Color ', $this->plugin_name),
232
+ 'desc' => __('Enter hex value of color for carousel navigation.', $this->plugin_name),
233
+ 'std' => '#d6d6d6'
234
+ ),
235
+
236
+ array(
237
+ 'id' => '_nav_active_color',
238
+ 'type' => 'color',
239
+ 'name' => __('Navigation Color: Hover & Active', $this->plugin_name),
240
+ 'desc' => __('Enter hex value of color for carousel navigation.', $this->plugin_name),
241
+ 'std' => '#4dc7a0'
242
+ ),
243
+ )
244
+ );
245
+ $meta_box = new \CarouselSlider\MetaBox($carousel_metabox);
246
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
247
 
248
+ public function columns_head($columns){
249
+
250
+ $columns = array(
251
+ 'cb' => '<input type="checkbox">',
252
+ 'title' => __('Carousel Slide Title', $this->plugin_name),
253
+ 'usage' => __('Shortcode', $this->plugin_name),
254
+ 'images' => __('Carousel Images', $this->plugin_name)
255
+ );
256
 
257
+ return $columns;
 
 
258
 
259
+ }
 
 
 
260
 
 
 
261
 
262
+ public function columns_content($column, $post_id) {
263
+ global $post;
 
 
264
 
265
+ switch ($column) {
 
 
266
 
267
+ case 'usage':
268
 
269
+ $id = $post_id;
 
270
 
271
+ if ( !empty($id) ){
272
+ echo '<pre><code>[carousel_slide id="'.$id.'"]</code></pre>';
273
+ }
274
 
275
+ break;
276
 
277
+ case 'images':
278
+ $image_ids = explode(',', get_post_meta( get_the_ID(), '_wpdh_image_ids', true) );
279
+ $images ='<ul id="carousel-thumbs" class="carousel-thumbs">';
280
+ foreach ( $image_ids as $image ) {
281
+ if(!$image) continue;
282
+ $src = wp_get_attachment_image_src( $image, array(32,32) );
283
+ $images .= "<li style='display:inline;margin-right:5px;'><img src='{$src[0]}' width='{$src[1]}' height='{$src[2]}'></li>";
284
+ }
285
+ $images .= '</ul>';
286
+ echo $images;
287
 
288
+ break;
289
+ default :
290
+ break;
291
+ }
292
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
293
  }
admin/Carousel_Slider_Settings.php DELETED
@@ -1,265 +0,0 @@
1
- <?php
2
- class Carousel_Slider_Settings {
3
- /**
4
- * Holds the values to be used in the fields callbacks
5
- */
6
- private $options;
7
-
8
- /**
9
- * Start up
10
- */
11
- public function __construct()
12
- {
13
- add_action( 'admin_menu', array( $this, 'add_plugin_page' ) );
14
- add_action( 'admin_init', array( $this, 'page_init' ) );
15
- register_activation_hook( __FILE__, array( $this, 'default_options' ));
16
- $this->options = get_option('sis_carousel_settings');
17
-
18
-
19
- }
20
-
21
- public function default_options(){
22
-
23
- $options_array = array(
24
- 'image_size' => 'full',
25
- 'img_width' => '',
26
- 'img_height' => '',
27
- 'img_crop' => '',
28
- 'btn_bg_color' => '#666666',
29
- 'btn_color' => '#dddddd',
30
- 'btn_opacity' => '0.4',
31
- );
32
-
33
- if ( $this->options !== false ) {
34
-
35
- update_option( 'sis_carousel_settings', $options_array );
36
-
37
- } else{
38
-
39
- add_option( 'sis_carousel_settings', $options_array );
40
-
41
- }
42
-
43
- }
44
-
45
- public function custom_image_size(){
46
-
47
- if ( isset($options['image_size']) && $options['image_size'] == 'carousel-thumb') {
48
-
49
- add_image_size( 'carousel-thumb', $this->options['img_width'], $this->options['img_height'], $this->options['img_crop'] );
50
- }
51
- }
52
-
53
- /**
54
- * Add options page
55
- */
56
- public function add_plugin_page()
57
- {
58
- // This page will be under "Settings"
59
- add_options_page(
60
- __('Carousel Slider Settings', 'carouselslider'),
61
- __('Carousel Slider', 'carouselslider'),
62
- 'manage_options',
63
- 'carousel_slider',
64
- array( $this, 'create_admin_page' )
65
- );
66
- }
67
-
68
- /**
69
- * Options page callback
70
- */
71
- public function create_admin_page()
72
- {
73
- // Set class property
74
- $this->options = get_option( 'sis_carousel_settings' );
75
- ?>
76
- <div class="wrap">
77
- <h2><?php _e('Carousel Slider Settings' ,'carouselslider'); ?></h2>
78
- <form method="post" action="options.php">
79
- <?php
80
- // This prints out all hidden setting fields
81
- settings_fields( 'carousel_slider_option_group' );
82
- do_settings_sections( 'carousel_slider' );
83
- submit_button();
84
- ?>
85
- </form>
86
- </div>
87
- <?php
88
- }
89
-
90
- /**
91
- * Register and add settings
92
- */
93
- public function page_init() {
94
-
95
- register_setting(
96
- 'carousel_slider_option_group', // Option group
97
- 'sis_carousel_settings', // Option name
98
- array( $this, 'sanitize' ) // Sanitize
99
- );
100
-
101
- add_settings_section(
102
- 'setting_section_id', // ID
103
- __('Global Settings', 'carouselslider'), // Title
104
- array( $this, 'print_section_info' ), // Callback
105
- 'carousel_slider' // Page
106
- );
107
-
108
- add_settings_field(
109
- 'image_size', // ID
110
- __('Carousel Images Size', 'carouselslider'), // Title
111
- array( $this, 'image_size_callback' ), // Callback
112
- 'carousel_slider', // Page
113
- 'setting_section_id' // Section
114
- );
115
-
116
- add_settings_field(
117
- 'custom_image_size',
118
- __('Custom Image Size', 'carouselslider'),
119
- array( $this, 'custom_image_size_callback' ),
120
- 'carousel_slider',
121
- 'setting_section_id'
122
- );
123
-
124
- add_settings_field(
125
- 'btn_bg_color',
126
- __('Nav Background Color', 'carouselslider'),
127
- array( $this, 'btn_bg_color_callback' ),
128
- 'carousel_slider',
129
- 'setting_section_id'
130
- );
131
-
132
- add_settings_field(
133
- 'btn_color',
134
- __('Nav Color', 'carouselslider'),
135
- array( $this, 'btn_color_callback' ),
136
- 'carousel_slider',
137
- 'setting_section_id'
138
- );
139
-
140
- add_settings_field(
141
- 'btn_opacity',
142
- __('Nav Opacity', 'carouselslider'),
143
- array( $this, 'btn_opacity_callback' ),
144
- 'carousel_slider',
145
- 'setting_section_id'
146
- );
147
- }
148
-
149
- /**
150
- * Sanitize each setting field as needed
151
- *
152
- * @param array $input Contains all settings fields as array keys
153
- */
154
- public function sanitize( $input )
155
- {
156
- $new_input = array();
157
-
158
- if ( in_array( $input['image_size'], array( 'thumbnail', 'medium', 'large', 'full', 'carousel-thumb' ), true ) )
159
- $new_input['image_size'] = $input['image_size'];
160
-
161
- if( isset( $input['img_width'] ) )
162
- $new_input['img_width'] = absint( $input['img_width'] );
163
-
164
- if( isset( $input['img_height'] ) )
165
- $new_input['img_height'] = absint( $input['img_height'] );
166
-
167
- if ( in_array( $input['img_crop'], array( 'false', 'true' ), true ) )
168
- $new_input['img_crop'] = $input['img_crop'];
169
-
170
- if( isset( $input['btn_bg_color'] ) )
171
- $new_input['btn_bg_color'] = sanitize_text_field( $input['btn_bg_color'] );
172
-
173
- if( isset( $input['btn_color'] ) )
174
- $new_input['btn_color'] = sanitize_text_field( $input['btn_color'] );
175
-
176
- if( isset( $input['btn_opacity'] ) )
177
- $new_input['btn_opacity'] = sanitize_text_field( $input['btn_opacity'] );
178
-
179
- return $new_input;
180
- }
181
-
182
- /**
183
- * Print the Section text
184
- */
185
- public function print_section_info()
186
- {
187
- print 'Change the global settings for carousel slider. This settings will be applicable for all carousel slider that you used in your site.';
188
- }
189
-
190
- /**
191
- * Get the settings option array and print one of its values
192
- */
193
- function image_size_callback() {
194
-
195
- $values = array(
196
- 'full' => 'Full resolution (original size uploaded)',
197
- 'large' => 'Large resolution (default 640px x 640px max)',
198
- 'medium' => 'Medium resolution (default 300px x 300px max)',
199
- 'thumbnail' => 'Thumbnail (default 150px x 150px max)',
200
- 'carousel-thumb'=> 'Use custom image size',
201
- );
202
-
203
- ?>
204
- <select id='image_size' name='sis_carousel_settings[image_size]'>
205
- <?php
206
- foreach($values as $code => $label) :
207
- if( $code == $this->options['image_size'] ) { $selected = "selected='selected'"; } else { $selected = ''; }
208
- echo "<option {$selected} value='{$code}'>{$label}</option>";
209
- endforeach;
210
- ?>
211
- </select>
212
- <?php
213
- echo '<p>' . __( 'Select carousel image size.', 'sandbox' ) . '</p>';
214
- }
215
- /**
216
- * Get the settings option array and print one of its values
217
- */
218
- public function custom_image_size_callback() {
219
-
220
- $values = array(
221
- 'false' => 'Soft proportional crop mode',
222
- 'true' => 'Hard crop mode',
223
- );
224
-
225
- ?>
226
- <input type='number' class='small-text' name='sis_carousel_settings[img_width]' id='img_width' value='<?php echo (isset($this->options['img_width'])) ? $this->options['img_width'] : '0'; ?>'>
227
-
228
- <input type='number' class='small-text' name='sis_carousel_settings[img_height]' id='img_height' value='<?php echo (isset($this->options['img_height'])) ? $this->options['img_height'] : '0'; ?>'>
229
- <select id='img_crop' name='sis_carousel_settings[img_crop]'>
230
- <?php
231
- foreach($values as $code => $label) :
232
- if( $code == $this->options['img_crop'] ) { $selected = "selected='selected'"; } else { $selected = ''; }
233
- echo "<option {$selected} value='{$code}'>{$label}</option>";
234
- endforeach;
235
- ?>
236
- </select>
237
- <p><?php _e( 'Width x Height x Crop. (Carousel Images Size need to be selected as Use custom image size). This settings will not affect for the previously uploaded images. If you want to rebuild previously uploaded images, you can use another WordPress plugin <a target="_blank" href="https://wordpress.org/plugins/ajax-thumbnail-rebuild/">AJAX Thumbnail Rebuild</a>', 'sandbox' ); ?></p>
238
- <?php
239
-
240
- }
241
-
242
- public function btn_bg_color_callback(){
243
- ?>
244
- <input type="text" name="sis_carousel_settings[btn_bg_color]" id="btn_bg_color" data-default-color="#666666" value="<?php echo (isset($this->options['btn_bg_color'])) ? $this->options['btn_bg_color'] : '#666666'; ?>">
245
- <p><?php _e( 'Choose carousel navigation background color.', 'sandbox' ); ?></p>
246
- <?php
247
- }
248
-
249
- public function btn_color_callback(){
250
- ?>
251
- <input type="text" name="sis_carousel_settings[btn_color]" id="btn_color" data-default-color="#dddddd" value="<?php echo (isset($this->options['btn_color'])) ? $this->options['btn_color'] : '#dddddd'; ?>">
252
- <p><?php _e( 'Choose carousel navigation color.', 'sandbox' ); ?></p>
253
- <?php
254
- }
255
-
256
- public function btn_opacity_callback(){
257
- ?>
258
- <input type="text" class="small-text" name="sis_carousel_settings[btn_opacity]" id="btn_opacity" value="<?php echo (isset($this->options['btn_opacity'])) ? $this->options['btn_opacity'] : '.4'; ?>">
259
- <p><?php _e( 'Enter button opacity value. min value is 0 and max value is 1. Example 0.2', 'sandbox' ); ?></p>
260
- <?php
261
- }
262
- }
263
-
264
- if( is_admin() )
265
- $carousel_slider_settings = new Carousel_Slider_Settings();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/index.php CHANGED
File without changes
admin/js/carousel-button.js DELETED
@@ -1,25 +0,0 @@
1
- (function() {
2
- tinymce.create('tinymce.plugins.Carousel_Slider', {
3
-
4
- init : function(ed, url) {
5
- ed.addCommand('carousel_slider_button', function() {
6
- return_text = '[carousel id=""][item href="" img_link=""][item href="" img_link=""][item href="" img_link=""][item href="" img_link=""][item href="" img_link=""][/carousel]';
7
- ed.execCommand('mceInsertContent', 0, return_text);
8
- });
9
-
10
-
11
- ed.addButton('carousel_slider_button', {
12
- title : 'Add Carousel Slider',
13
- cmd : 'carousel_slider_button',
14
- image : url + '/carousel.png'
15
- });
16
-
17
- },
18
- createControl : function(n, cm) {
19
- return null;
20
- },
21
- });
22
-
23
- // Register plugin
24
- tinymce.PluginManager.add('carousel_slider', tinymce.plugins.Carousel_Slider);
25
- })();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/js/carousel-color-script.js DELETED
@@ -1,4 +0,0 @@
1
- jQuery(document).ready(function($){
2
- $('#btn_bg_color').wpColorPicker();
3
- $('#btn_color').wpColorPicker();
4
- });
 
 
 
 
admin/js/carousel.png DELETED
Binary file
admin/partials/MetaBox.php ADDED
@@ -0,0 +1,469 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace CarouselSlider;
3
+
4
+ class MetaBox {
5
+
6
+ private $fields;
7
+
8
+ public function __construct($fields){
9
+ $this->fields = $fields;
10
+ add_action( 'add_meta_boxes', array( &$this, 'add_meta_boxes' ) );
11
+ add_action( 'save_post', array( &$this, 'save_meta_box' ) );
12
+ add_action( 'wp_ajax_save_images', array( &$this, 'save_images' ) );
13
+ add_action( 'admin_enqueue_scripts', array( &$this, 'metabox_scripts' ) );
14
+ add_action( 'admin_head', array( &$this, 'admin_head' ) );
15
+ }
16
+
17
+ /**
18
+ * Add a custom meta box
19
+ *
20
+ * @method add_meta_boxes
21
+ */
22
+ public function add_meta_boxes()
23
+ {
24
+ if( !is_array( $this->fields ) ) return false;
25
+ add_meta_box(
26
+ $this->fields['id'],
27
+ $this->fields['title'],
28
+ array( $this, 'meta_box_callback' ),
29
+ $this->fields['page'],
30
+ $this->fields['context'],
31
+ $this->fields['priority'],
32
+ $this->fields
33
+ );
34
+ }
35
+
36
+
37
+ /**
38
+ * Prints out the HTML for the edit screen section.
39
+ * @method meta_box_callback
40
+ * @param string $post name of post type
41
+ * @param array $form_fields Arguments to pass into your callback function.
42
+ */
43
+ public function meta_box_callback($post, $form_fields)
44
+ {
45
+ if( !is_array( $form_fields) ) return false;
46
+
47
+ wp_nonce_field( basename(__FILE__), 'wpdh_meta_box_nonce' );
48
+
49
+ echo '<table class="form-table">';
50
+
51
+ foreach( $form_fields['args']['fields'] as $field ){
52
+
53
+ $meta_id = (isset($field['id'])) ? $field['id'] : strtolower(str_replace(' ', '_', $field['name']));
54
+ $meta_name = $this->fields['id'] . '_meta['.$meta_id. ']';
55
+ $meta = get_post_meta( $post->ID, $meta_id, true );
56
+ $std = (isset($field['std'])) ? $field['std'] : '';
57
+ $value = $meta ? $meta : $std;
58
+ $desc = (isset($field['desc'])) ? $field['desc'] : '';
59
+ $type = (isset($field['type'])) ? $field['type'] : 'text';
60
+
61
+ echo sprintf('<tr><th><label for="%1$s"><strong>%2$s</strong></label></th>', $meta_id, $field['name']);
62
+
63
+ switch( $type ){
64
+ case 'text':
65
+ echo sprintf('<td><input type="text" name="%1$s" id="%2$s" value="%3$s" class="regular-text">',$meta_name, $meta_id, $value);
66
+ break;
67
+
68
+ case 'email':
69
+ echo sprintf('<td><input type="email" name="%1$s" id="%2$s" value="%3$s" class="regular-text">',$meta_name, $meta_id, $value);
70
+ break;
71
+
72
+ case 'number':
73
+ echo sprintf('<td><input type="number" name="%1$s" id="%2$s" value="%3$s" class="regular-text">',$meta_name, $meta_id, $value);
74
+ break;
75
+
76
+ case 'url':
77
+ echo sprintf('<td><input type="url" name="%1$s" id="%2$s" value="%3$s" class="regular-text">',$meta_name, $meta_id, $value);
78
+ break;
79
+
80
+ case 'color':
81
+ echo sprintf('<td><input type="text" name="%1$s" id="%2$s" value="%3$s" data-default-color="%4$s" class="colorpicker">',$meta_name, $meta_id, $value, $std);
82
+ break;
83
+
84
+ case 'date':
85
+ echo sprintf('<td><input type="text" name="%1$s" id="%2$s" value="%3$s" class="datepicker">',$meta_name, $meta_id, $value);
86
+ break;
87
+
88
+ case 'textarea':
89
+ echo sprintf('<td><textarea name="%1$s" id="%2$s" rows="8" cols="50">%3$s</textarea>',$meta_name, $meta_id, $value);
90
+ break;
91
+
92
+ case 'select':
93
+ echo sprintf('<td><select name="%1$s" id="%2$s">',$meta_name, $meta_id);
94
+ foreach( $field['options'] as $key => $option ){
95
+ $selected = ( $value == $key ) ? ' selected="selected"' : '';
96
+ echo sprintf('<option value="%1$s" %3$s>%2$s</option>',$key, $option, $selected);
97
+ }
98
+ echo'</select>';
99
+ break;
100
+
101
+ case 'image_sizes':
102
+ $available_img_size = get_intermediate_image_sizes();
103
+ array_push($available_img_size, 'full');
104
+
105
+ echo sprintf('<td><select name="%1$s" id="%2$s">',$meta_name, $meta_id);
106
+ foreach( $available_img_size as $key => $option ){
107
+ $selected = ( $value == $option ) ? ' selected="selected"' : '';
108
+ echo sprintf('<option value="%1$s" %3$s>%2$s</option>',$option, $option, $selected);
109
+ }
110
+ echo'</select>';
111
+ break;
112
+
113
+ case 'radio':
114
+ echo '<td><fieldset>';
115
+ foreach( $field['options'] as $key => $option ){
116
+
117
+ $checked = ( $value == $key ) ? ' checked="checked"' : '';
118
+ echo sprintf('<label for="%1$s"><input type="radio" name="%4$s" id="%1$s" value="%1$s" %3$s>%2$s</label><br>',$key, $option, $checked, $meta_name);
119
+ }
120
+ echo '<fieldset>';
121
+ break;
122
+
123
+ case 'checkbox':
124
+ $checked = ( $value == 'on' ) ? ' checked' : '';
125
+ $label = (isset($field['label'])) ? $field['label'] : '';
126
+ echo sprintf( '<input type="hidden" name="%1$s" value="off">', $meta_name );
127
+ echo sprintf('<td><label for="%2$s"><input type="checkbox" %4$s value="on" id="%2$s" name="%1$s">%3$s</label>',$meta_name, $meta_id, $label, $checked);
128
+ break;
129
+
130
+ case 'file':
131
+ $multiple = ( isset( $field['multiple'] ) ) ? true : false;
132
+ ?><script>
133
+ jQuery(function($){
134
+ var frame,
135
+ isMultiple = "<?php echo $multiple; ?>";
136
+
137
+ $('#<?php echo $meta_id; ?>_button').on('click', function(e) {
138
+ e.preventDefault();
139
+
140
+ var options = {
141
+ state: 'insert',
142
+ frame: 'post',
143
+ multiple: isMultiple
144
+ };
145
+
146
+ frame = wp.media(options).open();
147
+
148
+ frame.menu.get('view').unset('gallery');
149
+ frame.menu.get('view').unset('featured-image');
150
+
151
+ frame.toolbar.get('view').set({
152
+ insert: {
153
+ style: 'primary',
154
+ text: '<?php _e("Insert", "wpdh"); ?>',
155
+
156
+ click: function() {
157
+ var models = frame.state().get('selection'),
158
+ url = models.first().attributes.url,
159
+ files = [];
160
+
161
+ if( isMultiple ) {
162
+ models.map (function( attachment ) {
163
+ attachment = attachment.toJSON();
164
+ files.push(attachment.url);
165
+ url = files;
166
+ });
167
+ }
168
+
169
+ $('#<?php echo $meta_id; ?>').val( url );
170
+
171
+ frame.close();
172
+ }
173
+ }
174
+ });
175
+ });
176
+ });
177
+ </script>
178
+
179
+ <?php
180
+ echo sprintf('<td><input type="text" name="%1$s" id="%2$s" value="%3$s" class="regular-text">',$meta_name, $meta_id, $value);
181
+ echo '<input type="button" class="button" name="'. $meta_id .'_button" id="'. $meta_id .'_button" value="Browse">';
182
+ break;
183
+
184
+ case 'images':
185
+ $create_btn_text = 'Create Gallery';
186
+ $edit_btn_text = 'Edit Gallery';
187
+ $update_btn_text = 'Save Gallery';
188
+ $progress_btn_text = 'Saving...';
189
+ ?>
190
+ <script>
191
+ jQuery(function($){
192
+ var frame,
193
+ images = '<?php echo get_post_meta( $post->ID, '_wpdh_image_ids', true ); ?>',
194
+ selection = loadImages(images);
195
+
196
+ $('#wpdh_images_upload').on('click', function(e) {
197
+ e.preventDefault();
198
+ var options = {
199
+ title: '<?php echo $create_btn_text; ?>',
200
+ state: 'gallery-edit',
201
+ frame: 'post',
202
+ selection: selection
203
+ };
204
+
205
+ if( frame || selection ) {
206
+ options['title'] = '<?php echo $edit_btn_text; ?>';
207
+ }
208
+
209
+ frame = wp.media(options).open();
210
+
211
+ // Tweak Views
212
+ frame.menu.get('view').unset('cancel');
213
+ frame.menu.get('view').unset('separateCancel');
214
+ frame.menu.get('view').get('gallery-edit').el.innerHTML = '<?php echo $edit_btn_text; ?>';
215
+ frame.content.get('view').sidebar.unset('gallery'); // Hide Gallery Settings in sidebar
216
+
217
+ // when editing a gallery
218
+ overrideGalleryInsert();
219
+ frame.on( 'toolbar:render:gallery-edit', function() {
220
+ overrideGalleryInsert();
221
+ });
222
+
223
+ frame.on( 'content:render:browse', function( browser ) {
224
+ if ( !browser ) return;
225
+ // Hide Gallery Settings in sidebar
226
+ browser.sidebar.on('ready', function(){
227
+ browser.sidebar.unset('gallery');
228
+ });
229
+ // Hide filter/search as they don't work
230
+ browser.toolbar.on('ready', function(){
231
+ if(browser.toolbar.controller._state == 'gallery-library'){
232
+ browser.toolbar.$el.hide();
233
+ }
234
+ });
235
+ });
236
+
237
+ // All images removed
238
+ frame.state().get('library').on( 'remove', function() {
239
+ var models = frame.state().get('library');
240
+ if(models.length == 0){
241
+ selection = false;
242
+ $.post(ajaxurl, {
243
+ ids: '',
244
+ action: 'save_images',
245
+ post_id: wpdh_ajax.post_id,
246
+ nonce: wpdh_ajax.nonce
247
+ });
248
+ }
249
+ });
250
+
251
+ function overrideGalleryInsert(){
252
+ frame.toolbar.get('view').set({
253
+ insert: {
254
+ style: 'primary',
255
+ text: '<?php echo $update_btn_text; ?>',
256
+ click: function(){
257
+ var models = frame.state().get('library'),
258
+ ids = '';
259
+
260
+ models.each( function( attachment ) {
261
+ ids += attachment.id + ','
262
+ });
263
+
264
+ this.el.innerHTML = '<?php echo $progress_btn_text; ?>';
265
+
266
+ $.ajax({
267
+ type: 'POST',
268
+ url: ajaxurl,
269
+ data: {
270
+ ids: ids,
271
+ action: 'save_images',
272
+ post_id: wpdh_ajax.post_id,
273
+ nonce: wpdh_ajax.nonce
274
+ },
275
+ success: function(){
276
+ selection = loadImages(ids);
277
+ $('#_wpdh_image_ids').val( ids );
278
+ frame.close();
279
+ },
280
+ dataType: 'html'
281
+ }).done( function( data ) {
282
+ $('.wpdh-gallery-thumbs').html( data );
283
+ console.log(data);
284
+ });
285
+ }
286
+ }
287
+ });
288
+ }
289
+
290
+ });
291
+
292
+ function loadImages(images){
293
+ if (images){
294
+ var shortcode = new wp.shortcode({
295
+ tag: 'gallery',
296
+ attrs: { ids: images },
297
+ type: 'single'
298
+ });
299
+
300
+ var attachments = wp.media.gallery.attachments( shortcode );
301
+
302
+ var selection = new wp.media.model.Selection( attachments.models, {
303
+ props: attachments.props.toJSON(),
304
+ multiple: true
305
+ });
306
+
307
+ selection.gallery = attachments.gallery;
308
+
309
+ selection.more().done( function() {
310
+ // Break ties with the query.
311
+ selection.props.set({ query: false });
312
+ selection.unmirror();
313
+ selection.props.unset('orderby');
314
+ });
315
+
316
+ return selection;
317
+ }
318
+ return false;
319
+ }
320
+ });
321
+ </script>
322
+
323
+ <?php
324
+
325
+ $meta = get_post_meta( $post->ID, '_wpdh_image_ids', true );
326
+ $thumbs_output = '';
327
+ $button_text = ($meta) ? $edit_btn_text : $create_btn_text;
328
+ if( $meta ) {
329
+ $thumbs = explode(',', $meta);
330
+ $thumbs_output = '';
331
+ foreach( $thumbs as $thumb ) {
332
+ $thumbs_output .= '<li>' . wp_get_attachment_image( $thumb, array(75,75) ) . '</li>';
333
+ }
334
+ }
335
+
336
+ echo sprintf('<td class="wpdh-box-%s">', $type);
337
+ echo sprintf('<input type="button" class="button" name="%1$s" id="wpdh_images_upload" value="%2$s">', $meta_id, $button_text);
338
+ echo '<input type="hidden" name="wpdh_meta[_wpdh_image_ids]" id="_wpdh_image_ids" value="' . ($meta ? $meta : 'false') . '"><br>';
339
+
340
+ echo sprintf('<div class="wpdh-gallery-thumbs"><ul>%s</ul></div>',$thumbs_output);
341
+ break;
342
+
343
+ default:
344
+ echo sprintf('<td><input type="text" name="%1$s" id="%2$s" value="%3$s" class="regular-text">',$meta_name, $meta_id, $value);
345
+ break;
346
+
347
+ }
348
+
349
+ if (!empty($desc)) {
350
+ echo sprintf('<p class="description">%s</p>', $desc);
351
+ }
352
+
353
+ echo '</td></tr>';
354
+
355
+ }
356
+
357
+ echo '</table>';
358
+
359
+ // Include inline scripts for meta box
360
+ $this->inline_scripts();
361
+
362
+ }
363
+
364
+ /**
365
+ * Save custom meta box
366
+ * @method save_meta_box
367
+ * @param int $post_id The post ID
368
+ */
369
+ public function save_meta_box( $post_id ) {
370
+
371
+ if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
372
+ return;
373
+
374
+ $postName = $this->fields['id']. '_meta';
375
+
376
+ if ( !isset($_POST[$postName]) || !isset($_POST['wpdh_meta_box_nonce']) || !wp_verify_nonce( $_POST['wpdh_meta_box_nonce'], basename( __FILE__ ) ) )
377
+ return;
378
+
379
+ if ( 'page' == $_POST['post_type'] ) {
380
+ if ( !current_user_can( 'edit_page', $post_id ) ) return;
381
+ } else {
382
+ if ( !current_user_can( 'edit_post', $post_id ) ) return;
383
+ }
384
+
385
+ foreach( $_POST[$postName] as $key => $val ){
386
+ update_post_meta( $post_id, $key, stripslashes(htmlspecialchars($val)) );
387
+ }
388
+ }
389
+
390
+ /**
391
+ * Save images
392
+ * @method save_images
393
+ */
394
+ public function save_images(){
395
+ if( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ){
396
+ return;
397
+ }
398
+
399
+ if ( !isset($_POST['ids']) || !isset($_POST['nonce']) || !wp_verify_nonce( $_POST['nonce'], 'wpdh-ajax' ) ){
400
+ return;
401
+ }
402
+
403
+ if ( !current_user_can( 'edit_posts' ) ) return;
404
+
405
+ $ids = strip_tags(rtrim($_POST['ids'], ','));
406
+ update_post_meta($_POST['post_id'], '_wpdh_image_ids', $ids);
407
+
408
+ $thumbs = explode(',', $ids);
409
+ $thumbs_output = '';
410
+ foreach( $thumbs as $thumb ) {
411
+ $thumbs_output .= '<li>' . wp_get_attachment_image( $thumb, array(75,75) ) . '</li>';
412
+ }
413
+
414
+ echo $thumbs_output;
415
+
416
+ die();
417
+ }
418
+
419
+ /**
420
+ * Enqueue admin scripts for meta box
421
+ * @method metabox_scripts
422
+ */
423
+ public function metabox_scripts(){
424
+
425
+ wp_enqueue_media();
426
+ wp_enqueue_style( 'wp-color-picker' );
427
+ wp_enqueue_script( 'wp-color-picker' );
428
+ wp_enqueue_script( 'jquery-ui-datepicker' );
429
+
430
+ global $post;
431
+ if( isset($post) ) {
432
+ wp_localize_script( 'jquery', 'wpdh_ajax', array(
433
+ 'post_id' => $post->ID,
434
+ 'nonce' => wp_create_nonce( 'wpdh-ajax' )
435
+ ) );
436
+ }
437
+ }
438
+
439
+ /**
440
+ * Add inline script for color and date field
441
+ * @method inline_scripts
442
+ */
443
+ public function inline_scripts()
444
+ {
445
+ ?><script type="text/javascript">
446
+ jQuery(document).ready(function($){
447
+ $('.colorpicker').wpColorPicker();
448
+ $( ".datepicker" ).datepicker({
449
+ changeMonth: true,
450
+ changeYear: true
451
+ });
452
+ });
453
+ </script><?php
454
+ }
455
+
456
+ /**
457
+ * Add inline style for admin screen
458
+ * @method admin_head
459
+ */
460
+ public function admin_head()
461
+ {
462
+ $style = '<style>';
463
+ $style .= '.wpdh-gallery-thumbs{display: block; clear: both;}';
464
+ $style .= '.wpdh-gallery-thumbs li {display: inline-block;margin-right: 10px;margin-bottom: 10px;}';
465
+ $style .= '</style>';
466
+ echo $style;
467
+ }
468
+
469
+ }
admin/partials/documentation.php ADDED
@@ -0,0 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="wrap">
2
+
3
+ <div class="notice">
4
+ <p><strong>If you like this plugin or if you make money using this or if you want to help me to continue my contribution on open source projects, consider to make a small donation.</strong></p>
5
+ <p><a href="http://sayfulit.com/donate" target="_blank"><img alt="" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif"></a></p>
6
+ <p><strong>You can also buy premium version from <a href="http://wpeden.com/product/sp-image-carousel/">here</a> or <a href="http://demo.sayfulit.com/sp-image-carousel/">try demo first</a></strong></p>
7
+ </div>
8
+
9
+ <h2>From Version 1.5.0</h2>
10
+
11
+ <hr><iframe width="560" height="315" src="https://www.youtube.com/embed/O4-EM32h7b4?list=PL9GiQPpTzMv5ftsvX55JO_lTDcKrwCPVn" frameborder="0" allowfullscreen></iframe><hr>
12
+
13
+ <h2>Usage - linking image</h2>
14
+ <p>Without using custom post (Carousels admin menu), you can use custom shortcode to link image and generate carousel slider.</p>
15
+ <p>To gererate carousel slider using shortcode, at first write wrapper shortcode as following:</p>
16
+ <pre><code>[carousel][/carousel]</code></pre>
17
+ <p>Now write the following shortcode inside the wrapper shortcode as many image as you want.</p>
18
+ <pre><code>[item img_link=""]</code></pre>
19
+ <p>You can add following attribute if you want to link image to custom post, page, image, etc. Like as following</p>
20
+ <pre><code>[item img_link="IMAGE_URL_GOES_HERE" href="CUSTOM_URL_GOES_HERE"]</code></pre>
21
+ <P>The whole shortcode look likes as following: (See example shortcode.)</P>
22
+ <pre style="overflow: auto;"><code>[carousel][item img_link="IMAGE_URL_GOES_HERE"][item img_link="IMAGE_URL_GOES_HERE" href="CUSTOM_URL_GOES_HERE"][item img_link="IMAGE_URL_GOES_HERE"][/carousel]</code></pre>
23
+ <h2>Shortcode Attributes</h2>
24
+ <p>You can use shortcode attributes to change default functionality. These attributes need to place inside wrapper shortcode. The available shortcode attributes are as following:</p>
25
+ <table class="form-table doc-table">
26
+ <tr>
27
+ <th scope="row">Attribute</th>
28
+ <th>Default Value</th>
29
+ <th>Usage</th>
30
+ </tr>
31
+ <tr>
32
+ <th scope="row">id=''</th>
33
+ <td>Random Number.</td>
34
+ <td>Add id if you want to use multiple carousel at same page. If you leave it blank, it will generate random number.</td>
35
+ </tr>
36
+ <tr>
37
+ <th scope="row">items=''</th>
38
+ <td>4</td>
39
+ <td>To set the maximum amount of items displayed at a time with the widest browser width (window >= 1200)</td>
40
+ </tr>
41
+ <tr>
42
+ <th scope="row">items_desktop=''</th>
43
+ <td>4</td>
44
+ <td>This allows you to preset the number of slides visible with (window >= 980) browser width.</td>
45
+ </tr>
46
+ <tr>
47
+ <th scope="row">items_desktop_small=''</th>
48
+ <td>3</td>
49
+ <td>This allows you to preset the number of slides visible with (window >= 768) browser width.</td>
50
+ </tr>
51
+ <tr>
52
+ <th scope="row">items_tablet=''</th>
53
+ <td>2</td>
54
+ <td>This allows you to preset the number of slides visible with (window >= 600) browser width.</td>
55
+ </tr>
56
+ <tr>
57
+ <th scope="row">items_mobile=''</th>
58
+ <td>1</td>
59
+ <td>This allows you to preset the number of slides visible with (window >= 320) browser width.</td>
60
+ </tr>
61
+ <tr>
62
+ <th scope="row">auto_play=''</th>
63
+ <td>true</td>
64
+ <td>Write true to enable autoplay else write false.</td>
65
+ </tr>
66
+ <tr>
67
+ <th scope="row">stop_on_hover=''</th>
68
+ <td>true</td>
69
+ <td>Write true pause autoplay on mouse hover else write false.</td>
70
+ </tr>
71
+ <tr>
72
+ <th scope="row">navigation=''</th>
73
+ <td>true</td>
74
+ <td>Write false to hide "next" and "previous" buttons.</td>
75
+ </tr>
76
+ <tr>
77
+ <th scope="row">nav_color=''</th>
78
+ <td>#d6d6d6</td>
79
+ <td>Enter hex value of color for carousel navigation.</td>
80
+ </tr>
81
+ <tr>
82
+ <th scope="row">nav_active_color=''</th>
83
+ <td>#4dc7a0</td>
84
+ <td>Enter hex value of color for carousel navigation on mouse hover.</td>
85
+ </tr>
86
+ <tr>
87
+ <th scope="row">margin_right=''</th>
88
+ <td>10</td>
89
+ <td>margin-right(px) on item. Default value is 10. Example: 20</td>
90
+ </tr>
91
+ <tr>
92
+ <th scope="row">inifnity_loop=''</th>
93
+ <td>true</td>
94
+ <td>Write true to show inifnity loop. Duplicate last and first items to get loop illusion</td>
95
+ </tr>
96
+ <tr>
97
+ <th scope="row">autoplay_timeout=''</th>
98
+ <td>5000</td>
99
+ <td>Autoplay interval timeout in millisecond. Default: 5000</td>
100
+ </tr>
101
+ <tr>
102
+ <th scope="row">autoplay_speed=''</th>
103
+ <td>500</td>
104
+ <td>Autoplay speen in millisecond. Default: 500</td>
105
+ </tr>
106
+ <tr>
107
+ <th scope="row">slide_by=''</th>
108
+ <td>1</td>
109
+ <td>Navigation slide by x number. Default value is 1.</td>
110
+ </tr>
111
+ </table>
112
+
113
+ <h2>Example 1</h2>
114
+ <pre style="overflow: auto;"><code>[carousel][item img_link='http://lorempixel.com/400/200/city/1/'][item img_link='http://lorempixel.com/400/200/city/2/'][item img_link='http://lorempixel.com/400/200/city/3/'][item img_link='http://lorempixel.com/400/200/city/4/'][item img_link='http://lorempixel.com/400/200/city/5/'][item img_link='http://lorempixel.com/400/200/city/6/'][item img_link='http://lorempixel.com/400/200/city/7/'][item img_link='http://lorempixel.com/400/200/city/8/'][item img_link='http://lorempixel.com/400/200/city/9/'][item img_link='http://lorempixel.com/400/200/city/10/'][/carousel]</code></pre>
115
+
116
+ <h2>Example 2 with attribute</h2>
117
+ <pre style="overflow: auto;"><code>[carousel id='myCustomId' items='3' items_desktop='3' margin_right='5' navigation='false'][item img_link='http://lorempixel.com/400/200/city/1/'][item img_link='http://lorempixel.com/400/200/city/2/'][item img_link='http://lorempixel.com/400/200/city/3/'][item img_link='http://lorempixel.com/400/200/city/4/'][item img_link='http://lorempixel.com/400/200/city/5/'][item img_link='http://lorempixel.com/400/200/city/6/'][item img_link='http://lorempixel.com/400/200/city/7/'][item img_link='http://lorempixel.com/400/200/city/8/'][item img_link='http://lorempixel.com/400/200/city/9/'][item img_link='http://lorempixel.com/400/200/city/10/'][/carousel]</code></pre>
118
+ </div>
admin/partials/plugin-name-admin-display.php DELETED
@@ -1,16 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Provide a dashboard view for the plugin
5
- *
6
- * This file is used to markup the public-facing aspects of the plugin.
7
- *
8
- * @link http://example.com
9
- * @since 1.0.0
10
- *
11
- * @package Plugin_Name
12
- * @subpackage Plugin_Name/admin/partials
13
- */
14
- ?>
15
-
16
- <!-- This file should primarily consist of HTML with a little bit of PHP. -->
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
carousel-slider.php CHANGED
@@ -3,10 +3,10 @@
3
  Plugin Name: Carousel Slider
4
  Plugin URI: http://wordpress.org/plugins/carousel-slider
5
  Description: Touch enabled wordpress plugin that lets you create beautiful responsive carousel slider.
6
- Version: 1.4.2
7
  Author: Sayful Islam
8
- Author URI: http://sayful.net
9
- Text Domain: carouselslider
10
  Domain Path: /languages/
11
  License: GPLv2 or later
12
  License URI: http://www.gnu.org/licenses/gpl-2.0.txt
3
  Plugin Name: Carousel Slider
4
  Plugin URI: http://wordpress.org/plugins/carousel-slider
5
  Description: Touch enabled wordpress plugin that lets you create beautiful responsive carousel slider.
6
+ Version: 1.5.0
7
  Author: Sayful Islam
8
+ Author URI: http://sayfulit.com
9
+ Text Domain: carousel-slider
10
  Domain Path: /languages/
11
  License: GPLv2 or later
12
  License URI: http://www.gnu.org/licenses/gpl-2.0.txt
includes/Carousel_Slider.php CHANGED
@@ -45,11 +45,6 @@ class Carousel_Slider {
45
  */
46
  require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/Carousel_Slider_Admin.php';
47
 
48
- /**
49
- * The class responsible for defining all actions that occur in the Dashboard.
50
- */
51
- require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/Carousel_Slider_Settings.php';
52
-
53
  /**
54
  * The class responsible for defining all actions that occur in the public-facing
55
  * side of the site.
@@ -83,14 +78,10 @@ class Carousel_Slider {
83
  $plugin_admin = new Carousel_Slider_Admin( $this->get_plugin_name(), $this->get_version() );
84
 
85
  $this->loader->add_action( 'init', $plugin_admin, 'carousel_post_type' );
86
- $this->loader->add_action( 'init', $plugin_admin, 'custom_taxonomy' );
87
- $this->loader->add_action( 'init', $plugin_admin, 'custom_image_size' );
88
- $this->loader->add_action( 'do_meta_boxes', $plugin_admin, 'carousel_image_box' );
89
  $this->loader->add_action( 'add_meta_boxes', $plugin_admin, 'add_meta_box' );
90
- $this->loader->add_action( 'save_post', $plugin_admin, 'save_meta_box' );
91
- $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'carousel_admin_color' );
92
- $this->loader->add_filter( 'mce_external_plugins', $plugin_admin, 'mce_plugin' );
93
- $this->loader->add_filter( 'mce_buttons', $plugin_admin, 'mce_button' );
94
 
95
  }
96
 
@@ -101,9 +92,7 @@ class Carousel_Slider {
101
 
102
  $plugin_public = new Carousel_Slider_Public( $this->get_plugin_name(), $this->get_version() );
103
 
104
- $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' );
105
  $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' );
106
- $this->loader->add_action( 'wp_head', $plugin_public, 'inline_styles' );
107
 
108
  }
109
 
45
  */
46
  require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/Carousel_Slider_Admin.php';
47
 
 
 
 
 
 
48
  /**
49
  * The class responsible for defining all actions that occur in the public-facing
50
  * side of the site.
78
  $plugin_admin = new Carousel_Slider_Admin( $this->get_plugin_name(), $this->get_version() );
79
 
80
  $this->loader->add_action( 'init', $plugin_admin, 'carousel_post_type' );
 
 
 
81
  $this->loader->add_action( 'add_meta_boxes', $plugin_admin, 'add_meta_box' );
82
+ $this->loader->add_action( 'admin_menu', $plugin_admin, 'admin_submenu' );
83
+ $this->loader->add_filter( 'manage_edit-carousels_columns', $plugin_admin, 'columns_head' );
84
+ $this->loader->add_filter( 'manage_carousels_posts_custom_column', $plugin_admin, 'columns_content', 10, 2 );
 
85
 
86
  }
87
 
92
 
93
  $plugin_public = new Carousel_Slider_Public( $this->get_plugin_name(), $this->get_version() );
94
 
 
95
  $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' );
 
96
 
97
  }
98
 
includes/Carousel_Slider_Activator.php CHANGED
File without changes
includes/Carousel_Slider_Deactivator.php CHANGED
File without changes
includes/Carousel_Slider_Loader.php CHANGED
File without changes
includes/Carousel_Slider_i18n.php CHANGED
File without changes
includes/index.php CHANGED
File without changes
index.php CHANGED
File without changes
languages/{carouselslider.pot → carousel-slider.pot} RENAMED
File without changes
languages/carouselslider-bn_BD.mo DELETED
Binary file
languages/carouselslider-bn_BD.po DELETED
@@ -1,314 +0,0 @@
1
- # Copyright (C) 2014
2
- # This file is distributed under the same license as the package.
3
- msgid ""
4
- msgstr ""
5
- "Project-Id-Version: Carousel Slider\n"
6
- "Report-Msgid-Bugs-To: http://wordpress.org/tag/carousel-slider\n"
7
- "POT-Creation-Date: 2014-09-07 13:41:21+00:00\n"
8
- "MIME-Version: 1.0\n"
9
- "Content-Type: text/plain; charset=UTF-8\n"
10
- "Content-Transfer-Encoding: 8bit\n"
11
- "PO-Revision-Date: 2014-09-07 23:12+0600\n"
12
- "Last-Translator: Sayful Islam <sayful.islam001@gmail.com>\n"
13
- "Language-Team: \n"
14
- "X-Generator: Poedit 1.5.4\n"
15
- "Plural-Forms: nplurals=2; plural=(n != 1);\n"
16
- "Language: Bengali\n"
17
-
18
- #: carousel-img-type.php:6
19
- msgctxt "Post Type General Name"
20
- msgid "Carousels"
21
- msgstr "ক্যরোসেল"
22
-
23
- #: carousel-img-type.php:7
24
- msgctxt "Post Type Singular Name"
25
- msgid "Carousel"
26
- msgstr "ক্যরোসেল"
27
-
28
- #: carousel-img-type.php:8
29
- msgid "Carousels"
30
- msgstr "ক্যরোসেল সমূহ"
31
-
32
- #: carousel-img-type.php:9
33
- msgid "Parent Carousel:"
34
- msgstr "মূল ক্যরোসেল"
35
-
36
- #: carousel-img-type.php:10
37
- msgid "All Carousels"
38
- msgstr "সকল ক্যরোসেল সমূহ"
39
-
40
- #: carousel-img-type.php:11
41
- msgid "View Carousel"
42
- msgstr "ক্যরোসেল প্রদর্শন"
43
-
44
- #: carousel-img-type.php:12
45
- msgid "Add New Carousel"
46
- msgstr "নতুন ক্যরোসেল যুক্ত করুন"
47
-
48
- #: carousel-img-type.php:13
49
- msgid "Add New"
50
- msgstr "নতুন যুক্ত করুন"
51
-
52
- #: carousel-img-type.php:14
53
- msgid "Edit Carousel"
54
- msgstr "ক্যরোসেল সম্পাদন করুন"
55
-
56
- #: carousel-img-type.php:15
57
- msgid "Update Carousel"
58
- msgstr "ক্যরোসেল হালনাগাদ করন"
59
-
60
- #: carousel-img-type.php:16
61
- msgid "Search Carousel"
62
- msgstr "ক্যরোসেল অনুসন্ধান করুন"
63
-
64
- #: carousel-img-type.php:17
65
- msgid "Not found"
66
- msgstr "পাওয়া যায় নি"
67
-
68
- #: carousel-img-type.php:18
69
- msgid "Not found in Trash"
70
- msgstr "ট্রস্টে পাওয়া যায় নি"
71
-
72
- #: carousel-img-type.php:27 carousel-img-type.php:28
73
- msgid "Carousel"
74
- msgstr "ক্যরোসেল"
75
-
76
- #: carousel-img-type.php:57
77
- msgid "Upload Carousel Image"
78
- msgstr "ক্যরোসেল চিত্র আপলোড করুন"
79
-
80
- #: carousel-options.php:3 carousel.php:81
81
- msgid "Carousel Settings"
82
- msgstr "ক্যরোসেল সেটিং"
83
-
84
- #: carousel-options.php:13
85
- msgid "Maximum Items"
86
- msgstr "সর্বাধিক আইটেম"
87
-
88
- #: carousel-options.php:17
89
- msgid ""
90
- "This variable allows you to set the maximum amount of items displayed at a "
91
- "time with the widest browser width &#40;window &gt;= 1200&#41;"
92
- msgstr ""
93
- "এই ভেরিয়াবল আপনাকে ব্রাউজারের প্রস্থ (উইন্ডো <= 1200) সঙ্গে একটি সময়ে প্রদর্শিত "
94
- "সর্বোচ্চ পরিমাণ আইটেম সেট করতে পারবেন।"
95
-
96
- #: carousel-options.php:22
97
- msgid "Items Desktop"
98
- msgstr "আইটেম ডেস্কটপ"
99
-
100
- #: carousel-options.php:26
101
- msgid ""
102
- "This allows you to preset the number of slides visible with &#40;window &lt;"
103
- "= 1199&#41; browser width"
104
- msgstr ""
105
- "(উইন্ডো <= ১১৯৯) ব্রাউজার প্রস্থে কতটি স্লাইড সংখ্যা প্রিসেট করতে পারবেন তা নর্দিস্ট "
106
- "করুন"
107
-
108
- #: carousel-options.php:31
109
- msgid "Items Desktop Small"
110
- msgstr "আইটেম ছোট ডেস্কটপ"
111
-
112
- #: carousel-options.php:35
113
- msgid ""
114
- "This allows you to preset the number of slides visible with &#40;window &lt;"
115
- "= 979&#41; browser width"
116
- msgstr ""
117
- "(উইন্ডো <= ৯৭৯) ব্রাউজার প্রস্থে কতটি স্লাইড সংখ্যা প্রিসেট করতে পারবেন তা নর্দিস্ট "
118
- "করুন"
119
-
120
- #: carousel-options.php:40
121
- msgid "Items Tablet"
122
- msgstr "আইটেম ট্যাবলেট"
123
-
124
- #: carousel-options.php:44
125
- msgid ""
126
- "This allows you to preset the number of slides visible with &#40;window &lt;"
127
- "= 768&#41; browser width"
128
- msgstr ""
129
- "(উইন্ডো <= ৭৬৮) ব্রাউজার প্রস্থে কতটি স্লাইড সংখ্যা প্রিসেট করতে পারবেন তা নর্দিস্ট "
130
- "করুন"
131
-
132
- #: carousel-options.php:49
133
- msgid "Items Mobile"
134
- msgstr "আইটেম মোবাইল"
135
-
136
- #: carousel-options.php:53
137
- msgid ""
138
- "This allows you to preset the number of slides visible with &#40;window &lt;"
139
- "= 479&#41; browser width"
140
- msgstr ""
141
- "(উইন্ডো <= ৪৭৯) ব্রাউজার প্রস্থে কতটি স্লাইড সংখ্যা প্রিসেট করতে পারবেন তা নর্দিস্ট "
142
- "করুন"
143
-
144
- #: carousel-options.php:58
145
- msgid "Single Item"
146
- msgstr "একক আইটেম"
147
-
148
- #: carousel-options.php:61 carousel-options.php:121 carousel-options.php:131
149
- #: carousel-options.php:159 carousel-options.php:169 carousel-options.php:188
150
- msgid "NO"
151
- msgstr "না"
152
-
153
- #: carousel-options.php:62 carousel-options.php:122 carousel-options.php:132
154
- #: carousel-options.php:160 carousel-options.php:170 carousel-options.php:189
155
- msgid "Yes"
156
- msgstr "হা"
157
-
158
- #: carousel-options.php:63
159
- msgid ""
160
- "If you select \"Yes\", it will display only one item and top five options "
161
- "will be automatically stopped."
162
- msgstr ""
163
- "আপনি \"হ্যাঁ \" নির্বাচন করুন, এটি কেবল একটি আইটেম প্রদর্শন করবে এবং শীর্ষ পাঁচটি "
164
- "বিকল্প স্বয়ংক্রিয়ভাবে বন্ধ করা হবে ।"
165
-
166
- #: carousel-options.php:68
167
- msgid "Transition Style"
168
- msgstr "স্থানান্তরণ স্টাইল"
169
-
170
- #: carousel-options.php:72
171
- msgid "fade"
172
- msgstr "বিবর্ণ"
173
-
174
- #: carousel-options.php:73
175
- msgid "backSlide"
176
- msgstr "আগেকার অবস্থান থেকে পিছিয়ে পড়া"
177
-
178
- #: carousel-options.php:74
179
- msgid "goDown"
180
- msgstr "আগেকার অবস্থান থেকে নিচে যাওয়া"
181
-
182
- #: carousel-options.php:75
183
- msgid "scaleUp"
184
- msgstr "আপ আকার পরিবর্তন"
185
-
186
- #: carousel-options.php:77
187
- msgid ""
188
- "Transition style works only in modern browsers that support CSS3 translate3d "
189
- "methods and only with single item on screen."
190
- msgstr ""
191
- "স্থানান্তরণ শৈলী শুধুমাত্র CSS 3 Translate3d পদ্ধতি সমর্থন করে আধুনিক ব্রাউজারে এবং "
192
- "শুধুমাত্র পর্দায় আইটেম সঙ্গে কাজ করে ।"
193
-
194
- #: carousel-options.php:82
195
- msgid "Slide Speed"
196
- msgstr "স্লাইড গতি"
197
-
198
- #: carousel-options.php:86
199
- msgid ""
200
- "Slide speed in milliseconds. Default speed is &lsquo;200&rsquo; milliseconds."
201
- msgstr "মিলিসেকেন্ডে ব্যক্ত গতি স্লাইড. ডিফল্ট গতি '200' মিলিসেকেন্ড হয়."
202
-
203
- #: carousel-options.php:91
204
- msgid "Pagination Speed"
205
- msgstr "পত্রাঙ্কন গতি"
206
-
207
- #: carousel-options.php:95
208
- msgid ""
209
- "Pagination speed in milliseconds. Default speed is &lsquo;800&rsquo; "
210
- "milliseconds."
211
- msgstr "মিলিসেকেন্ডে ব্যক্ত পেজিনেশন গতি. ডিফল্ট গতি '800' মিলিসেকেন্ড হয়."
212
-
213
- #: carousel-options.php:100
214
- msgid "Rewind Speed"
215
- msgstr "গুটিয়ে নেওয়ার গতি"
216
-
217
- #: carousel-options.php:104
218
- msgid ""
219
- "Rewind speed in milliseconds. Default speed is &lsquo;1000&rsquo; "
220
- "milliseconds."
221
- msgstr "মিলিসেকেন্ডে ব্যক্ত গুটিয়ে নেওয়ার গতি. ডিফল্ট গতি '1000' মিলিসেকেন্ড হয়."
222
-
223
- #: carousel-options.php:109
224
- msgid "AutoPlay"
225
- msgstr "স্বয়ংক্রিয়ভাবে চলা"
226
-
227
- #: carousel-options.php:113
228
- msgid ""
229
- "Change to any integrer for example &lsquo;autoPlay : 5000&rsquo; to play "
230
- "every 5 seconds. If you set &lsquo;autoPlay: true&rsquo; default speed will "
231
- "be 5 seconds."
232
- msgstr ""
233
- "যে কোনো পূর্ন সংখ্যায় পরিবর্তন করুন যেমন 'স্বয়ংক্রিয়ভাবে চলা: 8000' প্রতি ৮ সেকেন্ডে "
234
- "অনলাইন. আপনি 'স্বয়ংক্রিয়ভাবে চলা: true 'সেট যদি ডিফল্ট গতি 5 সেকেন্ড হতে হবে."
235
-
236
- #: carousel-options.php:118
237
- msgid "Stop On Hover"
238
- msgstr "কার্সার রাখার স্থানে থামুন"
239
-
240
- #: carousel-options.php:123
241
- msgid "Stop autoplay on mouse hover."
242
- msgstr "মাউস উপর কার্সার রেখে দেখুন অটোপ্লে বন্ধ করুন ।"
243
-
244
- #: carousel-options.php:128
245
- msgid "Navigation"
246
- msgstr "ন্যাভিগেশন"
247
-
248
- #: carousel-options.php:133
249
- msgid "Display &lsquo;next&rsquo; and &lsquo;prev&rsquo; buttons."
250
- msgstr "&lsquo;পরবর্তী&rsquo; এবং &lsquo;পূর্ববর্তী&rsquo; বাটন দেখান ।"
251
-
252
- #: carousel-options.php:138
253
- msgid "Navigation Color"
254
- msgstr "ন্যাভিগেশন রঙ"
255
-
256
- #: carousel-options.php:142
257
- msgid "Choose color for Navigation Background."
258
- msgstr "ন্যাভিগেশন পটভূমির জন্য রঙ চয়ন করুন ।"
259
-
260
- #: carousel-options.php:147
261
- msgid "Navigation Arrow Color"
262
- msgstr "ন্যাভিগেশন তীর রঙ"
263
-
264
- #: carousel-options.php:151
265
- msgid "Choose color for Navigation Arrow."
266
- msgstr "ন্যাভিগেশন তীর জন্য রঙ চয়ন করুন ।"
267
-
268
- #: carousel-options.php:156
269
- msgid "Scroll Per Page"
270
- msgstr "প্রতি পৃষ্ঠা স্ক্রোল"
271
-
272
- #: carousel-options.php:161
273
- msgid ""
274
- "Scroll per page not per item. This affect next/prev buttons and mouse/touch "
275
- "dragging."
276
- msgstr ""
277
- "প্রতি পৃষ্ঠায় স্ক্রোল করুন, আইটেম প্রতি নয় । এই পরবর্তী / পূর্ববর্তী বাটন এবং মাউস / "
278
- "স্পর্শ টেনে আনা আটকানো প্রভাবিত."
279
-
280
- #: carousel-options.php:166
281
- msgid "Pagination"
282
- msgstr "পত্রাঙ্কন"
283
-
284
- #: carousel-options.php:171
285
- msgid "Show pagination."
286
- msgstr "পত্রাঙ্কন দেখান"
287
-
288
- #: carousel-options.php:176
289
- msgid "Pagination Color"
290
- msgstr "পত্রাঙ্কন রং"
291
-
292
- #: carousel-options.php:180
293
- msgid "Choose color for Pagination Background."
294
- msgstr "পত্রাঙ্ক পটভূমির জন্য রঙ চয়ন করুন ।"
295
-
296
- #: carousel-options.php:185
297
- msgid "Pagination Numbers"
298
- msgstr "পত্রাঙ্কন সংখ্যা"
299
-
300
- #: carousel-options.php:190
301
- msgid "Show numbers inside pagination buttons"
302
- msgstr "পত্রাঙ্কন বাটনের মধ্যে সংখ্যা প্রদর্শন"
303
-
304
- #: carousel-options.php:195
305
- msgid "Pagination Number Color"
306
- msgstr "পত্রাঙ্কন সংখ্যা রং"
307
-
308
- #: carousel-options.php:199
309
- msgid "Choose color for Pagination Number."
310
- msgstr "পত্রাঙ্কন সংখ্যার জন্য রং পছন্দ করুন"
311
-
312
- #: carousel-options.php:204
313
- msgid "Save Changes"
314
- msgstr "পরিবর্তন সংরক্ষন করুন"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
public/Carousel_Slider_Public.php CHANGED
@@ -13,45 +13,13 @@ class Carousel_Slider_Public {
13
 
14
  }
15
 
16
- public function enqueue_styles() {
17
-
18
- wp_register_style( 'owl-carousel', plugin_dir_url( __FILE__ ) . 'css/owl.carousel.css', array(), '1.3.2', 'all' );
19
- wp_register_style( 'owl-theme', plugin_dir_url( __FILE__ ) . 'css/owl.theme.css', array(), '1.3.2', 'all' );
20
- wp_register_style( 'owl-transitions', plugin_dir_url( __FILE__ ) . 'css/owl.transitions.css', array(), '1.3.2', 'all' );
21
-
22
- wp_enqueue_style('owl-carousel');
23
- wp_enqueue_style('owl-theme');
24
- wp_enqueue_style('owl-transitions');
25
-
26
- }
27
-
28
  public function enqueue_scripts() {
 
 
 
 
29
 
30
- wp_register_script( 'owl-carousel', plugin_dir_url( __FILE__ ) . 'js/owl.carousel.js', array( 'jquery' ), '1.3.2', true );
31
-
32
- wp_enqueue_script('jquery');
33
- wp_enqueue_script( 'owl-carousel' );
34
-
35
- }
36
-
37
- public function inline_styles(){
38
- $this->options = get_option( 'sis_carousel_settings' );
39
- ?><style>
40
- .owl-buttons,
41
- .owl-theme .owl-controls .owl-page span.owl-numbers {
42
- color: <?php echo (isset($this->options['btn_color'])) ? $this->options['btn_color'] : '#dddddd'; ?>;
43
  }
44
- .owl-theme .owl-buttons .owl-prev,
45
- .owl-theme .owl-buttons .owl-next,
46
- .owl-theme .owl-controls .owl-page span{
47
- background: <?php echo (isset($this->options['btn_bg_color'])) ? $this->options['btn_bg_color'] : '#666666'; ?>;
48
- }
49
- .owl-theme .owl-buttons .owl-prev,
50
- .owl-theme .owl-buttons .owl-next,
51
- .owl-theme .owl-controls .owl-page span{
52
- opacity: <?php echo (isset($this->options['btn_opacity'])) ? $this->options['btn_opacity'] : '.4'; ?>;
53
- }
54
- </style><?php
55
  }
56
-
57
  }
13
 
14
  }
15
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  public function enqueue_scripts() {
17
+ global $post;
18
+ if( is_a( $post, 'WP_Post' ) && (has_shortcode( $post->post_content, 'carousel_slide') || has_shortcode( $post->post_content, 'carousel')) ) {
19
+ wp_enqueue_style( 'owl-carousel', plugin_dir_url( __FILE__ ) . 'owl-carousel/owl.carousel.css', '', '2.0.0', 'all' );
20
+ wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ). 'owl-carousel/style.css', '', $this->version, 'all' );
21
 
22
+ wp_enqueue_script( 'owl-carousel', plugin_dir_url( __FILE__ ). 'owl-carousel/owl.carousel.min.js', array( 'jquery' ), '2.0.0', false );
 
 
 
 
 
 
 
 
 
 
 
 
23
  }
 
 
 
 
 
 
 
 
 
 
 
24
  }
 
25
  }
public/css/owl.carousel.css CHANGED
File without changes
public/css/owl.theme.css CHANGED
File without changes
public/css/owl.transitions.css CHANGED
File without changes
public/img/arrows.png ADDED
Binary file
public/index.php CHANGED
File without changes
public/js/carousel-button.js DELETED
@@ -1,25 +0,0 @@
1
- (function() {
2
- tinymce.create('tinymce.plugins.sisCarousel', {
3
-
4
- init : function(ed, url) {
5
- ed.addCommand('siscarouseltriger', function() {
6
- return_text = '[carousel id=""][item href="" img_link=""][item href="" img_link=""][item href="" img_link=""][item href="" img_link=""][item href="" img_link=""][/carousel]';
7
- ed.execCommand('mceInsertContent', 0, return_text);
8
- });
9
-
10
-
11
- ed.addButton('siscarouseltriger', {
12
- title : 'Add Carousel Slider',
13
- cmd : 'siscarouseltriger',
14
- image : url + '/carousel.png'
15
- });
16
-
17
- },
18
- createControl : function(n, cm) {
19
- return null;
20
- },
21
- });
22
-
23
- // Register plugin
24
- tinymce.PluginManager.add('siscours', tinymce.plugins.sisCarousel);
25
- })();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
public/js/carousel.png DELETED
Binary file
public/js/owl.carousel.js CHANGED
File without changes
public/owl-carousel/owl.carousel.css ADDED
@@ -0,0 +1,218 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Owl Carousel - Animate Plugin
3
+ */
4
+ .owl-carousel .animated {
5
+ -webkit-animation-duration: 1000ms;
6
+ animation-duration: 1000ms;
7
+ -webkit-animation-fill-mode: both;
8
+ animation-fill-mode: both;
9
+ }
10
+ .owl-carousel .owl-animated-in {
11
+ z-index: 0;
12
+ }
13
+ .owl-carousel .owl-animated-out {
14
+ z-index: 1;
15
+ }
16
+ .owl-carousel .fadeOut {
17
+ -webkit-animation-name: fadeOut;
18
+ animation-name: fadeOut;
19
+ }
20
+
21
+ @-webkit-keyframes fadeOut {
22
+ 0% {
23
+ opacity: 1;
24
+ }
25
+
26
+ 100% {
27
+ opacity: 0;
28
+ }
29
+ }
30
+ @keyframes fadeOut {
31
+ 0% {
32
+ opacity: 1;
33
+ }
34
+
35
+ 100% {
36
+ opacity: 0;
37
+ }
38
+ }
39
+
40
+ /*
41
+ * Owl Carousel - Auto Height Plugin
42
+ */
43
+ .owl-height {
44
+ -webkit-transition: height 500ms ease-in-out;
45
+ -moz-transition: height 500ms ease-in-out;
46
+ -ms-transition: height 500ms ease-in-out;
47
+ -o-transition: height 500ms ease-in-out;
48
+ transition: height 500ms ease-in-out;
49
+ }
50
+
51
+ /*
52
+ * Core Owl Carousel CSS File
53
+ */
54
+ .owl-carousel {
55
+ display: none;
56
+ width: 100%;
57
+ -webkit-tap-highlight-color: transparent;
58
+ /* position relative and z-index fix webkit rendering fonts issue */
59
+ position: relative;
60
+ z-index: 1;
61
+ }
62
+ .owl-carousel .owl-stage {
63
+ position: relative;
64
+ -ms-touch-action: pan-Y;
65
+ }
66
+ .owl-carousel .owl-stage:after {
67
+ content: ".";
68
+ display: block;
69
+ clear: both;
70
+ visibility: hidden;
71
+ line-height: 0;
72
+ height: 0;
73
+ }
74
+ .owl-carousel .owl-stage-outer {
75
+ position: relative;
76
+ overflow: hidden;
77
+ /* fix for flashing background */
78
+ -webkit-transform: translate3d(0px, 0px, 0px);
79
+ }
80
+ .owl-carousel .owl-controls .owl-nav .owl-prev,
81
+ .owl-carousel .owl-controls .owl-nav .owl-next,
82
+ .owl-carousel .owl-controls .owl-dot {
83
+ cursor: pointer;
84
+ cursor: hand;
85
+ -webkit-user-select: none;
86
+ -khtml-user-select: none;
87
+ -moz-user-select: none;
88
+ -ms-user-select: none;
89
+ user-select: none;
90
+ }
91
+ .owl-carousel.owl-loaded {
92
+ display: block;
93
+ }
94
+ .owl-carousel.owl-loading {
95
+ opacity: 0;
96
+ display: block;
97
+ }
98
+ .owl-carousel.owl-hidden {
99
+ opacity: 0;
100
+ }
101
+ .owl-carousel .owl-refresh .owl-item {
102
+ display: none;
103
+ }
104
+ .owl-carousel .owl-item {
105
+ position: relative;
106
+ min-height: 1px;
107
+ float: left;
108
+ -webkit-backface-visibility: hidden;
109
+ -webkit-tap-highlight-color: transparent;
110
+ -webkit-touch-callout: none;
111
+ -webkit-user-select: none;
112
+ -moz-user-select: none;
113
+ -ms-user-select: none;
114
+ user-select: none;
115
+ }
116
+ .owl-carousel .owl-item img {
117
+ display: block;
118
+ width: auto;
119
+ margin-right: auto;
120
+ margin-left: auto;
121
+ -webkit-transform-style: preserve-3d;
122
+ }
123
+ .owl-carousel.owl-text-select-on .owl-item {
124
+ -webkit-user-select: auto;
125
+ -moz-user-select: auto;
126
+ -ms-user-select: auto;
127
+ user-select: auto;
128
+ }
129
+ .owl-carousel .owl-grab {
130
+ cursor: move;
131
+ cursor: -webkit-grab;
132
+ cursor: -o-grab;
133
+ cursor: -ms-grab;
134
+ cursor: grab;
135
+ }
136
+ .owl-carousel.owl-rtl {
137
+ direction: rtl;
138
+ }
139
+ .owl-carousel.owl-rtl .owl-item {
140
+ float: right;
141
+ }
142
+
143
+ /* No Js */
144
+ .no-js .owl-carousel {
145
+ display: block;
146
+ }
147
+
148
+ /*
149
+ * Owl Carousel - Lazy Load Plugin
150
+ */
151
+ .owl-carousel .owl-item .owl-lazy {
152
+ opacity: 0;
153
+ -webkit-transition: opacity 400ms ease;
154
+ -moz-transition: opacity 400ms ease;
155
+ -ms-transition: opacity 400ms ease;
156
+ -o-transition: opacity 400ms ease;
157
+ transition: opacity 400ms ease;
158
+ }
159
+ .owl-carousel .owl-item img {
160
+ transform-style: preserve-3d;
161
+ }
162
+
163
+ /*
164
+ * Owl Carousel - Video Plugin
165
+ */
166
+ .owl-carousel .owl-video-wrapper {
167
+ position: relative;
168
+ height: 100%;
169
+ background: #000;
170
+ }
171
+ .owl-carousel .owl-video-play-icon {
172
+ position: absolute;
173
+ height: 80px;
174
+ width: 80px;
175
+ left: 50%;
176
+ top: 50%;
177
+ margin-left: -40px;
178
+ margin-top: -40px;
179
+ background: url("owl.video.play.png") no-repeat;
180
+ cursor: pointer;
181
+ z-index: 1;
182
+ -webkit-backface-visibility: hidden;
183
+ -webkit-transition: scale 100ms ease;
184
+ -moz-transition: scale 100ms ease;
185
+ -ms-transition: scale 100ms ease;
186
+ -o-transition: scale 100ms ease;
187
+ transition: scale 100ms ease;
188
+ }
189
+ .owl-carousel .owl-video-play-icon:hover {
190
+ -webkit-transition: scale(1.3, 1.3);
191
+ -moz-transition: scale(1.3, 1.3);
192
+ -ms-transition: scale(1.3, 1.3);
193
+ -o-transition: scale(1.3, 1.3);
194
+ transition: scale(1.3, 1.3);
195
+ }
196
+ .owl-carousel .owl-video-playing .owl-video-tn,
197
+ .owl-carousel .owl-video-playing .owl-video-play-icon {
198
+ display: none;
199
+ }
200
+ .owl-carousel .owl-video-tn {
201
+ opacity: 0;
202
+ height: 100%;
203
+ background-position: center center;
204
+ background-repeat: no-repeat;
205
+ -webkit-background-size: contain;
206
+ -moz-background-size: contain;
207
+ -o-background-size: contain;
208
+ background-size: contain;
209
+ -webkit-transition: opacity 400ms ease;
210
+ -moz-transition: opacity 400ms ease;
211
+ -ms-transition: opacity 400ms ease;
212
+ -o-transition: opacity 400ms ease;
213
+ transition: opacity 400ms ease;
214
+ }
215
+ .owl-carousel .owl-video-frame {
216
+ position: relative;
217
+ z-index: 1;
218
+ }
public/owl-carousel/owl.carousel.min.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ !function(a,b,c,d){function e(b,c){this.settings=null,this.options=a.extend({},e.Defaults,c),this.$element=a(b),this.drag=a.extend({},m),this.state=a.extend({},n),this.e=a.extend({},o),this._plugins={},this._supress={},this._current=null,this._speed=null,this._coordinates=[],this._breakpoint=null,this._width=null,this._items=[],this._clones=[],this._mergers=[],this._invalidated={},this._pipe=[],a.each(e.Plugins,a.proxy(function(a,b){this._plugins[a[0].toLowerCase()+a.slice(1)]=new b(this)},this)),a.each(e.Pipe,a.proxy(function(b,c){this._pipe.push({filter:c.filter,run:a.proxy(c.run,this)})},this)),this.setup(),this.initialize()}function f(a){if(a.touches!==d)return{x:a.touches[0].pageX,y:a.touches[0].pageY};if(a.touches===d){if(a.pageX!==d)return{x:a.pageX,y:a.pageY};if(a.pageX===d)return{x:a.clientX,y:a.clientY}}}function g(a){var b,d,e=c.createElement("div"),f=a;for(b in f)if(d=f[b],"undefined"!=typeof e.style[d])return e=null,[d,b];return[!1]}function h(){return g(["transition","WebkitTransition","MozTransition","OTransition"])[1]}function i(){return g(["transform","WebkitTransform","MozTransform","OTransform","msTransform"])[0]}function j(){return g(["perspective","webkitPerspective","MozPerspective","OPerspective","MsPerspective"])[0]}function k(){return"ontouchstart"in b||!!navigator.msMaxTouchPoints}function l(){return b.navigator.msPointerEnabled}var m,n,o;m={start:0,startX:0,startY:0,current:0,currentX:0,currentY:0,offsetX:0,offsetY:0,distance:null,startTime:0,endTime:0,updatedX:0,targetEl:null},n={isTouch:!1,isScrolling:!1,isSwiping:!1,direction:!1,inMotion:!1},o={_onDragStart:null,_onDragMove:null,_onDragEnd:null,_transitionEnd:null,_resizer:null,_responsiveCall:null,_goToLoop:null,_checkVisibile:null},e.Defaults={items:3,loop:!1,center:!1,mouseDrag:!0,touchDrag:!0,pullDrag:!0,freeDrag:!1,margin:0,stagePadding:0,merge:!1,mergeFit:!0,autoWidth:!1,startPosition:0,rtl:!1,smartSpeed:250,fluidSpeed:!1,dragEndSpeed:!1,responsive:{},responsiveRefreshRate:200,responsiveBaseElement:b,responsiveClass:!1,fallbackEasing:"swing",info:!1,nestedItemSelector:!1,itemElement:"div",stageElement:"div",themeClass:"owl-theme",baseClass:"owl-carousel",itemClass:"owl-item",centerClass:"center",activeClass:"active"},e.Width={Default:"default",Inner:"inner",Outer:"outer"},e.Plugins={},e.Pipe=[{filter:["width","items","settings"],run:function(a){a.current=this._items&&this._items[this.relative(this._current)]}},{filter:["items","settings"],run:function(){var a=this._clones,b=this.$stage.children(".cloned");(b.length!==a.length||!this.settings.loop&&a.length>0)&&(this.$stage.children(".cloned").remove(),this._clones=[])}},{filter:["items","settings"],run:function(){var a,b,c=this._clones,d=this._items,e=this.settings.loop?c.length-Math.max(2*this.settings.items,4):0;for(a=0,b=Math.abs(e/2);b>a;a++)e>0?(this.$stage.children().eq(d.length+c.length-1).remove(),c.pop(),this.$stage.children().eq(0).remove(),c.pop()):(c.push(c.length/2),this.$stage.append(d[c[c.length-1]].clone().addClass("cloned")),c.push(d.length-1-(c.length-1)/2),this.$stage.prepend(d[c[c.length-1]].clone().addClass("cloned")))}},{filter:["width","items","settings"],run:function(){var a,b,c,d=this.settings.rtl?1:-1,e=(this.width()/this.settings.items).toFixed(3),f=0;for(this._coordinates=[],b=0,c=this._clones.length+this._items.length;c>b;b++)a=this._mergers[this.relative(b)],a=this.settings.mergeFit&&Math.min(a,this.settings.items)||a,f+=(this.settings.autoWidth?this._items[this.relative(b)].width()+this.settings.margin:e*a)*d,this._coordinates.push(f)}},{filter:["width","items","settings"],run:function(){var b,c,d=(this.width()/this.settings.items).toFixed(3),e={width:Math.abs(this._coordinates[this._coordinates.length-1])+2*this.settings.stagePadding,"padding-left":this.settings.stagePadding||"","padding-right":this.settings.stagePadding||""};if(this.$stage.css(e),e={width:this.settings.autoWidth?"auto":d-this.settings.margin},e[this.settings.rtl?"margin-left":"margin-right"]=this.settings.margin,!this.settings.autoWidth&&a.grep(this._mergers,function(a){return a>1}).length>0)for(b=0,c=this._coordinates.length;c>b;b++)e.width=Math.abs(this._coordinates[b])-Math.abs(this._coordinates[b-1]||0)-this.settings.margin,this.$stage.children().eq(b).css(e);else this.$stage.children().css(e)}},{filter:["width","items","settings"],run:function(a){a.current&&this.reset(this.$stage.children().index(a.current))}},{filter:["position"],run:function(){this.animate(this.coordinates(this._current))}},{filter:["width","position","items","settings"],run:function(){var a,b,c,d,e=this.settings.rtl?1:-1,f=2*this.settings.stagePadding,g=this.coordinates(this.current())+f,h=g+this.width()*e,i=[];for(c=0,d=this._coordinates.length;d>c;c++)a=this._coordinates[c-1]||0,b=Math.abs(this._coordinates[c])+f*e,(this.op(a,"<=",g)&&this.op(a,">",h)||this.op(b,"<",g)&&this.op(b,">",h))&&i.push(c);this.$stage.children("."+this.settings.activeClass).removeClass(this.settings.activeClass),this.$stage.children(":eq("+i.join("), :eq(")+")").addClass(this.settings.activeClass),this.settings.center&&(this.$stage.children("."+this.settings.centerClass).removeClass(this.settings.centerClass),this.$stage.children().eq(this.current()).addClass(this.settings.centerClass))}}],e.prototype.initialize=function(){if(this.trigger("initialize"),this.$element.addClass(this.settings.baseClass).addClass(this.settings.themeClass).toggleClass("owl-rtl",this.settings.rtl),this.browserSupport(),this.settings.autoWidth&&this.state.imagesLoaded!==!0){var b,c,e;if(b=this.$element.find("img"),c=this.settings.nestedItemSelector?"."+this.settings.nestedItemSelector:d,e=this.$element.children(c).width(),b.length&&0>=e)return this.preloadAutoWidthImages(b),!1}this.$element.addClass("owl-loading"),this.$stage=a("<"+this.settings.stageElement+' class="owl-stage"/>').wrap('<div class="owl-stage-outer">'),this.$element.append(this.$stage.parent()),this.replace(this.$element.children().not(this.$stage.parent())),this._width=this.$element.width(),this.refresh(),this.$element.removeClass("owl-loading").addClass("owl-loaded"),this.eventsCall(),this.internalEvents(),this.addTriggerableEvents(),this.trigger("initialized")},e.prototype.setup=function(){var b=this.viewport(),c=this.options.responsive,d=-1,e=null;c?(a.each(c,function(a){b>=a&&a>d&&(d=Number(a))}),e=a.extend({},this.options,c[d]),delete e.responsive,e.responsiveClass&&this.$element.attr("class",function(a,b){return b.replace(/\b owl-responsive-\S+/g,"")}).addClass("owl-responsive-"+d)):e=a.extend({},this.options),(null===this.settings||this._breakpoint!==d)&&(this.trigger("change",{property:{name:"settings",value:e}}),this._breakpoint=d,this.settings=e,this.invalidate("settings"),this.trigger("changed",{property:{name:"settings",value:this.settings}}))},e.prototype.optionsLogic=function(){this.$element.toggleClass("owl-center",this.settings.center),this.settings.loop&&this._items.length<this.settings.items&&(this.settings.loop=!1),this.settings.autoWidth&&(this.settings.stagePadding=!1,this.settings.merge=!1)},e.prototype.prepare=function(b){var c=this.trigger("prepare",{content:b});return c.data||(c.data=a("<"+this.settings.itemElement+"/>").addClass(this.settings.itemClass).append(b)),this.trigger("prepared",{content:c.data}),c.data},e.prototype.update=function(){for(var b=0,c=this._pipe.length,d=a.proxy(function(a){return this[a]},this._invalidated),e={};c>b;)(this._invalidated.all||a.grep(this._pipe[b].filter,d).length>0)&&this._pipe[b].run(e),b++;this._invalidated={}},e.prototype.width=function(a){switch(a=a||e.Width.Default){case e.Width.Inner:case e.Width.Outer:return this._width;default:return this._width-2*this.settings.stagePadding+this.settings.margin}},e.prototype.refresh=function(){if(0===this._items.length)return!1;(new Date).getTime();this.trigger("refresh"),this.setup(),this.optionsLogic(),this.$stage.addClass("owl-refresh"),this.update(),this.$stage.removeClass("owl-refresh"),this.state.orientation=b.orientation,this.watchVisibility(),this.trigger("refreshed")},e.prototype.eventsCall=function(){this.e._onDragStart=a.proxy(function(a){this.onDragStart(a)},this),this.e._onDragMove=a.proxy(function(a){this.onDragMove(a)},this),this.e._onDragEnd=a.proxy(function(a){this.onDragEnd(a)},this),this.e._onResize=a.proxy(function(a){this.onResize(a)},this),this.e._transitionEnd=a.proxy(function(a){this.transitionEnd(a)},this),this.e._preventClick=a.proxy(function(a){this.preventClick(a)},this)},e.prototype.onThrottledResize=function(){b.clearTimeout(this.resizeTimer),this.resizeTimer=b.setTimeout(this.e._onResize,this.settings.responsiveRefreshRate)},e.prototype.onResize=function(){return this._items.length?this._width===this.$element.width()?!1:this.trigger("resize").isDefaultPrevented()?!1:(this._width=this.$element.width(),this.invalidate("width"),this.refresh(),void this.trigger("resized")):!1},e.prototype.eventsRouter=function(a){var b=a.type;"mousedown"===b||"touchstart"===b?this.onDragStart(a):"mousemove"===b||"touchmove"===b?this.onDragMove(a):"mouseup"===b||"touchend"===b?this.onDragEnd(a):"touchcancel"===b&&this.onDragEnd(a)},e.prototype.internalEvents=function(){var c=(k(),l());this.settings.mouseDrag?(this.$stage.on("mousedown",a.proxy(function(a){this.eventsRouter(a)},this)),this.$stage.on("dragstart",function(){return!1}),this.$stage.get(0).onselectstart=function(){return!1}):this.$element.addClass("owl-text-select-on"),this.settings.touchDrag&&!c&&this.$stage.on("touchstart touchcancel",a.proxy(function(a){this.eventsRouter(a)},this)),this.transitionEndVendor&&this.on(this.$stage.get(0),this.transitionEndVendor,this.e._transitionEnd,!1),this.settings.responsive!==!1&&this.on(b,"resize",a.proxy(this.onThrottledResize,this))},e.prototype.onDragStart=function(d){var e,g,h,i;if(e=d.originalEvent||d||b.event,3===e.which||this.state.isTouch)return!1;if("mousedown"===e.type&&this.$stage.addClass("owl-grab"),this.trigger("drag"),this.drag.startTime=(new Date).getTime(),this.speed(0),this.state.isTouch=!0,this.state.isScrolling=!1,this.state.isSwiping=!1,this.drag.distance=0,g=f(e).x,h=f(e).y,this.drag.offsetX=this.$stage.position().left,this.drag.offsetY=this.$stage.position().top,this.settings.rtl&&(this.drag.offsetX=this.$stage.position().left+this.$stage.width()-this.width()+this.settings.margin),this.state.inMotion&&this.support3d)i=this.getTransformProperty(),this.drag.offsetX=i,this.animate(i),this.state.inMotion=!0;else if(this.state.inMotion&&!this.support3d)return this.state.inMotion=!1,!1;this.drag.startX=g-this.drag.offsetX,this.drag.startY=h-this.drag.offsetY,this.drag.start=g-this.drag.startX,this.drag.targetEl=e.target||e.srcElement,this.drag.updatedX=this.drag.start,("IMG"===this.drag.targetEl.tagName||"A"===this.drag.targetEl.tagName)&&(this.drag.targetEl.draggable=!1),a(c).on("mousemove.owl.dragEvents mouseup.owl.dragEvents touchmove.owl.dragEvents touchend.owl.dragEvents",a.proxy(function(a){this.eventsRouter(a)},this))},e.prototype.onDragMove=function(a){var c,e,g,h,i,j;this.state.isTouch&&(this.state.isScrolling||(c=a.originalEvent||a||b.event,e=f(c).x,g=f(c).y,this.drag.currentX=e-this.drag.startX,this.drag.currentY=g-this.drag.startY,this.drag.distance=this.drag.currentX-this.drag.offsetX,this.drag.distance<0?this.state.direction=this.settings.rtl?"right":"left":this.drag.distance>0&&(this.state.direction=this.settings.rtl?"left":"right"),this.settings.loop?this.op(this.drag.currentX,">",this.coordinates(this.minimum()))&&"right"===this.state.direction?this.drag.currentX-=(this.settings.center&&this.coordinates(0))-this.coordinates(this._items.length):this.op(this.drag.currentX,"<",this.coordinates(this.maximum()))&&"left"===this.state.direction&&(this.drag.currentX+=(this.settings.center&&this.coordinates(0))-this.coordinates(this._items.length)):(h=this.coordinates(this.settings.rtl?this.maximum():this.minimum()),i=this.coordinates(this.settings.rtl?this.minimum():this.maximum()),j=this.settings.pullDrag?this.drag.distance/5:0,this.drag.currentX=Math.max(Math.min(this.drag.currentX,h+j),i+j)),(this.drag.distance>8||this.drag.distance<-8)&&(c.preventDefault!==d?c.preventDefault():c.returnValue=!1,this.state.isSwiping=!0),this.drag.updatedX=this.drag.currentX,(this.drag.currentY>16||this.drag.currentY<-16)&&this.state.isSwiping===!1&&(this.state.isScrolling=!0,this.drag.updatedX=this.drag.start),this.animate(this.drag.updatedX)))},e.prototype.onDragEnd=function(b){var d,e,f;if(this.state.isTouch){if("mouseup"===b.type&&this.$stage.removeClass("owl-grab"),this.trigger("dragged"),this.drag.targetEl.removeAttribute("draggable"),this.state.isTouch=!1,this.state.isScrolling=!1,this.state.isSwiping=!1,0===this.drag.distance&&this.state.inMotion!==!0)return this.state.inMotion=!1,!1;this.drag.endTime=(new Date).getTime(),d=this.drag.endTime-this.drag.startTime,e=Math.abs(this.drag.distance),(e>3||d>300)&&this.removeClick(this.drag.targetEl),f=this.closest(this.drag.updatedX),this.speed(this.settings.dragEndSpeed||this.settings.smartSpeed),this.current(f),this.invalidate("position"),this.update(),this.settings.pullDrag||this.drag.updatedX!==this.coordinates(f)||this.transitionEnd(),this.drag.distance=0,a(c).off(".owl.dragEvents")}},e.prototype.removeClick=function(c){this.drag.targetEl=c,a(c).on("click.preventClick",this.e._preventClick),b.setTimeout(function(){a(c).off("click.preventClick")},300)},e.prototype.preventClick=function(b){b.preventDefault?b.preventDefault():b.returnValue=!1,b.stopPropagation&&b.stopPropagation(),a(b.target).off("click.preventClick")},e.prototype.getTransformProperty=function(){var a,c;return a=b.getComputedStyle(this.$stage.get(0),null).getPropertyValue(this.vendorName+"transform"),a=a.replace(/matrix(3d)?\(|\)/g,"").split(","),c=16===a.length,c!==!0?a[4]:a[12]},e.prototype.closest=function(b){var c=-1,d=30,e=this.width(),f=this.coordinates();return this.settings.freeDrag||a.each(f,a.proxy(function(a,g){return b>g-d&&g+d>b?c=a:this.op(b,"<",g)&&this.op(b,">",f[a+1]||g-e)&&(c="left"===this.state.direction?a+1:a),-1===c},this)),this.settings.loop||(this.op(b,">",f[this.minimum()])?c=b=this.minimum():this.op(b,"<",f[this.maximum()])&&(c=b=this.maximum())),c},e.prototype.animate=function(b){this.trigger("translate"),this.state.inMotion=this.speed()>0,this.support3d?this.$stage.css({transform:"translate3d("+b+"px,0px, 0px)",transition:this.speed()/1e3+"s"}):this.state.isTouch?this.$stage.css({left:b+"px"}):this.$stage.animate({left:b},this.speed()/1e3,this.settings.fallbackEasing,a.proxy(function(){this.state.inMotion&&this.transitionEnd()},this))},e.prototype.current=function(a){if(a===d)return this._current;if(0===this._items.length)return d;if(a=this.normalize(a),this._current!==a){var b=this.trigger("change",{property:{name:"position",value:a}});b.data!==d&&(a=this.normalize(b.data)),this._current=a,this.invalidate("position"),this.trigger("changed",{property:{name:"position",value:this._current}})}return this._current},e.prototype.invalidate=function(a){this._invalidated[a]=!0},e.prototype.reset=function(a){a=this.normalize(a),a!==d&&(this._speed=0,this._current=a,this.suppress(["translate","translated"]),this.animate(this.coordinates(a)),this.release(["translate","translated"]))},e.prototype.normalize=function(b,c){var e=c?this._items.length:this._items.length+this._clones.length;return!a.isNumeric(b)||1>e?d:b=this._clones.length?(b%e+e)%e:Math.max(this.minimum(c),Math.min(this.maximum(c),b))},e.prototype.relative=function(a){return a=this.normalize(a),a-=this._clones.length/2,this.normalize(a,!0)},e.prototype.maximum=function(a){var b,c,d,e=0,f=this.settings;if(a)return this._items.length-1;if(!f.loop&&f.center)b=this._items.length-1;else if(f.loop||f.center)if(f.loop||f.center)b=this._items.length+f.items;else{if(!f.autoWidth&&!f.merge)throw"Can not detect maximum absolute position.";for(revert=f.rtl?1:-1,c=this.$stage.width()-this.$element.width();(d=this.coordinates(e))&&!(d*revert>=c);)b=++e}else b=this._items.length-f.items;return b},e.prototype.minimum=function(a){return a?0:this._clones.length/2},e.prototype.items=function(a){return a===d?this._items.slice():(a=this.normalize(a,!0),this._items[a])},e.prototype.mergers=function(a){return a===d?this._mergers.slice():(a=this.normalize(a,!0),this._mergers[a])},e.prototype.clones=function(b){var c=this._clones.length/2,e=c+this._items.length,f=function(a){return a%2===0?e+a/2:c-(a+1)/2};return b===d?a.map(this._clones,function(a,b){return f(b)}):a.map(this._clones,function(a,c){return a===b?f(c):null})},e.prototype.speed=function(a){return a!==d&&(this._speed=a),this._speed},e.prototype.coordinates=function(b){var c=null;return b===d?a.map(this._coordinates,a.proxy(function(a,b){return this.coordinates(b)},this)):(this.settings.center?(c=this._coordinates[b],c+=(this.width()-c+(this._coordinates[b-1]||0))/2*(this.settings.rtl?-1:1)):c=this._coordinates[b-1]||0,c)},e.prototype.duration=function(a,b,c){return Math.min(Math.max(Math.abs(b-a),1),6)*Math.abs(c||this.settings.smartSpeed)},e.prototype.to=function(c,d){if(this.settings.loop){var e=c-this.relative(this.current()),f=this.current(),g=this.current(),h=this.current()+e,i=0>g-h?!0:!1,j=this._clones.length+this._items.length;h<this.settings.items&&i===!1?(f=g+this._items.length,this.reset(f)):h>=j-this.settings.items&&i===!0&&(f=g-this._items.length,this.reset(f)),b.clearTimeout(this.e._goToLoop),this.e._goToLoop=b.setTimeout(a.proxy(function(){this.speed(this.duration(this.current(),f+e,d)),this.current(f+e),this.update()},this),30)}else this.speed(this.duration(this.current(),c,d)),this.current(c),this.update()},e.prototype.next=function(a){a=a||!1,this.to(this.relative(this.current())+1,a)},e.prototype.prev=function(a){a=a||!1,this.to(this.relative(this.current())-1,a)},e.prototype.transitionEnd=function(a){return a!==d&&(a.stopPropagation(),(a.target||a.srcElement||a.originalTarget)!==this.$stage.get(0))?!1:(this.state.inMotion=!1,void this.trigger("translated"))},e.prototype.viewport=function(){var d;if(this.options.responsiveBaseElement!==b)d=a(this.options.responsiveBaseElement).width();else if(b.innerWidth)d=b.innerWidth;else{if(!c.documentElement||!c.documentElement.clientWidth)throw"Can not detect viewport width.";d=c.documentElement.clientWidth}return d},e.prototype.replace=function(b){this.$stage.empty(),this._items=[],b&&(b=b instanceof jQuery?b:a(b)),this.settings.nestedItemSelector&&(b=b.find("."+this.settings.nestedItemSelector)),b.filter(function(){return 1===this.nodeType}).each(a.proxy(function(a,b){b=this.prepare(b),this.$stage.append(b),this._items.push(b),this._mergers.push(1*b.find("[data-merge]").andSelf("[data-merge]").attr("data-merge")||1)},this)),this.reset(a.isNumeric(this.settings.startPosition)?this.settings.startPosition:0),this.invalidate("items")},e.prototype.add=function(a,b){b=b===d?this._items.length:this.normalize(b,!0),this.trigger("add",{content:a,position:b}),0===this._items.length||b===this._items.length?(this.$stage.append(a),this._items.push(a),this._mergers.push(1*a.find("[data-merge]").andSelf("[data-merge]").attr("data-merge")||1)):(this._items[b].before(a),this._items.splice(b,0,a),this._mergers.splice(b,0,1*a.find("[data-merge]").andSelf("[data-merge]").attr("data-merge")||1)),this.invalidate("items"),this.trigger("added",{content:a,position:b})},e.prototype.remove=function(a){a=this.normalize(a,!0),a!==d&&(this.trigger("remove",{content:this._items[a],position:a}),this._items[a].remove(),this._items.splice(a,1),this._mergers.splice(a,1),this.invalidate("items"),this.trigger("removed",{content:null,position:a}))},e.prototype.addTriggerableEvents=function(){var b=a.proxy(function(b,c){return a.proxy(function(a){a.relatedTarget!==this&&(this.suppress([c]),b.apply(this,[].slice.call(arguments,1)),this.release([c]))},this)},this);a.each({next:this.next,prev:this.prev,to:this.to,destroy:this.destroy,refresh:this.refresh,replace:this.replace,add:this.add,remove:this.remove},a.proxy(function(a,c){this.$element.on(a+".owl.carousel",b(c,a+".owl.carousel"))},this))},e.prototype.watchVisibility=function(){function c(a){return a.offsetWidth>0&&a.offsetHeight>0}function d(){c(this.$element.get(0))&&(this.$element.removeClass("owl-hidden"),this.refresh(),b.clearInterval(this.e._checkVisibile))}c(this.$element.get(0))||(this.$element.addClass("owl-hidden"),b.clearInterval(this.e._checkVisibile),this.e._checkVisibile=b.setInterval(a.proxy(d,this),500))},e.prototype.preloadAutoWidthImages=function(b){var c,d,e,f;c=0,d=this,b.each(function(g,h){e=a(h),f=new Image,f.onload=function(){c++,e.attr("src",f.src),e.css("opacity",1),c>=b.length&&(d.state.imagesLoaded=!0,d.initialize())},f.src=e.attr("src")||e.attr("data-src")||e.attr("data-src-retina")})},e.prototype.destroy=function(){this.$element.hasClass(this.settings.themeClass)&&this.$element.removeClass(this.settings.themeClass),this.settings.responsive!==!1&&a(b).off("resize.owl.carousel"),this.transitionEndVendor&&this.off(this.$stage.get(0),this.transitionEndVendor,this.e._transitionEnd);for(var d in this._plugins)this._plugins[d].destroy();(this.settings.mouseDrag||this.settings.touchDrag)&&(this.$stage.off("mousedown touchstart touchcancel"),a(c).off(".owl.dragEvents"),this.$stage.get(0).onselectstart=function(){},this.$stage.off("dragstart",function(){return!1})),this.$element.off(".owl"),this.$stage.children(".cloned").remove(),this.e=null,this.$element.removeData("owlCarousel"),this.$stage.children().contents().unwrap(),this.$stage.children().unwrap(),this.$stage.unwrap()},e.prototype.op=function(a,b,c){var d=this.settings.rtl;switch(b){case"<":return d?a>c:c>a;case">":return d?c>a:a>c;case">=":return d?c>=a:a>=c;case"<=":return d?a>=c:c>=a}},e.prototype.on=function(a,b,c,d){a.addEventListener?a.addEventListener(b,c,d):a.attachEvent&&a.attachEvent("on"+b,c)},e.prototype.off=function(a,b,c,d){a.removeEventListener?a.removeEventListener(b,c,d):a.detachEvent&&a.detachEvent("on"+b,c)},e.prototype.trigger=function(b,c,d){var e={item:{count:this._items.length,index:this.current()}},f=a.camelCase(a.grep(["on",b,d],function(a){return a}).join("-").toLowerCase()),g=a.Event([b,"owl",d||"carousel"].join(".").toLowerCase(),a.extend({relatedTarget:this},e,c));return this._supress[b]||(a.each(this._plugins,function(a,b){b.onTrigger&&b.onTrigger(g)}),this.$element.trigger(g),this.settings&&"function"==typeof this.settings[f]&&this.settings[f].apply(this,g)),g},e.prototype.suppress=function(b){a.each(b,a.proxy(function(a,b){this._supress[b]=!0},this))},e.prototype.release=function(b){a.each(b,a.proxy(function(a,b){delete this._supress[b]},this))},e.prototype.browserSupport=function(){if(this.support3d=j(),this.support3d){this.transformVendor=i();var a=["transitionend","webkitTransitionEnd","transitionend","oTransitionEnd"];this.transitionEndVendor=a[h()],this.vendorName=this.transformVendor.replace(/Transform/i,""),this.vendorName=""!==this.vendorName?"-"+this.vendorName.toLowerCase()+"-":""}this.state.orientation=b.orientation},a.fn.owlCarousel=function(b){return this.each(function(){a(this).data("owlCarousel")||a(this).data("owlCarousel",new e(this,b))})},a.fn.owlCarousel.Constructor=e}(window.Zepto||window.jQuery,window,document),function(a,b){var c=function(b){this._core=b,this._loaded=[],this._handlers={"initialized.owl.carousel change.owl.carousel":a.proxy(function(b){if(b.namespace&&this._core.settings&&this._core.settings.lazyLoad&&(b.property&&"position"==b.property.name||"initialized"==b.type))for(var c=this._core.settings,d=c.center&&Math.ceil(c.items/2)||c.items,e=c.center&&-1*d||0,f=(b.property&&b.property.value||this._core.current())+e,g=this._core.clones().length,h=a.proxy(function(a,b){this.load(b)},this);e++<d;)this.load(g/2+this._core.relative(f)),g&&a.each(this._core.clones(this._core.relative(f++)),h)},this)},this._core.options=a.extend({},c.Defaults,this._core.options),this._core.$element.on(this._handlers)};c.Defaults={lazyLoad:!1},c.prototype.load=function(c){var d=this._core.$stage.children().eq(c),e=d&&d.find(".owl-lazy");!e||a.inArray(d.get(0),this._loaded)>-1||(e.each(a.proxy(function(c,d){var e,f=a(d),g=b.devicePixelRatio>1&&f.attr("data-src-retina")||f.attr("data-src");this._core.trigger("load",{element:f,url:g},"lazy"),f.is("img")?f.one("load.owl.lazy",a.proxy(function(){f.css("opacity",1),this._core.trigger("loaded",{element:f,url:g},"lazy")},this)).attr("src",g):(e=new Image,e.onload=a.proxy(function(){f.css({"background-image":"url("+g+")",opacity:"1"}),this._core.trigger("loaded",{element:f,url:g},"lazy")},this),e.src=g)},this)),this._loaded.push(d.get(0)))},c.prototype.destroy=function(){var a,b;for(a in this.handlers)this._core.$element.off(a,this.handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.Lazy=c}(window.Zepto||window.jQuery,window,document),function(a){var b=function(c){this._core=c,this._handlers={"initialized.owl.carousel":a.proxy(function(){this._core.settings.autoHeight&&this.update()},this),"changed.owl.carousel":a.proxy(function(a){this._core.settings.autoHeight&&"position"==a.property.name&&this.update()},this),"loaded.owl.lazy":a.proxy(function(a){this._core.settings.autoHeight&&a.element.closest("."+this._core.settings.itemClass)===this._core.$stage.children().eq(this._core.current())&&this.update()},this)},this._core.options=a.extend({},b.Defaults,this._core.options),this._core.$element.on(this._handlers)};b.Defaults={autoHeight:!1,autoHeightClass:"owl-height"},b.prototype.update=function(){this._core.$stage.parent().height(this._core.$stage.children().eq(this._core.current()).height()).addClass(this._core.settings.autoHeightClass)},b.prototype.destroy=function(){var a,b;for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.AutoHeight=b}(window.Zepto||window.jQuery,window,document),function(a,b,c){var d=function(b){this._core=b,this._videos={},this._playing=null,this._fullscreen=!1,this._handlers={"resize.owl.carousel":a.proxy(function(a){this._core.settings.video&&!this.isInFullScreen()&&a.preventDefault()},this),"refresh.owl.carousel changed.owl.carousel":a.proxy(function(){this._playing&&this.stop()},this),"prepared.owl.carousel":a.proxy(function(b){var c=a(b.content).find(".owl-video");c.length&&(c.css("display","none"),this.fetch(c,a(b.content)))},this)},this._core.options=a.extend({},d.Defaults,this._core.options),this._core.$element.on(this._handlers),this._core.$element.on("click.owl.video",".owl-video-play-icon",a.proxy(function(a){this.play(a)},this))};d.Defaults={video:!1,videoHeight:!1,videoWidth:!1},d.prototype.fetch=function(a,b){var c=a.attr("data-vimeo-id")?"vimeo":"youtube",d=a.attr("data-vimeo-id")||a.attr("data-youtube-id"),e=a.attr("data-width")||this._core.settings.videoWidth,f=a.attr("data-height")||this._core.settings.videoHeight,g=a.attr("href");if(!g)throw new Error("Missing video URL.");if(d=g.match(/(http:|https:|)\/\/(player.|www.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com))\/(video\/|embed\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(\&\S+)?/),d[3].indexOf("youtu")>-1)c="youtube";else{if(!(d[3].indexOf("vimeo")>-1))throw new Error("Video URL not supported.");c="vimeo"}d=d[6],this._videos[g]={type:c,id:d,width:e,height:f},b.attr("data-video",g),this.thumbnail(a,this._videos[g])},d.prototype.thumbnail=function(b,c){var d,e,f,g=c.width&&c.height?'style="width:'+c.width+"px;height:"+c.height+'px;"':"",h=b.find("img"),i="src",j="",k=this._core.settings,l=function(a){e='<div class="owl-video-play-icon"></div>',d=k.lazyLoad?'<div class="owl-video-tn '+j+'" '+i+'="'+a+'"></div>':'<div class="owl-video-tn" style="opacity:1;background-image:url('+a+')"></div>',b.after(d),b.after(e)};return b.wrap('<div class="owl-video-wrapper"'+g+"></div>"),this._core.settings.lazyLoad&&(i="data-src",j="owl-lazy"),h.length?(l(h.attr(i)),h.remove(),!1):void("youtube"===c.type?(f="http://img.youtube.com/vi/"+c.id+"/hqdefault.jpg",l(f)):"vimeo"===c.type&&a.ajax({type:"GET",url:"http://vimeo.com/api/v2/video/"+c.id+".json",jsonp:"callback",dataType:"jsonp",success:function(a){f=a[0].thumbnail_large,l(f)}}))},d.prototype.stop=function(){this._core.trigger("stop",null,"video"),this._playing.find(".owl-video-frame").remove(),this._playing.removeClass("owl-video-playing"),this._playing=null},d.prototype.play=function(b){this._core.trigger("play",null,"video"),this._playing&&this.stop();var c,d,e=a(b.target||b.srcElement),f=e.closest("."+this._core.settings.itemClass),g=this._videos[f.attr("data-video")],h=g.width||"100%",i=g.height||this._core.$stage.height();"youtube"===g.type?c='<iframe width="'+h+'" height="'+i+'" src="http://www.youtube.com/embed/'+g.id+"?autoplay=1&v="+g.id+'" frameborder="0" allowfullscreen></iframe>':"vimeo"===g.type&&(c='<iframe src="http://player.vimeo.com/video/'+g.id+'?autoplay=1" width="'+h+'" height="'+i+'" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>'),f.addClass("owl-video-playing"),this._playing=f,d=a('<div style="height:'+i+"px; width:"+h+'px" class="owl-video-frame">'+c+"</div>"),e.after(d)},d.prototype.isInFullScreen=function(){var d=c.fullscreenElement||c.mozFullScreenElement||c.webkitFullscreenElement;return d&&a(d).parent().hasClass("owl-video-frame")&&(this._core.speed(0),this._fullscreen=!0),d&&this._fullscreen&&this._playing?!1:this._fullscreen?(this._fullscreen=!1,!1):this._playing&&this._core.state.orientation!==b.orientation?(this._core.state.orientation=b.orientation,!1):!0},d.prototype.destroy=function(){var a,b;this._core.$element.off("click.owl.video");for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.Video=d}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this.core=b,this.core.options=a.extend({},e.Defaults,this.core.options),this.swapping=!0,this.previous=d,this.next=d,this.handlers={"change.owl.carousel":a.proxy(function(a){"position"==a.property.name&&(this.previous=this.core.current(),this.next=a.property.value)},this),"drag.owl.carousel dragged.owl.carousel translated.owl.carousel":a.proxy(function(a){this.swapping="translated"==a.type},this),"translate.owl.carousel":a.proxy(function(){this.swapping&&(this.core.options.animateOut||this.core.options.animateIn)&&this.swap()},this)},this.core.$element.on(this.handlers)};e.Defaults={animateOut:!1,animateIn:!1},e.prototype.swap=function(){if(1===this.core.settings.items&&this.core.support3d){this.core.speed(0);var b,c=a.proxy(this.clear,this),d=this.core.$stage.children().eq(this.previous),e=this.core.$stage.children().eq(this.next),f=this.core.settings.animateIn,g=this.core.settings.animateOut;this.core.current()!==this.previous&&(g&&(b=this.core.coordinates(this.previous)-this.core.coordinates(this.next),d.css({left:b+"px"}).addClass("animated owl-animated-out").addClass(g).one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",c)),f&&e.addClass("animated owl-animated-in").addClass(f).one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",c))}},e.prototype.clear=function(b){a(b.target).css({left:""}).removeClass("animated owl-animated-out owl-animated-in").removeClass(this.core.settings.animateIn).removeClass(this.core.settings.animateOut),this.core.transitionEnd()},e.prototype.destroy=function(){var a,b;for(a in this.handlers)this.core.$element.off(a,this.handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.Animate=e}(window.Zepto||window.jQuery,window,document),function(a,b,c){var d=function(b){this.core=b,this.core.options=a.extend({},d.Defaults,this.core.options),this.handlers={"translated.owl.carousel refreshed.owl.carousel":a.proxy(function(){this.autoplay()
2
+ },this),"play.owl.autoplay":a.proxy(function(a,b,c){this.play(b,c)},this),"stop.owl.autoplay":a.proxy(function(){this.stop()},this),"mouseover.owl.autoplay":a.proxy(function(){this.core.settings.autoplayHoverPause&&this.pause()},this),"mouseleave.owl.autoplay":a.proxy(function(){this.core.settings.autoplayHoverPause&&this.autoplay()},this)},this.core.$element.on(this.handlers)};d.Defaults={autoplay:!1,autoplayTimeout:5e3,autoplayHoverPause:!1,autoplaySpeed:!1},d.prototype.autoplay=function(){this.core.settings.autoplay&&!this.core.state.videoPlay?(b.clearInterval(this.interval),this.interval=b.setInterval(a.proxy(function(){this.play()},this),this.core.settings.autoplayTimeout)):b.clearInterval(this.interval)},d.prototype.play=function(){return c.hidden===!0||this.core.state.isTouch||this.core.state.isScrolling||this.core.state.isSwiping||this.core.state.inMotion?void 0:this.core.settings.autoplay===!1?void b.clearInterval(this.interval):void this.core.next(this.core.settings.autoplaySpeed)},d.prototype.stop=function(){b.clearInterval(this.interval)},d.prototype.pause=function(){b.clearInterval(this.interval)},d.prototype.destroy=function(){var a,c;b.clearInterval(this.interval);for(a in this.handlers)this.core.$element.off(a,this.handlers[a]);for(c in Object.getOwnPropertyNames(this))"function"!=typeof this[c]&&(this[c]=null)},a.fn.owlCarousel.Constructor.Plugins.autoplay=d}(window.Zepto||window.jQuery,window,document),function(a){"use strict";var b=function(c){this._core=c,this._initialized=!1,this._pages=[],this._controls={},this._templates=[],this.$element=this._core.$element,this._overrides={next:this._core.next,prev:this._core.prev,to:this._core.to},this._handlers={"prepared.owl.carousel":a.proxy(function(b){this._core.settings.dotsData&&this._templates.push(a(b.content).find("[data-dot]").andSelf("[data-dot]").attr("data-dot"))},this),"add.owl.carousel":a.proxy(function(b){this._core.settings.dotsData&&this._templates.splice(b.position,0,a(b.content).find("[data-dot]").andSelf("[data-dot]").attr("data-dot"))},this),"remove.owl.carousel prepared.owl.carousel":a.proxy(function(a){this._core.settings.dotsData&&this._templates.splice(a.position,1)},this),"change.owl.carousel":a.proxy(function(a){if("position"==a.property.name&&!this._core.state.revert&&!this._core.settings.loop&&this._core.settings.navRewind){var b=this._core.current(),c=this._core.maximum(),d=this._core.minimum();a.data=a.property.value>c?b>=c?d:c:a.property.value<d?c:a.property.value}},this),"changed.owl.carousel":a.proxy(function(a){"position"==a.property.name&&this.draw()},this),"refreshed.owl.carousel":a.proxy(function(){this._initialized||(this.initialize(),this._initialized=!0),this._core.trigger("refresh",null,"navigation"),this.update(),this.draw(),this._core.trigger("refreshed",null,"navigation")},this)},this._core.options=a.extend({},b.Defaults,this._core.options),this.$element.on(this._handlers)};b.Defaults={nav:!1,navRewind:!0,navText:["prev","next"],navSpeed:!1,navElement:"div",navContainer:!1,navContainerClass:"owl-nav",navClass:["owl-prev","owl-next"],slideBy:1,dotClass:"owl-dot",dotsClass:"owl-dots",dots:!0,dotsEach:!1,dotData:!1,dotsSpeed:!1,dotsContainer:!1,controlsClass:"owl-controls"},b.prototype.initialize=function(){var b,c,d=this._core.settings;d.dotsData||(this._templates=[a("<div>").addClass(d.dotClass).append(a("<span>")).prop("outerHTML")]),d.navContainer&&d.dotsContainer||(this._controls.$container=a("<div>").addClass(d.controlsClass).appendTo(this.$element)),this._controls.$indicators=d.dotsContainer?a(d.dotsContainer):a("<div>").hide().addClass(d.dotsClass).appendTo(this._controls.$container),this._controls.$indicators.on("click","div",a.proxy(function(b){var c=a(b.target).parent().is(this._controls.$indicators)?a(b.target).index():a(b.target).parent().index();b.preventDefault(),this.to(c,d.dotsSpeed)},this)),b=d.navContainer?a(d.navContainer):a("<div>").addClass(d.navContainerClass).prependTo(this._controls.$container),this._controls.$next=a("<"+d.navElement+">"),this._controls.$previous=this._controls.$next.clone(),this._controls.$previous.addClass(d.navClass[0]).html(d.navText[0]).hide().prependTo(b).on("click",a.proxy(function(){this.prev(d.navSpeed)},this)),this._controls.$next.addClass(d.navClass[1]).html(d.navText[1]).hide().appendTo(b).on("click",a.proxy(function(){this.next(d.navSpeed)},this));for(c in this._overrides)this._core[c]=a.proxy(this[c],this)},b.prototype.destroy=function(){var a,b,c,d;for(a in this._handlers)this.$element.off(a,this._handlers[a]);for(b in this._controls)this._controls[b].remove();for(d in this.overides)this._core[d]=this._overrides[d];for(c in Object.getOwnPropertyNames(this))"function"!=typeof this[c]&&(this[c]=null)},b.prototype.update=function(){var a,b,c,d=this._core.settings,e=this._core.clones().length/2,f=e+this._core.items().length,g=d.center||d.autoWidth||d.dotData?1:d.dotsEach||d.items;if("page"!==d.slideBy&&(d.slideBy=Math.min(d.slideBy,d.items)),d.dots||"page"==d.slideBy)for(this._pages=[],a=e,b=0,c=0;f>a;a++)(b>=g||0===b)&&(this._pages.push({start:a-e,end:a-e+g-1}),b=0,++c),b+=this._core.mergers(this._core.relative(a))},b.prototype.draw=function(){var b,c,d="",e=this._core.settings,f=(this._core.$stage.children(),this._core.relative(this._core.current()));if(!e.nav||e.loop||e.navRewind||(this._controls.$previous.toggleClass("disabled",0>=f),this._controls.$next.toggleClass("disabled",f>=this._core.maximum())),this._controls.$previous.toggle(e.nav),this._controls.$next.toggle(e.nav),e.dots){if(b=this._pages.length-this._controls.$indicators.children().length,e.dotData&&0!==b){for(c=0;c<this._controls.$indicators.children().length;c++)d+=this._templates[this._core.relative(c)];this._controls.$indicators.html(d)}else b>0?(d=new Array(b+1).join(this._templates[0]),this._controls.$indicators.append(d)):0>b&&this._controls.$indicators.children().slice(b).remove();this._controls.$indicators.find(".active").removeClass("active"),this._controls.$indicators.children().eq(a.inArray(this.current(),this._pages)).addClass("active")}this._controls.$indicators.toggle(e.dots)},b.prototype.onTrigger=function(b){var c=this._core.settings;b.page={index:a.inArray(this.current(),this._pages),count:this._pages.length,size:c&&(c.center||c.autoWidth||c.dotData?1:c.dotsEach||c.items)}},b.prototype.current=function(){var b=this._core.relative(this._core.current());return a.grep(this._pages,function(a){return a.start<=b&&a.end>=b}).pop()},b.prototype.getPosition=function(b){var c,d,e=this._core.settings;return"page"==e.slideBy?(c=a.inArray(this.current(),this._pages),d=this._pages.length,b?++c:--c,c=this._pages[(c%d+d)%d].start):(c=this._core.relative(this._core.current()),d=this._core.items().length,b?c+=e.slideBy:c-=e.slideBy),c},b.prototype.next=function(b){a.proxy(this._overrides.to,this._core)(this.getPosition(!0),b)},b.prototype.prev=function(b){a.proxy(this._overrides.to,this._core)(this.getPosition(!1),b)},b.prototype.to=function(b,c,d){var e;d?a.proxy(this._overrides.to,this._core)(b,c):(e=this._pages.length,a.proxy(this._overrides.to,this._core)(this._pages[(b%e+e)%e].start,c))},a.fn.owlCarousel.Constructor.Plugins.Navigation=b}(window.Zepto||window.jQuery,window,document),function(a,b){"use strict";var c=function(d){this._core=d,this._hashes={},this.$element=this._core.$element,this._handlers={"initialized.owl.carousel":a.proxy(function(){"URLHash"==this._core.settings.startPosition&&a(b).trigger("hashchange.owl.navigation")},this),"prepared.owl.carousel":a.proxy(function(b){var c=a(b.content).find("[data-hash]").andSelf("[data-hash]").attr("data-hash");this._hashes[c]=b.content},this)},this._core.options=a.extend({},c.Defaults,this._core.options),this.$element.on(this._handlers),a(b).on("hashchange.owl.navigation",a.proxy(function(){var a=b.location.hash.substring(1),c=this._core.$stage.children(),d=this._hashes[a]&&c.index(this._hashes[a])||0;return a?void this._core.to(d,!1,!0):!1},this))};c.Defaults={URLhashListener:!1},c.prototype.destroy=function(){var c,d;a(b).off("hashchange.owl.navigation");for(c in this._handlers)this._core.$element.off(c,this._handlers[c]);for(d in Object.getOwnPropertyNames(this))"function"!=typeof this[d]&&(this[d]=null)},a.fn.owlCarousel.Constructor.Plugins.Hash=c}(window.Zepto||window.jQuery,window,document);
public/owl-carousel/style.css ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Green theme - Owl Carousel CSS File
3
+ */
4
+ @media (max-width: 768px) {
5
+ #spic:hover .owl-theme .owl-nav {
6
+ display: none;
7
+ }
8
+ #spic .owl-theme .owl-dots {
9
+ display: none !important;
10
+ }
11
+ }
12
+ #spic a, #spic a:hover, #spic a:active, #spic a:focus {
13
+ outline: 0 !important;
14
+ }
15
+ .lb-nav a, .lb-nav a:hover, .lb-nav a:active, .lb-nav a:focus {
16
+ outline: 0 !important;
17
+ }
18
+ #spic .owl-theme {
19
+ position: relative;
20
+ }
21
+ #spic .owl-controls {
22
+ position: static;
23
+ bottom: 0;
24
+ left: 0;
25
+ right: 0;
26
+ }
27
+ #spic .owl-theme .owl-nav {
28
+ margin-top: 10px;
29
+ text-align: center;
30
+ -webkit-tap-highlight-color: transparent;
31
+ }
32
+ #spic .owl-theme .owl-nav [class*='owl-'] {}
33
+ #spic .owl-theme .owl-nav [class*='owl-']:hover {
34
+ background-color: #4dc7a0;
35
+ color: white;
36
+ text-decoration: none;
37
+ }
38
+ #spic .owl-theme .owl-nav .disabled {
39
+ opacity: 0.5;
40
+ cursor: default;
41
+ }
42
+ #spic .owl-theme .owl-nav.disabled + .owl-dots {
43
+ margin-top: 10px;
44
+ }
45
+ #spic .owl-theme .owl-dots {
46
+ text-align: center;
47
+ -webkit-tap-highlight-color: transparent;
48
+ position: absolute;
49
+ left: 0;
50
+ right: 0;
51
+ margin-top: -35px;
52
+ }
53
+ #spic .owl-theme .owl-dots .owl-dot {
54
+ display: inline-block;
55
+ zoom: 1;
56
+ *display: inline;
57
+ }
58
+ #spic .owl-theme .owl-dots .owl-dot span {
59
+ width: 10px;
60
+ height: 10px;
61
+ margin: 5px 7px;
62
+ background-color: #d6d6d6;
63
+ display: block;
64
+ -webkit-backface-visibility: visible;
65
+ -webkit-transition: opacity 200ms ease;
66
+ -moz-transition: opacity 200ms ease;
67
+ -ms-transition: opacity 200ms ease;
68
+ -o-transition: opacity 200ms ease;
69
+ transition: opacity 200ms ease;
70
+ -webkit-border-radius: 30px;
71
+ -moz-border-radius: 30px;
72
+ border-radius: 30px;
73
+ }
74
+ #spic .owl-theme .owl-dots .owl-dot.active span,
75
+ #spic .owl-theme .owl-dots .owl-dot:hover span {
76
+ background-color: #4dc7a0;
77
+ }
78
+
79
+
80
+ #spic .owl-theme .owl-nav [class*="owl-"] {
81
+ display: inline-block;
82
+ padding: 4px 7px;
83
+ text-indent: -1e+7px;
84
+ height: 25px;
85
+ width: 25px;
86
+ border-radius: 25px;
87
+ position: absolute;
88
+ top: 50%;
89
+ transform: translateY(-50%);
90
+ opacity: 0;
91
+ margin: 0;
92
+ padding: 0;
93
+ }
94
+ #spic:hover .owl-theme .owl-nav [class*="owl-"] {
95
+ opacity: 1;
96
+ }
97
+ #spic .owl-theme .owl-nav [class*="owl-"]:first-child {
98
+ background-position: 0 45px;
99
+ background-image: url("../img/arrows.png") !important;
100
+ background-color: rgba(0,0,0,.2);
101
+ margin-right: 3px;
102
+ transition:all .3s ease-in-out;
103
+ left: -30px;
104
+ }
105
+ #spic .owl-theme .owl-nav [class*="owl-"]:last-child {
106
+ background-position: 2px 2px;
107
+ background-image: url("../img/arrows.png") !important;
108
+ background-color: rgba(0,0,0,.2);
109
+ margin-left: 3px;
110
+ transition:all .3s ease-in-out;
111
+ right: -30px;
112
+ }
113
+ #spic .owl-theme .owl-nav [class*="owl-"]:first-child:hover {
114
+ background-position: 0 24px;
115
+ background-color: #4DC7A0;
116
+ }
117
+ #spic .owl-theme .owl-nav [class*="owl-"]:last-child:hover {
118
+ background-position: 2px -20px;
119
+ background-color: #4DC7A0;
120
+ }
121
+
122
+ #spic .owl-carousel .owl-item img {
123
+ display: block;
124
+ margin-left: auto;
125
+ margin-right: auto;
126
+ max-width: 100%;
127
+ height: auto;
128
+ }
129
+
130
+ #spic .woocommerce ul.products li.product,
131
+ #spic .woocommerce-page ul.products li.product {
132
+ width: 100%;
133
+ transition:all .3s ease-in-out;
134
+ }
135
+
136
+ #spic .woocommerce ul.products li.product:hover,
137
+ #spic .woocommerce-page ul.products li.product:hover {
138
+ transform: scale(0.90) translateY(-5px);
139
+ }
140
+ #spic .woocommerce ul.products li.product .onsale {
141
+ margin: 0;
142
+ z-index: 10;
143
+ }
144
+
145
+ #spic .spic-title {
146
+ padding: 0 10px;
147
+ text-align: center;
148
+ }
149
+ #spic .spic-content {
150
+ padding: 0 10px;
151
+ text-align: left;
152
+ }
153
+ #spic .spic-more {
154
+ margin-bottom: 35px;
155
+ padding: 0 15px;
156
+ text-align: left;
157
+ }
readme.txt CHANGED
@@ -1,9 +1,10 @@
1
  === Carousel Slider ===
2
  Contributors: sayful
3
- Tags: carousel, carousel slider, image carousel, slider, responsive slider,
 
4
  Requires at least: 3.0
5
- Tested up to: 4.2
6
- Stable tag: 1.4.2
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -11,95 +12,136 @@ Touch enabled wordpress plugin that lets you create beautiful responsive carouse
11
 
12
  == Description ==
13
 
14
- Fully written in jQuery, touch enabled wordpress plugin based on [OWL Carousel](http://www.owlgraphic.com/owlcarousel/) that lets you create beautiful responsive carousel slider.
15
 
16
- = Usage - Settings, Carousels & Carousel Categories =
17
 
18
- After installing or Upgrading go to `Settings >> Carousel Slider` and change the default settings as your need.
 
 
19
 
20
- Then go to `Carousels >> Add New` and fill all fields as your need and don't forget to give Carousel Categories name if you want to add multiple carousel at your site.
 
 
 
 
 
 
21
 
22
- Now go to page or post where you want to add Carousel slider and paste the following shortcode:
 
 
 
 
 
 
 
 
23
 
24
- `[carousel_slider]`
25
 
26
- You can add multiple slider at page or post by Carousel Categories slug from ( plugin version 1.4.0 ). To do this you must create Carousel Categories when you creating New Carousel. Now you can show your Carousel by categories slug. So add the following attribute to your shortcode:
27
 
28
- `category_slug=''`
29
 
30
- Set category to a comma separated list of Carousel Categories Slug to only show those. You also need to add a mandatory attribute `id=''` if you want to add multiple carousel slider at the same page or post and need to give a number manually that is unique with other carousel slider (It won't conflict with other WordPress IDs). Example:
31
 
32
- `[carousel_slider id='1' category_slug='one']`
33
 
34
- `[carousel_slider id='2' category_slug='one,two,three,four']`
35
 
 
36
 
 
37
 
38
- = Usage - TinyMCE Button =
39
 
40
- I am sorry that TinyMCE Button is not fully functional yet but it works well.
41
 
42
- To add carousel slider at your page from TinyMCE visual editor and click on "Add Carousel Slider" button from WordPress visual editor [view screenshot](https://s.w.org/plugins/carousel-slider/screenshot-4.jpg?r=1098179) and it will output the following shortcode:
43
 
44
- `[carousel id=""]
45
- [item href="" img_link=""]
46
- [item href="" img_link=""]
47
- [item href="" img_link=""]
48
- [item href="" img_link=""]
49
- [item href="" img_link=""]
50
- [/carousel]`
51
 
52
- inside `img_link=''` put you image link and inside href="" put post, page, media or any link that you want to open on click. Repeat `[item href="" img_link=""]` as many image as you want.
53
 
54
  = Change Default Functionality =
55
 
56
- You can change default functionality by adding following optional attributes at `[carousel_slider]` and `[carousel][/carousel]` shortcode
57
-
58
-
59
- `items = '4'` : to set the maximum amount of items displayed at a time with the widest browser width (window >= 1200)
60
 
61
- `items_desktop = '4'` : This allows you to preset the number of slides visible with (window <= 1199) browser width
 
 
62
 
63
- `items_desktop_small = '3'` : This allows you to preset the number of slides visible with (window <= 979) browser width
 
 
64
 
65
- `items_tablet = '2'` : This allows you to preset the number of slides visible with (window <= 768) browser width
 
 
66
 
67
- `items_mobile = '1'` : This allows you to preset the number of slides visible with (window <= 479) browser width
 
 
68
 
69
- `single_item = 'false'` : If you set true, it will display only one item
 
 
70
 
71
- `slide_speed = '200'` : Slide speed in milliseconds
 
 
72
 
73
- `pagination_speed = '800'` : Pagination speed in milliseconds
 
 
74
 
75
- `rewind_speed = '1000'` : Rewind speed in milliseconds
 
 
76
 
77
- `auto_play = 'true'` : Change to any integrer for example auto_play : 5000 to play every 5 seconds. If you set auto_play: true default speed will be 5 seconds.
 
 
78
 
79
- `stop_on_hover = 'true'` : Stop autoplay on mouse hover
 
 
80
 
81
- `navigation = 'true'` : Display "next" and "prev" buttons.
 
 
82
 
83
- `scroll_per_page = 'false'` : Scroll per page not per item. This affect next/prev buttons and mouse/touch dragging.
 
 
84
 
85
- `pagination = 'false'` : Show or hide pagination.
 
 
86
 
87
- `pagination_numbers = 'false'` : Show or hide numbers inside pagination buttons
 
 
88
 
89
- `auto_height = 'false'` : Add height to owl-wrapper-outer so you can use diffrent heights on slides. Use it only for one item per page setting.
 
 
90
 
91
- Example 1(Settings, Carousels & Carousel Categories):
 
 
92
 
93
- `[carousel_slider id='1' category_slug='portfolio,two' items = '3' navigation = 'false']`
94
 
95
- Example 2:
96
 
97
- `[carousel id='' items = '3' navigation = 'false' slide_speed = '400']
98
- [item href='' img_link='']
99
- [item href='' img_link='']
100
- [/carousel]`
101
 
 
102
 
 
 
 
103
 
104
  == Installation ==
105
 
@@ -130,18 +172,25 @@ Do you have questions or issues with Carousel Slider? [Ask for support here](htt
130
 
131
  == Screenshots ==
132
 
133
- 1. Screenshot of Carousel Slider Settings page
134
- 2. Screenshot of Carousel Custom Post Type (Add New Carousel)
135
- 3. Screenshot of Carousel Custom Post Type Categories
136
- 4. Screenshot of Carousel shortcode button.
137
- 5. Screenshot of Carousel Front-end Example.
138
 
139
  == Changelog ==
140
 
 
 
 
 
 
 
 
141
  = version 1.4.2 =
 
142
  * Bug fixed release
143
 
144
  = version 1.4.1 =
 
145
  * Bug fixed release
146
 
147
  = version 1.4.0 =
@@ -152,7 +201,6 @@ Do you have questions or issues with Carousel Slider? [Ask for support here](htt
152
  * Added feature to add multiple slider at page, post or theme by custom post category slug
153
  * Re-write with Object-oriented programming (OOP)
154
 
155
-
156
  = version 1.3 =
157
 
158
  * Tested with WordPress version 4.1
@@ -169,21 +217,20 @@ Do you have questions or issues with Carousel Slider? [Ask for support here](htt
169
 
170
  = version 1.0 =
171
 
172
- * Implementation of basic functionality.
173
 
174
  == Upgrade Notice ==
175
- Upgrade the plugin to get more features and better performance.
176
-
177
- == CREDIT ==
178
 
179
- 1.This plugin was developed by [Sayful Islam](http://sayful.net)
180
- 1.Some open source framework have been used. For detail [click here](http://owlgraphic.com/owlcarousel/)
181
 
182
- == CONTACT ==
 
183
 
184
- [Sayful Islam](http://sayful1.wordpress.com/100-2/)
185
 
 
186
 
187
- == Upgrade Notice ==
188
 
189
- 1.4.0 is a major update. Some previous settings and shortcode will not work in this version. Check detail description befor upgrading to new version.
1
  === Carousel Slider ===
2
  Contributors: sayful
3
+ Tags: carousel, carousel slider, image carousel, slider, responsive slider
4
+ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=LKV6BEG3BA4KQ
5
  Requires at least: 3.0
6
+ Tested up to: 4.4
7
+ Stable tag: 1.5.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
12
 
13
  == Description ==
14
 
 
15
 
16
+ Fully written in jQuery, touch enabled wordpress plugin based on [OWL Carousel](http://www.owlgraphic.com/owlcarousel/) that lets you create beautiful responsive carousel slider.
17
 
18
+ = Depreciated shortcode at version 1.5.0 =
19
+ `carousel_slider`
20
+ `all-carousels`
21
 
22
+ = Depreciated shortcode attribute from "carousel" shortcode at version 1.5.0 =
23
+ `pagination_speed
24
+ rewind_speed
25
+ scroll_per_page
26
+ pagination_numbers
27
+ auto_height
28
+ single_item`
29
 
30
+ = Introduce new shortcode attribute in "carousel" shortcode at version 1.5.0 =
31
+ `margin_right
32
+ inifnity_loop
33
+ autoplay_timeout
34
+ autoplay_speed
35
+ slide_by
36
+ nav_color
37
+ nav_active_color
38
+ `
39
 
40
+ = Usage 1st method =
41
 
42
+ Then go to `Carousels >> Add New` and fill all fields as your need and then click on "Publish" button. Now copy the generated shortcode and paste on post or page where you want to show carousel slider. See video instruction:
43
 
44
+ https://www.youtube.com/watch?v=O4-EM32h7b4&feature=youtu.be
45
 
46
+ = Usage - 2nd method =
47
 
48
+ Without using custom post (Carousels admin menu), you can use custom shortcode to link image and generate carousel slider.
49
 
50
+ To gererate carousel slider using shortcode, at first write wrapper shortcode as following:
51
 
52
+ `[carousel][/carousel]`
53
 
54
+ Now write the following shortcode inside the wrapper shortcode as many image as you want.
55
 
56
+ `[item img_link=""]`
57
 
58
+ You can add following attribute if you want to link image to custom post, page, image or anything that you want to open on click. Like as following
59
 
60
+ `[item img_link="IMAGE_URL_GOES_HERE" href="CUSTOM_URL_GOES_HERE"]`
61
 
62
+ The whole shortcode look likes as following: (See example shortcode.)
 
 
 
 
 
 
63
 
64
+ `[carousel][item img_link="IMAGE_URL_GOES_HERE"][item img_link="IMAGE_URL_GOES_HERE" href="CUSTOM_URL_GOES_HERE"][item img_link="IMAGE_URL_GOES_HERE"][/carousel]`
65
 
66
  = Change Default Functionality =
67
 
68
+ You can change default functionality by adding following optional attributes at `[carousel][/carousel]` shortcode
 
 
 
69
 
70
+ `id=''`
71
+ Default: Random number
72
+ Add id if you want to use multiple carousel at same page. If you leave it blank, it will generate random number.
73
 
74
+ `items=''`
75
+ Default: 4
76
+ To set the maximum amount of items displayed at a time with the widest browser width (window >= 1200)
77
 
78
+ `items_desktop=''`
79
+ Default: 4
80
+ This allows you to preset the number of slides visible with (window >= 980) browser width.
81
 
82
+ `items_desktop_small=''`
83
+ Default: 3
84
+ This allows you to preset the number of slides visible with (window >= 768) browser width.
85
 
86
+ `items_tablet=''`
87
+ Default: 2
88
+ This allows you to preset the number of slides visible with (window >= 600) browser width.
89
 
90
+ `items_mobile=''`
91
+ Default: 1
92
+ This allows you to preset the number of slides visible with (window >= 320) browser width.
93
 
94
+ `auto_play=''`
95
+ Default: true
96
+ Write true to enable autoplay else write false.
97
 
98
+ `stop_on_hover=''`
99
+ Default: true
100
+ Write true pause autoplay on mouse hover else write false.
101
 
102
+ `navigation=''`
103
+ Default: true
104
+ Write false to hide "next" and "previous" buttons.
105
 
106
+ `nav_color=''`
107
+ Default: #d6d6d6
108
+ Enter hex value of color for carousel navigation.
109
 
110
+ `nav_active_color=''`
111
+ Default: #4dc7a0
112
+ Enter hex value of color for carousel navigation on mouse hover.
113
 
114
+ `margin_right=''`
115
+ Default: 10
116
+ margin-right(px) on item. Default value is 10. Example: 20
117
 
118
+ `inifnity_loop=''`
119
+ Default: true
120
+ Write true to show inifnity loop. Duplicate last and first items to get loop illusion
121
 
122
+ `autoplay_timeout=''`
123
+ Default: 5000
124
+ Autoplay interval timeout in millisecond.
125
 
126
+ `autoplay_speed=''`
127
+ Default: 500
128
+ Autoplay speen in millisecond.
129
 
130
+ `slide_by=''`
131
+ Default: 1
132
+ Navigation slide by x number. Default value is 1.
133
 
134
+ Example 1 (no attribute):
135
 
136
+ `[carousel][item img_link='http://lorempixel.com/400/200/city/1/'][item img_link='http://lorempixel.com/400/200/city/2/'][item img_link='http://lorempixel.com/400/200/city/3/'][item img_link='http://lorempixel.com/400/200/city/4/'][item img_link='http://lorempixel.com/400/200/city/5/'][item img_link='http://lorempixel.com/400/200/city/6/'][item img_link='http://lorempixel.com/400/200/city/7/'][item img_link='http://lorempixel.com/400/200/city/8/'][item img_link='http://lorempixel.com/400/200/city/9/'][item img_link='http://lorempixel.com/400/200/city/10/'][/carousel]`
137
 
138
+ Example 2 (with attribute):
 
 
 
139
 
140
+ `[carousel id='myCustomId' items='3' items_desktop='3' margin_right='5' navigation='false'][item img_link='http://lorempixel.com/400/200/city/1/'][item img_link='http://lorempixel.com/400/200/city/2/'][item img_link='http://lorempixel.com/400/200/city/3/'][item img_link='http://lorempixel.com/400/200/city/4/'][item img_link='http://lorempixel.com/400/200/city/5/'][item img_link='http://lorempixel.com/400/200/city/6/'][item img_link='http://lorempixel.com/400/200/city/7/'][item img_link='http://lorempixel.com/400/200/city/8/'][item img_link='http://lorempixel.com/400/200/city/9/'][item img_link='http://lorempixel.com/400/200/city/10/'][/carousel]`
141
 
142
+ `
143
+ If you like the plugin or earning using this plugin, make a small <a href="http://www.sayfulit.com/donate/">donation</a>.
144
+ `
145
 
146
  == Installation ==
147
 
172
 
173
  == Screenshots ==
174
 
175
+ 1. Screenshot of Carousel Custom Post Type (Add New Carousel)
176
+ 2. Screenshot of Carousel All Carousel
177
+ 3. Screenshot of Carousel Front-end Example.
 
 
178
 
179
  == Changelog ==
180
 
181
+ = version 1.5.0 =
182
+
183
+ * Added graphical interface to add carousel
184
+ * Added shortcode attributes 'inifnity_loop', 'autoplay_timeout', 'autoplay_speed', 'slide_by', 'nav_color', 'nav_active_color', 'margin_right'
185
+ * Removed shortcode 'carousel_slider' and 'all-carousels'
186
+ * Removed shortcode attributes 'pagination_speed', 'rewind_speed', 'scroll_per_page', 'pagination_numbers', 'auto_height', 'single_item'
187
+
188
  = version 1.4.2 =
189
+
190
  * Bug fixed release
191
 
192
  = version 1.4.1 =
193
+
194
  * Bug fixed release
195
 
196
  = version 1.4.0 =
201
  * Added feature to add multiple slider at page, post or theme by custom post category slug
202
  * Re-write with Object-oriented programming (OOP)
203
 
 
204
  = version 1.3 =
205
 
206
  * Tested with WordPress version 4.1
217
 
218
  = version 1.0 =
219
 
220
+ * Initial release.
221
 
222
  == Upgrade Notice ==
 
 
 
223
 
224
+ = 1.5.0 =
225
+ 1.5.0 is a major update. `carousel_slider` and `all-carousels` have been depreciated in this version. Check detail description befor upgrading to new version.
226
 
227
+ = 1.4.0 =
228
+ 1.4.0 is a major update. Some previous settings and shortcode will not work in this version. Check detail description befor upgrading to new version.
229
 
230
+ == CREDIT ==
231
 
232
+ Some open source framework have been used. For detail [click here](http://owlgraphic.com/owlcarousel/)
233
 
234
+ == CONTACT ==
235
 
236
+ [Sayful Islam](http://sayfulit.com/)
screenshot-1.jpg DELETED
Binary file
screenshot-1.png ADDED
Binary file
screenshot-2.jpg DELETED
Binary file
screenshot-2.png ADDED
Binary file
screenshot-3.jpg DELETED
Binary file
screenshot-3.png ADDED
Binary file
screenshot-4.jpg DELETED
Binary file
screenshot-5.jpg DELETED
Binary file
shortcodes/shortcodes.php CHANGED
@@ -1,211 +1,188 @@
1
  <?php
2
 
3
- /*Shortcode for carousel by custom button*/
4
- function carousel_slider_shortcode($atts, $content=null){
5
-
6
- extract(shortcode_atts(array(
7
- 'id' =>'',
8
- 'category_slug' =>'',
9
- 'items' =>'4',
10
- 'items_desktop' =>'4',
11
- 'items_desktop_small' =>'3',
12
- 'items_tablet' =>'2',
13
- 'items_mobile' =>'1',
14
- 'single_item' =>'false',
15
- 'slide_speed' =>'200',
16
- 'pagination_speed' =>'800',
17
- 'rewind_speed' =>'1000',
18
- 'auto_play' =>'true',
19
- 'stop_on_hover' =>'true',
20
- 'navigation' =>'true',
21
- 'scroll_per_page' =>'false',
22
- 'pagination' =>'false',
23
- 'pagination_numbers' =>'false',
24
- 'auto_height' =>'false',
25
- ), $atts));
26
-
27
- if (trim($category_slug) !='') {
28
-
29
- $termname = $category_slug;
30
-
31
- } else {
32
- function all_terms(){
33
- // It is blank
34
- }
35
- $termname = all_terms();
36
- }
37
-
38
- global $post;
39
-
40
- $options = get_option('sis_carousel_settings');
41
-
42
- ob_start();
43
- ?>
44
- <div id="" class="row">
45
- <div id="carousel_slider<?php echo $id; ?>" class="owl-carousel">
46
-
47
- <?php
48
- query_posts("post_type=carousel&posts_per_page=-1&carousel_category=$termname");
49
- if (have_posts()) : while (have_posts()) : the_post();
50
-
51
- $image_size = (isset($options['image_size'])) ? $options['image_size'] : 'full';
52
-
53
- $img= get_the_post_thumbnail( $post->ID, $image_size );
54
-
55
-
56
- $carousel_link = get_post_meta( $post->ID, '_carousel_slider_slide_link_value', true );
57
-
58
-
59
- if (trim($carousel_link) != '') {
60
-
61
- $carousel_link = $carousel_link;
62
-
63
- } else {
64
-
65
- $carousel_link = '#';
66
- }
67
-
68
- $link_target = get_post_meta( $post->ID, '_carousel_slider_slide_link_target_value', true );
69
- ?>
70
-
71
- <div class="carousel_img">
72
- <a target="<?php echo $link_target; ?>" href="<?php echo $carousel_link; ?>">
73
- <?php echo $img; ?>
74
- </a>
75
- </div>
76
-
77
- <?php endwhile; endif; wp_reset_query(); ?>
78
-
79
- </div>
80
- </div>
81
- <script type="text/javascript">
82
- jQuery(document).ready(function($) {
83
- $("#carousel_slider<?php echo $id; ?>").owlCarousel({
84
- // Most important owl features
85
- items : <?php echo $items; ?>,
86
- itemsDesktop : [1199,<?php echo $items_desktop; ?>],
87
- itemsDesktopSmall : [980,<?php echo $items_desktop_small; ?>],
88
- itemsTablet: [768,<?php echo $items_tablet; ?>],
89
- itemsMobile : [479,<?php echo $items_mobile; ?>],
90
- singleItem : <?php echo $single_item; ?>,
91
-
92
- //Basic Speeds
93
- slideSpeed : <?php echo $slide_speed; ?>,
94
- paginationSpeed : <?php echo $pagination_speed; ?>,
95
- rewindSpeed : <?php echo $rewind_speed; ?>,
96
-
97
- //Autoplay
98
- autoPlay : <?php echo $auto_play; ?>,
99
- stopOnHover : <?php echo $stop_on_hover; ?>,
100
-
101
- // Navigation
102
- navigation : <?php echo $navigation; ?>,
103
- navigationText : ["&lt;","&gt;"],
104
- rewindNav : true,
105
- scrollPerPage : <?php echo $scroll_per_page; ?>,
106
-
107
- //Pagination
108
- pagination : <?php echo $pagination; ?>,
109
- paginationNumbers: <?php echo $pagination_numbers; ?>,
110
-
111
- //Auto height
112
- autoHeight : <?php echo $auto_height; ?>,
113
-
114
- });
115
- $(".owl-pagination").css("left", function(){
116
- return ($(".owl-carousel.owl-theme").width() - $(this).width()) / 2;
117
- });
118
- })
119
- </script>
120
- <?php
121
- return ob_get_clean();
122
- }
123
-
124
  function carousel_slider_wrapper_shortcode($atts, $content=null){
125
 
126
  extract(shortcode_atts(array(
127
- 'id' =>'',
128
- 'items' =>'4',
129
- 'items_desktop' =>'4',
130
- 'items_desktop_small' =>'3',
131
- 'items_tablet' =>'2',
132
- 'items_mobile' =>'1',
133
- 'single_item' =>'false',
134
- 'slide_speed' =>'200',
135
- 'pagination_speed' =>'800',
136
- 'rewind_speed' =>'1000',
137
- 'auto_play' =>'true',
138
- 'stop_on_hover' =>'true',
139
- 'navigation' =>'true',
140
- 'scroll_per_page' =>'false',
141
- 'pagination' =>'false',
142
- 'pagination_numbers' =>'false',
143
- 'auto_height' =>'false',
144
  ), $atts));
145
 
146
- global $post;
147
- ob_start();
148
- ?>
149
- <div id="" class="row">
150
- <div id="carousel_slider<?php echo $id; ?>" class="owl-carousel">
151
- <?php echo do_shortcode($content); ?>
152
- </div>
153
- </div>
154
- <script type="text/javascript">
155
- jQuery(document).ready(function($) {
156
- $("#carousel_slider<?php echo $id; ?>").owlCarousel({
157
- // Most important owl features
158
- items : <?php echo $items; ?>,
159
- itemsDesktop : [1199,<?php echo $items_desktop; ?>],
160
- itemsDesktopSmall : [980,<?php echo $items_desktop_small; ?>],
161
- itemsTablet: [768,<?php echo $items_tablet; ?>],
162
- itemsMobile : [479,<?php echo $items_mobile; ?>],
163
- singleItem : <?php echo $single_item; ?>,
164
-
165
- //Basic Speeds
166
- slideSpeed : <?php echo $slide_speed; ?>,
167
- paginationSpeed : <?php echo $pagination_speed; ?>,
168
- rewindSpeed : <?php echo $rewind_speed; ?>,
169
-
170
- //Autoplay
171
- autoPlay : <?php echo $auto_play; ?>,
172
- stopOnHover : <?php echo $stop_on_hover; ?>,
173
-
174
- // Navigation
175
- navigation : <?php echo $navigation; ?>,
176
- navigationText : ["&lt;","&gt;"],
177
- rewindNav : true,
178
- scrollPerPage : <?php echo $scroll_per_page; ?>,
179
-
180
- //Pagination
181
- pagination : <?php echo $pagination; ?>,
182
- paginationNumbers: <?php echo $pagination_numbers; ?>,
183
-
184
- //Auto height
185
- autoHeight : <?php echo $auto_height; ?>,
186
-
187
- });
188
- $(".owl-pagination").css("left", function(){
189
- return ($(".owl-carousel.owl-theme").width() - $(this).width()) / 2;
190
  });
191
- })
192
- </script>
193
- <?php
194
- return ob_get_clean();
195
  }
 
196
 
197
  function sis_carousel_shortcode( $atts, $content = null ) {
198
- extract(shortcode_atts(array(
199
- 'img_link' =>'',
200
- 'href' =>'#',
201
- 'target' =>'_self',
202
- ), $atts));
203
 
 
204
  return '<div class=""><a target="'.$target.'" href="'.$href.'"><img src="'.$img_link.'"></a></div>';
 
 
 
205
  }
206
-
207
- add_shortcode('carousel_slider', 'carousel_slider_shortcode');
208
- add_shortcode('all-carousels', 'carousel_slider_shortcode');
209
- add_shortcode( 'carousel', 'carousel_slider_wrapper_shortcode' );
210
  add_shortcode( 'item', 'sis_carousel_shortcode' );
 
211
  add_filter('widget_text', 'do_shortcode');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  <?php
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  function carousel_slider_wrapper_shortcode($atts, $content=null){
4
 
5
  extract(shortcode_atts(array(
6
+ 'id' => rand(1, 10),
7
+ 'items' => '4',
8
+ 'items_desktop' => '4',
9
+ 'items_desktop_small' => '3',
10
+ 'items_tablet' => '2',
11
+ 'items_mobile' => '1',
12
+ 'auto_play' => 'true',
13
+ 'stop_on_hover' => 'true',
14
+ 'navigation' => 'true',
15
+ 'pagination' => 'false',
16
+ 'nav_color' => '#d6d6d6',
17
+ 'nav_active_color' => '#4dc7a0',
18
+ 'margin_right' => '10',
19
+ 'inifnity_loop' => 'true',
20
+ 'autoplay_timeout' => '5000',
21
+ 'autoplay_speed' => '500',
22
+ 'slide_by' => '1',
23
  ), $atts));
24
 
25
+ $html = '';
26
+ $html .= '<div id="spic" class="row">';
27
+ $html .= '<div id="spic-'.$id.'" class="owl-carousel">';
28
+ $html .= do_shortcode($content);
29
+ $html .= '</div>';
30
+ $html .= '<style type="text/css">
31
+ #spic-'.$id.'.owl-theme .owl-dots .owl-dot span,
32
+ #spic-'.$id.'.owl-theme .owl-nav [class*="owl-"]:first-child,
33
+ #spic-'.$id.'.owl-theme .owl-nav [class*="owl-"]:last-child {
34
+ background-color: '.$nav_color.';
35
+ }
36
+ #spic-'.$id.'.owl-theme .owl-dots .owl-dot.active span,
37
+ #spic-'.$id.'.owl-theme .owl-dots .owl-dot:hover span,
38
+ #spic-'.$id.'.owl-theme .owl-nav [class*="owl-"]:first-child:hover,
39
+ #spic-'.$id.'.owl-theme .owl-nav [class*="owl-"]:last-child:hover {
40
+ background-color: '.$nav_active_color.';
41
+ }
42
+ </style>';
43
+
44
+ $html .='<script type="text/javascript">
45
+ jQuery(document).ready(function($) {
46
+ $(\'#spic-'.$id.'\').owlCarousel({
47
+ nav : '.$navigation.',
48
+ dots: '.$pagination.',
49
+ margin:'.$margin_right.',
50
+ loop :'.$inifnity_loop.',
51
+ autoplay: '.$auto_play.',
52
+ autoplayTimeout: '.$autoplay_timeout.',
53
+ autoplaySpeed: '.$autoplay_speed.',
54
+ autoplayHoverPause: '.$stop_on_hover.',
55
+ slideBy: '.$slide_by.',
56
+ responsiveClass:true,
57
+ responsive:{
58
+ 320:{ items:'.$items_mobile.' },
59
+ 600:{ items:'.$items_tablet.' },
60
+ 768:{ items:'.$items_desktop_small.' },
61
+ 980:{ items:'.$items_desktop.' },
62
+ 1200:{ items:'.$items.' }
63
+ }
64
+ });
 
 
 
 
65
  });
66
+ </script>';
67
+ $html .='</div>';
68
+ return $html;
 
69
  }
70
+ add_shortcode( 'carousel', 'carousel_slider_wrapper_shortcode' );
71
 
72
  function sis_carousel_shortcode( $atts, $content = null ) {
73
+ extract(shortcode_atts(array(
74
+ 'img_link' =>'',
75
+ 'href' =>'',
76
+ 'target' =>'_self',
77
+ ), $atts));
78
 
79
+ if ($href != '') {
80
  return '<div class=""><a target="'.$target.'" href="'.$href.'"><img src="'.$img_link.'"></a></div>';
81
+ } else {
82
+ return '<div class=""><img src="'.$img_link.'"></div>';
83
+ }
84
  }
 
 
 
 
85
  add_shortcode( 'item', 'sis_carousel_shortcode' );
86
+
87
  add_filter('widget_text', 'do_shortcode');
88
+
89
+ function carousel_slide_shortcode($atts, $content = null)
90
+ {
91
+ extract(shortcode_atts(array(
92
+ 'id' =>'',
93
+ ), $atts));
94
+
95
+ $attachment_ids = get_post_meta( $id, '_wpdh_image_ids', true );
96
+ // convert string into array
97
+ $attachment_ids = explode( ',', $attachment_ids );
98
+ // clean the array (remove empty values)
99
+ $attachment_ids = array_filter( $attachment_ids );
100
+
101
+ if ( $attachment_ids ) {
102
+ $_items_small_desktop = get_post_meta( $id, '_items_small_desktop', true );
103
+ $_items_portrait_tablet = get_post_meta( $id, '_items_portrait_tablet', true );
104
+ $_items_small_portrait_tablet = get_post_meta( $id, '_items_small_portrait_tablet', true );
105
+ $_items_portrait_mobile = get_post_meta( $id, '_items_portrait_mobile', true );
106
+ $_items = get_post_meta( $id, '_items', true );
107
+ $_image_size = get_post_meta( $id, '_image_size', true );
108
+ $_slide_by = get_post_meta( $id, '_slide_by', true );
109
+ $_margin_right = get_post_meta( $id, '_margin_right', true );
110
+ $_nav_button = get_post_meta( $id, '_nav_button', true );
111
+ $_nav_button = ($_nav_button == 'on') ? 'true' : 'false';
112
+ $_dot_nav = get_post_meta( $id, '_dot_nav', true );
113
+ $_dot_nav = ($_dot_nav == 'on') ? 'true' : 'false';
114
+ $_inifnity_loop = get_post_meta( $id, '_inifnity_loop', true );
115
+ $_inifnity_loop = ($_inifnity_loop == 'on') ? 'true' : 'false';
116
+ $_autoplay = get_post_meta( $id, '_autoplay', true );
117
+ $_autoplay = ($_autoplay == 'on') ? 'true' : 'false';
118
+ $_autoplay_timeout = get_post_meta( $id, '_autoplay_timeout', true );
119
+ $_autoplay_speed = get_post_meta( $id, '_autoplay_speed', true );
120
+ $_autoplay_pause = get_post_meta( $id, '_autoplay_pause', true );
121
+ $_autoplay_pause = ($_autoplay_pause == 'on') ? 'true' : 'false';
122
+ $_nav_color = get_post_meta( $id, '_nav_color', true );
123
+ $_nav_active_color = get_post_meta( $id, '_nav_active_color', true );
124
+
125
+ $html = '';
126
+ $html .= '<div id="spic" class="row">';
127
+ $html .='<div id="spic-'.$id.'" class="owl-carousel">';
128
+
129
+ foreach ( $attachment_ids as $attachment_id ) {
130
+
131
+ $image = wp_get_attachment_image( $attachment_id, $_image_size, 0, array( 'alt' => trim( strip_tags( get_post_meta( $attachment_id, '_wp_attachment_image_alt', true ) ) ) ) );
132
+
133
+ $image_url = wp_get_attachment_image_src( $attachment_id, 'full' );
134
+ $image_title = get_post( $attachment_id )->post_title ? get_post( $attachment_id )->post_title : '';
135
+ $image_caption = get_post( $attachment_id )->post_excerpt ? get_post( $attachment_id )->post_excerpt : '';
136
+ $image_description = get_post( $attachment_id )->post_content ? get_post( $attachment_id )->post_content : '';
137
+
138
+
139
+ if (!filter_var($image_description, FILTER_VALIDATE_URL) === false) {
140
+ $html .='<div><a href="'.$image_description.'">'.$image.'</a></div>';
141
+ } else {
142
+ $html .='<div>'.$image.'</div>';
143
+ }
144
+ }
145
+ $html .= '</div>';
146
+ $html .= '<style type="text/css">
147
+ #spic-'.$id.'.owl-theme .owl-dots .owl-dot span,
148
+ #spic-'.$id.'.owl-theme .owl-nav [class*="owl-"]:first-child,
149
+ #spic-'.$id.'.owl-theme .owl-nav [class*="owl-"]:last-child {
150
+ background-color: '.$_nav_color.';
151
+ }
152
+ #spic-'.$id.'.owl-theme .owl-dots .owl-dot.active span,
153
+ #spic-'.$id.'.owl-theme .owl-dots .owl-dot:hover span,
154
+ #spic-'.$id.'.owl-theme .owl-nav [class*="owl-"]:first-child:hover,
155
+ #spic-'.$id.'.owl-theme .owl-nav [class*="owl-"]:last-child:hover {
156
+ background-color: '.$_nav_active_color.';
157
+ }
158
+ </style>';
159
+
160
+ $html .='<script type="text/javascript">
161
+ jQuery(document).ready(function($) {
162
+ $(\'#spic-'.$id.'\').owlCarousel({
163
+ nav : '.$_nav_button.',
164
+ dots: '.$_dot_nav.',
165
+ margin:'.$_margin_right.',
166
+ loop :'.$_inifnity_loop.',
167
+ autoplay: '.$_autoplay.',
168
+ autoplayTimeout: '.$_autoplay_timeout.',
169
+ autoplaySpeed: '.$_autoplay_speed.',
170
+ autoplayHoverPause: '.$_autoplay_pause.',
171
+ slideBy: '.$_slide_by.',
172
+ responsiveClass:true,
173
+ responsive:{
174
+ 320:{ items:'.$_items_portrait_mobile.' },
175
+ 600:{ items:'.$_items_portrait_tablet.' },
176
+ 768:{ items:'.$_items_portrait_tablet.' },
177
+ 980:{ items:'.$_items_small_desktop.' },
178
+ 1200:{ items:'.$_items.' }
179
+ }
180
+ });
181
+ });
182
+ </script>';
183
+ $html .='</div>';
184
+
185
+ return $html;
186
+ }
187
+ }
188
+ add_shortcode('carousel_slide', 'carousel_slide_shortcode');
uninstall.php DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
- // If uninstall not called from WordPress, then exit.
3
- if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
4
- exit;
5
- }
6
- // If uninstall called from WordPress, then delete option
7
- if ( get_option( 'sis_carousel_settings' ) != false ){
8
- delete_option( 'sis_carousel_settings' );
9
- }