//!\doc:file,used:1,src:JS,vXX:v0 /*s+ C:\iC\v0\_systemboost\diaporama-(_systemboost.v0).js.php */ try{ /* https://www.pierre-giraud.com/javascript-apprendre-coder-cours/dom-navigation-deplacement/ https://stackoverflow.com/questions/17049455/javascript-how-do-i-make-a-javascript-image-link-to-a-page https://codepen.io/gloriaJun/pen/JLKpxm/ https://www.zhenghao.io/posts/verify-image-url https://www.daniweb.com/programming/web-development/threads/272711/make-a-javascript-function-image-link-to-a-new-page https://stackoverflow.com/questions/2433185/help-needed-in-javascript-image-href https://stackoverflow.com/questions/6452212/getting-the-href-attribute-of-an-image-with-javascript https://infoforall.fr/js/javascript-act100.html https://yard.onl/sitelycee/cours/js/_Js.html?Miseenpratiqueimages.html https://www.commentcoder.com/html-a-href/ https://jenseign.com/apprendre-html-css/pratique-exemple/survol-sur-image-avec-texte-et-lien/ https://www.xul.fr/ecmascript/image-map.php https://darchevillepatrick.info/js/js10.php#corps https://tutowebdesign.com/dom-javascript.php https://attacomsian.com/blog/javascript-htmlcollection +++ https://itecnote.com/tecnote/javascript-converting-a-object-htmlcollection-into-string-in-javascript/ https://www.codeguage.com/courses/js/html-dom-html-serialization-exercise +++ https://blog.codewise.fr/javascript-manipulation-dom agnès verdier-molinié IFRAP var JSlinksDatas={ "c3": [ //case 3 { "l1": "https:"+"/"+"/"+"agissimo.com" ,"l2": "" ,"l3": "https:"+"/"+"/"+"urbanicite.com" ,"l4": "https:"+"/"+"/"+"systemboost.com" ,"l5": "https:"+"/"+"/"+"systemboost.com" }]}; var JSlinksDatas={ "l1": "https:"+"/"+"/"+"agissimo.com" ,"l2": "" ,"l3": "https:"+"/"+"/"+"urbanicite.com" ,"l4": "https:"+"/"+"/"+"systemboost.com" ,"l5": "https:"+"/"+"/"+"systemboost.com" }; */ var JSlinksDatas=new Array( "https:"+"/"+"/"+"agissimo.com" ,"" ,"https:"+"/"+"/"+"urbanicite.com" ,"https:"+"/"+"/"+"systemboost.com" ,"https:"+"/"+"/"+"systemboost.com" ,"" ,"https:"+"/"+"/"+"systemboost.com" //!\today:22/08/2023 07:35:15:change:6->7 ); //alert("//!\today:22/08/2023 07:35:15:change:6->7"); var nbrVignettes=7; //!\today:22/08/2023 07:35:15:change:6->7 var line=3; var newdiaporama0=0;//1; var diapoInterval0=null; //var stopDiapo=0; var tempoDiapo=5000;//2000 //===== function newaffichage(n) { var i;//,countlast=nbrVignettes+1;//ok 5+1=6 n++;// au démarrage n=0 newdiaporama0=0 //=== if (n > nbrVignettes) {n=1;} if (n <= 0) {n=nbrVignettes+1;}// n=case actual 1,2,3,4,5,6 //=== //=== //id="diapoX" diapoX=document.getElementById("diapoX");if(diapoX)diapoX.innerHTML=n;//ppt; cases=document.getElementById("cases");if(cases)cases.innerHTML=nbrVignettes;//nbrVignettes+1;//filename fileEXT=document.getElementById("fileEXT");if(fileEXT)fileEXT.innerHTML=''; movEXT=document.getElementById("movEXT");if(movEXT)movEXT.innerHTML=''; filename=document.getElementById("filename");if(filename)filename.innerHTML=''; //=== var j=0; for (i=1; i < nbrVignettes; i++) {// nbrVignettes+1; i++) { diapoData=document.getElementById("data-xdiapo"+i); diapoA=document.getElementById("a-xdiapo"+i); diapoImg=document.getElementById("img-xdiapo"+i); // diapoImg.title="title "+i; //img-'.$f_xdiapo.' // "video-'.$f_xdiapo.'" if(diapoData){// datas de hidden 1,2,3,4 files=diapoData.getAttribute("data-xdiapo"+i); if(0){ alert("l 32 \n"+" \n files= "+files);// 1- } i_list=files.split("||"); dir=i_list[0]; //nn=n+1; // if(n==2)alert("l 24 \n dir"+n+"= "+dir+" \n i_list[n]= "+i_list[n]); imgNum=i_list[n].split('=='); numero=imgNum[1]; link3=imgNum[2]; // numero=imgNum[1]; file= dir+"/"+imgNum[0];//i_list[n];//nn]; line=37; extension0=i_list[n].split('.'); extension=extension0[extension0.length-2]; result=displayPlusDocJPG(i,n,extension,extension0,diapoImg,'mov'); if(!result)result=displayPlusDocJPG(i,n,extension,extension0,diapoImg,'pdf'); /* line=35; if(extension=='mov'){ if(0){ alert("l 45 \n dir"+n+"= "+dir+" \n i_list[n]= "+i_list[i] +" \n file= "+file+" \n extension= "+extension +" \n extension0[extension0.length-1]= "+extension0[extension0.length-1] //jpg +" \n extension0[extension0.length-2]= "+extension0[extension0.length-2] // mov );// 1- } mov_video=document.getElementById("mov-video-xdiapo"+i); if(mov_video)mov_video.style.display="inline"; if(extension+extension0[extension0.length-1]=="movjpg") diapoImg.style.display="inline"; else diapoImg.style.display="none"; } else{ mov_video=document.getElementById("mov-video-xdiapo"+n); if(mov_video)mov_video.style.display="none"; diapoImg.style.display="inline"; } */ /// file= dir+"/"+i_list[i];//nn]; 23/06/2023 10:17:52 line=87; if(diapoA)diapoA.href=link3; diapoImg.src=file; //if(i==3){ lx="l"+(numero+1); // diapoImg.parentNode=JSlinksDatas[numero]; // diapoImgParentNode=diapoImg.parentNode;diapoImgParentNodeNodeName=diapoImgParentNode.nodeName; // diapoImg.title=line+" - "+file+" - "+JSlinksDatas[numero]+" \n - parent "+diapoImgParentNode.getElementsByTagName(diapoImgParentNodeNodeName);// .getAttribute('href') .value = "https://www.w3schools.com"; .entries() .setAttribute('href',JSlinksDatas[numero]) "p").setAttribute('href',JSlinksDatas[numero]);// .href=JSlinksDatas[numero] lx;//file;//"title "+i; //img-'.$f_xdiapo.' ["l"+i] // diapoImg.title=line+" - "+file+" - "+JSlinksDatas[numero]+" \n - parent "+diapoImgParentNode.getElementsByTagName(diapoImgParentNodeNodeName).namedItem('href');// .keys() .getNamedItem('href') setAttribute('href',JSlinksDatas[numero]) .getAttribute('href') .value = "https://www.w3schools.com"; .entries() .setAttribute('href',JSlinksDatas[numero]) "p").setAttribute('href',JSlinksDatas[numero]);// .href=JSlinksDatas[numero] lx;//file;//"title "+i; //img-'.$f_xdiapo.' ["l"+i] // diapoImg.title=line+" - "+file+" - "+JSlinksDatas.c3.lx;//file;//"title "+i; //img-'.$f_xdiapo.' ["l"+i] // diapoImg.parentNode.parentNode.nodeName ="DIV" // diapoImg.title=line+" - "+file+" - "+JSlinksDatas[numero]+" \n - parent "+Objects.diapoImg.parentNode.parentNode.getElementsByTagName("div");// .getElementsByTagName("a") .keys() .getNamedItem('href') setAttribute('href',JSlinksDatas[numero]) .getAttribute('href') .value = "https://www.w3schools.com"; .entries() .setAttribute('href',JSlinksDatas[numero]) "p").setAttribute('href',JSlinksDatas[numero]);// .href=JSlinksDatas[numero] lx;//file;//"title "+i; //img-'.$f_xdiapo.' ["l"+i] // diapoImg.title=line+" - "+file+" - "+JSlinksDatas[numero]+" \n - link3: "+link3;// .getElementsByTagName("a") .keys() .getNamedItem('href') setAttribute('href',JSlinksDatas[numero]) .getAttribute('href') .value = "https://www.w3schools.com"; .entries() .setAttribute('href',JSlinksDatas[numero]) "p").setAttribute('href',JSlinksDatas[numero]);// .href=JSlinksDatas[numero] lx;//file;//"title "+i; //img-'.$f_xdiapo.' ["l"+i] diapoImg.title=link3;// .getElementsByTagName("a") .keys() .getNamedItem('href') setAttribute('href',JSlinksDatas[numero]) .getAttribute('href') .value = "https://www.w3schools.com"; .entries() .setAttribute('href',JSlinksDatas[numero]) "p").setAttribute('href',JSlinksDatas[numero]);// .href=JSlinksDatas[numero] lx;//file;//"title "+i; //img-'.$f_xdiapo.' ["l"+i] //} if(0&&i==3){ // parentElement // alert("l 90 \n"+" \n file= "+file+" \n - "+i+" \n - "+files+" \n - parent "+diapoImg.parentNode.nodeName.toLowerCase());// 1- .parentNode .previousSibling .previousElementSibling alert("l 127 \n"+" \n file= "+file+" \n - "+i+" \n - "+files+" \n - parent "+diapoImg.src);// 1- .parentNode .previousSibling .previousElementSibling } }//if(diapoData){ if(0){// stop total // file= dir+"/"+i_list[i];//nn]; extension=i_list[n].split('.'); extension=extension[extension.length-1]; line=42;index=i_list[n].split("."); // extension=index[0];index=index[1]; line=44;diapoImg=document.getElementById("img-xdiapo"+n); nbrImg=1; extensionMOV=index[index.length-2]; mov_video=document.getElementById("mov-video-xdiapo"+i);// data-index="'.$i_index.'" nbrVideo=0; if(mov_video) if(n==mov_video.getAttribute("mov-video-xdiapo"+i)) { mov_video.style.display="none"; // nbrVideo=1; } if(extensionMOV=='mov'){ nbrVideo=1; // if(mov_video&&(nbrImg+nbrVideo==2)){ if(mov_video&&(i==1)&&(n==1)){ movEXT.innerHTML=n+'='+extensionMOV;//extensionMOV='.'+index[index.length-2]; extension=""; mov_video.style.display="inline"; } } extensionMOV=''; fileEXT.innerHTML+=extensionMOV+extension+","; filename.innerHTML=file; diapoImg=document.getElementById("img-xdiapo"+i); /// if(!diapoImg)diapoImg=document.getElementById("video_img-xdiapo"+N); diapoVideo=document.getElementById("video-xdiapo"+i); // data-extension-'.$f_xdiapo.'="'.$extension.'" // diapoExtension=document.getElementById("data-extension-xdiapo"+N); // extension='jpg'; diapoVideoOld=null; // data-array-docs-'.$f_xdiapo.'="'.$docs.'" diapoDocs=diapoData.getAttribute("data-array-docs-xdiapo"+i); /// alert("l 46 \n dir"+n+"= "+dir+" \ndiapoDocs= "+diapoDocs); line=48;index=diapoDocs.split(","); extension=index[0];index=index[1]; if(0&&diapoDocs){// mov,2 // line=49;index=diapoDocs.split(","); // extension=index[0];index=index[1]; switch(extension){ case 'mov': line=54;pos=diapoData.getAttribute("data-two-doc-xdiapo"+i); if(i==2&&pos){ // line=54;pos=diapoData.getAttribute("data-two-doc-xdiapo"+index); // if(i==1&&index==n&&pos){ if(0) alert("l 53 \n dir"+n+"= "+dir+" \n diapoDocs= "+diapoDocs+" \n pos= "+pos); document.getElementById("video-xdiapo"+index).style.display="inline"; document.getElementById("img-xdiapo"+i).style.display="none"; diapoData.setAttribute("data-two-doc-xdiapo"+index,""); } else{ if(document.getElementById("video-xdiapo"+(i-1))) document.getElementById("video-xdiapo"+(i-1)).style.display="none"; // document.getElementById("img-xdiapo"+index).style.display="inline"; document.getElementById("img-xdiapo"+i).style.display="inline"; } break; // setInterval(function(){newdiaporama0=newaffichage(newdiaporama0);},tempoDiapo); line=64;if(0&&index==i){ pos=diapoData.getAttribute("data-two-doc-xdiapo"+index); if(pos){ // data-two-doc-'.$f_xdiapo.'="'.0.'" //setTimeout(function(){displayVideo(index);},100); line=70;setTimeout(function(){displayVideo(index);},100); diapoData.setAttribute("data-two-doc-xdiapo"+index,0); } /// alert("l 46 \n dir"+n+"= "+dir+" \ndiapoDocs= "+diapoDocs); } default: if(document.getElementById("video-xdiapo"+(i-1))) document.getElementById("video-xdiapo"+(i-1)).style.display="none"; // document.getElementById("img-xdiapo"+index).style.display="inline"; document.getElementById("img-xdiapo"+i).style.display="inline"; } } line=79; if(index==n){ if(0)alert("l 75 \n dir"+n+"= "+dir+" \n diapoDocs= "+diapoDocs); // document.getElementById("img-xdiapo"+index).style.display="inline"; // document.getElementById("video-xdiapo"+index).style.display="none"; //diapoData.setAttribute("data-two-doc-xdiapo"+index,""); } // if(diapoVideo)extension=diapoData.getAttribute("data-extension-xdiapo"+N); // else extension='jpg'; (i-1) // image http://127.0.0.1/w3/_systemboost/uploads/welcome/videos/1-CoDesigning%20Or%2021s.mov if(0&&diapoVideo&&n==1) alert("l 39 \ndir"+n+"= "+dir+" \ni_list[n]= "+i_list[n] +" \nextension= "+extension ); if(0) switch(extension){ case 'mov': diapoVideoOld=diapoVideo;// video-'.$f_xdiapo.' break; default: if(diapoVideoOld){ diapoVideoOld=document.getElementById("video-xdiapo1"); diapoVideoOld.style.display="none"; } } } //line=158; diapoImg.src=file; // }//if(diapoData){ // else // alert("l 24 \ndir"+N+"= "+dir+" \ni_list[n]= "+i_list[n]); }//for (i=0; i <= nbrVignettes+1; i++) { return(n); }//function newaffichage(n,diapo) { //===== function xxxnewshowTime(n){ //n++; if(n>nbrVignettes)n=0; n=newaffichage(n); //n++; return(n); } //===== function goInterval(){ //newdiaporama0=newaffichage(newdiaporama0); ///diapoInterval0=setInterval(function(){newdiaporama0=newshowTime(newdiaporama0);},tempoDiapo); diapoInterval0=setInterval(function(){newdiaporama0=newaffichage(newdiaporama0);},tempoDiapo); } //===== function stopInterval(){ var idpointRouge=document.getElementById("idpointRouge"); var idpointImage=document.getElementById("idpointImage"); var idbarreLEFT=document.getElementById("idbarreLEFT"); var idbarreRIGHT=document.getElementById("idbarreRIGHT"); var idclick=(idpointRouge.getAttribute("data-click")==0?1:0);// inversion par idclick //var idclick=(idpointRouge.getAttribute("data-click")==1?0:1);// inversion par idclick idpointRouge.setAttribute("data-click",idclick); //stopDiapo=idclick; var bouton=idpointRouge.innerHTML; var PAUSE="START-STOP"; //alert("line 145 \n bouton : "+bouton+" \n idclick : "+idclick); //if(idclick){ ///alert("bouton : "+bouton); if(bouton==PAUSE){ idbarreLEFT.style.color=idbarreRIGHT.style.color="blue"; clearInterval(diapoInterval0); idpointRouge.innerHTML=PAUSE+'.';//"GO";//"START & GO"; // idpointImage.src="/w3/systemboost/img/play.png"; var image="start.png";//point-rouge-clignotant.gif";//"START & GO"; idpointImage.src=dirUploads+"/"+"uploads"+"/"+image;//"/atelier/modules/thesea/uploads/play.png"; } else { idbarreLEFT.style.color=idbarreRIGHT.style.color="transparent"; idpointRouge.innerHTML=PAUSE;//"START & GO"; // idpointImage.src="/w3/systemboost/img/point-rouge-clignotant.gif"; idpointImage.src=dirUploads+"/"+"uploads"+"/"+"play.gif"; goInterval(); } //} } //===== function xxxdisplayVideo(index){ line=159;alert('index : '+index); } //===== function moveVideo(sens){ clearInterval(diapoInterval0); newdiaporama0=(sens=="previous"?newdiaporama0-1 : newdiaporama0+1);//-1; //newdiaporama0=(sens=="previous"?++newdiaporama0:--newdiaporama0); if (newdiaporama0 > nbrVignettes) {newdiaporama0=1;}// ok /// if (newdiaporama0 < 1) {newdiaporama0=nbrVignettes+1;}// n=case actual 1,2,3,4,5,6 if (newdiaporama0 < 1) {newdiaporama0=nbrVignettes;}// n=case actual 1,2,3,4,5,6 newaffichage(newdiaporama0); goInterval(); } //===== function fct_displayPlusDocJPG(i,n,extension,extension0,diapoImg){ line=253; if(extension=='mov'){//||extension=='pdf'){ if(0){ alert("l 45 \n dir"+n+"= "+dir+" \n i_list[n]= "+i_list[i] +" \n file= "+file+" \n extension= "+extension +" \n extension0[extension0.length-2]= "+extension0[extension0.length-2] // mov +" \n extension0[extension0.length-1]= "+extension0[extension0.length-1] //jpg );// 1- } mov_video=document.getElementById("mov-video-xdiapo"+i); if(mov_video){ mov_video.style.display="inline"; diapoImg.style.display="none"; } extensionTwo=extension+extension0[extension0.length-1]; if(extensionTwo=="movjpg")//||extensionTwo=="pdfjpg") { diapoImg.style.display="none"; } else{ //diapoImg.style.display="inline"; } } else{ mov_video=document.getElementById("mov-video-xdiapo"+n); if(mov_video)mov_video.style.display="none"; diapoImg.style.display="inline"; } } //===== function displayPlusDocJPG(i,n,extension,extension0,diapoImg,doc){ line=253; if(!doc)doc='mov'; //fct_displayPlusDocJPG(i,n,extension,extension0,diapoImg); result=false; ///alert("l 394 \n extension"+n+"= "+extension); if(extension==doc){//'mov'){//||extension=='pdf'){ if(0){ alert("l 45 \n dir"+n+"= "+dir+" \n i_list[n]= "+i_list[i] +" \n file= "+file+" \n extension= "+extension +" \n extension0[extension0.length-2]= "+extension0[extension0.length-2] // mov +" \n extension0[extension0.length-1]= "+extension0[extension0.length-1] //jpg );// 1- } diapoImg.style.display="inline"; mov_video=document.getElementById(doc+"-video-xdiapo"+i);// "mov-video-xdiapo"+i); if(mov_video){ mov_video.style.display="inline"; /// diapoImg.style.display="none"; } extensionTwo=extension+extension0[extension0.length-1]; if(extensionTwo==doc+"jpg"||mov_video)// "movjpg")//||extensionTwo=="pdfjpg") { diapoImg.style.display="none"; } /* else{ //diapoImg.style.display="inline"; } */ result=true; } else{ //mov_video=document.getElementById(doc+"-video-xdiapo"+n);//"mov-video-xdiapo"+n); mov_video=document.getElementById(doc+"-video-xdiapo"+i);//"mov-video-xdiapo"+n); if(mov_video)mov_video.style.display="none"; diapoImg.style.display="inline"; } return(result); } //===== /* function displayPlusDocJPG(i,n,extension,extension0,diapoImg){ line=253; if(extension=='mov'||extension=='pdf'){ if(0){ alert("l 45 \n dir"+n+"= "+dir+" \n i_list[n]= "+i_list[i] +" \n file= "+file+" \n extension= "+extension +" \n extension0[extension0.length-2]= "+extension0[extension0.length-2] // mov +" \n extension0[extension0.length-1]= "+extension0[extension0.length-1] //jpg );// 1- } //=== mov_video=document.getElementById("mov-video-xdiapo"+i); if(mov_video)mov_video.style.display="inline"; pdf_video=document.getElementById("pdf-video-xdiapo"+i); if(pdf_video)pdf_video.style.display="inline"; //=== extensionTwo=extension+extension0[extension0.length-1]; if(extensionTwo=="movjpg") { diapoImg.style.display="inline"; } else { diapoImg.style.display="none"; } mov_video=document.getElementById("mov-video-xdiapo"+n); if(mov_video)mov_video.style.display="none"; diapoImg.style.display="inline"; } else { mov_video=document.getElementById("mov-video-xdiapo"+n); if(mov_video)mov_video.style.display="none"; diapoImg.style.display="inline"; } if(extensionTwo=="movjpg"||extensionTwo=="pdfjpg") {diapoImg.style.display="inline"; pdf_video.style.display="inline"; } else{ diapoImg.style.display="none"; pdf_video.style.display="none"; } } else{ //=== mov_video=document.getElementById("mov-video-xdiapo"+n); if(mov_video)mov_video.style.display="none"; diapoImg.style.display="inline"; //=== pdf_video=document.getElementById("pdf-video-xdiapo"+n); if(pdf_video)pdf_video.style.display="none"; pdf_video.style.display="inline"; //=== } } */ //goInterval(); //newshowTime(0); goInterval(); // ////////////////////////////////////////////////////////// }catch(e){alert('e= '+e+'\n line= '+line);}