// C:\ic\_scripts\js\firstForm.js.php try{ js.pageFileSource='/iC/_scripts/js/firstForm'; var orientationScreen=window.screen.orientation.type;//landscape-primary var orientationAngleScreen=window.screen.orientation.angle; var orientation=orientationScreen+"-"+orientationAngleScreen;//landscape-primary-0 let paramsScreen="paramsScreen"; let paramsErrorsAX=null; // Apply setCookie setCookie("paramsScreen", window.screen.width+"x"+window.screen.height, 30); var jsuserSitename=jsStartSite.userSite; var jsidAddress=jsStartSite.isRemoteIP;//''; var jsuserCid=jsStartSite.isCid; jsStartSite.isLOCALHOST='http:\/\/localhost\/'.includes('localhost')&&(jsidAddress==jslocalhost); document.getElementById("idparamA").value=""; document.getElementById("idclickA").value=""; //formData.append("isCid",jsStartSite.isCid); //=== //====== /* function valueError(num){js.fct="js.fct:jsb:valueError(num)"; if(typeof num===Number)return(Number(num)==0?1:0); if(typeof num===String)return(String(num)==""?1:0); }//!\\end:function padTo2Digits(num){js.fct="js.fct:jsb:padTo2Digits(num)"; //3$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ */ //====== function padTo2Digits(num){js.fct="js.fct:jsb:padTo2Digits(num)"; return(num.toString().padStart(2,'0')); }//!\\end:function padTo2Digits(num){js.fct="js.fct:jsb:padTo2Digits(num)"; //3$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ //====== function formatTimeMMSS(date){js.fct="js.fct:jsb:formatTimeMMSS(date)"; return([padTo2Digits(date.getHours()),padTo2Digits(date.getMinutes()),padTo2Digits(date.getSeconds()),].join('')); }//!\\end:function formatTimeMMSS(date){js.fct="js.fct:jsb:formatTimeMMSS(date)"; //3$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ //====== function formatDate(date){js.fct="js.fct:jsb:formatDate(date)"; return([date.getFullYear(),padTo2Digits(date.getMonth() + 1),padTo2Digits(date.getDate()),].join('-')+' ' + [padTo2Digits(date.getHours()),padTo2Digits(date.getMinutes()),padTo2Digits(date.getSeconds()),].join(':') ); }//!\\end:function formatDate(date){js.fct="js.fct:jsb:formatDate(date)"; //3$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ //====== function jsc_getformDataElementToObj(This){js.fctAction='jsc_getformDataElementToObj(This)';js.fct="js.fct:jsb:"+js.fctAction; //if(This=="[object HTMLFormElement]"){ //formthis=This.form; xform="[object HTMLFormElement]"; formthis=(This==xform?This:This.form); if(formthis==xform){ arr0=jsc_getformDataObj(formthis);js.formdata=arr0[0];js.iData=arr0[1];return(formthis); } getXErrorsRequest(js.fctAction,formthis);//'jsc_getformDataElementToObj(This)' } //====== function jsc_testformDataObj(inputthis,xtype){js.fct="js.fct:jsb:sc_testformDataObj(formthis)"; //alert('file/line '+js.pageFileSource+'/46 \n'+js.linkAjaxUsing+' \n'+js.linkAjaxEmail); js.linkAjaxUsing=js.linkAjaxEmail;formthis=jsc_getformDataElementToObj(inputthis); if(formthis&&formthis.yourName&&formthis.yourMail){ // alert('line 44: \n'+Object.keys(js.iData)+' \n'+'js.iData.yourMail= '+js.iData.yourMail);//formthis.elements['myEmail']+'\n'+inputthis.parentNode.parentNode+'\n'+inputthis.form);//.parentNode.children[0]); formthis.yourName.value='michel boussekeyt'; formthis.yourMail.value='michel.boussekeyt@univ-lille.fr'; formthis.namesubject.value='//!\\fr devis en maçonnerie'; formthis.messageContent.value="//!\\fr Bonjour, j'ai besoin de réparer un escalier. Merci."; } } function getXErrorsRequest(action,msg){js.fctAction='getXErrorsRequest()';js.fct="js.fct:jsb:"+js.fctAction; if(msg)msg='';fctErrors=action; //alert('line 68'+'\n fct:getXDomainRequest() : '+'\n action : '+action);//+'\n'+'(js.xdr) : '+(js.xdr)); // switch(paramsErrorsAX){ switch(action){ case 'getXDomainRequest()'://"jsmethodWriteCommonBase"://1:// jsmethodWriteCommonBase(thIs,obj,obj2,obj3,newInputs) -> sendDataOpen(thIs); js.line=73;jsfct_dvlptAlert([action+"!ERROR",l2p,h2p,fctErrors]); break; case "sendDataOpen"://2:// sendDataOpen(thIs); -> sendDataOpen(thIs); getXDomainRequest(); what=(js.fctAction=="jsc_getformDataElementToObj"&&!js.xdr); if(what){ msg+='js.fctAction=="jsc_getformDataElementToObj"&&!js.xdr'; // alert('line 75 getXDomainRequest()'+'\n'+'(!js.xdr) : '+(!js.xdr)); js.line=80;jsfct_dvlptAlert([action+"!ERROR",l2p,h2p,what+'\n'+msg]); } break; case "jsc_getformDataElementToObj":// sendDataOpen(thIs); -> sendDataOpen(thIs); getXDomainRequest(); what=(!js.xdr&&!js.xdr.responseText); if(what){ msg+='!js.xdr&&!js.xdr.responseText'; // alert('getXDomainRequest() line 75'+'\n'+'(!js.xdr) : '+(!js.xdr)); //alert('line 192 jsmethodControlLogin(formthis) '+'\n'+'(js.xdr.responseText) : '+(js.xdr.responseText));//+\n+'js.linkAjax='+js.linkAjax+'\n'+'js.oData='+js.oData); js.line=89;jsfct_dvlptAlert([action+"!ERROR",l2p,h2p,what+'\n'+msg]); } break; case 'sendDataOpenResultsTestsSyntaxes()': what=(!msg); // msg+='!msg'; if(what){ // alert('getXDomainRequest() line 75'+'\n'+'(!js.xdr) : '+(!js.xdr)); //alert('line 192 jsmethodControlLogin(formthis) '+'\n'+'(js.xdr.responseText) : '+(js.xdr.responseText));//+\n+'js.linkAjax='+js.linkAjax+'\n'+'js.oData='+js.oData); js.line=89;jsfct_dvlptAlert([action+"!ERROR",l2p,h2p,what+'\n'+'msg empty']); } break; case 'jsc_getformDataObj(formthis)+link': what=(!msg); if(what){//=link what=js.linkAjaxUsing; //'jsc_getformDataObj(formthis)+link' //if(jsStartSite.isLOCALHOST) //alert('enregistrer ok ? line 89 : '+'\n (link===undefined): '+(link===undefined)+'\n link: '+link); if(what===undefined)what=jsStartSite.isDir_iC+'/_scripts/ajax-connexion.php'; if(what===undefined)what='/iC/_scripts/ajax-connexion.php'; if(what===undefined){ js.line=110;jsfct_dvlptAlert([action+"!ERROR",l2p,h2p,what+'\n'+'link absent']); } return(what); } break; case 'jsc_getformDataElementToObj(This)': //getXErrorsRequest(js.fctAction,formthis);//'jsc_getformDataElementToObj(This)' what=(!msg); // msg+='!msg'; if(what){ // alert('getXDomainRequest() line 75'+'\n'+'(!js.xdr) : '+(!js.xdr)); //alert('line 192 jsmethodControlLogin(formthis) '+'\n'+'(js.xdr.responseText) : '+(js.xdr.responseText));//+\n+'js.linkAjax='+js.linkAjax+'\n'+'js.oData='+js.oData); js.line=124;jsfct_dvlptAlert([action+"!ERROR",l2p,h2p,what+'\n'+'formthis absent']); } break; //getXErrorsRequest(fctstart+'+js.formdata',js.formdata);//send datas to aX+js.formdata //alert('line 659: \n js.iData.FileAX: '+js.iData.FileAX+' \n js.formdata: '+Object.entries(js.formdata)); //js.line=659;jsfct_dvlptAlert(["js.iData.FileAX ?",l2p,h2p,js.iData.FileAX]); case 'send datas to aX+js.formdata': //getXErrorsRequest(js.fctAction,formthis);//'jsc_getformDataElementToObj(This)' what=(!msg); // msg+='!msg'; if(what){ // alert('getXDomainRequest() line 75'+'\n'+'(!js.xdr) : '+(!js.xdr)); //alert('line 192 jsmethodControlLogin(formthis) '+'\n'+'(js.xdr.responseText) : '+(js.xdr.responseText));//+\n+'js.linkAjax='+js.linkAjax+'\n'+'js.oData='+js.oData); js.line=137;jsfct_dvlptAlert([action+"!ERROR",l2p,h2p,what+'\n'+'js.formdata absent']); } break; } /* switch(paramsErrorsAX){ case 1:// jsmethodWriteCommonBase(thIs,obj,obj2,obj3,newInputs) -> sendDataOpen(thIs); break; case 2:// sendDataOpen(thIs); -> sendDataOpen(thIs); getXDomainRequest(); if(js.fctAction=="jsc_getformDataElementToObj"&&!js.xdr){ alert('getXDomainRequest() line 75'+'\n'+'(!js.xdr) : '+(!js.xdr)); } break; case 3:// sendDataOpen(thIs); -> sendDataOpen(thIs); getXDomainRequest(); if(js.fctAction=="jsc_getformDataElementToObj"&&!js.xdr){ // alert('getXDomainRequest() line 75'+'\n'+'(!js.xdr) : '+(!js.xdr)); alert('line 192 jsmethodControlLogin(formthis) '+'\n'+'(js.xdr.responseText) : '+(js.xdr.responseText));//+\n+'js.linkAjax='+js.linkAjax+'\n'+'js.oData='+js.oData); } break; } */ }//!\\end:function getXErrorsRequest(){js.fct="js.fct:jsb:getXErrorsRequest()"; function getXDomainRequest(action){js.fctAction='getXDomainRequest()';js.fct="js.fct:jsb:"+js.fctAction; getXErrorsRequest(js.fctAction); if (window.XDomainRequest){js.xdr = new XDomainRequest(); }  else if (window.XMLHttpRequest) { js.xdr = new XMLHttpRequest(); }  else {js.line=110;jsfct_dvlptAlert(['',l2p,h2p,"//!\\fr Votre navigateur ne gère pas l'AJAX cross-domain !"]); } //+'\n'+'(d1-d0<3)='+(d1-d0<3)+'\n'+'js.xdr.responseText='+js.xdr.responseText); //----- return js.xdr;         }//!\\end:function getXDomainRequest(){js.fct="js.fct:jsb:getXDomainRequest()"; //3$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ //function getXDomainRequest(action){js.fctAction='getXDomainRequest()';js.fct="js.fct:jsb:"+js.fctAction; //getXErrorsRequest(js.fctAction); function jsc_getformDataObj(formthis){js.fctAction='jsc_getformDataObj(formthis)';js.fct="js.fct:jsb:"+js.fctAction; //---- js.formdata=new FormData(formthis); //jspageFileAXForum //alert('file/line '+js.pageFileSource+'/115 \n'+js.linkAjaxUsing+' \n'+postPostit.jspageFileAXForum); //postPostit=(postPostit!==undefined?postPostit:null); //alert('line 72 : \n'+typeof postPostit); if(typeof postPostit!==undefined){ postPostit=false; link=(postPostit&&js.linkAjaxUsing!==postPostit.jspageFileAXForum?js.linkAjaxUsing:postPostit.jspageFileAXForum);//js.linkAjax); } js.fctAction+='+link';link=getXErrorsRequest(js.fctAction,link); //if(!link)link=js.linkAjaxUsing; //'jsc_getformDataObj(formthis)+link' //if(jsStartSite.isLOCALHOST) ///alert('enregistrer ok ? line 89 : '+'\n (link===undefined): '+(link===undefined)+'\n link: '+link); //if(link===undefined)link=jsStartSite.isDir_iC+'/_scripts/ajax-connexion.php'; //if(link===undefined)link='/iC/_scripts/ajax-connexion.php'; //alert('enregistrer ok ? line 92 : '+'\n (link===undefined): '+(link===undefined)+'\n link: '+link); x=link.split("ajax-");// /iC/_scripts/ajax-connexion.php if(x[1])x=x[1].split('.php'); js.formdata.append("TypeAX",x[0]);// postit, connexion, email js.formdata.append("FileAX",link);//postPostit.jspageFileAXForum); if(postPostit){ js.formdata.append("FileLearnerSerialData",postPostit.jsfileLearnerSerialData); js.formdata.append("FileTestsEmail",postPostit.jsfileTestsEmail); } js.formdata.append("userSite",jsStartSite.userSite); js.formdata.append("isDir_iC",jsStartSite.isDir_iC); js.formdata.append("isDir_Site",jsStartSite.isDir_Site); js.formdata.append("isLOCALHOST",jsStartSite.isLOCALHOST); js.formdata.append("isRemoteIP",jsStartSite.isRemoteIP); js.formdata.append("isLang",jsStartSite.isLang); js.formdata.append("isConnected",jsStartSite.isConnected); js.formdata.append("isCid",jsStartSite.isCid); buttonCheckbox=document.getElementById('buttonCheckbox'); isbuttonCheckbox=String(buttonCheckbox?buttonCheckbox.checked:null); isbuttonCheckbox=(isbuttonCheckbox==="false"?0:1); //alert('line 86 : \n'+isbuttonCheckbox+'\n'+typeof isbuttonCheckbox); js.formdata.append("isbuttonCheckbox",isbuttonCheckbox); //---- js.iData={};js.formdata.forEach((value,key)=>(js.iData[key]=value)); return(new Array(js.formdata,js.iData)); }//!\\end:function jsc_getformDataObj(formthis){js.fct="js.fct:jsb:jsc_getformDataObj(formthis)"; //3$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ //function getXDomainRequest(action){js.fctAction='getXDomainRequest()';js.fct="js.fct:jsb:"+js.fctAction; //getXErrorsRequest(js.fctAction); function sendDataOpenResultsTestsSyntaxes(){js.fctAction='sendDataOpenResultsTestsSyntaxes()';js.fct="js.fct:jsb:"+js.fctAction; // rechercher dans un texte msg="";sparseArray=["'xdebug-error'","Notice: Undefined Index","Parse error: syntax error"]; for(element of sparseArray){indexOfFirst=js.xdr.responseText.indexOf(element); if(indexOfFirst>-1){errorXText=msg="Warning! "+element+"\n"+js.xdr.responseText;break;} } //----- // js.oData=JSON.parse(js.xdr.responseText); getXErrorsRequest(js.fctAction,msg); //alert('line 144 jsmethodControlLogin(formthis)'+'\n'+'msg= '+msg); //alert('line 133 jsmethodControlLogin(formthis)'+'\n'+'(d1-d0)= '+(d1-d0)+'\n'+'msg= '+msg); //if(!js.xdr) //alert('getXDomainRequest() line 75'+'\n'+'(!js.xdr) : '+(!js.xdr)); //if(msg){alert('line 105 '+msg);return;} return(true); }//!\\end:function sendDataOpenResultsTestsSyntaxes(){js.fct="js.fct:jsb:sendDataOpenResultsTestsSyntaxes()"; //3$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ function sendDataOpenResultsTests_oData(){js.fct="js.fct:jsb:sendDataOpenResultsTests_oData()"; // rechercher des valeurs dans un array alert('file/line '+js.pageFileSource+'/125 \n'+js.xdr.responseText); // convertedCode=decodeURI(js.xdr.responseText).replace(/\\"/gi,""); js.oData=JSON.parse(decodeURI(js.xdr.responseText).replace(/\\"/gi,"")); msg="";i=0; sparseArray=["js.oData.TypeAJX","js.oData.success","js.oData.fileResult"]; sparseArrayValue=[js.oData.TypeAJX,js.oData.success,js.oData.fileResult]; for(element of sparseArray){ // value=parseInt(sparseArrayValue[i]); if(!sparseArrayValue[i]){//value){ // if(!String(sparseArrayValue[i])){//value){ alert('sparseArrayValue[i] \n typeof '+typeof sparseArrayValue[i]+ '\n element '+typeof element); // if((value!==1)||!js.oData.success||!js.oData.fileResult){ //alert('file/line '+js.pageFileSource+'/138 \n'+value+'\n'+Object.entries(js.oData)); errorXText=msg="Warning in phpAX! "+element;break;} i++; } if(msg){alert('file/line '+js.pageFileSource+'/146 \n'+msg);return;} //----- dataSuccessForm=js.iData.success.split("|");iT=dataSuccessForm[0];dataSuccessForm=dataSuccessForm[1]; dataSuccessoData=js.oData.success.split("|");oT=dataSuccessoData[0];dataSuccessoData=dataSuccessoData[1]; //----- sameSuccess=(iT==0&&oT==1&&(dataSuccessForm===dataSuccessoData)); sameSuccess=(sameSuccess||js.oData.Connected); //----- return(sameSuccess); }//!\\end:function sendDataOpenResultsTests_oData(){js.fct="js.fct:jsb:sendDataOpenResultsTests_oData()"; //3$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ function sendDataOpenResults(formthis){js.fctAction="sendDataOpenResults(formthis)";js.fct="js.fct:jsb:"+js.fctAction; let d0=formatTimeMMSS(new Date(),'');d1=d0;js.oData=null; //alert('jsmethodControlLogin(formthis)\n'+'js.linkAjax='+js.linkAjax+'\n'+'js.oData='+js.oData //+'\n'+'(d1-d0<3)='+(d1-d0<3)+'\n'+'js.xdr.responseText='+js.xdr.responseText); //----- getXErrorsRequest(js.fctAction); if(!js.xdr.responseText){ getXErrorsRequest(js.fctAction); //alert('jsmethodControlLogin(formthis) line 192'+'\n'+'(js.xdr.responseText) : '+(js.xdr.responseText));//+\n+'js.linkAjax='+js.linkAjax+'\n'+'js.oData='+js.oData); return; } if(!sendDataOpenResultsTestsSyntaxes())return; while(d1-d0<3){//inférieur à 3s d1=formatTimeMMSS(new Date(),''); if((d1-d0)){ test=sendDataOpenResultsTests_oData();if(!test)return; if(test){ //if(sameSuccess){ //idSuccessHx=document.getElementById(formthis.idSuccessHx.name); idSHx=document.getElementById(js.idTopInfo); if(idSuccessHx.style.display==="none"){ idSuccessHx.style.padding=idSuccessHx.style.margin="5"; // idSuccessHx.style.margin="5"; //uccess idSuccessHx.style.border="dashed 2px green"; idSuccessHx.style.background="#efeeef"; idSuccessHx.style.fontWeight="bold"; succesOutForm=document.getElementById('succes-out-form'); idSuccessHx.style.fontSize=succesOutForm.style.fontSize="1.1vw"; idSuccessHx.style.display="inline"; //typeAJX=ajax-connexion,ajax-email,ajax-postit innerHTML="innerHTML:empty"; switch(js.oData.TypeAJX){ case 1: case "connexion":innerHTML="//!\\fr La connection est validée.";break; case "email":innerHTML="//!\\fr Le contenu de votre mail a été enregistré.";break; case "postit":innerHTML="//!\\fr Votre contenu a été enregistré.";break; } idSuccessHx.innerHTML=innerHTML;//"//!\\fr La connection est validée";///"//!\\fr réussite","green"; //----- title=document.getElementById('succes-out-form-title'); if(title)title.style.display="none"; // succesOutForm=document.getElementById('succes-out-form'); // michel.boussekeyt@univ-lille.fr / xyz2024 // succesOutForm.style.fontSize="12pt"; succesOutForm.style.color="orange"; succesOutForm.innerHTML="  "+"//!\\fr Vous pouvez fermer ce formulaire"; // idSuccessHx.innerHTML;// // jsmethodControlCommonWaiting("idSuccessHx","//!\\fr La connection est valide","green"); // idSuccessHx.style.display="inline"; //----- //alert('line 155 jsmethodControlLogin(formthis)\n'+'formthis.getElementsByTagName(\'fieldset\')[0]= '+formthis.getElementsByTagName('fieldset')[0]); formthisFieldset=formthis.getElementsByTagName('fieldset')[0]; formthisFieldset.setAttribute('disabled','disabled');// https://linkedlist.ch/disabling_an_entire_form_in_html_37/ //jsmethodControlCommonWaiting(js.idTopInfo,'//!\\fr La connection est valide',"green"); } //alert('line 146 jsmethodControlLogin(formthis)\n'+'idSuccessHx= '+idSuccessHx+'\n'+'idSuccessHx.style.display==="none"= '+idSuccessHx.style.display==="none"); return(true); }//!\\end:if(test){ js.line=305;jsfct_dvlptAlert(['',l2p,h2p,"idSuccessHx.style.color= "+idSuccessHx.style.color ]); idSuccessHx.style.color="red"; break;//!\\sendX //step:logger:9 traitment of js.xdr.responseText ready }//!\\end:js:if((d1-d0)){ }//!\\end:js:while (d1-d0<3) {//inférieur à 3s }//!\\end:function sendDataOpenResults(formthis){js.fct="js.fct:jsb:sendDataOpenResults(formthis)"; //3$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ function goConstructForm(array,content){js.fct="js.fct:jsb:goConstructForm(array,content)"; return(jsmethodConstructFORM(true)+content+jsmethodConstructFORM(false));// head+content+end //return(jsmethodConstructFORM(true,array)+content+jsmethodConstructFORM(false));// head+content+end }//!\\end:function goConstructForm(array,content){js.fct="js.fct:jsb:goConstructForm(array,content)"; //3$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ function jsmethodConstructFORM(mode){js.fct="js.fct:jsb:jsmethodConstructFORM(mode,xarray)"; //function jsmethodConstructFORM(mode,xarray){js.fct="js.fct:jsb:jsmethodConstructFORM(mode,xarray)"; // permet de créer une form pour ajax content=''; if(mode===false)return(''); if(jsStartSite.isLOCALHOST){ content='
'; content+='

