Version Description
- Initial release
=
Download this release
Release Info
Developer | yithemes |
Plugin | YITH WooCommerce Zoom Magnifier |
Version | 1.0.0 |
Comparing to | |
See all releases |
Version 1.0.0
- README.txt +91 -0
- assets/css/admin.css +16 -0
- assets/css/frontend.css +51 -0
- assets/css/yith_magnifier.css +71 -0
- assets/images/slider-arrow.png +0 -0
- assets/js/frontend.js +43 -0
- assets/js/frontend.min.js +9 -0
- assets/js/jquery.carouFredSel.js +4255 -0
- assets/js/jquery.carouFredSel.min.js +16 -0
- assets/js/yith_magnifier.js +751 -0
- assets/js/yith_magnifier.min.js +27 -0
- class.yith-wcmg-admin.php +633 -0
- class.yith-wcmg-frontend.php +116 -0
- class.yith-wcmg.php +88 -0
- functions.yith-wcmg.php +52 -0
- init.php +54 -0
- languages/default.po +222 -0
- languages/yit-it_IT.mo +0 -0
- languages/yit-it_IT.po +236 -0
- languages/yit.pot +220 -0
- screenshot-1.png +0 -0
- screenshot-2.png +0 -0
- templates/single-product/product-image-magnifier.php +86 -0
- templates/single-product/product-thumbnails-magnifier.php +59 -0
- uninstall.php +15 -0
- yit-common/yit-functions.php +90 -0
README.txt
ADDED
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
=== YITH WooCommerce Zoom Magnifier ===
|
2 |
+
|
3 |
+
Contributors: yithemes
|
4 |
+
Tags: zoom, magnifier, woocommerce, products, themes, yit, e-commerce, shop
|
5 |
+
Requires at least: 3.5.1
|
6 |
+
Tested up to: 3.5.1
|
7 |
+
Stable tag: 1.0.0
|
8 |
+
License: GPLv2 or later
|
9 |
+
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
+
|
11 |
+
YITH WooCommerce Zoom Magnifier is a Wordpress plugins that enables you to add a zoom effect to product images.
|
12 |
+
|
13 |
+
== Description ==
|
14 |
+
|
15 |
+
= Improve the user experience, improve your sales =
|
16 |
+
|
17 |
+
Offer to your visitors a chance to inspect in detail the quality of your products. With YITH WooCommerce Zoom Magnifier you can add a zoom effect to all your product images.
|
18 |
+
The Wordpress plugin also adds a slider below the featured image with your product gallery images.
|
19 |
+
|
20 |
+
A working demo is available [here](http://demo.yithemes.com/room09/product/africa-style/). Full documentation is available [here](http://yithemes.com/docs-plugins/yith_magnifier/).
|
21 |
+
|
22 |
+
= Installation =
|
23 |
+
|
24 |
+
Once you have installed the plugin, you just need to activate the plugin in order to enable it.
|
25 |
+
|
26 |
+
= Configuration =
|
27 |
+
|
28 |
+
YITH WooCommerce Zoom Magnifier will add a new tab called "Magnifier" below the Woocommerce -> Settings menu. Here you are able to configure all the plugin settings.
|
29 |
+
|
30 |
+
= Developer =
|
31 |
+
|
32 |
+
Are you a developer? Want to customize the templates or the style of the plugin? Read on the [documentation](http://yithemes.com/docs-plugins/yith_magnifier/) and discover how to do that.
|
33 |
+
|
34 |
+
= Support =
|
35 |
+
|
36 |
+
Hi there, we have good news here: all our plugins are released for free. Wow!
|
37 |
+
Already knew it, right?! Great, but maybe you do not know that: if you're looking for how to install the plugins or how to use them within your Wordpress installations, which is the right way to ask support?
|
38 |
+
That's the way:
|
39 |
+
|
40 |
+
* Register on http://yithemes.com
|
41 |
+
* Go to Support > Get Support
|
42 |
+
|
43 |
+
Here we provide support, not on wordpress.org were, usually we do not read topics. It's better to follow us or write on our forum!
|
44 |
+
|
45 |
+
== Installation ==
|
46 |
+
|
47 |
+
1. Unzip the downloaded zip file.
|
48 |
+
2. Upload the plugin folder into the `wp-content/plugins/` directory of your WordPress site.
|
49 |
+
3. Activate `YITH WooCommerce Zoom Magnifier` from Plugins page
|
50 |
+
|
51 |
+
== Frequently Asked Questions ==
|
52 |
+
|
53 |
+
= The size of the Zoom image is not the size I setted. Why? =
|
54 |
+
If you enabled the plugin after you uploaded the images of the product you need to [regenerate the thumbnails](http://wordpress.org/extend/plugins/regenerate-thumbnails/ "regenerate the thumbnails") before to use it. Another reason could be that the size setted for the zoom images is greather than the original image size.
|
55 |
+
|
56 |
+
= I'm not able to change the sizes of Zoom Image. Why? =
|
57 |
+
The size of the Zoom Image is automatically setted. If you want to change these values you just need to untick the option Forcing Zoom Image sizes.
|
58 |
+
|
59 |
+
== Screenshots ==
|
60 |
+
|
61 |
+
1. The plugin at work displaying the magnifier
|
62 |
+
2. The Magnifier settings page
|
63 |
+
|
64 |
+
== Changelog ==
|
65 |
+
|
66 |
+
= 1.0.0 =
|
67 |
+
|
68 |
+
* Initial release
|
69 |
+
|
70 |
+
== Suggestions ==
|
71 |
+
|
72 |
+
If you have suggestions about how to improve YITH WooCommerce Zoom Magnifier, you can [write us](mailto:plugins@yithemes.com "Your Inspiration Themes") so we can bundle them into YITH Zoom WooCommerce Magnifier.
|
73 |
+
|
74 |
+
== Translators ==
|
75 |
+
|
76 |
+
= Available Languages =
|
77 |
+
* English (Default)
|
78 |
+
* Italiano
|
79 |
+
|
80 |
+
If you have created your own language pack, or have an update for an existing one, you can send [gettext PO and MO file](http://codex.wordpress.org/Translating_WordPress "Translating WordPress")
|
81 |
+
[use](http://yithemes.com/contact/ "Your Inspiration Themes") so we can bundle it into YITH WooCommerce Zoom Magnfier Languages.
|
82 |
+
|
83 |
+
== Documentation ==
|
84 |
+
|
85 |
+
Full documentation is available [here](http://yithemes.com/docs-plugins/yith_magnifier/).
|
86 |
+
|
87 |
+
== Upgrade notice ==
|
88 |
+
|
89 |
+
= 1.0.0 =
|
90 |
+
|
91 |
+
Initial release
|
assets/css/admin.css
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.yith_woocommerce_slider {
|
2 |
+
width: 300px;
|
3 |
+
float: left
|
4 |
+
}
|
5 |
+
.yith_woocommerce_slider_value {
|
6 |
+
margin-top: -5px;
|
7 |
+
margin-left: 10px;
|
8 |
+
width: 50px;
|
9 |
+
float: left;
|
10 |
+
text-align: center;
|
11 |
+
font-weight: bold;
|
12 |
+
}
|
13 |
+
|
14 |
+
.yith_banner {
|
15 |
+
margin-top: 10px;
|
16 |
+
}
|
assets/css/frontend.css
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* gallery */
|
2 |
+
.yith_magnifier_gallery {
|
3 |
+
margin: 0;
|
4 |
+
padding: 0;
|
5 |
+
}
|
6 |
+
.yith_magnifier_gallery li {
|
7 |
+
position: relative;
|
8 |
+
float: left;
|
9 |
+
display: block;
|
10 |
+
}
|
11 |
+
.yith_magnifier_gallery li.last {
|
12 |
+
margin-right: 0;
|
13 |
+
}
|
14 |
+
.yith_magnifier_gallery li a {
|
15 |
+
width: 100% !important;
|
16 |
+
display: block;
|
17 |
+
margin-top: 10px;
|
18 |
+
height: auto !important;
|
19 |
+
}
|
20 |
+
|
21 |
+
/* next/prev */
|
22 |
+
.single-product.woocommerce .thumbnails {
|
23 |
+
position: relative;
|
24 |
+
}
|
25 |
+
.single-product.woocommerce .thumbnails #slider-prev,
|
26 |
+
.single-product.woocommerce .thumbnails #slider-next {
|
27 |
+
display: none !important;
|
28 |
+
cursor: pointer;
|
29 |
+
width: 27px;
|
30 |
+
height: 26px;
|
31 |
+
background: url('../images/slider-arrow.png') no-repeat left center;
|
32 |
+
position: absolute;
|
33 |
+
top: 48%;
|
34 |
+
margin-top: -2px;
|
35 |
+
}
|
36 |
+
|
37 |
+
.single-product.woocommerce .thumbnails #slider-prev {
|
38 |
+
background-position: left center;
|
39 |
+
left: 0px;
|
40 |
+
}
|
41 |
+
.single-product.woocommerce .thumbnails #slider-next {
|
42 |
+
background-position: right center;
|
43 |
+
right: 0px;
|
44 |
+
}
|
45 |
+
|
46 |
+
.single-product.woocommerce .thumbnails:hover #slider-prev,
|
47 |
+
.single-product.woocommerce .thumbnails:hover #slider-next {
|
48 |
+
display: block !important;
|
49 |
+
}
|
50 |
+
|
51 |
+
span.onsale { z-index: 10000 }
|
assets/css/yith_magnifier.css
ADDED
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.yith_magnifier_zoom_wrap {
|
2 |
+
top: 0;
|
3 |
+
z-index: 9999;
|
4 |
+
position: relative;
|
5 |
+
}
|
6 |
+
|
7 |
+
.yith_magnifier_loading {
|
8 |
+
color:white;
|
9 |
+
background:#222;
|
10 |
+
padding:3px;
|
11 |
+
border:1px solid #000;
|
12 |
+
position: absolute;
|
13 |
+
text-align: center;
|
14 |
+
top: 10%;
|
15 |
+
z-index: 9999;
|
16 |
+
}
|
17 |
+
|
18 |
+
.yith_magnifier_zoom {
|
19 |
+
position: relative;
|
20 |
+
display: block;
|
21 |
+
}
|
22 |
+
|
23 |
+
.yith_magnifier_zoom img {
|
24 |
+
display: block;
|
25 |
+
}
|
26 |
+
|
27 |
+
.yith_magnifier_mousetrap {
|
28 |
+
z-index: 999;
|
29 |
+
position: absolute;
|
30 |
+
width: 0px;
|
31 |
+
height :0px;
|
32 |
+
left: 0;
|
33 |
+
top: 0;
|
34 |
+
}
|
35 |
+
|
36 |
+
/* ie fix */
|
37 |
+
.ie .yith_magnifier_mousetrap {
|
38 |
+
background-image: url(".");
|
39 |
+
}
|
40 |
+
|
41 |
+
.yith_magnifier_lens {
|
42 |
+
display: none;
|
43 |
+
z-index:98;
|
44 |
+
position:absolute;
|
45 |
+
overflow: hidden;
|
46 |
+
|
47 |
+
border: 1px solid #ccc;
|
48 |
+
}
|
49 |
+
|
50 |
+
.yith_magnifier_lens img {
|
51 |
+
width: auto !important;
|
52 |
+
max-width: none !important;
|
53 |
+
|
54 |
+
-webkit-transition: all ease-in-out 0s !important;
|
55 |
+
-moz-transition: all ease-in-out 0s !important;
|
56 |
+
-o-transition: all ease-in-out 0s !important;
|
57 |
+
transition: all ease-in-out 0s !important;
|
58 |
+
}
|
59 |
+
|
60 |
+
.yith_magnifier_zoom_magnifier {
|
61 |
+
display:none;
|
62 |
+
position:absolute;
|
63 |
+
z-index: 99;
|
64 |
+
|
65 |
+
border:4px solid #ccc;
|
66 |
+
overflow:hidden;
|
67 |
+
}
|
68 |
+
|
69 |
+
.yith_magnifier_gallery {
|
70 |
+
list-style: none;
|
71 |
+
}
|
assets/images/slider-arrow.png
ADDED
Binary file
|
assets/js/frontend.js
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* frontend.js
|
3 |
+
*
|
4 |
+
* @author Your Inspiration Themes
|
5 |
+
* @package YITH WooCommerce Zoom Magnifier
|
6 |
+
* @version 1.0.0
|
7 |
+
*/
|
8 |
+
jQuery(document).ready(function($){
|
9 |
+
|
10 |
+
var yith_wcmg = $('.images');
|
11 |
+
var yith_wcmg_zoom = $('.yith_magnifier_zoom');
|
12 |
+
var yith_wcmg_image = $('.yith_magnifier_zoom img');
|
13 |
+
|
14 |
+
var yith_wcmg_default_zoom = yith_wcmg.find('.yith_magnifier_zoom').attr('href');
|
15 |
+
var yith_wcmg_default_image = yith_wcmg.find('.yith_magnifier_zoom img').attr('src');
|
16 |
+
|
17 |
+
yith_wcmg.yith_magnifier(yith_magnifier_options);
|
18 |
+
|
19 |
+
$( 'form.variations_form' ).on( 'found_variation', function( event, variation ) {
|
20 |
+
var image_magnifier = variation.image_magnifier ? variation.image_magnifier : yith_wcmg_default_zoom;
|
21 |
+
var image_src = variation.image_src ? variation.image_src : yith_wcmg_default_image;
|
22 |
+
|
23 |
+
yith_wcmg_zoom.attr('href', image_magnifier);
|
24 |
+
yith_wcmg_image.attr('src', image_src);
|
25 |
+
|
26 |
+
if( yith_wcmg.data('yith_magnifier') ) {
|
27 |
+
yith_wcmg.yith_magnifier('destroy');
|
28 |
+
}
|
29 |
+
|
30 |
+
yith_wcmg.yith_magnifier(yith_magnifier_options);
|
31 |
+
}).on( 'reset_image', function( event ) {
|
32 |
+
yith_wcmg_zoom.attr('href', yith_wcmg_default_zoom);
|
33 |
+
//yith_wcmg_image.attr('src', yith_wcmg_default_image);
|
34 |
+
|
35 |
+
if( yith_wcmg.data('yith_magnifier') ) {
|
36 |
+
yith_wcmg.yith_magnifier('destroy');
|
37 |
+
}
|
38 |
+
|
39 |
+
yith_wcmg.yith_magnifier(yith_magnifier_options);
|
40 |
+
})
|
41 |
+
|
42 |
+
$( 'form.variations_form .variations select').trigger('change');
|
43 |
+
});
|
assets/js/frontend.min.js
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* Functions
|
3 |
+
*
|
4 |
+
* @author Your Inspiration Themes
|
5 |
+
* @package YITH WooCommerce Zoom Magnifier
|
6 |
+
* @version 1.0.0
|
7 |
+
*/
|
8 |
+
jQuery(document).ready(function(b){var a=b(".images"),d=b(".yith_magnifier_zoom"),f=b(".yith_magnifier_zoom img"),e=a.find(".yith_magnifier_zoom").attr("href"),g=a.find(".yith_magnifier_zoom img").attr("src");a.yith_magnifier(yith_magnifier_options);b("form.variations_form").on("found_variation",function(b,c){var h=c.image_src?c.image_src:g;d.attr("href",c.image_magnifier?c.image_magnifier:e);f.attr("src",h);a.data("yith_magnifier")&&a.yith_magnifier("destroy");a.yith_magnifier(yith_magnifier_options)}).on("reset_image",
|
9 |
+
function(){d.attr("href",e);a.data("yith_magnifier")&&a.yith_magnifier("destroy");a.yith_magnifier(yith_magnifier_options)});b("form.variations_form .variations select").trigger("change")});
|
assets/js/jquery.carouFredSel.js
ADDED
@@ -0,0 +1,4255 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
* jQuery carouFredSel 6.2.1
|
3 |
+
* Demo's and documentation:
|
4 |
+
* caroufredsel.dev7studios.com
|
5 |
+
*
|
6 |
+
* Copyright (c) 2013 Fred Heusschen
|
7 |
+
* www.frebsite.nl
|
8 |
+
*
|
9 |
+
* Dual licensed under the MIT and GPL licenses.
|
10 |
+
* http://en.wikipedia.org/wiki/MIT_License
|
11 |
+
* http://en.wikipedia.org/wiki/GNU_General_Public_License
|
12 |
+
*/
|
13 |
+
|
14 |
+
|
15 |
+
(function($) {
|
16 |
+
|
17 |
+
|
18 |
+
// LOCAL
|
19 |
+
|
20 |
+
if ( $.fn.carouFredSel )
|
21 |
+
{
|
22 |
+
return;
|
23 |
+
}
|
24 |
+
|
25 |
+
$.fn.caroufredsel = $.fn.carouFredSel = function(options, configs)
|
26 |
+
{
|
27 |
+
|
28 |
+
// no element
|
29 |
+
if (this.length == 0)
|
30 |
+
{
|
31 |
+
debug( true, 'No element found for "' + this.selector + '".' );
|
32 |
+
return this;
|
33 |
+
}
|
34 |
+
|
35 |
+
// multiple elements
|
36 |
+
if (this.length > 1)
|
37 |
+
{
|
38 |
+
return this.each(function() {
|
39 |
+
$(this).carouFredSel(options, configs);
|
40 |
+
});
|
41 |
+
}
|
42 |
+
|
43 |
+
|
44 |
+
var $cfs = this,
|
45 |
+
$tt0 = this[0],
|
46 |
+
starting_position = false;
|
47 |
+
|
48 |
+
if ($cfs.data('_cfs_isCarousel'))
|
49 |
+
{
|
50 |
+
starting_position = $cfs.triggerHandler('_cfs_triggerEvent', 'currentPosition');
|
51 |
+
$cfs.trigger('_cfs_triggerEvent', ['destroy', true]);
|
52 |
+
}
|
53 |
+
|
54 |
+
var FN = {};
|
55 |
+
|
56 |
+
FN._init = function(o, setOrig, start)
|
57 |
+
{
|
58 |
+
o = go_getObject($tt0, o);
|
59 |
+
|
60 |
+
o.items = go_getItemsObject($tt0, o.items);
|
61 |
+
o.scroll = go_getScrollObject($tt0, o.scroll);
|
62 |
+
o.auto = go_getAutoObject($tt0, o.auto);
|
63 |
+
o.prev = go_getPrevNextObject($tt0, o.prev);
|
64 |
+
o.next = go_getPrevNextObject($tt0, o.next);
|
65 |
+
o.pagination = go_getPaginationObject($tt0, o.pagination);
|
66 |
+
o.swipe = go_getSwipeObject($tt0, o.swipe);
|
67 |
+
o.mousewheel = go_getMousewheelObject($tt0, o.mousewheel);
|
68 |
+
|
69 |
+
if (setOrig)
|
70 |
+
{
|
71 |
+
opts_orig = $.extend(true, {}, $.fn.carouFredSel.defaults, o);
|
72 |
+
}
|
73 |
+
|
74 |
+
opts = $.extend(true, {}, $.fn.carouFredSel.defaults, o);
|
75 |
+
opts.d = cf_getDimensions(opts);
|
76 |
+
|
77 |
+
crsl.direction = (opts.direction == 'up' || opts.direction == 'left') ? 'next' : 'prev';
|
78 |
+
|
79 |
+
var a_itm = $cfs.children(),
|
80 |
+
avail_primary = ms_getParentSize($wrp, opts, 'width');
|
81 |
+
|
82 |
+
if (is_true(opts.cookie))
|
83 |
+
{
|
84 |
+
opts.cookie = 'caroufredsel_cookie_' + conf.serialNumber;
|
85 |
+
}
|
86 |
+
|
87 |
+
opts.maxDimension = ms_getMaxDimension(opts, avail_primary);
|
88 |
+
|
89 |
+
// complement items and sizes
|
90 |
+
opts.items = in_complementItems(opts.items, opts, a_itm, start);
|
91 |
+
opts[opts.d['width']] = in_complementPrimarySize(opts[opts.d['width']], opts, a_itm);
|
92 |
+
opts[opts.d['height']] = in_complementSecondarySize(opts[opts.d['height']], opts, a_itm);
|
93 |
+
|
94 |
+
// primary size not set for a responsive carousel
|
95 |
+
if (opts.responsive)
|
96 |
+
{
|
97 |
+
if (!is_percentage(opts[opts.d['width']]))
|
98 |
+
{
|
99 |
+
opts[opts.d['width']] = '100%';
|
100 |
+
}
|
101 |
+
}
|
102 |
+
|
103 |
+
// primary size is percentage
|
104 |
+
if (is_percentage(opts[opts.d['width']]))
|
105 |
+
{
|
106 |
+
crsl.upDateOnWindowResize = true;
|
107 |
+
crsl.primarySizePercentage = opts[opts.d['width']];
|
108 |
+
opts[opts.d['width']] = ms_getPercentage(avail_primary, crsl.primarySizePercentage);
|
109 |
+
if (!opts.items.visible)
|
110 |
+
{
|
111 |
+
opts.items.visibleConf.variable = true;
|
112 |
+
}
|
113 |
+
}
|
114 |
+
|
115 |
+
if (opts.responsive)
|
116 |
+
{
|
117 |
+
opts.usePadding = false;
|
118 |
+
opts.padding = [0, 0, 0, 0];
|
119 |
+
opts.align = false;
|
120 |
+
opts.items.visibleConf.variable = false;
|
121 |
+
}
|
122 |
+
else
|
123 |
+
{
|
124 |
+
// visible-items not set
|
125 |
+
if (!opts.items.visible)
|
126 |
+
{
|
127 |
+
opts = in_complementVisibleItems(opts, avail_primary);
|
128 |
+
}
|
129 |
+
|
130 |
+
// primary size not set -> calculate it or set to "variable"
|
131 |
+
if (!opts[opts.d['width']])
|
132 |
+
{
|
133 |
+
if (!opts.items.visibleConf.variable && is_number(opts.items[opts.d['width']]) && opts.items.filter == '*')
|
134 |
+
{
|
135 |
+
opts[opts.d['width']] = opts.items.visible * opts.items[opts.d['width']];
|
136 |
+
opts.align = false;
|
137 |
+
}
|
138 |
+
else
|
139 |
+
{
|
140 |
+
opts[opts.d['width']] = 'variable';
|
141 |
+
}
|
142 |
+
}
|
143 |
+
// align not set -> set to center if primary size is number
|
144 |
+
if (is_undefined(opts.align))
|
145 |
+
{
|
146 |
+
opts.align = (is_number(opts[opts.d['width']]))
|
147 |
+
? 'center'
|
148 |
+
: false;
|
149 |
+
}
|
150 |
+
// set variabe visible-items
|
151 |
+
if (opts.items.visibleConf.variable)
|
152 |
+
{
|
153 |
+
opts.items.visible = gn_getVisibleItemsNext(a_itm, opts, 0);
|
154 |
+
}
|
155 |
+
}
|
156 |
+
|
157 |
+
// set visible items by filter
|
158 |
+
if (opts.items.filter != '*' && !opts.items.visibleConf.variable)
|
159 |
+
{
|
160 |
+
opts.items.visibleConf.org = opts.items.visible;
|
161 |
+
opts.items.visible = gn_getVisibleItemsNextFilter(a_itm, opts, 0);
|
162 |
+
}
|
163 |
+
|
164 |
+
opts.items.visible = cf_getItemsAdjust(opts.items.visible, opts, opts.items.visibleConf.adjust, $tt0);
|
165 |
+
opts.items.visibleConf.old = opts.items.visible;
|
166 |
+
|
167 |
+
if (opts.responsive)
|
168 |
+
{
|
169 |
+
if (!opts.items.visibleConf.min)
|
170 |
+
{
|
171 |
+
opts.items.visibleConf.min = opts.items.visible;
|
172 |
+
}
|
173 |
+
if (!opts.items.visibleConf.max)
|
174 |
+
{
|
175 |
+
opts.items.visibleConf.max = opts.items.visible;
|
176 |
+
}
|
177 |
+
opts = in_getResponsiveValues(opts, a_itm, avail_primary);
|
178 |
+
}
|
179 |
+
else
|
180 |
+
{
|
181 |
+
opts.padding = cf_getPadding(opts.padding);
|
182 |
+
|
183 |
+
if (opts.align == 'top')
|
184 |
+
{
|
185 |
+
opts.align = 'left';
|
186 |
+
}
|
187 |
+
else if (opts.align == 'bottom')
|
188 |
+
{
|
189 |
+
opts.align = 'right';
|
190 |
+
}
|
191 |
+
|
192 |
+
switch (opts.align)
|
193 |
+
{
|
194 |
+
// align: center, left or right
|
195 |
+
case 'center':
|
196 |
+
case 'left':
|
197 |
+
case 'right':
|
198 |
+
if (opts[opts.d['width']] != 'variable')
|
199 |
+
{
|
200 |
+
opts = in_getAlignPadding(opts, a_itm);
|
201 |
+
opts.usePadding = true;
|
202 |
+
}
|
203 |
+
break;
|
204 |
+
|
205 |
+
// padding
|
206 |
+
default:
|
207 |
+
opts.align = false;
|
208 |
+
opts.usePadding = (
|
209 |
+
opts.padding[0] == 0 &&
|
210 |
+
opts.padding[1] == 0 &&
|
211 |
+
opts.padding[2] == 0 &&
|
212 |
+
opts.padding[3] == 0
|
213 |
+
) ? false : true;
|
214 |
+
break;
|
215 |
+
}
|
216 |
+
}
|
217 |
+
|
218 |
+
if (!is_number(opts.scroll.duration))
|
219 |
+
{
|
220 |
+
opts.scroll.duration = 500;
|
221 |
+
}
|
222 |
+
if (is_undefined(opts.scroll.items))
|
223 |
+
{
|
224 |
+
opts.scroll.items = (opts.responsive || opts.items.visibleConf.variable || opts.items.filter != '*')
|
225 |
+
? 'visible'
|
226 |
+
: opts.items.visible;
|
227 |
+
}
|
228 |
+
|
229 |
+
opts.auto = $.extend(true, {}, opts.scroll, opts.auto);
|
230 |
+
opts.prev = $.extend(true, {}, opts.scroll, opts.prev);
|
231 |
+
opts.next = $.extend(true, {}, opts.scroll, opts.next);
|
232 |
+
opts.pagination = $.extend(true, {}, opts.scroll, opts.pagination);
|
233 |
+
// swipe and mousewheel extend later on, per direction
|
234 |
+
|
235 |
+
opts.auto = go_complementAutoObject($tt0, opts.auto);
|
236 |
+
opts.prev = go_complementPrevNextObject($tt0, opts.prev);
|
237 |
+
opts.next = go_complementPrevNextObject($tt0, opts.next);
|
238 |
+
opts.pagination = go_complementPaginationObject($tt0, opts.pagination);
|
239 |
+
opts.swipe = go_complementSwipeObject($tt0, opts.swipe);
|
240 |
+
opts.mousewheel = go_complementMousewheelObject($tt0, opts.mousewheel);
|
241 |
+
|
242 |
+
if (opts.synchronise)
|
243 |
+
{
|
244 |
+
opts.synchronise = cf_getSynchArr(opts.synchronise);
|
245 |
+
}
|
246 |
+
|
247 |
+
|
248 |
+
// DEPRECATED
|
249 |
+
if (opts.auto.onPauseStart)
|
250 |
+
{
|
251 |
+
opts.auto.onTimeoutStart = opts.auto.onPauseStart;
|
252 |
+
deprecated('auto.onPauseStart', 'auto.onTimeoutStart');
|
253 |
+
}
|
254 |
+
if (opts.auto.onPausePause)
|
255 |
+
{
|
256 |
+
opts.auto.onTimeoutPause = opts.auto.onPausePause;
|
257 |
+
deprecated('auto.onPausePause', 'auto.onTimeoutPause');
|
258 |
+
}
|
259 |
+
if (opts.auto.onPauseEnd)
|
260 |
+
{
|
261 |
+
opts.auto.onTimeoutEnd = opts.auto.onPauseEnd;
|
262 |
+
deprecated('auto.onPauseEnd', 'auto.onTimeoutEnd');
|
263 |
+
}
|
264 |
+
if (opts.auto.pauseDuration)
|
265 |
+
{
|
266 |
+
opts.auto.timeoutDuration = opts.auto.pauseDuration;
|
267 |
+
deprecated('auto.pauseDuration', 'auto.timeoutDuration');
|
268 |
+
}
|
269 |
+
// /DEPRECATED
|
270 |
+
|
271 |
+
|
272 |
+
}; // /init
|
273 |
+
|
274 |
+
|
275 |
+
FN._build = function() {
|
276 |
+
$cfs.data('_cfs_isCarousel', true);
|
277 |
+
|
278 |
+
var a_itm = $cfs.children(),
|
279 |
+
orgCSS = in_mapCss($cfs, ['textAlign', 'float', 'position', 'top', 'right', 'bottom', 'left', 'zIndex', 'width', 'height', 'marginTop', 'marginRight', 'marginBottom', 'marginLeft']),
|
280 |
+
newPosition = 'relative';
|
281 |
+
|
282 |
+
switch (orgCSS.position)
|
283 |
+
{
|
284 |
+
case 'absolute':
|
285 |
+
case 'fixed':
|
286 |
+
newPosition = orgCSS.position;
|
287 |
+
break;
|
288 |
+
}
|
289 |
+
|
290 |
+
if (conf.wrapper == 'parent')
|
291 |
+
{
|
292 |
+
sz_storeOrigCss($wrp);
|
293 |
+
}
|
294 |
+
else
|
295 |
+
{
|
296 |
+
$wrp.css(orgCSS);
|
297 |
+
}
|
298 |
+
$wrp.css({
|
299 |
+
'overflow' : 'hidden',
|
300 |
+
'position' : newPosition
|
301 |
+
});
|
302 |
+
|
303 |
+
sz_storeOrigCss($cfs);
|
304 |
+
$cfs.data('_cfs_origCssZindex', orgCSS.zIndex);
|
305 |
+
$cfs.css({
|
306 |
+
'textAlign' : 'left',
|
307 |
+
'float' : 'none',
|
308 |
+
'position' : 'absolute',
|
309 |
+
'top' : 0,
|
310 |
+
'right' : 'auto',
|
311 |
+
'bottom' : 'auto',
|
312 |
+
'left' : 0,
|
313 |
+
'marginTop' : 0,
|
314 |
+
'marginRight' : 0,
|
315 |
+
'marginBottom' : 0,
|
316 |
+
'marginLeft' : 0
|
317 |
+
});
|
318 |
+
|
319 |
+
sz_storeMargin(a_itm, opts);
|
320 |
+
sz_storeOrigCss(a_itm);
|
321 |
+
if (opts.responsive)
|
322 |
+
{
|
323 |
+
sz_setResponsiveSizes(opts, a_itm);
|
324 |
+
}
|
325 |
+
|
326 |
+
}; // /build
|
327 |
+
|
328 |
+
|
329 |
+
FN._bind_events = function() {
|
330 |
+
FN._unbind_events();
|
331 |
+
|
332 |
+
|
333 |
+
// stop event
|
334 |
+
$cfs.bind(cf_e('stop', conf), function(e, imm) {
|
335 |
+
e.stopPropagation();
|
336 |
+
|
337 |
+
// button
|
338 |
+
if (!crsl.isStopped)
|
339 |
+
{
|
340 |
+
if (opts.auto.button)
|
341 |
+
{
|
342 |
+
opts.auto.button.addClass(cf_c('stopped', conf));
|
343 |
+
}
|
344 |
+
}
|
345 |
+
|
346 |
+
// set stopped
|
347 |
+
crsl.isStopped = true;
|
348 |
+
|
349 |
+
if (opts.auto.play)
|
350 |
+
{
|
351 |
+
opts.auto.play = false;
|
352 |
+
$cfs.trigger(cf_e('pause', conf), imm);
|
353 |
+
}
|
354 |
+
return true;
|
355 |
+
});
|
356 |
+
|
357 |
+
|
358 |
+
// finish event
|
359 |
+
$cfs.bind(cf_e('finish', conf), function(e) {
|
360 |
+
e.stopPropagation();
|
361 |
+
if (crsl.isScrolling)
|
362 |
+
{
|
363 |
+
sc_stopScroll(scrl);
|
364 |
+
}
|
365 |
+
return true;
|
366 |
+
});
|
367 |
+
|
368 |
+
|
369 |
+
// pause event
|
370 |
+
$cfs.bind(cf_e('pause', conf), function(e, imm, res) {
|
371 |
+
e.stopPropagation();
|
372 |
+
tmrs = sc_clearTimers(tmrs);
|
373 |
+
|
374 |
+
// immediately pause
|
375 |
+
if (imm && crsl.isScrolling)
|
376 |
+
{
|
377 |
+
scrl.isStopped = true;
|
378 |
+
var nst = getTime() - scrl.startTime;
|
379 |
+
scrl.duration -= nst;
|
380 |
+
if (scrl.pre)
|
381 |
+
{
|
382 |
+
scrl.pre.duration -= nst;
|
383 |
+
}
|
384 |
+
if (scrl.post)
|
385 |
+
{
|
386 |
+
scrl.post.duration -= nst;
|
387 |
+
}
|
388 |
+
sc_stopScroll(scrl, false);
|
389 |
+
}
|
390 |
+
|
391 |
+
// update remaining pause-time
|
392 |
+
if (!crsl.isPaused && !crsl.isScrolling)
|
393 |
+
{
|
394 |
+
if (res)
|
395 |
+
{
|
396 |
+
tmrs.timePassed += getTime() - tmrs.startTime;
|
397 |
+
}
|
398 |
+
}
|
399 |
+
|
400 |
+
// button
|
401 |
+
if (!crsl.isPaused)
|
402 |
+
{
|
403 |
+
if (opts.auto.button)
|
404 |
+
{
|
405 |
+
opts.auto.button.addClass(cf_c('paused', conf));
|
406 |
+
}
|
407 |
+
}
|
408 |
+
|
409 |
+
// set paused
|
410 |
+
crsl.isPaused = true;
|
411 |
+
|
412 |
+
// pause pause callback
|
413 |
+
if (opts.auto.onTimeoutPause)
|
414 |
+
{
|
415 |
+
var dur1 = opts.auto.timeoutDuration - tmrs.timePassed,
|
416 |
+
perc = 100 - Math.ceil( dur1 * 100 / opts.auto.timeoutDuration );
|
417 |
+
|
418 |
+
opts.auto.onTimeoutPause.call($tt0, perc, dur1);
|
419 |
+
}
|
420 |
+
return true;
|
421 |
+
});
|
422 |
+
|
423 |
+
|
424 |
+
// play event
|
425 |
+
$cfs.bind(cf_e('play', conf), function(e, dir, del, res) {
|
426 |
+
e.stopPropagation();
|
427 |
+
tmrs = sc_clearTimers(tmrs);
|
428 |
+
|
429 |
+
// sort params
|
430 |
+
var v = [dir, del, res],
|
431 |
+
t = ['string', 'number', 'boolean'],
|
432 |
+
a = cf_sortParams(v, t);
|
433 |
+
|
434 |
+
dir = a[0];
|
435 |
+
del = a[1];
|
436 |
+
res = a[2];
|
437 |
+
|
438 |
+
if (dir != 'prev' && dir != 'next')
|
439 |
+
{
|
440 |
+
dir = crsl.direction;
|
441 |
+
}
|
442 |
+
if (!is_number(del))
|
443 |
+
{
|
444 |
+
del = 0;
|
445 |
+
}
|
446 |
+
if (!is_boolean(res))
|
447 |
+
{
|
448 |
+
res = false;
|
449 |
+
}
|
450 |
+
|
451 |
+
// stopped?
|
452 |
+
if (res)
|
453 |
+
{
|
454 |
+
crsl.isStopped = false;
|
455 |
+
opts.auto.play = true;
|
456 |
+
}
|
457 |
+
if (!opts.auto.play)
|
458 |
+
{
|
459 |
+
e.stopImmediatePropagation();
|
460 |
+
return debug(conf, 'Carousel stopped: Not scrolling.');
|
461 |
+
}
|
462 |
+
|
463 |
+
// button
|
464 |
+
if (crsl.isPaused)
|
465 |
+
{
|
466 |
+
if (opts.auto.button)
|
467 |
+
{
|
468 |
+
opts.auto.button.removeClass(cf_c('stopped', conf));
|
469 |
+
opts.auto.button.removeClass(cf_c('paused', conf));
|
470 |
+
}
|
471 |
+
}
|
472 |
+
|
473 |
+
// set playing
|
474 |
+
crsl.isPaused = false;
|
475 |
+
tmrs.startTime = getTime();
|
476 |
+
|
477 |
+
// timeout the scrolling
|
478 |
+
var dur1 = opts.auto.timeoutDuration + del;
|
479 |
+
dur2 = dur1 - tmrs.timePassed;
|
480 |
+
perc = 100 - Math.ceil(dur2 * 100 / dur1);
|
481 |
+
|
482 |
+
if (opts.auto.progress)
|
483 |
+
{
|
484 |
+
tmrs.progress = setInterval(function() {
|
485 |
+
var pasd = getTime() - tmrs.startTime + tmrs.timePassed,
|
486 |
+
perc = Math.ceil(pasd * 100 / dur1);
|
487 |
+
opts.auto.progress.updater.call(opts.auto.progress.bar[0], perc);
|
488 |
+
}, opts.auto.progress.interval);
|
489 |
+
}
|
490 |
+
|
491 |
+
tmrs.auto = setTimeout(function() {
|
492 |
+
if (opts.auto.progress)
|
493 |
+
{
|
494 |
+
opts.auto.progress.updater.call(opts.auto.progress.bar[0], 100);
|
495 |
+
}
|
496 |
+
if (opts.auto.onTimeoutEnd)
|
497 |
+
{
|
498 |
+
opts.auto.onTimeoutEnd.call($tt0, perc, dur2);
|
499 |
+
}
|
500 |
+
if (crsl.isScrolling)
|
501 |
+
{
|
502 |
+
$cfs.trigger(cf_e('play', conf), dir);
|
503 |
+
}
|
504 |
+
else
|
505 |
+
{
|
506 |
+
$cfs.trigger(cf_e(dir, conf), opts.auto);
|
507 |
+
}
|
508 |
+
}, dur2);
|
509 |
+
|
510 |
+
// pause start callback
|
511 |
+
if (opts.auto.onTimeoutStart)
|
512 |
+
{
|
513 |
+
opts.auto.onTimeoutStart.call($tt0, perc, dur2);
|
514 |
+
}
|
515 |
+
|
516 |
+
return true;
|
517 |
+
});
|
518 |
+
|
519 |
+
|
520 |
+
// resume event
|
521 |
+
$cfs.bind(cf_e('resume', conf), function(e) {
|
522 |
+
e.stopPropagation();
|
523 |
+
if (scrl.isStopped)
|
524 |
+
{
|
525 |
+
scrl.isStopped = false;
|
526 |
+
crsl.isPaused = false;
|
527 |
+
crsl.isScrolling = true;
|
528 |
+
scrl.startTime = getTime();
|
529 |
+
sc_startScroll(scrl, conf);
|
530 |
+
}
|
531 |
+
else
|
532 |
+
{
|
533 |
+
$cfs.trigger(cf_e('play', conf));
|
534 |
+
}
|
535 |
+
return true;
|
536 |
+
});
|
537 |
+
|
538 |
+
|
539 |
+
// prev + next events
|
540 |
+
$cfs.bind(cf_e('prev', conf)+' '+cf_e('next', conf), function(e, obj, num, clb, que) {
|
541 |
+
e.stopPropagation();
|
542 |
+
|
543 |
+
// stopped or hidden carousel, don't scroll, don't queue
|
544 |
+
if (crsl.isStopped || $cfs.is(':hidden'))
|
545 |
+
{
|
546 |
+
e.stopImmediatePropagation();
|
547 |
+
return debug(conf, 'Carousel stopped or hidden: Not scrolling.');
|
548 |
+
}
|
549 |
+
|
550 |
+
// not enough items
|
551 |
+
var minimum = (is_number(opts.items.minimum)) ? opts.items.minimum : opts.items.visible + 1;
|
552 |
+
if (minimum > itms.total)
|
553 |
+
{
|
554 |
+
e.stopImmediatePropagation();
|
555 |
+
return debug(conf, 'Not enough items ('+itms.total+' total, '+minimum+' needed): Not scrolling.');
|
556 |
+
}
|
557 |
+
|
558 |
+
// get config
|
559 |
+
var v = [obj, num, clb, que],
|
560 |
+
t = ['object', 'number/string', 'function', 'boolean'],
|
561 |
+
a = cf_sortParams(v, t);
|
562 |
+
|
563 |
+
obj = a[0];
|
564 |
+
num = a[1];
|
565 |
+
clb = a[2];
|
566 |
+
que = a[3];
|
567 |
+
|
568 |
+
var eType = e.type.slice(conf.events.prefix.length);
|
569 |
+
|
570 |
+
if (!is_object(obj))
|
571 |
+
{
|
572 |
+
obj = {};
|
573 |
+
}
|
574 |
+
if (is_function(clb))
|
575 |
+
{
|
576 |
+
obj.onAfter = clb;
|
577 |
+
}
|
578 |
+
if (is_boolean(que))
|
579 |
+
{
|
580 |
+
obj.queue = que;
|
581 |
+
}
|
582 |
+
obj = $.extend(true, {}, opts[eType], obj);
|
583 |
+
|
584 |
+
// test conditions callback
|
585 |
+
if (obj.conditions && !obj.conditions.call($tt0, eType))
|
586 |
+
{
|
587 |
+
e.stopImmediatePropagation();
|
588 |
+
return debug(conf, 'Callback "conditions" returned false.');
|
589 |
+
}
|
590 |
+
|
591 |
+
if (!is_number(num))
|
592 |
+
{
|
593 |
+
if (opts.items.filter != '*')
|
594 |
+
{
|
595 |
+
num = 'visible';
|
596 |
+
}
|
597 |
+
else
|
598 |
+
{
|
599 |
+
var arr = [num, obj.items, opts[eType].items];
|
600 |
+
for (var a = 0, l = arr.length; a < l; a++)
|
601 |
+
{
|
602 |
+
if (is_number(arr[a]) || arr[a] == 'page' || arr[a] == 'visible') {
|
603 |
+
num = arr[a];
|
604 |
+
break;
|
605 |
+
}
|
606 |
+
}
|
607 |
+
}
|
608 |
+
switch(num) {
|
609 |
+
case 'page':
|
610 |
+
e.stopImmediatePropagation();
|
611 |
+
return $cfs.triggerHandler(cf_e(eType+'Page', conf), [obj, clb]);
|
612 |
+
break;
|
613 |
+
|
614 |
+
case 'visible':
|
615 |
+
if (!opts.items.visibleConf.variable && opts.items.filter == '*')
|
616 |
+
{
|
617 |
+
num = opts.items.visible;
|
618 |
+
}
|
619 |
+
break;
|
620 |
+
}
|
621 |
+
}
|
622 |
+
|
623 |
+
// resume animation, add current to queue
|
624 |
+
if (scrl.isStopped)
|
625 |
+
{
|
626 |
+
$cfs.trigger(cf_e('resume', conf));
|
627 |
+
$cfs.trigger(cf_e('queue', conf), [eType, [obj, num, clb]]);
|
628 |
+
e.stopImmediatePropagation();
|
629 |
+
return debug(conf, 'Carousel resumed scrolling.');
|
630 |
+
}
|
631 |
+
|
632 |
+
// queue if scrolling
|
633 |
+
if (obj.duration > 0)
|
634 |
+
{
|
635 |
+
if (crsl.isScrolling)
|
636 |
+
{
|
637 |
+
if (obj.queue)
|
638 |
+
{
|
639 |
+
if (obj.queue == 'last')
|
640 |
+
{
|
641 |
+
queu = [];
|
642 |
+
}
|
643 |
+
if (obj.queue != 'first' || queu.length == 0)
|
644 |
+
{
|
645 |
+
$cfs.trigger(cf_e('queue', conf), [eType, [obj, num, clb]]);
|
646 |
+
}
|
647 |
+
}
|
648 |
+
e.stopImmediatePropagation();
|
649 |
+
return debug(conf, 'Carousel currently scrolling.');
|
650 |
+
}
|
651 |
+
}
|
652 |
+
|
653 |
+
tmrs.timePassed = 0;
|
654 |
+
$cfs.trigger(cf_e('slide_'+eType, conf), [obj, num]);
|
655 |
+
|
656 |
+
// synchronise
|
657 |
+
if (opts.synchronise)
|
658 |
+
{
|
659 |
+
var s = opts.synchronise,
|
660 |
+
c = [obj, num];
|
661 |
+
|
662 |
+
for (var j = 0, l = s.length; j < l; j++) {
|
663 |
+
var d = eType;
|
664 |
+
if (!s[j][2])
|
665 |
+
{
|
666 |
+
d = (d == 'prev') ? 'next' : 'prev';
|
667 |
+
}
|
668 |
+
if (!s[j][1])
|
669 |
+
{
|
670 |
+
c[0] = s[j][0].triggerHandler('_cfs_triggerEvent', ['configuration', d]);
|
671 |
+
}
|
672 |
+
c[1] = num + s[j][3];
|
673 |
+
s[j][0].trigger('_cfs_triggerEvent', ['slide_'+d, c]);
|
674 |
+
}
|
675 |
+
}
|
676 |
+
return true;
|
677 |
+
});
|
678 |
+
|
679 |
+
|
680 |
+
// prev event
|
681 |
+
$cfs.bind(cf_e('slide_prev', conf), function(e, sO, nI) {
|
682 |
+
e.stopPropagation();
|
683 |
+
var a_itm = $cfs.children();
|
684 |
+
|
685 |
+
// non-circular at start, scroll to end
|
686 |
+
if (!opts.circular)
|
687 |
+
{
|
688 |
+
if (itms.first == 0)
|
689 |
+
{
|
690 |
+
if (opts.infinite)
|
691 |
+
{
|
692 |
+
$cfs.trigger(cf_e('next', conf), itms.total-1);
|
693 |
+
}
|
694 |
+
return e.stopImmediatePropagation();
|
695 |
+
}
|
696 |
+
}
|
697 |
+
|
698 |
+
sz_resetMargin(a_itm, opts);
|
699 |
+
|
700 |
+
// find number of items to scroll
|
701 |
+
if (!is_number(nI))
|
702 |
+
{
|
703 |
+
if (opts.items.visibleConf.variable)
|
704 |
+
{
|
705 |
+
nI = gn_getVisibleItemsPrev(a_itm, opts, itms.total-1);
|
706 |
+
}
|
707 |
+
else if (opts.items.filter != '*')
|
708 |
+
{
|
709 |
+
var xI = (is_number(sO.items)) ? sO.items : gn_getVisibleOrg($cfs, opts);
|
710 |
+
nI = gn_getScrollItemsPrevFilter(a_itm, opts, itms.total-1, xI);
|
711 |
+
}
|
712 |
+
else
|
713 |
+
{
|
714 |
+
nI = opts.items.visible;
|
715 |
+
}
|
716 |
+
nI = cf_getAdjust(nI, opts, sO.items, $tt0);
|
717 |
+
}
|
718 |
+
|
719 |
+
// prevent non-circular from scrolling to far
|
720 |
+
if (!opts.circular)
|
721 |
+
{
|
722 |
+
if (itms.total - nI < itms.first)
|
723 |
+
{
|
724 |
+
nI = itms.total - itms.first;
|
725 |
+
}
|
726 |
+
}
|
727 |
+
|
728 |
+
// set new number of visible items
|
729 |
+
opts.items.visibleConf.old = opts.items.visible;
|
730 |
+
if (opts.items.visibleConf.variable)
|
731 |
+
{
|
732 |
+
var vI = cf_getItemsAdjust(gn_getVisibleItemsNext(a_itm, opts, itms.total-nI), opts, opts.items.visibleConf.adjust, $tt0);
|
733 |
+
if (opts.items.visible+nI <= vI && nI < itms.total)
|
734 |
+
{
|
735 |
+
nI++;
|
736 |
+
vI = cf_getItemsAdjust(gn_getVisibleItemsNext(a_itm, opts, itms.total-nI), opts, opts.items.visibleConf.adjust, $tt0);
|
737 |
+
}
|
738 |
+
opts.items.visible = vI;
|
739 |
+
}
|
740 |
+
else if (opts.items.filter != '*')
|
741 |
+
{
|
742 |
+
var vI = gn_getVisibleItemsNextFilter(a_itm, opts, itms.total-nI);
|
743 |
+
opts.items.visible = cf_getItemsAdjust(vI, opts, opts.items.visibleConf.adjust, $tt0);
|
744 |
+
}
|
745 |
+
|
746 |
+
sz_resetMargin(a_itm, opts, true);
|
747 |
+
|
748 |
+
// scroll 0, don't scroll
|
749 |
+
if (nI == 0)
|
750 |
+
{
|
751 |
+
e.stopImmediatePropagation();
|
752 |
+
return debug(conf, '0 items to scroll: Not scrolling.');
|
753 |
+
}
|
754 |
+
debug(conf, 'Scrolling '+nI+' items backward.');
|
755 |
+
|
756 |
+
|
757 |
+
// save new config
|
758 |
+
itms.first += nI;
|
759 |
+
while (itms.first >= itms.total)
|
760 |
+
{
|
761 |
+
itms.first -= itms.total;
|
762 |
+
}
|
763 |
+
|
764 |
+
// non-circular callback
|
765 |
+
if (!opts.circular)
|
766 |
+
{
|
767 |
+
if (itms.first == 0 && sO.onEnd)
|
768 |
+
{
|
769 |
+
sO.onEnd.call($tt0, 'prev');
|
770 |
+
}
|
771 |
+
if (!opts.infinite)
|
772 |
+
{
|
773 |
+
nv_enableNavi(opts, itms.first, conf);
|
774 |
+
}
|
775 |
+
}
|
776 |
+
|
777 |
+
// rearrange items
|
778 |
+
$cfs.children().slice(itms.total-nI, itms.total).prependTo($cfs);
|
779 |
+
if (itms.total < opts.items.visible + nI)
|
780 |
+
{
|
781 |
+
$cfs.children().slice(0, (opts.items.visible+nI)-itms.total).clone(true).appendTo($cfs);
|
782 |
+
}
|
783 |
+
|
784 |
+
// the needed items
|
785 |
+
var a_itm = $cfs.children(),
|
786 |
+
i_old = gi_getOldItemsPrev(a_itm, opts, nI),
|
787 |
+
i_new = gi_getNewItemsPrev(a_itm, opts),
|
788 |
+
i_cur_l = a_itm.eq(nI-1),
|
789 |
+
i_old_l = i_old.last(),
|
790 |
+
i_new_l = i_new.last();
|
791 |
+
|
792 |
+
sz_resetMargin(a_itm, opts);
|
793 |
+
|
794 |
+
var pL = 0,
|
795 |
+
pR = 0;
|
796 |
+
|
797 |
+
if (opts.align)
|
798 |
+
{
|
799 |
+
var p = cf_getAlignPadding(i_new, opts);
|
800 |
+
pL = p[0];
|
801 |
+
pR = p[1];
|
802 |
+
}
|
803 |
+
var oL = (pL < 0) ? opts.padding[opts.d[3]] : 0;
|
804 |
+
|
805 |
+
// hide items for fx directscroll
|
806 |
+
var hiddenitems = false,
|
807 |
+
i_skp = $();
|
808 |
+
if (opts.items.visible < nI)
|
809 |
+
{
|
810 |
+
i_skp = a_itm.slice(opts.items.visibleConf.old, nI);
|
811 |
+
if (sO.fx == 'directscroll')
|
812 |
+
{
|
813 |
+
var orgW = opts.items[opts.d['width']];
|
814 |
+
hiddenitems = i_skp;
|
815 |
+
i_cur_l = i_new_l;
|
816 |
+
sc_hideHiddenItems(hiddenitems);
|
817 |
+
opts.items[opts.d['width']] = 'variable';
|
818 |
+
}
|
819 |
+
}
|
820 |
+
|
821 |
+
// save new sizes
|
822 |
+
var $cf2 = false,
|
823 |
+
i_siz = ms_getTotalSize(a_itm.slice(0, nI), opts, 'width'),
|
824 |
+
w_siz = cf_mapWrapperSizes(ms_getSizes(i_new, opts, true), opts, !opts.usePadding),
|
825 |
+
i_siz_vis = 0,
|
826 |
+
a_cfs = {},
|
827 |
+
a_wsz = {},
|
828 |
+
a_cur = {},
|
829 |
+
a_old = {},
|
830 |
+
a_new = {},
|
831 |
+
a_lef = {},
|
832 |
+
a_lef_vis = {},
|
833 |
+
a_dur = sc_getDuration(sO, opts, nI, i_siz);
|
834 |
+
|
835 |
+
switch(sO.fx)
|
836 |
+
{
|
837 |
+
case 'cover':
|
838 |
+
case 'cover-fade':
|
839 |
+
i_siz_vis = ms_getTotalSize(a_itm.slice(0, opts.items.visible), opts, 'width');
|
840 |
+
break;
|
841 |
+
}
|
842 |
+
|
843 |
+
if (hiddenitems)
|
844 |
+
{
|
845 |
+
opts.items[opts.d['width']] = orgW;
|
846 |
+
}
|
847 |
+
|
848 |
+
sz_resetMargin(a_itm, opts, true);
|
849 |
+
if (pR >= 0)
|
850 |
+
{
|
851 |
+
sz_resetMargin(i_old_l, opts, opts.padding[opts.d[1]]);
|
852 |
+
}
|
853 |
+
if (pL >= 0)
|
854 |
+
{
|
855 |
+
sz_resetMargin(i_cur_l, opts, opts.padding[opts.d[3]]);
|
856 |
+
}
|
857 |
+
|
858 |
+
if (opts.align)
|
859 |
+
{
|
860 |
+
opts.padding[opts.d[1]] = pR;
|
861 |
+
opts.padding[opts.d[3]] = pL;
|
862 |
+
}
|
863 |
+
|
864 |
+
a_lef[opts.d['left']] = -(i_siz - oL);
|
865 |
+
a_lef_vis[opts.d['left']] = -(i_siz_vis - oL);
|
866 |
+
a_wsz[opts.d['left']] = w_siz[opts.d['width']];
|
867 |
+
|
868 |
+
// scrolling functions
|
869 |
+
var _s_wrapper = function() {},
|
870 |
+
_a_wrapper = function() {},
|
871 |
+
_s_paddingold = function() {},
|
872 |
+
_a_paddingold = function() {},
|
873 |
+
_s_paddingnew = function() {},
|
874 |
+
_a_paddingnew = function() {},
|
875 |
+
_s_paddingcur = function() {},
|
876 |
+
_a_paddingcur = function() {},
|
877 |
+
_onafter = function() {},
|
878 |
+
_moveitems = function() {},
|
879 |
+
_position = function() {};
|
880 |
+
|
881 |
+
// clone carousel
|
882 |
+
switch(sO.fx)
|
883 |
+
{
|
884 |
+
case 'crossfade':
|
885 |
+
case 'cover':
|
886 |
+
case 'cover-fade':
|
887 |
+
case 'uncover':
|
888 |
+
case 'uncover-fade':
|
889 |
+
$cf2 = $cfs.clone(true).appendTo($wrp);
|
890 |
+
break;
|
891 |
+
}
|
892 |
+
switch(sO.fx)
|
893 |
+
{
|
894 |
+
case 'crossfade':
|
895 |
+
case 'uncover':
|
896 |
+
case 'uncover-fade':
|
897 |
+
$cf2.children().slice(0, nI).remove();
|
898 |
+
$cf2.children().slice(opts.items.visibleConf.old).remove();
|
899 |
+
break;
|
900 |
+
|
901 |
+
case 'cover':
|
902 |
+
case 'cover-fade':
|
903 |
+
$cf2.children().slice(opts.items.visible).remove();
|
904 |
+
$cf2.css(a_lef_vis);
|
905 |
+
break;
|
906 |
+
}
|
907 |
+
|
908 |
+
$cfs.css(a_lef);
|
909 |
+
|
910 |
+
// reset all scrolls
|
911 |
+
scrl = sc_setScroll(a_dur, sO.easing, conf);
|
912 |
+
|
913 |
+
// animate / set carousel
|
914 |
+
a_cfs[opts.d['left']] = (opts.usePadding) ? opts.padding[opts.d[3]] : 0;
|
915 |
+
|
916 |
+
// animate / set wrapper
|
917 |
+
if (opts[opts.d['width']] == 'variable' || opts[opts.d['height']] == 'variable')
|
918 |
+
{
|
919 |
+
_s_wrapper = function() {
|
920 |
+
$wrp.css(w_siz);
|
921 |
+
};
|
922 |
+
_a_wrapper = function() {
|
923 |
+
scrl.anims.push([$wrp, w_siz]);
|
924 |
+
};
|
925 |
+
}
|
926 |
+
|
927 |
+
// animate / set items
|
928 |
+
if (opts.usePadding)
|
929 |
+
{
|
930 |
+
if (i_new_l.not(i_cur_l).length)
|
931 |
+
{
|
932 |
+
a_cur[opts.d['marginRight']] = i_cur_l.data('_cfs_origCssMargin');
|
933 |
+
|
934 |
+
if (pL < 0)
|
935 |
+
{
|
936 |
+
i_cur_l.css(a_cur);
|
937 |
+
}
|
938 |
+
else
|
939 |
+
{
|
940 |
+
_s_paddingcur = function() {
|
941 |
+
i_cur_l.css(a_cur);
|
942 |
+
};
|
943 |
+
_a_paddingcur = function() {
|
944 |
+
scrl.anims.push([i_cur_l, a_cur]);
|
945 |
+
};
|
946 |
+
}
|
947 |
+
}
|
948 |
+
switch(sO.fx)
|
949 |
+
{
|
950 |
+
case 'cover':
|
951 |
+
case 'cover-fade':
|
952 |
+
$cf2.children().eq(nI-1).css(a_cur);
|
953 |
+
break;
|
954 |
+
}
|
955 |
+
|
956 |
+
if (i_new_l.not(i_old_l).length)
|
957 |
+
{
|
958 |
+
a_old[opts.d['marginRight']] = i_old_l.data('_cfs_origCssMargin');
|
959 |
+
_s_paddingold = function() {
|
960 |
+
i_old_l.css(a_old);
|
961 |
+
};
|
962 |
+
_a_paddingold = function() {
|
963 |
+
scrl.anims.push([i_old_l, a_old]);
|
964 |
+
};
|
965 |
+
}
|
966 |
+
|
967 |
+
if (pR >= 0)
|
968 |
+
{
|
969 |
+
a_new[opts.d['marginRight']] = i_new_l.data('_cfs_origCssMargin') + opts.padding[opts.d[1]];
|
970 |
+
_s_paddingnew = function() {
|
971 |
+
i_new_l.css(a_new);
|
972 |
+
};
|
973 |
+
_a_paddingnew = function() {
|
974 |
+
scrl.anims.push([i_new_l, a_new]);
|
975 |
+
};
|
976 |
+
}
|
977 |
+
}
|
978 |
+
|
979 |
+
// set position
|
980 |
+
_position = function() {
|
981 |
+
$cfs.css(a_cfs);
|
982 |
+
};
|
983 |
+
|
984 |
+
|
985 |
+
var overFill = opts.items.visible+nI-itms.total;
|
986 |
+
|
987 |
+
// rearrange items
|
988 |
+
_moveitems = function() {
|
989 |
+
if (overFill > 0)
|
990 |
+
{
|
991 |
+
$cfs.children().slice(itms.total).remove();
|
992 |
+
i_old = $( $cfs.children().slice(itms.total-(opts.items.visible-overFill)).get().concat( $cfs.children().slice(0, overFill).get() ) );
|
993 |
+
}
|
994 |
+
sc_showHiddenItems(hiddenitems);
|
995 |
+
|
996 |
+
if (opts.usePadding)
|
997 |
+
{
|
998 |
+
var l_itm = $cfs.children().eq(opts.items.visible+nI-1);
|
999 |
+
l_itm.css(opts.d['marginRight'], l_itm.data('_cfs_origCssMargin'));
|
1000 |
+
}
|
1001 |
+
};
|
1002 |
+
|
1003 |
+
|
1004 |
+
var cb_arguments = sc_mapCallbackArguments(i_old, i_skp, i_new, nI, 'prev', a_dur, w_siz);
|
1005 |
+
|
1006 |
+
// fire onAfter callbacks
|
1007 |
+
_onafter = function() {
|
1008 |
+
sc_afterScroll($cfs, $cf2, sO);
|
1009 |
+
crsl.isScrolling = false;
|
1010 |
+
clbk.onAfter = sc_fireCallbacks($tt0, sO, 'onAfter', cb_arguments, clbk);
|
1011 |
+
queu = sc_fireQueue($cfs, queu, conf);
|
1012 |
+
|
1013 |
+
if (!crsl.isPaused)
|
1014 |
+
{
|
1015 |
+
$cfs.trigger(cf_e('play', conf));
|
1016 |
+
}
|
1017 |
+
};
|
1018 |
+
|
1019 |
+
// fire onBefore callback
|
1020 |
+
crsl.isScrolling = true;
|
1021 |
+
tmrs = sc_clearTimers(tmrs);
|
1022 |
+
clbk.onBefore = sc_fireCallbacks($tt0, sO, 'onBefore', cb_arguments, clbk);
|
1023 |
+
|
1024 |
+
switch(sO.fx)
|
1025 |
+
{
|
1026 |
+
case 'none':
|
1027 |
+
$cfs.css(a_cfs);
|
1028 |
+
_s_wrapper();
|
1029 |
+
_s_paddingold();
|
1030 |
+
_s_paddingnew();
|
1031 |
+
_s_paddingcur();
|
1032 |
+
_position();
|
1033 |
+
_moveitems();
|
1034 |
+
_onafter();
|
1035 |
+
break;
|
1036 |
+
|
1037 |
+
case 'fade':
|
1038 |
+
scrl.anims.push([$cfs, { 'opacity': 0 }, function() {
|
1039 |
+
_s_wrapper();
|
1040 |
+
_s_paddingold();
|
1041 |
+
_s_paddingnew();
|
1042 |
+
_s_paddingcur();
|
1043 |
+
_position();
|
1044 |
+
_moveitems();
|
1045 |
+
scrl = sc_setScroll(a_dur, sO.easing, conf);
|
1046 |
+
scrl.anims.push([$cfs, { 'opacity': 1 }, _onafter]);
|
1047 |
+
sc_startScroll(scrl, conf);
|
1048 |
+
}]);
|
1049 |
+
break;
|
1050 |
+
|
1051 |
+
case 'crossfade':
|
1052 |
+
$cfs.css({ 'opacity': 0 });
|
1053 |
+
scrl.anims.push([$cf2, { 'opacity': 0 }]);
|
1054 |
+
scrl.anims.push([$cfs, { 'opacity': 1 }, _onafter]);
|
1055 |
+
_a_wrapper();
|
1056 |
+
_s_paddingold();
|
1057 |
+
_s_paddingnew();
|
1058 |
+
_s_paddingcur();
|
1059 |
+
_position();
|
1060 |
+
_moveitems();
|
1061 |
+
break;
|
1062 |
+
|
1063 |
+
case 'cover':
|
1064 |
+
scrl.anims.push([$cf2, a_cfs, function() {
|
1065 |
+
_s_paddingold();
|
1066 |
+
_s_paddingnew();
|
1067 |
+
_s_paddingcur();
|
1068 |
+
_position();
|
1069 |
+
_moveitems();
|
1070 |
+
_onafter();
|
1071 |
+
}]);
|
1072 |
+
_a_wrapper();
|
1073 |
+
break;
|
1074 |
+
|
1075 |
+
case 'cover-fade':
|
1076 |
+
scrl.anims.push([$cfs, { 'opacity': 0 }]);
|
1077 |
+
scrl.anims.push([$cf2, a_cfs, function() {
|
1078 |
+
_s_paddingold();
|
1079 |
+
_s_paddingnew();
|
1080 |
+
_s_paddingcur();
|
1081 |
+
_position();
|
1082 |
+
_moveitems();
|
1083 |
+
_onafter();
|
1084 |
+
}]);
|
1085 |
+
_a_wrapper();
|
1086 |
+
break;
|
1087 |
+
|
1088 |
+
case 'uncover':
|
1089 |
+
scrl.anims.push([$cf2, a_wsz, _onafter]);
|
1090 |
+
_a_wrapper();
|
1091 |
+
_s_paddingold();
|
1092 |
+
_s_paddingnew();
|
1093 |
+
_s_paddingcur();
|
1094 |
+
_position();
|
1095 |
+
_moveitems();
|
1096 |
+
break;
|
1097 |
+
|
1098 |
+
case 'uncover-fade':
|
1099 |
+
$cfs.css({ 'opacity': 0 });
|
1100 |
+
scrl.anims.push([$cfs, { 'opacity': 1 }]);
|
1101 |
+
scrl.anims.push([$cf2, a_wsz, _onafter]);
|
1102 |
+
_a_wrapper();
|
1103 |
+
_s_paddingold();
|
1104 |
+
_s_paddingnew();
|
1105 |
+
_s_paddingcur();
|
1106 |
+
_position();
|
1107 |
+
_moveitems();
|
1108 |
+
break;
|
1109 |
+
|
1110 |
+
default:
|
1111 |
+
scrl.anims.push([$cfs, a_cfs, function() {
|
1112 |
+
_moveitems();
|
1113 |
+
_onafter();
|
1114 |
+
}]);
|
1115 |
+
_a_wrapper();
|
1116 |
+
_a_paddingold();
|
1117 |
+
_a_paddingnew();
|
1118 |
+
_a_paddingcur();
|
1119 |
+
break;
|
1120 |
+
}
|
1121 |
+
|
1122 |
+
sc_startScroll(scrl, conf);
|
1123 |
+
cf_setCookie(opts.cookie, $cfs, conf);
|
1124 |
+
|
1125 |
+
$cfs.trigger(cf_e('updatePageStatus', conf), [false, w_siz]);
|
1126 |
+
|
1127 |
+
return true;
|
1128 |
+
});
|
1129 |
+
|
1130 |
+
|
1131 |
+
// next event
|
1132 |
+
$cfs.bind(cf_e('slide_next', conf), function(e, sO, nI) {
|
1133 |
+
e.stopPropagation();
|
1134 |
+
var a_itm = $cfs.children();
|
1135 |
+
|
1136 |
+
// non-circular at end, scroll to start
|
1137 |
+
if (!opts.circular)
|
1138 |
+
{
|
1139 |
+
if (itms.first == opts.items.visible)
|
1140 |
+
{
|
1141 |
+
if (opts.infinite)
|
1142 |
+
{
|
1143 |
+
$cfs.trigger(cf_e('prev', conf), itms.total-1);
|
1144 |
+
}
|
1145 |
+
return e.stopImmediatePropagation();
|
1146 |
+
}
|
1147 |
+
}
|
1148 |
+
|
1149 |
+
sz_resetMargin(a_itm, opts);
|
1150 |
+
|
1151 |
+
// find number of items to scroll
|
1152 |
+
if (!is_number(nI))
|
1153 |
+
{
|
1154 |
+
if (opts.items.filter != '*')
|
1155 |
+
{
|
1156 |
+
var xI = (is_number(sO.items)) ? sO.items : gn_getVisibleOrg($cfs, opts);
|
1157 |
+
nI = gn_getScrollItemsNextFilter(a_itm, opts, 0, xI);
|
1158 |
+
}
|
1159 |
+
else
|
1160 |
+
{
|
1161 |
+
nI = opts.items.visible;
|
1162 |
+
}
|
1163 |
+
nI = cf_getAdjust(nI, opts, sO.items, $tt0);
|
1164 |
+
}
|
1165 |
+
|
1166 |
+
var lastItemNr = (itms.first == 0) ? itms.total : itms.first;
|
1167 |
+
|
1168 |
+
// prevent non-circular from scrolling to far
|
1169 |
+
if (!opts.circular)
|
1170 |
+
{
|
1171 |
+
if (opts.items.visibleConf.variable)
|
1172 |
+
{
|
1173 |
+
var vI = gn_getVisibleItemsNext(a_itm, opts, nI),
|
1174 |
+
xI = gn_getVisibleItemsPrev(a_itm, opts, lastItemNr-1);
|
1175 |
+
}
|
1176 |
+
else
|
1177 |
+
{
|
1178 |
+
var vI = opts.items.visible,
|
1179 |
+
xI = opts.items.visible;
|
1180 |
+
}
|
1181 |
+
|
1182 |
+
if (nI + vI > lastItemNr)
|
1183 |
+
{
|
1184 |
+
nI = lastItemNr - xI;
|
1185 |
+
}
|
1186 |
+
}
|
1187 |
+
|
1188 |
+
// set new number of visible items
|
1189 |
+
opts.items.visibleConf.old = opts.items.visible;
|
1190 |
+
if (opts.items.visibleConf.variable)
|
1191 |
+
{
|
1192 |
+
var vI = cf_getItemsAdjust(gn_getVisibleItemsNextTestCircular(a_itm, opts, nI, lastItemNr), opts, opts.items.visibleConf.adjust, $tt0);
|
1193 |
+
while (opts.items.visible-nI >= vI && nI < itms.total)
|
1194 |
+
{
|
1195 |
+
nI++;
|
1196 |
+
vI = cf_getItemsAdjust(gn_getVisibleItemsNextTestCircular(a_itm, opts, nI, lastItemNr), opts, opts.items.visibleConf.adjust, $tt0);
|
1197 |
+
}
|
1198 |
+
opts.items.visible = vI;
|
1199 |
+
}
|
1200 |
+
else if (opts.items.filter != '*')
|
1201 |
+
{
|
1202 |
+
var vI = gn_getVisibleItemsNextFilter(a_itm, opts, nI);
|
1203 |
+
opts.items.visible = cf_getItemsAdjust(vI, opts, opts.items.visibleConf.adjust, $tt0);
|
1204 |
+
}
|
1205 |
+
|
1206 |
+
sz_resetMargin(a_itm, opts, true);
|
1207 |
+
|
1208 |
+
// scroll 0, don't scroll
|
1209 |
+
if (nI == 0)
|
1210 |
+
{
|
1211 |
+
e.stopImmediatePropagation();
|
1212 |
+
return debug(conf, '0 items to scroll: Not scrolling.');
|
1213 |
+
}
|
1214 |
+
debug(conf, 'Scrolling '+nI+' items forward.');
|
1215 |
+
|
1216 |
+
|
1217 |
+
// save new config
|
1218 |
+
itms.first -= nI;
|
1219 |
+
while (itms.first < 0)
|
1220 |
+
{
|
1221 |
+
itms.first += itms.total;
|
1222 |
+
}
|
1223 |
+
|
1224 |
+
// non-circular callback
|
1225 |
+
if (!opts.circular)
|
1226 |
+
{
|
1227 |
+
if (itms.first == opts.items.visible && sO.onEnd)
|
1228 |
+
{
|
1229 |
+
sO.onEnd.call($tt0, 'next');
|
1230 |
+
}
|
1231 |
+
if (!opts.infinite)
|
1232 |
+
{
|
1233 |
+
nv_enableNavi(opts, itms.first, conf);
|
1234 |
+
}
|
1235 |
+
}
|
1236 |
+
|
1237 |
+
// rearrange items
|
1238 |
+
if (itms.total < opts.items.visible+nI)
|
1239 |
+
{
|
1240 |
+
$cfs.children().slice(0, (opts.items.visible+nI)-itms.total).clone(true).appendTo($cfs);
|
1241 |
+
}
|
1242 |
+
|
1243 |
+
// the needed items
|
1244 |
+
var a_itm = $cfs.children(),
|
1245 |
+
i_old = gi_getOldItemsNext(a_itm, opts),
|
1246 |
+
i_new = gi_getNewItemsNext(a_itm, opts, nI),
|
1247 |
+
i_cur_l = a_itm.eq(nI-1),
|
1248 |
+
i_old_l = i_old.last(),
|
1249 |
+
i_new_l = i_new.last();
|
1250 |
+
|
1251 |
+
sz_resetMargin(a_itm, opts);
|
1252 |
+
|
1253 |
+
var pL = 0,
|
1254 |
+
pR = 0;
|
1255 |
+
|
1256 |
+
if (opts.align)
|
1257 |
+
{
|
1258 |
+
var p = cf_getAlignPadding(i_new, opts);
|
1259 |
+
pL = p[0];
|
1260 |
+
pR = p[1];
|
1261 |
+
}
|
1262 |
+
|
1263 |
+
// hide items for fx directscroll
|
1264 |
+
var hiddenitems = false,
|
1265 |
+
i_skp = $();
|
1266 |
+
if (opts.items.visibleConf.old < nI)
|
1267 |
+
{
|
1268 |
+
i_skp = a_itm.slice(opts.items.visibleConf.old, nI);
|
1269 |
+
if (sO.fx == 'directscroll')
|
1270 |
+
{
|
1271 |
+
var orgW = opts.items[opts.d['width']];
|
1272 |
+
hiddenitems = i_skp;
|
1273 |
+
i_cur_l = i_old_l;
|
1274 |
+
sc_hideHiddenItems(hiddenitems);
|
1275 |
+
opts.items[opts.d['width']] = 'variable';
|
1276 |
+
}
|
1277 |
+
}
|
1278 |
+
|
1279 |
+
// save new sizes
|
1280 |
+
var $cf2 = false,
|
1281 |
+
i_siz = ms_getTotalSize(a_itm.slice(0, nI), opts, 'width'),
|
1282 |
+
w_siz = cf_mapWrapperSizes(ms_getSizes(i_new, opts, true), opts, !opts.usePadding),
|
1283 |
+
i_siz_vis = 0,
|
1284 |
+
a_cfs = {},
|
1285 |
+
a_cfs_vis = {},
|
1286 |
+
a_cur = {},
|
1287 |
+
a_old = {},
|
1288 |
+
a_lef = {},
|
1289 |
+
a_dur = sc_getDuration(sO, opts, nI, i_siz);
|
1290 |
+
|
1291 |
+
switch(sO.fx)
|
1292 |
+
{
|
1293 |
+
case 'uncover':
|
1294 |
+
case 'uncover-fade':
|
1295 |
+
i_siz_vis = ms_getTotalSize(a_itm.slice(0, opts.items.visibleConf.old), opts, 'width');
|
1296 |
+
break;
|
1297 |
+
}
|
1298 |
+
|
1299 |
+
if (hiddenitems)
|
1300 |
+
{
|
1301 |
+
opts.items[opts.d['width']] = orgW;
|
1302 |
+
}
|
1303 |
+
|
1304 |
+
if (opts.align)
|
1305 |
+
{
|
1306 |
+
if (opts.padding[opts.d[1]] < 0)
|
1307 |
+
{
|
1308 |
+
opts.padding[opts.d[1]] = 0;
|
1309 |
+
}
|
1310 |
+
}
|
1311 |
+
sz_resetMargin(a_itm, opts, true);
|
1312 |
+
sz_resetMargin(i_old_l, opts, opts.padding[opts.d[1]]);
|
1313 |
+
|
1314 |
+
if (opts.align)
|
1315 |
+
{
|
1316 |
+
opts.padding[opts.d[1]] = pR;
|
1317 |
+
opts.padding[opts.d[3]] = pL;
|
1318 |
+
}
|
1319 |
+
|
1320 |
+
a_lef[opts.d['left']] = (opts.usePadding) ? opts.padding[opts.d[3]] : 0;
|
1321 |
+
|
1322 |
+
// scrolling functions
|
1323 |
+
var _s_wrapper = function() {},
|
1324 |
+
_a_wrapper = function() {},
|
1325 |
+
_s_paddingold = function() {},
|
1326 |
+
_a_paddingold = function() {},
|
1327 |
+
_s_paddingcur = function() {},
|
1328 |
+
_a_paddingcur = function() {},
|
1329 |
+
_onafter = function() {},
|
1330 |
+
_moveitems = function() {},
|
1331 |
+
_position = function() {};
|
1332 |
+
|
1333 |
+
// clone carousel
|
1334 |
+
switch(sO.fx)
|
1335 |
+
{
|
1336 |
+
case 'crossfade':
|
1337 |
+
case 'cover':
|
1338 |
+
case 'cover-fade':
|
1339 |
+
case 'uncover':
|
1340 |
+
case 'uncover-fade':
|
1341 |
+
$cf2 = $cfs.clone(true).appendTo($wrp);
|
1342 |
+
$cf2.children().slice(opts.items.visibleConf.old).remove();
|
1343 |
+
break;
|
1344 |
+
}
|
1345 |
+
switch(sO.fx)
|
1346 |
+
{
|
1347 |
+
case 'crossfade':
|
1348 |
+
case 'cover':
|
1349 |
+
case 'cover-fade':
|
1350 |
+
$cfs.css('zIndex', 1);
|
1351 |
+
$cf2.css('zIndex', 0);
|
1352 |
+
break;
|
1353 |
+
}
|
1354 |
+
|
1355 |
+
// reset all scrolls
|
1356 |
+
scrl = sc_setScroll(a_dur, sO.easing, conf);
|
1357 |
+
|
1358 |
+
// animate / set carousel
|
1359 |
+
a_cfs[opts.d['left']] = -i_siz;
|
1360 |
+
a_cfs_vis[opts.d['left']] = -i_siz_vis;
|
1361 |
+
|
1362 |
+
if (pL < 0)
|
1363 |
+
{
|
1364 |
+
a_cfs[opts.d['left']] += pL;
|
1365 |
+
}
|
1366 |
+
|
1367 |
+
// animate / set wrapper
|
1368 |
+
if (opts[opts.d['width']] == 'variable' || opts[opts.d['height']] == 'variable')
|
1369 |
+
{
|
1370 |
+
_s_wrapper = function() {
|
1371 |
+
$wrp.css(w_siz);
|
1372 |
+
};
|
1373 |
+
_a_wrapper = function() {
|
1374 |
+
scrl.anims.push([$wrp, w_siz]);
|
1375 |
+
};
|
1376 |
+
}
|
1377 |
+
|
1378 |
+
// animate / set items
|
1379 |
+
if (opts.usePadding)
|
1380 |
+
{
|
1381 |
+
var i_new_l_m = i_new_l.data('_cfs_origCssMargin');
|
1382 |
+
|
1383 |
+
if (pR >= 0)
|
1384 |
+
{
|
1385 |
+
i_new_l_m += opts.padding[opts.d[1]];
|
1386 |
+
}
|
1387 |
+
i_new_l.css(opts.d['marginRight'], i_new_l_m);
|
1388 |
+
|
1389 |
+
if (i_cur_l.not(i_old_l).length)
|
1390 |
+
{
|
1391 |
+
a_old[opts.d['marginRight']] = i_old_l.data('_cfs_origCssMargin');
|
1392 |
+
}
|
1393 |
+
_s_paddingold = function() {
|
1394 |
+
i_old_l.css(a_old);
|
1395 |
+
};
|
1396 |
+
_a_paddingold = function() {
|
1397 |
+
scrl.anims.push([i_old_l, a_old]);
|
1398 |
+
};
|
1399 |
+
|
1400 |
+
var i_cur_l_m = i_cur_l.data('_cfs_origCssMargin');
|
1401 |
+
if (pL > 0)
|
1402 |
+
{
|
1403 |
+
i_cur_l_m += opts.padding[opts.d[3]];
|
1404 |
+
}
|
1405 |
+
|
1406 |
+
a_cur[opts.d['marginRight']] = i_cur_l_m;
|
1407 |
+
|
1408 |
+
_s_paddingcur = function() {
|
1409 |
+
i_cur_l.css(a_cur);
|
1410 |
+
};
|
1411 |
+
_a_paddingcur = function() {
|
1412 |
+
scrl.anims.push([i_cur_l, a_cur]);
|
1413 |
+
};
|
1414 |
+
}
|
1415 |
+
|
1416 |
+
// set position
|
1417 |
+
_position = function() {
|
1418 |
+
$cfs.css(a_lef);
|
1419 |
+
};
|
1420 |
+
|
1421 |
+
|
1422 |
+
var overFill = opts.items.visible+nI-itms.total;
|
1423 |
+
|
1424 |
+
// rearrange items
|
1425 |
+
_moveitems = function() {
|
1426 |
+
if (overFill > 0)
|
1427 |
+
{
|
1428 |
+
$cfs.children().slice(itms.total).remove();
|
1429 |
+
}
|
1430 |
+
var l_itm = $cfs.children().slice(0, nI).appendTo($cfs).last();
|
1431 |
+
if (overFill > 0)
|
1432 |
+
{
|
1433 |
+
i_new = gi_getCurrentItems(a_itm, opts);
|
1434 |
+
}
|
1435 |
+
sc_showHiddenItems(hiddenitems);
|
1436 |
+
|
1437 |
+
if (opts.usePadding)
|
1438 |
+
{
|
1439 |
+
if (itms.total < opts.items.visible+nI) {
|
1440 |
+
var i_cur_l = $cfs.children().eq(opts.items.visible-1);
|
1441 |
+
i_cur_l.css(opts.d['marginRight'], i_cur_l.data('_cfs_origCssMargin') + opts.padding[opts.d[1]]);
|
1442 |
+
}
|
1443 |
+
l_itm.css(opts.d['marginRight'], l_itm.data('_cfs_origCssMargin'));
|
1444 |
+
}
|
1445 |
+
};
|
1446 |
+
|
1447 |
+
|
1448 |
+
var cb_arguments = sc_mapCallbackArguments(i_old, i_skp, i_new, nI, 'next', a_dur, w_siz);
|
1449 |
+
|
1450 |
+
// fire onAfter callbacks
|
1451 |
+
_onafter = function() {
|
1452 |
+
$cfs.css('zIndex', $cfs.data('_cfs_origCssZindex'));
|
1453 |
+
sc_afterScroll($cfs, $cf2, sO);
|
1454 |
+
crsl.isScrolling = false;
|
1455 |
+
clbk.onAfter = sc_fireCallbacks($tt0, sO, 'onAfter', cb_arguments, clbk);
|
1456 |
+
queu = sc_fireQueue($cfs, queu, conf);
|
1457 |
+
|
1458 |
+
if (!crsl.isPaused)
|
1459 |
+
{
|
1460 |
+
$cfs.trigger(cf_e('play', conf));
|
1461 |
+
}
|
1462 |
+
};
|
1463 |
+
|
1464 |
+
// fire onBefore callbacks
|
1465 |
+
crsl.isScrolling = true;
|
1466 |
+
tmrs = sc_clearTimers(tmrs);
|
1467 |
+
clbk.onBefore = sc_fireCallbacks($tt0, sO, 'onBefore', cb_arguments, clbk);
|
1468 |
+
|
1469 |
+
switch(sO.fx)
|
1470 |
+
{
|
1471 |
+
case 'none':
|
1472 |
+
$cfs.css(a_cfs);
|
1473 |
+
_s_wrapper();
|
1474 |
+
_s_paddingold();
|
1475 |
+
_s_paddingcur();
|
1476 |
+
_position();
|
1477 |
+
_moveitems();
|
1478 |
+
_onafter();
|
1479 |
+
break;
|
1480 |
+
|
1481 |
+
case 'fade':
|
1482 |
+
scrl.anims.push([$cfs, { 'opacity': 0 }, function() {
|
1483 |
+
_s_wrapper();
|
1484 |
+
_s_paddingold();
|
1485 |
+
_s_paddingcur();
|
1486 |
+
_position();
|
1487 |
+
_moveitems();
|
1488 |
+
scrl = sc_setScroll(a_dur, sO.easing, conf);
|
1489 |
+
scrl.anims.push([$cfs, { 'opacity': 1 }, _onafter]);
|
1490 |
+
sc_startScroll(scrl, conf);
|
1491 |
+
}]);
|
1492 |
+
break;
|
1493 |
+
|
1494 |
+
case 'crossfade':
|
1495 |
+
$cfs.css({ 'opacity': 0 });
|
1496 |
+
scrl.anims.push([$cf2, { 'opacity': 0 }]);
|
1497 |
+
scrl.anims.push([$cfs, { 'opacity': 1 }, _onafter]);
|
1498 |
+
_a_wrapper();
|
1499 |
+
_s_paddingold();
|
1500 |
+
_s_paddingcur();
|
1501 |
+
_position();
|
1502 |
+
_moveitems();
|
1503 |
+
break;
|
1504 |
+
|
1505 |
+
case 'cover':
|
1506 |
+
$cfs.css(opts.d['left'], $wrp[opts.d['width']]());
|
1507 |
+
scrl.anims.push([$cfs, a_lef, _onafter]);
|
1508 |
+
_a_wrapper();
|
1509 |
+
_s_paddingold();
|
1510 |
+
_s_paddingcur();
|
1511 |
+
_moveitems();
|
1512 |
+
break;
|
1513 |
+
|
1514 |
+
case 'cover-fade':
|
1515 |
+
$cfs.css(opts.d['left'], $wrp[opts.d['width']]());
|
1516 |
+
scrl.anims.push([$cf2, { 'opacity': 0 }]);
|
1517 |
+
scrl.anims.push([$cfs, a_lef, _onafter]);
|
1518 |
+
_a_wrapper();
|
1519 |
+
_s_paddingold();
|
1520 |
+
_s_paddingcur();
|
1521 |
+
_moveitems();
|
1522 |
+
break;
|
1523 |
+
|
1524 |
+
case 'uncover':
|
1525 |
+
scrl.anims.push([$cf2, a_cfs_vis, _onafter]);
|
1526 |
+
_a_wrapper();
|
1527 |
+
_s_paddingold();
|
1528 |
+
_s_paddingcur();
|
1529 |
+
_position();
|
1530 |
+
_moveitems();
|
1531 |
+
break;
|
1532 |
+
|
1533 |
+
case 'uncover-fade':
|
1534 |
+
$cfs.css({ 'opacity': 0 });
|
1535 |
+
scrl.anims.push([$cfs, { 'opacity': 1 }]);
|
1536 |
+
scrl.anims.push([$cf2, a_cfs_vis, _onafter]);
|
1537 |
+
_a_wrapper();
|
1538 |
+
_s_paddingold();
|
1539 |
+
_s_paddingcur();
|
1540 |
+
_position();
|
1541 |
+
_moveitems();
|
1542 |
+
break;
|
1543 |
+
|
1544 |
+
default:
|
1545 |
+
scrl.anims.push([$cfs, a_cfs, function() {
|
1546 |
+
_position();
|
1547 |
+
_moveitems();
|
1548 |
+
_onafter();
|
1549 |
+
}]);
|
1550 |
+
_a_wrapper();
|
1551 |
+
_a_paddingold();
|
1552 |
+
_a_paddingcur();
|
1553 |
+
break;
|
1554 |
+
}
|
1555 |
+
|
1556 |
+
sc_startScroll(scrl, conf);
|
1557 |
+
cf_setCookie(opts.cookie, $cfs, conf);
|
1558 |
+
|
1559 |
+
$cfs.trigger(cf_e('updatePageStatus', conf), [false, w_siz]);
|
1560 |
+
|
1561 |
+
return true;
|
1562 |
+
});
|
1563 |
+
|
1564 |
+
|
1565 |
+
// slideTo event
|
1566 |
+
$cfs.bind(cf_e('slideTo', conf), function(e, num, dev, org, obj, dir, clb) {
|
1567 |
+
e.stopPropagation();
|
1568 |
+
|
1569 |
+
var v = [num, dev, org, obj, dir, clb],
|
1570 |
+
t = ['string/number/object', 'number', 'boolean', 'object', 'string', 'function'],
|
1571 |
+
a = cf_sortParams(v, t);
|
1572 |
+
|
1573 |
+
obj = a[3];
|
1574 |
+
dir = a[4];
|
1575 |
+
clb = a[5];
|
1576 |
+
|
1577 |
+
num = gn_getItemIndex(a[0], a[1], a[2], itms, $cfs);
|
1578 |
+
|
1579 |
+
if (num == 0)
|
1580 |
+
{
|
1581 |
+
return false;
|
1582 |
+
}
|
1583 |
+
if (!is_object(obj))
|
1584 |
+
{
|
1585 |
+
obj = false;
|
1586 |
+
}
|
1587 |
+
|
1588 |
+
if (dir != 'prev' && dir != 'next')
|
1589 |
+
{
|
1590 |
+
if (opts.circular)
|
1591 |
+
{
|
1592 |
+
dir = (num <= itms.total / 2) ? 'next' : 'prev';
|
1593 |
+
}
|
1594 |
+
else
|
1595 |
+
{
|
1596 |
+
dir = (itms.first == 0 || itms.first > num) ? 'next' : 'prev';
|
1597 |
+
}
|
1598 |
+
}
|
1599 |
+
|
1600 |
+
if (dir == 'prev')
|
1601 |
+
{
|
1602 |
+
num = itms.total-num;
|
1603 |
+
}
|
1604 |
+
$cfs.trigger(cf_e(dir, conf), [obj, num, clb]);
|
1605 |
+
|
1606 |
+
return true;
|
1607 |
+
});
|
1608 |
+
|
1609 |
+
|
1610 |
+
// prevPage event
|
1611 |
+
$cfs.bind(cf_e('prevPage', conf), function(e, obj, clb) {
|
1612 |
+
e.stopPropagation();
|
1613 |
+
var cur = $cfs.triggerHandler(cf_e('currentPage', conf));
|
1614 |
+
return $cfs.triggerHandler(cf_e('slideToPage', conf), [cur-1, obj, 'prev', clb]);
|
1615 |
+
});
|
1616 |
+
|
1617 |
+
|
1618 |
+
// nextPage event
|
1619 |
+
$cfs.bind(cf_e('nextPage', conf), function(e, obj, clb) {
|
1620 |
+
e.stopPropagation();
|
1621 |
+
var cur = $cfs.triggerHandler(cf_e('currentPage', conf));
|
1622 |
+
return $cfs.triggerHandler(cf_e('slideToPage', conf), [cur+1, obj, 'next', clb]);
|
1623 |
+
});
|
1624 |
+
|
1625 |
+
|
1626 |
+
// slideToPage event
|
1627 |
+
$cfs.bind(cf_e('slideToPage', conf), function(e, pag, obj, dir, clb) {
|
1628 |
+
e.stopPropagation();
|
1629 |
+
if (!is_number(pag))
|
1630 |
+
{
|
1631 |
+
pag = $cfs.triggerHandler(cf_e('currentPage', conf));
|
1632 |
+
}
|
1633 |
+
var ipp = opts.pagination.items || opts.items.visible,
|
1634 |
+
max = Math.ceil(itms.total / ipp)-1;
|
1635 |
+
|
1636 |
+
if (pag < 0)
|
1637 |
+
{
|
1638 |
+
pag = max;
|
1639 |
+
}
|
1640 |
+
if (pag > max)
|
1641 |
+
{
|
1642 |
+
pag = 0;
|
1643 |
+
}
|
1644 |
+
return $cfs.triggerHandler(cf_e('slideTo', conf), [pag*ipp, 0, true, obj, dir, clb]);
|
1645 |
+
});
|
1646 |
+
|
1647 |
+
// jumpToStart event
|
1648 |
+
$cfs.bind(cf_e('jumpToStart', conf), function(e, s) {
|
1649 |
+
e.stopPropagation();
|
1650 |
+
if (s)
|
1651 |
+
{
|
1652 |
+
s = gn_getItemIndex(s, 0, true, itms, $cfs);
|
1653 |
+
}
|
1654 |
+
else
|
1655 |
+
{
|
1656 |
+
s = 0;
|
1657 |
+
}
|
1658 |
+
|
1659 |
+
s += itms.first;
|
1660 |
+
if (s != 0)
|
1661 |
+
{
|
1662 |
+
if (itms.total > 0)
|
1663 |
+
{
|
1664 |
+
while (s > itms.total)
|
1665 |
+
{
|
1666 |
+
s -= itms.total;
|
1667 |
+
}
|
1668 |
+
}
|
1669 |
+
$cfs.prepend($cfs.children().slice(s, itms.total));
|
1670 |
+
}
|
1671 |
+
return true;
|
1672 |
+
});
|
1673 |
+
|
1674 |
+
|
1675 |
+
// synchronise event
|
1676 |
+
$cfs.bind(cf_e('synchronise', conf), function(e, s) {
|
1677 |
+
e.stopPropagation();
|
1678 |
+
if (s)
|
1679 |
+
{
|
1680 |
+
s = cf_getSynchArr(s);
|
1681 |
+
}
|
1682 |
+
else if (opts.synchronise)
|
1683 |
+
{
|
1684 |
+
s = opts.synchronise;
|
1685 |
+
}
|
1686 |
+
else
|
1687 |
+
{
|
1688 |
+
return debug(conf, 'No carousel to synchronise.');
|
1689 |
+
}
|
1690 |
+
|
1691 |
+
var n = $cfs.triggerHandler(cf_e('currentPosition', conf)),
|
1692 |
+
x = true;
|
1693 |
+
|
1694 |
+
for (var j = 0, l = s.length; j < l; j++)
|
1695 |
+
{
|
1696 |
+
if (!s[j][0].triggerHandler(cf_e('slideTo', conf), [n, s[j][3], true]))
|
1697 |
+
{
|
1698 |
+
x = false;
|
1699 |
+
}
|
1700 |
+
}
|
1701 |
+
return x;
|
1702 |
+
});
|
1703 |
+
|
1704 |
+
|
1705 |
+
// queue event
|
1706 |
+
$cfs.bind(cf_e('queue', conf), function(e, dir, opt) {
|
1707 |
+
e.stopPropagation();
|
1708 |
+
if (is_function(dir))
|
1709 |
+
{
|
1710 |
+
dir.call($tt0, queu);
|
1711 |
+
}
|
1712 |
+
else if (is_array(dir))
|
1713 |
+
{
|
1714 |
+
queu = dir;
|
1715 |
+
}
|
1716 |
+
else if (!is_undefined(dir))
|
1717 |
+
{
|
1718 |
+
queu.push([dir, opt]);
|
1719 |
+
}
|
1720 |
+
return queu;
|
1721 |
+
});
|
1722 |
+
|
1723 |
+
|
1724 |
+
// insertItem event
|
1725 |
+
$cfs.bind(cf_e('insertItem', conf), function(e, itm, num, org, dev) {
|
1726 |
+
e.stopPropagation();
|
1727 |
+
|
1728 |
+
var v = [itm, num, org, dev],
|
1729 |
+
t = ['string/object', 'string/number/object', 'boolean', 'number'],
|
1730 |
+
a = cf_sortParams(v, t);
|
1731 |
+
|
1732 |
+
itm = a[0];
|
1733 |
+
num = a[1];
|
1734 |
+
org = a[2];
|
1735 |
+
dev = a[3];
|
1736 |
+
|
1737 |
+
if (is_object(itm) && !is_jquery(itm))
|
1738 |
+
{
|
1739 |
+
itm = $(itm);
|
1740 |
+
}
|
1741 |
+
else if (is_string(itm))
|
1742 |
+
{
|
1743 |
+
itm = $(itm);
|
1744 |
+
}
|
1745 |
+
if (!is_jquery(itm) || itm.length == 0)
|
1746 |
+
{
|
1747 |
+
return debug(conf, 'Not a valid object.');
|
1748 |
+
}
|
1749 |
+
|
1750 |
+
if (is_undefined(num))
|
1751 |
+
{
|
1752 |
+
num = 'end';
|
1753 |
+
}
|
1754 |
+
|
1755 |
+
sz_storeMargin(itm, opts);
|
1756 |
+
sz_storeOrigCss(itm);
|
1757 |
+
|
1758 |
+
var orgNum = num,
|
1759 |
+
before = 'before';
|
1760 |
+
|
1761 |
+
if (num == 'end')
|
1762 |
+
{
|
1763 |
+
if (org)
|
1764 |
+
{
|
1765 |
+
if (itms.first == 0)
|
1766 |
+
{
|
1767 |
+
num = itms.total-1;
|
1768 |
+
before = 'after';
|
1769 |
+
}
|
1770 |
+
else
|
1771 |
+
{
|
1772 |
+
num = itms.first;
|
1773 |
+
itms.first += itm.length;
|
1774 |
+
}
|
1775 |
+
if (num < 0)
|
1776 |
+
{
|
1777 |
+
num = 0;
|
1778 |
+
}
|
1779 |
+
}
|
1780 |
+
else
|
1781 |
+
{
|
1782 |
+
num = itms.total-1;
|
1783 |
+
before = 'after';
|
1784 |
+
}
|
1785 |
+
}
|
1786 |
+
else
|
1787 |
+
{
|
1788 |
+
num = gn_getItemIndex(num, dev, org, itms, $cfs);
|
1789 |
+
}
|
1790 |
+
|
1791 |
+
var $cit = $cfs.children().eq(num);
|
1792 |
+
if ($cit.length)
|
1793 |
+
{
|
1794 |
+
$cit[before](itm);
|
1795 |
+
}
|
1796 |
+
else
|
1797 |
+
{
|
1798 |
+
debug(conf, 'Correct insert-position not found! Appending item to the end.');
|
1799 |
+
$cfs.append(itm);
|
1800 |
+
}
|
1801 |
+
|
1802 |
+
if (orgNum != 'end' && !org)
|
1803 |
+
{
|
1804 |
+
if (num < itms.first)
|
1805 |
+
{
|
1806 |
+
itms.first += itm.length;
|
1807 |
+
}
|
1808 |
+
}
|
1809 |
+
itms.total = $cfs.children().length;
|
1810 |
+
if (itms.first >= itms.total)
|
1811 |
+
{
|
1812 |
+
itms.first -= itms.total;
|
1813 |
+
}
|
1814 |
+
|
1815 |
+
$cfs.trigger(cf_e('updateSizes', conf));
|
1816 |
+
$cfs.trigger(cf_e('linkAnchors', conf));
|
1817 |
+
|
1818 |
+
return true;
|
1819 |
+
});
|
1820 |
+
|
1821 |
+
|
1822 |
+
// removeItem event
|
1823 |
+
$cfs.bind(cf_e('removeItem', conf), function(e, num, org, dev) {
|
1824 |
+
e.stopPropagation();
|
1825 |
+
|
1826 |
+
var v = [num, org, dev],
|
1827 |
+
t = ['string/number/object', 'boolean', 'number'],
|
1828 |
+
a = cf_sortParams(v, t);
|
1829 |
+
|
1830 |
+
num = a[0];
|
1831 |
+
org = a[1];
|
1832 |
+
dev = a[2];
|
1833 |
+
|
1834 |
+
var removed = false;
|
1835 |
+
|
1836 |
+
if (num instanceof $ && num.length > 1)
|
1837 |
+
{
|
1838 |
+
$removed = $();
|
1839 |
+
num.each(function(i, el) {
|
1840 |
+
var $rem = $cfs.trigger(cf_e('removeItem', conf), [$(this), org, dev]);
|
1841 |
+
if ( $rem )
|
1842 |
+
{
|
1843 |
+
$removed = $removed.add($rem);
|
1844 |
+
}
|
1845 |
+
});
|
1846 |
+
return $removed;
|
1847 |
+
}
|
1848 |
+
|
1849 |
+
if (is_undefined(num) || num == 'end')
|
1850 |
+
{
|
1851 |
+
$removed = $cfs.children().last();
|
1852 |
+
}
|
1853 |
+
else
|
1854 |
+
{
|
1855 |
+
num = gn_getItemIndex(num, dev, org, itms, $cfs);
|
1856 |
+
var $removed = $cfs.children().eq(num);
|
1857 |
+
if ( $removed.length )
|
1858 |
+
{
|
1859 |
+
if (num < itms.first)
|
1860 |
+
{
|
1861 |
+
itms.first -= $removed.length;
|
1862 |
+
}
|
1863 |
+
}
|
1864 |
+
}
|
1865 |
+
if ( $removed && $removed.length )
|
1866 |
+
{
|
1867 |
+
$removed.detach();
|
1868 |
+
itms.total = $cfs.children().length;
|
1869 |
+
$cfs.trigger(cf_e('updateSizes', conf));
|
1870 |
+
}
|
1871 |
+
|
1872 |
+
return $removed;
|
1873 |
+
});
|
1874 |
+
|
1875 |
+
|
1876 |
+
// onBefore and onAfter event
|
1877 |
+
$cfs.bind(cf_e('onBefore', conf)+' '+cf_e('onAfter', conf), function(e, fn) {
|
1878 |
+
e.stopPropagation();
|
1879 |
+
var eType = e.type.slice(conf.events.prefix.length);
|
1880 |
+
if (is_array(fn))
|
1881 |
+
{
|
1882 |
+
clbk[eType] = fn;
|
1883 |
+
}
|
1884 |
+
if (is_function(fn))
|
1885 |
+
{
|
1886 |
+
clbk[eType].push(fn);
|
1887 |
+
}
|
1888 |
+
return clbk[eType];
|
1889 |
+
});
|
1890 |
+
|
1891 |
+
|
1892 |
+
// currentPosition event
|
1893 |
+
$cfs.bind(cf_e('currentPosition', conf), function(e, fn) {
|
1894 |
+
e.stopPropagation();
|
1895 |
+
if (itms.first == 0)
|
1896 |
+
{
|
1897 |
+
var val = 0;
|
1898 |
+
}
|
1899 |
+
else
|
1900 |
+
{
|
1901 |
+
var val = itms.total - itms.first;
|
1902 |
+
}
|
1903 |
+
if (is_function(fn))
|
1904 |
+
{
|
1905 |
+
fn.call($tt0, val);
|
1906 |
+
}
|
1907 |
+
return val;
|
1908 |
+
});
|
1909 |
+
|
1910 |
+
|
1911 |
+
// currentPage event
|
1912 |
+
$cfs.bind(cf_e('currentPage', conf), function(e, fn) {
|
1913 |
+
e.stopPropagation();
|
1914 |
+
var ipp = opts.pagination.items || opts.items.visible,
|
1915 |
+
max = Math.ceil(itms.total/ipp-1),
|
1916 |
+
nr;
|
1917 |
+
if (itms.first == 0)
|
1918 |
+
{
|
1919 |
+
nr = 0;
|
1920 |
+
}
|
1921 |
+
else if (itms.first < itms.total % ipp)
|
1922 |
+
{
|
1923 |
+
nr = 0;
|
1924 |
+
}
|
1925 |
+
else if (itms.first == ipp && !opts.circular)
|
1926 |
+
{
|
1927 |
+
nr = max;
|
1928 |
+
}
|
1929 |
+
else
|
1930 |
+
{
|
1931 |
+
nr = Math.round((itms.total-itms.first)/ipp);
|
1932 |
+
}
|
1933 |
+
if (nr < 0)
|
1934 |
+
{
|
1935 |
+
nr = 0;
|
1936 |
+
}
|
1937 |
+
if (nr > max)
|
1938 |
+
{
|
1939 |
+
nr = max;
|
1940 |
+
}
|
1941 |
+
if (is_function(fn))
|
1942 |
+
{
|
1943 |
+
fn.call($tt0, nr);
|
1944 |
+
}
|
1945 |
+
return nr;
|
1946 |
+
});
|
1947 |
+
|
1948 |
+
|
1949 |
+
// currentVisible event
|
1950 |
+
$cfs.bind(cf_e('currentVisible', conf), function(e, fn) {
|
1951 |
+
e.stopPropagation();
|
1952 |
+
var $i = gi_getCurrentItems($cfs.children(), opts);
|
1953 |
+
if (is_function(fn))
|
1954 |
+
{
|
1955 |
+
fn.call($tt0, $i);
|
1956 |
+
}
|
1957 |
+
return $i;
|
1958 |
+
});
|
1959 |
+
|
1960 |
+
|
1961 |
+
// slice event
|
1962 |
+
$cfs.bind(cf_e('slice', conf), function(e, f, l, fn) {
|
1963 |
+
e.stopPropagation();
|
1964 |
+
|
1965 |
+
if (itms.total == 0)
|
1966 |
+
{
|
1967 |
+
return false;
|
1968 |
+
}
|
1969 |
+
|
1970 |
+
var v = [f, l, fn],
|
1971 |
+
t = ['number', 'number', 'function'],
|
1972 |
+
a = cf_sortParams(v, t);
|
1973 |
+
|
1974 |
+
f = (is_number(a[0])) ? a[0] : 0;
|
1975 |
+
l = (is_number(a[1])) ? a[1] : itms.total;
|
1976 |
+
fn = a[2];
|
1977 |
+
|
1978 |
+
f += itms.first;
|
1979 |
+
l += itms.first;
|
1980 |
+
|
1981 |
+
if (items.total > 0)
|
1982 |
+
{
|
1983 |
+
while (f > itms.total)
|
1984 |
+
{
|
1985 |
+
f -= itms.total;
|
1986 |
+
}
|
1987 |
+
while (l > itms.total)
|
1988 |
+
{
|
1989 |
+
l -= itms.total;
|
1990 |
+
}
|
1991 |
+
while (f < 0)
|
1992 |
+
{
|
1993 |
+
f += itms.total;
|
1994 |
+
}
|
1995 |
+
while (l < 0)
|
1996 |
+
{
|
1997 |
+
l += itms.total;
|
1998 |
+
}
|
1999 |
+
}
|
2000 |
+
var $iA = $cfs.children(),
|
2001 |
+
$i;
|
2002 |
+
|
2003 |
+
if (l > f)
|
2004 |
+
{
|
2005 |
+
$i = $iA.slice(f, l);
|
2006 |
+
}
|
2007 |
+
else
|
2008 |
+
{
|
2009 |
+
$i = $( $iA.slice(f, itms.total).get().concat( $iA.slice(0, l).get() ) );
|
2010 |
+
}
|
2011 |
+
|
2012 |
+
if (is_function(fn))
|
2013 |
+
{
|
2014 |
+
fn.call($tt0, $i);
|
2015 |
+
}
|
2016 |
+
return $i;
|
2017 |
+
});
|
2018 |
+
|
2019 |
+
|
2020 |
+
// isPaused, isStopped and isScrolling events
|
2021 |
+
$cfs.bind(cf_e('isPaused', conf)+' '+cf_e('isStopped', conf)+' '+cf_e('isScrolling', conf), function(e, fn) {
|
2022 |
+
e.stopPropagation();
|
2023 |
+
var eType = e.type.slice(conf.events.prefix.length),
|
2024 |
+
value = crsl[eType];
|
2025 |
+
if (is_function(fn))
|
2026 |
+
{
|
2027 |
+
fn.call($tt0, value);
|
2028 |
+
}
|
2029 |
+
return value;
|
2030 |
+
});
|
2031 |
+
|
2032 |
+
|
2033 |
+
// configuration event
|
2034 |
+
$cfs.bind(cf_e('configuration', conf), function(e, a, b, c) {
|
2035 |
+
e.stopPropagation();
|
2036 |
+
var reInit = false;
|
2037 |
+
|
2038 |
+
// return entire configuration-object
|
2039 |
+
if (is_function(a))
|
2040 |
+
{
|
2041 |
+
a.call($tt0, opts);
|
2042 |
+
}
|
2043 |
+
// set multiple options via object
|
2044 |
+
else if (is_object(a))
|
2045 |
+
{
|
2046 |
+
opts_orig = $.extend(true, {}, opts_orig, a);
|
2047 |
+
if (b !== false) reInit = true;
|
2048 |
+
else opts = $.extend(true, {}, opts, a);
|
2049 |
+
|
2050 |
+
}
|
2051 |
+
else if (!is_undefined(a))
|
2052 |
+
{
|
2053 |
+
|
2054 |
+
// callback function for specific option
|
2055 |
+
if (is_function(b))
|
2056 |
+
{
|
2057 |
+
var val = eval('opts.'+a);
|
2058 |
+
if (is_undefined(val))
|
2059 |
+
{
|
2060 |
+
val = '';
|
2061 |
+
}
|
2062 |
+
b.call($tt0, val);
|
2063 |
+
}
|
2064 |
+
// set individual option
|
2065 |
+
else if (!is_undefined(b))
|
2066 |
+
{
|
2067 |
+
if (typeof c !== 'boolean') c = true;
|
2068 |
+
eval('opts_orig.'+a+' = b');
|
2069 |
+
if (c !== false) reInit = true;
|
2070 |
+
else eval('opts.'+a+' = b');
|
2071 |
+
}
|
2072 |
+
// return value for specific option
|
2073 |
+
else
|
2074 |
+
{
|
2075 |
+
return eval('opts.'+a);
|
2076 |
+
}
|
2077 |
+
}
|
2078 |
+
if (reInit)
|
2079 |
+
{
|
2080 |
+
sz_resetMargin($cfs.children(), opts);
|
2081 |
+
FN._init(opts_orig);
|
2082 |
+
FN._bind_buttons();
|
2083 |
+
var sz = sz_setSizes($cfs, opts);
|
2084 |
+
$cfs.trigger(cf_e('updatePageStatus', conf), [true, sz]);
|
2085 |
+
}
|
2086 |
+
return opts;
|
2087 |
+
});
|
2088 |
+
|
2089 |
+
|
2090 |
+
// linkAnchors event
|
2091 |
+
$cfs.bind(cf_e('linkAnchors', conf), function(e, $con, sel) {
|
2092 |
+
e.stopPropagation();
|
2093 |
+
|
2094 |
+
if (is_undefined($con))
|
2095 |
+
{
|
2096 |
+
$con = $('body');
|
2097 |
+
}
|
2098 |
+
else if (is_string($con))
|
2099 |
+
{
|
2100 |
+
$con = $($con);
|
2101 |
+
}
|
2102 |
+
if (!is_jquery($con) || $con.length == 0)
|
2103 |
+
{
|
2104 |
+
return debug(conf, 'Not a valid object.');
|
2105 |
+
}
|
2106 |
+
if (!is_string(sel))
|
2107 |
+
{
|
2108 |
+
sel = 'a.caroufredsel';
|
2109 |
+
}
|
2110 |
+
|
2111 |
+
$con.find(sel).each(function() {
|
2112 |
+
var h = this.hash || '';
|
2113 |
+
if (h.length > 0 && $cfs.children().index($(h)) != -1)
|
2114 |
+
{
|
2115 |
+
$(this).unbind('click').click(function(e) {
|
2116 |
+
e.preventDefault();
|
2117 |
+
$cfs.trigger(cf_e('slideTo', conf), h);
|
2118 |
+
});
|
2119 |
+
}
|
2120 |
+
});
|
2121 |
+
return true;
|
2122 |
+
});
|
2123 |
+
|
2124 |
+
|
2125 |
+
// updatePageStatus event
|
2126 |
+
$cfs.bind(cf_e('updatePageStatus', conf), function(e, build, sizes) {
|
2127 |
+
e.stopPropagation();
|
2128 |
+
if (!opts.pagination.container)
|
2129 |
+
{
|
2130 |
+
return;
|
2131 |
+
}
|
2132 |
+
|
2133 |
+
var ipp = opts.pagination.items || opts.items.visible,
|
2134 |
+
pgs = Math.ceil(itms.total/ipp);
|
2135 |
+
|
2136 |
+
if (build)
|
2137 |
+
{
|
2138 |
+
if (opts.pagination.anchorBuilder)
|
2139 |
+
{
|
2140 |
+
opts.pagination.container.children().remove();
|
2141 |
+
opts.pagination.container.each(function() {
|
2142 |
+
for (var a = 0; a < pgs; a++)
|
2143 |
+
{
|
2144 |
+
var i = $cfs.children().eq( gn_getItemIndex(a*ipp, 0, true, itms, $cfs) );
|
2145 |
+
$(this).append(opts.pagination.anchorBuilder.call(i[0], a+1));
|
2146 |
+
}
|
2147 |
+
});
|
2148 |
+
}
|
2149 |
+
opts.pagination.container.each(function() {
|
2150 |
+
$(this).children().unbind(opts.pagination.event).each(function(a) {
|
2151 |
+
$(this).bind(opts.pagination.event, function(e) {
|
2152 |
+
e.preventDefault();
|
2153 |
+
$cfs.trigger(cf_e('slideTo', conf), [a*ipp, -opts.pagination.deviation, true, opts.pagination]);
|
2154 |
+
});
|
2155 |
+
});
|
2156 |
+
});
|
2157 |
+
}
|
2158 |
+
|
2159 |
+
var selected = $cfs.triggerHandler(cf_e('currentPage', conf)) + opts.pagination.deviation;
|
2160 |
+
if (selected >= pgs)
|
2161 |
+
{
|
2162 |
+
selected = 0;
|
2163 |
+
}
|
2164 |
+
if (selected < 0)
|
2165 |
+
{
|
2166 |
+
selected = pgs-1;
|
2167 |
+
}
|
2168 |
+
opts.pagination.container.each(function() {
|
2169 |
+
$(this).children().removeClass(cf_c('selected', conf)).eq(selected).addClass(cf_c('selected', conf));
|
2170 |
+
});
|
2171 |
+
return true;
|
2172 |
+
});
|
2173 |
+
|
2174 |
+
|
2175 |
+
// updateSizes event
|
2176 |
+
$cfs.bind(cf_e('updateSizes', conf), function(e) {
|
2177 |
+
var vI = opts.items.visible,
|
2178 |
+
a_itm = $cfs.children(),
|
2179 |
+
avail_primary = ms_getParentSize($wrp, opts, 'width');
|
2180 |
+
|
2181 |
+
itms.total = a_itm.length;
|
2182 |
+
|
2183 |
+
if (crsl.primarySizePercentage)
|
2184 |
+
{
|
2185 |
+
opts.maxDimension = avail_primary;
|
2186 |
+
opts[opts.d['width']] = ms_getPercentage(avail_primary, crsl.primarySizePercentage);
|
2187 |
+
}
|
2188 |
+
else
|
2189 |
+
{
|
2190 |
+
opts.maxDimension = ms_getMaxDimension(opts, avail_primary);
|
2191 |
+
}
|
2192 |
+
|
2193 |
+
if (opts.responsive)
|
2194 |
+
{
|
2195 |
+
opts.items.width = opts.items.sizesConf.width;
|
2196 |
+
opts.items.height = opts.items.sizesConf.height;
|
2197 |
+
opts = in_getResponsiveValues(opts, a_itm, avail_primary);
|
2198 |
+
vI = opts.items.visible;
|
2199 |
+
sz_setResponsiveSizes(opts, a_itm);
|
2200 |
+
}
|
2201 |
+
else if (opts.items.visibleConf.variable)
|
2202 |
+
{
|
2203 |
+
vI = gn_getVisibleItemsNext(a_itm, opts, 0);
|
2204 |
+
}
|
2205 |
+
else if (opts.items.filter != '*')
|
2206 |
+
{
|
2207 |
+
vI = gn_getVisibleItemsNextFilter(a_itm, opts, 0);
|
2208 |
+
}
|
2209 |
+
|
2210 |
+
if (!opts.circular && itms.first != 0 && vI > itms.first) {
|
2211 |
+
if (opts.items.visibleConf.variable)
|
2212 |
+
{
|
2213 |
+
var nI = gn_getVisibleItemsPrev(a_itm, opts, itms.first) - itms.first;
|
2214 |
+
}
|
2215 |
+
else if (opts.items.filter != '*')
|
2216 |
+
{
|
2217 |
+
var nI = gn_getVisibleItemsPrevFilter(a_itm, opts, itms.first) - itms.first;
|
2218 |
+
}
|
2219 |
+
else
|
2220 |
+
{
|
2221 |
+
var nI = opts.items.visible - itms.first;
|
2222 |
+
}
|
2223 |
+
debug(conf, 'Preventing non-circular: sliding '+nI+' items backward.');
|
2224 |
+
$cfs.trigger(cf_e('prev', conf), nI);
|
2225 |
+
}
|
2226 |
+
|
2227 |
+
opts.items.visible = cf_getItemsAdjust(vI, opts, opts.items.visibleConf.adjust, $tt0);
|
2228 |
+
opts.items.visibleConf.old = opts.items.visible;
|
2229 |
+
opts = in_getAlignPadding(opts, a_itm);
|
2230 |
+
|
2231 |
+
var sz = sz_setSizes($cfs, opts);
|
2232 |
+
$cfs.trigger(cf_e('updatePageStatus', conf), [true, sz]);
|
2233 |
+
nv_showNavi(opts, itms.total, conf);
|
2234 |
+
nv_enableNavi(opts, itms.first, conf);
|
2235 |
+
|
2236 |
+
return sz;
|
2237 |
+
});
|
2238 |
+
|
2239 |
+
|
2240 |
+
// destroy event
|
2241 |
+
$cfs.bind(cf_e('destroy', conf), function(e, orgOrder) {
|
2242 |
+
e.stopPropagation();
|
2243 |
+
tmrs = sc_clearTimers(tmrs);
|
2244 |
+
|
2245 |
+
$cfs.data('_cfs_isCarousel', false);
|
2246 |
+
$cfs.trigger(cf_e('finish', conf));
|
2247 |
+
if (orgOrder)
|
2248 |
+
{
|
2249 |
+
$cfs.trigger(cf_e('jumpToStart', conf));
|
2250 |
+
}
|
2251 |
+
sz_restoreOrigCss($cfs.children());
|
2252 |
+
sz_restoreOrigCss($cfs);
|
2253 |
+
FN._unbind_events();
|
2254 |
+
FN._unbind_buttons();
|
2255 |
+
if (conf.wrapper == 'parent')
|
2256 |
+
{
|
2257 |
+
sz_restoreOrigCss($wrp);
|
2258 |
+
}
|
2259 |
+
else
|
2260 |
+
{
|
2261 |
+
$wrp.replaceWith($cfs);
|
2262 |
+
}
|
2263 |
+
|
2264 |
+
return true;
|
2265 |
+
});
|
2266 |
+
|
2267 |
+
|
2268 |
+
// debug event
|
2269 |
+
$cfs.bind(cf_e('debug', conf), function(e) {
|
2270 |
+
debug(conf, 'Carousel width: ' + opts.width);
|
2271 |
+
debug(conf, 'Carousel height: ' + opts.height);
|
2272 |
+
debug(conf, 'Item widths: ' + opts.items.width);
|
2273 |
+
debug(conf, 'Item heights: ' + opts.items.height);
|
2274 |
+
debug(conf, 'Number of items visible: ' + opts.items.visible);
|
2275 |
+
if (opts.auto.play)
|
2276 |
+
{
|
2277 |
+
debug(conf, 'Number of items scrolled automatically: ' + opts.auto.items);
|
2278 |
+
}
|
2279 |
+
if (opts.prev.button)
|
2280 |
+
{
|
2281 |
+
debug(conf, 'Number of items scrolled backward: ' + opts.prev.items);
|
2282 |
+
}
|
2283 |
+
if (opts.next.button)
|
2284 |
+
{
|
2285 |
+
debug(conf, 'Number of items scrolled forward: ' + opts.next.items);
|
2286 |
+
}
|
2287 |
+
return conf.debug;
|
2288 |
+
});
|
2289 |
+
|
2290 |
+
|
2291 |
+
// triggerEvent, making prefixed and namespaced events accessible from outside
|
2292 |
+
$cfs.bind('_cfs_triggerEvent', function(e, n, o) {
|
2293 |
+
e.stopPropagation();
|
2294 |
+
return $cfs.triggerHandler(cf_e(n, conf), o);
|
2295 |
+
});
|
2296 |
+
}; // /bind_events
|
2297 |
+
|
2298 |
+
|
2299 |
+
FN._unbind_events = function() {
|
2300 |
+
$cfs.unbind(cf_e('', conf));
|
2301 |
+
$cfs.unbind(cf_e('', conf, false));
|
2302 |
+
$cfs.unbind('_cfs_triggerEvent');
|
2303 |
+
}; // /unbind_events
|
2304 |
+
|
2305 |
+
|
2306 |
+
FN._bind_buttons = function() {
|
2307 |
+
FN._unbind_buttons();
|
2308 |
+
nv_showNavi(opts, itms.total, conf);
|
2309 |
+
nv_enableNavi(opts, itms.first, conf);
|
2310 |
+
|
2311 |
+
if (opts.auto.pauseOnHover)
|
2312 |
+
{
|
2313 |
+
var pC = bt_pauseOnHoverConfig(opts.auto.pauseOnHover);
|
2314 |
+
$wrp.bind(cf_e('mouseenter', conf, false), function() { $cfs.trigger(cf_e('pause', conf), pC); })
|
2315 |
+
.bind(cf_e('mouseleave', conf, false), function() { $cfs.trigger(cf_e('resume', conf)); });
|
2316 |
+
}
|
2317 |
+
|
2318 |
+
// play button
|
2319 |
+
if (opts.auto.button)
|
2320 |
+
{
|
2321 |
+
opts.auto.button.bind(cf_e(opts.auto.event, conf, false), function(e) {
|
2322 |
+
e.preventDefault();
|
2323 |
+
var ev = false,
|
2324 |
+
pC = null;
|
2325 |
+
|
2326 |
+
if (crsl.isPaused)
|
2327 |
+
{
|
2328 |
+
ev = 'play';
|
2329 |
+
}
|
2330 |
+
else if (opts.auto.pauseOnEvent)
|
2331 |
+
{
|
2332 |
+
ev = 'pause';
|
2333 |
+
pC = bt_pauseOnHoverConfig(opts.auto.pauseOnEvent);
|
2334 |
+
}
|
2335 |
+
if (ev)
|
2336 |
+
{
|
2337 |
+
$cfs.trigger(cf_e(ev, conf), pC);
|
2338 |
+
}
|
2339 |
+
});
|
2340 |
+
}
|
2341 |
+
|
2342 |
+
// prev button
|
2343 |
+
if (opts.prev.button)
|
2344 |
+
{
|
2345 |
+
opts.prev.button.bind(cf_e(opts.prev.event, conf, false), function(e) {
|
2346 |
+
e.preventDefault();
|
2347 |
+
$cfs.trigger(cf_e('prev', conf));
|
2348 |
+
});
|
2349 |
+
if (opts.prev.pauseOnHover)
|
2350 |
+
{
|
2351 |
+
var pC = bt_pauseOnHoverConfig(opts.prev.pauseOnHover);
|
2352 |
+
opts.prev.button.bind(cf_e('mouseenter', conf, false), function() { $cfs.trigger(cf_e('pause', conf), pC); })
|
2353 |
+
.bind(cf_e('mouseleave', conf, false), function() { $cfs.trigger(cf_e('resume', conf)); });
|
2354 |
+
}
|
2355 |
+
}
|
2356 |
+
|
2357 |
+
// next butotn
|
2358 |
+
if (opts.next.button)
|
2359 |
+
{
|
2360 |
+
opts.next.button.bind(cf_e(opts.next.event, conf, false), function(e) {
|
2361 |
+
e.preventDefault();
|
2362 |
+
$cfs.trigger(cf_e('next', conf));
|
2363 |
+
});
|
2364 |
+
if (opts.next.pauseOnHover)
|
2365 |
+
{
|
2366 |
+
var pC = bt_pauseOnHoverConfig(opts.next.pauseOnHover);
|
2367 |
+
opts.next.button.bind(cf_e('mouseenter', conf, false), function() { $cfs.trigger(cf_e('pause', conf), pC); })
|
2368 |
+
.bind(cf_e('mouseleave', conf, false), function() { $cfs.trigger(cf_e('resume', conf)); });
|
2369 |
+
}
|
2370 |
+
}
|
2371 |
+
|
2372 |
+
// pagination
|
2373 |
+
if (opts.pagination.container)
|
2374 |
+
{
|
2375 |
+
if (opts.pagination.pauseOnHover)
|
2376 |
+
{
|
2377 |
+
var pC = bt_pauseOnHoverConfig(opts.pagination.pauseOnHover);
|
2378 |
+
opts.pagination.container.bind(cf_e('mouseenter', conf, false), function() { $cfs.trigger(cf_e('pause', conf), pC); })
|
2379 |
+
.bind(cf_e('mouseleave', conf, false), function() { $cfs.trigger(cf_e('resume', conf)); });
|
2380 |
+
}
|
2381 |
+
}
|
2382 |
+
|
2383 |
+
// prev/next keys
|
2384 |
+
if (opts.prev.key || opts.next.key)
|
2385 |
+
{
|
2386 |
+
$(document).bind(cf_e('keyup', conf, false, true, true), function(e) {
|
2387 |
+
var k = e.keyCode;
|
2388 |
+
if (k == opts.next.key)
|
2389 |
+
{
|
2390 |
+
e.preventDefault();
|
2391 |
+
$cfs.trigger(cf_e('next', conf));
|
2392 |
+
}
|
2393 |
+
if (k == opts.prev.key)
|
2394 |
+
{
|
2395 |
+
e.preventDefault();
|
2396 |
+
$cfs.trigger(cf_e('prev', conf));
|
2397 |
+
}
|
2398 |
+
});
|
2399 |
+
}
|
2400 |
+
|
2401 |
+
// pagination keys
|
2402 |
+
if (opts.pagination.keys)
|
2403 |
+
{
|
2404 |
+
$(document).bind(cf_e('keyup', conf, false, true, true), function(e) {
|
2405 |
+
var k = e.keyCode;
|
2406 |
+
if (k >= 49 && k < 58)
|
2407 |
+
{
|
2408 |
+
k = (k-49) * opts.items.visible;
|
2409 |
+
if (k <= itms.total)
|
2410 |
+
{
|
2411 |
+
e.preventDefault();
|
2412 |
+
$cfs.trigger(cf_e('slideTo', conf), [k, 0, true, opts.pagination]);
|
2413 |
+
}
|
2414 |
+
}
|
2415 |
+
});
|
2416 |
+
}
|
2417 |
+
|
2418 |
+
// swipe
|
2419 |
+
if ($.fn.swipe)
|
2420 |
+
{
|
2421 |
+
var isTouch = 'ontouchstart' in window;
|
2422 |
+
if ((isTouch && opts.swipe.onTouch) || (!isTouch && opts.swipe.onMouse))
|
2423 |
+
{
|
2424 |
+
var scP = $.extend(true, {}, opts.prev, opts.swipe),
|
2425 |
+
scN = $.extend(true, {}, opts.next, opts.swipe),
|
2426 |
+
swP = function() { $cfs.trigger(cf_e('prev', conf), [scP]) },
|
2427 |
+
swN = function() { $cfs.trigger(cf_e('next', conf), [scN]) };
|
2428 |
+
|
2429 |
+
switch (opts.direction)
|
2430 |
+
{
|
2431 |
+
case 'up':
|
2432 |
+
case 'down':
|
2433 |
+
opts.swipe.options.swipeUp = swN;
|
2434 |
+
opts.swipe.options.swipeDown = swP;
|
2435 |
+
break;
|
2436 |
+
default:
|
2437 |
+
opts.swipe.options.swipeLeft = swN;
|
2438 |
+
opts.swipe.options.swipeRight = swP;
|
2439 |
+
}
|
2440 |
+
if (crsl.swipe)
|
2441 |
+
{
|
2442 |
+
$cfs.swipe('destroy');
|
2443 |
+
}
|
2444 |
+
$wrp.swipe(opts.swipe.options);
|
2445 |
+
$wrp.css('cursor', 'move');
|
2446 |
+
crsl.swipe = true;
|
2447 |
+
}
|
2448 |
+
}
|
2449 |
+
|
2450 |
+
// mousewheel
|
2451 |
+
if ($.fn.mousewheel)
|
2452 |
+
{
|
2453 |
+
|
2454 |
+
if (opts.mousewheel)
|
2455 |
+
{
|
2456 |
+
var mcP = $.extend(true, {}, opts.prev, opts.mousewheel),
|
2457 |
+
mcN = $.extend(true, {}, opts.next, opts.mousewheel);
|
2458 |
+
|
2459 |
+
if (crsl.mousewheel)
|
2460 |
+
{
|
2461 |
+
$wrp.unbind(cf_e('mousewheel', conf, false));
|
2462 |
+
}
|
2463 |
+
$wrp.bind(cf_e('mousewheel', conf, false), function(e, delta) {
|
2464 |
+
e.preventDefault();
|
2465 |
+
if (delta > 0)
|
2466 |
+
{
|
2467 |
+
$cfs.trigger(cf_e('prev', conf), [mcP]);
|
2468 |
+
}
|
2469 |
+
else
|
2470 |
+
{
|
2471 |
+
$cfs.trigger(cf_e('next', conf), [mcN]);
|
2472 |
+
}
|
2473 |
+
});
|
2474 |
+
crsl.mousewheel = true;
|
2475 |
+
}
|
2476 |
+
}
|
2477 |
+
|
2478 |
+
if (opts.auto.play)
|
2479 |
+
{
|
2480 |
+
$cfs.trigger(cf_e('play', conf), opts.auto.delay);
|
2481 |
+
}
|
2482 |
+
|
2483 |
+
if (crsl.upDateOnWindowResize)
|
2484 |
+
{
|
2485 |
+
var resizeFn = function(e) {
|
2486 |
+
$cfs.trigger(cf_e('finish', conf));
|
2487 |
+
if (opts.auto.pauseOnResize && !crsl.isPaused)
|
2488 |
+
{
|
2489 |
+
$cfs.trigger(cf_e('play', conf));
|
2490 |
+
}
|
2491 |
+
sz_resetMargin($cfs.children(), opts);
|
2492 |
+
$cfs.trigger(cf_e('updateSizes', conf));
|
2493 |
+
};
|
2494 |
+
|
2495 |
+
var $w = $(window),
|
2496 |
+
onResize = null;
|
2497 |
+
|
2498 |
+
if ($.debounce && conf.onWindowResize == 'debounce')
|
2499 |
+
{
|
2500 |
+
onResize = $.debounce(200, resizeFn);
|
2501 |
+
}
|
2502 |
+
else if ($.throttle && conf.onWindowResize == 'throttle')
|
2503 |
+
{
|
2504 |
+
onResize = $.throttle(300, resizeFn);
|
2505 |
+
}
|
2506 |
+
else
|
2507 |
+
{
|
2508 |
+
var _windowWidth = 0,
|
2509 |
+
_windowHeight = 0;
|
2510 |
+
|
2511 |
+
onResize = function() {
|
2512 |
+
var nw = $w.width(),
|
2513 |
+
nh = $w.height();
|
2514 |
+
|
2515 |
+
if (nw != _windowWidth || nh != _windowHeight)
|
2516 |
+
{
|
2517 |
+
resizeFn();
|
2518 |
+
_windowWidth = nw;
|
2519 |
+
_windowHeight = nh;
|
2520 |
+
}
|
2521 |
+
};
|
2522 |
+
}
|
2523 |
+
$w.bind(cf_e('resize', conf, false, true, true), onResize);
|
2524 |
+
}
|
2525 |
+
}; // /bind_buttons
|
2526 |
+
|
2527 |
+
|
2528 |
+
FN._unbind_buttons = function() {
|
2529 |
+
var ns1 = cf_e('', conf),
|
2530 |
+
ns2 = cf_e('', conf, false);
|
2531 |
+
ns3 = cf_e('', conf, false, true, true);
|
2532 |
+
|
2533 |
+
$(document).unbind(ns3);
|
2534 |
+
$(window).unbind(ns3);
|
2535 |
+
$wrp.unbind(ns2);
|
2536 |
+
|
2537 |
+
if (opts.auto.button)
|
2538 |
+
{
|
2539 |
+
opts.auto.button.unbind(ns2);
|
2540 |
+
}
|
2541 |
+
if (opts.prev.button)
|
2542 |
+
{
|
2543 |
+
opts.prev.button.unbind(ns2);
|
2544 |
+
}
|
2545 |
+
if (opts.next.button)
|
2546 |
+
{
|
2547 |
+
opts.next.button.unbind(ns2);
|
2548 |
+
}
|
2549 |
+
if (opts.pagination.container)
|
2550 |
+
{
|
2551 |
+
opts.pagination.container.unbind(ns2);
|
2552 |
+
if (opts.pagination.anchorBuilder)
|
2553 |
+
{
|
2554 |
+
opts.pagination.container.children().remove();
|
2555 |
+
}
|
2556 |
+
}
|
2557 |
+
if (crsl.swipe)
|
2558 |
+
{
|
2559 |
+
$cfs.swipe('destroy');
|
2560 |
+
$wrp.css('cursor', 'default');
|
2561 |
+
crsl.swipe = false;
|
2562 |
+
}
|
2563 |
+
if (crsl.mousewheel)
|
2564 |
+
{
|
2565 |
+
crsl.mousewheel = false;
|
2566 |
+
}
|
2567 |
+
|
2568 |
+
nv_showNavi(opts, 'hide', conf);
|
2569 |
+
nv_enableNavi(opts, 'removeClass', conf);
|
2570 |
+
|
2571 |
+
}; // /unbind_buttons
|
2572 |
+
|
2573 |
+
|
2574 |
+
|
2575 |
+
// START
|
2576 |
+
|
2577 |
+
if (is_boolean(configs))
|
2578 |
+
{
|
2579 |
+
configs = {
|
2580 |
+
'debug': configs
|
2581 |
+
};
|
2582 |
+
}
|
2583 |
+
|
2584 |
+
// set vars
|
2585 |
+
var crsl = {
|
2586 |
+
'direction' : 'next',
|
2587 |
+
'isPaused' : true,
|
2588 |
+
'isScrolling' : false,
|
2589 |
+
'isStopped' : false,
|
2590 |
+
'mousewheel' : false,
|
2591 |
+
'swipe' : false
|
2592 |
+
},
|
2593 |
+
itms = {
|
2594 |
+
'total' : $cfs.children().length,
|
2595 |
+
'first' : 0
|
2596 |
+
},
|
2597 |
+
tmrs = {
|
2598 |
+
'auto' : null,
|
2599 |
+
'progress' : null,
|
2600 |
+
'startTime' : getTime(),
|
2601 |
+
'timePassed' : 0
|
2602 |
+
},
|
2603 |
+
scrl = {
|
2604 |
+
'isStopped' : false,
|
2605 |
+
'duration' : 0,
|
2606 |
+
'startTime' : 0,
|
2607 |
+
'easing' : '',
|
2608 |
+
'anims' : []
|
2609 |
+
},
|
2610 |
+
clbk = {
|
2611 |
+
'onBefore' : [],
|
2612 |
+
'onAfter' : []
|
2613 |
+
},
|
2614 |
+
queu = [],
|
2615 |
+
conf = $.extend(true, {}, $.fn.carouFredSel.configs, configs),
|
2616 |
+
opts = {},
|
2617 |
+
opts_orig = $.extend(true, {}, options),
|
2618 |
+
$wrp = (conf.wrapper == 'parent')
|
2619 |
+
? $cfs.parent()
|
2620 |
+
: $cfs.wrap('<'+conf.wrapper.element+' class="'+conf.wrapper.classname+'" />').parent();
|
2621 |
+
|
2622 |
+
|
2623 |
+
conf.selector = $cfs.selector;
|
2624 |
+
conf.serialNumber = $.fn.carouFredSel.serialNumber++;
|
2625 |
+
|
2626 |
+
conf.transition = (conf.transition && $.fn.transition) ? 'transition' : 'animate';
|
2627 |
+
|
2628 |
+
// create carousel
|
2629 |
+
FN._init(opts_orig, true, starting_position);
|
2630 |
+
FN._build();
|
2631 |
+
FN._bind_events();
|
2632 |
+
FN._bind_buttons();
|
2633 |
+
|
2634 |
+
// find item to start
|
2635 |
+
if (is_array(opts.items.start))
|
2636 |
+
{
|
2637 |
+
var start_arr = opts.items.start;
|
2638 |
+
}
|
2639 |
+
else
|
2640 |
+
{
|
2641 |
+
var start_arr = [];
|
2642 |
+
if (opts.items.start != 0)
|
2643 |
+
{
|
2644 |
+
start_arr.push(opts.items.start);
|
2645 |
+
}
|
2646 |
+
}
|
2647 |
+
if (opts.cookie)
|
2648 |
+
{
|
2649 |
+
start_arr.unshift(parseInt(cf_getCookie(opts.cookie), 10));
|
2650 |
+
}
|
2651 |
+
|
2652 |
+
if (start_arr.length > 0)
|
2653 |
+
{
|
2654 |
+
for (var a = 0, l = start_arr.length; a < l; a++)
|
2655 |
+
{
|
2656 |
+
var s = start_arr[a];
|
2657 |
+
if (s == 0)
|
2658 |
+
{
|
2659 |
+
continue;
|
2660 |
+
}
|
2661 |
+
if (s === true)
|
2662 |
+
{
|
2663 |
+
s = window.location.hash;
|
2664 |
+
if (s.length < 1)
|
2665 |
+
{
|
2666 |
+
continue;
|
2667 |
+
}
|
2668 |
+
}
|
2669 |
+
else if (s === 'random')
|
2670 |
+
{
|
2671 |
+
s = Math.floor(Math.random()*itms.total);
|
2672 |
+
}
|
2673 |
+
if ($cfs.triggerHandler(cf_e('slideTo', conf), [s, 0, true, { fx: 'none' }]))
|
2674 |
+
{
|
2675 |
+
break;
|
2676 |
+
}
|
2677 |
+
}
|
2678 |
+
}
|
2679 |
+
var siz = sz_setSizes($cfs, opts),
|
2680 |
+
itm = gi_getCurrentItems($cfs.children(), opts);
|
2681 |
+
|
2682 |
+
if (opts.onCreate)
|
2683 |
+
{
|
2684 |
+
opts.onCreate.call($tt0, {
|
2685 |
+
'width': siz.width,
|
2686 |
+
'height': siz.height,
|
2687 |
+
'items': itm
|
2688 |
+
});
|
2689 |
+
}
|
2690 |
+
|
2691 |
+
$cfs.trigger(cf_e('updatePageStatus', conf), [true, siz]);
|
2692 |
+
$cfs.trigger(cf_e('linkAnchors', conf));
|
2693 |
+
|
2694 |
+
if (conf.debug)
|
2695 |
+
{
|
2696 |
+
$cfs.trigger(cf_e('debug', conf));
|
2697 |
+
}
|
2698 |
+
|
2699 |
+
return $cfs;
|
2700 |
+
};
|
2701 |
+
|
2702 |
+
|
2703 |
+
|
2704 |
+
// GLOBAL PUBLIC
|
2705 |
+
|
2706 |
+
$.fn.carouFredSel.serialNumber = 1;
|
2707 |
+
$.fn.carouFredSel.defaults = {
|
2708 |
+
'synchronise' : false,
|
2709 |
+
'infinite' : true,
|
2710 |
+
'circular' : true,
|
2711 |
+
'responsive' : false,
|
2712 |
+
'direction' : 'left',
|
2713 |
+
'items' : {
|
2714 |
+
'start' : 0
|
2715 |
+
},
|
2716 |
+
'scroll' : {
|
2717 |
+
'easing' : 'swing',
|
2718 |
+
'duration' : 500,
|
2719 |
+
'pauseOnHover' : false,
|
2720 |
+
'event' : 'click',
|
2721 |
+
'queue' : false
|
2722 |
+
}
|
2723 |
+
};
|
2724 |
+
$.fn.carouFredSel.configs = {
|
2725 |
+
'debug' : false,
|
2726 |
+
'transition' : false,
|
2727 |
+
'onWindowResize': 'throttle',
|
2728 |
+
'events' : {
|
2729 |
+
'prefix' : '',
|
2730 |
+
'namespace' : 'cfs'
|
2731 |
+
},
|
2732 |
+
'wrapper' : {
|
2733 |
+
'element' : 'div',
|
2734 |
+
'classname' : 'caroufredsel_wrapper'
|
2735 |
+
},
|
2736 |
+
'classnames' : {}
|
2737 |
+
};
|
2738 |
+
$.fn.carouFredSel.pageAnchorBuilder = function(nr) {
|
2739 |
+
return '<a href="#"><span>'+nr+'</span></a>';
|
2740 |
+
};
|
2741 |
+
$.fn.carouFredSel.progressbarUpdater = function(perc) {
|
2742 |
+
$(this).css('width', perc+'%');
|
2743 |
+
};
|
2744 |
+
|
2745 |
+
$.fn.carouFredSel.cookie = {
|
2746 |
+
get: function(n) {
|
2747 |
+
n += '=';
|
2748 |
+
var ca = document.cookie.split(';');
|
2749 |
+
for (var a = 0, l = ca.length; a < l; a++)
|
2750 |
+
{
|
2751 |
+
var c = ca[a];
|
2752 |
+
while (c.charAt(0) == ' ')
|
2753 |
+
{
|
2754 |
+
c = c.slice(1);
|
2755 |
+
}
|
2756 |
+
if (c.indexOf(n) == 0)
|
2757 |
+
{
|
2758 |
+
return c.slice(n.length);
|
2759 |
+
}
|
2760 |
+
}
|
2761 |
+
return 0;
|
2762 |
+
},
|
2763 |
+
set: function(n, v, d) {
|
2764 |
+
var e = "";
|
2765 |
+
if (d)
|
2766 |
+
{
|
2767 |
+
var date = new Date();
|
2768 |
+
date.setTime(date.getTime() + (d * 24 * 60 * 60 * 1000));
|
2769 |
+
e = "; expires=" + date.toGMTString();
|
2770 |
+
}
|
2771 |
+
document.cookie = n + '=' + v + e + '; path=/';
|
2772 |
+
},
|
2773 |
+
remove: function(n) {
|
2774 |
+
$.fn.carouFredSel.cookie.set(n, "", -1);
|
2775 |
+
}
|
2776 |
+
};
|
2777 |
+
|
2778 |
+
|
2779 |
+
// GLOBAL PRIVATE
|
2780 |
+
|
2781 |
+
// scrolling functions
|
2782 |
+
function sc_setScroll(d, e, c) {
|
2783 |
+
if (c.transition == 'transition')
|
2784 |
+
{
|
2785 |
+
if (e == 'swing')
|
2786 |
+
{
|
2787 |
+
e = 'ease';
|
2788 |
+
}
|
2789 |
+
}
|
2790 |
+
return {
|
2791 |
+
anims: [],
|
2792 |
+
duration: d,
|
2793 |
+
orgDuration: d,
|
2794 |
+
easing: e,
|
2795 |
+
startTime: getTime()
|
2796 |
+
};
|
2797 |
+
}
|
2798 |
+
function sc_startScroll(s, c) {
|
2799 |
+
for (var a = 0, l = s.anims.length; a < l; a++)
|
2800 |
+
{
|
2801 |
+
var b = s.anims[a];
|
2802 |
+
if (!b)
|
2803 |
+
{
|
2804 |
+
continue;
|
2805 |
+
}
|
2806 |
+
b[0][c.transition](b[1], s.duration, s.easing, b[2]);
|
2807 |
+
}
|
2808 |
+
}
|
2809 |
+
function sc_stopScroll(s, finish) {
|
2810 |
+
if (!is_boolean(finish))
|
2811 |
+
{
|
2812 |
+
finish = true;
|
2813 |
+
}
|
2814 |
+
if (is_object(s.pre))
|
2815 |
+
{
|
2816 |
+
sc_stopScroll(s.pre, finish);
|
2817 |
+
}
|
2818 |
+
for (var a = 0, l = s.anims.length; a < l; a++)
|
2819 |
+
{
|
2820 |
+
var b = s.anims[a];
|
2821 |
+
b[0].stop(true);
|
2822 |
+
if (finish)
|
2823 |
+
{
|
2824 |
+
b[0].css(b[1]);
|
2825 |
+
if (is_function(b[2]))
|
2826 |
+
{
|
2827 |
+
b[2]();
|
2828 |
+
}
|
2829 |
+
}
|
2830 |
+
}
|
2831 |
+
if (is_object(s.post))
|
2832 |
+
{
|
2833 |
+
sc_stopScroll(s.post, finish);
|
2834 |
+
}
|
2835 |
+
}
|
2836 |
+
function sc_afterScroll( $c, $c2, o ) {
|
2837 |
+
if ($c2)
|
2838 |
+
{
|
2839 |
+
$c2.remove();
|
2840 |
+
}
|
2841 |
+
|
2842 |
+
switch(o.fx) {
|
2843 |
+
case 'fade':
|
2844 |
+
case 'crossfade':
|
2845 |
+
case 'cover-fade':
|
2846 |
+
case 'uncover-fade':
|
2847 |
+
$c.css('opacity', 1);
|
2848 |
+
$c.css('filter', '');
|
2849 |
+
break;
|
2850 |
+
}
|
2851 |
+
}
|
2852 |
+
function sc_fireCallbacks($t, o, b, a, c) {
|
2853 |
+
if (o[b])
|
2854 |
+
{
|
2855 |
+
o[b].call($t, a);
|
2856 |
+
}
|
2857 |
+
if (c[b].length)
|
2858 |
+
{
|
2859 |
+
for (var i = 0, l = c[b].length; i < l; i++)
|
2860 |
+
{
|
2861 |
+
c[b][i].call($t, a);
|
2862 |
+
}
|
2863 |
+
}
|
2864 |
+
return [];
|
2865 |
+
}
|
2866 |
+
function sc_fireQueue($c, q, c) {
|
2867 |
+
|
2868 |
+
if (q.length)
|
2869 |
+
{
|
2870 |
+
$c.trigger(cf_e(q[0][0], c), q[0][1]);
|
2871 |
+
q.shift();
|
2872 |
+
}
|
2873 |
+
return q;
|
2874 |
+
}
|
2875 |
+
function sc_hideHiddenItems(hiddenitems) {
|
2876 |
+
hiddenitems.each(function() {
|
2877 |
+
var hi = $(this);
|
2878 |
+
hi.data('_cfs_isHidden', hi.is(':hidden')).hide();
|
2879 |
+
});
|
2880 |
+
}
|
2881 |
+
function sc_showHiddenItems(hiddenitems) {
|
2882 |
+
if (hiddenitems)
|
2883 |
+
{
|
2884 |
+
hiddenitems.each(function() {
|
2885 |
+
var hi = $(this);
|
2886 |
+
if (!hi.data('_cfs_isHidden'))
|
2887 |
+
{
|
2888 |
+
hi.show();
|
2889 |
+
}
|
2890 |
+
});
|
2891 |
+
}
|
2892 |
+
}
|
2893 |
+
function sc_clearTimers(t) {
|
2894 |
+
if (t.auto)
|
2895 |
+
{
|
2896 |
+
clearTimeout(t.auto);
|
2897 |
+
}
|
2898 |
+
if (t.progress)
|
2899 |
+
{
|
2900 |
+
clearInterval(t.progress);
|
2901 |
+
}
|
2902 |
+
return t;
|
2903 |
+
}
|
2904 |
+
function sc_mapCallbackArguments(i_old, i_skp, i_new, s_itm, s_dir, s_dur, w_siz) {
|
2905 |
+
return {
|
2906 |
+
'width': w_siz.width,
|
2907 |
+
'height': w_siz.height,
|
2908 |
+
'items': {
|
2909 |
+
'old': i_old,
|
2910 |
+
'skipped': i_skp,
|
2911 |
+
'visible': i_new
|
2912 |
+
},
|
2913 |
+
'scroll': {
|
2914 |
+
'items': s_itm,
|
2915 |
+
'direction': s_dir,
|
2916 |
+
'duration': s_dur
|
2917 |
+
}
|
2918 |
+
};
|
2919 |
+
}
|
2920 |
+
function sc_getDuration( sO, o, nI, siz ) {
|
2921 |
+
var dur = sO.duration;
|
2922 |
+
if (sO.fx == 'none')
|
2923 |
+
{
|
2924 |
+
return 0;
|
2925 |
+
}
|
2926 |
+
if (dur == 'auto')
|
2927 |
+
{
|
2928 |
+
dur = o.scroll.duration / o.scroll.items * nI;
|
2929 |
+
}
|
2930 |
+
else if (dur < 10)
|
2931 |
+
{
|
2932 |
+
dur = siz / dur;
|
2933 |
+
}
|
2934 |
+
if (dur < 1)
|
2935 |
+
{
|
2936 |
+
return 0;
|
2937 |
+
}
|
2938 |
+
if (sO.fx == 'fade')
|
2939 |
+
{
|
2940 |
+
dur = dur / 2;
|
2941 |
+
}
|
2942 |
+
return Math.round(dur);
|
2943 |
+
}
|
2944 |
+
|
2945 |
+
// navigation functions
|
2946 |
+
function nv_showNavi(o, t, c) {
|
2947 |
+
var minimum = (is_number(o.items.minimum)) ? o.items.minimum : o.items.visible + 1;
|
2948 |
+
if (t == 'show' || t == 'hide')
|
2949 |
+
{
|
2950 |
+
var f = t;
|
2951 |
+
}
|
2952 |
+
else if (minimum > t)
|
2953 |
+
{
|
2954 |
+
debug(c, 'Not enough items ('+t+' total, '+minimum+' needed): Hiding navigation.');
|
2955 |
+
var f = 'hide';
|
2956 |
+
}
|
2957 |
+
else
|
2958 |
+
{
|
2959 |
+
var f = 'show';
|
2960 |
+
}
|
2961 |
+
var s = (f == 'show') ? 'removeClass' : 'addClass',
|
2962 |
+
h = cf_c('hidden', c);
|
2963 |
+
|
2964 |
+
if (o.auto.button)
|
2965 |
+
{
|
2966 |
+
o.auto.button[f]()[s](h);
|
2967 |
+
}
|
2968 |
+
if (o.prev.button)
|
2969 |
+
{
|
2970 |
+
o.prev.button[f]()[s](h);
|
2971 |
+
}
|
2972 |
+
if (o.next.button)
|
2973 |
+
{
|
2974 |
+
o.next.button[f]()[s](h);
|
2975 |
+
}
|
2976 |
+
if (o.pagination.container)
|
2977 |
+
{
|
2978 |
+
o.pagination.container[f]()[s](h);
|
2979 |
+
}
|
2980 |
+
}
|
2981 |
+
function nv_enableNavi(o, f, c) {
|
2982 |
+
if (o.circular || o.infinite) return;
|
2983 |
+
var fx = (f == 'removeClass' || f == 'addClass') ? f : false,
|
2984 |
+
di = cf_c('disabled', c);
|
2985 |
+
|
2986 |
+
if (o.auto.button && fx)
|
2987 |
+
{
|
2988 |
+
o.auto.button[fx](di);
|
2989 |
+
}
|
2990 |
+
if (o.prev.button)
|
2991 |
+
{
|
2992 |
+
var fn = fx || (f == 0) ? 'addClass' : 'removeClass';
|
2993 |
+
o.prev.button[fn](di);
|
2994 |
+
}
|
2995 |
+
if (o.next.button)
|
2996 |
+
{
|
2997 |
+
var fn = fx || (f == o.items.visible) ? 'addClass' : 'removeClass';
|
2998 |
+
o.next.button[fn](di);
|
2999 |
+
}
|
3000 |
+
}
|
3001 |
+
|
3002 |
+
// get object functions
|
3003 |
+
function go_getObject($tt, obj) {
|
3004 |
+
if (is_function(obj))
|
3005 |
+
{
|
3006 |
+
obj = obj.call($tt);
|
3007 |
+
}
|
3008 |
+
else if (is_undefined(obj))
|
3009 |
+
{
|
3010 |
+
obj = {};
|
3011 |
+
}
|
3012 |
+
return obj;
|
3013 |
+
}
|
3014 |
+
function go_getItemsObject($tt, obj) {
|
3015 |
+
obj = go_getObject($tt, obj);
|
3016 |
+
if (is_number(obj))
|
3017 |
+
{
|
3018 |
+
obj = {
|
3019 |
+
'visible': obj
|
3020 |
+
};
|
3021 |
+
}
|
3022 |
+
else if (obj == 'variable')
|
3023 |
+
{
|
3024 |
+
obj = {
|
3025 |
+
'visible': obj,
|
3026 |
+
'width': obj,
|
3027 |
+
'height': obj
|
3028 |
+
};
|
3029 |
+
}
|
3030 |
+
else if (!is_object(obj))
|
3031 |
+
{
|
3032 |
+
obj = {};
|
3033 |
+
}
|
3034 |
+
return obj;
|
3035 |
+
}
|
3036 |
+
function go_getScrollObject($tt, obj) {
|
3037 |
+
obj = go_getObject($tt, obj);
|
3038 |
+
if (is_number(obj))
|
3039 |
+
{
|
3040 |
+
if (obj <= 50)
|
3041 |
+
{
|
3042 |
+
obj = {
|
3043 |
+
'items': obj
|
3044 |
+
};
|
3045 |
+
}
|
3046 |
+
else
|
3047 |
+
{
|
3048 |
+
obj = {
|
3049 |
+
'duration': obj
|
3050 |
+
};
|
3051 |
+
}
|
3052 |
+
}
|
3053 |
+
else if (is_string(obj))
|
3054 |
+
{
|
3055 |
+
obj = {
|
3056 |
+
'easing': obj
|
3057 |
+
};
|
3058 |
+
}
|
3059 |
+
else if (!is_object(obj))
|
3060 |
+
{
|
3061 |
+
obj = {};
|
3062 |
+
}
|
3063 |
+
return obj;
|
3064 |
+
}
|
3065 |
+
function go_getNaviObject($tt, obj) {
|
3066 |
+
obj = go_getObject($tt, obj);
|
3067 |
+
if (is_string(obj))
|
3068 |
+
{
|
3069 |
+
var temp = cf_getKeyCode(obj);
|
3070 |
+
if (temp == -1)
|
3071 |
+
{
|
3072 |
+
obj = $(obj);
|
3073 |
+
}
|
3074 |
+
else
|
3075 |
+
{
|
3076 |
+
obj = temp;
|
3077 |
+
}
|
3078 |
+
}
|
3079 |
+
return obj;
|
3080 |
+
}
|
3081 |
+
|
3082 |
+
function go_getAutoObject($tt, obj) {
|
3083 |
+
obj = go_getNaviObject($tt, obj);
|
3084 |
+
if (is_jquery(obj))
|
3085 |
+
{
|
3086 |
+
obj = {
|
3087 |
+
'button': obj
|
3088 |
+
};
|
3089 |
+
}
|
3090 |
+
else if (is_boolean(obj))
|
3091 |
+
{
|
3092 |
+
obj = {
|
3093 |
+
'play': obj
|
3094 |
+
};
|
3095 |
+
}
|
3096 |
+
else if (is_number(obj))
|
3097 |
+
{
|
3098 |
+
obj = {
|
3099 |
+
'timeoutDuration': obj
|
3100 |
+
};
|
3101 |
+
}
|
3102 |
+
if (obj.progress)
|
3103 |
+
{
|
3104 |
+
if (is_string(obj.progress) || is_jquery(obj.progress))
|
3105 |
+
{
|
3106 |
+
obj.progress = {
|
3107 |
+
'bar': obj.progress
|
3108 |
+
};
|
3109 |
+
}
|
3110 |
+
}
|
3111 |
+
return obj;
|
3112 |
+
}
|
3113 |
+
function go_complementAutoObject($tt, obj) {
|
3114 |
+
if (is_function(obj.button))
|
3115 |
+
{
|
3116 |
+
obj.button = obj.button.call($tt);
|
3117 |
+
}
|
3118 |
+
if (is_string(obj.button))
|
3119 |
+
{
|
3120 |
+
obj.button = $(obj.button);
|
3121 |
+
}
|
3122 |
+
if (!is_boolean(obj.play))
|
3123 |
+
{
|
3124 |
+
obj.play = true;
|
3125 |
+
}
|
3126 |
+
if (!is_number(obj.delay))
|
3127 |
+
{
|
3128 |
+
obj.delay = 0;
|
3129 |
+
}
|
3130 |
+
if (is_undefined(obj.pauseOnEvent))
|
3131 |
+
{
|
3132 |
+
obj.pauseOnEvent = true;
|
3133 |
+
}
|
3134 |
+
if (!is_boolean(obj.pauseOnResize))
|
3135 |
+
{
|
3136 |
+
obj.pauseOnResize = true;
|
3137 |
+
}
|
3138 |
+
if (!is_number(obj.timeoutDuration))
|
3139 |
+
{
|
3140 |
+
obj.timeoutDuration = (obj.duration < 10)
|
3141 |
+
? 2500
|
3142 |
+
: obj.duration * 5;
|
3143 |
+
}
|
3144 |
+
if (obj.progress)
|
3145 |
+
{
|
3146 |
+
if (is_function(obj.progress.bar))
|
3147 |
+
{
|
3148 |
+
obj.progress.bar = obj.progress.bar.call($tt);
|
3149 |
+
}
|
3150 |
+
if (is_string(obj.progress.bar))
|
3151 |
+
{
|
3152 |
+
obj.progress.bar = $(obj.progress.bar);
|
3153 |
+
}
|
3154 |
+
if (obj.progress.bar)
|
3155 |
+
{
|
3156 |
+
if (!is_function(obj.progress.updater))
|
3157 |
+
{
|
3158 |
+
obj.progress.updater = $.fn.carouFredSel.progressbarUpdater;
|
3159 |
+
}
|
3160 |
+
if (!is_number(obj.progress.interval))
|
3161 |
+
{
|
3162 |
+
obj.progress.interval = 50;
|
3163 |
+
}
|
3164 |
+
}
|
3165 |
+
else
|
3166 |
+
{
|
3167 |
+
obj.progress = false;
|
3168 |
+
}
|
3169 |
+
}
|
3170 |
+
return obj;
|
3171 |
+
}
|
3172 |
+
|
3173 |
+
function go_getPrevNextObject($tt, obj) {
|
3174 |
+
obj = go_getNaviObject($tt, obj);
|
3175 |
+
if (is_jquery(obj))
|
3176 |
+
{
|
3177 |
+
obj = {
|
3178 |
+
'button': obj
|
3179 |
+
};
|
3180 |
+
}
|
3181 |
+
else if (is_number(obj))
|
3182 |
+
{
|
3183 |
+
obj = {
|
3184 |
+
'key': obj
|
3185 |
+
};
|
3186 |
+
}
|
3187 |
+
return obj;
|
3188 |
+
}
|
3189 |
+
function go_complementPrevNextObject($tt, obj) {
|
3190 |
+
if (is_function(obj.button))
|
3191 |
+
{
|
3192 |
+
obj.button = obj.button.call($tt);
|
3193 |
+
}
|
3194 |
+
if (is_string(obj.button))
|
3195 |
+
{
|
3196 |
+
obj.button = $(obj.button);
|
3197 |
+
}
|
3198 |
+
if (is_string(obj.key))
|
3199 |
+
{
|
3200 |
+
obj.key = cf_getKeyCode(obj.key);
|
3201 |
+
}
|
3202 |
+
return obj;
|
3203 |
+
}
|
3204 |
+
|
3205 |
+
function go_getPaginationObject($tt, obj) {
|
3206 |
+
obj = go_getNaviObject($tt, obj);
|
3207 |
+
if (is_jquery(obj))
|
3208 |
+
{
|
3209 |
+
obj = {
|
3210 |
+
'container': obj
|
3211 |
+
};
|
3212 |
+
}
|
3213 |
+
else if (is_boolean(obj))
|
3214 |
+
{
|
3215 |
+
obj = {
|
3216 |
+
'keys': obj
|
3217 |
+
};
|
3218 |
+
}
|
3219 |
+
return obj;
|
3220 |
+
}
|
3221 |
+
function go_complementPaginationObject($tt, obj) {
|
3222 |
+
if (is_function(obj.container))
|
3223 |
+
{
|
3224 |
+
obj.container = obj.container.call($tt);
|
3225 |
+
}
|
3226 |
+
if (is_string(obj.container))
|
3227 |
+
{
|
3228 |
+
obj.container = $(obj.container);
|
3229 |
+
}
|
3230 |
+
if (!is_number(obj.items))
|
3231 |
+
{
|
3232 |
+
obj.items = false;
|
3233 |
+
}
|
3234 |
+
if (!is_boolean(obj.keys))
|
3235 |
+
{
|
3236 |
+
obj.keys = false;
|
3237 |
+
}
|
3238 |
+
if (!is_function(obj.anchorBuilder) && !is_false(obj.anchorBuilder))
|
3239 |
+
{
|
3240 |
+
obj.anchorBuilder = $.fn.carouFredSel.pageAnchorBuilder;
|
3241 |
+
}
|
3242 |
+
if (!is_number(obj.deviation))
|
3243 |
+
{
|
3244 |
+
obj.deviation = 0;
|
3245 |
+
}
|
3246 |
+
return obj;
|
3247 |
+
}
|
3248 |
+
|
3249 |
+
function go_getSwipeObject($tt, obj) {
|
3250 |
+
if (is_function(obj))
|
3251 |
+
{
|
3252 |
+
obj = obj.call($tt);
|
3253 |
+
}
|
3254 |
+
if (is_undefined(obj))
|
3255 |
+
{
|
3256 |
+
obj = {
|
3257 |
+
'onTouch': false
|
3258 |
+
};
|
3259 |
+
}
|
3260 |
+
if (is_true(obj))
|
3261 |
+
{
|
3262 |
+
obj = {
|
3263 |
+
'onTouch': obj
|
3264 |
+
};
|
3265 |
+
}
|
3266 |
+
else if (is_number(obj))
|
3267 |
+
{
|
3268 |
+
obj = {
|
3269 |
+
'items': obj
|
3270 |
+
};
|
3271 |
+
}
|
3272 |
+
return obj;
|
3273 |
+
}
|
3274 |
+
function go_complementSwipeObject($tt, obj) {
|
3275 |
+
if (!is_boolean(obj.onTouch))
|
3276 |
+
{
|
3277 |
+
obj.onTouch = true;
|
3278 |
+
}
|
3279 |
+
if (!is_boolean(obj.onMouse))
|
3280 |
+
{
|
3281 |
+
obj.onMouse = false;
|
3282 |
+
}
|
3283 |
+
if (!is_object(obj.options))
|
3284 |
+
{
|
3285 |
+
obj.options = {};
|
3286 |
+
}
|
3287 |
+
if (!is_boolean(obj.options.triggerOnTouchEnd))
|
3288 |
+
{
|
3289 |
+
obj.options.triggerOnTouchEnd = false;
|
3290 |
+
}
|
3291 |
+
return obj;
|
3292 |
+
}
|
3293 |
+
function go_getMousewheelObject($tt, obj) {
|
3294 |
+
if (is_function(obj))
|
3295 |
+
{
|
3296 |
+
obj = obj.call($tt);
|
3297 |
+
}
|
3298 |
+
if (is_true(obj))
|
3299 |
+
{
|
3300 |
+
obj = {};
|
3301 |
+
}
|
3302 |
+
else if (is_number(obj))
|
3303 |
+
{
|
3304 |
+
obj = {
|
3305 |
+
'items': obj
|
3306 |
+
};
|
3307 |
+
}
|
3308 |
+
else if (is_undefined(obj))
|
3309 |
+
{
|
3310 |
+
obj = false;
|
3311 |
+
}
|
3312 |
+
return obj;
|
3313 |
+
}
|
3314 |
+
function go_complementMousewheelObject($tt, obj) {
|
3315 |
+
return obj;
|
3316 |
+
}
|
3317 |
+
|
3318 |
+
// get number functions
|
3319 |
+
function gn_getItemIndex(num, dev, org, items, $cfs) {
|
3320 |
+
if (is_string(num))
|
3321 |
+
{
|
3322 |
+
num = $(num, $cfs);
|
3323 |
+
}
|
3324 |
+
|
3325 |
+
if (is_object(num))
|
3326 |
+
{
|
3327 |
+
num = $(num, $cfs);
|
3328 |
+
}
|
3329 |
+
if (is_jquery(num))
|
3330 |
+
{
|
3331 |
+
num = $cfs.children().index(num);
|
3332 |
+
if (!is_boolean(org))
|
3333 |
+
{
|
3334 |
+
org = false;
|
3335 |
+
}
|
3336 |
+
}
|
3337 |
+
else
|
3338 |
+
{
|
3339 |
+
if (!is_boolean(org))
|
3340 |
+
{
|
3341 |
+
org = true;
|
3342 |
+
}
|
3343 |
+
}
|
3344 |
+
if (!is_number(num))
|
3345 |
+
{
|
3346 |
+
num = 0;
|
3347 |
+
}
|
3348 |
+
if (!is_number(dev))
|
3349 |
+
{
|
3350 |
+
dev = 0;
|
3351 |
+
}
|
3352 |
+
|
3353 |
+
if (org)
|
3354 |
+
{
|
3355 |
+
num += items.first;
|
3356 |
+
}
|
3357 |
+
num += dev;
|
3358 |
+
if (items.total > 0)
|
3359 |
+
{
|
3360 |
+
while (num >= items.total)
|
3361 |
+
{
|
3362 |
+
num -= items.total;
|
3363 |
+
}
|
3364 |
+
while (num < 0)
|
3365 |
+
{
|
3366 |
+
num += items.total;
|
3367 |
+
}
|
3368 |
+
}
|
3369 |
+
return num;
|
3370 |
+
}
|
3371 |
+
|
3372 |
+
// items prev
|
3373 |
+
function gn_getVisibleItemsPrev(i, o, s) {
|
3374 |
+
var t = 0,
|
3375 |
+
x = 0;
|
3376 |
+
|
3377 |
+
for (var a = s; a >= 0; a--)
|
3378 |
+
{
|
3379 |
+
var j = i.eq(a);
|
3380 |
+
t += (j.is(':visible')) ? j[o.d['outerWidth']](true) : 0;
|
3381 |
+
if (t > o.maxDimension)
|
3382 |
+
{
|
3383 |
+
return x;
|
3384 |
+
}
|
3385 |
+
if (a == 0)
|
3386 |
+
{
|
3387 |
+
a = i.length;
|
3388 |
+
}
|
3389 |
+
x++;
|
3390 |
+
}
|
3391 |
+
}
|
3392 |
+
function gn_getVisibleItemsPrevFilter(i, o, s) {
|
3393 |
+
return gn_getItemsPrevFilter(i, o.items.filter, o.items.visibleConf.org, s);
|
3394 |
+
}
|
3395 |
+
function gn_getScrollItemsPrevFilter(i, o, s, m) {
|
3396 |
+
return gn_getItemsPrevFilter(i, o.items.filter, m, s);
|
3397 |
+
}
|
3398 |
+
function gn_getItemsPrevFilter(i, f, m, s) {
|
3399 |
+
var t = 0,
|
3400 |
+
x = 0;
|
3401 |
+
|
3402 |
+
for (var a = s, l = i.length; a >= 0; a--)
|
3403 |
+
{
|
3404 |
+
x++;
|
3405 |
+
if (x == l)
|
3406 |
+
{
|
3407 |
+
return x;
|
3408 |
+
}
|
3409 |
+
|
3410 |
+
var j = i.eq(a);
|
3411 |
+
if (j.is(f))
|
3412 |
+
{
|
3413 |
+
t++;
|
3414 |
+
if (t == m)
|
3415 |
+
{
|
3416 |
+
return x;
|
3417 |
+
}
|
3418 |
+
}
|
3419 |
+
if (a == 0)
|
3420 |
+
{
|
3421 |
+
a = l;
|
3422 |
+
}
|
3423 |
+
}
|
3424 |
+
}
|
3425 |
+
|
3426 |
+
function gn_getVisibleOrg($c, o) {
|
3427 |
+
return o.items.visibleConf.org || $c.children().slice(0, o.items.visible).filter(o.items.filter).length;
|
3428 |
+
}
|
3429 |
+
|
3430 |
+
// items next
|
3431 |
+
function gn_getVisibleItemsNext(i, o, s) {
|
3432 |
+
var t = 0,
|
3433 |
+
x = 0;
|
3434 |
+
|
3435 |
+
for (var a = s, l = i.length-1; a <= l; a++)
|
3436 |
+
{
|
3437 |
+
var j = i.eq(a);
|
3438 |
+
|
3439 |
+
t += (j.is(':visible')) ? j[o.d['outerWidth']](true) : 0;
|
3440 |
+
if (t > o.maxDimension)
|
3441 |
+
{
|
3442 |
+
return x;
|
3443 |
+
}
|
3444 |
+
|
3445 |
+
x++;
|
3446 |
+
if (x == l+1)
|
3447 |
+
{
|
3448 |
+
return x;
|
3449 |
+
}
|
3450 |
+
if (a == l)
|
3451 |
+
{
|
3452 |
+
a = -1;
|
3453 |
+
}
|
3454 |
+
}
|
3455 |
+
}
|
3456 |
+
function gn_getVisibleItemsNextTestCircular(i, o, s, l) {
|
3457 |
+
var v = gn_getVisibleItemsNext(i, o, s);
|
3458 |
+
if (!o.circular)
|
3459 |
+
{
|
3460 |
+
if (s + v > l)
|
3461 |
+
{
|
3462 |
+
v = l - s;
|
3463 |
+
}
|
3464 |
+
}
|
3465 |
+
return v;
|
3466 |
+
}
|
3467 |
+
function gn_getVisibleItemsNextFilter(i, o, s) {
|
3468 |
+
return gn_getItemsNextFilter(i, o.items.filter, o.items.visibleConf.org, s, o.circular);
|
3469 |
+
}
|
3470 |
+
function gn_getScrollItemsNextFilter(i, o, s, m) {
|
3471 |
+
return gn_getItemsNextFilter(i, o.items.filter, m+1, s, o.circular) - 1;
|
3472 |
+
}
|
3473 |
+
function gn_getItemsNextFilter(i, f, m, s, c) {
|
3474 |
+
var t = 0,
|
3475 |
+
x = 0;
|
3476 |
+
|
3477 |
+
for (var a = s, l = i.length-1; a <= l; a++)
|
3478 |
+
{
|
3479 |
+
x++;
|
3480 |
+
if (x >= l)
|
3481 |
+
{
|
3482 |
+
return x;
|
3483 |
+
}
|
3484 |
+
|
3485 |
+
var j = i.eq(a);
|
3486 |
+
if (j.is(f))
|
3487 |
+
{
|
3488 |
+
t++;
|
3489 |
+
if (t == m)
|
3490 |
+
{
|
3491 |
+
return x;
|
3492 |
+
}
|
3493 |
+
}
|
3494 |
+
if (a == l)
|
3495 |
+
{
|
3496 |
+
a = -1;
|
3497 |
+
}
|
3498 |
+
}
|
3499 |
+
}
|
3500 |
+
|
3501 |
+
// get items functions
|
3502 |
+
function gi_getCurrentItems(i, o) {
|
3503 |
+
return i.slice(0, o.items.visible);
|
3504 |
+
}
|
3505 |
+
function gi_getOldItemsPrev(i, o, n) {
|
3506 |
+
return i.slice(n, o.items.visibleConf.old+n);
|
3507 |
+
}
|
3508 |
+
function gi_getNewItemsPrev(i, o) {
|
3509 |
+
return i.slice(0, o.items.visible);
|
3510 |
+
}
|
3511 |
+
function gi_getOldItemsNext(i, o) {
|
3512 |
+
return i.slice(0, o.items.visibleConf.old);
|
3513 |
+
}
|
3514 |
+
function gi_getNewItemsNext(i, o, n) {
|
3515 |
+
return i.slice(n, o.items.visible+n);
|
3516 |
+
}
|
3517 |
+
|
3518 |
+
// sizes functions
|
3519 |
+
function sz_storeMargin(i, o, d) {
|
3520 |
+
if (o.usePadding)
|
3521 |
+
{
|
3522 |
+
if (!is_string(d))
|
3523 |
+
{
|
3524 |
+
d = '_cfs_origCssMargin';
|
3525 |
+
}
|
3526 |
+
i.each(function() {
|
3527 |
+
var j = $(this),
|
3528 |
+
m = parseInt(j.css(o.d['marginRight']), 10);
|
3529 |
+
if (!is_number(m))
|
3530 |
+
{
|
3531 |
+
m = 0;
|
3532 |
+
}
|
3533 |
+
j.data(d, m);
|
3534 |
+
});
|
3535 |
+
}
|
3536 |
+
}
|
3537 |
+
function sz_resetMargin(i, o, m) {
|
3538 |
+
if (o.usePadding)
|
3539 |
+
{
|
3540 |
+
var x = (is_boolean(m)) ? m : false;
|
3541 |
+
if (!is_number(m))
|
3542 |
+
{
|
3543 |
+
m = 0;
|
3544 |
+
}
|
3545 |
+
sz_storeMargin(i, o, '_cfs_tempCssMargin');
|
3546 |
+
i.each(function() {
|
3547 |
+
var j = $(this);
|
3548 |
+
j.css(o.d['marginRight'], ((x) ? j.data('_cfs_tempCssMargin') : m + j.data('_cfs_origCssMargin')));
|
3549 |
+
});
|
3550 |
+
}
|
3551 |
+
}
|
3552 |
+
function sz_storeOrigCss(i) {
|
3553 |
+
i.each(function() {
|
3554 |
+
var j = $(this);
|
3555 |
+
j.data('_cfs_origCss', j.attr('style') || '');
|
3556 |
+
});
|
3557 |
+
}
|
3558 |
+
function sz_restoreOrigCss(i) {
|
3559 |
+
i.each(function() {
|
3560 |
+
var j = $(this);
|
3561 |
+
j.attr('style', j.data('_cfs_origCss') || '');
|
3562 |
+
});
|
3563 |
+
}
|
3564 |
+
function sz_setResponsiveSizes(o, all) {
|
3565 |
+
var visb = o.items.visible,
|
3566 |
+
newS = o.items[o.d['width']],
|
3567 |
+
seco = o[o.d['height']],
|
3568 |
+
secp = is_percentage(seco);
|
3569 |
+
|
3570 |
+
all.each(function() {
|
3571 |
+
var $t = $(this),
|
3572 |
+
nw = newS - ms_getPaddingBorderMargin($t, o, 'Width');
|
3573 |
+
|
3574 |
+
$t[o.d['width']](nw);
|
3575 |
+
if (secp)
|
3576 |
+
{
|
3577 |
+
$t[o.d['height']](ms_getPercentage(nw, seco));
|
3578 |
+
}
|
3579 |
+
});
|
3580 |
+
}
|
3581 |
+
function sz_setSizes($c, o) {
|
3582 |
+
var $w = $c.parent(),
|
3583 |
+
$i = $c.children(),
|
3584 |
+
$v = gi_getCurrentItems($i, o),
|
3585 |
+
sz = cf_mapWrapperSizes(ms_getSizes($v, o, true), o, false);
|
3586 |
+
|
3587 |
+
$w.css(sz);
|
3588 |
+
|
3589 |
+
if (o.usePadding)
|
3590 |
+
{
|
3591 |
+
var p = o.padding,
|
3592 |
+
r = p[o.d[1]];
|
3593 |
+
|
3594 |
+
if (o.align && r < 0)
|
3595 |
+
{
|
3596 |
+
r = 0;
|
3597 |
+
}
|
3598 |
+
var $l = $v.last();
|
3599 |
+
$l.css(o.d['marginRight'], $l.data('_cfs_origCssMargin') + r);
|
3600 |
+
$c.css(o.d['top'], p[o.d[0]]);
|
3601 |
+
$c.css(o.d['left'], p[o.d[3]]);
|
3602 |
+
}
|
3603 |
+
|
3604 |
+
$c.css(o.d['width'], sz[o.d['width']]+(ms_getTotalSize($i, o, 'width')*2));
|
3605 |
+
$c.css(o.d['height'], ms_getLargestSize($i, o, 'height'));
|
3606 |
+
return sz;
|
3607 |
+
}
|
3608 |
+
|
3609 |
+
// measuring functions
|
3610 |
+
function ms_getSizes(i, o, wrapper) {
|
3611 |
+
return [ms_getTotalSize(i, o, 'width', wrapper), ms_getLargestSize(i, o, 'height', wrapper)];
|
3612 |
+
}
|
3613 |
+
function ms_getLargestSize(i, o, dim, wrapper) {
|
3614 |
+
if (!is_boolean(wrapper))
|
3615 |
+
{
|
3616 |
+
wrapper = false;
|
3617 |
+
}
|
3618 |
+
if (is_number(o[o.d[dim]]) && wrapper)
|
3619 |
+
{
|
3620 |
+
return o[o.d[dim]];
|
3621 |
+
}
|
3622 |
+
if (is_number(o.items[o.d[dim]]))
|
3623 |
+
{
|
3624 |
+
return o.items[o.d[dim]];
|
3625 |
+
}
|
3626 |
+
dim = (dim.toLowerCase().indexOf('width') > -1) ? 'outerWidth' : 'outerHeight';
|
3627 |
+
return ms_getTrueLargestSize(i, o, dim);
|
3628 |
+
}
|
3629 |
+
function ms_getTrueLargestSize(i, o, dim) {
|
3630 |
+
var s = 0;
|
3631 |
+
|
3632 |
+
for (var a = 0, l = i.length; a < l; a++)
|
3633 |
+
{
|
3634 |
+
var j = i.eq(a);
|
3635 |
+
|
3636 |
+
var m = (j.is(':visible')) ? j[o.d[dim]](true) : 0;
|
3637 |
+
if (s < m)
|
3638 |
+
{
|
3639 |
+
s = m;
|
3640 |
+
}
|
3641 |
+
}
|
3642 |
+
return s;
|
3643 |
+
}
|
3644 |
+
|
3645 |
+
function ms_getTotalSize(i, o, dim, wrapper) {
|
3646 |
+
if (!is_boolean(wrapper))
|
3647 |
+
{
|
3648 |
+
wrapper = false;
|
3649 |
+
}
|
3650 |
+
if (is_number(o[o.d[dim]]) && wrapper)
|
3651 |
+
{
|
3652 |
+
return o[o.d[dim]];
|
3653 |
+
}
|
3654 |
+
if (is_number(o.items[o.d[dim]]))
|
3655 |
+
{
|
3656 |
+
return o.items[o.d[dim]] * i.length;
|
3657 |
+
}
|
3658 |
+
|
3659 |
+
var d = (dim.toLowerCase().indexOf('width') > -1) ? 'outerWidth' : 'outerHeight',
|
3660 |
+
s = 0;
|
3661 |
+
|
3662 |
+
for (var a = 0, l = i.length; a < l; a++)
|
3663 |
+
{
|
3664 |
+
var j = i.eq(a);
|
3665 |
+
s += (j.is(':visible')) ? j[o.d[d]](true) : 0;
|
3666 |
+
}
|
3667 |
+
return s;
|
3668 |
+
}
|
3669 |
+
function ms_getParentSize($w, o, d) {
|
3670 |
+
var isVisible = $w.is(':visible');
|
3671 |
+
if (isVisible)
|
3672 |
+
{
|
3673 |
+
$w.hide();
|
3674 |
+
}
|
3675 |
+
var s = $w.parent()[o.d[d]]();
|
3676 |
+
if (isVisible)
|
3677 |
+
{
|
3678 |
+
$w.show();
|
3679 |
+
}
|
3680 |
+
return s;
|
3681 |
+
}
|
3682 |
+
function ms_getMaxDimension(o, a) {
|
3683 |
+
return (is_number(o[o.d['width']])) ? o[o.d['width']] : a;
|
3684 |
+
}
|
3685 |
+
function ms_hasVariableSizes(i, o, dim) {
|
3686 |
+
var s = false,
|
3687 |
+
v = false;
|
3688 |
+
|
3689 |
+
for (var a = 0, l = i.length; a < l; a++)
|
3690 |
+
{
|
3691 |
+
var j = i.eq(a);
|
3692 |
+
|
3693 |
+
var c = (j.is(':visible')) ? j[o.d[dim]](true) : 0;
|
3694 |
+
if (s === false)
|
3695 |
+
{
|
3696 |
+
s = c;
|
3697 |
+
}
|
3698 |
+
else if (s != c)
|
3699 |
+
{
|
3700 |
+
v = true;
|
3701 |
+
}
|
3702 |
+
if (s == 0)
|
3703 |
+
{
|
3704 |
+
v = true;
|
3705 |
+
}
|
3706 |
+
}
|
3707 |
+
return v;
|
3708 |
+
}
|
3709 |
+
function ms_getPaddingBorderMargin(i, o, d) {
|
3710 |
+
return i[o.d['outer'+d]](true) - i[o.d[d.toLowerCase()]]();
|
3711 |
+
}
|
3712 |
+
function ms_getPercentage(s, o) {
|
3713 |
+
if (is_percentage(o))
|
3714 |
+
{
|
3715 |
+
o = parseInt( o.slice(0, -1), 10 );
|
3716 |
+
if (!is_number(o))
|
3717 |
+
{
|
3718 |
+
return s;
|
3719 |
+
}
|
3720 |
+
s *= o/100;
|
3721 |
+
}
|
3722 |
+
return s;
|
3723 |
+
}
|
3724 |
+
|
3725 |
+
// config functions
|
3726 |
+
function cf_e(n, c, pf, ns, rd) {
|
3727 |
+
if (!is_boolean(pf))
|
3728 |
+
{
|
3729 |
+
pf = true;
|
3730 |
+
}
|
3731 |
+
if (!is_boolean(ns))
|
3732 |
+
{
|
3733 |
+
ns = true;
|
3734 |
+
}
|
3735 |
+
if (!is_boolean(rd))
|
3736 |
+
{
|
3737 |
+
rd = false;
|
3738 |
+
}
|
3739 |
+
|
3740 |
+
if (pf)
|
3741 |
+
{
|
3742 |
+
n = c.events.prefix + n;
|
3743 |
+
}
|
3744 |
+
if (ns)
|
3745 |
+
{
|
3746 |
+
n = n +'.'+ c.events.namespace;
|
3747 |
+
}
|
3748 |
+
if (ns && rd)
|
3749 |
+
{
|
3750 |
+
n += c.serialNumber;
|
3751 |
+
}
|
3752 |
+
|
3753 |
+
return n;
|
3754 |
+
}
|
3755 |
+
function cf_c(n, c) {
|
3756 |
+
return (is_string(c.classnames[n])) ? c.classnames[n] : n;
|
3757 |
+
}
|
3758 |
+
function cf_mapWrapperSizes(ws, o, p) {
|
3759 |
+
if (!is_boolean(p))
|
3760 |
+
{
|
3761 |
+
p = true;
|
3762 |
+
}
|
3763 |
+
var pad = (o.usePadding && p) ? o.padding : [0, 0, 0, 0];
|
3764 |
+
var wra = {};
|
3765 |
+
|
3766 |
+
wra[o.d['width']] = ws[0] + pad[1] + pad[3];
|
3767 |
+
wra[o.d['height']] = ws[1] + pad[0] + pad[2];
|
3768 |
+
|
3769 |
+
return wra;
|
3770 |
+
}
|
3771 |
+
function cf_sortParams(vals, typs) {
|
3772 |
+
var arr = [];
|
3773 |
+
for (var a = 0, l1 = vals.length; a < l1; a++)
|
3774 |
+
{
|
3775 |
+
for (var b = 0, l2 = typs.length; b < l2; b++)
|
3776 |
+
{
|
3777 |
+
if (typs[b].indexOf(typeof vals[a]) > -1 && is_undefined(arr[b]))
|
3778 |
+
{
|
3779 |
+
arr[b] = vals[a];
|
3780 |
+
break;
|
3781 |
+
}
|
3782 |
+
}
|
3783 |
+
}
|
3784 |
+
return arr;
|
3785 |
+
}
|
3786 |
+
function cf_getPadding(p) {
|
3787 |
+
if (is_undefined(p))
|
3788 |
+
{
|
3789 |
+
return [0, 0, 0, 0];
|
3790 |
+
}
|
3791 |
+
if (is_number(p))
|
3792 |
+
{
|
3793 |
+
return [p, p, p, p];
|
3794 |
+
}
|
3795 |
+
if (is_string(p))
|
3796 |
+
{
|
3797 |
+
p = p.split('px').join('').split('em').join('').split(' ');
|
3798 |
+
}
|
3799 |
+
|
3800 |
+
if (!is_array(p))
|
3801 |
+
{
|
3802 |
+
return [0, 0, 0, 0];
|
3803 |
+
}
|
3804 |
+
for (var i = 0; i < 4; i++)
|
3805 |
+
{
|
3806 |
+
p[i] = parseInt(p[i], 10);
|
3807 |
+
}
|
3808 |
+
switch (p.length)
|
3809 |
+
{
|
3810 |
+
case 0:
|
3811 |
+
return [0, 0, 0, 0];
|
3812 |
+
case 1:
|
3813 |
+
return [p[0], p[0], p[0], p[0]];
|
3814 |
+
case 2:
|
3815 |
+
return [p[0], p[1], p[0], p[1]];
|
3816 |
+
case 3:
|
3817 |
+
return [p[0], p[1], p[2], p[1]];
|
3818 |
+
default:
|
3819 |
+
return [p[0], p[1], p[2], p[3]];
|
3820 |
+
}
|
3821 |
+
}
|
3822 |
+
function cf_getAlignPadding(itm, o) {
|
3823 |
+
var x = (is_number(o[o.d['width']])) ? Math.ceil(o[o.d['width']] - ms_getTotalSize(itm, o, 'width')) : 0;
|
3824 |
+
switch (o.align)
|
3825 |
+
{
|
3826 |
+
case 'left':
|
3827 |
+
return [0, x];
|
3828 |
+
case 'right':
|
3829 |
+
return [x, 0];
|
3830 |
+
case 'center':
|
3831 |
+
default:
|
3832 |
+
return [Math.ceil(x/2), Math.floor(x/2)];
|
3833 |
+
}
|
3834 |
+
}
|
3835 |
+
function cf_getDimensions(o) {
|
3836 |
+
var dm = [
|
3837 |
+
['width' , 'innerWidth' , 'outerWidth' , 'height' , 'innerHeight' , 'outerHeight' , 'left', 'top' , 'marginRight' , 0, 1, 2, 3],
|
3838 |
+
['height' , 'innerHeight' , 'outerHeight' , 'width' , 'innerWidth' , 'outerWidth' , 'top' , 'left', 'marginBottom', 3, 2, 1, 0]
|
3839 |
+
];
|
3840 |
+
|
3841 |
+
var dl = dm[0].length,
|
3842 |
+
dx = (o.direction == 'right' || o.direction == 'left') ? 0 : 1;
|
3843 |
+
|
3844 |
+
var dimensions = {};
|
3845 |
+
for (var d = 0; d < dl; d++)
|
3846 |
+
{
|
3847 |
+
dimensions[dm[0][d]] = dm[dx][d];
|
3848 |
+
}
|
3849 |
+
return dimensions;
|
3850 |
+
}
|
3851 |
+
function cf_getAdjust(x, o, a, $t) {
|
3852 |
+
var v = x;
|
3853 |
+
if (is_function(a))
|
3854 |
+
{
|
3855 |
+
v = a.call($t, v);
|
3856 |
+
|
3857 |
+
}
|
3858 |
+
else if (is_string(a))
|
3859 |
+
{
|
3860 |
+
var p = a.split('+'),
|
3861 |
+
m = a.split('-');
|
3862 |
+
|
3863 |
+
if (m.length > p.length)
|
3864 |
+
{
|
3865 |
+
var neg = true,
|
3866 |
+
sta = m[0],
|
3867 |
+
adj = m[1];
|
3868 |
+
}
|
3869 |
+
else
|
3870 |
+
{
|
3871 |
+
var neg = false,
|
3872 |
+
sta = p[0],
|
3873 |
+
adj = p[1];
|
3874 |
+
}
|
3875 |
+
|
3876 |
+
switch(sta)
|
3877 |
+
{
|
3878 |
+
case 'even':
|
3879 |
+
v = (x % 2 == 1) ? x-1 : x;
|
3880 |
+
break;
|
3881 |
+
case 'odd':
|
3882 |
+
v = (x % 2 == 0) ? x-1 : x;
|
3883 |
+
break;
|
3884 |
+
default:
|
3885 |
+
v = x;
|
3886 |
+
break;
|
3887 |
+
}
|
3888 |
+
adj = parseInt(adj, 10);
|
3889 |
+
if (is_number(adj))
|
3890 |
+
{
|
3891 |
+
if (neg)
|
3892 |
+
{
|
3893 |
+
adj = -adj;
|
3894 |
+
}
|
3895 |
+
v += adj;
|
3896 |
+
}
|
3897 |
+
}
|
3898 |
+
if (!is_number(v) || v < 1)
|
3899 |
+
{
|
3900 |
+
v = 1;
|
3901 |
+
}
|
3902 |
+
return v;
|
3903 |
+
}
|
3904 |
+
function cf_getItemsAdjust(x, o, a, $t) {
|
3905 |
+
return cf_getItemAdjustMinMax(cf_getAdjust(x, o, a, $t), o.items.visibleConf);
|
3906 |
+
}
|
3907 |
+
function cf_getItemAdjustMinMax(v, i) {
|
3908 |
+
if (is_number(i.min) && v < i.min)
|
3909 |
+
{
|
3910 |
+
v = i.min;
|
3911 |
+
}
|
3912 |
+
if (is_number(i.max) && v > i.max)
|
3913 |
+
{
|
3914 |
+
v = i.max;
|
3915 |
+
}
|
3916 |
+
if (v < 1)
|
3917 |
+
{
|
3918 |
+
v = 1;
|
3919 |
+
}
|
3920 |
+
return v;
|
3921 |
+
}
|
3922 |
+
function cf_getSynchArr(s) {
|
3923 |
+
if (!is_array(s))
|
3924 |
+
{
|
3925 |
+
s = [[s]];
|
3926 |
+
}
|
3927 |
+
if (!is_array(s[0]))
|
3928 |
+
{
|
3929 |
+
s = [s];
|
3930 |
+
}
|
3931 |
+
for (var j = 0, l = s.length; j < l; j++)
|
3932 |
+
{
|
3933 |
+
if (is_string(s[j][0]))
|
3934 |
+
{
|
3935 |
+
s[j][0] = $(s[j][0]);
|
3936 |
+
}
|
3937 |
+
if (!is_boolean(s[j][1]))
|
3938 |
+
{
|
3939 |
+
s[j][1] = true;
|
3940 |
+
}
|
3941 |
+
if (!is_boolean(s[j][2]))
|
3942 |
+
{
|
3943 |
+
s[j][2] = true;
|
3944 |
+
}
|
3945 |
+
if (!is_number(s[j][3]))
|
3946 |
+
{
|
3947 |
+
s[j][3] = 0;
|
3948 |
+
}
|
3949 |
+
}
|
3950 |
+
return s;
|
3951 |
+
}
|
3952 |
+
function cf_getKeyCode(k) {
|
3953 |
+
if (k == 'right')
|
3954 |
+
{
|
3955 |
+
return 39;
|
3956 |
+
}
|
3957 |
+
if (k == 'left')
|
3958 |
+
{
|
3959 |
+
return 37;
|
3960 |
+
}
|
3961 |
+
if (k == 'up')
|
3962 |
+
{
|
3963 |
+
return 38;
|
3964 |
+
}
|
3965 |
+
if (k == 'down')
|
3966 |
+
{
|
3967 |
+
return 40;
|
3968 |
+
}
|
3969 |
+
return -1;
|
3970 |
+
}
|
3971 |
+
function cf_setCookie(n, $c, c) {
|
3972 |
+
if (n)
|
3973 |
+
{
|
3974 |
+
var v = $c.triggerHandler(cf_e('currentPosition', c));
|
3975 |
+
$.fn.carouFredSel.cookie.set(n, v);
|
3976 |
+
}
|
3977 |
+
}
|
3978 |
+
function cf_getCookie(n) {
|
3979 |
+
var c = $.fn.carouFredSel.cookie.get(n);
|
3980 |
+
return (c == '') ? 0 : c;
|
3981 |
+
}
|
3982 |
+
|
3983 |
+
// init function
|
3984 |
+
function in_mapCss($elem, props) {
|
3985 |
+
var css = {};
|
3986 |
+
for (var p = 0, l = props.length; p < l; p++)
|
3987 |
+
{
|
3988 |
+
css[props[p]] = $elem.css(props[p]);
|
3989 |
+
}
|
3990 |
+
return css;
|
3991 |
+
}
|
3992 |
+
function in_complementItems(obj, opt, itm, sta) {
|
3993 |
+
if (!is_object(obj.visibleConf))
|
3994 |
+
{
|
3995 |
+
obj.visibleConf = {};
|
3996 |
+
}
|
3997 |
+
if (!is_object(obj.sizesConf))
|
3998 |
+
{
|
3999 |
+
obj.sizesConf = {};
|
4000 |
+
}
|
4001 |
+
|
4002 |
+
if (obj.start == 0 && is_number(sta))
|
4003 |
+
{
|
4004 |
+
obj.start = sta;
|
4005 |
+
}
|
4006 |
+
|
4007 |
+
// visible items
|
4008 |
+
if (is_object(obj.visible))
|
4009 |
+
{
|
4010 |
+
obj.visibleConf.min = obj.visible.min;
|
4011 |
+
obj.visibleConf.max = obj.visible.max;
|
4012 |
+
obj.visible = false;
|
4013 |
+
}
|
4014 |
+
else if (is_string(obj.visible))
|
4015 |
+
{
|
4016 |
+
// variable visible items
|
4017 |
+
if (obj.visible == 'variable')
|
4018 |
+
{
|
4019 |
+
obj.visibleConf.variable = true;
|
4020 |
+
}
|
4021 |
+
// adjust string visible items
|
4022 |
+
else
|
4023 |
+
{
|
4024 |
+
obj.visibleConf.adjust = obj.visible;
|
4025 |
+
}
|
4026 |
+
obj.visible = false;
|
4027 |
+
}
|
4028 |
+
else if (is_function(obj.visible))
|
4029 |
+
{
|
4030 |
+
obj.visibleConf.adjust = obj.visible;
|
4031 |
+
obj.visible = false;
|
4032 |
+
}
|
4033 |
+
|
4034 |
+
// set items filter
|
4035 |
+
if (!is_string(obj.filter))
|
4036 |
+
{
|
4037 |
+
obj.filter = (itm.filter(':hidden').length > 0) ? ':visible' : '*';
|
4038 |
+
}
|
4039 |
+
|
4040 |
+
// primary item-size not set
|
4041 |
+
if (!obj[opt.d['width']])
|
4042 |
+
{
|
4043 |
+
// responsive carousel -> set to largest
|
4044 |
+
if (opt.responsive)
|
4045 |
+
{
|
4046 |
+
debug(true, 'Set a '+opt.d['width']+' for the items!');
|
4047 |
+
obj[opt.d['width']] = ms_getTrueLargestSize(itm, opt, 'outerWidth');
|
4048 |
+
}
|
4049 |
+
// non-responsive -> measure it or set to "variable"
|
4050 |
+
else
|
4051 |
+
{
|
4052 |
+
obj[opt.d['width']] = (ms_hasVariableSizes(itm, opt, 'outerWidth'))
|
4053 |
+
? 'variable'
|
4054 |
+
: itm[opt.d['outerWidth']](true);
|
4055 |
+
}
|
4056 |
+
}
|
4057 |
+
|
4058 |
+
// secondary item-size not set -> measure it or set to "variable"
|
4059 |
+
if (!obj[opt.d['height']])
|
4060 |
+
{
|
4061 |
+
obj[opt.d['height']] = (ms_hasVariableSizes(itm, opt, 'outerHeight'))
|
4062 |
+
? 'variable'
|
4063 |
+
: itm[opt.d['outerHeight']](true);
|
4064 |
+
}
|
4065 |
+
|
4066 |
+
obj.sizesConf.width = obj.width;
|
4067 |
+
obj.sizesConf.height = obj.height;
|
4068 |
+
return obj;
|
4069 |
+
}
|
4070 |
+
function in_complementVisibleItems(opt, avl) {
|
4071 |
+
// primary item-size variable -> set visible items variable
|
4072 |
+
if (opt.items[opt.d['width']] == 'variable')
|
4073 |
+
{
|
4074 |
+
opt.items.visibleConf.variable = true;
|
4075 |
+
}
|
4076 |
+
if (!opt.items.visibleConf.variable) {
|
4077 |
+
// primary size is number -> calculate visible-items
|
4078 |
+
if (is_number(opt[opt.d['width']]))
|
4079 |
+
{
|
4080 |
+
opt.items.visible = Math.floor(opt[opt.d['width']] / opt.items[opt.d['width']]);
|
4081 |
+
}
|
4082 |
+
// measure and calculate primary size and visible-items
|
4083 |
+
else
|
4084 |
+
{
|
4085 |
+
opt.items.visible = Math.floor(avl / opt.items[opt.d['width']]);
|
4086 |
+
opt[opt.d['width']] = opt.items.visible * opt.items[opt.d['width']];
|
4087 |
+
if (!opt.items.visibleConf.adjust)
|
4088 |
+
{
|
4089 |
+
opt.align = false;
|
4090 |
+
}
|
4091 |
+
}
|
4092 |
+
if (opt.items.visible == 'Infinity' || opt.items.visible < 1)
|
4093 |
+
{
|
4094 |
+
debug(true, 'Not a valid number of visible items: Set to "variable".');
|
4095 |
+
opt.items.visibleConf.variable = true;
|
4096 |
+
}
|
4097 |
+
}
|
4098 |
+
return opt;
|
4099 |
+
}
|
4100 |
+
function in_complementPrimarySize(obj, opt, all) {
|
4101 |
+
// primary size set to auto -> measure largest item-size and set it
|
4102 |
+
if (obj == 'auto')
|
4103 |
+
{
|
4104 |
+
obj = ms_getTrueLargestSize(all, opt, 'outerWidth');
|
4105 |
+
}
|
4106 |
+
return obj;
|
4107 |
+
}
|
4108 |
+
function in_complementSecondarySize(obj, opt, all) {
|
4109 |
+
// secondary size set to auto -> measure largest item-size and set it
|
4110 |
+
if (obj == 'auto')
|
4111 |
+
{
|
4112 |
+
obj = ms_getTrueLargestSize(all, opt, 'outerHeight');
|
4113 |
+
}
|
4114 |
+
// secondary size not set -> set to secondary item-size
|
4115 |
+
if (!obj)
|
4116 |
+
{
|
4117 |
+
obj = opt.items[opt.d['height']];
|
4118 |
+
}
|
4119 |
+
return obj;
|
4120 |
+
}
|
4121 |
+
function in_getAlignPadding(o, all) {
|
4122 |
+
var p = cf_getAlignPadding(gi_getCurrentItems(all, o), o);
|
4123 |
+
o.padding[o.d[1]] = p[1];
|
4124 |
+
o.padding[o.d[3]] = p[0];
|
4125 |
+
return o;
|
4126 |
+
}
|
4127 |
+
function in_getResponsiveValues(o, all, avl) {
|
4128 |
+
|
4129 |
+
var visb = cf_getItemAdjustMinMax(Math.ceil(o[o.d['width']] / o.items[o.d['width']]), o.items.visibleConf);
|
4130 |
+
if (visb > all.length)
|
4131 |
+
{
|
4132 |
+
visb = all.length;
|
4133 |
+
}
|
4134 |
+
|
4135 |
+
var newS = Math.floor(o[o.d['width']]/visb);
|
4136 |
+
|
4137 |
+
o.items.visible = visb;
|
4138 |
+
o.items[o.d['width']] = newS;
|
4139 |
+
o[o.d['width']] = visb * newS;
|
4140 |
+
return o;
|
4141 |
+
}
|
4142 |
+
|
4143 |
+
|
4144 |
+
// buttons functions
|
4145 |
+
function bt_pauseOnHoverConfig(p) {
|
4146 |
+
if (is_string(p))
|
4147 |
+
{
|
4148 |
+
var i = (p.indexOf('immediate') > -1) ? true : false,
|
4149 |
+
r = (p.indexOf('resume') > -1) ? true : false;
|
4150 |
+
}
|
4151 |
+
else
|
4152 |
+
{
|
4153 |
+
var i = r = false;
|
4154 |
+
}
|
4155 |
+
return [i, r];
|
4156 |
+
}
|
4157 |
+
function bt_mousesheelNumber(mw) {
|
4158 |
+
return (is_number(mw)) ? mw : null
|
4159 |
+
}
|
4160 |
+
|
4161 |
+
// helper functions
|
4162 |
+
function is_null(a) {
|
4163 |
+
return (a === null);
|
4164 |
+
}
|
4165 |
+
function is_undefined(a) {
|
4166 |
+
return (is_null(a) || typeof a == 'undefined' || a === '' || a === 'undefined');
|
4167 |
+
}
|
4168 |
+
function is_array(a) {
|
4169 |
+
return (a instanceof Array);
|
4170 |
+
}
|
4171 |
+
function is_jquery(a) {
|
4172 |
+
return (a instanceof jQuery);
|
4173 |
+
}
|
4174 |
+
function is_object(a) {
|
4175 |
+
return ((a instanceof Object || typeof a == 'object') && !is_null(a) && !is_jquery(a) && !is_array(a) && !is_function(a));
|
4176 |
+
}
|
4177 |
+
function is_number(a) {
|
4178 |
+
return ((a instanceof Number || typeof a == 'number') && !isNaN(a));
|
4179 |
+
}
|
4180 |
+
function is_string(a) {
|
4181 |
+
return ((a instanceof String || typeof a == 'string') && !is_undefined(a) && !is_true(a) && !is_false(a));
|
4182 |
+
}
|
4183 |
+
function is_function(a) {
|
4184 |
+
return (a instanceof Function || typeof a == 'function');
|
4185 |
+
}
|
4186 |
+
function is_boolean(a) {
|
4187 |
+
return (a instanceof Boolean || typeof a == 'boolean' || is_true(a) || is_false(a));
|
4188 |
+
}
|
4189 |
+
function is_true(a) {
|
4190 |
+
return (a === true || a === 'true');
|
4191 |
+
}
|
4192 |
+
function is_false(a) {
|
4193 |
+
return (a === false || a === 'false');
|
4194 |
+
}
|
4195 |
+
function is_percentage(x) {
|
4196 |
+
return (is_string(x) && x.slice(-1) == '%');
|
4197 |
+
}
|
4198 |
+
|
4199 |
+
|
4200 |
+
function getTime() {
|
4201 |
+
return new Date().getTime();
|
4202 |
+
}
|
4203 |
+
|
4204 |
+
function deprecated( o, n ) {
|
4205 |
+
debug(true, o+' is DEPRECATED, support for it will be removed. Use '+n+' instead.');
|
4206 |
+
}
|
4207 |
+
function debug(d, m) {
|
4208 |
+
if (!is_undefined(window.console) && !is_undefined(window.console.log))
|
4209 |
+
{
|
4210 |
+
if (is_object(d))
|
4211 |
+
{
|
4212 |
+
var s = ' ('+d.selector+')';
|
4213 |
+
d = d.debug;
|
4214 |
+
}
|
4215 |
+
else
|
4216 |
+
{
|
4217 |
+
var s = '';
|
4218 |
+
}
|
4219 |
+
if (!d)
|
4220 |
+
{
|
4221 |
+
return false;
|
4222 |
+
}
|
4223 |
+
|
4224 |
+
if (is_string(m))
|
4225 |
+
{
|
4226 |
+
m = 'carouFredSel'+s+': ' + m;
|
4227 |
+
}
|
4228 |
+
else
|
4229 |
+
{
|
4230 |
+
m = ['carouFredSel'+s+':', m];
|
4231 |
+
}
|
4232 |
+
window.console.log(m);
|
4233 |
+
}
|
4234 |
+
return false;
|
4235 |
+
}
|
4236 |
+
|
4237 |
+
|
4238 |
+
|
4239 |
+
// EASING FUNCTIONS
|
4240 |
+
$.extend($.easing, {
|
4241 |
+
'quadratic': function(t) {
|
4242 |
+
var t2 = t * t;
|
4243 |
+
return t * (-t2 * t + 4 * t2 - 6 * t + 4);
|
4244 |
+
},
|
4245 |
+
'cubic': function(t) {
|
4246 |
+
return t * (4 * t * t - 9 * t + 6);
|
4247 |
+
},
|
4248 |
+
'elastic': function(t) {
|
4249 |
+
var t2 = t * t;
|
4250 |
+
return t * (33 * t2 * t2 - 106 * t2 * t + 126 * t2 - 67 * t + 15);
|
4251 |
+
}
|
4252 |
+
});
|
4253 |
+
|
4254 |
+
|
4255 |
+
})(jQuery);
|
assets/js/jquery.carouFredSel.min.js
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
* jQuery carouFredSel 6.2.1
|
3 |
+
* Demo's and documentation:
|
4 |
+
* caroufredsel.dev7studios.com
|
5 |
+
*
|
6 |
+
* Copyright (c) 2013 Fred Heusschen
|
7 |
+
* www.frebsite.nl
|
8 |
+
*
|
9 |
+
* Dual licensed under the MIT and GPL licenses.
|
10 |
+
* http://en.wikipedia.org/wiki/MIT_License
|
11 |
+
* http://en.wikipedia.org/wiki/GNU_General_Public_License
|
12 |
+
*/
|
13 |
+
|
14 |
+
|
15 |
+
(function($){function sc_setScroll(a,b,c){return"transition"==c.transition&&"swing"==b&&(b="ease"),{anims:[],duration:a,orgDuration:a,easing:b,startTime:getTime()}}function sc_startScroll(a,b){for(var c=0,d=a.anims.length;d>c;c++){var e=a.anims[c];e&&e[0][b.transition](e[1],a.duration,a.easing,e[2])}}function sc_stopScroll(a,b){is_boolean(b)||(b=!0),is_object(a.pre)&&sc_stopScroll(a.pre,b);for(var c=0,d=a.anims.length;d>c;c++){var e=a.anims[c];e[0].stop(!0),b&&(e[0].css(e[1]),is_function(e[2])&&e[2]())}is_object(a.post)&&sc_stopScroll(a.post,b)}function sc_afterScroll(a,b,c){switch(b&&b.remove(),c.fx){case"fade":case"crossfade":case"cover-fade":case"uncover-fade":a.css("opacity",1),a.css("filter","")}}function sc_fireCallbacks(a,b,c,d,e){if(b[c]&&b[c].call(a,d),e[c].length)for(var f=0,g=e[c].length;g>f;f++)e[c][f].call(a,d);return[]}function sc_fireQueue(a,b,c){return b.length&&(a.trigger(cf_e(b[0][0],c),b[0][1]),b.shift()),b}function sc_hideHiddenItems(a){a.each(function(){var a=$(this);a.data("_cfs_isHidden",a.is(":hidden")).hide()})}function sc_showHiddenItems(a){a&&a.each(function(){var a=$(this);a.data("_cfs_isHidden")||a.show()})}function sc_clearTimers(a){return a.auto&&clearTimeout(a.auto),a.progress&&clearInterval(a.progress),a}function sc_mapCallbackArguments(a,b,c,d,e,f,g){return{width:g.width,height:g.height,items:{old:a,skipped:b,visible:c},scroll:{items:d,direction:e,duration:f}}}function sc_getDuration(a,b,c,d){var e=a.duration;return"none"==a.fx?0:("auto"==e?e=b.scroll.duration/b.scroll.items*c:10>e&&(e=d/e),1>e?0:("fade"==a.fx&&(e/=2),Math.round(e)))}function nv_showNavi(a,b,c){var d=is_number(a.items.minimum)?a.items.minimum:a.items.visible+1;if("show"==b||"hide"==b)var e=b;else if(d>b){debug(c,"Not enough items ("+b+" total, "+d+" needed): Hiding navigation.");var e="hide"}else var e="show";var f="show"==e?"removeClass":"addClass",g=cf_c("hidden",c);a.auto.button&&a.auto.button[e]()[f](g),a.prev.button&&a.prev.button[e]()[f](g),a.next.button&&a.next.button[e]()[f](g),a.pagination.container&&a.pagination.container[e]()[f](g)}function nv_enableNavi(a,b,c){if(!a.circular&&!a.infinite){var d="removeClass"==b||"addClass"==b?b:!1,e=cf_c("disabled",c);if(a.auto.button&&d&&a.auto.button[d](e),a.prev.button){var f=d||0==b?"addClass":"removeClass";a.prev.button[f](e)}if(a.next.button){var f=d||b==a.items.visible?"addClass":"removeClass";a.next.button[f](e)}}}function go_getObject(a,b){return is_function(b)?b=b.call(a):is_undefined(b)&&(b={}),b}function go_getItemsObject(a,b){return b=go_getObject(a,b),is_number(b)?b={visible:b}:"variable"==b?b={visible:b,width:b,height:b}:is_object(b)||(b={}),b}function go_getScrollObject(a,b){return b=go_getObject(a,b),is_number(b)?b=50>=b?{items:b}:{duration:b}:is_string(b)?b={easing:b}:is_object(b)||(b={}),b}function go_getNaviObject(a,b){if(b=go_getObject(a,b),is_string(b)){var c=cf_getKeyCode(b);b=-1==c?$(b):c}return b}function go_getAutoObject(a,b){return b=go_getNaviObject(a,b),is_jquery(b)?b={button:b}:is_boolean(b)?b={play:b}:is_number(b)&&(b={timeoutDuration:b}),b.progress&&(is_string(b.progress)||is_jquery(b.progress))&&(b.progress={bar:b.progress}),b}function go_complementAutoObject(a,b){return is_function(b.button)&&(b.button=b.button.call(a)),is_string(b.button)&&(b.button=$(b.button)),is_boolean(b.play)||(b.play=!0),is_number(b.delay)||(b.delay=0),is_undefined(b.pauseOnEvent)&&(b.pauseOnEvent=!0),is_boolean(b.pauseOnResize)||(b.pauseOnResize=!0),is_number(b.timeoutDuration)||(b.timeoutDuration=10>b.duration?2500:5*b.duration),b.progress&&(is_function(b.progress.bar)&&(b.progress.bar=b.progress.bar.call(a)),is_string(b.progress.bar)&&(b.progress.bar=$(b.progress.bar)),b.progress.bar?(is_function(b.progress.updater)||(b.progress.updater=$.fn.carouFredSel.progressbarUpdater),is_number(b.progress.interval)||(b.progress.interval=50)):b.progress=!1),b}function go_getPrevNextObject(a,b){return b=go_getNaviObject(a,b),is_jquery(b)?b={button:b}:is_number(b)&&(b={key:b}),b}function go_complementPrevNextObject(a,b){return is_function(b.button)&&(b.button=b.button.call(a)),is_string(b.button)&&(b.button=$(b.button)),is_string(b.key)&&(b.key=cf_getKeyCode(b.key)),b}function go_getPaginationObject(a,b){return b=go_getNaviObject(a,b),is_jquery(b)?b={container:b}:is_boolean(b)&&(b={keys:b}),b}function go_complementPaginationObject(a,b){return is_function(b.container)&&(b.container=b.container.call(a)),is_string(b.container)&&(b.container=$(b.container)),is_number(b.items)||(b.items=!1),is_boolean(b.keys)||(b.keys=!1),is_function(b.anchorBuilder)||is_false(b.anchorBuilder)||(b.anchorBuilder=$.fn.carouFredSel.pageAnchorBuilder),is_number(b.deviation)||(b.deviation=0),b}function go_getSwipeObject(a,b){return is_function(b)&&(b=b.call(a)),is_undefined(b)&&(b={onTouch:!1}),is_true(b)?b={onTouch:b}:is_number(b)&&(b={items:b}),b}function go_complementSwipeObject(a,b){return is_boolean(b.onTouch)||(b.onTouch=!0),is_boolean(b.onMouse)||(b.onMouse=!1),is_object(b.options)||(b.options={}),is_boolean(b.options.triggerOnTouchEnd)||(b.options.triggerOnTouchEnd=!1),b}function go_getMousewheelObject(a,b){return is_function(b)&&(b=b.call(a)),is_true(b)?b={}:is_number(b)?b={items:b}:is_undefined(b)&&(b=!1),b}function go_complementMousewheelObject(a,b){return b}function gn_getItemIndex(a,b,c,d,e){if(is_string(a)&&(a=$(a,e)),is_object(a)&&(a=$(a,e)),is_jquery(a)?(a=e.children().index(a),is_boolean(c)||(c=!1)):is_boolean(c)||(c=!0),is_number(a)||(a=0),is_number(b)||(b=0),c&&(a+=d.first),a+=b,d.total>0){for(;a>=d.total;)a-=d.total;for(;0>a;)a+=d.total}return a}function gn_getVisibleItemsPrev(a,b,c){for(var d=0,e=0,f=c;f>=0;f--){var g=a.eq(f);if(d+=g.is(":visible")?g[b.d.outerWidth](!0):0,d>b.maxDimension)return e;0==f&&(f=a.length),e++}}function gn_getVisibleItemsPrevFilter(a,b,c){return gn_getItemsPrevFilter(a,b.items.filter,b.items.visibleConf.org,c)}function gn_getScrollItemsPrevFilter(a,b,c,d){return gn_getItemsPrevFilter(a,b.items.filter,d,c)}function gn_getItemsPrevFilter(a,b,c,d){for(var e=0,f=0,g=d,h=a.length;g>=0;g--){if(f++,f==h)return f;var i=a.eq(g);if(i.is(b)&&(e++,e==c))return f;0==g&&(g=h)}}function gn_getVisibleOrg(a,b){return b.items.visibleConf.org||a.children().slice(0,b.items.visible).filter(b.items.filter).length}function gn_getVisibleItemsNext(a,b,c){for(var d=0,e=0,f=c,g=a.length-1;g>=f;f++){var h=a.eq(f);if(d+=h.is(":visible")?h[b.d.outerWidth](!0):0,d>b.maxDimension)return e;if(e++,e==g+1)return e;f==g&&(f=-1)}}function gn_getVisibleItemsNextTestCircular(a,b,c,d){var e=gn_getVisibleItemsNext(a,b,c);return b.circular||c+e>d&&(e=d-c),e}function gn_getVisibleItemsNextFilter(a,b,c){return gn_getItemsNextFilter(a,b.items.filter,b.items.visibleConf.org,c,b.circular)}function gn_getScrollItemsNextFilter(a,b,c,d){return gn_getItemsNextFilter(a,b.items.filter,d+1,c,b.circular)-1}function gn_getItemsNextFilter(a,b,c,d){for(var f=0,g=0,h=d,i=a.length-1;i>=h;h++){if(g++,g>=i)return g;var j=a.eq(h);if(j.is(b)&&(f++,f==c))return g;h==i&&(h=-1)}}function gi_getCurrentItems(a,b){return a.slice(0,b.items.visible)}function gi_getOldItemsPrev(a,b,c){return a.slice(c,b.items.visibleConf.old+c)}function gi_getNewItemsPrev(a,b){return a.slice(0,b.items.visible)}function gi_getOldItemsNext(a,b){return a.slice(0,b.items.visibleConf.old)}function gi_getNewItemsNext(a,b,c){return a.slice(c,b.items.visible+c)}function sz_storeMargin(a,b,c){b.usePadding&&(is_string(c)||(c="_cfs_origCssMargin"),a.each(function(){var a=$(this),d=parseInt(a.css(b.d.marginRight),10);is_number(d)||(d=0),a.data(c,d)}))}function sz_resetMargin(a,b,c){if(b.usePadding){var d=is_boolean(c)?c:!1;is_number(c)||(c=0),sz_storeMargin(a,b,"_cfs_tempCssMargin"),a.each(function(){var a=$(this);a.css(b.d.marginRight,d?a.data("_cfs_tempCssMargin"):c+a.data("_cfs_origCssMargin"))})}}function sz_storeOrigCss(a){a.each(function(){var a=$(this);a.data("_cfs_origCss",a.attr("style")||"")})}function sz_restoreOrigCss(a){a.each(function(){var a=$(this);a.attr("style",a.data("_cfs_origCss")||"")})}function sz_setResponsiveSizes(a,b){var d=(a.items.visible,a.items[a.d.width]),e=a[a.d.height],f=is_percentage(e);b.each(function(){var b=$(this),c=d-ms_getPaddingBorderMargin(b,a,"Width");b[a.d.width](c),f&&b[a.d.height](ms_getPercentage(c,e))})}function sz_setSizes(a,b){var c=a.parent(),d=a.children(),e=gi_getCurrentItems(d,b),f=cf_mapWrapperSizes(ms_getSizes(e,b,!0),b,!1);if(c.css(f),b.usePadding){var g=b.padding,h=g[b.d[1]];b.align&&0>h&&(h=0);var i=e.last();i.css(b.d.marginRight,i.data("_cfs_origCssMargin")+h),a.css(b.d.top,g[b.d[0]]),a.css(b.d.left,g[b.d[3]])}return a.css(b.d.width,f[b.d.width]+2*ms_getTotalSize(d,b,"width")),a.css(b.d.height,ms_getLargestSize(d,b,"height")),f}function ms_getSizes(a,b,c){return[ms_getTotalSize(a,b,"width",c),ms_getLargestSize(a,b,"height",c)]}function ms_getLargestSize(a,b,c,d){return is_boolean(d)||(d=!1),is_number(b[b.d[c]])&&d?b[b.d[c]]:is_number(b.items[b.d[c]])?b.items[b.d[c]]:(c=c.toLowerCase().indexOf("width")>-1?"outerWidth":"outerHeight",ms_getTrueLargestSize(a,b,c))}function ms_getTrueLargestSize(a,b,c){for(var d=0,e=0,f=a.length;f>e;e++){var g=a.eq(e),h=g.is(":visible")?g[b.d[c]](!0):0;h>d&&(d=h)}return d}function ms_getTotalSize(a,b,c,d){if(is_boolean(d)||(d=!1),is_number(b[b.d[c]])&&d)return b[b.d[c]];if(is_number(b.items[b.d[c]]))return b.items[b.d[c]]*a.length;for(var e=c.toLowerCase().indexOf("width")>-1?"outerWidth":"outerHeight",f=0,g=0,h=a.length;h>g;g++){var i=a.eq(g);f+=i.is(":visible")?i[b.d[e]](!0):0}return f}function ms_getParentSize(a,b,c){var d=a.is(":visible");d&&a.hide();var e=a.parent()[b.d[c]]();return d&&a.show(),e}function ms_getMaxDimension(a,b){return is_number(a[a.d.width])?a[a.d.width]:b}function ms_hasVariableSizes(a,b,c){for(var d=!1,e=!1,f=0,g=a.length;g>f;f++){var h=a.eq(f),i=h.is(":visible")?h[b.d[c]](!0):0;d===!1?d=i:d!=i&&(e=!0),0==d&&(e=!0)}return e}function ms_getPaddingBorderMargin(a,b,c){return a[b.d["outer"+c]](!0)-a[b.d[c.toLowerCase()]]()}function ms_getPercentage(a,b){if(is_percentage(b)){if(b=parseInt(b.slice(0,-1),10),!is_number(b))return a;a*=b/100}return a}function cf_e(a,b,c,d,e){return is_boolean(c)||(c=!0),is_boolean(d)||(d=!0),is_boolean(e)||(e=!1),c&&(a=b.events.prefix+a),d&&(a=a+"."+b.events.namespace),d&&e&&(a+=b.serialNumber),a}function cf_c(a,b){return is_string(b.classnames[a])?b.classnames[a]:a}function cf_mapWrapperSizes(a,b,c){is_boolean(c)||(c=!0);var d=b.usePadding&&c?b.padding:[0,0,0,0],e={};return e[b.d.width]=a[0]+d[1]+d[3],e[b.d.height]=a[1]+d[0]+d[2],e}function cf_sortParams(a,b){for(var c=[],d=0,e=a.length;e>d;d++)for(var f=0,g=b.length;g>f;f++)if(b[f].indexOf(typeof a[d])>-1&&is_undefined(c[f])){c[f]=a[d];break}return c}function cf_getPadding(a){if(is_undefined(a))return[0,0,0,0];if(is_number(a))return[a,a,a,a];if(is_string(a)&&(a=a.split("px").join("").split("em").join("").split(" ")),!is_array(a))return[0,0,0,0];for(var b=0;4>b;b++)a[b]=parseInt(a[b],10);switch(a.length){case 0:return[0,0,0,0];case 1:return[a[0],a[0],a[0],a[0]];case 2:return[a[0],a[1],a[0],a[1]];case 3:return[a[0],a[1],a[2],a[1]];default:return[a[0],a[1],a[2],a[3]]}}function cf_getAlignPadding(a,b){var c=is_number(b[b.d.width])?Math.ceil(b[b.d.width]-ms_getTotalSize(a,b,"width")):0;switch(b.align){case"left":return[0,c];case"right":return[c,0];case"center":default:return[Math.ceil(c/2),Math.floor(c/2)]}}function cf_getDimensions(a){for(var b=[["width","innerWidth","outerWidth","height","innerHeight","outerHeight","left","top","marginRight",0,1,2,3],["height","innerHeight","outerHeight","width","innerWidth","outerWidth","top","left","marginBottom",3,2,1,0]],c=b[0].length,d="right"==a.direction||"left"==a.direction?0:1,e={},f=0;c>f;f++)e[b[0][f]]=b[d][f];return e}function cf_getAdjust(a,b,c,d){var e=a;if(is_function(c))e=c.call(d,e);else if(is_string(c)){var f=c.split("+"),g=c.split("-");if(g.length>f.length)var h=!0,i=g[0],j=g[1];else var h=!1,i=f[0],j=f[1];switch(i){case"even":e=1==a%2?a-1:a;break;case"odd":e=0==a%2?a-1:a;break;default:e=a}j=parseInt(j,10),is_number(j)&&(h&&(j=-j),e+=j)}return(!is_number(e)||1>e)&&(e=1),e}function cf_getItemsAdjust(a,b,c,d){return cf_getItemAdjustMinMax(cf_getAdjust(a,b,c,d),b.items.visibleConf)}function cf_getItemAdjustMinMax(a,b){return is_number(b.min)&&b.min>a&&(a=b.min),is_number(b.max)&&a>b.max&&(a=b.max),1>a&&(a=1),a}function cf_getSynchArr(a){is_array(a)||(a=[[a]]),is_array(a[0])||(a=[a]);for(var b=0,c=a.length;c>b;b++)is_string(a[b][0])&&(a[b][0]=$(a[b][0])),is_boolean(a[b][1])||(a[b][1]=!0),is_boolean(a[b][2])||(a[b][2]=!0),is_number(a[b][3])||(a[b][3]=0);return a}function cf_getKeyCode(a){return"right"==a?39:"left"==a?37:"up"==a?38:"down"==a?40:-1}function cf_setCookie(a,b,c){if(a){var d=b.triggerHandler(cf_e("currentPosition",c));$.fn.carouFredSel.cookie.set(a,d)}}function cf_getCookie(a){var b=$.fn.carouFredSel.cookie.get(a);return""==b?0:b}function in_mapCss(a,b){for(var c={},d=0,e=b.length;e>d;d++)c[b[d]]=a.css(b[d]);return c}function in_complementItems(a,b,c,d){return is_object(a.visibleConf)||(a.visibleConf={}),is_object(a.sizesConf)||(a.sizesConf={}),0==a.start&&is_number(d)&&(a.start=d),is_object(a.visible)?(a.visibleConf.min=a.visible.min,a.visibleConf.max=a.visible.max,a.visible=!1):is_string(a.visible)?("variable"==a.visible?a.visibleConf.variable=!0:a.visibleConf.adjust=a.visible,a.visible=!1):is_function(a.visible)&&(a.visibleConf.adjust=a.visible,a.visible=!1),is_string(a.filter)||(a.filter=c.filter(":hidden").length>0?":visible":"*"),a[b.d.width]||(b.responsive?(debug(!0,"Set a "+b.d.width+" for the items!"),a[b.d.width]=ms_getTrueLargestSize(c,b,"outerWidth")):a[b.d.width]=ms_hasVariableSizes(c,b,"outerWidth")?"variable":c[b.d.outerWidth](!0)),a[b.d.height]||(a[b.d.height]=ms_hasVariableSizes(c,b,"outerHeight")?"variable":c[b.d.outerHeight](!0)),a.sizesConf.width=a.width,a.sizesConf.height=a.height,a}function in_complementVisibleItems(a,b){return"variable"==a.items[a.d.width]&&(a.items.visibleConf.variable=!0),a.items.visibleConf.variable||(is_number(a[a.d.width])?a.items.visible=Math.floor(a[a.d.width]/a.items[a.d.width]):(a.items.visible=Math.floor(b/a.items[a.d.width]),a[a.d.width]=a.items.visible*a.items[a.d.width],a.items.visibleConf.adjust||(a.align=!1)),("Infinity"==a.items.visible||1>a.items.visible)&&(debug(!0,'Not a valid number of visible items: Set to "variable".'),a.items.visibleConf.variable=!0)),a}function in_complementPrimarySize(a,b,c){return"auto"==a&&(a=ms_getTrueLargestSize(c,b,"outerWidth")),a}function in_complementSecondarySize(a,b,c){return"auto"==a&&(a=ms_getTrueLargestSize(c,b,"outerHeight")),a||(a=b.items[b.d.height]),a}function in_getAlignPadding(a,b){var c=cf_getAlignPadding(gi_getCurrentItems(b,a),a);return a.padding[a.d[1]]=c[1],a.padding[a.d[3]]=c[0],a}function in_getResponsiveValues(a,b){var d=cf_getItemAdjustMinMax(Math.ceil(a[a.d.width]/a.items[a.d.width]),a.items.visibleConf);d>b.length&&(d=b.length);var e=Math.floor(a[a.d.width]/d);return a.items.visible=d,a.items[a.d.width]=e,a[a.d.width]=d*e,a}function bt_pauseOnHoverConfig(a){if(is_string(a))var b=a.indexOf("immediate")>-1?!0:!1,c=a.indexOf("resume")>-1?!0:!1;else var b=c=!1;return[b,c]}function bt_mousesheelNumber(a){return is_number(a)?a:null}function is_null(a){return null===a}function is_undefined(a){return is_null(a)||a===void 0||""===a||"undefined"===a}function is_array(a){return a instanceof Array}function is_jquery(a){return a instanceof jQuery}function is_object(a){return(a instanceof Object||"object"==typeof a)&&!is_null(a)&&!is_jquery(a)&&!is_array(a)&&!is_function(a)}function is_number(a){return(a instanceof Number||"number"==typeof a)&&!isNaN(a)}function is_string(a){return(a instanceof String||"string"==typeof a)&&!is_undefined(a)&&!is_true(a)&&!is_false(a)}function is_function(a){return a instanceof Function||"function"==typeof a}function is_boolean(a){return a instanceof Boolean||"boolean"==typeof a||is_true(a)||is_false(a)}function is_true(a){return a===!0||"true"===a}function is_false(a){return a===!1||"false"===a}function is_percentage(a){return is_string(a)&&"%"==a.slice(-1)}function getTime(){return(new Date).getTime()}function deprecated(a,b){debug(!0,a+" is DEPRECATED, support for it will be removed. Use "+b+" instead.")}function debug(a,b){if(!is_undefined(window.console)&&!is_undefined(window.console.log)){if(is_object(a)){var c=" ("+a.selector+")";a=a.debug}else var c="";if(!a)return!1;b=is_string(b)?"carouFredSel"+c+": "+b:["carouFredSel"+c+":",b],window.console.log(b)}return!1}$.fn.carouFredSel||($.fn.caroufredsel=$.fn.carouFredSel=function(options,configs){if(0==this.length)return debug(!0,'No element found for "'+this.selector+'".'),this;if(this.length>1)return this.each(function(){$(this).carouFredSel(options,configs)});var $cfs=this,$tt0=this[0],starting_position=!1;$cfs.data("_cfs_isCarousel")&&(starting_position=$cfs.triggerHandler("_cfs_triggerEvent","currentPosition"),$cfs.trigger("_cfs_triggerEvent",["destroy",!0]));var FN={};FN._init=function(a,b,c){a=go_getObject($tt0,a),a.items=go_getItemsObject($tt0,a.items),a.scroll=go_getScrollObject($tt0,a.scroll),a.auto=go_getAutoObject($tt0,a.auto),a.prev=go_getPrevNextObject($tt0,a.prev),a.next=go_getPrevNextObject($tt0,a.next),a.pagination=go_getPaginationObject($tt0,a.pagination),a.swipe=go_getSwipeObject($tt0,a.swipe),a.mousewheel=go_getMousewheelObject($tt0,a.mousewheel),b&&(opts_orig=$.extend(!0,{},$.fn.carouFredSel.defaults,a)),opts=$.extend(!0,{},$.fn.carouFredSel.defaults,a),opts.d=cf_getDimensions(opts),crsl.direction="up"==opts.direction||"left"==opts.direction?"next":"prev";var d=$cfs.children(),e=ms_getParentSize($wrp,opts,"width");if(is_true(opts.cookie)&&(opts.cookie="caroufredsel_cookie_"+conf.serialNumber),opts.maxDimension=ms_getMaxDimension(opts,e),opts.items=in_complementItems(opts.items,opts,d,c),opts[opts.d.width]=in_complementPrimarySize(opts[opts.d.width],opts,d),opts[opts.d.height]=in_complementSecondarySize(opts[opts.d.height],opts,d),opts.responsive&&(is_percentage(opts[opts.d.width])||(opts[opts.d.width]="100%")),is_percentage(opts[opts.d.width])&&(crsl.upDateOnWindowResize=!0,crsl.primarySizePercentage=opts[opts.d.width],opts[opts.d.width]=ms_getPercentage(e,crsl.primarySizePercentage),opts.items.visible||(opts.items.visibleConf.variable=!0)),opts.responsive?(opts.usePadding=!1,opts.padding=[0,0,0,0],opts.align=!1,opts.items.visibleConf.variable=!1):(opts.items.visible||(opts=in_complementVisibleItems(opts,e)),opts[opts.d.width]||(!opts.items.visibleConf.variable&&is_number(opts.items[opts.d.width])&&"*"==opts.items.filter?(opts[opts.d.width]=opts.items.visible*opts.items[opts.d.width],opts.align=!1):opts[opts.d.width]="variable"),is_undefined(opts.align)&&(opts.align=is_number(opts[opts.d.width])?"center":!1),opts.items.visibleConf.variable&&(opts.items.visible=gn_getVisibleItemsNext(d,opts,0))),"*"==opts.items.filter||opts.items.visibleConf.variable||(opts.items.visibleConf.org=opts.items.visible,opts.items.visible=gn_getVisibleItemsNextFilter(d,opts,0)),opts.items.visible=cf_getItemsAdjust(opts.items.visible,opts,opts.items.visibleConf.adjust,$tt0),opts.items.visibleConf.old=opts.items.visible,opts.responsive)opts.items.visibleConf.min||(opts.items.visibleConf.min=opts.items.visible),opts.items.visibleConf.max||(opts.items.visibleConf.max=opts.items.visible),opts=in_getResponsiveValues(opts,d,e);else switch(opts.padding=cf_getPadding(opts.padding),"top"==opts.align?opts.align="left":"bottom"==opts.align&&(opts.align="right"),opts.align){case"center":case"left":case"right":"variable"!=opts[opts.d.width]&&(opts=in_getAlignPadding(opts,d),opts.usePadding=!0);break;default:opts.align=!1,opts.usePadding=0==opts.padding[0]&&0==opts.padding[1]&&0==opts.padding[2]&&0==opts.padding[3]?!1:!0}is_number(opts.scroll.duration)||(opts.scroll.duration=500),is_undefined(opts.scroll.items)&&(opts.scroll.items=opts.responsive||opts.items.visibleConf.variable||"*"!=opts.items.filter?"visible":opts.items.visible),opts.auto=$.extend(!0,{},opts.scroll,opts.auto),opts.prev=$.extend(!0,{},opts.scroll,opts.prev),opts.next=$.extend(!0,{},opts.scroll,opts.next),opts.pagination=$.extend(!0,{},opts.scroll,opts.pagination),opts.auto=go_complementAutoObject($tt0,opts.auto),opts.prev=go_complementPrevNextObject($tt0,opts.prev),opts.next=go_complementPrevNextObject($tt0,opts.next),opts.pagination=go_complementPaginationObject($tt0,opts.pagination),opts.swipe=go_complementSwipeObject($tt0,opts.swipe),opts.mousewheel=go_complementMousewheelObject($tt0,opts.mousewheel),opts.synchronise&&(opts.synchronise=cf_getSynchArr(opts.synchronise)),opts.auto.onPauseStart&&(opts.auto.onTimeoutStart=opts.auto.onPauseStart,deprecated("auto.onPauseStart","auto.onTimeoutStart")),opts.auto.onPausePause&&(opts.auto.onTimeoutPause=opts.auto.onPausePause,deprecated("auto.onPausePause","auto.onTimeoutPause")),opts.auto.onPauseEnd&&(opts.auto.onTimeoutEnd=opts.auto.onPauseEnd,deprecated("auto.onPauseEnd","auto.onTimeoutEnd")),opts.auto.pauseDuration&&(opts.auto.timeoutDuration=opts.auto.pauseDuration,deprecated("auto.pauseDuration","auto.timeoutDuration"))},FN._build=function(){$cfs.data("_cfs_isCarousel",!0);var a=$cfs.children(),b=in_mapCss($cfs,["textAlign","float","position","top","right","bottom","left","zIndex","width","height","marginTop","marginRight","marginBottom","marginLeft"]),c="relative";switch(b.position){case"absolute":case"fixed":c=b.position}"parent"==conf.wrapper?sz_storeOrigCss($wrp):$wrp.css(b),$wrp.css({overflow:"hidden",position:c}),sz_storeOrigCss($cfs),$cfs.data("_cfs_origCssZindex",b.zIndex),$cfs.css({textAlign:"left","float":"none",position:"absolute",top:0,right:"auto",bottom:"auto",left:0,marginTop:0,marginRight:0,marginBottom:0,marginLeft:0}),sz_storeMargin(a,opts),sz_storeOrigCss(a),opts.responsive&&sz_setResponsiveSizes(opts,a)},FN._bind_events=function(){FN._unbind_events(),$cfs.bind(cf_e("stop",conf),function(a,b){return a.stopPropagation(),crsl.isStopped||opts.auto.button&&opts.auto.button.addClass(cf_c("stopped",conf)),crsl.isStopped=!0,opts.auto.play&&(opts.auto.play=!1,$cfs.trigger(cf_e("pause",conf),b)),!0}),$cfs.bind(cf_e("finish",conf),function(a){return a.stopPropagation(),crsl.isScrolling&&sc_stopScroll(scrl),!0}),$cfs.bind(cf_e("pause",conf),function(a,b,c){if(a.stopPropagation(),tmrs=sc_clearTimers(tmrs),b&&crsl.isScrolling){scrl.isStopped=!0;var d=getTime()-scrl.startTime;scrl.duration-=d,scrl.pre&&(scrl.pre.duration-=d),scrl.post&&(scrl.post.duration-=d),sc_stopScroll(scrl,!1)}if(crsl.isPaused||crsl.isScrolling||c&&(tmrs.timePassed+=getTime()-tmrs.startTime),crsl.isPaused||opts.auto.button&&opts.auto.button.addClass(cf_c("paused",conf)),crsl.isPaused=!0,opts.auto.onTimeoutPause){var e=opts.auto.timeoutDuration-tmrs.timePassed,f=100-Math.ceil(100*e/opts.auto.timeoutDuration);opts.auto.onTimeoutPause.call($tt0,f,e)}return!0}),$cfs.bind(cf_e("play",conf),function(a,b,c,d){a.stopPropagation(),tmrs=sc_clearTimers(tmrs);var e=[b,c,d],f=["string","number","boolean"],g=cf_sortParams(e,f);if(b=g[0],c=g[1],d=g[2],"prev"!=b&&"next"!=b&&(b=crsl.direction),is_number(c)||(c=0),is_boolean(d)||(d=!1),d&&(crsl.isStopped=!1,opts.auto.play=!0),!opts.auto.play)return a.stopImmediatePropagation(),debug(conf,"Carousel stopped: Not scrolling.");crsl.isPaused&&opts.auto.button&&(opts.auto.button.removeClass(cf_c("stopped",conf)),opts.auto.button.removeClass(cf_c("paused",conf))),crsl.isPaused=!1,tmrs.startTime=getTime();var h=opts.auto.timeoutDuration+c;return dur2=h-tmrs.timePassed,perc=100-Math.ceil(100*dur2/h),opts.auto.progress&&(tmrs.progress=setInterval(function(){var a=getTime()-tmrs.startTime+tmrs.timePassed,b=Math.ceil(100*a/h);opts.auto.progress.updater.call(opts.auto.progress.bar[0],b)},opts.auto.progress.interval)),tmrs.auto=setTimeout(function(){opts.auto.progress&&opts.auto.progress.updater.call(opts.auto.progress.bar[0],100),opts.auto.onTimeoutEnd&&opts.auto.onTimeoutEnd.call($tt0,perc,dur2),crsl.isScrolling?$cfs.trigger(cf_e("play",conf),b):$cfs.trigger(cf_e(b,conf),opts.auto)},dur2),opts.auto.onTimeoutStart&&opts.auto.onTimeoutStart.call($tt0,perc,dur2),!0}),$cfs.bind(cf_e("resume",conf),function(a){return a.stopPropagation(),scrl.isStopped?(scrl.isStopped=!1,crsl.isPaused=!1,crsl.isScrolling=!0,scrl.startTime=getTime(),sc_startScroll(scrl,conf)):$cfs.trigger(cf_e("play",conf)),!0}),$cfs.bind(cf_e("prev",conf)+" "+cf_e("next",conf),function(a,b,c,d,e){if(a.stopPropagation(),crsl.isStopped||$cfs.is(":hidden"))return a.stopImmediatePropagation(),debug(conf,"Carousel stopped or hidden: Not scrolling.");var f=is_number(opts.items.minimum)?opts.items.minimum:opts.items.visible+1;if(f>itms.total)return a.stopImmediatePropagation(),debug(conf,"Not enough items ("+itms.total+" total, "+f+" needed): Not scrolling.");var g=[b,c,d,e],h=["object","number/string","function","boolean"],i=cf_sortParams(g,h);b=i[0],c=i[1],d=i[2],e=i[3];var j=a.type.slice(conf.events.prefix.length);if(is_object(b)||(b={}),is_function(d)&&(b.onAfter=d),is_boolean(e)&&(b.queue=e),b=$.extend(!0,{},opts[j],b),b.conditions&&!b.conditions.call($tt0,j))return a.stopImmediatePropagation(),debug(conf,'Callback "conditions" returned false.');if(!is_number(c)){if("*"!=opts.items.filter)c="visible";else for(var k=[c,b.items,opts[j].items],i=0,l=k.length;l>i;i++)if(is_number(k[i])||"page"==k[i]||"visible"==k[i]){c=k[i];break}switch(c){case"page":return a.stopImmediatePropagation(),$cfs.triggerHandler(cf_e(j+"Page",conf),[b,d]);case"visible":opts.items.visibleConf.variable||"*"!=opts.items.filter||(c=opts.items.visible)}}if(scrl.isStopped)return $cfs.trigger(cf_e("resume",conf)),$cfs.trigger(cf_e("queue",conf),[j,[b,c,d]]),a.stopImmediatePropagation(),debug(conf,"Carousel resumed scrolling.");if(b.duration>0&&crsl.isScrolling)return b.queue&&("last"==b.queue&&(queu=[]),("first"!=b.queue||0==queu.length)&&$cfs.trigger(cf_e("queue",conf),[j,[b,c,d]])),a.stopImmediatePropagation(),debug(conf,"Carousel currently scrolling.");if(tmrs.timePassed=0,$cfs.trigger(cf_e("slide_"+j,conf),[b,c]),opts.synchronise)for(var m=opts.synchronise,n=[b,c],o=0,l=m.length;l>o;o++){var p=j;m[o][2]||(p="prev"==p?"next":"prev"),m[o][1]||(n[0]=m[o][0].triggerHandler("_cfs_triggerEvent",["configuration",p])),n[1]=c+m[o][3],m[o][0].trigger("_cfs_triggerEvent",["slide_"+p,n])}return!0}),$cfs.bind(cf_e("slide_prev",conf),function(a,b,c){a.stopPropagation();var d=$cfs.children();if(!opts.circular&&0==itms.first)return opts.infinite&&$cfs.trigger(cf_e("next",conf),itms.total-1),a.stopImmediatePropagation();if(sz_resetMargin(d,opts),!is_number(c)){if(opts.items.visibleConf.variable)c=gn_getVisibleItemsPrev(d,opts,itms.total-1);else if("*"!=opts.items.filter){var e=is_number(b.items)?b.items:gn_getVisibleOrg($cfs,opts);c=gn_getScrollItemsPrevFilter(d,opts,itms.total-1,e)}else c=opts.items.visible;c=cf_getAdjust(c,opts,b.items,$tt0)}if(opts.circular||itms.total-c<itms.first&&(c=itms.total-itms.first),opts.items.visibleConf.old=opts.items.visible,opts.items.visibleConf.variable){var f=cf_getItemsAdjust(gn_getVisibleItemsNext(d,opts,itms.total-c),opts,opts.items.visibleConf.adjust,$tt0);f>=opts.items.visible+c&&itms.total>c&&(c++,f=cf_getItemsAdjust(gn_getVisibleItemsNext(d,opts,itms.total-c),opts,opts.items.visibleConf.adjust,$tt0)),opts.items.visible=f}else if("*"!=opts.items.filter){var f=gn_getVisibleItemsNextFilter(d,opts,itms.total-c);opts.items.visible=cf_getItemsAdjust(f,opts,opts.items.visibleConf.adjust,$tt0)}if(sz_resetMargin(d,opts,!0),0==c)return a.stopImmediatePropagation(),debug(conf,"0 items to scroll: Not scrolling.");for(debug(conf,"Scrolling "+c+" items backward."),itms.first+=c;itms.first>=itms.total;)itms.first-=itms.total;opts.circular||(0==itms.first&&b.onEnd&&b.onEnd.call($tt0,"prev"),opts.infinite||nv_enableNavi(opts,itms.first,conf)),$cfs.children().slice(itms.total-c,itms.total).prependTo($cfs),itms.total<opts.items.visible+c&&$cfs.children().slice(0,opts.items.visible+c-itms.total).clone(!0).appendTo($cfs);var d=$cfs.children(),g=gi_getOldItemsPrev(d,opts,c),h=gi_getNewItemsPrev(d,opts),i=d.eq(c-1),j=g.last(),k=h.last();sz_resetMargin(d,opts);var l=0,m=0;if(opts.align){var n=cf_getAlignPadding(h,opts);l=n[0],m=n[1]}var o=0>l?opts.padding[opts.d[3]]:0,p=!1,q=$();if(c>opts.items.visible&&(q=d.slice(opts.items.visibleConf.old,c),"directscroll"==b.fx)){var r=opts.items[opts.d.width];p=q,i=k,sc_hideHiddenItems(p),opts.items[opts.d.width]="variable"}var s=!1,t=ms_getTotalSize(d.slice(0,c),opts,"width"),u=cf_mapWrapperSizes(ms_getSizes(h,opts,!0),opts,!opts.usePadding),v=0,w={},x={},y={},z={},A={},B={},C={},D=sc_getDuration(b,opts,c,t);switch(b.fx){case"cover":case"cover-fade":v=ms_getTotalSize(d.slice(0,opts.items.visible),opts,"width")}p&&(opts.items[opts.d.width]=r),sz_resetMargin(d,opts,!0),m>=0&&sz_resetMargin(j,opts,opts.padding[opts.d[1]]),l>=0&&sz_resetMargin(i,opts,opts.padding[opts.d[3]]),opts.align&&(opts.padding[opts.d[1]]=m,opts.padding[opts.d[3]]=l),B[opts.d.left]=-(t-o),C[opts.d.left]=-(v-o),x[opts.d.left]=u[opts.d.width];var E=function(){},F=function(){},G=function(){},H=function(){},I=function(){},J=function(){},K=function(){},L=function(){},M=function(){},N=function(){},O=function(){};switch(b.fx){case"crossfade":case"cover":case"cover-fade":case"uncover":case"uncover-fade":s=$cfs.clone(!0).appendTo($wrp)}switch(b.fx){case"crossfade":case"uncover":case"uncover-fade":s.children().slice(0,c).remove(),s.children().slice(opts.items.visibleConf.old).remove();break;case"cover":case"cover-fade":s.children().slice(opts.items.visible).remove(),s.css(C)}if($cfs.css(B),scrl=sc_setScroll(D,b.easing,conf),w[opts.d.left]=opts.usePadding?opts.padding[opts.d[3]]:0,("variable"==opts[opts.d.width]||"variable"==opts[opts.d.height])&&(E=function(){$wrp.css(u)},F=function(){scrl.anims.push([$wrp,u])}),opts.usePadding){switch(k.not(i).length&&(y[opts.d.marginRight]=i.data("_cfs_origCssMargin"),0>l?i.css(y):(K=function(){i.css(y)},L=function(){scrl.anims.push([i,y])})),b.fx){case"cover":case"cover-fade":s.children().eq(c-1).css(y)}k.not(j).length&&(z[opts.d.marginRight]=j.data("_cfs_origCssMargin"),G=function(){j.css(z)},H=function(){scrl.anims.push([j,z])}),m>=0&&(A[opts.d.marginRight]=k.data("_cfs_origCssMargin")+opts.padding[opts.d[1]],I=function(){k.css(A)},J=function(){scrl.anims.push([k,A])})}O=function(){$cfs.css(w)};var P=opts.items.visible+c-itms.total;N=function(){if(P>0&&($cfs.children().slice(itms.total).remove(),g=$($cfs.children().slice(itms.total-(opts.items.visible-P)).get().concat($cfs.children().slice(0,P).get()))),sc_showHiddenItems(p),opts.usePadding){var a=$cfs.children().eq(opts.items.visible+c-1);a.css(opts.d.marginRight,a.data("_cfs_origCssMargin"))}};var Q=sc_mapCallbackArguments(g,q,h,c,"prev",D,u);switch(M=function(){sc_afterScroll($cfs,s,b),crsl.isScrolling=!1,clbk.onAfter=sc_fireCallbacks($tt0,b,"onAfter",Q,clbk),queu=sc_fireQueue($cfs,queu,conf),crsl.isPaused||$cfs.trigger(cf_e("play",conf))},crsl.isScrolling=!0,tmrs=sc_clearTimers(tmrs),clbk.onBefore=sc_fireCallbacks($tt0,b,"onBefore",Q,clbk),b.fx){case"none":$cfs.css(w),E(),G(),I(),K(),O(),N(),M();break;case"fade":scrl.anims.push([$cfs,{opacity:0},function(){E(),G(),I(),K(),O(),N(),scrl=sc_setScroll(D,b.easing,conf),scrl.anims.push([$cfs,{opacity:1},M]),sc_startScroll(scrl,conf)}]);break;case"crossfade":$cfs.css({opacity:0}),scrl.anims.push([s,{opacity:0}]),scrl.anims.push([$cfs,{opacity:1},M]),F(),G(),I(),K(),O(),N();break;case"cover":scrl.anims.push([s,w,function(){G(),I(),K(),O(),N(),M()}]),F();break;case"cover-fade":scrl.anims.push([$cfs,{opacity:0}]),scrl.anims.push([s,w,function(){G(),I(),K(),O(),N(),M()}]),F();break;case"uncover":scrl.anims.push([s,x,M]),F(),G(),I(),K(),O(),N();break;case"uncover-fade":$cfs.css({opacity:0}),scrl.anims.push([$cfs,{opacity:1}]),scrl.anims.push([s,x,M]),F(),G(),I(),K(),O(),N();break;default:scrl.anims.push([$cfs,w,function(){N(),M()}]),F(),H(),J(),L()}return sc_startScroll(scrl,conf),cf_setCookie(opts.cookie,$cfs,conf),$cfs.trigger(cf_e("updatePageStatus",conf),[!1,u]),!0
|
16 |
+
}),$cfs.bind(cf_e("slide_next",conf),function(a,b,c){a.stopPropagation();var d=$cfs.children();if(!opts.circular&&itms.first==opts.items.visible)return opts.infinite&&$cfs.trigger(cf_e("prev",conf),itms.total-1),a.stopImmediatePropagation();if(sz_resetMargin(d,opts),!is_number(c)){if("*"!=opts.items.filter){var e=is_number(b.items)?b.items:gn_getVisibleOrg($cfs,opts);c=gn_getScrollItemsNextFilter(d,opts,0,e)}else c=opts.items.visible;c=cf_getAdjust(c,opts,b.items,$tt0)}var f=0==itms.first?itms.total:itms.first;if(!opts.circular){if(opts.items.visibleConf.variable)var g=gn_getVisibleItemsNext(d,opts,c),e=gn_getVisibleItemsPrev(d,opts,f-1);else var g=opts.items.visible,e=opts.items.visible;c+g>f&&(c=f-e)}if(opts.items.visibleConf.old=opts.items.visible,opts.items.visibleConf.variable){for(var g=cf_getItemsAdjust(gn_getVisibleItemsNextTestCircular(d,opts,c,f),opts,opts.items.visibleConf.adjust,$tt0);opts.items.visible-c>=g&&itms.total>c;)c++,g=cf_getItemsAdjust(gn_getVisibleItemsNextTestCircular(d,opts,c,f),opts,opts.items.visibleConf.adjust,$tt0);opts.items.visible=g}else if("*"!=opts.items.filter){var g=gn_getVisibleItemsNextFilter(d,opts,c);opts.items.visible=cf_getItemsAdjust(g,opts,opts.items.visibleConf.adjust,$tt0)}if(sz_resetMargin(d,opts,!0),0==c)return a.stopImmediatePropagation(),debug(conf,"0 items to scroll: Not scrolling.");for(debug(conf,"Scrolling "+c+" items forward."),itms.first-=c;0>itms.first;)itms.first+=itms.total;opts.circular||(itms.first==opts.items.visible&&b.onEnd&&b.onEnd.call($tt0,"next"),opts.infinite||nv_enableNavi(opts,itms.first,conf)),itms.total<opts.items.visible+c&&$cfs.children().slice(0,opts.items.visible+c-itms.total).clone(!0).appendTo($cfs);var d=$cfs.children(),h=gi_getOldItemsNext(d,opts),i=gi_getNewItemsNext(d,opts,c),j=d.eq(c-1),k=h.last(),l=i.last();sz_resetMargin(d,opts);var m=0,n=0;if(opts.align){var o=cf_getAlignPadding(i,opts);m=o[0],n=o[1]}var p=!1,q=$();if(c>opts.items.visibleConf.old&&(q=d.slice(opts.items.visibleConf.old,c),"directscroll"==b.fx)){var r=opts.items[opts.d.width];p=q,j=k,sc_hideHiddenItems(p),opts.items[opts.d.width]="variable"}var s=!1,t=ms_getTotalSize(d.slice(0,c),opts,"width"),u=cf_mapWrapperSizes(ms_getSizes(i,opts,!0),opts,!opts.usePadding),v=0,w={},x={},y={},z={},A={},B=sc_getDuration(b,opts,c,t);switch(b.fx){case"uncover":case"uncover-fade":v=ms_getTotalSize(d.slice(0,opts.items.visibleConf.old),opts,"width")}p&&(opts.items[opts.d.width]=r),opts.align&&0>opts.padding[opts.d[1]]&&(opts.padding[opts.d[1]]=0),sz_resetMargin(d,opts,!0),sz_resetMargin(k,opts,opts.padding[opts.d[1]]),opts.align&&(opts.padding[opts.d[1]]=n,opts.padding[opts.d[3]]=m),A[opts.d.left]=opts.usePadding?opts.padding[opts.d[3]]:0;var C=function(){},D=function(){},E=function(){},F=function(){},G=function(){},H=function(){},I=function(){},J=function(){},K=function(){};switch(b.fx){case"crossfade":case"cover":case"cover-fade":case"uncover":case"uncover-fade":s=$cfs.clone(!0).appendTo($wrp),s.children().slice(opts.items.visibleConf.old).remove()}switch(b.fx){case"crossfade":case"cover":case"cover-fade":$cfs.css("zIndex",1),s.css("zIndex",0)}if(scrl=sc_setScroll(B,b.easing,conf),w[opts.d.left]=-t,x[opts.d.left]=-v,0>m&&(w[opts.d.left]+=m),("variable"==opts[opts.d.width]||"variable"==opts[opts.d.height])&&(C=function(){$wrp.css(u)},D=function(){scrl.anims.push([$wrp,u])}),opts.usePadding){var L=l.data("_cfs_origCssMargin");n>=0&&(L+=opts.padding[opts.d[1]]),l.css(opts.d.marginRight,L),j.not(k).length&&(z[opts.d.marginRight]=k.data("_cfs_origCssMargin")),E=function(){k.css(z)},F=function(){scrl.anims.push([k,z])};var M=j.data("_cfs_origCssMargin");m>0&&(M+=opts.padding[opts.d[3]]),y[opts.d.marginRight]=M,G=function(){j.css(y)},H=function(){scrl.anims.push([j,y])}}K=function(){$cfs.css(A)};var N=opts.items.visible+c-itms.total;J=function(){N>0&&$cfs.children().slice(itms.total).remove();var a=$cfs.children().slice(0,c).appendTo($cfs).last();if(N>0&&(i=gi_getCurrentItems(d,opts)),sc_showHiddenItems(p),opts.usePadding){if(itms.total<opts.items.visible+c){var b=$cfs.children().eq(opts.items.visible-1);b.css(opts.d.marginRight,b.data("_cfs_origCssMargin")+opts.padding[opts.d[1]])}a.css(opts.d.marginRight,a.data("_cfs_origCssMargin"))}};var O=sc_mapCallbackArguments(h,q,i,c,"next",B,u);switch(I=function(){$cfs.css("zIndex",$cfs.data("_cfs_origCssZindex")),sc_afterScroll($cfs,s,b),crsl.isScrolling=!1,clbk.onAfter=sc_fireCallbacks($tt0,b,"onAfter",O,clbk),queu=sc_fireQueue($cfs,queu,conf),crsl.isPaused||$cfs.trigger(cf_e("play",conf))},crsl.isScrolling=!0,tmrs=sc_clearTimers(tmrs),clbk.onBefore=sc_fireCallbacks($tt0,b,"onBefore",O,clbk),b.fx){case"none":$cfs.css(w),C(),E(),G(),K(),J(),I();break;case"fade":scrl.anims.push([$cfs,{opacity:0},function(){C(),E(),G(),K(),J(),scrl=sc_setScroll(B,b.easing,conf),scrl.anims.push([$cfs,{opacity:1},I]),sc_startScroll(scrl,conf)}]);break;case"crossfade":$cfs.css({opacity:0}),scrl.anims.push([s,{opacity:0}]),scrl.anims.push([$cfs,{opacity:1},I]),D(),E(),G(),K(),J();break;case"cover":$cfs.css(opts.d.left,$wrp[opts.d.width]()),scrl.anims.push([$cfs,A,I]),D(),E(),G(),J();break;case"cover-fade":$cfs.css(opts.d.left,$wrp[opts.d.width]()),scrl.anims.push([s,{opacity:0}]),scrl.anims.push([$cfs,A,I]),D(),E(),G(),J();break;case"uncover":scrl.anims.push([s,x,I]),D(),E(),G(),K(),J();break;case"uncover-fade":$cfs.css({opacity:0}),scrl.anims.push([$cfs,{opacity:1}]),scrl.anims.push([s,x,I]),D(),E(),G(),K(),J();break;default:scrl.anims.push([$cfs,w,function(){K(),J(),I()}]),D(),F(),H()}return sc_startScroll(scrl,conf),cf_setCookie(opts.cookie,$cfs,conf),$cfs.trigger(cf_e("updatePageStatus",conf),[!1,u]),!0}),$cfs.bind(cf_e("slideTo",conf),function(a,b,c,d,e,f,g){a.stopPropagation();var h=[b,c,d,e,f,g],i=["string/number/object","number","boolean","object","string","function"],j=cf_sortParams(h,i);return e=j[3],f=j[4],g=j[5],b=gn_getItemIndex(j[0],j[1],j[2],itms,$cfs),0==b?!1:(is_object(e)||(e=!1),"prev"!=f&&"next"!=f&&(f=opts.circular?itms.total/2>=b?"next":"prev":0==itms.first||itms.first>b?"next":"prev"),"prev"==f&&(b=itms.total-b),$cfs.trigger(cf_e(f,conf),[e,b,g]),!0)}),$cfs.bind(cf_e("prevPage",conf),function(a,b,c){a.stopPropagation();var d=$cfs.triggerHandler(cf_e("currentPage",conf));return $cfs.triggerHandler(cf_e("slideToPage",conf),[d-1,b,"prev",c])}),$cfs.bind(cf_e("nextPage",conf),function(a,b,c){a.stopPropagation();var d=$cfs.triggerHandler(cf_e("currentPage",conf));return $cfs.triggerHandler(cf_e("slideToPage",conf),[d+1,b,"next",c])}),$cfs.bind(cf_e("slideToPage",conf),function(a,b,c,d,e){a.stopPropagation(),is_number(b)||(b=$cfs.triggerHandler(cf_e("currentPage",conf)));var f=opts.pagination.items||opts.items.visible,g=Math.ceil(itms.total/f)-1;return 0>b&&(b=g),b>g&&(b=0),$cfs.triggerHandler(cf_e("slideTo",conf),[b*f,0,!0,c,d,e])}),$cfs.bind(cf_e("jumpToStart",conf),function(a,b){if(a.stopPropagation(),b=b?gn_getItemIndex(b,0,!0,itms,$cfs):0,b+=itms.first,0!=b){if(itms.total>0)for(;b>itms.total;)b-=itms.total;$cfs.prepend($cfs.children().slice(b,itms.total))}return!0}),$cfs.bind(cf_e("synchronise",conf),function(a,b){if(a.stopPropagation(),b)b=cf_getSynchArr(b);else{if(!opts.synchronise)return debug(conf,"No carousel to synchronise.");b=opts.synchronise}for(var c=$cfs.triggerHandler(cf_e("currentPosition",conf)),d=!0,e=0,f=b.length;f>e;e++)b[e][0].triggerHandler(cf_e("slideTo",conf),[c,b[e][3],!0])||(d=!1);return d}),$cfs.bind(cf_e("queue",conf),function(a,b,c){return a.stopPropagation(),is_function(b)?b.call($tt0,queu):is_array(b)?queu=b:is_undefined(b)||queu.push([b,c]),queu}),$cfs.bind(cf_e("insertItem",conf),function(a,b,c,d,e){a.stopPropagation();var f=[b,c,d,e],g=["string/object","string/number/object","boolean","number"],h=cf_sortParams(f,g);if(b=h[0],c=h[1],d=h[2],e=h[3],is_object(b)&&!is_jquery(b)?b=$(b):is_string(b)&&(b=$(b)),!is_jquery(b)||0==b.length)return debug(conf,"Not a valid object.");is_undefined(c)&&(c="end"),sz_storeMargin(b,opts),sz_storeOrigCss(b);var i=c,j="before";"end"==c?d?(0==itms.first?(c=itms.total-1,j="after"):(c=itms.first,itms.first+=b.length),0>c&&(c=0)):(c=itms.total-1,j="after"):c=gn_getItemIndex(c,e,d,itms,$cfs);var k=$cfs.children().eq(c);return k.length?k[j](b):(debug(conf,"Correct insert-position not found! Appending item to the end."),$cfs.append(b)),"end"==i||d||itms.first>c&&(itms.first+=b.length),itms.total=$cfs.children().length,itms.first>=itms.total&&(itms.first-=itms.total),$cfs.trigger(cf_e("updateSizes",conf)),$cfs.trigger(cf_e("linkAnchors",conf)),!0}),$cfs.bind(cf_e("removeItem",conf),function(a,b,c,d){a.stopPropagation();var e=[b,c,d],f=["string/number/object","boolean","number"],g=cf_sortParams(e,f);if(b=g[0],c=g[1],d=g[2],b instanceof $&&b.length>1)return i=$(),b.each(function(){var e=$cfs.trigger(cf_e("removeItem",conf),[$(this),c,d]);e&&(i=i.add(e))}),i;if(is_undefined(b)||"end"==b)i=$cfs.children().last();else{b=gn_getItemIndex(b,d,c,itms,$cfs);var i=$cfs.children().eq(b);i.length&&itms.first>b&&(itms.first-=i.length)}return i&&i.length&&(i.detach(),itms.total=$cfs.children().length,$cfs.trigger(cf_e("updateSizes",conf))),i}),$cfs.bind(cf_e("onBefore",conf)+" "+cf_e("onAfter",conf),function(a,b){a.stopPropagation();var c=a.type.slice(conf.events.prefix.length);return is_array(b)&&(clbk[c]=b),is_function(b)&&clbk[c].push(b),clbk[c]}),$cfs.bind(cf_e("currentPosition",conf),function(a,b){if(a.stopPropagation(),0==itms.first)var c=0;else var c=itms.total-itms.first;return is_function(b)&&b.call($tt0,c),c}),$cfs.bind(cf_e("currentPage",conf),function(a,b){a.stopPropagation();var e,c=opts.pagination.items||opts.items.visible,d=Math.ceil(itms.total/c-1);return e=0==itms.first?0:itms.first<itms.total%c?0:itms.first!=c||opts.circular?Math.round((itms.total-itms.first)/c):d,0>e&&(e=0),e>d&&(e=d),is_function(b)&&b.call($tt0,e),e}),$cfs.bind(cf_e("currentVisible",conf),function(a,b){a.stopPropagation();var c=gi_getCurrentItems($cfs.children(),opts);return is_function(b)&&b.call($tt0,c),c}),$cfs.bind(cf_e("slice",conf),function(a,b,c,d){if(a.stopPropagation(),0==itms.total)return!1;var e=[b,c,d],f=["number","number","function"],g=cf_sortParams(e,f);if(b=is_number(g[0])?g[0]:0,c=is_number(g[1])?g[1]:itms.total,d=g[2],b+=itms.first,c+=itms.first,items.total>0){for(;b>itms.total;)b-=itms.total;for(;c>itms.total;)c-=itms.total;for(;0>b;)b+=itms.total;for(;0>c;)c+=itms.total}var i,h=$cfs.children();return i=c>b?h.slice(b,c):$(h.slice(b,itms.total).get().concat(h.slice(0,c).get())),is_function(d)&&d.call($tt0,i),i}),$cfs.bind(cf_e("isPaused",conf)+" "+cf_e("isStopped",conf)+" "+cf_e("isScrolling",conf),function(a,b){a.stopPropagation();var c=a.type.slice(conf.events.prefix.length),d=crsl[c];return is_function(b)&&b.call($tt0,d),d}),$cfs.bind(cf_e("configuration",conf),function(e,a,b,c){e.stopPropagation();var reInit=!1;if(is_function(a))a.call($tt0,opts);else if(is_object(a))opts_orig=$.extend(!0,{},opts_orig,a),b!==!1?reInit=!0:opts=$.extend(!0,{},opts,a);else if(!is_undefined(a))if(is_function(b)){var val=eval("opts."+a);is_undefined(val)&&(val=""),b.call($tt0,val)}else{if(is_undefined(b))return eval("opts."+a);"boolean"!=typeof c&&(c=!0),eval("opts_orig."+a+" = b"),c!==!1?reInit=!0:eval("opts."+a+" = b")}if(reInit){sz_resetMargin($cfs.children(),opts),FN._init(opts_orig),FN._bind_buttons();var sz=sz_setSizes($cfs,opts);$cfs.trigger(cf_e("updatePageStatus",conf),[!0,sz])}return opts}),$cfs.bind(cf_e("linkAnchors",conf),function(a,b,c){return a.stopPropagation(),is_undefined(b)?b=$("body"):is_string(b)&&(b=$(b)),is_jquery(b)&&0!=b.length?(is_string(c)||(c="a.caroufredsel"),b.find(c).each(function(){var a=this.hash||"";a.length>0&&-1!=$cfs.children().index($(a))&&$(this).unbind("click").click(function(b){b.preventDefault(),$cfs.trigger(cf_e("slideTo",conf),a)})}),!0):debug(conf,"Not a valid object.")}),$cfs.bind(cf_e("updatePageStatus",conf),function(a,b){if(a.stopPropagation(),opts.pagination.container){var d=opts.pagination.items||opts.items.visible,e=Math.ceil(itms.total/d);b&&(opts.pagination.anchorBuilder&&(opts.pagination.container.children().remove(),opts.pagination.container.each(function(){for(var a=0;e>a;a++){var b=$cfs.children().eq(gn_getItemIndex(a*d,0,!0,itms,$cfs));$(this).append(opts.pagination.anchorBuilder.call(b[0],a+1))}})),opts.pagination.container.each(function(){$(this).children().unbind(opts.pagination.event).each(function(a){$(this).bind(opts.pagination.event,function(b){b.preventDefault(),$cfs.trigger(cf_e("slideTo",conf),[a*d,-opts.pagination.deviation,!0,opts.pagination])})})}));var f=$cfs.triggerHandler(cf_e("currentPage",conf))+opts.pagination.deviation;return f>=e&&(f=0),0>f&&(f=e-1),opts.pagination.container.each(function(){$(this).children().removeClass(cf_c("selected",conf)).eq(f).addClass(cf_c("selected",conf))}),!0}}),$cfs.bind(cf_e("updateSizes",conf),function(){var b=opts.items.visible,c=$cfs.children(),d=ms_getParentSize($wrp,opts,"width");if(itms.total=c.length,crsl.primarySizePercentage?(opts.maxDimension=d,opts[opts.d.width]=ms_getPercentage(d,crsl.primarySizePercentage)):opts.maxDimension=ms_getMaxDimension(opts,d),opts.responsive?(opts.items.width=opts.items.sizesConf.width,opts.items.height=opts.items.sizesConf.height,opts=in_getResponsiveValues(opts,c,d),b=opts.items.visible,sz_setResponsiveSizes(opts,c)):opts.items.visibleConf.variable?b=gn_getVisibleItemsNext(c,opts,0):"*"!=opts.items.filter&&(b=gn_getVisibleItemsNextFilter(c,opts,0)),!opts.circular&&0!=itms.first&&b>itms.first){if(opts.items.visibleConf.variable)var e=gn_getVisibleItemsPrev(c,opts,itms.first)-itms.first;else if("*"!=opts.items.filter)var e=gn_getVisibleItemsPrevFilter(c,opts,itms.first)-itms.first;else var e=opts.items.visible-itms.first;debug(conf,"Preventing non-circular: sliding "+e+" items backward."),$cfs.trigger(cf_e("prev",conf),e)}opts.items.visible=cf_getItemsAdjust(b,opts,opts.items.visibleConf.adjust,$tt0),opts.items.visibleConf.old=opts.items.visible,opts=in_getAlignPadding(opts,c);var f=sz_setSizes($cfs,opts);return $cfs.trigger(cf_e("updatePageStatus",conf),[!0,f]),nv_showNavi(opts,itms.total,conf),nv_enableNavi(opts,itms.first,conf),f}),$cfs.bind(cf_e("destroy",conf),function(a,b){return a.stopPropagation(),tmrs=sc_clearTimers(tmrs),$cfs.data("_cfs_isCarousel",!1),$cfs.trigger(cf_e("finish",conf)),b&&$cfs.trigger(cf_e("jumpToStart",conf)),sz_restoreOrigCss($cfs.children()),sz_restoreOrigCss($cfs),FN._unbind_events(),FN._unbind_buttons(),"parent"==conf.wrapper?sz_restoreOrigCss($wrp):$wrp.replaceWith($cfs),!0}),$cfs.bind(cf_e("debug",conf),function(){return debug(conf,"Carousel width: "+opts.width),debug(conf,"Carousel height: "+opts.height),debug(conf,"Item widths: "+opts.items.width),debug(conf,"Item heights: "+opts.items.height),debug(conf,"Number of items visible: "+opts.items.visible),opts.auto.play&&debug(conf,"Number of items scrolled automatically: "+opts.auto.items),opts.prev.button&&debug(conf,"Number of items scrolled backward: "+opts.prev.items),opts.next.button&&debug(conf,"Number of items scrolled forward: "+opts.next.items),conf.debug}),$cfs.bind("_cfs_triggerEvent",function(a,b,c){return a.stopPropagation(),$cfs.triggerHandler(cf_e(b,conf),c)})},FN._unbind_events=function(){$cfs.unbind(cf_e("",conf)),$cfs.unbind(cf_e("",conf,!1)),$cfs.unbind("_cfs_triggerEvent")},FN._bind_buttons=function(){if(FN._unbind_buttons(),nv_showNavi(opts,itms.total,conf),nv_enableNavi(opts,itms.first,conf),opts.auto.pauseOnHover){var a=bt_pauseOnHoverConfig(opts.auto.pauseOnHover);$wrp.bind(cf_e("mouseenter",conf,!1),function(){$cfs.trigger(cf_e("pause",conf),a)}).bind(cf_e("mouseleave",conf,!1),function(){$cfs.trigger(cf_e("resume",conf))})}if(opts.auto.button&&opts.auto.button.bind(cf_e(opts.auto.event,conf,!1),function(a){a.preventDefault();var b=!1,c=null;crsl.isPaused?b="play":opts.auto.pauseOnEvent&&(b="pause",c=bt_pauseOnHoverConfig(opts.auto.pauseOnEvent)),b&&$cfs.trigger(cf_e(b,conf),c)}),opts.prev.button&&(opts.prev.button.bind(cf_e(opts.prev.event,conf,!1),function(a){a.preventDefault(),$cfs.trigger(cf_e("prev",conf))}),opts.prev.pauseOnHover)){var a=bt_pauseOnHoverConfig(opts.prev.pauseOnHover);opts.prev.button.bind(cf_e("mouseenter",conf,!1),function(){$cfs.trigger(cf_e("pause",conf),a)}).bind(cf_e("mouseleave",conf,!1),function(){$cfs.trigger(cf_e("resume",conf))})}if(opts.next.button&&(opts.next.button.bind(cf_e(opts.next.event,conf,!1),function(a){a.preventDefault(),$cfs.trigger(cf_e("next",conf))}),opts.next.pauseOnHover)){var a=bt_pauseOnHoverConfig(opts.next.pauseOnHover);opts.next.button.bind(cf_e("mouseenter",conf,!1),function(){$cfs.trigger(cf_e("pause",conf),a)}).bind(cf_e("mouseleave",conf,!1),function(){$cfs.trigger(cf_e("resume",conf))})}if(opts.pagination.container&&opts.pagination.pauseOnHover){var a=bt_pauseOnHoverConfig(opts.pagination.pauseOnHover);opts.pagination.container.bind(cf_e("mouseenter",conf,!1),function(){$cfs.trigger(cf_e("pause",conf),a)}).bind(cf_e("mouseleave",conf,!1),function(){$cfs.trigger(cf_e("resume",conf))})}if((opts.prev.key||opts.next.key)&&$(document).bind(cf_e("keyup",conf,!1,!0,!0),function(a){var b=a.keyCode;b==opts.next.key&&(a.preventDefault(),$cfs.trigger(cf_e("next",conf))),b==opts.prev.key&&(a.preventDefault(),$cfs.trigger(cf_e("prev",conf)))}),opts.pagination.keys&&$(document).bind(cf_e("keyup",conf,!1,!0,!0),function(a){var b=a.keyCode;b>=49&&58>b&&(b=(b-49)*opts.items.visible,itms.total>=b&&(a.preventDefault(),$cfs.trigger(cf_e("slideTo",conf),[b,0,!0,opts.pagination])))}),$.fn.swipe){var b="ontouchstart"in window;if(b&&opts.swipe.onTouch||!b&&opts.swipe.onMouse){var c=$.extend(!0,{},opts.prev,opts.swipe),d=$.extend(!0,{},opts.next,opts.swipe),e=function(){$cfs.trigger(cf_e("prev",conf),[c])},f=function(){$cfs.trigger(cf_e("next",conf),[d])};switch(opts.direction){case"up":case"down":opts.swipe.options.swipeUp=f,opts.swipe.options.swipeDown=e;break;default:opts.swipe.options.swipeLeft=f,opts.swipe.options.swipeRight=e}crsl.swipe&&$cfs.swipe("destroy"),$wrp.swipe(opts.swipe.options),$wrp.css("cursor","move"),crsl.swipe=!0}}if($.fn.mousewheel&&opts.mousewheel){var g=$.extend(!0,{},opts.prev,opts.mousewheel),h=$.extend(!0,{},opts.next,opts.mousewheel);crsl.mousewheel&&$wrp.unbind(cf_e("mousewheel",conf,!1)),$wrp.bind(cf_e("mousewheel",conf,!1),function(a,b){a.preventDefault(),b>0?$cfs.trigger(cf_e("prev",conf),[g]):$cfs.trigger(cf_e("next",conf),[h])}),crsl.mousewheel=!0}if(opts.auto.play&&$cfs.trigger(cf_e("play",conf),opts.auto.delay),crsl.upDateOnWindowResize){var i=function(){$cfs.trigger(cf_e("finish",conf)),opts.auto.pauseOnResize&&!crsl.isPaused&&$cfs.trigger(cf_e("play",conf)),sz_resetMargin($cfs.children(),opts),$cfs.trigger(cf_e("updateSizes",conf))},j=$(window),k=null;if($.debounce&&"debounce"==conf.onWindowResize)k=$.debounce(200,i);else if($.throttle&&"throttle"==conf.onWindowResize)k=$.throttle(300,i);else{var l=0,m=0;k=function(){var a=j.width(),b=j.height();(a!=l||b!=m)&&(i(),l=a,m=b)}}j.bind(cf_e("resize",conf,!1,!0,!0),k)}},FN._unbind_buttons=function(){var b=(cf_e("",conf),cf_e("",conf,!1));ns3=cf_e("",conf,!1,!0,!0),$(document).unbind(ns3),$(window).unbind(ns3),$wrp.unbind(b),opts.auto.button&&opts.auto.button.unbind(b),opts.prev.button&&opts.prev.button.unbind(b),opts.next.button&&opts.next.button.unbind(b),opts.pagination.container&&(opts.pagination.container.unbind(b),opts.pagination.anchorBuilder&&opts.pagination.container.children().remove()),crsl.swipe&&($cfs.swipe("destroy"),$wrp.css("cursor","default"),crsl.swipe=!1),crsl.mousewheel&&(crsl.mousewheel=!1),nv_showNavi(opts,"hide",conf),nv_enableNavi(opts,"removeClass",conf)},is_boolean(configs)&&(configs={debug:configs});var crsl={direction:"next",isPaused:!0,isScrolling:!1,isStopped:!1,mousewheel:!1,swipe:!1},itms={total:$cfs.children().length,first:0},tmrs={auto:null,progress:null,startTime:getTime(),timePassed:0},scrl={isStopped:!1,duration:0,startTime:0,easing:"",anims:[]},clbk={onBefore:[],onAfter:[]},queu=[],conf=$.extend(!0,{},$.fn.carouFredSel.configs,configs),opts={},opts_orig=$.extend(!0,{},options),$wrp="parent"==conf.wrapper?$cfs.parent():$cfs.wrap("<"+conf.wrapper.element+' class="'+conf.wrapper.classname+'" />').parent();if(conf.selector=$cfs.selector,conf.serialNumber=$.fn.carouFredSel.serialNumber++,conf.transition=conf.transition&&$.fn.transition?"transition":"animate",FN._init(opts_orig,!0,starting_position),FN._build(),FN._bind_events(),FN._bind_buttons(),is_array(opts.items.start))var start_arr=opts.items.start;else{var start_arr=[];0!=opts.items.start&&start_arr.push(opts.items.start)}if(opts.cookie&&start_arr.unshift(parseInt(cf_getCookie(opts.cookie),10)),start_arr.length>0)for(var a=0,l=start_arr.length;l>a;a++){var s=start_arr[a];if(0!=s){if(s===!0){if(s=window.location.hash,1>s.length)continue}else"random"===s&&(s=Math.floor(Math.random()*itms.total));if($cfs.triggerHandler(cf_e("slideTo",conf),[s,0,!0,{fx:"none"}]))break}}var siz=sz_setSizes($cfs,opts),itm=gi_getCurrentItems($cfs.children(),opts);return opts.onCreate&&opts.onCreate.call($tt0,{width:siz.width,height:siz.height,items:itm}),$cfs.trigger(cf_e("updatePageStatus",conf),[!0,siz]),$cfs.trigger(cf_e("linkAnchors",conf)),conf.debug&&$cfs.trigger(cf_e("debug",conf)),$cfs},$.fn.carouFredSel.serialNumber=1,$.fn.carouFredSel.defaults={synchronise:!1,infinite:!0,circular:!0,responsive:!1,direction:"left",items:{start:0},scroll:{easing:"swing",duration:500,pauseOnHover:!1,event:"click",queue:!1}},$.fn.carouFredSel.configs={debug:!1,transition:!1,onWindowResize:"throttle",events:{prefix:"",namespace:"cfs"},wrapper:{element:"div",classname:"caroufredsel_wrapper"},classnames:{}},$.fn.carouFredSel.pageAnchorBuilder=function(a){return'<a href="#"><span>'+a+"</span></a>"},$.fn.carouFredSel.progressbarUpdater=function(a){$(this).css("width",a+"%")},$.fn.carouFredSel.cookie={get:function(a){a+="=";for(var b=document.cookie.split(";"),c=0,d=b.length;d>c;c++){for(var e=b[c];" "==e.charAt(0);)e=e.slice(1);if(0==e.indexOf(a))return e.slice(a.length)}return 0},set:function(a,b,c){var d="";if(c){var e=new Date;e.setTime(e.getTime()+1e3*60*60*24*c),d="; expires="+e.toGMTString()}document.cookie=a+"="+b+d+"; path=/"},remove:function(a){$.fn.carouFredSel.cookie.set(a,"",-1)}},$.extend($.easing,{quadratic:function(a){var b=a*a;return a*(-b*a+4*b-6*a+4)},cubic:function(a){return a*(4*a*a-9*a+6)},elastic:function(a){var b=a*a;return a*(33*b*b-106*b*a+126*b-67*a+15)}}))})(jQuery);
|
assets/js/yith_magnifier.js
ADDED
@@ -0,0 +1,751 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* YITH Magnifier
|
3 |
+
*
|
4 |
+
* @version 0.1
|
5 |
+
* @author Your Inspiration Themes Team <info@yithemes.com>
|
6 |
+
*
|
7 |
+
* MIT License.
|
8 |
+
*/
|
9 |
+
;(function( window, $, undefined ) {
|
10 |
+
'use strict';
|
11 |
+
|
12 |
+
//include imagesLoaded plugin
|
13 |
+
if( $.fn.imagesLoaded === undefined ) {
|
14 |
+
/*!
|
15 |
+
* jQuery imagesLoaded plugin v2.1.1
|
16 |
+
* http://github.com/desandro/imagesloaded
|
17 |
+
*
|
18 |
+
* MIT License. by Paul Irish et al.
|
19 |
+
*/
|
20 |
+
|
21 |
+
/*jshint curly: true, eqeqeq: true, noempty: true, strict: true, undef: true, browser: true */
|
22 |
+
/*global jQuery: false */
|
23 |
+
|
24 |
+
;(function($, undefined) {
|
25 |
+
'use strict';
|
26 |
+
|
27 |
+
// blank image data-uri bypasses webkit log warning (thx doug jones)
|
28 |
+
var BLANK = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==';
|
29 |
+
|
30 |
+
$.fn.imagesLoaded = function( callback ) {
|
31 |
+
var $this = this,
|
32 |
+
deferred = $.isFunction($.Deferred) ? $.Deferred() : 0,
|
33 |
+
hasNotify = $.isFunction(deferred.notify),
|
34 |
+
$images = $this.find('img').add( $this.filter('img') ),
|
35 |
+
loaded = [],
|
36 |
+
proper = [],
|
37 |
+
broken = [];
|
38 |
+
|
39 |
+
// Register deferred callbacks
|
40 |
+
if ($.isPlainObject(callback)) {
|
41 |
+
$.each(callback, function (key, value) {
|
42 |
+
if (key === 'callback') {
|
43 |
+
callback = value;
|
44 |
+
} else if (deferred) {
|
45 |
+
deferred[key](value);
|
46 |
+
}
|
47 |
+
});
|
48 |
+
}
|
49 |
+
|
50 |
+
function doneLoading() {
|
51 |
+
var $proper = $(proper),
|
52 |
+
$broken = $(broken);
|
53 |
+
|
54 |
+
if ( deferred ) {
|
55 |
+
if ( broken.length ) {
|
56 |
+
deferred.reject( $images, $proper, $broken );
|
57 |
+
} else {
|
58 |
+
deferred.resolve( $images );
|
59 |
+
}
|
60 |
+
}
|
61 |
+
|
62 |
+
if ( $.isFunction( callback ) ) {
|
63 |
+
callback.call( $this, $images, $proper, $broken );
|
64 |
+
}
|
65 |
+
}
|
66 |
+
|
67 |
+
function imgLoadedHandler( event ) {
|
68 |
+
imgLoaded( event.target, event.type === 'error' );
|
69 |
+
}
|
70 |
+
|
71 |
+
function imgLoaded( img, isBroken ) {
|
72 |
+
// don't proceed if BLANK image, or image is already loaded
|
73 |
+
if ( img.src === BLANK || $.inArray( img, loaded ) !== -1 ) {
|
74 |
+
return;
|
75 |
+
}
|
76 |
+
|
77 |
+
// store element in loaded images array
|
78 |
+
loaded.push( img );
|
79 |
+
|
80 |
+
// keep track of broken and properly loaded images
|
81 |
+
if ( isBroken ) {
|
82 |
+
broken.push( img );
|
83 |
+
} else {
|
84 |
+
proper.push( img );
|
85 |
+
}
|
86 |
+
|
87 |
+
// cache image and its state for future calls
|
88 |
+
$.data( img, 'imagesLoaded', { isBroken: isBroken, src: img.src } );
|
89 |
+
|
90 |
+
// trigger deferred progress method if present
|
91 |
+
if ( hasNotify ) {
|
92 |
+
deferred.notifyWith( $(img), [ isBroken, $images, $(proper), $(broken) ] );
|
93 |
+
}
|
94 |
+
|
95 |
+
// call doneLoading and clean listeners if all images are loaded
|
96 |
+
if ( $images.length === loaded.length ) {
|
97 |
+
setTimeout( doneLoading );
|
98 |
+
$images.unbind( '.imagesLoaded', imgLoadedHandler );
|
99 |
+
}
|
100 |
+
}
|
101 |
+
|
102 |
+
// if no images, trigger immediately
|
103 |
+
if ( !$images.length ) {
|
104 |
+
doneLoading();
|
105 |
+
} else {
|
106 |
+
$images.bind( 'load.imagesLoaded error.imagesLoaded', imgLoadedHandler )
|
107 |
+
.each( function( i, el ) {
|
108 |
+
var src = el.src;
|
109 |
+
|
110 |
+
// find out if this image has been already checked for status
|
111 |
+
// if it was, and src has not changed, call imgLoaded on it
|
112 |
+
var cached = $.data( el, 'imagesLoaded' );
|
113 |
+
if ( cached && cached.src === src ) {
|
114 |
+
imgLoaded( el, cached.isBroken );
|
115 |
+
return;
|
116 |
+
}
|
117 |
+
|
118 |
+
// if complete is true and browser supports natural sizes, try
|
119 |
+
// to check for image status manually
|
120 |
+
if ( el.complete && el.naturalWidth !== undefined ) {
|
121 |
+
imgLoaded( el, el.naturalWidth === 0 || el.naturalHeight === 0 );
|
122 |
+
return;
|
123 |
+
}
|
124 |
+
|
125 |
+
// cached images don't fire load sometimes, so we reset src, but only when
|
126 |
+
// dealing with IE, or image is complete (loaded) and failed manual check
|
127 |
+
// webkit hack from http://groups.google.com/group/jquery-dev/browse_thread/thread/eee6ab7b2da50e1f
|
128 |
+
if ( el.readyState || el.complete ) {
|
129 |
+
el.src = BLANK;
|
130 |
+
el.src = src;
|
131 |
+
}
|
132 |
+
});
|
133 |
+
}
|
134 |
+
|
135 |
+
return deferred ? deferred.promise( $this ) : $this;
|
136 |
+
};
|
137 |
+
|
138 |
+
})(jQuery);
|
139 |
+
}
|
140 |
+
|
141 |
+
|
142 |
+
|
143 |
+
|
144 |
+
|
145 |
+
|
146 |
+
$.yith_magnifier = function( options, element ) {
|
147 |
+
this.t = element;
|
148 |
+
this.element = $( element );
|
149 |
+
this._init( options );
|
150 |
+
};
|
151 |
+
|
152 |
+
$.yith_magnifier.defaults = {
|
153 |
+
zoomWidth: 'auto',
|
154 |
+
zoomHeight: 'auto',
|
155 |
+
position: 'right',
|
156 |
+
tint: false,
|
157 |
+
tintOpacity: 0.5,
|
158 |
+
lensOpacity: 0.5,
|
159 |
+
softFocus: false,
|
160 |
+
smoothMove: 3,
|
161 |
+
showTitle: true,
|
162 |
+
titleOpacity: 0.5,
|
163 |
+
adjustX: 0,
|
164 |
+
adjustY: 0,
|
165 |
+
|
166 |
+
phoneBehavior: 'inside', //allowed values: inside, disable, default
|
167 |
+
loadingLabel: 'Loading...',
|
168 |
+
|
169 |
+
enableSlider: true,
|
170 |
+
sliderOptions: {},
|
171 |
+
|
172 |
+
onLoad : function() { return false; },
|
173 |
+
onEnter: function() { return false },
|
174 |
+
onLeave: function() { return false },
|
175 |
+
onMove: function() { return false },
|
176 |
+
onClick: function() { return false; },
|
177 |
+
|
178 |
+
elements : {
|
179 |
+
zoom : $('.yith_magnifier_zoom'),
|
180 |
+
zoomImage: $('.yith_magnifier_zoom img'),
|
181 |
+
gallery : $('.yith_magnifier_gallery li a')
|
182 |
+
}
|
183 |
+
};
|
184 |
+
|
185 |
+
$.yith_magnifier.prototype = {
|
186 |
+
|
187 |
+
/**
|
188 |
+
* Let's start the magnifier
|
189 |
+
*
|
190 |
+
* @param {Object} options
|
191 |
+
*
|
192 |
+
* @private
|
193 |
+
*/
|
194 |
+
_init : function( options ) {
|
195 |
+
var self = this;
|
196 |
+
|
197 |
+
$.each($.yith_magnifier.defaults.elements, function(i,v){
|
198 |
+
var el = $.yith_magnifier.defaults.elements;
|
199 |
+
el[i] = $(v, self);
|
200 |
+
});
|
201 |
+
self.options = $.extend( true, {}, $.yith_magnifier.defaults, options );
|
202 |
+
self.isPhone = self._isPhone();
|
203 |
+
|
204 |
+
self._loading();
|
205 |
+
|
206 |
+
self.element.imagesLoaded(function(){
|
207 |
+
self.options.onLoad();
|
208 |
+
self._initZoom();
|
209 |
+
self._initGallery();
|
210 |
+
});
|
211 |
+
},
|
212 |
+
|
213 |
+
|
214 |
+
/**
|
215 |
+
* Init gallery handlers
|
216 |
+
*
|
217 |
+
* @private
|
218 |
+
*
|
219 |
+
*/
|
220 |
+
_initGallery: function() {
|
221 |
+
var self = this;
|
222 |
+
var elements = self.options.elements;
|
223 |
+
|
224 |
+
var gallery = elements.gallery;
|
225 |
+
var zoom = elements.zoom;
|
226 |
+
var zoomImage = elements.zoomImage;
|
227 |
+
|
228 |
+
if( gallery.length > 0 ) {
|
229 |
+
gallery.on('click', function(e){
|
230 |
+
e.preventDefault();
|
231 |
+
|
232 |
+
var t = $(this);
|
233 |
+
self.destroy();
|
234 |
+
|
235 |
+
zoom.attr('href', this.href);
|
236 |
+
|
237 |
+
zoomImage.attr('src', t.data('small'))
|
238 |
+
.attr('title', '')
|
239 |
+
.attr('title', t.attr('title'));
|
240 |
+
$.data( self.t, 'yith_magnifier', new $.yith_magnifier( self.options, self.element ) );
|
241 |
+
});
|
242 |
+
|
243 |
+
//gallery.filter(':first').trigger('click');
|
244 |
+
|
245 |
+
if( self.options.enableSlider ) {
|
246 |
+
gallery.parents('ul').carouFredSel( self.options.sliderOptions );
|
247 |
+
}
|
248 |
+
|
249 |
+
} else {
|
250 |
+
gallery.on('click', function(e){
|
251 |
+
e.preventDefault();
|
252 |
+
return false;
|
253 |
+
})
|
254 |
+
}
|
255 |
+
},
|
256 |
+
|
257 |
+
/**
|
258 |
+
* Show a loading icon while image isn't properly loaded
|
259 |
+
*
|
260 |
+
* @private
|
261 |
+
*/
|
262 |
+
_loading : function() {
|
263 |
+
if( this.options.disableRightClick ) {
|
264 |
+
$(document).on('contextmenu', function(e){
|
265 |
+
return false;
|
266 |
+
});
|
267 |
+
}
|
268 |
+
|
269 |
+
if (this.mouseTrap === undefined) {
|
270 |
+
var w = this.options.elements.zoom.width();
|
271 |
+
|
272 |
+
$('<div class="yith_magnifier_loading">' + this.options.loadingLabel + '</div>').css({
|
273 |
+
width: w / 3,
|
274 |
+
left: (w / 2) - (w / 6),
|
275 |
+
opacity: .5
|
276 |
+
}).appendTo(this.options.elements.zoom.parent());
|
277 |
+
}
|
278 |
+
},
|
279 |
+
|
280 |
+
/**
|
281 |
+
* Initialize the zoom images
|
282 |
+
*
|
283 |
+
* @private
|
284 |
+
*/
|
285 |
+
_initZoom : function() {
|
286 |
+
var self = this;
|
287 |
+
|
288 |
+
self.zoom = self.options.elements.zoom;
|
289 |
+
self.zoomImage = self.options.elements.zoomImage;
|
290 |
+
|
291 |
+
//wrap the zoom image with a div
|
292 |
+
//if( !self.zoom.parent().hasClass('yith_magnifier_zoom_wrap') ) {
|
293 |
+
self.zoom.wrap('<div class="yith_magnifier_zoom_wrap"></div>');
|
294 |
+
//}
|
295 |
+
|
296 |
+
self.IMG_zoomImage = new Image();
|
297 |
+
self.IMG_zoomImage.src = self.zoom.attr('href');
|
298 |
+
|
299 |
+
self.IMG_smallImage = new Image();
|
300 |
+
self.IMG_smallImage.src = self.zoomImage.attr('src');
|
301 |
+
|
302 |
+
if( $.browser.msie && $.browser.version == 8 ) {
|
303 |
+
$(self.IMG_zoomImage).load(function(){
|
304 |
+
self._initTrap();
|
305 |
+
});
|
306 |
+
} else {
|
307 |
+
$([self.IMG_zoomImage, self.IMG_smallImage]).imagesLoaded(function(){
|
308 |
+
self._initTrap();
|
309 |
+
});
|
310 |
+
}
|
311 |
+
},
|
312 |
+
|
313 |
+
/**
|
314 |
+
* Create the mouse trap
|
315 |
+
*
|
316 |
+
* @private
|
317 |
+
*/
|
318 |
+
_initTrap : function() {
|
319 |
+
var self = this;
|
320 |
+
var zoomImg = self.IMG_zoomImage,
|
321 |
+
thumbImg = self.IMG_smallImage;
|
322 |
+
|
323 |
+
self.mx = 0;
|
324 |
+
self.my = 0;
|
325 |
+
self.controlTimer = 0;
|
326 |
+
self.lens = null;
|
327 |
+
self.tint = null;
|
328 |
+
self.softFocus = null;
|
329 |
+
self.zoomDiv = null;
|
330 |
+
self.cw = 0;
|
331 |
+
self.ch = 0;
|
332 |
+
self.zw = 0;
|
333 |
+
self.destU = 0;
|
334 |
+
self.destV = 0;
|
335 |
+
self.currU = 0;
|
336 |
+
self.currV = 0;
|
337 |
+
self.mouseTrap = null;
|
338 |
+
|
339 |
+
var zoom = self.options.elements.zoom;
|
340 |
+
var zoomImage = self.options.elements.zoomImage;
|
341 |
+
|
342 |
+
//remove loading div
|
343 |
+
//this.zoom.parent().siblings('.yith_magnifier_loading').remove();
|
344 |
+
$('.yith_magnifier_loading').remove();
|
345 |
+
|
346 |
+
if( this.element.find('.yith_magnifier_mousetrap') ) {
|
347 |
+
this.element.find('.yith_magnifier_mousetrap').remove();
|
348 |
+
}
|
349 |
+
|
350 |
+
this.mouseTrap = $('<div class="yith_magnifier_mousetrap" />').css({
|
351 |
+
width: '100%', //zoomImage.outerWidth(),
|
352 |
+
height: '100%', //zoomImage.outerHeight(),
|
353 |
+
top: 0,
|
354 |
+
left: 0
|
355 |
+
}).appendTo(zoom.parent());
|
356 |
+
|
357 |
+
// Detect device type, normal mouse or touchy(ipad android) by albanx
|
358 |
+
var touchy = ("ontouchstart" in document.documentElement) ? true : false;
|
359 |
+
var event_move = 'touchmove mousemove';
|
360 |
+
var event_end = 'touchend mouseleave';
|
361 |
+
var event_ent = 'touchstart mouseenter';
|
362 |
+
var event_click = 'touchstart click';
|
363 |
+
|
364 |
+
this.mouseTrap.on(event_move, this, function (e) {
|
365 |
+
self.options.onMove();
|
366 |
+
|
367 |
+
self.mx = ( typeof(e.originalEvent.touches) !='undefined' ) ? e.originalEvent.touches[0].pageX : e.pageX;
|
368 |
+
self.my = ( typeof(e.originalEvent.touches) !='undefined' ) ? e.originalEvent.touches[0].pageY : e.pageY;
|
369 |
+
|
370 |
+
}).on(event_end, this, function (e) {
|
371 |
+
|
372 |
+
clearTimeout(self.controlTimer);
|
373 |
+
//event.data.removeBits();
|
374 |
+
if(self.lens) { self.lens.fadeOut(299); }
|
375 |
+
if(self.tint) { self.tint.fadeOut(299); }
|
376 |
+
if(self.softFocus) { self.softFocus.fadeOut(299); }
|
377 |
+
self.zoomDiv.fadeOut(300, function () {
|
378 |
+
self._onLeave();
|
379 |
+
});
|
380 |
+
|
381 |
+
return false;
|
382 |
+
|
383 |
+
}).on(event_click, this, function (e) {
|
384 |
+
self.options.onClick();
|
385 |
+
}).on(event_ent, this, function (e) {
|
386 |
+
self.options.onEnter();
|
387 |
+
|
388 |
+
if(touchy) {
|
389 |
+
e.preventDefault();
|
390 |
+
}
|
391 |
+
|
392 |
+
self.mx = ( typeof(e.originalEvent.touches) !='undefined' ) ? e.originalEvent.touches[0].pageX : e.pageX;
|
393 |
+
self.my = ( typeof(e.originalEvent.touches) !='undefined' ) ? e.originalEvent.touches[0].pageY : e.pageY;
|
394 |
+
|
395 |
+
self.zw = e.data;
|
396 |
+
if (self.zoomDiv) {
|
397 |
+
self.zoomDiv.stop(true, false);
|
398 |
+
self.zoomDiv.remove();
|
399 |
+
}
|
400 |
+
|
401 |
+
var xPos = self.options.adjustX,
|
402 |
+
yPos = self.options.adjustY;
|
403 |
+
|
404 |
+
var siw = zoomImage.outerWidth();
|
405 |
+
var sih = zoomImage.outerHeight();
|
406 |
+
|
407 |
+
var w = self.options.zoomWidth;
|
408 |
+
var h = self.options.zoomHeight;
|
409 |
+
|
410 |
+
if (self.options.zoomWidth == 'auto') {
|
411 |
+
w = siw;
|
412 |
+
}
|
413 |
+
|
414 |
+
if (self.options.zoomHeight == 'auto') {
|
415 |
+
h = sih;
|
416 |
+
}
|
417 |
+
|
418 |
+
var appendTo = zoom.parent();
|
419 |
+
switch (self.options.position) {
|
420 |
+
case 'top':
|
421 |
+
yPos -= h;
|
422 |
+
break;
|
423 |
+
case 'right':
|
424 |
+
xPos += siw;
|
425 |
+
break;
|
426 |
+
case 'bottom':
|
427 |
+
yPos += sih;
|
428 |
+
break;
|
429 |
+
case 'left':
|
430 |
+
xPos -= w;
|
431 |
+
break;
|
432 |
+
case 'inside':
|
433 |
+
w = siw;
|
434 |
+
h = sih;
|
435 |
+
break;
|
436 |
+
|
437 |
+
// All other values, try and find an id in the dom to attach to.
|
438 |
+
default:
|
439 |
+
appendTo = $('#' + self.options.position);
|
440 |
+
// If dom element doesn't exit, just use 'right' position as default.
|
441 |
+
if (!appendTo.length) {
|
442 |
+
appendTo = zoom;
|
443 |
+
xPos += siw; //+ opts.adjustX;
|
444 |
+
yPos += sih; // + opts.adjustY;
|
445 |
+
} else {
|
446 |
+
w = appendTo.innerWidth();
|
447 |
+
h = appendTo.innerHeight();
|
448 |
+
}
|
449 |
+
}
|
450 |
+
|
451 |
+
if( self.isPhone && self.options.phoneBehavior == 'inside' ) {
|
452 |
+
w = siw;
|
453 |
+
h = sih;
|
454 |
+
xPos = 0;
|
455 |
+
yPos = 0;
|
456 |
+
}
|
457 |
+
|
458 |
+
self.zoomDiv = $('<div class="yith_magnifier_zoom_magnifier" />').css({
|
459 |
+
left: xPos,
|
460 |
+
top: yPos,
|
461 |
+
width: w,
|
462 |
+
height: h,
|
463 |
+
backgroundImage: 'url('+ zoomImg.src + ')'
|
464 |
+
}).appendTo(appendTo);
|
465 |
+
|
466 |
+
// Add the title from title tag.
|
467 |
+
if (zoomImage.attr('title') && self.options.showTitle) {
|
468 |
+
$('<div class="yith_magnifier_title">' + zoomImage.attr('title') + '</div>').appendTo(self.zoomDiv);
|
469 |
+
}
|
470 |
+
|
471 |
+
if( self.isPhone ) {
|
472 |
+
if( self.options.phoneBehavior != 'disable' ) {
|
473 |
+
self.zoomDiv.fadeIn(500);
|
474 |
+
} else {
|
475 |
+
self.lens.fadeOut(299);
|
476 |
+
}
|
477 |
+
} else {
|
478 |
+
self.zoomDiv.fadeIn(500);
|
479 |
+
}
|
480 |
+
|
481 |
+
if (self.lens) {
|
482 |
+
self.lens.remove();
|
483 |
+
self.lens = null;
|
484 |
+
}
|
485 |
+
|
486 |
+
if( zoomImg.width <= 1) {
|
487 |
+
self.cw = (zoomImage.outerWidth() / zoomImg.naturalWidth) * self.zoomDiv.width();
|
488 |
+
} else {
|
489 |
+
self.cw = (zoomImage.outerWidth() / zoomImg.width) * self.zoomDiv.width();
|
490 |
+
}
|
491 |
+
|
492 |
+
if( zoomImg.height <= 1 ) {
|
493 |
+
self.ch = (zoomImage.outerHeight() / zoomImg.naturalHeight) * self.zoomDiv.height();
|
494 |
+
} else {
|
495 |
+
self.ch = (zoomImage.outerHeight() / zoomImg.height) * self.zoomDiv.height();
|
496 |
+
}
|
497 |
+
|
498 |
+
// Attach mouse, initially invisible to prevent first frame glitch
|
499 |
+
self.lens = $('<div class="yith_magnifier_lens" />').css({
|
500 |
+
width: self.cw,
|
501 |
+
height: self.ch
|
502 |
+
}).appendTo(zoom);
|
503 |
+
|
504 |
+
self.mouseTrap.css('cursor', self.lens.css('cursor'));
|
505 |
+
|
506 |
+
var noTrans = false;
|
507 |
+
|
508 |
+
|
509 |
+
// Init tint layer if needed. (Not relevant if using inside mode)
|
510 |
+
if (self.options.tint) {
|
511 |
+
//self.lens.css('background', 'url("' + zoomImage.attr('src') + '")');
|
512 |
+
self.tint = $('<div />').css({
|
513 |
+
display: 'none',
|
514 |
+
position: 'absolute',
|
515 |
+
left: 0,
|
516 |
+
top: 0,
|
517 |
+
width: zoomImage.outerWidth(),
|
518 |
+
height: zoomImage.outerHeight(),
|
519 |
+
backgroundColor: self.options.tint,
|
520 |
+
opacity: self.options.tintOpacity
|
521 |
+
}).appendTo(zoom);
|
522 |
+
|
523 |
+
|
524 |
+
self.lens.append($('<img />', {
|
525 |
+
src: zoomImage.attr('src')
|
526 |
+
}));
|
527 |
+
|
528 |
+
noTrans = true;
|
529 |
+
self.tint.fadeIn(500);
|
530 |
+
}
|
531 |
+
|
532 |
+
if (self.options.softFocus) {
|
533 |
+
//self.lens.css('background', 'url("' + zoomImage.attr('src') + '")');
|
534 |
+
self.softFocus = $('<div />').css({
|
535 |
+
position: 'absolute',
|
536 |
+
display: 'none',
|
537 |
+
top: '1px',
|
538 |
+
left: '1px',
|
539 |
+
width: zoomImage.outerWidth(),
|
540 |
+
height: zoomImage.outerHeight(),
|
541 |
+
//background: 'url("' + zoomImage.attr('src') + '")',
|
542 |
+
//backgroundSize: '100%',
|
543 |
+
opacity: .5
|
544 |
+
}).appendTo(zoom);
|
545 |
+
|
546 |
+
self.softFocus.append($('<img />', {
|
547 |
+
src: zoomImage.attr('src')
|
548 |
+
}));
|
549 |
+
|
550 |
+
if( self.lens.find('img').length == 0 ) {
|
551 |
+
self.lens.append($('<img />', {
|
552 |
+
src: zoomImage.attr('src')
|
553 |
+
}));
|
554 |
+
}
|
555 |
+
|
556 |
+
noTrans = true;
|
557 |
+
self.softFocus.fadeIn(500);
|
558 |
+
}
|
559 |
+
|
560 |
+
|
561 |
+
if (!noTrans) {
|
562 |
+
self.lens.css('opacity', self.options.lensOpacity);
|
563 |
+
}
|
564 |
+
if ( self.options.position !== 'inside' ) { self.lens.fadeIn(500); }
|
565 |
+
|
566 |
+
// Start processing.
|
567 |
+
self.zw._controlLoop();
|
568 |
+
|
569 |
+
return; // Don't return false here otherwise opera will not detect change of the mouse pointer type.
|
570 |
+
});
|
571 |
+
},
|
572 |
+
|
573 |
+
/**
|
574 |
+
*
|
575 |
+
*
|
576 |
+
* @private
|
577 |
+
*/
|
578 |
+
_controlLoop: function() {
|
579 |
+
var self = this;
|
580 |
+
|
581 |
+
if (this.lens) {
|
582 |
+
var x = (this.mx - this.zoomImage.offset().left - (this.cw * 0.5)) >> 0;
|
583 |
+
var y = (this.my - this.zoomImage.offset().top - (this.ch * 0.5)) >> 0;
|
584 |
+
|
585 |
+
if (x < 0) {
|
586 |
+
x = 0;
|
587 |
+
} else if (x > (this.zoomImage.outerWidth() - this.cw)) {
|
588 |
+
x = (this.zoomImage.outerWidth() - this.cw);
|
589 |
+
}
|
590 |
+
|
591 |
+
if (y < 0) {
|
592 |
+
y = 0;
|
593 |
+
} else if (y > (this.zoomImage.outerHeight() - this.ch)) {
|
594 |
+
y = (this.zoomImage.outerHeight() - this.ch);
|
595 |
+
}
|
596 |
+
|
597 |
+
this.lens.css({
|
598 |
+
left: x - 2,
|
599 |
+
top: y - 1
|
600 |
+
});
|
601 |
+
|
602 |
+
//this.lens.css('background-position', (-x) + 'px ' + (-y) + 'px');
|
603 |
+
|
604 |
+
|
605 |
+
this.lens.find('img').css({
|
606 |
+
width: this.zoomImage.outerWidth(),
|
607 |
+
height: this.zoomImage.outerHeight(),
|
608 |
+
marginLeft: (-x) + 'px ',
|
609 |
+
marginTop: (-y) + 'px'
|
610 |
+
});
|
611 |
+
|
612 |
+
|
613 |
+
if( this.IMG_zoomImage.width <= 1 ) {
|
614 |
+
this.destU = (((x) / this.zoomImage.outerWidth()) * this.IMG_zoomImage.naturalWidth) >> 0;
|
615 |
+
} else {
|
616 |
+
this.destU = (((x) / this.zoomImage.outerWidth()) * this.IMG_zoomImage.width) >> 0;
|
617 |
+
}
|
618 |
+
|
619 |
+
if( this.IMG_zoomImage.height <= 1 ) {
|
620 |
+
this.destV = (((y) / this.zoomImage.outerHeight()) * this.IMG_zoomImage.naturalHeight) >> 0;
|
621 |
+
} else {
|
622 |
+
this.destV = (((y) / this.zoomImage.outerHeight()) * this.IMG_zoomImage.height) >> 0;
|
623 |
+
}
|
624 |
+
|
625 |
+
|
626 |
+
this.currU += (this.destU - this.currU) / this.options.smoothMove;
|
627 |
+
this.currV += (this.destV - this.currV) / this.options.smoothMove;
|
628 |
+
|
629 |
+
this.zoomDiv.css('background-position', (-(this.currU >> 0) + 'px ') + (-(this.currV >> 0) + 'px'));
|
630 |
+
}
|
631 |
+
|
632 |
+
this.controlTimer = setTimeout(function () {
|
633 |
+
self._controlLoop();
|
634 |
+
}, 30);
|
635 |
+
},
|
636 |
+
|
637 |
+
/**
|
638 |
+
* This method is called when the mouse leave the image
|
639 |
+
*
|
640 |
+
* @private
|
641 |
+
*/
|
642 |
+
_onLeave: function() {
|
643 |
+
this.options.onLeave();
|
644 |
+
|
645 |
+
if (this.zoomDiv) {
|
646 |
+
this.zoomDiv.remove();
|
647 |
+
this.zoomDiv = null;
|
648 |
+
}
|
649 |
+
|
650 |
+
this._removeElements();
|
651 |
+
},
|
652 |
+
|
653 |
+
/**
|
654 |
+
* Remove lens, tint and softfocus
|
655 |
+
*
|
656 |
+
* @private
|
657 |
+
*/
|
658 |
+
_removeElements: function() {
|
659 |
+
if (this.lens) {
|
660 |
+
this.lens.remove();
|
661 |
+
this.lens = null;
|
662 |
+
}
|
663 |
+
|
664 |
+
if (this.tint) {
|
665 |
+
this.tint.remove();
|
666 |
+
this.tint = null;
|
667 |
+
}
|
668 |
+
|
669 |
+
if (this.softFocus) {
|
670 |
+
this.softFocus.remove();
|
671 |
+
this.softFocus = null;
|
672 |
+
}
|
673 |
+
|
674 |
+
if( this.element.find('.yith_magnifier_loading').length > 0 ) {
|
675 |
+
this.element.find('.yith_magnifier_loading').remove();
|
676 |
+
}
|
677 |
+
},
|
678 |
+
|
679 |
+
/**
|
680 |
+
* Detect if user is using a phone device (eg iPhone)
|
681 |
+
*
|
682 |
+
* @private
|
683 |
+
*/
|
684 |
+
_isPhone: function() {
|
685 |
+
var userAgent = navigator.userAgent.toLowerCase();
|
686 |
+
|
687 |
+
return ( userAgent.match(/iphone/i) || userAgent.match(/ipod/i) || userAgent.match(/android/i) );
|
688 |
+
},
|
689 |
+
|
690 |
+
/**
|
691 |
+
* Destroy the instance
|
692 |
+
*
|
693 |
+
*/
|
694 |
+
destroy: function() {
|
695 |
+
if(this.zoom) {
|
696 |
+
this.zoom.unwrap();
|
697 |
+
}
|
698 |
+
|
699 |
+
if(this.mouseTrap) {
|
700 |
+
this.mouseTrap.unbind();
|
701 |
+
this.mouseTrap.remove();
|
702 |
+
this.mouseTrap = null;
|
703 |
+
}
|
704 |
+
|
705 |
+
if (this.zoomDiv) {
|
706 |
+
this.zoomDiv.remove();
|
707 |
+
this.zoomDiv = null;
|
708 |
+
}
|
709 |
+
|
710 |
+
if( this.options.disableRightClick ) {
|
711 |
+
$(document).unbind();
|
712 |
+
}
|
713 |
+
|
714 |
+
this._removeElements();
|
715 |
+
this.options.elements.gallery.unbind();
|
716 |
+
this.element.removeData('yith_magnifier');
|
717 |
+
}
|
718 |
+
};
|
719 |
+
|
720 |
+
$.fn.yith_magnifier = function( options ) {
|
721 |
+
if ( typeof options === 'string' ) {
|
722 |
+
var args = Array.prototype.slice.call( arguments, 1 );
|
723 |
+
|
724 |
+
this.each(function() {
|
725 |
+
var instance = $.data( this, 'yith_magnifier' );
|
726 |
+
if ( !instance ) {
|
727 |
+
$.error( "cannot call methods on yith_magnifier prior to initialization; " +
|
728 |
+
"attempted to call method '" + options + "'" );
|
729 |
+
return;
|
730 |
+
}
|
731 |
+
if ( !$.isFunction( instance[options] ) || options.charAt(0) === "_" ) {
|
732 |
+
$.error( "no such method '" + options + "' for yith_magnifier instance" );
|
733 |
+
return;
|
734 |
+
}
|
735 |
+
instance[ options ].apply( instance, args );
|
736 |
+
});
|
737 |
+
} else {
|
738 |
+
this.each(function() {
|
739 |
+
var instance = $.data( this, 'yith_magnifier' );
|
740 |
+
if ( !instance ) {
|
741 |
+
$.data( this, 'yith_magnifier', new $.yith_magnifier( options, this ) );
|
742 |
+
} else {
|
743 |
+
$.error('yith_magnifier already istantiated.');
|
744 |
+
}
|
745 |
+
});
|
746 |
+
}
|
747 |
+
return this;
|
748 |
+
};
|
749 |
+
|
750 |
+
|
751 |
+
})( window, jQuery );
|
assets/js/yith_magnifier.min.js
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* YITH Magnifier
|
3 |
+
*
|
4 |
+
* @version 0.1
|
5 |
+
* @author Your Inspiration Themes Team <info@yithemes.com>
|
6 |
+
*
|
7 |
+
* MIT License.
|
8 |
+
*/
|
9 |
+
(function(s,b,q){if(b.fn.imagesLoaded===q){var g=jQuery,r="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==";g.fn.imagesLoaded=function(a){function b(){var d=g(k),e=g(j);c&&(j.length?c.reject(h,d,e):c.resolve(h));g.isFunction(a)&&a.call(p,h,d,e)}function e(a){f(a.target,"error"===a.type)}function f(a,f){a.src===r||-1!==g.inArray(a,m)||(m.push(a),f?j.push(a):k.push(a),g.data(a,"imagesLoaded",{isBroken:f,src:a.src}),l&&c.notifyWith(g(a),[f,h,g(k),g(j)]),h.length===m.length&&(setTimeout(b),
|
10 |
+
h.unbind(".imagesLoaded",e)))}var p=this,c=g.isFunction(g.Deferred)?g.Deferred():0,l=g.isFunction(c.notify),h=p.find("img").add(p.filter("img")),m=[],k=[],j=[];g.isPlainObject(a)&&g.each(a,function(b,d){if("callback"===b)a=d;else if(c)c[b](d)});h.length?h.bind("load.imagesLoaded error.imagesLoaded",e).each(function(a,b){var c=b.src,d=g.data(b,"imagesLoaded");if(d&&d.src===c)f(b,d.isBroken);else if(b.complete&&void 0!==b.naturalWidth)f(b,0===b.naturalWidth||0===b.naturalHeight);else if(b.readyState||
|
11 |
+
b.complete)b.src=r,b.src=c}):b();return c?c.promise(p):p}}b.yith_magnifier=function(a,d){this.t=d;this.element=b(d);this._init(a)};b.yith_magnifier.defaults={zoomWidth:"auto",zoomHeight:"auto",position:"right",tint:!1,tintOpacity:0.5,lensOpacity:0.5,softFocus:!1,smoothMove:3,showTitle:!0,titleOpacity:0.5,adjustX:0,adjustY:0,phoneBehavior:"inside",loadingLabel:"Loading...",enableSlider:!0,sliderOptions:{},onLoad:function(){return!1},onEnter:function(){return!1},onLeave:function(){return!1},onMove:function(){return!1},
|
12 |
+
onClick:function(){return!1},elements:{zoom:b(".yith_magnifier_zoom"),zoomImage:b(".yith_magnifier_zoom img"),gallery:b(".yith_magnifier_gallery li a")}};b.yith_magnifier.prototype={_init:function(a){var d=this;b.each(b.yith_magnifier.defaults.elements,function(a,f){b.yith_magnifier.defaults.elements[a]=b(f,d)});d.options=b.extend(!0,{},b.yith_magnifier.defaults,a);d.isPhone=d._isPhone();d._loading();d.element.imagesLoaded(function(){d.options.onLoad();d._initZoom();d._initGallery()})},_initGallery:function(){var a=
|
13 |
+
this,d=a.options.elements,e=d.gallery,f=d.zoom,g=d.zoomImage;if(0<e.length)e.on("click",function(c){c.preventDefault();c=b(this);a.destroy();f.attr("href",this.href);g.attr("src",c.data("small")).attr("title","").attr("title",c.attr("title"));b.data(a.t,"yith_magnifier",new b.yith_magnifier(a.options,a.element))}),a.options.enableSlider&&e.parents("ul").carouFredSel(a.options.sliderOptions);else e.on("click",function(a){a.preventDefault();return!1})},_loading:function(){if(this.options.disableRightClick)b(document).on("contextmenu",
|
14 |
+
function(){return!1});if(this.mouseTrap===q){var a=this.options.elements.zoom.width();b('<div class="yith_magnifier_loading">'+this.options.loadingLabel+"</div>").css({width:a/3,left:a/2-a/6,opacity:0.5}).appendTo(this.options.elements.zoom.parent())}},_initZoom:function(){var a=this;a.zoom=a.options.elements.zoom;a.zoomImage=a.options.elements.zoomImage;a.zoom.wrap('<div class="yith_magnifier_zoom_wrap"></div>');a.IMG_zoomImage=new Image;a.IMG_zoomImage.src=a.zoom.attr("href");a.IMG_smallImage=new Image;
|
15 |
+
a.IMG_smallImage.src=a.zoomImage.attr("src");b.browser.msie&&8==b.browser.version?b(a.IMG_zoomImage).load(function(){a._initTrap()}):b([a.IMG_zoomImage,a.IMG_smallImage]).imagesLoaded(function(){a._initTrap()})},_initTrap:function(){var a=this,d=a.IMG_zoomImage;a.mx=0;a.my=0;a.controlTimer=0;a.lens=null;a.tint=null;a.softFocus=null;a.zoomDiv=null;a.cw=0;a.ch=0;a.zw=0;a.destU=0;a.destV=0;a.currU=0;a.currV=0;a.mouseTrap=null;var e=a.options.elements.zoom,f=a.options.elements.zoomImage;b(".yith_magnifier_loading").remove();
|
16 |
+
this.element.find(".yith_magnifier_mousetrap")&&this.element.find(".yith_magnifier_mousetrap").remove();this.mouseTrap=b('<div class="yith_magnifier_mousetrap" />').css({width:"100%",height:"100%",top:0,left:0}).appendTo(e.parent());var g="ontouchstart"in document.documentElement?!0:!1;this.mouseTrap.on("touchmove mousemove",this,function(b){a.options.onMove();a.mx="undefined"!=typeof b.originalEvent.touches?b.originalEvent.touches[0].pageX:b.pageX;a.my="undefined"!=typeof b.originalEvent.touches?
|
17 |
+
b.originalEvent.touches[0].pageY:b.pageY}).on("touchend mouseleave",this,function(){clearTimeout(a.controlTimer);a.lens&&a.lens.fadeOut(299);a.tint&&a.tint.fadeOut(299);a.softFocus&&a.softFocus.fadeOut(299);a.zoomDiv.fadeOut(300,function(){a._onLeave()});return!1}).on("touchstart click",this,function(){a.options.onClick()}).on("touchstart mouseenter",this,function(c){a.options.onEnter();g&&c.preventDefault();a.mx="undefined"!=typeof c.originalEvent.touches?c.originalEvent.touches[0].pageX:c.pageX;
|
18 |
+
a.my="undefined"!=typeof c.originalEvent.touches?c.originalEvent.touches[0].pageY:c.pageY;a.zw=c.data;a.zoomDiv&&(a.zoomDiv.stop(!0,!1),a.zoomDiv.remove());c=a.options.adjustX;var l=a.options.adjustY,h=f.outerWidth(),m=f.outerHeight(),k=a.options.zoomWidth,j=a.options.zoomHeight;"auto"==a.options.zoomWidth&&(k=h);"auto"==a.options.zoomHeight&&(j=m);var n=e.parent();switch(a.options.position){case "top":l-=j;break;case "right":c+=h;break;case "bottom":l+=m;break;case "left":c-=k;break;case "inside":k=
|
19 |
+
h;j=m;break;default:n=b("#"+a.options.position),n.length?(k=n.innerWidth(),j=n.innerHeight()):(n=e,c+=h,l+=m)}a.isPhone&&"inside"==a.options.phoneBehavior&&(k=h,j=m,l=c=0);a.zoomDiv=b('<div class="yith_magnifier_zoom_magnifier" />').css({left:c,top:l,width:k,height:j,backgroundImage:"url("+d.src+")"}).appendTo(n);f.attr("title")&&a.options.showTitle&&b('<div class="yith_magnifier_title">'+f.attr("title")+"</div>").appendTo(a.zoomDiv);a.isPhone?"disable"!=a.options.phoneBehavior?a.zoomDiv.fadeIn(500):
|
20 |
+
a.lens.fadeOut(299):a.zoomDiv.fadeIn(500);a.lens&&(a.lens.remove(),a.lens=null);a.cw=1>=d.width?f.outerWidth()/d.naturalWidth*a.zoomDiv.width():f.outerWidth()/d.width*a.zoomDiv.width();a.ch=1>=d.height?f.outerHeight()/d.naturalHeight*a.zoomDiv.height():f.outerHeight()/d.height*a.zoomDiv.height();a.lens=b('<div class="yith_magnifier_lens" />').css({width:a.cw,height:a.ch}).appendTo(e);a.mouseTrap.css("cursor",a.lens.css("cursor"));c=!1;a.options.tint&&(a.tint=b("<div />").css({display:"none",position:"absolute",
|
21 |
+
left:0,top:0,width:f.outerWidth(),height:f.outerHeight(),backgroundColor:a.options.tint,opacity:a.options.tintOpacity}).appendTo(e),a.lens.append(b("<img />",{src:f.attr("src")})),c=!0,a.tint.fadeIn(500));a.options.softFocus&&(a.softFocus=b("<div />").css({position:"absolute",display:"none",top:"1px",left:"1px",width:f.outerWidth(),height:f.outerHeight(),opacity:0.5}).appendTo(e),a.softFocus.append(b("<img />",{src:f.attr("src")})),0==a.lens.find("img").length&&a.lens.append(b("<img />",{src:f.attr("src")})),
|
22 |
+
c=!0,a.softFocus.fadeIn(500));c||a.lens.css("opacity",a.options.lensOpacity);"inside"!==a.options.position&&a.lens.fadeIn(500);a.zw._controlLoop()})},_controlLoop:function(){var a=this;if(this.lens){var b=this.mx-this.zoomImage.offset().left-0.5*this.cw>>0,e=this.my-this.zoomImage.offset().top-0.5*this.ch>>0;0>b?b=0:b>this.zoomImage.outerWidth()-this.cw&&(b=this.zoomImage.outerWidth()-this.cw);0>e?e=0:e>this.zoomImage.outerHeight()-this.ch&&(e=this.zoomImage.outerHeight()-this.ch);this.lens.css({left:b-
|
23 |
+
2,top:e-1});this.lens.find("img").css({width:this.zoomImage.outerWidth(),height:this.zoomImage.outerHeight(),marginLeft:-b+"px ",marginTop:-e+"px"});this.destU=1>=this.IMG_zoomImage.width?b/this.zoomImage.outerWidth()*this.IMG_zoomImage.naturalWidth>>0:b/this.zoomImage.outerWidth()*this.IMG_zoomImage.width>>0;this.destV=1>=this.IMG_zoomImage.height?e/this.zoomImage.outerHeight()*this.IMG_zoomImage.naturalHeight>>0:e/this.zoomImage.outerHeight()*this.IMG_zoomImage.height>>0;this.currU+=(this.destU-
|
24 |
+
this.currU)/this.options.smoothMove;this.currV+=(this.destV-this.currV)/this.options.smoothMove;this.zoomDiv.css("background-position",-(this.currU>>0)+"px "+(-(this.currV>>0)+"px"))}this.controlTimer=setTimeout(function(){a._controlLoop()},30)},_onLeave:function(){this.options.onLeave();this.zoomDiv&&(this.zoomDiv.remove(),this.zoomDiv=null);this._removeElements()},_removeElements:function(){this.lens&&(this.lens.remove(),this.lens=null);this.tint&&(this.tint.remove(),this.tint=null);this.softFocus&&
|
25 |
+
(this.softFocus.remove(),this.softFocus=null);0<this.element.find(".yith_magnifier_loading").length&&this.element.find(".yith_magnifier_loading").remove()},_isPhone:function(){var a=navigator.userAgent.toLowerCase();return a.match(/iphone/i)||a.match(/ipod/i)||a.match(/android/i)},destroy:function(){this.zoom&&this.zoom.unwrap();this.mouseTrap&&(this.mouseTrap.unbind(),this.mouseTrap.remove(),this.mouseTrap=null);this.zoomDiv&&(this.zoomDiv.remove(),this.zoomDiv=null);this.options.disableRightClick&&
|
26 |
+
b(document).unbind();this._removeElements();this.options.elements.gallery.unbind();this.element.removeData("yith_magnifier")}};b.fn.yith_magnifier=function(a){if("string"===typeof a){var d=Array.prototype.slice.call(arguments,1);this.each(function(){var e=b.data(this,"yith_magnifier");e?!b.isFunction(e[a])||"_"===a.charAt(0)?b.error("no such method '"+a+"' for yith_magnifier instance"):e[a].apply(e,d):b.error("cannot call methods on yith_magnifier prior to initialization; attempted to call method '"+
|
27 |
+
a+"'")})}else this.each(function(){b.data(this,"yith_magnifier")?b.error("yith_magnifier already istantiated."):b.data(this,"yith_magnifier",new b.yith_magnifier(a,this))});return this}})(window,jQuery);
|
class.yith-wcmg-admin.php
ADDED
@@ -0,0 +1,633 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Admin class
|
4 |
+
*
|
5 |
+
* @author Your Inspiration Themes
|
6 |
+
* @package YITH WooCommerce Zoom Magnifier
|
7 |
+
* @version 1.0.0
|
8 |
+
*/
|
9 |
+
|
10 |
+
if ( !defined( 'YITH_WCMG' ) ) { exit; } // Exit if accessed directly
|
11 |
+
|
12 |
+
if( !class_exists( 'YITH_WCMG_Admin' ) ) {
|
13 |
+
/**
|
14 |
+
* Admin class.
|
15 |
+
* The class manage all the admin behaviors.
|
16 |
+
*
|
17 |
+
* @since 1.0.0
|
18 |
+
*/
|
19 |
+
class YITH_WCMG_Admin {
|
20 |
+
/**
|
21 |
+
* Plugin options
|
22 |
+
*
|
23 |
+
* @var array
|
24 |
+
* @access public
|
25 |
+
* @since 1.0.0
|
26 |
+
*/
|
27 |
+
public $options = array();
|
28 |
+
|
29 |
+
/**
|
30 |
+
* Plugin version
|
31 |
+
*
|
32 |
+
* @var string
|
33 |
+
* @since 1.0.0
|
34 |
+
*/
|
35 |
+
public $version;
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Various links
|
39 |
+
*
|
40 |
+
* @var string
|
41 |
+
* @access public
|
42 |
+
* @since 1.0.0
|
43 |
+
*/
|
44 |
+
public $banner_url = 'http://cdn.yithemes.com/plugins/yith_magnifier.php?url';
|
45 |
+
public $banner_img = 'http://cdn.yithemes.com/plugins/yith_magnifier.php';
|
46 |
+
public $doc_url = 'http://yithemes.com/docs-plugins/yith_magnifier/';
|
47 |
+
|
48 |
+
/**
|
49 |
+
* Constructor
|
50 |
+
*
|
51 |
+
* @access public
|
52 |
+
* @since 1.0.0
|
53 |
+
*/
|
54 |
+
public function __construct( $version ) {
|
55 |
+
$this->options = $this->_initOptions();
|
56 |
+
$this->version = $version;
|
57 |
+
|
58 |
+
//Actions
|
59 |
+
add_action( 'init', array( $this, 'init' ) );
|
60 |
+
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_styles_scripts' ) );
|
61 |
+
add_filter( 'plugin_action_links_' . plugin_basename( dirname(__FILE__) . '/init.php' ), array( $this, 'action_links' ) );
|
62 |
+
|
63 |
+
add_action( 'woocommerce_settings_tabs_yith_wcmg', array( $this, 'print_plugin_options' ) );
|
64 |
+
add_action( 'woocommerce_update_options_yith_wcmg', array( $this, 'update_options' ) );
|
65 |
+
add_action( 'woocommerce_admin_field_slider', array( $this, 'admin_fields_slider' ) );
|
66 |
+
add_action( 'woocommerce_admin_field_picker', array( $this, 'admin_fields_picker' ) );
|
67 |
+
add_action( 'woocommerce_admin_field_banner', array( $this, 'admin_fields_banner' ) );
|
68 |
+
add_action( 'admin_print_footer_scripts', array( $this, 'admin_fields_image_deps' ) );
|
69 |
+
|
70 |
+
add_action( 'woocommerce_update_option_slider', array( $this, 'admin_update_option' ) );
|
71 |
+
add_action( 'woocommerce_update_option_picker', array( $this, 'admin_update_option' ) );
|
72 |
+
|
73 |
+
//Filters
|
74 |
+
add_filter( 'woocommerce_settings_tabs_array', array( $this, 'add_tab_woocommerce' ) );
|
75 |
+
add_filter( 'woocommerce_catalog_settings', array( $this, 'add_catalog_image_size' ) );
|
76 |
+
|
77 |
+
//Apply filters
|
78 |
+
$this->banner_url = apply_filters('yith_wcmg_banner_url', $this->banner_url);
|
79 |
+
|
80 |
+
// YITH WCMG Loaded
|
81 |
+
do_action( 'yith_wcmg_loaded' );
|
82 |
+
}
|
83 |
+
|
84 |
+
|
85 |
+
/**
|
86 |
+
* Init method:
|
87 |
+
* - default options
|
88 |
+
*
|
89 |
+
* @access public
|
90 |
+
* @since 1.0.0
|
91 |
+
*/
|
92 |
+
public function init() {
|
93 |
+
$this->_default_options();
|
94 |
+
}
|
95 |
+
|
96 |
+
|
97 |
+
/**
|
98 |
+
* Update plugin options.
|
99 |
+
*
|
100 |
+
* @return void
|
101 |
+
* @since 1.0.0
|
102 |
+
*/
|
103 |
+
public function update_options() {
|
104 |
+
foreach( $this->options as $option ) {
|
105 |
+
woocommerce_update_options( $option );
|
106 |
+
}
|
107 |
+
}
|
108 |
+
|
109 |
+
|
110 |
+
/**
|
111 |
+
* Add Magnifier's tab to Woocommerce -> Settings page
|
112 |
+
*
|
113 |
+
* @access public
|
114 |
+
* @param array $tabs
|
115 |
+
*
|
116 |
+
* @return array
|
117 |
+
*/
|
118 |
+
public function add_tab_woocommerce($tabs) {
|
119 |
+
$tabs['yith_wcmg'] = __('Magnifier', 'yit');
|
120 |
+
|
121 |
+
return $tabs;
|
122 |
+
}
|
123 |
+
|
124 |
+
|
125 |
+
/**
|
126 |
+
* Add Zoom Image size to Woocommerce -> Catalog
|
127 |
+
*
|
128 |
+
* @access public
|
129 |
+
* @param array $settings
|
130 |
+
*
|
131 |
+
* @return array
|
132 |
+
*/
|
133 |
+
public function add_catalog_image_size( $settings ) {
|
134 |
+
$tmp = $settings[ count($settings)-1 ];
|
135 |
+
unset( $settings[ count($settings)-1 ] );
|
136 |
+
|
137 |
+
$settings[] = array(
|
138 |
+
'name' => __( 'Catalog Zoom Images', 'yit' ),
|
139 |
+
'desc' => __('The size of images used within the magnifier box', 'yit'),
|
140 |
+
'id' => 'woocommerce_magnifier_image',
|
141 |
+
'css' => '',
|
142 |
+
'type' => 'image_width',
|
143 |
+
'default' => array(
|
144 |
+
'width' => 600,
|
145 |
+
'height' => 600,
|
146 |
+
'crop' => true
|
147 |
+
),
|
148 |
+
'std' => array(
|
149 |
+
'width' => 600,
|
150 |
+
'height' => 600,
|
151 |
+
'crop' => true
|
152 |
+
),
|
153 |
+
'desc_tip' => true
|
154 |
+
);
|
155 |
+
$settings[] = $tmp;
|
156 |
+
return $settings;
|
157 |
+
}
|
158 |
+
|
159 |
+
|
160 |
+
/**
|
161 |
+
* Print all plugin options.
|
162 |
+
*
|
163 |
+
* @return void
|
164 |
+
* @since 1.0.0
|
165 |
+
*/
|
166 |
+
public function print_plugin_options() {
|
167 |
+
$links = apply_filters( 'yith_wcmg_tab_links', array(
|
168 |
+
'<a href="#yith_wcmg_general">' . __( 'General Settings', 'yit' ) . '</a>',
|
169 |
+
'<a href="#yith_wcmg_magnifier">' . __( 'Magnifier', 'yit' ) . '</a>',
|
170 |
+
'<a href="#yith_wcmg_slider">' . __( 'Slider', 'yit' ) . '</a>'
|
171 |
+
) );
|
172 |
+
|
173 |
+
$this->_printBanner();
|
174 |
+
?>
|
175 |
+
|
176 |
+
<div class="subsubsub_section">
|
177 |
+
<ul class="subsubsub">
|
178 |
+
<li>
|
179 |
+
<?php echo implode( ' | </li><li>', $links ) ?>
|
180 |
+
</li>
|
181 |
+
</ul>
|
182 |
+
<br class="clear" />
|
183 |
+
|
184 |
+
<?php foreach( $this->options as $id => $tab ) : ?>
|
185 |
+
<!-- tab #<?php echo $id ?> -->
|
186 |
+
<div class="section" id="yith_wcmg_<?php echo $id ?>">
|
187 |
+
<?php woocommerce_admin_fields( $this->options[$id] ) ?>
|
188 |
+
</div>
|
189 |
+
<?php endforeach ?>
|
190 |
+
</div>
|
191 |
+
<?php
|
192 |
+
}
|
193 |
+
|
194 |
+
|
195 |
+
/**
|
196 |
+
* Initialize the options
|
197 |
+
*
|
198 |
+
* @access protected
|
199 |
+
* @return array
|
200 |
+
* @since 1.0.0
|
201 |
+
*/
|
202 |
+
protected function _initOptions() {
|
203 |
+
$options = array(
|
204 |
+
'general' => array(
|
205 |
+
array(
|
206 |
+
'name' => __( 'General Settings', 'yit' ),
|
207 |
+
'type' => 'title',
|
208 |
+
'desc' => '',
|
209 |
+
'id' => 'yith_wcmg_general'
|
210 |
+
),
|
211 |
+
|
212 |
+
array(
|
213 |
+
'name' => __( 'Enable YITH Magnifier', 'yit' ),
|
214 |
+
'desc' => __( 'Enable the plugin or use the Woocommerce default product image.', 'yit' ),
|
215 |
+
'id' => 'yith_wcmg_enable_plugin',
|
216 |
+
'std' => 'yes',
|
217 |
+
'default' => 'yes',
|
218 |
+
'type' => 'checkbox'
|
219 |
+
),
|
220 |
+
|
221 |
+
array(
|
222 |
+
'name' => __( 'Forcing Zoom Image sizes', 'yit' ),
|
223 |
+
'desc' => __( 'If disabled, you will able to customize the sizes of Zoom Images. Please disable at your own risk; the magnifier should not properly work with unproportioned image sizes.', 'yit' ),
|
224 |
+
'id' => 'yith_wcmg_force_sizes',
|
225 |
+
'std' => 'yes',
|
226 |
+
'default' => 'yes',
|
227 |
+
'type' => 'checkbox'
|
228 |
+
),
|
229 |
+
|
230 |
+
array( 'type' => 'sectionend', 'id' => 'yith_wcmg_general_end' )
|
231 |
+
),
|
232 |
+
'magnifier' => array(
|
233 |
+
array(
|
234 |
+
'name' => __( 'Magnifier Settings', 'yit' ),
|
235 |
+
'type' => 'title',
|
236 |
+
'desc' => '',
|
237 |
+
'id' => 'yith_wcmg_magnifier'
|
238 |
+
),
|
239 |
+
|
240 |
+
array(
|
241 |
+
'name' => __( 'Zoom Area Width', 'yit' ),
|
242 |
+
'desc' => __( 'The width of magnifier box (default: auto)', 'yit' ),
|
243 |
+
'id' => 'yith_wcmg_zoom_width',
|
244 |
+
'std' => 'auto',
|
245 |
+
'default' => 'auto',
|
246 |
+
'type' => 'text',
|
247 |
+
),
|
248 |
+
|
249 |
+
array(
|
250 |
+
'name' => __( 'Zoom Area Height', 'yit' ),
|
251 |
+
'desc' => __( 'The height of magnifier box (default: auto)', 'yit' ),
|
252 |
+
'id' => 'yith_wcmg_zoom_height',
|
253 |
+
'std' => 'auto',
|
254 |
+
'default' => 'auto',
|
255 |
+
'type' => 'text',
|
256 |
+
),
|
257 |
+
|
258 |
+
array(
|
259 |
+
'name' => __( 'Zoom Area Position', 'yit' ),
|
260 |
+
'desc' => __( 'The magnifier position', 'yit' ),
|
261 |
+
'id' => 'yith_wcmg_zoom_position',
|
262 |
+
'std' => 'right',
|
263 |
+
'default' => 'right',
|
264 |
+
'type' => 'select',
|
265 |
+
'options' => array(
|
266 |
+
'right' => __( 'Right', 'yit' ),
|
267 |
+
'inside' => __( 'Inside', 'yit' )
|
268 |
+
)
|
269 |
+
),
|
270 |
+
|
271 |
+
array(
|
272 |
+
'name' => __( 'Zoom Area Mobile Position', 'yit' ),
|
273 |
+
'desc' => __( 'The magnifier position with mobile devices (iPhone, Android, etc.)', 'yit' ),
|
274 |
+
'id' => 'yith_wcmg_zoom_mobile_position',
|
275 |
+
'std' => 'default',
|
276 |
+
'default' => 'inside',
|
277 |
+
'type' => 'select',
|
278 |
+
'options' => array(
|
279 |
+
'default' => __( 'Default', 'yit' ),
|
280 |
+
'inside' => __( 'Inside', 'yit' ),
|
281 |
+
'disable' => __( 'Disable', 'yit' )
|
282 |
+
)
|
283 |
+
),
|
284 |
+
|
285 |
+
array(
|
286 |
+
'name' => __( 'Loading label', 'yit' ),
|
287 |
+
'desc' => '',
|
288 |
+
'id' => 'yith_wcmg_loading_label',
|
289 |
+
'std' => __('Loading...', 'yit' ),
|
290 |
+
'default' => __('Loading...', 'yit' ),
|
291 |
+
'type' => 'text',
|
292 |
+
),
|
293 |
+
/*
|
294 |
+
array(
|
295 |
+
'name' => __( 'Tint', 'yit' ),
|
296 |
+
'desc' => '',
|
297 |
+
'id' => 'yith_wcmg_tint',
|
298 |
+
'std' => '',
|
299 |
+
'default' => '',
|
300 |
+
'type' => 'picker',
|
301 |
+
),
|
302 |
+
|
303 |
+
array(
|
304 |
+
'name' => __( 'Tint Opacity', 'yit' ),
|
305 |
+
'desc' => '',
|
306 |
+
'id' => 'yith_wcmg_tint_opacity',
|
307 |
+
'std' => 0.5,
|
308 |
+
'default' => 0.5,
|
309 |
+
'type' => 'slider',
|
310 |
+
'min' => 0,
|
311 |
+
'max' => 1,
|
312 |
+
'step' => .1
|
313 |
+
),
|
314 |
+
*/
|
315 |
+
array(
|
316 |
+
'name' => __( 'Lens Opacity', 'yit' ),
|
317 |
+
'desc' => '',
|
318 |
+
'id' => 'yith_wcmg_lens_opacity',
|
319 |
+
'std' => 0.5,
|
320 |
+
'default' => 0.5,
|
321 |
+
'type' => 'slider',
|
322 |
+
'min' => 0,
|
323 |
+
'max' => 1,
|
324 |
+
'step' => .1
|
325 |
+
),
|
326 |
+
/*
|
327 |
+
array(
|
328 |
+
'name' => __( 'Smoothness', 'yit' ),
|
329 |
+
'desc' => '',
|
330 |
+
'id' => 'yith_wcmg_smooth',
|
331 |
+
'std' => 3,
|
332 |
+
'default' => 3,
|
333 |
+
'type' => 'slider',
|
334 |
+
'min' => 1,
|
335 |
+
'max' => 5,
|
336 |
+
'step' => 1
|
337 |
+
),
|
338 |
+
*/
|
339 |
+
array(
|
340 |
+
'name' => __( 'Blur', 'yit' ),
|
341 |
+
'desc' => __( 'Add a blur effect to the small image on mouse hover.', 'yit' ),
|
342 |
+
'id' => 'yith_wcmg_softfocus',
|
343 |
+
'std' => 'no',
|
344 |
+
'default' => 'no',
|
345 |
+
'type' => 'checkbox'
|
346 |
+
),
|
347 |
+
|
348 |
+
array( 'type' => 'sectionend', 'id' => 'yith_wcmg_magnifier_end' )
|
349 |
+
),
|
350 |
+
'slider' => array(
|
351 |
+
array(
|
352 |
+
'name' => __( 'Slider Settings', 'yit' ),
|
353 |
+
'type' => 'title',
|
354 |
+
'desc' => '',
|
355 |
+
'id' => 'yith_wcmg_slider'
|
356 |
+
),
|
357 |
+
|
358 |
+
array(
|
359 |
+
'name' => __( 'Enable Slider', 'yit' ),
|
360 |
+
'desc' => __( 'Enable Thumbnail slider.', 'yit' ),
|
361 |
+
'id' => 'yith_wcmg_enableslider',
|
362 |
+
'std' => 'yes',
|
363 |
+
'default' => 'yes',
|
364 |
+
'type' => 'checkbox'
|
365 |
+
),
|
366 |
+
|
367 |
+
array(
|
368 |
+
'name' => __( 'Enable Slider Responsive', 'yit' ),
|
369 |
+
'desc' => __( 'The option fits the thumbnails within the available space. Disable it if you want to manage by yourself the thumbnails (eg. add margins, paddings, etc.)', 'yit' ),
|
370 |
+
'id' => 'yith_wcmg_slider_responsive',
|
371 |
+
'std' => 'yes',
|
372 |
+
'default' => 'yes',
|
373 |
+
'type' => 'checkbox'
|
374 |
+
),
|
375 |
+
|
376 |
+
array(
|
377 |
+
'name' => __( 'Items', 'yit' ),
|
378 |
+
'desc' => __( 'Number of items to show', 'yit' ),
|
379 |
+
'id' => 'yith_wcmg_slider_items',
|
380 |
+
'std' => 3,
|
381 |
+
'default' => 3,
|
382 |
+
'type' => 'slider',
|
383 |
+
'min' => 1,
|
384 |
+
'max' => 10,
|
385 |
+
'step' => 1
|
386 |
+
),
|
387 |
+
|
388 |
+
array(
|
389 |
+
'name' => __( 'Circular carousel', 'yit' ),
|
390 |
+
'desc' => __( 'Determines whether the carousel should be circular.', 'yit' ),
|
391 |
+
'id' => 'yith_wcmg_slider_circular',
|
392 |
+
'std' => 'yes',
|
393 |
+
'default' => 'yes',
|
394 |
+
'type' => 'checkbox'
|
395 |
+
),
|
396 |
+
|
397 |
+
array(
|
398 |
+
'name' => __( 'Infinite carousel', 'yit' ),
|
399 |
+
'desc' => __( 'Determines whether the carousel should be infinite. Note: It is possible to create a non-circular, infinite carousel, but it is not possible to create a circular, non-infinite carousel.', 'yit' ),
|
400 |
+
'id' => 'yith_wcmg_slider_infinite',
|
401 |
+
'std' => 'yes',
|
402 |
+
'default' => 'yes',
|
403 |
+
'type' => 'checkbox'
|
404 |
+
),
|
405 |
+
/*
|
406 |
+
array(
|
407 |
+
'name' => __( 'Slider direction', 'yit' ),
|
408 |
+
'desc' => __( 'The direction to scroll the carousel.', 'yit' ),
|
409 |
+
'id' => 'yith_wcmg_slider_direction',
|
410 |
+
'std' => 'yes',
|
411 |
+
'default' => 'yes',
|
412 |
+
'type' => 'select',
|
413 |
+
'options' => array(
|
414 |
+
'left' => __('Left', 'yit' ),
|
415 |
+
'right' => __('Right', 'yit' )
|
416 |
+
)
|
417 |
+
),
|
418 |
+
*/
|
419 |
+
array( 'type' => 'sectionend', 'id' => 'yith_wcmg_slider_end' )
|
420 |
+
)
|
421 |
+
);
|
422 |
+
|
423 |
+
return apply_filters('yith_wcmg_tab_options', $options);
|
424 |
+
}
|
425 |
+
|
426 |
+
|
427 |
+
/**
|
428 |
+
* Default options
|
429 |
+
*
|
430 |
+
* Sets up the default options used on the settings page
|
431 |
+
*
|
432 |
+
* @access protected
|
433 |
+
* @return void
|
434 |
+
* @since 1.0.0
|
435 |
+
*/
|
436 |
+
protected function _default_options() {
|
437 |
+
foreach ($this->options as $section) {
|
438 |
+
foreach ( $section as $value ) {
|
439 |
+
if ( isset( $value['std'] ) && isset( $value['id'] ) ) {
|
440 |
+
if ( $value['type'] == 'image_width' ) {
|
441 |
+
add_option($value['id'].'_width', $value['std']);
|
442 |
+
add_option($value['id'].'_height', $value['std']);
|
443 |
+
} else {
|
444 |
+
add_option($value['id'], $value['std']);
|
445 |
+
}
|
446 |
+
}
|
447 |
+
}
|
448 |
+
}
|
449 |
+
}
|
450 |
+
|
451 |
+
|
452 |
+
/**
|
453 |
+
* Create new Woocommerce admin field: slider
|
454 |
+
*
|
455 |
+
* @access public
|
456 |
+
* @param array $value
|
457 |
+
* @return void
|
458 |
+
* @since 1.0.0
|
459 |
+
*/
|
460 |
+
public function admin_fields_slider( $value ) {
|
461 |
+
$slider_value = ( get_option( $value['id'] ) !== false && get_option( $value['id'] ) !== null ) ?
|
462 |
+
esc_attr( stripslashes( get_option($value['id'] ) ) ) :
|
463 |
+
esc_attr( $value['std'] );
|
464 |
+
|
465 |
+
?><tr valign="top">
|
466 |
+
<th scope="row" class="titledesc">
|
467 |
+
<label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo $value['name']; ?></label>
|
468 |
+
</th>
|
469 |
+
<td class="forminp">
|
470 |
+
<div id="<?php echo esc_attr( $value['id'] ); ?>_slider" class="yith_woocommerce_slider" style="width: 300px; float: left;"></div>
|
471 |
+
<div id="<?php echo esc_attr( $value['id'] ); ?>_value" class="yith_woocommerce_slider_value ui-state-default ui-corner-all"><?php echo $slider_value ?></div>
|
472 |
+
<input name="<?php echo esc_attr( $value['id'] ); ?>" id="<?php echo esc_attr( $value['id'] ); ?>" type="hidden" value="<?php echo $slider_value ?>" /> <?php echo $value['desc']; ?></td>
|
473 |
+
</tr>
|
474 |
+
|
475 |
+
|
476 |
+
|
477 |
+
<script>
|
478 |
+
jQuery(document).ready(function($){
|
479 |
+
$('#<?php echo esc_attr( $value['id'] ); ?>_slider').slider({
|
480 |
+
min: <?php echo $value['min'] ?>,
|
481 |
+
max: <?php echo $value['max'] ?>,
|
482 |
+
step: <?php echo $value['step'] ?>,
|
483 |
+
value: <?php echo $slider_value ?>,
|
484 |
+
slide: function( event, ui ) {
|
485 |
+
$( "#<?php echo esc_attr( $value['id'] ); ?>" ).val( ui.value );
|
486 |
+
$( "#<?php echo esc_attr( $value['id'] ); ?>_value" ).text( ui.value );
|
487 |
+
}
|
488 |
+
});
|
489 |
+
});
|
490 |
+
</script>
|
491 |
+
|
492 |
+
<?php
|
493 |
+
}
|
494 |
+
|
495 |
+
|
496 |
+
/**
|
497 |
+
* Create new Woocommerce admin field: picker
|
498 |
+
*
|
499 |
+
* @access public
|
500 |
+
* @param array $value
|
501 |
+
* @return void
|
502 |
+
* @since 1.0.0
|
503 |
+
*/
|
504 |
+
public function admin_fields_picker( $value ) {
|
505 |
+
$picker_value = ( get_option( $value['id'] ) !== false && get_option( $value['id'] ) !== null ) ?
|
506 |
+
esc_attr( stripslashes( get_option($value['id'] ) ) ) :
|
507 |
+
esc_attr( $value['std'] );
|
508 |
+
|
509 |
+
?><tr valign="top">
|
510 |
+
<th scope="row" class="titledesc">
|
511 |
+
<label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo $value['name']; ?></label>
|
512 |
+
</th>
|
513 |
+
<td class="forminp">
|
514 |
+
<div class="color_box"><strong><?php echo $value['name']; ?></strong>
|
515 |
+
<input name="<?php echo esc_attr( $value['id'] ) ?>" id="<?php echo esc_attr( $value['id'] ) ?>" type="text" value="<?php echo $picker_value ?>" class="colorpick" /> <div id="colorPickerDiv_<?php echo esc_attr( $value['id'] ) ?>" class="colorpickdiv"></div>
|
516 |
+
</div> <?php echo $value['desc']; ?></td>
|
517 |
+
</tr>
|
518 |
+
<?php
|
519 |
+
}
|
520 |
+
|
521 |
+
/**
|
522 |
+
* Save the admin field: slider
|
523 |
+
*
|
524 |
+
* @access public
|
525 |
+
* @param mixed $value
|
526 |
+
* @return void
|
527 |
+
* @since 1.0.0
|
528 |
+
*/
|
529 |
+
public function admin_update_option($value) {
|
530 |
+
update_option( $value['id'], woocommerce_clean($_POST[$value['id']]) );
|
531 |
+
}
|
532 |
+
|
533 |
+
/**
|
534 |
+
* Create new Woocommerce admin field: image deps
|
535 |
+
*
|
536 |
+
* @access public
|
537 |
+
* @param array $value
|
538 |
+
* @return void
|
539 |
+
* @since 1.0.0
|
540 |
+
*/
|
541 |
+
public function admin_fields_image_deps( $value ) {
|
542 |
+
global $woocommerce;
|
543 |
+
|
544 |
+
$force = get_option('yith_wcmg_force_sizes') == 'yes';
|
545 |
+
|
546 |
+
if( $force ) {
|
547 |
+
$value['desc'] = 'These values are automatically calculated based on the values of the Single product. If you\'d like to customize yourself the values, please disable the "Forcing Zoom Image sizes" in "Magnifier" tab.';
|
548 |
+
}
|
549 |
+
|
550 |
+
if( $force && isset($_GET['page']) && isset($_GET['tab']) && $_GET['page'] == 'woocommerce_settings' && $_GET['tab'] == 'catalog' ): ?>
|
551 |
+
<script>
|
552 |
+
jQuery(document).ready(function($){
|
553 |
+
$('#woocommerce_magnifier_image-width, #woocommerce_magnifier_image-height, #woocommerce_magnifier_image-crop').attr('disabled', 'disabled');
|
554 |
+
|
555 |
+
$('#shop_single_image_size-width, #shop_single_image_size-height').on('keyup', function(){
|
556 |
+
var value = parseInt( $(this).val() );
|
557 |
+
var input = (this.id).indexOf('width') >= 0 ? 'width' : 'height';
|
558 |
+
|
559 |
+
if( !isNaN(value) ) {
|
560 |
+
$('#woocommerce_magnifier_image-' + input).val( value * 2 );
|
561 |
+
}
|
562 |
+
});
|
563 |
+
|
564 |
+
$('#shop_single_image_size-crop').on('change', function(){
|
565 |
+
if( $(this).is(':checked') ) {
|
566 |
+
$('#woocommerce_magnifier_image-crop').attr('checked', 'checked');
|
567 |
+
} else {
|
568 |
+
$('#woocommerce_magnifier_image-crop').removeAttr('checked');
|
569 |
+
}
|
570 |
+
});
|
571 |
+
|
572 |
+
$('#mainform').on('submit', function(){
|
573 |
+
$(':disabled').removeAttr('disabled');
|
574 |
+
});
|
575 |
+
});
|
576 |
+
</script>
|
577 |
+
<?php endif;
|
578 |
+
}
|
579 |
+
|
580 |
+
|
581 |
+
/**
|
582 |
+
* Enqueue admin styles and scripts
|
583 |
+
*
|
584 |
+
* @access public
|
585 |
+
* @return void
|
586 |
+
* @since 1.0.0
|
587 |
+
*/
|
588 |
+
public function enqueue_styles_scripts() {
|
589 |
+
wp_enqueue_script( 'jquery-ui' );
|
590 |
+
wp_enqueue_script( 'jquery-ui-core' );
|
591 |
+
wp_enqueue_script( 'jquery-ui-mouse' );
|
592 |
+
wp_enqueue_script( 'jquery-ui-slider' );
|
593 |
+
|
594 |
+
wp_enqueue_style( 'yith_wcmg_admin', YITH_WCMG_URL . 'assets/css/admin.css' );
|
595 |
+
}
|
596 |
+
|
597 |
+
|
598 |
+
/**
|
599 |
+
* Print the banner
|
600 |
+
*
|
601 |
+
* @access protected
|
602 |
+
* @return void
|
603 |
+
* @since 1.0.0
|
604 |
+
*/
|
605 |
+
protected function _printBanner() {
|
606 |
+
?>
|
607 |
+
<div class="yith_banner">
|
608 |
+
<a href="<?php echo $this->banner_url ?>" target="_blank">
|
609 |
+
<img src="<?php echo $this->banner_img ?>" alt="" />
|
610 |
+
</a>
|
611 |
+
</div>
|
612 |
+
<?php
|
613 |
+
}
|
614 |
+
|
615 |
+
|
616 |
+
/**
|
617 |
+
* action_links function.
|
618 |
+
*
|
619 |
+
* @access public
|
620 |
+
* @param mixed $links
|
621 |
+
* @return void
|
622 |
+
*/
|
623 |
+
public function action_links( $links ) {
|
624 |
+
|
625 |
+
$plugin_links = array(
|
626 |
+
'<a href="' . admin_url( 'admin.php?page=woocommerce_settings&tab=yith_wcmg' ) . '">' . __( 'Settings', 'yit' ) . '</a>',
|
627 |
+
'<a href="' . $this->doc_url . '">' . __( 'Docs', 'yit' ) . '</a>',
|
628 |
+
);
|
629 |
+
|
630 |
+
return array_merge( $plugin_links, $links );
|
631 |
+
}
|
632 |
+
}
|
633 |
+
}
|
class.yith-wcmg-frontend.php
ADDED
@@ -0,0 +1,116 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Frontend class
|
4 |
+
*
|
5 |
+
* @author Your Inspiration Themes
|
6 |
+
* @package YITH WooCommerce Zoom Magnifier
|
7 |
+
* @version 1.0.0
|
8 |
+
*/
|
9 |
+
|
10 |
+
if ( !defined( 'YITH_WCMG' ) ) { exit; } // Exit if accessed directly
|
11 |
+
|
12 |
+
if( !class_exists( 'YITH_WCMG_Frontend' ) ) {
|
13 |
+
/**
|
14 |
+
* Admin class.
|
15 |
+
* The class manage all the Frontend behaviors.
|
16 |
+
*
|
17 |
+
* @since 1.0.0
|
18 |
+
*/
|
19 |
+
class YITH_WCMG_Frontend {
|
20 |
+
/**
|
21 |
+
* Plugin version
|
22 |
+
*
|
23 |
+
* @var string
|
24 |
+
* @since 1.0.0
|
25 |
+
*/
|
26 |
+
public $version;
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Constructor
|
30 |
+
*
|
31 |
+
* @access public
|
32 |
+
* @since 1.0.0
|
33 |
+
*/
|
34 |
+
public function __construct( $version ) {
|
35 |
+
$this->version = $version;
|
36 |
+
|
37 |
+
if( yith_wcmg_is_enabled() ) {
|
38 |
+
//change the templates
|
39 |
+
remove_action( 'woocommerce_before_single_product_summary', 'woocommerce_show_product_images', 20 );
|
40 |
+
remove_action( 'woocommerce_product_thumbnails', 'woocommerce_show_product_thumbnails', 20 );
|
41 |
+
add_action( 'woocommerce_before_single_product_summary', array($this, 'show_product_images'), 20 );
|
42 |
+
add_action( 'woocommerce_product_thumbnails', array($this, 'show_product_thumbnails'), 20 );
|
43 |
+
|
44 |
+
//custom styles and javascripts
|
45 |
+
add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_styles_scripts' ) );
|
46 |
+
|
47 |
+
//add attributes to product variations
|
48 |
+
add_filter( 'woocommerce_available_variation', array( $this, 'available_variation' ), 10, 3);
|
49 |
+
}
|
50 |
+
}
|
51 |
+
|
52 |
+
|
53 |
+
/**
|
54 |
+
* Change product-single.php template
|
55 |
+
*
|
56 |
+
* @access public
|
57 |
+
* @return void
|
58 |
+
* @since 1.0.0
|
59 |
+
*/
|
60 |
+
public function show_product_images() {
|
61 |
+
woocommerce_get_template( 'single-product/product-image-magnifier.php', array(), '', YITH_WCMG_DIR . 'templates/' );
|
62 |
+
}
|
63 |
+
|
64 |
+
|
65 |
+
/**
|
66 |
+
* Change product-thumbnails.php template
|
67 |
+
*
|
68 |
+
* @access public
|
69 |
+
* @return void
|
70 |
+
* @since 1.0.0
|
71 |
+
*/
|
72 |
+
public function show_product_thumbnails() {
|
73 |
+
woocommerce_get_template( 'single-product/product-thumbnails-magnifier.php', array(), '', YITH_WCMG_DIR . 'templates/' );
|
74 |
+
}
|
75 |
+
|
76 |
+
|
77 |
+
/**
|
78 |
+
* Enqueue styles and scripts
|
79 |
+
*
|
80 |
+
* @access public
|
81 |
+
* @return void
|
82 |
+
* @since 1.0.0
|
83 |
+
*/
|
84 |
+
public function enqueue_styles_scripts() {
|
85 |
+
global $post;
|
86 |
+
|
87 |
+
if( is_product() || ( ! empty( $post->post_content ) && strstr( $post->post_content, '[product_page' ) ) ) {
|
88 |
+
$suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
|
89 |
+
|
90 |
+
wp_enqueue_script('jquery-caroufredsel', YITH_WCMG_URL . 'assets/js/jquery.carouFredSel' . $suffix .'.js', array('jquery'), '6.2.1', true);
|
91 |
+
wp_enqueue_script('yith-magnifier', YITH_WCMG_URL . 'assets/js/yith_magnifier' . $suffix .'.js', array('jquery'), $this->version, true);
|
92 |
+
wp_enqueue_script('yith_wcmg_frontend', YITH_WCMG_URL . 'assets/js/frontend' . $suffix .'.js', array('jquery', 'yith-magnifier'), $this->version, true);
|
93 |
+
wp_enqueue_style( 'yith-magnifier', YITH_WCMG_URL . 'assets/css/yith_magnifier.css' );
|
94 |
+
|
95 |
+
$css = file_exists( get_stylesheet_directory() . '/woocommerce/yith_magnifier.css' ) ? get_stylesheet_directory_uri() . '/woocommerce/yith_magnifier.css' : YITH_WCMG_URL . 'assets/css/frontend.css';
|
96 |
+
wp_enqueue_style( 'yith_wcmg_frontend', $css );
|
97 |
+
}
|
98 |
+
}
|
99 |
+
|
100 |
+
|
101 |
+
/**
|
102 |
+
* Add attributes to product variations
|
103 |
+
*
|
104 |
+
* @access public
|
105 |
+
* @return void
|
106 |
+
* @since 1.0.0
|
107 |
+
*/
|
108 |
+
public function available_variation( $data, $wc_prod, $variation ) {
|
109 |
+
$attachment_id = get_post_thumbnail_id( $variation->get_variation_id() );
|
110 |
+
$attachment = wp_get_attachment_image_src( $attachment_id, 'shop_magnifier' );
|
111 |
+
|
112 |
+
$data['image_magnifier'] = $attachment ? current( $attachment ) : '';
|
113 |
+
return $data;
|
114 |
+
}
|
115 |
+
}
|
116 |
+
}
|
class.yith-wcmg.php
ADDED
@@ -0,0 +1,88 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Main class
|
4 |
+
*
|
5 |
+
* @author Your Inspiration Themes
|
6 |
+
* @package YITH WooCommerce Zoom Magnifier
|
7 |
+
* @version 1.0.0
|
8 |
+
*/
|
9 |
+
|
10 |
+
if ( !defined( 'YITH_WCMG' ) ) { exit; } // Exit if accessed directly
|
11 |
+
|
12 |
+
if( !class_exists( 'YITH_WCMG' ) ) {
|
13 |
+
/**
|
14 |
+
* WooCommerce Magnifier
|
15 |
+
*
|
16 |
+
* @since 1.0.0
|
17 |
+
*/
|
18 |
+
class YITH_WCMG {
|
19 |
+
/**
|
20 |
+
* Plugin version
|
21 |
+
*
|
22 |
+
* @var string
|
23 |
+
* @since 1.0.0
|
24 |
+
*/
|
25 |
+
public $version = '1.0.0';
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Plugin object
|
29 |
+
*
|
30 |
+
* @var string
|
31 |
+
* @since 1.0.0
|
32 |
+
*/
|
33 |
+
public $obj = null;
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Constructor
|
37 |
+
*
|
38 |
+
* @return mixed|YITH_WCMG_Admin|YITH_WCMG_Frontend
|
39 |
+
* @since 1.0.0
|
40 |
+
*/
|
41 |
+
public function __construct() {
|
42 |
+
load_plugin_textdomain( 'yit', false, YITH_WCMG_DIR . 'languages/' );
|
43 |
+
|
44 |
+
// actions
|
45 |
+
add_action( 'init', array( $this, 'init' ) );
|
46 |
+
|
47 |
+
if( is_admin() ) {
|
48 |
+
$this->obj = new YITH_WCMG_Admin( $this->version );
|
49 |
+
} else {
|
50 |
+
$this->obj = new YITH_WCMG_Frontend( $this->version );
|
51 |
+
}
|
52 |
+
|
53 |
+
return $this->obj;
|
54 |
+
}
|
55 |
+
|
56 |
+
|
57 |
+
/**
|
58 |
+
* Init method:
|
59 |
+
* - default options
|
60 |
+
*
|
61 |
+
* @access public
|
62 |
+
* @since 1.0.0
|
63 |
+
*/
|
64 |
+
public function init() {
|
65 |
+
$this->_image_sizes();
|
66 |
+
}
|
67 |
+
|
68 |
+
|
69 |
+
/**
|
70 |
+
* Add image sizes
|
71 |
+
*
|
72 |
+
* Init images
|
73 |
+
*
|
74 |
+
* @access protected
|
75 |
+
* @return void
|
76 |
+
* @since 1.0.0
|
77 |
+
*/
|
78 |
+
protected function _image_sizes() {
|
79 |
+
$size = get_option('woocommerce_magnifier_image');
|
80 |
+
$width = $size['width'];
|
81 |
+
$height = $size['height'];
|
82 |
+
$crop = $size['crop'];
|
83 |
+
|
84 |
+
add_image_size( 'shop_magnifier', $width, $height, $crop );
|
85 |
+
}
|
86 |
+
|
87 |
+
}
|
88 |
+
}
|
functions.yith-wcmg.php
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Functions
|
4 |
+
*
|
5 |
+
* @author Your Inspiration Themes
|
6 |
+
* @package YITH WooCommerce Zoom Magnifier
|
7 |
+
* @version 1.0.0
|
8 |
+
*/
|
9 |
+
|
10 |
+
if ( !defined( 'YITH_WCMG' ) ) { exit; } // Exit if accessed directly
|
11 |
+
|
12 |
+
if( !function_exists( 'yith_wcmg_is_enabled' ) ) {
|
13 |
+
/**
|
14 |
+
* Locate the templates and return the path of the file found
|
15 |
+
*
|
16 |
+
* @param string $path
|
17 |
+
* @param array $var
|
18 |
+
* @return void
|
19 |
+
* @since 1.0.0
|
20 |
+
*/
|
21 |
+
function yith_wcmg_is_enabled() {
|
22 |
+
return get_option('yith_wcmg_enable_plugin') == 'yes';
|
23 |
+
}
|
24 |
+
}
|
25 |
+
|
26 |
+
if( !function_exists( 'yit_shop_single_w' ) ) {
|
27 |
+
/**
|
28 |
+
* Return the shop_single image width
|
29 |
+
*
|
30 |
+
* @return integer
|
31 |
+
* @since 1.0.0
|
32 |
+
*/
|
33 |
+
function yit_shop_single_w() {
|
34 |
+
global $woocommerce;
|
35 |
+
$size = $woocommerce->get_image_size('shop_single');
|
36 |
+
return $size['width'];
|
37 |
+
}
|
38 |
+
}
|
39 |
+
|
40 |
+
if( !function_exists( 'yit_shop_thumbnail_w' ) ) {
|
41 |
+
/**
|
42 |
+
* Return the shop_thumbnail image width
|
43 |
+
*
|
44 |
+
* @return integer
|
45 |
+
* @since 1.0.0
|
46 |
+
*/
|
47 |
+
function yit_shop_thumbnail_w() {
|
48 |
+
global $woocommerce;
|
49 |
+
$size = $woocommerce->get_image_size('shop_thumbnail');
|
50 |
+
return $size['width'];
|
51 |
+
}
|
52 |
+
}
|
init.php
ADDED
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Plugin Name: YITH WooCommerce Zoom Magnifier
|
4 |
+
* Plugin URI: http://yithemes.com/
|
5 |
+
* Description: YITH WooCommerce Zoom Magnifier enables you to add a zoom effect to product images.
|
6 |
+
* Version: 1.0.0
|
7 |
+
* Author: Your Inspiration Themes
|
8 |
+
* Author URI: http://yithemes.com/
|
9 |
+
* Text Domain: yit
|
10 |
+
* Domain Path: /languages/
|
11 |
+
*
|
12 |
+
* @author Your Inspiration Themes
|
13 |
+
* @package YITH WooCommerce Magnifier
|
14 |
+
* @version 1.0.0
|
15 |
+
*/
|
16 |
+
/* Copyright 2013 Your Inspiration Themes (email : plugins@yithemes.com)
|
17 |
+
|
18 |
+
This program is free software; you can redistribute it and/or modify
|
19 |
+
it under the terms of the GNU General Public License, version 2, as
|
20 |
+
published by the Free Software Foundation.
|
21 |
+
|
22 |
+
This program is distributed in the hope that it will be useful,
|
23 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
24 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
25 |
+
GNU General Public License for more details.
|
26 |
+
|
27 |
+
You should have received a copy of the GNU General Public License
|
28 |
+
along with this program; if not, write to the Free Software
|
29 |
+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
30 |
+
*/
|
31 |
+
if ( !defined( 'ABSPATH' ) ) { exit; } // Exit if accessed directly
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Required functions
|
35 |
+
*/
|
36 |
+
if( !defined('YITH_FUNCTIONS') ) {
|
37 |
+
require_once( 'yit-common/yit-functions.php' );
|
38 |
+
}
|
39 |
+
if ( ! yit_is_woocommerce_active() ) return;
|
40 |
+
|
41 |
+
define( 'YITH_WCMG', true );
|
42 |
+
define( 'YITH_WCMG_URL', plugin_dir_url( __FILE__ ) );
|
43 |
+
define( 'YITH_WCMG_DIR', plugin_dir_path( __FILE__ ) );
|
44 |
+
|
45 |
+
// Load required classes and functions
|
46 |
+
require_once('functions.yith-wcmg.php');
|
47 |
+
require_once('class.yith-wcmg-admin.php');
|
48 |
+
require_once('class.yith-wcmg-frontend.php');
|
49 |
+
require_once('class.yith-wcmg.php');
|
50 |
+
|
51 |
+
// Let's start the game!
|
52 |
+
global $yith_wcmg;
|
53 |
+
$yith_wcmg = new YITH_WCMG();
|
54 |
+
|
languages/default.po
ADDED
@@ -0,0 +1,222 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
msgid ""
|
2 |
+
msgstr ""
|
3 |
+
"Project-Id-Version: YITH WooCommerce Magnifier v1.0.0\n"
|
4 |
+
"Report-Msgid-Bugs-To: \n"
|
5 |
+
"POT-Creation-Date: 2013-05-17 18:04+0100\n"
|
6 |
+
"PO-Revision-Date: 2013-05-17 18:04+0100\n"
|
7 |
+
"Last-Translator: Your Inspiration Themes <plugins@yithemes.com>\n"
|
8 |
+
"Language-Team: \n"
|
9 |
+
"Language: en_US\n"
|
10 |
+
"MIME-Version: 1.0\n"
|
11 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
12 |
+
"Content-Transfer-Encoding: 8bit\n"
|
13 |
+
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
14 |
+
"X-Generator: Poedit 1.5.5\n"
|
15 |
+
"X-Poedit-SourceCharset: utf-8\n"
|
16 |
+
"X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;"
|
17 |
+
"_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2\n"
|
18 |
+
"X-Poedit-Basepath: ../\n"
|
19 |
+
"X-Textdomain-Support: yes\n"
|
20 |
+
"X-Poedit-SearchPath-0: .\n"
|
21 |
+
|
22 |
+
# @ yit
|
23 |
+
#: class.yith-wcmg-admin.php:119 class.yith-wcmg-admin.php:169
|
24 |
+
msgid "Magnifier"
|
25 |
+
msgstr ""
|
26 |
+
|
27 |
+
# @ yit
|
28 |
+
#: class.yith-wcmg-admin.php:138
|
29 |
+
msgid "Catalog Zoom Images"
|
30 |
+
msgstr ""
|
31 |
+
|
32 |
+
# @ yit
|
33 |
+
#: class.yith-wcmg-admin.php:139
|
34 |
+
msgid "The size of images used within the magnifier box"
|
35 |
+
msgstr ""
|
36 |
+
|
37 |
+
# @ yit
|
38 |
+
#: class.yith-wcmg-admin.php:168 class.yith-wcmg-admin.php:206
|
39 |
+
msgid "General Settings"
|
40 |
+
msgstr ""
|
41 |
+
|
42 |
+
# @ yit
|
43 |
+
#: class.yith-wcmg-admin.php:170
|
44 |
+
msgid "Slider"
|
45 |
+
msgstr ""
|
46 |
+
|
47 |
+
# @ yit
|
48 |
+
#: class.yith-wcmg-admin.php:213
|
49 |
+
msgid "Enable YITH Magnifier"
|
50 |
+
msgstr ""
|
51 |
+
|
52 |
+
# @ yit
|
53 |
+
#: class.yith-wcmg-admin.php:214
|
54 |
+
msgid "Enable the plugin or use the Woocommerce default product image."
|
55 |
+
msgstr ""
|
56 |
+
|
57 |
+
# @ yit
|
58 |
+
#: class.yith-wcmg-admin.php:222
|
59 |
+
msgid "Forcing Zoom Image sizes"
|
60 |
+
msgstr ""
|
61 |
+
|
62 |
+
# @ yit
|
63 |
+
#: class.yith-wcmg-admin.php:223
|
64 |
+
msgid ""
|
65 |
+
"If disabled, you will able to customize the sizes of Zoom Images. Please "
|
66 |
+
"disable at your own risk; the magnifier should not properly work with "
|
67 |
+
"unproportioned image sizes."
|
68 |
+
msgstr ""
|
69 |
+
|
70 |
+
# @ yit
|
71 |
+
#: class.yith-wcmg-admin.php:234
|
72 |
+
msgid "Magnifier Settings"
|
73 |
+
msgstr ""
|
74 |
+
|
75 |
+
# @ yit
|
76 |
+
#: class.yith-wcmg-admin.php:241
|
77 |
+
msgid "Zoom Area Width"
|
78 |
+
msgstr ""
|
79 |
+
|
80 |
+
#: class.yith-wcmg-admin.php:242
|
81 |
+
msgid "The width of magnifier box (default: auto)"
|
82 |
+
msgstr ""
|
83 |
+
|
84 |
+
# @ yit
|
85 |
+
#: class.yith-wcmg-admin.php:250
|
86 |
+
msgid "Zoom Area Height"
|
87 |
+
msgstr ""
|
88 |
+
|
89 |
+
#: class.yith-wcmg-admin.php:251
|
90 |
+
msgid "The height of magnifier box (default: auto)"
|
91 |
+
msgstr ""
|
92 |
+
|
93 |
+
# @ yit
|
94 |
+
#: class.yith-wcmg-admin.php:259
|
95 |
+
msgid "Zoom Area Position"
|
96 |
+
msgstr ""
|
97 |
+
|
98 |
+
# @ yit
|
99 |
+
#: class.yith-wcmg-admin.php:260
|
100 |
+
msgid "The magnifier position"
|
101 |
+
msgstr ""
|
102 |
+
|
103 |
+
# @ yit
|
104 |
+
#: class.yith-wcmg-admin.php:266
|
105 |
+
msgid "Right"
|
106 |
+
msgstr ""
|
107 |
+
|
108 |
+
# @ yit
|
109 |
+
#: class.yith-wcmg-admin.php:267 class.yith-wcmg-admin.php:280
|
110 |
+
msgid "Inside"
|
111 |
+
msgstr ""
|
112 |
+
|
113 |
+
# @ yit
|
114 |
+
#: class.yith-wcmg-admin.php:272
|
115 |
+
msgid "Zoom Area Mobile Position"
|
116 |
+
msgstr ""
|
117 |
+
|
118 |
+
# @ yit
|
119 |
+
#: class.yith-wcmg-admin.php:273
|
120 |
+
msgid "The magnifier position with mobile devices (iPhone, Android, etc.)"
|
121 |
+
msgstr ""
|
122 |
+
|
123 |
+
# @ yit
|
124 |
+
#: class.yith-wcmg-admin.php:279
|
125 |
+
msgid "Default"
|
126 |
+
msgstr ""
|
127 |
+
|
128 |
+
# @ yit
|
129 |
+
#: class.yith-wcmg-admin.php:281
|
130 |
+
msgid "Disable"
|
131 |
+
msgstr ""
|
132 |
+
|
133 |
+
# @ yit
|
134 |
+
#: class.yith-wcmg-admin.php:286
|
135 |
+
msgid "Loading label"
|
136 |
+
msgstr ""
|
137 |
+
|
138 |
+
# @ yit
|
139 |
+
#: class.yith-wcmg-admin.php:289 class.yith-wcmg-admin.php:290
|
140 |
+
msgid "Loading..."
|
141 |
+
msgstr ""
|
142 |
+
|
143 |
+
# @ yit
|
144 |
+
#: class.yith-wcmg-admin.php:316
|
145 |
+
msgid "Lens Opacity"
|
146 |
+
msgstr ""
|
147 |
+
|
148 |
+
# @ yit
|
149 |
+
#: class.yith-wcmg-admin.php:340
|
150 |
+
msgid "Blur"
|
151 |
+
msgstr ""
|
152 |
+
|
153 |
+
# @ yit
|
154 |
+
#: class.yith-wcmg-admin.php:341
|
155 |
+
msgid "Add a blur effect to the small image on mouse hover."
|
156 |
+
msgstr ""
|
157 |
+
|
158 |
+
# @ yit
|
159 |
+
#: class.yith-wcmg-admin.php:352
|
160 |
+
msgid "Slider Settings"
|
161 |
+
msgstr ""
|
162 |
+
|
163 |
+
# @ yit
|
164 |
+
#: class.yith-wcmg-admin.php:359
|
165 |
+
msgid "Enable Slider"
|
166 |
+
msgstr ""
|
167 |
+
|
168 |
+
# @ yit
|
169 |
+
#: class.yith-wcmg-admin.php:360
|
170 |
+
msgid "Enable Thumbnail slider."
|
171 |
+
msgstr ""
|
172 |
+
|
173 |
+
#: class.yith-wcmg-admin.php:368
|
174 |
+
msgid "Enable Slider Responsive"
|
175 |
+
msgstr ""
|
176 |
+
|
177 |
+
#: class.yith-wcmg-admin.php:369
|
178 |
+
msgid ""
|
179 |
+
"The option fits the thumbnails within the available space. Disable it if you "
|
180 |
+
"want to manage by yourself the thumbnails (eg. add margins, paddings, etc.)"
|
181 |
+
msgstr ""
|
182 |
+
|
183 |
+
# @ yit
|
184 |
+
#: class.yith-wcmg-admin.php:377
|
185 |
+
msgid "Items"
|
186 |
+
msgstr ""
|
187 |
+
|
188 |
+
# @ yit
|
189 |
+
#: class.yith-wcmg-admin.php:378
|
190 |
+
msgid "Number of items to show"
|
191 |
+
msgstr ""
|
192 |
+
|
193 |
+
# @ yit
|
194 |
+
#: class.yith-wcmg-admin.php:389
|
195 |
+
msgid "Circular carousel"
|
196 |
+
msgstr ""
|
197 |
+
|
198 |
+
# @ yit
|
199 |
+
#: class.yith-wcmg-admin.php:390
|
200 |
+
msgid "Determines whether the carousel should be circular."
|
201 |
+
msgstr ""
|
202 |
+
|
203 |
+
# @ yit
|
204 |
+
#: class.yith-wcmg-admin.php:398
|
205 |
+
msgid "Infinite carousel"
|
206 |
+
msgstr ""
|
207 |
+
|
208 |
+
# @ yit
|
209 |
+
#: class.yith-wcmg-admin.php:399
|
210 |
+
msgid ""
|
211 |
+
"Determines whether the carousel should be infinite. Note: It is possible to "
|
212 |
+
"create a non-circular, infinite carousel, but it is not possible to create a "
|
213 |
+
"circular, non-infinite carousel."
|
214 |
+
msgstr ""
|
215 |
+
|
216 |
+
#: class.yith-wcmg-admin.php:626
|
217 |
+
msgid "Settings"
|
218 |
+
msgstr ""
|
219 |
+
|
220 |
+
#: class.yith-wcmg-admin.php:627
|
221 |
+
msgid "Docs"
|
222 |
+
msgstr ""
|
languages/yit-it_IT.mo
ADDED
Binary file
|
languages/yit-it_IT.po
ADDED
@@ -0,0 +1,236 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
msgid ""
|
2 |
+
msgstr ""
|
3 |
+
"Project-Id-Version: YITH WooCommerce Magnifier v1.0.0\n"
|
4 |
+
"Report-Msgid-Bugs-To: \n"
|
5 |
+
"POT-Creation-Date: 2013-05-17 18:04+0100\n"
|
6 |
+
"PO-Revision-Date: 2013-05-17 18:06+0100\n"
|
7 |
+
"Last-Translator: Your Inspiration Themes <plugins@yithemes.com>\n"
|
8 |
+
"Language-Team: \n"
|
9 |
+
"Language: it_IT\n"
|
10 |
+
"MIME-Version: 1.0\n"
|
11 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
12 |
+
"Content-Transfer-Encoding: 8bit\n"
|
13 |
+
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
14 |
+
"X-Generator: Poedit 1.5.5\n"
|
15 |
+
"X-Poedit-SourceCharset: utf-8\n"
|
16 |
+
"X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;"
|
17 |
+
"_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2\n"
|
18 |
+
"X-Poedit-Basepath: ../\n"
|
19 |
+
"X-Textdomain-Support: yes\n"
|
20 |
+
"X-Poedit-SearchPath-0: .\n"
|
21 |
+
|
22 |
+
# @ yit
|
23 |
+
#: class.yith-wcmg-admin.php:119 class.yith-wcmg-admin.php:169
|
24 |
+
msgid "Magnifier"
|
25 |
+
msgstr "Magnifier"
|
26 |
+
|
27 |
+
# @ yit
|
28 |
+
#: class.yith-wcmg-admin.php:138
|
29 |
+
msgid "Catalog Zoom Images"
|
30 |
+
msgstr "Immagini Zoom"
|
31 |
+
|
32 |
+
# @ yit
|
33 |
+
#: class.yith-wcmg-admin.php:139
|
34 |
+
msgid "The size of images used within the magnifier box"
|
35 |
+
msgstr "La dimensione dell'immagine usata all'interno del box dello zoom"
|
36 |
+
|
37 |
+
# @ yit
|
38 |
+
#: class.yith-wcmg-admin.php:168 class.yith-wcmg-admin.php:206
|
39 |
+
msgid "General Settings"
|
40 |
+
msgstr "Impostazioni Generali"
|
41 |
+
|
42 |
+
# @ yit
|
43 |
+
#: class.yith-wcmg-admin.php:170
|
44 |
+
msgid "Slider"
|
45 |
+
msgstr "Slider"
|
46 |
+
|
47 |
+
# @ yit
|
48 |
+
#: class.yith-wcmg-admin.php:213
|
49 |
+
msgid "Enable YITH Magnifier"
|
50 |
+
msgstr "Abilita YITH Magnifier"
|
51 |
+
|
52 |
+
# @ yit
|
53 |
+
#: class.yith-wcmg-admin.php:214
|
54 |
+
msgid "Enable the plugin or use the Woocommerce default product image."
|
55 |
+
msgstr ""
|
56 |
+
"Abilita il plugin oppure utilizza l'immagine di default di Woocommerce."
|
57 |
+
|
58 |
+
# @ yit
|
59 |
+
#: class.yith-wcmg-admin.php:222
|
60 |
+
msgid "Forcing Zoom Image sizes"
|
61 |
+
msgstr "Forza le dimensioni delle immagini di Zoom"
|
62 |
+
|
63 |
+
# @ yit
|
64 |
+
#: class.yith-wcmg-admin.php:223
|
65 |
+
msgid ""
|
66 |
+
"If disabled, you will able to customize the sizes of Zoom Images. Please "
|
67 |
+
"disable at your own risk; the magnifier should not properly work with "
|
68 |
+
"unproportioned image sizes."
|
69 |
+
msgstr ""
|
70 |
+
"Se disabilitato, potrai personalizzare le dimensioni delle immagini di Zoom. "
|
71 |
+
"Disabilita con attenzione questa opzione, lo zoom potrebbe non funzionare "
|
72 |
+
"correttamente con immagini di dimensioni non proporzionali tra di loro."
|
73 |
+
|
74 |
+
# @ yit
|
75 |
+
#: class.yith-wcmg-admin.php:234
|
76 |
+
msgid "Magnifier Settings"
|
77 |
+
msgstr "Impostazioni Magnifier"
|
78 |
+
|
79 |
+
# @ yit
|
80 |
+
#: class.yith-wcmg-admin.php:241
|
81 |
+
msgid "Zoom Area Width"
|
82 |
+
msgstr "Larghezza area di zoom"
|
83 |
+
|
84 |
+
# @ yit
|
85 |
+
#: class.yith-wcmg-admin.php:242
|
86 |
+
msgid "The width of magnifier box (default: auto)"
|
87 |
+
msgstr "Larghezza del box di zoom (default: auto)"
|
88 |
+
|
89 |
+
# @ yit
|
90 |
+
#: class.yith-wcmg-admin.php:250
|
91 |
+
msgid "Zoom Area Height"
|
92 |
+
msgstr "Altezza area di zoom"
|
93 |
+
|
94 |
+
# @ yit
|
95 |
+
#: class.yith-wcmg-admin.php:251
|
96 |
+
msgid "The height of magnifier box (default: auto)"
|
97 |
+
msgstr "Larghezza del box di zoom (default: auto)"
|
98 |
+
|
99 |
+
# @ yit
|
100 |
+
#: class.yith-wcmg-admin.php:259
|
101 |
+
msgid "Zoom Area Position"
|
102 |
+
msgstr "Posizione area di zoom"
|
103 |
+
|
104 |
+
# @ yit
|
105 |
+
#: class.yith-wcmg-admin.php:260
|
106 |
+
msgid "The magnifier position"
|
107 |
+
msgstr "Posizione del Magnifier"
|
108 |
+
|
109 |
+
# @ yit
|
110 |
+
#: class.yith-wcmg-admin.php:266
|
111 |
+
msgid "Right"
|
112 |
+
msgstr "Destra"
|
113 |
+
|
114 |
+
# @ yit
|
115 |
+
#: class.yith-wcmg-admin.php:267 class.yith-wcmg-admin.php:280
|
116 |
+
msgid "Inside"
|
117 |
+
msgstr "Interno"
|
118 |
+
|
119 |
+
# @ yit
|
120 |
+
#: class.yith-wcmg-admin.php:272
|
121 |
+
msgid "Zoom Area Mobile Position"
|
122 |
+
msgstr "Posizione area di zoom nei dispositivi mobili"
|
123 |
+
|
124 |
+
# @ yit
|
125 |
+
#: class.yith-wcmg-admin.php:273
|
126 |
+
msgid "The magnifier position with mobile devices (iPhone, Android, etc.)"
|
127 |
+
msgstr "Posizione area di zoom nei dispositivi mobili (iPhone, Android, ecc.)"
|
128 |
+
|
129 |
+
# @ yit
|
130 |
+
#: class.yith-wcmg-admin.php:279
|
131 |
+
msgid "Default"
|
132 |
+
msgstr "Default"
|
133 |
+
|
134 |
+
# @ yit
|
135 |
+
#: class.yith-wcmg-admin.php:281
|
136 |
+
msgid "Disable"
|
137 |
+
msgstr "Disabilitato"
|
138 |
+
|
139 |
+
# @ yit
|
140 |
+
#: class.yith-wcmg-admin.php:286
|
141 |
+
msgid "Loading label"
|
142 |
+
msgstr "Messaggio Caricamento"
|
143 |
+
|
144 |
+
# @ yit
|
145 |
+
#: class.yith-wcmg-admin.php:289 class.yith-wcmg-admin.php:290
|
146 |
+
msgid "Loading..."
|
147 |
+
msgstr "Caricamento..."
|
148 |
+
|
149 |
+
# @ yit
|
150 |
+
#: class.yith-wcmg-admin.php:316
|
151 |
+
msgid "Lens Opacity"
|
152 |
+
msgstr "Opacità lente"
|
153 |
+
|
154 |
+
# @ yit
|
155 |
+
#: class.yith-wcmg-admin.php:340
|
156 |
+
msgid "Blur"
|
157 |
+
msgstr "Sfocatura"
|
158 |
+
|
159 |
+
# @ yit
|
160 |
+
#: class.yith-wcmg-admin.php:341
|
161 |
+
msgid "Add a blur effect to the small image on mouse hover."
|
162 |
+
msgstr "Aggiungi un effetto sfocatura all'immagine al movimento del mouse."
|
163 |
+
|
164 |
+
# @ yit
|
165 |
+
#: class.yith-wcmg-admin.php:352
|
166 |
+
msgid "Slider Settings"
|
167 |
+
msgstr "Impostazioni Slider"
|
168 |
+
|
169 |
+
# @ yit
|
170 |
+
#: class.yith-wcmg-admin.php:359
|
171 |
+
msgid "Enable Slider"
|
172 |
+
msgstr "Abilita Slider"
|
173 |
+
|
174 |
+
# @ yit
|
175 |
+
#: class.yith-wcmg-admin.php:360
|
176 |
+
msgid "Enable Thumbnail slider."
|
177 |
+
msgstr "Abilita lo sliding delle thumbnail."
|
178 |
+
|
179 |
+
# @ yit
|
180 |
+
#: class.yith-wcmg-admin.php:368
|
181 |
+
msgid "Enable Slider Responsive"
|
182 |
+
msgstr "Abilita Responsive Slider"
|
183 |
+
|
184 |
+
#: class.yith-wcmg-admin.php:369
|
185 |
+
msgid ""
|
186 |
+
"The option fits the thumbnails within the available space. Disable it if you "
|
187 |
+
"want to manage by yourself the thumbnails (eg. add margins, paddings, etc.)"
|
188 |
+
msgstr ""
|
189 |
+
"L'opzione automaticamente ridimensione le thumbnail in maniera da riempire "
|
190 |
+
"automaticamente lo spazio a disposizione. Disabilitare l'opzione se si "
|
191 |
+
"voglio gestire in maniera autonoma le thumbnails (ad esempio per aggiungere "
|
192 |
+
"margini, padding, ecc.)"
|
193 |
+
|
194 |
+
# @ yit
|
195 |
+
#: class.yith-wcmg-admin.php:377
|
196 |
+
msgid "Items"
|
197 |
+
msgstr "Elementi"
|
198 |
+
|
199 |
+
# @ yit
|
200 |
+
#: class.yith-wcmg-admin.php:378
|
201 |
+
msgid "Number of items to show"
|
202 |
+
msgstr "Numero di elementi da mostrare"
|
203 |
+
|
204 |
+
# @ yit
|
205 |
+
#: class.yith-wcmg-admin.php:389
|
206 |
+
msgid "Circular carousel"
|
207 |
+
msgstr "Slider circolare"
|
208 |
+
|
209 |
+
# @ yit
|
210 |
+
#: class.yith-wcmg-admin.php:390
|
211 |
+
msgid "Determines whether the carousel should be circular."
|
212 |
+
msgstr "Selezionare se impostare lo slider circolare."
|
213 |
+
|
214 |
+
# @ yit
|
215 |
+
#: class.yith-wcmg-admin.php:398
|
216 |
+
msgid "Infinite carousel"
|
217 |
+
msgstr "Slider infinito"
|
218 |
+
|
219 |
+
# @ yit
|
220 |
+
#: class.yith-wcmg-admin.php:399
|
221 |
+
msgid ""
|
222 |
+
"Determines whether the carousel should be infinite. Note: It is possible to "
|
223 |
+
"create a non-circular, infinite carousel, but it is not possible to create a "
|
224 |
+
"circular, non-infinite carousel."
|
225 |
+
msgstr ""
|
226 |
+
"Selezionare se lo slider deve essere infinito. Attenzione: è possibile "
|
227 |
+
"creare uno slider infinito non circolare ma non è possibile il contrario."
|
228 |
+
|
229 |
+
# @ yit
|
230 |
+
#: class.yith-wcmg-admin.php:626
|
231 |
+
msgid "Settings"
|
232 |
+
msgstr "Impostazioni"
|
233 |
+
|
234 |
+
#: class.yith-wcmg-admin.php:627
|
235 |
+
msgid "Docs"
|
236 |
+
msgstr "Docs"
|
languages/yit.pot
ADDED
@@ -0,0 +1,220 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
msgid ""
|
2 |
+
msgstr ""
|
3 |
+
"Project-Id-Version: YITH WooCommerce Magnifier v1.0.0\n"
|
4 |
+
"Report-Msgid-Bugs-To: \n"
|
5 |
+
"POT-Creation-Date: 2013-05-17 18:04+0100\n"
|
6 |
+
"PO-Revision-Date: 2013-05-17 18:05+0100\n"
|
7 |
+
"Last-Translator: Your Inspiration Themes <plugins@yithemes.com>\n"
|
8 |
+
"Language-Team: \n"
|
9 |
+
"Language: en_US\n"
|
10 |
+
"MIME-Version: 1.0\n"
|
11 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
12 |
+
"Content-Transfer-Encoding: 8bit\n"
|
13 |
+
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
14 |
+
"X-Generator: Poedit 1.5.5\n"
|
15 |
+
"X-Poedit-SourceCharset: UTF-8\n"
|
16 |
+
"X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;"
|
17 |
+
"_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2\n"
|
18 |
+
"X-Textdomain-Support: yes\n"
|
19 |
+
|
20 |
+
# @ yit
|
21 |
+
#: class.yith-wcmg-admin.php:119 class.yith-wcmg-admin.php:169
|
22 |
+
msgid "Magnifier"
|
23 |
+
msgstr ""
|
24 |
+
|
25 |
+
# @ yit
|
26 |
+
#: class.yith-wcmg-admin.php:138
|
27 |
+
msgid "Catalog Zoom Images"
|
28 |
+
msgstr ""
|
29 |
+
|
30 |
+
# @ yit
|
31 |
+
#: class.yith-wcmg-admin.php:139
|
32 |
+
msgid "The size of images used within the magnifier box"
|
33 |
+
msgstr ""
|
34 |
+
|
35 |
+
# @ yit
|
36 |
+
#: class.yith-wcmg-admin.php:168 class.yith-wcmg-admin.php:206
|
37 |
+
msgid "General Settings"
|
38 |
+
msgstr ""
|
39 |
+
|
40 |
+
# @ yit
|
41 |
+
#: class.yith-wcmg-admin.php:170
|
42 |
+
msgid "Slider"
|
43 |
+
msgstr ""
|
44 |
+
|
45 |
+
# @ yit
|
46 |
+
#: class.yith-wcmg-admin.php:213
|
47 |
+
msgid "Enable YITH Magnifier"
|
48 |
+
msgstr ""
|
49 |
+
|
50 |
+
# @ yit
|
51 |
+
#: class.yith-wcmg-admin.php:214
|
52 |
+
msgid "Enable the plugin or use the Woocommerce default product image."
|
53 |
+
msgstr ""
|
54 |
+
|
55 |
+
# @ yit
|
56 |
+
#: class.yith-wcmg-admin.php:222
|
57 |
+
msgid "Forcing Zoom Image sizes"
|
58 |
+
msgstr ""
|
59 |
+
|
60 |
+
# @ yit
|
61 |
+
#: class.yith-wcmg-admin.php:223
|
62 |
+
msgid ""
|
63 |
+
"If disabled, you will able to customize the sizes of Zoom Images. Please "
|
64 |
+
"disable at your own risk; the magnifier should not properly work with "
|
65 |
+
"unproportioned image sizes."
|
66 |
+
msgstr ""
|
67 |
+
|
68 |
+
# @ yit
|
69 |
+
#: class.yith-wcmg-admin.php:234
|
70 |
+
msgid "Magnifier Settings"
|
71 |
+
msgstr ""
|
72 |
+
|
73 |
+
# @ yit
|
74 |
+
#: class.yith-wcmg-admin.php:241
|
75 |
+
msgid "Zoom Area Width"
|
76 |
+
msgstr ""
|
77 |
+
|
78 |
+
#: class.yith-wcmg-admin.php:242
|
79 |
+
msgid "The width of magnifier box (default: auto)"
|
80 |
+
msgstr ""
|
81 |
+
|
82 |
+
# @ yit
|
83 |
+
#: class.yith-wcmg-admin.php:250
|
84 |
+
msgid "Zoom Area Height"
|
85 |
+
msgstr ""
|
86 |
+
|
87 |
+
#: class.yith-wcmg-admin.php:251
|
88 |
+
msgid "The height of magnifier box (default: auto)"
|
89 |
+
msgstr ""
|
90 |
+
|
91 |
+
# @ yit
|
92 |
+
#: class.yith-wcmg-admin.php:259
|
93 |
+
msgid "Zoom Area Position"
|
94 |
+
msgstr ""
|
95 |
+
|
96 |
+
# @ yit
|
97 |
+
#: class.yith-wcmg-admin.php:260
|
98 |
+
msgid "The magnifier position"
|
99 |
+
msgstr ""
|
100 |
+
|
101 |
+
# @ yit
|
102 |
+
#: class.yith-wcmg-admin.php:266
|
103 |
+
msgid "Right"
|
104 |
+
msgstr ""
|
105 |
+
|
106 |
+
# @ yit
|
107 |
+
#: class.yith-wcmg-admin.php:267 class.yith-wcmg-admin.php:280
|
108 |
+
msgid "Inside"
|
109 |
+
msgstr ""
|
110 |
+
|
111 |
+
# @ yit
|
112 |
+
#: class.yith-wcmg-admin.php:272
|
113 |
+
msgid "Zoom Area Mobile Position"
|
114 |
+
msgstr ""
|
115 |
+
|
116 |
+
# @ yit
|
117 |
+
#: class.yith-wcmg-admin.php:273
|
118 |
+
msgid "The magnifier position with mobile devices (iPhone, Android, etc.)"
|
119 |
+
msgstr ""
|
120 |
+
|
121 |
+
# @ yit
|
122 |
+
#: class.yith-wcmg-admin.php:279
|
123 |
+
msgid "Default"
|
124 |
+
msgstr ""
|
125 |
+
|
126 |
+
# @ yit
|
127 |
+
#: class.yith-wcmg-admin.php:281
|
128 |
+
msgid "Disable"
|
129 |
+
msgstr ""
|
130 |
+
|
131 |
+
# @ yit
|
132 |
+
#: class.yith-wcmg-admin.php:286
|
133 |
+
msgid "Loading label"
|
134 |
+
msgstr ""
|
135 |
+
|
136 |
+
# @ yit
|
137 |
+
#: class.yith-wcmg-admin.php:289 class.yith-wcmg-admin.php:290
|
138 |
+
msgid "Loading..."
|
139 |
+
msgstr ""
|
140 |
+
|
141 |
+
# @ yit
|
142 |
+
#: class.yith-wcmg-admin.php:316
|
143 |
+
msgid "Lens Opacity"
|
144 |
+
msgstr ""
|
145 |
+
|
146 |
+
# @ yit
|
147 |
+
#: class.yith-wcmg-admin.php:340
|
148 |
+
msgid "Blur"
|
149 |
+
msgstr ""
|
150 |
+
|
151 |
+
# @ yit
|
152 |
+
#: class.yith-wcmg-admin.php:341
|
153 |
+
msgid "Add a blur effect to the small image on mouse hover."
|
154 |
+
msgstr ""
|
155 |
+
|
156 |
+
# @ yit
|
157 |
+
#: class.yith-wcmg-admin.php:352
|
158 |
+
msgid "Slider Settings"
|
159 |
+
msgstr ""
|
160 |
+
|
161 |
+
# @ yit
|
162 |
+
#: class.yith-wcmg-admin.php:359
|
163 |
+
msgid "Enable Slider"
|
164 |
+
msgstr ""
|
165 |
+
|
166 |
+
# @ yit
|
167 |
+
#: class.yith-wcmg-admin.php:360
|
168 |
+
msgid "Enable Thumbnail slider."
|
169 |
+
msgstr ""
|
170 |
+
|
171 |
+
#: class.yith-wcmg-admin.php:368
|
172 |
+
msgid "Enable Slider Responsive"
|
173 |
+
msgstr ""
|
174 |
+
|
175 |
+
#: class.yith-wcmg-admin.php:369
|
176 |
+
msgid ""
|
177 |
+
"The option fits the thumbnails within the available space. Disable it if you "
|
178 |
+
"want to manage by yourself the thumbnails (eg. add margins, paddings, etc.)"
|
179 |
+
msgstr ""
|
180 |
+
|
181 |
+
# @ yit
|
182 |
+
#: class.yith-wcmg-admin.php:377
|
183 |
+
msgid "Items"
|
184 |
+
msgstr ""
|
185 |
+
|
186 |
+
# @ yit
|
187 |
+
#: class.yith-wcmg-admin.php:378
|
188 |
+
msgid "Number of items to show"
|
189 |
+
msgstr ""
|
190 |
+
|
191 |
+
# @ yit
|
192 |
+
#: class.yith-wcmg-admin.php:389
|
193 |
+
msgid "Circular carousel"
|
194 |
+
msgstr ""
|
195 |
+
|
196 |
+
# @ yit
|
197 |
+
#: class.yith-wcmg-admin.php:390
|
198 |
+
msgid "Determines whether the carousel should be circular."
|
199 |
+
msgstr ""
|
200 |
+
|
201 |
+
# @ yit
|
202 |
+
#: class.yith-wcmg-admin.php:398
|
203 |
+
msgid "Infinite carousel"
|
204 |
+
msgstr ""
|
205 |
+
|
206 |
+
# @ yit
|
207 |
+
#: class.yith-wcmg-admin.php:399
|
208 |
+
msgid ""
|
209 |
+
"Determines whether the carousel should be infinite. Note: It is possible to "
|
210 |
+
"create a non-circular, infinite carousel, but it is not possible to create a "
|
211 |
+
"circular, non-infinite carousel."
|
212 |
+
msgstr ""
|
213 |
+
|
214 |
+
#: class.yith-wcmg-admin.php:626
|
215 |
+
msgid "Settings"
|
216 |
+
msgstr ""
|
217 |
+
|
218 |
+
#: class.yith-wcmg-admin.php:627
|
219 |
+
msgid "Docs"
|
220 |
+
msgstr ""
|
screenshot-1.png
ADDED
Binary file
|
screenshot-2.png
ADDED
Binary file
|
templates/single-product/product-image-magnifier.php
ADDED
@@ -0,0 +1,86 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Single Product Image
|
4 |
+
*
|
5 |
+
* @author YIThemes
|
6 |
+
* @package YITH_Magnifier/Templates
|
7 |
+
* @version 1.0.0
|
8 |
+
*/
|
9 |
+
|
10 |
+
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
11 |
+
|
12 |
+
global $post, $woocommerce, $product, $is_IE;
|
13 |
+
|
14 |
+
$enable_slider = get_option('yith_wcmg_enableslider') == 'yes' ? true : false;
|
15 |
+
?>
|
16 |
+
<div class="images<?php if($is_IE): ?> ie<?php endif ?>">
|
17 |
+
|
18 |
+
<?php
|
19 |
+
if ( has_post_thumbnail() ) {
|
20 |
+
|
21 |
+
$image = get_the_post_thumbnail( $post->ID, apply_filters( 'single_product_large_thumbnail_size', 'shop_single' ) );
|
22 |
+
$image_title = esc_attr( get_the_title( get_post_thumbnail_id() ) );
|
23 |
+
$image_link = wp_get_attachment_url( get_post_thumbnail_id() );
|
24 |
+
list( $magnifier_url, $magnifier_width, $magnifier_height ) = wp_get_attachment_image_src( get_post_thumbnail_id(), "shop_magnifier" );
|
25 |
+
|
26 |
+
echo apply_filters( 'woocommerce_single_product_image_html', sprintf( '<a href="%s" itemprop="image" class="yith_magnifier_zoom woocommerce-main-image" title="%s">%s</a>', $magnifier_url, $image_title, $image ), $post->ID );
|
27 |
+
|
28 |
+
} else {
|
29 |
+
echo apply_filters( 'woocommerce_single_product_image_html', sprintf( '<a href="%s" itemprop="image" class="yith_magnifier_zoom woocommerce-main-image"><img src="%s" alt="Placeholder" /></a>', woocommerce_placeholder_img_src(), woocommerce_placeholder_img_src() ), $post->ID );
|
30 |
+
}
|
31 |
+
?>
|
32 |
+
|
33 |
+
<?php do_action( 'woocommerce_product_thumbnails' ); ?>
|
34 |
+
|
35 |
+
</div>
|
36 |
+
|
37 |
+
|
38 |
+
<script type="text/javascript" charset="utf-8">
|
39 |
+
var yith_magnifier_options = {
|
40 |
+
enableSlider: <?php echo $enable_slider ? 'true' : 'false' ?>,
|
41 |
+
|
42 |
+
<?php if( $enable_slider ): ?>
|
43 |
+
sliderOptions: {
|
44 |
+
responsive: <?php echo get_option('yith_wcmg_slider_responsive') == 'yes' ? 'true' : 'false' ?>,
|
45 |
+
circular: <?php echo get_option('yith_wcmg_slider_circular') == 'yes' ? 'true' : 'false' ?>,
|
46 |
+
infinite: <?php echo get_option('yith_wcmg_slider_infinite') == 'yes' ? 'true' : 'false' ?>,
|
47 |
+
//direction: '<?php //echo get_option('yith_wcmg_slider_direction') == 'yes' ? 'left' : get_option('yith_wcmg_slider_direction') ?>',
|
48 |
+
direction: 'left',
|
49 |
+
debug: false,
|
50 |
+
auto: false,
|
51 |
+
align: 'left',
|
52 |
+
prev : {
|
53 |
+
button : "#slider-prev",
|
54 |
+
key : "left"
|
55 |
+
},
|
56 |
+
next : {
|
57 |
+
button : "#slider-next",
|
58 |
+
key : "right"
|
59 |
+
},
|
60 |
+
//width : <?php echo yit_shop_single_w() + 18 ?>,
|
61 |
+
scroll : {
|
62 |
+
items : 1,
|
63 |
+
pauseOnHover: true
|
64 |
+
},
|
65 |
+
items : {
|
66 |
+
//width: <?php echo yit_shop_thumbnail_w() + 4 ?>,
|
67 |
+
visible: <?php echo apply_filters( 'woocommerce_product_thumbnails_columns', get_option( 'yith_wcmg_slider_items', 3 ) ) ?>
|
68 |
+
}
|
69 |
+
},
|
70 |
+
<?php endif ?>
|
71 |
+
|
72 |
+
showTitle: false,
|
73 |
+
zoomWidth: '<?php echo get_option('yith_wcmg_zoom_width') ?>',
|
74 |
+
zoomHeight: '<?php echo get_option('yith_wcmg_zoom_height') ?>',
|
75 |
+
position: '<?php echo get_option('yith_wcmg_zoom_position') ?>',
|
76 |
+
//tint: <?php //echo get_option('yith_wcmg_tint') == '' ? 'false' : "'".get_option('yith_wcmg_tint')."'" ?>,
|
77 |
+
//tintOpacity: <?php //echo get_option('yith_wcmg_tint_opacity') ?>,
|
78 |
+
lensOpacity: <?php echo get_option('yith_wcmg_lens_opacity') ?>,
|
79 |
+
softFocus: <?php echo get_option('yith_wcmg_softfocus') == 'yes' ? 'true' : 'false' ?>,
|
80 |
+
//smoothMove: <?php //echo get_option('yith_wcmg_smooth') ?>,
|
81 |
+
adjustY: 0,
|
82 |
+
disableRightClick: false,
|
83 |
+
phoneBehavior: '<?php echo get_option('yith_wcmg_zoom_mobile_position') ?>',
|
84 |
+
loadingLabel: '<?php echo stripslashes(get_option('yith_wcmg_loading_label')) ?>'
|
85 |
+
};
|
86 |
+
</script>
|
templates/single-product/product-thumbnails-magnifier.php
ADDED
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Single Product Image
|
4 |
+
*
|
5 |
+
* @author YIThemes
|
6 |
+
* @package YITH_Magnifier/Templates
|
7 |
+
* @version 1.0.0
|
8 |
+
*/
|
9 |
+
|
10 |
+
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
11 |
+
|
12 |
+
global $post, $product, $woocommerce;
|
13 |
+
|
14 |
+
$enable_slider = get_option('yith_wcmg_enableslider') == 'yes' ? true : false;
|
15 |
+
|
16 |
+
$attachment_ids = $product->get_gallery_attachment_ids();
|
17 |
+
if ( ! empty( $attachment_ids ) ) array_unshift( $attachment_ids, get_post_thumbnail_id() );
|
18 |
+
|
19 |
+
if ( $attachment_ids ) {
|
20 |
+
?>
|
21 |
+
<div class="thumbnails <?php echo $enable_slider ? 'slider' : 'noslider' ?>">
|
22 |
+
<ul class="yith_magnifier_gallery">
|
23 |
+
<?php
|
24 |
+
$loop = 0;
|
25 |
+
$columns = apply_filters( 'woocommerce_product_thumbnails_columns', get_option( 'yith_wcmg_slider_items', 3 ) );
|
26 |
+
|
27 |
+
foreach ( $attachment_ids as $attachment_id ) {
|
28 |
+
$classes = array( 'yith_magnifier_thumbnail' );
|
29 |
+
|
30 |
+
if ( $loop == 0 || $loop % $columns == 0 ) {
|
31 |
+
$classes[] = 'first';
|
32 |
+
}
|
33 |
+
|
34 |
+
if ( ( $loop + 1 ) % $columns == 0 ) {
|
35 |
+
$classes[] = 'last';
|
36 |
+
}
|
37 |
+
|
38 |
+
$image = wp_get_attachment_image( $attachment_id, apply_filters( 'single_product_small_thumbnail_size', 'shop_thumbnail' ) );
|
39 |
+
$image_class = esc_attr( implode( ' ', $classes ) );
|
40 |
+
$image_title = esc_attr( get_the_title( $attachment_id ) );
|
41 |
+
|
42 |
+
list( $thumbnail_url, $thumbnail_width, $thumbnail_height ) = wp_get_attachment_image_src( $attachment_id, "shop_single" );
|
43 |
+
list( $magnifier_url, $magnifier_width, $magnifier_height ) = wp_get_attachment_image_src( $attachment_id, "shop_magnifier" );
|
44 |
+
|
45 |
+
echo apply_filters( 'woocommerce_single_product_image_thumbnail_html', sprintf( '<li class="%s"><a href="%s" class="%s" title="%s" data-small="%s">%s</a></li>', $image_class, $magnifier_url, $image_class, $image_title, $thumbnail_url, $image ), $attachment_id, $post->ID, $image_class );
|
46 |
+
|
47 |
+
$loop++;
|
48 |
+
}
|
49 |
+
?>
|
50 |
+
</ul>
|
51 |
+
|
52 |
+
<?php if ( $enable_slider ) : ?>
|
53 |
+
<div id="slider-prev"></div>
|
54 |
+
<div id="slider-next"></div>
|
55 |
+
<?php endif; ?>
|
56 |
+
</div>
|
57 |
+
<?php
|
58 |
+
}
|
59 |
+
?>
|
uninstall.php
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Uninstall plugin
|
4 |
+
*
|
5 |
+
* @author Your Inspiration Themes
|
6 |
+
* @package YITH WooCommerce Zoom Magnifier
|
7 |
+
* @version 1.0.0
|
8 |
+
*/
|
9 |
+
|
10 |
+
// If uninstall not called from WordPress exit
|
11 |
+
if( !defined( 'WP_UNINSTALL_PLUGIN' ) )
|
12 |
+
{ exit; }
|
13 |
+
|
14 |
+
global $wpdb;
|
15 |
+
|
yit-common/yit-functions.php
ADDED
@@ -0,0 +1,90 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Your Inspiration Themes common functions
|
4 |
+
*
|
5 |
+
* @author Your Inspiration Themes
|
6 |
+
* @version 0.0.1
|
7 |
+
*/
|
8 |
+
|
9 |
+
if( !defined('YITH_FUNCTIONS')) {
|
10 |
+
define( 'YITH_FUNCTIONS', true);
|
11 |
+
}
|
12 |
+
|
13 |
+
if ( ! function_exists( 'yit_is_woocommerce_active' ) ) {
|
14 |
+
/**
|
15 |
+
* WC Detection
|
16 |
+
*/
|
17 |
+
function yit_is_woocommerce_active() {
|
18 |
+
$active_plugins = (array) get_option( 'active_plugins', array() );
|
19 |
+
|
20 |
+
if ( is_multisite() ) {
|
21 |
+
$active_plugins = array_merge( $active_plugins, get_site_option( 'active_sitewide_plugins', array() ) );
|
22 |
+
}
|
23 |
+
|
24 |
+
$woo = yit_get_plugin_basename_from_slug( 'woocommerce' );
|
25 |
+
return in_array( $woo, $active_plugins ) || array_key_exists( $woo, $active_plugins );
|
26 |
+
}
|
27 |
+
}
|
28 |
+
|
29 |
+
if( ! function_exists( 'yit_get_plugin_basename_from_slug' ) ) {
|
30 |
+
/**
|
31 |
+
* Helper function to extract the file path of the plugin file from the
|
32 |
+
* plugin slug, if the plugin is installed.
|
33 |
+
*
|
34 |
+
* @param string $slug Plugin slug (typically folder name) as provided by the developer
|
35 |
+
* @return string Either file path for plugin if installed, or just the plugin slug
|
36 |
+
*/
|
37 |
+
function yit_get_plugin_basename_from_slug( $slug ) {
|
38 |
+
include_once ABSPATH . '/wp-admin/includes/plugin.php';
|
39 |
+
|
40 |
+
$keys = array_keys( get_plugins() );
|
41 |
+
|
42 |
+
foreach ( $keys as $key ) {
|
43 |
+
if ( preg_match( '|^' . $slug .'|', $key ) )
|
44 |
+
return $key;
|
45 |
+
}
|
46 |
+
|
47 |
+
return $slug;
|
48 |
+
}
|
49 |
+
}
|
50 |
+
|
51 |
+
if( ! function_exists( 'yit_debug') ) {
|
52 |
+
/**
|
53 |
+
* Debug helper function. This is a wrapper for var_dump() that adds
|
54 |
+
* the <pre /> tags, cleans up newlines and indents, and runs
|
55 |
+
* htmlentities() before output.
|
56 |
+
*
|
57 |
+
* @param mixed $var The variable to dump.
|
58 |
+
* @param mixed $var2 The second variable to dump
|
59 |
+
* @param ...
|
60 |
+
* @return string
|
61 |
+
*/
|
62 |
+
function yit_debug() {
|
63 |
+
$args = func_get_args();
|
64 |
+
if( !empty( $args ) ) {
|
65 |
+
foreach( $args as $k=>$arg ) {
|
66 |
+
// var_dump the variable into a buffer and keep the output
|
67 |
+
ob_start();
|
68 |
+
var_dump($arg);
|
69 |
+
$output = ob_get_clean();
|
70 |
+
|
71 |
+
// neaten the newlines and indents
|
72 |
+
$output = preg_replace("/\]\=\>\n(\s+)/m", "] => ", $output);
|
73 |
+
|
74 |
+
if(!extension_loaded('xdebug')) {
|
75 |
+
$output = htmlspecialchars($output, ENT_QUOTES);
|
76 |
+
}
|
77 |
+
|
78 |
+
$output = '<pre class="yit-debug">'
|
79 |
+
. '<strong>$param_' . ($k+1) . ": </strong>"
|
80 |
+
. $output
|
81 |
+
. '</pre>';
|
82 |
+
echo $output;
|
83 |
+
}
|
84 |
+
} else {
|
85 |
+
trigger_error("yit_debug() expects at least 1 parameter, 0 given.", E_USER_WARNING);
|
86 |
+
}
|
87 |
+
|
88 |
+
return $args;
|
89 |
+
}
|
90 |
+
}
|