[f9f08d2] | 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 | //________________________________________________________________________________________________________ |
---|
[1c74bf5] | 11 | // Se utiliza en los botones in y out de las columnas |
---|
| 12 | // Permite mover los equipos seleccionados desde una columna a otra |
---|
[f9f08d2] | 13 | function move(fbox, tbox) { |
---|
| 14 | var arrFbox = new Array(); |
---|
| 15 | var arrTbox = new Array(); |
---|
| 16 | var arrLookup = new Array(); |
---|
| 17 | var i; |
---|
| 18 | for (i = 0; i < tbox.options.length; i++) { |
---|
| 19 | arrLookup[tbox.options[i].text] = tbox.options[i].value; |
---|
| 20 | arrTbox[i] = tbox.options[i].text; |
---|
| 21 | } |
---|
| 22 | var fLength = 0; |
---|
| 23 | var tLength = arrTbox.length; |
---|
| 24 | for(i = 0; i < fbox.options.length; i++) { |
---|
| 25 | arrLookup[fbox.options[i].text] = fbox.options[i].value; |
---|
| 26 | if (fbox.options[i].selected && fbox.options[i].value != "") { |
---|
| 27 | arrTbox[tLength] = fbox.options[i].text; |
---|
| 28 | tLength++; |
---|
| 29 | } |
---|
| 30 | else { |
---|
| 31 | arrFbox[fLength] = fbox.options[i].text; |
---|
| 32 | fLength++; |
---|
| 33 | } |
---|
| 34 | } |
---|
| 35 | arrFbox.sort(); |
---|
| 36 | arrTbox.sort(); |
---|
| 37 | fbox.length = 0; |
---|
| 38 | tbox.length = 0; |
---|
| 39 | var c; |
---|
| 40 | |
---|
| 41 | for(c = 0; c < arrFbox.length; c++) { |
---|
| 42 | var no = new Option(); |
---|
| 43 | no.value = arrLookup[arrFbox[c]]; |
---|
| 44 | no.text = arrFbox[c]; |
---|
| 45 | fbox[c] = no; |
---|
| 46 | } |
---|
| 47 | |
---|
| 48 | for(c = 0; c < arrTbox.length; c++) { |
---|
| 49 | var no = new Option(); |
---|
| 50 | no.value = arrLookup[arrTbox[c]]; |
---|
| 51 | no.text = arrTbox[c]; |
---|
| 52 | tbox[c] = no; |
---|
| 53 | } |
---|
| 54 | } |
---|
[1c74bf5] | 55 | // Se utiliza al enviar el formulario |
---|
| 56 | // Asigna como valor del campo listOfItems un listado |
---|
| 57 | // con las correspodendencias nombre plantilla - nombre equipo. |
---|
[831de70] | 58 | // Version 1.1.1 - Se identifica plantilla y equipo como necesita la función createBootMode (#802 #888) |
---|
[f9f08d2] | 59 | function allSelect() |
---|
| 60 | { |
---|
[1c74bf5] | 61 | var saveString = ""; |
---|
| 62 | // seleccionamos cada uno de los select |
---|
| 63 | var input = document.getElementsByTagName('select'); |
---|
| 64 | |
---|
| 65 | for(var i=0; i<input.length; i++){ |
---|
[831de70] | 66 | // quitamos L inicial |
---|
| 67 | patron = "L"; |
---|
| 68 | parm = input[i].name; |
---|
| 69 | parm = parm.replace(patron,''); |
---|
[1c74bf5] | 70 | |
---|
[831de70] | 71 | for (j=0;j<input[i].length;j++) { |
---|
[3aadac3b] | 72 | saveString = saveString + parm + '|' + input[i].options[j].value + ';'; |
---|
[831de70] | 73 | } |
---|
[1c74bf5] | 74 | } |
---|
[ee0a327] | 75 | document.forms[0].listOfItems.value = saveString; |
---|
[f9f08d2] | 76 | } |
---|