Announcement

Do not use the forums to submit bug reports, feature requests or patches, submit a New Ticket instead.

#1 2007-07-12 16:04:03

jtnt
New member
Registered: 2007-07-12
Posts: 1

Mulitple fonts in editor oddity

A picture is worth a thousand words:

xinha-ff.jpg

Notice how the font randomly changes. There are no font tags in the source. Also, when I select text, the highlighted area does not match what I select. e.g. I select the word "technical" but the word "standpoint" is actual selected. Source code appears fine, and I can edit properly there.

I have implemented this a ton of times on other sites. I am using the latest FF on Mac. It doesn't happen on Safari or PC, but I don't think it's a browser thing, since the Demo at the main Xinha site works fine as do other installs I've done that I've gone back and checked. I am using the latest version of Xinha.

Any ideas on what could be causing this?

Here's my code:

xinha_editors = null;
xinha_init    = null;
xinha_config  = null;
xinha_plugins = null;

// Initialize
xinha_init = xinha_init ? xinha_init : function()
{
/** STEP 1 ***************************************************************
* Load desired plugins.
************************************************************************/

xinha_plugins = xinha_plugins ? xinha_plugins :
[ "CharacterMap",
"ContextMenu",
"FindReplace",
"GetHtml",
"HtmlEntities",
"PasteText"
];

// THIS BIT OF JAVASCRIPT LOADS THE PLUGINS, NO TOUCHING  :)
if(!Xinha.loadPlugins(xinha_plugins, xinha_init)) return;

/** STEP 2 ***************************************************************
* Set which fields will get Xinha
************************************************************************/

var textareas = document.getElementsByTagName("textarea");
var xinha_editors = new Array();

for (var i in textareas) {

if ((textareas[i].id)  && (
textareas[i].id != "field_id_65" && 
textareas[i].id != "field_id_83" &&
textareas[i].id != "field_id_92"
) ) {

xinha_editors.push(textareas[i].id);

}
}

/** STEP 3 ***************************************************************
* Configure.
*************************************************************************/

xinha_config = xinha_config ? xinha_config : new Xinha.Config();


xinha_config.toolbar = [
["undo","redo","separator", "formatblock","bold","italic"],
["linebreak","separator","justifyleft","justifycenter","justifyright"],
["separator","insertorderedlist","insertunorderedlist","outdent","indent"],
["separator","createlink"],
["linebreak","separator"], (Xinha.is_gecko ? [] : ["cut","copy"]),
["separator","htmlmode"]
];                



xinha_config.formatblock = {
"— format —"  : "",
"Normal"   : "p",    
"Heading 1": "h1",
"Heading 2": "h2",
"Heading 3": "h3"
};

/** STEP 4 ***************************************************************
* Create editors for the textareas.
************************************************************************/

xinha_editors   = Xinha.makeEditors(xinha_editors, xinha_config, xinha_plugins);

/** STEP 5 ***************************************************************
* "Start" the editors, this turns the textareas into
* Xinha editors.
************************************************************************/

Xinha.startEditors(xinha_editors);        
}

Offline

Board footer

Powered by FluxBB