Diferencia entre revisiones de «MediaWiki:Common.js»
De WikiCAAD
Línea 7: | Línea 7: | ||
var tipo = document.getElementById('campo-tipo').value; | var tipo = document.getElementById('campo-tipo').value; | ||
var texto = | var texto = "'''" + titulo + "''' es una [[" + tipo + "]] realizada en " + year + " por [[" + autor + "]] para [[" + plataformas + "]] empleando el [[" + herramienta + "]]."; | ||
document.getElementById('campo-texto-libre').value = texto; | document.getElementById('campo-texto-libre').value = texto; | ||
} | } | ||
document.addEventListener('DOMContentLoaded', function() { | document.addEventListener('DOMContentLoaded', function() { | ||
document.getElementById('campo-titulo').addEventListener('input', actualizarTextoLibre); | document.getElementById('campo-titulo').addEventListener('input', actualizarTextoLibre); |
Revisión del 08:23 22 ago 2024
function actualizarTextoLibre() {
var titulo = document.getElementById('campo-titulo').value;
var year = document.getElementById('campo-year').value;
var autor = document.getElementById('campo-autor').value;
var plataformas = document.getElementById('campo-plataformas').value;
var herramienta = document.getElementById('campo-herramienta').value;
var tipo = document.getElementById('campo-tipo').value;
var texto = "'''" + titulo + "''' es una [[" + tipo + "]] realizada en " + year + " por [[" + autor + "]] para [[" + plataformas + "]] empleando el [[" + herramienta + "]].";
document.getElementById('campo-texto-libre').value = texto;
}
document.addEventListener('DOMContentLoaded', function() {
document.getElementById('campo-titulo').addEventListener('input', actualizarTextoLibre);
document.getElementById('campo-year').addEventListener('input', actualizarTextoLibre);
document.getElementById('campo-autor').addEventListener('input', actualizarTextoLibre);
document.getElementById('campo-plataformas').addEventListener('input', actualizarTextoLibre);
document.getElementById('campo-herramienta').addEventListener('input', actualizarTextoLibre);
document.getElementById('campo-tipo').addEventListener('input', actualizarTextoLibre);
});