1 | // ************************************************************************************************************************************************* |
---|
2 | // Libreria de scripts de Javascript |
---|
3 | // Autor: Alberto García Padilla (Universidad de Málaga) |
---|
4 | // Fecha Creación: 2012 |
---|
5 | // Fecha Última modificación: Mayo-2012 |
---|
6 | // Nombre del fichero: boot_grub4dos.js |
---|
7 | // Descripción : |
---|
8 | // Este fichero implementa las funciones javascript del fichero boot_grub4dos.php |
---|
9 | // ************************************************************************************************************************************************* |
---|
10 | //________________________________________________________________________________________________________ |
---|
11 | function move(fbox, tbox) { |
---|
12 | var arrFbox = new Array(); |
---|
13 | var arrTbox = new Array(); |
---|
14 | var arrLookup = new Array(); |
---|
15 | var i; |
---|
16 | for (i = 0; i < tbox.options.length; i++) { |
---|
17 | arrLookup[tbox.options[i].text] = tbox.options[i].value; |
---|
18 | arrTbox[i] = tbox.options[i].text; |
---|
19 | } |
---|
20 | var fLength = 0; |
---|
21 | var tLength = arrTbox.length; |
---|
22 | for(i = 0; i < fbox.options.length; i++) { |
---|
23 | arrLookup[fbox.options[i].text] = fbox.options[i].value; |
---|
24 | if (fbox.options[i].selected && fbox.options[i].value != "") { |
---|
25 | arrTbox[tLength] = fbox.options[i].text; |
---|
26 | tLength++; |
---|
27 | } |
---|
28 | else { |
---|
29 | arrFbox[fLength] = fbox.options[i].text; |
---|
30 | fLength++; |
---|
31 | } |
---|
32 | } |
---|
33 | arrFbox.sort(); |
---|
34 | arrTbox.sort(); |
---|
35 | fbox.length = 0; |
---|
36 | tbox.length = 0; |
---|
37 | var c; |
---|
38 | |
---|
39 | for(c = 0; c < arrFbox.length; c++) { |
---|
40 | var no = new Option(); |
---|
41 | no.value = arrLookup[arrFbox[c]]; |
---|
42 | no.text = arrFbox[c]; |
---|
43 | fbox[c] = no; |
---|
44 | } |
---|
45 | |
---|
46 | for(c = 0; c < arrTbox.length; c++) { |
---|
47 | var no = new Option(); |
---|
48 | no.value = arrLookup[arrTbox[c]]; |
---|
49 | no.text = arrTbox[c]; |
---|
50 | tbox[c] = no; |
---|
51 | } |
---|
52 | } |
---|
53 | |
---|
54 | function allSelect() |
---|
55 | { |
---|
56 | var saveString = ""; |
---|
57 | // seleccionamos cada uno de los select |
---|
58 | var input = document.getElementsByTagName('select'); |
---|
59 | //alert(input.length); |
---|
60 | for(var i=0; i<input.length; i++){ |
---|
61 | //if(inputs[i].getAttribute('type')=='button'){ |
---|
62 | // your statements |
---|
63 | patron = "L"; |
---|
64 | parm = input[i].name; |
---|
65 | //alert(parm); |
---|
66 | parm = parm.replace(patron,''); |
---|
67 | //alert(parm); |
---|
68 | for (j=0;j<input[i].length;j++) |
---|
69 | { |
---|
70 | //List.options[i].selected = true; |
---|
71 | saveString = saveString + parm + '|' + input[i].options[j].value + ';'; |
---|
72 | //alert(saveString); |
---|
73 | } |
---|
74 | } |
---|
75 | document.forms['myForm'].listOfItems.value = saveString; |
---|
76 | } |
---|