1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
|
function plus() {
c=document.getElementById("div_form");
// CREATION D'UNE SECTION EN PLUS
cdiv=document.createElement("div");
cdiv.setAttribute("class","un_lien");
c.appendChild(cdiv);
cspan = document.createElement("span");
cspan.setAttribute("class","s_ajout");
cdiv.appendChild(cspan);
cspan.innerHTML = "Titre de l'épisode:";
c2=c.getElementsByTagName("input");
ch=document.createElement("input");
if(((c2.length/4)+1) < 10) {
if(pair(c2.length)) {
curval = "00"+((c2.length/4)+1);
} else {
curval = "00"+((c2.length)/4);
}
} else {
if(c2.length < 100) {
if(pair(c2.length)) {
curval = "0"+((c2.length/4)+1);
} else {
curval = "0"+(c2.length/4);
}
}
}
// TITRE
ch.setAttribute("type","text");
ch.setAttribute("name","titreep"+curval);
ch.setAttribute("class","i_ajout");
ch.setAttribute("value","Episode "+curval);
cdiv.appendChild(ch);
// LIEN
cspan2 = document.createElement("span");
cspan2.setAttribute("class","s_ajout");
cdiv.appendChild(cspan2);
cspan2.innerHTML = "Lien:";
ch2=document.createElement("input");
ch2.setAttribute("type","text");
ch2.setAttribute("name","lienep"+curval);
ch2.setAttribute("class","i_ajout");
ch2.setAttribute("value","");
cdiv.appendChild(ch2);
// LIEN ALTERNATIF
cspan2 = document.createElement("span");
cspan2.setAttribute("class","s_ajout");
cdiv.appendChild(cspan2);
cspan2.innerHTML = "Lien alternatif:";
ch2=document.createElement("input");
ch2.setAttribute("type","text");
ch2.setAttribute("name","lienep"+curval);
ch2.setAttribute("class","i_ajout");
ch2.setAttribute("value","");
cdiv.appendChild(ch2);
// TAILLE
cspan2 = document.createElement("span");
cspan2.setAttribute("class","s_ajout");
cdiv.appendChild(cspan2);
cspan2.innerHTML = "Taille:";
ch2=document.createElement("input");
ch2.setAttribute("type","text");
ch2.setAttribute("name","lienep"+curval);
ch2.setAttribute("class","i_ajout");
ch2.setAttribute("value","");
cdiv.appendChild(ch2);
document.getElementById("sup").style.display="inline";
}
function moins(b){
c=document.getElementById("div_form");
cl=c.getElementsByTagName("div");
if(!cl[1]){
b.style.display="none";
}
if(cl[0]){
c.removeChild(cl[cl.length-1]);
}
} |
Partager