Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce accumsan elementum pretium. Pellentesque erat turpis, facilisis in scelerisque eget, maximus vitae est. Aenean dictum arcu a suscipit fringilla. Maecenas molestie suscipit lectus, vel iaculis purus consequat vitae. Vivamus vel dolor ac leo rutrum consectetur. Fusce hendrerit hendrerit fringilla. Sed dictum maximus lorem sed faucibus. Phasellus pharetra risus nec scelerisque varius. In eu nulla laoreet libero viverra condimentum vel in quam. Donec fermentum lectus at lobortis dignissim. Integer lorem libero, tempor et ante et, varius consequat dui. Aliquam convallis vel arcu et varius. Morbi turpis lorem, luctus nec venenatis eu, aliquet sit amet est.
Interdum et malesuada fames ac ante ipsum primis in faucibus. Donec dictum semper enim, vitae ultricies quam blandit sed. Etiam pretium nisl ac tortor elementum, nec efficitur risus convallis. Maecenas nec iaculis lectus. Vivamus ligula dui, ullamcorper sed justo sed, congue consectetur augue. Vestibulum eget augue justo. Cras vitae feugiat eros. In neque odio, malesuada quis felis vitae, placerat iaculis dui. Mauris feugiat et lectus non fermentum.
').html(error)
);
}
// unset selected date on error
jQuery('#vapdayselected').val('');
// hide wait list button
jQuery('#vapwaitlistbox').hide();
// hide add cart button
jQuery('#vapadditembutton').hide();
}
// animate only in case the timeline is not visible
var px_to_scroll = isBoxOutOfMonitor(jQuery('#vaptimeline'), 60);
if (px_to_scroll !== false) {
jQuery('html,body').animate({scrollTop: "+=" + px_to_scroll}, {duration:'normal'});
}
});
}
var HOUR_MIN_SELECTED = false;
function vapRenderTimeline(timeline, html, newRate, request) {
let eventArgs = {
timeline: timeline,
html: html,
newRate: newRate,
request: request,
};
// inject received parameters within the event to dispatch
var event = jQuery.Event('timeline.beforerender');
event.params = eventArgs;
// trigger event before rendering the timeline
jQuery(window).trigger(event);
// fill timeline with fetched HTML
jQuery('#vaptimeline').html(html);
// update base cost
if (newRate && typeof vapUpdateServiceRate !== 'undefined') {
/**
* @see views/employeesearch/tmpl/default_filterbar.php
*/
vapUpdateServiceRate(newRate);
}
var at_least_one_open = false;
var at_least_one_closed = false;
// iterate timeline levels
timeline.forEach((level) => {
// iterate level times
level.forEach((time) => {
at_least_one_open = at_least_one_open || (time.status == 1);
at_least_one_closed = at_least_one_closed || (time.status == 0);
});
});
// display "add to cart" button only if the timeline
// reports at least an available slot
if (at_least_one_open) {
jQuery('#vapadditembutton').show();
} else {
jQuery('#vapadditembutton').hide();
}
// display "add to waiting list" button only if the
// timeline reports at least an occupied slot
if (at_least_one_closed) {
jQuery('#vapwaitlistbox').show();
} else {
jQuery('#vapwaitlistbox').hide();
}
// inject received parameters within the event to dispatch
var event = jQuery.Event('timeline.afterrender');
event.params = eventArgs;
// trigger event after rendering the timeline
jQuery(window).trigger(event);
}
function vapTimeClicked(hour, min, slot)
{
let eventArgs = {
hour: hour,
min: min,
};
// inject received parameters within the event to dispatch
var event = jQuery.Event('timeline.beforepicktime');
event.params = eventArgs;
// trigger event before picking a time slot
jQuery(slot).trigger(event);
// get new rate as string
var newRate = '' + jQuery(slot).find('.vaptlblock1').data('rate');
if (newRate.length && typeof vapUpdateServiceRate !== 'undefined') {
/**
* Dispatch rate update only if the data is set.
*
* @see views/employeesearch/tmpl/default_filterbar.php
*/
vapUpdateServiceRate(parseFloat(newRate));
}
jQuery('#vapconfempselected').val(0);
jQuery('#vapconfserselected').val(3);
jQuery('#vapconfdayselected').val(jQuery('#vapdayselected').val());
jQuery('#vapconfhourselected').val(hour);
jQuery('#vapconfminselected').val(min);
jQuery('#vapconfpeopleselected').val(jQuery('#vappeopleselected').val());
jQuery('.vaptlblock1').removeClass('vaptimeselected');
jQuery(slot).find('.vaptlblock1').addClass('vaptimeselected');
var opt_div = jQuery('.vapseroptionscont');
if (opt_div.length > 0) {
opt_div.slideDown();
}
var rec_div = jQuery('.vaprecurrencediv');
if (rec_div.length > 0) {
rec_div.slideDown();
}
isTimeChoosen = true;
// inject received parameters within the event to dispatch
var event = jQuery.Event('timeline.afterpicktime');
event.params = eventArgs;
// trigger event after picking a time slot
jQuery(slot).trigger(event);
}