Testimonials Widget - Version 3.1.1

Version Description

= 3.0.0 =

This is a major overhaul without backwards compliance of over 80 changes. Please read the Testimonials Widget 3.0 and Testimonials Widget Premium 2.0 Upgrade Notice for more help.

If you use custom CSS, actions, or filters to modify Testimonials Widget and Testimonials Widget Premium actions or output, this upgrade will not be compatible with those modifications until corrections are made.

= Older Versions =

Read UPGRADING.

Download this release

Release Info

Developer comprock
Plugin Icon wp plugin Testimonials Widget
Version 3.1.1
Comparing to
See all releases

Code changes from version 3.1.0 to 3.1.1

CHANGELOG.md CHANGED
@@ -2,6 +2,9 @@
2
 
3
  ## master
4
 
 
 
 
5
  ## 3.1.0
6
  * Change brand name from Aihrus to Axelerant
7
  * Change copyright text
2
 
3
  ## master
4
 
5
+ ## 3.1.1
6
+ * Redo SVN release
7
+
8
  ## 3.1.0
9
  * Change brand name from Aihrus to Axelerant
10
  * Change copyright text
includes/libraries/bxslider-4/.jshintrc ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bitwise": true,
3
+ "browser": true,
4
+ "curly": true,
5
+ "eqeqeq": true,
6
+ "eqnull": true,
7
+ "esnext": true,
8
+ "immed": true,
9
+ "jquery": true,
10
+ "latedef": true,
11
+ "newcap": true,
12
+ "noarg": true,
13
+ "node": true,
14
+ "strict": false,
15
+ "trailing": true
16
+ }
includes/libraries/bxslider-4/Gulpfile.js ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // ## Globals
2
+ /*global $:true*/
3
+ var $ = require('gulp-load-plugins')();
4
+ var gulp = require('gulp');
5
+
6
+ // ### Styles
7
+ // `gulp styles` - compiles and optimizes css.
8
+ gulp.task('styles', function() {
9
+ return gulp.src('./src/less/*.less')
10
+ .pipe($.less())
11
+ .pipe($.pleeease({
12
+ autoprefixer: {
13
+ browsers: [
14
+ 'last 2 versions', 'ie 8', 'ie 9', 'android 2.3', 'android 4',
15
+ 'opera 12'
16
+ ]
17
+ },
18
+ minifier: false
19
+ }))
20
+ .pipe(gulp.dest('./dist/'));
21
+ });
22
+
23
+ // ### Scripts
24
+ // `gulp scripts` - runs jshint and uglify
25
+ gulp.task('scripts', ['jshint'], function() {
26
+ return gulp.src('./src/js/*.js')
27
+ .pipe(gulp.dest('./dist/'))
28
+ .pipe($.uglify({
29
+ preserveComments: function (node, comment) {
30
+ if (/^\*\*/.test(comment.value) && /\*\*$/.test(comment.value)) {
31
+
32
+ console.log('Found tri-star comment. Preserving.');
33
+ return true;
34
+ }
35
+ }
36
+ }))
37
+ .pipe($.rename({extname: '.min.js'}))
38
+ .pipe(gulp.dest('./dist/'));
39
+ });
40
+
41
+ // ### Vendor Scripts
42
+ // `gulp vendor` - runs uglify on 3rd party plugins
43
+ gulp.task('vendor', function() {
44
+ return gulp.src('./src/vendor/*.js')
45
+ .pipe(gulp.dest('./dist/vendor'));
46
+ });
47
+
48
+ // ### Images
49
+ // `gulp images` - run lossless compression on all the images.
50
+ gulp.task('images', function() {
51
+ return gulp.src('./src/images/*')
52
+ .pipe($.imagemin({
53
+ progressive: true,
54
+ interlaced: true
55
+ }))
56
+ .pipe(gulp.dest('./dist/images'));
57
+ });
58
+
59
+ // ### JsHint
60
+ // `gulp jshint` - lints configuration JSON and project javascript
61
+ gulp.task('jshint', function() {
62
+ return gulp.src([ 'bower.json', 'gulpfile.js', './src/*.js' ])
63
+ .pipe($.jshint())
64
+ .pipe($.jshint.reporter('jshint-stylish'))
65
+ .pipe($.jshint.reporter('fail'));
66
+ });
67
+
68
+ // ### Clean
69
+ // `gulp clean` - deletes the build folder entirely
70
+ gulp.task('clean', require('del').bind(null, ['dist/']));
71
+
72
+ // ### Build
73
+ // `gulp build` - Run all the build tasks but don't clean up beforehand.
74
+ // Generally you should be running `gulp` instead of `gulp build`.
75
+ gulp.task('build', ['styles', 'scripts', 'images', 'vendor']);
76
+
77
+
78
+ // ### Gulp
79
+ // `gulp` - Run a complete build. To compile for production run `gulp --production`.
80
+ gulp.task('default', ['clean'], function() {
81
+ gulp.start('build');
82
+ });
includes/libraries/bxslider-4/LICENSE.md ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ License
2
+ -------
3
+
4
+ The MIT License (MIT)
5
+
6
+ Copyright © 2014 [Steven Wanderski](https://twitter.com/stevenwanderski)
7
+
8
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
11
+
12
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
includes/libraries/bxslider-4/dist/images/bx_loader.gif ADDED
Binary file
includes/libraries/bxslider-4/dist/images/controls.png ADDED
Binary file
includes/libraries/bxslider-4/dist/jquery.bxslider.css ADDED
@@ -0,0 +1,182 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /***
2
+ * BxSlider v4.2.2 - Fully loaded, responsive content slider
3
+ * http://bxslider.com
4
+ *
5
+ * Written by: Steven Wanderski, 2014
6
+ * http://stevenwanderski.com
7
+ * (while drinking Belgian ales and listening to jazz)
8
+ *
9
+ * CEO and founder of bxCreative, LTD
10
+ * http://bxcreative.com
11
+ ***/
12
+ /** RESET AND LAYOUT
13
+ ===================================*/
14
+ .bx-wrapper {
15
+ position: relative;
16
+ margin: 0 auto 60px;
17
+ padding: 0;
18
+ *zoom: 1;
19
+ -ms-touch-action: pan-y;
20
+ touch-action: pan-y;
21
+ }
22
+ .bx-wrapper img {
23
+ max-width: 100%;
24
+ display: block;
25
+ }
26
+ .bxslider {
27
+ margin: 0;
28
+ padding: 0;
29
+ }
30
+ ul.bxslider {
31
+ list-style: none;
32
+ }
33
+ .bx-viewport {
34
+ /*fix other elements on the page moving (on Chrome)*/
35
+ -webkit-transform: translatez(0);
36
+ }
37
+ /** THEME
38
+ ===================================*/
39
+ .bx-wrapper {
40
+ -webkit-box-shadow: 0 0 5px #ccc;
41
+ box-shadow: 0 0 5px #ccc;
42
+ border: 5px solid #fff;
43
+ background: #fff;
44
+ }
45
+ .bx-wrapper .bx-pager,
46
+ .bx-wrapper .bx-controls-auto {
47
+ position: absolute;
48
+ bottom: -30px;
49
+ width: 100%;
50
+ }
51
+ /* LOADER */
52
+ .bx-wrapper .bx-loading {
53
+ min-height: 50px;
54
+ background: url(images/bx_loader.gif) center center no-repeat #ffffff;
55
+ height: 100%;
56
+ width: 100%;
57
+ position: absolute;
58
+ top: 0;
59
+ left: 0;
60
+ z-index: 2000;
61
+ }
62
+ /* PAGER */
63
+ .bx-wrapper .bx-pager {
64
+ text-align: center;
65
+ font-size: .85em;
66
+ font-family: Arial;
67
+ font-weight: bold;
68
+ color: #666;
69
+ padding-top: 20px;
70
+ }
71
+ .bx-wrapper .bx-pager.bx-default-pager a {
72
+ background: #666;
73
+ text-indent: -9999px;
74
+ display: block;
75
+ width: 10px;
76
+ height: 10px;
77
+ margin: 0 5px;
78
+ outline: 0;
79
+ border-radius: 5px;
80
+ }
81
+ .bx-wrapper .bx-pager.bx-default-pager a:hover,
82
+ .bx-wrapper .bx-pager.bx-default-pager a.active,
83
+ .bx-wrapper .bx-pager.bx-default-pager a:focus {
84
+ background: #000;
85
+ }
86
+ .bx-wrapper .bx-pager-item,
87
+ .bx-wrapper .bx-controls-auto .bx-controls-auto-item {
88
+ display: inline-block;
89
+ *zoom: 1;
90
+ *display: inline;
91
+ }
92
+ .bx-wrapper .bx-pager-item {
93
+ font-size: 0;
94
+ line-height: 0;
95
+ }
96
+ /* DIRECTION CONTROLS (NEXT / PREV) */
97
+ .bx-wrapper .bx-prev {
98
+ left: 10px;
99
+ background: url(images/controls.png) no-repeat 0 -32px;
100
+ }
101
+ .bx-wrapper .bx-prev:hover,
102
+ .bx-wrapper .bx-prev:focus {
103
+ background-position: 0 0;
104
+ }
105
+ .bx-wrapper .bx-next {
106
+ right: 10px;
107
+ background: url(images/controls.png) no-repeat -43px -32px;
108
+ }
109
+ .bx-wrapper .bx-next:hover,
110
+ .bx-wrapper .bx-next:focus {
111
+ background-position: -43px 0;
112
+ }
113
+ .bx-wrapper .bx-controls-direction a {
114
+ position: absolute;
115
+ top: 50%;
116
+ margin-top: -16px;
117
+ outline: 0;
118
+ width: 32px;
119
+ height: 32px;
120
+ text-indent: -9999px;
121
+ z-index: 9999;
122
+ }
123
+ .bx-wrapper .bx-controls-direction a.disabled {
124
+ display: none;
125
+ }
126
+ /* AUTO CONTROLS (START / STOP) */
127
+ .bx-wrapper .bx-controls-auto {
128
+ text-align: center;
129
+ }
130
+ .bx-wrapper .bx-controls-auto .bx-start {
131
+ display: block;
132
+ text-indent: -9999px;
133
+ width: 10px;
134
+ height: 11px;
135
+ outline: 0;
136
+ background: url(images/controls.png) -86px -11px no-repeat;
137
+ margin: 0 3px;
138
+ }
139
+ .bx-wrapper .bx-controls-auto .bx-start:hover,
140
+ .bx-wrapper .bx-controls-auto .bx-start.active,
141
+ .bx-wrapper .bx-controls-auto .bx-start:focus {
142
+ background-position: -86px 0;
143
+ }
144
+ .bx-wrapper .bx-controls-auto .bx-stop {
145
+ display: block;
146
+ text-indent: -9999px;
147
+ width: 9px;
148
+ height: 11px;
149
+ outline: 0;
150
+ background: url(images/controls.png) -86px -44px no-repeat;
151
+ margin: 0 3px;
152
+ }
153
+ .bx-wrapper .bx-controls-auto .bx-stop:hover,
154
+ .bx-wrapper .bx-controls-auto .bx-stop.active,
155
+ .bx-wrapper .bx-controls-auto .bx-stop:focus {
156
+ background-position: -86px -33px;
157
+ }
158
+ /* PAGER WITH AUTO-CONTROLS HYBRID LAYOUT */
159
+ .bx-wrapper .bx-controls.bx-has-controls-auto.bx-has-pager .bx-pager {
160
+ text-align: left;
161
+ width: 80%;
162
+ }
163
+ .bx-wrapper .bx-controls.bx-has-controls-auto.bx-has-pager .bx-controls-auto {
164
+ right: 0;
165
+ width: 35px;
166
+ }
167
+ /* IMAGE CAPTIONS */
168
+ .bx-wrapper .bx-caption {
169
+ position: absolute;
170
+ bottom: 0;
171
+ left: 0;
172
+ background: #666;
173
+ background: rgba(80, 80, 80, 0.75);
174
+ width: 100%;
175
+ }
176
+ .bx-wrapper .bx-caption span {
177
+ color: #fff;
178
+ font-family: Arial;
179
+ display: block;
180
+ font-size: .85em;
181
+ padding: 10px;
182
+ }
includes/libraries/bxslider-4/dist/jquery.bxslider.js ADDED
@@ -0,0 +1,1543 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /***
2
+ * BxSlider v4.2.3 - Fully loaded, responsive content slider
3
+ * http://bxslider.com
4
+ *
5
+ * Copyright 2014, Steven Wanderski - http://stevenwanderski.com - http://bxcreative.com
6
+ * Written while drinking Belgian ales and listening to jazz
7
+ *
8
+ * Released under the MIT license - http://opensource.org/licenses/MIT
9
+ ***/
10
+
11
+ ;(function($){
12
+
13
+ var defaults = {
14
+
15
+ // GENERAL
16
+ mode: 'horizontal',
17
+ slideSelector: '',
18
+ infiniteLoop: true,
19
+ hideControlOnEnd: false,
20
+ speed: 500,
21
+ easing: null,
22
+ slideMargin: 0,
23
+ startSlide: 0,
24
+ randomStart: false,
25
+ captions: false,
26
+ ticker: false,
27
+ tickerHover: false,
28
+ adaptiveHeight: false,
29
+ adaptiveHeightSpeed: 500,
30
+ video: false,
31
+ useCSS: true,
32
+ preloadImages: 'visible',
33
+ responsive: true,
34
+ slideZIndex: 50,
35
+ wrapperClass: 'bx-wrapper',
36
+
37
+ // TOUCH
38
+ touchEnabled: true,
39
+ swipeThreshold: 50,
40
+ oneToOneTouch: true,
41
+ preventDefaultSwipeX: true,
42
+ preventDefaultSwipeY: false,
43
+
44
+ // KEYBOARD
45
+ keyboardEnabled: false,
46
+
47
+ // PAGER
48
+ pager: true,
49
+ pagerType: 'full',
50
+ pagerShortSeparator: ' / ',
51
+ pagerSelector: null,
52
+ buildPager: null,
53
+ pagerCustom: null,
54
+
55
+ // CONTROLS
56
+ controls: true,
57
+ nextText: 'Next',
58
+ prevText: 'Prev',
59
+ nextSelector: null,
60
+ prevSelector: null,
61
+ autoControls: false,
62
+ startText: 'Start',
63
+ stopText: 'Stop',
64
+ autoControlsCombine: false,
65
+ autoControlsSelector: null,
66
+
67
+ // AUTO
68
+ auto: false,
69
+ pause: 4000,
70
+ autoStart: true,
71
+ autoDirection: 'next',
72
+ autoHover: false,
73
+ autoDelay: 0,
74
+ autoSlideForOnePage: false,
75
+
76
+ // CAROUSEL
77
+ minSlides: 1,
78
+ maxSlides: 1,
79
+ moveSlides: 0,
80
+ slideWidth: 0,
81
+
82
+ // CALLBACKS
83
+ onSliderLoad: function(){ return true },
84
+ onSlideBefore: function(){ return true },
85
+ onSlideAfter: function(){ return true },
86
+ onSlideNext: function(){ return true },
87
+ onSlidePrev: function(){ return true },
88
+ onSliderResize: function(){ return true }
89
+ };
90
+
91
+ $.fn.bxSlider = function(options){
92
+
93
+ if(this.length === 0){
94
+ return this;
95
+ }
96
+
97
+ // support multiple elements
98
+ if(this.length > 1){
99
+ this.each(function(){
100
+ $(this).bxSlider(options);
101
+ });
102
+ return this;
103
+ }
104
+
105
+ // create a namespace to be used throughout the plugin
106
+ var slider = {};
107
+ // set a reference to our slider element
108
+ var el = this;
109
+
110
+ /**
111
+ * Makes slideshow responsive
112
+ */
113
+ // first get the original window dimens (thanks a lot IE)
114
+ var windowWidth = $(window).width();
115
+ var windowHeight = $(window).height();
116
+
117
+
118
+
119
+ /**
120
+ * ===================================================================================
121
+ * = PRIVATE FUNCTIONS
122
+ * ===================================================================================
123
+ */
124
+
125
+ /**
126
+ * Initializes namespace settings to be used throughout plugin
127
+ */
128
+ var init = function(){
129
+ // merge user-supplied options with the defaults
130
+ slider.settings = $.extend({}, defaults, options);
131
+ // parse slideWidth setting
132
+ slider.settings.slideWidth = parseInt(slider.settings.slideWidth);
133
+ // store the original children
134
+ slider.children = el.children(slider.settings.slideSelector);
135
+ // check if actual number of slides is less than minSlides / maxSlides
136
+ if(slider.children.length < slider.settings.minSlides){ slider.settings.minSlides = slider.children.length; }
137
+ if(slider.children.length < slider.settings.maxSlides){ slider.settings.maxSlides = slider.children.length; }
138
+ // if random start, set the startSlide setting to random number
139
+ if(slider.settings.randomStart){ slider.settings.startSlide = Math.floor(Math.random() * slider.children.length); }
140
+ // store active slide information
141
+ slider.active = { index: slider.settings.startSlide };
142
+ // store if the slider is in carousel mode (displaying / moving multiple slides)
143
+ slider.carousel = slider.settings.minSlides > 1 || slider.settings.maxSlides > 1 ? true : false;
144
+ // if carousel, force preloadImages = 'all'
145
+ if(slider.carousel){ slider.settings.preloadImages = 'all'; }
146
+ // calculate the min / max width thresholds based on min / max number of slides
147
+ // used to setup and update carousel slides dimensions
148
+ slider.minThreshold = (slider.settings.minSlides * slider.settings.slideWidth) + ((slider.settings.minSlides - 1) * slider.settings.slideMargin);
149
+ slider.maxThreshold = (slider.settings.maxSlides * slider.settings.slideWidth) + ((slider.settings.maxSlides - 1) * slider.settings.slideMargin);
150
+ // store the current state of the slider (if currently animating, working is true)
151
+ slider.working = false;
152
+ // initialize the controls object
153
+ slider.controls = {};
154
+ // initialize an auto interval
155
+ slider.interval = null;
156
+ // determine which property to use for transitions
157
+ slider.animProp = slider.settings.mode === 'vertical' ? 'top' : 'left';
158
+ // determine if hardware acceleration can be used
159
+ slider.usingCSS = slider.settings.useCSS && slider.settings.mode !== 'fade' && (function(){
160
+ // create our test div element
161
+ var div = document.createElement('div');
162
+ // css transition properties
163
+ var props = ['WebkitPerspective', 'MozPerspective', 'OPerspective', 'msPerspective'];
164
+ // test for each property
165
+ for(var i in props){
166
+ if(div.style[props[i]] !== undefined){
167
+ slider.cssPrefix = props[i].replace('Perspective', '').toLowerCase();
168
+ slider.animProp = '-' + slider.cssPrefix + '-transform';
169
+ return true;
170
+ }
171
+ }
172
+ return false;
173
+ }());
174
+ // if vertical mode always make maxSlides and minSlides equal
175
+ if(slider.settings.mode === 'vertical'){ slider.settings.maxSlides = slider.settings.minSlides; }
176
+ // save original style data
177
+ el.data("origStyle", el.attr("style"));
178
+ el.children(slider.settings.slideSelector).each(function(){
179
+ $(this).data("origStyle", $(this).attr("style"));
180
+ });
181
+ // perform all DOM / CSS modifications
182
+ setup();
183
+ };
184
+
185
+ /**
186
+ * Performs all DOM and CSS modifications
187
+ */
188
+ var setup = function(){
189
+ // wrap el in a wrapper
190
+ el.wrap('<div class="' + slider.settings.wrapperClass + '"><div class="bx-viewport"></div></div>');
191
+ // store a namespace reference to .bx-viewport
192
+ slider.viewport = el.parent();
193
+ // add a loading div to display while images are loading
194
+ slider.loader = $('<div class="bx-loading" />');
195
+ slider.viewport.prepend(slider.loader);
196
+ // set el to a massive width, to hold any needed slides
197
+ // also strip any margin and padding from el
198
+ el.css({
199
+ width: slider.settings.mode === 'horizontal' ? (slider.children.length * 1000 + 215) + '%' : 'auto',
200
+ position: 'absolute'
201
+ });
202
+ // if using CSS, add the easing property
203
+ if(slider.usingCSS && slider.settings.easing){
204
+ el.css('-' + slider.cssPrefix + '-transition-timing-function', slider.settings.easing);
205
+ // if not using CSS and no easing value was supplied, use the default JS animation easing (swing)
206
+ }else if(!slider.settings.easing){
207
+ slider.settings.easing = 'swing';
208
+ }
209
+ var slidesShowing = getNumberSlidesShowing();
210
+ // make modifications to the viewport (.bx-viewport)
211
+ slider.viewport.css({
212
+ width: '100%',
213
+ overflow: 'hidden',
214
+ position: 'relative'
215
+ });
216
+ slider.viewport.parent().css({
217
+ maxWidth: getViewportMaxWidth()
218
+ });
219
+ // make modification to the wrapper (.bx-wrapper)
220
+ if(!slider.settings.pager && !slider.settings.controls){
221
+ slider.viewport.parent().css({
222
+ margin: '0 auto 0px'
223
+ });
224
+ }
225
+ // apply css to all slider children
226
+ slider.children.css({
227
+ 'float': slider.settings.mode === 'horizontal' ? 'left' : 'none',
228
+ listStyle: 'none',
229
+ position: 'relative'
230
+ });
231
+ // apply the calculated width after the float is applied to prevent scrollbar interference
232
+ slider.children.css('width', getSlideWidth());
233
+ // if slideMargin is supplied, add the css
234
+ if(slider.settings.mode === 'horizontal' && slider.settings.slideMargin > 0){ slider.children.css('marginRight', slider.settings.slideMargin); }
235
+ if(slider.settings.mode === 'vertical' && slider.settings.slideMargin > 0){ slider.children.css('marginBottom', slider.settings.slideMargin); }
236
+ // if "fade" mode, add positioning and z-index CSS
237
+ if(slider.settings.mode === 'fade'){
238
+ slider.children.css({
239
+ position: 'absolute',
240
+ zIndex: 0,
241
+ display: 'none'
242
+ });
243
+ // prepare the z-index on the showing element
244
+ slider.children.eq(slider.settings.startSlide).css({zIndex: slider.settings.slideZIndex, display: 'block'});
245
+ }
246
+ // create an element to contain all slider controls (pager, start / stop, etc)
247
+ slider.controls.el = $('<div class="bx-controls" />');
248
+ // if captions are requested, add them
249
+ if(slider.settings.captions){ appendCaptions(); }
250
+ // check if startSlide is last slide
251
+ slider.active.last = slider.settings.startSlide === getPagerQty() - 1;
252
+ // if video is true, set up the fitVids plugin
253
+ if(slider.settings.video){ el.fitVids(); }
254
+ // set the default preload selector (visible)
255
+ var preloadSelector = slider.children.eq(slider.settings.startSlide);
256
+ if(slider.settings.preloadImages === "all" || slider.settings.ticker){ preloadSelector = slider.children; }
257
+ // only check for control addition if not in "ticker" mode
258
+ if(!slider.settings.ticker){
259
+ // if controls are requested, add them
260
+ if(slider.settings.controls){ appendControls(); }
261
+ // if auto is true, and auto controls are requested, add them
262
+ if(slider.settings.auto && slider.settings.autoControls){ appendControlsAuto(); }
263
+ // if pager is requested, add it
264
+ if(slider.settings.pager){ appendPager(); }
265
+ // if any control option is requested, add the controls wrapper
266
+ if(slider.settings.controls || slider.settings.autoControls || slider.settings.pager){ slider.viewport.after(slider.controls.el); }
267
+ // if ticker mode, do not allow a pager
268
+ } else {
269
+ slider.settings.pager = false;
270
+ }
271
+ loadElements(preloadSelector, start);
272
+ };
273
+
274
+ var loadElements = function(selector, callback){
275
+ var total = selector.find('img:not([src=""]), iframe').length;
276
+ if(total === 0){
277
+ callback();
278
+ return;
279
+ }
280
+ var count = 0;
281
+ selector.find('img:not([src=""]), iframe').each(function(){
282
+ $(this).one('load error', function(){
283
+ if(++count === total){ callback(); }
284
+ }).each(function(){
285
+ if(this.complete){ $(this).load(); }
286
+ });
287
+ });
288
+ };
289
+
290
+ /**
291
+ * Start the slider
292
+ */
293
+ var start = function(){
294
+ // if infinite loop, prepare additional slides
295
+ if(slider.settings.infiniteLoop && slider.settings.mode !== 'fade' && !slider.settings.ticker){
296
+ var slice = slider.settings.mode === 'vertical' ? slider.settings.minSlides : slider.settings.maxSlides;
297
+ var sliceAppend = slider.children.slice(0, slice).clone(true).addClass('bx-clone');
298
+ var slicePrepend = slider.children.slice(-slice).clone(true).addClass('bx-clone');
299
+ el.append(sliceAppend).prepend(slicePrepend);
300
+ }
301
+ // remove the loading DOM element
302
+ slider.loader.remove();
303
+ // set the left / top position of "el"
304
+ setSlidePosition();
305
+ // if "vertical" mode, always use adaptiveHeight to prevent odd behavior
306
+ if(slider.settings.mode === 'vertical'){ slider.settings.adaptiveHeight = true; }
307
+ // set the viewport height
308
+ slider.viewport.height(getViewportHeight());
309
+ // make sure everything is positioned just right (same as a window resize)
310
+ el.redrawSlider();
311
+ // onSliderLoad callback
312
+ slider.settings.onSliderLoad(slider,slider.active.index);
313
+ // slider has been fully initialized
314
+ slider.initialized = true;
315
+ // bind the resize call to the window
316
+ if(slider.settings.responsive){ $(window).bind('resize', resizeWindow); }
317
+ // if auto is true and has more than 1 page, start the show
318
+ if(slider.settings.auto && slider.settings.autoStart && (getPagerQty() > 1 || slider.settings.autoSlideForOnePage)){ initAuto(); }
319
+ // if ticker is true, start the ticker
320
+ if(slider.settings.ticker){ initTicker(); }
321
+ // if pager is requested, make the appropriate pager link active
322
+ if(slider.settings.pager){ updatePagerActive(slider.settings.startSlide); }
323
+ // check for any updates to the controls (like hideControlOnEnd updates)
324
+ if(slider.settings.controls){ updateDirectionControls(); }
325
+ // if touchEnabled is true, setup the touch events
326
+ if(slider.settings.touchEnabled && !slider.settings.ticker){ initTouch(); }
327
+ // if keyboardEnabled is true, setup the keyboard events
328
+ if (slider.settings.keyboardEnabled && !slider.settings.ticker) {
329
+ $(document).keydown(keyPress);
330
+ }
331
+ };
332
+
333
+ /**
334
+ * Returns the calculated height of the viewport, used to determine either adaptiveHeight or the maxHeight value
335
+ */
336
+ var getViewportHeight = function(){
337
+ var height = 0;
338
+ // first determine which children (slides) should be used in our height calculation
339
+ var children = $();
340
+ // if mode is not "vertical" and adaptiveHeight is false, include all children
341
+ if(slider.settings.mode !== 'vertical' && !slider.settings.adaptiveHeight){
342
+ children = slider.children;
343
+ }else{
344
+ // if not carousel, return the single active child
345
+ if(!slider.carousel){
346
+ children = slider.children.eq(slider.active.index);
347
+ // if carousel, return a slice of children
348
+ }else{
349
+ // get the individual slide index
350
+ var currentIndex = slider.settings.moveSlides === 1 ? slider.active.index : slider.active.index * getMoveBy();
351
+ // add the current slide to the children
352
+ children = slider.children.eq(currentIndex);
353
+ // cycle through the remaining "showing" slides
354
+ for (i = 1; i <= slider.settings.maxSlides - 1; i++){
355
+ // if looped back to the start
356
+ if(currentIndex + i >= slider.children.length){
357
+ children = children.add(slider.children.eq(i - 1));
358
+ }else{
359
+ children = children.add(slider.children.eq(currentIndex + i));
360
+ }
361
+ }
362
+ }
363
+ }
364
+ // if "vertical" mode, calculate the sum of the heights of the children
365
+ if(slider.settings.mode === 'vertical'){
366
+ children.each(function(index){
367
+ height += $(this).outerHeight();
368
+ });
369
+ // add user-supplied margins
370
+ if(slider.settings.slideMargin > 0){
371
+ height += slider.settings.slideMargin * (slider.settings.minSlides - 1);
372
+ }
373
+ // if not "vertical" mode, calculate the max height of the children
374
+ }else{
375
+ height = Math.max.apply(Math, children.map(function(){
376
+ return $(this).outerHeight(false);
377
+ }).get());
378
+ }
379
+
380
+ if(slider.viewport.css('box-sizing') === 'border-box'){
381
+ height += parseFloat(slider.viewport.css('padding-top')) + parseFloat(slider.viewport.css('padding-bottom')) +
382
+ parseFloat(slider.viewport.css('border-top-width')) + parseFloat(slider.viewport.css('border-bottom-width'));
383
+ }else if(slider.viewport.css('box-sizing') === 'padding-box'){
384
+ height += parseFloat(slider.viewport.css('padding-top')) + parseFloat(slider.viewport.css('padding-bottom'));
385
+ }
386
+
387
+ return height;
388
+ };
389
+
390
+ /**
391
+ * Returns the calculated width to be used for the outer wrapper / viewport
392
+ */
393
+ var getViewportMaxWidth = function(){
394
+ var width = '100%';
395
+ if(slider.settings.slideWidth > 0){
396
+ if(slider.settings.mode === 'horizontal'){
397
+ width = (slider.settings.maxSlides * slider.settings.slideWidth) + ((slider.settings.maxSlides - 1) * slider.settings.slideMargin);
398
+ }else{
399
+ width = slider.settings.slideWidth;
400
+ }
401
+ }
402
+ return width;
403
+ };
404
+
405
+ /**
406
+ * Returns the calculated width to be applied to each slide
407
+ */
408
+ var getSlideWidth = function(){
409
+ // start with any user-supplied slide width
410
+ var newElWidth = slider.settings.slideWidth;
411
+ // get the current viewport width
412
+ var wrapWidth = slider.viewport.width();
413
+ // if slide width was not supplied, or is larger than the viewport use the viewport width
414
+ if(slider.settings.slideWidth === 0 ||
415
+ (slider.settings.slideWidth > wrapWidth && !slider.carousel) ||
416
+ slider.settings.mode === 'vertical'){
417
+ newElWidth = wrapWidth;
418
+ // if carousel, use the thresholds to determine the width
419
+ }else if(slider.settings.maxSlides > 1 && slider.settings.mode === 'horizontal'){
420
+ if(wrapWidth > slider.maxThreshold){
421
+ // newElWidth = (wrapWidth - (slider.settings.slideMargin * (slider.settings.maxSlides - 1))) / slider.settings.maxSlides;
422
+ }else if(wrapWidth < slider.minThreshold){
423
+ newElWidth = (wrapWidth - (slider.settings.slideMargin * (slider.settings.minSlides - 1))) / slider.settings.minSlides;
424
+ }
425
+ }
426
+ return newElWidth;
427
+ };
428
+
429
+ /**
430
+ * Returns the number of slides currently visible in the viewport (includes partially visible slides)
431
+ */
432
+ var getNumberSlidesShowing = function(){
433
+ var slidesShowing = 1;
434
+ if(slider.settings.mode === 'horizontal' && slider.settings.slideWidth > 0){
435
+ // if viewport is smaller than minThreshold, return minSlides
436
+ if(slider.viewport.width() < slider.minThreshold){
437
+ slidesShowing = slider.settings.minSlides;
438
+ // if viewport is larger than maxThreshold, return maxSlides
439
+ }else if(slider.viewport.width() > slider.maxThreshold){
440
+ slidesShowing = slider.settings.maxSlides;
441
+ // if viewport is between min / max thresholds, divide viewport width by first child width
442
+ }else{
443
+ var childWidth = slider.children.first().width() + slider.settings.slideMargin;
444
+ slidesShowing = Math.floor((slider.viewport.width() +
445
+ slider.settings.slideMargin) / childWidth);
446
+ }
447
+ // if "vertical" mode, slides showing will always be minSlides
448
+ }else if(slider.settings.mode === 'vertical'){
449
+ slidesShowing = slider.settings.minSlides;
450
+ }
451
+ return slidesShowing;
452
+ };
453
+
454
+ /**
455
+ * Returns the number of pages (one full viewport of slides is one "page")
456
+ */
457
+ var getPagerQty = function(){
458
+ var pagerQty = 0;
459
+ // if moveSlides is specified by the user
460
+ if(slider.settings.moveSlides > 0){
461
+ if(slider.settings.infiniteLoop){
462
+ pagerQty = Math.ceil(slider.children.length / getMoveBy());
463
+ }else{
464
+ // use a while loop to determine pages
465
+ var breakPoint = 0;
466
+ var counter = 0;
467
+ // when breakpoint goes above children length, counter is the number of pages
468
+ while (breakPoint < slider.children.length){
469
+ ++pagerQty;
470
+ breakPoint = counter + getNumberSlidesShowing();
471
+ counter += slider.settings.moveSlides <= getNumberSlidesShowing() ? slider.settings.moveSlides : getNumberSlidesShowing();
472
+ }
473
+ }
474
+ // if moveSlides is 0 (auto) divide children length by sides showing, then round up
475
+ }else{
476
+ pagerQty = Math.ceil(slider.children.length / getNumberSlidesShowing());
477
+ }
478
+ return pagerQty;
479
+ };
480
+
481
+ /**
482
+ * Returns the number of individual slides by which to shift the slider
483
+ */
484
+ var getMoveBy = function(){
485
+ // if moveSlides was set by the user and moveSlides is less than number of slides showing
486
+ if(slider.settings.moveSlides > 0 && slider.settings.moveSlides <= getNumberSlidesShowing()){
487
+ return slider.settings.moveSlides;
488
+ }
489
+ // if moveSlides is 0 (auto)
490
+ return getNumberSlidesShowing();
491
+ };
492
+
493
+ /**
494
+ * Sets the slider's (el) left or top position
495
+ */
496
+ var setSlidePosition = function(){
497
+ var position;
498
+ // if last slide, not infinite loop, and number of children is larger than specified maxSlides
499
+ if(slider.children.length > slider.settings.maxSlides && slider.active.last && !slider.settings.infiniteLoop){
500
+ if(slider.settings.mode === 'horizontal'){
501
+ // get the last child's position
502
+ var lastChild = slider.children.last();
503
+ position = lastChild.position();
504
+ // set the left position
505
+ setPositionProperty(-(position.left - (slider.viewport.width() - lastChild.outerWidth())), 'reset', 0);
506
+ }else if(slider.settings.mode === 'vertical'){
507
+ // get the last showing index's position
508
+ var lastShowingIndex = slider.children.length - slider.settings.minSlides;
509
+ position = slider.children.eq(lastShowingIndex).position();
510
+ // set the top position
511
+ setPositionProperty(-position.top, 'reset', 0);
512
+ }
513
+ // if not last slide
514
+ }else{
515
+ // get the position of the first showing slide
516
+ position = slider.children.eq(slider.active.index * getMoveBy()).position();
517
+ // check for last slide
518
+ if(slider.active.index === getPagerQty() - 1){ slider.active.last = true; }
519
+ // set the respective position
520
+ if(position !== undefined){
521
+ if(slider.settings.mode === 'horizontal'){ setPositionProperty(-position.left, 'reset', 0); }
522
+ else if(slider.settings.mode === 'vertical'){ setPositionProperty(-position.top, 'reset', 0); }
523
+ }
524
+ }
525
+ };
526
+
527
+ /**
528
+ * Sets the el's animating property position (which in turn will sometimes animate el).
529
+ * If using CSS, sets the transform property. If not using CSS, sets the top / left property.
530
+ *
531
+ * @param value (int)
532
+ * - the animating property's value
533
+ *
534
+ * @param type (string) 'slide', 'reset', 'ticker'
535
+ * - the type of instance for which the function is being
536
+ *
537
+ * @param duration (int)
538
+ * - the amount of time (in ms) the transition should occupy
539
+ *
540
+ * @param params (array) optional
541
+ * - an optional parameter containing any variables that need to be passed in
542
+ */
543
+ var setPositionProperty = function(value, type, duration, params){
544
+ // use CSS transform
545
+ if(slider.usingCSS){
546
+ // determine the translate3d value
547
+ var propValue = slider.settings.mode === 'vertical' ? 'translate3d(0, ' + value + 'px, 0)' : 'translate3d(' + value + 'px, 0, 0)';
548
+ // add the CSS transition-duration
549
+ el.css('-' + slider.cssPrefix + '-transition-duration', duration / 1000 + 's');
550
+ if(type === 'slide'){
551
+ setTimeout(function() {
552
+ // set the property value
553
+ el.css(slider.animProp, propValue);
554
+ // if value 0, just update
555
+ if(value === 0) {
556
+ updateAfterSlideTransition();
557
+ } else {
558
+ // bind a callback method - executes when CSS transition completes
559
+ el.bind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', function(){
560
+ // unbind the callback
561
+ el.unbind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd');
562
+ updateAfterSlideTransition();
563
+ });
564
+ }
565
+ }, 0);
566
+ }else if(type === 'reset'){
567
+ el.css(slider.animProp, propValue);
568
+ }else if(type === 'ticker'){
569
+ // make the transition use 'linear'
570
+ el.css('-' + slider.cssPrefix + '-transition-timing-function', 'linear');
571
+ el.css(slider.animProp, propValue);
572
+ // bind a callback method - executes when CSS transition completes
573
+ el.bind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', function(){
574
+ // unbind the callback
575
+ el.unbind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd');
576
+ // reset the position
577
+ setPositionProperty(params.resetValue, 'reset', 0);
578
+ // start the loop again
579
+ tickerLoop();
580
+ });
581
+ }
582
+ // use JS animate
583
+ }else{
584
+ var animateObj = {};
585
+ animateObj[slider.animProp] = value;
586
+ if(type === 'slide'){
587
+ el.animate(animateObj, duration, slider.settings.easing, function(){
588
+ updateAfterSlideTransition();
589
+ });
590
+ }else if(type === 'reset'){
591
+ el.css(slider.animProp, value);
592
+ }else if(type === 'ticker'){
593
+ el.animate(animateObj, speed, 'linear', function(){
594
+ setPositionProperty(params.resetValue, 'reset', 0);
595
+ // run the recursive loop after animation
596
+ tickerLoop();
597
+ });
598
+ }
599
+ }
600
+ };
601
+
602
+ /**
603
+ * Populates the pager with proper amount of pages
604
+ */
605
+ var populatePager = function(){
606
+ var pagerHtml = '';
607
+ var pagerQty = getPagerQty();
608
+ // loop through each pager item
609
+ for(var i=0; i < pagerQty; i++){
610
+ var linkContent = '';
611
+ // if a buildPager function is supplied, use it to get pager link value, else use index + 1
612
+ if(slider.settings.buildPager && $.isFunction(slider.settings.buildPager) || slider.settings.pagerCustom){
613
+ linkContent = slider.settings.buildPager(i);
614
+ slider.pagerEl.addClass('bx-custom-pager');
615
+ }else{
616
+ linkContent = i + 1;
617
+ slider.pagerEl.addClass('bx-default-pager');
618
+ }
619
+ // var linkContent = slider.settings.buildPager && $.isFunction(slider.settings.buildPager) ? slider.settings.buildPager(i) : i + 1;
620
+ // add the markup to the string
621
+ pagerHtml += '<div class="bx-pager-item"><a href="" data-slide-index="' + i + '" class="bx-pager-link">' + linkContent + '</a></div>';
622
+ }
623
+ // populate the pager element with pager links
624
+ slider.pagerEl.html(pagerHtml);
625
+ };
626
+
627
+ /**
628
+ * Appends the pager to the controls element
629
+ */
630
+ var appendPager = function(){
631
+ if(!slider.settings.pagerCustom){
632
+ // create the pager DOM element
633
+ slider.pagerEl = $('<div class="bx-pager" />');
634
+ // if a pager selector was supplied, populate it with the pager
635
+ if(slider.settings.pagerSelector){
636
+ $(slider.settings.pagerSelector).html(slider.pagerEl);
637
+ // if no pager selector was supplied, add it after the wrapper
638
+ }else{
639
+ slider.controls.el.addClass('bx-has-pager').append(slider.pagerEl);
640
+ }
641
+ // populate the pager
642
+ populatePager();
643
+ }else{
644
+ slider.pagerEl = $(slider.settings.pagerCustom);
645
+ }
646
+ // assign the pager click binding
647
+ slider.pagerEl.on('click touchend', 'a', clickPagerBind);
648
+ };
649
+
650
+ /**
651
+ * Appends prev / next controls to the controls element
652
+ */
653
+ var appendControls = function(){
654
+ slider.controls.next = $('<a class="bx-next" href="">' + slider.settings.nextText + '</a>');
655
+ slider.controls.prev = $('<a class="bx-prev" href="">' + slider.settings.prevText + '</a>');
656
+ // bind click actions to the controls
657
+ slider.controls.next.bind('click touchend', clickNextBind);
658
+ slider.controls.prev.bind('click touchend', clickPrevBind);
659
+ // if nextSelector was supplied, populate it
660
+ if(slider.settings.nextSelector){
661
+ $(slider.settings.nextSelector).append(slider.controls.next);
662
+ }
663
+ // if prevSelector was supplied, populate it
664
+ if(slider.settings.prevSelector){
665
+ $(slider.settings.prevSelector).append(slider.controls.prev);
666
+ }
667
+ // if no custom selectors were supplied
668
+ if(!slider.settings.nextSelector && !slider.settings.prevSelector){
669
+ // add the controls to the DOM
670
+ slider.controls.directionEl = $('<div class="bx-controls-direction" />');
671
+ // add the control elements to the directionEl
672
+ slider.controls.directionEl.append(slider.controls.prev).append(slider.controls.next);
673
+ // slider.viewport.append(slider.controls.directionEl);
674
+ slider.controls.el.addClass('bx-has-controls-direction').append(slider.controls.directionEl);
675
+ }
676
+ };
677
+
678
+ /**
679
+ * Appends start / stop auto controls to the controls element
680
+ */
681
+ var appendControlsAuto = function(){
682
+ slider.controls.start = $('<div class="bx-controls-auto-item"><a class="bx-start" href="">' + slider.settings.startText + '</a></div>');
683
+ slider.controls.stop = $('<div class="bx-controls-auto-item"><a class="bx-stop" href="">' + slider.settings.stopText + '</a></div>');
684
+ // add the controls to the DOM
685
+ slider.controls.autoEl = $('<div class="bx-controls-auto" />');
686
+ // bind click actions to the controls
687
+ slider.controls.autoEl.on('click', '.bx-start', clickStartBind);
688
+ slider.controls.autoEl.on('click', '.bx-stop', clickStopBind);
689
+ // if autoControlsCombine, insert only the "start" control
690
+ if(slider.settings.autoControlsCombine){
691
+ slider.controls.autoEl.append(slider.controls.start);
692
+ // if autoControlsCombine is false, insert both controls
693
+ }else{
694
+ slider.controls.autoEl.append(slider.controls.start).append(slider.controls.stop);
695
+ }
696
+ // if auto controls selector was supplied, populate it with the controls
697
+ if(slider.settings.autoControlsSelector){
698
+ $(slider.settings.autoControlsSelector).html(slider.controls.autoEl);
699
+ // if auto controls selector was not supplied, add it after the wrapper
700
+ }else{
701
+ slider.controls.el.addClass('bx-has-controls-auto').append(slider.controls.autoEl);
702
+ }
703
+ // update the auto controls
704
+ updateAutoControls(slider.settings.autoStart ? 'stop' : 'start');
705
+ };
706
+
707
+ /**
708
+ * Appends image captions to the DOM
709
+ */
710
+ var appendCaptions = function(){
711
+ // cycle through each child
712
+ slider.children.each(function(index){
713
+ // get the image title attribute
714
+ var title = $(this).find('img:first').attr('title');
715
+ // append the caption
716
+ if(title !== undefined && ('' + title).length){
717
+ $(this).append('<div class="bx-caption"><span>' + title + '</span></div>');
718
+ }
719
+ });
720
+ };
721
+
722
+ /**
723
+ * Click next binding
724
+ *
725
+ * @param e (event)
726
+ * - DOM event object
727
+ */
728
+ var clickNextBind = function(e){
729
+ e.preventDefault();
730
+ if (slider.controls.el.hasClass('disabled')) {
731
+ return;
732
+ }
733
+ // if auto show is running, stop it
734
+ if(slider.settings.auto){ el.stopAuto(); }
735
+ el.goToNextSlide();
736
+ };
737
+
738
+ /**
739
+ * Click prev binding
740
+ *
741
+ * @param e (event)
742
+ * - DOM event object
743
+ */
744
+ var clickPrevBind = function(e){
745
+ e.preventDefault();
746
+ if (slider.controls.el.hasClass('disabled')) {
747
+ return;
748
+ }
749
+ // if auto show is running, stop it
750
+ if(slider.settings.auto){ el.stopAuto(); }
751
+ el.goToPrevSlide();
752
+ };
753
+
754
+ /**
755
+ * Click start binding
756
+ *
757
+ * @param e (event)
758
+ * - DOM event object
759
+ */
760
+ var clickStartBind = function(e){
761
+ el.startAuto();
762
+ e.preventDefault();
763
+ };
764
+
765
+ /**
766
+ * Click stop binding
767
+ *
768
+ * @param e (event)
769
+ * - DOM event object
770
+ */
771
+ var clickStopBind = function(e){
772
+ el.stopAuto();
773
+ e.preventDefault();
774
+ };
775
+
776
+ /**
777
+ * Click pager binding
778
+ *
779
+ * @param e (event)
780
+ * - DOM event object
781
+ */
782
+ var clickPagerBind = function(e){
783
+ e.preventDefault();
784
+ if (slider.controls.el.hasClass('disabled')) {
785
+ return;
786
+ }
787
+ // if auto show is running, stop it
788
+ if(slider.settings.auto){ el.stopAuto(); }
789
+ var pagerLink = $(e.currentTarget);
790
+ if(pagerLink.attr('data-slide-index') !== undefined){
791
+ var pagerIndex = parseInt(pagerLink.attr('data-slide-index'));
792
+ // if clicked pager link is not active, continue with the goToSlide call
793
+ if(pagerIndex !== slider.active.index){ el.goToSlide(pagerIndex); }
794
+ }
795
+ };
796
+
797
+ /**
798
+ * Updates the pager links with an active class
799
+ *
800
+ * @param slideIndex (int)
801
+ * - index of slide to make active
802
+ */
803
+ var updatePagerActive = function(slideIndex){
804
+ // if "short" pager type
805
+ var len = slider.children.length; // nb of children
806
+ if(slider.settings.pagerType === 'short'){
807
+ if(slider.settings.maxSlides > 1){
808
+ len = Math.ceil(slider.children.length/slider.settings.maxSlides);
809
+ }
810
+ slider.pagerEl.html( (slideIndex + 1) + slider.settings.pagerShortSeparator + len);
811
+ return;
812
+ }
813
+ // remove all pager active classes
814
+ slider.pagerEl.find('a').removeClass('active');
815
+ // apply the active class for all pagers
816
+ slider.pagerEl.each(function(i, el){ $(el).find('a').eq(slideIndex).addClass('active'); });
817
+ };
818
+
819
+ /**
820
+ * Performs needed actions after a slide transition
821
+ */
822
+ var updateAfterSlideTransition = function(){
823
+ // if infinite loop is true
824
+ if(slider.settings.infiniteLoop){
825
+ var position = '';
826
+ // first slide
827
+ if(slider.active.index === 0){
828
+ // set the new position
829
+ position = slider.children.eq(0).position();
830
+ // carousel, last slide
831
+ }else if(slider.active.index === getPagerQty() - 1 && slider.carousel){
832
+ position = slider.children.eq((getPagerQty() - 1) * getMoveBy()).position();
833
+ // last slide
834
+ }else if(slider.active.index === slider.children.length - 1){
835
+ position = slider.children.eq(slider.children.length - 1).position();
836
+ }
837
+ if(position){
838
+ if(slider.settings.mode === 'horizontal'){ setPositionProperty(-position.left, 'reset', 0); }
839
+ else if(slider.settings.mode === 'vertical'){ setPositionProperty(-position.top, 'reset', 0); }
840
+ }
841
+ }
842
+ // declare that the transition is complete
843
+ slider.working = false;
844
+ // onSlideAfter callback
845
+ slider.settings.onSlideAfter(slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index);
846
+ };
847
+
848
+ /**
849
+ * Updates the auto controls state (either active, or combined switch)
850
+ *
851
+ * @param state (string) "start", "stop"
852
+ * - the new state of the auto show
853
+ */
854
+ var updateAutoControls = function(state){
855
+ // if autoControlsCombine is true, replace the current control with the new state
856
+ if(slider.settings.autoControlsCombine){
857
+ slider.controls.autoEl.html(slider.controls[state]);
858
+ // if autoControlsCombine is false, apply the "active" class to the appropriate control
859
+ }else{
860
+ slider.controls.autoEl.find('a').removeClass('active');
861
+ slider.controls.autoEl.find('a:not(.bx-' + state + ')').addClass('active');
862
+ }
863
+ };
864
+
865
+ /**
866
+ * Updates the direction controls (checks if either should be hidden)
867
+ */
868
+ var updateDirectionControls = function(){
869
+ if(getPagerQty() === 1){
870
+ slider.controls.prev.addClass('disabled');
871
+ slider.controls.next.addClass('disabled');
872
+ }else if(!slider.settings.infiniteLoop && slider.settings.hideControlOnEnd){
873
+ // if first slide
874
+ if(slider.active.index === 0){
875
+ slider.controls.prev.addClass('disabled');
876
+ slider.controls.next.removeClass('disabled');
877
+ // if last slide
878
+ }else if(slider.active.index === getPagerQty() - 1){
879
+ slider.controls.next.addClass('disabled');
880
+ slider.controls.prev.removeClass('disabled');
881
+ // if any slide in the middle
882
+ }else{
883
+ slider.controls.prev.removeClass('disabled');
884
+ slider.controls.next.removeClass('disabled');
885
+ }
886
+ }
887
+ };
888
+
889
+ /**
890
+ * Initializes the auto process
891
+ */
892
+ var initAuto = function(){
893
+ // if autoDelay was supplied, launch the auto show using a setTimeout() call
894
+ if(slider.settings.autoDelay > 0){
895
+ var timeout = setTimeout(el.startAuto, slider.settings.autoDelay);
896
+ // if autoDelay was not supplied, start the auto show normally
897
+ }else{
898
+ el.startAuto();
899
+
900
+ //add focus and blur events to ensure its running if timeout gets paused
901
+ $(window).focus(function() {
902
+ el.startAuto();
903
+ }).blur(function() {
904
+ el.stopAuto();
905
+ });
906
+
907
+
908
+ }
909
+ // if autoHover is requested
910
+ if(slider.settings.autoHover){
911
+ // on el hover
912
+ el.hover(function(){
913
+ // if the auto show is currently playing (has an active interval)
914
+ if(slider.interval){
915
+ // stop the auto show and pass true argument which will prevent control update
916
+ el.stopAuto(true);
917
+ // create a new autoPaused value which will be used by the relative "mouseout" event
918
+ slider.autoPaused = true;
919
+ }
920
+ }, function(){
921
+ // if the autoPaused value was created be the prior "mouseover" event
922
+ if(slider.autoPaused){
923
+ // start the auto show and pass true argument which will prevent control update
924
+ el.startAuto(true);
925
+ // reset the autoPaused value
926
+ slider.autoPaused = null;
927
+ }
928
+ });
929
+ }
930
+ };
931
+
932
+ /**
933
+ * Initializes the ticker process
934
+ */
935
+ var initTicker = function(){
936
+ var startPosition = 0;
937
+ // if autoDirection is "next", append a clone of the entire slider
938
+ if(slider.settings.autoDirection === 'next'){
939
+ el.append(slider.children.clone().addClass('bx-clone'));
940
+ // if autoDirection is "prev", prepend a clone of the entire slider, and set the left position
941
+ }else{
942
+ el.prepend(slider.children.clone().addClass('bx-clone'));
943
+ var position = slider.children.first().position();
944
+ startPosition = slider.settings.mode === 'horizontal' ? -position.left : -position.top;
945
+ }
946
+ setPositionProperty(startPosition, 'reset', 0);
947
+ // do not allow controls in ticker mode
948
+ slider.settings.pager = false;
949
+ slider.settings.controls = false;
950
+ slider.settings.autoControls = false;
951
+ // if autoHover is requested
952
+ if(slider.settings.tickerHover){
953
+ if(slider.usingCSS){
954
+ var value;
955
+ var idx = slider.settings.mode == 'horizontal' ? 4 : 5;
956
+ slider.viewport.hover(function(){
957
+ var transform = el.css('-' + slider.cssPrefix + '-transform');
958
+ value = parseFloat(transform.split(',')[idx]);
959
+ setPositionProperty(value, 'reset', 0);
960
+ }, function(){
961
+ var totalDimens = 0;
962
+ slider.children.each(function(index){
963
+ totalDimens += slider.settings.mode == 'horizontal' ? $(this).outerWidth(true) : $(this).outerHeight(true);
964
+ });
965
+ // calculate the speed ratio (used to determine the new speed to finish the paused animation)
966
+ var ratio = slider.settings.speed / totalDimens;
967
+ // determine which property to use
968
+ var property = slider.settings.mode == 'horizontal' ? 'left' : 'top';
969
+ // calculate the new speed
970
+ var newSpeed = ratio * (totalDimens - (Math.abs(parseInt(value))));
971
+ tickerLoop(newSpeed);
972
+ });
973
+ } else {
974
+ // on el hover
975
+ slider.viewport.hover(function(){
976
+ el.stop();
977
+ }, function(){
978
+ // calculate the total width of children (used to calculate the speed ratio)
979
+ var totalDimens = 0;
980
+ slider.children.each(function(index){
981
+ totalDimens += slider.settings.mode == 'horizontal' ? $(this).outerWidth(true) : $(this).outerHeight(true);
982
+ });
983
+ // calculate the speed ratio (used to determine the new speed to finish the paused animation)
984
+ var ratio = slider.settings.speed / totalDimens;
985
+ // determine which property to use
986
+ var property = slider.settings.mode == 'horizontal' ? 'left' : 'top';
987
+ // calculate the new speed
988
+ var newSpeed = ratio * (totalDimens - (Math.abs(parseInt(el.css(property)))));
989
+ tickerLoop(newSpeed);
990
+ });
991
+ }
992
+ }
993
+ // start the ticker loop
994
+ tickerLoop();
995
+ };
996
+
997
+ /**
998
+ * Runs a continuous loop, news ticker-style
999
+ */
1000
+ var tickerLoop = function(resumeSpeed){
1001
+ speed = resumeSpeed ? resumeSpeed : slider.settings.speed;
1002
+ var position = {left: 0, top: 0};
1003
+ var reset = {left: 0, top: 0};
1004
+ // if "next" animate left position to last child, then reset left to 0
1005
+ if(slider.settings.autoDirection === 'next'){
1006
+ position = el.find('.bx-clone').first().position();
1007
+ // if "prev" animate left position to 0, then reset left to first non-clone child
1008
+ }else{
1009
+ reset = slider.children.first().position();
1010
+ }
1011
+ var animateProperty = slider.settings.mode === 'horizontal' ? -position.left : -position.top;
1012
+ var resetValue = slider.settings.mode === 'horizontal' ? -reset.left : -reset.top;
1013
+ var params = {resetValue: resetValue};
1014
+ setPositionProperty(animateProperty, 'ticker', speed, params);
1015
+ };
1016
+
1017
+ /**
1018
+ * Check if el is on screen
1019
+ */
1020
+ var isOnScreen = function(el){
1021
+ var win = $(window);
1022
+ var viewport = {
1023
+ top : win.scrollTop(),
1024
+ left : win.scrollLeft()
1025
+ };
1026
+ viewport.right = viewport.left + win.width();
1027
+ viewport.bottom = viewport.top + win.height();
1028
+
1029
+ var bounds = el.offset();
1030
+ bounds.right = bounds.left + el.outerWidth();
1031
+ bounds.bottom = bounds.top + el.outerHeight();
1032
+
1033
+ return (!(viewport.right < bounds.left || viewport.left > bounds.right || viewport.bottom < bounds.top || viewport.top > bounds.bottom));
1034
+ };
1035
+
1036
+ /**
1037
+ * Initializes keyboard events
1038
+ */
1039
+ var keyPress = function(e){
1040
+ var activeElementTag = document.activeElement.tagName.toLowerCase();
1041
+ var tagFilters='input|textarea';
1042
+ var p = new RegExp(activeElementTag,["i"]);
1043
+ var result = p.exec(tagFilters);
1044
+ if (result == null && isOnScreen(el)) {
1045
+ if (e.keyCode == 39) {
1046
+ clickNextBind(e);
1047
+ return false;
1048
+ }
1049
+ else if (e.keyCode == 37) {
1050
+ clickPrevBind(e);
1051
+ return false;
1052
+ }
1053
+ }
1054
+ };
1055
+
1056
+ /**
1057
+ * Initializes touch events
1058
+ */
1059
+ var initTouch = function(){
1060
+ // initialize object to contain all touch values
1061
+ slider.touch = {
1062
+ start: {x: 0, y: 0},
1063
+ end: {x: 0, y: 0}
1064
+ };
1065
+ slider.viewport.bind('touchstart MSPointerDown pointerdown', onTouchStart);
1066
+
1067
+ //for browsers that have implemented pointer events and fire a click after
1068
+ //every pointerup regardless of whether pointerup is on same screen location as pointerdown or not
1069
+ slider.viewport.on('click', '.bxslider a', function(e) {
1070
+ if (slider.viewport.hasClass('click-disabled')) {
1071
+ e.preventDefault();
1072
+ slider.viewport.removeClass('click-disabled');
1073
+ }
1074
+ });
1075
+ };
1076
+
1077
+ /**
1078
+ * Event handler for "touchstart"
1079
+ *
1080
+ * @param e (event)
1081
+ * - DOM event object
1082
+ */
1083
+ var onTouchStart = function(e){
1084
+ //disable slider controls while user is interacting with slides to avoid slider freeze that happens on touch devices when a slide swipe happens immediately after interacting with slider controls
1085
+ slider.controls.el.addClass('disabled');
1086
+
1087
+ if(slider.working){
1088
+ e.preventDefault();
1089
+ slider.controls.el.removeClass('disabled');
1090
+ }else{
1091
+ // record the original position when touch starts
1092
+ slider.touch.originalPos = el.position();
1093
+ var orig = e.originalEvent;
1094
+ var touchPoints = (typeof orig.changedTouches != 'undefined') ? orig.changedTouches : [orig];
1095
+ // record the starting touch x, y coordinates
1096
+ slider.touch.start.x = touchPoints[0].pageX;
1097
+ slider.touch.start.y = touchPoints[0].pageY;
1098
+
1099
+ if (slider.viewport.get(0).setPointerCapture) {
1100
+ slider.pointerId = orig.pointerId;
1101
+ slider.viewport.get(0).setPointerCapture(slider.pointerId);
1102
+ }
1103
+ // bind a "touchmove" event to the viewport
1104
+ slider.viewport.bind('touchmove MSPointerMove pointermove', onTouchMove);
1105
+ // bind a "touchend" event to the viewport
1106
+ slider.viewport.bind('touchend MSPointerUp pointerup', onTouchEnd);
1107
+ slider.viewport.bind('MSPointerCancel pointercancel', onPointerCancel);
1108
+ }
1109
+ };
1110
+
1111
+ /**
1112
+ * Cancel Pointer for Windows Phone
1113
+ *
1114
+ * @param e (event)
1115
+ * - DOM event object
1116
+ */
1117
+ var onPointerCancel = function(e) {
1118
+ /* onPointerCancel handler is needed to deal with situations when a touchend
1119
+ doesn't fire after a touchstart (this happens on windows phones only) */
1120
+ setPositionProperty(slider.touch.originalPos.left, 'reset', 0);
1121
+
1122
+ //remove handlers
1123
+ slider.controls.el.removeClass('disabled');
1124
+ slider.viewport.unbind('MSPointerCancel pointercancel', onPointerCancel);
1125
+ slider.viewport.unbind('touchmove MSPointerMove pointermove', onTouchMove);
1126
+ slider.viewport.unbind('touchend MSPointerUp pointerup', onTouchEnd);
1127
+ if (slider.viewport.get(0).releasePointerCapture) {
1128
+ slider.viewport.get(0).releasePointerCapture(slider.pointerId);
1129
+ }
1130
+ }
1131
+
1132
+ /**
1133
+ * Event handler for "touchmove"
1134
+ *
1135
+ * @param e (event)
1136
+ * - DOM event object
1137
+ */
1138
+ var onTouchMove = function(e){
1139
+ var orig = e.originalEvent;
1140
+ var touchPoints = (typeof orig.changedTouches != 'undefined') ? orig.changedTouches : [orig];
1141
+ // if scrolling on y axis, do not prevent default
1142
+ var xMovement = Math.abs(touchPoints[0].pageX - slider.touch.start.x);
1143
+ var yMovement = Math.abs(touchPoints[0].pageY - slider.touch.start.y);
1144
+ // x axis swipe
1145
+ if((xMovement * 3) > yMovement && slider.settings.preventDefaultSwipeX){
1146
+ e.preventDefault();
1147
+ // y axis swipe
1148
+ }else if((yMovement * 3) > xMovement && slider.settings.preventDefaultSwipeY){
1149
+ e.preventDefault();
1150
+ }
1151
+ if(slider.settings.mode !== 'fade' && slider.settings.oneToOneTouch){
1152
+ var value = 0, change = 0;
1153
+ // if horizontal, drag along x axis
1154
+ if(slider.settings.mode === 'horizontal'){
1155
+ change = touchPoints[0].pageX - slider.touch.start.x;
1156
+ value = slider.touch.originalPos.left + change;
1157
+ // if vertical, drag along y axis
1158
+ }else{
1159
+ change = touchPoints[0].pageY - slider.touch.start.y;
1160
+ value = slider.touch.originalPos.top + change;
1161
+ }
1162
+ setPositionProperty(value, 'reset', 0);
1163
+ }
1164
+ };
1165
+
1166
+ /**
1167
+ * Event handler for "touchend"
1168
+ *
1169
+ * @param e (event)
1170
+ * - DOM event object
1171
+ */
1172
+ var onTouchEnd = function(e){
1173
+ slider.viewport.unbind('touchmove MSPointerMove pointermove', onTouchMove);
1174
+ //enable slider controls as soon as user stops interacing with slides
1175
+ slider.controls.el.removeClass('disabled');
1176
+ var orig = e.originalEvent;
1177
+ var touchPoints = (typeof orig.changedTouches != 'undefined') ? orig.changedTouches : [orig];
1178
+ var value = 0;
1179
+ var distance = 0;
1180
+ // record end x, y positions
1181
+ slider.touch.end.x = touchPoints[0].pageX;
1182
+ slider.touch.end.y = touchPoints[0].pageY;
1183
+ // if fade mode, check if absolute x distance clears the threshold
1184
+ if(slider.settings.mode === 'fade'){
1185
+ distance = Math.abs(slider.touch.start.x - slider.touch.end.x);
1186
+ if(distance >= slider.settings.swipeThreshold){
1187
+ if(slider.touch.start.x > slider.touch.end.x){
1188
+ el.goToNextSlide();
1189
+ } else {
1190
+ el.goToPrevSlide();
1191
+ }
1192
+ el.stopAuto();
1193
+ }
1194
+ // not fade mode
1195
+ }else{
1196
+ // calculate distance and el's animate property
1197
+ if(slider.settings.mode === 'horizontal'){
1198
+ distance = slider.touch.end.x - slider.touch.start.x;
1199
+ value = slider.touch.originalPos.left;
1200
+ }else{
1201
+ distance = slider.touch.end.y - slider.touch.start.y;
1202
+ value = slider.touch.originalPos.top;
1203
+ }
1204
+ // if not infinite loop and first / last slide, do not attempt a slide transition
1205
+ if(!slider.settings.infiniteLoop && ((slider.active.index === 0 && distance > 0) || (slider.active.last && distance < 0))){
1206
+ setPositionProperty(value, 'reset', 200);
1207
+ }else{
1208
+ // check if distance clears threshold
1209
+ if(Math.abs(distance) >= slider.settings.swipeThreshold){
1210
+ if(distance < 0){
1211
+ el.goToNextSlide();
1212
+ } else {
1213
+ el.goToPrevSlide();
1214
+ }
1215
+ el.stopAuto();
1216
+ }else{
1217
+ // el.animate(property, 200);
1218
+ setPositionProperty(value, 'reset', 200);
1219
+ }
1220
+ }
1221
+ }
1222
+ slider.viewport.unbind('touchend MSPointerUp pointerup', onTouchEnd);
1223
+ if (slider.viewport.get(0).releasePointerCapture) {
1224
+ slider.viewport.get(0).releasePointerCapture(slider.pointerId);
1225
+ }
1226
+ };
1227
+
1228
+ /**
1229
+ * Window resize event callback
1230
+ */
1231
+ var resizeWindow = function(e){
1232
+ // don't do anything if slider isn't initialized.
1233
+ if(!slider.initialized){ return; }
1234
+ // Delay if slider working.
1235
+ if (slider.working) {
1236
+ window.setTimeout(resizeWindow, 10);
1237
+ } else {
1238
+ // get the new window dimens (again, thank you IE)
1239
+ var windowWidthNew = $(window).width();
1240
+ var windowHeightNew = $(window).height();
1241
+ // make sure that it is a true window resize
1242
+ // *we must check this because our dinosaur friend IE fires a window resize event when certain DOM elements
1243
+ // are resized. Can you just die already?*
1244
+ if(windowWidth !== windowWidthNew || windowHeight !== windowHeightNew){
1245
+ // set the new window dimens
1246
+ windowWidth = windowWidthNew;
1247
+ windowHeight = windowHeightNew;
1248
+ // update all dynamic elements
1249
+ el.redrawSlider();
1250
+ // Call user resize handler
1251
+ slider.settings.onSliderResize.call(el, slider.active.index);
1252
+ }
1253
+ }
1254
+ };
1255
+
1256
+ /**
1257
+ * ===================================================================================
1258
+ * = PUBLIC FUNCTIONS
1259
+ * ===================================================================================
1260
+ */
1261
+
1262
+ /**
1263
+ * Performs slide transition to the specified slide
1264
+ *
1265
+ * @param slideIndex (int)
1266
+ * - the destination slide's index (zero-based)
1267
+ *
1268
+ * @param direction (string)
1269
+ * - INTERNAL USE ONLY - the direction of travel ("prev" / "next")
1270
+ */
1271
+ el.goToSlide = function(slideIndex, direction){
1272
+ // if plugin is currently in motion, ignore request
1273
+ if(slider.working || slider.active.index === slideIndex){ return; }
1274
+ // declare that plugin is in motion
1275
+ slider.working = true;
1276
+ // store the old index
1277
+ slider.oldIndex = slider.active.index;
1278
+ // if slideIndex is less than zero, set active index to last child (this happens during infinite loop)
1279
+ if(slideIndex < 0){
1280
+ slider.active.index = getPagerQty() - 1;
1281
+ // if slideIndex is greater than children length, set active index to 0 (this happens during infinite loop)
1282
+ }else if(slideIndex >= getPagerQty()){
1283
+ slider.active.index = 0;
1284
+ // set active index to requested slide
1285
+ }else{
1286
+ slider.active.index = slideIndex;
1287
+ }
1288
+ // onSlideBefore, onSlideNext, onSlidePrev callbacks
1289
+ // Allow transition canceling based on returned value
1290
+ var performTransition = true;
1291
+
1292
+ performTransition = slider.settings.onSlideBefore(slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index);
1293
+
1294
+ if ( typeof(performTransition) !== "undefined" && !performTransition ) {
1295
+ slider.active.index = slider.oldIndex; // restore old index
1296
+ slider.working = false; // is not in motion
1297
+ return;
1298
+ }
1299
+ if(direction === 'next'){
1300
+ // Prevent canceling in future functions or lack there-of from negating previous commands to cancel
1301
+ if(!slider.settings.onSlideNext(slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index)){
1302
+ performTransition = false;
1303
+ }
1304
+ }else if(direction === 'prev'){
1305
+ // Prevent canceling in future functions or lack there-of from negating previous commands to cancel
1306
+ if(!slider.settings.onSlidePrev(slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index)){
1307
+ performTransition = false;
1308
+ }
1309
+ }
1310
+
1311
+ // If transitions canceled, reset and return
1312
+ if ( typeof(performTransition) !== "undefined" && !performTransition ) {
1313
+ slider.active.index = slider.oldIndex; // restore old index
1314
+ slider.working = false; // is not in motion
1315
+ return;
1316
+ }
1317
+
1318
+ // check if last slide
1319
+ slider.active.last = slider.active.index >= getPagerQty() - 1;
1320
+ // update the pager with active class
1321
+ if(slider.settings.pager || slider.settings.pagerCustom){ updatePagerActive(slider.active.index); }
1322
+ // // check for direction control update
1323
+ if(slider.settings.controls){ updateDirectionControls(); }
1324
+ // if slider is set to mode: "fade"
1325
+ if(slider.settings.mode === 'fade'){
1326
+ // if adaptiveHeight is true and next height is different from current height, animate to the new height
1327
+ if(slider.settings.adaptiveHeight && slider.viewport.height() !== getViewportHeight()){
1328
+ slider.viewport.animate({height: getViewportHeight()}, slider.settings.adaptiveHeightSpeed);
1329
+ }
1330
+ // fade out the visible child and reset its z-index value
1331
+ slider.children.filter(':visible').fadeOut(slider.settings.speed).css({zIndex: 0});
1332
+ // fade in the newly requested slide
1333
+ slider.children.eq(slider.active.index).css('zIndex', slider.settings.slideZIndex+1).fadeIn(slider.settings.speed, function(){
1334
+ $(this).css('zIndex', slider.settings.slideZIndex);
1335
+ updateAfterSlideTransition();
1336
+ });
1337
+ // slider mode is not "fade"
1338
+ }else{
1339
+ // if adaptiveHeight is true and next height is different from current height, animate to the new height
1340
+ if(slider.settings.adaptiveHeight && slider.viewport.height() !== getViewportHeight()){
1341
+ slider.viewport.animate({height: getViewportHeight()}, slider.settings.adaptiveHeightSpeed);
1342
+ }
1343
+ var moveBy = 0;
1344
+ var position = {left: 0, top: 0};
1345
+ var lastChild = null;
1346
+ // if carousel and not infinite loop
1347
+ if(!slider.settings.infiniteLoop && slider.carousel && slider.active.last){
1348
+ if(slider.settings.mode === 'horizontal'){
1349
+ // get the last child position
1350
+ lastChild = slider.children.eq(slider.children.length - 1);
1351
+ position = lastChild.position();
1352
+ // calculate the position of the last slide
1353
+ moveBy = slider.viewport.width() - lastChild.outerWidth();
1354
+ }else{
1355
+ // get last showing index position
1356
+ var lastShowingIndex = slider.children.length - slider.settings.minSlides;
1357
+ position = slider.children.eq(lastShowingIndex).position();
1358
+ }
1359
+ // horizontal carousel, going previous while on first slide (infiniteLoop mode)
1360
+ }else if(slider.carousel && slider.active.last && direction === 'prev'){
1361
+ // get the last child position
1362
+ var eq = slider.settings.moveSlides === 1 ? slider.settings.maxSlides - getMoveBy() : ((getPagerQty() - 1) * getMoveBy()) - (slider.children.length - slider.settings.maxSlides);
1363
+ lastChild = el.children('.bx-clone').eq(eq);
1364
+ position = lastChild.position();
1365
+ // if infinite loop and "Next" is clicked on the last slide
1366
+ }else if(direction === 'next' && slider.active.index === 0){
1367
+ // get the last clone position
1368
+ position = el.find('> .bx-clone').eq(slider.settings.maxSlides).position();
1369
+ slider.active.last = false;
1370
+ // normal non-zero requests
1371
+ }else if(slideIndex >= 0){
1372
+ var requestEl = slideIndex * getMoveBy();
1373
+ position = slider.children.eq(requestEl).position();
1374
+ }
1375
+
1376
+
1377
+ /* If the position doesn't exist
1378
+ * (e.g. if you destroy the slider on a next click),
1379
+ * it doesn't throw an error.
1380
+ */
1381
+ if("undefined" !== typeof(position)){
1382
+ var value = slider.settings.mode === 'horizontal' ? -(position.left - moveBy) : -position.top;
1383
+ // plugin values to be animated
1384
+ setPositionProperty(value, 'slide', slider.settings.speed);
1385
+ }
1386
+ }
1387
+ };
1388
+
1389
+ /**
1390
+ * Transitions to the next slide in the show
1391
+ */
1392
+ el.goToNextSlide = function(){
1393
+ // if infiniteLoop is false and last page is showing, disregard call
1394
+ if(!slider.settings.infiniteLoop && slider.active.last){ return; }
1395
+ var pagerIndex = parseInt(slider.active.index) + 1;
1396
+ el.goToSlide(pagerIndex, 'next');
1397
+ };
1398
+
1399
+ /**
1400
+ * Transitions to the prev slide in the show
1401
+ */
1402
+ el.goToPrevSlide = function(){
1403
+ // if infiniteLoop is false and last page is showing, disregard call
1404
+ if(!slider.settings.infiniteLoop && slider.active.index === 0){ return; }
1405
+ var pagerIndex = parseInt(slider.active.index) - 1;
1406
+ el.goToSlide(pagerIndex, 'prev');
1407
+ };
1408
+
1409
+ /**
1410
+ * Starts the auto show
1411
+ *
1412
+ * @param preventControlUpdate (boolean)
1413
+ * - if true, auto controls state will not be updated
1414
+ */
1415
+ el.startAuto = function(preventControlUpdate){
1416
+ // if an interval already exists, disregard call
1417
+ if(slider.interval){ return; }
1418
+ // create an interval
1419
+ slider.interval = setInterval(function(){
1420
+ if(slider.settings.autoDirection === 'next'){
1421
+ el.goToNextSlide();
1422
+ }else{
1423
+ el.goToPrevSlide();
1424
+ }
1425
+ }, slider.settings.pause);
1426
+ // if auto controls are displayed and preventControlUpdate is not true
1427
+ if(slider.settings.autoControls && preventControlUpdate !== true){ updateAutoControls('stop'); }
1428
+ };
1429
+
1430
+ /**
1431
+ * Stops the auto show
1432
+ *
1433
+ * @param preventControlUpdate (boolean)
1434
+ * - if true, auto controls state will not be updated
1435
+ */
1436
+ el.stopAuto = function(preventControlUpdate){
1437
+ // if no interval exists, disregard call
1438
+ if(!slider.interval){ return; }
1439
+ // clear the interval
1440
+ clearInterval(slider.interval);
1441
+ slider.interval = null;
1442
+ // if auto controls are displayed and preventControlUpdate is not true
1443
+ if(slider.settings.autoControls && preventControlUpdate !== true){ updateAutoControls('start'); }
1444
+ };
1445
+
1446
+ /**
1447
+ * Returns current slide index (zero-based)
1448
+ */
1449
+ el.getCurrentSlide = function(){
1450
+ return slider.active.index;
1451
+ };
1452
+
1453
+ /**
1454
+ * Returns current slide element
1455
+ */
1456
+ el.getCurrentSlideElement = function(){
1457
+ return slider.children.eq(slider.active.index);
1458
+ };
1459
+
1460
+ /**
1461
+ * Returns number of slides in show
1462
+ */
1463
+ el.getSlideCount = function(){
1464
+ return slider.children.length;
1465
+ };
1466
+
1467
+ /**
1468
+ * Return slider.working variable
1469
+ */
1470
+ el.isWorking = function() {
1471
+ return slider.working;
1472
+ }
1473
+
1474
+ /**
1475
+ * Update all dynamic slider elements
1476
+ */
1477
+ el.redrawSlider = function(){
1478
+ // resize all children in ratio to new screen size
1479
+ slider.children.add(el.find('.bx-clone')).outerWidth(getSlideWidth());
1480
+ // adjust the height
1481
+ slider.viewport.css('height', getViewportHeight());
1482
+ // update the slide position
1483
+ if(!slider.settings.ticker) { setSlidePosition(); }
1484
+ // if active.last was true before the screen resize, we want
1485
+ // to keep it last no matter what screen size we end on
1486
+ if (slider.active.last) { slider.active.index = getPagerQty() - 1; }
1487
+ // if the active index (page) no longer exists due to the resize, simply set the index as last
1488
+ if (slider.active.index >= getPagerQty()) { slider.active.last = true; }
1489
+ // if a pager is being displayed and a custom pager is not being used, update it
1490
+ if(slider.settings.pager && !slider.settings.pagerCustom){
1491
+ populatePager();
1492
+ updatePagerActive(slider.active.index);
1493
+ }
1494
+ };
1495
+
1496
+ /**
1497
+ * Destroy the current instance of the slider (revert everything back to original state)
1498
+ */
1499
+ el.destroySlider = function(){
1500
+ // don't do anything if slider has already been destroyed
1501
+ if(!slider.initialized){ return; }
1502
+ slider.initialized = false;
1503
+ $('.bx-clone', this).remove();
1504
+ slider.children.each(function(){
1505
+ if($(this).data("origStyle") !== undefined){
1506
+ $(this).attr("style", $(this).data("origStyle"));
1507
+ } else {
1508
+ $(this).removeAttr('style');
1509
+ }
1510
+ });
1511
+ if($(this).data("origStyle") !== undefined){
1512
+ this.attr("style", $(this).data("origStyle"));
1513
+ } else {
1514
+ $(this).removeAttr('style');
1515
+ }
1516
+ $(this).unwrap().unwrap();
1517
+ if(slider.controls.el){ slider.controls.el.remove(); }
1518
+ if(slider.controls.next){ slider.controls.next.remove(); }
1519
+ if(slider.controls.prev){ slider.controls.prev.remove(); }
1520
+ if(slider.pagerEl && slider.settings.controls && !slider.settings.pagerCustom){ slider.pagerEl.remove(); }
1521
+ $('.bx-caption', this).remove();
1522
+ if(slider.controls.autoEl){ slider.controls.autoEl.remove(); }
1523
+ clearInterval(slider.interval);
1524
+ if(slider.settings.responsive){ $(window).unbind('resize', resizeWindow); }
1525
+ if(slider.settings.keyboardEnabled){ $(document).unbind('keydown', keyPress); }
1526
+ };
1527
+
1528
+ /**
1529
+ * Reload the slider (revert all DOM changes, and re-initialize)
1530
+ */
1531
+ el.reloadSlider = function(settings){
1532
+ if(settings !== undefined){ options = settings; }
1533
+ el.destroySlider();
1534
+ init();
1535
+ };
1536
+
1537
+ init();
1538
+
1539
+ // returns the current jQuery object
1540
+ return this;
1541
+ };
1542
+
1543
+ })(jQuery);
includes/libraries/bxslider-4/dist/jquery.bxslider.min.js ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ /***
2
+ * BxSlider v4.2.3 - Fully loaded, responsive content slider
3
+ * http://bxslider.com
4
+ *
5
+ * Copyright 2014, Steven Wanderski - http://stevenwanderski.com - http://bxcreative.com
6
+ * Written while drinking Belgian ales and listening to jazz
7
+ *
8
+ * Released under the MIT license - http://opensource.org/licenses/MIT
9
+ ***/
10
+ !function(e){var t={mode:"horizontal",slideSelector:"",infiniteLoop:!0,hideControlOnEnd:!1,speed:500,easing:null,slideMargin:0,startSlide:0,randomStart:!1,captions:!1,ticker:!1,tickerHover:!1,adaptiveHeight:!1,adaptiveHeightSpeed:500,video:!1,useCSS:!0,preloadImages:"visible",responsive:!0,slideZIndex:50,wrapperClass:"bx-wrapper",touchEnabled:!0,swipeThreshold:50,oneToOneTouch:!0,preventDefaultSwipeX:!0,preventDefaultSwipeY:!1,keyboardEnabled:!1,pager:!0,pagerType:"full",pagerShortSeparator:" / ",pagerSelector:null,buildPager:null,pagerCustom:null,controls:!0,nextText:"Next",prevText:"Prev",nextSelector:null,prevSelector:null,autoControls:!1,startText:"Start",stopText:"Stop",autoControlsCombine:!1,autoControlsSelector:null,auto:!1,pause:4e3,autoStart:!0,autoDirection:"next",autoHover:!1,autoDelay:0,autoSlideForOnePage:!1,minSlides:1,maxSlides:1,moveSlides:0,slideWidth:0,onSliderLoad:function(){return!0},onSlideBefore:function(){return!0},onSlideAfter:function(){return!0},onSlideNext:function(){return!0},onSlidePrev:function(){return!0},onSliderResize:function(){return!0}};e.fn.bxSlider=function(n){if(0===this.length)return this;if(this.length>1)return this.each(function(){e(this).bxSlider(n)}),this;var s={},o=this,r=e(window).width(),a=e(window).height(),l=function(){s.settings=e.extend({},t,n),s.settings.slideWidth=parseInt(s.settings.slideWidth),s.children=o.children(s.settings.slideSelector),s.children.length<s.settings.minSlides&&(s.settings.minSlides=s.children.length),s.children.length<s.settings.maxSlides&&(s.settings.maxSlides=s.children.length),s.settings.randomStart&&(s.settings.startSlide=Math.floor(Math.random()*s.children.length)),s.active={index:s.settings.startSlide},s.carousel=s.settings.minSlides>1||s.settings.maxSlides>1?!0:!1,s.carousel&&(s.settings.preloadImages="all"),s.minThreshold=s.settings.minSlides*s.settings.slideWidth+(s.settings.minSlides-1)*s.settings.slideMargin,s.maxThreshold=s.settings.maxSlides*s.settings.slideWidth+(s.settings.maxSlides-1)*s.settings.slideMargin,s.working=!1,s.controls={},s.interval=null,s.animProp="vertical"===s.settings.mode?"top":"left",s.usingCSS=s.settings.useCSS&&"fade"!==s.settings.mode&&function(){var e=document.createElement("div"),t=["WebkitPerspective","MozPerspective","OPerspective","msPerspective"];for(var i in t)if(void 0!==e.style[t[i]])return s.cssPrefix=t[i].replace("Perspective","").toLowerCase(),s.animProp="-"+s.cssPrefix+"-transform",!0;return!1}(),"vertical"===s.settings.mode&&(s.settings.maxSlides=s.settings.minSlides),o.data("origStyle",o.attr("style")),o.children(s.settings.slideSelector).each(function(){e(this).data("origStyle",e(this).attr("style"))}),d()},d=function(){o.wrap('<div class="'+s.settings.wrapperClass+'"><div class="bx-viewport"></div></div>'),s.viewport=o.parent(),s.loader=e('<div class="bx-loading" />'),s.viewport.prepend(s.loader),o.css({width:"horizontal"===s.settings.mode?1e3*s.children.length+215+"%":"auto",position:"absolute"}),s.usingCSS&&s.settings.easing?o.css("-"+s.cssPrefix+"-transition-timing-function",s.settings.easing):s.settings.easing||(s.settings.easing="swing");v();s.viewport.css({width:"100%",overflow:"hidden",position:"relative"}),s.viewport.parent().css({maxWidth:u()}),s.settings.pager||s.settings.controls||s.viewport.parent().css({margin:"0 auto 0px"}),s.children.css({"float":"horizontal"===s.settings.mode?"left":"none",listStyle:"none",position:"relative"}),s.children.css("width",h()),"horizontal"===s.settings.mode&&s.settings.slideMargin>0&&s.children.css("marginRight",s.settings.slideMargin),"vertical"===s.settings.mode&&s.settings.slideMargin>0&&s.children.css("marginBottom",s.settings.slideMargin),"fade"===s.settings.mode&&(s.children.css({position:"absolute",zIndex:0,display:"none"}),s.children.eq(s.settings.startSlide).css({zIndex:s.settings.slideZIndex,display:"block"})),s.controls.el=e('<div class="bx-controls" />'),s.settings.captions&&P(),s.active.last=s.settings.startSlide===f()-1,s.settings.video&&o.fitVids();var t=s.children.eq(s.settings.startSlide);("all"===s.settings.preloadImages||s.settings.ticker)&&(t=s.children),s.settings.ticker?s.settings.pager=!1:(s.settings.controls&&C(),s.settings.auto&&s.settings.autoControls&&T(),s.settings.pager&&w(),(s.settings.controls||s.settings.autoControls||s.settings.pager)&&s.viewport.after(s.controls.el)),c(t,g)},c=function(t,i){var n=t.find('img:not([src=""]), iframe').length;if(0===n)return void i();var s=0;t.find('img:not([src=""]), iframe').each(function(){e(this).one("load error",function(){++s===n&&i()}).each(function(){this.complete&&e(this).load()})})},g=function(){if(s.settings.infiniteLoop&&"fade"!==s.settings.mode&&!s.settings.ticker){var t="vertical"===s.settings.mode?s.settings.minSlides:s.settings.maxSlides,i=s.children.slice(0,t).clone(!0).addClass("bx-clone"),n=s.children.slice(-t).clone(!0).addClass("bx-clone");o.append(i).prepend(n)}s.loader.remove(),m(),"vertical"===s.settings.mode&&(s.settings.adaptiveHeight=!0),s.viewport.height(p()),o.redrawSlider(),s.settings.onSliderLoad(s,s.active.index),s.initialized=!0,s.settings.responsive&&e(window).bind("resize",Z),s.settings.auto&&s.settings.autoStart&&(f()>1||s.settings.autoSlideForOnePage)&&A(),s.settings.ticker&&H(),s.settings.pager&&I(s.settings.startSlide),s.settings.controls&&W(),s.settings.touchEnabled&&!s.settings.ticker&&O(),s.settings.keyboardEnabled&&!s.settings.ticker&&e(document).keydown(N)},p=function(){var t=0,n=e();if("vertical"===s.settings.mode||s.settings.adaptiveHeight)if(s.carousel){var o=1===s.settings.moveSlides?s.active.index:s.active.index*x();for(n=s.children.eq(o),i=1;i<=s.settings.maxSlides-1;i++)n=n.add(o+i>=s.children.length?s.children.eq(i-1):s.children.eq(o+i))}else n=s.children.eq(s.active.index);else n=s.children;return"vertical"===s.settings.mode?(n.each(function(){t+=e(this).outerHeight()}),s.settings.slideMargin>0&&(t+=s.settings.slideMargin*(s.settings.minSlides-1))):t=Math.max.apply(Math,n.map(function(){return e(this).outerHeight(!1)}).get()),"border-box"===s.viewport.css("box-sizing")?t+=parseFloat(s.viewport.css("padding-top"))+parseFloat(s.viewport.css("padding-bottom"))+parseFloat(s.viewport.css("border-top-width"))+parseFloat(s.viewport.css("border-bottom-width")):"padding-box"===s.viewport.css("box-sizing")&&(t+=parseFloat(s.viewport.css("padding-top"))+parseFloat(s.viewport.css("padding-bottom"))),t},u=function(){var e="100%";return s.settings.slideWidth>0&&(e="horizontal"===s.settings.mode?s.settings.maxSlides*s.settings.slideWidth+(s.settings.maxSlides-1)*s.settings.slideMargin:s.settings.slideWidth),e},h=function(){var e=s.settings.slideWidth,t=s.viewport.width();return 0===s.settings.slideWidth||s.settings.slideWidth>t&&!s.carousel||"vertical"===s.settings.mode?e=t:s.settings.maxSlides>1&&"horizontal"===s.settings.mode&&(t>s.maxThreshold||t<s.minThreshold&&(e=(t-s.settings.slideMargin*(s.settings.minSlides-1))/s.settings.minSlides)),e},v=function(){var e=1;if("horizontal"===s.settings.mode&&s.settings.slideWidth>0)if(s.viewport.width()<s.minThreshold)e=s.settings.minSlides;else if(s.viewport.width()>s.maxThreshold)e=s.settings.maxSlides;else{var t=s.children.first().width()+s.settings.slideMargin;e=Math.floor((s.viewport.width()+s.settings.slideMargin)/t)}else"vertical"===s.settings.mode&&(e=s.settings.minSlides);return e},f=function(){var e=0;if(s.settings.moveSlides>0)if(s.settings.infiniteLoop)e=Math.ceil(s.children.length/x());else for(var t=0,i=0;t<s.children.length;)++e,t=i+v(),i+=s.settings.moveSlides<=v()?s.settings.moveSlides:v();else e=Math.ceil(s.children.length/v());return e},x=function(){return s.settings.moveSlides>0&&s.settings.moveSlides<=v()?s.settings.moveSlides:v()},m=function(){var e;if(s.children.length>s.settings.maxSlides&&s.active.last&&!s.settings.infiniteLoop){if("horizontal"===s.settings.mode){var t=s.children.last();e=t.position(),S(-(e.left-(s.viewport.width()-t.outerWidth())),"reset",0)}else if("vertical"===s.settings.mode){var i=s.children.length-s.settings.minSlides;e=s.children.eq(i).position(),S(-e.top,"reset",0)}}else e=s.children.eq(s.active.index*x()).position(),s.active.index===f()-1&&(s.active.last=!0),void 0!==e&&("horizontal"===s.settings.mode?S(-e.left,"reset",0):"vertical"===s.settings.mode&&S(-e.top,"reset",0))},S=function(e,t,i,n){if(s.usingCSS){var r="vertical"===s.settings.mode?"translate3d(0, "+e+"px, 0)":"translate3d("+e+"px, 0, 0)";o.css("-"+s.cssPrefix+"-transition-duration",i/1e3+"s"),"slide"===t?setTimeout(function(){o.css(s.animProp,r),0===e?q():o.bind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",function(){o.unbind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd"),q()})},0):"reset"===t?o.css(s.animProp,r):"ticker"===t&&(o.css("-"+s.cssPrefix+"-transition-timing-function","linear"),o.css(s.animProp,r),o.bind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",function(){o.unbind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd"),S(n.resetValue,"reset",0),L()}))}else{var a={};a[s.animProp]=e,"slide"===t?o.animate(a,i,s.settings.easing,function(){q()}):"reset"===t?o.css(s.animProp,e):"ticker"===t&&o.animate(a,speed,"linear",function(){S(n.resetValue,"reset",0),L()})}},b=function(){for(var t="",i=f(),n=0;i>n;n++){var o="";s.settings.buildPager&&e.isFunction(s.settings.buildPager)||s.settings.pagerCustom?(o=s.settings.buildPager(n),s.pagerEl.addClass("bx-custom-pager")):(o=n+1,s.pagerEl.addClass("bx-default-pager")),t+='<div class="bx-pager-item"><a href="" data-slide-index="'+n+'" class="bx-pager-link">'+o+"</a></div>"}s.pagerEl.html(t)},w=function(){s.settings.pagerCustom?s.pagerEl=e(s.settings.pagerCustom):(s.pagerEl=e('<div class="bx-pager" />'),s.settings.pagerSelector?e(s.settings.pagerSelector).html(s.pagerEl):s.controls.el.addClass("bx-has-pager").append(s.pagerEl),b()),s.pagerEl.on("click touchend","a",z)},C=function(){s.controls.next=e('<a class="bx-next" href="">'+s.settings.nextText+"</a>"),s.controls.prev=e('<a class="bx-prev" href="">'+s.settings.prevText+"</a>"),s.controls.next.bind("click touchend",E),s.controls.prev.bind("click touchend",y),s.settings.nextSelector&&e(s.settings.nextSelector).append(s.controls.next),s.settings.prevSelector&&e(s.settings.prevSelector).append(s.controls.prev),s.settings.nextSelector||s.settings.prevSelector||(s.controls.directionEl=e('<div class="bx-controls-direction" />'),s.controls.directionEl.append(s.controls.prev).append(s.controls.next),s.controls.el.addClass("bx-has-controls-direction").append(s.controls.directionEl))},T=function(){s.controls.start=e('<div class="bx-controls-auto-item"><a class="bx-start" href="">'+s.settings.startText+"</a></div>"),s.controls.stop=e('<div class="bx-controls-auto-item"><a class="bx-stop" href="">'+s.settings.stopText+"</a></div>"),s.controls.autoEl=e('<div class="bx-controls-auto" />'),s.controls.autoEl.on("click",".bx-start",k),s.controls.autoEl.on("click",".bx-stop",M),s.settings.autoControlsCombine?s.controls.autoEl.append(s.controls.start):s.controls.autoEl.append(s.controls.start).append(s.controls.stop),s.settings.autoControlsSelector?e(s.settings.autoControlsSelector).html(s.controls.autoEl):s.controls.el.addClass("bx-has-controls-auto").append(s.controls.autoEl),D(s.settings.autoStart?"stop":"start")},P=function(){s.children.each(function(){var t=e(this).find("img:first").attr("title");void 0!==t&&(""+t).length&&e(this).append('<div class="bx-caption"><span>'+t+"</span></div>")})},E=function(e){e.preventDefault(),s.controls.el.hasClass("disabled")||(s.settings.auto&&o.stopAuto(),o.goToNextSlide())},y=function(e){e.preventDefault(),s.controls.el.hasClass("disabled")||(s.settings.auto&&o.stopAuto(),o.goToPrevSlide())},k=function(e){o.startAuto(),e.preventDefault()},M=function(e){o.stopAuto(),e.preventDefault()},z=function(t){if(t.preventDefault(),!s.controls.el.hasClass("disabled")){s.settings.auto&&o.stopAuto();var i=e(t.currentTarget);if(void 0!==i.attr("data-slide-index")){var n=parseInt(i.attr("data-slide-index"));n!==s.active.index&&o.goToSlide(n)}}},I=function(t){var i=s.children.length;return"short"===s.settings.pagerType?(s.settings.maxSlides>1&&(i=Math.ceil(s.children.length/s.settings.maxSlides)),void s.pagerEl.html(t+1+s.settings.pagerShortSeparator+i)):(s.pagerEl.find("a").removeClass("active"),void s.pagerEl.each(function(i,n){e(n).find("a").eq(t).addClass("active")}))},q=function(){if(s.settings.infiniteLoop){var e="";0===s.active.index?e=s.children.eq(0).position():s.active.index===f()-1&&s.carousel?e=s.children.eq((f()-1)*x()).position():s.active.index===s.children.length-1&&(e=s.children.eq(s.children.length-1).position()),e&&("horizontal"===s.settings.mode?S(-e.left,"reset",0):"vertical"===s.settings.mode&&S(-e.top,"reset",0))}s.working=!1,s.settings.onSlideAfter(s.children.eq(s.active.index),s.oldIndex,s.active.index)},D=function(e){s.settings.autoControlsCombine?s.controls.autoEl.html(s.controls[e]):(s.controls.autoEl.find("a").removeClass("active"),s.controls.autoEl.find("a:not(.bx-"+e+")").addClass("active"))},W=function(){1===f()?(s.controls.prev.addClass("disabled"),s.controls.next.addClass("disabled")):!s.settings.infiniteLoop&&s.settings.hideControlOnEnd&&(0===s.active.index?(s.controls.prev.addClass("disabled"),s.controls.next.removeClass("disabled")):s.active.index===f()-1?(s.controls.next.addClass("disabled"),s.controls.prev.removeClass("disabled")):(s.controls.prev.removeClass("disabled"),s.controls.next.removeClass("disabled")))},A=function(){if(s.settings.autoDelay>0){setTimeout(o.startAuto,s.settings.autoDelay)}else o.startAuto(),e(window).focus(function(){o.startAuto()}).blur(function(){o.stopAuto()});s.settings.autoHover&&o.hover(function(){s.interval&&(o.stopAuto(!0),s.autoPaused=!0)},function(){s.autoPaused&&(o.startAuto(!0),s.autoPaused=null)})},H=function(){var t=0;if("next"===s.settings.autoDirection)o.append(s.children.clone().addClass("bx-clone"));else{o.prepend(s.children.clone().addClass("bx-clone"));var i=s.children.first().position();t="horizontal"===s.settings.mode?-i.left:-i.top}if(S(t,"reset",0),s.settings.pager=!1,s.settings.controls=!1,s.settings.autoControls=!1,s.settings.tickerHover)if(s.usingCSS){var n,r="horizontal"==s.settings.mode?4:5;s.viewport.hover(function(){var e=o.css("-"+s.cssPrefix+"-transform");n=parseFloat(e.split(",")[r]),S(n,"reset",0)},function(){var t=0;s.children.each(function(){t+="horizontal"==s.settings.mode?e(this).outerWidth(!0):e(this).outerHeight(!0)});var i=s.settings.speed/t,o=("horizontal"==s.settings.mode?"left":"top",i*(t-Math.abs(parseInt(n))));L(o)})}else s.viewport.hover(function(){o.stop()},function(){var t=0;s.children.each(function(){t+="horizontal"==s.settings.mode?e(this).outerWidth(!0):e(this).outerHeight(!0)});var i=s.settings.speed/t,n="horizontal"==s.settings.mode?"left":"top",r=i*(t-Math.abs(parseInt(o.css(n))));L(r)});L()},L=function(e){speed=e?e:s.settings.speed;var t={left:0,top:0},i={left:0,top:0};"next"===s.settings.autoDirection?t=o.find(".bx-clone").first().position():i=s.children.first().position();var n="horizontal"===s.settings.mode?-t.left:-t.top,r="horizontal"===s.settings.mode?-i.left:-i.top,a={resetValue:r};S(n,"ticker",speed,a)},F=function(t){var i=e(window),n={top:i.scrollTop(),left:i.scrollLeft()};n.right=n.left+i.width(),n.bottom=n.top+i.height();var s=t.offset();return s.right=s.left+t.outerWidth(),s.bottom=s.top+t.outerHeight(),!(n.right<s.left||n.left>s.right||n.bottom<s.top||n.top>s.bottom)},N=function(e){var t=document.activeElement.tagName.toLowerCase(),i="input|textarea",n=new RegExp(t,["i"]),s=n.exec(i);if(null==s&&F(o)){if(39==e.keyCode)return E(e),!1;if(37==e.keyCode)return y(e),!1}},O=function(){s.touch={start:{x:0,y:0},end:{x:0,y:0}},s.viewport.bind("touchstart MSPointerDown pointerdown",X),s.viewport.on("click",".bxslider a",function(e){s.viewport.hasClass("click-disabled")&&(e.preventDefault(),s.viewport.removeClass("click-disabled"))})},X=function(e){if(s.controls.el.addClass("disabled"),s.working)e.preventDefault(),s.controls.el.removeClass("disabled");else{s.touch.originalPos=o.position();var t=e.originalEvent,i="undefined"!=typeof t.changedTouches?t.changedTouches:[t];s.touch.start.x=i[0].pageX,s.touch.start.y=i[0].pageY,s.viewport.get(0).setPointerCapture&&(s.pointerId=t.pointerId,s.viewport.get(0).setPointerCapture(s.pointerId)),s.viewport.bind("touchmove MSPointerMove pointermove",R),s.viewport.bind("touchend MSPointerUp pointerup",V),s.viewport.bind("MSPointerCancel pointercancel",Y)}},Y=function(){S(s.touch.originalPos.left,"reset",0),s.controls.el.removeClass("disabled"),s.viewport.unbind("MSPointerCancel pointercancel",Y),s.viewport.unbind("touchmove MSPointerMove pointermove",R),s.viewport.unbind("touchend MSPointerUp pointerup",V),s.viewport.get(0).releasePointerCapture&&s.viewport.get(0).releasePointerCapture(s.pointerId)},R=function(e){var t=e.originalEvent,i="undefined"!=typeof t.changedTouches?t.changedTouches:[t],n=Math.abs(i[0].pageX-s.touch.start.x),o=Math.abs(i[0].pageY-s.touch.start.y);if(3*n>o&&s.settings.preventDefaultSwipeX?e.preventDefault():3*o>n&&s.settings.preventDefaultSwipeY&&e.preventDefault(),"fade"!==s.settings.mode&&s.settings.oneToOneTouch){var r=0,a=0;"horizontal"===s.settings.mode?(a=i[0].pageX-s.touch.start.x,r=s.touch.originalPos.left+a):(a=i[0].pageY-s.touch.start.y,r=s.touch.originalPos.top+a),S(r,"reset",0)}},V=function(e){s.viewport.unbind("touchmove MSPointerMove pointermove",R),s.controls.el.removeClass("disabled");var t=e.originalEvent,i="undefined"!=typeof t.changedTouches?t.changedTouches:[t],n=0,r=0;s.touch.end.x=i[0].pageX,s.touch.end.y=i[0].pageY,"fade"===s.settings.mode?(r=Math.abs(s.touch.start.x-s.touch.end.x),r>=s.settings.swipeThreshold&&(s.touch.start.x>s.touch.end.x?o.goToNextSlide():o.goToPrevSlide(),o.stopAuto())):("horizontal"===s.settings.mode?(r=s.touch.end.x-s.touch.start.x,n=s.touch.originalPos.left):(r=s.touch.end.y-s.touch.start.y,n=s.touch.originalPos.top),!s.settings.infiniteLoop&&(0===s.active.index&&r>0||s.active.last&&0>r)?S(n,"reset",200):Math.abs(r)>=s.settings.swipeThreshold?(0>r?o.goToNextSlide():o.goToPrevSlide(),o.stopAuto()):S(n,"reset",200)),s.viewport.unbind("touchend MSPointerUp pointerup",V),s.viewport.get(0).releasePointerCapture&&s.viewport.get(0).releasePointerCapture(s.pointerId)},Z=function(){if(s.initialized)if(s.working)window.setTimeout(Z,10);else{var t=e(window).width(),i=e(window).height();(r!==t||a!==i)&&(r=t,a=i,o.redrawSlider(),s.settings.onSliderResize.call(o,s.active.index))}};return o.goToSlide=function(t,i){if(!s.working&&s.active.index!==t){s.working=!0,s.oldIndex=s.active.index,s.active.index=0>t?f()-1:t>=f()?0:t;var n=!0;if(n=s.settings.onSlideBefore(s.children.eq(s.active.index),s.oldIndex,s.active.index),"undefined"!=typeof n&&!n)return s.active.index=s.oldIndex,void(s.working=!1);if("next"===i?s.settings.onSlideNext(s.children.eq(s.active.index),s.oldIndex,s.active.index)||(n=!1):"prev"===i&&(s.settings.onSlidePrev(s.children.eq(s.active.index),s.oldIndex,s.active.index)||(n=!1)),"undefined"!=typeof n&&!n)return s.active.index=s.oldIndex,void(s.working=!1);if(s.active.last=s.active.index>=f()-1,(s.settings.pager||s.settings.pagerCustom)&&I(s.active.index),s.settings.controls&&W(),"fade"===s.settings.mode)s.settings.adaptiveHeight&&s.viewport.height()!==p()&&s.viewport.animate({height:p()},s.settings.adaptiveHeightSpeed),s.children.filter(":visible").fadeOut(s.settings.speed).css({zIndex:0}),s.children.eq(s.active.index).css("zIndex",s.settings.slideZIndex+1).fadeIn(s.settings.speed,function(){e(this).css("zIndex",s.settings.slideZIndex),q()});else{s.settings.adaptiveHeight&&s.viewport.height()!==p()&&s.viewport.animate({height:p()},s.settings.adaptiveHeightSpeed);var r=0,a={left:0,top:0},l=null;if(!s.settings.infiniteLoop&&s.carousel&&s.active.last)if("horizontal"===s.settings.mode)l=s.children.eq(s.children.length-1),a=l.position(),r=s.viewport.width()-l.outerWidth();else{var d=s.children.length-s.settings.minSlides;a=s.children.eq(d).position()}else if(s.carousel&&s.active.last&&"prev"===i){var c=1===s.settings.moveSlides?s.settings.maxSlides-x():(f()-1)*x()-(s.children.length-s.settings.maxSlides);l=o.children(".bx-clone").eq(c),a=l.position()}else if("next"===i&&0===s.active.index)a=o.find("> .bx-clone").eq(s.settings.maxSlides).position(),s.active.last=!1;else if(t>=0){var g=t*x();a=s.children.eq(g).position()}if("undefined"!=typeof a){var u="horizontal"===s.settings.mode?-(a.left-r):-a.top;S(u,"slide",s.settings.speed)}}}},o.goToNextSlide=function(){if(s.settings.infiniteLoop||!s.active.last){var e=parseInt(s.active.index)+1;o.goToSlide(e,"next")}},o.goToPrevSlide=function(){if(s.settings.infiniteLoop||0!==s.active.index){var e=parseInt(s.active.index)-1;o.goToSlide(e,"prev")}},o.startAuto=function(e){s.interval||(s.interval=setInterval(function(){"next"===s.settings.autoDirection?o.goToNextSlide():o.goToPrevSlide()},s.settings.pause),s.settings.autoControls&&e!==!0&&D("stop"))},o.stopAuto=function(e){s.interval&&(clearInterval(s.interval),s.interval=null,s.settings.autoControls&&e!==!0&&D("start"))},o.getCurrentSlide=function(){return s.active.index},o.getCurrentSlideElement=function(){return s.children.eq(s.active.index)},o.getSlideCount=function(){return s.children.length},o.isWorking=function(){return s.working},o.redrawSlider=function(){s.children.add(o.find(".bx-clone")).outerWidth(h()),s.viewport.css("height",p()),s.settings.ticker||m(),s.active.last&&(s.active.index=f()-1),s.active.index>=f()&&(s.active.last=!0),s.settings.pager&&!s.settings.pagerCustom&&(b(),I(s.active.index))},o.destroySlider=function(){s.initialized&&(s.initialized=!1,e(".bx-clone",this).remove(),s.children.each(function(){void 0!==e(this).data("origStyle")?e(this).attr("style",e(this).data("origStyle")):e(this).removeAttr("style")}),void 0!==e(this).data("origStyle")?this.attr("style",e(this).data("origStyle")):e(this).removeAttr("style"),e(this).unwrap().unwrap(),s.controls.el&&s.controls.el.remove(),s.controls.next&&s.controls.next.remove(),s.controls.prev&&s.controls.prev.remove(),s.pagerEl&&s.settings.controls&&!s.settings.pagerCustom&&s.pagerEl.remove(),e(".bx-caption",this).remove(),s.controls.autoEl&&s.controls.autoEl.remove(),clearInterval(s.interval),s.settings.responsive&&e(window).unbind("resize",Z),s.settings.keyboardEnabled&&e(document).unbind("keydown",N))},o.reloadSlider=function(e){void 0!==e&&(n=e),o.destroySlider(),l()},l(),this}}(jQuery);
includes/libraries/bxslider-4/dist/vendor/jquery.easing.1.3.js ADDED
@@ -0,0 +1,205 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
3
+ *
4
+ * Uses the built in easing capabilities added In jQuery 1.1
5
+ * to offer multiple easing options
6
+ *
7
+ * TERMS OF USE - jQuery Easing
8
+ *
9
+ * Open source under the BSD License.
10
+ *
11
+ * Copyright © 2008 George McGinley Smith
12
+ * All rights reserved.
13
+ *
14
+ * Redistribution and use in source and binary forms, with or without modification,
15
+ * are permitted provided that the following conditions are met:
16
+ *
17
+ * Redistributions of source code must retain the above copyright notice, this list of
18
+ * conditions and the following disclaimer.
19
+ * Redistributions in binary form must reproduce the above copyright notice, this list
20
+ * of conditions and the following disclaimer in the documentation and/or other materials
21
+ * provided with the distribution.
22
+ *
23
+ * Neither the name of the author nor the names of contributors may be used to endorse
24
+ * or promote products derived from this software without specific prior written permission.
25
+ *
26
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
27
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
28
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
29
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
31
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
32
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
33
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
34
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
35
+ *
36
+ */
37
+
38
+ // t: current time, b: begInnIng value, c: change In value, d: duration
39
+ jQuery.easing['jswing'] = jQuery.easing['swing'];
40
+
41
+ jQuery.extend( jQuery.easing,
42
+ {
43
+ def: 'easeOutQuad',
44
+ swing: function (x, t, b, c, d) {
45
+ //alert(jQuery.easing.default);
46
+ return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
47
+ },
48
+ easeInQuad: function (x, t, b, c, d) {
49
+ return c*(t/=d)*t + b;
50
+ },
51
+ easeOutQuad: function (x, t, b, c, d) {
52
+ return -c *(t/=d)*(t-2) + b;
53
+ },
54
+ easeInOutQuad: function (x, t, b, c, d) {
55
+ if ((t/=d/2) < 1) return c/2*t*t + b;
56
+ return -c/2 * ((--t)*(t-2) - 1) + b;
57
+ },
58
+ easeInCubic: function (x, t, b, c, d) {
59
+ return c*(t/=d)*t*t + b;
60
+ },
61
+ easeOutCubic: function (x, t, b, c, d) {
62
+ return c*((t=t/d-1)*t*t + 1) + b;
63
+ },
64
+ easeInOutCubic: function (x, t, b, c, d) {
65
+ if ((t/=d/2) < 1) return c/2*t*t*t + b;
66
+ return c/2*((t-=2)*t*t + 2) + b;
67
+ },
68
+ easeInQuart: function (x, t, b, c, d) {
69
+ return c*(t/=d)*t*t*t + b;
70
+ },
71
+ easeOutQuart: function (x, t, b, c, d) {
72
+ return -c * ((t=t/d-1)*t*t*t - 1) + b;
73
+ },
74
+ easeInOutQuart: function (x, t, b, c, d) {
75
+ if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
76
+ return -c/2 * ((t-=2)*t*t*t - 2) + b;
77
+ },
78
+ easeInQuint: function (x, t, b, c, d) {
79
+ return c*(t/=d)*t*t*t*t + b;
80
+ },
81
+ easeOutQuint: function (x, t, b, c, d) {
82
+ return c*((t=t/d-1)*t*t*t*t + 1) + b;
83
+ },
84
+ easeInOutQuint: function (x, t, b, c, d) {
85
+ if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
86
+ return c/2*((t-=2)*t*t*t*t + 2) + b;
87
+ },
88
+ easeInSine: function (x, t, b, c, d) {
89
+ return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
90
+ },
91
+ easeOutSine: function (x, t, b, c, d) {
92
+ return c * Math.sin(t/d * (Math.PI/2)) + b;
93
+ },
94
+ easeInOutSine: function (x, t, b, c, d) {
95
+ return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
96
+ },
97
+ easeInExpo: function (x, t, b, c, d) {
98
+ return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
99
+ },
100
+ easeOutExpo: function (x, t, b, c, d) {
101
+ return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
102
+ },
103
+ easeInOutExpo: function (x, t, b, c, d) {
104
+ if (t==0) return b;
105
+ if (t==d) return b+c;
106
+ if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
107
+ return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
108
+ },
109
+ easeInCirc: function (x, t, b, c, d) {
110
+ return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
111
+ },
112
+ easeOutCirc: function (x, t, b, c, d) {
113
+ return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
114
+ },
115
+ easeInOutCirc: function (x, t, b, c, d) {
116
+ if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
117
+ return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
118
+ },
119
+ easeInElastic: function (x, t, b, c, d) {
120
+ var s=1.70158;var p=0;var a=c;
121
+ if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
122
+ if (a < Math.abs(c)) { a=c; var s=p/4; }
123
+ else var s = p/(2*Math.PI) * Math.asin (c/a);
124
+ return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
125
+ },
126
+ easeOutElastic: function (x, t, b, c, d) {
127
+ var s=1.70158;var p=0;var a=c;
128
+ if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
129
+ if (a < Math.abs(c)) { a=c; var s=p/4; }
130
+ else var s = p/(2*Math.PI) * Math.asin (c/a);
131
+ return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
132
+ },
133
+ easeInOutElastic: function (x, t, b, c, d) {
134
+ var s=1.70158;var p=0;var a=c;
135
+ if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5);
136
+ if (a < Math.abs(c)) { a=c; var s=p/4; }
137
+ else var s = p/(2*Math.PI) * Math.asin (c/a);
138
+ if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
139
+ return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
140
+ },
141
+ easeInBack: function (x, t, b, c, d, s) {
142
+ if (s == undefined) s = 1.70158;
143
+ return c*(t/=d)*t*((s+1)*t - s) + b;
144
+ },
145
+ easeOutBack: function (x, t, b, c, d, s) {
146
+ if (s == undefined) s = 1.70158;
147
+ return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
148
+ },
149
+ easeInOutBack: function (x, t, b, c, d, s) {
150
+ if (s == undefined) s = 1.70158;
151
+ if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
152
+ return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
153
+ },
154
+ easeInBounce: function (x, t, b, c, d) {
155
+ return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
156
+ },
157
+ easeOutBounce: function (x, t, b, c, d) {
158
+ if ((t/=d) < (1/2.75)) {
159
+ return c*(7.5625*t*t) + b;
160
+ } else if (t < (2/2.75)) {
161
+ return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
162
+ } else if (t < (2.5/2.75)) {
163
+ return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
164
+ } else {
165
+ return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
166
+ }
167
+ },
168
+ easeInOutBounce: function (x, t, b, c, d) {
169
+ if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
170
+ return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
171
+ }
172
+ });
173
+
174
+ /*
175
+ *
176
+ * TERMS OF USE - EASING EQUATIONS
177
+ *
178
+ * Open source under the BSD License.
179
+ *
180
+ * Copyright © 2001 Robert Penner
181
+ * All rights reserved.
182
+ *
183
+ * Redistribution and use in source and binary forms, with or without modification,
184
+ * are permitted provided that the following conditions are met:
185
+ *
186
+ * Redistributions of source code must retain the above copyright notice, this list of
187
+ * conditions and the following disclaimer.
188
+ * Redistributions in binary form must reproduce the above copyright notice, this list
189
+ * of conditions and the following disclaimer in the documentation and/or other materials
190
+ * provided with the distribution.
191
+ *
192
+ * Neither the name of the author nor the names of contributors may be used to endorse
193
+ * or promote products derived from this software without specific prior written permission.
194
+ *
195
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
196
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
197
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
198
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
199
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
200
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
201
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
202
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
203
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
204
+ *
205
+ */
includes/libraries/bxslider-4/dist/vendor/jquery.fitvids.js ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*global jQuery */
2
+ /*jshint multistr:true browser:true */
3
+ /*!
4
+ * FitVids 1.0
5
+ *
6
+ * Copyright 2011, Chris Coyier - http://css-tricks.com + Dave Rupert - http://daverupert.com
7
+ * Credit to Thierry Koblentz - http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/
8
+ * Released under the WTFPL license - http://sam.zoy.org/wtfpl/
9
+ *
10
+ * Date: Thu Sept 01 18:00:00 2011 -0500
11
+ */
12
+
13
+ (function( $ ){
14
+
15
+ "use strict";
16
+
17
+ $.fn.fitVids = function( options ) {
18
+ var settings = {
19
+ customSelector: null
20
+ };
21
+
22
+ var div = document.createElement('div'),
23
+ ref = document.getElementsByTagName('base')[0] || document.getElementsByTagName('script')[0];
24
+
25
+ div.className = 'fit-vids-style';
26
+ div.innerHTML = '&shy;<style> \
27
+ .fluid-width-video-wrapper { \
28
+ width: 100%; \
29
+ position: relative; \
30
+ padding: 0; \
31
+ } \
32
+ \
33
+ .fluid-width-video-wrapper iframe, \
34
+ .fluid-width-video-wrapper object, \
35
+ .fluid-width-video-wrapper embed { \
36
+ position: absolute; \
37
+ top: 0; \
38
+ left: 0; \
39
+ width: 100%; \
40
+ height: 100%; \
41
+ } \
42
+ </style>';
43
+
44
+ ref.parentNode.insertBefore(div,ref);
45
+
46
+ if ( options ) {
47
+ $.extend( settings, options );
48
+ }
49
+
50
+ return this.each(function(){
51
+ var selectors = [
52
+ "iframe[src*='player.vimeo.com']",
53
+ "iframe[src*='www.youtube.com']",
54
+ "iframe[src*='www.kickstarter.com']",
55
+ "object",
56
+ "embed"
57
+ ];
58
+
59
+ if (settings.customSelector) {
60
+ selectors.push(settings.customSelector);
61
+ }
62
+
63
+ var $allVideos = $(this).find(selectors.join(','));
64
+
65
+ $allVideos.each(function(){
66
+ var $this = $(this);
67
+ if (this.tagName.toLowerCase() === 'embed' && $this.parent('object').length || $this.parent('.fluid-width-video-wrapper').length) { return; }
68
+ var height = ( this.tagName.toLowerCase() === 'object' || ($this.attr('height') && !isNaN(parseInt($this.attr('height'), 10))) ) ? parseInt($this.attr('height'), 10) : $this.height(),
69
+ width = !isNaN(parseInt($this.attr('width'), 10)) ? parseInt($this.attr('width'), 10) : $this.width(),
70
+ aspectRatio = height / width;
71
+ if(!$this.attr('id')){
72
+ var videoID = 'fitvid' + Math.floor(Math.random()*999999);
73
+ $this.attr('id', videoID);
74
+ }
75
+ $this.wrap('<div class="fluid-width-video-wrapper"></div>').parent('.fluid-width-video-wrapper').css('padding-top', (aspectRatio * 100)+"%");
76
+ $this.removeAttr('height').removeAttr('width');
77
+ });
78
+ });
79
+ };
80
+ })( jQuery );
includes/libraries/bxslider-4/package.json ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "bxslider",
3
+ "version": "4.2.3",
4
+ "author": "Steven Wanderski <steven@bxcreative.com>",
5
+ "homepage": "http://bxslider.com",
6
+ "private": true,
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git://github.com/stevenwanderski/bxslider-4.git"
10
+ },
11
+ "bugs": {
12
+ "url": "https://github.com/stevenwanderski/bxslider-4/issues"
13
+ },
14
+ "licenses": [
15
+ {
16
+ "type": "MIT",
17
+ "url": "http://opensource.org/licenses/MIT"
18
+ }
19
+ ],
20
+ "devDependencies": {
21
+ "del": "^1.1.1",
22
+ "gulp": "^3.8.10",
23
+ "gulp-imagemin": "^2.1.0",
24
+ "gulp-jshint": "^1.9.0",
25
+ "gulp-less": "^2.0.1",
26
+ "gulp-load-plugins": "^0.8.0",
27
+ "gulp-pleeease": "^1.1.0",
28
+ "gulp-rename": "^1.2.0",
29
+ "gulp-uglify": "^1.1.0",
30
+ "imagemin-pngcrush": "^4.0.0",
31
+ "jshint-stylish": "^1.0.0"
32
+ }
33
+ }
includes/libraries/bxslider-4/src/images/bx_loader.gif ADDED
Binary file
includes/libraries/bxslider-4/src/images/controls.png ADDED
Binary file
includes/libraries/bxslider-4/src/js/jquery.bxslider.js ADDED
@@ -0,0 +1,1543 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /***
2
+ * BxSlider v4.2.3 - Fully loaded, responsive content slider
3
+ * http://bxslider.com
4
+ *
5
+ * Copyright 2014, Steven Wanderski - http://stevenwanderski.com - http://bxcreative.com
6
+ * Written while drinking Belgian ales and listening to jazz
7
+ *
8
+ * Released under the MIT license - http://opensource.org/licenses/MIT
9
+ ***/
10
+
11
+ ;(function($){
12
+
13
+ var defaults = {
14
+
15
+ // GENERAL
16
+ mode: 'horizontal',
17
+ slideSelector: '',
18
+ infiniteLoop: true,
19
+ hideControlOnEnd: false,
20
+ speed: 500,
21
+ easing: null,
22
+ slideMargin: 0,
23
+ startSlide: 0,
24
+ randomStart: false,
25
+ captions: false,
26
+ ticker: false,
27
+ tickerHover: false,
28
+ adaptiveHeight: false,
29
+ adaptiveHeightSpeed: 500,
30
+ video: false,
31
+ useCSS: true,
32
+ preloadImages: 'visible',
33
+ responsive: true,
34
+ slideZIndex: 50,
35
+ wrapperClass: 'bx-wrapper',
36
+
37
+ // TOUCH
38
+ touchEnabled: true,
39
+ swipeThreshold: 50,
40
+ oneToOneTouch: true,
41
+ preventDefaultSwipeX: true,
42
+ preventDefaultSwipeY: false,
43
+
44
+ // KEYBOARD
45
+ keyboardEnabled: false,
46
+
47
+ // PAGER
48
+ pager: true,
49
+ pagerType: 'full',
50
+ pagerShortSeparator: ' / ',
51
+ pagerSelector: null,
52
+ buildPager: null,
53
+ pagerCustom: null,
54
+
55
+ // CONTROLS
56
+ controls: true,
57
+ nextText: 'Next',
58
+ prevText: 'Prev',
59
+ nextSelector: null,
60
+ prevSelector: null,
61
+ autoControls: false,
62
+ startText: 'Start',
63
+ stopText: 'Stop',
64
+ autoControlsCombine: false,
65
+ autoControlsSelector: null,
66
+
67
+ // AUTO
68
+ auto: false,
69
+ pause: 4000,
70
+ autoStart: true,
71
+ autoDirection: 'next',
72
+ autoHover: false,
73
+ autoDelay: 0,
74
+ autoSlideForOnePage: false,
75
+
76
+ // CAROUSEL
77
+ minSlides: 1,
78
+ maxSlides: 1,
79
+ moveSlides: 0,
80
+ slideWidth: 0,
81
+
82
+ // CALLBACKS
83
+ onSliderLoad: function(){ return true },
84
+ onSlideBefore: function(){ return true },
85
+ onSlideAfter: function(){ return true },
86
+ onSlideNext: function(){ return true },
87
+ onSlidePrev: function(){ return true },
88
+ onSliderResize: function(){ return true }
89
+ };
90
+
91
+ $.fn.bxSlider = function(options){
92
+
93
+ if(this.length === 0){
94
+ return this;
95
+ }
96
+
97
+ // support multiple elements
98
+ if(this.length > 1){
99
+ this.each(function(){
100
+ $(this).bxSlider(options);
101
+ });
102
+ return this;
103
+ }
104
+
105
+ // create a namespace to be used throughout the plugin
106
+ var slider = {};
107
+ // set a reference to our slider element
108
+ var el = this;
109
+
110
+ /**
111
+ * Makes slideshow responsive
112
+ */
113
+ // first get the original window dimens (thanks a lot IE)
114
+ var windowWidth = $(window).width();
115
+ var windowHeight = $(window).height();
116
+
117
+
118
+
119
+ /**
120
+ * ===================================================================================
121
+ * = PRIVATE FUNCTIONS
122
+ * ===================================================================================
123
+ */
124
+
125
+ /**
126
+ * Initializes namespace settings to be used throughout plugin
127
+ */
128
+ var init = function(){
129
+ // merge user-supplied options with the defaults
130
+ slider.settings = $.extend({}, defaults, options);
131
+ // parse slideWidth setting
132
+ slider.settings.slideWidth = parseInt(slider.settings.slideWidth);
133
+ // store the original children
134
+ slider.children = el.children(slider.settings.slideSelector);
135
+ // check if actual number of slides is less than minSlides / maxSlides
136
+ if(slider.children.length < slider.settings.minSlides){ slider.settings.minSlides = slider.children.length; }
137
+ if(slider.children.length < slider.settings.maxSlides){ slider.settings.maxSlides = slider.children.length; }
138
+ // if random start, set the startSlide setting to random number
139
+ if(slider.settings.randomStart){ slider.settings.startSlide = Math.floor(Math.random() * slider.children.length); }
140
+ // store active slide information
141
+ slider.active = { index: slider.settings.startSlide };
142
+ // store if the slider is in carousel mode (displaying / moving multiple slides)
143
+ slider.carousel = slider.settings.minSlides > 1 || slider.settings.maxSlides > 1 ? true : false;
144
+ // if carousel, force preloadImages = 'all'
145
+ if(slider.carousel){ slider.settings.preloadImages = 'all'; }
146
+ // calculate the min / max width thresholds based on min / max number of slides
147
+ // used to setup and update carousel slides dimensions
148
+ slider.minThreshold = (slider.settings.minSlides * slider.settings.slideWidth) + ((slider.settings.minSlides - 1) * slider.settings.slideMargin);
149
+ slider.maxThreshold = (slider.settings.maxSlides * slider.settings.slideWidth) + ((slider.settings.maxSlides - 1) * slider.settings.slideMargin);
150
+ // store the current state of the slider (if currently animating, working is true)
151
+ slider.working = false;
152
+ // initialize the controls object
153
+ slider.controls = {};
154
+ // initialize an auto interval
155
+ slider.interval = null;
156
+ // determine which property to use for transitions
157
+ slider.animProp = slider.settings.mode === 'vertical' ? 'top' : 'left';
158
+ // determine if hardware acceleration can be used
159
+ slider.usingCSS = slider.settings.useCSS && slider.settings.mode !== 'fade' && (function(){
160
+ // create our test div element
161
+ var div = document.createElement('div');
162
+ // css transition properties
163
+ var props = ['WebkitPerspective', 'MozPerspective', 'OPerspective', 'msPerspective'];
164
+ // test for each property
165
+ for(var i in props){
166
+ if(div.style[props[i]] !== undefined){
167
+ slider.cssPrefix = props[i].replace('Perspective', '').toLowerCase();
168
+ slider.animProp = '-' + slider.cssPrefix + '-transform';
169
+ return true;
170
+ }
171
+ }
172
+ return false;
173
+ }());
174
+ // if vertical mode always make maxSlides and minSlides equal
175
+ if(slider.settings.mode === 'vertical'){ slider.settings.maxSlides = slider.settings.minSlides; }
176
+ // save original style data
177
+ el.data("origStyle", el.attr("style"));
178
+ el.children(slider.settings.slideSelector).each(function(){
179
+ $(this).data("origStyle", $(this).attr("style"));
180
+ });
181
+ // perform all DOM / CSS modifications
182
+ setup();
183
+ };
184
+
185
+ /**
186
+ * Performs all DOM and CSS modifications
187
+ */
188
+ var setup = function(){
189
+ // wrap el in a wrapper
190
+ el.wrap('<div class="' + slider.settings.wrapperClass + '"><div class="bx-viewport"></div></div>');
191
+ // store a namespace reference to .bx-viewport
192
+ slider.viewport = el.parent();
193
+ // add a loading div to display while images are loading
194
+ slider.loader = $('<div class="bx-loading" />');
195
+ slider.viewport.prepend(slider.loader);
196
+ // set el to a massive width, to hold any needed slides
197
+ // also strip any margin and padding from el
198
+ el.css({
199
+ width: slider.settings.mode === 'horizontal' ? (slider.children.length * 1000 + 215) + '%' : 'auto',
200
+ position: 'absolute'
201
+ });
202
+ // if using CSS, add the easing property
203
+ if(slider.usingCSS && slider.settings.easing){
204
+ el.css('-' + slider.cssPrefix + '-transition-timing-function', slider.settings.easing);
205
+ // if not using CSS and no easing value was supplied, use the default JS animation easing (swing)
206
+ }else if(!slider.settings.easing){
207
+ slider.settings.easing = 'swing';
208
+ }
209
+ var slidesShowing = getNumberSlidesShowing();
210
+ // make modifications to the viewport (.bx-viewport)
211
+ slider.viewport.css({
212
+ width: '100%',
213
+ overflow: 'hidden',
214
+ position: 'relative'
215
+ });
216
+ slider.viewport.parent().css({
217
+ maxWidth: getViewportMaxWidth()
218
+ });
219
+ // make modification to the wrapper (.bx-wrapper)
220
+ if(!slider.settings.pager && !slider.settings.controls){
221
+ slider.viewport.parent().css({
222
+ margin: '0 auto 0px'
223
+ });
224
+ }
225
+ // apply css to all slider children
226
+ slider.children.css({
227
+ 'float': slider.settings.mode === 'horizontal' ? 'left' : 'none',
228
+ listStyle: 'none',
229
+ position: 'relative'
230
+ });
231
+ // apply the calculated width after the float is applied to prevent scrollbar interference
232
+ slider.children.css('width', getSlideWidth());
233
+ // if slideMargin is supplied, add the css
234
+ if(slider.settings.mode === 'horizontal' && slider.settings.slideMargin > 0){ slider.children.css('marginRight', slider.settings.slideMargin); }
235
+ if(slider.settings.mode === 'vertical' && slider.settings.slideMargin > 0){ slider.children.css('marginBottom', slider.settings.slideMargin); }
236
+ // if "fade" mode, add positioning and z-index CSS
237
+ if(slider.settings.mode === 'fade'){
238
+ slider.children.css({
239
+ position: 'absolute',
240
+ zIndex: 0,
241
+ display: 'none'
242
+ });
243
+ // prepare the z-index on the showing element
244
+ slider.children.eq(slider.settings.startSlide).css({zIndex: slider.settings.slideZIndex, display: 'block'});
245
+ }
246
+ // create an element to contain all slider controls (pager, start / stop, etc)
247
+ slider.controls.el = $('<div class="bx-controls" />');
248
+ // if captions are requested, add them
249
+ if(slider.settings.captions){ appendCaptions(); }
250
+ // check if startSlide is last slide
251
+ slider.active.last = slider.settings.startSlide === getPagerQty() - 1;
252
+ // if video is true, set up the fitVids plugin
253
+ if(slider.settings.video){ el.fitVids(); }
254
+ // set the default preload selector (visible)
255
+ var preloadSelector = slider.children.eq(slider.settings.startSlide);
256
+ if(slider.settings.preloadImages === "all" || slider.settings.ticker){ preloadSelector = slider.children; }
257
+ // only check for control addition if not in "ticker" mode
258
+ if(!slider.settings.ticker){
259
+ // if controls are requested, add them
260
+ if(slider.settings.controls){ appendControls(); }
261
+ // if auto is true, and auto controls are requested, add them
262
+ if(slider.settings.auto && slider.settings.autoControls){ appendControlsAuto(); }
263
+ // if pager is requested, add it
264
+ if(slider.settings.pager){ appendPager(); }
265
+ // if any control option is requested, add the controls wrapper
266
+ if(slider.settings.controls || slider.settings.autoControls || slider.settings.pager){ slider.viewport.after(slider.controls.el); }
267
+ // if ticker mode, do not allow a pager
268
+ } else {
269
+ slider.settings.pager = false;
270
+ }
271
+ loadElements(preloadSelector, start);
272
+ };
273
+
274
+ var loadElements = function(selector, callback){
275
+ var total = selector.find('img:not([src=""]), iframe').length;
276
+ if(total === 0){
277
+ callback();
278
+ return;
279
+ }
280
+ var count = 0;
281
+ selector.find('img:not([src=""]), iframe').each(function(){
282
+ $(this).one('load error', function(){
283
+ if(++count === total){ callback(); }
284
+ }).each(function(){
285
+ if(this.complete){ $(this).load(); }
286
+ });
287
+ });
288
+ };
289
+
290
+ /**
291
+ * Start the slider
292
+ */
293
+ var start = function(){
294
+ // if infinite loop, prepare additional slides
295
+ if(slider.settings.infiniteLoop && slider.settings.mode !== 'fade' && !slider.settings.ticker){
296
+ var slice = slider.settings.mode === 'vertical' ? slider.settings.minSlides : slider.settings.maxSlides;
297
+ var sliceAppend = slider.children.slice(0, slice).clone(true).addClass('bx-clone');
298
+ var slicePrepend = slider.children.slice(-slice).clone(true).addClass('bx-clone');
299
+ el.append(sliceAppend).prepend(slicePrepend);
300
+ }
301
+ // remove the loading DOM element
302
+ slider.loader.remove();
303
+ // set the left / top position of "el"
304
+ setSlidePosition();
305
+ // if "vertical" mode, always use adaptiveHeight to prevent odd behavior
306
+ if(slider.settings.mode === 'vertical'){ slider.settings.adaptiveHeight = true; }
307
+ // set the viewport height
308
+ slider.viewport.height(getViewportHeight());
309
+ // make sure everything is positioned just right (same as a window resize)
310
+ el.redrawSlider();
311
+ // onSliderLoad callback
312
+ slider.settings.onSliderLoad(slider,slider.active.index);
313
+ // slider has been fully initialized
314
+ slider.initialized = true;
315
+ // bind the resize call to the window
316
+ if(slider.settings.responsive){ $(window).bind('resize', resizeWindow); }
317
+ // if auto is true and has more than 1 page, start the show
318
+ if(slider.settings.auto && slider.settings.autoStart && (getPagerQty() > 1 || slider.settings.autoSlideForOnePage)){ initAuto(); }
319
+ // if ticker is true, start the ticker
320
+ if(slider.settings.ticker){ initTicker(); }
321
+ // if pager is requested, make the appropriate pager link active
322
+ if(slider.settings.pager){ updatePagerActive(slider.settings.startSlide); }
323
+ // check for any updates to the controls (like hideControlOnEnd updates)
324
+ if(slider.settings.controls){ updateDirectionControls(); }
325
+ // if touchEnabled is true, setup the touch events
326
+ if(slider.settings.touchEnabled && !slider.settings.ticker){ initTouch(); }
327
+ // if keyboardEnabled is true, setup the keyboard events
328
+ if (slider.settings.keyboardEnabled && !slider.settings.ticker) {
329
+ $(document).keydown(keyPress);
330
+ }
331
+ };
332
+
333
+ /**
334
+ * Returns the calculated height of the viewport, used to determine either adaptiveHeight or the maxHeight value
335
+ */
336
+ var getViewportHeight = function(){
337
+ var height = 0;
338
+ // first determine which children (slides) should be used in our height calculation
339
+ var children = $();
340
+ // if mode is not "vertical" and adaptiveHeight is false, include all children
341
+ if(slider.settings.mode !== 'vertical' && !slider.settings.adaptiveHeight){
342
+ children = slider.children;
343
+ }else{
344
+ // if not carousel, return the single active child
345
+ if(!slider.carousel){
346
+ children = slider.children.eq(slider.active.index);
347
+ // if carousel, return a slice of children
348
+ }else{
349
+ // get the individual slide index
350
+ var currentIndex = slider.settings.moveSlides === 1 ? slider.active.index : slider.active.index * getMoveBy();
351
+ // add the current slide to the children
352
+ children = slider.children.eq(currentIndex);
353
+ // cycle through the remaining "showing" slides
354
+ for (i = 1; i <= slider.settings.maxSlides - 1; i++){
355
+ // if looped back to the start
356
+ if(currentIndex + i >= slider.children.length){
357
+ children = children.add(slider.children.eq(i - 1));
358
+ }else{
359
+ children = children.add(slider.children.eq(currentIndex + i));
360
+ }
361
+ }
362
+ }
363
+ }
364
+ // if "vertical" mode, calculate the sum of the heights of the children
365
+ if(slider.settings.mode === 'vertical'){
366
+ children.each(function(index){
367
+ height += $(this).outerHeight();
368
+ });
369
+ // add user-supplied margins
370
+ if(slider.settings.slideMargin > 0){
371
+ height += slider.settings.slideMargin * (slider.settings.minSlides - 1);
372
+ }
373
+ // if not "vertical" mode, calculate the max height of the children
374
+ }else{
375
+ height = Math.max.apply(Math, children.map(function(){
376
+ return $(this).outerHeight(false);
377
+ }).get());
378
+ }
379
+
380
+ if(slider.viewport.css('box-sizing') === 'border-box'){
381
+ height += parseFloat(slider.viewport.css('padding-top')) + parseFloat(slider.viewport.css('padding-bottom')) +
382
+ parseFloat(slider.viewport.css('border-top-width')) + parseFloat(slider.viewport.css('border-bottom-width'));
383
+ }else if(slider.viewport.css('box-sizing') === 'padding-box'){
384
+ height += parseFloat(slider.viewport.css('padding-top')) + parseFloat(slider.viewport.css('padding-bottom'));
385
+ }
386
+
387
+ return height;
388
+ };
389
+
390
+ /**
391
+ * Returns the calculated width to be used for the outer wrapper / viewport
392
+ */
393
+ var getViewportMaxWidth = function(){
394
+ var width = '100%';
395
+ if(slider.settings.slideWidth > 0){
396
+ if(slider.settings.mode === 'horizontal'){
397
+ width = (slider.settings.maxSlides * slider.settings.slideWidth) + ((slider.settings.maxSlides - 1) * slider.settings.slideMargin);
398
+ }else{
399
+ width = slider.settings.slideWidth;
400
+ }
401
+ }
402
+ return width;
403
+ };
404
+
405
+ /**
406
+ * Returns the calculated width to be applied to each slide
407
+ */
408
+ var getSlideWidth = function(){
409
+ // start with any user-supplied slide width
410
+ var newElWidth = slider.settings.slideWidth;
411
+ // get the current viewport width
412
+ var wrapWidth = slider.viewport.width();
413
+ // if slide width was not supplied, or is larger than the viewport use the viewport width
414
+ if(slider.settings.slideWidth === 0 ||
415
+ (slider.settings.slideWidth > wrapWidth && !slider.carousel) ||
416
+ slider.settings.mode === 'vertical'){
417
+ newElWidth = wrapWidth;
418
+ // if carousel, use the thresholds to determine the width
419
+ }else if(slider.settings.maxSlides > 1 && slider.settings.mode === 'horizontal'){
420
+ if(wrapWidth > slider.maxThreshold){
421
+ // newElWidth = (wrapWidth - (slider.settings.slideMargin * (slider.settings.maxSlides - 1))) / slider.settings.maxSlides;
422
+ }else if(wrapWidth < slider.minThreshold){
423
+ newElWidth = (wrapWidth - (slider.settings.slideMargin * (slider.settings.minSlides - 1))) / slider.settings.minSlides;
424
+ }
425
+ }
426
+ return newElWidth;
427
+ };
428
+
429
+ /**
430
+ * Returns the number of slides currently visible in the viewport (includes partially visible slides)
431
+ */
432
+ var getNumberSlidesShowing = function(){
433
+ var slidesShowing = 1;
434
+ if(slider.settings.mode === 'horizontal' && slider.settings.slideWidth > 0){
435
+ // if viewport is smaller than minThreshold, return minSlides
436
+ if(slider.viewport.width() < slider.minThreshold){
437
+ slidesShowing = slider.settings.minSlides;
438
+ // if viewport is larger than maxThreshold, return maxSlides
439
+ }else if(slider.viewport.width() > slider.maxThreshold){
440
+ slidesShowing = slider.settings.maxSlides;
441
+ // if viewport is between min / max thresholds, divide viewport width by first child width
442
+ }else{
443
+ var childWidth = slider.children.first().width() + slider.settings.slideMargin;
444
+ slidesShowing = Math.floor((slider.viewport.width() +
445
+ slider.settings.slideMargin) / childWidth);
446
+ }
447
+ // if "vertical" mode, slides showing will always be minSlides
448
+ }else if(slider.settings.mode === 'vertical'){
449
+ slidesShowing = slider.settings.minSlides;
450
+ }
451
+ return slidesShowing;
452
+ };
453
+
454
+ /**
455
+ * Returns the number of pages (one full viewport of slides is one "page")
456
+ */
457
+ var getPagerQty = function(){
458
+ var pagerQty = 0;
459
+ // if moveSlides is specified by the user
460
+ if(slider.settings.moveSlides > 0){
461
+ if(slider.settings.infiniteLoop){
462
+ pagerQty = Math.ceil(slider.children.length / getMoveBy());
463
+ }else{
464
+ // use a while loop to determine pages
465
+ var breakPoint = 0;
466
+ var counter = 0;
467
+ // when breakpoint goes above children length, counter is the number of pages
468
+ while (breakPoint < slider.children.length){
469
+ ++pagerQty;
470
+ breakPoint = counter + getNumberSlidesShowing();
471
+ counter += slider.settings.moveSlides <= getNumberSlidesShowing() ? slider.settings.moveSlides : getNumberSlidesShowing();
472
+ }
473
+ }
474
+ // if moveSlides is 0 (auto) divide children length by sides showing, then round up
475
+ }else{
476
+ pagerQty = Math.ceil(slider.children.length / getNumberSlidesShowing());
477
+ }
478
+ return pagerQty;
479
+ };
480
+
481
+ /**
482
+ * Returns the number of individual slides by which to shift the slider
483
+ */
484
+ var getMoveBy = function(){
485
+ // if moveSlides was set by the user and moveSlides is less than number of slides showing
486
+ if(slider.settings.moveSlides > 0 && slider.settings.moveSlides <= getNumberSlidesShowing()){
487
+ return slider.settings.moveSlides;
488
+ }
489
+ // if moveSlides is 0 (auto)
490
+ return getNumberSlidesShowing();
491
+ };
492
+
493
+ /**
494
+ * Sets the slider's (el) left or top position
495
+ */
496
+ var setSlidePosition = function(){
497
+ var position;
498
+ // if last slide, not infinite loop, and number of children is larger than specified maxSlides
499
+ if(slider.children.length > slider.settings.maxSlides && slider.active.last && !slider.settings.infiniteLoop){
500
+ if(slider.settings.mode === 'horizontal'){
501
+ // get the last child's position
502
+ var lastChild = slider.children.last();
503
+ position = lastChild.position();
504
+ // set the left position
505
+ setPositionProperty(-(position.left - (slider.viewport.width() - lastChild.outerWidth())), 'reset', 0);
506
+ }else if(slider.settings.mode === 'vertical'){
507
+ // get the last showing index's position
508
+ var lastShowingIndex = slider.children.length - slider.settings.minSlides;
509
+ position = slider.children.eq(lastShowingIndex).position();
510
+ // set the top position
511
+ setPositionProperty(-position.top, 'reset', 0);
512
+ }
513
+ // if not last slide
514
+ }else{
515
+ // get the position of the first showing slide
516
+ position = slider.children.eq(slider.active.index * getMoveBy()).position();
517
+ // check for last slide
518
+ if(slider.active.index === getPagerQty() - 1){ slider.active.last = true; }
519
+ // set the respective position
520
+ if(position !== undefined){
521
+ if(slider.settings.mode === 'horizontal'){ setPositionProperty(-position.left, 'reset', 0); }
522
+ else if(slider.settings.mode === 'vertical'){ setPositionProperty(-position.top, 'reset', 0); }
523
+ }
524
+ }
525
+ };
526
+
527
+ /**
528
+ * Sets the el's animating property position (which in turn will sometimes animate el).
529
+ * If using CSS, sets the transform property. If not using CSS, sets the top / left property.
530
+ *
531
+ * @param value (int)
532
+ * - the animating property's value
533
+ *
534
+ * @param type (string) 'slide', 'reset', 'ticker'
535
+ * - the type of instance for which the function is being
536
+ *
537
+ * @param duration (int)
538
+ * - the amount of time (in ms) the transition should occupy
539
+ *
540
+ * @param params (array) optional
541
+ * - an optional parameter containing any variables that need to be passed in
542
+ */
543
+ var setPositionProperty = function(value, type, duration, params){
544
+ // use CSS transform
545
+ if(slider.usingCSS){
546
+ // determine the translate3d value
547
+ var propValue = slider.settings.mode === 'vertical' ? 'translate3d(0, ' + value + 'px, 0)' : 'translate3d(' + value + 'px, 0, 0)';
548
+ // add the CSS transition-duration
549
+ el.css('-' + slider.cssPrefix + '-transition-duration', duration / 1000 + 's');
550
+ if(type === 'slide'){
551
+ setTimeout(function() {
552
+ // set the property value
553
+ el.css(slider.animProp, propValue);
554
+ // if value 0, just update
555
+ if(value === 0) {
556
+ updateAfterSlideTransition();
557
+ } else {
558
+ // bind a callback method - executes when CSS transition completes
559
+ el.bind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', function(){
560
+ // unbind the callback
561
+ el.unbind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd');
562
+ updateAfterSlideTransition();
563
+ });
564
+ }
565
+ }, 0);
566
+ }else if(type === 'reset'){
567
+ el.css(slider.animProp, propValue);
568
+ }else if(type === 'ticker'){
569
+ // make the transition use 'linear'
570
+ el.css('-' + slider.cssPrefix + '-transition-timing-function', 'linear');
571
+ el.css(slider.animProp, propValue);
572
+ // bind a callback method - executes when CSS transition completes
573
+ el.bind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', function(){
574
+ // unbind the callback
575
+ el.unbind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd');
576
+ // reset the position
577
+ setPositionProperty(params.resetValue, 'reset', 0);
578
+ // start the loop again
579
+ tickerLoop();
580
+ });
581
+ }
582
+ // use JS animate
583
+ }else{
584
+ var animateObj = {};
585
+ animateObj[slider.animProp] = value;
586
+ if(type === 'slide'){
587
+ el.animate(animateObj, duration, slider.settings.easing, function(){
588
+ updateAfterSlideTransition();
589
+ });
590
+ }else if(type === 'reset'){
591
+ el.css(slider.animProp, value);
592
+ }else if(type === 'ticker'){
593
+ el.animate(animateObj, speed, 'linear', function(){
594
+ setPositionProperty(params.resetValue, 'reset', 0);
595
+ // run the recursive loop after animation
596
+ tickerLoop();
597
+ });
598
+ }
599
+ }
600
+ };
601
+
602
+ /**
603
+ * Populates the pager with proper amount of pages
604
+ */
605
+ var populatePager = function(){
606
+ var pagerHtml = '';
607
+ var pagerQty = getPagerQty();
608
+ // loop through each pager item
609
+ for(var i=0; i < pagerQty; i++){
610
+ var linkContent = '';
611
+ // if a buildPager function is supplied, use it to get pager link value, else use index + 1
612
+ if(slider.settings.buildPager && $.isFunction(slider.settings.buildPager) || slider.settings.pagerCustom){
613
+ linkContent = slider.settings.buildPager(i);
614
+ slider.pagerEl.addClass('bx-custom-pager');
615
+ }else{
616
+ linkContent = i + 1;
617
+ slider.pagerEl.addClass('bx-default-pager');
618
+ }
619
+ // var linkContent = slider.settings.buildPager && $.isFunction(slider.settings.buildPager) ? slider.settings.buildPager(i) : i + 1;
620
+ // add the markup to the string
621
+ pagerHtml += '<div class="bx-pager-item"><a href="" data-slide-index="' + i + '" class="bx-pager-link">' + linkContent + '</a></div>';
622
+ }
623
+ // populate the pager element with pager links
624
+ slider.pagerEl.html(pagerHtml);
625
+ };
626
+
627
+ /**
628
+ * Appends the pager to the controls element
629
+ */
630
+ var appendPager = function(){
631
+ if(!slider.settings.pagerCustom){
632
+ // create the pager DOM element
633
+ slider.pagerEl = $('<div class="bx-pager" />');
634
+ // if a pager selector was supplied, populate it with the pager
635
+ if(slider.settings.pagerSelector){
636
+ $(slider.settings.pagerSelector).html(slider.pagerEl);
637
+ // if no pager selector was supplied, add it after the wrapper
638
+ }else{
639
+ slider.controls.el.addClass('bx-has-pager').append(slider.pagerEl);
640
+ }
641
+ // populate the pager
642
+ populatePager();
643
+ }else{
644
+ slider.pagerEl = $(slider.settings.pagerCustom);
645
+ }
646
+ // assign the pager click binding
647
+ slider.pagerEl.on('click touchend', 'a', clickPagerBind);
648
+ };
649
+
650
+ /**
651
+ * Appends prev / next controls to the controls element
652
+ */
653
+ var appendControls = function(){
654
+ slider.controls.next = $('<a class="bx-next" href="">' + slider.settings.nextText + '</a>');
655
+ slider.controls.prev = $('<a class="bx-prev" href="">' + slider.settings.prevText + '</a>');
656
+ // bind click actions to the controls
657
+ slider.controls.next.bind('click touchend', clickNextBind);
658
+ slider.controls.prev.bind('click touchend', clickPrevBind);
659
+ // if nextSelector was supplied, populate it
660
+ if(slider.settings.nextSelector){
661
+ $(slider.settings.nextSelector).append(slider.controls.next);
662
+ }
663
+ // if prevSelector was supplied, populate it
664
+ if(slider.settings.prevSelector){
665
+ $(slider.settings.prevSelector).append(slider.controls.prev);
666
+ }
667
+ // if no custom selectors were supplied
668
+ if(!slider.settings.nextSelector && !slider.settings.prevSelector){
669
+ // add the controls to the DOM
670
+ slider.controls.directionEl = $('<div class="bx-controls-direction" />');
671
+ // add the control elements to the directionEl
672
+ slider.controls.directionEl.append(slider.controls.prev).append(slider.controls.next);
673
+ // slider.viewport.append(slider.controls.directionEl);
674
+ slider.controls.el.addClass('bx-has-controls-direction').append(slider.controls.directionEl);
675
+ }
676
+ };
677
+
678
+ /**
679
+ * Appends start / stop auto controls to the controls element
680
+ */
681
+ var appendControlsAuto = function(){
682
+ slider.controls.start = $('<div class="bx-controls-auto-item"><a class="bx-start" href="">' + slider.settings.startText + '</a></div>');
683
+ slider.controls.stop = $('<div class="bx-controls-auto-item"><a class="bx-stop" href="">' + slider.settings.stopText + '</a></div>');
684
+ // add the controls to the DOM
685
+ slider.controls.autoEl = $('<div class="bx-controls-auto" />');
686
+ // bind click actions to the controls
687
+ slider.controls.autoEl.on('click', '.bx-start', clickStartBind);
688
+ slider.controls.autoEl.on('click', '.bx-stop', clickStopBind);
689
+ // if autoControlsCombine, insert only the "start" control
690
+ if(slider.settings.autoControlsCombine){
691
+ slider.controls.autoEl.append(slider.controls.start);
692
+ // if autoControlsCombine is false, insert both controls
693
+ }else{
694
+ slider.controls.autoEl.append(slider.controls.start).append(slider.controls.stop);
695
+ }
696
+ // if auto controls selector was supplied, populate it with the controls
697
+ if(slider.settings.autoControlsSelector){
698
+ $(slider.settings.autoControlsSelector).html(slider.controls.autoEl);
699
+ // if auto controls selector was not supplied, add it after the wrapper
700
+ }else{
701
+ slider.controls.el.addClass('bx-has-controls-auto').append(slider.controls.autoEl);
702
+ }
703
+ // update the auto controls
704
+ updateAutoControls(slider.settings.autoStart ? 'stop' : 'start');
705
+ };
706
+
707
+ /**
708
+ * Appends image captions to the DOM
709
+ */
710
+ var appendCaptions = function(){
711
+ // cycle through each child
712
+ slider.children.each(function(index){
713
+ // get the image title attribute
714
+ var title = $(this).find('img:first').attr('title');
715
+ // append the caption
716
+ if(title !== undefined && ('' + title).length){
717
+ $(this).append('<div class="bx-caption"><span>' + title + '</span></div>');
718
+ }
719
+ });
720
+ };
721
+
722
+ /**
723
+ * Click next binding
724
+ *
725
+ * @param e (event)
726
+ * - DOM event object
727
+ */
728
+ var clickNextBind = function(e){
729
+ e.preventDefault();
730
+ if (slider.controls.el.hasClass('disabled')) {
731
+ return;
732
+ }
733
+ // if auto show is running, stop it
734
+ if(slider.settings.auto){ el.stopAuto(); }
735
+ el.goToNextSlide();
736
+ };
737
+
738
+ /**
739
+ * Click prev binding
740
+ *
741
+ * @param e (event)
742
+ * - DOM event object
743
+ */
744
+ var clickPrevBind = function(e){
745
+ e.preventDefault();
746
+ if (slider.controls.el.hasClass('disabled')) {
747
+ return;
748
+ }
749
+ // if auto show is running, stop it
750
+ if(slider.settings.auto){ el.stopAuto(); }
751
+ el.goToPrevSlide();
752
+ };
753
+
754
+ /**
755
+ * Click start binding
756
+ *
757
+ * @param e (event)
758
+ * - DOM event object
759
+ */
760
+ var clickStartBind = function(e){
761
+ el.startAuto();
762
+ e.preventDefault();
763
+ };
764
+
765
+ /**
766
+ * Click stop binding
767
+ *
768
+ * @param e (event)
769
+ * - DOM event object
770
+ */
771
+ var clickStopBind = function(e){
772
+ el.stopAuto();
773
+ e.preventDefault();
774
+ };
775
+
776
+ /**
777
+ * Click pager binding
778
+ *
779
+ * @param e (event)
780
+ * - DOM event object
781
+ */
782
+ var clickPagerBind = function(e){
783
+ e.preventDefault();
784
+ if (slider.controls.el.hasClass('disabled')) {
785
+ return;
786
+ }
787
+ // if auto show is running, stop it
788
+ if(slider.settings.auto){ el.stopAuto(); }
789
+ var pagerLink = $(e.currentTarget);
790
+ if(pagerLink.attr('data-slide-index') !== undefined){
791
+ var pagerIndex = parseInt(pagerLink.attr('data-slide-index'));
792
+ // if clicked pager link is not active, continue with the goToSlide call
793
+ if(pagerIndex !== slider.active.index){ el.goToSlide(pagerIndex); }
794
+ }
795
+ };
796
+
797
+ /**
798
+ * Updates the pager links with an active class
799
+ *
800
+ * @param slideIndex (int)
801
+ * - index of slide to make active
802
+ */
803
+ var updatePagerActive = function(slideIndex){
804
+ // if "short" pager type
805
+ var len = slider.children.length; // nb of children
806
+ if(slider.settings.pagerType === 'short'){
807
+ if(slider.settings.maxSlides > 1){
808
+ len = Math.ceil(slider.children.length/slider.settings.maxSlides);
809
+ }
810
+ slider.pagerEl.html( (slideIndex + 1) + slider.settings.pagerShortSeparator + len);
811
+ return;
812
+ }
813
+ // remove all pager active classes
814
+ slider.pagerEl.find('a').removeClass('active');
815
+ // apply the active class for all pagers
816
+ slider.pagerEl.each(function(i, el){ $(el).find('a').eq(slideIndex).addClass('active'); });
817
+ };
818
+
819
+ /**
820
+ * Performs needed actions after a slide transition
821
+ */
822
+ var updateAfterSlideTransition = function(){
823
+ // if infinite loop is true
824
+ if(slider.settings.infiniteLoop){
825
+ var position = '';
826
+ // first slide
827
+ if(slider.active.index === 0){
828
+ // set the new position
829
+ position = slider.children.eq(0).position();
830
+ // carousel, last slide
831
+ }else if(slider.active.index === getPagerQty() - 1 && slider.carousel){
832
+ position = slider.children.eq((getPagerQty() - 1) * getMoveBy()).position();
833
+ // last slide
834
+ }else if(slider.active.index === slider.children.length - 1){
835
+ position = slider.children.eq(slider.children.length - 1).position();
836
+ }
837
+ if(position){
838
+ if(slider.settings.mode === 'horizontal'){ setPositionProperty(-position.left, 'reset', 0); }
839
+ else if(slider.settings.mode === 'vertical'){ setPositionProperty(-position.top, 'reset', 0); }
840
+ }
841
+ }
842
+ // declare that the transition is complete
843
+ slider.working = false;
844
+ // onSlideAfter callback
845
+ slider.settings.onSlideAfter(slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index);
846
+ };
847
+
848
+ /**
849
+ * Updates the auto controls state (either active, or combined switch)
850
+ *
851
+ * @param state (string) "start", "stop"
852
+ * - the new state of the auto show
853
+ */
854
+ var updateAutoControls = function(state){
855
+ // if autoControlsCombine is true, replace the current control with the new state
856
+ if(slider.settings.autoControlsCombine){
857
+ slider.controls.autoEl.html(slider.controls[state]);
858
+ // if autoControlsCombine is false, apply the "active" class to the appropriate control
859
+ }else{
860
+ slider.controls.autoEl.find('a').removeClass('active');
861
+ slider.controls.autoEl.find('a:not(.bx-' + state + ')').addClass('active');
862
+ }
863
+ };
864
+
865
+ /**
866
+ * Updates the direction controls (checks if either should be hidden)
867
+ */
868
+ var updateDirectionControls = function(){
869
+ if(getPagerQty() === 1){
870
+ slider.controls.prev.addClass('disabled');
871
+ slider.controls.next.addClass('disabled');
872
+ }else if(!slider.settings.infiniteLoop && slider.settings.hideControlOnEnd){
873
+ // if first slide
874
+ if(slider.active.index === 0){
875
+ slider.controls.prev.addClass('disabled');
876
+ slider.controls.next.removeClass('disabled');
877
+ // if last slide
878
+ }else if(slider.active.index === getPagerQty() - 1){
879
+ slider.controls.next.addClass('disabled');
880
+ slider.controls.prev.removeClass('disabled');
881
+ // if any slide in the middle
882
+ }else{
883
+ slider.controls.prev.removeClass('disabled');
884
+ slider.controls.next.removeClass('disabled');
885
+ }
886
+ }
887
+ };
888
+
889
+ /**
890
+ * Initializes the auto process
891
+ */
892
+ var initAuto = function(){
893
+ // if autoDelay was supplied, launch the auto show using a setTimeout() call
894
+ if(slider.settings.autoDelay > 0){
895
+ var timeout = setTimeout(el.startAuto, slider.settings.autoDelay);
896
+ // if autoDelay was not supplied, start the auto show normally
897
+ }else{
898
+ el.startAuto();
899
+
900
+ //add focus and blur events to ensure its running if timeout gets paused
901
+ $(window).focus(function() {
902
+ el.startAuto();
903
+ }).blur(function() {
904
+ el.stopAuto();
905
+ });
906
+
907
+
908
+ }
909
+ // if autoHover is requested
910
+ if(slider.settings.autoHover){
911
+ // on el hover
912
+ el.hover(function(){
913
+ // if the auto show is currently playing (has an active interval)
914
+ if(slider.interval){
915
+ // stop the auto show and pass true argument which will prevent control update
916
+ el.stopAuto(true);
917
+ // create a new autoPaused value which will be used by the relative "mouseout" event
918
+ slider.autoPaused = true;
919
+ }
920
+ }, function(){
921
+ // if the autoPaused value was created be the prior "mouseover" event
922
+ if(slider.autoPaused){
923
+ // start the auto show and pass true argument which will prevent control update
924
+ el.startAuto(true);
925
+ // reset the autoPaused value
926
+ slider.autoPaused = null;
927
+ }
928
+ });
929
+ }
930
+ };
931
+
932
+ /**
933
+ * Initializes the ticker process
934
+ */
935
+ var initTicker = function(){
936
+ var startPosition = 0;
937
+ // if autoDirection is "next", append a clone of the entire slider
938
+ if(slider.settings.autoDirection === 'next'){
939
+ el.append(slider.children.clone().addClass('bx-clone'));
940
+ // if autoDirection is "prev", prepend a clone of the entire slider, and set the left position
941
+ }else{
942
+ el.prepend(slider.children.clone().addClass('bx-clone'));
943
+ var position = slider.children.first().position();
944
+ startPosition = slider.settings.mode === 'horizontal' ? -position.left : -position.top;
945
+ }
946
+ setPositionProperty(startPosition, 'reset', 0);
947
+ // do not allow controls in ticker mode
948
+ slider.settings.pager = false;
949
+ slider.settings.controls = false;
950
+ slider.settings.autoControls = false;
951
+ // if autoHover is requested
952
+ if(slider.settings.tickerHover){
953
+ if(slider.usingCSS){
954
+ var value;
955
+ var idx = slider.settings.mode == 'horizontal' ? 4 : 5;
956
+ slider.viewport.hover(function(){
957
+ var transform = el.css('-' + slider.cssPrefix + '-transform');
958
+ value = parseFloat(transform.split(',')[idx]);
959
+ setPositionProperty(value, 'reset', 0);
960
+ }, function(){
961
+ var totalDimens = 0;
962
+ slider.children.each(function(index){
963
+ totalDimens += slider.settings.mode == 'horizontal' ? $(this).outerWidth(true) : $(this).outerHeight(true);
964
+ });
965
+ // calculate the speed ratio (used to determine the new speed to finish the paused animation)
966
+ var ratio = slider.settings.speed / totalDimens;
967
+ // determine which property to use
968
+ var property = slider.settings.mode == 'horizontal' ? 'left' : 'top';
969
+ // calculate the new speed
970
+ var newSpeed = ratio * (totalDimens - (Math.abs(parseInt(value))));
971
+ tickerLoop(newSpeed);
972
+ });
973
+ } else {
974
+ // on el hover
975
+ slider.viewport.hover(function(){
976
+ el.stop();
977
+ }, function(){
978
+ // calculate the total width of children (used to calculate the speed ratio)
979
+ var totalDimens = 0;
980
+ slider.children.each(function(index){
981
+ totalDimens += slider.settings.mode == 'horizontal' ? $(this).outerWidth(true) : $(this).outerHeight(true);
982
+ });
983
+ // calculate the speed ratio (used to determine the new speed to finish the paused animation)
984
+ var ratio = slider.settings.speed / totalDimens;
985
+ // determine which property to use
986
+ var property = slider.settings.mode == 'horizontal' ? 'left' : 'top';
987
+ // calculate the new speed
988
+ var newSpeed = ratio * (totalDimens - (Math.abs(parseInt(el.css(property)))));
989
+ tickerLoop(newSpeed);
990
+ });
991
+ }
992
+ }
993
+ // start the ticker loop
994
+ tickerLoop();
995
+ };
996
+
997
+ /**
998
+ * Runs a continuous loop, news ticker-style
999
+ */
1000
+ var tickerLoop = function(resumeSpeed){
1001
+ speed = resumeSpeed ? resumeSpeed : slider.settings.speed;
1002
+ var position = {left: 0, top: 0};
1003
+ var reset = {left: 0, top: 0};
1004
+ // if "next" animate left position to last child, then reset left to 0
1005
+ if(slider.settings.autoDirection === 'next'){
1006
+ position = el.find('.bx-clone').first().position();
1007
+ // if "prev" animate left position to 0, then reset left to first non-clone child
1008
+ }else{
1009
+ reset = slider.children.first().position();
1010
+ }
1011
+ var animateProperty = slider.settings.mode === 'horizontal' ? -position.left : -position.top;
1012
+ var resetValue = slider.settings.mode === 'horizontal' ? -reset.left : -reset.top;
1013
+ var params = {resetValue: resetValue};
1014
+ setPositionProperty(animateProperty, 'ticker', speed, params);
1015
+ };
1016
+
1017
+ /**
1018
+ * Check if el is on screen
1019
+ */
1020
+ var isOnScreen = function(el){
1021
+ var win = $(window);
1022
+ var viewport = {
1023
+ top : win.scrollTop(),
1024
+ left : win.scrollLeft()
1025
+ };
1026
+ viewport.right = viewport.left + win.width();
1027
+ viewport.bottom = viewport.top + win.height();
1028
+
1029
+ var bounds = el.offset();
1030
+ bounds.right = bounds.left + el.outerWidth();
1031
+ bounds.bottom = bounds.top + el.outerHeight();
1032
+
1033
+ return (!(viewport.right < bounds.left || viewport.left > bounds.right || viewport.bottom < bounds.top || viewport.top > bounds.bottom));
1034
+ };
1035
+
1036
+ /**
1037
+ * Initializes keyboard events
1038
+ */
1039
+ var keyPress = function(e){
1040
+ var activeElementTag = document.activeElement.tagName.toLowerCase();
1041
+ var tagFilters='input|textarea';
1042
+ var p = new RegExp(activeElementTag,["i"]);
1043
+ var result = p.exec(tagFilters);
1044
+ if (result == null && isOnScreen(el)) {
1045
+ if (e.keyCode == 39) {
1046
+ clickNextBind(e);
1047
+ return false;
1048
+ }
1049
+ else if (e.keyCode == 37) {
1050
+ clickPrevBind(e);
1051
+ return false;
1052
+ }
1053
+ }
1054
+ };
1055
+
1056
+ /**
1057
+ * Initializes touch events
1058
+ */
1059
+ var initTouch = function(){
1060
+ // initialize object to contain all touch values
1061
+ slider.touch = {
1062
+ start: {x: 0, y: 0},
1063
+ end: {x: 0, y: 0}
1064
+ };
1065
+ slider.viewport.bind('touchstart MSPointerDown pointerdown', onTouchStart);
1066
+
1067
+ //for browsers that have implemented pointer events and fire a click after
1068
+ //every pointerup regardless of whether pointerup is on same screen location as pointerdown or not
1069
+ slider.viewport.on('click', '.bxslider a', function(e) {
1070
+ if (slider.viewport.hasClass('click-disabled')) {
1071
+ e.preventDefault();
1072
+ slider.viewport.removeClass('click-disabled');
1073
+ }
1074
+ });
1075
+ };
1076
+
1077
+ /**
1078
+ * Event handler for "touchstart"
1079
+ *
1080
+ * @param e (event)
1081
+ * - DOM event object
1082
+ */
1083
+ var onTouchStart = function(e){
1084
+ //disable slider controls while user is interacting with slides to avoid slider freeze that happens on touch devices when a slide swipe happens immediately after interacting with slider controls
1085
+ slider.controls.el.addClass('disabled');
1086
+
1087
+ if(slider.working){
1088
+ e.preventDefault();
1089
+ slider.controls.el.removeClass('disabled');
1090
+ }else{
1091
+ // record the original position when touch starts
1092
+ slider.touch.originalPos = el.position();
1093
+ var orig = e.originalEvent;
1094
+ var touchPoints = (typeof orig.changedTouches != 'undefined') ? orig.changedTouches : [orig];
1095
+ // record the starting touch x, y coordinates
1096
+ slider.touch.start.x = touchPoints[0].pageX;
1097
+ slider.touch.start.y = touchPoints[0].pageY;
1098
+
1099
+ if (slider.viewport.get(0).setPointerCapture) {
1100
+ slider.pointerId = orig.pointerId;
1101
+ slider.viewport.get(0).setPointerCapture(slider.pointerId);
1102
+ }
1103
+ // bind a "touchmove" event to the viewport
1104
+ slider.viewport.bind('touchmove MSPointerMove pointermove', onTouchMove);
1105
+ // bind a "touchend" event to the viewport
1106
+ slider.viewport.bind('touchend MSPointerUp pointerup', onTouchEnd);
1107
+ slider.viewport.bind('MSPointerCancel pointercancel', onPointerCancel);
1108
+ }
1109
+ };
1110
+
1111
+ /**
1112
+ * Cancel Pointer for Windows Phone
1113
+ *
1114
+ * @param e (event)
1115
+ * - DOM event object
1116
+ */
1117
+ var onPointerCancel = function(e) {
1118
+ /* onPointerCancel handler is needed to deal with situations when a touchend
1119
+ doesn't fire after a touchstart (this happens on windows phones only) */
1120
+ setPositionProperty(slider.touch.originalPos.left, 'reset', 0);
1121
+
1122
+ //remove handlers
1123
+ slider.controls.el.removeClass('disabled');
1124
+ slider.viewport.unbind('MSPointerCancel pointercancel', onPointerCancel);
1125
+ slider.viewport.unbind('touchmove MSPointerMove pointermove', onTouchMove);
1126
+ slider.viewport.unbind('touchend MSPointerUp pointerup', onTouchEnd);
1127
+ if (slider.viewport.get(0).releasePointerCapture) {
1128
+ slider.viewport.get(0).releasePointerCapture(slider.pointerId);
1129
+ }
1130
+ }
1131
+
1132
+ /**
1133
+ * Event handler for "touchmove"
1134
+ *
1135
+ * @param e (event)
1136
+ * - DOM event object
1137
+ */
1138
+ var onTouchMove = function(e){
1139
+ var orig = e.originalEvent;
1140
+ var touchPoints = (typeof orig.changedTouches != 'undefined') ? orig.changedTouches : [orig];
1141
+ // if scrolling on y axis, do not prevent default
1142
+ var xMovement = Math.abs(touchPoints[0].pageX - slider.touch.start.x);
1143
+ var yMovement = Math.abs(touchPoints[0].pageY - slider.touch.start.y);
1144
+ // x axis swipe
1145
+ if((xMovement * 3) > yMovement && slider.settings.preventDefaultSwipeX){
1146
+ e.preventDefault();
1147
+ // y axis swipe
1148
+ }else if((yMovement * 3) > xMovement && slider.settings.preventDefaultSwipeY){
1149
+ e.preventDefault();
1150
+ }
1151
+ if(slider.settings.mode !== 'fade' && slider.settings.oneToOneTouch){
1152
+ var value = 0, change = 0;
1153
+ // if horizontal, drag along x axis
1154
+ if(slider.settings.mode === 'horizontal'){
1155
+ change = touchPoints[0].pageX - slider.touch.start.x;
1156
+ value = slider.touch.originalPos.left + change;
1157
+ // if vertical, drag along y axis
1158
+ }else{
1159
+ change = touchPoints[0].pageY - slider.touch.start.y;
1160
+ value = slider.touch.originalPos.top + change;
1161
+ }
1162
+ setPositionProperty(value, 'reset', 0);
1163
+ }
1164
+ };
1165
+
1166
+ /**
1167
+ * Event handler for "touchend"
1168
+ *
1169
+ * @param e (event)
1170
+ * - DOM event object
1171
+ */
1172
+ var onTouchEnd = function(e){
1173
+ slider.viewport.unbind('touchmove MSPointerMove pointermove', onTouchMove);
1174
+ //enable slider controls as soon as user stops interacing with slides
1175
+ slider.controls.el.removeClass('disabled');
1176
+ var orig = e.originalEvent;
1177
+ var touchPoints = (typeof orig.changedTouches != 'undefined') ? orig.changedTouches : [orig];
1178
+ var value = 0;
1179
+ var distance = 0;
1180
+ // record end x, y positions
1181
+ slider.touch.end.x = touchPoints[0].pageX;
1182
+ slider.touch.end.y = touchPoints[0].pageY;
1183
+ // if fade mode, check if absolute x distance clears the threshold
1184
+ if(slider.settings.mode === 'fade'){
1185
+ distance = Math.abs(slider.touch.start.x - slider.touch.end.x);
1186
+ if(distance >= slider.settings.swipeThreshold){
1187
+ if(slider.touch.start.x > slider.touch.end.x){
1188
+ el.goToNextSlide();
1189
+ } else {
1190
+ el.goToPrevSlide();
1191
+ }
1192
+ el.stopAuto();
1193
+ }
1194
+ // not fade mode
1195
+ }else{
1196
+ // calculate distance and el's animate property
1197
+ if(slider.settings.mode === 'horizontal'){
1198
+ distance = slider.touch.end.x - slider.touch.start.x;
1199
+ value = slider.touch.originalPos.left;
1200
+ }else{
1201
+ distance = slider.touch.end.y - slider.touch.start.y;
1202
+ value = slider.touch.originalPos.top;
1203
+ }
1204
+ // if not infinite loop and first / last slide, do not attempt a slide transition
1205
+ if(!slider.settings.infiniteLoop && ((slider.active.index === 0 && distance > 0) || (slider.active.last && distance < 0))){
1206
+ setPositionProperty(value, 'reset', 200);
1207
+ }else{
1208
+ // check if distance clears threshold
1209
+ if(Math.abs(distance) >= slider.settings.swipeThreshold){
1210
+ if(distance < 0){
1211
+ el.goToNextSlide();
1212
+ } else {
1213
+ el.goToPrevSlide();
1214
+ }
1215
+ el.stopAuto();
1216
+ }else{
1217
+ // el.animate(property, 200);
1218
+ setPositionProperty(value, 'reset', 200);
1219
+ }
1220
+ }
1221
+ }
1222
+ slider.viewport.unbind('touchend MSPointerUp pointerup', onTouchEnd);
1223
+ if (slider.viewport.get(0).releasePointerCapture) {
1224
+ slider.viewport.get(0).releasePointerCapture(slider.pointerId);
1225
+ }
1226
+ };
1227
+
1228
+ /**
1229
+ * Window resize event callback
1230
+ */
1231
+ var resizeWindow = function(e){
1232
+ // don't do anything if slider isn't initialized.
1233
+ if(!slider.initialized){ return; }
1234
+ // Delay if slider working.
1235
+ if (slider.working) {
1236
+ window.setTimeout(resizeWindow, 10);
1237
+ } else {
1238
+ // get the new window dimens (again, thank you IE)
1239
+ var windowWidthNew = $(window).width();
1240
+ var windowHeightNew = $(window).height();
1241
+ // make sure that it is a true window resize
1242
+ // *we must check this because our dinosaur friend IE fires a window resize event when certain DOM elements
1243
+ // are resized. Can you just die already?*
1244
+ if(windowWidth !== windowWidthNew || windowHeight !== windowHeightNew){
1245
+ // set the new window dimens
1246
+ windowWidth = windowWidthNew;
1247
+ windowHeight = windowHeightNew;
1248
+ // update all dynamic elements
1249
+ el.redrawSlider();
1250
+ // Call user resize handler
1251
+ slider.settings.onSliderResize.call(el, slider.active.index);
1252
+ }
1253
+ }
1254
+ };
1255
+
1256
+ /**
1257
+ * ===================================================================================
1258
+ * = PUBLIC FUNCTIONS
1259
+ * ===================================================================================
1260
+ */
1261
+
1262
+ /**
1263
+ * Performs slide transition to the specified slide
1264
+ *
1265
+ * @param slideIndex (int)
1266
+ * - the destination slide's index (zero-based)
1267
+ *
1268
+ * @param direction (string)
1269
+ * - INTERNAL USE ONLY - the direction of travel ("prev" / "next")
1270
+ */
1271
+ el.goToSlide = function(slideIndex, direction){
1272
+ // if plugin is currently in motion, ignore request
1273
+ if(slider.working || slider.active.index === slideIndex){ return; }
1274
+ // declare that plugin is in motion
1275
+ slider.working = true;
1276
+ // store the old index
1277
+ slider.oldIndex = slider.active.index;
1278
+ // if slideIndex is less than zero, set active index to last child (this happens during infinite loop)
1279
+ if(slideIndex < 0){
1280
+ slider.active.index = getPagerQty() - 1;
1281
+ // if slideIndex is greater than children length, set active index to 0 (this happens during infinite loop)
1282
+ }else if(slideIndex >= getPagerQty()){
1283
+ slider.active.index = 0;
1284
+ // set active index to requested slide
1285
+ }else{
1286
+ slider.active.index = slideIndex;
1287
+ }
1288
+ // onSlideBefore, onSlideNext, onSlidePrev callbacks
1289
+ // Allow transition canceling based on returned value
1290
+ var performTransition = true;
1291
+
1292
+ performTransition = slider.settings.onSlideBefore(slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index);
1293
+
1294
+ if ( typeof(performTransition) !== "undefined" && !performTransition ) {
1295
+ slider.active.index = slider.oldIndex; // restore old index
1296
+ slider.working = false; // is not in motion
1297
+ return;
1298
+ }
1299
+ if(direction === 'next'){
1300
+ // Prevent canceling in future functions or lack there-of from negating previous commands to cancel
1301
+ if(!slider.settings.onSlideNext(slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index)){
1302
+ performTransition = false;
1303
+ }
1304
+ }else if(direction === 'prev'){
1305
+ // Prevent canceling in future functions or lack there-of from negating previous commands to cancel
1306
+ if(!slider.settings.onSlidePrev(slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index)){
1307
+ performTransition = false;
1308
+ }
1309
+ }
1310
+
1311
+ // If transitions canceled, reset and return
1312
+ if ( typeof(performTransition) !== "undefined" && !performTransition ) {
1313
+ slider.active.index = slider.oldIndex; // restore old index
1314
+ slider.working = false; // is not in motion
1315
+ return;
1316
+ }
1317
+
1318
+ // check if last slide
1319
+ slider.active.last = slider.active.index >= getPagerQty() - 1;
1320
+ // update the pager with active class
1321
+ if(slider.settings.pager || slider.settings.pagerCustom){ updatePagerActive(slider.active.index); }
1322
+ // // check for direction control update
1323
+ if(slider.settings.controls){ updateDirectionControls(); }
1324
+ // if slider is set to mode: "fade"
1325
+ if(slider.settings.mode === 'fade'){
1326
+ // if adaptiveHeight is true and next height is different from current height, animate to the new height
1327
+ if(slider.settings.adaptiveHeight && slider.viewport.height() !== getViewportHeight()){
1328
+ slider.viewport.animate({height: getViewportHeight()}, slider.settings.adaptiveHeightSpeed);
1329
+ }
1330
+ // fade out the visible child and reset its z-index value
1331
+ slider.children.filter(':visible').fadeOut(slider.settings.speed).css({zIndex: 0});
1332
+ // fade in the newly requested slide
1333
+ slider.children.eq(slider.active.index).css('zIndex', slider.settings.slideZIndex+1).fadeIn(slider.settings.speed, function(){
1334
+ $(this).css('zIndex', slider.settings.slideZIndex);
1335
+ updateAfterSlideTransition();
1336
+ });
1337
+ // slider mode is not "fade"
1338
+ }else{
1339
+ // if adaptiveHeight is true and next height is different from current height, animate to the new height
1340
+ if(slider.settings.adaptiveHeight && slider.viewport.height() !== getViewportHeight()){
1341
+ slider.viewport.animate({height: getViewportHeight()}, slider.settings.adaptiveHeightSpeed);
1342
+ }
1343
+ var moveBy = 0;
1344
+ var position = {left: 0, top: 0};
1345
+ var lastChild = null;
1346
+ // if carousel and not infinite loop
1347
+ if(!slider.settings.infiniteLoop && slider.carousel && slider.active.last){
1348
+ if(slider.settings.mode === 'horizontal'){
1349
+ // get the last child position
1350
+ lastChild = slider.children.eq(slider.children.length - 1);
1351
+ position = lastChild.position();
1352
+ // calculate the position of the last slide
1353
+ moveBy = slider.viewport.width() - lastChild.outerWidth();
1354
+ }else{
1355
+ // get last showing index position
1356
+ var lastShowingIndex = slider.children.length - slider.settings.minSlides;
1357
+ position = slider.children.eq(lastShowingIndex).position();
1358
+ }
1359
+ // horizontal carousel, going previous while on first slide (infiniteLoop mode)
1360
+ }else if(slider.carousel && slider.active.last && direction === 'prev'){
1361
+ // get the last child position
1362
+ var eq = slider.settings.moveSlides === 1 ? slider.settings.maxSlides - getMoveBy() : ((getPagerQty() - 1) * getMoveBy()) - (slider.children.length - slider.settings.maxSlides);
1363
+ lastChild = el.children('.bx-clone').eq(eq);
1364
+ position = lastChild.position();
1365
+ // if infinite loop and "Next" is clicked on the last slide
1366
+ }else if(direction === 'next' && slider.active.index === 0){
1367
+ // get the last clone position
1368
+ position = el.find('> .bx-clone').eq(slider.settings.maxSlides).position();
1369
+ slider.active.last = false;
1370
+ // normal non-zero requests
1371
+ }else if(slideIndex >= 0){
1372
+ var requestEl = slideIndex * getMoveBy();
1373
+ position = slider.children.eq(requestEl).position();
1374
+ }
1375
+
1376
+
1377
+ /* If the position doesn't exist
1378
+ * (e.g. if you destroy the slider on a next click),
1379
+ * it doesn't throw an error.
1380
+ */
1381
+ if("undefined" !== typeof(position)){
1382
+ var value = slider.settings.mode === 'horizontal' ? -(position.left - moveBy) : -position.top;
1383
+ // plugin values to be animated
1384
+ setPositionProperty(value, 'slide', slider.settings.speed);
1385
+ }
1386
+ }
1387
+ };
1388
+
1389
+ /**
1390
+ * Transitions to the next slide in the show
1391
+ */
1392
+ el.goToNextSlide = function(){
1393
+ // if infiniteLoop is false and last page is showing, disregard call
1394
+ if(!slider.settings.infiniteLoop && slider.active.last){ return; }
1395
+ var pagerIndex = parseInt(slider.active.index) + 1;
1396
+ el.goToSlide(pagerIndex, 'next');
1397
+ };
1398
+
1399
+ /**
1400
+ * Transitions to the prev slide in the show
1401
+ */
1402
+ el.goToPrevSlide = function(){
1403
+ // if infiniteLoop is false and last page is showing, disregard call
1404
+ if(!slider.settings.infiniteLoop && slider.active.index === 0){ return; }
1405
+ var pagerIndex = parseInt(slider.active.index) - 1;
1406
+ el.goToSlide(pagerIndex, 'prev');
1407
+ };
1408
+
1409
+ /**
1410
+ * Starts the auto show
1411
+ *
1412
+ * @param preventControlUpdate (boolean)
1413
+ * - if true, auto controls state will not be updated
1414
+ */
1415
+ el.startAuto = function(preventControlUpdate){
1416
+ // if an interval already exists, disregard call
1417
+ if(slider.interval){ return; }
1418
+ // create an interval
1419
+ slider.interval = setInterval(function(){
1420
+ if(slider.settings.autoDirection === 'next'){
1421
+ el.goToNextSlide();
1422
+ }else{
1423
+ el.goToPrevSlide();
1424
+ }
1425
+ }, slider.settings.pause);
1426
+ // if auto controls are displayed and preventControlUpdate is not true
1427
+ if(slider.settings.autoControls && preventControlUpdate !== true){ updateAutoControls('stop'); }
1428
+ };
1429
+
1430
+ /**
1431
+ * Stops the auto show
1432
+ *
1433
+ * @param preventControlUpdate (boolean)
1434
+ * - if true, auto controls state will not be updated
1435
+ */
1436
+ el.stopAuto = function(preventControlUpdate){
1437
+ // if no interval exists, disregard call
1438
+ if(!slider.interval){ return; }
1439
+ // clear the interval
1440
+ clearInterval(slider.interval);
1441
+ slider.interval = null;
1442
+ // if auto controls are displayed and preventControlUpdate is not true
1443
+ if(slider.settings.autoControls && preventControlUpdate !== true){ updateAutoControls('start'); }
1444
+ };
1445
+
1446
+ /**
1447
+ * Returns current slide index (zero-based)
1448
+ */
1449
+ el.getCurrentSlide = function(){
1450
+ return slider.active.index;
1451
+ };
1452
+
1453
+ /**
1454
+ * Returns current slide element
1455
+ */
1456
+ el.getCurrentSlideElement = function(){
1457
+ return slider.children.eq(slider.active.index);
1458
+ };
1459
+
1460
+ /**
1461
+ * Returns number of slides in show
1462
+ */
1463
+ el.getSlideCount = function(){
1464
+ return slider.children.length;
1465
+ };
1466
+
1467
+ /**
1468
+ * Return slider.working variable
1469
+ */
1470
+ el.isWorking = function() {
1471
+ return slider.working;
1472
+ }
1473
+
1474
+ /**
1475
+ * Update all dynamic slider elements
1476
+ */
1477
+ el.redrawSlider = function(){
1478
+ // resize all children in ratio to new screen size
1479
+ slider.children.add(el.find('.bx-clone')).outerWidth(getSlideWidth());
1480
+ // adjust the height
1481
+ slider.viewport.css('height', getViewportHeight());
1482
+ // update the slide position
1483
+ if(!slider.settings.ticker) { setSlidePosition(); }
1484
+ // if active.last was true before the screen resize, we want
1485
+ // to keep it last no matter what screen size we end on
1486
+ if (slider.active.last) { slider.active.index = getPagerQty() - 1; }
1487
+ // if the active index (page) no longer exists due to the resize, simply set the index as last
1488
+ if (slider.active.index >= getPagerQty()) { slider.active.last = true; }
1489
+ // if a pager is being displayed and a custom pager is not being used, update it
1490
+ if(slider.settings.pager && !slider.settings.pagerCustom){
1491
+ populatePager();
1492
+ updatePagerActive(slider.active.index);
1493
+ }
1494
+ };
1495
+
1496
+ /**
1497
+ * Destroy the current instance of the slider (revert everything back to original state)
1498
+ */
1499
+ el.destroySlider = function(){
1500
+ // don't do anything if slider has already been destroyed
1501
+ if(!slider.initialized){ return; }
1502
+ slider.initialized = false;
1503
+ $('.bx-clone', this).remove();
1504
+ slider.children.each(function(){
1505
+ if($(this).data("origStyle") !== undefined){
1506
+ $(this).attr("style", $(this).data("origStyle"));
1507
+ } else {
1508
+ $(this).removeAttr('style');
1509
+ }
1510
+ });
1511
+ if($(this).data("origStyle") !== undefined){
1512
+ this.attr("style", $(this).data("origStyle"));
1513
+ } else {
1514
+ $(this).removeAttr('style');
1515
+ }
1516
+ $(this).unwrap().unwrap();
1517
+ if(slider.controls.el){ slider.controls.el.remove(); }
1518
+ if(slider.controls.next){ slider.controls.next.remove(); }
1519
+ if(slider.controls.prev){ slider.controls.prev.remove(); }
1520
+ if(slider.pagerEl && slider.settings.controls && !slider.settings.pagerCustom){ slider.pagerEl.remove(); }
1521
+ $('.bx-caption', this).remove();
1522
+ if(slider.controls.autoEl){ slider.controls.autoEl.remove(); }
1523
+ clearInterval(slider.interval);
1524
+ if(slider.settings.responsive){ $(window).unbind('resize', resizeWindow); }
1525
+ if(slider.settings.keyboardEnabled){ $(document).unbind('keydown', keyPress); }
1526
+ };
1527
+
1528
+ /**
1529
+ * Reload the slider (revert all DOM changes, and re-initialize)
1530
+ */
1531
+ el.reloadSlider = function(settings){
1532
+ if(settings !== undefined){ options = settings; }
1533
+ el.destroySlider();
1534
+ init();
1535
+ };
1536
+
1537
+ init();
1538
+
1539
+ // returns the current jQuery object
1540
+ return this;
1541
+ };
1542
+
1543
+ })(jQuery);
includes/libraries/bxslider-4/src/less/jquery.bxslider.less ADDED
@@ -0,0 +1,207 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /***
2
+ * BxSlider v4.2.3 - Fully loaded, responsive content slider
3
+ * http://bxslider.com
4
+ *
5
+ * Written by: Steven Wanderski, 2014
6
+ * http://stevenwanderski.com
7
+ * (while drinking Belgian ales and listening to jazz)
8
+ *
9
+ * CEO and founder of bxCreative, LTD
10
+ * http://bxcreative.com
11
+ ***/
12
+
13
+
14
+ /** RESET AND LAYOUT
15
+ ===================================*/
16
+
17
+ .bx-wrapper {
18
+ position: relative;
19
+ margin: 0 auto 60px;
20
+ padding: 0;
21
+ *zoom: 1;
22
+ -ms-touch-action: pan-y;
23
+ touch-action: pan-y;
24
+ img {
25
+ max-width: 100%;
26
+ display: block;
27
+ }
28
+ }
29
+
30
+ .bxslider {
31
+ margin: 0;
32
+ padding: 0;
33
+ }
34
+
35
+ ul.bxslider {
36
+ list-style: none;
37
+ }
38
+
39
+ .bx-viewport {
40
+ /*fix other elements on the page moving (on Chrome)*/
41
+ -webkit-transform: translatez(0);
42
+ }
43
+
44
+ /** THEME
45
+ ===================================*/
46
+
47
+ .bx-wrapper {
48
+ -moz-box-shadow: 0 0 5px #ccc;
49
+ -webkit-box-shadow: 0 0 5px #ccc;
50
+ box-shadow: 0 0 5px #ccc;
51
+ border: 5px solid #fff;
52
+ background: #fff;
53
+ .bx-pager,
54
+ .bx-controls-auto {
55
+ position: absolute;
56
+ bottom: -30px;
57
+ width: 100%;
58
+ }
59
+ }
60
+
61
+ /* LOADER */
62
+ .bx-wrapper .bx-loading {
63
+ min-height: 50px;
64
+ background: url(images/bx_loader.gif) center center no-repeat #fff;
65
+ height: 100%;
66
+ width: 100%;
67
+ position: absolute;
68
+ top: 0;
69
+ left: 0;
70
+ z-index: 2000;
71
+ }
72
+
73
+ /* PAGER */
74
+ .bx-wrapper {
75
+ .bx-pager {
76
+ text-align: center;
77
+ font-size: .85em;
78
+ font-family: Arial;
79
+ font-weight: bold;
80
+ color: #666;
81
+ padding-top: 20px;
82
+ &.bx-default-pager a {
83
+ background: #666;
84
+ text-indent: -9999px;
85
+ display: block;
86
+ width: 10px;
87
+ height: 10px;
88
+ margin: 0 5px;
89
+ outline: 0;
90
+ -moz-border-radius: 5px;
91
+ -webkit-border-radius: 5px;
92
+ border-radius: 5px;
93
+ &:hover,
94
+ &.active,
95
+ &:focus {
96
+ background: #000;
97
+ }
98
+ }
99
+ }
100
+ .bx-pager-item,
101
+ .bx-controls-auto .bx-controls-auto-item {
102
+ display: inline-block;
103
+ *zoom: 1;
104
+ *display: inline;
105
+ }
106
+ .bx-pager-item {
107
+ font-size: 0;
108
+ line-height: 0;
109
+ }
110
+ }
111
+
112
+ /* DIRECTION CONTROLS (NEXT / PREV) */
113
+ .bx-wrapper {
114
+ .bx-prev {
115
+ left: 10px;
116
+ background: url(images/controls.png) no-repeat 0 -32px;
117
+ &:hover,
118
+ &:focus {
119
+ background-position: 0 0;
120
+ }
121
+ }
122
+ .bx-next {
123
+ right: 10px;
124
+ background: url(images/controls.png) no-repeat -43px -32px;
125
+ &:hover,
126
+ &:focus {
127
+ background-position: -43px 0;
128
+ }
129
+ }
130
+ .bx-controls-direction a {
131
+ position: absolute;
132
+ top: 50%;
133
+ margin-top: -16px;
134
+ outline: 0;
135
+ width: 32px;
136
+ height: 32px;
137
+ text-indent: -9999px;
138
+ z-index: 9999;
139
+ &.disabled {
140
+ display: none;
141
+ }
142
+ }
143
+ }
144
+
145
+ /* AUTO CONTROLS (START / STOP) */
146
+ .bx-wrapper .bx-controls-auto {
147
+ text-align: center;
148
+ .bx-start {
149
+ display: block;
150
+ text-indent: -9999px;
151
+ width: 10px;
152
+ height: 11px;
153
+ outline: 0;
154
+ background: url(images/controls.png) -86px -11px no-repeat;
155
+ margin: 0 3px;
156
+ &:hover,
157
+ &.active,
158
+ &:focus {
159
+ background-position: -86px 0;
160
+ }
161
+ }
162
+ .bx-stop {
163
+ display: block;
164
+ text-indent: -9999px;
165
+ width: 9px;
166
+ height: 11px;
167
+ outline: 0;
168
+ background: url(images/controls.png) -86px -44px no-repeat;
169
+ margin: 0 3px;
170
+ &:hover,
171
+ &.active,
172
+ &:focus {
173
+ background-position: -86px -33px;
174
+ }
175
+ }
176
+ }
177
+
178
+ /* PAGER WITH AUTO-CONTROLS HYBRID LAYOUT */
179
+ .bx-wrapper {
180
+ .bx-controls.bx-has-controls-auto.bx-has-pager {
181
+ .bx-pager {
182
+ text-align: left;
183
+ width: 80%;
184
+ }
185
+ .bx-controls-auto {
186
+ right: 0;
187
+ width: 35px;
188
+ }
189
+ }
190
+ }
191
+
192
+ /* IMAGE CAPTIONS */
193
+ .bx-wrapper .bx-caption {
194
+ position: absolute;
195
+ bottom: 0;
196
+ left: 0;
197
+ background: #666;
198
+ background: rgba(80, 80, 80, 0.75);
199
+ width: 100%;
200
+ span {
201
+ color: #fff;
202
+ font-family: Arial;
203
+ display: block;
204
+ font-size: .85em;
205
+ padding: 10px;
206
+ }
207
+ }
includes/libraries/bxslider-4/src/vendor/jquery.easing.1.3.js ADDED
@@ -0,0 +1,205 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
3
+ *
4
+ * Uses the built in easing capabilities added In jQuery 1.1
5
+ * to offer multiple easing options
6
+ *
7
+ * TERMS OF USE - jQuery Easing
8
+ *
9
+ * Open source under the BSD License.
10
+ *
11
+ * Copyright © 2008 George McGinley Smith
12
+ * All rights reserved.
13
+ *
14
+ * Redistribution and use in source and binary forms, with or without modification,
15
+ * are permitted provided that the following conditions are met:
16
+ *
17
+ * Redistributions of source code must retain the above copyright notice, this list of
18
+ * conditions and the following disclaimer.
19
+ * Redistributions in binary form must reproduce the above copyright notice, this list
20
+ * of conditions and the following disclaimer in the documentation and/or other materials
21
+ * provided with the distribution.
22
+ *
23
+ * Neither the name of the author nor the names of contributors may be used to endorse
24
+ * or promote products derived from this software without specific prior written permission.
25
+ *
26
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
27
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
28
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
29
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
31
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
32
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
33
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
34
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
35
+ *
36
+ */
37
+
38
+ // t: current time, b: begInnIng value, c: change In value, d: duration
39
+ jQuery.easing['jswing'] = jQuery.easing['swing'];
40
+
41
+ jQuery.extend( jQuery.easing,
42
+ {
43
+ def: 'easeOutQuad',
44
+ swing: function (x, t, b, c, d) {
45
+ //alert(jQuery.easing.default);
46
+ return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
47
+ },
48
+ easeInQuad: function (x, t, b, c, d) {
49
+ return c*(t/=d)*t + b;
50
+ },
51
+ easeOutQuad: function (x, t, b, c, d) {
52
+ return -c *(t/=d)*(t-2) + b;
53
+ },
54
+ easeInOutQuad: function (x, t, b, c, d) {
55
+ if ((t/=d/2) < 1) return c/2*t*t + b;
56
+ return -c/2 * ((--t)*(t-2) - 1) + b;
57
+ },
58
+ easeInCubic: function (x, t, b, c, d) {
59
+ return c*(t/=d)*t*t + b;
60
+ },
61
+ easeOutCubic: function (x, t, b, c, d) {
62
+ return c*((t=t/d-1)*t*t + 1) + b;
63
+ },
64
+ easeInOutCubic: function (x, t, b, c, d) {
65
+ if ((t/=d/2) < 1) return c/2*t*t*t + b;
66
+ return c/2*((t-=2)*t*t + 2) + b;
67
+ },
68
+ easeInQuart: function (x, t, b, c, d) {
69
+ return c*(t/=d)*t*t*t + b;
70
+ },
71
+ easeOutQuart: function (x, t, b, c, d) {
72
+ return -c * ((t=t/d-1)*t*t*t - 1) + b;
73
+ },
74
+ easeInOutQuart: function (x, t, b, c, d) {
75
+ if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
76
+ return -c/2 * ((t-=2)*t*t*t - 2) + b;
77
+ },
78
+ easeInQuint: function (x, t, b, c, d) {
79
+ return c*(t/=d)*t*t*t*t + b;
80
+ },
81
+ easeOutQuint: function (x, t, b, c, d) {
82
+ return c*((t=t/d-1)*t*t*t*t + 1) + b;
83
+ },
84
+ easeInOutQuint: function (x, t, b, c, d) {
85
+ if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
86
+ return c/2*((t-=2)*t*t*t*t + 2) + b;
87
+ },
88
+ easeInSine: function (x, t, b, c, d) {
89
+ return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
90
+ },
91
+ easeOutSine: function (x, t, b, c, d) {
92
+ return c * Math.sin(t/d * (Math.PI/2)) + b;
93
+ },
94
+ easeInOutSine: function (x, t, b, c, d) {
95
+ return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
96
+ },
97
+ easeInExpo: function (x, t, b, c, d) {
98
+ return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
99
+ },
100
+ easeOutExpo: function (x, t, b, c, d) {
101
+ return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
102
+ },
103
+ easeInOutExpo: function (x, t, b, c, d) {
104
+ if (t==0) return b;
105
+ if (t==d) return b+c;
106
+ if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
107
+ return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
108
+ },
109
+ easeInCirc: function (x, t, b, c, d) {
110
+ return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
111
+ },
112
+ easeOutCirc: function (x, t, b, c, d) {
113
+ return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
114
+ },
115
+ easeInOutCirc: function (x, t, b, c, d) {
116
+ if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
117
+ return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
118
+ },
119
+ easeInElastic: function (x, t, b, c, d) {
120
+ var s=1.70158;var p=0;var a=c;
121
+ if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
122
+ if (a < Math.abs(c)) { a=c; var s=p/4; }
123
+ else var s = p/(2*Math.PI) * Math.asin (c/a);
124
+ return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
125
+ },
126
+ easeOutElastic: function (x, t, b, c, d) {
127
+ var s=1.70158;var p=0;var a=c;
128
+ if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
129
+ if (a < Math.abs(c)) { a=c; var s=p/4; }
130
+ else var s = p/(2*Math.PI) * Math.asin (c/a);
131
+ return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
132
+ },
133
+ easeInOutElastic: function (x, t, b, c, d) {
134
+ var s=1.70158;var p=0;var a=c;
135
+ if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5);
136
+ if (a < Math.abs(c)) { a=c; var s=p/4; }
137
+ else var s = p/(2*Math.PI) * Math.asin (c/a);
138
+ if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
139
+ return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
140
+ },
141
+ easeInBack: function (x, t, b, c, d, s) {
142
+ if (s == undefined) s = 1.70158;
143
+ return c*(t/=d)*t*((s+1)*t - s) + b;
144
+ },
145
+ easeOutBack: function (x, t, b, c, d, s) {
146
+ if (s == undefined) s = 1.70158;
147
+ return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
148
+ },
149
+ easeInOutBack: function (x, t, b, c, d, s) {
150
+ if (s == undefined) s = 1.70158;
151
+ if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
152
+ return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
153
+ },
154
+ easeInBounce: function (x, t, b, c, d) {
155
+ return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
156
+ },
157
+ easeOutBounce: function (x, t, b, c, d) {
158
+ if ((t/=d) < (1/2.75)) {
159
+ return c*(7.5625*t*t) + b;
160
+ } else if (t < (2/2.75)) {
161
+ return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
162
+ } else if (t < (2.5/2.75)) {
163
+ return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
164
+ } else {
165
+ return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
166
+ }
167
+ },
168
+ easeInOutBounce: function (x, t, b, c, d) {
169
+ if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
170
+ return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
171
+ }
172
+ });
173
+
174
+ /*
175
+ *
176
+ * TERMS OF USE - EASING EQUATIONS
177
+ *
178
+ * Open source under the BSD License.
179
+ *
180
+ * Copyright © 2001 Robert Penner
181
+ * All rights reserved.
182
+ *
183
+ * Redistribution and use in source and binary forms, with or without modification,
184
+ * are permitted provided that the following conditions are met:
185
+ *
186
+ * Redistributions of source code must retain the above copyright notice, this list of
187
+ * conditions and the following disclaimer.
188
+ * Redistributions in binary form must reproduce the above copyright notice, this list
189
+ * of conditions and the following disclaimer in the documentation and/or other materials
190
+ * provided with the distribution.
191
+ *
192
+ * Neither the name of the author nor the names of contributors may be used to endorse
193
+ * or promote products derived from this software without specific prior written permission.
194
+ *
195
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
196
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
197
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
198
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
199
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
200
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
201
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
202
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
203
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
204
+ *
205
+ */
includes/libraries/bxslider-4/src/vendor/jquery.fitvids.js ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*global jQuery */
2
+ /*jshint multistr:true browser:true */
3
+ /*!
4
+ * FitVids 1.0
5
+ *
6
+ * Copyright 2011, Chris Coyier - http://css-tricks.com + Dave Rupert - http://daverupert.com
7
+ * Credit to Thierry Koblentz - http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/
8
+ * Released under the WTFPL license - http://sam.zoy.org/wtfpl/
9
+ *
10
+ * Date: Thu Sept 01 18:00:00 2011 -0500
11
+ */
12
+
13
+ (function( $ ){
14
+
15
+ "use strict";
16
+
17
+ $.fn.fitVids = function( options ) {
18
+ var settings = {
19
+ customSelector: null
20
+ };
21
+
22
+ var div = document.createElement('div'),
23
+ ref = document.getElementsByTagName('base')[0] || document.getElementsByTagName('script')[0];
24
+
25
+ div.className = 'fit-vids-style';
26
+ div.innerHTML = '&shy;<style> \
27
+ .fluid-width-video-wrapper { \
28
+ width: 100%; \
29
+ position: relative; \
30
+ padding: 0; \
31
+ } \
32
+ \
33
+ .fluid-width-video-wrapper iframe, \
34
+ .fluid-width-video-wrapper object, \
35
+ .fluid-width-video-wrapper embed { \
36
+ position: absolute; \
37
+ top: 0; \
38
+ left: 0; \
39
+ width: 100%; \
40
+ height: 100%; \
41
+ } \
42
+ </style>';
43
+
44
+ ref.parentNode.insertBefore(div,ref);
45
+
46
+ if ( options ) {
47
+ $.extend( settings, options );
48
+ }
49
+
50
+ return this.each(function(){
51
+ var selectors = [
52
+ "iframe[src*='player.vimeo.com']",
53
+ "iframe[src*='www.youtube.com']",
54
+ "iframe[src*='www.kickstarter.com']",
55
+ "object",
56
+ "embed"
57
+ ];
58
+
59
+ if (settings.customSelector) {
60
+ selectors.push(settings.customSelector);
61
+ }
62
+
63
+ var $allVideos = $(this).find(selectors.join(','));
64
+
65
+ $allVideos.each(function(){
66
+ var $this = $(this);
67
+ if (this.tagName.toLowerCase() === 'embed' && $this.parent('object').length || $this.parent('.fluid-width-video-wrapper').length) { return; }
68
+ var height = ( this.tagName.toLowerCase() === 'object' || ($this.attr('height') && !isNaN(parseInt($this.attr('height'), 10))) ) ? parseInt($this.attr('height'), 10) : $this.height(),
69
+ width = !isNaN(parseInt($this.attr('width'), 10)) ? parseInt($this.attr('width'), 10) : $this.width(),
70
+ aspectRatio = height / width;
71
+ if(!$this.attr('id')){
72
+ var videoID = 'fitvid' + Math.floor(Math.random()*999999);
73
+ $this.attr('id', videoID);
74
+ }
75
+ $this.wrap('<div class="fluid-width-video-wrapper"></div>').parent('.fluid-width-video-wrapper').css('padding-top', (aspectRatio * 100)+"%");
76
+ $this.removeAttr('height').removeAttr('width');
77
+ });
78
+ });
79
+ };
80
+ })( jQuery );
languages/testimonials-widget.pot CHANGED
@@ -2,9 +2,9 @@
2
  # This file is distributed under the same license as the Testimonials Widget package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Testimonials Widget 3.1.0\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/support/plugin/testimonials-widget\n"
