[3ec149c] | 1 | // ************************************************************************************************************************************************* |
---|
| 2 | // Libreria de scripts de Javascript |
---|
[3806a31] | 3 | // Autor: Jos� Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla |
---|
| 4 | // Fecha Creaci�n: 2009-2010 |
---|
| 5 | // Fecha �ltima modificaci�n: Noviembre-2005 |
---|
[3ec149c] | 6 | // Nombre del fichero: L_Iconos.js |
---|
[3806a31] | 7 | // Descripci�n : |
---|
[3ec149c] | 8 | // Este fichero implementa las funciones javascript del fichero L_Iconos.php |
---|
| 9 | // ************************************************************************************************************************************************* |
---|
| 10 | // Opciones |
---|
[3806a31] | 11 | var Menu=0; |
---|
| 12 | var Insertar=1; |
---|
| 13 | var Eliminar=2; |
---|
| 14 | var Modificar=3; |
---|
| 15 | var Consultar=4; |
---|
[3ec149c] | 16 | |
---|
| 17 | // Acciones |
---|
[3806a31] | 18 | var Sin_accion=0; |
---|
| 19 | var Insertar_registro=1; |
---|
| 20 | var Borrar_registro=2; |
---|
| 21 | var Modificar_registro=3; |
---|
| 22 | var Leer_registro=4; |
---|
[3ec149c] | 23 | |
---|
| 24 | var currentImg=null; |
---|
| 25 | |
---|
| 26 | var IE=(navigator.appName=="Microsoft Internet Explorer"); |
---|
| 27 | var NS=(navigator.appName=="Netscape"); |
---|
| 28 | //----------------------------------------------------------------------------------------------------- |
---|
| 29 | function consultar(){ |
---|
| 30 | reset_contextual(-1,-1); |
---|
[3806a31] | 31 | id=document.fdatos.identificador.value; |
---|
| 32 | var whref; |
---|
| 33 | whref="M_Iconos.php"; |
---|
| 34 | whref=whref + "?opcion=" + Consultar; |
---|
| 35 | whref=whref + "&accion=" + Leer_registro; |
---|
| 36 | whref=whref + "&idicono=" + id; |
---|
[3ec149c] | 37 | window.open(whref,"frame_contenidos") |
---|
| 38 | } |
---|
| 39 | //----------------------------------------------------------------------------------------------------- |
---|
| 40 | function borrar(){ |
---|
| 41 | reset_contextual(-1,-1); |
---|
[3806a31] | 42 | id=document.fdatos.identificador.value; |
---|
| 43 | var whref; |
---|
| 44 | whref="M_Iconos.php"; |
---|
| 45 | whref=whref + "?opcion=" + Eliminar; |
---|
| 46 | whref=whref + "&accion=" + Leer_registro; |
---|
| 47 | whref=whref + "&idicono=" + id; |
---|
[3ec149c] | 48 | window.open(whref,"frame_contenidos") |
---|
| 49 | } |
---|
| 50 | //----------------------------------------------------------------------------------------------------- |
---|
| 51 | function modificar(){ |
---|
| 52 | reset_contextual(-1,-1); |
---|
[3806a31] | 53 | id=document.fdatos.identificador.value; |
---|
| 54 | var whref; |
---|
| 55 | whref="M_Iconos.php"; |
---|
| 56 | whref=whref + "?opcion=" + Modificar; |
---|
| 57 | whref=whref + "&accion=" + Leer_registro; |
---|
| 58 | whref=whref + "&idicono=" + id; |
---|
[3ec149c] | 59 | window.open(whref,"frame_contenidos") |
---|
| 60 | } |
---|
| 61 | //_____________________________________________________________________________________ |
---|
| 62 | // |
---|
| 63 | function menu_contextual(o){ |
---|
[3806a31] | 64 | document.fdatos.identificador.value=o.getAttribute("id"); |
---|
[3ec149c] | 65 | if (currentImg!=null) |
---|
[3806a31] | 66 | currentImg.src="../images/iconos/administrar_off.gif"; |
---|
[3ec149c] | 67 | o.src="../images/iconos/administrar_on.gif"; |
---|
| 68 | currentImg=o; |
---|
| 69 | var menuctx=document.getElementById("flo_menu"); |
---|
| 70 | muestra_contextual(ClickX,ClickY,menuctx); |
---|
| 71 | } |
---|
| 72 | //____________________________________________________________________________ |
---|
| 73 | // |
---|
[3806a31] | 74 | // Se ejecuta cada vez que se hace click con el puntero del rat�n. Se usa para desmarca |
---|
[3ec149c] | 75 | // cualquier item de menu contextual que estuviese activo |
---|
| 76 | //____________________________________________________________________________ |
---|
| 77 | function click_de_raton(e){ |
---|
| 78 | if(IE){ |
---|
[3806a31] | 79 | botonraton=event.button; |
---|
[3ec149c] | 80 | event.returnValue=true; |
---|
| 81 | } |
---|
| 82 | if(NS){ |
---|
| 83 | botonraton=e.which; |
---|
| 84 | e.returnValue=true; |
---|
| 85 | } |
---|
| 86 | } |
---|
| 87 | //____________________________________________________________________________ |
---|
| 88 | // |
---|
[3806a31] | 89 | // Se ejecuta cada vez que se mueve el puntero del rat�n. Se usa para capturar coordenadas |
---|
[3ec149c] | 90 | //____________________________________________________________________________ |
---|
| 91 | function move_de_raton(e){ |
---|
| 92 | if(IE){ |
---|
[3806a31] | 93 | ClickX=event.clientX; |
---|
| 94 | ClickY=event.clientY; |
---|
[3ec149c] | 95 | event.returnValue=true; |
---|
| 96 | } |
---|
| 97 | if(NS){ |
---|
[3806a31] | 98 | ClickX=e.clientX; |
---|
| 99 | ClickY=e.clientY; |
---|
[3ec149c] | 100 | e.returnValue=true; |
---|
| 101 | } |
---|
| 102 | } |
---|
| 103 | //____________________________________________________________________________ |
---|
| 104 | // |
---|
[3806a31] | 105 | // Redirecciona el evento onmousedown a la funci�n de usuario especificada. |
---|
[3ec149c] | 106 | //____________________________________________________________________________ |
---|
| 107 | document.onmousedown = click_de_raton; // Redefine el evento onmousedown |
---|
| 108 | document.onmousemove = move_de_raton; // Redefine el evento onmousedown |
---|
| 109 | |
---|
| 110 | |
---|
| 111 | |
---|