// JavaScript Document // Si vous êtes dans le fichier 'file.js' //var indexJs,isTest,xline; var $jssliCpopPVx='/iC/pop/+/V0';//!\code:wait: C:\iC\pop\+\V0\imgs/config-system.jpg // ../../iC/pop/+/V0/cfgSite // C:\w3\popSchools\index.js //var indexJs='/w3/wwwSite/index.js',isTest=x=0,xline=``;// if(0&&(isTest||isLocal))alert( var indexJs=`\/w3\/wwwSite\/index.js`,isTest=0,xline=``;// if(0&&(isTest||isLocal))alert( var isLocal=(window.location.hostname==='localhost'||window.location.hostname==='127.0.0.1'?1:0); //x=0;// sinon il est possible sur le serveur de mettre x=1 pour des tests quand même var isTest=(isLocal?1:0); var tabber7pt=true; //============================= var scriptUrl=document.currentScript.src; // récupère l'URL complète du script http://127.0.0.1/w3/popSchools/index.js xx=scriptUrl.split('/');// xx= w3,popSchools var scriptBasename=xx[xx.length-1];// scriptBasename= index.js var url=new URL(scriptUrl);// http://127.0.0.1/w3/popSchools/index.js var path=url.pathname; // par exemple '/www/monsite/file.js' /w3/popSchools/index.js var __popbaseUrl=window.parent.location.origin;// http://127.0.0.1 if(0)alert('scriptUrl= '+scriptUrl+' - url= '+url+' - path= '+path+' - __popbaseUrl= '+__popbaseUrl +' - scriptBasename= '+scriptBasename); //scriptUrl= http://127.0.0.1/w3/popSchools/index.js //- url= http://127.0.0.1/w3/popSchools/index.js //- path= /w3/popSchools/index.js //- __popbaseUrl= http://127.0.0.1 // - scriptBasename= index.js //============================= // Pour obtenir le répertoire 'www/monsite/' // affiche __popsitename= w3/systemboost.immobilier isLocal= true var __popsitenamedir=path.substring(1, path.lastIndexOf('/')); xx=__popsitenamedir.split('/');// xx= w3,popSchools var __popsitename=xx[xx.length-1];// __popsitename= popSchools xx="../".repeat(xx.length); var __popsitenamepoints=xx.substring(0, xx.lastIndexOf('/'));// __popsitenamepoints= ../.. //alert('__popsitenamepoints= '+__popsitenamepoints); //===== var __popsitenamepoints=xx.substring(0, xx.lastIndexOf('/'));// __popsitenamepoints= ../.. var indexJsParams={}; //===== chemin du site indexJsParams.$popsitename=__popsitename; indexJsParams.$popbaseUrl=__popbaseUrl;// http://127.0.0.1 indexJsParams.$path=path;// /w3/??????/index.js indexJsParams.$scriptBasename=scriptBasename;// index.js indexJsParams.$popsitenamedir=__popsitenamedir;// /w3/?????? indexJsParams.$popsitenamepoints=__popsitenamepoints;// ../.. indexJsParams.$popSiteTitle=document.title;// ,popSchools //===== NavigatorOnLine indexJsParams.$popNavigatorOnLine=parseInt(navigator.onLine);// false/true 0/1 //===== screen indexJsParams.$wScreenWidth=window.screen.width; indexJsParams.$wScreenHeight=window.screen.height; indexJsParams.$wScreenMobile=(window.screen.widthwindow.screen.height?'land':'paper');// Desktop horizontal ou vertical (ex:journal) //===== lang indexJsParams.$popSiteLang=`fr-FR`; //===== //Object.entries(indexJsParams)= $popsitename,popSchools,$popbaseUrl,http://127.0.0.1,$path //,/w3/popSchools/index.js,$scriptBasename,index.js,$popsitenamedir,w3/popSchools ///,$popsitenamepoints,../..,$popSiteTitle,popSchools //,$wScreenWidth,1440,$wScreenHeight,900,$wScreenMobile,land,$wScreenDesktop,land //,$popSiteLang,fr-FR //============================== var __popfile,__popparams,__popjs,msgAll,msgAllDiv; //============================= //var __jojpopInitAllCondition=1; var __popBarTop=indexJsParams.$popSiteTitle; var __popLang=indexJsParams.$popSiteLang;// fr-FR if(0){ alert(77777); alert('Object.entries(indexJsParams)= '+Object.entries(indexJsParams)); } //===== var __poplocalhost=isLocal; var __popdirname=__popsitenamedir; var __popsitename2points=__popsitenamepoints; //============================== function popEvalFileJsScriptVAL(value){ if(0&&(isTest||isLocal))alert('value= '+value); try{xline+='/51'; let x=value;//`popJsPhpValScript`; let y=(window.parent[x]?1:0); //y=0;if(window.parent.popJsPhpValScript)y=1; if(!y)alert(`Script [${window.parent[x]}] <- [${x}] JS is not OK !`); }catch(e){alert("catch(e): "+e+" - "+xline+" - "+indexJs);}; } //============================== function popStartScriptJSparams(id){// `indexJs` try{xline+='/60'; let scriptTag = document.getElementById(id); if(0&&(isTest||isLocal))alert('scriptTag.id= '+scriptTag.id); if(scriptTag) { // Obtenir l'attribut src let src = scriptTag.getAttribute('src'); // Le src de la balise script upload.js est :/ic-functions/plugins/upload-/base/upload.js let x=src.split('/'); let __filename=x[x.length-1]; x=src.split('/'+__filename); let __dirname=x[0]; // __dirname __filename __subPoints x=__dirname.split('/'); let __subPoints=x.length-1; // .replace('//', '/') __subPoints=('../'.repeat(__subPoints)+'/').replace('//', ''); // var isLOCALHOST=jsStartSite.isLOCALHOST; // alert('Le src de la balise script upload.js est :'+ src+' - __filename= '+ __filename); if(0&&(isTest||isLocal))alert('Le src de la balise script upload.js est :'+ src+' - __dirname= '+ __dirname+' - __filename= '+ __filename+' - __subPoints= '+ __subPoints); //Le src de la balise script upload.js est :/ic-functions/plugins/upload-/base/upload.js - __dirname= /ic-functions/plugins/upload-/base - __filename= upload.js return({__dirname:__dirname,__filename:__filename,__subPoints:__subPoints,__idjs:id}); } }catch(e){alert("catch(e): "+e+" - "+xline+" - "+id);}; }//end:function popStartScriptJSparams(id){ //==============================