Carousel Slider - Version 1.5.2

Version Description

Download this release

Release Info

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

Code changes from version 1.5.1 to 1.5.2

Files changed (60) hide show
  1. LICENSE.txt +0 -0
  2. admin/Carousel_Slider_Admin.php +0 -291
  3. admin/index.php +0 -1
  4. assets/css/admin.css +15 -0
  5. assets/css/style.css +60 -0
  6. assets/img/ajax-loader.gif +0 -0
  7. {public → assets}/img/arrows.png +0 -0
  8. assets/img/icon-images.svg +1 -0
  9. assets/img/play.svg +1 -0
  10. assets/js/admin.js +139 -0
  11. {public/owl-carousel → assets/js}/owl.carousel.min.js +0 -0
  12. assets/sass/_animate.scss +27 -0
  13. assets/sass/_autoheight.scss +4 -0
  14. assets/sass/_core.scss +101 -0
  15. assets/sass/_lazyload.scss +14 -0
  16. assets/sass/_theme.scss +132 -0
  17. assets/sass/_variables.scss +5 -0
  18. assets/sass/_video.scss +49 -0
  19. assets/sass/admin.scss +56 -0
  20. assets/sass/style.scss +7 -0
  21. carousel-slider.php +169 -23
  22. includes/Carousel_Slider.php +0 -133
  23. includes/Carousel_Slider_Activator.php +0 -11
  24. includes/Carousel_Slider_Admin.php +348 -0
  25. includes/Carousel_Slider_Deactivator.php +0 -9
  26. includes/Carousel_Slider_Documentation.php +39 -0
  27. includes/Carousel_Slider_Loader.php +0 -53
  28. admin/partials/MetaBox.php → includes/Carousel_Slider_Meta_Box.php +285 -471
  29. includes/Carousel_Slider_VC_Element.php +44 -0
  30. includes/Carousel_Slider_i18n.php +0 -27
  31. includes/index.php +0 -0
  32. index.php +0 -0
  33. languages/carousel-slider.pot +162 -137
  34. {public → languages}/index.php +0 -0
  35. public/Carousel_Slider_Public.php +0 -25
  36. public/css/owl.carousel.css +0 -70
  37. public/css/owl.theme.css +0 -95
  38. public/css/owl.transitions.css +0 -163
  39. public/js/owl.carousel.js +0 -1512
  40. public/owl-carousel/owl.carousel.css +0 -218
  41. public/owl-carousel/style.css +0 -157
  42. readme.txt +39 -37
  43. screenshot-1.jpg +0 -0
  44. screenshot-1.png +0 -0
  45. screenshot-2.jpg +0 -0
  46. screenshot-2.png +0 -0
  47. screenshot-3.jpg +0 -0
  48. screenshot-3.png +0 -0
  49. screenshot-4.jpg +0 -0
  50. screenshot-5.jpg +0 -0
  51. screenshot-6.jpg +0 -0
  52. screenshot-7.jpg +0 -0
  53. shortcodes/Carousel_Slider_Shortcode.php +161 -0
  54. shortcodes/index.php +2 -0
  55. shortcodes/shortcodes.php +0 -188
  56. templates/carousel.php +5 -0
  57. templates/carousel_slide.php +144 -0
  58. {admin/partials → templates}/documentation.php +5 -0
  59. templates/index.php +2 -0
  60. widgets/widget-carousel_slider.php +122 -0
LICENSE.txt CHANGED
File without changes
admin/Carousel_Slider_Admin.php DELETED
@@ -1,291 +0,0 @@
1
- <?php
2
-
3
- class Carousel_Slider_Admin {
4
-
5
- private $plugin_name;
6
-
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,
63
- 'exclude_from_search' => false,
64
- 'publicly_queryable' => 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="https://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
- new \CarouselSlider\MetaBox($carousel_metabox);
246
- }
247
-
248
- public function columns_head(){
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
- switch ($column) {
264
-
265
- case 'usage':
266
-
267
- $id = $post_id;
268
-
269
- if ( !empty($id) ){
270
- echo '<pre><code>[carousel_slide id="'.$id.'"]</code></pre>';
271
- }
272
-
273
- break;
274
-
275
- case 'images':
276
- $image_ids = explode(',', get_post_meta( get_the_ID(), '_wpdh_image_ids', true) );
277
- $images ='<ul id="carousel-thumbs" class="carousel-thumbs">';
278
- foreach ( $image_ids as $image ) {
279
- if(!$image) continue;
280
- $src = wp_get_attachment_image_src( $image, array(32,32) );
281
- $images .= "<li style='display:inline;margin-right:5px;'><img src='{$src[0]}' width='{$src[1]}' height='{$src[2]}'></li>";
282
- }
283
- $images .= '</ul>';
284
- echo $images;
285
-
286
- break;
287
- default :
288
- break;
289
- }
290
- }
291
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/index.php DELETED
@@ -1 +0,0 @@
1
- <?php // Silence is golden
 
assets/css/admin.css ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ div[id*="_carousel_slider"] .widget-top { background: #ddffff !important; border: 1px solid #2196f3 !important; }
2
+ div[id*="_carousel_slider"] .widget-top:hover { background: #ffdddd !important; border: 1px solid #f44336 !important; }
3
+
4
+ .wpdh-gallery-thumbs { display: block; margin: 15px 0; }
5
+ .wpdh-gallery-thumbs:before, .wpdh-gallery-thumbs:after { display: table; content: ""; }
6
+ .wpdh-gallery-thumbs:after { clear: both; }
7
+ .wpdh-gallery-thumbs ul { margin: 0; padding: 0; list-style: none; }
8
+ .wpdh-gallery-thumbs li { display: inline-block; margin: 0 10px 10px 0; }
9
+ .wpdh-gallery-thumbs li img { display: block; }
10
+
11
+ .carousel-thumbs { margin: 0; padding: 0; list-style: none; }
12
+ .carousel-thumbs li { float: left; display: inline; margin: 0; padding: 0; }
13
+ .carousel-thumbs li img { display: block; margin: 0 5px 5px 0; }
14
+
15
+ /*# sourceMappingURL=admin.css.map */
assets/css/style.css ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .owl-carousel { display: none; width: 100%; -webkit-tap-highlight-color: transparent; position: relative; z-index: 1; }
2
+ .owl-carousel .owl-stage { position: relative; -ms-touch-action: pan-Y; }
3
+ .owl-carousel .owl-stage:after { content: "."; display: block; clear: both; visibility: hidden; line-height: 0; height: 0; }
4
+ .owl-carousel .owl-stage-outer { position: relative; overflow: hidden; -webkit-transform: translate3d(0px, 0px, 0px); }
5
+ .owl-carousel .owl-item { position: relative; min-height: 1px; float: left; -webkit-backface-visibility: hidden; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; }
6
+ .owl-carousel .owl-item img { display: block; width: 100%; -webkit-transform-style: preserve-3d; }
7
+ .owl-carousel .owl-nav.disabled, .owl-carousel .owl-dots.disabled { display: none; }
8
+ .owl-carousel .owl-nav .owl-prev, .owl-carousel .owl-nav .owl-next, .owl-carousel .owl-dot { cursor: pointer; cursor: hand; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; }
9
+ .owl-carousel.owl-loaded { display: block; }
10
+ .owl-carousel.owl-loading { opacity: 0; display: block; }
11
+ .owl-carousel.owl-hidden { opacity: 0; }
12
+ .owl-carousel.owl-refresh .owl-item { visibility: hidden; }
13
+ .owl-carousel.owl-drag .owl-item { -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; }
14
+ .owl-carousel.owl-grab { cursor: move; cursor: grab; }
15
+ .owl-carousel.owl-rtl { direction: rtl; }
16
+ .owl-carousel.owl-rtl .owl-item { float: right; }
17
+
18
+ .no-js #carousel-slider { display: block; }
19
+
20
+ .owl-carousel .animated { animation-duration: 1000ms; animation-fill-mode: both; }
21
+ .owl-carousel .owl-animated-in { z-index: 0; }
22
+ .owl-carousel .owl-animated-out { z-index: 1; }
23
+ .owl-carousel .fadeOut { animation-name: fadeOut; }
24
+
25
+ @keyframes fadeOut { 0% { opacity: 1; }
26
+ 100% { opacity: 0; } }
27
+ .owl-height { transition: height 500ms ease-in-out; }
28
+
29
+ .owl-carousel .owl-item .owl-lazy { opacity: 0; transition: opacity 400ms ease; }
30
+ .owl-carousel .owl-item img.owl-lazy { transform-style: preserve-3d; }
31
+
32
+ .owl-carousel .owl-video-wrapper { position: relative; height: 100%; background: #000; }
33
+ .owl-carousel .owl-video-play-icon { position: absolute; height: 80px; width: 80px; left: 50%; top: 50%; margin-left: -40px; margin-top: -40px; background: url("../img/play.svg") no-repeat; cursor: pointer; z-index: 1; -webkit-backface-visibility: hidden; transition: transform 100ms ease; }
34
+ .owl-carousel .owl-video-play-icon:hover { transform: scale(1.3, 1.3); }
35
+ .owl-carousel .owl-video-playing .owl-video-tn, .owl-carousel .owl-video-playing .owl-video-play-icon { display: none; }
36
+ .owl-carousel .owl-video-tn { opacity: 0; height: 100%; background-position: center center; background-repeat: no-repeat; background-size: contain; transition: opacity 400ms ease; }
37
+ .owl-carousel .owl-video-frame { position: relative; z-index: 1; height: 100%; width: 100%; }
38
+
39
+ #carousel-slider { position: relative; }
40
+ #carousel-slider .owl-nav [class*='owl-'] { background-image: url("../img/arrows.png"); background-color: #f1f1f1; display: inline-block; text-indent: -1e+7px; height: 25px; width: 25px; border-radius: 25px; position: absolute; top: 50%; transform: translateY(-50%); opacity: 0; margin: 0; padding: 0; transition: all .3s ease-in-out; }
41
+ #carousel-slider .owl-nav [class*='owl-']:hover { background-color: #4caf50; }
42
+ #carousel-slider .owl-nav [class*='owl-']:first-child { background-position: 0 45px; margin-right: 3px; left: -30px; }
43
+ #carousel-slider .owl-nav [class*='owl-']:last-child { background-position: 2px 2px; margin-left: 3px; right: -30px; }
44
+ #carousel-slider .owl-nav [class*='owl-']:first-child:hover { background-position: 0 24px; }
45
+ #carousel-slider .owl-nav [class*='owl-']:last-child:hover { background-position: 2px -20px; }
46
+ #carousel-slider .owl-nav .disabled { opacity: 0.5; cursor: default; }
47
+ #carousel-slider .owl-dots { text-align: center; -webkit-tap-highlight-color: transparent; margin-top: 10px; }
48
+ #carousel-slider .owl-dots .owl-dot { display: inline-block; zoom: 1; *display: inline; }
49
+ #carousel-slider .owl-dots .owl-dot span { width: 10px; height: 10px; margin: 4px 8px; background-color: #f1f1f1; display: block; -webkit-backface-visibility: visible; transition: opacity 200ms ease; border-radius: 30px; }
50
+ #carousel-slider .owl-dots .owl-dot.active span, #carousel-slider .owl-dots .owl-dot:hover span { background-color: #4caf50; }
51
+ #carousel-slider .carousel-slider__item { position: relative; }
52
+ #carousel-slider .carousel-slider__item img { display: block; margin-left: auto; margin-right: auto; max-width: 100%; height: auto; }
53
+ #carousel-slider .carousel-slider__caption { position: relative; }
54
+ #carousel-slider .carousel-slider__caption .title { overflow: hidden; text-overflow: ellipsis; color: #474747; font-size: 16px; font-weight: 500; margin: 10px 0 0; text-align: center; }
55
+ #carousel-slider .carousel-slider__caption .caption { font-size: 14px; font-weight: 300; margin: 10px 0 0; text-align: center; }
56
+ #carousel-slider:hover .owl-nav [class*='owl-'] { opacity: 1; }
57
+ @media (max-width: 767px) { #carousel-slider:hover .sp-theme .owl-nav { display: none; }
58
+ #carousel-slider .sp-theme .owl-nav { display: none; } }
59
+
60
+ /*# sourceMappingURL=style.css.map */
assets/img/ajax-loader.gif ADDED
Binary file
{public → assets}/img/arrows.png RENAMED
File without changes
assets/img/icon-images.svg ADDED
@@ -0,0 +1 @@
 
1
+ <?xml version="1.0" ?><!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'><svg height="512px" id="Layer_1" style="enable-background:new 0 0 512 512;" version="1.1" viewBox="0 0 512 512" width="512px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g><g><path d="M457.6,140.2l-82.5-4l-4.8-53.8c-1-11.3-11.1-19.2-22.9-18.3L51.4,88.4c-11.8,1-20.3,10.5-19.4,21.7l21.2,235.8 c1,11.3,11.2,19.2,22.9,18.3l15-1.2l-2.4,45.8c-0.6,12.6,9.2,22.8,22.4,23.5L441.3,448c13.2,0.6,24.1-8.6,24.8-21.2L480,163.5 C480.6,151,470.7,140.8,457.6,140.2z M102.6,145.5l-7.1,134.8L78.1,305l-16-178c0-0.2,0-0.3,0-0.5s0-0.3,0-0.5 c0.5-5,4.3-9,9.5-9.4l261-21.4c5.2-0.4,9.7,3,10.5,7.9c0,0.2,0.3,0.2,0.3,0.4c0,0.1,0.3,0.2,0.3,0.4l2.7,30.8l-219-10.5 C114.2,123.8,103.2,133,102.6,145.5z M436.7,382.4l-46.7-55.3l-27.5-32.7c-2.4-2.9-6.3-5.3-10.6-5.5c-4.3-0.2-7.5,1.5-11.1,4.1 l-16.4,11.9c-3.5,2.1-6.2,3.5-9.9,3.3c-3.6-0.2-6.8-1.6-9.1-3.8c-0.8-0.8-2.3-2.2-3.5-3.4l-42.8-48.9c-3.1-3.9-8.2-6.4-13.8-6.7 c-5.7-0.3-11.2,2.1-14.8,5.6L129.4,359.8l-6.8,7.4l0.3-6.8l6.8-128.9l3.3-62.9c0-0.2,0-0.4,0-0.5c0-0.2,0-0.4,0-0.5 c1.4-5.4,6.2-9.3,11.9-9l204.2,9.8l28.7,1.4l58.3,2.8c5.8,0.3,10.3,4.7,10.4,10.2c0,0.2,0.3,0.3,0.3,0.5c0,0.2,0.3,0.3,0.3,0.5 L436.7,382.4z"/></g><path d="M373.2,262.3c19.4,0,35.2-15.8,35.2-35.2s-15.7-35.2-35.2-35.2c-19.4,0-35.2,15.7-35.2,35.2S353.7,262.3,373.2,262.3z"/></g></svg>
assets/img/play.svg ADDED
@@ -0,0 +1 @@
 
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40" width="80" height="80" fill="#f1f1f1"><path d="M12.1 6.7 35.1 20.2 12.1 33.7l0-26.9z"/><path d="m19.7 40c-11 0-20-9-20-20 0-11 9-20 20-20 11 0 20 9 20 20 0 11-9 20-20 20zm0-38c-9.9 0-18 8.1-18 18 0 9.9 8.1 18 18 18 9.9 0 18-8.1 18-18 0-9.9-8.1-18-18-18z"/></svg>
assets/js/admin.js ADDED
@@ -0,0 +1,139 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function( $ ) {
2
+ "use strict";
3
+
4
+ // Use WP Color Picker
5
+ $('.colorpicker').each(function(){
6
+ $(this).wpColorPicker();
7
+ });
8
+
9
+ // Gallery Images Editor
10
+ var frame,
11
+ images = wpdh_ajax.image_ids,
12
+ selection = loadImages(images);
13
+
14
+ $('#wpdh_images_upload').on('click', function(e) {
15
+ e.preventDefault();
16
+ var options = {
17
+ title: wpdh_ajax.create_btn_text,
18
+ state: 'gallery-edit',
19
+ frame: 'post',
20
+ selection: selection
21
+ };
22
+
23
+ if( frame || selection ) {
24
+ options['title'] = wpdh_ajax.edit_btn_text;
25
+ }
26
+
27
+ frame = wp.media(options).open();
28
+
29
+ // Tweak Views
30
+ frame.menu.get('view').unset('cancel');
31
+ frame.menu.get('view').unset('separateCancel');
32
+ frame.menu.get('view').get('gallery-edit').el.innerHTML = wpdh_ajax.edit_btn_text;
33
+ frame.content.get('view').sidebar.unset('gallery'); // Hide Gallery Settings in sidebar
34
+
35
+ // when editing a gallery
36
+ overrideGalleryInsert();
37
+ frame.on( 'toolbar:render:gallery-edit', function() {
38
+ overrideGalleryInsert();
39
+ });
40
+
41
+ frame.on( 'content:render:browse', function( browser ) {
42
+ if ( !browser ) return;
43
+ // Hide Gallery Settings in sidebar
44
+ browser.sidebar.on('ready', function(){
45
+ browser.sidebar.unset('gallery');
46
+ });
47
+ // Hide filter/search as they don't work
48
+ browser.toolbar.on('ready', function(){
49
+ if(browser.toolbar.controller._state == 'gallery-library'){
50
+ browser.toolbar.$el.hide();
51
+ }
52
+ });
53
+ });
54
+
55
+ // All images removed
56
+ frame.state().get('library').on( 'remove', function() {
57
+ var models = frame.state().get('library');
58
+ if(models.length == 0){
59
+ selection = false;
60
+ $.post(ajaxurl, {
61
+ ids: '',
62
+ action: 'save_images',
63
+ post_id: wpdh_ajax.post_id,
64
+ nonce: wpdh_ajax.nonce
65
+ });
66
+ }
67
+ });
68
+
69
+ function overrideGalleryInsert(){
70
+ frame.toolbar.get('view').set({
71
+ insert: {
72
+ style: 'primary',
73
+ text: wpdh_ajax.save_btn_text,
74
+ click: function(){
75
+ var models = frame.state().get('library'),
76
+ ids = '';
77
+
78
+ models.each( function( attachment ) {
79
+ ids += attachment.id + ','
80
+ });
81
+
82
+ this.el.innerHTML = wpdh_ajax.progress_btn_text;
83
+
84
+ $.ajax({
85
+ type: 'POST',
86
+ url: ajaxurl,
87
+ data: {
88
+ ids: ids,
89
+ action: 'save_images',
90
+ post_id: wpdh_ajax.post_id,
91
+ nonce: wpdh_ajax.nonce
92
+ },
93
+ success: function(){
94
+ selection = loadImages(ids);
95
+ $('#_wpdh_image_ids').val( ids );
96
+ frame.close();
97
+ },
98
+ dataType: 'html'
99
+ }).done( function( data ) {
100
+ $('.wpdh-gallery-thumbs').html( data );
101
+ console.log(data);
102
+ });
103
+ }
104
+ }
105
+ });
106
+ }
107
+
108
+ });
109
+
110
+ function loadImages(images){
111
+ if (images){
112
+ var shortcode = new wp.shortcode({
113
+ tag: 'gallery',
114
+ attrs: { ids: images },
115
+ type: 'single'
116
+ });
117
+
118
+ var attachments = wp.media.gallery.attachments( shortcode );
119
+
120
+ var selection = new wp.media.model.Selection( attachments.models, {
121
+ props: attachments.props.toJSON(),
122
+ multiple: true
123
+ });
124
+
125
+ selection.gallery = attachments.gallery;
126
+
127
+ selection.more().done( function() {
128
+ // Break ties with the query.
129
+ selection.props.set({ query: false });
130
+ selection.unmirror();
131
+ selection.props.unset('orderby');
132
+ });
133
+
134
+ return selection;
135
+ }
136
+ return false;
137
+ }
138
+
139
+ })(jQuery);
{public/owl-carousel → assets/js}/owl.carousel.min.js RENAMED
File without changes
assets/sass/_animate.scss ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Owl Carousel - Animate Plugin
2
+ .owl-carousel {
3
+
4
+ .animated {
5
+ animation-duration: 1000ms;
6
+ animation-fill-mode: both;
7
+ }
8
+ .owl-animated-in {
9
+ z-index: 0;
10
+ }
11
+ .owl-animated-out {
12
+ z-index: 1;
13
+ }
14
+ .fadeOut {
15
+ animation-name: fadeOut;
16
+ }
17
+ }
18
+
19
+ @keyframes fadeOut {
20
+ 0% {
21
+ opacity: 1;
22
+ }
23
+
24
+ 100% {
25
+ opacity: 0;
26
+ }
27
+ }
assets/sass/_autoheight.scss ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ // Owl Carousel - Auto Height Plugin
2
+ .owl-height {
3
+ transition: height 500ms ease-in-out;
4
+ }
assets/sass/_core.scss ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Owl Carousel - Core
2
+ .owl-carousel {
3
+ display: none;
4
+ width: 100%;
5
+ -webkit-tap-highlight-color: transparent;
6
+ position: relative;
7
+ z-index: 1;
8
+
9
+ .owl-stage {
10
+ position: relative;
11
+ -ms-touch-action: pan-Y;
12
+ }
13
+
14
+ .owl-stage:after {
15
+ content: ".";
16
+ display: block;
17
+ clear: both;
18
+ visibility: hidden;
19
+ line-height: 0;
20
+ height: 0;
21
+ }
22
+
23
+ .owl-stage-outer {
24
+ position: relative;
25
+ overflow: hidden;
26
+ -webkit-transform: translate3d(0px, 0px, 0px);
27
+ }
28
+
29
+ .owl-item {
30
+ position: relative;
31
+ min-height: 1px;
32
+ float: left;
33
+ -webkit-backface-visibility: hidden;
34
+ -webkit-tap-highlight-color: transparent;
35
+ -webkit-touch-callout: none;
36
+ }
37
+ .owl-item img {
38
+ display: block;
39
+ width: 100%;
40
+ -webkit-transform-style: preserve-3d;
41
+ }
42
+
43
+ .owl-nav.disabled,
44
+ .owl-dots.disabled {
45
+ display: none;
46
+ }
47
+
48
+ .owl-nav .owl-prev,
49
+ .owl-nav .owl-next,
50
+ .owl-dot {
51
+ cursor: pointer;
52
+ cursor: hand;
53
+ -webkit-user-select: none;
54
+ -khtml-user-select: none;
55
+ -moz-user-select: none;
56
+ -ms-user-select: none;
57
+ user-select: none;
58
+ }
59
+
60
+ &.owl-loaded {
61
+ display: block;
62
+ }
63
+
64
+ &.owl-loading {
65
+ opacity: 0;
66
+ display: block;
67
+ }
68
+
69
+ &.owl-hidden {
70
+ opacity: 0;
71
+ }
72
+
73
+ &.owl-refresh .owl-item {
74
+ visibility: hidden;
75
+ }
76
+
77
+ &.owl-drag .owl-item {
78
+ -webkit-user-select: none;
79
+ -moz-user-select: none;
80
+ -ms-user-select: none;
81
+ user-select: none;
82
+ }
83
+
84
+ &.owl-grab {
85
+ cursor: move;
86
+ cursor: grab;
87
+ }
88
+
89
+ &.owl-rtl {
90
+ direction: rtl;
91
+ }
92
+
93
+ &.owl-rtl .owl-item {
94
+ float: right;
95
+ }
96
+ }
97
+
98
+ // No Js
99
+ .no-js #carousel-slider {
100
+ display: block;
101
+ }
assets/sass/_lazyload.scss ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Owl Carousel - Lazy Load Plugin
2
+ .owl-carousel {
3
+ .owl-item {
4
+ .owl-lazy {
5
+ opacity: 0;
6
+ transition: opacity 400ms ease;
7
+ }
8
+
9
+ img.owl-lazy {
10
+ transform-style: preserve-3d;
11
+ }
12
+ }
13
+ }
14
+
assets/sass/_theme.scss ADDED
@@ -0,0 +1,132 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #carousel-slider {
2
+ position: relative;
3
+
4
+ // Styling Next and Prev buttons
5
+ .owl-nav {
6
+ [class*='owl-'] {
7
+ background-image: url( $nav-arrows-url );
8
+ background-color: $background-color;
9
+ // background-color: #4dc7a0;
10
+ display: inline-block;
11
+ text-indent: -1e+7px;
12
+ height: 25px;
13
+ width: 25px;
14
+ border-radius: 25px;
15
+ position: absolute;
16
+ top: 50%;
17
+ transform: translateY(-50%);
18
+ opacity: 0;
19
+ margin: 0;
20
+ padding: 0;
21
+ transition:all .3s ease-in-out;
22
+
23
+ &:hover {
24
+ background-color: $background-hover-color;
25
+ }
26
+ &:first-child {
27
+ background-position: 0 45px;
28
+ margin-right: 3px;
29
+ left: -30px;
30
+ }
31
+ &:last-child {
32
+ background-position: 2px 2px;
33
+ margin-left: 3px;
34
+ right: -30px;
35
+ }
36
+ &:first-child:hover {
37
+ background-position: 0 24px;
38
+ }
39
+ &:last-child:hover {
40
+ background-position: 2px -20px;
41
+ }
42
+ }
43
+
44
+ .disabled {
45
+ opacity: 0.5;
46
+ cursor: default;
47
+ }
48
+ }
49
+
50
+ // Styling dots
51
+ .owl-dots {
52
+ text-align: center;
53
+ -webkit-tap-highlight-color: transparent;
54
+ margin-top: 10px;
55
+
56
+ .owl-dot {
57
+ display: inline-block;
58
+ zoom: 1;
59
+ *display: inline;
60
+
61
+ span {
62
+ width: 10px;
63
+ height: 10px;
64
+ margin: 4px 8px;
65
+ background-color: $background-color;
66
+ display: block;
67
+ -webkit-backface-visibility: visible;
68
+ transition: opacity 200ms ease;
69
+ border-radius: 30px;
70
+ }
71
+
72
+ &.active,
73
+ &:hover {
74
+ span {
75
+ background-color: $background-hover-color;
76
+ }
77
+ }
78
+ }
79
+ }
80
+
81
+ // Styling item
82
+ .carousel-slider__item {
83
+ position: relative;
84
+
85
+ img {
86
+ display: block;
87
+ margin-left: auto;
88
+ margin-right: auto;
89
+ max-width: 100%;
90
+ height: auto;
91
+ }
92
+ }
93
+ .carousel-slider__caption {
94
+ position: relative;
95
+
96
+ .title {
97
+ overflow: hidden;
98
+ text-overflow: ellipsis;
99
+ color: #474747;
100
+ font-size: 16px;
101
+ font-weight: 500;
102
+ margin: 10px 0 0;
103
+ text-align: center;
104
+ }
105
+
106
+ .caption {
107
+ font-size: 14px;
108
+ font-weight: 300;
109
+ margin: 10px 0 0;
110
+ text-align: center;
111
+ }
112
+ }
113
+
114
+ &:hover {
115
+ .owl-nav {
116
+ [class*='owl-'] {
117
+ opacity: 1;
118
+ }
119
+ }
120
+ }
121
+
122
+ @media ( max-width: 767px ) {
123
+ &:hover {
124
+ .sp-theme .owl-nav {
125
+ display : none;
126
+ }
127
+ }
128
+ .sp-theme .owl-nav {
129
+ display : none;
130
+ }
131
+ }
132
+ }
assets/sass/_variables.scss ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ // Variables
2
+ $background-color : #f1f1f1;
3
+ $background-hover-color : #4caf50;
4
+ $nav-arrows-url : "../img/arrows.png";
5
+ $owl-video-play-icon : "../img/play.svg";
assets/sass/_video.scss ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Owl Carousel - Video Plugin
2
+ .owl-carousel {
3
+
4
+ .owl-video-wrapper {
5
+ position: relative;
6
+ height: 100%;
7
+ background: #000;
8
+ }
9
+
10
+ .owl-video-play-icon {
11
+ position: absolute;
12
+ height: 80px;
13
+ width: 80px;
14
+ left: 50%;
15
+ top: 50%;
16
+ margin-left: -40px;
17
+ margin-top: -40px;
18
+ background: url( $owl-video-play-icon ) no-repeat;
19
+ cursor: pointer;
20
+ z-index: 1;
21
+ -webkit-backface-visibility: hidden;
22
+ transition: transform 100ms ease;
23
+ }
24
+
25
+ .owl-video-play-icon:hover {
26
+ transform: scale(1.3, 1.3);
27
+ }
28
+
29
+ .owl-video-playing .owl-video-tn,
30
+ .owl-video-playing .owl-video-play-icon {
31
+ display: none;
32
+ }
33
+
34
+ .owl-video-tn {
35
+ opacity: 0;
36
+ height: 100%;
37
+ background-position: center center;
38
+ background-repeat: no-repeat;
39
+ background-size: contain;
40
+ transition: opacity 400ms ease;
41
+ }
42
+
43
+ .owl-video-frame {
44
+ position: relative;
45
+ z-index: 1;
46
+ height: 100%;
47
+ width: 100%;
48
+ }
49
+ }
assets/sass/admin.scss ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Widget Styles
2
+ div[id*="_carousel_slider"] .widget-top{
3
+ background: #ddffff !important;
4
+ border: 1px solid #2196f3 !important;
5
+
6
+ &:hover {
7
+ background: #ffdddd !important;
8
+ border: 1px solid #f44336 !important;
9
+ }
10
+ }
11
+
12
+ .wpdh-gallery-thumbs{
13
+ display: block;
14
+ margin: 15px 0;
15
+ &:before,
16
+ &:after {
17
+ display: table;
18
+ content: "";
19
+ }
20
+ &:after {
21
+ clear: both;
22
+ }
23
+
24
+ ul {
25
+ margin: 0;
26
+ padding: 0;
27
+ list-style: none;
28
+ }
29
+
30
+ li {
31
+ display: inline-block;
32
+ margin: 0 10px 10px 0;
33
+
34
+ img {
35
+ display: block;
36
+ }
37
+ }
38
+ }
39
+
40
+ .carousel-thumbs {
41
+ margin: 0;
42
+ padding: 0;
43
+ list-style: none;
44
+
45
+ li {
46
+ float: left;
47
+ display: inline;
48
+ margin: 0;
49
+ padding: 0;
50
+
51
+ img {
52
+ display: block;
53
+ margin: 0 5px 5px 0;
54
+ }
55
+ }
56
+ }
assets/sass/style.scss ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ @import 'variables';
2
+ @import 'core';
3
+ @import 'animate';
4
+ @import 'autoheight';
5
+ @import 'lazyload';
6
+ @import 'video';
7
+ @import 'theme';
carousel-slider.php CHANGED
@@ -3,7 +3,7 @@
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
@@ -17,38 +17,184 @@ if ( ! defined( 'WPINC' ) ) {
17
  die;
18
  }
19
 
20
- /**
21
- * The code that runs during plugin activation.
22
- */
23
- function activate_carousel_slider() {
24
- require_once plugin_dir_path( __FILE__ ) . 'includes/Carousel_Slider_Activator.php';
25
- Carousel_Slider_Activator::activate();
26
- }
27
 
28
- /**
29
- * The code that runs during plugin deactivation.
30
- */
31
- function deactivate_carousel_slider() {
32
- require_once plugin_dir_path( __FILE__ ) . 'includes/Carousel_Slider_Deactivator.php';
33
- Carousel_Slider_Deactivator::deactivate();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  }
35
 
36
- register_activation_hook( __FILE__, 'activate_carousel_slider' );
37
- register_deactivation_hook( __FILE__, 'deactivate_carousel_slider' );
38
 
39
  /**
40
- * The core plugin class that is used to define internationalization,
41
- * dashboard-specific hooks, and public-facing site hooks.
42
  */
43
- require plugin_dir_path( __FILE__ ) . 'includes/Carousel_Slider.php';
 
 
 
 
44
 
45
  /**
46
  * Begins execution of the plugin.
47
  */
48
  function run_carousel_slider() {
49
-
50
- $plugin = new Carousel_Slider();
51
- $plugin->run();
52
-
53
  }
54
  run_carousel_slider();
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.2
7
  Author: Sayful Islam
8
  Author URI: http://sayfulit.com
9
  Text Domain: carousel-slider
17
  die;
18
  }
