// JavaScript Document C:\iC\pop\+\pop.js.php try{ var jsscriptFile='/w3/??site??/index.php'; alert('jsscriptFile= '+jsscriptFile); var jsscriptCmd,msgAll,msgAllDiv,jsscriptTest,$jigpopLine,jsscriptLine,jsscriptTest,$jscatch,index; //var =56;// $jig=js+integer+global+ //var jsscriptTest=0;// 2=plugin var brT=`\n`,brH=``; // __jojpopInitAllCondition.__jokvpopsubnameSiteHead __jojpopInitAllCondition.__jokvpopSetDevAlert //var __jojpopInitAllCondition={ // __joj=js+object+JSON __jokv=constante+js+object+key+value var __jojpopInitAllCondition={ // __joj=js+object+JSON __jokv=constante+js+object+key+value __jokvpopSetDevAlert: //popInitAllCondition.$subnameSiteHead //const fonctionne mais j'ai peur qu'on ne puisse pas ajouter une constate JSON //var $jojpopInitAllCondition={ // $joj=js+object+JSON $jojkv ,__jokvpopsubnameSiteHead:`` //popInitAllCondition.$subnameSiteHead ,__jihpopmiddleSiteIframe:`` // __jojpopInitAllCondition.__jihpopmiddleSiteIframe }; //__jojpopInitAllCondition.__toto='__toto'; // const permet d'ajouter une kv //alert('__jojpopInitAllCondition.__toto'+__jojpopInitAllCondition.__toto); //$jigpopLine=2;index=1; //if(!msgAll) //var msgAll=''; //if(!jsscriptFile) //jsscriptFile='./pop.js.php'; //if(!jsscriptCmd) jsscriptCmd=''; //if(!jigpopLine) //var $jigpopLine=4; //if(!jsscriptTest) //var jsscriptTest=0; //var $jscatch; //var __jojpopInitAllCondition=1;//§\warning: à quoi ça sert ?? //if(!__popDevIT) var __popDevIT,__popbaseUrl,__popdirname,__popsitename,__popsitename2points ,__popfile,__popparams,__popBarTop=document.title,__popLang=`fr-FR`,__popjs; //===== var __popbaseUrl,__poplocalhost; __popbaseUrl=window.location.origin; // baseUrl= http://127.0.0.1 par exemple "http://localhost:3000"const imageUrl=`${baseUrl}/images/logo.png`; //x=__popbaseUrl.split(`\/\/127.0.0.1`);//x=x[1]; x=(__popbaseUrl+1).split(`\/\/127.0.0.1`);//x=x[1]; __poplocalhost=parseInt(x[1]?1:0);// en javascript //===== //__popBarTop=document.title;//=`titleIHM`; /* popreplaceall=function(text,src,dest){ $jigpopLine=14; //try{$jigpopLine=2; //var tagfct={kjsfile:script_debug,kjsfct:'myDebug.replaceall=function(text,src,dest)',kjsstop:debug_stop}; if(!text||text==''||typeof text!=='string')return(text); let re=new RegExp();//re=/,/g;text.replace(re,dest); let nbsp=`\ \;`; switch(src){ case '\n':re=/\n/g;break; case '/!':re=/\/!/g;break; case 'wyz':re=/wyz/g;break; case `${nbsp}`:re=/ /g;break; default: //if(text=='myApp.konclick=0.paper.0.0.div'||text=='get_boot_cfg_jsph0')return(text); for(let i=0;i<100;i++){ text=text.replace(src,dest); if(text.search(src)<0)break; } return(text); } return(text.replace(re,dest)); //}catch(e){if(myDebug)myDebug.debug_view_e_catch(e,tagfct);} }//c myDebug.replaceall=function(text,src,dest) */ //===================================== function popjsExistsFunction(string,display){ if(!__poplocalhost)return; if(!string||!display)return; let msg; //==== if(window.parent[string] && typeof window.parent[string] === 'function') { //window.parent.toto[string];//("2025"); msg={owner:window,page:`parent`,functname:string,target:window[string]}; } if (window.parent && window.parent !== window && typeof window.parent[string] === 'function') { //window.parent.toto[string];//("2025"); msg={owner:window.parent,page:`iframe`,functname:string,target:window.parent[string]}; } //==== if(0&&__poplocalhost&&msg&&display){ //if($x&&$x.owner) alert( `------- function ${string}() : -------\n` +`\n msg.functname= --> `+string +`\n msg.owner --> `+msg.owner +`\n msg.target= --> code of function ${string}()` //`+msg.target //+`\n msg.target= --> `+typeof msg.target +`\n\n content of Object.entries(msg) --> \n`+Object.entries(msg) ); } //==== /* let parent=window.parent; if (parent && parent !== window && typeof parent[string] === 'function') { //if (window.parent && window.parent !== window && typeof window.parent[string] === 'function') { //window.parent.toto[string];//("2025"); return({parent:parent,function:parent[string]}); } return({parent:null}); */ } //===================================== function popjsSiteAlert(msg){// __popDevIT=null if(!__poplocalhost) alert(msg); else alert(`popjsSiteAlert(msg): \n`+msg); } //===================================== function popjsdevAlert(msg,head,script){// __popDevIT=null if(!__poplocalhost||!msg)return; head=(!head?`devAlert`:head); script=(!script?`js`:script); if(!head)if(!__popDevIT||!jsscriptTest)return; let cmd=(!jsscriptCmd?``:`/cmd:${jsscriptCmd}`); //==== let br,brT=`\n`,brH=``; if(head==`alert`)br=brT;//`\n`; else if(head=='div'){br=brH;head='div.debug.INIT';};//br=``; //==== if(!br)br=brT; msg =`------- ${head} in : -------${br} Script ${jsscriptFile} \/ ${$jigpopLine} \/ ${cmd} \/ ${script} : ${br} ${msg}`; if(head=='div'){ // if(!__jojpopInitAllCondition.__jokvpopSetDevAlert)return; if(!__jojpopInitAllCondition)return; // head='div.debug.INIT'; msgAll=msg;//`------- ${head} in : -------\n Script ${jsscriptFile}/${$jigpopLine}${cmd} : \n ${msg}`; } else popjsSiteAlert(msg);//al ert(msg);//`------- ${head} in : -------\n Script ${jsscriptFile}/${$jigpopLine}${cmd} : \n ${msg}`); } //===================================== function popjsAlertError(e,index,line,cmd) { //function alertError(e,line,fct) { //js$Obj$KV$FS$FilesOfSite=FilesOfFunctions if(!__popjs)__popjs={file:null,previous:null,line:line}; cmd=(!cmd?``:cmd); __popjs.error=`0790 ${e}`; __popjs.file=jsscriptFile;//`fct_file`;//(js$Obj$KV$FS$FilesOfSite?js$Obj$KV$FS$FilesOfSite.f1:`not js$Obj$KV$FS$FilesOfSite.f1`); __popjs.cmd=cmd; __popjs.previous=`fct_previous`;//(js$Obj$KV$FS$FilesOfSite?js$Obj$KV$FS$FilesOfSite.previous:`not js$Obj$KV$FS$FilesOfSite.previous`); //js$Obj$KV$FS$FilesOfSite.index=index; //index=0; //hereError="------- Error in : -------\n error= "+e;hereLine="line: "+__popjs.line+"/"+__popjs.file; //properties=" islocalhost="+"jsheadCodeHTML.islocalhost "; // al ert(hereError+"\n"+hereLine+"\n"+fct.name+"\n"+js.fct+"\n"+js$Obj$KV$FS$FilesOfSite.index+"\n"+fct_file+"\n"+fct_previous); // al ert(hereError+"\n"+hereLine+"/"+__popjs.file+"\n"+index+"\n"+__popjs.file+"\n"+__popjs.previous); jsscriptTest=index;$jigpopLine=line; if($jscatch)$jscatch='catch:'; let msg=`${$jscatch} ${__popjs.error}\n`;$jscatch=null; /* $x=popjsExistsFunction(`popjsdevAlert`); if($x&&$x.parent)alert(`popjsdevAlert existe= `+$x); */ popjsdevAlert(msg,`Error`); } //===================================== function popjsGetURLparts(popactionpage){ /* alert('ici'); $x=popjsExistsFunction(`popjsdevAlert`); if($x&&$x.owner)alert(`popjsdevAlert existe $x.owner= `+$x.owner +`\n $x.target= `+typeof $x.target +`\n Object.entries($x)= `+Object.entries($x) ); */ popjsExistsFunction(`popjsdevAlert`,1); $jigpopLine=60; if(!popactionpage)popactionpage=`html`;// si popactionpage= /* __popbaseUrl=window.location.origin; // baseUrl= http://127.0.0.1 par exemple "http://localhost:3000"const imageUrl=`${baseUrl}/images/logo.png`; //x=__popbaseUrl.split(`\/\/127.0.0.1`);//x=x[1]; let x=(__popbaseUrl+1).split(`\/\/127.0.0.1`);//x=x[1]; __poplocalhost=parseInt(x[1]?1:0);// en javascript */ __popactionpage=popactionpage; // popactionpage=`html` ou popactionpage=`ajax` ou popactionpage=`alert` //al ert(`__popbaseUrl= ${__popbaseUrl}`); // // baseUrl= http://127.0.0.1 x=window.location.href; // baseUrl= http://127.0.0.1 par exemple "http://localhost:3000"const imageUrl=`${baseUrl}/images/logo.png`; x=x.split(`${__popbaseUrl}/`);x =x[1]; x=x.split(`/`); __popfile=x[x.length-1];x[x.length-1]=null; y=x.join(`/`);//al ert(`y= `+y.substring(0,y.length-1)); __popdirname=y.substring(0,y.length-1); y=__popdirname.split(`/`);//al ert(`y= `+y.substring(0,y.length-1)); let z=y.length; //__popsitename2points=y.length; __popsitename2points="..";for(i=0;i`; $jigpopLine=95;if(__poplocalhost&&__jojpopInitAllCondition.__jokvpopSetDevAlert){ let br=brH;//if(popactionpage) //if(popactionpage==`alert`)br=''; let sp=`&space;`;let sp5=`${sp}${sp}${sp}${sp}${sp}`; let xmsg=`__popbaseUrl = ${__popbaseUrl} ${br} __poplocalhost = ${__poplocalhost} ${br} jsscriptTest = ${jsscriptTest} ${br} __popactionpage = ${__popactionpage} ${br} __popdirname = ${__popdirname} ${br} __popsitename2points = ${__popsitename2points} ${br} __popsitename = ${__popsitename} ${br} __popfile = ${__popfile} ${br} __popparams = ${__popparams} ${br} __popwindowInnerWidth = ${__popwindowInnerWidth} ${br} __popwindowInnerHeight = ${__popwindowInnerHeight} ${br}__jojpopInitAllCondition(init object) ${br} ${sp5} .__jokvpopSetDevAlert = ${__jojpopInitAllCondition.__jokvpopSetDevAlert} ${br} ${sp5} .__jokvpopsubnameSiteHead = ${__jojpopInitAllCondition.__jokvpopsubnameSiteHead} ` ; // // baseUrl= http://127.0.0.1 msgAllDiv=xmsg.replace(/&space;/g," "); xmsg=xmsg.replace(/&space;/g," "); xmsg=xmsg.replace(//g," "); //xmsg=xmsg.replace(/&space;/g," "); //xmsg=popreplaceall(xmsg,`\n`,``); //xmsg=popreplaceall(xmsg,`\ \;`,` `); //xmsg=popreplaceall(xmsg,`&;`,``); //popreplaceall=function(text,src,dest) msgAll+=xmsg; //xmsg=`__popbaseUrl= ${__popbaseUrl}${br} __poplocalhost= ${__poplocalhost}` popjsdevAlert(xmsg,popactionpage);//`div`); } //var __popdirname=``; //__popBarTop=`possible function`; } //===== function getButtonsCmdLSallIHM(idname,fct,text,textarea){ if(!textarea)textarea="textarea"; let msg=`
`; msg+=``; msg+=``; msg+=``; msg+=`
`; document.open();document.write(msg);document.close(); } //===== function getInformationIHMFilename(infos,filename,id,filesize){//copyright){// for popmodal display=(infos?`block`:`none`); if(!id)id=null; //copyright=`@copyright`; let hr=`
`;//
`; let hrEnd=``;//`
`; let i=`
${filename} | ${filesize}
`; //document.open();//document.write(p_page);document.close(); let msg=hr;//`
`; msg+=i;//`
${copyright}
`; msg+=`${hrEnd}`;//
`; return({hr:hr,i:i,msg:msg}); //document.open();document.write(msg);document.close(); }; //===== function getInformationIHMCopyright(infos,copyright){// for popmodal display=(infos?`block`:`none`); copyright=`@copyright`; let hr=`
`;//
`; let hrEnd=``;//`
`; let i=`
${copyright}  
`; //document.open();//document.write(p_page);document.close(); let msg=hr;//`
`; msg+=i;//`
${copyright}
`; msg+=`${hrEnd}`;//
`; return({hr:hr,i:i,msg:msg}); //document.open();document.write(msg);document.close(); }; //===== function getInformationIHM(infos,copyright){// for popmodal display=(infos?`block`:`none`); copyright=`@copyright`; //document.open();//document.write(p_page);document.close(); let msg=`
`; ///let msg=`
`; //msg+=`
`; msg+=`
les informations now
`; msg+=`
les informations développement
`; msg+=`
les informations locales
`; msg+=`
les informations nationales
`; msg+=`
les informations internationales
`; msg+=`
les informations outils ?
`; let x=getInformationIHMCopyright(infos,copyright); msg+=x.msg; //msg+=`
${copyright}
`; msg+=`
`; document.open();document.write(msg);document.close(); }; //======================== function popjsAjaxJson(arr0,ARR0,arr1,ARR1,arr2,ARR2){// arr0,ARR0,arr1,ARR1,arr2,ARR2 //==== let paramsThis,paramsForm,paramsString,paramsAjaxphp; if(!arr0){ xmsg=`Error= arr0 to ajax`;$jigpopLine=293;if(1)popjsdevAlert(xmsg,`Error`); } paramsThis=ARR0[0];paramsForm=ARR0[1];paramsString=ARR0[2];paramsAjaxphp=ARR0[3]; //==== xmsg=`\n paramsAjaxphp= `+paramsAjaxphp; $jigpopLine=298;if(1)popjsdevAlert(xmsg); //==== let formData=xhr=``; /* //!\warning: inutile et problème formdata avec ActiveXObject if(window.XMLHttpRequest) xhr = new XMLHttpRequest(); else xhr = new ActiveXObject(Microsoft.XMLHTTP); */ if(paramsForm) xhr=new XMLHttpRequest(paramsForm); else{ formData=new FormData(); for(let i=0;i