jQuery(window).on('load', function() { new JCaption('img.caption'); }); jQuery(document).ready(function($){ $("#chronoform-formularz_kontaktowy").gvalidate(); $("#chronoform-formularz_kontaktowy").find(":input").on("invalid.gvalidation", function(){ var field = $(this); if(field.is(":hidden")){ if(field.closest(".tab-pane").length > 0){ var tab_id = field.closest(".tab-pane").attr("id"); $('a[href="#'+tab_id+'"]').closest(".nav").gtabs("get").show($('a[href="#'+tab_id+'"]')); } if(field.closest(".panel-collapse").length > 0){ var slider_id = field.closest(".panel-collapse").attr("id"); $('a[href="#'+slider_id+'"]').closest(".panel-group").gsliders("get").show($('a[href="#'+slider_id+'"]')); } } if(field.data("wysiwyg") == "1"){ field.data("gvalidation-target", field.parent()); } }); $("#chronoform-formularz_kontaktowy").on("success.gvalidation", function(e){ if($("#chronoform-formularz_kontaktowy").data("gvalidate_success")){ var gvalidate_success = $("#chronoform-formularz_kontaktowy").data("gvalidate_success"); if(gvalidate_success in window){ window[gvalidate_success](e, $("#chronoform-formularz_kontaktowy")); } } }); $("#chronoform-formularz_kontaktowy").on("fail.gvalidation", function(e){ if($("#chronoform-formularz_kontaktowy").data("gvalidate_fail")){ var gvalidate_fail = $("#chronoform-formularz_kontaktowy").data("gvalidate_fail"); if(gvalidate_fail in window){ window[gvalidate_fail](e, $("#chronoform-formularz_kontaktowy")); } } }); function chronoforms_validation_signs(formObj){ formObj.find(":input[class*=validate]").each(function(){ if($(this).attr("class").indexOf("required") >= 0 || $(this).attr("class").indexOf("group") >= 0){ var required_parent = []; if($(this).closest(".gcore-subinput-container").length > 0){ var required_parent = $(this).closest(".gcore-subinput-container"); }else if($(this).closest(".gcore-form-row, .form-group").length > 0){ var required_parent = $(this).closest(".gcore-form-row, .form-group"); } if(required_parent.length > 0){ var required_label = required_parent.find("label"); if(required_label.length > 0 && !required_label.first().hasClass("required_label")){ required_label.first().addClass("required_label"); required_label.first().html(required_label.first().html() + " *"); } } } }); } chronoforms_validation_signs($("#chronoform-formularz_kontaktowy")); function chronoforms_data_tooltip(formObj){ formObj.find(":input").each(function(){ if($(this).data("tooltip") && $(this).closest(".gcore-input, .gcore-input-wide").length > 0){ var tipped_parent = []; if($(this).closest(".gcore-subinput-container").length > 0){ var tipped_parent = $(this).closest(".gcore-subinput-container"); }else if($(this).closest(".gcore-form-row, .form-group").length > 0){ var tipped_parent = $(this).closest(".gcore-form-row, .form-group"); } if(tipped_parent.length > 0){ var tipped_label = tipped_parent.find("label"); if(tipped_label.length > 0 && !tipped_label.first().hasClass("tipped_label")){ tipped_label.first().addClass("tipped_label"); var $tip = $("!"); $tip.data("content", $(this).data("tooltip")); tipped_label.first().append($tip); } } } }); formObj.find(".input-tooltip").gtooltip(); } chronoforms_data_tooltip($("#chronoform-formularz_kontaktowy")); function chronoforms_data_loadstate(formObj){ formObj.find(':input[data-load-state="disabled"]').prop("disabled", true); formObj.find('*[data-load-state="hidden"]').css("display", "none"); formObj.find(':input[data-load-state="hidden_parent"]').each(function(){ if($(this).closest(".gcore-subinput-container").length > 0){ $(this).closest(".gcore-subinput-container").css("display", "none"); }else if($(this).closest(".gcore-form-row").length > 0){ $(this).closest(".gcore-form-row").css("display", "none"); } }); } chronoforms_data_loadstate($("#chronoform-formularz_kontaktowy")); $(":input").inputmask(); function chronoforms_fields_events(){ } chronoforms_fields_events(); function chronoforms_pageload_fields_events(){ } chronoforms_pageload_fields_events(); }); jQuery(document).ready(function($){ $('[data-g-toggle="tab"]').closest('.nav').gtabs({ 'pane_selector':'.tab-pane', 'tab_selector':'[data-g-toggle="tab"]', }); $('[data-g-toggle="collapse"]').closest('.panel-group').gsliders({ 'pane_selector':'.panel-collapse', 'tab_selector':'[data-g-toggle="collapse"]', 'active_pane_class':'in', }); $('[data-g-toggle="modal"]').on('click', function(e){ e.preventDefault(); $modal = $($(this).data('g-target')); $modal.gmodal({ 'close_selector' : '[data-g-dismiss="modal"]', }); $modal.gmodal('open'); }); $('.gdropdown').gdropdown(); $('[data-g-toggle="dropdown"]').on('click', function(e){ e.preventDefault(); $(this).parent().find('.gdropdown').gdropdown('toggle'); }); });