Pregunta

Estoy usando el editor de texto enriquecido de YUI en mi sitio. Lo estoy cargando usando el javascript de carga de Google. Cuando intento crear un enlace (o cualquier otra acción que cree un cuadro & Quot; settings & Quot;, falta la barra de título, consulte imagen aquí . Puede ver cómo se supone que debe verse sobre aquí en el sitio de Yahoos para YUI.

Estoy usando este código en la etiqueta <head>:

<!--Include YUI Loader: --> 
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/yui/2.7.0/build/yuiloader/yuiloader-min.js"></script> 
<!--Use YUI Loader to bring in your other dependencies: --> 
<script type="text/javascript"> 
// Instantiate and configure YUI Loader: 
(function() { 
    var loader = new YAHOO.util.YUILoader({ 
        base: "http://ajax.googleapis.com/ajax/libs/yui/2.7.0/build/", 
        require: ["editor"], 
        loadOptional: true, 
        combine: false, 
        filter: "MIN", 
        allowRollup: true, 
        onSuccess: function() { 
            var Editor = new YAHOO.widget.Editor('content', {
                height: '300px',
                width: '802px',
            dompath: true, //Turns on the bar at the bottom
            animate: true //Animates the opening, closing and moving of Editor windows   
            });
            Editor.render(); 
    }     
});    

// Load the files using the insert() method. 
loader.insert(); 
})(); 
</script> 

Y en mi página web:

<div class="sIFR-ignore yui-skin-sam">
    <textarea name="content" id="content" cols="50" rows="10">
    </textarea>
</div>
¿Fue útil?

Solución

Recibí ayuda de David Glass, uno de los desarrolladores de YUI RTE. El error que cometí fue en realidad una cuestión de CSS, en alguna parte de mis archivos CSS era una línea que decía & Quot; h3 {visibilidad: oculta;} & Quot; que cometió este error De todos modos, ¡gracias por tu ayuda!

Otros consejos

Intenta forzar tu propio título para el editor:

var Editor = new YAHOO.widget.Editor('content', {
                height: '300px',
                width: '802px',
            dompath: true, //Turns on the bar at the bottom
            animate: true //Animates the opening, closing and moving of Editor windows   
            });
            Editor._defaultToolbar.titlebar="<b>Use my title</b>";
            Editor.render(); 

Podría estar equivocado aquí, pero, debido a SOP (Política del mismo origen) no lo hago No creo que JavaScript alojado en Google pueda modificar el DOM (a menos que sea google).

Intente colocar JavaScript en su servidor web y vincular desde allí:

<script type="text/javascript" src="http://your.web.server.com/yui/2.7.0/build/yuiloader/yuiloader-min.js"></script> 
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top