first
This commit is contained in:
211
wp-content/plugins/slider-bws/js/admin-script.js
Normal file
211
wp-content/plugins/slider-bws/js/admin-script.js
Normal file
@ -0,0 +1,211 @@
|
||||
function sldr_setMessage( msg ) {
|
||||
(function($) {
|
||||
$( ".error" ).hide();
|
||||
$( ".sldr_image_update_message" ).html( msg ).show();
|
||||
})(jQuery);
|
||||
}
|
||||
|
||||
function sldr_setError( msg ) {
|
||||
(function($) {
|
||||
$( ".sldr_image_update_message" ).hide();
|
||||
$( ".error" ).html( msg ).show();
|
||||
})(jQuery);
|
||||
}
|
||||
|
||||
(function($) {
|
||||
$(document).ready( function() {
|
||||
|
||||
if ( $( window ).width() < 800 ) {
|
||||
$.each( $( '.sldr_add_responsive_column' ), function() {
|
||||
var content = '<div class="sldr_info hidden">';
|
||||
$.each( $( this ).find( 'td:hidden' ).not( '.column-order' ), function() {
|
||||
content = content + '<label>' + $( this ).attr( 'data-colname' ) + '</label><br/>' + $( this ).html() + '<br/>';
|
||||
$( this ).html( '' );
|
||||
});
|
||||
content = content + '</div>';
|
||||
$( this ).find( '.column-title' ).append( content );
|
||||
$( this ).find( '.sldr_info_show' ).show();
|
||||
});
|
||||
$( '.sldr_info_show' ).on( 'click', function( event ) {
|
||||
event.preventDefault();
|
||||
if ( $( this ).next( '.sldr_info' ).is( ':hidden' ) ) {
|
||||
$( this ).next( '.sldr_info' ).show();
|
||||
} else {
|
||||
$( this ).next( '.sldr_info' ).hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if ( ! $( '#sldr-attachments li' ).length )
|
||||
$( '.sldr-media-bulk-select-button' ).hide();
|
||||
|
||||
$( '#sldr-media-insert' ).click( function open_media_window() {
|
||||
if ( this.window === undefined ) {
|
||||
this.window = wp.media({
|
||||
title: sldr_vars.wp_media_title,
|
||||
library: { type: 'image, video/MP4, video/WebM, video/Ogg' },
|
||||
multiple: true,
|
||||
button: { text: sldr_vars.wp_media_button }
|
||||
});
|
||||
|
||||
var self = this; /* Needed to retrieve our variable in the anonymous function below */
|
||||
this.window.on( 'select', function() {
|
||||
var all = self.window.state().get( 'selection' ).toJSON();
|
||||
all.forEach( function( item, i, arr ) {
|
||||
$.ajax({
|
||||
url: '../wp-admin/admin-ajax.php',
|
||||
type: "POST",
|
||||
data: "action=sldr_add_from_media&add_id=" + item.id + "&post_id=" + $( '#post_ID' ).val() + "&sldr_ajax_add_nonce=" + sldr_vars.sldr_add_nonce,
|
||||
success: function( result ) {
|
||||
$( '#sldr-attachments' ).prepend( result );
|
||||
$( '#sldr-attachments li:first-child' ).addClass( 'success' );
|
||||
$( '.sldr-media-bulk-select-button' ).show();
|
||||
if ( ! $( '#sldr-attachments' ).data( 'ui-sortable' ) ) {
|
||||
sldr_add_sortable();
|
||||
}
|
||||
}
|
||||
});
|
||||
$('<input type="hidden" name="sldr_new_image[]" id="sldr_new_image_' + item.id + '" value="' + item.id + '" />').appendTo( '#hidden' );
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
this.window.open();
|
||||
return false;
|
||||
});
|
||||
|
||||
function sldr_add_sortable() {
|
||||
if ( $.fn.sortable ) {
|
||||
if ( $( "#sldr-attachments li" ).length > 1 ) {
|
||||
$( '#sldr-attachments' ).sortable({
|
||||
stop: function( event, ui ) {
|
||||
var g = $( '#sldr-attachments' ).sortable( 'toArray' );
|
||||
var f = g.length;
|
||||
$.each( g,
|
||||
function( k,l ) {
|
||||
$( '#' + l + ' input[name^="_sldr_order"]' ).val( k + 1 );
|
||||
}
|
||||
)
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
sldr_add_sortable();
|
||||
|
||||
$( '.sldr-media-bulk-select-button' ).on( 'click', function() {
|
||||
$( '.attachments' ).sortable( 'disable' ).addClass( 'bulk-selected' );
|
||||
$( '.sldr-wp-filter' ).addClass( 'selected' );
|
||||
$( '.sldr-media-attachment' ).on( 'click', function() {
|
||||
var attachment_id = $( this ).find( '.sldr_attachment_id' ).val();
|
||||
if ( $( this ).hasClass( 'details' ) ) {
|
||||
$( this ).removeClass( 'details selected' );
|
||||
$( '#sldr_new_image_' + attachment_id ).removeClass( 'selected remove-selected' );
|
||||
} else {
|
||||
$( this ).addClass( 'details selected' );
|
||||
$( '#sldr_new_image_' + attachment_id ).addClass( 'selected remove-selected' );
|
||||
}
|
||||
if ( $( this ).length > 0 )
|
||||
$( '.sldr-media-bulk-delete-selected-button' ).removeAttr( 'disabled' );
|
||||
else
|
||||
$( '.sldr-media-bulk-delete-selected-button' ).attr( 'disabled', 'disabled' );
|
||||
});
|
||||
$( '.sldr-media-check' ).on( 'click', function() {
|
||||
if ( $( this ).parent().hasClass( 'details' ) )
|
||||
$( this ).parent().removeClass( 'details selected' );
|
||||
else
|
||||
$( this ).parent().addClass( 'details selected' );
|
||||
if ( $( '.sldr-media-attachment.selected' ).length > 0 )
|
||||
$( '.sldr-media-bulk-delete-selected-button' ).removeAttr( 'disabled' );
|
||||
else
|
||||
$( '.sldr-media-bulk-delete-selected-button' ).attr( 'disabled', 'disabled' );
|
||||
return false;
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
$( '.sldr-media-bulk-cansel-select-button' ).on( 'click', function() {
|
||||
$( '.attachments' ).sortable().removeClass( 'bulk-selected' );
|
||||
$( '.attachments' ).sortable( 'option', 'disabled', false );
|
||||
$( '.attachments li' ).removeClass( 'details selected' );
|
||||
$( '.sldr-wp-filter' ).removeClass( 'selected' );
|
||||
$( '.sldr-media-attachment' ).off( 'click' );
|
||||
$( '.sldr-media-check' ).off( 'click' );
|
||||
return false;
|
||||
});
|
||||
|
||||
$( document ).on( 'click', '.sldr-media-actions-delete', function() {
|
||||
if ( window.confirm( sldr_vars.warnSingleDelete ) ) {
|
||||
var attachment_id = $( this ).parent().find( '.sldr_attachment_id' ).val(),
|
||||
slider_id = $( this ).parent().find( '.sldr_slider_id' ).val();
|
||||
$.ajax({
|
||||
url: '../wp-admin/admin-ajax.php',
|
||||
type: "POST",
|
||||
data: "action=sldr_delete_image&delete_id_array=" + attachment_id + "&slider_id=" + slider_id + "&sldr_ajax_nonce_field=" + sldr_vars.sldr_nonce,
|
||||
success: function( result ) {
|
||||
$( '#sldr_new_image_' + attachment_id ).remove();
|
||||
$( '#post-' + attachment_id ).remove();
|
||||
tb_remove();
|
||||
if ( ! $( '.attachments li' ).length )
|
||||
$( '.sldr-media-bulk-select-button' ).hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$( '.sldr-media-bulk-delete-selected-button' ).on( 'click', function() {
|
||||
if ( 'disabled' != $( this ).attr( 'disabled' ) ) {
|
||||
if ( window.confirm( sldr_vars.warnBulkDelete ) ) {
|
||||
var delete_id_array = '';
|
||||
$( '.attachments li.selected' ).each( function() {
|
||||
delete_id_array += $( this ).attr( 'id' ).replace( 'post-', '' ) + ',';
|
||||
});
|
||||
var slider_id = $( '.sldr_slider_id' ).val();
|
||||
$( '.sldr-media-spinner' ).css( 'display', 'inline-block' );
|
||||
$( '.attachments' ).attr( 'disabled', 'disabled' );
|
||||
$.ajax({
|
||||
url: '../wp-admin/admin-ajax.php',
|
||||
type: "POST",
|
||||
data: "action=sldr_delete_image&delete_id_array=" + delete_id_array + "&slider_id=" + slider_id + "&sldr_ajax_nonce_field=" + sldr_vars.sldr_nonce,
|
||||
success: function( result ) {
|
||||
$( '.remove-selected' ).remove();
|
||||
$( '.sldr-media-attachment.selected' ).remove();
|
||||
$( '.sldr-media-bulk-delete-selected-button' ).attr( 'disabled', 'disabled' );
|
||||
if ( ! $( '#post-body-content .attachments li' ).length ) {
|
||||
$( '.sldr-media-bulk-cansel-select-button' ).trigger( 'click' );
|
||||
$( '.sldr-media-bulk-select-button' ).hide();
|
||||
}
|
||||
$( '.sldr-media-spinner' ).css( 'display', 'none' );
|
||||
$( '.attachments' ).removeAttr( 'disabled' );
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
});
|
||||
})(jQuery);
|
||||
|
||||
/* Create notice on a gallery page */
|
||||
function sldr_notice_view( data_id ) {
|
||||
(function( $ ) {
|
||||
/* function to send Ajax request to gallery notice */
|
||||
sldr_notice_media_attach = function( thumb_id ) {
|
||||
$.ajax({
|
||||
url: "../wp-admin/admin-ajax.php",
|
||||
type: "POST",
|
||||
data: "action=sldr_media_check&thumbnail_id=" + thumb_id + "&sldr_ajax_nonce_field=" + sldr_vars.sldr_nonce,
|
||||
success: function( html ) {
|
||||
if ( undefined != html.data ) {
|
||||
$( ".media-frame-content" ).find( "#sldr_media_notice" ).html( html.data );
|
||||
$( '.button.media-button-select' ).attr( 'disabled', 'disabled' );
|
||||
} else {
|
||||
$( '.button.media-button-select' ).removeAttr( 'disabled' );
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
sldr_notice_media_attach( data_id );
|
||||
})( jQuery );
|
||||
}
|
5142
wp-content/plugins/slider-bws/js/owl.carousel.js
Normal file
5142
wp-content/plugins/slider-bws/js/owl.carousel.js
Normal file
File diff suppressed because it is too large
Load Diff
121
wp-content/plugins/slider-bws/js/owl.carousel/owl.animate.js
Normal file
121
wp-content/plugins/slider-bws/js/owl.carousel/owl.animate.js
Normal file
@ -0,0 +1,121 @@
|
||||
/**
|
||||
* Animate Plugin
|
||||
* @version 2.3.4
|
||||
* @author Bartosz Wojciechowski
|
||||
* @author David Deutsch
|
||||
* @license The MIT License (MIT)
|
||||
*/
|
||||
;(function($, window, document, undefined) {
|
||||
|
||||
/**
|
||||
* Creates the animate plugin.
|
||||
* @class The Navigation Plugin
|
||||
* @param {Owl} scope - The Owl Carousel
|
||||
*/
|
||||
var Animate = function(scope) {
|
||||
this.core = scope;
|
||||
this.core.options = $.extend({}, Animate.Defaults, this.core.options);
|
||||
this.swapping = true;
|
||||
this.previous = undefined;
|
||||
this.next = undefined;
|
||||
|
||||
this.handlers = {
|
||||
'change.owl.carousel': $.proxy(function(e) {
|
||||
if (e.namespace && e.property.name == 'position') {
|
||||
this.previous = this.core.current();
|
||||
this.next = e.property.value;
|
||||
}
|
||||
}, this),
|
||||
'drag.owl.carousel dragged.owl.carousel translated.owl.carousel': $.proxy(function(e) {
|
||||
if (e.namespace) {
|
||||
this.swapping = e.type == 'translated';
|
||||
}
|
||||
}, this),
|
||||
'translate.owl.carousel': $.proxy(function(e) {
|
||||
if (e.namespace && this.swapping && (this.core.options.animateOut || this.core.options.animateIn)) {
|
||||
this.swap();
|
||||
}
|
||||
}, this)
|
||||
};
|
||||
|
||||
this.core.$element.on(this.handlers);
|
||||
};
|
||||
|
||||
/**
|
||||
* Default options.
|
||||
* @public
|
||||
*/
|
||||
Animate.Defaults = {
|
||||
animateOut: false,
|
||||
animateIn: false
|
||||
};
|
||||
|
||||
/**
|
||||
* Toggles the animation classes whenever an translations starts.
|
||||
* @protected
|
||||
* @returns {Boolean|undefined}
|
||||
*/
|
||||
Animate.prototype.swap = function() {
|
||||
|
||||
if (this.core.settings.items !== 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!$.support.animation || !$.support.transition) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.core.speed(0);
|
||||
|
||||
var left,
|
||||
clear = $.proxy(this.clear, this),
|
||||
previous = this.core.$stage.children().eq(this.previous),
|
||||
next = this.core.$stage.children().eq(this.next),
|
||||
incoming = this.core.settings.animateIn,
|
||||
outgoing = this.core.settings.animateOut;
|
||||
|
||||
if (this.core.current() === this.previous) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (outgoing) {
|
||||
left = this.core.coordinates(this.previous) - this.core.coordinates(this.next);
|
||||
previous.one($.support.animation.end, clear)
|
||||
.css( { 'left': left + 'px' } )
|
||||
.addClass('animated owl-animated-out')
|
||||
.addClass(outgoing);
|
||||
}
|
||||
|
||||
if (incoming) {
|
||||
next.one($.support.animation.end, clear)
|
||||
.addClass('animated owl-animated-in')
|
||||
.addClass(incoming);
|
||||
}
|
||||
};
|
||||
|
||||
Animate.prototype.clear = function(e) {
|
||||
$(e.target).css( { 'left': '' } )
|
||||
.removeClass('animated owl-animated-out owl-animated-in')
|
||||
.removeClass(this.core.settings.animateIn)
|
||||
.removeClass(this.core.settings.animateOut);
|
||||
this.core.onTransitionEnd();
|
||||
};
|
||||
|
||||
/**
|
||||
* Destroys the plugin.
|
||||
* @public
|
||||
*/
|
||||
Animate.prototype.destroy = function() {
|
||||
var handler, property;
|
||||
|
||||
for (handler in this.handlers) {
|
||||
this.core.$element.off(handler, this.handlers[handler]);
|
||||
}
|
||||
for (property in Object.getOwnPropertyNames(this)) {
|
||||
typeof this[property] != 'function' && (this[property] = null);
|
||||
}
|
||||
};
|
||||
|
||||
$.fn.owlCarousel.Constructor.Plugins.Animate = Animate;
|
||||
|
||||
})(window.Zepto || window.jQuery, window, document);
|
132
wp-content/plugins/slider-bws/js/owl.carousel/owl.autoheight.js
Normal file
132
wp-content/plugins/slider-bws/js/owl.carousel/owl.autoheight.js
Normal file
@ -0,0 +1,132 @@
|
||||
/**
|
||||
* AutoHeight Plugin
|
||||
* @version 2.3.4
|
||||
* @author Bartosz Wojciechowski
|
||||
* @author David Deutsch
|
||||
* @license The MIT License (MIT)
|
||||
*/
|
||||
;(function($, window, document, undefined) {
|
||||
|
||||
/**
|
||||
* Creates the auto height plugin.
|
||||
* @class The Auto Height Plugin
|
||||
* @param {Owl} carousel - The Owl Carousel
|
||||
*/
|
||||
var AutoHeight = function(carousel) {
|
||||
/**
|
||||
* Reference to the core.
|
||||
* @protected
|
||||
* @type {Owl}
|
||||
*/
|
||||
this._core = carousel;
|
||||
|
||||
this._previousHeight = null;
|
||||
|
||||
/**
|
||||
* All event handlers.
|
||||
* @protected
|
||||
* @type {Object}
|
||||
*/
|
||||
this._handlers = {
|
||||
'initialized.owl.carousel refreshed.owl.carousel': $.proxy(function(e) {
|
||||
if (e.namespace && this._core.settings.autoHeight) {
|
||||
this.update();
|
||||
}
|
||||
}, this),
|
||||
'changed.owl.carousel': $.proxy(function(e) {
|
||||
if (e.namespace && this._core.settings.autoHeight && e.property.name === 'position'){
|
||||
this.update();
|
||||
}
|
||||
}, this),
|
||||
'loaded.owl.lazy': $.proxy(function(e) {
|
||||
if (e.namespace && this._core.settings.autoHeight
|
||||
&& e.element.closest('.' + this._core.settings.itemClass).index() === this._core.current()) {
|
||||
this.update();
|
||||
}
|
||||
}, this)
|
||||
};
|
||||
|
||||
// set default options
|
||||
this._core.options = $.extend({}, AutoHeight.Defaults, this._core.options);
|
||||
|
||||
// register event handlers
|
||||
this._core.$element.on(this._handlers);
|
||||
this._intervalId = null;
|
||||
var refThis = this;
|
||||
|
||||
// These changes have been taken from a PR by gavrochelegnou proposed in #1575
|
||||
// and have been made compatible with the latest jQuery version
|
||||
$(window).on('load', function() {
|
||||
if (refThis._core.settings.autoHeight) {
|
||||
refThis.update();
|
||||
}
|
||||
});
|
||||
|
||||
// Autoresize the height of the carousel when window is resized
|
||||
// When carousel has images, the height is dependent on the width
|
||||
// and should also change on resize
|
||||
$(window).resize(function() {
|
||||
if (refThis._core.settings.autoHeight) {
|
||||
if (refThis._intervalId != null) {
|
||||
clearTimeout(refThis._intervalId);
|
||||
}
|
||||
|
||||
refThis._intervalId = setTimeout(function() {
|
||||
refThis.update();
|
||||
}, 250);
|
||||
}
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* Default options.
|
||||
* @public
|
||||
*/
|
||||
AutoHeight.Defaults = {
|
||||
autoHeight: false,
|
||||
autoHeightClass: 'owl-height'
|
||||
};
|
||||
|
||||
/**
|
||||
* Updates the view.
|
||||
*/
|
||||
AutoHeight.prototype.update = function() {
|
||||
var start = this._core._current,
|
||||
end = start + this._core.settings.items,
|
||||
lazyLoadEnabled = this._core.settings.lazyLoad,
|
||||
visible = this._core.$stage.children().toArray().slice(start, end),
|
||||
heights = [],
|
||||
maxheight = 0;
|
||||
|
||||
$.each(visible, function(index, item) {
|
||||
heights.push($(item).height());
|
||||
});
|
||||
|
||||
maxheight = Math.max.apply(null, heights);
|
||||
|
||||
if (maxheight <= 1 && lazyLoadEnabled && this._previousHeight) {
|
||||
maxheight = this._previousHeight;
|
||||
}
|
||||
|
||||
this._previousHeight = maxheight;
|
||||
|
||||
this._core.$stage.parent()
|
||||
.height(maxheight)
|
||||
.addClass(this._core.settings.autoHeightClass);
|
||||
};
|
||||
|
||||
AutoHeight.prototype.destroy = function() {
|
||||
var handler, property;
|
||||
|
||||
for (handler in this._handlers) {
|
||||
this._core.$element.off(handler, this._handlers[handler]);
|
||||
}
|
||||
for (property in Object.getOwnPropertyNames(this)) {
|
||||
typeof this[property] !== 'function' && (this[property] = null);
|
||||
}
|
||||
};
|
||||
|
||||
$.fn.owlCarousel.Constructor.Plugins.AutoHeight = AutoHeight;
|
||||
|
||||
})(window.Zepto || window.jQuery, window, document);
|
233
wp-content/plugins/slider-bws/js/owl.carousel/owl.autoplay.js
Normal file
233
wp-content/plugins/slider-bws/js/owl.carousel/owl.autoplay.js
Normal file
@ -0,0 +1,233 @@
|
||||
/**
|
||||
* Autoplay Plugin
|
||||
* @version 2.3.4
|
||||
* @author Bartosz Wojciechowski
|
||||
* @author Artus Kolanowski
|
||||
* @author David Deutsch
|
||||
* @author Tom De Caluwé
|
||||
* @license The MIT License (MIT)
|
||||
*/
|
||||
;(function($, window, document, undefined) {
|
||||
|
||||
/**
|
||||
* Creates the autoplay plugin.
|
||||
* @class The Autoplay Plugin
|
||||
* @param {Owl} scope - The Owl Carousel
|
||||
*/
|
||||
var Autoplay = function(carousel) {
|
||||
/**
|
||||
* Reference to the core.
|
||||
* @protected
|
||||
* @type {Owl}
|
||||
*/
|
||||
this._core = carousel;
|
||||
|
||||
/**
|
||||
* The autoplay timeout id.
|
||||
* @type {Number}
|
||||
*/
|
||||
this._call = null;
|
||||
|
||||
/**
|
||||
* Depending on the state of the plugin, this variable contains either
|
||||
* the start time of the timer or the current timer value if it's
|
||||
* paused. Since we start in a paused state we initialize the timer
|
||||
* value.
|
||||
* @type {Number}
|
||||
*/
|
||||
this._time = 0;
|
||||
|
||||
/**
|
||||
* Stores the timeout currently used.
|
||||
* @type {Number}
|
||||
*/
|
||||
this._timeout = 0;
|
||||
|
||||
/**
|
||||
* Indicates whenever the autoplay is paused.
|
||||
* @type {Boolean}
|
||||
*/
|
||||
this._paused = true;
|
||||
|
||||
/**
|
||||
* All event handlers.
|
||||
* @protected
|
||||
* @type {Object}
|
||||
*/
|
||||
this._handlers = {
|
||||
'changed.owl.carousel': $.proxy(function(e) {
|
||||
if (e.namespace && e.property.name === 'settings') {
|
||||
if (this._core.settings.autoplay) {
|
||||
this.play();
|
||||
} else {
|
||||
this.stop();
|
||||
}
|
||||
} else if (e.namespace && e.property.name === 'position' && this._paused) {
|
||||
// Reset the timer. This code is triggered when the position
|
||||
// of the carousel was changed through user interaction.
|
||||
this._time = 0;
|
||||
}
|
||||
}, this),
|
||||
'initialized.owl.carousel': $.proxy(function(e) {
|
||||
if (e.namespace && this._core.settings.autoplay) {
|
||||
this.play();
|
||||
}
|
||||
}, this),
|
||||
'play.owl.autoplay': $.proxy(function(e, t, s) {
|
||||
if (e.namespace) {
|
||||
this.play(t, s);
|
||||
}
|
||||
}, this),
|
||||
'stop.owl.autoplay': $.proxy(function(e) {
|
||||
if (e.namespace) {
|
||||
this.stop();
|
||||
}
|
||||
}, this),
|
||||
'mouseover.owl.autoplay': $.proxy(function() {
|
||||
if (this._core.settings.autoplayHoverPause && this._core.is('rotating')) {
|
||||
this.pause();
|
||||
}
|
||||
}, this),
|
||||
'mouseleave.owl.autoplay': $.proxy(function() {
|
||||
if (this._core.settings.autoplayHoverPause && this._core.is('rotating')) {
|
||||
this.play();
|
||||
}
|
||||
}, this),
|
||||
'touchstart.owl.core': $.proxy(function() {
|
||||
if (this._core.settings.autoplayHoverPause && this._core.is('rotating')) {
|
||||
this.pause();
|
||||
}
|
||||
}, this),
|
||||
'touchend.owl.core': $.proxy(function() {
|
||||
if (this._core.settings.autoplayHoverPause) {
|
||||
this.play();
|
||||
}
|
||||
}, this)
|
||||
};
|
||||
|
||||
// register event handlers
|
||||
this._core.$element.on(this._handlers);
|
||||
|
||||
// set default options
|
||||
this._core.options = $.extend({}, Autoplay.Defaults, this._core.options);
|
||||
};
|
||||
|
||||
/**
|
||||
* Default options.
|
||||
* @public
|
||||
*/
|
||||
Autoplay.Defaults = {
|
||||
autoplay: false,
|
||||
autoplayTimeout: 5000,
|
||||
autoplayHoverPause: false,
|
||||
autoplaySpeed: false
|
||||
};
|
||||
|
||||
/**
|
||||
* Transition to the next slide and set a timeout for the next transition.
|
||||
* @private
|
||||
* @param {Number} [speed] - The animation speed for the animations.
|
||||
*/
|
||||
Autoplay.prototype._next = function(speed) {
|
||||
this._call = window.setTimeout(
|
||||
$.proxy(this._next, this, speed),
|
||||
this._timeout * (Math.round(this.read() / this._timeout) + 1) - this.read()
|
||||
);
|
||||
|
||||
if (this._core.is('interacting') || document.hidden) {
|
||||
return;
|
||||
}
|
||||
this._core.next(speed || this._core.settings.autoplaySpeed);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads the current timer value when the timer is playing.
|
||||
* @public
|
||||
*/
|
||||
Autoplay.prototype.read = function() {
|
||||
return new Date().getTime() - this._time;
|
||||
};
|
||||
|
||||
/**
|
||||
* Starts the autoplay.
|
||||
* @public
|
||||
* @param {Number} [timeout] - The interval before the next animation starts.
|
||||
* @param {Number} [speed] - The animation speed for the animations.
|
||||
*/
|
||||
Autoplay.prototype.play = function(timeout, speed) {
|
||||
var elapsed;
|
||||
|
||||
if (!this._core.is('rotating')) {
|
||||
this._core.enter('rotating');
|
||||
}
|
||||
|
||||
timeout = timeout || this._core.settings.autoplayTimeout;
|
||||
|
||||
// Calculate the elapsed time since the last transition. If the carousel
|
||||
// wasn't playing this calculation will yield zero.
|
||||
elapsed = Math.min(this._time % (this._timeout || timeout), timeout);
|
||||
|
||||
if (this._paused) {
|
||||
// Start the clock.
|
||||
this._time = this.read();
|
||||
this._paused = false;
|
||||
} else {
|
||||
// Clear the active timeout to allow replacement.
|
||||
window.clearTimeout(this._call);
|
||||
}
|
||||
|
||||
// Adjust the origin of the timer to match the new timeout value.
|
||||
this._time += this.read() % timeout - elapsed;
|
||||
|
||||
this._timeout = timeout;
|
||||
this._call = window.setTimeout($.proxy(this._next, this, speed), timeout - elapsed);
|
||||
};
|
||||
|
||||
/**
|
||||
* Stops the autoplay.
|
||||
* @public
|
||||
*/
|
||||
Autoplay.prototype.stop = function() {
|
||||
if (this._core.is('rotating')) {
|
||||
// Reset the clock.
|
||||
this._time = 0;
|
||||
this._paused = true;
|
||||
|
||||
window.clearTimeout(this._call);
|
||||
this._core.leave('rotating');
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Pauses the autoplay.
|
||||
* @public
|
||||
*/
|
||||
Autoplay.prototype.pause = function() {
|
||||
if (this._core.is('rotating') && !this._paused) {
|
||||
// Pause the clock.
|
||||
this._time = this.read();
|
||||
this._paused = true;
|
||||
|
||||
window.clearTimeout(this._call);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Destroys the plugin.
|
||||
*/
|
||||
Autoplay.prototype.destroy = function() {
|
||||
var handler, property;
|
||||
|
||||
this.stop();
|
||||
|
||||
for (handler in this._handlers) {
|
||||
this._core.$element.off(handler, this._handlers[handler]);
|
||||
}
|
||||
for (property in Object.getOwnPropertyNames(this)) {
|
||||
typeof this[property] != 'function' && (this[property] = null);
|
||||
}
|
||||
};
|
||||
|
||||
$.fn.owlCarousel.Constructor.Plugins.autoplay = Autoplay;
|
||||
|
||||
})(window.Zepto || window.jQuery, window, document);
|
111
wp-content/plugins/slider-bws/js/owl.carousel/owl.autorefresh.js
Normal file
111
wp-content/plugins/slider-bws/js/owl.carousel/owl.autorefresh.js
Normal file
@ -0,0 +1,111 @@
|
||||
/**
|
||||
* AutoRefresh Plugin
|
||||
* @version 2.3.4
|
||||
* @author Artus Kolanowski
|
||||
* @author David Deutsch
|
||||
* @license The MIT License (MIT)
|
||||
*/
|
||||
;(function($, window, document, undefined) {
|
||||
|
||||
/**
|
||||
* Creates the auto refresh plugin.
|
||||
* @class The Auto Refresh Plugin
|
||||
* @param {Owl} carousel - The Owl Carousel
|
||||
*/
|
||||
var AutoRefresh = function(carousel) {
|
||||
/**
|
||||
* Reference to the core.
|
||||
* @protected
|
||||
* @type {Owl}
|
||||
*/
|
||||
this._core = carousel;
|
||||
|
||||
/**
|
||||
* Refresh interval.
|
||||
* @protected
|
||||
* @type {number}
|
||||
*/
|
||||
this._interval = null;
|
||||
|
||||
/**
|
||||
* Whether the element is currently visible or not.
|
||||
* @protected
|
||||
* @type {Boolean}
|
||||
*/
|
||||
this._visible = null;
|
||||
|
||||
/**
|
||||
* All event handlers.
|
||||
* @protected
|
||||
* @type {Object}
|
||||
*/
|
||||
this._handlers = {
|
||||
'initialized.owl.carousel': $.proxy(function(e) {
|
||||
if (e.namespace && this._core.settings.autoRefresh) {
|
||||
this.watch();
|
||||
}
|
||||
}, this)
|
||||
};
|
||||
|
||||
// set default options
|
||||
this._core.options = $.extend({}, AutoRefresh.Defaults, this._core.options);
|
||||
|
||||
// register event handlers
|
||||
this._core.$element.on(this._handlers);
|
||||
};
|
||||
|
||||
/**
|
||||
* Default options.
|
||||
* @public
|
||||
*/
|
||||
AutoRefresh.Defaults = {
|
||||
autoRefresh: true,
|
||||
autoRefreshInterval: 500
|
||||
};
|
||||
|
||||
/**
|
||||
* Watches the element.
|
||||
*/
|
||||
AutoRefresh.prototype.watch = function() {
|
||||
if (this._interval) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._visible = this._core.isVisible();
|
||||
this._interval = window.setInterval($.proxy(this.refresh, this), this._core.settings.autoRefreshInterval);
|
||||
};
|
||||
|
||||
/**
|
||||
* Refreshes the element.
|
||||
*/
|
||||
AutoRefresh.prototype.refresh = function() {
|
||||
if (this._core.isVisible() === this._visible) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._visible = !this._visible;
|
||||
|
||||
this._core.$element.toggleClass('owl-hidden', !this._visible);
|
||||
|
||||
this._visible && (this._core.invalidate('width') && this._core.refresh());
|
||||
};
|
||||
|
||||
/**
|
||||
* Destroys the plugin.
|
||||
*/
|
||||
AutoRefresh.prototype.destroy = function() {
|
||||
var handler, property;
|
||||
|
||||
window.clearInterval(this._interval);
|
||||
|
||||
for (handler in this._handlers) {
|
||||
this._core.$element.off(handler, this._handlers[handler]);
|
||||
}
|
||||
for (property in Object.getOwnPropertyNames(this)) {
|
||||
typeof this[property] != 'function' && (this[property] = null);
|
||||
}
|
||||
};
|
||||
|
||||
$.fn.owlCarousel.Constructor.Plugins.AutoRefresh = AutoRefresh;
|
||||
|
||||
})(window.Zepto || window.jQuery, window, document);
|
1750
wp-content/plugins/slider-bws/js/owl.carousel/owl.carousel.js
Normal file
1750
wp-content/plugins/slider-bws/js/owl.carousel/owl.carousel.js
Normal file
File diff suppressed because it is too large
Load Diff
122
wp-content/plugins/slider-bws/js/owl.carousel/owl.hash.js
Normal file
122
wp-content/plugins/slider-bws/js/owl.carousel/owl.hash.js
Normal file
@ -0,0 +1,122 @@
|
||||
/**
|
||||
* Hash Plugin
|
||||
* @version 2.3.4
|
||||
* @author Artus Kolanowski
|
||||
* @author David Deutsch
|
||||
* @license The MIT License (MIT)
|
||||
*/
|
||||
;(function($, window, document, undefined) {
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Creates the hash plugin.
|
||||
* @class The Hash Plugin
|
||||
* @param {Owl} carousel - The Owl Carousel
|
||||
*/
|
||||
var Hash = function(carousel) {
|
||||
/**
|
||||
* Reference to the core.
|
||||
* @protected
|
||||
* @type {Owl}
|
||||
*/
|
||||
this._core = carousel;
|
||||
|
||||
/**
|
||||
* Hash index for the items.
|
||||
* @protected
|
||||
* @type {Object}
|
||||
*/
|
||||
this._hashes = {};
|
||||
|
||||
/**
|
||||
* The carousel element.
|
||||
* @type {jQuery}
|
||||
*/
|
||||
this.$element = this._core.$element;
|
||||
|
||||
/**
|
||||
* All event handlers.
|
||||
* @protected
|
||||
* @type {Object}
|
||||
*/
|
||||
this._handlers = {
|
||||
'initialized.owl.carousel': $.proxy(function(e) {
|
||||
if (e.namespace && this._core.settings.startPosition === 'URLHash') {
|
||||
$(window).trigger('hashchange.owl.navigation');
|
||||
}
|
||||
}, this),
|
||||
'prepared.owl.carousel': $.proxy(function(e) {
|
||||
if (e.namespace) {
|
||||
var hash = $(e.content).find('[data-hash]').addBack('[data-hash]').attr('data-hash');
|
||||
|
||||
if (!hash) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._hashes[hash] = e.content;
|
||||
}
|
||||
}, this),
|
||||
'changed.owl.carousel': $.proxy(function(e) {
|
||||
if (e.namespace && e.property.name === 'position') {
|
||||
var current = this._core.items(this._core.relative(this._core.current())),
|
||||
hash = $.map(this._hashes, function(item, hash) {
|
||||
return item === current ? hash : null;
|
||||
}).join();
|
||||
|
||||
if (!hash || window.location.hash.slice(1) === hash) {
|
||||
return;
|
||||
}
|
||||
|
||||
window.location.hash = hash;
|
||||
}
|
||||
}, this)
|
||||
};
|
||||
|
||||
// set default options
|
||||
this._core.options = $.extend({}, Hash.Defaults, this._core.options);
|
||||
|
||||
// register the event handlers
|
||||
this.$element.on(this._handlers);
|
||||
|
||||
// register event listener for hash navigation
|
||||
$(window).on('hashchange.owl.navigation', $.proxy(function(e) {
|
||||
var hash = window.location.hash.substring(1),
|
||||
items = this._core.$stage.children(),
|
||||
position = this._hashes[hash] && items.index(this._hashes[hash]);
|
||||
|
||||
if (position === undefined || position === this._core.current()) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._core.to(this._core.relative(position), false, true);
|
||||
}, this));
|
||||
};
|
||||
|
||||
/**
|
||||
* Default options.
|
||||
* @public
|
||||
*/
|
||||
Hash.Defaults = {
|
||||
URLhashListener: false
|
||||
};
|
||||
|
||||
/**
|
||||
* Destroys the plugin.
|
||||
* @public
|
||||
*/
|
||||
Hash.prototype.destroy = function() {
|
||||
var handler, property;
|
||||
|
||||
$(window).off('hashchange.owl.navigation');
|
||||
|
||||
for (handler in this._handlers) {
|
||||
this._core.$element.off(handler, this._handlers[handler]);
|
||||
}
|
||||
for (property in Object.getOwnPropertyNames(this)) {
|
||||
typeof this[property] != 'function' && (this[property] = null);
|
||||
}
|
||||
};
|
||||
|
||||
$.fn.owlCarousel.Constructor.Plugins.Hash = Hash;
|
||||
|
||||
})(window.Zepto || window.jQuery, window, document);
|
149
wp-content/plugins/slider-bws/js/owl.carousel/owl.lazyload.js
Normal file
149
wp-content/plugins/slider-bws/js/owl.carousel/owl.lazyload.js
Normal file
@ -0,0 +1,149 @@
|
||||
/**
|
||||
* Lazy Plugin
|
||||
* @version 2.3.4
|
||||
* @author Bartosz Wojciechowski
|
||||
* @author David Deutsch
|
||||
* @license The MIT License (MIT)
|
||||
*/
|
||||
;(function($, window, document, undefined) {
|
||||
|
||||
/**
|
||||
* Creates the lazy plugin.
|
||||
* @class The Lazy Plugin
|
||||
* @param {Owl} carousel - The Owl Carousel
|
||||
*/
|
||||
var Lazy = function(carousel) {
|
||||
|
||||
/**
|
||||
* Reference to the core.
|
||||
* @protected
|
||||
* @type {Owl}
|
||||
*/
|
||||
this._core = carousel;
|
||||
|
||||
/**
|
||||
* Already loaded items.
|
||||
* @protected
|
||||
* @type {Array.<jQuery>}
|
||||
*/
|
||||
this._loaded = [];
|
||||
|
||||
/**
|
||||
* Event handlers.
|
||||
* @protected
|
||||
* @type {Object}
|
||||
*/
|
||||
this._handlers = {
|
||||
'initialized.owl.carousel change.owl.carousel resized.owl.carousel': $.proxy(function(e) {
|
||||
if (!e.namespace) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this._core.settings || !this._core.settings.lazyLoad) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ((e.property && e.property.name == 'position') || e.type == 'initialized') {
|
||||
var settings = this._core.settings,
|
||||
n = (settings.center && Math.ceil(settings.items / 2) || settings.items),
|
||||
i = ((settings.center && n * -1) || 0),
|
||||
position = (e.property && e.property.value !== undefined ? e.property.value : this._core.current()) + i,
|
||||
clones = this._core.clones().length,
|
||||
load = $.proxy(function(i, v) { this.load(v) }, this);
|
||||
//TODO: Need documentation for this new option
|
||||
if (settings.lazyLoadEager > 0) {
|
||||
n += settings.lazyLoadEager;
|
||||
// If the carousel is looping also preload images that are to the "left"
|
||||
if (settings.loop) {
|
||||
position -= settings.lazyLoadEager;
|
||||
n++;
|
||||
}
|
||||
}
|
||||
|
||||
while (i++ < n) {
|
||||
this.load(clones / 2 + this._core.relative(position));
|
||||
clones && $.each(this._core.clones(this._core.relative(position)), load);
|
||||
position++;
|
||||
}
|
||||
}
|
||||
}, this)
|
||||
};
|
||||
|
||||
// set the default options
|
||||
this._core.options = $.extend({}, Lazy.Defaults, this._core.options);
|
||||
|
||||
// register event handler
|
||||
this._core.$element.on(this._handlers);
|
||||
};
|
||||
|
||||
/**
|
||||
* Default options.
|
||||
* @public
|
||||
*/
|
||||
Lazy.Defaults = {
|
||||
lazyLoad: false,
|
||||
lazyLoadEager: 0
|
||||
};
|
||||
|
||||
/**
|
||||
* Loads all resources of an item at the specified position.
|
||||
* @param {Number} position - The absolute position of the item.
|
||||
* @protected
|
||||
*/
|
||||
Lazy.prototype.load = function(position) {
|
||||
var $item = this._core.$stage.children().eq(position),
|
||||
$elements = $item && $item.find('.owl-lazy');
|
||||
|
||||
if (!$elements || $.inArray($item.get(0), this._loaded) > -1) {
|
||||
return;
|
||||
}
|
||||
|
||||
$elements.each($.proxy(function(index, element) {
|
||||
var $element = $(element), image,
|
||||
url = (window.devicePixelRatio > 1 && $element.attr('data-src-retina')) || $element.attr('data-src') || $element.attr('data-srcset');
|
||||
|
||||
this._core.trigger('load', { element: $element, url: url }, 'lazy');
|
||||
|
||||
if ($element.is('img')) {
|
||||
$element.one('load.owl.lazy', $.proxy(function() {
|
||||
$element.css('opacity', 1);
|
||||
this._core.trigger('loaded', { element: $element, url: url }, 'lazy');
|
||||
}, this)).attr('src', url);
|
||||
} else if ($element.is('source')) {
|
||||
$element.one('load.owl.lazy', $.proxy(function() {
|
||||
this._core.trigger('loaded', { element: $element, url: url }, 'lazy');
|
||||
}, this)).attr('srcset', url);
|
||||
} else {
|
||||
image = new Image();
|
||||
image.onload = $.proxy(function() {
|
||||
$element.css({
|
||||
'background-image': 'url("' + url + '")',
|
||||
'opacity': '1'
|
||||
});
|
||||
this._core.trigger('loaded', { element: $element, url: url }, 'lazy');
|
||||
}, this);
|
||||
image.src = url;
|
||||
}
|
||||
}, this));
|
||||
|
||||
this._loaded.push($item.get(0));
|
||||
};
|
||||
|
||||
/**
|
||||
* Destroys the plugin.
|
||||
* @public
|
||||
*/
|
||||
Lazy.prototype.destroy = function() {
|
||||
var handler, property;
|
||||
|
||||
for (handler in this.handlers) {
|
||||
this._core.$element.off(handler, this.handlers[handler]);
|
||||
}
|
||||
for (property in Object.getOwnPropertyNames(this)) {
|
||||
typeof this[property] != 'function' && (this[property] = null);
|
||||
}
|
||||
};
|
||||
|
||||
$.fn.owlCarousel.Constructor.Plugins.Lazy = Lazy;
|
||||
|
||||
})(window.Zepto || window.jQuery, window, document);
|
406
wp-content/plugins/slider-bws/js/owl.carousel/owl.navigation.js
Normal file
406
wp-content/plugins/slider-bws/js/owl.carousel/owl.navigation.js
Normal file
@ -0,0 +1,406 @@
|
||||
/**
|
||||
* Navigation Plugin
|
||||
* @version 2.3.4
|
||||
* @author Artus Kolanowski
|
||||
* @author David Deutsch
|
||||
* @license The MIT License (MIT)
|
||||
*/
|
||||
;(function($, window, document, undefined) {
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Creates the navigation plugin.
|
||||
* @class The Navigation Plugin
|
||||
* @param {Owl} carousel - The Owl Carousel.
|
||||
*/
|
||||
var Navigation = function(carousel) {
|
||||
/**
|
||||
* Reference to the core.
|
||||
* @protected
|
||||
* @type {Owl}
|
||||
*/
|
||||
this._core = carousel;
|
||||
|
||||
/**
|
||||
* Indicates whether the plugin is initialized or not.
|
||||
* @protected
|
||||
* @type {Boolean}
|
||||
*/
|
||||
this._initialized = false;
|
||||
|
||||
/**
|
||||
* The current paging indexes.
|
||||
* @protected
|
||||
* @type {Array}
|
||||
*/
|
||||
this._pages = [];
|
||||
|
||||
/**
|
||||
* All DOM elements of the user interface.
|
||||
* @protected
|
||||
* @type {Object}
|
||||
*/
|
||||
this._controls = {};
|
||||
|
||||
/**
|
||||
* Markup for an indicator.
|
||||
* @protected
|
||||
* @type {Array.<String>}
|
||||
*/
|
||||
this._templates = [];
|
||||
|
||||
/**
|
||||
* The carousel element.
|
||||
* @type {jQuery}
|
||||
*/
|
||||
this.$element = this._core.$element;
|
||||
|
||||
/**
|
||||
* Overridden methods of the carousel.
|
||||
* @protected
|
||||
* @type {Object}
|
||||
*/
|
||||
this._overrides = {
|
||||
next: this._core.next,
|
||||
prev: this._core.prev,
|
||||
to: this._core.to
|
||||
};
|
||||
|
||||
/**
|
||||
* All event handlers.
|
||||
* @protected
|
||||
* @type {Object}
|
||||
*/
|
||||
this._handlers = {
|
||||
'prepared.owl.carousel': $.proxy(function(e) {
|
||||
if (e.namespace && this._core.settings.dotsData) {
|
||||
this._templates.push('<div class="' + this._core.settings.dotClass + '">' +
|
||||
$(e.content).find('[data-dot]').addBack('[data-dot]').attr('data-dot') + '</div>');
|
||||
}
|
||||
}, this),
|
||||
'added.owl.carousel': $.proxy(function(e) {
|
||||
if (e.namespace && this._core.settings.dotsData) {
|
||||
this._templates.splice(e.position, 0, this._templates.pop());
|
||||
}
|
||||
}, this),
|
||||
'remove.owl.carousel': $.proxy(function(e) {
|
||||
if (e.namespace && this._core.settings.dotsData) {
|
||||
this._templates.splice(e.position, 1);
|
||||
}
|
||||
}, this),
|
||||
'changed.owl.carousel': $.proxy(function(e) {
|
||||
if (e.namespace && e.property.name == 'position') {
|
||||
this.draw();
|
||||
}
|
||||
}, this),
|
||||
'initialized.owl.carousel': $.proxy(function(e) {
|
||||
if (e.namespace && !this._initialized) {
|
||||
this._core.trigger('initialize', null, 'navigation');
|
||||
this.initialize();
|
||||
this.update();
|
||||
this.draw();
|
||||
this._initialized = true;
|
||||
this._core.trigger('initialized', null, 'navigation');
|
||||
}
|
||||
}, this),
|
||||
'refreshed.owl.carousel': $.proxy(function(e) {
|
||||
if (e.namespace && this._initialized) {
|
||||
this._core.trigger('refresh', null, 'navigation');
|
||||
this.update();
|
||||
this.draw();
|
||||
this._core.trigger('refreshed', null, 'navigation');
|
||||
}
|
||||
}, this)
|
||||
};
|
||||
|
||||
// set default options
|
||||
this._core.options = $.extend({}, Navigation.Defaults, this._core.options);
|
||||
|
||||
// register event handlers
|
||||
this.$element.on(this._handlers);
|
||||
};
|
||||
|
||||
/**
|
||||
* Default options.
|
||||
* @public
|
||||
* @todo Rename `slideBy` to `navBy`
|
||||
*/
|
||||
Navigation.Defaults = {
|
||||
nav: false,
|
||||
navText: [
|
||||
'<span aria-label="' + 'Previous' + '">‹</span>',
|
||||
'<span aria-label="' + 'Next' + '">›</span>'
|
||||
],
|
||||
navSpeed: false,
|
||||
navElement: 'button type="button" role="presentation"',
|
||||
navContainer: false,
|
||||
navContainerClass: 'owl-nav',
|
||||
navClass: [
|
||||
'owl-prev',
|
||||
'owl-next'
|
||||
],
|
||||
slideBy: 1,
|
||||
dotClass: 'owl-dot',
|
||||
dotsClass: 'owl-dots',
|
||||
dots: true,
|
||||
dotsEach: false,
|
||||
dotsData: false,
|
||||
dotsSpeed: false,
|
||||
dotsContainer: false
|
||||
};
|
||||
|
||||
/**
|
||||
* Initializes the layout of the plugin and extends the carousel.
|
||||
* @protected
|
||||
*/
|
||||
Navigation.prototype.initialize = function() {
|
||||
var override,
|
||||
settings = this._core.settings;
|
||||
|
||||
// create DOM structure for relative navigation
|
||||
this._controls.$relative = (settings.navContainer ? $(settings.navContainer)
|
||||
: $('<div>').addClass(settings.navContainerClass).appendTo(this.$element)).addClass('disabled');
|
||||
|
||||
this._controls.$previous = $('<' + settings.navElement + '>')
|
||||
.addClass(settings.navClass[0])
|
||||
.html(settings.navText[0])
|
||||
.prependTo(this._controls.$relative)
|
||||
.on('click', $.proxy(function(e) {
|
||||
this.prev(settings.navSpeed);
|
||||
}, this));
|
||||
this._controls.$next = $('<' + settings.navElement + '>')
|
||||
.addClass(settings.navClass[1])
|
||||
.html(settings.navText[1])
|
||||
.appendTo(this._controls.$relative)
|
||||
.on('click', $.proxy(function(e) {
|
||||
this.next(settings.navSpeed);
|
||||
}, this));
|
||||
|
||||
// create DOM structure for absolute navigation
|
||||
if (!settings.dotsData) {
|
||||
this._templates = [ $('<button role="button">')
|
||||
.addClass(settings.dotClass)
|
||||
.append($('<span>'))
|
||||
.prop('outerHTML') ];
|
||||
}
|
||||
|
||||
this._controls.$absolute = (settings.dotsContainer ? $(settings.dotsContainer)
|
||||
: $('<div>').addClass(settings.dotsClass).appendTo(this.$element)).addClass('disabled');
|
||||
|
||||
this._controls.$absolute.on('click', 'button', $.proxy(function(e) {
|
||||
var index = $(e.target).parent().is(this._controls.$absolute)
|
||||
? $(e.target).index() : $(e.target).parent().index();
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
this.to(index, settings.dotsSpeed);
|
||||
}, this));
|
||||
|
||||
/*$el.on('focusin', function() {
|
||||
$(document).off(".carousel");
|
||||
|
||||
$(document).on('keydown.carousel', function(e) {
|
||||
if(e.keyCode == 37) {
|
||||
$el.trigger('prev.owl')
|
||||
}
|
||||
if(e.keyCode == 39) {
|
||||
$el.trigger('next.owl')
|
||||
}
|
||||
});
|
||||
});*/
|
||||
|
||||
// override public methods of the carousel
|
||||
for (override in this._overrides) {
|
||||
this._core[override] = $.proxy(this[override], this);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Destroys the plugin.
|
||||
* @protected
|
||||
*/
|
||||
Navigation.prototype.destroy = function() {
|
||||
var handler, control, property, override, settings;
|
||||
settings = this._core.settings;
|
||||
|
||||
for (handler in this._handlers) {
|
||||
this.$element.off(handler, this._handlers[handler]);
|
||||
}
|
||||
for (control in this._controls) {
|
||||
if (control === '$relative' && settings.navContainer) {
|
||||
this._controls[control].html('');
|
||||
} else {
|
||||
this._controls[control].remove();
|
||||
}
|
||||
}
|
||||
for (override in this.overides) {
|
||||
this._core[override] = this._overrides[override];
|
||||
}
|
||||
for (property in Object.getOwnPropertyNames(this)) {
|
||||
typeof this[property] != 'function' && (this[property] = null);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Updates the internal state.
|
||||
* @protected
|
||||
*/
|
||||
Navigation.prototype.update = function() {
|
||||
var i, j, k,
|
||||
lower = this._core.clones().length / 2,
|
||||
upper = lower + this._core.items().length,
|
||||
maximum = this._core.maximum(true),
|
||||
settings = this._core.settings,
|
||||
size = settings.center || settings.autoWidth || settings.dotsData
|
||||
? 1 : settings.dotsEach || settings.items;
|
||||
|
||||
if (settings.slideBy !== 'page') {
|
||||
settings.slideBy = Math.min(settings.slideBy, settings.items);
|
||||
}
|
||||
|
||||
if (settings.dots || settings.slideBy == 'page') {
|
||||
this._pages = [];
|
||||
|
||||
for (i = lower, j = 0, k = 0; i < upper; i++) {
|
||||
if (j >= size || j === 0) {
|
||||
this._pages.push({
|
||||
start: Math.min(maximum, i - lower),
|
||||
end: i - lower + size - 1
|
||||
});
|
||||
if (Math.min(maximum, i - lower) === maximum) {
|
||||
break;
|
||||
}
|
||||
j = 0, ++k;
|
||||
}
|
||||
j += this._core.mergers(this._core.relative(i));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Draws the user interface.
|
||||
* @todo The option `dotsData` wont work.
|
||||
* @protected
|
||||
*/
|
||||
Navigation.prototype.draw = function() {
|
||||
var difference,
|
||||
settings = this._core.settings,
|
||||
disabled = this._core.items().length <= settings.items,
|
||||
index = this._core.relative(this._core.current()),
|
||||
loop = settings.loop || settings.rewind;
|
||||
|
||||
this._controls.$relative.toggleClass('disabled', !settings.nav || disabled);
|
||||
|
||||
if (settings.nav) {
|
||||
this._controls.$previous.toggleClass('disabled', !loop && index <= this._core.minimum(true));
|
||||
this._controls.$next.toggleClass('disabled', !loop && index >= this._core.maximum(true));
|
||||
}
|
||||
|
||||
this._controls.$absolute.toggleClass('disabled', !settings.dots || disabled);
|
||||
|
||||
if (settings.dots) {
|
||||
difference = this._pages.length - this._controls.$absolute.children().length;
|
||||
|
||||
if (settings.dotsData && difference !== 0) {
|
||||
this._controls.$absolute.html(this._templates.join(''));
|
||||
} else if (difference > 0) {
|
||||
this._controls.$absolute.append(new Array(difference + 1).join(this._templates[0]));
|
||||
} else if (difference < 0) {
|
||||
this._controls.$absolute.children().slice(difference).remove();
|
||||
}
|
||||
|
||||
this._controls.$absolute.find('.active').removeClass('active');
|
||||
this._controls.$absolute.children().eq($.inArray(this.current(), this._pages)).addClass('active');
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Extends event data.
|
||||
* @protected
|
||||
* @param {Event} event - The event object which gets thrown.
|
||||
*/
|
||||
Navigation.prototype.onTrigger = function(event) {
|
||||
var settings = this._core.settings;
|
||||
|
||||
event.page = {
|
||||
index: $.inArray(this.current(), this._pages),
|
||||
count: this._pages.length,
|
||||
size: settings && (settings.center || settings.autoWidth || settings.dotsData
|
||||
? 1 : settings.dotsEach || settings.items)
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* Gets the current page position of the carousel.
|
||||
* @protected
|
||||
* @returns {Number}
|
||||
*/
|
||||
Navigation.prototype.current = function() {
|
||||
var current = this._core.relative(this._core.current());
|
||||
return $.grep(this._pages, $.proxy(function(page, index) {
|
||||
return page.start <= current && page.end >= current;
|
||||
}, this)).pop();
|
||||
};
|
||||
|
||||
/**
|
||||
* Gets the current succesor/predecessor position.
|
||||
* @protected
|
||||
* @returns {Number}
|
||||
*/
|
||||
Navigation.prototype.getPosition = function(successor) {
|
||||
var position, length,
|
||||
settings = this._core.settings;
|
||||
|
||||
if (settings.slideBy == 'page') {
|
||||
position = $.inArray(this.current(), this._pages);
|
||||
length = this._pages.length;
|
||||
successor ? ++position : --position;
|
||||
position = this._pages[((position % length) + length) % length].start;
|
||||
} else {
|
||||
position = this._core.relative(this._core.current());
|
||||
length = this._core.items().length;
|
||||
successor ? position += settings.slideBy : position -= settings.slideBy;
|
||||
}
|
||||
|
||||
return position;
|
||||
};
|
||||
|
||||
/**
|
||||
* Slides to the next item or page.
|
||||
* @public
|
||||
* @param {Number} [speed=false] - The time in milliseconds for the transition.
|
||||
*/
|
||||
Navigation.prototype.next = function(speed) {
|
||||
$.proxy(this._overrides.to, this._core)(this.getPosition(true), speed);
|
||||
};
|
||||
|
||||
/**
|
||||
* Slides to the previous item or page.
|
||||
* @public
|
||||
* @param {Number} [speed=false] - The time in milliseconds for the transition.
|
||||
*/
|
||||
Navigation.prototype.prev = function(speed) {
|
||||
$.proxy(this._overrides.to, this._core)(this.getPosition(false), speed);
|
||||
};
|
||||
|
||||
/**
|
||||
* Slides to the specified item or page.
|
||||
* @public
|
||||
* @param {Number} position - The position of the item or page.
|
||||
* @param {Number} [speed] - The time in milliseconds for the transition.
|
||||
* @param {Boolean} [standard=false] - Whether to use the standard behaviour or not.
|
||||
*/
|
||||
Navigation.prototype.to = function(position, speed, standard) {
|
||||
var length;
|
||||
|
||||
if (!standard && this._pages.length) {
|
||||
length = this._pages.length;
|
||||
$.proxy(this._overrides.to, this._core)(this._pages[((position % length) + length) % length].start, speed);
|
||||
} else {
|
||||
$.proxy(this._overrides.to, this._core)(position, speed);
|
||||
}
|
||||
};
|
||||
|
||||
$.fn.owlCarousel.Constructor.Plugins.Navigation = Navigation;
|
||||
|
||||
})(window.Zepto || window.jQuery, window, document);
|
83
wp-content/plugins/slider-bws/js/owl.carousel/owl.support.js
Normal file
83
wp-content/plugins/slider-bws/js/owl.carousel/owl.support.js
Normal file
@ -0,0 +1,83 @@
|
||||
/**
|
||||
* Support Plugin
|
||||
*
|
||||
* @version 2.3.4
|
||||
* @author Vivid Planet Software GmbH
|
||||
* @author Artus Kolanowski
|
||||
* @author David Deutsch
|
||||
* @license The MIT License (MIT)
|
||||
*/
|
||||
;(function($, window, document, undefined) {
|
||||
|
||||
var style = $('<support>').get(0).style,
|
||||
prefixes = 'Webkit Moz O ms'.split(' '),
|
||||
events = {
|
||||
transition: {
|
||||
end: {
|
||||
WebkitTransition: 'webkitTransitionEnd',
|
||||
MozTransition: 'transitionend',
|
||||
OTransition: 'oTransitionEnd',
|
||||
transition: 'transitionend'
|
||||
}
|
||||
},
|
||||
animation: {
|
||||
end: {
|
||||
WebkitAnimation: 'webkitAnimationEnd',
|
||||
MozAnimation: 'animationend',
|
||||
OAnimation: 'oAnimationEnd',
|
||||
animation: 'animationend'
|
||||
}
|
||||
}
|
||||
},
|
||||
tests = {
|
||||
csstransforms: function() {
|
||||
return !!test('transform');
|
||||
},
|
||||
csstransforms3d: function() {
|
||||
return !!test('perspective');
|
||||
},
|
||||
csstransitions: function() {
|
||||
return !!test('transition');
|
||||
},
|
||||
cssanimations: function() {
|
||||
return !!test('animation');
|
||||
}
|
||||
};
|
||||
|
||||
function test(property, prefixed) {
|
||||
var result = false,
|
||||
upper = property.charAt(0).toUpperCase() + property.slice(1);
|
||||
|
||||
$.each((property + ' ' + prefixes.join(upper + ' ') + upper).split(' '), function(i, property) {
|
||||
if (style[property] !== undefined) {
|
||||
result = prefixed ? property : true;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
function prefixed(property) {
|
||||
return test(property, true);
|
||||
}
|
||||
|
||||
if (tests.csstransitions()) {
|
||||
/* jshint -W053 */
|
||||
$.support.transition = new String(prefixed('transition'))
|
||||
$.support.transition.end = events.transition.end[ $.support.transition ];
|
||||
}
|
||||
|
||||
if (tests.cssanimations()) {
|
||||
/* jshint -W053 */
|
||||
$.support.animation = new String(prefixed('animation'))
|
||||
$.support.animation.end = events.animation.end[ $.support.animation ];
|
||||
}
|
||||
|
||||
if (tests.csstransforms()) {
|
||||
/* jshint -W053 */
|
||||
$.support.transform = new String(prefixed('transform'));
|
||||
$.support.transform3d = tests.csstransforms3d();
|
||||
}
|
||||
|
||||
})(window.Zepto || window.jQuery, window, document);
|
327
wp-content/plugins/slider-bws/js/owl.carousel/owl.video.js
Normal file
327
wp-content/plugins/slider-bws/js/owl.carousel/owl.video.js
Normal file
@ -0,0 +1,327 @@
|
||||
/**
|
||||
* Video Plugin
|
||||
* @version 2.3.4
|
||||
* @author Bartosz Wojciechowski
|
||||
* @author David Deutsch
|
||||
* @license The MIT License (MIT)
|
||||
*/
|
||||
;(function($, window, document, undefined) {
|
||||
|
||||
/**
|
||||
* Creates the video plugin.
|
||||
* @class The Video Plugin
|
||||
* @param {Owl} carousel - The Owl Carousel
|
||||
*/
|
||||
var Video = function(carousel) {
|
||||
/**
|
||||
* Reference to the core.
|
||||
* @protected
|
||||
* @type {Owl}
|
||||
*/
|
||||
this._core = carousel;
|
||||
|
||||
/**
|
||||
* Cache all video URLs.
|
||||
* @protected
|
||||
* @type {Object}
|
||||
*/
|
||||
this._videos = {};
|
||||
|
||||
/**
|
||||
* Current playing item.
|
||||
* @protected
|
||||
* @type {jQuery}
|
||||
*/
|
||||
this._playing = null;
|
||||
|
||||
/**
|
||||
* All event handlers.
|
||||
* @todo The cloned content removale is too late
|
||||
* @protected
|
||||
* @type {Object}
|
||||
*/
|
||||
this._handlers = {
|
||||
'initialized.owl.carousel': $.proxy(function(e) {
|
||||
if (e.namespace) {
|
||||
this._core.register({ type: 'state', name: 'playing', tags: [ 'interacting' ] });
|
||||
}
|
||||
}, this),
|
||||
'resize.owl.carousel': $.proxy(function(e) {
|
||||
if (e.namespace && this._core.settings.video && this.isInFullScreen()) {
|
||||
e.preventDefault();
|
||||
}
|
||||
}, this),
|
||||
'refreshed.owl.carousel': $.proxy(function(e) {
|
||||
if (e.namespace && this._core.is('resizing')) {
|
||||
this._core.$stage.find('.cloned .owl-video-frame').remove();
|
||||
}
|
||||
}, this),
|
||||
'changed.owl.carousel': $.proxy(function(e) {
|
||||
if (e.namespace && e.property.name === 'position' && this._playing) {
|
||||
this.stop();
|
||||
}
|
||||
}, this),
|
||||
'prepared.owl.carousel': $.proxy(function(e) {
|
||||
if (!e.namespace) {
|
||||
return;
|
||||
}
|
||||
|
||||
var $element = $(e.content).find('.owl-video');
|
||||
|
||||
if ($element.length) {
|
||||
$element.css('display', 'none');
|
||||
this.fetch($element, $(e.content));
|
||||
}
|
||||
}, this)
|
||||
};
|
||||
|
||||
// set default options
|
||||
this._core.options = $.extend({}, Video.Defaults, this._core.options);
|
||||
|
||||
// register event handlers
|
||||
this._core.$element.on(this._handlers);
|
||||
|
||||
this._core.$element.on('click.owl.video', '.owl-video-play-icon', $.proxy(function(e) {
|
||||
this.play(e);
|
||||
}, this));
|
||||
};
|
||||
|
||||
/**
|
||||
* Default options.
|
||||
* @public
|
||||
*/
|
||||
Video.Defaults = {
|
||||
video: false,
|
||||
videoHeight: false,
|
||||
videoWidth: false
|
||||
};
|
||||
|
||||
/**
|
||||
* Gets the video ID and the type (YouTube/Vimeo/vzaar only).
|
||||
* @protected
|
||||
* @param {jQuery} target - The target containing the video data.
|
||||
* @param {jQuery} item - The item containing the video.
|
||||
*/
|
||||
Video.prototype.fetch = function(target, item) {
|
||||
var type = (function() {
|
||||
if (target.attr('data-vimeo-id')) {
|
||||
return 'vimeo';
|
||||
} else if (target.attr('data-vzaar-id')) {
|
||||
return 'vzaar'
|
||||
} else {
|
||||
return 'youtube';
|
||||
}
|
||||
})(),
|
||||
id = target.attr('data-vimeo-id') || target.attr('data-youtube-id') || target.attr('data-vzaar-id'),
|
||||
width = target.attr('data-width') || this._core.settings.videoWidth,
|
||||
height = target.attr('data-height') || this._core.settings.videoHeight,
|
||||
url = target.attr('href');
|
||||
|
||||
if (url) {
|
||||
|
||||
/*
|
||||
Parses the id's out of the following urls (and probably more):
|
||||
https://www.youtube.com/watch?v=:id
|
||||
https://youtu.be/:id
|
||||
https://vimeo.com/:id
|
||||
https://vimeo.com/channels/:channel/:id
|
||||
https://vimeo.com/groups/:group/videos/:id
|
||||
https://app.vzaar.com/videos/:id
|
||||
|
||||
Visual example: https://regexper.com/#(http%3A%7Chttps%3A%7C)%5C%2F%5C%2F(player.%7Cwww.%7Capp.)%3F(vimeo%5C.com%7Cyoutu(be%5C.com%7C%5C.be%7Cbe%5C.googleapis%5C.com)%7Cvzaar%5C.com)%5C%2F(video%5C%2F%7Cvideos%5C%2F%7Cembed%5C%2F%7Cchannels%5C%2F.%2B%5C%2F%7Cgroups%5C%2F.%2B%5C%2F%7Cwatch%5C%3Fv%3D%7Cv%5C%2F)%3F(%5BA-Za-z0-9._%25-%5D*)(%5C%26%5CS%2B)%3F
|
||||
*/
|
||||
|
||||
id = url.match(/(http:|https:|)\/\/(player.|www.|app.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com|be\-nocookie\.com)|vzaar\.com)\/(video\/|videos\/|embed\/|channels\/.+\/|groups\/.+\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(\&\S+)?/);
|
||||
|
||||
if (id[3].indexOf('youtu') > -1) {
|
||||
type = 'youtube';
|
||||
} else if (id[3].indexOf('vimeo') > -1) {
|
||||
type = 'vimeo';
|
||||
} else if (id[3].indexOf('vzaar') > -1) {
|
||||
type = 'vzaar';
|
||||
} else {
|
||||
throw new Error('Video URL not supported.');
|
||||
}
|
||||
id = id[6];
|
||||
} else {
|
||||
throw new Error('Missing video URL.');
|
||||
}
|
||||
|
||||
this._videos[url] = {
|
||||
type: type,
|
||||
id: id,
|
||||
width: width,
|
||||
height: height
|
||||
};
|
||||
|
||||
item.attr('data-video', url);
|
||||
|
||||
this.thumbnail(target, this._videos[url]);
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates video thumbnail.
|
||||
* @protected
|
||||
* @param {jQuery} target - The target containing the video data.
|
||||
* @param {Object} info - The video info object.
|
||||
* @see `fetch`
|
||||
*/
|
||||
Video.prototype.thumbnail = function(target, video) {
|
||||
var tnLink,
|
||||
icon,
|
||||
path,
|
||||
dimensions = video.width && video.height ? 'width:' + video.width + 'px;height:' + video.height + 'px;' : '',
|
||||
customTn = target.find('img'),
|
||||
srcType = 'src',
|
||||
lazyClass = '',
|
||||
settings = this._core.settings,
|
||||
create = function(path) {
|
||||
icon = '<div class="owl-video-play-icon"></div>';
|
||||
|
||||
if (settings.lazyLoad) {
|
||||
tnLink = $('<div/>',{
|
||||
"class": 'owl-video-tn ' + lazyClass,
|
||||
"srcType": path
|
||||
});
|
||||
} else {
|
||||
tnLink = $( '<div/>', {
|
||||
"class": "owl-video-tn",
|
||||
"style": 'opacity:1;background-image:url(' + path + ')'
|
||||
});
|
||||
}
|
||||
target.after(tnLink);
|
||||
target.after(icon);
|
||||
};
|
||||
|
||||
// wrap video content into owl-video-wrapper div
|
||||
target.wrap( $( '<div/>', {
|
||||
"class": "owl-video-wrapper",
|
||||
"style": dimensions
|
||||
}));
|
||||
|
||||
if (this._core.settings.lazyLoad) {
|
||||
srcType = 'data-src';
|
||||
lazyClass = 'owl-lazy';
|
||||
}
|
||||
|
||||
// custom thumbnail
|
||||
if (customTn.length) {
|
||||
create(customTn.attr(srcType));
|
||||
customTn.remove();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (video.type === 'youtube') {
|
||||
path = "//img.youtube.com/vi/" + video.id + "/hqdefault.jpg";
|
||||
create(path);
|
||||
} else if (video.type === 'vimeo') {
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: '//vimeo.com/api/v2/video/' + video.id + '.json',
|
||||
jsonp: 'callback',
|
||||
dataType: 'jsonp',
|
||||
success: function(data) {
|
||||
path = data[0].thumbnail_large;
|
||||
create(path);
|
||||
}
|
||||
});
|
||||
} else if (video.type === 'vzaar') {
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: '//vzaar.com/api/videos/' + video.id + '.json',
|
||||
jsonp: 'callback',
|
||||
dataType: 'jsonp',
|
||||
success: function(data) {
|
||||
path = data.framegrab_url;
|
||||
create(path);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Stops the current video.
|
||||
* @public
|
||||
*/
|
||||
Video.prototype.stop = function() {
|
||||
this._core.trigger('stop', null, 'video');
|
||||
this._playing.find('.owl-video-frame').remove();
|
||||
this._playing.removeClass('owl-video-playing');
|
||||
this._playing = null;
|
||||
this._core.leave('playing');
|
||||
this._core.trigger('stopped', null, 'video');
|
||||
};
|
||||
|
||||
/**
|
||||
* Starts the current video.
|
||||
* @public
|
||||
* @param {Event} event - The event arguments.
|
||||
*/
|
||||
Video.prototype.play = function(event) {
|
||||
var target = $(event.target),
|
||||
item = target.closest('.' + this._core.settings.itemClass),
|
||||
video = this._videos[item.attr('data-video')],
|
||||
width = video.width || '100%',
|
||||
height = video.height || this._core.$stage.height(),
|
||||
html,
|
||||
iframe;
|
||||
|
||||
if (this._playing) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._core.enter('playing');
|
||||
this._core.trigger('play', null, 'video');
|
||||
|
||||
item = this._core.items(this._core.relative(item.index()));
|
||||
|
||||
this._core.reset(item.index());
|
||||
|
||||
html = $( '<iframe frameborder="0" allowfullscreen mozallowfullscreen webkitAllowFullScreen ></iframe>' );
|
||||
html.attr( 'height', height );
|
||||
html.attr( 'width', width );
|
||||
if (video.type === 'youtube') {
|
||||
html.attr( 'src', '//www.youtube.com/embed/' + video.id + '?autoplay=1&rel=0&v=' + video.id );
|
||||
} else if (video.type === 'vimeo') {
|
||||
html.attr( 'src', '//player.vimeo.com/video/' + video.id + '?autoplay=1' );
|
||||
} else if (video.type === 'vzaar') {
|
||||
html.attr( 'src', '//view.vzaar.com/' + video.id + '/player?autoplay=true' );
|
||||
}
|
||||
|
||||
iframe = $(html).wrap( '<div class="owl-video-frame" />' ).insertAfter(item.find('.owl-video'));
|
||||
|
||||
this._playing = item.addClass('owl-video-playing');
|
||||
};
|
||||
|
||||
/**
|
||||
* Checks whether an video is currently in full screen mode or not.
|
||||
* @todo Bad style because looks like a readonly method but changes members.
|
||||
* @protected
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
Video.prototype.isInFullScreen = function() {
|
||||
var element = document.fullscreenElement || document.mozFullScreenElement ||
|
||||
document.webkitFullscreenElement;
|
||||
|
||||
return element && $(element).parent().hasClass('owl-video-frame');
|
||||
};
|
||||
|
||||
/**
|
||||
* Destroys the plugin.
|
||||
*/
|
||||
Video.prototype.destroy = function() {
|
||||
var handler, property;
|
||||
|
||||
this._core.$element.off('click.owl.video');
|
||||
|
||||
for (handler in this._handlers) {
|
||||
this._core.$element.off(handler, this._handlers[handler]);
|
||||
}
|
||||
for (property in Object.getOwnPropertyNames(this)) {
|
||||
typeof this[property] != 'function' && (this[property] = null);
|
||||
}
|
||||
};
|
||||
|
||||
$.fn.owlCarousel.Constructor.Plugins.Video = Video;
|
||||
|
||||
})(window.Zepto || window.jQuery, window, document);
|
111
wp-content/plugins/slider-bws/js/script.js
Normal file
111
wp-content/plugins/slider-bws/js/script.js
Normal file
@ -0,0 +1,111 @@
|
||||
( function( $ ) {
|
||||
$( window ).on( 'load', function() {
|
||||
|
||||
$( window ).on( 'resize', function() {
|
||||
/* Enable style for the Booking search form */
|
||||
|
||||
$( '.sldr_bkng_wrapper' ).each( function() {
|
||||
var sliderBoxWidth = $( this ).find( '.sldr_wrapper' ).width();
|
||||
|
||||
var sliderExist = $( this ).find( '.sldr_wrapper' ).length;
|
||||
|
||||
var return_location_list = $( this ).find( 'select[name="bws_bkng_search[bkng_return_location]"]' ).parent().parent();
|
||||
|
||||
if ( sliderExist > 0 && sliderBoxWidth > 900 ) {
|
||||
/* If the slider block width is more than 900px, display standard Booking search form */
|
||||
if ( $( this ).hasClass( 'sldr_bkng_inline_form' ) ) {
|
||||
$( this ).removeClass( 'sldr_bkng_inline_form' );
|
||||
}
|
||||
|
||||
if ( $( this ).hasClass( 'sldr_bkng_mobile_view' ) ) {
|
||||
$( this ).removeClass( 'sldr_bkng_mobile_view' );
|
||||
}
|
||||
|
||||
if ( $( this ).hasClass( 'sldr_bkng_mobile_inline_view' ) ) {
|
||||
$( this ).removeClass( 'sldr_bkng_mobile_inline_view' );
|
||||
}
|
||||
|
||||
if ( $( this ).find('.bws_bkng_search_products_item').parent().hasClass( 'bws_bkng_search_products_items' ) ) {
|
||||
$( this ).find( '.bws_bkng_search_products_item' ).unwrap( '<div class="bws_bkng_search_products_items" />' );
|
||||
}
|
||||
/* For theme Renty */
|
||||
var interval = setInterval( function() {
|
||||
if ( $( 'a.sbToggle' ).length > 0 ) {
|
||||
clearInterval( interval );
|
||||
$( 'a.sbToggle' ).css( 'width', '0' );
|
||||
}
|
||||
}, 50 );
|
||||
/* end */
|
||||
$( 'a.sbToggle' ).css( 'width', '0' );
|
||||
return_location_list.css( {'display' : 'block', 'width' : '100%'} );
|
||||
} else if( sliderExist > 0 && sliderBoxWidth > 520 && sliderBoxWidth < 900 ) {
|
||||
|
||||
if ( $( this ).hasClass( 'sldr_bkng_mobile_view' ) ) {
|
||||
$( this ).removeClass( 'sldr_bkng_mobile_view' );
|
||||
}
|
||||
|
||||
/* If the slider block width is less than 900px, display Booking search form in row */
|
||||
if ( ! $( this ).hasClass( 'sldr_bkng_mobile_inline_view' ) ) {
|
||||
$( this ).addClass( 'sldr_bkng_mobile_inline_view' );
|
||||
}
|
||||
|
||||
/* Show/hide the return locations list in the products search form */
|
||||
$( this ).find( '.crrntl-return-different-location' ).prop( 'checked', true );
|
||||
|
||||
/* Display hidden return locations field on the search form */
|
||||
$( this ).find( '.crrntl-return-different-location' ).on( 'change', function() {
|
||||
|
||||
/*var return_location_list = $( this ).parent().parent().next( 'div' );*/
|
||||
if ( $( this ).is( ':checked' ) ) {
|
||||
return_location_list.css( { 'display':'block', 'width':'21%' } );
|
||||
} else {
|
||||
return_location_list.hide();
|
||||
}
|
||||
} ).trigger( 'change' );
|
||||
|
||||
if ( ! $( this ).hasClass( 'sldr_bkng_inline_form' ) ) {
|
||||
$( this ).addClass( 'sldr_bkng_inline_form' );
|
||||
}
|
||||
|
||||
$( '.bws_bkng_search_products_form' ).each( function() {
|
||||
if ( ! $( this ).find( '.bws_bkng_filter_button' ).parent().hasClass( 'bws_bkng_buttons' ) ) {
|
||||
$( this ).find( '.bws_bkng_filter_button[type="submit"]' ).wrap( '<div class="bws_bkng_buttons" />' );
|
||||
|
||||
$( this ).find( '.bws_bkng_filter_button[type="reset"]' ).appendTo( $( this ).find( '.bws_bkng_buttons' ) );
|
||||
}
|
||||
|
||||
if ( ! $( this ).children().hasClass( 'bws_bkng_search_products_items' ) ) {
|
||||
$( this ).children().wrapAll( '<div class="bws_bkng_search_products_items" />' );
|
||||
}
|
||||
} );
|
||||
/* if there isn't any created location */
|
||||
if ( $( 'select[name="bws_bkng_search[bkng_return_location]"]' ).length == 0 ) {
|
||||
$( '.bws_bkng_search_products_item:nth-child(2)' ).css( 'top', '55%' );
|
||||
}
|
||||
/* end */
|
||||
} else if ( sliderExist > 0 && sliderBoxWidth < 520 ) {
|
||||
/* If the slider block width is less than 520px, display standard mobile Booking search form */
|
||||
if ( ! $( this ).hasClass( 'sldr_bkng_mobile_view' ) ) {
|
||||
$( this ).addClass( 'sldr_bkng_mobile_view' );
|
||||
}
|
||||
|
||||
if ( $( this ).hasClass( 'sldr_bkng_mobile_inline_view' ) ) {
|
||||
$( this ).removeClass( 'sldr_bkng_mobile_inline_view' );
|
||||
}
|
||||
|
||||
if ( $( this ).hasClass( 'sldr_bkng_inline_form' ) ) {
|
||||
$( this ).removeClass( 'sldr_bkng_inline_form' );
|
||||
}
|
||||
return_location_list.css( {'display' : 'block', 'width' : '100%'} );
|
||||
}
|
||||
} );
|
||||
/* Search form position regarding the height of the slider */
|
||||
$( '.sldr_bkng_wrapper' ).each( function() {
|
||||
var height = $( this ).find( '.sldr_wrapper' ).height();
|
||||
var marginTop = Math.ceil( height * -0.2 );
|
||||
$( this ).find( '.crrntl_search_form_wrap' ).find( '.crrntl_search_form' ).css( 'margin-top', marginTop );
|
||||
} );
|
||||
|
||||
} ).trigger( 'resize' );
|
||||
} );
|
||||
} )( jQuery );
|
Reference in New Issue
Block a user