Foros del Web » Programando para Internet » Javascript »

editor WYSIWYG

Estas en el tema de editor WYSIWYG en el foro de Javascript en Foros del Web. Hola. Estoy buscando un editor WYSIWYG para unos formularios. He probado el SPAW y e buscado mas pero nada... el spaw usa una class de ...
  #1 (permalink)  
Antiguo 19/10/2003, 10:39
Avatar de Maycol  
Fecha de Ingreso: diciembre-2001
Ubicación: Ávila (España)
Mensajes: 539
Antigüedad: 22 años, 4 meses
Puntos: 0
editor WYSIWYG

Hola.
Estoy buscando un editor WYSIWYG para unos formularios.
He probado el SPAW y e buscado mas pero nada... el spaw usa una class de PHP para cargarlo voy a ver la demo en mi localhost y me da errores.

Recomendarme uno que sea sencillito

gracias ;)
__________________
Zepsilon.com
Diseño e imaginacion
  #2 (permalink)  
Antiguo 20/10/2003, 02:43
Avatar de epplestun  
Fecha de Ingreso: octubre-2001
Mensajes: 1.621
Antigüedad: 22 años, 6 meses
Puntos: 5
Yo nose que recomendarte, yo me hice uno con la documentacion de DOM de Mozilla, y funciona bajo IE y Mozilla perfectamente, si te interesa algo solo para IE puedes usar el de esta web:

http://www.editworkspro.com/

http://www.webedpro.com/

Espero que te ayude en algo, como te dije, esos solo funcionan bajo IE

Aqui te dejo el codigo que uso yo para mi script.

Código PHP:
/*
   +----------------------------------------------------------------------+
   | RTE v.0.0.1                                                                      |
   +----------------------------------------------------------------------+
   | Copyright (c) 2001-2003 EppleMedia                              |
   +----------------------------------------------------------------------+
   | This source file is subject to version 2.02 of the PHP license,      |
   | that is bundled with this package in the file LICENSE, and is        |
   | available at through the world-wide-web at                           |
   | [url]www.php.net/license/2_02.txt[/url]                                 |
   | If you did not receive a copy of the PHP license and are unable to   |
   | obtain it through the world-wide-web, please send a note to          |
   | [email][email protected][/email] so we can mail you a copy immediately.               |
   +----------------------------------------------------------------------+
   | Authors: Ivan Rodriguez Espada [email]<[email protected][/email]>        |
   +----------------------------------------------------------------------+
*/
/*
 * Inicializa el editor
 */
function start()
{
    
document.getElementById('edit').contentWindow.document.designMode "on";
}

/*
 * Indica el estilo que queremos dar a nuestra letra
 */
function estilo(estilo

    switch(
estilo)
    {
        case 
"Bold":
            
document.getElementById('edit').contentWindow.document.execCommand("Bold"falsenull);
            break;
        case 
"Italic":
            
document.getElementById('edit').contentWindow.document.execCommand("Italic"falsenull);
            break;
        case 
"Underline":
            
document.getElementById('edit').contentWindow.document.execCommand("Underline"falsenull);
            break;
        case 
"Superscript":
            
document.getElementById('edit').contentWindow.document.execCommand("Superscript"falsenull);
            break;
        case 
"Subscript":
            
document.getElementById('edit').contentWindow.document.execCommand("Subscript"falsenull);
            break;
        case 
"Strikethrough":
            
document.getElementById('edit').contentWindow.document.execCommand("Strikethrough"falsenull);
            break;
        default: break;
    }
    
document.getElementById('edit').contentWindow.focus();
}

/*
 * Genera una ventana Modal
 */
function VentanaMod(urlanchoalto)
{
    var 
anchoVentana ancho;
    var 
altoVentana  alto;
    var 
izquierda = ((screen.width-anchoVentana)/2);
    var 
arriba    = ((screen.height-altoVentana)/2);
    
window.open(url'Enlace''width='+anchoVentana+',height='+altoVentana',left=' izquierda ',top=' arriba);
}

/*
 * Alinea el documento
 */
function alinear(opcion)
{
    switch(
opcion)
    {
        case 
"Justifycenter":
            
document.getElementById('edit').contentWindow.document.execCommand("Justifycenter"falsenull);
            break;
        case 
"Justifyfull":
            
document.getElementById('edit').contentWindow.document.execCommand("Justifyfull"falsenull);
            break;
        case 
"Justifyleft":
            
document.getElementById('edit').contentWindow.document.execCommand("Justifyleft"falsenull);
            break;
        case 
"Justifyright":
            
document.getElementById('edit').contentWindow.document.execCommand("Justifyright"falsenull);
            break;
        default: break;
    }
    
document.getElementById('edit').contentWindow.focus();
}

/*
 * Funciones de edicion
 */
function edicion(estilo

    switch(
estilo)
    {
        case 
"Paste":
            
document.getElementById('edit').contentWindow.document.execCommand("Paste"falsenull);
            break;
        case 
"Copy":
            
document.getElementById('edit').contentWindow.document.execCommand("Copy"falsenull);
            break;
        case 
"Cut":
            
document.getElementById('edit').contentWindow.document.execCommand("Cut"falsenull);
            break;
        case 
"Undo":
            
document.getElementById('edit').contentWindow.document.execCommand("Undo"falsenull);
            break;
        case 
"Redo":
            
document.getElementById('edit').contentWindow.document.execCommand("Redo"falsenull);
            break;
        default: break;
    }
    
document.getElementById('edit').contentWindow.focus();
}

/*
 * Funciones de listas
 */
function listas(estilo

    switch(
estilo)
    {
        case 
"Insertorderedlist":
            
document.getElementById('edit').contentWindow.document.execCommand("Insertorderedlist"falsenull);
            break;
        case 
"Insertunorderedlist":
            
document.getElementById('edit').contentWindow.document.execCommand("Insertunorderedlist"falsenull);
            break;
        default: break;
    }
    
document.getElementById('edit').contentWindow.focus();
}

/*
 * Funciones de margen
 */
function margen(estilo

    switch(
estilo)
    {
        case 
"Outdent":
            
document.getElementById('edit').contentWindow.document.execCommand("Outdent"falsenull);
            break;
        case 
"Indent":
            
document.getElementById('edit').contentWindow.document.execCommand("Indent"falsenull);
            break;
        default: break;
    }
    
document.getElementById('edit').contentWindow.focus();
}

/*
 * Funciones de estilo de fuente
 */
function select(selectname)
{
    var 
cursel document.getElementById(selectname).selectedIndex;
    if (
cursel != 0)
    {
        var 
selected document.getElementById(selectname).options[cursel].value;
        
document.getElementById('edit').contentWindow.document.execCommand(selectnamefalseselected);
        
document.getElementById(selectname).selectedIndex 0;
    }
    
document.getElementById('edit').contentWindow.focus();
}

/*
 * Inserta una linea horizontal
 */
function linea()
{
    
document.getElementById('edit').contentWindow.document.execCommand("Inserthorizontalrule"falsenull);
    
document.getElementById('edit').contentWindow.focus();
}

function 
codigo()
{
    var 
html document.getElementById('edit').contentWindow.document.body.innerHTML;
    
document.enlace.HTML.value html;

Como ves tiene una licencia y hay que mantenerla y cumplirla

Saludos!
__________________
Usuario registrado de Linux #288725

Última edición por epplestun; 20/10/2003 a las 02:47
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 22:39.