idResponseHx

'; } if(mode&&xarray){ xonsubmit=xarray[0];//'goSaveNewPostit(this,\'ta blez\');return(false);'; valueSuccess=xarray[1];//'Postit Form'; value_form_=xarray[2];//'postit.0,ta blez,password,record,keywords,content'; content='
'; content+='
'; content+='

'; content+='
'; content+=''; content+=''; content+=''; content+=''; } return(content); }//!\\end:js:function jsmethodConstructFORM(mode,xarray){js.fct="jsmethodConstructFORM(mode,xarray)"; //3$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ function jsmethodTestElementFORM(idTopInfo,message,elmValue,warning,fct){js.fct="js.fct:jsb:jsmethodTestElementFORM(js.idTopInfo,message,elmValue,warning,js.fct)"; tobor='tobor';xfalse=true; if(js.fct==tobor) {if(elmValue!==""){jsmethodControlCommonWaiting(js.idTopInfo,message);return(false);};} else{ if(elmValue==""){jsmethodControlCommonWaiting(js.idTopInfo,message);return(false);}; switch(js.fct){ case 'mail': if(!jsmethodControlLoginValidateEmail(elmValue)){jsmethodControlCommonWaiting(js.idTopInfo,message);return(false);}; break; case 'pass': if(!jsmethodControlLoginValidatePass(elmValue)){jsmethodControlCommonWaiting(js.idTopInfo,message);return(false);}; break; default: return(false); }//!\\end:switch(js.fct){ } obj=document.getElementById(js.idTopInfo); if(obj=="[object HTMLHeadingElement]")y=(obj.style.display=="none"); return(true); }//!\\end:function jsmethodTestElementFORM(js.idTopInfo,message,elmValue,warning,fct){js.fct="js.fct:jsb:jsmethodTestElementFORM(js.idTopInfo,message,elmValue,warning,fct)"; //3$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ function jsmethodControlCommonSetElementTitleFORM(infoStart,value){js.fct="js.fct:jsb:jsmethodControlCommonSetElementTitleFORM(infoStart,value)"; // return(new Array(info0,info1)); info0=document.getElementById('infoId'+'0'+infoStart);///keyT); info1=document.getElementById('infoId'+'1'+infoStart);///keyT); if(value>-1){ if(info0)info0.style.display=(value==0?'inline':'none'); if(info1)info1.style.display=(value==1?'inline':'none'); } return(new Array(info0,info1)); }//!\\end:function jsmethodControlCommonSetElementTitleFORM(infoStart,value){js.fct="js.fct:jsb:jsmethodControlCommonSetElementTitleFORM(infoStart,value)"; //3$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ function jsmethodControlCommonSetElementContent(element,ok,value,color,opacity,disabled){js.fct="js.fct:jsb:jsmethodControlCommonSetElementContent(element,ok,value,color,opacity,disabled)"; if(ok){ //element.value=value; element.style.color='green';element.style.opacity=.3;element.disabled=true; return; } element.value=(value?value:'');element.style.color=(color?color:'black'); element.style.opacity=(opacity?opacity:1);element.disabled=(disabled?disabled:false); }//!\\end:function jsmethodControlCommonSetElementContent(element,ok,value,color,opacity,disabled){js.fct="js.fct:jsb:jsmethodControlCommonSetElementContent(element,ok,value,color,opacity,disabled)"; //3$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ function jsfct_dvlptWriteLoginMailPass(mail,pass){js.fct="js.fct:jsb:jsfct_dvlptWriteLoginMailPass(mail,pass"; x=document.getElementById('mail');if(x)x.value=mail; x=document.getElementById('pass');if(x)x.value=pass; }//!\\end:function jsfct_dvlptWriteLoginMailPass(mail,pass){js.fct=js.fct:jsb:jsfct_dvlptWriteLoginMailPass(mail,pass"; //3$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ function jsmethodControlLoginValidatePass(pass){js.fct="js.fct:jsb:jsmethodControlLoginValidatePass(pass)"; date=new Date(); passDate=[padTo2Digits(date.getDate()),padTo2Digits(date.getMonth() + 1)].join(''); if(passDate==pass)return(true); //alert('mediumRegex : '+passDate+'\n'+'pass : '+pass); strongRegex=new RegExp("^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#\$%\^&\*])(?=.{8,})"); mediumRegex=new RegExp("^(((?=.*[a-z])(?=.*[A-Z]))|((?=.*[a-z])(?=.*[0-9]))|((?=.*[A-Z])(?=.*[0-9])))(?=.{6,})"); ///alert('mediumRegex : '+mediumRegex.test(pass)+' - strongRegex : '+strongRegex.test(pass)); x=mediumRegex.test(pass);return(x); // return(mediumRegex.test(pass)); //if(mediumRegex.test(pass))return(false); }//!\\end:function jsmethodControlLoginValidatePass(pass){js.fct="js.fct:jsb:jsmethodControlLoginValidatePass(pass)"; //3$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ function jsmethodControlLoginValidateEmail(mail){js.fct="js.fct:jsb:jsmethodControlLoginValidateEmail(mail)"; js.line=354;re=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; x=re.test(mail);return(x); }//!\\end:function jsmethodControlLoginValidateEmail(mail){js.fct="js.fct:jsb:jsmethodControlLoginValidateEmail(mail)"; //3$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ function jsmethodControlLoginDisplayPass(thIs,f_name){js.fct="js.fct:jsb:jsmethodControlLoginDisplayPass(thIs,f_name)"; js.line=262; x=document.getElementById(f_name);x.type=(x.type==="password"?"text":"password"); y=f_name;if(y==="mail")x.type="email"; if(y==="pass"){i=thIs.parentNode.children[0];x.type=(thIs.checked?'text':'password');} }//!\\end:function jsmethodControlLoginDisplayPass(thIs,f_name){js.fct="js.fct:jsb:jsmethodControlLoginDisplayPass(thIs,f_name)"; //3$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ function jsmethodControlCommonWaiting(key,text,color){js.fct="js.fct:jsb:jsmethodControlCommonWaiting(key,text,color)"; js.line=270;content=''; obj=document.getElementById(key); if(obj=="[object HTMLHeadingElement]"){ y=(obj.style.display=="none"); obj.innerHTML=(y?text:""); //obj.innerHTML=text; obj.style.display=(y?"inline":"none"); obj.style.color=(y?"red":"green"); if(color)obj.style.color=color; return; } msg=document.getElementById('infoId'+key); if(obj){ switch(obj.type){ case '[object HTMLHeadingElement]': case 'xxxxtextarea': content=obj.innerHTML; break; default://input type="text et email et textarea" content=obj.value; } } if(!content&&msg){ msg.style.display='inline-block';msg.style.fontSize='12pt';msg.style.weight='bold'; msg.style.color='red'; msg.innerHTML=text; return(false); } }//!\\end:function jsmethodControlCommonWaiting(key,text,color){js.fct="js.fct:jsb:jsmethodControlCommonWaiting(key,text,color)"; //3$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ if(0){ function jsmethodDetectionForm(formthis){js.fct="js.fct:jsb:jsmethodDetectionForm(formthis)"; alert('not used : jsmethodDetectionForm(formthis)'); if(formthis=="[object HTMLFormElement]"){ spanButton=formthis.parentElement; upCheckbox=formthis.parentElement.children[1]; //idsuccessHx, _form_, success, tobor, buttonCheckbox, mail, pass, taskLoginSelect, idnahiddenSelect, testdata, fileX, userSite, isDir_Site arr0=jsc_getformDataObj(formthis); js.formdata=arr0[0];js.iData=arr0[1]; js.iData.fileX=postPostit.jspageFileAXForum;//jspageFileAXForum; js.iData.fileLearnerSerialData=postPostit.jsfileLearnerSerialData;// ex:michelb js.iData.userSite=jsStartSite.userSite; js.iData.isDir_iC=jsStartSite.isDir_iC; js.iData.isDir_Site=jsStartSite.isDir_Site; js.iData.isLang=jsStartSite.isLang; js.iData.isConnected=jsStartSite.isConnected; js.iData.isCid=jsStartSite.isCid;//append("isCid",jsStartSite.isCid); if(!js.upButton)js.upButton=formthis; spanButton=formthis.parentElement; //upButton=thIs;//.parentElement.children[0]; upCheckbox=formthis.parentElement.children[1]; //==== xid='infoIdCheckbox';upLabelMsg=document.getElementById(xid); if(!upLabelMsg){jsmethodControlCommonWaiting(upLabelMsg,'not '+xid);return(false);}; upLabelMsg.style.display='none';//x.style.color='red'; titleId=''; for(i=0;i { input=obj[key]; if(input){ input.style.color='black'; switch(newInputs){ case 'newInputs': jsmethodControlCommonSetElementContent(input,false); break; case 'pdfInputs': break; case 'setInputs': jsmethodControlCommonSetElementContent(input,false,obj3[key]); break; default: z=1; if(input.type=='email'){// // fatima@gmail.com / _Sys.fatima0 z=jsmethodControlLoginValidateEmail(input.value); } if(!input.value||!z){error++;jsmethodControlCommonWaiting(key,obj2[key]);};//return(false);}; if(input.value){ jsmethodControlCommonSetElementContent(input,true); } } }//if(input){ }); return([z,error]); } */ }//!\\end:function jsmethodWriteCommonBase(thIs,obj,obj2,obj3,newInputs){js.fct="js.fct:jsb:jsmethodWriteCommonBase(thIs,obj,obj2,obj3,newInputs)"; //3$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ function jsmethodWriteEmailBase(thIs){js.fct="js.fct:jsb:jsmethodWriteEmailBase(thIs)"; ///alert('file/line '+js.pageFileSource+'/467 \n'+js.linkAjaxUsing+' \n'+js.linkAjaxEmail); js.linkAjaxUsing=js.linkAjaxEmail;sendDataOpen(thIs); }//!\\end:function jsmethodWriteEmailBase(thIs,newInputs){js.fct="js.fct:jsb:jsmethodWriteEmailBase(thIs,newInputs)"; //3$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ if(0){ function xxxxjsGoLogger(formthis){js.fct="js.fct:jsb:jsGoLogger(formthis){"; idSuccessIHx=formthis.idSuccessHx; idSuccessHx=document.getElementById(idSuccessIHx.name); if(errorXText)idSuccessIHx.value=errorXText; idSuccessHx.innerHTML="//!\\fr En cours "+idSuccessIHx.value; errorXText=""; idSuccessHx.style.display="inline"; //

// //----- //!\\sendX //step:logger:5 send formdata+js.iData -> X.php -> return oData js.oData=sendDataOpen(formthis);//js.linkAjax,synchro,js.xdr); return(false); }//!\\end:function jsGoLogger(formthis){js.fct="js.fct:jsb:jsGoLogger(formthis){"; //3$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ } function jsmethodControlLogin(formthis){js.fct="js.fct:jsb:jsmethodControlLogin(formthis)"; js.linkAjaxUsing=js.linkAjaxConnexion;sendDataOpen(formthis); }//!\\end:function jsmethodControlLogin(formthis){js.fct="js.fct:jsb:jsmethodControlLogin(formthis)"; //3$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ function idformALink(param,value,xalert){js.fct="ijs.fct:jsb:dformALink(param,value)";// lang,en_gb response = null; if(xalert){ switch(xalert){ case 'connexion':response=confirm("//!\\fr: Vous voulez vous déconnecter ?");break; default: } if(!response)return(false); } //==== $('#idimgStandbyLang').css('display','inline');//idimgStandbyLang //==== var idparamA=document.getElementById('idparamA'); idparamA.value=value;// ex:lang //==== var idformA=document.getElementById('idformA'); idformA.value='idformA'+'='+param;// ex: idformA=lang //==== var idclickA=document.getElementById('idclickA'); idclickA.value='idclickA'+'='+true;// ex: click internaute //==== js.line=497;jsfct_dvlptAlert(['',l2p,h2p,'idclickA.value='+idclickA.value,'value='+value ,'idformA.value='+idformA.value,'jsStartSite.isLOCALHOST='+jsStartSite.isLOCALHOST ]); idformA.click(); }//!\\end:function idformALink(param,value){js.fct="ijs.fct:jsb:dformALink(param,value)"; //3$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ function idformASaveDvlptLocal(that,param,value,file){js.fct="js.fct:jsb:idformALink(param,value)"; // messageContent marche :: https://here.tf/_systemboost/ https://here.tf/_systemboost/ http://here.tf/_systemboost/ http://www.here.tf/_systemboost/ if(value.value)value=value.value; if(value.innerHTML)value=value.innerHTML; // https://www.scaler.com/topics/window-object-in-javascript/ $('#idimgStandbyLang').css('display','inline');//idimgStandbyLang //==== var idparamA=document.getElementById('idparamA'); if(idparamA)idparamA.value=(value?value:"");//that.messageContent.innerHTML;// ex:lang //==== var idfileA=document.getElementById('idfileA'); if(idfileA)idfileA.value=(file?file:"");// ex: idfileA=file //==== var idformA=document.getElementById('idformA'); if(idformA)idformA.value=(param?'idformA'+'='+param+(idfileA.value?"="+idfileA.value:""):"");// ex: idformA=un=deux=file //==== var idclickA=document.getElementById('idclickA'); if(idclickA)idclickA.value='idclickA'+'='+true;// ex: click internaute //==== idformA.click(); }//!\\end:function idformASaveDvlptLocal(that,param,value,file){js.fct="js.fct:jsb:idformALink(param,value)"; //3$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ //function jsmethodWriteCommonBase(thIs,obj,obj2,obj3,newInputs){js.fctAction='jsmethodWriteCommonBase(thIs,obj,obj2,obj3,newInputs)';js.fct="js.fct:jsb:"+js.fctAction; function sendDataOpen(formthis){fctstart=js.fctAction="send datas to aX";js.fct="js.fct:jsb:aX:"+js.fctAction; js.xdr=getXDomainRequest();getXErrorsRequest(js.fctAction);//sendDataOpen(formthis) getXDomainRequest(); jsc_getformDataElementToObj(formthis); // js.fctAction="jsc_getformDataElementToObj"; // arr0=jsc_getformDataObj(formthis); // js.formdata=arr0[0];js.iData=arr0[1]; //==== //test=(js.iData.isbuttonCheckbox!="false"); //alert('line 550 '+js.iData.isbuttonCheckbox); // if(js.iData.isbuttonCheckbox!="on"){ //idTopInfo='idSuccessHx'; if(!parseInt(js.iData.isbuttonCheckbox)){//js.iData.isbuttonCheckbox!="on"){ jsmethodControlCommonWaiting(js.idTopInfo,jslangSystem.Cochez_pour_enregistrer_depuis_ce_bouton);return(false); } jsmethodControlCommonWaiting(js.idTopInfo,""); //==== js.xdr.onload=function(){sendDataOpenResults(formthis);} //----- getXErrorsRequest(fctstart+'+js.formdata',js.iData.FileAX+'|'+js.formdata+'|'+js.synchro);//send datas to aX+js.formdata //alert('line 673: \n js.iData.FileAX: '+js.iData.FileAX+' \n js.formdata: '+Object.entries(js.formdata)); alert('line 673: \n js.iData.FileAX: '+js.iData.FileAX+' \n js.formdata: '+Object.keys(js.formdata)); //js.line=659;jsfct_dvlptAlert(["js.iData.FileAX ?",l2p,h2p,js.iData.FileAX]); if(js.formdata){ js.xdr.open("POST",js.iData.FileAX,js.synchro);// synchro=false permet d'ATTENDRE que results vers return(results); js.xdr.send(js.formdata); } else js.line=680;jsfct_dvlptAlert(["js.formdata ?",l2p,h2p,"datas empty"]); }//!\\end:function sendDataOpen(formthis){js.fct="js.fct:jsb:aX:sendDataOpen(formthis)"; //3$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ }catch(e){js.fctAction="firstForm:error";js.fct="try/catch:jsb:error";js.line=594;jsfct_dvlptAlert(['',l2p,h2p,a2p+js.fctAction,ce2p+e]);} //3$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ //============================================================================= //============================================================================= //============================================================================= //============================================================================= if(0){ //----- idResponseHx=document.getElementById("idResponseHx"); if(idResponseHx){ idResponseHx.style.fontSize="0.8vw"; idResponseHx.innerHTML=js.iData.mail+", "+js.iData.pass+", "+" | "+js.oData.mail+", "+js.oData.pass+" | " +(js.iData.mail==js.oData.mail&&js.iData.pass==js.oData.pass); } //----- idobjectConON0=document.getElementById("idobjectConON0"); //idobjectConON0.style.display="inline"; idobjectConON1=document.getElementById("idobjectConON1"); if(idobjectConON0){ idobjectConON0.style.display=idobjectConON1.style.display="inline"; } //----- idobjectConOFF=document.getElementById("idobjectConOFF"); if(idobjectConOFF){ idobjectConOFF.style.display="none"; } //----- } //============================================================================== // code dessous en standby //============================================================================== /* js.line=65;jsfct_dvlptAlert([l2p+js.line,h2p+"nbrVignettes orientation"]); const obj={ name: 'yourName', value: f.yourName }; serialize(mixedValue) // Prints "name Jean-Luc Picard" followed by "rank Captain" Object.entries(obj).forEach(entry => { const [key, value]=entry; if(!value){jsmethodControlCommonWaiting(y,'not '+key);return(false);}; // console.log(key, value); }); */ /* obj={ yourName: jslangSystem.Le_nom_est_vide, yourMail: jslangSystem.Le_mail_est_vide , namesubject: jslangSystem.Le_sujet_est_vide, messageContent: jslangSystem.Le_message_est_vide }; Object.keys(obj).forEach(key => { const value=obj[key];
Vous pouvez ici contacter à une personne par mail.
m=document.getElementById('infoId'+key);if(m)m.style.display='none'; if(!m){jsmethodControlCommonWaiting(m,value);return(false);}; }); */ ///if(!f.yourName){jsmethodControlCommonWaiting(y,'not yourName');return(false);}; //if(!f.yourMail){jsmethodControlCommonWaiting(y,'not yourMail');return(false);}; //if(!f.namesubject){jsmethodControlCommonWaiting(y,'not namesubject');return(false);}; //if(!f.messageContent){jsmethodControlCommonWaiting(y,'not messageContent');return(false);}; /* js.line='207 jsmethodWriteEmailBase(thIs)'; //==== //yourName , yourMail, namesubject, messageContent $i_yourMessage='messageContent'; yourName=f.yourName.value;yourMail=f.yourMail.value; namesubject=f.namesubject.value;messageContent=f.messageContent.value; m=document.getElementById('infoId'+'yourName');if(m)m.style.display='none'; if(!yourName){jsmethodControlCommonWaiting(m,jslangSystem.Le_nom_est_vide);return(false);}; //==== m=document.getElementById('infoId'+'yourMail');if(m)m.style.display='none'; if(!yourMail){jsmethodControlCommonWaiting(m,jslangSystem.Le_mail_est_vide);return(false);}; //==== m=document.getElementById('infoId'+'namesubject');if(m)m.style.display='none'; if(!namesubject){jsmethodControlCommonWaiting(m,jslangSystem.Le_sujet_est_vide);return(false);}; //==== m=document.getElementById('infoId'+'messageContent');if(m)m.style.display='none'; if(!messageContent){jsmethodControlCommonWaiting(m,jslangSystem.Le_message_est_vide);return(false);}; */ /* if(0){ js.line='182 jsmethodWriteEmailBase(thIs)'; xid='infoIdCheckbox';x=document.getElementById(xid); if(!x){jsmethodControlCommonWaiting(x,'not '+xid);return(false);}; x.style.display='none';//x.style.color='red'; if(!thIs.form){jsmethodControlCommonWaiting(x,'not form-this');return(false);}; f=thIs.form; //==== //yourName , yourMail, namesubject, messageContent js.line='192 jsmethodWriteEmailBase(thIs)'; alert(js.line+'\n'+xid+'\n'+f.name); //--> //----- /* if(1){ js.line=614;jsfct_dvlptAlert('line= forum.js.php+connection.php,'+js.line+'\n'+'oData= '+oData); //js.line=613;jsfct_dvlptAlert('line= forum.js.php+connection.php,'+js.line+'\n'+'oData= '+Object.keys(oData)); } //!\\sendX //step:logger:11 final oData <- traitment of js.xdr.responseText ready if(oData.success){ idSuccessHx.style.color="green"; if(0){ js.line=618;jsfct_dvlptAlert('line= forum.js.php+connection.php,'+js.line+'\n'+'linkAjax fonctionne ?='+oData.success +'\n'+'oData._form_= '+oData._form_ +'\n'+'oData.mail= '+oData.mail +'\n'+'oData.pass= '+oData.pass +'\n'+'oData.dataSerialize= '+oData.dataSerialize +'\n'+'oData.okX= '+oData.okX +'\n'+'oData.login= '+oData.login +'\n'+'oData.Connected= '+oData.Connected +'\n'+'oData.userSite= '+oData.userSite +'\n'+'oData.fluxX= '+oData.fluxX ); } if(oData.login.connecting)return(true); //!\\sendX //step:logger:12 traitment of dataBase ?? return(true); } idSuccessHx.style.color="red"; return(false); */ /* $i_test='';// idButtonUp jsmethodWriteEmailBase(js.upButton,'setInputs','$i_id') if(¤isLOCALHOST) $i_test=<<   TEST; 'votre mail est bien arrivé !' xyzEnvoyer un autre mail xyzRemplir le mail automatiquement pour test xyzEnvoyer le mail en PDF aussi $p_jsSystem['mmail0']=$g_langFIRST[¤langT]['Le mail est vide']; $p_jsSystem['mmail1']=$g_langFIRST[¤langT]['Le mail est invalide']; $p_jsSystem['mmail2']=$g_langFIRST[¤langT]['votre mail est bien arrivé']; $p_jsSystem['mmail3']=$g_langFIRST[¤langT]['Envoyer un autre mail']; $p_jsSystem['mmail4']=$g_langFIRST[¤langT]['Remplir le mail automatiquement pour test']; Nouveau Test PDF $p_jsSystem['mmail5']=$g_langFIRST[¤langT]['Envoyer le mail en PDF aussi']; */ // info0.style.display='none'; // info1.style.display='block-inline'; ////test=false; //newInputs=(!newInputs?true:newInputs); //infoStart=arrO.fsuccess; //js.line=324;alert(js.line+' line \n '+'\n newInputs= '+newInputs+'\n arrO= '+arrO); //alert('line 252 '+'\narrO= '+arrO+'\n ftarget= '+ftarget+'\n test= '+test); ///x={'spanButton':spanButton,'upButton':js.upButton,'upCheckbox':upCheckbox,'upLabelMsg':upLabelMsg,'ftarget':ftarget}; //return(new Array(z,error)); //==== //js.line=269;alert(js.line+' ok? \n z= '+z+'\n error= '+error); //js.line=325;alert(js.line+' line \n '+'\n jsDIR_iC+/_DB/ajax-email.php= '+jsDIR_iC+'/_DB/ajax-email.php' //+'\n error= '+error+'\n newInputs= '+newInputs); // https://www.nicesnippets.com/blog/jquery-ajax-form-submit-with-formdata-example // https://thoughtbot.com/blog/ridiculously-simple-ajax-uploads-with-formdata // https://copyprogramming.com/howto/how-to-pass-the-form-data-in-ajax // https://www.delftstack.com/howto/javascript/javascript-serialize-form/ // https://www.tutsplanet.com/how-to-send-all-form-form-data-in-ajax/ /* $.ajax({ type:'POST', url:'formpost.php', data:$('#contact_form').serialize(), success:function(msg){ alert(msg); } }); */ //js.line=346;alert(js.line+' line \n '+'\n ftarget= '+ftarget); //var form=document.getElementById(ftarget.name); //js.line=348;alert(js.line+' line \n '+'\n ftarget.name= '+ftarget.name); //js.line=350;alert(js.line+' line \n '+'\n ftarget.name= '+ftarget.name); //var iData=new FormData(); oReq.open("POST",jsDIR_iC+'/_DB/ajax-email.php',true); // iData.append("datas", iData.serialize()); //data: $('form#data-form').serialize(), ////var iData=new FormData(arrO.fsuccess); /* js.line=332;jsfct_dvlptAlert(js.line+'\nform.serialize()= '+'form.serialize()' +'\nObject.keys(form)[10].name= '+Object.keys(form)[10].name +'\nObject.values(form)[10].value= '+Object.values(form)[10].value +'\nObject.keys(iData)= '+Object.keys(iData)+'\nftarget.yourMail= '+ftarget.yourMail+ '\n ok'); */ /// iData.append("result", paramsA_in.result);// passage des résultats OUT/IN //=== // ne pas mémoriser le texte pour ne pas avoir en mémoire le même texte se qui surcharge Ajax // pour comparer 2 textes filesize est utile, peut-être comparer entête + footer + middle ??? // filemtime non peu comparer 2 dates celle du fichier et une date mémorisée ??? //=== //alert("line 350 iData: "+iData); C:\w3\renov-az\userSite\ajax-email.php // https://robertnyman.com/2013/02/11/using-formdata-to-send-forms-with-xhr-as-keyvalue-pairs/ // https://javascript.info/xmlhttprequest // https://developer.mozilla.org/en-US/docs/Learn/Forms/Sending_forms_through_JavaScript //najehchawel3@gmail.com //michel.boussekeyt@univ-lille.fr // iData.append('senderHostFrom',jsStartSite.iswebmaster);//'webmaster@pooletude.com'); // iData.append('senderHostToReply','michel.boussekeyt@univ-lille.fr'); // iData.append('senderHostTo','michel.boussekeyt@univ-lille.fr');// 'najehchawel3@gmail.com'); // let view=new TextEncoder('utf-8').encode(value.value);// view=liste de caractères // iData.append(value.name, view); // iData.append(value.name, decodeURI(value.value).replace(/\\"/gi,"")); // async: true (asynchronous libère le serveur pour retourner le résultat quand // il peut) or false (synchronous bloque le serveur pour retourner le résultat) //js.line=227;jsfct_dvlptAlert(js.line+'\n pmsErr: '+jsDIR_iC+'_DB/ajax-email.php'); // oReq.open("POST",'/renov-az/userSite/ajax-email.php',true);// url ok false=synchrone attendre le résultat avant de le renvoyer / true=asynchrone /// oReq.open("POST", url, paramsA.async);// url ok false=synchrone attendre le résultat avant de le renvoyer / true=asynchrone /// oReq.open("POST", iData.url, true); // ne marche pas not ok //infoStart=arrO.fsuccess; //i=jsmethodControlCommonSetElementTitleFORM(infoStart,-1);//chercher les 2 infoId //newInputs=(newInputs=='newInputs'||newInputs=='setInputs'?newInputs:false); //let arrO=jsmethodDetectionForm(thIs); //obj={ yourName: ftarget.yourName, yourMail: ftarget.yourMail, namesubject: ftarget.namesubject, messageContent: ftarget.messageContent }; //obj2={ yourName: jslangSystem.Le_nom_est_vide, yourMail: jslangSystem.Le_mail_est_vide //, namesubject: jslangSystem.Le_sujet_est_vide, messageContent: jslangSystem.Le_message_est_vide }; // https://masteringjs.io/tutorials/fundamentals/foreach-key-value // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries //const obj={ yourName: 1, b: 2, c: 3 } ///js.line=227;jsfct_dvlptAlert(js.line+' jsmethodDetectionForm(thIs)\n thIs= '+thIs //+'\n input.name= '+input.name+'\n newInputs= '+newInputs+ '\n ok'); ////if(!input)break; // jsmethodControlCommonSetElementContent(element,ok,value,color,opacity,disabled,display) // input.value='';input.style.color='black';input.style.opacity=1;input.disabled=false; // input.display='block-inline'; // input.value=obj3[key]; // input.style.color='black';input.style.opacity=1;input.disabled=false; // input.style.color='red';input.style.opacity=.3;input.disabled=true; //js.line=188;jsfct_dvlptAlert(js.line+'\nupButton: '+arrO.upButton+'\nx.ftarget: '+arrO.ftarget+'\nupCheckbox: '+arrO.upCheckbox //+'\nftarget.yourMail: '+ftarget.name+ '\n ok'); //==== //alert(9900); C:\iC\_scripts\js\firstForm.js.php // https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/JSON // texte de clé : https://codes-sources.commentcamarche.net/source/36434-permet-de-crypter-coder-facilement-un-texte-a-l-aide-d-une-cle-mot-de-passe-indechiffrable // https://codes-sources.commentcamarche.net/source/30279-cryptage-de-texte // https://tzi.fr/js/code-vigenere/ // https://www.google.com/search?q=js+coder+un+mot&sca_esv=567294360&ei=Ul0MZevxMaajkdUP3_qPkA8&start=10&sa=N&ved=2ahUKEwjr4oPY_ruBAxWmUaQEHV_9A_IQ8tMDegQIBBAE&biw=1440&bih=789&dpr=1 // ok https://waytolearnx.com/2019/09/chiffrement-de-cesar-en-javascript.html // C:\ic\_scripts\js\firstForm.js.php /* function essai(){ jsidAddress="¤isRemoteIP"; let myObj={ name: jsidAddress, age: 38 }; alert('line 5 : '+myObj.name+' - '+jsidAddress+' - '+'toto'); } alain.perrier@univ-rennes1.fr; "Michel Vergnaud" , "Jacques Ledig" , "Alain Perrier" , "Laurent Surcin" , "Michel Moulin" , "Michel Boussekeyt" , "Philippe Costes" , "Patrick Chanot" https://www.galaxie.enseignementsup-recherche.gouv.fr/ensup/etab_recrutement_PRAG_PRCE.htm#:~:text=Les%20candidats%20doivent%20d%C3%A9poser%20leur,les%20documents%20sp%C3%A9cifiques%20que%20chaque https://www.neoprofs.org/t125977-universite-ou-lycee-quel-est-le-meilleur-salaire https://www.foesr.fr/index.php/9-uncategorised/171-grilles-indiciaires-prag-prce */ /* alert(window.screen.width+"x"+window.screen.height);//1280x1024 alert(document.cookie); var x=getCookie("orientation"); if(x!=orientation){ document.cookie="orientation="+orientation; window.location.reload(); ///break; // try{break;}catch(e){throw new Error();} ///exit(0); //break; //throw new Error(); } else{ var screenSizes=window.screen.width+"x"+window.screen.height; alert(screenSizes); document.cookie="screenSizes="+screenSizes+"-"+window.screen.availWidth+"x"+window.screen.availHeight; ////al ert("orientation",getCookie("orientation")); var x=getCookie("orientation"); } */ ///al ert(x[0],x[1]); ///al ert(myDebug.getCookie("orientation")); //===== ///alert(h2p+"nbrVignettes orientation"); //var gjs_smartphone=false; //var x=screenOrientation(); //var gjs_smartphone=x.smarphone; //var nbr Vignettes=1; //var jsSnone="none",jsSinline='inline'; //var jsloc alhost='127.0.0.1'; ///url='http://localhost/'; ///al ert(url.includes('localhost')); / g_idAddress //url=url.includes('localhost') || url.includes('127.0.0.1'); //url=url.includes('127.0.0.1'); //url=url.includes(localhost);//'localhost'); ///alert("url ="+url.includes('localhost')+"\n jsidAddress ="+''); ///var jsidAddress='',jsis_ localhost=url&&jsidAddress; ///var jsidAddress='', //var jsis_ localhost='http:\/\/localhost/'.includes('localhost')&&(jsidAddress==localhost);//,jsis_ localhost=(url==jsidAddress);//url&&jsidAddress; //var jsis_ localhost='http:\/\/localhost\/'.includes('localhost')&&(jsidAddress==jslocalhost);// =true //alert(jsStartSite.isLOCALHOST+'\n'+jsuserSitename+'\n'+jsidAddress+'\n'+jsStartSite.isLOCALHOST);// // // https://www.c-sharpcorner.com/blogs/getting-client-ip-address-or-local-ip-address-in-javascript // https://www.geeksforgeeks.org/how-to-get-client-ip-address-using-javascript/ // // /// //================ //formData.append("iData",iData); //iData=formDataObj={};formData.forEach((value,key)=>(formDataObj[key]=value)); //iData.success="0"+"|"+iData._form_; //sameSuccess=iData.success; ///iDataSerialize=serialize(iData); //alert('serialize(formData)= \n'+serialize(iData)); /* js.line=208;jsfct_dvlptAlert(['!',l2p+js.line,h2p+fct,"action= "+js.fctAction ,"Object.entries(iData)="+Object.entries(iData)//formData.success ]); */ //formDataObj=Object.assign(iData,formDataObj); //!\\sendX //step:logger:8 traitment of js.xdr.responseText // https://dmitripavlutin.com/foreach-iterate-array-javascript/ // https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Statements/for...of //,'dataSuccessForm===dataSuccessoData= '+dataSuccessForm===dataSuccessoData //,'sameSuccess= '+sameSuccess,'Object.entries(oData)= '+Object.entries(oData) //,'datas= '+datas,'Object.entries(iData)= '+Object.entries(iData) //if(oData.success){ //idSuccessHx idSuccessHx ///idSuccessIHx=formthis.idSuccessHx; /* if(1){ js.line=261;jsfct_dvlptAlert('line= forum.js.php+connection.php,'+js.line+'\n'+'linkAjax fonctionne ?='+oData.success +'\n'+'oData._form_= '+oData._form_ +'\n'+'oData.mail= '+oData.mail +'\n'+'oData.pass= '+oData.pass +'\n'+'oData.dataSerialize= '+oData.dataSerialize +'\n'+'oData.okX= '+oData.okX +'\n'+'oData.login= '+oData.login +'\n'+'oData.Connected= '+oData.Connected +'\n'+'oData.userSite= '+oData.userSite +'\n'+'oData.fluxX= '+oData.fluxX ); } */ // if(oData.login.connecting)return(true); //!\\sendX //step:logger:12 traitment of dataBase ?? /* content=''; content+='