19
 
20
+ if( ! class_exists('Carousel_Slider') ):
 
 
 
 
 
 
21
 
22
+ class Carousel_Slider
23
+ {
24
+ private $plugin_name;
25
+ private $plugin_version;
26
+ private $plugin_url;
27
+ private $plugin_path;
28
+
29
+ public function __construct()
30
+ {
31
+ $this->plugin_name = 'carousel-slider';
32
+ $this->plugin_version = '1.5.2';
33
+
34
+ add_action('wp_enqueue_scripts', array( $this, 'frontend_scripts' ), 15 );
35
+ add_action( 'admin_enqueue_scripts', array( $this, 'admin_scripts' ), 10 );
36
+ add_action('init', array( $this, 'load_textdomain' ) );
37
+ add_filter('widget_text', 'do_shortcode');
38
+ $this->includes();
39
+ }
40
+
41
+ public function load_textdomain()
42
+ {
43
+ // Set filter for plugin's languages directory
44
+ $shaplatools_lang_dir = dirname( plugin_basename( __FILE__ ) ) . '/languages/';
45
+
46
+ // Traditional WordPress plugin locale filter
47
+ $locale = apply_filters( 'plugin_locale', get_locale(), 'carousel-slider' );
48
+ $mofile = sprintf( '%1$s-%2$s.mo', 'carousel-slider', $locale );
49
+
50
+ // Setup paths to current locale file
51
+ $mofile_local = $shaplatools_lang_dir . $mofile;
52
+ $mofile_global = WP_LANG_DIR . '/carousel-slider/' . $mofile;
53
+
54
+ if ( file_exists( $mofile_global ) ) {
55
+ // Look in global /wp-content/languages/carousel-slider folder
56
+ load_textdomain( $this->plugin_name, $mofile_global );
57
+ } elseif ( file_exists( $mofile_local ) ) {
58
+ // Look in local /wp-content/plugins/carousel-slider/languages/ folder
59
+ load_textdomain( $this->plugin_name, $mofile_local );
60
+ } else {
61
+ // Load the default language files
62
+ load_plugin_textdomain( $this->plugin_name, false, $shaplatools_lang_dir );
63
+ }
64
+ }
65
+
66
+ public function includes()
67
+ {
68
+ if ( is_admin() ) {
69
+ $this->admin_includes();
70
+ }
71
+ if ( ! is_admin() ) {
72
+ $this->frontend_includes();
73
+ }
74
+
75
+ require_once $this->plugin_path() . '/widgets/widget-carousel_slider.php';
76
+ }
77
+
78
+ public function admin_includes()
79
+ {
80
+ require_once $this->plugin_path() . '/includes/Carousel_Slider_VC_Element.php';
81
+ require_once $this->plugin_path() . '/includes/Carousel_Slider_Documentation.php';
82
+ require_once $this->plugin_path() . '/includes/Carousel_Slider_Meta_Box.php';
83
+ require_once $this->plugin_path() . '/includes/Carousel_Slider_Admin.php';
84
+
85
+ new Carousel_Slider_Admin;
86
+ }
87
+
88
+ public function frontend_includes()
89
+ {
90
+ require_once $this->plugin_path() . '/shortcodes/Carousel_Slider_Shortcode.php';
91
+
92
+ new Carousel_Slider_Shortcode( $this->plugin_path(), $this->plugin_url() );
93
+ }
94
+
95
+ public function frontend_scripts()
96
+ {
97
+ wp_register_style( $this->plugin_name, $this->plugin_url() . '/assets/css/style.css', array(), $this->plugin_version, 'all' );
98
+ wp_register_script( 'owl-carousel', $this->plugin_url() . '/assets/js/owl.carousel.min.js', array( 'jquery' ), '2.0.0', true );
99
+
100
+ if( $this->has_shortcode('carousel_slide') || $this->has_shortcode( 'carousel') )
101
+ {
102
+ wp_enqueue_style( $this->plugin_name );
103
+ wp_enqueue_script( 'owl-carousel' );
104
+ }
105
+ }
106
+
107
+ public function admin_scripts()
108
+ {
109
+ global $post;
110
+
111
+ wp_enqueue_style(
112
+ $this->plugin_name . '-admin',
113
+ $this->plugin_url() . '/assets/css/admin.css',
114
+ array(),
115
+ $this->plugin_version,
116
+ 'all'
117
+ );
118
+
119
+ if( is_a( $post, 'WP_Post' ) && isset( $post->ID ) ) {
120
+
121
+ wp_enqueue_media();
122
+ wp_enqueue_style( 'wp-color-picker' );
123
+ wp_enqueue_script( 'wp-color-picker' );
124
+
125
+ wp_enqueue_script(
126
+ $this->plugin_name . '-admin',
127
+ $this->plugin_url() . '/assets/js/admin.js',
128
+ array( 'jquery', 'wp-color-picker' ),
129
+ $this->plugin_version,
130
+ true
131
+ );
132
+
133
+ wp_localize_script( $this->plugin_name . '-admin', 'wpdh_ajax', array(
134
+ 'post_id' => $post->ID,
135
+ 'image_ids' => get_post_meta( $post->ID, '_wpdh_image_ids', true ),
136
+ 'nonce' => wp_create_nonce( 'wpdh-ajax' ),
137
+ 'create_btn_text' => __('Create Gallery', 'carousel-slider'),
138
+ 'edit_btn_text' => __('Edit Gallery', 'carousel-slider'),
139
+ 'save_btn_text' => __('Save Gallery', 'carousel-slider'),
140
+ 'progress_btn_text' => __('Saving...', 'carousel-slider'),
141
+ ) );
142
+ }
143
+ }
144
+
145
+ private function has_shortcode( $shortcode )
146
+ {
147
+ global $post;
148
+
149
+ if ( ! is_a( $post, 'WP_Post' ) ) {
150
+ return false;
151
+ }
152
+
153
+ if ( ! has_shortcode( $post->post_content, $shortcode) ) {
154
+ return false;
155
+ }
156
+
157
+ return true;
158
+ }
159
+
160
+ /**
161
+ * Plugin path.
162
+ *
163
+ * @return string Plugin path
164
+ */
165
+ private function plugin_path() {
166
+ if ( $this->plugin_path ) return $this->plugin_path;
167
+
168
+ return $this->plugin_path = untrailingslashit( plugin_dir_path( __FILE__ ) );
169
+ }
170
+
171
+ /**
172
+ * Plugin url.
173
+ *
174
+ * @return string Plugin url
175
+ */
176
+ private function plugin_url() {
177
+ if ( $this->plugin_url ) return $this->plugin_url;
178
+ return $this->plugin_url = untrailingslashit( plugins_url( '/', __FILE__ ) );
179
+ }
180
  }
181
 
182
+ endif;
 
183
 
184
  /**
185
+ * The code that runs during plugin activation.
186
+ * The code that runs during plugin deactivation.
187
  */
188
+ function carousel_slider_activation_deactivation() {
189
+ flush_rewrite_rules();;
190
+ }
191
+ register_activation_hook( __FILE__, 'carousel_slider_activation_deactivation' );
192
+ register_deactivation_hook( __FILE__, 'carousel_slider_activation_deactivation' );
193
 
194
  /**
195
  * Begins execution of the plugin.
196
  */
197
  function run_carousel_slider() {
198
+ new Carousel_Slider();
 
 
 
199
  }
200
  run_carousel_slider();
includes/Carousel_Slider.php DELETED
@@ -1,133 +0,0 @@
1
- <?php
2
-
3
- class Carousel_Slider {
4
-
5
- protected $loader;
6
-
7
- protected $plugin_name;
8
-
9
- protected $version;
10
-
11
- public function __construct() {
12
-
13
- $this->plugin_name = 'carousel-slider';
14
- $this->version = '1.5.1';
15
-
16
- $this->load_dependencies();
17
- $this->set_locale();
18
- $this->define_admin_hooks();
19
- $this->define_public_hooks();
20
- $this->includes();
21
-
22
- }
23
-
24
- /**
25
- * Load the required dependencies for this plugin.
26
- * Create an instance of the loader which will be used to register the hooks
27
- * with WordPress.
28
- */
29
- private function load_dependencies() {
30
-
31
- /**
32
- * The class responsible for orchestrating the actions and filters of the
33
- * core plugin.
34
- */
35
- require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/Carousel_Slider_Loader.php';
36
-
37
- /**
38
- * The class responsible for defining internationalization functionality
39
- * of the plugin.
40
- */
41
- require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/Carousel_Slider_i18n.php';
42
-
43
- /**
44
- * The class responsible for defining all actions that occur in the Dashboard.
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.
51
- */
52
- require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/Carousel_Slider_Public.php';
53
-
54
- $this->loader = new Carousel_Slider_Loader();
55
-
56
- }
57
-
58
- /**
59
- * Define the locale for this plugin for internationalization.
60
- *
61
- * Uses the Carousel_Slider_i18n class in order to set the domain and to register the hook
62
- * with WordPress.
63
- */
64
- private function set_locale() {
65
-
66
- $plugin_i18n = new Carousel_Slider_i18n();
67
- $plugin_i18n->set_domain( $this->get_plugin_name() );
68
-
69
- $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );
70
-
71
- }
72
-
73
- /**
74
- * Register all of the hooks related to the dashboard functionality of the plugin.
75
- */
76
- private function define_admin_hooks() {
77
-
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
-
88
- /**
89
- * Register all of the hooks related to the public-facing functionality of the plugin.
90
- */
91
- private function define_public_hooks() {
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
-
99
- /**
100
- * Include admin and frontend files.
101
- */
102
- public function includes() {
103
-
104
- if( !is_admin() ){
105
- $this->frontend_includes();
106
- }
107
-
108
- }
109
-
110
- /**
111
- * Include frontend files.
112
- */
113
- public function frontend_includes(){
114
- require_once plugin_dir_path( dirname( __FILE__ ) ) . 'shortcodes/shortcodes.php';
115
- }
116
-
117
- public function run() {
118
- $this->loader->run();
119
- }
120
-
121
- public function get_plugin_name() {
122
- return $this->plugin_name;
123
- }
124
-
125
- public function get_loader() {
126
- return $this->loader;
127
- }
128
-
129
- public function get_version() {
130
- return $this->version;
131
- }
132
-
133
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/Carousel_Slider_Activator.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- class Carousel_Slider_Activator {
4
-
5
- public static function activate() {
6
-
7
- flush_rewrite_rules();
8
-
9
- }
10
-
11
- }
 
 
 
 
 
 
 
 
 
 
 
includes/Carousel_Slider_Admin.php ADDED
@@ -0,0 +1,348 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // If this file is called directly, abort.
3
+ if ( ! defined( 'WPINC' ) ) {
4
+ die;
5
+ }
6
+
7
+ if( ! class_exists('Carousel_Slider_Admin') ):
8
+
9
+ class Carousel_Slider_Admin
10
+ {
11
+ public function __construct()
12
+ {
13
+ add_action('init', array( $this, 'carousel_post_type' ) );
14
+ add_action('add_meta_boxes', array( $this, 'add_meta_boxes' ) );
15
+ add_filter( 'manage_edit-carousels_columns', array( $this, 'columns_head') );
16
+ add_filter( 'manage_carousels_posts_custom_column', array( $this, 'columns_content'), 10, 2 );
17
+ $this->metaboxs();
18
+ }
19
+
20
+ public function carousel_post_type() {
21
+ $labels = array(
22
+ 'name' => _x( 'Carousels', 'Post Type General Name', 'carousel-slider' ),
23
+ 'singular_name' => _x( 'Carousel', 'Post Type Singular Name', 'carousel-slider' ),
24
+ 'menu_name' => __( 'Carousels', 'carousel-slider' ),
25
+ 'parent_item_colon' => __( 'Parent Carousel:', 'carousel-slider' ),
26
+ 'all_items' => __( 'All Carousels', 'carousel-slider' ),
27
+ 'view_item' => __( 'View Carousel', 'carousel-slider' ),
28
+ 'add_new_item' => __( 'Add New Carousel', 'carousel-slider' ),
29
+ 'add_new' => __( 'Add New', 'carousel-slider' ),
30
+ 'edit_item' => __( 'Edit Carousel', 'carousel-slider' ),
31
+ 'update_item' => __( 'Update Carousel', 'carousel-slider' ),
32
+ 'search_items' => __( 'Search Carousel', 'carousel-slider' ),
33
+ 'not_found' => __( 'Not found', 'carousel-slider' ),
34
+ 'not_found_in_trash' => __( 'Not found in Trash', 'carousel-slider' ),
35
+ );
36
+ $args = array(
37
+ 'label' => __( 'Carousel', 'carousel-slider' ),
38
+ 'description' => __( 'Carousel', 'carousel-slider' ),
39
+ 'labels' => $labels,
40
+ 'supports' => array( 'title' ),
41
+ 'hierarchical' => false,
42
+ 'public' => false,
43
+ 'show_ui' => true,
44
+ 'show_in_menu' => true,
45
+ 'show_in_nav_menus' => true,
46
+ 'show_in_admin_bar' => true,
47
+ 'menu_position' => 5.55525,
48
+ 'menu_icon' => 'dashicons-slides',
49
+ 'can_export' => true,
50
+ 'has_archive' => false,
51
+ 'exclude_from_search' => true,
52
+ 'publicly_queryable' => true,
53
+ 'rewrite' => false,
54
+ 'capability_type' => 'post',
55
+ );
56
+ register_post_type( 'carousels', $args );
57
+ }
58
+
59
+ public function columns_head(){
60
+
61
+ $columns = array(
62
+ 'cb' => '<input type="checkbox">',
63
+ 'title' => __('Carousel Slide Title', 'carousel-slider'),
64
+ 'usage' => __('Shortcode', 'carousel-slider'),
65
+ 'images' => __('Carousel Images', 'carousel-slider')
66
+ );
67
+
68
+ return $columns;
69
+
70
+ }
71
+
72
+ public function columns_content($column, $post_id) {
73
+ switch ($column) {
74
+
75
+ case 'usage':
76
+
77
+ $id = $post_id;
78
+
79
+ if ( !empty($id) ){
80
+ echo '<pre><code>[carousel_slide id="'.$id.'"]</code></pre>';
81
+ }
82
+
83
+ break;
84
+
85
+ case 'images':
86
+ $image_ids = explode(',', get_post_meta( get_the_ID(), '_wpdh_image_ids', true) );
87
+ $images ='<ul id="carousel-thumbs" class="carousel-thumbs">';
88
+ foreach ( $image_ids as $image ) {
89
+ if(!$image) continue;
90
+ $src = wp_get_attachment_image_src( $image, array(32,32) );
91
+ $images .= "<li><img src='{$src[0]}' width='{$src[1]}' height='{$src[2]}'></li>";
92
+ }
93
+ $images .= '</ul>';
94
+ echo $images;
95
+
96
+ break;
97
+ default :
98
+ break;
99
+ }
100
+ }
101
+
102
+ public function add_meta_boxes()
103
+ {
104
+ add_meta_box(
105
+ "carousel-shortcode-info",
106
+ __("Usage (Shortcode)", 'carousel-slider'),
107
+ array( $this, 'render_meta_box_shortcode_info' ),
108
+ "carousels",
109
+ "side",
110
+ "high"
111
+ );
112
+ }
113
+
114
+ public function render_meta_box_shortcode_info()
115
+ {
116
+ ob_start(); ?>
117
+ <p>
118
+ <strong>
119
+ <?php _e('Copy the following shortcode and paste in post or page where you want to show.', 'carousel-slider'); ?>
120
+ </strong>
121
+ </p>
122
+ <p>
123
+ <pre><code>[carousel_slide id="<?php echo get_the_ID(); ?>"]</code></pre>
124
+ </p>
125
+ <hr>
126
+ <p>
127
+ <?php _e('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.', 'carousel-slider'); ?>
128
+ </p>
129
+ <p style="text-align: center;">
130
+ <a target="_blank" href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=3LZWQTHEVYWCY">
131
+ <img src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" alt="PayPal Donate">
132
+ </a>
133
+ </p>
134
+ <?php echo ob_get_clean();
135
+ }
136
+
137
+ public function metaboxs()
138
+ {
139
+ $carousel_metabox = array(
140
+ 'id' => 'metabox-carousel-slide',
141
+ 'title' => __('Images Settings', 'carousel-slider'),
142
+ 'page' => array('carousels'),
143
+ 'context' => 'normal',
144
+ 'priority' => 'high',
145
+ 'fields' => array(
146
+ array(
147
+ 'id' => '_carousel_images',
148
+ 'type' => 'images',
149
+ 'name' => __('Carousel Images', 'carousel-slider'),
150
+ 'desc' => __('Choose carousel images.', 'carousel-slider'),
151
+ ),
152
+ array(
153
+ 'id' => '_image_size',
154
+ 'type' => 'image_sizes',
155
+ 'name' => __('Carousel Image Size', 'carousel-slider'),
156
+ '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.', 'carousel-slider' ),'<a target="_blank" href="'.get_admin_url().'options-media.php">','</a>'),
157
+ ),
158
+ )
159
+ );
160
+
161
+ $general_metabox = array(
162
+ 'id' => 'carousel-slide-general_metabox',
163
+ 'title' => __('General Settings', 'carousel-slider'),
164
+ 'page' => array('carousels'),
165
+ 'context' => 'normal',
166
+ 'priority' => 'high',
167
+ 'fields' => array(
168
+ array(
169
+ 'id' => '_slide_by',
170
+ 'type' => 'text',
171
+ 'name' => __('Slide By', 'carousel-slider'),
172
+ 'desc' => __('Navigation slide by x number. Write "page" with inverted comma to slide by page. Default value is 1.', 'carousel-slider'),
173
+ 'std' => 1
174
+ ),
175
+ array(
176
+ 'id' => '_margin_right',
177
+ 'type' => 'number',
178
+ 'name' => __('Margin Right(px) on item.', 'carousel-slider'),
179
+ 'desc' => __('margin-right(px) on item. Default value is 10. Example: 20', 'carousel-slider'),
180
+ 'std' => 10
181
+ ),
182
+ array(
183
+ 'id' => '_inifnity_loop',
184
+ 'type' => 'checkbox',
185
+ 'name' => __('Inifnity loop', 'carousel-slider'),
186
+ 'label' => __('Inifnity loop.', 'carousel-slider'),
187
+ 'desc' => __('Check to show inifnity loop. Duplicate last and first items to get loop illusion', 'carousel-slider'),
188
+ 'std' => 'on'
189
+ ),
190
+ array(
191
+ 'id' => '_lazy_load_image',
192
+ 'type' => 'checkbox',
193
+ 'name' => __('Lazy load image', 'carousel-slider'),
194
+ 'label' => __('Lazy load image', 'carousel-slider'),
195
+ 'desc' => __('Check to enable image lazy load.', 'carousel-slider'),
196
+ 'std' => 'off'
197
+ ),
198
+ array(
199
+ 'id' => '_show_attachment_title',
200
+ 'type' => 'checkbox',
201
+ 'name' => __('Show Title', 'carousel-slider'),
202
+ 'label' => __('Show Title', 'carousel-slider'),
203
+ 'desc' => __('Check to show attachment title below image.', 'carousel-slider'),
204
+ 'std' => 'off'
205
+ ),
206
+ array(
207
+ 'id' => '_show_attachment_caption',
208
+ 'type' => 'checkbox',
209
+ 'name' => __('Show Caption', 'carousel-slider'),
210
+ 'label' => __('Show Caption', 'carousel-slider'),
211
+ 'desc' => __('Check to show attachment caption below image.', 'carousel-slider'),
212
+ 'std' => 'off'
213
+ ),
214
+ )
215
+ );
216
+
217
+ $navigation_metabox = array(
218
+ 'id' => 'carousel-slide-navigation_metabox',
219
+ 'title' => __('Navigation Settings', 'carousel-slider'),
220
+ 'page' => array('carousels'),
221
+ 'context' => 'normal',
222
+ 'priority' => 'high',
223
+ 'fields' => array(
224
+ array(
225
+ 'id' => '_nav_button',
226
+ 'type' => 'checkbox',
227
+ 'name' => __('Display navigation buttons', 'carousel-slider'),
228
+ 'label' => __('Display "next" and "previous" buttons', 'carousel-slider'),
229
+ 'desc' => __('Check to display "next" and "previous" buttons', 'carousel-slider'),
230
+ ),
231
+ array(
232
+ 'id' => '_dot_nav',
233
+ 'type' => 'checkbox',
234
+ 'name' => __('Show dots navigation', 'carousel-slider'),
235
+ 'label' => __('Show dots navigation.', 'carousel-slider'),
236
+ 'desc' => __('Check to show dots navigation.', 'carousel-slider'),
237
+ ),
238
+ array(
239
+ 'id' => '_nav_color',
240
+ 'type' => 'color',
241
+ 'name' => __('Navigation Color ', 'carousel-slider'),
242
+ 'desc' => __('Enter hex value of color for carousel navigation.', 'carousel-slider'),
243
+ 'std' => '#f1f1f1'
244
+ ),
245
+ array(
246
+ 'id' => '_nav_active_color',
247
+ 'type' => 'color',
248
+ 'name' => __('Navigation Color: Hover & Active', 'carousel-slider'),
249
+ 'desc' => __('Enter hex value of color for carousel navigation.', 'carousel-slider'),
250
+ 'std' => '#4caf50'
251
+ ),
252
+ ),
253
+ );
254
+
255
+ $autoplay_metabox = array(
256
+ 'id' => 'carousel-slide-autoplay_metabox',
257
+ 'title' => __('Autoplay Settings', 'carousel-slider'),
258
+ 'page' => array('carousels'),
259
+ 'context' => 'normal',
260
+ 'priority' => 'high',
261
+ 'fields' => array(
262
+ array(
263
+ 'id' => '_autoplay',
264
+ 'type' => 'checkbox',
265
+ 'name' => __('Autoplay', 'carousel-slider'),
266
+ 'label' => __('Autoplay.', 'carousel-slider'),
267
+ 'desc' => __('Check to enable autoplay', 'carousel-slider'),
268
+ 'std' => 'on'
269
+ ),
270
+ array(
271
+ 'id' => '_autoplay_timeout',
272
+ 'type' => 'number',
273
+ 'name' => __('Autoplay Timeout', 'carousel-slider'),
274
+ 'desc' => __('Autoplay interval timeout in millisecond. Default: 5000', 'carousel-slider'),
275
+ 'std' => 5000
276
+ ),
277
+
278
+ array(
279
+ 'id' => '_autoplay_speed',
280
+ 'type' => 'number',
281
+ 'name' => __('Autoplay Speed', 'carousel-slider'),
282
+ 'desc' => __('Autoplay speen in millisecond. Default: 500', 'carousel-slider'),
283
+ 'std' => 500
284
+ ),
285
+ array(
286
+ 'id' => '_autoplay_pause',
287
+ 'type' => 'checkbox',
288
+ 'name' => __('Autoplay Hover Pause', 'carousel-slider'),
289
+ 'label' => __('Pause on mouse hover.', 'carousel-slider'),
290
+ 'desc' => __('Pause autoplay on mouse hover.', 'carousel-slider'),
291
+ ),
292
+ ),
293
+ );
294
+
295
+ $responsive_metabox = array(
296
+ 'id' => 'carousel-slide-responsive_metabox',
297
+ 'title' => __('Responsive Settings', 'carousel-slider'),
298
+ 'page' => array('carousels'),
299
+ 'context' => 'normal',
300
+ 'priority' => 'high',
301
+ 'fields' => array(
302
+ array(
303
+ 'id' => '_items',
304
+ 'type' => 'number',
305
+ 'name' => __('Carousel items', 'carousel-slider'),
306
+ 'desc' => __('To set the maximum amount of items displayed at a time with the widest browser width (window >= 1200)', 'carousel-slider'),
307
+ 'std' => 4
308
+ ),
309
+ array(
310
+ 'id' => '_items_small_desktop',
311
+ 'type' => 'number',
312
+ 'name' => __('Carousel items for small desktop', 'carousel-slider'),
313
+ 'desc' => __('This allows you to preset the number of slides visible with (window >= 980) browser width.', 'carousel-slider'),
314
+ 'std' => 4
315
+ ),
316
+ array(
317
+ 'id' => '_items_portrait_tablet',
318
+ 'type' => 'number',
319
+ 'name' => __('Carousel items for portrait Tablet', 'carousel-slider'),
320
+ 'desc' => __('This allows you to preset the number of slides visible with (window >= 768) browser width.', 'carousel-slider'),
321
+ 'std' => 3
322
+ ),
323
+ array(
324
+ 'id' => '_items_small_portrait_tablet',
325
+ 'type' => 'number',
326
+ 'name' => __('Carousel items for small portrait Tablet', 'carousel-slider'),
327
+ 'desc' => __('This allows you to preset the number of slides visible with (window >= 600) browser width.', 'carousel-slider'),
328
+ 'std' => 2
329
+ ),
330
+ array(
331
+ 'id' => '_items_portrait_mobile',
332
+ 'type' => 'number',
333
+ 'name' => __('Carousel items for portrait Mobile', 'carousel-slider'),
334
+ 'desc' => __('This allows you to preset the number of slides visible with (window >= 320) browser width.', 'carousel-slider'),
335
+ 'std' => 1
336
+ ),
337
+ ),
338
+ );
339
+
340
+ new Carousel_Slider_Meta_Box( $carousel_metabox );
341
+ new Carousel_Slider_Meta_Box( $general_metabox );
342
+ new Carousel_Slider_Meta_Box( $navigation_metabox );
343
+ new Carousel_Slider_Meta_Box( $autoplay_metabox );
344
+ new Carousel_Slider_Meta_Box( $responsive_metabox );
345
+ }
346
+ }
347
+
348
+ endif;
includes/Carousel_Slider_Deactivator.php DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
-
3
- class Carousel_Slider_Deactivator {
4
-
5
- public static function deactivate() {
6
- flush_rewrite_rules();
7
- }
8
-
9
- }
 
 
 
 
 
 
 
 
 
