Ver Mensaje Individual
  #12 (permalink)  
Antiguo 14/10/2005, 08:20
Avatar de Reynier
Reynier
 
Fecha de Ingreso: noviembre-2002
Ubicación: Por ahí en algún sitio
Mensajes: 1.844
Antigüedad: 21 años, 6 meses
Puntos: 1
Gracias

Hola caricatos y muchas gracias por responder mi mensaje nuevamente. Resulta que he ido a la web y he estado buscando lo que necesito. Ya me he bajado el script "editor.js" y puesto en el directorio de mis ficheros JS. Bien tambien copie y pegue el código fuente del Libro de Visitas pero leyendo hay algunas cosas que no me quedan muy claras del todo. Por ejemplo tu tienes este código en el evento onLoad de tu pagina:
Código HTML:
 onload="formu = ini_editor(document.forms.editar.opine);
La pregunta es: Si pongo "document.forms" no necesito especificar el nombre del formulario no?

Seguimos. Tambien en el código del Libro de Visitas tienes todo este código:
Código HTML:
function ponEnlaces(texto)	{
	texto = texto.split("[EMAIL]").join("<a href=mailto:").split("[/EMAIL]").join(">EMAIL</a>");
	texto = texto.split("[NEWS]").join("<a href=news:").split("[/NEWS]").join(">NEWS</a>");
	if (texto.split("[URL]").length > 0)
		if (texto.split("http").length == 0) texto = "http://" + texto;
	return texto.split("[URL]").join("<a href=").split("[/URL]").join(">URL</a>");
}

function ponImagen(texto)	{
	return texto.split("[img = ").join("<img src='").split("/]").join("' />"); 
}

function ponTag(texto, Tag)	{
	return texto.split("[" + Tag + "]").join("<" + Tag + ">").split("[/" + Tag + "]").join("</" + Tag + ">"); 
}

function leePrompt(texto, mensaje)	{
	return prompt(texto, mensaje);
}

function leeTag(Tag)	{
	insertor = _lector();
	texto = leePrompt(Tag, insertor);
	if ((Tag == "URL") && (texto.substr(0, 4) != "http")) texto = "http://" + texto;
	return "[" + Tag + "]" + texto + "[/" + Tag + "]";
}

function imagen(cual)	{
	return "[img = " + cual + "/]";
}

var tex;
function limpieza()	{
	document.forms.editar.opine.value = "";
}

function poner(x)	{
	_insertar(formu, x);
}

var emotis = [
	"[:)]",
	"[:(]",
	"[:x]",
	"[BIEN]",
	"[MAL]",
	"[SI]",
	"[NO]",
	"[APLAUSOS]",
	"[MEJORABLE]",
	"[¡A VER!]",
	"[¡DÉJAME PENSAR!]",
	"[FLIPE]",
	"[¡SIN PALABRAS!]"
];

var fichs = [
	"00.gif",
	"01.gif",
	"02.gif",
	"03.gif",
	"04.gif",
	"05.gif",
	"06.gif",
	"07.gif",
	"08.gif",
	"09.gif",
	"10.gif",
	"11.gif",
	"12.gif"
];

function chequote(x)	{
	while (x.indexOf("\"") != -1) x = x.replace("\"", "&34");

}

function salida()	{
	opener.actualizar();
	window.close();
}

function chequeo()	{

//alert("función deshabilitada...");


// Provisionalmente deshabilitado

tex = document.forms.editar.opine.value;
if (tex == "") {alert("Debe poner algún comentario"); return;}
var quien = document.forms.visitas.nombre.value;

while (tex.indexOf("<") != -1)	
	{
		tex = tex.replace("<", "[código insertado:" );
		if (tex.indexOf(">") != -1) tex = tex.replace(">", "]" );
	}
for (var i = 0; i < fichs.length; i ++)
	tex = tex.split(emotis[i]).join("<img src=" + fichs[i] + ">");

document.forms.visitas.tx.value = ponEnlaces(ponTag(ponTag(ponImagen(tex), 'B'), "I"));
var nom = (quien == "") ? " Anónimo" : quien;
document.forms.visitas.nm.value = nom;

var ops = "width=200,height=200,left=" + (screen.width / 2 - 100) + ",top=" + (screen.height / 2 - 100);
var ventana = window.open('', 'actualizando', ops);

document.forms.visitas.submit();
setTimeout("salida()", 2000);

}

function subiendo()	{
	var ops = "status=yes,width=400,height=260,top=" + (screen.height / 2 - 130) + ",left=" + (screen.width / 2 - 200);
	window.open("", "subir", ops);
	document.forms["subir"].submit()
}

function devolver(n)	{
	poner("[img = " + n + " /]");
}

function cuenta()	{
	document.forms.editar.opine.rows = (document.all) ? 10 : 8;
}
De todas esas funciones entiendo muy pocas y no se como adaptarlas para que funcione con mi Libro de Visitas y Forum de Discusión en un futuro. Por ejemplo yo pongo mis caritas con imagenes. Como haría para al dar clic me ponga la carita o el equivalente en código BB en el elemento TEXTAREA según he podido ver tu lo haces mediante JS. Si pudieras exlicar un poco mejor te lo agradecería.

Salu2
__________________
Ing. Reynier Pérez Mira