// source --> https://inhala.org/tienda/wp-content/plugins/booking/js/wpbc_vars.js?ver=8.7.6
/**
* @version 1.0
* @package Booking Calendar
* @subpackage JS Variables
* @category Scripts
*
* @author wpdevelop
* @link https://wpbookingcalendar.com/
* @email info@wpbookingcalendar.com
*
* @modified 2014.05.20
*/
////////////////////////////////////////////////////////////////////////////////
// Eval specific variable value (integer, bool, arrays, etc...)
////////////////////////////////////////////////////////////////////////////////
function wpbc_define_var( wpbc_global_var ) {
if (wpbc_global_var === undefined) { return null; }
else { return jQuery.parseJSON(wpbc_global_var); } //FixIn:6.1
}
////////////////////////////////////////////////////////////////////////////////
// Define global Booking Calendar Varibales based on Localization
////////////////////////////////////////////////////////////////////////////////
var wpbc_ajaxurl = wpbc_global1.wpbc_ajaxurl;
var wpdev_bk_plugin_url = wpbc_global1.wpdev_bk_plugin_url;
var wpdev_bk_today = wpbc_define_var( wpbc_global1.wpdev_bk_today );
var visible_booking_id_on_page = wpbc_define_var( wpbc_global1.visible_booking_id_on_page );
var booking_max_monthes_in_calendar = wpbc_global1.booking_max_monthes_in_calendar;
var user_unavilable_days = wpbc_define_var( wpbc_global1.user_unavilable_days );
var wpdev_bk_edit_id_hash = wpbc_global1.wpdev_bk_edit_id_hash;
var wpdev_bk_plugin_filename = wpbc_global1.wpdev_bk_plugin_filename;
var bk_days_selection_mode = wpbc_global1.bk_days_selection_mode;
var wpdev_bk_personal = parseInt( wpbc_global1.wpdev_bk_personal );
var block_some_dates_from_today = parseInt( wpbc_global1.block_some_dates_from_today );
var message_verif_requred = wpbc_global1.message_verif_requred;
var message_verif_requred_for_check_box = wpbc_global1.message_verif_requred_for_check_box;
var message_verif_requred_for_radio_box = wpbc_global1.message_verif_requred_for_radio_box;
var message_verif_emeil = wpbc_global1.message_verif_emeil;
var message_verif_same_emeil = wpbc_global1.message_verif_same_emeil;
var message_verif_selectdts = wpbc_global1.message_verif_selectdts;
var parent_booking_resources = wpbc_define_var( wpbc_global1.parent_booking_resources );
var new_booking_title = wpbc_global1.new_booking_title;
var new_booking_title_time = parseInt( wpbc_global1.new_booking_title_time);
var type_of_thank_you_message = wpbc_global1.type_of_thank_you_message;
var thank_you_page_URL = wpbc_global1.thank_you_page_URL;
var is_am_pm_inside_time = ( wpbc_global1.is_am_pm_inside_time == "true" );
var is_booking_used_check_in_out_time = ( wpbc_global1.is_booking_used_check_in_out_time == "true" );
var wpbc_active_locale = wpbc_global1.wpbc_active_locale;
var wpbc_message_processing = wpbc_global1.wpbc_message_processing;
var wpbc_message_deleting = wpbc_global1.wpbc_message_deleting;
var wpbc_message_updating = wpbc_global1.wpbc_message_updating;
var wpbc_message_saving = wpbc_global1.wpbc_message_saving;
//FixIn: 8.2.1.99
var message_checkinouttime_error = wpbc_global1.message_checkinouttime_error; //FixIn:6.1.1.1
var message_starttime_error = wpbc_global1.message_starttime_error;
var message_endtime_error = wpbc_global1.message_endtime_error;
var message_rangetime_error = wpbc_global1.message_rangetime_error;
var message_durationtime_error = wpbc_global1.message_durationtime_error;
var bk_highlight_timeslot_word = wpbc_global1.bk_highlight_timeslot_word;
if (typeof wpbc_global2 !== 'undefined') {
var message_time_error = wpbc_global2.message_time_error;
}
if (typeof wpbc_global3 !== 'undefined') {
var bk_1click_mode_days_num = parseInt( wpbc_global3.bk_1click_mode_days_num );
var bk_1click_mode_days_start = wpbc_define_var( wpbc_global3.bk_1click_mode_days_start );
var bk_2clicks_mode_days_min = parseInt( wpbc_global3.bk_2clicks_mode_days_min );
var bk_2clicks_mode_days_max = parseInt( wpbc_global3.bk_2clicks_mode_days_max );
var bk_2clicks_mode_days_specific = wpbc_define_var( wpbc_global3.bk_2clicks_mode_days_specific );
var bk_2clicks_mode_days_start = wpbc_define_var( wpbc_global3.bk_2clicks_mode_days_start );
//FixIn: 8.2.1.99
bk_highlight_timeslot_word = wpbc_global3.bk_highlight_timeslot_word;
var is_booking_recurrent_time = ( wpbc_global3.is_booking_recurrent_time == "true" );
is_booking_used_check_in_out_time = ( wpbc_global3.is_booking_used_check_in_out_time == "true" );
var bk_currency_pos = wpbc_global3.bk_currency_pos; //FixIn: 7.0.1.49
}
if (typeof wpbc_global4 !== 'undefined') {
var wpbc_available_days_num_from_today = parseInt( wpbc_global4.wpbc_available_days_num_from_today );
var bk_cost_depends_from_selection_line1 = wpbc_global4.bk_cost_depends_from_selection_line1;
var bk_cost_depends_from_selection_line2 = wpbc_global4.bk_cost_depends_from_selection_line2;
var bk_cost_depends_from_selection_line3 = wpbc_global4.bk_cost_depends_from_selection_line3;
var bk_cost_depends_from_selection_line14summ = wpbc_global4.bk_cost_depends_from_selection_line14summ;
var bk_cost_depends_from_selection_line24summ = wpbc_global4.bk_cost_depends_from_selection_line24summ;
var wpdev_bk_season_filter = wpbc_define_var( wpbc_global4.wpdev_bk_season_filter );
var bk_show_info_in_form = ( wpbc_global4.bk_show_info_in_form == "true" ); //FixIn: 8.1.3.15
}
if (typeof wpbc_global5 !== 'undefined') {
var max_visitors_4_bk_res = wpbc_define_var( wpbc_global5.max_visitors_4_bk_res );
var message_verif_visitors_more_then_available = wpbc_global5.message_verif_visitors_more_then_available;
var is_use_visitors_number_for_availability = ( wpbc_global5.is_use_visitors_number_for_availability == "true" );
var availability_based_on = wpbc_global5.availability_based_on;
parent_booking_resources = wpbc_define_var( wpbc_global5.parent_booking_resources );
};
// source --> https://inhala.org/tienda/wp-content/plugins/booking/assets/libs/bootstrap/js/bootstrap.js?ver=3.3.5.1
/*!
* Bootstrap v3.3.5 (http://getbootstrap.com)
* Copyright 2011-2015 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
/*!
* Generated using the Bootstrap Customizer (http://getbootstrap.com/customize/?id=f4b4c9cb85df757ca08c)
* Config saved to config.json and https://gist.github.com/f4b4c9cb85df757ca08c
*/
if (typeof jQuery === 'undefined') {
throw new Error('Bootstrap\'s JavaScript requires jQuery')
}
+function ($) {
'use strict';
var version = $.fn.jquery.split(' ')[0].split('.')
if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1)) {
throw new Error('Bootstrap\'s JavaScript requires jQuery version 1.9.1 or higher')
}
}(jQuery);
/* ========================================================================
* Bootstrap: alert.js v3.3.5
* http://getbootstrap.com/javascript/#alerts
* ========================================================================
* Copyright 2011-2015 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ======================================================================== */
+function ($) {
'use strict';
// ALERT CLASS DEFINITION
// ======================
var dismiss = '[data-dismiss="alert"]'
var Alert = function (el) {
$(el).on('click', dismiss, this.close)
}
Alert.VERSION = '3.3.5'
Alert.TRANSITION_DURATION = 150
Alert.prototype.close = function (e) {
var $this = $(this)
var selector = $this.attr('data-target')
if (!selector) {
selector = $this.attr('href')
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
}
var $parent = $(selector)
if (e) e.preventDefault()
if (!$parent.length) {
$parent = $this.closest('.alert')
}
$parent.trigger(e = $.Event('close.bs.alert'))
if (e.isDefaultPrevented()) return
$parent.removeClass('in')
function removeElement() {
// detach from parent, fire event then clean up data
$parent.detach().trigger('closed.bs.alert').remove()
}
$.support.transition && $parent.hasClass('fade') ?
$parent
.one('bsTransitionEnd', removeElement)
.emulateTransitionEnd(Alert.TRANSITION_DURATION) :
removeElement()
}
// ALERT PLUGIN DEFINITION
// =======================
function Plugin(option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.alert')
if (!data) $this.data('bs.alert', (data = new Alert(this)))
if (typeof option == 'string') data[option].call($this)
})
}
var old = $.fn.alert
$.fn.alert = Plugin
$.fn.alert.Constructor = Alert
// ALERT NO CONFLICT
// =================
$.fn.alert.noConflict = function () {
$.fn.alert = old
return this
}
// ALERT DATA-API
// ==============
$(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close)
}(jQuery);
/* ========================================================================
* Bootstrap: button.js v3.3.5
* http://getbootstrap.com/javascript/#buttons
* ========================================================================
* Copyright 2011-2015 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ======================================================================== */
+function ($) {
'use strict';
// BUTTON PUBLIC CLASS DEFINITION
// ==============================
var Button = function (element, options) {
this.$element = $(element)
this.options = $.extend({}, Button.DEFAULTS, options)
this.isLoading = false
}
Button.VERSION = '3.3.5'
Button.DEFAULTS = {
loadingText: 'loading...'
}
Button.prototype.setState = function (state) {
var d = 'disabled'
var $el = this.$element
var val = $el.is('input') ? 'val' : 'html'
var data = $el.data()
state += 'Text'
if (data.resetText == null) $el.data('resetText', $el[val]())
// push to event loop to allow forms to submit
setTimeout($.proxy(function () {
$el[val](data[state] == null ? this.options[state] : data[state])
if (state == 'loadingText') {
this.isLoading = true
$el.addClass(d).attr(d, d)
} else if (this.isLoading) {
this.isLoading = false
$el.removeClass(d).removeAttr(d)
}
}, this), 0)
}
Button.prototype.toggle = function () {
var changed = true
var $parent = this.$element.closest('[data-toggle="buttons"]')
if ($parent.length) {
var $input = this.$element.find('input')
if ($input.prop('type') == 'radio') {
if ($input.prop('checked')) changed = false
$parent.find('.active').removeClass('active')
this.$element.addClass('active')
} else if ($input.prop('type') == 'checkbox') {
if (($input.prop('checked')) !== this.$element.hasClass('active')) changed = false
this.$element.toggleClass('active')
}
$input.prop('checked', this.$element.hasClass('active'))
if (changed) $input.trigger('change')
} else {
this.$element.attr('aria-pressed', !this.$element.hasClass('active'))
this.$element.toggleClass('active')
}
}
// BUTTON PLUGIN DEFINITION
// ========================
function Plugin(option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.button')
var options = typeof option == 'object' && option
if (!data) $this.data('bs.button', (data = new Button(this, options)))
if (option == 'toggle') data.toggle()
else if (option) data.setState(option)
})
}
var old = $.fn.button
$.fn.button = Plugin
$.fn.button.Constructor = Button
// BUTTON NO CONFLICT
// ==================
$.fn.button.noConflict = function () {
$.fn.button = old
return this
}
// BUTTON DATA-API
// ===============
$(document)
.on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) {
var $btn = $(e.target)
if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
Plugin.call($btn, 'toggle')
if (!($(e.target).is('input[type="radio"]') || $(e.target).is('input[type="checkbox"]'))) e.preventDefault()
})
.on('focus.bs.button.data-api blur.bs.button.data-api', '[data-toggle^="button"]', function (e) {
$(e.target).closest('.btn').toggleClass('focus', /^focus(in)?$/.test(e.type))
})
}(jQuery);
/* ========================================================================
* Bootstrap: carousel.js v3.3.5
* http://getbootstrap.com/javascript/#carousel
* ========================================================================
* Copyright 2011-2015 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ======================================================================== */
+function ($) {
'use strict';
// CAROUSEL CLASS DEFINITION
// =========================
var Carousel = function (element, options) {
this.$element = $(element)
this.$indicators = this.$element.find('.carousel-indicators')
this.options = options
this.paused = null
this.sliding = null
this.interval = null
this.$active = null
this.$items = null
this.options.keyboard && this.$element.on('keydown.bs.carousel', $.proxy(this.keydown, this))
this.options.pause == 'hover' && !('ontouchstart' in document.documentElement) && this.$element
.on('mouseenter.bs.carousel', $.proxy(this.pause, this))
.on('mouseleave.bs.carousel', $.proxy(this.cycle, this))
}
Carousel.VERSION = '3.3.5'
Carousel.TRANSITION_DURATION = 600
Carousel.DEFAULTS = {
interval: 5000,
pause: 'hover',
wrap: true,
keyboard: true
}
Carousel.prototype.keydown = function (e) {
if (/input|textarea/i.test(e.target.tagName)) return
switch (e.which) {
case 37: this.prev(); break
case 39: this.next(); break
default: return
}
e.preventDefault()
}
Carousel.prototype.cycle = function (e) {
e || (this.paused = false)
this.interval && clearInterval(this.interval)
this.options.interval
&& !this.paused
&& (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
return this
}
Carousel.prototype.getItemIndex = function (item) {
this.$items = item.parent().children('.item')
return this.$items.index(item || this.$active)
}
Carousel.prototype.getItemForDirection = function (direction, active) {
var activeIndex = this.getItemIndex(active)
var willWrap = (direction == 'prev' && activeIndex === 0)
|| (direction == 'next' && activeIndex == (this.$items.length - 1))
if (willWrap && !this.options.wrap) return active
var delta = direction == 'prev' ? -1 : 1
var itemIndex = (activeIndex + delta) % this.$items.length
return this.$items.eq(itemIndex)
}
Carousel.prototype.to = function (pos) {
var that = this
var activeIndex = this.getItemIndex(this.$active = this.$element.find('.item.active'))
if (pos > (this.$items.length - 1) || pos < 0) return
if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) // yes, "slid"
if (activeIndex == pos) return this.pause().cycle()
return this.slide(pos > activeIndex ? 'next' : 'prev', this.$items.eq(pos))
}
Carousel.prototype.pause = function (e) {
e || (this.paused = true)
if (this.$element.find('.next, .prev').length && $.support.transition) {
this.$element.trigger($.support.transition.end)
this.cycle(true)
}
this.interval = clearInterval(this.interval)
return this
}
Carousel.prototype.next = function () {
if (this.sliding) return
return this.slide('next')
}
Carousel.prototype.prev = function () {
if (this.sliding) return
return this.slide('prev')
}
Carousel.prototype.slide = function (type, next) {
var $active = this.$element.find('.item.active')
var $next = next || this.getItemForDirection(type, $active)
var isCycling = this.interval
var direction = type == 'next' ? 'left' : 'right'
var that = this
if ($next.hasClass('active')) return (this.sliding = false)
var relatedTarget = $next[0]
var slideEvent = $.Event('slide.bs.carousel', {
relatedTarget: relatedTarget,
direction: direction
})
this.$element.trigger(slideEvent)
if (slideEvent.isDefaultPrevented()) return
this.sliding = true
isCycling && this.pause()
if (this.$indicators.length) {
this.$indicators.find('.active').removeClass('active')
var $nextIndicator = $(this.$indicators.children()[this.getItemIndex($next)])
$nextIndicator && $nextIndicator.addClass('active')
}
var slidEvent = $.Event('slid.bs.carousel', { relatedTarget: relatedTarget, direction: direction }) // yes, "slid"
if ($.support.transition && this.$element.hasClass('slide')) {
$next.addClass(type)
$next[0].offsetWidth // force reflow
$active.addClass(direction)
$next.addClass(direction)
$active
.one('bsTransitionEnd', function () {
$next.removeClass([type, direction].join(' ')).addClass('active')
$active.removeClass(['active', direction].join(' '))
that.sliding = false
setTimeout(function () {
that.$element.trigger(slidEvent)
}, 0)
})
.emulateTransitionEnd(Carousel.TRANSITION_DURATION)
} else {
$active.removeClass('active')
$next.addClass('active')
this.sliding = false
this.$element.trigger(slidEvent)
}
isCycling && this.cycle()
return this
}
// CAROUSEL PLUGIN DEFINITION
// ==========================
function Plugin(option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.carousel')
var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option)
var action = typeof option == 'string' ? option : options.slide
if (!data) $this.data('bs.carousel', (data = new Carousel(this, options)))
if (typeof option == 'number') data.to(option)
else if (action) data[action]()
else if (options.interval) data.pause().cycle()
})
}
var old = $.fn.carousel
$.fn.carousel = Plugin
$.fn.carousel.Constructor = Carousel
// CAROUSEL NO CONFLICT
// ====================
$.fn.carousel.noConflict = function () {
$.fn.carousel = old
return this
}
// CAROUSEL DATA-API
// =================
var clickHandler = function (e) {
var href
var $this = $(this)
var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7
if (!$target.hasClass('carousel')) return
var options = $.extend({}, $target.data(), $this.data())
var slideIndex = $this.attr('data-slide-to')
if (slideIndex) options.interval = false
Plugin.call($target, options)
if (slideIndex) {
$target.data('bs.carousel').to(slideIndex)
}
e.preventDefault()
}
$(document)
.on('click.bs.carousel.data-api', '[data-slide]', clickHandler)
.on('click.bs.carousel.data-api', '[data-slide-to]', clickHandler)
$(window).on('load', function () {
$('[data-ride="carousel"]').each(function () {
var $carousel = $(this)
Plugin.call($carousel, $carousel.data())
})
})
}(jQuery);
/* ========================================================================
* Bootstrap: dropdown.js v3.3.5
* http://getbootstrap.com/javascript/#dropdowns
* ========================================================================
* Copyright 2011-2015 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ======================================================================== */
+function ($) {
'use strict';
// DROPDOWN CLASS DEFINITION
// =========================
var backdrop = '.dropdown-backdrop'
var toggle = '[data-toggle="dropdown"]'
var Dropdown = function (element) {
$(element).on('click.bs.dropdown', this.toggle)
}
Dropdown.VERSION = '3.3.5'
function getParent($this) {
var selector = $this.attr('data-target')
if (!selector) {
selector = $this.attr('href')
selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
}
var $parent = selector && $(selector)
return $parent && $parent.length ? $parent : $this.parent()
}
function clearMenus(e) {
if (e && e.which === 3) return
$(backdrop).remove()
$(toggle).each(function () {
var $this = $(this)
var $parent = getParent($this)
var relatedTarget = { relatedTarget: this }
if (!$parent.hasClass('open')) return
if (e && e.type == 'click' && /input|textarea/i.test(e.target.tagName) && $.contains($parent[0], e.target)) return
$parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
if (e.isDefaultPrevented()) return
$this.attr('aria-expanded', 'false')
$parent.removeClass('open').trigger('hidden.bs.dropdown', relatedTarget)
})
}
Dropdown.prototype.toggle = function (e) {
var $this = $(this)
if ($this.is('.disabled, :disabled')) return
var $parent = getParent($this)
var isActive = $parent.hasClass('open')
clearMenus()
if (!isActive) {
if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
// if mobile we use a backdrop because click events don't delegate
$(document.createElement('div'))
.addClass('dropdown-backdrop')
.insertAfter($(this))
.on('click', clearMenus)
}
var relatedTarget = { relatedTarget: this }
$parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget))
if (e.isDefaultPrevented()) return
$this
.trigger('focus')
.attr('aria-expanded', 'true')
$parent
.toggleClass('open')
.trigger('shown.bs.dropdown', relatedTarget)
}
return false
}
Dropdown.prototype.keydown = function (e) {
if (!/(38|40|27|32)/.test(e.which) || /input|textarea/i.test(e.target.tagName)) return
var $this = $(this)
e.preventDefault()
e.stopPropagation()
if ($this.is('.disabled, :disabled')) return
var $parent = getParent($this)
var isActive = $parent.hasClass('open')
if (!isActive && e.which != 27 || isActive && e.which == 27) {
if (e.which == 27) $parent.find(toggle).trigger('focus')
return $this.trigger('click')
}
var desc = ' li:not(.disabled):visible a'
var $items = $parent.find('.dropdown-menu' + desc)
if (!$items.length) return
var index = $items.index(e.target)
if (e.which == 38 && index > 0) index-- // up
if (e.which == 40 && index < $items.length - 1) index++ // down
if (!~index) index = 0
$items.eq(index).trigger('focus')
}
// DROPDOWN PLUGIN DEFINITION
// ==========================
function Plugin(option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.dropdown')
if (!data) $this.data('bs.dropdown', (data = new Dropdown(this)))
if (typeof option == 'string') data[option].call($this)
})
}
var old = $.fn.dropdown
$.fn.dropdown = Plugin
$.fn.dropdown.Constructor = Dropdown
// DROPDOWN NO CONFLICT
// ====================
$.fn.dropdown.noConflict = function () {
$.fn.dropdown = old
return this
}
// APPLY TO STANDARD DROPDOWN ELEMENTS
// ===================================
$(document)
.on('click.bs.dropdown.data-api', clearMenus)
.on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
.on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle)
.on('keydown.bs.dropdown.data-api', toggle, Dropdown.prototype.keydown)
.on('keydown.bs.dropdown.data-api', '.dropdown-menu', Dropdown.prototype.keydown)
}(jQuery);
/* ========================================================================
* Bootstrap: modal.js v3.3.5
* http://getbootstrap.com/javascript/#modals
* ========================================================================
* Copyright 2011-2015 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ======================================================================== */
+function ($) {
'use strict';
// MODAL CLASS DEFINITION
// ======================
var Modal = function (element, options) {
this.options = options
this.$body = $(document.body)
this.$element = $(element)
this.$dialog = this.$element.find('.modal-dialog')
this.$backdrop = null
this.isShown = null
this.originalBodyPad = null
this.scrollbarWidth = 0
this.ignoreBackdropClick = false
if (this.options.remote) {
this.$element
.find('.modal-content')
.load(this.options.remote, $.proxy(function () {
this.$element.trigger('loaded.bs.modal')
}, this))
}
}
Modal.VERSION = '3.3.5'
Modal.TRANSITION_DURATION = 300
Modal.BACKDROP_TRANSITION_DURATION = 150
Modal.DEFAULTS = {
backdrop: true,
keyboard: true,
show: true
}
Modal.prototype.toggle = function (_relatedTarget) {
return this.isShown ? this.hide() : this.show(_relatedTarget)
}
Modal.prototype.show = function (_relatedTarget) {
var that = this
var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })
this.$element.trigger(e)
if (this.isShown || e.isDefaultPrevented()) return
this.isShown = true
this.checkScrollbar()
this.setScrollbar()
this.$body.addClass('modal-open')
this.escape()
this.resize()
this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
this.$dialog.on('mousedown.dismiss.bs.modal', function () {
that.$element.one('mouseup.dismiss.bs.modal', function (e) {
if ($(e.target).is(that.$element)) that.ignoreBackdropClick = true
})
})
this.backdrop(function () {
var transition = $.support.transition && that.$element.hasClass('fade')
if (!that.$element.parent().length) {
that.$element.appendTo(that.$body) // don't move modals dom position
}
that.$element
.show()
.scrollTop(0)
that.adjustDialog()
if (transition) {
that.$element[0].offsetWidth // force reflow
}
that.$element.addClass('in')
that.enforceFocus()
var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget })
transition ?
that.$dialog // wait for modal to slide in
.one('bsTransitionEnd', function () {
that.$element.trigger('focus').trigger(e)
})
.emulateTransitionEnd(Modal.TRANSITION_DURATION) :
that.$element.trigger('focus').trigger(e)
})
}
Modal.prototype.hide = function (e) {
if (e) e.preventDefault()
e = $.Event('hide.bs.modal')
this.$element.trigger(e)
if (!this.isShown || e.isDefaultPrevented()) return
this.isShown = false
this.escape()
this.resize()
$(document).off('focusin.bs.modal')
this.$element
.removeClass('in')
.off('click.dismiss.bs.modal')
.off('mouseup.dismiss.bs.modal')
this.$dialog.off('mousedown.dismiss.bs.modal')
$.support.transition && this.$element.hasClass('fade') ?
this.$element
.one('bsTransitionEnd', $.proxy(this.hideModal, this))
.emulateTransitionEnd(Modal.TRANSITION_DURATION) :
this.hideModal()
}
Modal.prototype.enforceFocus = function () {
$(document)
.off('focusin.bs.modal') // guard against infinite focus loop
.on('focusin.bs.modal', $.proxy(function (e) {
if (this.$element[0] !== e.target && !this.$element.has(e.target).length) {
this.$element.trigger('focus')
}
}, this))
}
Modal.prototype.escape = function () {
if (this.isShown && this.options.keyboard) {
this.$element.on('keydown.dismiss.bs.modal', $.proxy(function (e) {
e.which == 27 && this.hide()
}, this))
} else if (!this.isShown) {
this.$element.off('keydown.dismiss.bs.modal')
}
}
Modal.prototype.resize = function () {
if (this.isShown) {
$(window).on('resize.bs.modal', $.proxy(this.handleUpdate, this))
} else {
$(window).off('resize.bs.modal')
}
}
Modal.prototype.hideModal = function () {
var that = this
this.$element.hide()
this.backdrop(function () {
that.$body.removeClass('modal-open')
that.resetAdjustments()
that.resetScrollbar()
that.$element.trigger('hidden.bs.modal')
})
}
Modal.prototype.removeBackdrop = function () {
this.$backdrop && this.$backdrop.remove()
this.$backdrop = null
}
Modal.prototype.backdrop = function (callback) {
var that = this
var animate = this.$element.hasClass('fade') ? 'fade' : ''
if (this.isShown && this.options.backdrop) {
var doAnimate = $.support.transition && animate
this.$backdrop = $(document.createElement('div'))
.addClass('modal-backdrop ' + animate)
.appendTo(this.$body)
this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) {
if (this.ignoreBackdropClick) {
this.ignoreBackdropClick = false
return
}
if (e.target !== e.currentTarget) return
this.options.backdrop == 'static'
? this.$element[0].focus()
: this.hide()
}, this))
if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
this.$backdrop.addClass('in')
if (!callback) return
doAnimate ?
this.$backdrop
.one('bsTransitionEnd', callback)
.emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :
callback()
} else if (!this.isShown && this.$backdrop) {
this.$backdrop.removeClass('in')
var callbackRemove = function () {
that.removeBackdrop()
callback && callback()
}
$.support.transition && this.$element.hasClass('fade') ?
this.$backdrop
.one('bsTransitionEnd', callbackRemove)
.emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :
callbackRemove()
} else if (callback) {
callback()
}
}
// these following methods are used to handle overflowing modals
Modal.prototype.handleUpdate = function () {
this.adjustDialog()
}
Modal.prototype.adjustDialog = function () {
var modalIsOverflowing = this.$element[0].scrollHeight > document.documentElement.clientHeight
this.$element.css({
paddingLeft: !this.bodyIsOverflowing && modalIsOverflowing ? this.scrollbarWidth : '',
paddingRight: this.bodyIsOverflowing && !modalIsOverflowing ? this.scrollbarWidth : ''
})
}
Modal.prototype.resetAdjustments = function () {
this.$element.css({
paddingLeft: '',
paddingRight: ''
})
}
Modal.prototype.checkScrollbar = function () {
var fullWindowWidth = window.innerWidth
if (!fullWindowWidth) { // workaround for missing window.innerWidth in IE8
var documentElementRect = document.documentElement.getBoundingClientRect()
fullWindowWidth = documentElementRect.right - Math.abs(documentElementRect.left)
}
this.bodyIsOverflowing = document.body.clientWidth < fullWindowWidth
this.scrollbarWidth = this.measureScrollbar()
}
Modal.prototype.setScrollbar = function () {
var bodyPad = parseInt((this.$body.css('padding-right') || 0), 10)
this.originalBodyPad = document.body.style.paddingRight || ''
if (this.bodyIsOverflowing) this.$body.css('padding-right', bodyPad + this.scrollbarWidth)
}
Modal.prototype.resetScrollbar = function () {
this.$body.css('padding-right', this.originalBodyPad)
}
Modal.prototype.measureScrollbar = function () { // thx walsh
var scrollDiv = document.createElement('div')
scrollDiv.className = 'modal-scrollbar-measure'
this.$body.append(scrollDiv)
var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth
this.$body[0].removeChild(scrollDiv)
return scrollbarWidth
}
// MODAL PLUGIN DEFINITION
// =======================
function Plugin(option, _relatedTarget) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.modal')
var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option)
if (!data) $this.data('bs.modal', (data = new Modal(this, options)))
if (typeof option == 'string') data[option](_relatedTarget)
else if (options.show) data.show(_relatedTarget)
})
}
var old = $.fn.modal
$.fn.modal = Plugin
$.fn.modal.Constructor = Modal
// MODAL NO CONFLICT
// =================
$.fn.modal.noConflict = function () {
$.fn.modal = old
return this
}
// MODAL DATA-API
// ==============
$(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) {
var $this = $(this)
var href = $this.attr('href')
var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) // strip for ie7
var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
if ($this.is('a')) e.preventDefault()
$target.one('show.bs.modal', function (showEvent) {
if (showEvent.isDefaultPrevented()) return // only register focus restorer if modal will actually get shown
$target.one('hidden.bs.modal', function () {
$this.is(':visible') && $this.trigger('focus')
})
})
Plugin.call($target, option, this)
})
}(jQuery);
/* ========================================================================
* Bootstrap: tooltip.js v3.3.5
* http://getbootstrap.com/javascript/#tooltip
* Inspired by the original jQuery.tipsy by Jason Frame
* ========================================================================
* Copyright 2011-2015 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ======================================================================== */
+function ($) {
'use strict';
// TOOLTIP PUBLIC CLASS DEFINITION
// ===============================
var Tooltip = function (element, options) {
this.type = null
this.options = null
this.enabled = null
this.timeout = null
this.hoverState = null
this.$element = null
this.inState = null
this.init('tooltip', element, options)
}
Tooltip.VERSION = '3.3.5'
Tooltip.TRANSITION_DURATION = 150
Tooltip.DEFAULTS = {
animation: true,
placement: 'top',
selector: false,
template: '
',
trigger: 'hover focus',
title: '',
delay: 0,
html: false,
container: false,
viewport: {
selector: 'body',
padding: 0
}
}
Tooltip.prototype.init = function (type, element, options) {
this.enabled = true
this.type = type
this.$element = $(element)
this.options = this.getOptions(options)
this.$viewport = this.options.viewport && $($.isFunction(this.options.viewport) ? this.options.viewport.call(this, this.$element) : (this.options.viewport.selector || this.options.viewport))
this.inState = { click: false, hover: false, focus: false }
if (this.$element[0] instanceof document.constructor && !this.options.selector) {
throw new Error('`selector` option must be specified when initializing ' + this.type + ' on the window.document object!')
}
var triggers = this.options.trigger.split(' ')
for (var i = triggers.length; i--;) {
var trigger = triggers[i]
if (trigger == 'click') {
this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
} else if (trigger != 'manual') {
var eventIn = trigger == 'hover' ? 'mouseenter' : 'focusin'
var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout'
this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
}
}
this.options.selector ?
(this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
this.fixTitle()
}
Tooltip.prototype.getDefaults = function () {
return Tooltip.DEFAULTS
}
Tooltip.prototype.getOptions = function (options) {
options = $.extend({}, this.getDefaults(), this.$element.data(), options)
if (options.delay && typeof options.delay == 'number') {
options.delay = {
show: options.delay,
hide: options.delay
}
}
return options
}
Tooltip.prototype.getDelegateOptions = function () {
var options = {}
var defaults = this.getDefaults()
this._options && $.each(this._options, function (key, value) {
if (defaults[key] != value) options[key] = value
})
return options
}
Tooltip.prototype.enter = function (obj) {
var self = obj instanceof this.constructor ?
obj : $(obj.currentTarget).data('bs.' + this.type)
if (!self) {
self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
$(obj.currentTarget).data('bs.' + this.type, self)
}
if (obj instanceof $.Event) {
self.inState[obj.type == 'focusin' ? 'focus' : 'hover'] = true
}
if (self.tip().hasClass('in') || self.hoverState == 'in') {
self.hoverState = 'in'
return
}
clearTimeout(self.timeout)
self.hoverState = 'in'
if (!self.options.delay || !self.options.delay.show) return self.show()
self.timeout = setTimeout(function () {
if (self.hoverState == 'in') self.show()
}, self.options.delay.show)
}
Tooltip.prototype.isInStateTrue = function () {
for (var key in this.inState) {
if (this.inState[key]) return true
}
return false
}
Tooltip.prototype.leave = function (obj) {
var self = obj instanceof this.constructor ?
obj : $(obj.currentTarget).data('bs.' + this.type)
if (!self) {
self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
$(obj.currentTarget).data('bs.' + this.type, self)
}
if (obj instanceof $.Event) {
self.inState[obj.type == 'focusout' ? 'focus' : 'hover'] = false
}
if (self.isInStateTrue()) return
clearTimeout(self.timeout)
self.hoverState = 'out'
if (!self.options.delay || !self.options.delay.hide) return self.hide()
self.timeout = setTimeout(function () {
if (self.hoverState == 'out') self.hide()
}, self.options.delay.hide)
}
Tooltip.prototype.show = function () {
var e = $.Event('show.bs.' + this.type)
if (this.hasContent() && this.enabled) {
this.$element.trigger(e)
var inDom = $.contains(this.$element[0].ownerDocument.documentElement, this.$element[0])
if (e.isDefaultPrevented() || !inDom) return
var that = this
var $tip = this.tip()
var tipId = this.getUID(this.type)
this.setContent()
$tip.attr('id', tipId)
this.$element.attr('aria-describedby', tipId)
if (this.options.animation) $tip.addClass('fade')
var placement = typeof this.options.placement == 'function' ?
this.options.placement.call(this, $tip[0], this.$element[0]) :
this.options.placement
var autoToken = /\s?auto?\s?/i
var autoPlace = autoToken.test(placement)
if (autoPlace) placement = placement.replace(autoToken, '') || 'top'
$tip
.detach()
.css({ top: 0, left: 0, display: 'block' })
.addClass(placement)
.data('bs.' + this.type, this)
this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
this.$element.trigger('inserted.bs.' + this.type)
var pos = this.getPosition()
var actualWidth = $tip[0].offsetWidth
var actualHeight = $tip[0].offsetHeight
if (autoPlace) {
var orgPlacement = placement
var viewportDim = this.getPosition(this.$viewport)
placement = placement == 'bottom' && pos.bottom + actualHeight > viewportDim.bottom ? 'top' :
placement == 'top' && pos.top - actualHeight < viewportDim.top ? 'bottom' :
placement == 'right' && pos.right + actualWidth > viewportDim.width ? 'left' :
placement == 'left' && pos.left - actualWidth < viewportDim.left ? 'right' :
placement
$tip
.removeClass(orgPlacement)
.addClass(placement)
}
var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight)
this.applyPlacement(calculatedOffset, placement)
var complete = function () {
var prevHoverState = that.hoverState
that.$element.trigger('shown.bs.' + that.type)
that.hoverState = null
if (prevHoverState == 'out') that.leave(that)
}
$.support.transition && this.$tip.hasClass('fade') ?
$tip
.one('bsTransitionEnd', complete)
.emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :
complete()
}
}
Tooltip.prototype.applyPlacement = function (offset, placement) {
var $tip = this.tip()
var width = $tip[0].offsetWidth
var height = $tip[0].offsetHeight
// manually read margins because getBoundingClientRect includes difference
var marginTop = parseInt($tip.css('margin-top'), 10)
var marginLeft = parseInt($tip.css('margin-left'), 10)
// we must check for NaN for ie 8/9
if (isNaN(marginTop)) marginTop = 0
if (isNaN(marginLeft)) marginLeft = 0
offset.top += marginTop
offset.left += marginLeft
// $.fn.offset doesn't round pixel values
// so we use setOffset directly with our own function B-0
$.offset.setOffset($tip[0], $.extend({
using: function (props) {
$tip.css({
top: Math.round(props.top),
left: Math.round(props.left)
})
}
}, offset), 0)
$tip.addClass('in')
// check to see if placing tip in new offset caused the tip to resize itself
var actualWidth = $tip[0].offsetWidth
var actualHeight = $tip[0].offsetHeight
if (placement == 'top' && actualHeight != height) {
offset.top = offset.top + height - actualHeight
}
var delta = this.getViewportAdjustedDelta(placement, offset, actualWidth, actualHeight)
if (delta.left) offset.left += delta.left
else offset.top += delta.top
var isVertical = /top|bottom/.test(placement)
var arrowDelta = isVertical ? delta.left * 2 - width + actualWidth : delta.top * 2 - height + actualHeight
var arrowOffsetPosition = isVertical ? 'offsetWidth' : 'offsetHeight'
$tip.offset(offset)
this.replaceArrow(arrowDelta, $tip[0][arrowOffsetPosition], isVertical)
}
Tooltip.prototype.replaceArrow = function (delta, dimension, isVertical) {
this.arrow()
.css(isVertical ? 'left' : 'top', 50 * (1 - delta / dimension) + '%')
.css(isVertical ? 'top' : 'left', '')
}
Tooltip.prototype.setContent = function () {
var $tip = this.tip()
var title = this.getTitle()
$tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
$tip.removeClass('fade in top bottom left right')
}
Tooltip.prototype.hide = function (callback) {
var that = this
var $tip = $(this.$tip)
var e = $.Event('hide.bs.' + this.type)
function complete() {
if (that.hoverState != 'in') $tip.detach()
that.$element
.removeAttr('aria-describedby')
.trigger('hidden.bs.' + that.type)
callback && callback()
}
this.$element.trigger(e)
if (e.isDefaultPrevented()) return
$tip.removeClass('in')
$.support.transition && $tip.hasClass('fade') ?
$tip
.one('bsTransitionEnd', complete)
.emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :
complete()
this.hoverState = null
return this
}
Tooltip.prototype.fixTitle = function () {
var $e = this.$element
if ($e.attr('title') || typeof $e.attr('data-original-title') != 'string') {
$e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
}
}
Tooltip.prototype.hasContent = function () {
return this.getTitle()
}
Tooltip.prototype.getPosition = function ($element) {
$element = $element || this.$element
var el = $element[0]
var isBody = el.tagName == 'BODY'
var elRect = el.getBoundingClientRect()
if (elRect.width == null) {
// width and height are missing in IE8, so compute them manually; see https://github.com/twbs/bootstrap/issues/14093
elRect = $.extend({}, elRect, { width: elRect.right - elRect.left, height: elRect.bottom - elRect.top })
}
var elOffset = isBody ? { top: 0, left: 0 } : $element.offset()
var scroll = { scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop() }
var outerDims = isBody ? { width: $(window).width(), height: $(window).height() } : null
return $.extend({}, elRect, scroll, outerDims, elOffset)
}
Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) {
return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } :
placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } :
placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } :
/* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width }
}
Tooltip.prototype.getViewportAdjustedDelta = function (placement, pos, actualWidth, actualHeight) {
var delta = { top: 0, left: 0 }
if (!this.$viewport) return delta
var viewportPadding = this.options.viewport && this.options.viewport.padding || 0
var viewportDimensions = this.getPosition(this.$viewport)
if (/right|left/.test(placement)) {
var topEdgeOffset = pos.top - viewportPadding - viewportDimensions.scroll
var bottomEdgeOffset = pos.top + viewportPadding - viewportDimensions.scroll + actualHeight
if (topEdgeOffset < viewportDimensions.top) { // top overflow
delta.top = viewportDimensions.top - topEdgeOffset
} else if (bottomEdgeOffset > viewportDimensions.top + viewportDimensions.height) { // bottom overflow
delta.top = viewportDimensions.top + viewportDimensions.height - bottomEdgeOffset
}
} else {
var leftEdgeOffset = pos.left - viewportPadding
var rightEdgeOffset = pos.left + viewportPadding + actualWidth
if (leftEdgeOffset < viewportDimensions.left) { // left overflow
delta.left = viewportDimensions.left - leftEdgeOffset
} else if (rightEdgeOffset > viewportDimensions.right) { // right overflow
delta.left = viewportDimensions.left + viewportDimensions.width - rightEdgeOffset
}
}
return delta
}
Tooltip.prototype.getTitle = function () {
var title
var $e = this.$element
var o = this.options
title = $e.attr('data-original-title')
|| (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
return title
}
Tooltip.prototype.getUID = function (prefix) {
do prefix += ~~(Math.random() * 1000000)
while (document.getElementById(prefix))
return prefix
}
Tooltip.prototype.tip = function () {
if (!this.$tip) {
this.$tip = $(this.options.template)
if (this.$tip.length != 1) {
throw new Error(this.type + ' `template` option must consist of exactly 1 top-level element!')
}
}
return this.$tip
}
Tooltip.prototype.arrow = function () {
return (this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow'))
}
Tooltip.prototype.enable = function () {
this.enabled = true
}
Tooltip.prototype.disable = function () {
this.enabled = false
}
Tooltip.prototype.toggleEnabled = function () {
this.enabled = !this.enabled
}
Tooltip.prototype.toggle = function (e) {
var self = this
if (e) {
self = $(e.currentTarget).data('bs.' + this.type)
if (!self) {
self = new this.constructor(e.currentTarget, this.getDelegateOptions())
$(e.currentTarget).data('bs.' + this.type, self)
}
}
if (e) {
self.inState.click = !self.inState.click
if (self.isInStateTrue()) self.enter(self)
else self.leave(self)
} else {
self.tip().hasClass('in') ? self.leave(self) : self.enter(self)
}
}
Tooltip.prototype.destroy = function () {
var that = this
clearTimeout(this.timeout)
this.hide(function () {
that.$element.off('.' + that.type).removeData('bs.' + that.type)
if (that.$tip) {
that.$tip.detach()
}
that.$tip = null
that.$arrow = null
that.$viewport = null
})
}
// TOOLTIP PLUGIN DEFINITION
// =========================
function Plugin(option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.tooltip')
var options = typeof option == 'object' && option
if (!data && /destroy|hide/.test(option)) return
if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))
if (typeof option == 'string') data[option]()
})
}
var old = $.fn.tooltip
$.fn.tooltip = Plugin
$.fn.tooltip.Constructor = Tooltip
// TOOLTIP NO CONFLICT
// ===================
$.fn.tooltip.noConflict = function () {
$.fn.tooltip = old
return this
}
}(jQuery);
/* ========================================================================
* Bootstrap: popover.js v3.3.5
* http://getbootstrap.com/javascript/#popovers
* ========================================================================
* Copyright 2011-2015 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ======================================================================== */
+function ($) {
'use strict';
// POPOVER PUBLIC CLASS DEFINITION
// ===============================
var Popover = function (element, options) {
this.init('popover', element, options)
}
if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')
Popover.VERSION = '3.3.5'
Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, {
placement: 'right',
trigger: 'click',
content: '',
template: ''
})
// NOTE: POPOVER EXTENDS tooltip.js
// ================================
Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype)
Popover.prototype.constructor = Popover
Popover.prototype.getDefaults = function () {
return Popover.DEFAULTS
}
Popover.prototype.setContent = function () {
var $tip = this.tip()
var title = this.getTitle()
var content = this.getContent()
$tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
$tip.find('.popover-content').children().detach().end()[ // we use append for html objects to maintain js events
this.options.html ? (typeof content == 'string' ? 'html' : 'append') : 'text'
](content)
$tip.removeClass('fade top bottom left right in')
// IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do
// this manually by checking the contents.
if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide()
}
Popover.prototype.hasContent = function () {
return this.getTitle() || this.getContent()
}
Popover.prototype.getContent = function () {
var $e = this.$element
var o = this.options
return $e.attr('data-content')
|| (typeof o.content == 'function' ?
o.content.call($e[0]) :
o.content)
}
Popover.prototype.arrow = function () {
return (this.$arrow = this.$arrow || this.tip().find('.arrow'))
}
// POPOVER PLUGIN DEFINITION
// =========================
function Plugin(option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.popover')
var options = typeof option == 'object' && option
if (!data && /destroy|hide/.test(option)) return
if (!data) $this.data('bs.popover', (data = new Popover(this, options)))
if (typeof option == 'string') data[option]()
})
}
var old = $.fn.popover
$.fn.popover = Plugin
$.fn.popover.Constructor = Popover
// POPOVER NO CONFLICT
// ===================
$.fn.popover.noConflict = function () {
$.fn.popover = old
return this
}
}(jQuery);
/* ========================================================================
* Bootstrap: tab.js v3.3.5
* http://getbootstrap.com/javascript/#tabs
* ========================================================================
* Copyright 2011-2015 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ======================================================================== */
+function ($) {
'use strict';
// TAB CLASS DEFINITION
// ====================
var Tab = function (element) {
// jscs:disable requireDollarBeforejQueryAssignment
this.element = $(element)
// jscs:enable requireDollarBeforejQueryAssignment
}
Tab.VERSION = '3.3.5'
Tab.TRANSITION_DURATION = 150
Tab.prototype.show = function () {
var $this = this.element
var $ul = $this.closest('ul:not(.dropdown-menu)')
var selector = $this.data('target')
if (!selector) {
selector = $this.attr('href')
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
}
if ($this.parent('li').hasClass('active')) return
var $previous = $ul.find('.active:last a')
var hideEvent = $.Event('hide.bs.tab', {
relatedTarget: $this[0]
})
var showEvent = $.Event('show.bs.tab', {
relatedTarget: $previous[0]
})
$previous.trigger(hideEvent)
$this.trigger(showEvent)
if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) return
var $target = $(selector)
this.activate($this.closest('li'), $ul)
this.activate($target, $target.parent(), function () {
$previous.trigger({
type: 'hidden.bs.tab',
relatedTarget: $this[0]
})
$this.trigger({
type: 'shown.bs.tab',
relatedTarget: $previous[0]
})
})
}
Tab.prototype.activate = function (element, container, callback) {
var $active = container.find('> .active')
var transition = callback
&& $.support.transition
&& ($active.length && $active.hasClass('fade') || !!container.find('> .fade').length)
function next() {
$active
.removeClass('active')
.find('> .dropdown-menu > .active')
.removeClass('active')
.end()
.find('[data-toggle="tab"]')
.attr('aria-expanded', false)
element
.addClass('active')
.find('[data-toggle="tab"]')
.attr('aria-expanded', true)
if (transition) {
element[0].offsetWidth // reflow for transition
element.addClass('in')
} else {
element.removeClass('fade')
}
if (element.parent('.dropdown-menu').length) {
element
.closest('li.dropdown')
.addClass('active')
.end()
.find('[data-toggle="tab"]')
.attr('aria-expanded', true)
}
callback && callback()
}
$active.length && transition ?
$active
.one('bsTransitionEnd', next)
.emulateTransitionEnd(Tab.TRANSITION_DURATION) :
next()
$active.removeClass('in')
}
// TAB PLUGIN DEFINITION
// =====================
function Plugin(option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.tab')
if (!data) $this.data('bs.tab', (data = new Tab(this)))
if (typeof option == 'string') data[option]()
})
}
var old = $.fn.tab
$.fn.tab = Plugin
$.fn.tab.Constructor = Tab
// TAB NO CONFLICT
// ===============
$.fn.tab.noConflict = function () {
$.fn.tab = old
return this
}
// TAB DATA-API
// ============
var clickHandler = function (e) {
e.preventDefault()
Plugin.call($(this), 'show')
}
$(document)
.on('click.bs.tab.data-api', '[data-toggle="tab"]', clickHandler)
.on('click.bs.tab.data-api', '[data-toggle="pill"]', clickHandler)
}(jQuery);
/* ========================================================================
* Bootstrap: affix.js v3.3.5
* http://getbootstrap.com/javascript/#affix
* ========================================================================
* Copyright 2011-2015 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ======================================================================== */
+function ($) {
'use strict';
// AFFIX CLASS DEFINITION
// ======================
var Affix = function (element, options) {
this.options = $.extend({}, Affix.DEFAULTS, options)
this.$target = $(this.options.target)
.on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this))
.on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this))
this.$element = $(element)
this.affixed = null
this.unpin = null
this.pinnedOffset = null
this.checkPosition()
}
Affix.VERSION = '3.3.5'
Affix.RESET = 'affix affix-top affix-bottom'
Affix.DEFAULTS = {
offset: 0,
target: window
}
Affix.prototype.getState = function (scrollHeight, height, offsetTop, offsetBottom) {
var scrollTop = this.$target.scrollTop()
var position = this.$element.offset()
var targetHeight = this.$target.height()
if (offsetTop != null && this.affixed == 'top') return scrollTop < offsetTop ? 'top' : false
if (this.affixed == 'bottom') {
if (offsetTop != null) return (scrollTop + this.unpin <= position.top) ? false : 'bottom'
return (scrollTop + targetHeight <= scrollHeight - offsetBottom) ? false : 'bottom'
}
var initializing = this.affixed == null
var colliderTop = initializing ? scrollTop : position.top
var colliderHeight = initializing ? targetHeight : height
if (offsetTop != null && scrollTop <= offsetTop) return 'top'
if (offsetBottom != null && (colliderTop + colliderHeight >= scrollHeight - offsetBottom)) return 'bottom'
return false
}
Affix.prototype.getPinnedOffset = function () {
if (this.pinnedOffset) return this.pinnedOffset
this.$element.removeClass(Affix.RESET).addClass('affix')
var scrollTop = this.$target.scrollTop()
var position = this.$element.offset()
return (this.pinnedOffset = position.top - scrollTop)
}
Affix.prototype.checkPositionWithEventLoop = function () {
setTimeout($.proxy(this.checkPosition, this), 1)
}
Affix.prototype.checkPosition = function () {
if (!this.$element.is(':visible')) return
var height = this.$element.height()
var offset = this.options.offset
var offsetTop = offset.top
var offsetBottom = offset.bottom
var scrollHeight = Math.max($(document).height(), $(document.body).height())
if (typeof offset != 'object') offsetBottom = offsetTop = offset
if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element)
if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element)
var affix = this.getState(scrollHeight, height, offsetTop, offsetBottom)
if (this.affixed != affix) {
if (this.unpin != null) this.$element.css('top', '')
var affixType = 'affix' + (affix ? '-' + affix : '')
var e = $.Event(affixType + '.bs.affix')
this.$element.trigger(e)
if (e.isDefaultPrevented()) return
this.affixed = affix
this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null
this.$element
.removeClass(Affix.RESET)
.addClass(affixType)
.trigger(affixType.replace('affix', 'affixed') + '.bs.affix')
}
if (affix == 'bottom') {
this.$element.offset({
top: scrollHeight - height - offsetBottom
})
}
}
// AFFIX PLUGIN DEFINITION
// =======================
function Plugin(option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.affix')
var options = typeof option == 'object' && option
if (!data) $this.data('bs.affix', (data = new Affix(this, options)))
if (typeof option == 'string') data[option]()
})
}
var old = $.fn.affix
$.fn.affix = Plugin
$.fn.affix.Constructor = Affix
// AFFIX NO CONFLICT
// =================
$.fn.affix.noConflict = function () {
$.fn.affix = old
return this
}
// AFFIX DATA-API
// ==============
$(window).on('load', function () {
$('[data-spy="affix"]').each(function () {
var $spy = $(this)
var data = $spy.data()
data.offset = data.offset || {}
if (data.offsetBottom != null) data.offset.bottom = data.offsetBottom
if (data.offsetTop != null) data.offset.top = data.offsetTop
Plugin.call($spy, data)
})
})
}(jQuery);
/* ========================================================================
* Bootstrap: collapse.js v3.3.5
* http://getbootstrap.com/javascript/#collapse
* ========================================================================
* Copyright 2011-2015 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ======================================================================== */
+function ($) {
'use strict';
// COLLAPSE PUBLIC CLASS DEFINITION
// ================================
var Collapse = function (element, options) {
this.$element = $(element)
this.options = $.extend({}, Collapse.DEFAULTS, options)
this.$trigger = $('[data-toggle="collapse"][href="#' + element.id + '"],' +
'[data-toggle="collapse"][data-target="#' + element.id + '"]')
this.transitioning = null
if (this.options.parent) {
this.$parent = this.getParent()
} else {
this.addAriaAndCollapsedClass(this.$element, this.$trigger)
}
if (this.options.toggle) this.toggle()
}
Collapse.VERSION = '3.3.5'
Collapse.TRANSITION_DURATION = 350
Collapse.DEFAULTS = {
toggle: true
}
Collapse.prototype.dimension = function () {
var hasWidth = this.$element.hasClass('width')
return hasWidth ? 'width' : 'height'
}
Collapse.prototype.show = function () {
if (this.transitioning || this.$element.hasClass('in')) return
var activesData
var actives = this.$parent && this.$parent.children('.panel').children('.in, .collapsing')
if (actives && actives.length) {
activesData = actives.data('bs.collapse')
if (activesData && activesData.transitioning) return
}
var startEvent = $.Event('show.bs.collapse')
this.$element.trigger(startEvent)
if (startEvent.isDefaultPrevented()) return
if (actives && actives.length) {
Plugin.call(actives, 'hide')
activesData || actives.data('bs.collapse', null)
}
var dimension = this.dimension()
this.$element
.removeClass('collapse')
.addClass('collapsing')[dimension](0)
.attr('aria-expanded', true)
this.$trigger
.removeClass('collapsed')
.attr('aria-expanded', true)
this.transitioning = 1
var complete = function () {
this.$element
.removeClass('collapsing')
.addClass('collapse in')[dimension]('')
this.transitioning = 0
this.$element
.trigger('shown.bs.collapse')
}
if (!$.support.transition) return complete.call(this)
var scrollSize = $.camelCase(['scroll', dimension].join('-'))
this.$element
.one('bsTransitionEnd', $.proxy(complete, this))
.emulateTransitionEnd(Collapse.TRANSITION_DURATION)[dimension](this.$element[0][scrollSize])
}
Collapse.prototype.hide = function () {
if (this.transitioning || !this.$element.hasClass('in')) return
var startEvent = $.Event('hide.bs.collapse')
this.$element.trigger(startEvent)
if (startEvent.isDefaultPrevented()) return
var dimension = this.dimension()
this.$element[dimension](this.$element[dimension]())[0].offsetHeight
this.$element
.addClass('collapsing')
.removeClass('collapse in')
.attr('aria-expanded', false)
this.$trigger
.addClass('collapsed')
.attr('aria-expanded', false)
this.transitioning = 1
var complete = function () {
this.transitioning = 0
this.$element
.removeClass('collapsing')
.addClass('collapse')
.trigger('hidden.bs.collapse')
}
if (!$.support.transition) return complete.call(this)
this.$element
[dimension](0)
.one('bsTransitionEnd', $.proxy(complete, this))
.emulateTransitionEnd(Collapse.TRANSITION_DURATION)
}
Collapse.prototype.toggle = function () {
this[this.$element.hasClass('in') ? 'hide' : 'show']()
}
Collapse.prototype.getParent = function () {
return $(this.options.parent)
.find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]')
.each($.proxy(function (i, element) {
var $element = $(element)
this.addAriaAndCollapsedClass(getTargetFromTrigger($element), $element)
}, this))
.end()
}
Collapse.prototype.addAriaAndCollapsedClass = function ($element, $trigger) {
var isOpen = $element.hasClass('in')
$element.attr('aria-expanded', isOpen)
$trigger
.toggleClass('collapsed', !isOpen)
.attr('aria-expanded', isOpen)
}
function getTargetFromTrigger($trigger) {
var href
var target = $trigger.attr('data-target')
|| (href = $trigger.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7
return $(target)
}
// COLLAPSE PLUGIN DEFINITION
// ==========================
function Plugin(option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.collapse')
var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)
if (!data && options.toggle && /show|hide/.test(option)) options.toggle = false
if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))
if (typeof option == 'string') data[option]()
})
}
var old = $.fn.collapse
$.fn.collapse = Plugin
$.fn.collapse.Constructor = Collapse
// COLLAPSE NO CONFLICT
// ====================
$.fn.collapse.noConflict = function () {
$.fn.collapse = old
return this
}
// COLLAPSE DATA-API
// =================
$(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (e) {
var $this = $(this)
if (!$this.attr('data-target')) e.preventDefault()
var $target = getTargetFromTrigger($this)
var data = $target.data('bs.collapse')
var option = data ? 'toggle' : $this.data()
Plugin.call($target, option)
})
}(jQuery);
/* ========================================================================
* Bootstrap: scrollspy.js v3.3.5
* http://getbootstrap.com/javascript/#scrollspy
* ========================================================================
* Copyright 2011-2015 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ======================================================================== */
+function ($) {
'use strict';
// SCROLLSPY CLASS DEFINITION
// ==========================
function ScrollSpy(element, options) {
this.$body = $(document.body)
this.$scrollElement = $(element).is(document.body) ? $(window) : $(element)
this.options = $.extend({}, ScrollSpy.DEFAULTS, options)
this.selector = (this.options.target || '') + ' .nav li > a'
this.offsets = []
this.targets = []
this.activeTarget = null
this.scrollHeight = 0
this.$scrollElement.on('scroll.bs.scrollspy', $.proxy(this.process, this))
this.refresh()
this.process()
}
ScrollSpy.VERSION = '3.3.5'
ScrollSpy.DEFAULTS = {
offset: 10
}
ScrollSpy.prototype.getScrollHeight = function () {
return this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight)
}
ScrollSpy.prototype.refresh = function () {
var that = this
var offsetMethod = 'offset'
var offsetBase = 0
this.offsets = []
this.targets = []
this.scrollHeight = this.getScrollHeight()
if (!$.isWindow(this.$scrollElement[0])) {
offsetMethod = 'position'
offsetBase = this.$scrollElement.scrollTop()
}
this.$body
.find(this.selector)
.map(function () {
var $el = $(this)
var href = $el.data('target') || $el.attr('href')
var $href = /^#./.test(href) && $(href)
return ($href
&& $href.length
&& $href.is(':visible')
&& [[$href[offsetMethod]().top + offsetBase, href]]) || null
})
.sort(function (a, b) { return a[0] - b[0] })
.each(function () {
that.offsets.push(this[0])
that.targets.push(this[1])
})
}
ScrollSpy.prototype.process = function () {
var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
var scrollHeight = this.getScrollHeight()
var maxScroll = this.options.offset + scrollHeight - this.$scrollElement.height()
var offsets = this.offsets
var targets = this.targets
var activeTarget = this.activeTarget
var i
if (this.scrollHeight != scrollHeight) {
this.refresh()
}
if (scrollTop >= maxScroll) {
return activeTarget != (i = targets[targets.length - 1]) && this.activate(i)
}
if (activeTarget && scrollTop < offsets[0]) {
this.activeTarget = null
return this.clear()
}
for (i = offsets.length; i--;) {
activeTarget != targets[i]
&& scrollTop >= offsets[i]
&& (offsets[i + 1] === undefined || scrollTop < offsets[i + 1])
&& this.activate(targets[i])
}
}
ScrollSpy.prototype.activate = function (target) {
this.activeTarget = target
this.clear()
var selector = this.selector +
'[data-target="' + target + '"],' +
this.selector + '[href="' + target + '"]'
var active = $(selector)
.parents('li')
.addClass('active')
if (active.parent('.dropdown-menu').length) {
active = active
.closest('li.dropdown')
.addClass('active')
}
active.trigger('activate.bs.scrollspy')
}
ScrollSpy.prototype.clear = function () {
$(this.selector)
.parentsUntil(this.options.target, '.active')
.removeClass('active')
}
// SCROLLSPY PLUGIN DEFINITION
// ===========================
function Plugin(option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.scrollspy')
var options = typeof option == 'object' && option
if (!data) $this.data('bs.scrollspy', (data = new ScrollSpy(this, options)))
if (typeof option == 'string') data[option]()
})
}
var old = $.fn.scrollspy
$.fn.scrollspy = Plugin
$.fn.scrollspy.Constructor = ScrollSpy
// SCROLLSPY NO CONFLICT
// =====================
$.fn.scrollspy.noConflict = function () {
$.fn.scrollspy = old
return this
}
// SCROLLSPY DATA-API
// ==================
$(window).on('load.bs.scrollspy.data-api', function () {
$('[data-spy="scroll"]').each(function () {
var $spy = $(this)
Plugin.call($spy, $spy.data())
})
})
}(jQuery);
/* ========================================================================
* Bootstrap: transition.js v3.3.5
* http://getbootstrap.com/javascript/#transitions
* ========================================================================
* Copyright 2011-2015 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ======================================================================== */
+function ($) {
'use strict';
// CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/)
// ============================================================
function transitionEnd() {
var el = document.createElement('bootstrap')
var transEndEventNames = {
WebkitTransition : 'webkitTransitionEnd',
MozTransition : 'transitionend',
OTransition : 'oTransitionEnd otransitionend',
transition : 'transitionend'
}
for (var name in transEndEventNames) {
if (el.style[name] !== undefined) {
return { end: transEndEventNames[name] }
}
}
return false // explicit for ie8 ( ._.)
}
// http://blog.alexmaccaw.com/css-transitions
$.fn.emulateTransitionEnd = function (duration) {
var called = false
var $el = this
$(this).one('bsTransitionEnd', function () { called = true })
var callback = function () { if (!called) $($el).trigger($.support.transition.end) }
setTimeout(callback, duration)
return this
}
$(function () {
$.support.transition = transitionEnd()
if (!$.support.transition) return
$.event.special.bsTransitionEnd = {
bindType: $.support.transition.end,
delegateType: $.support.transition.end,
handle: function (e) {
if ($(e.target).is(this)) return e.handleObj.handler.apply(this, arguments)
}
}
})
}(jQuery);
// source --> https://inhala.org/tienda/wp-content/plugins/booking/js/wpbc-migrate.js?ver=1.1
(function() {
var matched, browser;
jQuery.uaMatch = function( ua ) {
ua = ua.toLowerCase();
var match = /(chrome)[ \/]([\w.]+)/.exec( ua ) ||
/(webkit)[ \/]([\w.]+)/.exec( ua ) ||
/(opera)(?:.*version|)[ \/]([\w.]+)/.exec( ua ) ||
/(msie)[\s?]([\w.]+)/.exec( ua ) ||
/(trident)(?:.*? rv:([\w.]+)|)/.exec( ua ) ||
ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec( ua ) ||
[];
return {
browser: match[ 1 ] || "",
version: match[ 2 ] || "0"
};
};
matched = jQuery.uaMatch( navigator.userAgent );
//IE 11+ fix (Trident)
matched.browser = matched.browser == 'trident' ? 'msie' : matched.browser;
browser = {};
if ( matched.browser ) {
browser[ matched.browser ] = true;
browser.version = matched.version;
}
// Chrome is Webkit, but Webkit is also Safari.
if ( browser.chrome ) {
browser.webkit = true;
} else if ( browser.webkit ) {
browser.safari = true;
}
jQuery.browser = browser;
/* var matched, browser;
// Use of jQuery.browser is frowned upon.
// More details: http://api.jquery.com/jQuery.browser
// jQuery.uaMatch maintained for back-compat
jQuery.uaMatch = function( ua ) {
ua = ua.toLowerCase();
var match = /(chrome)[ \/]([\w.]+)/.exec( ua ) ||
/(webkit)[ \/]([\w.]+)/.exec( ua ) ||
/(opera)(?:.*version|)[ \/]([\w.]+)/.exec( ua ) ||
/(msie) ([\w.]+)/.exec( ua ) ||
ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec( ua ) ||
[];
return {
browser: match[ 1 ] || "",
version: match[ 2 ] || "0"
};
};
matched = jQuery.uaMatch( navigator.userAgent );
browser = {};
if ( matched.browser ) {
browser[ matched.browser ] = true;
browser.version = matched.version;
}
// Chrome is Webkit, but Webkit is also Safari.
if ( browser.chrome ) {
browser.webkit = true;
} else if ( browser.webkit ) {
browser.safari = true;
}
// Set to true to prevent console output; migrateWarnings still maintained
//jQuery.migrateMute = true;
jQuery.browser = browser;
*/
})();
// source --> https://inhala.org/tienda/wp-content/plugins/booking/js/datepick/jquery.datepick.js?ver=1.1
/* http://keith-wood.name/datepick.html
Datepicker for jQuery 3.7.1.
Written by Marc Grabanski (m@marcgrabanski.com) and
Keith Wood (kbwood{at}iinet.com.au).
Dual licensed under the GPL (http://dev.jQuery.com/browser/trunk/jQuery/GPL-LICENSE.txt) and
MIT (http://dev.jQuery.com/browser/trunk/jQuery/MIT-LICENSE.txt) licenses.
Please attribute the authors if you use it. */
(function($) { // Hide the namespace
var PROP_NAME = 'datepick';
/* Date picker manager.
Use the singleton instance of this class, $.datepick, to interact with the date picker.
Settings for (groups of) date pickers are maintained in an instance object,
allowing multiple different settings on the same page. */
function Datepick() {
this._uuid = new Date().getTime(); // Unique identifier seed
this._curInst = null; // The current instance in use
this._keyEvent = false; // If the last event was a key event
this._disabledInputs = []; // List of date picker inputs that have been disabled
this._datepickerShowing = false; // True if the popup picker is showing , false if not
this._inDialog = false; // True if showing within a "dialog", false if not
this.regional = []; // Available regional settings, indexed by language code
this.regional[''] = { // Default regional settings
clearText: 'Clear', // Display text for clear link
clearStatus: 'Erase the current date', // Status text for clear link
closeText: 'Close', // Display text for close link
closeStatus: 'Close without change', // Status text for close link
prevText: '<Prev', // Display text for previous month link
prevStatus: 'Show the previous month', // Status text for previous month link
prevBigText: '<<', // Display text for previous year link
prevBigStatus: 'Show the previous year', // Status text for previous year link
nextText: 'Next>', // Display text for next month link
nextStatus: 'Show the next month', // Status text for next month link
nextBigText: '>>', // Display text for next year link
nextBigStatus: 'Show the next year', // Status text for next year link
currentText: 'Today', // Display text for current month link
currentStatus: 'Show the current month', // Status text for current month link
monthNames: ['January','February','March','April','May','June',
'July','August','September','October','November','December'], // Names of months for drop-down and formatting
monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], // For formatting
monthStatus: 'Show a different month', // Status text for selecting a month
yearStatus: 'Show a different year', // Status text for selecting a year
weekHeader: 'Wk', // Header for the week of the year column
weekStatus: 'Week of the year', // Status text for the week of the year column
dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], // For formatting
dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], // For formatting
dayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], // Column headings for days starting at Sunday
dayStatus: 'Set DD as first week day', // Status text for the day of the week selection
dateStatus: 'Select DD, M d', // Status text for the date selection
dateFormat: 'mm/dd/yy', // See format options on parseDate
firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...
initStatus: 'Select a date', // Initial Status text on opening
isRTL: false, // True if right-to-left language, false if left-to-right
showMonthAfterYear: false, // True if the year select precedes month, false for month then year
yearSuffix: '' // Additional text to append to the year in the month headers
};
this._defaults = { // Global defaults for all the date picker instances
useThemeRoller: false, // True to apply ThemeRoller styling, false for default styling
showOn: 'focus', // 'focus' for popup on focus,
// 'button' for trigger button, or 'both' for either
showAnim: 'show', // Name of jQuery animation for popup
showOptions: {}, // Options for enhanced animations
duration: 'normal', // Duration of display/closure
buttonText: '...', // Text for trigger button
buttonImage: '', // URL for trigger button image
buttonImageOnly: false, // True if the image appears alone, false if it appears on a button
alignment: 'bottom', // Alignment of popup - with nominated corner of input:
// 'top' or 'bottom' aligns depending on language direction,
// 'topLeft', 'topRight', 'bottomLeft', 'bottomRight'
autoSize: false, // True to size the input for the date format, false to leave as is
defaultDate: null, // Used when field is blank: actual date,
// +/-number for offset from today, null for today
showDefault: false, // True to populate field with the default date
appendText: '', // Display text following the input box, e.g. showing the format
closeAtTop: true, // True to have the clear/close at the top,
// false to have them at the bottom
mandatory: false, // True to hide the Clear link, false to include it
hideIfNoPrevNext: false, // True to hide next/previous month links
// if not applicable, false to just disable them
navigationAsDateFormat: false, // True if date formatting applied to prev/today/next links
showBigPrevNext: false, // True to show big prev/next links
stepMonths: 1, // Number of months to step back/forward
stepBigMonths: 12, // Number of months to step back/forward for the big links
gotoCurrent: false, // True if today link goes back to current selection instead
changeMonth: true, // True if month can be selected directly, false if only prev/next
changeYear: true, // True if year can be selected directly, false if only prev/next
yearRange: '-10:+10', // Range of years to display in drop-down,
// either relative to current year (-nn:+nn) or absolute (nnnn:nnnn)
changeFirstDay: false, // True to click on day name to change, false to remain as set
showOtherMonths: false, // True to show dates in other months, false to leave blank
selectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable
highlightWeek: false, // True to highlight the selected week
showWeeks: false, // True to show week of the year, false to omit
calculateWeek: this.iso8601Week, // How to calculate the week of the year,
// takes a Date and returns the number of the week for it
shortYearCutoff: '+10', // Short year values < this are in the current century,
// > this are in the previous century, string value starting with '+'
// for current year + value, -1 for no change
showStatus: false, // True to show status bar at bottom, false to not show it
statusForDate: this.dateStatus, // Function to provide status text for a date -
// takes date and instance as parameters, returns display text
minDate: null, // The earliest selectable date, or null for no limit
maxDate: null, // The latest selectable date, or null for no limit
numberOfMonths: 1, // Number of months to show at a time
showCurrentAtPos: 0, // The position in multiple months at which to show the current month (starting at 0)
rangeSelect: false, // Allows for selecting a date range on one date picker
rangeSeparator: ' - ', // Text between two dates in a range
multiSelect: 0, // Maximum number of selectable dates
multiSeparator: ',', // Text between multiple dates
beforeShow: null, // Function that takes an input field and
// returns a set of custom settings for the date picker
beforeShowDay: null, // Function that takes a date and returns an array with
// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or '',
// [2] = cell title (optional), e.g. $.datepick.noWeekends
onChangeMonthYear: null, // Define a callback function when the month or year is changed
onHover: null, // Define a callback function when hovering over a day
onSelect: null, // Define a callback function when a date is selected
onClose: null, // Define a callback function when the datepicker is closed
altField: '', // Selector for an alternate field to store selected dates into
altFormat: '', // The date format to use for the alternate field
constrainInput: true // The input is constrained by the current date format
};
$.extend(this._defaults, this.regional['']);
this.dpDiv = $('' ); // Show message
jQuery( ".wpdev-help-message" )
// .css( {'color' : 'red'} )
.animate( {opacity: 1}, 10000 )
.fadeOut( 2000 ); // hide message
element.focus(); // make focus to elemnt
return true;
}
//PS: This function from ../booking/inc/js/personal.js
function isValidTimeTextField( timeStr ){
// Checks if time is in HH:MM AM/PM format.
// The seconds and AM/PM are optional.
var timePat = /^(\d{1,2}):(\d{2})(\s?(AM|am|PM|pm))?$/;
var matchArray = timeStr.match( timePat );
if ( matchArray == null ){
return false; //("");
}
var hour = matchArray[ 1 ];
var minute = matchArray[ 2 ];
var ampm = matchArray[ 4 ];
if ( ampm == "" ){
ampm = null
}
if ( hour < 0 || hour > 24 ){ //FixIn: 8.3.1.1
return false; //("");
}
if ( hour > 12 && ampm != null ){
return false; //("");
}
if ( minute < 0 || minute > 59 ){
return false; //("");
}
return true;
}
//FixIn: 8.4.7.6
// Disable Booked Time Slots in selectbox
function bkDisableBookedTimeSlots( all_dates, bk_type ){
var inst = jQuery.datepick._getInst( document.getElementById( 'calendar_booking' + bk_type ) );
var td_class;
var time_slot_field_name = 'select[name="rangetime' + bk_type + '"]';
var time_slot_field_name2 = 'select[name="rangetime' + bk_type + '[]"]';
var start_time_slot_field_name = 'select[name="starttime' + bk_type + '"]';
var start_time_slot_field_name2 = 'select[name="starttime' + bk_type + '[]"]';
var end_time_slot_field_name = 'select[name="endtime' + bk_type + '"]';
var end_time_slot_field_name2 = 'select[name="endtime' + bk_type + '[]"]';
// HERE WE WILL DISABLE ALL OPTIONS IN RANGE TIME INTERVALS FOR SINGLE DAYS SELECTIONS FOR THAT DAYS WHERE HOURS ALREADY BOOKED
//here is not range selections
all_dates = get_first_day_of_selection( all_dates );
if ( (bk_days_selection_mode == 'single') || (true) ){ // Only single day selections here
var current_single_day_selections = all_dates.split( '.' );
td_class = (current_single_day_selections[ 1 ] * 1) + '-' + (current_single_day_selections[ 0 ] * 1) + '-' + (current_single_day_selections[ 2 ] * 1);
var times_array = [];
jQuery( time_slot_field_name + ' option:disabled,' + time_slot_field_name2 + ' option:disabled,'
+ start_time_slot_field_name + ' option:disabled,' + start_time_slot_field_name2 + ' option:disabled,'
+ end_time_slot_field_name + ' option:disabled,' + end_time_slot_field_name2 + ' option:disabled'
).removeClass( 'booked' ); // Remove class "booked"
jQuery( time_slot_field_name + ' option:disabled,' + time_slot_field_name2 + ' option:disabled,'
+ start_time_slot_field_name + ' option:disabled,' + start_time_slot_field_name2 + ' option:disabled,'
+ end_time_slot_field_name + ' option:disabled,' + end_time_slot_field_name2 + ' option:disabled'
).removeAttr( 'disabled' ); // Make active all times
if ( jQuery( time_slot_field_name + ',' + time_slot_field_name2 + ',' + start_time_slot_field_name + ',' + start_time_slot_field_name2 ).length == 0 ) return; // WE DO NOT HAVE RANGE SELECTIONS AT THIS FORM SO JUST RETURN
var range_time_object = jQuery( time_slot_field_name + ' option:first,' + time_slot_field_name2 + ' option:first,' + start_time_slot_field_name + ' option:first,' + start_time_slot_field_name2 + ' option:first' );
if ( range_time_object == undefined ) return; // WE DO NOT HAVE RANGE SELECTIONS AT THIS FORM SO JUST RETURN
// Get dates and time from aproved dates
if ( typeof(date_approved[ bk_type ]) !== 'undefined' )
if ( typeof(date_approved[ bk_type ][ td_class ]) !== 'undefined' ){
if ( (date_approved[ bk_type ][ td_class ][ 0 ][ 3 ] != 0) || (date_approved[ bk_type ][ td_class ][ 0 ][ 4 ] != 0) ){
for ( i = 0; i < date_approved[ bk_type ][ td_class ].length; i++ ){
h = date_approved[ bk_type ][ td_class ][ i ][ 3 ];
if ( h < 10 ) h = '0' + h;
if ( h == 0 ) h = '00';
m = date_approved[ bk_type ][ td_class ][ i ][ 4 ];
if ( m < 10 ) m = '0' + m;
if ( m == 0 ) m = '00';
s = date_approved[ bk_type ][ td_class ][ i ][ 5 ];
if ( s == 2 ) s = '02';
times_array[ times_array.length ] = [ h, m, s ];
}
}
}
// Get dates and time from pending dates
if ( typeof(date2approve[ bk_type ]) !== 'undefined' )
if ( typeof(date2approve[ bk_type ][ td_class ]) !== 'undefined' )
if ( (date2approve[ bk_type ][ td_class ][ 0 ][ 3 ] != 0) || (date2approve[ bk_type ][ td_class ][ 0 ][ 4 ] != 0) ) //check for time here
{
for ( i = 0; i < date2approve[ bk_type ][ td_class ].length; i++ ){
h = date2approve[ bk_type ][ td_class ][ i ][ 3 ];
if ( h < 10 ) h = '0' + h;
if ( h == 0 ) h = '00';
m = date2approve[ bk_type ][ td_class ][ i ][ 4 ];
if ( m < 10 ) m = '0' + m;
if ( m == 0 ) m = '00';
s = date2approve[ bk_type ][ td_class ][ i ][ 5 ];
if ( s == 2 ) s = '02';
times_array[ times_array.length ] = [ h, m, s ];
}
}
// Check about situations, when we have end time without start time (... - 09:00) or start time without end time (21:00 - ...)
times_array.sort();
if ( times_array.length > 0 ){
s = parseInt( times_array[ 0 ][ 2 ] );
if ( s == 2 ){
times_array[ times_array.length ] = [ '00', '00', '01' ];
times_array.sort();
}
s = parseInt( times_array[ (times_array.length - 1) ][ 2 ] );
if ( s == 1 ){
times_array[ times_array.length ] = [ '23', '59', '02' ];
times_array.sort();
}
}
var check_times_fields=[
[ time_slot_field_name, time_slot_field_name2 ],
[ start_time_slot_field_name, start_time_slot_field_name2 ]
];
// Check about disabling "end times" only in "single day" selection mode //FixIn: 8.7.2.1
if ( ( bk_days_selection_mode == 'single' ) ) {
check_times_fields.push( [ end_time_slot_field_name, end_time_slot_field_name2 ] );
}
for ( var ctf= 0; ctf < check_times_fields.length; ctf++ ){
var time_field_to_check = check_times_fields[ ctf ];
//TODO: continue here with time_field_to_check
var removed_time_slots = is_time_slot_booked_for_this_time_array( bk_type, times_array, td_class , time_field_to_check );
//console.log( 'removed_time_slots',time_field_to_check, removed_time_slots );
var my_time_value = jQuery( time_field_to_check[ 0 ] + ' option,' + time_field_to_check[ 1 ] + ' option' );
for ( j = 0; j < my_time_value.length; j++ ){
if ( wpdev_in_array( removed_time_slots, j ) ){
jQuery( time_field_to_check[ 0 ] + ' option:eq(' + j + '),' + time_field_to_check[ 1 ] + ' option:eq(' + j + ')' ).attr( 'disabled', 'disabled' ); // Make disable some options
jQuery( time_field_to_check[ 0 ] + ' option:eq(' + j + '),' + time_field_to_check[ 1 ] + ' option:eq(' + j + ')' ).addClass( 'booked' ); // Add "booked" CSS class
if (
jQuery( time_field_to_check[ 0 ] + ' option:eq(' + j + '),' + time_field_to_check[ 1 ] + ' option:eq(' + j + ')' ).attr( 'selected' )
){ // iF THIS ELEMENT IS SELECTED SO REMOVE IT FROM THIS TIME
jQuery( time_field_to_check[ 0 ] + ' option:eq(' + j + '),' + time_field_to_check[ 1 ] + ' option:eq(' + j + ')' ).removeAttr( 'selected' );
if ( IEversion_4_bk == 7 ){ // Emulate disabling option in selectboxes for IE7 - its set selected option, which is not disabled
var rangetime_element = document.getElementsByName( "rangetime" + bk_type );
if ( typeof (rangetime_element) != 'undefined' && rangetime_element != null ){
set_selected_first_not_disabled_option_IE7( document.getElementsByName( "rangetime" + bk_type )[ 0 ] );
}
var start_element = document.getElementsByName( "starttime" + bk_type );
if ( typeof (start_element) != 'undefined' && start_element != null ){
set_selected_first_not_disabled_option_IE7( document.getElementsByName( "starttime" + bk_type )[ 0 ] );
}
}
}
}
}
}
if ( IEversion_4_bk == 7 ){ // Emulate disabling option in selectboxes for IE7 - its set grayed text options, which is disabled
emulate_disabled_options_to_gray_IE7( "rangetime" + bk_type );
emulate_disabled_options_to_gray_IE7( "starttime" + bk_type );
emulate_disabled_options_to_gray_IE7( "endtime" + bk_type );
}
}
}
// Check if this IE and get version of IE otherwise setversion of IE to 0
var isIE_4_bk = (navigator.appName == "Microsoft Internet Explorer");
var IEversion_4_bk = navigator.appVersion;
if ( isIE_4_bk ){
IEversion_4_bk = parseInt( IEversion_4_bk.substr( IEversion_4_bk.indexOf( "MSIE" ) + 4 ) );
} else {
IEversion_4_bk = 0;
}
// IE7 select box emulate functions for disabling select boxes:
if ( IEversion_4_bk == 7 ){
window.onload = function (){
if ( document.getElementsByTagName ){
var s = document.getElementsByTagName( "select" );
if ( s.length > 0 ){
window.select_current = new Array();
for ( var i = 0, select; select = s[ i ]; i++ ){
select.onfocus = function (){
window.select_current[ this.id ] = this.selectedIndex;
}
select.onchange = function (){
set_selected_previos_selected_option_IE7( this );
}
emulate_disabled_options_to_gray_IE7( select.name );
}
}
}
}
function set_selected_previos_selected_option_IE7( e ){
if ( e.options[ e.selectedIndex ].disabled ){
e.selectedIndex = window.select_current[ e.id ];
}
}
function set_selected_first_not_disabled_option_IE7( e ){
if ( e.options[ e.selectedIndex ].disabled ){
for ( var i = 0, option; option = e.options[ i ]; i++ ){
if ( !option.disabled ){
e.selectedIndex = i;
return 0;
}
}
}
return 0;
}
function emulate_disabled_options_to_gray_IE7( ename ){
jQuery( 'select[name="' + ename + '"] option,select[name="' + ename + '[]"] option' ).each( function ( index ){
if ( jQuery( this ).prop( 'disabled' ) ){
jQuery( this ).css( 'color', 'graytext' );
} else {
jQuery( this ).css( 'color', 'menutext' );
}
} );
/*
for (var i=0, option; option = e.options[i]; i++) {
if (option.disabled) { option.style.color = "graytext";}
else { option.style.color = "menutext";}
}*/
}
}
//FixIn: 8.4.7.6
function is_time_slot_booked_for_this_time_array( bk_type, times_array, td_class, time_field_to_check ) {
// Get time element from possible conditional section //FixIn: 7.0.Beta.11
if ( typeof(wpbc_get_conditional_section_id_for_weekday) == 'function' ){
var conditional_field_element_id = wpbc_get_conditional_section_id_for_weekday( td_class, bk_type );
if ( conditional_field_element_id !== false ){
time_field_to_check[ 0 ] = conditional_field_element_id + ' ' + time_field_to_check[ 0 ];
time_field_to_check[ 1 ] = conditional_field_element_id + ' ' + time_field_to_check[ 1 ];
}
}
times_array.sort();
var my_time_value = '';
var j;
var bk_time_slot_selection = '';
var minutes_booked;
var minutes_slot;
var my_range_time;
var removed_time_slots = [];
if ( times_array.length > 0 ){ //FixIn: 6.1.1.6
//Situation when we have first time option as End time. So we need to add start time to the midnight
if ( parseInt( times_array[ 0 ][ 2 ] ) == 2 ){
var new_times_array = [];
new_times_array[ new_times_array.length ] = [ '00', '00', '01' ];
for ( var i = 0; i < times_array.length; i++ ){
new_times_array[ new_times_array.length ] = times_array[ i ];
}
times_array = new_times_array;
}
//Situation when we have last time option as Start time. So we need to add End time to end of this times
if ( parseInt( times_array[ (times_array.length - 1) ][ 2 ] ) == 1 ){
times_array[ times_array.length ] = [ '23', '59', '02' ];
}
}
for ( var i = 0; i < times_array.length; i++ ){ // s = 2 - end time, s = 1 - start time
var s = parseInt( times_array[ i ][ 2 ] );
if ( i > 0 ){
if ( s == 2 ){
my_range_time = times_array[ i - 1 ][ 0 ] + ':' + times_array[ i - 1 ][ 1 ] + ' - ' + times_array[ i ][ 0 ] + ':' + times_array[ i ][ 1 ];
my_time_value = jQuery( time_field_to_check[ 0 ] + ' option,' + time_field_to_check[ 1 ] + ' option' );
for ( j = 0; j < my_time_value.length; j++ ){
if ( my_time_value[ j ].value == my_range_time ){ // Mark as disable this option
removed_time_slots[ removed_time_slots.length ] = j;
//return true;
} else {
// We will recheck here if, may be some interval here inside of already booked intervals, so then we need to disable it.
bk_time_slot_selection = my_time_value[ j ].value;
var is_time_range = bk_time_slot_selection.indexOf( "-" );
if ( is_time_range > -1 ){ // Timeslots
bk_time_slot_selection = bk_time_slot_selection.split( '-' );
bk_time_slot_selection[ 0 ] = jQuery.trim( bk_time_slot_selection[ 0 ] );
bk_time_slot_selection[ 1 ] = jQuery.trim( bk_time_slot_selection[ 1 ] );
bk_time_slot_selection[ 0 ] = bk_time_slot_selection[ 0 ].split( ':' );
bk_time_slot_selection[ 1 ] = bk_time_slot_selection[ 1 ].split( ':' );
// Get only minutes
minutes_booked = [ (parseInt( times_array[ i - 1 ][ 0 ] * 60 ) + parseInt( times_array[ i - 1 ][ 1 ] )), (parseInt( times_array[ i ][ 0 ] * 60 ) + parseInt( times_array[ i ][ 1 ] )) ];
minutes_slot = [ (parseInt( bk_time_slot_selection[ 0 ][ 0 ] * 60 ) + parseInt( bk_time_slot_selection[ 0 ][ 1 ] )), (parseInt( bk_time_slot_selection[ 1 ][ 0 ] * 60 ) + parseInt( bk_time_slot_selection[ 1 ][ 1 ] )) ];
if (
((minutes_booked[ 0 ] >= minutes_slot[ 0 ]) && (minutes_booked[ 0 ] < minutes_slot[ 1 ])) ||
((minutes_booked[ 1 ] > minutes_slot[ 0 ]) && (minutes_booked[ 1 ] <= minutes_slot[ 1 ]))
||
((minutes_slot[ 0 ] >= minutes_booked[ 0 ]) && (minutes_slot[ 0 ] < minutes_booked[ 1 ])) ||
((minutes_slot[ 1 ] > minutes_booked[ 0 ]) && (minutes_slot[ 1 ] <= minutes_booked[ 1 ]))
){
removed_time_slots[ removed_time_slots.length ] = j;
//return true;
}
} else { // Just some time (like start time)
bk_time_slot_selection = bk_time_slot_selection.split( ':' );
// Get only minutes
minutes_booked = [ (parseInt( times_array[ i - 1 ][ 0 ] * 60 ) + parseInt( times_array[ i - 1 ][ 1 ] )) , (parseInt( times_array[ i ][ 0 ] * 60 ) + parseInt( times_array[ i ][ 1 ] )) ];
minutes_slot = [ (parseInt( bk_time_slot_selection[ 0 ] * 60 ) + parseInt( bk_time_slot_selection[ 1 ] )) ];
//FixIn: 8.6.1.17
var is_end_time = time_field_to_check[ 0 ].indexOf( "endtime" );
if ( -1 !== is_end_time ){ // This is End Time
// Transform to seconds, and minus 10 second
minutes_booked[ 0 ] = minutes_booked[ 0 ] * 60;
minutes_booked[ 1 ] = minutes_booked[ 1 ] * 60;
minutes_slot[ 0 ] = minutes_slot[ 0 ] * 60 - 10;
}
if (
((minutes_slot[ 0 ] >= minutes_booked[ 0 ]) && (minutes_slot[ 0 ] < minutes_booked[ 1 ]))
){
removed_time_slots[ removed_time_slots.length ] = j;
//return true;
}
}
}
}
}
}
}
return removed_time_slots;
}
// Times
function isDayFullByTime( bk_type, td_class ) {
var times_array = [];
var time_slot_field_name = 'select[name="rangetime' + bk_type + '"]';
var time_slot_field_name2 = 'select[name="rangetime' + bk_type + '[]"]';
// Get rangetime element from possible conditional Weekdays section //FixIn: 5.4.5.2
if( typeof( wpbc_get_conditional_section_id_for_weekday ) == 'function' ) {
var conditional_field_element_id = wpbc_get_conditional_section_id_for_weekday( td_class, bk_type );
if ( conditional_field_element_id !== false ) {
time_slot_field_name = conditional_field_element_id + ' ' + 'select[name="rangetime' + bk_type + '"]';
time_slot_field_name2 = conditional_field_element_id + ' ' + 'select[name="rangetime' + bk_type + '[]"]';
}
}
// Get rangetime element from possible conditional Seasonal section //FixIn: 8.4.5.3
if ( typeof(wpbc_get_conditional_section_id_for_seasons) == 'function' ){
var conditional_field_element_id2 = wpbc_get_conditional_section_id_for_seasons( td_class, bk_type );
if ( conditional_field_element_id2 !== false ){
time_slot_field_name = conditional_field_element_id2 + ' ' + 'select[name="rangetime' + bk_type + '"]';
time_slot_field_name2 = conditional_field_element_id2 + ' ' + 'select[name="rangetime' + bk_type + '[]"]';
}
}
//console.log( time_slot_field_name, time_slot_field_name2 );
// Get dates and time from aproved dates
if(typeof(date_approved[ bk_type ]) !== 'undefined')
if(typeof(date_approved[ bk_type ][ td_class ]) !== 'undefined') {
for ( i=0; i< date_approved[ bk_type ][ td_class ].length; i++){
if( ( date_approved[ bk_type ][ td_class ][0][3] != 0) || ( date_approved[ bk_type ][ td_class ][0][4] != 0) ) {
h = date_approved[ bk_type ][ td_class ][i][3];if (h < 10) h = '0' + h;if (h == 0) h = '00';
m = date_approved[ bk_type ][ td_class ][i][4];if (m < 10) m = '0' + m;if (m == 0) m = '00';
s = date_approved[ bk_type ][ td_class ][i][5];if (s == 2) s = '02';
times_array[ times_array.length ] = [h,m,s];
}
}
}
// Get dates and time from pending dates
if(typeof( date2approve[ bk_type ]) !== 'undefined')
if(typeof( date2approve[ bk_type ][ td_class ]) !== 'undefined')
for ( i=0; i< date2approve[ bk_type ][ td_class ].length; i++){
if( ( date2approve[ bk_type ][ td_class ][0][3] != 0) || ( date2approve[ bk_type ][ td_class ][0][4] != 0) ) {
h = date2approve[ bk_type ][ td_class ][i][3];if (h < 10) h = '0' + h;if (h == 0) h = '00';
m = date2approve[ bk_type ][ td_class ][i][4];if (m < 10) m = '0' + m;if (m == 0) m = '00';
s = date2approve[ bk_type ][ td_class ][i][5];if (s == 2) s = '02';
times_array[ times_array.length ] = [h,m,s];
}
}
times_array.sort();
//Customization Bence - make day with start and end time - unavailable
//var is_start_here = false;
//var is_end_here = false;
//for (var jj=0; jj< times_array.length; jj++){
// if (times_array[jj][2]=='01' ) is_start_here = true;
// if (times_array[jj][2]=='02' ) is_end_here = true;
//}
//if ( (is_start_here) && (is_end_here) ) return true;
// check here according time ranges selection
// and check all slots for reserVATION.
// IF ALL SLOTS ARE RESERVED, INSIDE OF times_array
// SO THEN RETURN TRUE
//var is_element_exist = jQuery( time_slot_field_name+','+time_slot_field_name2 ).length; //FixIn:6.1.1.6 - Previously was this line
var start_time_fields = 'select[name="starttime' + bk_type + '"]'; //FixIn:6.1.1.6
var start_time_fields2 = 'select[name="starttime' + bk_type + '[]"]'; //FixIn:6.1.1.6
var is_element_exist = jQuery( time_slot_field_name + ',' + time_slot_field_name2 + ',' + start_time_fields + ',' + start_time_fields2 ).length; //FixIn:6.1.1.6
if (is_element_exist) {
var my_timerange_value = jQuery( time_slot_field_name + ' option,'+time_slot_field_name2 + ' option');
var my_st_en_times;
var my_temp_time;
var times_ranges_array=[];
for (var j=0; j< my_timerange_value.length; j++){
my_st_en_times = my_timerange_value[j].value.split(' - ');
my_temp_time = my_st_en_times[0].split(':');
times_ranges_array[ times_ranges_array.length ] = [ my_temp_time[0], my_temp_time[1], '01' ]; //Start time
my_temp_time = my_st_en_times[1].split(':');
times_ranges_array[ times_ranges_array.length ] = [ my_temp_time[0], my_temp_time[1], '02' ]; //End time
}
// check if all time slots from the selectbox are the booked inside of this day. Simple checking for the same
if (times_array.length == times_ranges_array.length) {
var is_all_same = true;
for ( var i=0; i< times_array.length; i++){
if (
( times_array[i][0] != times_ranges_array[i][0] ) ||
( times_array[i][1] != times_ranges_array[i][1] ) ||
( times_array[i][2] != times_ranges_array[i][2] )
)
is_all_same = false;
}
if ( is_all_same) return true;
}
// Star Time checking //FixIn:6.1.1.6
var my_start_time_options = jQuery( start_time_fields + ' option,'+start_time_fields2 + ' option');
if ( ( my_start_time_options.length > 0 )
&& ( ( bk_days_selection_mode == 'single' ) /*|| ( bk_days_selection_mode == 'multiple' )*/ ) //FixIn: 8.5.2.4
){ // Only if range selections exist and we are have single days selections
var removed_time_slots = is_time_slot_booked_for_this_time_array( bk_type, times_array, td_class, [ start_time_fields, start_time_fields2 ] );
var some_exist_time_slots = [];
var my_time_value = jQuery( start_time_fields + ' option,'+start_time_fields2 + ' option');
for ( j=0; j< my_time_value.length; j++){
if ( wpdev_in_array( removed_time_slots, j ) ) {
} else {
some_exist_time_slots[some_exist_time_slots.length] = j;
}
}
if (some_exist_time_slots.length == 0 ) return true;
}
// End //FixIn:6.1.1.6 End fix
//Check may be its not possible to select any other time slots from the selectbox, because its already booked, sothen mark this day as booked.
if ( ( my_timerange_value.length > 0 )
&& ( ( bk_days_selection_mode == 'single' ) || ( bk_days_selection_mode == 'multiple' ) )
){ // Only if range selections exist and we are have single days selections
var removed_time_slots = is_time_slot_booked_for_this_time_array( bk_type, times_array, td_class, [ time_slot_field_name, time_slot_field_name2 ] );
var some_exist_time_slots = [];
var my_time_value = jQuery( time_slot_field_name + ' option,'+time_slot_field_name2 + ' option');
for ( j=0; j< my_time_value.length; j++){
if ( wpdev_in_array( removed_time_slots, j ) ) {
} else {
some_exist_time_slots[some_exist_time_slots.length] = j;
}
}
if (some_exist_time_slots.length == 0 ) return true;
}
}
for ( var i=0; i< times_array.length; i++){ // s = 2 - end time, s = 1 - start time
s = parseInt( times_array[i][2] );
if (i == 0)
if (s !== 2) {return false;} // Its not start at the start of day
if ( i > 0 ) {
if ( s == 1 )
if ( !( ( times_array[i-1][0] == times_array[i][0] ) && ( times_array[i-1][1] == times_array[i][1] ) ) ) {
return false; // previos time is not equal to current so we have some free interval
}
}
if (i == ( times_array.length-1))
if (s !== 1) {return false;} // Its not end at the end of day
}
return true;
};
// source --> https://inhala.org/tienda/wp-content/plugins/booking/core/timeline/v2/_out/timeline_v2.js?ver=8.7.6
"use strict";
function wpbc_flextimeline_nav(timeline_obj, nav_step) {
jQuery(".wpbc_timeline_front_end").trigger("timeline_nav", [timeline_obj, nav_step]); //FixIn:7.0.1.48
// jQuery( '#'+timeline_obj.html_client_id + ' .wpbc_tl_prev,#'+timeline_obj.html_client_id + ' .wpbc_tl_next').remove();
// jQuery('#'+timeline_obj.html_client_id + ' .wpbc_tl_title').html( '   Loading...' ); // 'Loading ...
/div>'
jQuery('#' + timeline_obj.html_client_id + ' .flex_tl_prev,#' + timeline_obj.html_client_id + ' .flex_tl_next').remove();
jQuery('#' + timeline_obj.html_client_id + ' .flex_tl_title').html('
  Loading...'); // '
Loading ...
/div>'
if (jQuery.isFunction(jQuery(".popover_click.popover_bottom").popover)) //FixIn: 7.0.1.2 - 2016-12-10
jQuery('.popover_click.popover_bottom').popover('hide'); //Hide all opned popovers
jQuery.ajax({
url: wpbc_ajaxurl,
type: 'POST',
success: function success(data, textStatus) {
// Note, here we direct show HTML to TimeLine frame
if (textStatus == 'success') {
jQuery('#' + timeline_obj.html_client_id + ' .wpbc_timeline_ajax_replace').html(data);
return true;
}
},
error: function error(XMLHttpRequest, textStatus, errorThrown) {
window.status = 'Ajax Error! Status: ' + textStatus;
alert('Ajax Error! Status: ' + XMLHttpRequest.status + ' ' + XMLHttpRequest.statusText);
},
// beforeSend: someFunction,
data: {
action: 'WPBC_FLEXTIMELINE_NAV',
timeline_obj: timeline_obj,
nav_step: nav_step,
wpdev_active_locale: wpbc_active_locale,
wpbc_nonce: document.getElementById('wpbc_nonce_' + timeline_obj.html_client_id).value
}
});
}
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInYyL19zcmMvdGltZWxpbmVfdjIuanMiXSwibmFtZXMiOlsid3BiY19mbGV4dGltZWxpbmVfbmF2IiwidGltZWxpbmVfb2JqIiwibmF2X3N0ZXAiLCJqUXVlcnkiLCJ0cmlnZ2VyIiwiaHRtbF9jbGllbnRfaWQiLCJyZW1vdmUiLCJodG1sIiwiaXNGdW5jdGlvbiIsInBvcG92ZXIiLCJhamF4IiwidXJsIiwid3BiY19hamF4dXJsIiwidHlwZSIsInN1Y2Nlc3MiLCJkYXRhIiwidGV4dFN0YXR1cyIsImVycm9yIiwiWE1MSHR0cFJlcXVlc3QiLCJlcnJvclRocm93biIsIndpbmRvdyIsInN0YXR1cyIsImFsZXJ0Iiwic3RhdHVzVGV4dCIsImFjdGlvbiIsIndwZGV2X2FjdGl2ZV9sb2NhbGUiLCJ3cGJjX2FjdGl2ZV9sb2NhbGUiLCJ3cGJjX25vbmNlIiwiZG9jdW1lbnQiLCJnZXRFbGVtZW50QnlJZCIsInZhbHVlIl0sIm1hcHBpbmdzIjoiOztBQUNBLFNBQVNBLHFCQUFULENBQWdDQyxZQUFoQyxFQUE4Q0MsUUFBOUMsRUFBd0Q7QUFFcERDLEVBQUFBLE1BQU0sQ0FBRSwwQkFBRixDQUFOLENBQXFDQyxPQUFyQyxDQUE4QyxjQUE5QyxFQUErRCxDQUFFSCxZQUFGLEVBQWdCQyxRQUFoQixDQUEvRCxFQUZvRCxDQUVnRDtBQUVwRztBQUNBOztBQUVBQyxFQUFBQSxNQUFNLENBQUUsTUFBSUYsWUFBWSxDQUFDSSxjQUFqQixHQUFrQyxrQkFBbEMsR0FBcURKLFlBQVksQ0FBQ0ksY0FBbEUsR0FBbUYsZ0JBQXJGLENBQU4sQ0FBNkdDLE1BQTdHO0FBQ0FILEVBQUFBLE1BQU0sQ0FBQyxNQUFJRixZQUFZLENBQUNJLGNBQWpCLEdBQWtDLGlCQUFuQyxDQUFOLENBQTRERSxJQUE1RCxDQUFrRSw4RUFBbEUsRUFSb0QsQ0FRcUc7O0FBSXpKLE1BQUtKLE1BQU0sQ0FBQ0ssVUFBUCxDQUFtQkwsTUFBTSxDQUFDLCtCQUFELENBQU4sQ0FBeUNNLE9BQTVELENBQUwsRUFBb0Y7QUFDaEZOLElBQUFBLE1BQU0sQ0FBQywrQkFBRCxDQUFOLENBQXdDTSxPQUF4QyxDQUFpRCxNQUFqRCxFQWJnRCxDQWFnQzs7QUFFcEZOLEVBQUFBLE1BQU0sQ0FBQ08sSUFBUCxDQUFZO0FBQ1JDLElBQUFBLEdBQUcsRUFBRUMsWUFERztBQUVSQyxJQUFBQSxJQUFJLEVBQUMsTUFGRztBQUdSQyxJQUFBQSxPQUFPLEVBQUUsaUJBQVdDLElBQVgsRUFBaUJDLFVBQWpCLEVBQTZCO0FBQWtDO0FBQzVELFVBQUlBLFVBQVUsSUFBSSxTQUFsQixFQUE2QjtBQUN6QmIsUUFBQUEsTUFBTSxDQUFDLE1BQU1GLFlBQVksQ0FBQ0ksY0FBbkIsR0FBb0MsOEJBQXJDLENBQU4sQ0FBNEVFLElBQTVFLENBQWtGUSxJQUFsRjtBQUNBLGVBQU8sSUFBUDtBQUNIO0FBQ0osS0FSRDtBQVNSRSxJQUFBQSxLQUFLLEVBQUcsZUFBV0MsY0FBWCxFQUEyQkYsVUFBM0IsRUFBdUNHLFdBQXZDLEVBQW1EO0FBQy9DQyxNQUFBQSxNQUFNLENBQUNDLE1BQVAsR0FBZ0IseUJBQXlCTCxVQUF6QztBQUNBTSxNQUFBQSxLQUFLLENBQUUseUJBQXlCSixjQUFjLENBQUNHLE1BQXhDLEdBQWlELEdBQWpELEdBQXVESCxjQUFjLENBQUNLLFVBQXhFLENBQUw7QUFDSCxLQVpEO0FBYVI7QUFDQVIsSUFBQUEsSUFBSSxFQUFDO0FBQ0dTLE1BQUFBLE1BQU0sRUFBYyx1QkFEdkI7QUFFR3ZCLE1BQUFBLFlBQVksRUFBUUEsWUFGdkI7QUFHR0MsTUFBQUEsUUFBUSxFQUFZQSxRQUh2QjtBQUlHdUIsTUFBQUEsbUJBQW1CLEVBQUNDLGtCQUp2QjtBQUtHQyxNQUFBQSxVQUFVLEVBQVVDLFFBQVEsQ0FBQ0MsY0FBVCxDQUF3QixnQkFBZTVCLFlBQVksQ0FBQ0ksY0FBcEQsRUFBb0V5QjtBQUwzRjtBQWRHLEdBQVo7QUFzQkgiLCJzb3VyY2VzQ29udGVudCI6WyJcclxuZnVuY3Rpb24gd3BiY19mbGV4dGltZWxpbmVfbmF2KCB0aW1lbGluZV9vYmosIG5hdl9zdGVwICl7XHJcblxyXG4gICAgalF1ZXJ5KCBcIi53cGJjX3RpbWVsaW5lX2Zyb250X2VuZFwiICkudHJpZ2dlciggXCJ0aW1lbGluZV9uYXZcIiAsIFsgdGltZWxpbmVfb2JqLCBuYXZfc3RlcCBdICk7ICAgICAgICAvL0ZpeEluOjcuMC4xLjQ4XHJcblxyXG4gICAgLy8galF1ZXJ5KCAnIycrdGltZWxpbmVfb2JqLmh0bWxfY2xpZW50X2lkICsgJyAud3BiY190bF9wcmV2LCMnK3RpbWVsaW5lX29iai5odG1sX2NsaWVudF9pZCArICcgLndwYmNfdGxfbmV4dCcpLnJlbW92ZSgpO1xyXG4gICAgLy8galF1ZXJ5KCcjJyt0aW1lbGluZV9vYmouaHRtbF9jbGllbnRfaWQgKyAnIC53cGJjX3RsX3RpdGxlJykuaHRtbCggJzxzcGFuIGNsYXNzPVwiZ2x5cGhpY29uIGdseXBoaWNvbi1yZWZyZXNoIHdwYmNfc3BpblwiPjwvc3Bhbj4gJm5ic3AgTG9hZGluZy4uLicgKTsgICAgICAvLyAnPGRpdiBzdHlsZT1cImhlaWdodDoyMHB4O3dpZHRoOjEwMCU7dGV4dC1hbGlnbjpjZW50ZXI7bWFyZ2luOjE1cHggYXV0bztcIj5Mb2FkaW5nIC4uLiA8aW1nIHN0eWxlPVwidmVydGljYWwtYWxpZ246bWlkZGxlO2JveC1zaGFkb3c6bm9uZTt3aWR0aDoxNHB4O1wiIHNyYz1cIicrd3BkZXZfYmtfcGx1Z2luX3VybCsnL2Fzc2V0cy9pbWcvYWpheC1sb2FkZXIuZ2lmXCI+PC8vZGl2PidcclxuXHJcbiAgICBqUXVlcnkoICcjJyt0aW1lbGluZV9vYmouaHRtbF9jbGllbnRfaWQgKyAnIC5mbGV4X3RsX3ByZXYsIycrdGltZWxpbmVfb2JqLmh0bWxfY2xpZW50X2lkICsgJyAuZmxleF90bF9uZXh0JykucmVtb3ZlKCk7XHJcbiAgICBqUXVlcnkoJyMnK3RpbWVsaW5lX29iai5odG1sX2NsaWVudF9pZCArICcgLmZsZXhfdGxfdGl0bGUnKS5odG1sKCAnPHNwYW4gY2xhc3M9XCJnbHlwaGljb24gZ2x5cGhpY29uLXJlZnJlc2ggd3BiY19zcGluXCI+PC9zcGFuPiAmbmJzcCBMb2FkaW5nLi4uJyApOyAgICAgIC8vICc8ZGl2IHN0eWxlPVwiaGVpZ2h0OjIwcHg7d2lkdGg6MTAwJTt0ZXh0LWFsaWduOmNlbnRlcjttYXJnaW46MTVweCBhdXRvO1wiPkxvYWRpbmcgLi4uIDxpbWcgc3R5bGU9XCJ2ZXJ0aWNhbC1hbGlnbjptaWRkbGU7Ym94LXNoYWRvdzpub25lO3dpZHRoOjE0cHg7XCIgc3JjPVwiJyt3cGRldl9ia19wbHVnaW5fdXJsKycvYXNzZXRzL2ltZy9hamF4LWxvYWRlci5naWZcIj48Ly9kaXY+J1xyXG5cclxuXHJcblxyXG4gICAgaWYgKCBqUXVlcnkuaXNGdW5jdGlvbiggalF1ZXJ5KFwiLnBvcG92ZXJfY2xpY2sucG9wb3Zlcl9ib3R0b21cIiApLnBvcG92ZXIgKSAgKSAgICAgICAvL0ZpeEluOiA3LjAuMS4yICAtIDIwMTYtMTItMTBcclxuICAgICAgICBqUXVlcnkoJy5wb3BvdmVyX2NsaWNrLnBvcG92ZXJfYm90dG9tJykucG9wb3ZlciggJ2hpZGUnICk7ICAgICAgICAgICAgICAgICAgICAgIC8vSGlkZSBhbGwgb3BuZWQgcG9wb3ZlcnNcclxuXHJcbiAgICBqUXVlcnkuYWpheCh7XHJcbiAgICAgICAgdXJsOiB3cGJjX2FqYXh1cmwsXHJcbiAgICAgICAgdHlwZTonUE9TVCcsXHJcbiAgICAgICAgc3VjY2VzczogZnVuY3Rpb24gKCBkYXRhLCB0ZXh0U3RhdHVzICl7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gTm90ZSwgIGhlcmUgd2UgZGlyZWN0IHNob3cgSFRNTCB0byBUaW1lTGluZSBmcmFtZVxyXG4gICAgICAgICAgICAgICAgICAgIGlmKCB0ZXh0U3RhdHVzID09ICdzdWNjZXNzJykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBqUXVlcnkoJyMnICsgdGltZWxpbmVfb2JqLmh0bWxfY2xpZW50X2lkICsgJyAud3BiY190aW1lbGluZV9hamF4X3JlcGxhY2UnICkuaHRtbCggZGF0YSApO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9LFxyXG4gICAgICAgIGVycm9yOiAgZnVuY3Rpb24gKCBYTUxIdHRwUmVxdWVzdCwgdGV4dFN0YXR1cywgZXJyb3JUaHJvd24pe1xyXG4gICAgICAgICAgICAgICAgICAgIHdpbmRvdy5zdGF0dXMgPSAnQWpheCBFcnJvciEgU3RhdHVzOiAnICsgdGV4dFN0YXR1cztcclxuICAgICAgICAgICAgICAgICAgICBhbGVydCggJ0FqYXggRXJyb3IhIFN0YXR1czogJyArIFhNTEh0dHBSZXF1ZXN0LnN0YXR1cyArICcgJyArIFhNTEh0dHBSZXF1ZXN0LnN0YXR1c1RleHQgKTtcclxuICAgICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgLy8gYmVmb3JlU2VuZDogc29tZUZ1bmN0aW9uLFxyXG4gICAgICAgIGRhdGE6e1xyXG4gICAgICAgICAgICAgICAgYWN0aW9uOiAgICAgICAgICAgICAnV1BCQ19GTEVYVElNRUxJTkVfTkFWJyxcclxuICAgICAgICAgICAgICAgIHRpbWVsaW5lX29iajogICAgICAgdGltZWxpbmVfb2JqLFxyXG4gICAgICAgICAgICAgICAgbmF2X3N0ZXA6ICAgICAgICAgICBuYXZfc3RlcCxcclxuICAgICAgICAgICAgICAgIHdwZGV2X2FjdGl2ZV9sb2NhbGU6d3BiY19hY3RpdmVfbG9jYWxlLFxyXG4gICAgICAgICAgICAgICAgd3BiY19ub25jZTogICAgICAgICBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgnd3BiY19ub25jZV8nKyB0aW1lbGluZV9vYmouaHRtbF9jbGllbnRfaWQpLnZhbHVlXHJcbiAgICAgICAgfVxyXG4gICAgfSk7XHJcbn1cclxuXHJcbiJdLCJmaWxlIjoidjIvX291dC90aW1lbGluZV92Mi5qcyJ9;