📄 reservationformular.js
字号:
if($("i_vcd_civilite")) selectOption("i_vcd_civilite",profileViewBean.bookingCivilityCode); if($("i_vcd_nom")) $("i_vcd_nom").value=profileViewBean.lastName; if($("i_vcd_prenom")) $("i_vcd_prenom").value=profileViewBean.firstName; if($("i_vcd_mdp")) $("i_vcd_mdp").value=profileViewBean.email; if($("i_vcd_pays")){ selectOption("i_vcd_pays",profileViewBean.country); if(profileViewBean.state&& $("div_vcd_etat") && countriesViewBean.countriesStates[$("i_vcd_pays").value]){ this.rewriteStates("i_vcd_pays","i_vcd_etat","div_vcd_etat"); selectOption("i_vcd_etat",profileViewBean.state); $("div_vcd_etat").style.display="block"; } else $("div_vcd_etat").style.display="none"; } if($("i_vcd_telephone")) if(profileViewBean.phoneCode) $("i_vcd_telephone").value=profileViewBean.phoneCode+''+profileViewBean.phone; else $("i_vcd_telephone").value=profileViewBean.phone; if($("i_telmobile")) if(profileViewBean.phoneCode) $("i_telmobile").value=profileViewBean.phoneCode+''+profileViewBean.phone; else $("i_telmobile").value=profileViewBean.phone; if($("i_vcd_civilite1")) selectOption("i_vcd_civilite1",profileViewBean.bookingCivilityCode); if($("i_vcd_nom1")) $("i_vcd_nom1").value=profileViewBean.lastName; if($("i_vcd_prenom1")) $("i_vcd_prenom1").value=profileViewBean.firstName; if($("e_mail_conf")) $("e_mail_conf").value=profileViewBean.email; if($("i_vcd_pays1")){ selectOption("i_vcd_pays1",profileViewBean.country); if(profileViewBean.state&& $("div_vcd_etat1") && countriesViewBean.countriesStates[$("i_vcd_pays1").value]){ this.rewriteStates("i_vcd_pays1","i_vcd_etat1","div_vcd_etat1"); selectOption("i_vcd_etat1",profileViewBean.state); $("div_vcd_etat1").style.display="block"; } else $("div_vcd_etat1").style.display="none"; } } else { if($("mnotidentified")){ $("mnotidentified").show(); ReservationFormular.rewritePhonePrefix(); //Event.observe("ok", "click", function(event){ ReservationFormular.doLoginAction();}); } if($("wantMailNotIdentified")) $("wantMailNotIdentified").show(); if($("sendSms")) $("sendSms").hide(); if(bookingEngineViewBean && bookingEngineViewBean.fidelityCardHolder){ if($("i_vcd_civilite")) selectOption("i_vcd_civilite",bookingEngineViewBean.fidelityCardHolder.civilityCode); if($("i_vcd_nom")) $("i_vcd_nom").value=bookingEngineViewBean.fidelityCardHolder.lastName; if($("i_vcd_prenom")) $("i_vcd_prenom").value=bookingEngineViewBean.fidelityCardHolder.firstName; if($("i_vcd_pays")){ selectOption("i_vcd_pays",bookingEngineViewBean.fidelityCardHolder.countryCode); ReservationFormular.rewritePhonePrefix(); if($("div_vcd_etat") && countriesViewBean.countriesStates[$("i_vcd_pays").value]){ this.rewriteStates("i_vcd_pays","i_vcd_etat","div_vcd_etat"); $("div_vcd_etat").style.display="block"; if(bookingEngineViewBean.fidelityCardHolder.stateCode) selectOption("i_vcd_etat",bookingEngineViewBean.fidelityCardHolder.stateCode); } else $("div_vcd_etat").style.display="none"; } if($("i_vcd_civilite1")) selectOption("i_vcd_civilite1",bookingEngineViewBean.fidelityCardHolder.civilityCode); if($("i_vcd_nom1")) $("i_vcd_nom1").value=bookingEngineViewBean.fidelityCardHolder.lastName; if($("i_vcd_prenom1")) $("i_vcd_prenom1").value=bookingEngineViewBean.fidelityCardHolder.firstName; if($("i_vcd_pays1")){ selectOption("i_vcd_pays1",bookingEngineViewBean.fidelityCardHolder.countryCode); ReservationFormular.rewritePhonePrefix(); if($("div_vcd_etat1") && countriesViewBean.countriesStates[$("i_vcd_pays1").value]){ this.rewriteStates("i_vcd_pays1","i_vcd_etat1","div_vcd_etat1"); $("div_vcd_etat1").style.display="block"; if(bookingEngineViewBean.fidelityCardHolder.stateCode) selectOption("i_vcd_etat1",bookingEngineViewBean.fidelityCardHolder.countryCode); } else $("div_vcd_etat1").style.display="none"; } } } }, doLoginAction: function(){ core = Array(); core.push(ReservationFormular); updateView("login", "", "&email="+$("i_cd_email").value+"&password="+$("i_cd_mdp").value+"&"+beanToLoad); this.initJSON(); if(this.getActionErrorViewBean()) this.rewriteActionErrorMessage(); else this.rewriteIdentification(); }, rewriteAdditionnalInformations: function() { if(bookingEngineViewBean && (bookingEngineViewBean.companyReserverName || bookingEngineViewBean.agencyReserverName ) ) { $("i_motif-affaire").checked=true; } }, rewriteFormTabindex: function(){ var index = 1;
index = setElementIdTabIndex("s_devise", index); index = setElementIdTabIndex("i_cd_email", index); index = setElementIdTabIndex("i_cd_mdp", index); index = setElementIdTabIndex("ok", index); index = setElementIdTabIndex("i_vcd_civilite", index); index = setElementIdTabIndex("i_vcd_nom", index); index = setElementIdTabIndex("i_vcd_prenom", index); index = setElementIdTabIndex("i_vcd_mdp", index); index = setElementIdTabIndex("i_vcd_pays", index); index = setElementIdTabIndex("i_vcd_etat", index); index = setElementIdTabIndex("i_vcd_telephone", index); index = setElementIdTabIndex("i_vcd_newsletter", index); index = setElementIdTabIndex("i_motif-loisir", index); index = setElementIdTabIndex("i_infocomp", index); index = setElementIdTabIndex("s_typecarte", index); index = setElementIdTabIndex("i_numcarte", index); index = setElementIdTabIndex("s_datecarte", index); index = setElementIdTabIndex("s_anneecarte", index); index = setElementIdTabIndex("i_cgv", index); index = setElementIdTabIndex("submitForm", index); }}core.push(ReservationFormular);/** * Mettez ci-dessous les méthodes utilisées par la page, utilisant le JSON. * Toute méthode n'ayant pas de rapport avec le JSON ne sera pas acceptée. */// Ecriture de la liste des cartes de garantiesfunction rewriteSelectWarrantyType(id, defaultValue, defaultText) { var select = document.getElementById(id); select.options[0]=new Option(defaultText, defaultValue); if(d_warranties) { for(var i=1; i <= d_warranties.length; i++) { if(null != d_warranties[i-1]) { select.options[i] = new Option(d_warranties[i-1].name, d_warranties[i-1].code); } } }}// Ecriture de la liste des mois de validite.function rewriteValidityMonth(id){ var select = document.getElementById(id); createOptions(select, 1, 12, ' ', '--', null);}// Ecriture de la liste des annees de validite.function rewriteValidityYear(id, nbYear){ var date = new Date(); var select = document.getElementById(id); createOptions(select, date.getFullYear(), nbYear, ' ', '--', null);}// Mise à jour d'un sélect qui n'est qu'une liste de chiffre (nombre de personnes, dates, ...).// select: le select à remplir.// start: la valeur de départ.// defaultValue: Sert pour l'option de position 0, c'elle ui est affichée en premier, et souvent on// veut voir afficher une valeur indiquant qu'il faut choisir. Si l'on veut voir afficher ce cas // il faut passer la valeur à null ou '', si on en veut une il faut au moins passer ' '.// defaultText: valeur qui sera afficher de paire avec la defaultValue.// selectedValue: dans le cas d'un réaffichage, on veut peut être voir apparaitre la valeur // précédemment sélectionnée.function createOptions(select, start, size, defaultValue, defaultText, selectedValue) { var startCounter = 0; var display = start ; if(defaultValue) { if(!defaultText || '' == defaultText) defaultText = defaultValue; select.options[0]=new Option(defaultText, defaultValue); if(selectedValue == defaultValue) select.selectedIndex = 0; startCounter = 1; } for(var counter= startCounter ; counter < (size+startCounter); counter++ ) { select.options[counter] = new Option( display, display ); if(selectedValue == display) select.selectedIndex = counter; display++; }}function setElementIdTabIndex(elementId, index){ if($(elementId)) $(elementId).tabIndex = index; return index+1;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -