Ver Mensaje Individual
  #4 (permalink)  
Antiguo 17/11/2012, 09:28
Avatar de williamhpf
williamhpf
 
Fecha de Ingreso: mayo-2009
Mensajes: 144
Antigüedad: 15 años
Puntos: 8
Solucionado

function pepe(texto2,donde)
{
pLink = /^\[url[=]?[\w\*":.\/]*\][\w\*":.\/\[\]]+\[\/url\]$/
pImagen = /^\[img?(=left)?(=right)?\][\w:".\/]*\[\/img(=left)?(=right)?\]$/
pUrl = /^https?:\/\/[\w\.]+/
pCodigo = /^<[\w\.\"\'\$\(\)\= #\?&%@\[\]\;]+>$/
pCodigo2 = /="[\w\.:\/\-"\+\=\?\&\#%@\$'\(\)\[\]\;]+"/
pMail = /^[\w\_\.çñ]{2,255}@[\w]{2,255}\.[a-z]{1,3}\.?[a-z]{0,3}$/
var palabrota = 10
palabras = texto2.split(/\s/)
largo = palabras.length
for(m=0;m<largo;m++)
{
if(palabras[m].length > palabrota)
{
if (pLink.test(palabras[m]))
{continue}
if (pImagen.test(palabras[m]))
{continue}
if (pUrl.test(palabras[m]))
{continue}
if (pCodigo.test(palabras[m]))
{continue}
if (pCodigo2.test(palabras[m]))
{continue}
if (pMail.test(palabras[m]))
{continue}
texto3=palabras[m].substr(0,palabrota)+" "
for(h=palabrota;h<palabras[m].length;h+=palabrota)
{
texto3+=palabras[m].substr(h,palabrota)
}
texto2=texto2.replace(palabras[m],texto3)
donde.value=texto2
pepe(texto2,donde)
}
}
}

<textarea onBlur="pepe(this.value,this)" name="mensaje" cols="45" rows="6"></textarea>
__________________
Electricistas 24 Horas