Wed, 31 Dec 2014 07:16:47 +0100
Revert simplistic fix pending revisit of Mozilla integration attempt.
1 <html>
2 <head>
3 <script type="text/javascript">
4 var NumLine = 0
6 function maj(IDLine)
7 {
9 var newtr = document.createElement("tr")
10 newtr.setAttribute("id","tr"+IDLine)
13 var newtdselect = document.createElement("td")
14 var newselect = document.createElement("select")
15 newselect.setAttribute("id","HypothRank_"+IDLine)
16 newselect.setAttribute("name","HypothRank_"+IDLine)
18 for (i=1;i<=IDLine;i++)
19 {
21 var newoption = document.createElement("option")
22 newoption.setAttribute("id",i)
23 newoption.setAttribute("class","classoption1")
24 if (i == IDLine)
25 {
26 newoption.setAttribute("selected","selected")
27 }
28 var newtxt = document.createTextNode(i)
29 newoption.appendChild(newtxt)
31 newselect.appendChild(newoption)
32 }
34 if (i>2)
35 {
36 for (j=1;j<=i-2;j++)
37 {
38 var newoption = document.createElement("option")
39 newoption.setAttribute("class","classoption1")
40 newoption.setAttribute("id",IDLine)
41 var newtxt = document.createTextNode(i-1)
42 newoption.appendChild(newtxt)
43 document.getElementById("HypothRank_"+j).appendChild(newoption)
44 }
45 }
47 newtdselect.appendChild(newselect)
48 newtr.appendChild(newtdselect)
50 document.getElementById('letbody').appendChild(newtr)
52 NumLine++
53 }
57 function DeleteLine(IDLine)
58 {
59 for (i=1;i<=NumLine;i++)
61 {
62 if (i != IDLine)
63 {
64 noeud = document.getElementById("HypothRank_"+i)[IDLine-1]
65 document.getElementById("HypothRank_"+i).removeChild(noeud)
66 for (j=0;j<=NumLine-2;j++)
67 {
68 noeud = document.getElementById("HypothRank_"+i)[j]
70 k=j+1
71 noeud.setAttribute("id",k)
73 if (k == NumLine)
74 {
75 noeud.setAttribute("selected","selected")
76 }
77 depart = 0
78 taille = noeud.firstChild.nodeValue.length
79 document.getElementById("HypothRank_"+i)[j].firstChild.replaceData(depart,taille,j+1)
80 }
81 }
82 }
85 noeud = document.getElementById('tr'+IDLine)
86 document.getElementById('letbody').removeChild(noeud)
88 NumLine--
90 for (i=IDLine;i<=NumLine;i++)
91 {
92 k=i+1
93 noeud = document.getElementById("tr"+k)
94 noeud.setAttribute("id","tr"+i)
96 noeud = document.getElementById("HypothRank_"+k)
97 noeud.setAttribute("id","HypothRank_"+i)
98 noeud.setAttribute("name","HypothRank_"+i)
100 noeud = document.getElementById("Hypoth_"+k)
101 noeud.setAttribute("name","Hypoth_"+i)
102 noeud.setAttribute("id","Hypoth_"+i)
103 }
106 }
108 </script>
109 </head>
111 <body>
112 <form>
113 <table border="1" id="latable">
114 <thead></thead>
115 <tfoot></tfoot>
116 <tbody id="letbody"></tbody>
117 </table>
118 </form>
120 <script>
121 document.body.offsetWidth;
122 maj(NumLine+1);
123 document.body.offsetWidth;
124 maj(NumLine+1);
125 document.body.offsetWidth;
126 </script>
128 </body>
129 </html>