PluginProbe
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder / V3.3.2
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder vV3.3.2
V3.3.2 3.3.1 V-3.3.0 3.2.2 3.2.1 3.2.0 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 V3.0.3 V3.0.2 -3.0.1 V_3.0.0 1.1.1 1.1.8 1.2 1.3 1.4 1.4.18 1.5.2 1.9 2.0 2.10.0 All 139 releases
← All changes | includes/Admin/Form/FrontEndScriptGenerator.php +8 -9 V-3.3.0 → V3.3.2 View file →
@@ -42,17 +42,15 @@
42 42 }
43 43 if(!window.bf_globals[contentId]){
44 44 window.bf_globals[contentId] = {inits: {}, contentId: contentId};
45 45 }else{
46 - window.bf_globals[contentId].inits = {};
46 + if(!window.bf_globals[contentId].inits) window.bf_globals[contentId].inits = {};
47 47 window.bf_globals[contentId].contentId = contentId;
48 48 }
49 49 });
50 50 };
51 - // Wait for DOM ready: optimizers can run this before the form markup is
52 - // parsed, and the not-found branch would then delete arrived config.
53 51 if(document.readyState === "loading"){
54 - document.addEventListener("DOMContentLoaded", bfSetupGlobals);
52 + document.addEventListener("DOMContentLoaded", bfSetupGlobals, { once: true });
55 53 } else {
56 54 bfSetupGlobals();
57 55 }
58 56 })();';
@@ -224,13 +222,14 @@
224 222 $fileArr = $this->_validationJsFilesNeeded['requiredFldValidation'];
225 223 $this->addScriptInLoadedScriptsList($fileArr);
226 224 }
227 225 // for regex
228 - if (Helpers::property_exists_nested($fldData, 'valid->regexr')) {
229 - $patternFile = $this->_validationJsFilesNeeded['generateBackslashPattern'];
230 - $rgx = $this->_validationJsFilesNeeded['regexPatternValidation'];
231 - $this->addScriptInLoadedScriptsList($patternFile);
232 - $this->addScriptInLoadedScriptsList($rgx);
226 + // The RegEx scripts are registered by Pro; without it there is nothing to load.
227 + if (Helpers::property_exists_nested($fldData, 'valid->regexr')
228 + && !empty($this->_validationJsFilesNeeded['generateBackslashPattern'])
229 + && !empty($this->_validationJsFilesNeeded['regexPatternValidation'])) {
230 + $this->addScriptInLoadedScriptsList($this->_validationJsFilesNeeded['generateBackslashPattern']);
231 + $this->addScriptInLoadedScriptsList($this->_validationJsFilesNeeded['regexPatternValidation']);
233 232 }
234 233
235 234 $validationScriptFileMapping = ScriptFilePriorityManager::validationScriptFileMapping($fldData->typ);
236 235 if ($validationScriptFileMapping) {