'; //content+='

'; //content+='

'; content+=''; content+=''; content+=''; content+=''; */ /* // content+=' | //!\\fr enregistrer'; --> content+=''; content+=''; content+='
'+'//!\\fr Mots clés'+': '; content+='
'+''; // content+=''; */ /* content+=jsmethodConstructFORM(false);//'' return(content); */ /* C:\iC\v0\iCv0_index.php var jsStartSite={ userSite: "'.strtolower(¤APP_nameDir_SITE).'" , sedocList: "'.¤sedocList.'" , isDir_Site: "'.¤DIR_SITE.'" , isDir_iC: "'.¤DIR_iC.'", isV_XX: "'.¤vXX.'" , isRemoteIP: "'.¤RemoteIP.'", isSmarphone: "'.(integer)¤isSmartphone.'" , isScreenSizes: screenSizes, isOrientationScreen: x , isLang: "'.@$_SESSION[¤APP_nameDir_SITE][¤lang].'" , isConnected: "'.@$_SESSION[¤APP_nameDir_SITE][¤Connected].'" , isWifi: "'.¤isWIFI.'", isLOCALHOST: "'.¤isLOCALHOST.'", isforceDevlptAlerts: '.(integer)¤forceDevlptAlerts.' , isnbrDiapos: "'.(integer)@$_SESSION[¤APP_nameDir_SITE]['listProducts'].'" , isindexProduct: "'.(integer)@$_SESSION[¤APP_nameDir_SITE]['indexProduct'].'" , iswebmaster: "'.¤MAIL_WEBMASTER_SITE.'" , senderHostTo: "'.¤MAIL_senderHostTo_SITE.'" , senderHostToReply: "'.¤MAIL_senderHostToReply_SITE.'" formData.append("userSite",jsStartSite.userSite); formData.append("isDir_Site",jsStartSite.isDir_Site); formData.append("isLOCALHOST",jsStartSite.isLOCALHOST); formData.append("isRemoteIP",jsStartSite.isRemoteIP); formData.append("isLang",jsStartSite.isLang); formData.append("isConnected",jsStartSite.isConnected); */ //js.line=139;jsfct_dvlptAlert('119 mode= '+mode+'\n'+'xarray[0]= '+xarray[0]+'\n'+'xarray[1]= '+xarray[1]+'\n'+'xarray[2]= '+xarray[2]+'\n'+'xarray[3]= '+xarray[3]); /* js.line=141;jsfct_dvlptAlert(['!',l2p+js.line,h2p+js.pageFileSource,'xarray[0]= '+xarray[0] ,'xarray[1]= '+xarray[1],'xarray[2]= '+xarray[2]] ); */ //document.getElementById("idformA").value=""; // return(new Array(info0,info1)); // info0=document.getElementById('infoId0'+infoStart);///keyT); // info1=document.getElementById('infoId1'+infoStart);///keyT); // if(info0)info0.style.display='block-inline'; // if(info1)info1.style.display='none'; //if (node.parentElement) { // node.parentElement.style.color="red"; //} myElement.children // $i_id="formDoc"; //if(!thIs.parentElement){} /* passDate=[ date.getFullYear(), padTo2Digits(date.getMonth() + 1), padTo2Digits(date.getDate()), ].join('-'); */ // https://www.geeksforgeeks.org/how-to-validate-confirm-password-using-javascript/ /* var strongRegex=new RegExp(“^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#\$%\^&\*])(?=.{8,})”); RegEx Description ^ The password string starting. (?=.*[a-z]) Must contain at least 1 lowercase alphabetical character from a to z. (?=.*[A-Z]) Must contain at least 1 uppercase alphabetical character from A to Z. (?=.*[0-9]) Must contain at least 1 numeric character from 0 to 9. (?=.*[!@#$%^&*]) Must contain at least one special character. (?=.{8,}) Must be eight characters or longer string */ //+'\n'+'js.oData.Connected= '+js.oData.Connected +'\n'+'js.oData.success= '+js.oData.success //+'\n'+'js.oData.pointingI= '+js.oData.pointingI //alert('line 469 '+js.fct+'\n'+'js.oData= '+js.oData+'\n'+'js.iData.isbuttonCheckbox= '+js.iData.isbuttonCheckbox //); /* return; let arrO=jsmethodDetectionForm(formthis); //step:logger:0 form button to save js.xdr=getXDomainRequest();js.synchro=false; alert('jsmethodControlLogin(formthis)\n'+arrO); return; idTopInfo='idSuccessHx'; //----- //step:logger:1 search the iDatas jsmethodDetectionForm(formthis);//step:logger:2 search the iDatas here formdata+js.iData //!\\security //step:logger:3 tobor+buttonCheckbox+mail+pass+ if(js.iData.tobor){jsmethodControlCommonWaiting(js.idTopInfo,'//!\\fr Un robot tente d\'envoyer une donnée interdite !');return(false);}; //----- if(js.iData.buttonCheckbox!="on"){ jsmethodControlCommonWaiting(js.idTopInfo,jslangSystem.Cochez_pour_enregistrer_depuis_ce_bouton);return(false); } //----- if(!jsmethodTestElementFORM(js.idTopInfo,jslangSystem.Le_mail_est_invalide,js.iData.mail,'not mail','mail'))return(false); //----- if(!jsmethodTestElementFORM(js.idTopInfo,jslangSystem.Le_password_est_invalide,js.iData.pass,'not pass','pass'))return(false); //----- //!\\sendX //step:logger:4 send formdata+js.iData -> X.php -> return oData //js.oData= jsGoLogger(formthis); //----- formthisFieldset=formthis.getElementsByTagName('fieldset')[0]; formthisFieldset.setAttribute('disabled','disabled');// https://linkedlist.ch/disabling_an_entire_form_in_html_37/ jsmethodControlCommonWaiting(js.idTopInfo,'//!\\fr La connection est valide',"green"); return false; */ /* var xonsubmit="'.$i_onclick.'"; var valueSuccess="Logger Form"; var value_form_="logger.0,"+"'.$i_langT.'"+",mail,pass,select"; var xarray=new Array(xonsubmit,valueSuccess,value_form_); */ /* valueOnsubmit="goSaveNewPostit(this);return(false);"; valueSuccess='Postit Form'; value_form_='postit.0,'+js.tablez+',password,record,keywords,content'; xarray=[valueOnsubmit,valueSuccess,value_form_]; */ /* line 472 function jsmethodWriteEmailBase(thIs,newInputs){js.fct="js.fct:jsb:jsmethodWriteEmailBase(thIs,newInputs)"; return; if(js.test==true)newInputs='setInputs'; xid='infoIdCheckbox';//x=document.getElementById(xid); x=document.querySelector(xid).innerHTML; if(!x){jsmethodControlCommonWaiting(x,'not '+xid);return(false);}; let arrO=jsmethodDetectionForm(thIs); ftarget=arrO.ftarget; obj={ yourName: ftarget.yourName, yourMail: ftarget.yourMail, namesubject: ftarget.namesubject, messageContent: ftarget.messageContent }; obj2={ yourName: jslangSystem.Le_nom_est_vide, yourMail: jslangSystem.Le_mail_est_vide , namesubject: jslangSystem.Le_sujet_est_vide, messageContent: jslangSystem.Le_message_est_vide }; obj3={ yourName: 'michel boussekeyt', yourMail: 'michel.boussekeyt@univ-lille.fr' , namesubject: '//!\\fr devis en maçonnerie', messageContent: "//!\\fr Bonjour, j'ai besoin de réparer un escalier. Merci."}; e=jsmethodWriteCommonBase(thIs,obj,obj2,obj3,newInputs); z=e[0];error=e[1];// 1 et 4 si les cases sont vides if(error!=0||newInputs=='newInputs'||newInputs=='setInputs'){ arrO=jsmethodDetectionForm(thIs); return(false); } var form=(ftarget.name?document.getElementById(ftarget.name):ftarget); js.iData=new FormData(form); var oReq=new XMLHttpRequest(); // Push our data into our FormData object js.iData.append('senderHostFrom',jsStartSite.iswebmaster);//'webmaster@pooletude.com'); js.iData.append('senderHostToReply',jsStartSite.senderHostToReply);//,'michel.boussekeyt@univ-lille.fr'); js.iData.append('senderHostTo',jsStartSite.senderHostTo);//,'najehchawel3@gmail.com'); js.iData.append('idForm',arrO.fsuccess);//arrO.fsuccess); for (const [name, value] of Object.entries(form)) { js.iData.append(value.name, value.value); } oReq.open("POST",jsDIR_iC+'/_DB/ajax-email.php',true);// url ok false=synchrone attendre le résultat avant de le renvoyer / true=asynchrone oReq.onload=function(oEvent) { i=jsmethodControlCommonSetElementTitleFORM(arrO.fsuccess,-1);//chercher les 2 infoId info0=i[0];info1=i[1]; if(info1){ jsmethodControlCommonSetElementTitleFORM(arrO.fsuccess,1); n=''+ftarget.yourName.value+' ,
'; info1.innerHTML=jslangSystem.Bravo+' '+n+jslangSystem.votre_mail_est_bien_arrive+' !'; info1.innerHTML+='   '; if(jsStartSite.isLOCALHOST){ //jsc_testformDataObj(formthis) info1.innerHTML+=' '; // info1.innerHTML+=' '; } info1.innerHTML+=' '; } return(new Array(js.iData,oReq)); }; oReq.send(js.iData); return(false); */ /* //name=inputthis.type; // data-form="ihmt" //alert('line 36: \n'+document.forms[1].getAttribute('data-form')+'\n'+document.forms[1].onsubmit);//.parentNode.children[0]); //alert('line 36: \n'+document.forms[2].getAttribute('action')+'\n'+document.forms[2].onsubmit);//.parentNode.children[0]); arr0=jsc_getformDataObj(formthis); //alert('line 42: \n'+arr0);//formthis.elements['myEmail']+'\n'+inputthis.parentNode.parentNode+'\n'+inputthis.form);//.parentNode.children[0]); js.formdata=arr0[0];js.iData=arr0[1]; */ /* obj={ yourName: ftarget.yourName, yourMail: ftarget.yourMail, namesubject: ftarget.namesubject, messageContent: ftarget.messageContent }; obj2={ yourName: jslangSystem.Le_nom_est_vide, yourMail: jslangSystem.Le_mail_est_vide , namesubject: jslangSystem.Le_sujet_est_vide, messageContent: jslangSystem.Le_message_est_vide }; obj3={ yourName: 'michel boussekeyt', yourMail: 'michel.boussekeyt@univ-lille.fr' , namesubject: '//!\\fr devis en maçonnerie', messageContent: "//!\\fr Bonjour, j'ai besoin de réparer un escalier. Merci."}; alert(54321);test=true;x=document.getElementById('idButtonUp');if(x)x.click(); */