PageSourceSearch

https://donner.fondation-unavenirensemble.org/themes/default/js/st…?hash=646b3e2fefe3d9fcf3b9a63c96e570cf

js fondation-unavenirensemble.org collected 2026-10-05 21:31:13 UTC 19,357 bytes, 42 lines download raw bytes

1var Step1={max_height:'',min_once_amount:'',max_once_amount:'',min_regular_amount:'',max_regular_amount:'',adapted_height:false,lang:'fr_FR',payment_modes_once:{},payment_modes_regular:{},current_donation:'',amount_equivalences:{'once':[],'regular':[]},init_done:false,init:function(){window.fnUsage?.('Step1.init');$(document).trigger($.Event("ira_step1_init_before"));Step1.lang=$('html').attr('lang');var currency_field=$('input[name=currency],select[name=currency]');var famount_once=$('#famount-once');var famount_regular=$('#famount-regular');var amount_once=$('#once input[type="radio"]');var amount_regular=$('#regular input[type="radio"]');amount_regular.each(function(){$(this).attr('data-amount',$(this).val());});amount_once.each(function(){$(this).attr('data-amount',$(this).val());});Step1.min_once_amount_err_template=DntErrors.errorMsg.min_once_amount;Step1.max_once_amount_err_template=DntErrors.errorMsg.max_once_amount;Step1.min_regular_amount_err_template=DntErrors.errorMsg.min_regular_amount;Step1.max_regular_amount_err_template=DntErrors.errorMsg.max_regular_amount;Step1.hideReductionInfo();Step1.hideEquivalence();Step1.initValues();Step1.init_done=true;Step1.current_donation=Step1.getDonation();famount_once.change(function(){Step1.set_donation_from_element($(this));});famount_once.keyup(function(){setTimeout(function(){},100);Step1.set_donation_from_element($(this));});famount_regular.change(function(){Step1.set_donation_from_element($(this));});famount_regular.keyup(function(){setTimeout(function(){},100);Step1.set_donation_from_element($(this));});amount_once.click(function(){Step1.set_donation_from_element($(this));});amount_regular.click(function(){Step1.set_donation_from_element($(this));});currency_field.change(function(){$('body').trigger($.Event("change_amount"));Common.applyCurrency();});$("#famount-once, #famount-regular").irPriceInput({'decimal_sep':Step1.decimal_sep});Common.addValidationEventsOnFields($(Common.getFieldsToValidateSelector('#step-1')));try{var donation=Step1.getDonation();Common.fillField('input[name=currency],select[name=currency]',donation.currency);if(typeof Step3!='undefined'){Step1.payment_modes_once=$('#payment_modes_once').detach();Step1.payment_modes_regular=$('#payment_modes_regular').detach();Step3.showPaymentModes(donation.frequency);}
2if(donation&&typeof(donation)!='undefined'&&donation.amount>0){Step1.set_donation_from_element(donation.element);}
3$('form#form-steps').append('<input type="hidden" name="private_stats_config" />');$('input[name=private_stats_config]').val(JSON.stringify(Step1.get_user_params()));Step1.toggleReservedFields(donation.frequency);}catch(err){}},set_donation:function(donation){var elem=Step1.initValues(donation);Step1.set_donation_from_element(elem,donation);},set_donation_from_element:function(elem,donation){Step1.hideReductionInfo();Step1.hideEquivalence();var id_elem=elem.attr('id');$('#step-1 [id^=famount-], #step-1 [id^=amount-]').each(function(){if($(this).attr('id')!=id_elem){if($(this).attr('type')=='text')$(this).val('');else{$(this).removeAttr("selected");$(this).attr('checked',false);}}});var donation=donation||Step1.getDonation();Common.applyCurrency(donation.currency);var frequency=donation.frequency;if(frequency=='once'){if(typeof Step3!='undefined'){Step3.showPaymentModes('once');Step3.hidePaymentModes('regular');Step3.regularFrequenciesHide();}
4Step1.regularBlocksHide();Step1.onceBlocksShow();if(typeof showWalletWidgetOnce=='undefined'){$('#fielset-amazon').hide();}else{if(typeof accessToken!='undefined'){showWalletWidgetOnce(accessToken);}else{$('#fielset-amazon').show();if((typeof showAmazonPayButtonOnce!='undefined')&&(typeof(OffAmazonPayments)!="undefined")&&($('#AmazonPayButton > .amazonpay-button-inner-image').length)==0){showAmazonPayButtonOnce();}}}
5$('#amazon-submit-once').hide();}else{if(typeof Step3!='undefined'){Step3.showPaymentModes('regular');Step3.hidePaymentModes('once');Step3.regularFrequenciesShow();}
6Step1.regularBlocksShow();Step1.onceBlocksHide();if(typeof showWalletWidgetRegular=='undefined'){$('#fielset-amazon').hide();}else{if(typeof accessToken!='undefined'){showWalletWidgetRegular(accessToken);}else{$('#fielset-amazon').show();if((typeof showAmazonPayButtonRegular!='undefined')&&(typeof(OffAmazonPayments)!="undefined")&&($('#AmazonPayButton > .amazonpay-button-inner-image').length)==0){showAmazonPayButtonRegular();}}}
7$('#amazon-submit-regular').hide();}
8Step1.toggleReservedFields(frequency);$('#regular input, #once input').each(function(){$(this).prop('tabindex',100);});elem.prop('tabindex',0);$('#form-steps').change();Step1.showReductionInfo(donation.amount_donation,donation.amount_tip,frequency);Step1.showEquivalence(donation.amount_donation||donation.donation,frequency);Step1.adaptHeight();var amount_changed=(Step1.current_donation.frequency!=donation.frequency||Step1.current_donation.amount!=donation.amount);Step1.current_donation=donation;if(amount_changed){$('body').trigger($.Event("change_amount"));}
9$('body').trigger($.Event("arya_donation_render"),id_elem);$('body').trigger($.Event("init_done"));},get_user_params:function(){var e=0,t=0;var ratio=window.devicePixelRatio||1;try{"number"==typeof window.innerWidth?(e=window.innerWidth,t=window.innerHeight):document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)?(e=document.documentElement.clientWidth,t=document.documentElement.clientHeight):document.body&&(document.body.clientWidth||document.body.clientHeight)&&(e=document.body.clientWidth,t=document.body.clientHeight)}catch(n){console.log(n.message)}
10var i={"visitor_resolution_width":screen.width*ratio,"visitor_resolution_height":screen.height*ratio,"visitor_color":screen.colorDepth,"visitor_java_enabled":navigator.javaEnabled(),"visitor_langage":navigator.language,"visitor_screen_height":screen.height,"visitor_screen_width":screen.width,"user_agent":navigator.userAgent,"visitor_timezone":new Date().getTimezoneOffset(),"window_width":e,"window_height":t};return i},submit:function(){$('#form-steps').submit(function(){window.fnUsage?.('Step1.submit');if(!Step1.check()){console.log('Step 1 checking failed');return false;}});},check:function(){window.fnUsage?.('Step1.check');var donation=Step1.getDonation();var ok=true;if(donation.amount==0){DntErrors.addError('choose_amount');ok=false;}else{DntErrors.removeError('choose_amount');}
11var min_amount=Step1.min_once_amount*100;var max_amount=Step1.max_once_amount*100;if(donation.frequency=='regular'){min_amount=Step1.min_regular_amount*100;max_amount=Step1.max_regular_amount*100;}
12DntErrors.removeError('min_once_amount');DntErrors.removeError('min_regular_amount');if(min_amount!=''&&donation.amount<min_amount){DntErrors.errorMsg['min_'+donation.frequency+'_amount']=Step1['min_'+donation.frequency+'_amount_err_template'].replace('{min_amount_with_currency}',Common.get_price(min_amount,donation.currency));DntErrors.addError('min_'+donation.frequency+'_amount');ok=false;}
13DntErrors.removeError('max_once_amount');DntErrors.removeError('max_regular_amount');if(max_amount!=''&&donation.amount>max_amount){DntErrors.errorMsg['max_'+donation.frequency+'_amount']=Step1['max_'+donation.frequency+'_amount_err_template'].replace('{max_amount_with_currency}',Common.get_price(max_amount,donation.currency));DntErrors.addError('max_'+donation.frequency+'_amount');ok=false;}
14if(!Common.check_qualification('step1'))ok=false;if(ok==false){DntErrors.displayErrors();}
15return ok;},unCheckRadio:function(frequency){var selector='';if(frequency!=''){selector+='#'+frequency;}
16selector+=' input[type="radio"]';$(selector).each(function(){this.checked=false;});},hideEquivalence:function(){$('.amount-equivalences').hide();$('.amount-equivalences-description').html('');Step1.adaptHeight();},showEquivalence:function(value,frequency){var equivalences=Step1.amount_equivalences[frequency];if(!equivalences||!value||!frequency||(!equivalences.length)){Step1.hideEquivalence();return;}
17var equivalence={'image':null,'description':'','image_alt_text':''};for(var i in equivalences){if(value<equivalences[i]['price'])break;equivalence=equivalences[i];}
18equivalence_text=equivalence['description'].replace('[amount]','[amount/1]').replace(/\[amount[ ]*\/[ ]*([^\]]*)\]/g,function(match,$1){var div=parseFloat($1.replace(',','.'))||null;if(div){return Math.floor(value/(div*100));}
19return'';});$('#'+frequency+' .amount-equivalences-description').html(equivalence_text).toggle(!!equivalence_text.trim().length);if(equivalence['image']){var img=$('#'+frequency+' .amount-equivalences-img img');var fade=true;if(img&&img.length){if(img.attr('src')!=equivalence['image']){Step1.setEquivalenceImage(img,equivalence);setTimeout(function(){img.parent().css('min-height','');var height=Math.max(img.height()||0,img.parent().height()||0);if(height){img.parent().css('min-height',height);}else{img.parent().height('auto');}},100);}}else{img=$('<img/>');Step1.setEquivalenceImage(img,equivalence);img.hide();$('#'+frequency+' .amount-equivalences-img').append(img);img.hide().fadeIn('fast',function(){setTimeout(function(){img.parent().css('min-height','');var height=Math.max(img.height()||0,img.parent().height()||0);if(height){img.parent().css('min-height',height);}else{img.parent().height('auto');}},10);})}}
19else{$('#'+frequency+' .amount-equivalences-img').html('').css('height','');}
20$('#'+frequency+' .amount-equivalences').show();Step1.adaptHeight();},setEquivalenceImage:function(img,equivalence){const id='eq_img_'+Math.floor(Math.random()*1000000);img.attr('id',id).attr('src',equivalence['image']).attr('alt',equivalence['image_alt_text']);},hideReductionInfo:function(){if(Step1.active_tax_reduction==0)return;$('p.tax-info').hide();Step1.adaptHeight();},showReductionInfo:function(donation_amount_original,donation_amount_tip,frequency){var body_id=$('body').attr('id');var value=donation_amount_original;if(!Step1.is_tipping_campaign){value+=donation_amount_tip;}
21if(Step1.active_tax_reduction==0||value==0)return;var tax_text='';if(value>0&&value!=''){var company=$('#company').val();var is_company=$('#iscompany').prop('checked');var tax_info=Step1.tax_info;var tax_notice='';var real_value;var deduction;var real_values={"ir":0,"isf":0,"corp":0,"custom1":0,"custom2":0};var deductions={"ir":0,"isf":0,"corp":0,"custom1":0,"custom2":0};for(var key in real_values){real_values[key]=Step1.computeReduction(value,Step1.tax_reduction_rates[key],Step1.tax_reduction_ceils[key],Step1.tax_reduction_triggers[key],Step1.tax_reduction_exact[key]);deductions[key]=value/100-real_values[key];}
22if((body_id=='type-b'||body_id=='type-c')&&is_company){if(Step1.tax_reduction_notices["corp"]!='')tax_notice=' '+Step1.tax_reduction_notices["corp"];real_value=real_values["corp"];deduction=deductions["corp"];}else{if(Step1.is_french_isf==1){if(Step1.tax_reduction_notices["isf"]!='')tax_notice=' '+Step1.tax_reduction_notices["isf"];real_value=real_values["isf"];deduction=deductions["isf"];}else{if(Step1.tax_reduction_notices["ir"]!='')tax_notice=' '+Step1.tax_reduction_notices["ir"];real_value=real_values["ir"];deduction=deductions["ir"];}}
23if(!isNaN(deduction)&&!isNaN(real_value)&&deduction>0){tax_text=tax_info.replace('[notice]',tax_notice).replace(/\[(amount|deduction) ([^\]]*)\]/g,function(match,$1,$2){if($1=='amount')
24return Common.number_format(real_values[$2],2,Step1.decimal_sep).replace(Step1.decimal_sep+"00","");else
25return Common.number_format(deductions[$2],2,Step1.decimal_sep).replace(Step1.decimal_sep+"00","");}).replace('%s',Common.number_format(real_value,2,Step1.decimal_sep).replace(Step1.decimal_sep+"00","")).replace('%d',Common.number_format(deduction,2,Step1.decimal_sep).replace(Step1.decimal_sep+"00",""));}}
26var tax_text_dom=$('<div>'+tax_text+'</div>');$('.price_currency',tax_text_dom).html(Common.price_currencies[Common.getCurrency()]);tax_text=tax_text_dom.html();$('#'+frequency+' p.tax-info').html(tax_text).toggle(!!tax_text);Step1.adaptHeight();},initValues:function(amount_values){var amount=Common.getDonation();var currency=Common.price_default_currency;
26if(typeof amount!='undefined'&&!!amount&&typeof amount.currency!='undefined'&&!!amount.currency){currency=amount.currency;}else{amount.currency=currency;}
27if(amount_values){if(amount_values.amount&&!amount_values.amount_donation&&amount.amount==amount_values.amount){amount_values.amount_donation=amount.amount_donation;}
28if(amount.amount_tip){amount_values.amount_tip=amount.amount_tip;}}
29Common.checkDonation(amount_values);amount=Object.assign({},{'amount':0,'frequency':Common.campaign_default_frequency,'currency':Common.price_default_currency,},amount,amount_values);Common.setCurrency(amount.currency);Common.applyCurrency(amount.currency);Common.checkDonation(amount,true);var result=null;$('input[id^=famount-]').val('');$('input[id^=amount-]').attr('checked',false);if(!amount){return null;}
30try{if(amount!=null&&amount.amount_donation!=undefined&&amount.frequency!=undefined){result=$('input[name="amount-'+amount.frequency+'"][value="'+amount.amount_donation+'"]');if(!!result&&result.length==1){result.attr('checked','checked');result.click();Step1.showReductionInfo(amount.amount_donation,amount.amount_tip,amount.frequency);Step1.showEquivalence(amount.amount_donation,amount.frequency);return result;}}
31result=$('input#famount-'+amount.frequency);result.val(String(amount.amount_donation/100).replace('.',Step1.decimal_sep));result.irPriceInput({'decimal_sep':Step1.decimal_sep});result.keyup();Step1.showReductionInfo(amount.amount_donation,amount.amount_tip,amount.frequency);Step1.showEquivalence(amount.amount_donation,amount.frequency);}catch(err){console.warn(err);}
32return result;},saveHeightTempo:0,adaptHeight:function(){var rand=Math.floor(Math.random()*1000000);var self=this;self.saveHeightTempo=rand;setTimeout(function(){if(self.saveHeightTempo==rand){return self.adaptHeight_();}},100);},adaptHeight_:function(){if(Step1.adapt_tax_bloc){if(!Step1.adapted_height){$('#once').children().wrapAll('<div id="adapt_once"></div>');$('#regular').children().wrapAll('<div id="adapt_regular"></div>');}
33Step1.adapted_height=true;Step1.max_height=Math.max($('#adapt_once').height(),$('#adapt_regular').height());$('#once').height(Step1.max_height);$('#regular').height(Step1.max_height);}
34var body_id=$('body').attr('id');if(body_id=='type-b'||body_id=='type-c'){if(typeof Steps!="undefined"){Steps.adaptHeight();}}},getDonation:function(){var famount_once_element=$('#famount-once');var famount_regular_element=$('#famount-regular');var amount_once_element=$('#once input[type="radio"]:checked');var amount_regular_element=$('#regular input[type="radio"]:checked');var famount_once=famount_once_element.val();var famount_regular=famount_regular_element.val();var amount_once=amount_once_element.val();var amount_regular=amount_regular_element.val();var donation={};donation.amount=0;donation.frequency=$('#step-1 #regular,#step-1 #once').first().attr('id');if(donation.frequency=='once')donation.element=famount_once_element;else donation.element=famount_regular_element;if(famount_once==undefined&&famount_regular==''){donation.frequency='regular';donation.element=famount_regular_element;}
35if(amount_once!=undefined){donation.amount=parseFloat(amount_once);donation.frequency='once';donation.element=amount_once_element;}else if(famount_once!=''&&famount_once!=undefined&&famount_once!='0'){donation.amount=Math.round(parseFloat(famount_once.replace(',','.'))*100);donation.frequency='once';donation.element=famount_once_element;}else if(amount_regular!=undefined){donation.amount=parseFloat(amount_regular);donation.frequency='regular';donation.element=amount_regular_element;}else if(famount_regular!=''&&famount_regular!=undefined&&famount_regular!='0'){donation.amount=Math.round(parseFloat(famount_regular.replace(',','.'))*100);donation.frequency='regular';donation.element=famount_regular_element;}
36donation.currency=Common.getCurrency();donation.amount_donation=donation.amount;donation.log='Call to step1::getDonation(), initialize amount_donation to amount, set to '+donation.amount_donation;donation.amount_tip=Common.tip_value(donation.amount_donation);donation.amount=donation.amount_donation+donation.amount_tip;if(Step1.init_done){var dnt_amount_json=JSON.stringify({'amount':donation.amount,'frequency':donation.frequency,'currency':donation.currency,'amount_donation':donation.amount_donation,'amount_tip':donation.amount_tip,'log':donation.log});$.cookie('dnt_amount',dnt_amount_json,{'path':'/','secure':window.location.protocol==='https:'});}
37return donation;},changeGridAmount:function(id,newval){$('#'+id).val(newval);$('#value_of_'+id).find('.price_amount').html(Common.number_format(Math.round(newval/100),2,Step1.decimal_sep).replace(Step1.decimal_sep+"00",""));},applyRate:function(value,currency,round){var newval=value/Common.price_rates[Common.price_campaign_currency||Common.price_default_currency||'EUR']*Common.price_rates[currency];if(!round){return Math.round(newval);}
38if(newval<1000){newval=Math.round(Math.ceil(newval/100)*100);}else if(newval<10000){newval=Math.round(Math.ceil(newval/500)*500);}else if(newval<50000){newval=Math.round(Math.ceil(newval/1000)*1000);}else if(newval<100000){newval=Math.round(Math.ceil(newval/5000)*5000);}else{var precision=Math.pow(10,Math.floor(Math.log10(newval))-1);newval=Math.round(Math.round(newval/precision)*precision);}
39return newval;},applyCurrencyRateToGrid:function(currency){$('#once input[type="radio"][data-amount], #regular input[type="radio"][data-amount]').each(function(){var newval=$(this).attr('data-amount');if(currency!=(Common.price_campaign_currency||Common.price_default_currency||'EUR')){newval=Step1.applyRate(newval,currency,true);}
40Step1.changeGridAmount($(this).attr('id'),newval);});},computeReduction:function(value,rates,ceils,trigger,exact){if(value<trigger*100)return value/100;var deduction=0;var remain=value;var last_ceil=0;for(var i=0;i<rates.length;i++){var amount=remain;if(ceils.length>i&&ceils[i]>0)amount=Math.min(remain,ceils[i]*100-last_ceil*100);deduction+=amount*rates[i]/100;remain-=amount;last_ceil=ceils[i];}
41if(!exact){deduction=Math.round(deduction/100)*100;}
42return(value-deduction)/100;},disable:function(){$('#bloc-amount-once fieldset').prop('disabled',true);$('#bloc-amount-regular fieldset').prop('disabled',true);},enable:function(){$('#bloc-amount-once fieldset').prop('disabled',false);$('#bloc-amount-regular fieldset').prop('disabled',false);},onceAmountSelected:function onceAmountSelected(){var donation=Step1.getDonation();return(donation.frequency=='once');},regularBlocksHide:function(){$('.regularblock').hide();$('.regularblock input, .regularblock select, .regularblock textarea').prop('disabled',true);},regularBlocksShow:function(){$('.regularblock').show();$('.regularblock input, .regularblock select, .regularblock textarea').prop('disabled',false);},onceBlocksHide:function(){$('.onceblock').hide();$('.onceblock input, .onceblock select, .onceblock textarea').prop('disabled',true);},onceBlocksShow:function(){$('.onceblock').show();$('.onceblock input, .onceblock select, .onceblock textarea').prop('disabled',false);},toggleReservedFields:function(frequency){VisibilityToggleElementsCollection.getInstance().then(collection=>collection.applyFrequency(frequency));}}
vendor: 1 bytes, line 42
42;

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.