7
- "POT-Creation-Date: 2015-04-29 22:19:07+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
2
  # This file is distributed under the same license as the Testimonials Widget package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Testimonials Widget 3.1.1\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/support/plugin/testimonials-widget\n"
7
+ "POT-Creation-Date: 2015-05-04 05:13:28+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
readme.txt CHANGED
@@ -5,7 +5,7 @@ Donate link: http://axelerant.com/about-axelerant/donate/
5
  Tags: axelerant, client, customer, portfolio, quote, quotes, random, recommendation, reference, review, reviews, slider, testimonial, testimonials, wpml
6
  Requires at least: 3.9.2
7
  Tested up to: 4.2.0
8
- Stable tag: 3.1.0
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
5
  Tags: axelerant, client, customer, portfolio, quote, quotes, random, recommendation, reference, review, reviews, slider, testimonial, testimonials, wpml
6
  Requires at least: 3.9.2
7
  Tested up to: 4.2.0
8
+ Stable tag: 3.1.1
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
testimonials-widget.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin URI: http://wordpress.org/plugins/testimonials-widget/
5
  * Description: Easily add social proofing to your website with Testimonials Widget. List or slide reviews via functions, shortcodes, or widgets.
6
  * lets you socially randomly slide or list selected portfolios, quotes, reviews, or text with images or videos on your WordPress site.
7
- * Version: 3.1.0
8
  * Author: Axelerant
9
  * Author URI: http://axelerant.com/
10
  * License: GPLv2 or later
@@ -64,7 +64,7 @@ if ( ! defined( 'TW_PREMIUM_LINK' ) ) {
64
  }
65
 
66
  if ( ! defined( 'TW_VERSION' ) ) {
67
- define( 'TW_VERSION', '3.1.0' );
68
  }
69
 
70
  require_once TW_DIR_INC . 'requirements.php';
4
  * Plugin URI: http://wordpress.org/plugins/testimonials-widget/
5
  * Description: Easily add social proofing to your website with Testimonials Widget. List or slide reviews via functions, shortcodes, or widgets.
6
  * lets you socially randomly slide or list selected portfolios, quotes, reviews, or text with images or videos on your WordPress site.
7
+ * Version: 3.1.1
8
  * Author: Axelerant
9
  * Author URI: http://axelerant.com/
10
  * License: GPLv2 or later
64
  }
65
 
66
  if ( ! defined( 'TW_VERSION' ) ) {
67
+ define( 'TW_VERSION', '3.1.1' );
68
  }
69
 
70
  require_once TW_DIR_INC . 'requirements.php';