PageSourceSearch

https://dona.fondazionehumanitasricerca.it/themes/default/js/dynam…?hash=d0fa20a4d6821cc2aeba535277ff9b6e

js fondazionehumanitasricerca.it collected 2026-10-04 16:43:35 UTC 6,550 bytes, 26 lines download raw bytes

1const dynamicFormManager=(function(){let self={};const step2Blocks={'company_block':['company','company_siren','company_status'],'identity_block':['civility','firstname','lastname'],'address_block':['address1','address2','postcode','city','country']};let fieldInventory={'email':null,'address_block':{},'company_block':{},'identity_block':{},'custom_fields':{},};let emailIsHidden=false;let addressBlockIsHidden=false;let companyBlockIsHidden=false;let identityBlockIsHidden=false;let allCustomFieldsInStep2AreHidden=true;self.urlParameters={};function dynamicHideElement($element){$element.attr('data-dynamically-hidden',1);}
2function getCurrentFormState(){const $step1=$('#step-1');const $step2=$('#step-2');const $step3=$('#step-3');$step1.find('.custom-field-p ').each(function(){fieldInventory['custom_fields'][$(this).attr('name')]={'step':1,'element':$(this),'is_visible_in_dom':true};});fieldInventory['email']={'step':2,'element':$step2.find('#email').parent(),'is_visible_in_dom':$step2.find('#email').attr('type')!='hidden'};for(const[blockName,fieldList]of Object.entries(step2Blocks)){for(const fieldName of fieldList){if($step2.find('#'+fieldName).length>0){fieldInventory[blockName][fieldName]={'step':2,'element':$step2.find('#'+fieldName).parent(),'is_visible_in_dom':$step2.find('#'+fieldName).attr('type')!='hidden'};}}}
3$step2.find('.custom-field-p.company-infos').each(function(){fieldInventory['company_block'][$(this).attr('name')]={'step':2,'element':$(this),'is_visible_in_dom':true};});$step2.find('.custom-field-p').not('.company-infos').each(function(){fieldInventory['custom_fields'][$(this).attr('name')]={'step':2,'element':$(this),'is_visible_in_dom':true}});$step3.find('.custom-field-p').each(function(){fieldInventory['custom_fields'][$(this).attr('name')]={'step':3,'element':$(this),'is_visible_in_dom':true}});}
4function hideEmailIfFilled(){if('email'in self.urlParameters&&fieldInventory['email']['is_visible_in_dom']){dynamicHideElement(fieldInventory['email']['element']);fieldInventory['email']['is_visible_in_dom']=false;emailIsHidden=true;}}
5function hideCompanyBlockIfFilledOrEmpty(){let hideCompanyBlock=false;let fieldsNotGivenCount=0;let dataInIdentityBlock=false;for(const field in fieldInventory['identity_block']){if(field in self.urlParameters){dataInIdentityBlock=true;}}
6for(const field in fieldInventory['company_block']){if(fieldInventory['company_block'][field]['is_visible_in_dom']&&!(field in self.urlParameters)){fieldsNotGivenCount+=1;}}
7if(fieldsNotGivenCount==0||(dataInIdentityBlock&&fieldsNotGivenCount==Object.keys(fieldInventory['company_block']).length)){hideCompanyBlock=true;}
8if(hideCompanyBlock){for(const field in fieldInventory['company_block']){if(fieldInventory['company_block'][field]['is_visible_in_dom']){dynamicHideElement(fieldInventory['company_block'][field]['element']);fieldInventory['company_block'][field]['is_visible_in_dom']=false;}}
9dynamicHideElement($('.company-infos'));companyBlockIsHidden=true;}
10if(hideCompanyBlock||dataInIdentityBlock){dynamicHideElement($('#iscompany').closest('p'));}}
11function hideIdentityBlockIfFilled(){let hideIdentityBlock=true;for(const field in fieldInventory['identity_block']){if(fieldInventory['identity_block'][field]['is_visible_in_dom']&&!(field in self.urlParameters)){hideIdentityBlock=false;}}
12if(hideIdentityBlock){for(const field in fieldInventory['identity_block']){if(fieldInventory['identity_block'][field]['is_visible_in_dom']){dynamicHideElement(fieldInventory['identity_block'][field]['element']);fieldInventory['identity_block'][field]['is_visible_in_dom']=false;}}
13identityBlockIsHidden=true;}}
14function hideAddressBlockIfFilled(){let hideAddressBlock=true;for(const field in fieldInventory['address_block']){if(field!='address2'&&fieldInventory['address_block'][field]['is_visible_in_dom']&&!(field in self.urlParameters)){hideAddressBlock=false;}}
15if(hideAddressBlock){for(const field in fieldInventory['address_block']){if(fieldInventory['address_block'][field]['is_visible_in_dom']){dynamicHideElement(fieldInventory['address_block'][field]['element']);fieldInventory['address_block'][field]['is_visible_in_dom']=false;}}
16addressBlockIsHidden=true;}}
17function hideCustomFieldsIfFilled(){for(const field in fieldInventory['custom_fields']){if(field in self.urlParameters&&fieldInventory['custom_fields'][field]['is_visible_in_dom']){dynamicHideElement(fieldInventory['custom_fields'][field]['element']);}else{if(fieldInventory['custom_fields'][field]['step']==2){allCustomFieldsInStep2AreHidden=false;}}}}
18function hideFilledBlock(){hideEmailIfFilled();hideCompanyBlockIfFilledOrEmpty();hideIdentityBlockIfFilled();hideAddressBlockIfFilled();hideCustomFieldsIfFilled();toggleMandatoryFieldWarning();}
19function hideStep2IfFilled(){noPaymentMethodInStep2=$('#step-2').find('.step2_connect_block').length===0;if(allCustomFieldsInStep2AreHidden&&emailIsHidden&&addressBlockIsHidden&&companyBlockIsHidden&&identityBlockIsHidden&&noPaymentMethodInStep2){dynamicHideElement($('#step-2'));}}
20function toggleMandatoryFieldWarning(){const $requiredInfo=$('#required-info');if($('#step-2').find('[data-dynamically-hidden="1"]').find('label .required').length==$('#step-2').find('label .required').length){$requiredInfo.hide();}else{$requiredInfo.show();}}
21self.displayFieldsInError=function(){$('.ira-item-error[data-dynamically-hidden="1"]').each(function(){const $elem=$(this);$elem.attr('data-dynamically-hidden','0');let elemBlock=null;const elemName=$elem.find('input, select').attr('name');for(const[blockName,fieldList]of Object.entries(step2Blocks)){for(const fieldName of fieldList){if(fieldName==elemName){elemBlock=blockName;break;}}}
22if(elemBlock){for(const blockElemName of step2Blocks[elemBlock]){$('#step-2').find('#'+blockElemName).parent().attr('data-dynamically-hidden','0');}}
23$elem.parents('[data-dynamically-hidden="1"]').each(function(){const $parent=$(this);$parent.attr('data-dynamically-hidden','0');});});toggleMandatoryFieldWarning();}
24self.init=function(urlParameters){const afterAnchorParams=new URLSearchParams(document.location.hash.substring(1));
24afterAnchorParams.forEach((value,key)=>{urlParameters[key]=value;});if(typeof Steps!='undefined'){for(const[key,value]of Object.entries(Steps.urlParams)){urlParameters[key]=value;}}
25self.urlParameters=Object.fromEntries(Object.entries(urlParameters).filter(([k,v])=>v!=''));getCurrentFormState();hideFilledBlock();hideStep2IfFilled();self.displayFieldsInError();$('body').bind('error_change',self.displayFieldsInError);}
26return self;})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.