Skip to content

Commit

Permalink
Tarea #38
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosaj98 committed Nov 4, 2016
1 parent 63d43a2 commit cfafa8f
Showing 1 changed file with 32 additions and 36 deletions.
68 changes: 32 additions & 36 deletions js/script.js
Original file line number Diff line number Diff line change
@@ -1,49 +1,48 @@
function stopRKey(evt) {
var evt = (evt) ? evt : ((event) ? event : null);
var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);
if ((evt.keyCode == 13) && (node.type=="text")) {return false;}
var evt = (evt) ? evt : ((event) ? event : null);
var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);
if ((evt.keyCode == 13) && (node.type == "text")) {
return false;
}
}

/*
* ------------------------------------------------------------------------------
* Elimina todas las entradas existentes en la lista de valores referenciada
* Elimina todas las entradas existentes en la lista de valores referenciada
* por IDLISTA
* ------------------------------------------------------------------------------
*/

function Limpiar(idlista) {
var opcion = document.getElementById(idlista)
while (opcion.options.length > 0) {
while (opcion.options.length > 0) {
opcion.remove(0);
}

}
}

function Borrar(idlista) {
var idlista = document.getElementById(idlista);

// Seleccionar las opciones
var seleccionado = [];

for (var i = 0; i < idlista.options.length; ++i)
{
seleccionado[i] = idlista.options[i].selected;
}
// Eliminar las opciones seleccionadas
i = idlista.options.length;
while (i--)
{
if (seleccionado[i])
{
idlista.remove(i);
}
}
var idlista = document.getElementById(idlista);

// Seleccionar las opciones
var seleccionado = [];

for (var i = 0; i < idlista.options.length; ++i) {
seleccionado[i] = idlista.options[i].selected;
}
// Eliminar las opciones seleccionadas
i = idlista.options.length;
while (i--) {
if (seleccionado[i]) {
idlista.remove(i);
}
}
}

function Seleccionar(valor,idlista,idanadir,classanadir2,idtextoanadir) {
function Seleccionar(valor, idlista, idanadir, classanadir2, idtextoanadir) {
var valores = document.getElementById(idlista);
var seleccionado = valores.options.selectedIndex;
document.getElementById(valor).value=valores.options[seleccionado].value;
document.getElementById(valor).value = valores.options[seleccionado].value;
document.getElementById(idanadir).className = classanadir2;
document.getElementById(idtextoanadir).innerHTML = "Editar";

Expand All @@ -57,25 +56,22 @@ function Seleccionar(valor,idlista,idanadir,classanadir2,idtextoanadir) {
}
*/

function Anadir(idlista,valor) {
function Anadir(idlista, valor) {
var option = document.createElement("option");
option.text = document.getElementById(valor).value;
document.getElementById(idlista).add(option);
document.getElementById(idvalor).value="";
document.getElementById(idvalor).value = "";

document.getElementById(idvalor).focus();

}

function Procesar(idvalor2,idtexto) {
function Procesar(idvalor2, idtexto) {
var valores = document.getElementById(idvalor2);
var seleccionado = valores.options.selectedIndex;
document.getElementById(idtexto).innerHTML = "Procesando " + valores.options[seleccionado].value;
}

function mostrarMensaje (idTexto,valor) {
document.getElementById(idTexto).innerHTML += valor+"&#13;&#10;"; // Agrego nueva linea antes
}



function mostrarMensaje(idTexto, valor) {
document.getElementById(idTexto).innerHTML += valor + "&#13;&#10;"; // Agrego nueva linea antes
}

0 comments on commit cfafa8f

Please sign in to comment.