`);// voile opaque
// middle conteneur avant modal-container mais si 'none' enlève la protection translucide'
document.write(`
`);
//document.close();
//=====
//if(!dir)let dir=`../resources/images`;
// {whatType:whatType,dir:dir,title:title}
//isparent=(window.parent.getPopModalOfBarTop);params={whatType:null,dir:`./resources/images`,title:`gridimages`};
//document.write(isparent?getPopModalOfBarTop(params):parent.getPopModalOfBarTop(params));
if(window.parent.getPopModalOfBarTop)document.write(window.parent.getPopModalOfBarTop(params));
//=====
infos=1; // donc les informations apparaissent en bas sinon elles sont cachées
//height=(infos?`80%`:`95.4%`);
height=(infos?`50%`:`50%`);
//height=(infos?`50%`:`20%`);
//document.write(`
`);
//document.write(`
`);
//document.open();//document.write(p_page);document.close();
//document.write(`
`);
document.write(`
`);
//document.write(`content maintenant`);
//x=`< ? php echo $ p_page; ? >`;
//document.write("
Out with the old, in with the new! ");
//==============
//============== start grid image à partir de php
//==============
document.write(p_page);p_page=null;
//==============
//============== endt grid image à partir de php
//==============
document.write(``);
//
//display=(infos?`block`:`none`);// les informations
if(0&&window.getInformationIHM)getInformationIHM(infos);//!\warning:suppression d'infos mais peut être faut-il pouvoir informer le développement
//document.open();//document.write(p_page);document.close();
document.write(`
`);
//document.write(`
`);
document.close();
}
function getIHMofPanelGridImagesFileInput(){
xfileInput = document.getElementById("xfileInput");//xfileInput.value = '';
xline=57;if(0)alert("line "+xline+" \n xfileInput= "+xfileInput);
if(xfileInput){
xfileInput.onchange = function(e) {
imgZoom=document.getElementById("imageWithZoom");
var files = this.files;
// var html = [];
tfiles=this.files;
// iterate over all files
for(var file of files) {
// https://www.developpez.net/forums/d1252865/javascript/general-javascript/recuperer-vrai-path-d-input-file-js/
reader = new FileReader();
reader.readAsDataURL(file);
path = (window.URL || window.webkitURL).createObjectURL(file);
//https://www.edureka.co/community/71993/selected-change-input-type-file-using-javascript-jquery-ajax
//var tmppath = URL.createObjectURL(event.target.files[0]);
var tmppath = URL.createObjectURL(file);
xline=69;if(1)alert("line "+xline+" \n reader= "+Object.entries(reader)+" \n path= "+path
+" \n file.mozFullPath= "+file.mozFullPath+" \n tmppath= "+tmppath
);
x=file.type.split(`image/`);
if(!x[1]){
alert(file.name+` `+`n est pas une image`);return;
}
//myTable = tableBody.getElementsByTagName("table")[0];
//myTableBody = tableBody.getElementsByTagName("tbody")[0];
//myRow = myTableBody.getElementsByTagName("tr")[1];
//myCell = myRow.getElementsByTagName("td")[1];
// numimagesDir++;// tableBody.rows
// xnum=tableBody.rows.length;
// xnum=myTableBody.rows;
// rows = table.getElementsByTagName('tbody')[0].rows;
// rows = table.getElementsByTagName('tbody')[0].rows;
// properties=jsMinElementHTML.GetId(`NbrFiles`);
// selectedIndex=properties.selectedIndex;//=3;
//selectedIndex=document.getElementById(`NbrFiles`).selectedIndex;
// w=document.getElementById(`NbrFiles`).options[properties.selectedIndex].value;
if(0&&xnum){
w=properties.element.value;
alert(`xnum= `+xnum+`\n w= `+w);//[0]);Object.entries(xnum));//[0]);
/*
// if(parseInt(w)>=3){alert(`Le nombre d\`images ne doit pas dépasser à `+xnum);return;}
if(0&&xnum&&xnum>=3){
//
l=document.getElementById(`labelxfileInput`).setAttribute(`onclick`,`return(false);`);
document.getElementById(`ixfileInput`).style.display=`inline`;
alert(`Le nombre d\`images ne doit pas dépasser à `+xnum);return;
}
*/
}
// alert("Object.entries(this.files)= "+Object.entries(this.files)
// +"\n"+"file= "+file);
if (file) {
if (file.size <= 200000)
success="OK";//console.log("OK");
else
success="TOO";//console.log("Limit Exceeded!");
}
// generate row markup for each file
// https://jsnoteclub.com/blog/how-to-iterate-table-rows-in-javascript/
// https://www.softline.fr/foreach-js/
// https://www.softline.fr/christina-stathopoulos-plongez-dans-le-sql-pour-les-non-programmeurs/
//https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableRowElement/rowIndex
// html.push(`${file.name} ${file.type} ${file.size} ${success} `);
//row=tableBody.row;
ttrnbrrow++;//row.rowIndex
html.push(`${ttrnbrrow}
${file.name}
${file.type}
${file.size}
${success}
`);
// C:\w3\popDev IT\resources\images
//image/jpg image/png image/svg+xml , text/css
// y=imagesDir+`/`+file.name;z=`photos`+`/`+`case`+`1`;
// zz=path.split(`blob:`);// blob:http://127.0.0.1/69b786ab-c190-4cd5-a6d4-743b3be267c6/fixedmichelbj.jpg
// y=zz[1]+`/`+file.name;z=`photos`+`/`+`case`+`1`;
// y=tmppath+`/`+file.name;z=`photos`+`/`+`case`+`1`;
y=tmppath;z=`photos`+`/`+`case`+`1`;
imagesMultiple.innerHTML+=` photos ${ttrnbrrow} `;
// imagesMultiple.innerHTML+=` photos `+ttrnbrrow+` `;
}
// finally create all table rows
// and add them the tbody element
tableBody.innerHTML = '' + html.join(' ') + ' ';
DisplayDataOpen(0);
autoriseImagesSearch();//xnum);//,selectedIndex);
/*
if(xnum&&xnum+1>=3){
//
l=document.getElementById(`labelxfileInput`);
l.setAttribute(`onclick`,`return(false);`);
s=document.getElementById(`spanxfileInput`);
s.style.display=`none`;
i=document.getElementById(`ixfileInput`);
i.style.display=`inline`;
i.innerHTML=`Le nombre d\`images ne doit pas dépasser à `+(selectedIndex+1); //
// i.innerHTML=``Le nombre d\`images ne doit pas dépasser à `+(xnum+1)`; // selectedIndex
// alert(`Le nombre d\`images ne doit pas dépasser à `+(xnum+1));
// return;
}
*/
};
xfileInput.style.backgroundColor='yellow';
spanxfileInput = document.getElementById("spanxfileInput");
spanxfileInput.style.width='20px';
tableBody = document.getElementById("desc");
imagesMultiple = document.getElementById("imagesMultiple");
imagesDir=js$Obj$KV$FS$FilesOfSite.imagesDir;//`../../../atelier/steganography-main`;
if(1)alert('imagesDir= '+imagesDir);
numimagesDir=numimagesDirDel=-1;
html = [];
// var imvDiv = [];
tfiles;
ttrnbrrow=0;
distantDIRS={
case1:`distantDIRS/systemboost.entreprise/photos/case1`
};
distantDIRS.case2=distantDIRS.case1;
distantDIRS.case3=distantDIRS.case1;
distantDIRS.case4=distantDIRS.case1;
distantDIRS={
case1:`/localDIRS/namesite/photos/case1`
};
distantDIRS.case2=distantDIRS.case1;
distantDIRS.case3=distantDIRS.case1;
distantDIRS.case4=distantDIRS.case1;
GridOfImages={// GridOfImages.PlugFctDisplayDatas , ridOfImages.PlugFctPostDatas
PlugFctDisplayDatas:window.DisplayDataOpen
,PlugFctPostDatas:window.sendDataOpen
};
} else {index=2;if(0)alertError('No change for uploads',index);};
};
//================================
function fctjs_popupModal_OpenOrClose(gjs_popup,what){
//alert(`line 863 what= `+what);
if(gjs_popup&&what){
if(what==`close`)
x=`none`;
else
if(what==`open`)
x=`block`;
else
x=(what==`none`?`block`:`none`);
gjs_popup.style.display=x;// pour afficher la première fois
}
//force
///gjs_popupModal.style.display=`block`;
};
//================================
function xxxgetInformationIHM(infos){// for popmodal
display=(infos?`block`:`none`);
document.open();//document.write(p_page);document.close();
document.write(``);
document.write(`
les informations now (hier-today-demain-après) avec accordéon de configuration
`);
document.write(`
les informations développement (site, autres) avec accordéon de configuration etc...
`);
document.write(`
les informations locales
`);
document.write(`
les informations nationales
`);
document.write(`
les informations internationales
`);
document.write(`
les informations outils ?
`);
document.write(`
`);
document.close();
};
if(0){
var xfileInput = document.getElementById("xfileInput");//xfileInput.value = '';
xline=235;if(0)alert("line "+xline+" \n xfileInput= "+xfileInput);
if(xfileInput){
xfileInput.onchange = function(e) {
var files = this.files;
// var html = [];
tfiles=this.files;
// iterate over all files
for (var file of files) {
x=file.type.split(`image/`);
if(!x[1]){
alert(file.name+` `+`n est pas une image`);return;
}
//myTable = tableBody.getElementsByTagName("table")[0];
//myTableBody = tableBody.getElementsByTagName("tbody")[0];
//myRow = myTableBody.getElementsByTagName("tr")[1];
//myCell = myRow.getElementsByTagName("td")[1];
// numimagesDir++;// tableBody.rows
// xnum=tableBody.rows.length;
// xnum=myTableBody.rows;
// rows = table.getElementsByTagName('tbody')[0].rows;
// rows = table.getElementsByTagName('tbody')[0].rows;
// properties=jsMinElementHTML.GetId(`NbrFiles`);
// selectedIndex=properties.selectedIndex;//=3;
//selectedIndex=document.getElementById(`NbrFiles`).selectedIndex;
// w=document.getElementById(`NbrFiles`).options[properties.selectedIndex].value;
if(0&&xnum){
w=properties.element.value;
alert(`xnum= `+xnum+`\n w= `+w);//[0]);Object.entries(xnum));//[0]);
/*
// if(parseInt(w)>=3){alert(`Le nombre d\`images ne doit pas dépasser à `+xnum);return;}
if(0&&xnum&&xnum>=3){
//
l=document.getElementById(`labelxfileInput`).setAttribute(`onclick`,`return(false);`);
document.getElementById(`ixfileInput`).style.display=`inline`;
alert(`Le nombre d\`images ne doit pas dépasser à `+xnum);return;
}
*/
}
// alert("Object.entries(this.files)= "+Object.entries(this.files)
// +"\n"+"file= "+file);
if (file) {
if (file.size <= 200000)
success="OK";//console.log("OK");
else
success="TOO";//console.log("Limit Exceeded!");
}
// generate row markup for each file
// https://jsnoteclub.com/blog/how-to-iterate-table-rows-in-javascript/
// https://www.softline.fr/foreach-js/
// https://www.softline.fr/christina-stathopoulos-plongez-dans-le-sql-pour-les-non-programmeurs/
//https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableRowElement/rowIndex
// html.push(`${file.name} ${file.type} ${file.size} ${success} `);
//row=tableBody.row;
ttrnbrrow++;//row.rowIndex
html.push(`${ttrnbrrow}
${file.name}
${file.type}
${file.size}
${success}
`);
// C:\w3\popDev IT\resources\images
//image/jpg image/png image/svg+xml , text/css
y=imagesDir+`/`+file.name;z=`photos`+`/`+`case`+`1`;
imagesMultiple.innerHTML+=` photos `+ttrnbrrow+` `;
}
// finally create all table rows
// and add them the tbody element
tableBody.innerHTML = '' + html.join(' ') + ' ';
DisplayDataOpen(0);
autoriseImagesSearch();//xnum);//,selectedIndex);
/*
if(xnum&&xnum+1>=3){
//
l=document.getElementById(`labelxfileInput`);
l.setAttribute(`onclick`,`return(false);`);
s=document.getElementById(`spanxfileInput`);
s.style.display=`none`;
i=document.getElementById(`ixfileInput`);
i.style.display=`inline`;
i.innerHTML=`Le nombre d\`images ne doit pas dépasser à `+(selectedIndex+1); //
// i.innerHTML=``Le nombre d\`images ne doit pas dépasser à `+(xnum+1)`; // selectedIndex
// alert(`Le nombre d\`images ne doit pas dépasser à `+(xnum+1));
// return;
}
*/
};
xfileInput.style.backgroundColor='yellow';
var spanxfileInput = document.getElementById("spanxfileInput");
spanxfileInput.style.width='20px';
var tableBody = document.getElementById("desc");
var imagesMultiple = document.getElementById("imagesMultiple");
var imagesDir=js$Obj$KV$FS$FilesOfSite.imagesDir;// `../../../atelier/steganography-main`;
var numimagesDir=numimagesDirDel=-1;
var html = [];
// var imvDiv = [];
var tfiles;
var ttrnbrrow=0;
var distantDIRS={
case1:`distantDIRS/systemboost.entreprise/photos/case1`
};
distantDIRS.case2=distantDIRS.case1;
distantDIRS.case3=distantDIRS.case1;
distantDIRS.case4=distantDIRS.case1;
distantDIRS={
case1:`/localDIRS/namesite/photos/case1`
};
distantDIRS.case2=distantDIRS.case1;
distantDIRS.case3=distantDIRS.case1;
distantDIRS.case4=distantDIRS.case1;
var GridOfImages={// GridOfImages.PlugFctDisplayDatas , ridOfImages.PlugFctPostDatas
PlugFctDisplayDatas:window.DisplayDataOpen
,PlugFctPostDatas:window.sendDataOpen
};
} else {
index=2;if(0)alertError('No change for uploads',index);
};
};//end
/*
//if(x)x.style.display="none";
//fctjs_popupModal_OpenOrClose(what);
//alert(`line 1006 what= `+what);
if(0){
if(gjs_popupModal&&what){
if(what==`close`)
x=`none`;
else
x=(what==`none`?`block`:`none`);
gjs_popupModal.style.display=x;// pour afficher la première fois
}
}
//force
///gjs_popupModal.style.display=`block`;
*/