Michael Kremser wrote:
Neil wrote:
You didn't look in EdAEHTMLAttributes.js otherwise you would have found BuildHTMLAttributeNameList - although in the case of CSS you could probably use a static list.
Strange... I really have overseen this. May be because I searched differently. In that file, the function BuildHTMLAttributeNameList() makes these calls:
var elementName = gElement.localName.toLowerCase(); var attNames = gHTMLAttr[elementName];
I don't understand them. What is that "localName"
In this case it's a synonym for the tag name.
and where comes qHtmlAttr[] from? Where are they definied? Where is qHTMLAttr[] filled with values and how?
gHTMLAttr is defined in EdAEAttributes.js
I expected something like
gElement.AddHTMLAttributeNameInput.appendItem("background"); gElement.AddHTMLAttributeNameInput.appendItem("bg-color"); gElement.AddHTMLAttributeNameInput.appendItem("text");
but obviously I was wrong.
Well, gHTMLAttr.body = [
"background",
"bgcolor",
"text",
etc. so you were close. It's done this way because the list of attributes depends on the tag.
Now in EdAeHTMLAttributes.js I added this function:
function BuildCSSAttributeNameList()
{
gDialog.AddCSSAttributeValueInput.removeAllItems();
var menuitem;
menuitem = gDialog.AddCSSAttributeValueInput.appendItem("test");
}
And I added a call in EdAdvancedEdit.js:
// Build attribute name arrays for menulists
BuildJSEAttributeNameList();
BuildHTMLAttributeNameList();
BuildCSSAttributeNameList();
// No menulists for CSS panel (yet) <-- which is not true anymore now. ;)
Then I rebuilt Mozilla. The result is that I now have a nice drop down list, but it's not filled with that value yet.
Any suggestions on what I did wrong?
I can't see anything obviously wrong, but unless you expect your list to change I suggest that it would be simpler to define the list in the XUL.
-- Warning: May contain traces of nuts. _______________________________________________ mozilla-editor mailing list [EMAIL PROTECTED] http://mail.mozilla.org/listinfo/mozilla-editor