includes/Carousel_Slider_Documentation.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // If this file is called directly, abort.
3
+ if ( ! defined( 'WPINC' ) ) {
4
+ die;
5
+ }
6
+
7
+ if ( ! class_exists('Carousel_Slider_Documentation') ):
8
+
9
+ class Carousel_Slider_Documentation
10
+ {
11
+ private $plugin_path;
12
+
13
+ public function __construct( $plugin_path )
14
+ {
15
+ $this->plugin_path = $plugin_path;
16
+ add_action( 'admin_menu', array( $this, 'admin_menu' ) );
17
+ }
18
+
19
+ public function admin_menu()
20
+ {
21
+ add_submenu_page(
22
+ 'edit.php?post_type=carousels',
23
+ 'Documentation',
24
+ 'Documentation',
25
+ 'manage_options',
26
+ 'carousel-slider-documentation',
27
+ array( $this, 'submenu_page_callback')
28
+ );
29
+ }
30
+
31
+ public function submenu_page_callback()
32
+ {
33
+ include_once $this->plugin_path . '/templates/documentation.php';
34
+ }
35
+ }
36
+
37
+ endif;
38
+
39
+ new Carousel_Slider_Documentation( $this->plugin_path );
includes/Carousel_Slider_Loader.php DELETED
@@ -1,53 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Register all actions and filters for the plugin
5
- */
6
- class Carousel_Slider_Loader {
7
-
8
- protected $actions;
9
-
10
- protected $filters;
11
-
12
- public function __construct() {
13
-
14
- $this->actions = array();
15
- $this->filters = array();
16
-
17
- }
18
-
19
- public function add_action( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) {
20
- $this->actions = $this->add( $this->actions, $hook, $component, $callback, $priority, $accepted_args );
21
- }
22
-
23
- public function add_filter( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) {
24
- $this->filters = $this->add( $this->filters, $hook, $component, $callback, $priority, $accepted_args );
25
- }
26
-
27
- private function add( $hooks, $hook, $component, $callback, $priority, $accepted_args ) {
28
-
29
- $hooks[] = array(
30
- 'hook' => $hook,
31
- 'component' => $component,
32
- 'callback' => $callback,
33
- 'priority' => $priority,
34
- 'accepted_args' => $accepted_args
35
- );
36
-
37
- return $hooks;
38
-
39
- }
40
-
41
- public function run() {
42
-
43
- foreach ( $this->filters as $hook ) {
44
- add_filter( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] );
45
- }
46
-
47
- foreach ( $this->actions as $hook ) {
48
- add_action( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] );
49
- }
50
-
51
- }
52
-
53
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/partials/MetaBox.php → includes/Carousel_Slider_Meta_Box.php RENAMED
@@ -1,471 +1,285 @@
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
- * @return string
44
- */
45
- public function meta_box_callback($post, $form_fields)
46
- {
47
- if( !is_array( $form_fields) ) return false;
48
-
49
- wp_nonce_field( basename(__FILE__), 'wpdh_meta_box_nonce' );
50
-
51
- echo '<table class="form-table">';
52
-
53
- foreach( $form_fields['args']['fields'] as $field ){
54
-
55
- $meta_id = (isset($field['id'])) ? $field['id'] : strtolower(str_replace(' ', '_', $field['name']));
56
- $meta_name = $this->fields['id'] . '_meta['.$meta_id. ']';
57
- $meta = get_post_meta( $post->ID, $meta_id, true );
58
- $std = (isset($field['std'])) ? $field['std'] : '';
59
- $value = $meta ? $meta : $std;
60
- $desc = (isset($field['desc'])) ? $field['desc'] : '';
61
- $type = (isset($field['type'])) ? $field['type'] : 'text';
62
-
63
- echo sprintf('<tr><th><label for="%1$s"><strong>%2$s</strong></label></th>', $meta_id, $field['name']);
64
-
65
- switch( $type ){
66
- case 'text':
67
- echo sprintf('<td><input type="text" name="%1$s" id="%2$s" value="%3$s" class="regular-text">',$meta_name, $meta_id, $value);
68
- break;
69
-
70
- case 'email':
71
- echo sprintf('<td><input type="email" name="%1$s" id="%2$s" value="%3$s" class="regular-text">',$meta_name, $meta_id, $value);
72
- break;
73
-
74
- case 'number':
75
- echo sprintf('<td><input type="number" name="%1$s" id="%2$s" value="%3$s" class="regular-text">',$meta_name, $meta_id, $value);
76
- break;
77
-
78
- case 'url':
79
- echo sprintf('<td><input type="url" name="%1$s" id="%2$s" value="%3$s" class="regular-text">',$meta_name, $meta_id, $value);
80
- break;
81
-
82
- case 'color':
83
- 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);
84
- break;
85
-
86
- case 'date':
87
- echo sprintf('<td><input type="text" name="%1$s" id="%2$s" value="%3$s" class="datepicker">',$meta_name, $meta_id, $value);
88
- break;
89
-
90
- case 'textarea':
91
- echo sprintf('<td><textarea name="%1$s" id="%2$s" rows="8" cols="50">%3$s</textarea>',$meta_name, $meta_id, $value);
92
- break;
93
-
94
- case 'select':
95
- echo sprintf('<td><select name="%1$s" id="%2$s">',$meta_name, $meta_id);
96
- foreach( $field['options'] as $key => $option ){
97
- $selected = ( $value == $key ) ? ' selected="selected"' : '';
98
- echo sprintf('<option value="%1$s" %3$s>%2$s</option>',$key, $option, $selected);
99
- }
100
- echo'</select>';
101
- break;
102
-
103
- case 'image_sizes':
104
- $available_img_size = get_intermediate_image_sizes();
105
- array_push($available_img_size, 'full');
106
-
107
- echo sprintf('<td><select name="%1$s" id="%2$s">',$meta_name, $meta_id);
108
- foreach( $available_img_size as $key => $option ){
109
- $selected = ( $value == $option ) ? ' selected="selected"' : '';
110
- echo sprintf('<option value="%1$s" %3$s>%2$s</option>',$option, $option, $selected);
111
- }
112
- echo'</select>';
113
- break;
114
-
115
- case 'radio':
116
- echo '<td><fieldset>';
117
- foreach( $field['options'] as $key => $option ){
118
-
119
- $checked = ( $value == $key ) ? ' checked="checked"' : '';
120
- 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);
121
- }
122
- echo '<fieldset>';
123
- break;
124
-
125
- case 'checkbox':
126
- $checked = ( $value == 'on' ) ? ' checked' : '';
127
- $label = (isset($field['label'])) ? $field['label'] : '';
128
- echo sprintf( '<input type="hidden" name="%1$s" value="off">', $meta_name );
129
- 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);
130
- break;
131
-
132
- case 'file':
133
- $multiple = ( isset( $field['multiple'] ) ) ? true : false;
134
- ?><script>
135
- jQuery(function($){
136
- var frame,
137
- isMultiple = "<?php echo $multiple; ?>";
138
-
139
- $('#<?php echo $meta_id; ?>_button').on('click', function(e) {
140
- e.preventDefault();
141
-
142
- var options = {
143
- state: 'insert',
144
- frame: 'post',
145
- multiple: isMultiple
146
- };
147
-
148
- frame = wp.media(options).open();
149
-
150
- frame.menu.get('view').unset('gallery');
151
- frame.menu.get('view').unset('featured-image');
152
-
153
- frame.toolbar.get('view').set({
154
- insert: {
155
- style: 'primary',
156
- text: '<?php _e("Insert", "wpdh"); ?>',
157
-
158
- click: function() {
159
- var models = frame.state().get('selection'),
160
- url = models.first().attributes.url,
161
- files = [];
162
-
163
- if( isMultiple ) {
164
- models.map (function( attachment ) {
165
- attachment = attachment.toJSON();
166
- files.push(attachment.url);
167
- url = files;
168
- });
169
- }
170
-
171
- $('#<?php echo $meta_id; ?>').val( url );
172
-
173
- frame.close();
174
- }
175
- }
176
- });
177
- });
178
- });
179
- </script>
180
-
181
- <?php
182
- echo sprintf('<td><input type="text" name="%1$s" id="%2$s" value="%3$s" class="regular-text">',$meta_name, $meta_id, $value);
183
- echo '<input type="button" class="button" name="'. $meta_id .'_button" id="'. $meta_id .'_button" value="Browse">';
184
- break;
185
-
186
- case 'images':
187
- $create_btn_text = 'Create Gallery';
188
- $edit_btn_text = 'Edit Gallery';
189
- $update_btn_text = 'Save Gallery';
190
- $progress_btn_text = 'Saving...';
191
- ?>
192
- <script>
193
- jQuery(function($){
194
- var frame,
195
- images = '<?php echo get_post_meta( $post->ID, '_wpdh_image_ids', true ); ?>',
196
- selection = loadImages(images);
197
-
198
- $('#wpdh_images_upload').on('click', function(e) {
199
- e.preventDefault();
200
- var options = {
201
- title: '<?php echo $create_btn_text; ?>',
202
- state: 'gallery-edit',
203
- frame: 'post',
204
- selection: selection
205
- };
206
-
207
- if( frame || selection ) {
208
- options['title'] = '<?php echo $edit_btn_text; ?>';
209
- }
210
-
211
- frame = wp.media(options).open();
212
-
213
- // Tweak Views
214
- frame.menu.get('view').unset('cancel');
215
- frame.menu.get('view').unset('separateCancel');
216
- frame.menu.get('view').get('gallery-edit').el.innerHTML = '<?php echo $edit_btn_text; ?>';
217
- frame.content.get('view').sidebar.unset('gallery'); // Hide Gallery Settings in sidebar
218
-
219
- // when editing a gallery
220
- overrideGalleryInsert();
221
- frame.on( 'toolbar:render:gallery-edit', function() {
222
- overrideGalleryInsert();
223
- });
224
-
225
- frame.on( 'content:render:browse', function( browser ) {
226
- if ( !browser ) return;
227
- // Hide Gallery Settings in sidebar
228
- browser.sidebar.on('ready', function(){
229
- browser.sidebar.unset('gallery');
230
- });
231
- // Hide filter/search as they don't work
232
- browser.toolbar.on('ready', function(){
233
- if(browser.toolbar.controller._state == 'gallery-library'){
234
- browser.toolbar.$el.hide();
235
- }
236
- });
237
- });
238
-
239
- // All images removed
240
- frame.state().get('library').on( 'remove', function() {
241
- var models = frame.state().get('library');
242
- if(models.length == 0){
243
- selection = false;
244
- $.post(ajaxurl, {
245
- ids: '',
246
- action: 'save_images',
247
- post_id: wpdh_ajax.post_id,
248
- nonce: wpdh_ajax.nonce
249
- });
250
- }
251
- });
252
-
253
- function overrideGalleryInsert(){
254
- frame.toolbar.get('view').set({
255
- insert: {
256
- style: 'primary',
257
- text: '<?php echo $update_btn_text; ?>',
258
- click: function(){
259
- var models = frame.state().get('library'),
260
- ids = '';
261
-
262
- models.each( function( attachment ) {
263
- ids += attachment.id + ','
264
- });
265
-
266
- this.el.innerHTML = '<?php echo $progress_btn_text; ?>';
267
-
268
- $.ajax({
269
- type: 'POST',
270
- url: ajaxurl,
271
- data: {
272
- ids: ids,
273
- action: 'save_images',
274
- post_id: wpdh_ajax.post_id,
275
- nonce: wpdh_ajax.nonce
276
- },
277
- success: function(){
278
- selection = loadImages(ids);
279
- $('#_wpdh_image_ids').val( ids );
280
- frame.close();
281
- },
282
- dataType: 'html'
283
- }).done( function( data ) {
284
- $('.wpdh-gallery-thumbs').html( data );
285
- console.log(data);
286
- });
287
- }
288
- }
289
- });
290
- }
291
-
292
- });
293
-
294
- function loadImages(images){
295
- if (images){
296
- var shortcode = new wp.shortcode({
297
- tag: 'gallery',
298
- attrs: { ids: images },
299
- type: 'single'
300
- });
301
-
302
- var attachments = wp.media.gallery.attachments( shortcode );
303
-
304
- var selection = new wp.media.model.Selection( attachments.models, {
305
- props: attachments.props.toJSON(),
306
- multiple: true
307
- });
308
-
309
- selection.gallery = attachments.gallery;
310
-
311
- selection.more().done( function() {
312
- // Break ties with the query.
313
- selection.props.set({ query: false });
314
- selection.unmirror();
315
- selection.props.unset('orderby');
316
- });
317
-
318
- return selection;
319
- }
320
- return false;
321
- }
322
- });
323
- </script>
324
-
325
- <?php
326
-
327
- $meta = get_post_meta( $post->ID, '_wpdh_image_ids', true );
328
- $thumbs_output = '';
329
- $button_text = ($meta) ? $edit_btn_text : $create_btn_text;
330
- if( $meta ) {
331
- $thumbs = explode(',', $meta);
332
- $thumbs_output = '';
333
- foreach( $thumbs as $thumb ) {
334
- $thumbs_output .= '<li>' . wp_get_attachment_image( $thumb, array(75,75) ) . '</li>';
335
- }
336
- }
337
-
338
- echo sprintf('<td class="wpdh-box-%s">', $type);
339
- echo sprintf('<input type="button" class="button" name="%1$s" id="wpdh_images_upload" value="%2$s">', $meta_id, $button_text);
340
- echo '<input type="hidden" name="wpdh_meta[_wpdh_image_ids]" id="_wpdh_image_ids" value="' . ($meta ? $meta : 'false') . '"><br>';
341
-
342
- echo sprintf('<div class="wpdh-gallery-thumbs"><ul>%s</ul></div>',$thumbs_output);
343
- break;
344
-
345
- default:
346
- echo sprintf('<td><input type="text" name="%1$s" id="%2$s" value="%3$s" class="regular-text">',$meta_name, $meta_id, $value);
347
- break;
348
-
349
- }
350
-
351
- if (!empty($desc)) {
352
- echo sprintf('<p class="description">%s</p>', $desc);
353
- }
354
-
355
- echo '</td></tr>';
356
-
357
- }
358
-
359
- echo '</table>';
360
-
361
- // Include inline scripts for meta box
362
- $this->inline_scripts();
363
-
364
- }
365
-
366
- /**
367
- * Save custom meta box
368
- * @method save_meta_box
369
- * @param int $post_id The post ID
370
- */
371
- public function save_meta_box( $post_id ) {
372
-
373
- if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
374
- return;
375
-
376
- $postName = $this->fields['id']. '_meta';
377
-
378
- if ( !isset($_POST[$postName]) || !isset($_POST['wpdh_meta_box_nonce']) || !wp_verify_nonce( $_POST['wpdh_meta_box_nonce'], basename( __FILE__ ) ) )
379
- return;
380
-
381
- if ( 'page' == $_POST['post_type'] ) {
382
- if ( !current_user_can( 'edit_page', $post_id ) ) return;
383
- } else {
384
- if ( !current_user_can( 'edit_post', $post_id ) ) return;
385
- }
386
-
387
- foreach( $_POST[$postName] as $key => $val ){
388
- update_post_meta( $post_id, $key, stripslashes(htmlspecialchars($val)) );
389
- }
390
- }
391
-
392
- /**
393
- * Save images
394
- * @method save_images
395
- */
396
- public function save_images(){
397
- if( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ){
398
- return;
399
- }
400
-
401
- if ( !isset($_POST['ids']) || !isset($_POST['nonce']) || !wp_verify_nonce( $_POST['nonce'], 'wpdh-ajax' ) ){
402
- return;
403
- }
404
-
405
- if ( !current_user_can( 'edit_posts' ) ) return;
406
-
407
- $ids = strip_tags(rtrim($_POST['ids'], ','));
408
- update_post_meta($_POST['post_id'], '_wpdh_image_ids', $ids);
409
-
410
- $thumbs = explode(',', $ids);
411
- $thumbs_output = '';
412
- foreach( $thumbs as $thumb ) {
413
- $thumbs_output .= '<li>' . wp_get_attachment_image( $thumb, array(75,75) ) . '</li>';
414
- }
415
-
416
- echo $thumbs_output;
417
-
418
- die();
419
- }
420
-
421
- /**
422
- * Enqueue admin scripts for meta box
423
- * @method metabox_scripts
424
- */
425
- public function metabox_scripts(){
426
-
427
- wp_enqueue_media();
428
- wp_enqueue_style( 'wp-color-picker' );
429
- wp_enqueue_script( 'wp-color-picker' );
430
- wp_enqueue_script( 'jquery-ui-datepicker' );
431
-
432
- global $post;
433
- if( isset($post) ) {
434
- wp_localize_script( 'jquery', 'wpdh_ajax', array(
435
- 'post_id' => $post->ID,
436
- 'nonce' => wp_create_nonce( 'wpdh-ajax' )
437
- ) );
438
- }
439
- }
440
-
441
- /**
442
- * Add inline script for color and date field
443
- * @method inline_scripts
444
- */
445
- public function inline_scripts()
446
- {
447
- ?><script type="text/javascript">
448
- jQuery(document).ready(function($){
449
- $('.colorpicker').wpColorPicker();
450
- $( ".datepicker" ).datepicker({
451
- changeMonth: true,
452
- changeYear: true
453
- });
454
- });
455
- </script><?php
456
- }
457
-
458
- /**
459
- * Add inline style for admin screen
460
- * @method admin_head
461
- */
462
- public function admin_head()
463
- {
464
- $style = '<style>';
465
- $style .= '.wpdh-gallery-thumbs{display: block; clear: both;}';
466
- $style .= '.wpdh-gallery-thumbs li {display: inline-block;margin-right: 10px;margin-bottom: 10px;}';
467
- $style .= '</style>';
468
- echo $style;
469
- }
470
-
471
- }
1
+ <?php
2
+ // If this file is called directly, abort.
3
+ if ( ! defined( 'WPINC' ) ) {
4
+ die;
5
+ }
6
+
7
+ if ( ! class_exists('Carousel_Slider_Meta_Box') ):
8
+
9
+ class Carousel_Slider_Meta_Box {
10
+
11
+ private $fields;
12
+
13
+ public function __construct($fields){
14
+ $this->fields = $fields;
15
+ add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ), 15 );
16
+ add_action( 'save_post', array( $this, 'save_meta_box' ) );
17
+ add_action( 'wp_ajax_save_images', array( $this, 'save_images' ) );
18
+ }
19
+
20
+ /**
21
+ * Add a custom meta box
22
+ *
23
+ * @method add_meta_boxes
24
+ */
25
+ public function add_meta_boxes()
26
+ {
27
+ if( !is_array( $this->fields ) ) return false;
28
+ add_meta_box(
29
+ $this->fields['id'],
30
+ $this->fields['title'],
31
+ array( $this, 'meta_box_callback' ),
32
+ $this->fields['page'],
33
+ $this->fields['context'],
34
+ $this->fields['priority'],
35
+ $this->fields
36
+ );
37
+ }
38
+
39
+
40
+ /**
41
+ * Prints out the HTML for the edit screen section.
42
+ * @method meta_box_callback
43
+ * @param string $post name of post type
44
+ * @param array $form_fields Arguments to pass into your callback function.
45
+ *
46
+ * @return string
47
+ */
48
+ public function meta_box_callback($post, $form_fields)
49
+ {
50
+ if( !is_array( $form_fields) ) return false;
51
+
52
+ wp_nonce_field( basename(__FILE__), 'wpdh_meta_box_nonce' );
53
+
54
+ echo '<table class="form-table">';
55
+
56
+ foreach( $form_fields['args']['fields'] as $field ){
57
+
58
+ $meta_id = (isset($field['id'])) ? $field['id'] : strtolower(str_replace(' ', '_', $field['name']));
59
+ $meta_name = $this->fields['id'] . '_meta['.$meta_id. ']';
60
+ $meta = get_post_meta( $post->ID, $meta_id, true );
61
+ $std = (isset($field['std'])) ? $field['std'] : '';
62
+ $value = $meta ? $meta : $std;
63
+ $desc = (isset($field['desc'])) ? $field['desc'] : '';
64
+ $type = (isset($field['type'])) ? $field['type'] : 'text';
65
+
66
+ echo sprintf('<tr><th><label for="%1$s"><strong>%2$s</strong></label></th>', $meta_id, $field['name']);
67
+
68
+ switch( $type ){
69
+ case 'text':
70
+ echo sprintf('<td><input type="text" name="%1$s" id="%2$s" value="%3$s" class="regular-text">',$meta_name, $meta_id, $value);
71
+ break;
72
+
73
+ case 'email':
74
+ echo sprintf('<td><input type="email" name="%1$s" id="%2$s" value="%3$s" class="regular-text">',$meta_name, $meta_id, $value);
75
+ break;
76
+
77
+ case 'number':
78
+ echo sprintf('<td><input type="number" name="%1$s" id="%2$s" value="%3$s" class="regular-text">',$meta_name, $meta_id, $value);
79
+ break;
80
+
81
+ case 'url':
82
+ echo sprintf('<td><input type="url" name="%1$s" id="%2$s" value="%3$s" class="regular-text">',$meta_name, $meta_id, $value);
83
+ break;
84
+
85
+ case 'color':
86
+ 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);
87
+ break;
88
+
89
+ case 'date':
90
+ echo sprintf('<td><input type="text" name="%1$s" id="%2$s" value="%3$s" class="datepicker">',$meta_name, $meta_id, $value);
91
+ break;
92
+
93
+ case 'textarea':
94
+ echo sprintf('<td><textarea name="%1$s" id="%2$s" rows="8" cols="50">%3$s</textarea>',$meta_name, $meta_id, $value);
95
+ break;
96
+
97
+ case 'select':
98
+ echo sprintf('<td><select name="%1$s" id="%2$s">',$meta_name, $meta_id);
99
+ foreach( $field['options'] as $key => $option ){
100
+ $selected = ( $value == $key ) ? ' selected="selected"' : '';
101
+ echo sprintf('<option value="%1$s" %3$s>%2$s</option>',$key, $option, $selected);
102
+ }
103
+ echo'</select>';
104
+ break;
105
+
106
+ case 'image_sizes':
107
+ $available_img_size = get_intermediate_image_sizes();
108
+ array_push($available_img_size, 'full');
109
+
110
+ echo sprintf('<td><select name="%1$s" id="%2$s">',$meta_name, $meta_id);
111
+ foreach( $available_img_size as $key => $option ){
112
+ $selected = ( $value == $option ) ? ' selected="selected"' : '';
113
+ echo sprintf('<option value="%1$s" %3$s>%2$s</option>',$option, $option, $selected);
114
+ }
115
+ echo'</select>';
116
+ break;
117
+
118
+ case 'radio':
119
+ echo '<td><fieldset>';
120
+ foreach( $field['options'] as $key => $option ){
121
+
122
+ $checked = ( $value == $key ) ? ' checked="checked"' : '';
123
+ 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);
124
+ }
125
+ echo '<fieldset>';
126
+ break;
127
+
128
+ case 'checkbox':
129
+ $checked = ( $value == 'on' ) ? ' checked' : '';
130
+ $label = (isset($field['label'])) ? $field['label'] : '';
131
+ echo sprintf( '<input type="hidden" name="%1$s" value="off">', $meta_name );
132
+ 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);
133
+ break;
134
+
135
+ case 'file':
136
+ $multiple = ( isset( $field['multiple'] ) ) ? true : false;
137
+ ?><script>
138
+ jQuery(function($){
139
+ var frame,
140
+ isMultiple = "<?php echo $multiple; ?>";
141
+
142
+ $('#<?php echo $meta_id; ?>_button').on('click', function(e) {
143
+ e.preventDefault();
144
+
145
+ var options = {
146
+ state: 'insert',
147
+ frame: 'post',
148
+ multiple: isMultiple
149
+ };
150
+
151
+ frame = wp.media(options).open();
152
+
153
+ frame.menu.get('view').unset('gallery');
154
+ frame.menu.get('view').unset('featured-image');
155
+
156
+ frame.toolbar.get('view').set({
157
+ insert: {
158
+ style: 'primary',
159
+ text: '<?php _e("Insert", "wpdh"); ?>',
160
+
161
+ click: function() {
162
+ var models = frame.state().get('selection'),
163
+ url = models.first().attributes.url,
164
+ files = [];
165
+
166
+ if( isMultiple ) {
167
+ models.map (function( attachment ) {
168
+ attachment = attachment.toJSON();
169
+ files.push(attachment.url);
170
+ url = files;
171
+ });
172
+ }
173
+
174
+ $('#<?php echo $meta_id; ?>').val( url );
175
+
176
+ frame.close();
177
+ }
178
+ }
179
+ });
180
+ });
181
+ });
182
+ </script>
183
+
184
+ <?php
185
+ echo sprintf('<td><input type="text" name="%1$s" id="%2$s" value="%3$s" class="regular-text">',$meta_name, $meta_id, $value);
186
+ echo '<input type="button" class="button" name="'. $meta_id .'_button" id="'. $meta_id .'_button" value="Browse">';
187
+ break;
188
+
189
+ case 'images':
190
+ $create_btn_text = 'Create Gallery';
191
+ $edit_btn_text = 'Edit Gallery';
192
+
193
+ $meta = get_post_meta( $post->ID, '_wpdh_image_ids', true );
194
+ $thumbs_output = '';
195
+ $button_text = ($meta) ? $edit_btn_text : $create_btn_text;
196
+ if( $meta ) {
197
+ $thumbs = explode(',', $meta);
198
+ $thumbs_output = '';
199
+ foreach( $thumbs as $thumb ) {
200
+ $thumbs_output .= '<li>' . wp_get_attachment_image( $thumb, array(75,75) ) . '</li>';
201
+ }
202
+ }
203
+
204
+ echo sprintf('<td class="wpdh-box-%s">', $type);
205
+ echo sprintf('<input type="button" class="button" name="%1$s" id="wpdh_images_upload" value="%2$s">', $meta_id, $button_text);
206
+ echo '<input type="hidden" name="wpdh_meta[_wpdh_image_ids]" id="_wpdh_image_ids" value="' . ($meta ? $meta : 'false') . '"><br>';
207
+
208
+ echo sprintf('<div class="wpdh-gallery-thumbs"><ul>%s</ul></div>',$thumbs_output);
209
+ break;
210
+
211
+ default:
212
+ echo sprintf('<td><input type="text" name="%1$s" id="%2$s" value="%3$s" class="regular-text">',$meta_name, $meta_id, $value);
213
+ break;
214
+
215
+ }
216
+
217
+ if (!empty($desc)) {
218
+ echo sprintf('<p class="description">%s</p>', $desc);
219
+ }
220
+
221
+ echo '</td></tr>';
222
+
223
+ }
224
+
225
+ echo '</table>';
226
+
227
+ }
228
+
229
+ /**
230
+ * Save custom meta box
231
+ * @method save_meta_box
232
+ * @param int $post_id The post ID
233
+ */
234
+ public function save_meta_box( $post_id ) {
235
+
236
+ if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
237
+ return;
238
+
239
+ $postName = $this->fields['id']. '_meta';
240
+
241
+ if ( !isset($_POST[$postName]) || !isset($_POST['wpdh_meta_box_nonce']) || !wp_verify_nonce( $_POST['wpdh_meta_box_nonce'], basename( __FILE__ ) ) )
242
+ return;
243
+
244
+ if ( 'page' == $_POST['post_type'] ) {
245
+ if ( !current_user_can( 'edit_page', $post_id ) ) return;
246
+ } else {
247
+ if ( !current_user_can( 'edit_post', $post_id ) ) return;
248
+ }
249
+
250
+ foreach( $_POST[$postName] as $key => $val ){
251
+ update_post_meta( $post_id, $key, sanitize_text_field( $val ) );
252
+ }
253
+ }
254
+
255
+ /**
256
+ * Save images
257
+ * @method save_images
258
+ */
259
+ public function save_images(){
260
+ if( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ){
261
+ return;
262
+ }
263
+
264
+ if ( !isset($_POST['ids']) || !isset($_POST['nonce']) || !wp_verify_nonce( $_POST['nonce'], 'wpdh-ajax' ) ){
265
+ return;
266
+ }
267
+
268
+ if ( !current_user_can( 'edit_posts' ) ) return;
269
+
270
+ $ids = strip_tags(rtrim($_POST['ids'], ','));
271
+ update_post_meta($_POST['post_id'], '_wpdh_image_ids', $ids);
272
+
273
+ $thumbs = explode(',', $ids);
274
+ $thumbs_output = '';
275
+ foreach( $thumbs as $thumb ) {
276
+ $thumbs_output .= '<li>' . wp_get_attachment_image( $thumb, array(75,75) ) . '</li>';
277
+ }
278
+
279
+ echo $thumbs_output;
280
+
281
+ die();
282
+ }
283
+
284
+ }
285
+ endif;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/Carousel_Slider_VC_Element.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // If this file is called directly, abort.
3
+ if ( ! defined( 'WPINC' ) ) {
4
+ die;
5
+ }
6
+
7
+ if( ! class_exists('Carousel_Slider_VC_Element') ):
8
+
9
+ class Carousel_Slider_VC_Element
10
+ {
11
+ public function __construct() {
12
+ // We safely integrate with VC with this hook
13
+ add_action( 'init', array( $this, 'integrateWithVC' ) );
14
+ }
15
+
16
+ public function integrateWithVC() {
17
+ // Check if Visual Composer is installed
18
+ if ( ! defined( 'WPB_VC_VERSION' ) ) {
19
+ return;
20
+ }
21
+
22
+ vc_map( array(
23
+ "name" => __("Carousel Slider", 'carousel-slider'),
24
+ "description" => __("Place Carousel Slider.", 'carousel-slider'),
25
+ "base" => "carousel_slide",
26
+ "controls" => "full",
27
+ "icon" => plugins_url('assets/img/icon-images.svg', dirname(__FILE__)),
28
+ "category" => __('Content', 'carousel-slider'),
29
+ "params" => array(
30
+ array(
31
+ "type" => "textfield",
32
+ "holder" => "div",
33
+ "class" => "",
34
+ "param_name" => "id",
35
+ "heading" => __("Carousel Slide ID", 'carousel-slider'),
36
+ "description" => sprintf(__("Place carousel slide id here. %s to go Carousels page", 'carousel-slider'), '<a href="'. admin_url('edit.php?post_type=carousels') .'" target="_blank">' . __('Click here', 'carousel-slider') . '</a>'),
37
+ ),
38
+ ),
39
+ ));
40
+ }
41
+ }
42
+
43
+ endif;
44
+ new Carousel_Slider_VC_Element;
includes/Carousel_Slider_i18n.php DELETED
@@ -1,27 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Define the internationalization functionality
5
- *
6
- * Loads and defines the internationalization files for this plugin
7
- * so that it is ready for translation.
8
- */
9
- class Carousel_Slider_i18n {
10
-
11
- private $domain;
12
-
13
- public function load_plugin_textdomain() {
14
-
15
- load_plugin_textdomain(
16
- $this->domain,
17
- false,
18
- dirname( dirname( plugin_basename( __FILE__ ) ) ) . '/languages/'
19
- );
20
-
21
- }
22
-
23
- public function set_domain( $domain ) {
24
- $this->domain = $domain;
25
- }
26
-
27
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/index.php CHANGED
File without changes
index.php CHANGED
File without changes
languages/carousel-slider.pot CHANGED
@@ -1,293 +1,318 @@
1
  # Copyright (C) 2014
2
  # This file is distributed under the same license as the package.
 
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: \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-MO-DA HO:MI+ZONE\n"
12
- "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
- "Language-Team: LANGUAGE <LL@li.org>\n"
 
 
14
 
15
- #: carousel-img-type.php:6
16
  msgctxt "Post Type General Name"
17
  msgid "Carousels"
18
  msgstr ""
19
 
20
- #: carousel-img-type.php:7
21
  msgctxt "Post Type Singular Name"
22
  msgid "Carousel"
23
  msgstr ""
24
 
25
- #: carousel-img-type.php:8
26
  msgid "Carousels"
27
  msgstr ""
28
 
29
- #: carousel-img-type.php:9
30
  msgid "Parent Carousel:"
31
  msgstr ""
32
 
33
- #: carousel-img-type.php:10
34
  msgid "All Carousels"
35
  msgstr ""
36
 
37
- #: carousel-img-type.php:11
38
  msgid "View Carousel"
39
  msgstr ""
40
 
41
- #: carousel-img-type.php:12
42
  msgid "Add New Carousel"
43
  msgstr ""
44
 
45
- #: carousel-img-type.php:13
46
  msgid "Add New"
47
  msgstr ""
48
 
49
- #: carousel-img-type.php:14
50
  msgid "Edit Carousel"
51
  msgstr ""
52
 
53
- #: carousel-img-type.php:15
54
  msgid "Update Carousel"
55
  msgstr ""
56
 
57
- #: carousel-img-type.php:16
58
  msgid "Search Carousel"
59
  msgstr ""
60
 
61
- #: carousel-img-type.php:17
62
  msgid "Not found"
63
  msgstr ""
64
 
65
- #: carousel-img-type.php:18
66
  msgid "Not found in Trash"
67
  msgstr ""
68
 
69
- #: carousel-img-type.php:27 carousel-img-type.php:28
70
  msgid "Carousel"
71
  msgstr ""
72
 
73
- #: carousel-img-type.php:57
74
- msgid "Upload Carousel Image"
75
  msgstr ""
76
 
77
- #: carousel-options.php:3 carousel.php:81
78
- msgid "Carousel Settings"
79
  msgstr ""
80
 
81
- #: carousel-options.php:13
82
- msgid "Maximum Items"
83
  msgstr ""
84
 
85
- #: carousel-options.php:17
 
 
 
 
 
 
 
 
 
 
86
  msgid ""
87
- "This variable allows you to set the maximum amount of items displayed at a "
88
- "time with the widest browser width &#40;window &gt;= 1200&#41;"
 
 
 
 
 
 
 
 
 
89
  msgstr ""
90
 
91
- #: carousel-options.php:22
92
- msgid "Items Desktop"
93
  msgstr ""
94
 
95
- #: carousel-options.php:26
 
96
  msgid ""
97
- "This allows you to preset the number of slides visible with &#40;window &lt;"
98
- "= 1199&#41; browser width"
 
99
  msgstr ""
100
 
101
- #: carousel-options.php:31
102
- msgid "Items Desktop Small"
103
  msgstr ""
104
 
105
- #: carousel-options.php:35
106
  msgid ""
107
- "This allows you to preset the number of slides visible with &#40;window &lt;"
108
- "= 979&#41; browser width"
109
  msgstr ""
110
 
111
- #: carousel-options.php:40
112
- msgid "Items Tablet"
113
  msgstr ""
114
 
115
- #: carousel-options.php:44
116
  msgid ""
117
- "This allows you to preset the number of slides visible with &#40;window &lt;"
118
- "= 768&#41; browser width"
119
  msgstr ""
120
 
121
- #: carousel-options.php:49
122
- msgid "Items Mobile"
123
  msgstr ""
124
 
125
- #: carousel-options.php:53
126
  msgid ""
127
- "This allows you to preset the number of slides visible with &#40;window &lt;"
128
- "= 479&#41; browser width"
129
  msgstr ""
130
 
131
- #: carousel-options.php:58
132
- msgid "Single Item"
133
  msgstr ""
134
 
135
- #: carousel-options.php:61 carousel-options.php:121 carousel-options.php:131
136
- #: carousel-options.php:159 carousel-options.php:169 carousel-options.php:188
137
- msgid "NO"
 
138
  msgstr ""
139
 
140
- #: carousel-options.php:62 carousel-options.php:122 carousel-options.php:132
141
- #: carousel-options.php:160 carousel-options.php:170 carousel-options.php:189
142
- msgid "Yes"
143
  msgstr ""
144
 
145
- #: carousel-options.php:63
146
  msgid ""
147
- "If you select \"Yes\", it will display only one item and top five options "
148
- "will be automatically stopped."
149
  msgstr ""
150
 
151
- #: carousel-options.php:68
152
- msgid "Transition Style"
153
  msgstr ""
154
 
155
- #: carousel-options.php:72
156
- msgid "fade"
 
 
157
  msgstr ""
158
 
159
- #: carousel-options.php:73
160
- msgid "backSlide"
161
  msgstr ""
162
 
163
- #: carousel-options.php:74
164
- msgid "goDown"
165
  msgstr ""
166
 
167
- #: carousel-options.php:75
168
- msgid "scaleUp"
169
  msgstr ""
170
 
171
- #: carousel-options.php:77
172
- msgid ""
173
- "Transition style works only in modern browsers that support CSS3 translate3d "
174
- "methods and only with single item on screen."
175
  msgstr ""
176
 
177
- #: carousel-options.php:82
178
- msgid "Slide Speed"
179
  msgstr ""
180
 
181
- #: carousel-options.php:86
182
- msgid ""
183
- "Slide speed in milliseconds. Default speed is &lsquo;200&rsquo; milliseconds."
184
  msgstr ""
185
 
186
- #: carousel-options.php:91
187
- msgid "Pagination Speed"
188
  msgstr ""
189
 
190
- #: carousel-options.php:95
191
- msgid ""
192
- "Pagination speed in milliseconds. Default speed is &lsquo;800&rsquo; "
193
- "milliseconds."
194
  msgstr ""
195
 
196
- #: carousel-options.php:100
197
- msgid "Rewind Speed"
198
  msgstr ""
199
 
200
- #: carousel-options.php:104
 
 
 
 
201
  msgid ""
202
- "Rewind speed in milliseconds. Default speed is &lsquo;1000&rsquo; "
203
- "milliseconds."
204
  msgstr ""
205
 
206
- #: carousel-options.php:109
207
- msgid "AutoPlay"
208
  msgstr ""
209
 
210
- #: carousel-options.php:113
211
- msgid ""
212
- "Change to any integrer for example &lsquo;autoPlay : 5000&rsquo; to play "
213
- "every 5 seconds. If you set &lsquo;autoPlay: true&rsquo; default speed will "
214
- "be 5 seconds."
215
  msgstr ""
216
 
217
- #: carousel-options.php:118
218
- msgid "Stop On Hover"
219
  msgstr ""
220
 
221
- #: carousel-options.php:123
222
- msgid "Stop autoplay on mouse hover."
223
  msgstr ""
224
 
225
- #: carousel-options.php:128
226
- msgid "Navigation"
227
  msgstr ""
228
 
229
- #: carousel-options.php:133
230
- msgid "Display &lsquo;next&rsquo; and &lsquo;prev&rsquo; buttons."
231
  msgstr ""
232
 
233
- #: carousel-options.php:138
234
- msgid "Navigation Color"
235
  msgstr ""
236
 
237
- #: carousel-options.php:142
238
- msgid "Choose color for Navigation Background."
239
  msgstr ""
240
 
241
- #: carousel-options.php:147
242
- msgid "Navigation Arrow Color"
243
  msgstr ""
244
 
245
- #: carousel-options.php:151
246
- msgid "Choose color for Navigation Arrow."
247
  msgstr ""
248
 
249
- #: carousel-options.php:156
250
- msgid "Scroll Per Page"
251
  msgstr ""
252
 
253
- #: carousel-options.php:161
254
- msgid ""
255
- "Scroll per page not per item. This affect next/prev buttons and mouse/touch "
256
- "dragging."
257
  msgstr ""
258
 
259
- #: carousel-options.php:166
260
- msgid "Pagination"
261
  msgstr ""
262
 
263
- #: carousel-options.php:171
264
- msgid "Show pagination."
265
  msgstr ""
266
 
267
- #: carousel-options.php:176
268
- msgid "Pagination Color"
269
  msgstr ""
270
 
271
- #: carousel-options.php:180
272
- msgid "Choose color for Pagination Background."
273
  msgstr ""
274
 
275
- #: carousel-options.php:185
276
- msgid "Pagination Numbers"
277
  msgstr ""
278
 
279
- #: carousel-options.php:190
280
- msgid "Show numbers inside pagination buttons"
281
  msgstr ""
282
 
283
- #: carousel-options.php:195
284
- msgid "Pagination Number Color"
 
285
  msgstr ""
286
 
287
- #: carousel-options.php:199
288
- msgid "Choose color for Pagination Number."
289
  msgstr ""
290
 
291
- #: carousel-options.php:204
292
- msgid "Save Changes"
293
  msgstr ""
1
  # Copyright (C) 2014
2
  # This file is distributed under the same license as the package.
3
+ #, fuzzy
4
  msgid ""
5
  msgstr ""
6
+ "Project-Id-Version: Carousel Slider 1.5.2\n"
7
+ "POT-Creation-Date: 2016-12-03 09:56+0600\n"
8
+ "PO-Revision-Date: 2016-11-14 12:48+0600\n"
9
+ "Last-Translator: \n"
10
+ "Language-Team: Sayful Islam <sayful.islam001@gmail.com>\n"
11
+ "Language: en\n"
12
  "MIME-Version: 1.0\n"
13
  "Content-Type: text/plain; charset=UTF-8\n"
14
  "Content-Transfer-Encoding: 8bit\n"
15
+ "X-Generator: Poedit 1.8.7.1\n"
16
+ "X-Poedit-Basepath: ..\n"
17
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
18
+ "X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c\n"
19
+ "X-Poedit-SearchPath-0: .\n"
20
 
21
+ #: includes/Carousel_Slider_Admin.php:22
22
  msgctxt "Post Type General Name"
23
  msgid "Carousels"
24
  msgstr ""
25
 
26
+ #: includes/Carousel_Slider_Admin.php:23
27
  msgctxt "Post Type Singular Name"
28
  msgid "Carousel"
29
  msgstr ""
30
 
31
+ #: includes/Carousel_Slider_Admin.php:24
32
  msgid "Carousels"
33
  msgstr ""
34
 
35
+ #: includes/Carousel_Slider_Admin.php:25
36
  msgid "Parent Carousel:"
37
  msgstr ""
38
 
39
+ #: includes/Carousel_Slider_Admin.php:26
40
  msgid "All Carousels"
41
  msgstr ""
42
 
43
+ #: includes/Carousel_Slider_Admin.php:27
44
  msgid "View Carousel"
45
  msgstr ""
46
 
47
+ #: includes/Carousel_Slider_Admin.php:28
48
  msgid "Add New Carousel"
49
  msgstr ""
50
 
51
+ #: includes/Carousel_Slider_Admin.php:29
52
  msgid "Add New"
53
  msgstr ""
54
 
55
+ #: includes/Carousel_Slider_Admin.php:30
56
  msgid "Edit Carousel"
57
  msgstr ""
58
 
59
+ #: includes/Carousel_Slider_Admin.php:31
60
  msgid "Update Carousel"
61
  msgstr ""
62
 
63
+ #: includes/Carousel_Slider_Admin.php:32
64
  msgid "Search Carousel"
65
  msgstr ""
66
 
67
+ #: includes/Carousel_Slider_Admin.php:33
68
  msgid "Not found"
69
  msgstr ""
70
 
71
+ #: includes/Carousel_Slider_Admin.php:34
72
  msgid "Not found in Trash"
73
  msgstr ""
74
 
75
+ #: includes/Carousel_Slider_Admin.php:37 includes/Carousel_Slider_Admin.php:38
76
  msgid "Carousel"
77
  msgstr ""
78
 
79
+ #: includes/Carousel_Slider_Admin.php:63
80
+ msgid "Carousel Slide Title"
81
  msgstr ""
82
 
83
+ #: includes/Carousel_Slider_Admin.php:64
84
+ msgid "Shortcode"
85
  msgstr ""
86
 
87
+ #: includes/Carousel_Slider_Admin.php:65 includes/Carousel_Slider_Admin.php:149
88
+ msgid "Carousel Images"
89
  msgstr ""
90
 
91
+ #: includes/Carousel_Slider_Admin.php:106
92
+ msgid "Usage (Shortcode)"
93
+ msgstr ""
94
+
95
+ #: includes/Carousel_Slider_Admin.php:119
96
+ msgid ""
97
+ "Copy the following shortcode and paste in post or page where you want to "
98
+ "show."
99
+ msgstr ""
100
+
101
+ #: includes/Carousel_Slider_Admin.php:127
102
  msgid ""
103
+ "If you like this plugin or if you make money using this or if you want to "
104
+ "help me to continue my contribution on open source projects, consider to "
105
+ "make a small donation."
106
+ msgstr ""
107
+
108
+ #: includes/Carousel_Slider_Admin.php:141
109
+ msgid "Carousel Slider Settings"
110
+ msgstr ""
111
+
112
+ #: includes/Carousel_Slider_Admin.php:150
113
+ msgid "Choose carousel images."
114
  msgstr ""
115
 
116
+ #: includes/Carousel_Slider_Admin.php:155
117
+ msgid "Carousel Image Size"
118
  msgstr ""
119
 
120
+ #: includes/Carousel_Slider_Admin.php:156
121
+ #, php-format
122
  msgid ""
123
+ "Select \"full\" for full size image or your desired image size for carousel "
124
+ "image. You can change the default size for thumbnail, medium and large from "
125
+ "%1$s Settings >> Media %2$s."
126
  msgstr ""
127
 
128
+ #: includes/Carousel_Slider_Admin.php:161
129
+ msgid "Carousel items"
130
  msgstr ""
131
 
132
+ #: includes/Carousel_Slider_Admin.php:162
133
  msgid ""
134
+ "To set the maximum amount of items displayed at a time with the widest "
135
+ "browser width (window >= 1200)"
136
  msgstr ""
137
 
138
+ #: includes/Carousel_Slider_Admin.php:168
139
+ msgid "Carousel items for small desktop"
140
  msgstr ""
141
 
142
+ #: includes/Carousel_Slider_Admin.php:169
143
  msgid ""
144
+ "This allows you to preset the number of slides visible with (window >= 980) "
145
+ "browser width."
146
  msgstr ""
147
 
148
+ #: includes/Carousel_Slider_Admin.php:175
149
+ msgid "Carousel items for portrait Tablet"
150
  msgstr ""
151
 
152
+ #: includes/Carousel_Slider_Admin.php:176
153
  msgid ""
154
+ "This allows you to preset the number of slides visible with (window >= 768) "
155
+ "browser width."
156
  msgstr ""
157
 
158
+ #: includes/Carousel_Slider_Admin.php:182
159
+ msgid "Carousel items for small portrait Tablet"
160
  msgstr ""
161
 
162
+ #: includes/Carousel_Slider_Admin.php:183
163
+ msgid ""
164
+ "This allows you to preset the number of slides visible with (window >= 600) "
165
+ "browser width."
166
  msgstr ""
167
 
168
+ #: includes/Carousel_Slider_Admin.php:189
169
+ msgid "Carousel items for portrait Mobile"
 
170
  msgstr ""
171
 
172
+ #: includes/Carousel_Slider_Admin.php:190
173
  msgid ""
174
+ "This allows you to preset the number of slides visible with (window >= 320) "
175
+ "browser width."
176
  msgstr ""
177
 
178
+ #: includes/Carousel_Slider_Admin.php:196
179
+ msgid "Slide By"
180
  msgstr ""
181
 
182
+ #: includes/Carousel_Slider_Admin.php:197
183
+ msgid ""
184
+ "Navigation slide by x number. Write \"page\" with inverted comma to slide by "
185
+ "page. Default value is 1."
186
  msgstr ""
187
 
188
+ #: includes/Carousel_Slider_Admin.php:203
189
+ msgid "Margin Right(px) on item."
190
  msgstr ""
191
 
192
+ #: includes/Carousel_Slider_Admin.php:204
193
+ msgid "margin-right(px) on item. Default value is 10. Example: 20"
194
  msgstr ""
195
 
196
+ #: includes/Carousel_Slider_Admin.php:210
197
+ msgid "Display navigation buttons"
198
  msgstr ""
199
 
200
+ #: includes/Carousel_Slider_Admin.php:211
201
+ msgid "Display \"next\" and \"previous\" buttons"
 
 
202
  msgstr ""
203
 
204
+ #: includes/Carousel_Slider_Admin.php:212
205
+ msgid "Check to display \"next\" and \"previous\" buttons"
206
  msgstr ""
207
 
208
+ #: includes/Carousel_Slider_Admin.php:217
209
+ msgid "Show dots navigation"
 
210
  msgstr ""
211
 
212
+ #: includes/Carousel_Slider_Admin.php:218
213
+ msgid "Show dots navigation."
214
  msgstr ""
215
 
216
+ #: includes/Carousel_Slider_Admin.php:219
217
+ msgid "Check to show dots navigation."
 
 
218
  msgstr ""
219
 
220
+ #: includes/Carousel_Slider_Admin.php:224
221
+ msgid "Inifnity loop"
222
  msgstr ""
223
 
224
+ #: includes/Carousel_Slider_Admin.php:225
225
+ msgid "Inifnity loop."
226
+ msgstr ""
227
+
228
+ #: includes/Carousel_Slider_Admin.php:226
229
  msgid ""
230
+ "Check to show inifnity loop. Duplicate last and first items to get loop "
231
+ "illusion"
232
  msgstr ""
233
 
234
+ #: includes/Carousel_Slider_Admin.php:232
235
+ msgid "Autoplay"
236
  msgstr ""
237
 
238
+ #: includes/Carousel_Slider_Admin.php:233
239
+ msgid "Autoplay."
 
 
 
240
  msgstr ""
241
 
242
+ #: includes/Carousel_Slider_Admin.php:234
243
+ msgid "Check to enable autoplay"
244
  msgstr ""
245
 
246
+ #: includes/Carousel_Slider_Admin.php:240
247
+ msgid "Autoplay Timeout"
248
  msgstr ""
249
 
250
+ #: includes/Carousel_Slider_Admin.php:241
251
+ msgid "Autoplay interval timeout in millisecond. Default: 5000"
252
  msgstr ""
253
 
254
+ #: includes/Carousel_Slider_Admin.php:248
255
+ msgid "Autoplay Speed"
256
  msgstr ""
257
 
258
+ #: includes/Carousel_Slider_Admin.php:249
259
+ msgid "Autoplay speen in millisecond. Default: 500"
260
  msgstr ""
261
 
262
+ #: includes/Carousel_Slider_Admin.php:255
263
+ msgid "Autoplay Hover Pause"
264
  msgstr ""
265
 
266
+ #: includes/Carousel_Slider_Admin.php:256
267
+ msgid "Pause on mouse hover."
268
  msgstr ""
269
 
270
+ #: includes/Carousel_Slider_Admin.php:257
271
+ msgid "Pause autoplay on mouse hover."
272
  msgstr ""
273
 
274
+ #: includes/Carousel_Slider_Admin.php:262
275
+ msgid "Navigation Color\t"
276
  msgstr ""
277
 
278
+ #: includes/Carousel_Slider_Admin.php:263
279
+ #: includes/Carousel_Slider_Admin.php:271
280
+ msgid "Enter hex value of color for carousel navigation."
 
281
  msgstr ""
282
 
283
+ #: includes/Carousel_Slider_Admin.php:270
284
+ msgid "Navigation Color: Hover & Active"
285
  msgstr ""
286
 
287
+ #: includes/Carousel_Slider_Meta_Box.php:161
288
+ msgid "Insert"
289
  msgstr ""
290
 
291
+ #: includes/Carousel_Slider_VC_Element.php:23
292
+ msgid "Carousel Slider"
293
  msgstr ""
294
 
295
+ #: includes/Carousel_Slider_VC_Element.php:24
296
+ msgid "Place Carousel Slider."
297
  msgstr ""
298
 
299
+ #: includes/Carousel_Slider_VC_Element.php:28
300
+ msgid "Content"
301
  msgstr ""
302
 
303
+ #: includes/Carousel_Slider_VC_Element.php:35
304
+ msgid "Carousel Slide ID"
305
  msgstr ""
306
 
307
+ #: includes/Carousel_Slider_VC_Element.php:36
308
+ #, php-format
309
+ msgid "Place carousel slide id here. %s to go Carousels page"
310
  msgstr ""
311
 
312
+ #: includes/Carousel_Slider_VC_Element.php:36
313
+ msgid "Click here"
314
  msgstr ""
315
 
316
+ #: widgets/widget-carousel_slider.php:79
317
+ msgid "click here"
318
  msgstr ""
{public → languages}/index.php RENAMED
File without changes
public/Carousel_Slider_Public.php DELETED
@@ -1,25 +0,0 @@
1
- <?php
2
-
3
- class Carousel_Slider_Public {
4
-
5
- private $plugin_name;
6
-
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 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 DELETED
@@ -1,70 +0,0 @@
1
- /*
2
- * Core Owl Carousel CSS File
3
- * v1.3.2
4
- */
5
- /* clearfix */
6
- .owl-carousel .owl-wrapper:after {
7
- content: ".";
8
- display: block;
9
- clear: both;
10
- visibility: hidden;
11
- line-height: 0;
12
- height: 0;
13
- }
14
- /* display none until init */
15
- .owl-carousel{
16
- display: none;
17
- position: relative;
18
- width: 100%;
19
- -ms-touch-action: pan-y;
20
- }
21
- .owl-carousel .owl-wrapper{
22
- display: none;
23
- position: relative;
24
- -webkit-transform: translate3d(0px, 0px, 0px);
25
- }
26
- .owl-carousel .owl-wrapper-outer{
27
- overflow: hidden;
28
- position: relative;
29
- width: 100%;
30
- }
31
- .owl-carousel .owl-wrapper-outer.autoHeight{
32
- -webkit-transition: height 500ms ease-in-out;
33
- -moz-transition: height 500ms ease-in-out;
34
- -ms-transition: height 500ms ease-in-out;
35
- -o-transition: height 500ms ease-in-out;
36
- transition: height 500ms ease-in-out;
37
- }
38
-
39
- .owl-carousel .owl-item{
40
- float: left;
41
- }
42
- .owl-controls .owl-page,
43
- .owl-controls .owl-buttons div{
44
- cursor: pointer;
45
- }
46
- .owl-controls {
47
- -webkit-user-select: none;
48
- -khtml-user-select: none;
49
- -moz-user-select: none;
50
- -ms-user-select: none;
51
- user-select: none;
52
- -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
53
- }
54
-
55
- /* mouse grab icon */
56
- .grabbing {
57
- cursor:url(grabbing.png) 8 8, move;
58
- }
59
-
60
- /* fix */
61
- .owl-carousel .owl-wrapper,
62
- .owl-carousel .owl-item{
63
- -webkit-backface-visibility: hidden;
64
- -moz-backface-visibility: hidden;
65
- -ms-backface-visibility: hidden;
66
- -webkit-transform: translate3d(0,0,0);
67
- -moz-transform: translate3d(0,0,0);
68
- -ms-transform: translate3d(0,0,0);
69
- }
70
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
public/css/owl.theme.css DELETED
@@ -1,95 +0,0 @@
1
- .row:before,
2
- .row:after {
3
- display: table;
4
- content: " ";
5
- }
6
- .row:after {
7
- clear: both;
8
- }
9
- .owl-controls .owl-buttons {
10
- width: 100% !important;
11
- position: absolute;
12
- top: 50%;
13
- -webkit-transform: translateY(-50%);
14
- -ms-transform: translateY(-50%);
15
- transform: translateY(-50%);
16
- }
17
- .owl-controls .owl-pagination {
18
- position: absolute;
19
- bottom: 0;
20
- }
21
- .owl-buttons {
22
- color: #fff;
23
- font-weight: 900;
24
- width: 100%;
25
- }
26
- .owl-theme .owl-buttons .owl-prev,
27
- .owl-theme .owl-buttons .owl-next{
28
- font-size: 14px;
29
- background: #666;
30
- padding: 5px 10px;
31
- border-radius: 20px;
32
- display: inline-block;
33
- opacity: .2;
34
- transition: all .5s;
35
- }
36
- .owl-theme:hover .owl-buttons .owl-prev,
37
- .owl-theme:hover .owl-buttons .owl-next{
38
- opacity: 1;
39
- }
40
- .owl-buttons .owl-prev{
41
- left: 0;
42
- margin-left: 5px;
43
- }
44
- .owl-buttons .owl-next{
45
- right: 0;
46
- margin-right: 5px;
47
- position: absolute;
48
- }
49
-
50
- /* Clickable class fix problem with hover on touch devices */
51
- /* Use it for non-touch hover action */
52
- .owl-theme .owl-controls.clickable .owl-buttons div:hover{
53
- filter: Alpha(Opacity=100);/*IE7 fix*/
54
- opacity: 1;
55
- text-decoration: none;
56
- }
57
-
58
- /* Styling Pagination*/
59
-
60
- .owl-theme .owl-controls .owl-page{
61
- display: inline-block;
62
- zoom: 1;
63
- *display: inline;/*IE7 life-saver */
64
- }
65
- .owl-theme .owl-controls .owl-page span{
66
- display: block;
67
- width: 12px;
68
- height: 12px;
69
- margin: 5px 7px;
70
- filter: Alpha(Opacity=50);/*IE7 fix*/
71
- opacity: 0.5;
72
- -webkit-border-radius: 20px;
73
- -moz-border-radius: 20px;
74
- border-radius: 20px;
75
- background: #cad3d0;
76
- }
77
-
78
- .owl-theme .owl-controls .owl-page.active span,
79
- .owl-theme .owl-controls.clickable .owl-page:hover span{
80
- filter: Alpha(Opacity=100);/*IE7 fix*/
81
- opacity: 1;
82
- }
83
-
84
- /* If PaginationNumbers is true */
85
-
86
- .owl-theme .owl-controls .owl-page span.owl-numbers{
87
- height: auto;
88
- width: auto;
89
- color: #FFF;
90
- padding: 2px 10px;
91
- font-size: 12px;
92
- -webkit-border-radius: 30px;
93
- -moz-border-radius: 30px;
94
- border-radius: 30px;
95
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
public/css/owl.transitions.css DELETED
@@ -1,163 +0,0 @@
1
- /*
2
- * Owl Carousel CSS3 Transitions
3
- * v1.3.2
4
- */
5
-
6
- .owl-origin {
7
- -webkit-perspective: 1200px;
8
- -webkit-perspective-origin-x : 50%;
9
- -webkit-perspective-origin-y : 50%;
10
- -moz-perspective : 1200px;
11
- -moz-perspective-origin-x : 50%;
12
- -moz-perspective-origin-y : 50%;
13
- perspective : 1200px;
14
- }
15
- /* fade */
16
- .owl-fade-out {
17
- z-index: 10;
18
- -webkit-animation: fadeOut .7s both ease;
19
- -moz-animation: fadeOut .7s both ease;
20
- animation: fadeOut .7s both ease;
21
- }
22
- .owl-fade-in {
23
- -webkit-animation: fadeIn .7s both ease;
24
- -moz-animation: fadeIn .7s both ease;
25
- animation: fadeIn .7s both ease;
26
- }
27
- /* backSlide */
28
- .owl-backSlide-out {
29
- -webkit-animation: backSlideOut 1s both ease;
30
- -moz-animation: backSlideOut 1s both ease;
31
- animation: backSlideOut 1s both ease;
32
- }
33
- .owl-backSlide-in {
34
- -webkit-animation: backSlideIn 1s both ease;
35
- -moz-animation: backSlideIn 1s both ease;
36
- animation: backSlideIn 1s both ease;
37
- }
38
- /* goDown */
39
- .owl-goDown-out {
40
- -webkit-animation: scaleToFade .7s ease both;
41
- -moz-animation: scaleToFade .7s ease both;
42
- animation: scaleToFade .7s ease both;
43
- }
44
- .owl-goDown-in {
45
- -webkit-animation: goDown .6s ease both;
46
- -moz-animation: goDown .6s ease both;
47
- animation: goDown .6s ease both;
48
- }
49
- /* scaleUp */
50
- .owl-fadeUp-in {
51
- -webkit-animation: scaleUpFrom .5s ease both;
52
- -moz-animation: scaleUpFrom .5s ease both;
53
- animation: scaleUpFrom .5s ease both;
54
- }
55
-
56
- .owl-fadeUp-out {
57
- -webkit-animation: scaleUpTo .5s ease both;
58
- -moz-animation: scaleUpTo .5s ease both;
59
- animation: scaleUpTo .5s ease both;
60
- }
61
- /* Keyframes */
62
- /*empty*/
63
- @-webkit-keyframes empty {
64
- 0% {opacity: 1}
65
- }
66
- @-moz-keyframes empty {
67
- 0% {opacity: 1}
68
- }
69
- @keyframes empty {
70
- 0% {opacity: 1}
71
- }
72
- @-webkit-keyframes fadeIn {
73
- 0% { opacity:0; }
74
- 100% { opacity:1; }
75
- }
76
- @-moz-keyframes fadeIn {
77
- 0% { opacity:0; }
78
- 100% { opacity:1; }
79
- }
80
- @keyframes fadeIn {
81
- 0% { opacity:0; }
82
- 100% { opacity:1; }
83
- }
84
- @-webkit-keyframes fadeOut {
85
- 0% { opacity:1; }
86
- 100% { opacity:0; }
87
- }
88
- @-moz-keyframes fadeOut {
89
- 0% { opacity:1; }
90
- 100% { opacity:0; }
91
- }
92
- @keyframes fadeOut {
93
- 0% { opacity:1; }
94
- 100% { opacity:0; }
95
- }
96
- @-webkit-keyframes backSlideOut {
97
- 25% { opacity: .5; -webkit-transform: translateZ(-500px); }
98
- 75% { opacity: .5; -webkit-transform: translateZ(-500px) translateX(-200%); }
99
- 100% { opacity: .5; -webkit-transform: translateZ(-500px) translateX(-200%); }
100
- }
101
- @-moz-keyframes backSlideOut {
102
- 25% { opacity: .5; -moz-transform: translateZ(-500px); }
103
- 75% { opacity: .5; -moz-transform: translateZ(-500px) translateX(-200%); }
104
- 100% { opacity: .5; -moz-transform: translateZ(-500px) translateX(-200%); }
105
- }
106
- @keyframes backSlideOut {
107
- 25% { opacity: .5; transform: translateZ(-500px); }
108
- 75% { opacity: .5; transform: translateZ(-500px) translateX(-200%); }
109
- 100% { opacity: .5; transform: translateZ(-500px) translateX(-200%); }
110
- }
111
- @-webkit-keyframes backSlideIn {
112
- 0%, 25% { opacity: .5; -webkit-transform: translateZ(-500px) translateX(200%); }
113
- 75% { opacity: .5; -webkit-transform: translateZ(-500px); }
114
- 100% { opacity: 1; -webkit-transform: translateZ(0) translateX(0); }
115
- }
116
- @-moz-keyframes backSlideIn {
117
- 0%, 25% { opacity: .5; -moz-transform: translateZ(-500px) translateX(200%); }
118
- 75% { opacity: .5; -moz-transform: translateZ(-500px); }
119
- 100% { opacity: 1; -moz-transform: translateZ(0) translateX(0); }
120
- }
121
- @keyframes backSlideIn {
122
- 0%, 25% { opacity: .5; transform: translateZ(-500px) translateX(200%); }
123
- 75% { opacity: .5; transform: translateZ(-500px); }
124
- 100% { opacity: 1; transform: translateZ(0) translateX(0); }
125
- }
126
- @-webkit-keyframes scaleToFade {
127
- to { opacity: 0; -webkit-transform: scale(.8); }
128
- }
129
- @-moz-keyframes scaleToFade {
130
- to { opacity: 0; -moz-transform: scale(.8); }
131
- }
132
- @keyframes scaleToFade {
133
- to { opacity: 0; transform: scale(.8); }
134
- }
135
- @-webkit-keyframes goDown {
136
- from { -webkit-transform: translateY(-100%); }
137
- }
138
- @-moz-keyframes goDown {
139
- from { -moz-transform: translateY(-100%); }
140
- }
141
- @keyframes goDown {
142
- from { transform: translateY(-100%); }
143
- }
144
-
145
- @-webkit-keyframes scaleUpFrom {
146
- from { opacity: 0; -webkit-transform: scale(1.5); }
147
- }
148
- @-moz-keyframes scaleUpFrom {
149
- from { opacity: 0; -moz-transform: scale(1.5); }
150
- }
151
- @keyframes scaleUpFrom {
152
- from { opacity: 0; transform: scale(1.5); }
153
- }
154
-
155
- @-webkit-keyframes scaleUpTo {
156
- to { opacity: 0; -webkit-transform: scale(1.5); }
157
- }
158
- @-moz-keyframes scaleUpTo {
159
- to { opacity: 0; -moz-transform: scale(1.5); }
160
- }
161
- @keyframes scaleUpTo {
162
- to { opacity: 0; transform: scale(1.5); }
163
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
public/js/owl.carousel.js DELETED
@@ -1,1512 +0,0 @@
1
- /*
2
- * jQuery OwlCarousel v1.3.2
3
- *
4
- * Copyright (c) 2013 Bartosz Wojciechowski
5
- * http://www.owlgraphic.com/owlcarousel/
6
- *
7
- * Licensed under MIT
8
- *
9
- */
10
-
11
- /*JS Lint helpers: */
12
- /*global dragMove: false, dragEnd: false, $, jQuery, alert, window, document */
13
- /*jslint nomen: true, continue:true */
14
-
15
- if (typeof Object.create !== "function") {
16
- Object.create = function (obj) {
17
- function F() {}
18
- F.prototype = obj;
19
- return new F();
20
- };
21
- }
22
- (function ($, window, document) {
23
-
24
- var Carousel = {
25
- init : function (options, el) {
26
- var base = this;
27
-
28
- base.$elem = $(el);
29
- base.options = $.extend({}, $.fn.owlCarousel.options, base.$elem.data(), options);
30
-
31
- base.userOptions = options;
32
- base.loadContent();
33
- },
34
-
35
- loadContent : function () {
36
- var base = this, url;
37
-
38
- function getData(data) {
39
- var i, content = "";
40
- if (typeof base.options.jsonSuccess === "function") {
41
- base.options.jsonSuccess.apply(this, [data]);
42
- } else {
43
- for (i in data.owl) {
44
- if (data.owl.hasOwnProperty(i)) {
45
- content += data.owl[i].item;
46
- }
47
- }
48
- base.$elem.html(content);
49
- }
50
- base.logIn();
51
- }
52
-
53
- if (typeof base.options.beforeInit === "function") {
54
- base.options.beforeInit.apply(this, [base.$elem]);
55
- }
56
-
57
- if (typeof base.options.jsonPath === "string") {
58
- url = base.options.jsonPath;
59
- $.getJSON(url, getData);
60
- } else {
61
- base.logIn();
62
- }
63
- },
64
-
65
- logIn : function () {
66
- var base = this;
67
-
68
- base.$elem.data("owl-originalStyles", base.$elem.attr("style"))
69
- .data("owl-originalClasses", base.$elem.attr("class"));
70
-
71
- base.$elem.css({opacity: 0});
72
- base.orignalItems = base.options.items;
73
- base.checkBrowser();
74
- base.wrapperWidth = 0;
75
- base.checkVisible = null;
76
- base.setVars();
77
- },
78
-
79
- setVars : function () {
80
- var base = this;
81
- if (base.$elem.children().length === 0) {return false; }
82
- base.baseClass();
83
- base.eventTypes();
84
- base.$userItems = base.$elem.children();
85
- base.itemsAmount = base.$userItems.length;
86
- base.wrapItems();
87
- base.$owlItems = base.$elem.find(".owl-item");
88
- base.$owlWrapper = base.$elem.find(".owl-wrapper");
89
- base.playDirection = "next";
90
- base.prevItem = 0;
91
- base.prevArr = [0];
92
- base.currentItem = 0;
93
- base.customEvents();
94
- base.onStartup();
95
- },
96
-
97
- onStartup : function () {
98
- var base = this;
99
- base.updateItems();
100
- base.calculateAll();
101
- base.buildControls();
102
- base.updateControls();
103
- base.response();
104
- base.moveEvents();
105
- base.stopOnHover();
106
- base.owlStatus();
107
-
108
- if (base.options.transitionStyle !== false) {
109
- base.transitionTypes(base.options.transitionStyle);
110
- }
111
- if (base.options.autoPlay === true) {
112
- base.options.autoPlay = 5000;
113
- }
114
- base.play();
115
-
116
- base.$elem.find(".owl-wrapper").css("display", "block");
117
-
118
- if (!base.$elem.is(":visible")) {
119
- base.watchVisibility();
120
- } else {
121
- base.$elem.css("opacity", 1);
122
- }
123
- base.onstartup = false;
124
- base.eachMoveUpdate();
125
- if (typeof base.options.afterInit === "function") {
126
- base.options.afterInit.apply(this, [base.$elem]);
127
- }
128
- },
129
-
130
- eachMoveUpdate : function () {
131
- var base = this;
132
-
133
- if (base.options.lazyLoad === true) {
134
- base.lazyLoad();
135
- }
136
- if (base.options.autoHeight === true) {
137
- base.autoHeight();
138
- }
139
- base.onVisibleItems();
140
-
141
- if (typeof base.options.afterAction === "function") {
142
- base.options.afterAction.apply(this, [base.$elem]);
143
- }
144
- },
145
-
146
- updateVars : function () {
147
- var base = this;
148
- if (typeof base.options.beforeUpdate === "function") {
149
- base.options.beforeUpdate.apply(this, [base.$elem]);
150
- }
151
- base.watchVisibility();
152
- base.updateItems();
153
- base.calculateAll();
154
- base.updatePosition();
155
- base.updateControls();
156
- base.eachMoveUpdate();
157
- if (typeof base.options.afterUpdate === "function") {
158
- base.options.afterUpdate.apply(this, [base.$elem]);
159
- }
160
- },
161
-
162
- reload : function () {
163
- var base = this;
164
- window.setTimeout(function () {
165
- base.updateVars();
166
- }, 0);
167
- },
168
-
169
- watchVisibility : function () {
170
- var base = this;
171
-
172
- if (base.$elem.is(":visible") === false) {
173
- base.$elem.css({opacity: 0});
174
- window.clearInterval(base.autoPlayInterval);
175
- window.clearInterval(base.checkVisible);
176
- } else {
177
- return false;
178
- }
179
- base.checkVisible = window.setInterval(function () {
180
- if (base.$elem.is(":visible")) {
181
- base.reload();
182
- base.$elem.animate({opacity: 1}, 200);
183
- window.clearInterval(base.checkVisible);
184
- }
185
- }, 500);
186
- },
187
-
188
- wrapItems : function () {
189
- var base = this;
190
- base.$userItems.wrapAll("<div class=\"owl-wrapper\">").wrap("<div class=\"owl-item\"></div>");
191
- base.$elem.find(".owl-wrapper").wrap("<div class=\"owl-wrapper-outer\">");
192
- base.wrapperOuter = base.$elem.find(".owl-wrapper-outer");
193
- base.$elem.css("display", "block");
194
- },
195
-
196
- baseClass : function () {
197
- var base = this,
198
- hasBaseClass = base.$elem.hasClass(base.options.baseClass),
199
- hasThemeClass = base.$elem.hasClass(base.options.theme);
200
-
201
- if (!hasBaseClass) {
202
- base.$elem.addClass(base.options.baseClass);
203
- }
204
-
205
- if (!hasThemeClass) {
206
- base.$elem.addClass(base.options.theme);
207
- }
208
- },
209
-
210
- updateItems : function () {
211
- var base = this, width, i;
212
-
213
- if (base.options.responsive === false) {
214
- return false;
215
- }
216
- if (base.options.singleItem === true) {
217
- base.options.items = base.orignalItems = 1;
218
- base.options.itemsCustom = false;
219
- base.options.itemsDesktop = false;
220
- base.options.itemsDesktopSmall = false;
221
- base.options.itemsTablet = false;
222
- base.options.itemsTabletSmall = false;
223
- base.options.itemsMobile = false;
224
- return false;
225
- }
226
-
227
- width = $(base.options.responsiveBaseWidth).width();
228
-
229
- if (width > (base.options.itemsDesktop[0] || base.orignalItems)) {
230
- base.options.items = base.orignalItems;
231
- }
232
- if (base.options.itemsCustom !== false) {
233
- //Reorder array by screen size
234
- base.options.itemsCustom.sort(function (a, b) {return a[0] - b[0]; });
235
-
236
- for (i = 0; i < base.options.itemsCustom.length; i += 1) {
237
- if (base.options.itemsCustom[i][0] <= width) {
238
- base.options.items = base.options.itemsCustom[i][1];
239
- }
240
- }
241
-
242
- } else {
243
-
244
- if (width <= base.options.itemsDesktop[0] && base.options.itemsDesktop !== false) {
245
- base.options.items = base.options.itemsDesktop[1];
246
- }
247
-
248
- if (width <= base.options.itemsDesktopSmall[0] && base.options.itemsDesktopSmall !== false) {
249
- base.options.items = base.options.itemsDesktopSmall[1];
250
- }
251
-
252
- if (width <= base.options.itemsTablet[0] && base.options.itemsTablet !== false) {
253
- base.options.items = base.options.itemsTablet[1];
254
- }
255
-
256
- if (width <= base.options.itemsTabletSmall[0] && base.options.itemsTabletSmall !== false) {
257
- base.options.items = base.options.itemsTabletSmall[1];
258
- }
259
-
260
- if (width <= base.options.itemsMobile[0] && base.options.itemsMobile !== false) {
261
- base.options.items = base.options.itemsMobile[1];
262
- }
263
- }
264
-
265
- //if number of items is less than declared
266
- if (base.options.items > base.itemsAmount && base.options.itemsScaleUp === true) {
267
- base.options.items = base.itemsAmount;
268
- }
269
- },
270
-
271
- response : function () {
272
- var base = this,
273
- smallDelay,
274
- lastWindowWidth;
275
-
276
- if (base.options.responsive !== true) {
277
- return false;
278
- }
279
- lastWindowWidth = $(window).width();
280
-
281
- base.resizer = function () {
282
- if ($(window).width() !== lastWindowWidth) {
283
- if (base.options.autoPlay !== false) {
284
- window.clearInterval(base.autoPlayInterval);
285
- }
286
- window.clearTimeout(smallDelay);
287
- smallDelay = window.setTimeout(function () {
288
- lastWindowWidth = $(window).width();
289
- base.updateVars();
290
- }, base.options.responsiveRefreshRate);
291
- }
292
- };
293
- $(window).resize(base.resizer);
294
- },
295
-
296
- updatePosition : function () {
297
- var base = this;
298
- base.jumpTo(base.currentItem);
299
- if (base.options.autoPlay !== false) {
300
- base.checkAp();
301
- }
302
- },
303
-
304
- appendItemsSizes : function () {
305
- var base = this,
306
- roundPages = 0,
307
- lastItem = base.itemsAmount - base.options.items;
308
-
309
- base.$owlItems.each(function (index) {
310
- var $this = $(this);
311
- $this
312
- .css({"width": base.itemWidth})
313
- .data("owl-item", Number(index));
314
-
315
- if (index % base.options.items === 0 || index === lastItem) {
316
- if (!(index > lastItem)) {
317
- roundPages += 1;
318
- }
319
- }
320
- $this.data("owl-roundPages", roundPages);
321
- });
322
- },
323
-
324
- appendWrapperSizes : function () {
325
- var base = this,
326
- width = base.$owlItems.length * base.itemWidth;
327
-
328
- base.$owlWrapper.css({
329
- "width": width * 2,
330
- "left": 0
331
- });
332
- base.appendItemsSizes();
333
- },
334
-
335
- calculateAll : function () {
336
- var base = this;
337
- base.calculateWidth();
338
- base.appendWrapperSizes();
339
- base.loops();
340
- base.max();
341
- },
342
-
343
- calculateWidth : function () {
344
- var base = this;
345
- base.itemWidth = Math.round(base.$elem.width() / base.options.items);
346
- },
347
-
348
- max : function () {
349
- var base = this,
350
- maximum = ((base.itemsAmount * base.itemWidth) - base.options.items * base.itemWidth) * -1;
351
- if (base.options.items > base.itemsAmount) {
352
- base.maximumItem = 0;
353
- maximum = 0;
354
- base.maximumPixels = 0;
355
- } else {
356
- base.maximumItem = base.itemsAmount - base.options.items;
357
- base.maximumPixels = maximum;
358
- }
359
- return maximum;
360
- },
361
-
362
- min : function () {
363
- return 0;
364
- },
365
-
366
- loops : function () {
367
- var base = this,
368
- prev = 0,
369
- elWidth = 0,
370
- i,
371
- item,
372
- roundPageNum;
373
-
374
- base.positionsInArray = [0];
375
- base.pagesInArray = [];
376
-
377
- for (i = 0; i < base.itemsAmount; i += 1) {
378
- elWidth += base.itemWidth;
379
- base.positionsInArray.push(-elWidth);
380
-
381
- if (base.options.scrollPerPage === true) {
382
- item = $(base.$owlItems[i]);
383
- roundPageNum = item.data("owl-roundPages");
384
- if (roundPageNum !== prev) {
385
- base.pagesInArray[prev] = base.positionsInArray[i];
386
- prev = roundPageNum;
387
- }
388
- }
389
- }
390
- },
391
-
392
- buildControls : function () {
393
- var base = this;
394
- if (base.options.navigation === true || base.options.pagination === true) {
395
- base.owlControls = $("<div class=\"owl-controls\"/>").toggleClass("clickable", !base.browser.isTouch).appendTo(base.$elem);
396
- }
397
- if (base.options.pagination === true) {
398
- base.buildPagination();
399
- }
400
- if (base.options.navigation === true) {
401
- base.buildButtons();
402
- }
403
- },
404
-
405
- buildButtons : function () {
406
- var base = this,
407
- buttonsWrapper = $("<div class=\"owl-buttons\"/>");
408
- base.owlControls.append(buttonsWrapper);
409
-
410
- base.buttonPrev = $("<div/>", {
411
- "class" : "owl-prev",
412
- "html" : base.options.navigationText[0] || ""
413
- });
414
-
415
- base.buttonNext = $("<div/>", {
416
- "class" : "owl-next",
417
- "html" : base.options.navigationText[1] || ""
418
- });
419
-
420
- buttonsWrapper
421
- .append(base.buttonPrev)
422
- .append(base.buttonNext);
423
-
424
- buttonsWrapper.on("touchstart.owlControls mousedown.owlControls", "div[class^=\"owl\"]", function (event) {
425
- event.preventDefault();
426
- });
427
-
428
- buttonsWrapper.on("touchend.owlControls mouseup.owlControls", "div[class^=\"owl\"]", function (event) {
429
- event.preventDefault();
430
- if ($(this).hasClass("owl-next")) {
431
- base.next();
432
- } else {
433
- base.prev();
434
- }
435
- });
436
- },
437
-
438
- buildPagination : function () {
439
- var base = this;
440
-
441
- base.paginationWrapper = $("<div class=\"owl-pagination\"/>");
442
- base.owlControls.append(base.paginationWrapper);
443
-
444
- base.paginationWrapper.on("touchend.owlControls mouseup.owlControls", ".owl-page", function (event) {
445
- event.preventDefault();
446
- if (Number($(this).data("owl-page")) !== base.currentItem) {
447
- base.goTo(Number($(this).data("owl-page")), true);
448
- }
449
- });
450
- },
451
-
452
- updatePagination : function () {
453
- var base = this,
454
- counter,
455
- lastPage,
456
- lastItem,
457
- i,
458
- paginationButton,
459
- paginationButtonInner;
460
-
461
- if (base.options.pagination === false) {
462
- return false;
463
- }
464
-
465
- base.paginationWrapper.html("");
466
-
467
- counter = 0;
468
- lastPage = base.itemsAmount - base.itemsAmount % base.options.items;
469
-
470
- for (i = 0; i < base.itemsAmount; i += 1) {
471
- if (i % base.options.items === 0) {
472
- counter += 1;
473
- if (lastPage === i) {
474
- lastItem = base.itemsAmount - base.options.items;
475
- }
476
- paginationButton = $("<div/>", {
477
- "class" : "owl-page"
478
- });
479
- paginationButtonInner = $("<span></span>", {
480
- "text": base.options.paginationNumbers === true ? counter : "",
481
- "class": base.options.paginationNumbers === true ? "owl-numbers" : ""
482
- });
483
- paginationButton.append(paginationButtonInner);
484
-
485
- paginationButton.data("owl-page", lastPage === i ? lastItem : i);
486
- paginationButton.data("owl-roundPages", counter);
487
-
488
- base.paginationWrapper.append(paginationButton);
489
- }
490
- }
491
- base.checkPagination();
492
- },
493
- checkPagination : function () {
494
- var base = this;
495
- if (base.options.pagination === false) {
496
- return false;
497
- }
498
- base.paginationWrapper.find(".owl-page").each(function () {
499
- if ($(this).data("owl-roundPages") === $(base.$owlItems[base.currentItem]).data("owl-roundPages")) {
500
- base.paginationWrapper
501
- .find(".owl-page")
502
- .removeClass("active");
503
- $(this).addClass("active");
504
- }
505
- });
506
- },
507
-
508
- checkNavigation : function () {
509
- var base = this;
510
-
511
- if (base.options.navigation === false) {
512
- return false;
513
- }
514
- if (base.options.rewindNav === false) {
515
- if (base.currentItem === 0 && base.maximumItem === 0) {
516
- base.buttonPrev.addClass("disabled");
517
- base.buttonNext.addClass("disabled");
518
- } else if (base.currentItem === 0 && base.maximumItem !== 0) {
519
- base.buttonPrev.addClass("disabled");
520
- base.buttonNext.removeClass("disabled");
521
- } else if (base.currentItem === base.maximumItem) {
522
- base.buttonPrev.removeClass("disabled");
523
- base.buttonNext.addClass("disabled");
524
- } else if (base.currentItem !== 0 && base.currentItem !== base.maximumItem) {
525
- base.buttonPrev.removeClass("disabled");
526
- base.buttonNext.removeClass("disabled");
527
- }
528
- }
529
- },
530
-
531
- updateControls : function () {
532
- var base = this;
533
- base.updatePagination();
534
- base.checkNavigation();
535
- if (base.owlControls) {
536
- if (base.options.items >= base.itemsAmount) {
537
- base.owlControls.hide();
538
- } else {
539
- base.owlControls.show();
540
- }
541
- }
542
- },
543
-
544
- destroyControls : function () {
545
- var base = this;
546
- if (base.owlControls) {
547
- base.owlControls.remove();
548
- }
549
- },
550
-
551
- next : function (speed) {
552
- var base = this;
553
-
554
- if (base.isTransition) {
555
- return false;
556
- }
557
-
558
- base.currentItem += base.options.scrollPerPage === true ? base.options.items : 1;
559
- if (base.currentItem > base.maximumItem + (base.options.scrollPerPage === true ? (base.options.items - 1) : 0)) {
560
- if (base.options.rewindNav === true) {
561
- base.currentItem = 0;
562
- speed = "rewind";
563
- } else {
564
- base.currentItem = base.maximumItem;
565
- return false;
566
- }
567
- }
568
- base.goTo(base.currentItem, speed);
569
- },
570
-
571
- prev : function (speed) {
572
- var base = this;
573
-
574
- if (base.isTransition) {
575
- return false;
576
- }
577
-
578
- if (base.options.scrollPerPage === true && base.currentItem > 0 && base.currentItem < base.options.items) {
579
- base.currentItem = 0;
580
- } else {
581
- base.currentItem -= base.options.scrollPerPage === true ? base.options.items : 1;
582
- }
583
- if (base.currentItem < 0) {
584
- if (base.options.rewindNav === true) {
585
- base.currentItem = base.maximumItem;
586
- speed = "rewind";
587
- } else {
588
- base.currentItem = 0;
589
- return false;
590
- }
591
- }
592
- base.goTo(base.currentItem, speed);
593
- },
594
-
595
- goTo : function (position, speed, drag) {
596
- var base = this,
597
- goToPixel;
598
-
599
- if (base.isTransition) {
600
- return false;
601
- }
602
- if (typeof base.options.beforeMove === "function") {
603
- base.options.beforeMove.apply(this, [base.$elem]);
604
- }
605
- if (position >= base.maximumItem) {
606
- position = base.maximumItem;
607
- } else if (position <= 0) {
608
- position = 0;
609
- }
610
-
611
- base.currentItem = base.owl.currentItem = position;
612
- if (base.options.transitionStyle !== false && drag !== "drag" && base.options.items === 1 && base.browser.support3d === true) {
613
- base.swapSpeed(0);
614
- if (base.browser.support3d === true) {
615
- base.transition3d(base.positionsInArray[position]);
616
- } else {
617
- base.css2slide(base.positionsInArray[position], 1);
618
- }
619
- base.afterGo();
620
- base.singleItemTransition();
621
- return false;
622
- }
623
- goToPixel = base.positionsInArray[position];
624
-
625
- if (base.browser.support3d === true) {
626
- base.isCss3Finish = false;
627
-
628
- if (speed === true) {
629
- base.swapSpeed("paginationSpeed");
630
- window.setTimeout(function () {
631
- base.isCss3Finish = true;
632
- }, base.options.paginationSpeed);
633
-
634
- } else if (speed === "rewind") {
635
- base.swapSpeed(base.options.rewindSpeed);
636
- window.setTimeout(function () {
637
- base.isCss3Finish = true;
638
- }, base.options.rewindSpeed);
639
-
640
- } else {
641
- base.swapSpeed("slideSpeed");
642
- window.setTimeout(function () {
643
- base.isCss3Finish = true;
644
- }, base.options.slideSpeed);
645
- }
646
- base.transition3d(goToPixel);
647
- } else {
648
- if (speed === true) {
649
- base.css2slide(goToPixel, base.options.paginationSpeed);
650
- } else if (speed === "rewind") {
651
- base.css2slide(goToPixel, base.options.rewindSpeed);
652
- } else {
653
- base.css2slide(goToPixel, base.options.slideSpeed);
654
- }
655
- }
656
- base.afterGo();
657
- },
658
-
659
- jumpTo : function (position) {
660
- var base = this;
661
- if (typeof base.options.beforeMove === "function") {
662
- base.options.beforeMove.apply(this, [base.$elem]);
663
- }
664
- if (position >= base.maximumItem || position === -1) {
665
- position = base.maximumItem;
666
- } else if (position <= 0) {
667
- position = 0;
668
- }
669
- base.swapSpeed(0);
670
- if (base.browser.support3d === true) {
671
- base.transition3d(base.positionsInArray[position]);
672
- } else {
673
- base.css2slide(base.positionsInArray[position], 1);
674
- }
675
- base.currentItem = base.owl.currentItem = position;
676
- base.afterGo();
677
- },
678
-
679
- afterGo : function () {
680
- var base = this;
681
-
682
- base.prevArr.push(base.currentItem);
683
- base.prevItem = base.owl.prevItem = base.prevArr[base.prevArr.length - 2];
684
- base.prevArr.shift(0);
685
-
686
- if (base.prevItem !== base.currentItem) {
687
- base.checkPagination();
688
- base.checkNavigation();
689
- base.eachMoveUpdate();
690
-
691
- if (base.options.autoPlay !== false) {
692
- base.checkAp();
693
- }
694
- }
695
- if (typeof base.options.afterMove === "function" && base.prevItem !== base.currentItem) {
696
- base.options.afterMove.apply(this, [base.$elem]);
697
- }
698
- },
699
-
700
- stop : function () {
701
- var base = this;
702
- base.apStatus = "stop";
703
- window.clearInterval(base.autoPlayInterval);
704
- },
705
-
706
- checkAp : function () {
707
- var base = this;
708
- if (base.apStatus !== "stop") {
709
- base.play();
710
- }
711
- },
712
-
713
- play : function () {
714
- var base = this;
715
- base.apStatus = "play";
716
- if (base.options.autoPlay === false) {
717
- return false;
718
- }
719
- window.clearInterval(base.autoPlayInterval);
720
- base.autoPlayInterval = window.setInterval(function () {
721
- base.next(true);
722
- }, base.options.autoPlay);
723
- },
724
-
725
- swapSpeed : function (action) {
726
- var base = this;
727
- if (action === "slideSpeed") {
728
- base.$owlWrapper.css(base.addCssSpeed(base.options.slideSpeed));
729
- } else if (action === "paginationSpeed") {
730
- base.$owlWrapper.css(base.addCssSpeed(base.options.paginationSpeed));
731
- } else if (typeof action !== "string") {
732
- base.$owlWrapper.css(base.addCssSpeed(action));
733
- }
734
- },
735
-
736
- addCssSpeed : function (speed) {
737
- return {
738
- "-webkit-transition": "all " + speed + "ms ease",
739
- "-moz-transition": "all " + speed + "ms ease",
740
- "-o-transition": "all " + speed + "ms ease",
741
- "transition": "all " + speed + "ms ease"
742
- };
743
- },
744
-
745
- removeTransition : function () {
746
- return {
747
- "-webkit-transition": "",
748
- "-moz-transition": "",
749
- "-o-transition": "",
750
- "transition": ""
751
- };
752
- },
753
-
754
- doTranslate : function (pixels) {
755
- return {
756
- "-webkit-transform": "translate3d(" + pixels + "px, 0px, 0px)",
757
- "-moz-transform": "translate3d(" + pixels + "px, 0px, 0px)",
758
- "-o-transform": "translate3d(" + pixels + "px, 0px, 0px)",
759
- "-ms-transform": "translate3d(" + pixels + "px, 0px, 0px)",
760
- "transform": "translate3d(" + pixels + "px, 0px,0px)"
761
- };
762
- },
763
-
764
- transition3d : function (value) {
765
- var base = this;
766
- base.$owlWrapper.css(base.doTranslate(value));
767
- },
768
-
769
- css2move : function (value) {
770
- var base = this;
771
- base.$owlWrapper.css({"left" : value});
772
- },
773
-
774
- css2slide : function (value, speed) {
775
- var base = this;
776
-
777
- base.isCssFinish = false;
778
- base.$owlWrapper.stop(true, true).animate({
779
- "left" : value
780
- }, {
781
- duration : speed || base.options.slideSpeed,
782
- complete : function () {
783
- base.isCssFinish = true;
784
- }
785
- });
786
- },
787
-
788
- checkBrowser : function () {
789
- var base = this,
790
- translate3D = "translate3d(0px, 0px, 0px)",
791
- tempElem = document.createElement("div"),
792
- regex,
793
- asSupport,
794
- support3d,
795
- isTouch;
796
-
797
- tempElem.style.cssText = " -moz-transform:" + translate3D +
798
- "; -ms-transform:" + translate3D +
799
- "; -o-transform:" + translate3D +
800
- "; -webkit-transform:" + translate3D +
801
- "; transform:" + translate3D;
802
- regex = /translate3d\(0px, 0px, 0px\)/g;
803
- asSupport = tempElem.style.cssText.match(regex);
804
- support3d = (asSupport !== null && asSupport.length === 1);
805
-
806
- isTouch = "ontouchstart" in window || window.navigator.msMaxTouchPoints;
807
-
808
- base.browser = {
809
- "support3d" : support3d,
810
- "isTouch" : isTouch
811
- };
812
- },
813
-
814
- moveEvents : function () {
815
- var base = this;
816
- if (base.options.mouseDrag !== false || base.options.touchDrag !== false) {
817
- base.gestures();
818
- base.disabledEvents();
819
- }
820
- },
821
-
822
- eventTypes : function () {
823
- var base = this,
824
- types = ["s", "e", "x"];
825
-
826
- base.ev_types = {};
827
-
828
- if (base.options.mouseDrag === true && base.options.touchDrag === true) {
829
- types = [
830
- "touchstart.owl mousedown.owl",
831
- "touchmove.owl mousemove.owl",
832
- "touchend.owl touchcancel.owl mouseup.owl"
833
- ];
834
- } else if (base.options.mouseDrag === false && base.options.touchDrag === true) {
835
- types = [
836
- "touchstart.owl",
837
- "touchmove.owl",
838
- "touchend.owl touchcancel.owl"
839
- ];
840
- } else if (base.options.mouseDrag === true && base.options.touchDrag === false) {
841
- types = [
842
- "mousedown.owl",
843
- "mousemove.owl",
844
- "mouseup.owl"
845
- ];
846
- }
847
-
848
- base.ev_types.start = types[0];
849
- base.ev_types.move = types[1];
850
- base.ev_types.end = types[2];
851
- },
852
-
853
- disabledEvents : function () {
854
- var base = this;
855
- base.$elem.on("dragstart.owl", function (event) { event.preventDefault(); });
856
- base.$elem.on("mousedown.disableTextSelect", function (e) {
857
- return $(e.target).is('input, textarea, select, option');
858
- });
859
- },
860
-
861
- gestures : function () {
862
- /*jslint unparam: true*/
863
- var base = this,
864
- locals = {
865
- offsetX : 0,
866
- offsetY : 0,
867
- baseElWidth : 0,
868
- relativePos : 0,
869
- position: null,
870
- minSwipe : null,
871
- maxSwipe: null,
872
- sliding : null,
873
- dargging: null,
874
- targetElement : null
875
- };
876
-
877
- base.isCssFinish = true;
878
-
879
- function getTouches(event) {
880
- if (event.touches !== undefined) {
881
- return {
882
- x : event.touches[0].pageX,
883
- y : event.touches[0].pageY
884
- };
885
- }
886
-
887
- if (event.touches === undefined) {
888
- if (event.pageX !== undefined) {
889
- return {
890
- x : event.pageX,
891
- y : event.pageY
892
- };
893
- }
894
- if (event.pageX === undefined) {
895
- return {
896
- x : event.clientX,
897
- y : event.clientY
898
- };
899
- }
900
- }
901
- }
902
-
903
- function swapEvents(type) {
904
- if (type === "on") {
905
- $(document).on(base.ev_types.move, dragMove);
906
- $(document).on(base.ev_types.end, dragEnd);
907
- } else if (type === "off") {
908
- $(document).off(base.ev_types.move);
909
- $(document).off(base.ev_types.end);
910
- }
911
- }
912
-
913
- function dragStart(event) {
914
- var ev = event.originalEvent || event || window.event,
915
- position;
916
-
917
- if (ev.which === 3) {
918
- return false;
919
- }
920
- if (base.itemsAmount <= base.options.items) {
921
- return;
922
- }
923
- if (base.isCssFinish === false && !base.options.dragBeforeAnimFinish) {
924
- return false;
925
- }
926
- if (base.isCss3Finish === false && !base.options.dragBeforeAnimFinish) {
927
- return false;
928
- }
929
-
930
- if (base.options.autoPlay !== false) {
931
- window.clearInterval(base.autoPlayInterval);
932
- }
933
-
934
- if (base.browser.isTouch !== true && !base.$owlWrapper.hasClass("grabbing")) {
935
- base.$owlWrapper.addClass("grabbing");
936
- }
937
-
938
- base.newPosX = 0;
939
- base.newRelativeX = 0;
940
-
941
- $(this).css(base.removeTransition());
942
-
943
- position = $(this).position();
944
- locals.relativePos = position.left;
945
-
946
- locals.offsetX = getTouches(ev).x - position.left;
947
- locals.offsetY = getTouches(ev).y - position.top;
948
-
949
- swapEvents("on");
950
-
951
- locals.sliding = false;
952
- locals.targetElement = ev.target || ev.srcElement;
953
- }
954
-
955
- function dragMove(event) {
956
- var ev = event.originalEvent || event || window.event,
957
- minSwipe,
958
- maxSwipe;
959
-
960
- base.newPosX = getTouches(ev).x - locals.offsetX;
961
- base.newPosY = getTouches(ev).y - locals.offsetY;
962
- base.newRelativeX = base.newPosX - locals.relativePos;
963
-
964
- if (typeof base.options.startDragging === "function" && locals.dragging !== true && base.newRelativeX !== 0) {
965
- locals.dragging = true;
966
- base.options.startDragging.apply(base, [base.$elem]);
967
- }
968
-
969
- if ((base.newRelativeX > 8 || base.newRelativeX < -8) && (base.browser.isTouch === true)) {
970
- if (ev.preventDefault !== undefined) {
971
- ev.preventDefault();
972
- } else {
973
- ev.returnValue = false;
974
- }
975
- locals.sliding = true;
976
- }
977
-
978
- if ((base.newPosY > 10 || base.newPosY < -10) && locals.sliding === false) {
979
- $(document).off("touchmove.owl");
980
- }
981
-
982
- minSwipe = function () {
983
- return base.newRelativeX / 5;
984
- };
985
-
986
- maxSwipe = function () {
987
- return base.maximumPixels + base.newRelativeX / 5;
988
- };
989
-
990
- base.newPosX = Math.max(Math.min(base.newPosX, minSwipe()), maxSwipe());
991
- if (base.browser.support3d === true) {
992
- base.transition3d(base.newPosX);
993
- } else {
994
- base.css2move(base.newPosX);
995
- }
996
- }
997
-
998
- function dragEnd(event) {
999
- var ev = event.originalEvent || event || window.event,
1000
- newPosition,
1001
- handlers,
1002
- owlStopEvent;
1003
-
1004
- ev.target = ev.target || ev.srcElement;
1005
-
1006
- locals.dragging = false;
1007
-
1008
- if (base.browser.isTouch !== true) {
1009
- base.$owlWrapper.removeClass("grabbing");
1010
- }
1011
-
1012
- if (base.newRelativeX < 0) {
1013
- base.dragDirection = base.owl.dragDirection = "left";
1014
- } else {
1015
- base.dragDirection = base.owl.dragDirection = "right";
1016
- }
1017
-
1018
- if (base.newRelativeX !== 0) {
1019
- newPosition = base.getNewPosition();
1020
- base.goTo(newPosition, false, "drag");
1021
- if (locals.targetElement === ev.target && base.browser.isTouch !== true) {
1022
- $(ev.target).on("click.disable", function (ev) {
1023
- ev.stopImmediatePropagation();
1024
- ev.stopPropagation();
1025
- ev.preventDefault();
1026
- $(ev.target).off("click.disable");
1027
- });
1028
- handlers = $._data(ev.target, "events").click;
1029
- owlStopEvent = handlers.pop();
1030
- handlers.splice(0, 0, owlStopEvent);
1031
- }
1032
- }
1033
- swapEvents("off");
1034
- }
1035
- base.$elem.on(base.ev_types.start, ".owl-wrapper", dragStart);
1036
- },
1037
-
1038
- getNewPosition : function () {
1039
- var base = this,
1040
- newPosition = base.closestItem();
1041
-
1042
- if (newPosition > base.maximumItem) {
1043
- base.currentItem = base.maximumItem;
1044
- newPosition = base.maximumItem;
1045
- } else if (base.newPosX >= 0) {
1046
- newPosition = 0;
1047
- base.currentItem = 0;
1048
- }
1049
- return newPosition;
1050
- },
1051
- closestItem : function () {
1052
- var base = this,
1053
- array = base.options.scrollPerPage === true ? base.pagesInArray : base.positionsInArray,
1054
- goal = base.newPosX,
1055
- closest = null;
1056
-
1057
- $.each(array, function (i, v) {
1058
- if (goal - (base.itemWidth / 20) > array[i + 1] && goal - (base.itemWidth / 20) < v && base.moveDirection() === "left") {
1059
- closest = v;
1060
- if (base.options.scrollPerPage === true) {
1061
- base.currentItem = $.inArray(closest, base.positionsInArray);
1062
- } else {
1063
- base.currentItem = i;
1064
- }
1065
- } else if (goal + (base.itemWidth / 20) < v && goal + (base.itemWidth / 20) > (array[i + 1] || array[i] - base.itemWidth) && base.moveDirection() === "right") {
1066
- if (base.options.scrollPerPage === true) {
1067
- closest = array[i + 1] || array[array.length - 1];
1068
- base.currentItem = $.inArray(closest, base.positionsInArray);
1069
- } else {
1070
- closest = array[i + 1];
1071
- base.currentItem = i + 1;
1072
- }
1073
- }
1074
- });
1075
- return base.currentItem;
1076
- },
1077
-
1078
- moveDirection : function () {
1079
- var base = this,
1080
- direction;
1081
- if (base.newRelativeX < 0) {
1082
- direction = "right";
1083
- base.playDirection = "next";
1084
- } else {
1085
- direction = "left";
1086
- base.playDirection = "prev";
1087
- }
1088
- return direction;
1089
- },
1090
-
1091
- customEvents : function () {
1092
- /*jslint unparam: true*/
1093
- var base = this;
1094
- base.$elem.on("owl.next", function () {
1095
- base.next();
1096
- });
1097
- base.$elem.on("owl.prev", function () {
1098
- base.prev();
1099
- });
1100
- base.$elem.on("owl.play", function (event, speed) {
1101
- base.options.autoPlay = speed;
1102
- base.play();
1103
- base.hoverStatus = "play";
1104
- });
1105
- base.$elem.on("owl.stop", function () {
1106
- base.stop();
1107
- base.hoverStatus = "stop";
1108
- });
1109
- base.$elem.on("owl.goTo", function (event, item) {
1110
- base.goTo(item);
1111
- });
1112
- base.$elem.on("owl.jumpTo", function (event, item) {
1113
- base.jumpTo(item);
1114
- });
1115
- },
1116
-
1117
- stopOnHover : function () {
1118
- var base = this;
1119
- if (base.options.stopOnHover === true && base.browser.isTouch !== true && base.options.autoPlay !== false) {
1120
- base.$elem.on("mouseover", function () {
1121
- base.stop();
1122
- });
1123
- base.$elem.on("mouseout", function () {
1124
- if (base.hoverStatus !== "stop") {
1125
- base.play();
1126
- }
1127
- });
1128
- }
1129
- },
1130
-
1131
- lazyLoad : function () {
1132
- var base = this,
1133
- i,
1134
- $item,
1135
- itemNumber,
1136
- $lazyImg,
1137
- follow;
1138
-
1139
- if (base.options.lazyLoad === false) {
1140
- return false;
1141
- }
1142
- for (i = 0; i < base.itemsAmount; i += 1) {
1143
- $item = $(base.$owlItems[i]);
1144
-
1145
- if ($item.data("owl-loaded") === "loaded") {
1146
- continue;
1147
- }
1148
-
1149
- itemNumber = $item.data("owl-item");
1150
- $lazyImg = $item.find(".lazyOwl");
1151
-
1152
- if (typeof $lazyImg.data("src") !== "string") {
1153
- $item.data("owl-loaded", "loaded");
1154
- continue;
1155
- }
1156
- if ($item.data("owl-loaded") === undefined) {
1157
- $lazyImg.hide();
1158
- $item.addClass("loading").data("owl-loaded", "checked");
1159
- }
1160
- if (base.options.lazyFollow === true) {
1161
- follow = itemNumber >= base.currentItem;
1162
- } else {
1163
- follow = true;
1164
- }
1165
- if (follow && itemNumber < base.currentItem + base.options.items && $lazyImg.length) {
1166
- base.lazyPreload($item, $lazyImg);
1167
- }
1168
- }
1169
- },
1170
-
1171
- lazyPreload : function ($item, $lazyImg) {
1172
- var base = this,
1173
- iterations = 0,
1174
- isBackgroundImg;
1175
-
1176
- if ($lazyImg.prop("tagName") === "DIV") {
1177
- $lazyImg.css("background-image", "url(" + $lazyImg.data("src") + ")");
1178
- isBackgroundImg = true;
1179
- } else {
1180
- $lazyImg[0].src = $lazyImg.data("src");
1181
- }
1182
-
1183
- function showImage() {
1184
- $item.data("owl-loaded", "loaded").removeClass("loading");
1185
- $lazyImg.removeAttr("data-src");
1186
- if (base.options.lazyEffect === "fade") {
1187
- $lazyImg.fadeIn(400);
1188
- } else {
1189
- $lazyImg.show();
1190
- }
1191
- if (typeof base.options.afterLazyLoad === "function") {
1192
- base.options.afterLazyLoad.apply(this, [base.$elem]);
1193
- }
1194
- }
1195
-
1196
- function checkLazyImage() {
1197
- iterations += 1;
1198
- if (base.completeImg($lazyImg.get(0)) || isBackgroundImg === true) {
1199
- showImage();
1200
- } else if (iterations <= 100) {//if image loads in less than 10 seconds
1201
- window.setTimeout(checkLazyImage, 100);
1202
- } else {
1203
- showImage();
1204
- }
1205
- }
1206
-
1207
- checkLazyImage();
1208
- },
1209
-
1210
- autoHeight : function () {
1211
- var base = this,
1212
- $currentimg = $(base.$owlItems[base.currentItem]).find("img"),
1213
- iterations;
1214
-
1215
- function addHeight() {
1216
- var $currentItem = $(base.$owlItems[base.currentItem]).height();
1217
- base.wrapperOuter.css("height", $currentItem + "px");
1218
- if (!base.wrapperOuter.hasClass("autoHeight")) {
1219
- window.setTimeout(function () {
1220
- base.wrapperOuter.addClass("autoHeight");
1221
- }, 0);
1222
- }
1223
- }
1224
-
1225
- function checkImage() {
1226
- iterations += 1;
1227
- if (base.completeImg($currentimg.get(0))) {
1228
- addHeight();
1229
- } else if (iterations <= 100) { //if image loads in less than 10 seconds
1230
- window.setTimeout(checkImage, 100);
1231
- } else {
1232
- base.wrapperOuter.css("height", ""); //Else remove height attribute
1233
- }
1234
- }
1235
-
1236
- if ($currentimg.get(0) !== undefined) {
1237
- iterations = 0;
1238
- checkImage();
1239
- } else {
1240
- addHeight();
1241
- }
1242
- },
1243
-
1244
- completeImg : function (img) {
1245
- var naturalWidthType;
1246
-
1247
- if (!img.complete) {
1248
- return false;
1249
- }
1250
- naturalWidthType = typeof img.naturalWidth;
1251
- if (naturalWidthType !== "undefined" && img.naturalWidth === 0) {
1252
- return false;
1253
- }
1254
- return true;
1255
- },
1256
-
1257
- onVisibleItems : function () {
1258
- var base = this,
1259
- i;
1260
-
1261
- if (base.options.addClassActive === true) {
1262
- base.$owlItems.removeClass("active");
1263
- }
1264
- base.visibleItems = [];
1265
- for (i = base.currentItem; i < base.currentItem + base.options.items; i += 1) {
1266
- base.visibleItems.push(i);
1267
-
1268
- if (base.options.addClassActive === true) {
1269
- $(base.$owlItems[i]).addClass("active");
1270
- }
1271
- }
1272
- base.owl.visibleItems = base.visibleItems;
1273
- },
1274
-
1275
- transitionTypes : function (className) {
1276
- var base = this;
1277
- //Currently available: "fade", "backSlide", "goDown", "fadeUp"
1278
- base.outClass = "owl-" + className + "-out";
1279
- base.inClass = "owl-" + className + "-in";
1280
- },
1281
-
1282
- singleItemTransition : function () {
1283
- var base = this,
1284
- outClass = base.outClass,
1285
- inClass = base.inClass,
1286
- $currentItem = base.$owlItems.eq(base.currentItem),
1287
- $prevItem = base.$owlItems.eq(base.prevItem),
1288
- prevPos = Math.abs(base.positionsInArray[base.currentItem]) + base.positionsInArray[base.prevItem],
1289
- origin = Math.abs(base.positionsInArray[base.currentItem]) + base.itemWidth / 2,
1290
- animEnd = 'webkitAnimationEnd oAnimationEnd MSAnimationEnd animationend';
1291
-
1292
- base.isTransition = true;
1293
-
1294
- base.$owlWrapper
1295
- .addClass('owl-origin')
1296
- .css({
1297
- "-webkit-transform-origin" : origin + "px",
1298
- "-moz-perspective-origin" : origin + "px",
1299
- "perspective-origin" : origin + "px"
1300
- });
1301
- function transStyles(prevPos) {
1302
- return {
1303
- "position" : "relative",
1304
- "left" : prevPos + "px"
1305
- };
1306
- }
1307
-
1308
- $prevItem
1309
- .css(transStyles(prevPos, 10))
1310
- .addClass(outClass)
1311
- .on(animEnd, function () {
1312
- base.endPrev = true;
1313
- $prevItem.off(animEnd);
1314
- base.clearTransStyle($prevItem, outClass);
1315
- });
1316
-
1317
- $currentItem
1318
- .addClass(inClass)
1319
- .on(animEnd, function () {
1320
- base.endCurrent = true;
1321
- $currentItem.off(animEnd);
1322
- base.clearTransStyle($currentItem, inClass);
1323
- });
1324
- },
1325
-
1326
- clearTransStyle : function (item, classToRemove) {
1327
- var base = this;
1328
- item.css({
1329
- "position" : "",
1330
- "left" : ""
1331
- }).removeClass(classToRemove);
1332
-
1333
- if (base.endPrev && base.endCurrent) {
1334
- base.$owlWrapper.removeClass('owl-origin');
1335
- base.endPrev = false;
1336
- base.endCurrent = false;
1337
- base.isTransition = false;
1338
- }
1339
- },
1340
-
1341
- owlStatus : function () {
1342
- var base = this;
1343
- base.owl = {
1344
- "userOptions" : base.userOptions,
1345
- "baseElement" : base.$elem,
1346
- "userItems" : base.$userItems,
1347
- "owlItems" : base.$owlItems,
1348
- "currentItem" : base.currentItem,
1349
- "prevItem" : base.prevItem,
1350
- "visibleItems" : base.visibleItems,
1351
- "isTouch" : base.browser.isTouch,
1352
- "browser" : base.browser,
1353
- "dragDirection" : base.dragDirection
1354
- };
1355
- },
1356
-
1357
- clearEvents : function () {
1358
- var base = this;
1359
- base.$elem.off(".owl owl mousedown.disableTextSelect");
1360
- $(document).off(".owl owl");
1361
- $(window).off("resize", base.resizer);
1362
- },
1363
-
1364
- unWrap : function () {
1365
- var base = this;
1366
- if (base.$elem.children().length !== 0) {
1367
- base.$owlWrapper.unwrap();
1368
- base.$userItems.unwrap().unwrap();
1369
- if (base.owlControls) {
1370
- base.owlControls.remove();
1371
- }
1372
- }
1373
- base.clearEvents();
1374
- base.$elem
1375
- .attr("style", base.$elem.data("owl-originalStyles") || "")
1376
- .attr("class", base.$elem.data("owl-originalClasses"));
1377
- },
1378
-
1379
- destroy : function () {
1380
- var base = this;
1381
- base.stop();
1382
- window.clearInterval(base.checkVisible);
1383
- base.unWrap();
1384
- base.$elem.removeData();
1385
- },
1386
-
1387
- reinit : function (newOptions) {
1388
- var base = this,
1389
- options = $.extend({}, base.userOptions, newOptions);
1390
- base.unWrap();
1391
- base.init(options, base.$elem);
1392
- },
1393
-
1394
- addItem : function (htmlString, targetPosition) {
1395
- var base = this,
1396
- position;
1397
-
1398
- if (!htmlString) {return false; }
1399
-
1400
- if (base.$elem.children().length === 0) {
1401
- base.$elem.append(htmlString);
1402
- base.setVars();
1403
- return false;
1404
- }
1405
- base.unWrap();
1406
- if (targetPosition === undefined || targetPosition === -1) {
1407
- position = -1;
1408
- } else {
1409
- position = targetPosition;
1410
- }
1411
- if (position >= base.$userItems.length || position === -1) {
1412
- base.$userItems.eq(-1).after(htmlString);
1413
- } else {
1414
- base.$userItems.eq(position).before(htmlString);
1415
- }
1416
-
1417
- base.setVars();
1418
- },
1419
-
1420
- removeItem : function (targetPosition) {
1421
- var base = this,
1422
- position;
1423
-
1424
- if (base.$elem.children().length === 0) {
1425
- return false;
1426
- }
1427
- if (targetPosition === undefined || targetPosition === -1) {
1428
- position = -1;
1429
- } else {
1430
- position = targetPosition;
1431
- }
1432
-
1433
- base.unWrap();
1434
- base.$userItems.eq(position).remove();
1435
- base.setVars();
1436
- }
1437
-
1438
- };
1439
-
1440
- $.fn.owlCarousel = function (options) {
1441
- return this.each(function () {
1442
- if ($(this).data("owl-init") === true) {
1443
- return false;
1444
- }
1445
- $(this).data("owl-init", true);
1446
- var carousel = Object.create(Carousel);
1447
- carousel.init(options, this);
1448
- $.data(this, "owlCarousel", carousel);
1449
- });
1450
- };
1451
-
1452
- $.fn.owlCarousel.options = {
1453
-
1454
- items : 5,
1455
- itemsCustom : false,
1456
- itemsDesktop : [1199, 4],
1457
- itemsDesktopSmall : [979, 3],
1458
- itemsTablet : [768, 2],
1459
- itemsTabletSmall : false,
1460
- itemsMobile : [479, 1],
1461
- singleItem : false,
1462
- itemsScaleUp : false,
1463
-
1464
- slideSpeed : 200,
1465
- paginationSpeed : 800,
1466
- rewindSpeed : 1000,
1467
-
1468
- autoPlay : false,
1469
- stopOnHover : false,
1470
-
1471
- navigation : false,
1472
- navigationText : ["prev", "next"],
1473
- rewindNav : true,
1474
- scrollPerPage : false,
1475
-
1476
- pagination : true,
1477
- paginationNumbers : false,
1478
-
1479
- responsive : true,
1480
- responsiveRefreshRate : 200,
1481
- responsiveBaseWidth : window,
1482
-
1483
- baseClass : "owl-carousel",
1484
- theme : "owl-theme",
1485
-
1486
- lazyLoad : false,
1487
- lazyFollow : true,
1488
- lazyEffect : "fade",
1489
-
1490
- autoHeight : false,
1491
-
1492
- jsonPath : false,
1493
- jsonSuccess : false,
1494
-
1495
- dragBeforeAnimFinish : true,
1496
- mouseDrag : true,
1497
- touchDrag : true,
1498
-
1499
- addClassActive : false,
1500
- transitionStyle : false,
1501
-
1502
- beforeUpdate : false,
1503
- afterUpdate : false,
1504
- beforeInit : false,
1505
- afterInit : false,
1506
- beforeMove : false,
1507
- afterMove : false,
1508
- afterAction : false,
1509
- startDragging : false,
1510
- afterLazyLoad: false
1511
- };
1512
- }(jQuery, window, document));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
public/owl-carousel/owl.carousel.css DELETED
@@ -1,218 +0,0 @@
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/style.css DELETED
@@ -1,157 +0,0 @@
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,10 +1,10 @@
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.5
6
- Tested up to: 4.6
7
- Stable tag: 1.5.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -12,11 +12,23 @@ Touch enabled wordpress plugin that lets you create beautiful responsive carouse
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
  If you like this plugin, please give us ratings for future improvement.
19
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  = Usage 1st method =
21
 
22
  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:
@@ -151,30 +163,34 @@ Do you have questions or issues with Carousel Slider? [Ask for support here](htt
151
 
152
  == Screenshots ==
153
 
154
- 1. Screenshot of Carousel Custom Post Type (Add New Carousel)
155
  2. Screenshot of Carousel All Carousel
156
- 3. Screenshot of Carousel Front-end Example.
 
 
 
 
157
 
158
  == Changelog ==
159
 
160
- = version 1.5.1 =
 
 
 
 
 
 
 
 
161
  * Version compatibility check and some bug fix.
162
 
163
- = version 1.5.0 =
164
 
165
  * Added graphical interface to add carousel
166
  * Added shortcode attributes 'inifnity_loop', 'autoplay_timeout', 'autoplay_speed', 'slide_by', 'nav_color', 'nav_active_color', 'margin_right'
167
  * Removed shortcode 'carousel_slider' and 'all-carousels'
168
  * Removed shortcode attributes 'pagination_speed', 'rewind_speed', 'scroll_per_page', 'pagination_numbers', 'auto_height', 'single_item'
169
 
170
- = version 1.4.2 =
171
-
172
- * Bug fixed release
173
-
174
- = version 1.4.1 =
175
-
176
- * Bug fixed release
177
-
178
  = version 1.4.0 =
179
 
180
  * Added option to add custom image size
@@ -183,36 +199,22 @@ Do you have questions or issues with Carousel Slider? [Ask for support here](htt
183
  * Added feature to add multiple slider at page, post or theme by custom post category slug
184
  * Re-write with Object-oriented programming (OOP)
185
 
186
- = version 1.3 =
187
 
188
  * Tested with WordPress version 4.1
189
 
190
- = version 1.2 =
191
 
192
  * Fixed bugs regarding shortcode.
193
  * Added href="" to add link to post, page or media
194
  * Translation ready
195
 
196
- = version 1.1 =
197
 
198
  * Fixed some bugs.
199
 
200
- = version 1.0 =
201
-
202
  * Initial release.
203
 
204
  == Upgrade Notice ==
205
-
206
- = 1.5.0 =
207
- 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.
208
-
209
- = 1.4.0 =
210
- 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.
211
-
212
- == CREDIT ==
213
-
214
- Some open source framework have been used. For detail [click here](http://owlgraphic.com/owlcarousel/)
215
-
216
- == CONTACT ==
217
-
218
- [Sayful Islam](http://sayfulit.com/)
1
  === Carousel Slider ===
2
  Contributors: sayful
3
+ Tags: widget, shortcode, images, carousel, carousel slider, image carousel, slider, owl carousel
4
+ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=3LZWQTHEVYWCY
5
  Requires at least: 3.5
6
+ Tested up to: 4.7
7
+ Stable tag: 1.5.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
12
 
13
  == Description ==
14
 
15
+ Touch enabled WordPress plugin based on [OWL Carousel](http://www.owlgraphic.com/owlcarousel/) that lets you create beautiful responsive carousel slider.
 
16
 
17
  If you like this plugin, please give us ratings for future improvement.
18
 
19
+ = Features =
20
+
21
+ * Fully Responsive
22
+ * Unlimited Slides
23
+ * Supported in all major browsers
24
+ * Touch and Grab enabled
25
+ * CSS3 3D Acceleration
26
+ * Multiple carousel on single page
27
+ * Lazy load images
28
+ * Navigation and pagination with unlimited colors
29
+ * Support image title and caption option
30
+ * and more options
31
+
32
  = Usage 1st method =
33
 
34
  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:
163
 
164
  == Screenshots ==
165
 
166
+ 1. Screenshot of Carousel Front-end Example.
167
  2. Screenshot of Carousel All Carousel
168
+ 3. Screenshot of Carousel Image Settings
169
+ 4. Screenshot of Carousel General Settings
170
+ 5. Screenshot of Carousel Navigation Settings
171
+ 6. Screenshot of Carousel Autoplay Settings
172
+ 7. Screenshot of Carousel Responsive Settings
173
 
174
  == Changelog ==
175
 
176
+ = version 1.5.2 - 2016-12-03 =
177
+ * Added - Added options to show title and caption on carousel item.
178
+ * Added - Lazy Load of images.
179
+ * Added - Support multiple carousel slide at same page.
180
+ * Added - New Carousel Slider Widget to add carousel at widget. Especially helpful for page builder that use widget like "SiteOrigin Page Builder".
181
+ * Added - New Element added for WPBakery Visual Composer page builder. If you are using WPBakery Visual Composer page.
182
+ * Merged - All CSS styles in on file.
183
+
184
+ = version 1.5.1 - 2016-08-11 =
185
  * Version compatibility check and some bug fix.
186
 
187
+ = version 1.5.0 - 2016-02-05 =
188
 
189
  * Added graphical interface to add carousel
190
  * Added shortcode attributes 'inifnity_loop', 'autoplay_timeout', 'autoplay_speed', 'slide_by', 'nav_color', 'nav_active_color', 'margin_right'
191
  * Removed shortcode 'carousel_slider' and 'all-carousels'
192
  * Removed shortcode attributes 'pagination_speed', 'rewind_speed', 'scroll_per_page', 'pagination_numbers', 'auto_height', 'single_item'
193
 
 
 
 
 
 
 
 
 
194
  = version 1.4.0 =
195
 
196
  * Added option to add custom image size
199
  * Added feature to add multiple slider at page, post or theme by custom post category slug
200
  * Re-write with Object-oriented programming (OOP)
201
 
202
+ = version 1.3.0 =
203
 
204
  * Tested with WordPress version 4.1
205
 
206
+ = version 1.2.0 =
207
 
208
  * Fixed bugs regarding shortcode.
209
  * Added href="" to add link to post, page or media
210
  * Translation ready
211
 
212
+ = version 1.1.0 - 2014-07-15 =
213
 
214
  * Fixed some bugs.
215
 
216
+ = version 1.0.0 - 2014-06-30 =
 
217
  * Initial release.
218
 
219
  == Upgrade Notice ==
220
+ Update to get exciting new features and better security.
 
 
 
 
 
 
 
 
 
 
 
 
 
screenshot-1.jpg ADDED
Binary file
screenshot-1.png DELETED
Binary file
screenshot-2.jpg ADDED
Binary file
screenshot-2.png DELETED
Binary file
screenshot-3.jpg ADDED
Binary file
screenshot-3.png DELETED
Binary file
screenshot-4.jpg ADDED
Binary file
screenshot-5.jpg ADDED
Binary file
screenshot-6.jpg ADDED
Binary file
screenshot-7.jpg ADDED
Binary file
shortcodes/Carousel_Slider_Shortcode.php ADDED
@@ -0,0 +1,161 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // If this file is called directly, abort.
3
+ if ( ! defined( 'WPINC' ) ) {
4
+ die;
5
+ }
6
+
7
+ if( ! class_exists('Carousel_Slider_Shortcode') ):
8
+
9
+ class Carousel_Slider_Shortcode
10
+ {
11
+ private $plugin_path;
12
+ private $plugin_url;
13
+
14
+ public function __construct( $plugin_path, $plugin_url )
15
+ {
16
+ $this->plugin_path = $plugin_path;
17
+ $this->plugin_url = $plugin_url;
18
+
19
+ add_shortcode('carousel_slide', array( $this, 'carousel_slide' ) );
20
+ add_shortcode('carousel', array( $this, 'carousel' ) );
21
+ add_shortcode('item', array( $this, 'item' ) );
22
+ }
23
+
24
+ /**
25
+ * A shortcode for rendering the carousel slide.
26
+ *
27
+ * @param array $attributes Shortcode attributes.
28
+ * @param string $content The text content for shortcode. Not used.
29
+ *
30
+ * @return string The shortcode output
31
+ */
32
+ public function carousel_slide( $attributes, $content = null )
33
+ {
34
+ extract(
35
+ shortcode_atts(
36
+ array( 'id' =>'' ),
37
+ $attributes
38
+ )
39
+ );
40
+ if ( ! $id ) return;
41
+ $images_ids = array_filter( explode( ',', get_post_meta( $id, '_wpdh_image_ids', true ) ) );
42
+
43
+ ob_start();
44
+ require $this->plugin_path . '/templates/carousel_slide.php';
45
+ $html = ob_get_contents();
46
+ ob_end_clean();
47
+
48
+ return $html;
49
+ }
50
+
51
+ /**
52
+ * A shortcode for rendering the carousel slide.
53
+ *
54
+ * @param array $atts Shortcode attributes.
55
+ * @param string $content The text content for shortcode. Not used.
56
+ *
57
+ * @return string The shortcode output
58
+ */
59
+ public function carousel( $atts, $content = null )
60
+ {
61
+ extract(shortcode_atts(array(
62
+ 'id' => rand(1, 10),
63
+ 'items' => '4',
64
+ 'items_desktop' => '4',
65
+ 'items_desktop_small' => '3',
66
+ 'items_tablet' => '2',
67
+ 'items_mobile' => '1',
68
+ 'auto_play' => 'true',
69
+ 'stop_on_hover' => 'true',
70
+ 'navigation' => 'true',
71
+ 'pagination' => 'false',
72
+ 'nav_color' => '#f1f1f1',
73
+ 'nav_active_color' => '#4caf50',
74
+ 'margin_right' => '10',
75
+ 'inifnity_loop' => 'true',
76
+ 'autoplay_timeout' => '5000',
77
+ 'autoplay_speed' => '500',
78
+ 'slide_by' => '1',
79
+ ), $atts ) );
80
+
81
+ $html = '';
82
+ $html .= '<div id="carousel-slider" class="carousel-slider">';
83
+ $html .= '<div id="id-'.$id.'" class="owl-carousel sp-theme">';
84
+ $html .= do_shortcode($content);
85
+ $html .= '</div>';
86
+ $html .= '<style type="text/css">
87
+ #id-'.$id.'.owl-theme .owl-dots .owl-dot span,
88
+ #id-'.$id.'.owl-theme .owl-nav [class*="owl-"]:first-child,
89
+ #id-'.$id.'.owl-theme .owl-nav [class*="owl-"]:last-child {
90
+ background-color: '.$nav_color.';
91
+ }
92
+ #id-'.$id.'.owl-theme .owl-dots .owl-dot.active span,
93
+ #id-'.$id.'.owl-theme .owl-dots .owl-dot:hover span,
94
+ #id-'.$id.'.owl-theme .owl-nav [class*="owl-"]:first-child:hover,
95
+ #id-'.$id.'.owl-theme .owl-nav [class*="owl-"]:last-child:hover {
96
+ background-color: '.$nav_active_color.';
97
+ }
98
+ </style>';
99
+
100
+ $html .='<script type="text/javascript">
101
+ jQuery(document).ready(function($) {
102
+ $(\'#id-'.$id.'\').owlCarousel({
103
+ nav : '.$navigation.',
104
+ dots: '.$pagination.',
105
+ margin:'.$margin_right.',
106
+ loop :'.$inifnity_loop.',
107
+ autoplay: '.$auto_play.',
108
+ autoplayTimeout: '.$autoplay_timeout.',
109
+ autoplaySpeed: '.$autoplay_speed.',
110
+ autoplayHoverPause: '.$stop_on_hover.',
111
+ slideBy: '.$slide_by.',
112
+ responsiveClass:true,
113
+ responsive:{
114
+ 320:{ items:'.$items_mobile.' },
115
+ 600:{ items:'.$items_tablet.' },
116
+ 768:{ items:'.$items_desktop_small.' },
117
+ 980:{ items:'.$items_desktop.' },
118
+ 1200:{ items:'.$items.' }
119
+ }
120
+ });
121
+ });
122
+ </script>';
123
+ $html .='</div>';
124
+ return $html;
125
+ }
126
+
127
+ /**
128
+ * A shortcode for rendering the carousel slide.
129
+ *
130
+ * @param array $attributes Shortcode attributes.
131
+ * @param string $content The text content for shortcode. Not used.
132
+ *
133
+ * @return string The shortcode output
134
+ */
135
+ public function item( $attributes, $content = null )
136
+ {
137
+ extract(shortcode_atts(array(
138
+ 'img_link' =>'',
139
+ 'href' =>'',
140
+ 'target' =>'_self',
141
+ ), $attributes ) );
142
+
143
+ if ( filter_var( $href, FILTER_VALIDATE_URL ) ) {
144
+ return sprintf(
145
+ '<div><a target="%3$s" href="%2$s"><img src="%1$s"></a></div>',
146
+ $img_link,
147
+ $href,
148
+ $target
149
+ );
150
+ } else {
151
+
152
+ if ( filter_var( $img_link, FILTER_VALIDATE_URL ) ) {
153
+ return sprintf('<div><img src="%s"></div>', $img_link );
154
+ } else {
155
+ return '';
156
+ }
157
+ }
158
+ }
159
+ }
160
+
161
+ endif;
shortcodes/index.php ADDED
@@ -0,0 +1,2 @@
 
 
1
+ <?php
2
+ // Silence is golden
shortcodes/shortcodes.php DELETED
@@ -1,188 +0,0 @@
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');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
templates/carousel.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <div id="carousel-slider" class="carousel-slider">
2
+ <div id="id-<?php echo $id; ?>" class="owl-carousel sp-theme">
3
+ <?php echo do_shortcode($content); ?>
4
+ </div><!-- #id-## -->
5
+ </div><!-- #carousel-slider -->
templates/carousel_slide.php ADDED
@@ -0,0 +1,144 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_image_size = get_post_meta( $id, '_image_size', true );
3
+ $_nav_color = get_post_meta( $id, '_nav_color', true );
4
+ $_nav_active_color = get_post_meta( $id, '_nav_active_color', true );
5
+ $_lazy_load_image = get_post_meta( $id, '_lazy_load_image', true );
6
+ $_show_attachment_title = get_post_meta( $id, '_show_attachment_title', true );
7
+ $_show_attachment_caption = get_post_meta( $id, '_show_attachment_caption', true );
8
+
9
+ $loading_image = $this->plugin_url . '/assets/img/ajax-loader.gif';
10
+
11
+ if( count( $images_ids ) > 0 ): ?>
12
+ <div id="carousel-slider" class="carousel-slider">
13
+ <style type="text/css" scoped>
14
+ #id-<?php echo $id; ?> .owl-nav [class*='owl-'],
15
+ #id-<?php echo $id; ?> .owl-dots .owl-dot span {
16
+ background-color: <?php echo $_nav_color; ?>
17
+ }
18
+ #id-<?php echo $id; ?> .owl-nav [class*='owl-']:hover,
19
+ #id-<?php echo $id; ?> .owl-dots .owl-dot.active span,
20
+ #id-<?php echo $id; ?> .owl-dots .owl-dot:hover span {
21
+ background-color: <?php echo $_nav_active_color; ?>
22
+ }
23
+ </style>
24
+ <div id="id-<?php echo $id; ?>" class="owl-carousel sp-theme">
25
+ <?php
26
+ foreach ( $images_ids as $image_id ):
27
+
28
+ $get_post = get_post( $image_id );
29
+ $image_title = $get_post->post_title;
30
+ $image_caption = $get_post->post_excerpt;
31
+ $image_description = $get_post->post_content;
32
+ $image_alt_text = trim( strip_tags( get_post_meta( $image_id, '_wp_attachment_image_alt', true ) ) );
33
+
34
+ echo '<div class="carousel-slider__item">';
35
+
36
+ $title = sprintf( '<h4 class="title">%1$s</h4>', $image_title );
37
+ $caption = sprintf( '<p class="caption">%1$s</p>', $image_caption );
38
+
39
+ if ( $_show_attachment_title == 'on' && $_show_attachment_caption == 'on' ) {
40
+
41
+ $full_caption = sprintf('<div class="carousel-slider__caption">%1$s%2$s</div>', $title, $caption);
42
+
43
+ } elseif( $_show_attachment_title == 'on' ){
44
+
45
+ $full_caption = sprintf('<div class="carousel-slider__caption">%s</div>', $title);
46
+
47
+ } elseif( $_show_attachment_caption == 'on' ){
48
+
49
+ $full_caption = sprintf('<div class="carousel-slider__caption">%s</div>', $caption);
50
+
51
+ } else {
52
+ $full_caption = '';
53
+ }
54
+
55
+ if ( $_lazy_load_image == 'on' ) {
56
+
57
+ $image_src = wp_get_attachment_image_src( $image_id, $_image_size );
58
+ $image = sprintf(
59
+ '<img class="owl-lazy" data-src="%1$s" width="%2$s" height="%3$s" alt="%4$s" />',
60
+ $image_src[0],
61
+ $image_src[1],
62
+ $image_src[2],
63
+ $image_alt_text
64
+ );
65
+
66
+ } else {
67
+ $image = wp_get_attachment_image( $image_id, $_image_size, false, array( 'alt' => $image_alt_text ) );
68
+ }
69
+
70
+ if ( filter_var( $image_description, FILTER_VALIDATE_URL) ) {
71
+
72
+ echo '<a href="'.$image_description.'">';
73
+
74
+ echo $image;
75
+ echo $full_caption ;
76
+
77
+ echo '</a>';
78
+
79
+ } else {
80
+
81
+ echo $image ;
82
+ echo $full_caption ;
83
+ }
84
+
85
+ echo '</div>';
86
+
87
+ endforeach;
88
+ ?>
89
+ </div><!-- #id-## -->
90
+ </div><!-- #carousel-slider -->
91
+ <?php endif; //if( count( $images_ids ) > 0 ):
92
+
93
+ add_action('wp_footer', function() use ( $id )
94
+ {
95
+ $_items_small_desktop = get_post_meta( $id, '_items_small_desktop', true );
96
+ $_items_portrait_tablet = get_post_meta( $id, '_items_portrait_tablet', true );
97
+ $_items_small_portrait_tablet = get_post_meta( $id, '_items_small_portrait_tablet', true );
98
+ $_items_portrait_mobile = get_post_meta( $id, '_items_portrait_mobile', true );
99
+ $_items = get_post_meta( $id, '_items', true );
100
+ $_image_size = get_post_meta( $id, '_image_size', true );
101
+ $_slide_by = get_post_meta( $id, '_slide_by', true );
102
+ $_margin_right = get_post_meta( $id, '_margin_right', true );
103
+ $_nav_button = get_post_meta( $id, '_nav_button', true );
104
+ $_nav_button = ($_nav_button == 'on') ? 'true' : 'false';
105
+ $_dot_nav = get_post_meta( $id, '_dot_nav', true );
106
+ $_dot_nav = ($_dot_nav == 'on') ? 'true' : 'false';
107
+ $_inifnity_loop = get_post_meta( $id, '_inifnity_loop', true );
108
+ $_inifnity_loop = ($_inifnity_loop == 'on') ? 'true' : 'false';
109
+ $_autoplay = get_post_meta( $id, '_autoplay', true );
110
+ $_autoplay = ($_autoplay == 'on') ? 'true' : 'false';
111
+ $_autoplay_timeout = get_post_meta( $id, '_autoplay_timeout', true );
112
+ $_autoplay_speed = get_post_meta( $id, '_autoplay_speed', true );
113
+ $_autoplay_pause = get_post_meta( $id, '_autoplay_pause', true );
114
+ $_autoplay_pause = ($_autoplay_pause == 'on') ? 'true' : 'false';
115
+ ?>
116
+ <script type="text/javascript">
117
+ jQuery( document ).ready( function( $ ) {
118
+ var carouselSlider = $('#id-<?php echo $id; ?>');
119
+ carouselSlider.owlCarousel({
120
+ nav : <?php echo $_nav_button; ?>,
121
+ dots: <?php echo $_dot_nav; ?>,
122
+ margin:<?php echo $_margin_right; ?>,
123
+ loop :<?php echo $_inifnity_loop; ?>,
124
+ autoplay: <?php echo $_autoplay; ?>,
125
+ autoplayTimeout: <?php echo $_autoplay_timeout; ?>,
126
+ autoplaySpeed: <?php echo $_autoplay_speed; ?>,
127
+ autoplayHoverPause: <?php echo $_autoplay_pause; ?>,
128
+ slideBy: <?php echo $_slide_by; ?>,
129
+ responsiveClass:true,
130
+ lazyLoad:true,
131
+ responsive:{
132
+ 320:{ items:<?php echo $_items_portrait_mobile; ?> },
133
+ 600:{ items:<?php echo $_items_portrait_tablet; ?> },
134
+ 768:{ items:<?php echo $_items_portrait_tablet; ?> },
135
+ 980:{ items:<?php echo $_items_small_desktop; ?> },
136
+ 1200:{ items:<?php echo $_items; ?> }
137
+ }
138
+ });
139
+ });
140
+ </script>
141
+ <?php
142
+ }, 30);
143
+
144
+ ?>
{admin/partials → templates}/documentation.php RENAMED
@@ -6,6 +6,11 @@
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>
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
+ <div id="dashboard-widgets-wrap">
10
+ <div id="dashboard-widgets" class="metabox-holder">
11
+ </div>
12
+ </div>
13
+
14
  <h2>From Version 1.5.0</h2>
15
 
16
  <hr><iframe width="560" height="315" src="https://www.youtube.com/embed/O4-EM32h7b4?list=PL9GiQPpTzMv5ftsvX55JO_lTDcKrwCPVn" frameborder="0" allowfullscreen></iframe><hr>
templates/index.php ADDED
@@ -0,0 +1,2 @@
 
 
1
+ <?php
2
+ // Silence is golden
widgets/widget-carousel_slider.php ADDED
@@ -0,0 +1,122 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // If this file is called directly, abort.
3
+ if ( ! defined( 'WPINC' ) ) {
4
+ die;
5
+ }
6
+
7
+ class Widget_Carousel_Slider extends WP_Widget {
8
+
9
+ /**
10
+ * Sets up the widgets name etc
11
+ */
12
+ public function __construct() {
13
+ $widget_ops = array(
14
+ 'classname' => 'widget_carousel_slider',
15
+ 'description' => 'Easily use carousel slider in widget area.',
16
+ );
17
+ parent::__construct( 'widget_carousel_slider', 'Carousel Slider', $widget_ops );
18
+ }
19
+
20
+ /**
21
+ * Outputs the content of the widget
22
+ *
23
+ * @param array $args
24
+ * @param array $instance
25
+ */
26
+ public function widget( $args, $instance ) {
27
+ extract($args);
28
+
29
+ wp_enqueue_style( 'carousel-slider' );
30
+ wp_enqueue_script( 'owl-carousel' );
31
+
32
+ $carousel_id = $instance['carousel_id'];
33
+ echo $args['before_widget'];
34
+ echo do_shortcode('[carousel_slide id='. $carousel_id .']');
35
+ echo $args['after_widget'];
36
+ }
37
+
38
+ /**
39
+ * Outputs the options form on admin
40
+ *
41
+ * @param array $instance The widget options
42
+ */
43
+ public function form( $instance ) {
44
+ $args = array(
45
+ 'post_type' => 'carousels',
46
+ 'post_status' => 'publish',
47
+ );
48
+ $query = new WP_Query( $args );
49
+
50
+ if ( $query->have_posts() ) {
51
+
52
+ while ( $query->have_posts() ) {
53
+ $query->the_post();
54
+
55
+ echo "<label style='display: block;overflow: hidden;width: 100%; margin: 10px 0;'>";
56
+
57
+ $carousel_id = ! empty( $instance['carousel_id'] ) ? $instance['carousel_id'] : null;
58
+ $checked = $carousel_id == get_the_ID() ? 'checked="checket"' : '';
59
+ echo sprintf(
60
+ '<input type="radio" name="%s" value="%d" style="%s" %s>',
61
+ $this->get_field_name( 'carousel_id' ),
62
+ get_the_ID(),
63
+ 'float: left;margin: 10px 10px 0 0;',
64
+ $checked
65
+ );
66
+
67
+ $image_ids = explode(',', get_post_meta( get_the_ID(), '_wpdh_image_ids', true) );
68
+ echo $this->thumbnail_list( $image_ids );
69
+
70
+ echo "</label>";
71
+ }
72
+ wp_reset_postdata();
73
+
74
+ } else {
75
+ echo sprintf('%1$sYou did not add any carousel slider yet. %3$s%4$s%5$s to create a new carousel slider now.%2$s',
76
+ '<p>',
77
+ '</p>',
78
+ '<a href="'. admin_url('post-new.php?post_type=carousels') .'">',
79
+ __('click here'),
80
+ '</a>'
81
+ );
82
+ }
83
+ }
84
+
85
+ private function thumbnail_list( $ids )
86
+ {
87
+ $show_more_icon = false;
88
+ if ( count($ids) > 6 ) {
89
+ $ids = array_slice($ids, 0, 5);
90
+ $show_more_icon = true;
91
+ }
92
+ $html = "<ul style='float: left;margin:0;'>";
93
+ foreach ( $ids as $id ) {
94
+ $src = wp_get_attachment_image_src( $id, array(32,32) );
95
+ $html .= "<li style='display:inline;margin-right:5px;'><img src='{$src[0]}' width='{$src[1]}' height='{$src[2]}'></li>";
96
+ }
97
+ if ($show_more_icon) {
98
+ $html .= "<li style='display: inline;'>";
99
+ $html .= "<span style='display: inline;font-size: 14px;height: 32px;vertical-align: top;width: 32px;'>More +</span>";
100
+ $html .= "</li>";
101
+ }
102
+ $html .= "</ul>";
103
+ return $html;
104
+ }
105
+
106
+ /**
107
+ * Processing widget options on save
108
+ *
109
+ * @param array $new_instance The new options
110
+ * @param array $old_instance The previous options
111
+ */
112
+ public function update( $new_instance, $old_instance ) {
113
+ $instance = array();
114
+ $instance['carousel_id'] = ( ! empty( $new_instance['carousel_id'] ) ) ? strip_tags( $new_instance['carousel_id'] ) : '';
115
+
116
+ return $instance;
117
+ }
118
+ }
119
+
120
+ add_action( 'widgets_init', function(){
121
+ register_widget( 'Widget_Carousel_Slider' );
122
+ });