Version Description
- Numerous bug fixes and enhancements with the new v2 launch!
Download this release
Release Info
Developer | griffinjt |
Plugin | Slider by Soliloquy – Responsive Image Slider for WordPress |
Version | 2.0.5 |
Comparing to | |
See all releases |
Code changes from version 2.0.4 to 2.0.5
- assets/css/soliloquy.css +15 -1
- assets/js/soliloquy-dev-holder.js +60 -29
- assets/js/soliloquy.js +1 -1
- includes/admin/editor.php +1 -1
- includes/admin/metaboxes.php +1 -6
- includes/global/shortcode.php +5 -2
- readme.txt +3 -0
- soliloquy-lite.php +2 -2
assets/css/soliloquy.css
CHANGED
@@ -40,7 +40,7 @@
|
|
40 |
.soliloquy-container {
|
41 |
position: relative;
|
42 |
background: transparent url('images/preloader.gif') no-repeat scroll 50% 50%;
|
43 |
-
z-index:
|
44 |
width: 100%;
|
45 |
max-width: 100%;
|
46 |
}
|
@@ -60,6 +60,16 @@
|
|
60 |
padding: 0;
|
61 |
list-style: none !important;
|
62 |
height: 100%;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
}
|
64 |
|
65 |
.soliloquy-clear {
|
@@ -96,6 +106,10 @@
|
|
96 |
display: none;
|
97 |
}
|
98 |
|
|
|
|
|
|
|
|
|
99 |
.soliloquy-container .soliloquy-item:after {
|
100 |
content: '.';
|
101 |
position: absolute;
|
40 |
.soliloquy-container {
|
41 |
position: relative;
|
42 |
background: transparent url('images/preloader.gif') no-repeat scroll 50% 50%;
|
43 |
+
z-index: 0;
|
44 |
width: 100%;
|
45 |
max-width: 100%;
|
46 |
}
|
60 |
padding: 0;
|
61 |
list-style: none !important;
|
62 |
height: 100%;
|
63 |
+
zoom: 1;
|
64 |
+
*zoom: 1;
|
65 |
+
}
|
66 |
+
|
67 |
+
.soliloquy-container .soliloquy-viewport {
|
68 |
+
-webkit-transform: translatez(0);
|
69 |
+
-moz-transform: translatez(0);
|
70 |
+
-ms-transform: translatez(0);
|
71 |
+
-o-transform: translatez(0);
|
72 |
+
transform: translatez(0);
|
73 |
}
|
74 |
|
75 |
.soliloquy-clear {
|
106 |
display: none;
|
107 |
}
|
108 |
|
109 |
+
.no-js .soliloquy-container .soliloquy-slides > li:first-child {
|
110 |
+
display: block;
|
111 |
+
}
|
112 |
+
|
113 |
.soliloquy-container .soliloquy-item:after {
|
114 |
content: '.';
|
115 |
position: absolute;
|
assets/js/soliloquy-dev-holder.js
CHANGED
@@ -4,6 +4,9 @@
|
|
4 |
|
5 |
var defaults = {
|
6 |
|
|
|
|
|
|
|
7 |
// GENERAL
|
8 |
mode: 'horizontal',
|
9 |
slideSelector: '',
|
@@ -23,6 +26,8 @@
|
|
23 |
useCSS: true,
|
24 |
preloadImages: 'visible',
|
25 |
responsive: true,
|
|
|
|
|
26 |
|
27 |
// TOUCH
|
28 |
touchEnabled: true,
|
@@ -50,7 +55,6 @@
|
|
50 |
stopText: 'Stop',
|
51 |
autoControlsCombine: false,
|
52 |
autoControlsSelector: null,
|
53 |
-
keyboard: false,
|
54 |
|
55 |
// AUTO
|
56 |
auto: false,
|
@@ -59,6 +63,7 @@
|
|
59 |
autoDirection: 'next',
|
60 |
autoHover: false,
|
61 |
autoDelay: 0,
|
|
|
62 |
|
63 |
// CAROUSEL
|
64 |
minSlides: 1,
|
@@ -71,7 +76,8 @@
|
|
71 |
onSlideBefore: function() {},
|
72 |
onSlideAfter: function() {},
|
73 |
onSlideNext: function() {},
|
74 |
-
onSlidePrev: function() {}
|
|
|
75 |
}
|
76 |
|
77 |
$.fn.soliloquy = function(options){
|
@@ -170,7 +176,7 @@
|
|
170 |
*/
|
171 |
var setup = function(){
|
172 |
// wrap el in a wrapper
|
173 |
-
el.wrap('<div class="
|
174 |
// store a namspace reference to .soliloquy-viewport
|
175 |
slider.viewport = el.parent();
|
176 |
// add a loading div to display while images are loading
|
@@ -226,7 +232,7 @@
|
|
226 |
display: 'none'
|
227 |
});
|
228 |
// prepare the z-index on the showing element
|
229 |
-
slider.children.eq(slider.settings.startSlide).css({zIndex:
|
230 |
}
|
231 |
// create an element to contain all slider controls (pager, start / stop, etc)
|
232 |
slider.controls.el = $('<div class="soliloquy-controls" />');
|
@@ -234,8 +240,7 @@
|
|
234 |
if(slider.settings.captions) appendCaptions();
|
235 |
// check if startSlide is last slide
|
236 |
slider.active.last = slider.settings.startSlide == getPagerQty() - 1;
|
237 |
-
//
|
238 |
-
if(slider.settings.video) el.soliloquyVids();
|
239 |
// set the default preload selector (visible)
|
240 |
var preloadSelector = slider.children.eq(slider.settings.startSlide);
|
241 |
if (slider.settings.preloadImages == "all") preloadSelector = slider.children;
|
@@ -300,8 +305,8 @@
|
|
300 |
slider.initialized = true;
|
301 |
// bind the resize call to the window
|
302 |
if (slider.settings.responsive) $(window).bind('resize', resizeWindow);
|
303 |
-
// if auto is true, start the show
|
304 |
-
if (slider.settings.auto && slider.settings.autoStart) initAuto();
|
305 |
// if ticker is true, start the ticker
|
306 |
if (slider.settings.ticker) initTicker();
|
307 |
// if pager is requested, make the appropriate pager link active
|
@@ -310,7 +315,8 @@
|
|
310 |
if (slider.settings.controls) updateDirectionControls();
|
311 |
// if touchEnabled is true, setup the touch events
|
312 |
if (slider.settings.touchEnabled && !slider.settings.ticker) initTouch();
|
313 |
-
|
|
|
314 |
if (slider.settings.keyboard && !slider.settings.ticker) {
|
315 |
$(document).on('keydown', function(e){
|
316 |
if (e.keyCode == 39) {
|
@@ -371,6 +377,14 @@
|
|
371 |
return $(this).outerHeight(false);
|
372 |
}).get());
|
373 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
374 |
return height;
|
375 |
}
|
376 |
|
@@ -427,8 +441,9 @@
|
|
427 |
slidesShowing = slider.settings.maxSlides;
|
428 |
// if viewport is between min / max thresholds, divide viewport width by first child width
|
429 |
}else{
|
430 |
-
var childWidth = slider.children.first().width();
|
431 |
-
slidesShowing = Math.floor(slider.viewport.width()
|
|
|
432 |
}
|
433 |
// if "vertical" mode, slides showing will always be minSlides
|
434 |
}else if(slider.settings.mode == 'vertical'){
|
@@ -445,7 +460,7 @@
|
|
445 |
// if moveSlides is specified by the user
|
446 |
if(slider.settings.moveSlides > 0){
|
447 |
if(slider.settings.infiniteLoop){
|
448 |
-
pagerQty = slider.children.length / getMoveBy();
|
449 |
}else{
|
450 |
// use a while loop to determine pages
|
451 |
var breakPoint = 0;
|
@@ -487,7 +502,7 @@
|
|
487 |
var lastChild = slider.children.last();
|
488 |
var position = lastChild.position();
|
489 |
// set the left position
|
490 |
-
setPositionProperty(-(position.left - (slider.viewport.width() - lastChild.
|
491 |
}else if(slider.settings.mode == 'vertical'){
|
492 |
// get the last showing index's position
|
493 |
var lastShowingIndex = slider.children.length - slider.settings.minSlides;
|
@@ -622,7 +637,7 @@
|
|
622 |
slider.pagerEl = $(slider.settings.pagerCustom);
|
623 |
}
|
624 |
// assign the pager click binding
|
625 |
-
slider.pagerEl.
|
626 |
}
|
627 |
|
628 |
/**
|
@@ -662,8 +677,8 @@
|
|
662 |
// add the controls to the DOM
|
663 |
slider.controls.autoEl = $('<div class="soliloquy-controls-auto" />');
|
664 |
// bind click actions to the controls
|
665 |
-
slider.controls.autoEl.
|
666 |
-
slider.controls.autoEl.
|
667 |
// if autoControlsCombine, insert only the "start" control
|
668 |
if(slider.settings.autoControlsCombine){
|
669 |
slider.controls.autoEl.append(slider.controls.start);
|
@@ -755,10 +770,12 @@
|
|
755 |
// if auto show is running, stop it
|
756 |
if (slider.settings.auto) el.stopAuto();
|
757 |
var pagerLink = $(e.currentTarget);
|
758 |
-
|
759 |
-
|
760 |
-
|
761 |
-
|
|
|
|
|
762 |
}
|
763 |
|
764 |
/**
|
@@ -801,12 +818,14 @@
|
|
801 |
}else if(slider.active.index == slider.children.length - 1){
|
802 |
position = slider.children.eq(slider.children.length - 1).position();
|
803 |
}
|
804 |
-
if
|
805 |
-
|
|
|
|
|
806 |
}
|
807 |
// declare that the transition is complete
|
808 |
slider.working = false;
|
809 |
-
//
|
810 |
if(slider.settings.mode == 'fade'){
|
811 |
slider.viewport.css({overflow:''});
|
812 |
}
|
@@ -1072,6 +1091,8 @@
|
|
1072 |
* Window resize event callback
|
1073 |
*/
|
1074 |
var resizeWindow = function(e){
|
|
|
|
|
1075 |
// get the new window dimens (again, thank you IE)
|
1076 |
var windowWidthNew = $(window).width();
|
1077 |
var windowHeightNew = $(window).height();
|
@@ -1084,6 +1105,8 @@
|
|
1084 |
windowHeight = windowHeightNew;
|
1085 |
// update all dynamic elements
|
1086 |
el.redrawSlider();
|
|
|
|
|
1087 |
}
|
1088 |
}
|
1089 |
|
@@ -1134,8 +1157,8 @@
|
|
1134 |
if(slider.settings.controls) updateDirectionControls();
|
1135 |
// if slider is set to mode: "fade"
|
1136 |
if(slider.settings.mode == 'fade'){
|
1137 |
-
//
|
1138 |
-
|
1139 |
// if adaptiveHeight is true and next height is different from current height, animate to the new height
|
1140 |
if(slider.settings.adaptiveHeight && slider.viewport.height() != getViewportHeight()){
|
1141 |
slider.viewport.animate({height: getViewportHeight()}, slider.settings.adaptiveHeightSpeed);
|
@@ -1143,8 +1166,8 @@
|
|
1143 |
// fade out the visible child and reset its z-index value
|
1144 |
slider.children.filter(':visible').fadeOut(slider.settings.speed).css({zIndex: 0});
|
1145 |
// fade in the newly requested slide
|
1146 |
-
slider.children.eq(slider.active.index).css('zIndex',
|
1147 |
-
$(this).css('zIndex',
|
1148 |
updateAfterSlideTransition();
|
1149 |
});
|
1150 |
// slider mode is not "fade"
|
@@ -1257,6 +1280,13 @@
|
|
1257 |
return slider.active.index;
|
1258 |
}
|
1259 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1260 |
/**
|
1261 |
* Returns number of slides in show
|
1262 |
*/
|
@@ -1269,7 +1299,7 @@
|
|
1269 |
*/
|
1270 |
el.redrawSlider = function(){
|
1271 |
// resize all children in ratio to new screen size
|
1272 |
-
slider.children.add(el.find('.soliloquy-clone')).
|
1273 |
// adjust the height
|
1274 |
slider.viewport.css('height', getViewportHeight());
|
1275 |
// update the slide position
|
@@ -1302,7 +1332,7 @@
|
|
1302 |
if(slider.controls.el) slider.controls.el.remove();
|
1303 |
if(slider.controls.next) slider.controls.next.remove();
|
1304 |
if(slider.controls.prev) slider.controls.prev.remove();
|
1305 |
-
if(slider.pagerEl) slider.pagerEl.remove();
|
1306 |
$('.soliloquy-caption', this).remove();
|
1307 |
if(slider.controls.autoEl) slider.controls.autoEl.remove();
|
1308 |
clearInterval(slider.interval);
|
@@ -1325,6 +1355,7 @@
|
|
1325 |
}
|
1326 |
|
1327 |
})(jQuery);
|
|
|
1328 |
// Video functions.
|
1329 |
function soliloquyYouTubeVids(data, id, width, height, holder, $){
|
1330 |
// Immediately make the holder visible and increase z-index to overlay the player icon.
|
4 |
|
5 |
var defaults = {
|
6 |
|
7 |
+
// Added by Thomas
|
8 |
+
keyboard: false,
|
9 |
+
|
10 |
// GENERAL
|
11 |
mode: 'horizontal',
|
12 |
slideSelector: '',
|
26 |
useCSS: true,
|
27 |
preloadImages: 'visible',
|
28 |
responsive: true,
|
29 |
+
slideZIndex: 50,
|
30 |
+
wrapperClass: 'soliloquy-wrapper',
|
31 |
|
32 |
// TOUCH
|
33 |
touchEnabled: true,
|
55 |
stopText: 'Stop',
|
56 |
autoControlsCombine: false,
|
57 |
autoControlsSelector: null,
|
|
|
58 |
|
59 |
// AUTO
|
60 |
auto: false,
|
63 |
autoDirection: 'next',
|
64 |
autoHover: false,
|
65 |
autoDelay: 0,
|
66 |
+
autoSlideForOnePage: false,
|
67 |
|
68 |
// CAROUSEL
|
69 |
minSlides: 1,
|
76 |
onSlideBefore: function() {},
|
77 |
onSlideAfter: function() {},
|
78 |
onSlideNext: function() {},
|
79 |
+
onSlidePrev: function() {},
|
80 |
+
onSliderResize: function() {}
|
81 |
}
|
82 |
|
83 |
$.fn.soliloquy = function(options){
|
176 |
*/
|
177 |
var setup = function(){
|
178 |
// wrap el in a wrapper
|
179 |
+
el.wrap('<div class="' + slider.settings.wrapperClass + '"><div class="soliloquy-viewport"></div></div>');
|
180 |
// store a namspace reference to .soliloquy-viewport
|
181 |
slider.viewport = el.parent();
|
182 |
// add a loading div to display while images are loading
|
232 |
display: 'none'
|
233 |
});
|
234 |
// prepare the z-index on the showing element
|
235 |
+
slider.children.eq(slider.settings.startSlide).css({zIndex: slider.settings.slideZIndex, display: 'block'});
|
236 |
}
|
237 |
// create an element to contain all slider controls (pager, start / stop, etc)
|
238 |
slider.controls.el = $('<div class="soliloquy-controls" />');
|
240 |
if(slider.settings.captions) appendCaptions();
|
241 |
// check if startSlide is last slide
|
242 |
slider.active.last = slider.settings.startSlide == getPagerQty() - 1;
|
243 |
+
// Added by Thomas - removed fitVids support, no need.
|
|
|
244 |
// set the default preload selector (visible)
|
245 |
var preloadSelector = slider.children.eq(slider.settings.startSlide);
|
246 |
if (slider.settings.preloadImages == "all") preloadSelector = slider.children;
|
305 |
slider.initialized = true;
|
306 |
// bind the resize call to the window
|
307 |
if (slider.settings.responsive) $(window).bind('resize', resizeWindow);
|
308 |
+
// if auto is true and has more than 1 page, start the show
|
309 |
+
if (slider.settings.auto && slider.settings.autoStart && (getPagerQty() > 1 || slider.settings.autoSlideForOnePage)) initAuto();
|
310 |
// if ticker is true, start the ticker
|
311 |
if (slider.settings.ticker) initTicker();
|
312 |
// if pager is requested, make the appropriate pager link active
|
315 |
if (slider.settings.controls) updateDirectionControls();
|
316 |
// if touchEnabled is true, setup the touch events
|
317 |
if (slider.settings.touchEnabled && !slider.settings.ticker) initTouch();
|
318 |
+
|
319 |
+
// Added by Thomas
|
320 |
if (slider.settings.keyboard && !slider.settings.ticker) {
|
321 |
$(document).on('keydown', function(e){
|
322 |
if (e.keyCode == 39) {
|
377 |
return $(this).outerHeight(false);
|
378 |
}).get());
|
379 |
}
|
380 |
+
|
381 |
+
if(slider.viewport.css('box-sizing') == 'border-box'){
|
382 |
+
height += parseFloat(slider.viewport.css('padding-top')) + parseFloat(slider.viewport.css('padding-bottom')) +
|
383 |
+
parseFloat(slider.viewport.css('border-top-width')) + parseFloat(slider.viewport.css('border-bottom-width'));
|
384 |
+
}else if(slider.viewport.css('box-sizing') == 'padding-box'){
|
385 |
+
height += parseFloat(slider.viewport.css('padding-top')) + parseFloat(slider.viewport.css('padding-bottom'));
|
386 |
+
}
|
387 |
+
|
388 |
return height;
|
389 |
}
|
390 |
|
441 |
slidesShowing = slider.settings.maxSlides;
|
442 |
// if viewport is between min / max thresholds, divide viewport width by first child width
|
443 |
}else{
|
444 |
+
var childWidth = slider.children.first().width() + slider.settings.slideMargin;
|
445 |
+
slidesShowing = Math.floor((slider.viewport.width() +
|
446 |
+
slider.settings.slideMargin) / childWidth);
|
447 |
}
|
448 |
// if "vertical" mode, slides showing will always be minSlides
|
449 |
}else if(slider.settings.mode == 'vertical'){
|
460 |
// if moveSlides is specified by the user
|
461 |
if(slider.settings.moveSlides > 0){
|
462 |
if(slider.settings.infiniteLoop){
|
463 |
+
pagerQty = Math.ceil(slider.children.length / getMoveBy());
|
464 |
}else{
|
465 |
// use a while loop to determine pages
|
466 |
var breakPoint = 0;
|
502 |
var lastChild = slider.children.last();
|
503 |
var 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;
|
637 |
slider.pagerEl = $(slider.settings.pagerCustom);
|
638 |
}
|
639 |
// assign the pager click binding
|
640 |
+
slider.pagerEl.on('click', 'a', clickPagerBind);
|
641 |
}
|
642 |
|
643 |
/**
|
677 |
// add the controls to the DOM
|
678 |
slider.controls.autoEl = $('<div class="soliloquy-controls-auto" />');
|
679 |
// bind click actions to the controls
|
680 |
+
slider.controls.autoEl.on('click', '.soliloquy-start', clickStartBind);
|
681 |
+
slider.controls.autoEl.on('click', '.soliloquy-stop', clickStopBind);
|
682 |
// if autoControlsCombine, insert only the "start" control
|
683 |
if(slider.settings.autoControlsCombine){
|
684 |
slider.controls.autoEl.append(slider.controls.start);
|
770 |
// if auto show is running, stop it
|
771 |
if (slider.settings.auto) el.stopAuto();
|
772 |
var pagerLink = $(e.currentTarget);
|
773 |
+
if(pagerLink.attr('data-slide-index') !== undefined){
|
774 |
+
var pagerIndex = parseInt(pagerLink.attr('data-slide-index'));
|
775 |
+
// if clicked pager link is not active, continue with the goToSlide call
|
776 |
+
if(pagerIndex != slider.active.index) el.goToSlide(pagerIndex);
|
777 |
+
e.preventDefault();
|
778 |
+
}
|
779 |
}
|
780 |
|
781 |
/**
|
818 |
}else if(slider.active.index == slider.children.length - 1){
|
819 |
position = slider.children.eq(slider.children.length - 1).position();
|
820 |
}
|
821 |
+
if(position){
|
822 |
+
if (slider.settings.mode == 'horizontal') { setPositionProperty(-position.left, 'reset', 0); }
|
823 |
+
else if (slider.settings.mode == 'vertical') { setPositionProperty(-position.top, 'reset', 0); }
|
824 |
+
}
|
825 |
}
|
826 |
// declare that the transition is complete
|
827 |
slider.working = false;
|
828 |
+
// Added by Thomas
|
829 |
if(slider.settings.mode == 'fade'){
|
830 |
slider.viewport.css({overflow:''});
|
831 |
}
|
1091 |
* Window resize event callback
|
1092 |
*/
|
1093 |
var resizeWindow = function(e){
|
1094 |
+
// don't do anything if slider isn't initialized.
|
1095 |
+
if(!slider.initialized) return;
|
1096 |
// get the new window dimens (again, thank you IE)
|
1097 |
var windowWidthNew = $(window).width();
|
1098 |
var windowHeightNew = $(window).height();
|
1105 |
windowHeight = windowHeightNew;
|
1106 |
// update all dynamic elements
|
1107 |
el.redrawSlider();
|
1108 |
+
// Call user resize handler
|
1109 |
+
slider.settings.onSliderResize.call(el, slider.active.index);
|
1110 |
}
|
1111 |
}
|
1112 |
|
1157 |
if(slider.settings.controls) updateDirectionControls();
|
1158 |
// if slider is set to mode: "fade"
|
1159 |
if(slider.settings.mode == 'fade'){
|
1160 |
+
// Added by Thomas
|
1161 |
+
slider.viewport.css({overflow:'hidden'});
|
1162 |
// if adaptiveHeight is true and next height is different from current height, animate to the new height
|
1163 |
if(slider.settings.adaptiveHeight && slider.viewport.height() != getViewportHeight()){
|
1164 |
slider.viewport.animate({height: getViewportHeight()}, slider.settings.adaptiveHeightSpeed);
|
1166 |
// fade out the visible child and reset its z-index value
|
1167 |
slider.children.filter(':visible').fadeOut(slider.settings.speed).css({zIndex: 0});
|
1168 |
// fade in the newly requested slide
|
1169 |
+
slider.children.eq(slider.active.index).css('zIndex', slider.settings.slideZIndex+1).fadeIn(slider.settings.speed, function(){
|
1170 |
+
$(this).css('zIndex', slider.settings.slideZIndex);
|
1171 |
updateAfterSlideTransition();
|
1172 |
});
|
1173 |
// slider mode is not "fade"
|
1280 |
return slider.active.index;
|
1281 |
}
|
1282 |
|
1283 |
+
/**
|
1284 |
+
* Returns current slide element
|
1285 |
+
*/
|
1286 |
+
el.getCurrentSlideElement = function(){
|
1287 |
+
return slider.children.eq(slider.active.index);
|
1288 |
+
}
|
1289 |
+
|
1290 |
/**
|
1291 |
* Returns number of slides in show
|
1292 |
*/
|
1299 |
*/
|
1300 |
el.redrawSlider = function(){
|
1301 |
// resize all children in ratio to new screen size
|
1302 |
+
slider.children.add(el.find('.soliloquy-clone')).width(getSlideWidth());
|
1303 |
// adjust the height
|
1304 |
slider.viewport.css('height', getViewportHeight());
|
1305 |
// update the slide position
|
1332 |
if(slider.controls.el) slider.controls.el.remove();
|
1333 |
if(slider.controls.next) slider.controls.next.remove();
|
1334 |
if(slider.controls.prev) slider.controls.prev.remove();
|
1335 |
+
if(slider.pagerEl && slider.settings.controls) slider.pagerEl.remove();
|
1336 |
$('.soliloquy-caption', this).remove();
|
1337 |
if(slider.controls.autoEl) slider.controls.autoEl.remove();
|
1338 |
clearInterval(slider.interval);
|
1355 |
}
|
1356 |
|
1357 |
})(jQuery);
|
1358 |
+
|
1359 |
// Video functions.
|
1360 |
function soliloquyYouTubeVids(data, id, width, height, holder, $){
|
1361 |
// Immediately make the holder visible and increase z-index to overlay the player icon.
|
assets/js/soliloquy.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
// Soliloquyv2.
|
2 |
-
;(function(b){var a={};var c={mode:"horizontal",slideSelector:"",infiniteLoop:true,hideControlOnEnd:false,speed:500,easing:null,slideMargin:0,startSlide:0,randomStart:false,captions:false,ticker:false,tickerHover:false,adaptiveHeight:false,adaptiveHeightSpeed:500,video:false,useCSS:true,preloadImages:"visible",responsive:true,touchEnabled:true,swipeThreshold:50,oneToOneTouch:true,preventDefaultSwipeX:true,preventDefaultSwipeY:false,pager:true,pagerType:"full",pagerShortSeparator:" / ",pagerSelector:null,buildPager:null,pagerCustom:null,controls:true,nextText:"Next",prevText:"Prev",nextSelector:null,prevSelector:null,autoControls:false,startText:"Start",stopText:"Stop",autoControlsCombine:false,autoControlsSelector:null,keyboard:false,auto:false,pause:4000,autoStart:true,autoDirection:"next",autoHover:false,autoDelay:0,minSlides:1,maxSlides:1,moveSlides:0,slideWidth:0,onSliderLoad:function(){},onSlideBefore:function(){},onSlideAfter:function(){},onSlideNext:function(){},onSlidePrev:function(){}};b.fn.soliloquy=function(s){if(this.length==0){return this}if(this.length>1){this.each(function(){b(this).soliloquy(s)});return this}var j={};var H=this;a.el=this;var J=b(window).width();var M=b(window).height();var C=function(){j.settings=b.extend({},c,s);j.settings.slideWidth=parseInt(j.settings.slideWidth);j.children=H.children(j.settings.slideSelector);if(j.children.length<j.settings.minSlides){j.settings.minSlides=j.children.length}if(j.children.length<j.settings.maxSlides){j.settings.maxSlides=j.children.length}if(j.settings.randomStart){j.settings.startSlide=Math.floor(Math.random()*j.children.length)}j.active={index:j.settings.startSlide};j.carousel=j.settings.minSlides>1||j.settings.maxSlides>1;if(j.carousel){j.settings.preloadImages="all"}j.minThreshold=(j.settings.minSlides*j.settings.slideWidth)+((j.settings.minSlides-1)*j.settings.slideMargin);j.maxThreshold=(j.settings.maxSlides*j.settings.slideWidth)+((j.settings.maxSlides-1)*j.settings.slideMargin);j.working=false;j.controls={};j.interval=null;j.animProp=j.settings.mode=="vertical"?"top":"left";j.usingCSS=j.settings.useCSS&&j.settings.mode!="fade"&&(function(){var T=document.createElement("div");var S=["WebkitPerspective","MozPerspective","OPerspective","msPerspective"];for(var R in S){if(T.style[S[R]]!==undefined){j.cssPrefix=S[R].replace("Perspective","").toLowerCase();j.animProp="-"+j.cssPrefix+"-transform";return true}}return false}());if(j.settings.mode=="vertical"){j.settings.maxSlides=j.settings.minSlides}H.data("origStyle",H.attr("style"));H.children(j.settings.slideSelector).each(function(){b(this).data("origStyle",b(this).attr("style"))});m()};var m=function(){H.wrap('<div class="soliloquy-wrapper"><div class="soliloquy-viewport"></div></div>');j.viewport=H.parent();j.loader=b('<div class="soliloquy-loading" />');j.viewport.prepend(j.loader);H.css({width:j.settings.mode=="horizontal"?(j.children.length*100+215)+"%":"auto",position:"relative"});if(j.usingCSS&&j.settings.easing){H.css("-"+j.cssPrefix+"-transition-timing-function",j.settings.easing)}else{if(!j.settings.easing){j.settings.easing="swing"}}var R=A();j.viewport.css({width:"100%",position:"relative"});if(j.settings.mode!="fade"){j.viewport.css({overflow:"hidden"})}j.viewport.parent().css({maxWidth:L()});if(!j.settings.pager){j.viewport.parent().css({margin:"0 auto 0px"})}j.children.css({"float":j.settings.mode=="horizontal"?"left":"none",listStyle:"none",position:"relative"});j.children.css("width",D());if(j.settings.mode=="horizontal"&&j.settings.slideMargin>0){j.children.css("marginRight",j.settings.slideMargin)}if(j.settings.mode=="vertical"&&j.settings.slideMargin>0){j.children.css("marginBottom",j.settings.slideMargin)}if(j.settings.mode=="fade"){j.children.css({position:"absolute",zIndex:0,display:"none"});j.children.eq(j.settings.startSlide).css({zIndex:50,display:"block"})}j.controls.el=b('<div class="soliloquy-controls" />');if(j.settings.captions){z()}j.active.last=j.settings.startSlide==v()-1;if(j.settings.video){H.soliloquyVids()}var S=j.children.eq(j.settings.startSlide);if(j.settings.preloadImages=="all"){S=j.children}if(!j.settings.ticker){if(j.settings.pager){O()}if(j.settings.controls){k()}if(j.settings.auto&&j.settings.autoControls){K()}if(j.settings.controls||j.settings.autoControls||j.settings.pager){j.viewport.after(j.controls.el)}}else{j.settings.pager=false}d(S,t)};var d=function(R,U){var T=R.find("img, iframe").length;if(T==0){U();return}var S=0;R.find("img, iframe").each(function(){b(this).one("load",function(){if(++S==T){U()}}).each(function(){if(this.complete){b(this).load()}})})};var t=function(){if(j.settings.infiniteLoop&&j.settings.mode!="fade"&&!j.settings.ticker){var T=j.settings.mode=="vertical"?j.settings.minSlides:j.settings.maxSlides;var S=j.children.slice(0,T).clone().addClass("soliloquy-clone");var R=j.children.slice(-T).clone().addClass("soliloquy-clone");H.append(S).prepend(R)}j.loader.remove();h();if(j.settings.mode=="vertical"){j.settings.adaptiveHeight=true}j.viewport.height(o());H.redrawSlider();j.settings.onSliderLoad(j.active.index);j.initialized=true;if(j.settings.responsive){b(window).bind("resize",n)}if(j.settings.auto&&j.settings.autoStart){e()}if(j.settings.ticker){F()}if(j.settings.pager){Q(j.settings.startSlide)}if(j.settings.controls){l()}if(j.settings.touchEnabled&&!j.settings.ticker){f()}if(j.settings.keyboard&&!j.settings.ticker){b(document).on("keydown",function(U){if(U.keyCode==39){g(U);return false}else{if(U.keyCode==37){N(U);return false}}})}};var o=function(){var R=0;var T=b();if(j.settings.mode!="vertical"&&!j.settings.adaptiveHeight){T=j.children}else{if(!j.carousel){T=j.children.eq(j.active.index)}else{var S=j.settings.moveSlides==1?j.active.index:j.active.index*q();T=j.children.eq(S);for(i=1;i<=j.settings.maxSlides-1;i++){if(S+i>=j.children.length){T=T.add(j.children.eq(i-1))}else{T=T.add(j.children.eq(S+i))}}}}if(j.settings.mode=="vertical"){T.each(function(U){R+=b(this).outerHeight()});if(j.settings.slideMargin>0){R+=j.settings.slideMargin*(j.settings.minSlides-1)}}else{R=Math.max.apply(Math,T.map(function(){return b(this).outerHeight(false)}).get())}return R};var L=function(){var R="100%";if(j.settings.slideWidth>0){if(j.settings.mode=="horizontal"){R=(j.settings.maxSlides*j.settings.slideWidth)+((j.settings.maxSlides-1)*j.settings.slideMargin)}else{R=j.settings.slideWidth}}return R};var D=function(){var S=j.settings.slideWidth;var R=j.viewport.width();if(j.settings.slideWidth==0||(j.settings.slideWidth>R&&!j.carousel)||j.settings.mode=="vertical"){S=R}else{if(j.settings.maxSlides>1&&j.settings.mode=="horizontal"){if(R>j.maxThreshold){}else{if(R<j.minThreshold){S=(R-(j.settings.slideMargin*(j.settings.minSlides-1)))/j.settings.minSlides}}}}return S};var A=function(){var S=1;if(j.settings.mode=="horizontal"&&j.settings.slideWidth>0){if(j.viewport.width()<j.minThreshold){S=j.settings.minSlides}else{if(j.viewport.width()>j.maxThreshold){S=j.settings.maxSlides}else{var R=j.children.first().width();S=Math.floor(j.viewport.width()/R)}}}else{if(j.settings.mode=="vertical"){S=j.settings.minSlides}}return S};var v=function(){var S=0;if(j.settings.moveSlides>0){if(j.settings.infiniteLoop){S=j.children.length/q()}else{var T=0;var R=0;while(T<j.children.length){++S;T=R+A();R+=j.settings.moveSlides<=A()?j.settings.moveSlides:A()}}}else{S=Math.ceil(j.children.length/A())}return S};var q=function(){if(j.settings.moveSlides>0&&j.settings.moveSlides<=A()){return j.settings.moveSlides}return A()};var h=function(){if(j.children.length>j.settings.maxSlides&&j.active.last&&!j.settings.infiniteLoop){if(j.settings.mode=="horizontal"){var T=j.children.last();var R=T.position();B(-(R.left-(j.viewport.width()-T.width())),"reset",0)}else{if(j.settings.mode=="vertical"){var S=j.children.length-j.settings.minSlides;var R=j.children.eq(S).position();B(-R.top,"reset",0)}}}else{var R=j.children.eq(j.active.index*q()).position();if(j.active.index==v()-1){j.active.last=true}if(R!=undefined){if(j.settings.mode=="horizontal"){B(-R.left,"reset",0)}else{if(j.settings.mode=="vertical"){B(-R.top,"reset",0)}}}}};var B=function(T,S,U,W){if(j.usingCSS){var V=j.settings.mode=="vertical"?"translate3d(0, "+T+"px, 0)":"translate3d("+T+"px, 0, 0)";H.css("-"+j.cssPrefix+"-transition-duration",U/1000+"s");if(S=="slide"){H.css(j.animProp,V);H.bind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",function(){H.unbind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd");p()})}else{if(S=="reset"){H.css(j.animProp,V)}else{if(S=="ticker"){H.css("-"+j.cssPrefix+"-transition-timing-function","linear");H.css(j.animProp,V);H.bind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",function(){H.unbind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd");B(W.resetValue,"reset",0);u()})}}}}else{var R={};R[j.animProp]=T;if(S=="slide"){H.animate(R,U,j.settings.easing,function(){p()})}else{if(S=="reset"){H.css(j.animProp,T)}else{if(S=="ticker"){H.animate(R,speed,"linear",function(){B(W.resetValue,"reset",0);u()})}}}}};var r=function(){var U="";var T=v();for(var S=0;S<T;S++){var R="";if(j.settings.buildPager&&b.isFunction(j.settings.buildPager)){R=j.settings.buildPager(S);j.pagerEl.addClass("soliloquy-custom-pager")}else{R=S+1;j.pagerEl.addClass("soliloquy-default-pager")}U+='<div class="soliloquy-pager-item"><a href="" data-slide-index="'+S+'" class="soliloquy-pager-link"><span>'+R+"</span></a></div>"}j.pagerEl.html(U)};var O=function(){if(!j.settings.pagerCustom){j.pagerEl=b('<div class="soliloquy-pager" />');if(j.settings.pagerSelector){b(j.settings.pagerSelector).html(j.pagerEl)}else{j.controls.el.addClass("soliloquy-has-pager").append(j.pagerEl)}r()}else{j.pagerEl=b(j.settings.pagerCustom)}j.pagerEl.delegate("a","click",x)};var k=function(){j.controls.next=b('<a class="soliloquy-next" href=""><span>'+j.settings.nextText+"</span></a>");j.controls.prev=b('<a class="soliloquy-prev" href=""><span>'+j.settings.prevText+"</span></a>");j.controls.next.bind("click",g);j.controls.prev.bind("click",N);if(j.settings.nextSelector){b(j.settings.nextSelector).append(j.controls.next)}if(j.settings.prevSelector){b(j.settings.prevSelector).append(j.controls.prev)}if(!j.settings.nextSelector&&!j.settings.prevSelector){j.controls.directionEl=b('<div class="soliloquy-controls-direction" />');j.controls.directionEl.append(j.controls.prev).append(j.controls.next);j.controls.el.addClass("soliloquy-has-controls-direction").append(j.controls.directionEl)}};var K=function(){j.controls.start=b('<div class="soliloquy-controls-auto-item"><a class="soliloquy-start" href=""><span>'+j.settings.startText+"</span></a></div>");j.controls.stop=b('<div class="soliloquy-controls-auto-item"><a class="soliloquy-stop" href=""><span>'+j.settings.stopText+"</span></a></div>");j.controls.autoEl=b('<div class="soliloquy-controls-auto" />');j.controls.autoEl.delegate(".soliloquy-start","click",w);j.controls.autoEl.delegate(".soliloquy-stop","click",P);if(j.settings.autoControlsCombine){j.controls.autoEl.append(j.controls.start)}else{j.controls.autoEl.append(j.controls.start).append(j.controls.stop)}if(j.settings.autoControlsSelector){b(j.settings.autoControlsSelector).html(j.controls.autoEl)}else{j.controls.el.addClass("soliloquy-has-controls-auto").append(j.controls.autoEl)}G(j.settings.autoStart?"stop":"start")};var z=function(){j.children.each(function(R){var S=b(this).find("img:first").attr("title");if(S!=undefined&&(""+S).length){b(this).append('<div class="soliloquy-caption"><span>'+S+"</span></div>")}})};var g=function(R){if(j.settings.auto){H.stopAuto()}H.goToNextSlide();R.preventDefault()};var N=function(R){if(j.settings.auto){H.stopAuto()}H.goToPrevSlide();R.preventDefault()};var w=function(R){H.startAuto();R.preventDefault()};var P=function(R){H.stopAuto();R.preventDefault()};var x=function(T){if(j.settings.auto){H.stopAuto()}var S=b(T.currentTarget);var R=parseInt(S.attr("data-slide-index"));if(R!=j.active.index){H.goToSlide(R)}T.preventDefault()};var Q=function(S){var R=j.children.length;if(j.settings.pagerType=="short"){if(j.settings.maxSlides>1){R=Math.ceil(j.children.length/j.settings.maxSlides)}j.pagerEl.html((S+1)+j.settings.pagerShortSeparator+R);return}j.pagerEl.find("a").removeClass("active");j.pagerEl.each(function(T,U){b(U).find("a").eq(S).addClass("active")})};var p=function(){if(j.settings.infiniteLoop){var R="";if(j.active.index==0){R=j.children.eq(0).position()}else{if(j.active.index==v()-1&&j.carousel){R=j.children.eq((v()-1)*q()).position()}else{if(j.active.index==j.children.length-1){R=j.children.eq(j.children.length-1).position()}}}if(j.settings.mode=="horizontal"){B(-R.left,"reset",0)}else{if(j.settings.mode=="vertical"){B(-R.top,"reset",0)}}}j.working=false;if(j.settings.mode=="fade"){j.viewport.css({overflow:""})}j.settings.onSlideAfter(j.children.eq(j.active.index),j.oldIndex,j.active.index)};var G=function(R){if(j.settings.autoControlsCombine){j.controls.autoEl.html(j.controls[R])}else{j.controls.autoEl.find("a").removeClass("active");j.controls.autoEl.find("a:not(.soliloquy-"+R+")").addClass("active")}};var l=function(){if(v()==1){j.controls.prev.addClass("disabled");j.controls.next.addClass("disabled")}else{if(!j.settings.infiniteLoop&&j.settings.hideControlOnEnd){if(j.active.index==0){j.controls.prev.addClass("disabled");j.controls.next.removeClass("disabled")}else{if(j.active.index==v()-1){j.controls.next.addClass("disabled");j.controls.prev.removeClass("disabled")}else{j.controls.prev.removeClass("disabled");j.controls.next.removeClass("disabled")}}}}};var e=function(){if(j.settings.autoDelay>0){var R=setTimeout(H.startAuto,j.settings.autoDelay)}else{H.startAuto()}if(j.settings.autoHover){H.hover(function(){if(j.interval){H.stopAuto(true);j.autoPaused=true}},function(){if(j.autoPaused){H.startAuto(true);j.autoPaused=null}})}};var F=function(){var S=0;if(j.settings.autoDirection=="next"){H.append(j.children.clone().addClass("soliloquy-clone"))}else{H.prepend(j.children.clone().addClass("soliloquy-clone"));var R=j.children.first().position();S=j.settings.mode=="horizontal"?-R.left:-R.top}B(S,"reset",0);j.settings.pager=false;j.settings.controls=false;j.settings.autoControls=false;if(j.settings.tickerHover&&!j.usingCSS){j.viewport.hover(function(){H.stop()},function(){var W=0;j.children.each(function(X){W+=j.settings.mode=="horizontal"?b(this).outerWidth(true):b(this).outerHeight(true)});var T=j.settings.speed/W;var U=j.settings.mode=="horizontal"?"left":"top";var V=T*(W-(Math.abs(parseInt(H.css(U)))));u(V)})}u()};var u=function(W){speed=W?W:j.settings.speed;var R={left:0,top:0};var U={left:0,top:0};if(j.settings.autoDirection=="next"){R=H.find(".soliloquy-clone").first().position()}else{U=j.children.first().position()}var T=j.settings.mode=="horizontal"?-R.left:-R.top;var S=j.settings.mode=="horizontal"?-U.left:-U.top;var V={resetValue:S};B(T,"ticker",speed,V)};var f=function(){j.touch={start:{x:0,y:0},end:{x:0,y:0}};j.viewport.bind("touchstart",E)};var E=function(R){if(j.working){R.preventDefault()}else{j.touch.originalPos=H.position();var S=R.originalEvent;j.touch.start.x=S.changedTouches[0].pageX;j.touch.start.y=S.changedTouches[0].pageY;j.viewport.bind("touchmove",I);j.viewport.bind("touchend",y)}};var I=function(S){var W=S.originalEvent;var T=Math.abs(W.changedTouches[0].pageX-j.touch.start.x);var V=Math.abs(W.changedTouches[0].pageY-j.touch.start.y);if((T*3)>V&&j.settings.preventDefaultSwipeX){S.preventDefault()}else{if((V*3)>T&&j.settings.preventDefaultSwipeY){S.preventDefault()}}if(j.settings.mode!="fade"&&j.settings.oneToOneTouch){var R=0;if(j.settings.mode=="horizontal"){var U=W.changedTouches[0].pageX-j.touch.start.x;R=j.touch.originalPos.left+U}else{var U=W.changedTouches[0].pageY-j.touch.start.y;R=j.touch.originalPos.top+U}B(R,"reset",0)}};var y=function(S){j.viewport.unbind("touchmove",I);var U=S.originalEvent;var R=0;j.touch.end.x=U.changedTouches[0].pageX;j.touch.end.y=U.changedTouches[0].pageY;if(j.settings.mode=="fade"){var T=Math.abs(j.touch.start.x-j.touch.end.x);if(T>=j.settings.swipeThreshold){j.touch.start.x>j.touch.end.x?H.goToNextSlide():H.goToPrevSlide();H.stopAuto()}}else{var T=0;if(j.settings.mode=="horizontal"){T=j.touch.end.x-j.touch.start.x;R=j.touch.originalPos.left}else{T=j.touch.end.y-j.touch.start.y;R=j.touch.originalPos.top}if(!j.settings.infiniteLoop&&((j.active.index==0&&T>0)||(j.active.last&&T<0))){B(R,"reset",200)}else{if(Math.abs(T)>=j.settings.swipeThreshold){T<0?H.goToNextSlide():H.goToPrevSlide();H.stopAuto()}else{B(R,"reset",200)}}}j.viewport.unbind("touchend",y)};var n=function(S){var R=b(window).width();var T=b(window).height();if(J!=R||M!=T){J=R;M=T;H.redrawSlider()}};H.goToSlide=function(V,X){if(j.working||j.active.index==V){return}j.working=true;j.oldIndex=j.active.index;if(V<0){j.active.index=v()-1}else{if(V>=v()){j.active.index=0}else{j.active.index=V}}j.settings.onSlideBefore(j.children.eq(j.active.index),j.oldIndex,j.active.index);if(X=="next"){j.settings.onSlideNext(j.children.eq(j.active.index),j.oldIndex,j.active.index)}else{if(X=="prev"){j.settings.onSlidePrev(j.children.eq(j.active.index),j.oldIndex,j.active.index)}}j.active.last=j.active.index>=v()-1;if(j.settings.pager){Q(j.active.index)}if(j.settings.controls){l()}if(j.settings.mode=="fade"){j.viewport.css({overflow:"hidden"});if(j.settings.adaptiveHeight&&j.viewport.height()!=o()){j.viewport.animate({height:o()},j.settings.adaptiveHeightSpeed)}j.children.filter(":visible").fadeOut(j.settings.speed).css({zIndex:0});j.children.eq(j.active.index).css("zIndex",51).fadeIn(j.settings.speed,function(){b(this).css("zIndex",50);p()})}else{if(j.settings.adaptiveHeight&&j.viewport.height()!=o()){j.viewport.animate({height:o()},j.settings.adaptiveHeightSpeed)}var W=0;var U={left:0,top:0};if(!j.settings.infiniteLoop&&j.carousel&&j.active.last){if(j.settings.mode=="horizontal"){var R=j.children.eq(j.children.length-1);U=R.position();W=j.viewport.width()-R.outerWidth()}else{var T=j.children.length-j.settings.minSlides;U=j.children.eq(T).position()}}else{if(j.carousel&&j.active.last&&X=="prev"){var Z=j.settings.moveSlides==1?j.settings.maxSlides-q():((v()-1)*q())-(j.children.length-j.settings.maxSlides);var R=H.children(".soliloquy-clone").eq(Z);U=R.position()}else{if(X=="next"&&j.active.index==0){U=H.find("> .soliloquy-clone").eq(j.settings.maxSlides).position();j.active.last=false}else{if(V>=0){var S=V*q();U=j.children.eq(S).position()}}}}if("undefined"!==typeof(U)){var Y=j.settings.mode=="horizontal"?-(U.left-W):-U.top;B(Y,"slide",j.settings.speed)}}};H.goToNextSlide=function(){if(!j.settings.infiniteLoop&&j.active.last){return}var R=parseInt(j.active.index)+1;H.goToSlide(R,"next")};H.goToPrevSlide=function(){if(!j.settings.infiniteLoop&&j.active.index==0){return}var R=parseInt(j.active.index)-1;H.goToSlide(R,"prev")};H.startAuto=function(R){if(j.interval){return}j.interval=setInterval(function(){j.settings.autoDirection=="next"?H.goToNextSlide():H.goToPrevSlide()},j.settings.pause);if(j.settings.autoControls&&R!=true){G("stop")}};H.stopAuto=function(R){if(!j.interval){return}clearInterval(j.interval);j.interval=null;if(j.settings.autoControls&&R!=true){G("start")}};H.getCurrentSlide=function(){return j.active.index};H.getSlideCount=function(){return j.children.length};H.redrawSlider=function(){j.children.add(H.find(".soliloquy-clone")).outerWidth(D());j.viewport.css("height",o());if(!j.settings.ticker){h()}if(j.active.last){j.active.index=v()-1}if(j.active.index>=v()){j.active.last=true}if(j.settings.pager&&!j.settings.pagerCustom){r();Q(j.active.index)}};H.destroySlider=function(){if(!j.initialized){return}j.initialized=false;b(".soliloquy-clone",this).remove();j.children.each(function(){b(this).data("origStyle")!=undefined?b(this).attr("style",b(this).data("origStyle")):b(this).removeAttr("style")});b(this).data("origStyle")!=undefined?this.attr("style",b(this).data("origStyle")):b(this).removeAttr("style");b(this).unwrap().unwrap();if(j.controls.el){j.controls.el.remove()}if(j.controls.next){j.controls.next.remove()}if(j.controls.prev){j.controls.prev.remove()}if(j.pagerEl){j.pagerEl.remove()}b(".soliloquy-caption",this).remove();if(j.controls.autoEl){j.controls.autoEl.remove()}clearInterval(j.interval);if(j.settings.responsive){b(window).unbind("resize",n)}};H.reloadSlider=function(R){if(R!=undefined){s=R}H.destroySlider();C()};C();return this}})(jQuery);
|
3 |
// Mobile checker function.
|
4 |
function soliloquyIsMobile(){var check = false;(function(a){if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4)))check=true})(navigator.userAgent||navigator.vendor||window.opera);return check;}
|
5 |
// Video functions.
|
1 |
// Soliloquyv2.
|
2 |
+
;(function(b){var a={};var c={keyboard:false,mode:"horizontal",slideSelector:"",infiniteLoop:true,hideControlOnEnd:false,speed:500,easing:null,slideMargin:0,startSlide:0,randomStart:false,captions:false,ticker:false,tickerHover:false,adaptiveHeight:false,adaptiveHeightSpeed:500,video:false,useCSS:true,preloadImages:"visible",responsive:true,slideZIndex:50,wrapperClass:"soliloquy-wrapper",touchEnabled:true,swipeThreshold:50,oneToOneTouch:true,preventDefaultSwipeX:true,preventDefaultSwipeY:false,pager:true,pagerType:"full",pagerShortSeparator:" / ",pagerSelector:null,buildPager:null,pagerCustom:null,controls:true,nextText:"Next",prevText:"Prev",nextSelector:null,prevSelector:null,autoControls:false,startText:"Start",stopText:"Stop",autoControlsCombine:false,autoControlsSelector:null,auto:false,pause:4000,autoStart:true,autoDirection:"next",autoHover:false,autoDelay:0,autoSlideForOnePage:false,minSlides:1,maxSlides:1,moveSlides:0,slideWidth:0,onSliderLoad:function(){},onSlideBefore:function(){},onSlideAfter:function(){},onSlideNext:function(){},onSlidePrev:function(){},onSliderResize:function(){}};b.fn.soliloquy=function(s){if(this.length==0){return this}if(this.length>1){this.each(function(){b(this).soliloquy(s)});return this}var j={};var H=this;a.el=this;var J=b(window).width();var M=b(window).height();var C=function(){j.settings=b.extend({},c,s);j.settings.slideWidth=parseInt(j.settings.slideWidth);j.children=H.children(j.settings.slideSelector);if(j.children.length<j.settings.minSlides){j.settings.minSlides=j.children.length}if(j.children.length<j.settings.maxSlides){j.settings.maxSlides=j.children.length}if(j.settings.randomStart){j.settings.startSlide=Math.floor(Math.random()*j.children.length)}j.active={index:j.settings.startSlide};j.carousel=j.settings.minSlides>1||j.settings.maxSlides>1;if(j.carousel){j.settings.preloadImages="all"}j.minThreshold=(j.settings.minSlides*j.settings.slideWidth)+((j.settings.minSlides-1)*j.settings.slideMargin);j.maxThreshold=(j.settings.maxSlides*j.settings.slideWidth)+((j.settings.maxSlides-1)*j.settings.slideMargin);j.working=false;j.controls={};j.interval=null;j.animProp=j.settings.mode=="vertical"?"top":"left";j.usingCSS=j.settings.useCSS&&j.settings.mode!="fade"&&(function(){var T=document.createElement("div");var S=["WebkitPerspective","MozPerspective","OPerspective","msPerspective"];for(var R in S){if(T.style[S[R]]!==undefined){j.cssPrefix=S[R].replace("Perspective","").toLowerCase();j.animProp="-"+j.cssPrefix+"-transform";return true}}return false}());if(j.settings.mode=="vertical"){j.settings.maxSlides=j.settings.minSlides}H.data("origStyle",H.attr("style"));H.children(j.settings.slideSelector).each(function(){b(this).data("origStyle",b(this).attr("style"))});m()};var m=function(){H.wrap('<div class="'+j.settings.wrapperClass+'"><div class="soliloquy-viewport"></div></div>');j.viewport=H.parent();j.loader=b('<div class="soliloquy-loading" />');j.viewport.prepend(j.loader);H.css({width:j.settings.mode=="horizontal"?(j.children.length*100+215)+"%":"auto",position:"relative"});if(j.usingCSS&&j.settings.easing){H.css("-"+j.cssPrefix+"-transition-timing-function",j.settings.easing)}else{if(!j.settings.easing){j.settings.easing="swing"}}var R=A();j.viewport.css({width:"100%",position:"relative"});if(j.settings.mode!="fade"){j.viewport.css({overflow:"hidden"})}j.viewport.parent().css({maxWidth:L()});if(!j.settings.pager){j.viewport.parent().css({margin:"0 auto 0px"})}j.children.css({"float":j.settings.mode=="horizontal"?"left":"none",listStyle:"none",position:"relative"});j.children.css("width",D());if(j.settings.mode=="horizontal"&&j.settings.slideMargin>0){j.children.css("marginRight",j.settings.slideMargin)}if(j.settings.mode=="vertical"&&j.settings.slideMargin>0){j.children.css("marginBottom",j.settings.slideMargin)}if(j.settings.mode=="fade"){j.children.css({position:"absolute",zIndex:0,display:"none"});j.children.eq(j.settings.startSlide).css({zIndex:j.settings.slideZIndex,display:"block"})}j.controls.el=b('<div class="soliloquy-controls" />');if(j.settings.captions){z()}j.active.last=j.settings.startSlide==v()-1;var S=j.children.eq(j.settings.startSlide);if(j.settings.preloadImages=="all"){S=j.children}if(!j.settings.ticker){if(j.settings.pager){O()}if(j.settings.controls){k()}if(j.settings.auto&&j.settings.autoControls){K()}if(j.settings.controls||j.settings.autoControls||j.settings.pager){j.viewport.after(j.controls.el)}}else{j.settings.pager=false}d(S,t)};var d=function(R,U){var T=R.find("img, iframe").length;if(T==0){U();return}var S=0;R.find("img, iframe").each(function(){b(this).one("load",function(){if(++S==T){U()}}).each(function(){if(this.complete){b(this).load()}})})};var t=function(){if(j.settings.infiniteLoop&&j.settings.mode!="fade"&&!j.settings.ticker){var T=j.settings.mode=="vertical"?j.settings.minSlides:j.settings.maxSlides;var S=j.children.slice(0,T).clone().addClass("soliloquy-clone");var R=j.children.slice(-T).clone().addClass("soliloquy-clone");H.append(S).prepend(R)}j.loader.remove();h();if(j.settings.mode=="vertical"){j.settings.adaptiveHeight=true}j.viewport.height(o());H.redrawSlider();j.settings.onSliderLoad(j.active.index);j.initialized=true;if(j.settings.responsive){b(window).bind("resize",n)}if(j.settings.auto&&j.settings.autoStart&&(v()>1||j.settings.autoSlideForOnePage)){e()}if(j.settings.ticker){F()}if(j.settings.pager){Q(j.settings.startSlide)}if(j.settings.controls){l()}if(j.settings.touchEnabled&&!j.settings.ticker){f()}if(j.settings.keyboard&&!j.settings.ticker){b(document).on("keydown",function(U){if(U.keyCode==39){g(U);return false}else{if(U.keyCode==37){N(U);return false}}})}};var o=function(){var R=0;var T=b();if(j.settings.mode!="vertical"&&!j.settings.adaptiveHeight){T=j.children}else{if(!j.carousel){T=j.children.eq(j.active.index)}else{var S=j.settings.moveSlides==1?j.active.index:j.active.index*q();T=j.children.eq(S);for(i=1;i<=j.settings.maxSlides-1;i++){if(S+i>=j.children.length){T=T.add(j.children.eq(i-1))}else{T=T.add(j.children.eq(S+i))}}}}if(j.settings.mode=="vertical"){T.each(function(U){R+=b(this).outerHeight()});if(j.settings.slideMargin>0){R+=j.settings.slideMargin*(j.settings.minSlides-1)}}else{R=Math.max.apply(Math,T.map(function(){return b(this).outerHeight(false)}).get())}if(j.viewport.css("box-sizing")=="border-box"){R+=parseFloat(j.viewport.css("padding-top"))+parseFloat(j.viewport.css("padding-bottom"))+parseFloat(j.viewport.css("border-top-width"))+parseFloat(j.viewport.css("border-bottom-width"))}else{if(j.viewport.css("box-sizing")=="padding-box"){R+=parseFloat(j.viewport.css("padding-top"))+parseFloat(j.viewport.css("padding-bottom"))}}return R};var L=function(){var R="100%";if(j.settings.slideWidth>0){if(j.settings.mode=="horizontal"){R=(j.settings.maxSlides*j.settings.slideWidth)+((j.settings.maxSlides-1)*j.settings.slideMargin)}else{R=j.settings.slideWidth}}return R};var D=function(){var S=j.settings.slideWidth;var R=j.viewport.width();if(j.settings.slideWidth==0||(j.settings.slideWidth>R&&!j.carousel)||j.settings.mode=="vertical"){S=R}else{if(j.settings.maxSlides>1&&j.settings.mode=="horizontal"){if(R>j.maxThreshold){}else{if(R<j.minThreshold){S=(R-(j.settings.slideMargin*(j.settings.minSlides-1)))/j.settings.minSlides}}}}return S};var A=function(){var S=1;if(j.settings.mode=="horizontal"&&j.settings.slideWidth>0){if(j.viewport.width()<j.minThreshold){S=j.settings.minSlides}else{if(j.viewport.width()>j.maxThreshold){S=j.settings.maxSlides}else{var R=j.children.first().width()+j.settings.slideMargin;S=Math.floor((j.viewport.width()+j.settings.slideMargin)/R)}}}else{if(j.settings.mode=="vertical"){S=j.settings.minSlides}}return S};var v=function(){var S=0;if(j.settings.moveSlides>0){if(j.settings.infiniteLoop){S=Math.ceil(j.children.length/q())}else{var T=0;var R=0;while(T<j.children.length){++S;T=R+A();R+=j.settings.moveSlides<=A()?j.settings.moveSlides:A()}}}else{S=Math.ceil(j.children.length/A())}return S};var q=function(){if(j.settings.moveSlides>0&&j.settings.moveSlides<=A()){return j.settings.moveSlides}return A()};var h=function(){if(j.children.length>j.settings.maxSlides&&j.active.last&&!j.settings.infiniteLoop){if(j.settings.mode=="horizontal"){var T=j.children.last();var R=T.position();B(-(R.left-(j.viewport.width()-T.outerWidth())),"reset",0)}else{if(j.settings.mode=="vertical"){var S=j.children.length-j.settings.minSlides;var R=j.children.eq(S).position();B(-R.top,"reset",0)}}}else{var R=j.children.eq(j.active.index*q()).position();if(j.active.index==v()-1){j.active.last=true}if(R!=undefined){if(j.settings.mode=="horizontal"){B(-R.left,"reset",0)}else{if(j.settings.mode=="vertical"){B(-R.top,"reset",0)}}}}};var B=function(T,S,U,W){if(j.usingCSS){var V=j.settings.mode=="vertical"?"translate3d(0, "+T+"px, 0)":"translate3d("+T+"px, 0, 0)";H.css("-"+j.cssPrefix+"-transition-duration",U/1000+"s");if(S=="slide"){H.css(j.animProp,V);H.bind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",function(){H.unbind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd");p()})}else{if(S=="reset"){H.css(j.animProp,V)}else{if(S=="ticker"){H.css("-"+j.cssPrefix+"-transition-timing-function","linear");H.css(j.animProp,V);H.bind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",function(){H.unbind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd");B(W.resetValue,"reset",0);u()})}}}}else{var R={};R[j.animProp]=T;if(S=="slide"){H.animate(R,U,j.settings.easing,function(){p()})}else{if(S=="reset"){H.css(j.animProp,T)}else{if(S=="ticker"){H.animate(R,speed,"linear",function(){B(W.resetValue,"reset",0);u()})}}}}};var r=function(){var U="";var T=v();for(var S=0;S<T;S++){var R="";if(j.settings.buildPager&&b.isFunction(j.settings.buildPager)){R=j.settings.buildPager(S);j.pagerEl.addClass("soliloquy-custom-pager")}else{R=S+1;j.pagerEl.addClass("soliloquy-default-pager")}U+='<div class="soliloquy-pager-item"><a href="" data-slide-index="'+S+'" class="soliloquy-pager-link"><span>'+R+"</span></a></div>"}j.pagerEl.html(U)};var O=function(){if(!j.settings.pagerCustom){j.pagerEl=b('<div class="soliloquy-pager" />');if(j.settings.pagerSelector){b(j.settings.pagerSelector).html(j.pagerEl)}else{j.controls.el.addClass("soliloquy-has-pager").append(j.pagerEl)}r()}else{j.pagerEl=b(j.settings.pagerCustom)}j.pagerEl.on("click","a",x)};var k=function(){j.controls.next=b('<a class="soliloquy-next" href=""><span>'+j.settings.nextText+"</span></a>");j.controls.prev=b('<a class="soliloquy-prev" href=""><span>'+j.settings.prevText+"</span></a>");j.controls.next.bind("click",g);j.controls.prev.bind("click",N);if(j.settings.nextSelector){b(j.settings.nextSelector).append(j.controls.next)}if(j.settings.prevSelector){b(j.settings.prevSelector).append(j.controls.prev)}if(!j.settings.nextSelector&&!j.settings.prevSelector){j.controls.directionEl=b('<div class="soliloquy-controls-direction" />');j.controls.directionEl.append(j.controls.prev).append(j.controls.next);j.controls.el.addClass("soliloquy-has-controls-direction").append(j.controls.directionEl)}};var K=function(){j.controls.start=b('<div class="soliloquy-controls-auto-item"><a class="soliloquy-start" href=""><span>'+j.settings.startText+"</span></a></div>");j.controls.stop=b('<div class="soliloquy-controls-auto-item"><a class="soliloquy-stop" href=""><span>'+j.settings.stopText+"</span></a></div>");j.controls.autoEl=b('<div class="soliloquy-controls-auto" />');j.controls.autoEl.on("click",".soliloquy-start",w);j.controls.autoEl.on("click",".soliloquy-stop",P);if(j.settings.autoControlsCombine){j.controls.autoEl.append(j.controls.start)}else{j.controls.autoEl.append(j.controls.start).append(j.controls.stop)}if(j.settings.autoControlsSelector){b(j.settings.autoControlsSelector).html(j.controls.autoEl)}else{j.controls.el.addClass("soliloquy-has-controls-auto").append(j.controls.autoEl)}G(j.settings.autoStart?"stop":"start")};var z=function(){j.children.each(function(R){var S=b(this).find("img:first").attr("title");if(S!=undefined&&(""+S).length){b(this).append('<div class="soliloquy-caption"><span>'+S+"</span></div>")}})};var g=function(R){if(j.settings.auto){H.stopAuto()}H.goToNextSlide();R.preventDefault()};var N=function(R){if(j.settings.auto){H.stopAuto()}H.goToPrevSlide();R.preventDefault()};var w=function(R){H.startAuto();R.preventDefault()};var P=function(R){H.stopAuto();R.preventDefault()};var x=function(T){if(j.settings.auto){H.stopAuto()}var S=b(T.currentTarget);if(S.attr("data-slide-index")!==undefined){var R=parseInt(S.attr("data-slide-index"));if(R!=j.active.index){H.goToSlide(R)}T.preventDefault()}};var Q=function(S){var R=j.children.length;if(j.settings.pagerType=="short"){if(j.settings.maxSlides>1){R=Math.ceil(j.children.length/j.settings.maxSlides)}j.pagerEl.html((S+1)+j.settings.pagerShortSeparator+R);return}j.pagerEl.find("a").removeClass("active");j.pagerEl.each(function(T,U){b(U).find("a").eq(S).addClass("active")})};var p=function(){if(j.settings.infiniteLoop){var R="";if(j.active.index==0){R=j.children.eq(0).position()}else{if(j.active.index==v()-1&&j.carousel){R=j.children.eq((v()-1)*q()).position()}else{if(j.active.index==j.children.length-1){R=j.children.eq(j.children.length-1).position()}}}if(R){if(j.settings.mode=="horizontal"){B(-R.left,"reset",0)}else{if(j.settings.mode=="vertical"){B(-R.top,"reset",0)}}}}j.working=false;if(j.settings.mode=="fade"){j.viewport.css({overflow:""})}j.settings.onSlideAfter(j.children.eq(j.active.index),j.oldIndex,j.active.index)};var G=function(R){if(j.settings.autoControlsCombine){j.controls.autoEl.html(j.controls[R])}else{j.controls.autoEl.find("a").removeClass("active");j.controls.autoEl.find("a:not(.soliloquy-"+R+")").addClass("active")}};var l=function(){if(v()==1){j.controls.prev.addClass("disabled");j.controls.next.addClass("disabled")}else{if(!j.settings.infiniteLoop&&j.settings.hideControlOnEnd){if(j.active.index==0){j.controls.prev.addClass("disabled");j.controls.next.removeClass("disabled")}else{if(j.active.index==v()-1){j.controls.next.addClass("disabled");j.controls.prev.removeClass("disabled")}else{j.controls.prev.removeClass("disabled");j.controls.next.removeClass("disabled")}}}}};var e=function(){if(j.settings.autoDelay>0){var R=setTimeout(H.startAuto,j.settings.autoDelay)}else{H.startAuto()}if(j.settings.autoHover){H.hover(function(){if(j.interval){H.stopAuto(true);j.autoPaused=true}},function(){if(j.autoPaused){H.startAuto(true);j.autoPaused=null}})}};var F=function(){var S=0;if(j.settings.autoDirection=="next"){H.append(j.children.clone().addClass("soliloquy-clone"))}else{H.prepend(j.children.clone().addClass("soliloquy-clone"));var R=j.children.first().position();S=j.settings.mode=="horizontal"?-R.left:-R.top}B(S,"reset",0);j.settings.pager=false;j.settings.controls=false;j.settings.autoControls=false;if(j.settings.tickerHover&&!j.usingCSS){j.viewport.hover(function(){H.stop()},function(){var W=0;j.children.each(function(X){W+=j.settings.mode=="horizontal"?b(this).outerWidth(true):b(this).outerHeight(true)});var T=j.settings.speed/W;var U=j.settings.mode=="horizontal"?"left":"top";var V=T*(W-(Math.abs(parseInt(H.css(U)))));u(V)})}u()};var u=function(W){speed=W?W:j.settings.speed;var R={left:0,top:0};var U={left:0,top:0};if(j.settings.autoDirection=="next"){R=H.find(".soliloquy-clone").first().position()}else{U=j.children.first().position()}var T=j.settings.mode=="horizontal"?-R.left:-R.top;var S=j.settings.mode=="horizontal"?-U.left:-U.top;var V={resetValue:S};B(T,"ticker",speed,V)};var f=function(){j.touch={start:{x:0,y:0},end:{x:0,y:0}};j.viewport.bind("touchstart",E)};var E=function(R){if(j.working){R.preventDefault()}else{j.touch.originalPos=H.position();var S=R.originalEvent;j.touch.start.x=S.changedTouches[0].pageX;j.touch.start.y=S.changedTouches[0].pageY;j.viewport.bind("touchmove",I);j.viewport.bind("touchend",y)}};var I=function(S){var W=S.originalEvent;var T=Math.abs(W.changedTouches[0].pageX-j.touch.start.x);var V=Math.abs(W.changedTouches[0].pageY-j.touch.start.y);if((T*3)>V&&j.settings.preventDefaultSwipeX){S.preventDefault()}else{if((V*3)>T&&j.settings.preventDefaultSwipeY){S.preventDefault()}}if(j.settings.mode!="fade"&&j.settings.oneToOneTouch){var R=0;if(j.settings.mode=="horizontal"){var U=W.changedTouches[0].pageX-j.touch.start.x;R=j.touch.originalPos.left+U}else{var U=W.changedTouches[0].pageY-j.touch.start.y;R=j.touch.originalPos.top+U}B(R,"reset",0)}};var y=function(S){j.viewport.unbind("touchmove",I);var U=S.originalEvent;var R=0;j.touch.end.x=U.changedTouches[0].pageX;j.touch.end.y=U.changedTouches[0].pageY;if(j.settings.mode=="fade"){var T=Math.abs(j.touch.start.x-j.touch.end.x);if(T>=j.settings.swipeThreshold){j.touch.start.x>j.touch.end.x?H.goToNextSlide():H.goToPrevSlide();H.stopAuto()}}else{var T=0;if(j.settings.mode=="horizontal"){T=j.touch.end.x-j.touch.start.x;R=j.touch.originalPos.left}else{T=j.touch.end.y-j.touch.start.y;R=j.touch.originalPos.top}if(!j.settings.infiniteLoop&&((j.active.index==0&&T>0)||(j.active.last&&T<0))){B(R,"reset",200)}else{if(Math.abs(T)>=j.settings.swipeThreshold){T<0?H.goToNextSlide():H.goToPrevSlide();H.stopAuto()}else{B(R,"reset",200)}}}j.viewport.unbind("touchend",y)};var n=function(S){if(!j.initialized){return}var R=b(window).width();var T=b(window).height();if(J!=R||M!=T){J=R;M=T;H.redrawSlider();j.settings.onSliderResize.call(H,j.active.index)}};H.goToSlide=function(V,X){if(j.working||j.active.index==V){return}j.working=true;j.oldIndex=j.active.index;if(V<0){j.active.index=v()-1}else{if(V>=v()){j.active.index=0}else{j.active.index=V}}j.settings.onSlideBefore(j.children.eq(j.active.index),j.oldIndex,j.active.index);if(X=="next"){j.settings.onSlideNext(j.children.eq(j.active.index),j.oldIndex,j.active.index)}else{if(X=="prev"){j.settings.onSlidePrev(j.children.eq(j.active.index),j.oldIndex,j.active.index)}}j.active.last=j.active.index>=v()-1;if(j.settings.pager){Q(j.active.index)}if(j.settings.controls){l()}if(j.settings.mode=="fade"){j.viewport.css({overflow:"hidden"});if(j.settings.adaptiveHeight&&j.viewport.height()!=o()){j.viewport.animate({height:o()},j.settings.adaptiveHeightSpeed)}j.children.filter(":visible").fadeOut(j.settings.speed).css({zIndex:0});j.children.eq(j.active.index).css("zIndex",j.settings.slideZIndex+1).fadeIn(j.settings.speed,function(){b(this).css("zIndex",j.settings.slideZIndex);p()})}else{if(j.settings.adaptiveHeight&&j.viewport.height()!=o()){j.viewport.animate({height:o()},j.settings.adaptiveHeightSpeed)}var W=0;var U={left:0,top:0};if(!j.settings.infiniteLoop&&j.carousel&&j.active.last){if(j.settings.mode=="horizontal"){var R=j.children.eq(j.children.length-1);U=R.position();W=j.viewport.width()-R.outerWidth()}else{var T=j.children.length-j.settings.minSlides;U=j.children.eq(T).position()}}else{if(j.carousel&&j.active.last&&X=="prev"){var Z=j.settings.moveSlides==1?j.settings.maxSlides-q():((v()-1)*q())-(j.children.length-j.settings.maxSlides);var R=H.children(".soliloquy-clone").eq(Z);U=R.position()}else{if(X=="next"&&j.active.index==0){U=H.find("> .soliloquy-clone").eq(j.settings.maxSlides).position();j.active.last=false}else{if(V>=0){var S=V*q();U=j.children.eq(S).position()}}}}if("undefined"!==typeof(U)){var Y=j.settings.mode=="horizontal"?-(U.left-W):-U.top;B(Y,"slide",j.settings.speed)}}};H.goToNextSlide=function(){if(!j.settings.infiniteLoop&&j.active.last){return}var R=parseInt(j.active.index)+1;H.goToSlide(R,"next")};H.goToPrevSlide=function(){if(!j.settings.infiniteLoop&&j.active.index==0){return}var R=parseInt(j.active.index)-1;H.goToSlide(R,"prev")};H.startAuto=function(R){if(j.interval){return}j.interval=setInterval(function(){j.settings.autoDirection=="next"?H.goToNextSlide():H.goToPrevSlide()},j.settings.pause);if(j.settings.autoControls&&R!=true){G("stop")}};H.stopAuto=function(R){if(!j.interval){return}clearInterval(j.interval);j.interval=null;if(j.settings.autoControls&&R!=true){G("start")}};H.getCurrentSlide=function(){return j.active.index};H.getCurrentSlideElement=function(){return j.children.eq(j.active.index)};H.getSlideCount=function(){return j.children.length};H.redrawSlider=function(){j.children.add(H.find(".soliloquy-clone")).width(D());j.viewport.css("height",o());if(!j.settings.ticker){h()}if(j.active.last){j.active.index=v()-1}if(j.active.index>=v()){j.active.last=true}if(j.settings.pager&&!j.settings.pagerCustom){r();Q(j.active.index)}};H.destroySlider=function(){if(!j.initialized){return}j.initialized=false;b(".soliloquy-clone",this).remove();j.children.each(function(){b(this).data("origStyle")!=undefined?b(this).attr("style",b(this).data("origStyle")):b(this).removeAttr("style")});b(this).data("origStyle")!=undefined?this.attr("style",b(this).data("origStyle")):b(this).removeAttr("style");b(this).unwrap().unwrap();if(j.controls.el){j.controls.el.remove()}if(j.controls.next){j.controls.next.remove()}if(j.controls.prev){j.controls.prev.remove()}if(j.pagerEl&&j.settings.controls){j.pagerEl.remove()}b(".soliloquy-caption",this).remove();if(j.controls.autoEl){j.controls.autoEl.remove()}clearInterval(j.interval);if(j.settings.responsive){b(window).unbind("resize",n)}};H.reloadSlider=function(R){if(R!=undefined){s=R}H.destroySlider();C()};C();return this}})(jQuery);
|
3 |
// Mobile checker function.
|
4 |
function soliloquyIsMobile(){var check = false;(function(a){if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4)))check=true})(navigator.userAgent||navigator.vendor||window.opera);return check;}
|
5 |
// Video functions.
|
includes/admin/editor.php
CHANGED
@@ -71,7 +71,7 @@ class Soliloquy_Editor_Lite {
|
|
71 |
public function media_button( $buttons ) {
|
72 |
|
73 |
// Create the media button.
|
74 |
-
$button = '<style type="text/css">@media only screen and (-webkit-min-device-pixel-ratio: 2),only screen and (min--moz-device-pixel-ratio: 2),only screen and (-o-min-device-pixel-ratio: 2/1),only screen and (min-device-pixel-ratio: 2),only screen and (min-resolution: 192dpi),only screen and (min-resolution: 2dppx) { #soliloquy-media-modal-button .soliloquy-media-icon[style] { background-image: url(' . plugins_url( 'assets/css/images/editor@2x.png', $this->base->file ) . ') !important; background-size: 16px 16px !important; } }</style>';
|
75 |
$button .= '<a id="soliloquy-media-modal-button" href="#" class="button soliloquy-choose-slider" title="' . esc_attr__( 'Add Slider', 'soliloquy' ) . '" style="padding-left: .4em;"><span class="soliloquy-media-icon" style="background: transparent url(' . plugins_url( 'assets/css/images/editor-icon.png', $this->base->file ) . ') no-repeat scroll 0 0; width: 16px; height: 16px; display: inline-block; vertical-align: text-top;"></span> ' . __( 'Add Slider', 'soliloquy' ) . '</a>';
|
76 |
|
77 |
// Enqueue the script that will trigger the editor button.
|
71 |
public function media_button( $buttons ) {
|
72 |
|
73 |
// Create the media button.
|
74 |
+
$button = '<style type="text/css">@media only screen and (-webkit-min-device-pixel-ratio: 2),only screen and (min--moz-device-pixel-ratio: 2),only screen and (-o-min-device-pixel-ratio: 2/1),only screen and (min-device-pixel-ratio: 2),only screen and (min-resolution: 192dpi),only screen and (min-resolution: 2dppx) { #soliloquy-media-modal-button .soliloquy-media-icon[style] { background-image: url(' . plugins_url( 'assets/css/images/editor-icon@2x.png', $this->base->file ) . ') !important; background-size: 16px 16px !important; } }</style>';
|
75 |
$button .= '<a id="soliloquy-media-modal-button" href="#" class="button soliloquy-choose-slider" title="' . esc_attr__( 'Add Slider', 'soliloquy' ) . '" style="padding-left: .4em;"><span class="soliloquy-media-icon" style="background: transparent url(' . plugins_url( 'assets/css/images/editor-icon.png', $this->base->file ) . ') no-repeat scroll 0 0; width: 16px; height: 16px; display: inline-block; vertical-align: text-top;"></span> ' . __( 'Add Slider', 'soliloquy' ) . '</a>';
|
76 |
|
77 |
// Enqueue the script that will trigger the editor button.
|
includes/admin/metaboxes.php
CHANGED
@@ -229,12 +229,7 @@ class Soliloquy_Metaboxes_Lite {
|
|
229 |
'multipart' => true,
|
230 |
'urlstream_upload' => true,
|
231 |
'multipart_params' => $post_params,
|
232 |
-
'resize' =>
|
233 |
-
'width' => Soliloquy_Media_Lite::get_instance()->get_resize_width(),
|
234 |
-
'height' => Soliloquy_Media_Lite::get_instance()->get_resize_height(),
|
235 |
-
'quality' => 100,
|
236 |
-
'enabled' => true
|
237 |
-
)
|
238 |
);
|
239 |
|
240 |
// If we are on a mobile device, disable multi selection.
|
229 |
'multipart' => true,
|
230 |
'urlstream_upload' => true,
|
231 |
'multipart_params' => $post_params,
|
232 |
+
'resize' => false
|
|
|
|
|
|
|
|
|
|
|
233 |
);
|
234 |
|
235 |
// If we are on a mobile device, disable multi selection.
|
includes/global/shortcode.php
CHANGED
@@ -193,7 +193,7 @@ class Soliloquy_Shortcode_Lite {
|
|
193 |
|
194 |
// Build out the slider HTML.
|
195 |
$slider .= '<div id="soliloquy-container-' . sanitize_html_class( $data['id'] ) . '" class="' . $this->get_slider_classes( $data ) . '" style="max-width:' . $this->get_config( 'slider_width', $data ) . 'px;max-height:' . $this->get_config( 'slider_height', $data ) . 'px;' . apply_filters( 'soliloquy_output_container_style', '', $data ) . '"' . apply_filters( 'soliloquy_output_container_attr', '', $data ) . '>';
|
196 |
-
$slider .= '<ul id="soliloquy-' . sanitize_html_class( $data['id'] ) . '" class="soliloquy-slider soliloquy-wrap soliloquy-clear">';
|
197 |
$slider = apply_filters( 'soliloquy_output_before_container', $slider, $data );
|
198 |
|
199 |
foreach ( (array) $data['slider'] as $id => $item ) {
|
@@ -374,7 +374,10 @@ class Soliloquy_Shortcode_Lite {
|
|
374 |
<?php do_action( 'soliloquy_api_config_callback', $data ); ?>
|
375 |
onSliderLoad: function(currentIndex){
|
376 |
soliloquy_container_<?php echo $data['id']; ?>.find('.soliloquy-active-slide').removeClass('soliloquy-active-slide');
|
377 |
-
soliloquy_container_<?php echo $data['id']; ?>.css({'height':'auto','background-image':'none'})
|
|
|
|
|
|
|
378 |
soliloquy_<?php echo $data['id']; ?>.find('.soliloquy-item:not(.soliloquy-clone):eq(' + currentIndex + ')').addClass('soliloquy-active-slide');
|
379 |
// Purge all cloned items of IDs to avoid duplicate ID issues.
|
380 |
soliloquy_container_<?php echo $data['id']; ?>.find('.soliloquy-clone').find('*').removeAttr('id');
|
193 |
|
194 |
// Build out the slider HTML.
|
195 |
$slider .= '<div id="soliloquy-container-' . sanitize_html_class( $data['id'] ) . '" class="' . $this->get_slider_classes( $data ) . '" style="max-width:' . $this->get_config( 'slider_width', $data ) . 'px;max-height:' . $this->get_config( 'slider_height', $data ) . 'px;' . apply_filters( 'soliloquy_output_container_style', '', $data ) . '"' . apply_filters( 'soliloquy_output_container_attr', '', $data ) . '>';
|
196 |
+
$slider .= '<ul id="soliloquy-' . sanitize_html_class( $data['id'] ) . '" class="soliloquy-slider soliloquy-slides soliloquy-wrap soliloquy-clear">';
|
197 |
$slider = apply_filters( 'soliloquy_output_before_container', $slider, $data );
|
198 |
|
199 |
foreach ( (array) $data['slider'] as $id => $item ) {
|
374 |
<?php do_action( 'soliloquy_api_config_callback', $data ); ?>
|
375 |
onSliderLoad: function(currentIndex){
|
376 |
soliloquy_container_<?php echo $data['id']; ?>.find('.soliloquy-active-slide').removeClass('soliloquy-active-slide');
|
377 |
+
soliloquy_container_<?php echo $data['id']; ?>.css({'height':'auto','background-image':'none'});
|
378 |
+
if ( soliloquy_container_<?php echo $data['id']; ?>.find('.soliloquy-slider li').size() > 1 ) {
|
379 |
+
soliloquy_container_<?php echo $data['id']; ?>.find('.soliloquy-controls').fadeTo(300, 1);
|
380 |
+
}
|
381 |
soliloquy_<?php echo $data['id']; ?>.find('.soliloquy-item:not(.soliloquy-clone):eq(' + currentIndex + ')').addClass('soliloquy-active-slide');
|
382 |
// Purge all cloned items of IDs to avoid duplicate ID issues.
|
383 |
soliloquy_container_<?php echo $data['id']; ?>.find('.soliloquy-clone').find('*').removeAttr('id');
|
readme.txt
CHANGED
@@ -84,6 +84,9 @@ Soliloquy has many Addons that extend its default functionality to make it do in
|
|
84 |
|
85 |
== Changelog ==
|
86 |
|
|
|
|
|
|
|
87 |
= 2.0.4 =
|
88 |
* Fixed bug with loading size.
|
89 |
* Other bug fixes and improvements.
|
84 |
|
85 |
== Changelog ==
|
86 |
|
87 |
+
= 2.0.5 =
|
88 |
+
* Numerous bug fixes and enhancements with the new v2 launch!
|
89 |
+
|
90 |
= 2.0.4 =
|
91 |
* Fixed bug with loading size.
|
92 |
* Other bug fixes and improvements.
|
soliloquy-lite.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* Description: Soliloquy is best responsive WordPress slider plugin. This is the lite version.
|
6 |
* Author: Thomas Griffin
|
7 |
* Author URI: http://thomasgriffinmedia.com
|
8 |
-
* Version: 2.0.
|
9 |
* Text Domain: soliloquy
|
10 |
* Domain Path: languages
|
11 |
*
|
@@ -54,7 +54,7 @@ class Soliloquy_Lite {
|
|
54 |
*
|
55 |
* @var string
|
56 |
*/
|
57 |
-
public $version = '2.0.
|
58 |
|
59 |
/**
|
60 |
* The name of the plugin.
|
5 |
* Description: Soliloquy is best responsive WordPress slider plugin. This is the lite version.
|
6 |
* Author: Thomas Griffin
|
7 |
* Author URI: http://thomasgriffinmedia.com
|
8 |
+
* Version: 2.0.5
|
9 |
* Text Domain: soliloquy
|
10 |
* Domain Path: languages
|
11 |
*
|
54 |
*
|
55 |
* @var string
|
56 |
*/
|
57 |
+
public $version = '2.0.5';
|
58 |
|
59 |
/**
|
60 |
* The name of the plugin.
|