1 | // *********************************************************************************************************** |
---|
2 | // Libreria de scripts de Javascript |
---|
3 | // Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla |
---|
4 | // Fecha Creación: 2009-2010 |
---|
5 | // Fecha Última modificación: Agosto-2010 |
---|
6 | // Nombre del fichero: EjecutarScripts.js |
---|
7 | // Descripción : |
---|
8 | // Este fichero implementa las funciones javascript del fichero EjecutarScripts.php (Comandos) |
---|
9 | // *********************************************************************************************************** |
---|
10 | function confirmar(){ |
---|
11 | if (comprobar_datos()){ |
---|
12 | var RC='@'; |
---|
13 | var atributos=''; |
---|
14 | atributos +='tit='+document.fdatos.titulo.value+RC; |
---|
15 | atributos +='msj='+document.fdatos.mensaje.value+RC; |
---|
16 | document.fdatosejecucion.atributos.value=atributos; |
---|
17 | |
---|
18 | // Incluimos titulo y mensaje en fdatosejecucion. |
---|
19 | document.fdatosejecucion.appendChild(document.fdatos.titulo); |
---|
20 | document.fdatosejecucion.appendChild(document.fdatos.mensaje); |
---|
21 | |
---|
22 | filtrado(); |
---|
23 | document.fdatosejecucion.submit(); |
---|
24 | } |
---|
25 | } |
---|
26 | //________________________________________________________________________________________________________ |
---|
27 | |
---|
28 | function cancelar() |
---|
29 | { |
---|
30 | alert(CTbMsg[0]); |
---|
31 | location.href="../nada.php" |
---|
32 | } |
---|
33 | //________________________________________________________________________________________________________ |
---|
34 | // No comprobamos datos de ejecución porque son obligatorios |
---|
35 | function comprobar_datos() |
---|
36 | { |
---|
37 | function validate (field, validator, msgi) { |
---|
38 | if (!validator (field.value)) { |
---|
39 | alert(TbMsg[msgi]); |
---|
40 | validation_highlight (field); |
---|
41 | return false; |
---|
42 | } |
---|
43 | return true; |
---|
44 | } |
---|
45 | // Escapamos los saltos de línea para evitar error con curl |
---|
46 | fdatos.mensaje.value=fdatos.mensaje.value.split("\n").join("\\n"); |
---|
47 | return validate (fdatos.titulo, validate_text_notnull, 1) && |
---|
48 | validate (fdatos.mensaje, validate_text_notnull, 2) |
---|
49 | } |
---|