Affected times:
";
msg += "
"+me.formatString(me.allUsedSlots[i],true,me.tzf(d))+""+me.services[me.allUsedSlots[i].serviceindex].name+"
";
}
//overlapping = !find;
}
me.ignoreUsedSlots = false;
var isValid = !overlapping;
if (true === isValid) {
var submitted = validator.formSubmitted;
validator.prepareElement( element );
validator.formSubmitted = submitted;
validator.successList.push( element );
delete validator.invalid[ element.name ];
validator.showErrors();
} else {
for (var i=0;i
";
errors[ element.name ] = validator.defaultMessage( element, "avoid_overlapping" )+msg;
validator.invalid[ element.name ] = true;
validator.showErrors( errors );
element.focus();
}
previous.valid = isValid;
validator.stopRequest( element, isValid );
cp_hourbk_avoid_overlapping--;
}
});
return "pending";
}
return true;
}
$.validator.addMethod('avoid_overlapping', avoid_over_function);
}
},
val:function()
{
return 0;
}
}
); $.fbuilder.controls[ 'facceptance' ]=function(){};
$.extend(
$.fbuilder.controls[ 'facceptance' ].prototype,
$.fbuilder.controls[ 'ffields' ].prototype,
{
title:"Accept terms and conditions",
ftype:"facceptance",
value:"I accept",
required:true,
url:"",
message:"",
show:function()
{
var me = this,
dlg = '',
label = me.title;
if(!/^\s*$/.test(me.url))
{
label = ''+label+'';
}
else if(!/^\s*$/.test(me.message))
{
label = ''+label+'';
dlg += ''
}
return '';
},
after_show:function()
{
$(document).on('click','.cff-open-dlg', function(){
var dlg = $(this).closest('.fields').find('.cff-dialog'), w = dlg.data('width'), h=dlg.data('height');
dlg.removeClass('hide');
if('undefined' == typeof w) w = Math.min($(this).closest('form').width(), $(window).width(), dlg.width());
if('undefined' == typeof h) h = Math.min($(this).closest('form').height(), $(window).height(), dlg.height());
dlg.data('width',w);
dlg.data('height',h);
dlg.css({'width': w+'px', 'height': h+'px', 'margin-top': (-1*h/2)+'px', 'margin-left': (-1*w/2)+'px'});
});
$(document).on('click','.cff-close-dlg', function(){$(this).closest('.cff-dialog').addClass('hide');});
},
val:function()
{
var e = $('[id="'+this.name+'"]:checked:not(.ignore)');
if( e.length )
{
var t = $.fbuilder.parseValStr( e[0].value );
if(!$.isNumeric(t)) t = t.replace(/^"/,'').replace(/"$/,'');
}
return (v) ? (($.isNumeric(v)) ? v : '"'+v+'"') : 0;
}
}
); var fcount = 1;
var fcount_tags = 1;
var fnum = "_"+fcount;
var cp_avoid_hidden = false;
while (20>fcount || eval("typeof cp_appbooking_fbuilder_config"+fnum+" != 'undefined'"))
{
try {
var cp_appbooking_fbuilder_config = eval("cp_appbooking_fbuilder_config"+fnum);
while (20>fcount_tags && !$("#fbuilder_"+fcount_tags).length)
fcount_tags++;
cp_appbooking_fbuilder_config = $.parseJSON(cp_appbooking_fbuilder_config.obj);
cp_appbooking_fbuilder_config.identifier = "_"+fcount_tags;
var opt_identifier = $("#fieldlist_"+fcount_tags);
opt_identifier.attr("fcount_tags",fcount_tags);
opt_identifier.attr("fnum",fnum);
opt_identifier.addClass("cp_avoid_hidden")
var f = $("#fbuilder_"+fcount_tags).fbuilder(cp_appbooking_fbuilder_config);
f.fBuild.loadData("form_structure_"+fcount_tags);
$.fbuilder.configValidate($("#cp_appbooking_pform_"+fcount_tags));
if((typeof opt_identifier.attr("fnum") !== 'undefined') && !opt_identifier.is(':hidden'))
$(opt_identifier).addClass("cp_v_v");
else
cp_avoid_hidden = true;
} catch (e) {}
fcount++;
fcount_tags++;
fnum = "_"+fcount;
}
if (cp_avoid_hidden)
$( document ).each(
function()
{
(new MutationObserver(
function(mutationsList, observer)
{
for(let k in mutationsList)
{
var mutation = mutationsList[k];
if (mutation.type === 'childList')
{
if(mutation.addedNodes.length)
{
try{
$(".cp_avoid_hidden").each(function(){
var opt_identifier= $("#"+$(this).attr("id"));
if((typeof opt_identifier.attr("fnum") !== 'undefined') && !opt_identifier.is(':hidden') && !opt_identifier.hasClass("cp_v_v"))
{
$(opt_identifier).addClass("cp_v_v");
var fnum = opt_identifier.attr("fnum");
var fcount_tags = opt_identifier.attr("fcount_tags");
var cp_appbooking_fbuilder_config = eval("cp_appbooking_fbuilder_config"+fnum);
cp_appbooking_fbuilder_config = $.parseJSON(cp_appbooking_fbuilder_config.obj);
cp_appbooking_fbuilder_config.identifier = "_"+fcount_tags;
var f = $("#fbuilder_"+fcount_tags).fbuilder(cp_appbooking_fbuilder_config);
f.fBuild.loadData("form_structure_"+fcount_tags);
$.fbuilder.configValidate(opt_identifier.closest("form"));
}
})
}catch(err){}
}
}
}
}
)).observe(this, { childList: true, subtree: true });
}
);
})(fbuilderjQuery);
});