source: admin/WebConsole/images/L_Iconos.js @ 5d05b06

Last change on this file since 5d05b06 was 3806a31, checked in by ramon <ramongomez@…>, 7 years ago

#834: Limpiar código JavaScript?: terminar instrucciones con ";" y evitar asignaciones duplicadas.

git-svn-id: https://opengnsys.es/svn/branches/version1.1@5630 a21b9725-9963-47de-94b9-378ad31fedc9

  • Property mode set to 100644
File size: 3.7 KB
RevLine 
[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]11var Menu=0;
12var Insertar=1;
13var Eliminar=2;
14var Modificar=3;
15var Consultar=4;
[3ec149c]16
17// Acciones
[3806a31]18var Sin_accion=0;
19var Insertar_registro=1;
20var Borrar_registro=2;
21var Modificar_registro=3;
22var Leer_registro=4;
[3ec149c]23 
24var currentImg=null;
25
26var IE=(navigator.appName=="Microsoft Internet Explorer");
27var NS=(navigator.appName=="Netscape");
28//-----------------------------------------------------------------------------------------------------
29function 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//-----------------------------------------------------------------------------------------------------
40function 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//-----------------------------------------------------------------------------------------------------
51function 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//
63function 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//____________________________________________________________________________
77function 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//____________________________________________________________________________
91function 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//____________________________________________________________________________
107document.onmousedown = click_de_raton; // Redefine el evento onmousedown
108document.onmousemove = move_de_raton; // Redefine el evento onmousedown
109
110
111
Note: See TracBrowser for help on using the repository browser.