rem: linkMenulist.appendItem(text); 
add: createMenuItem(menupopup, text); 
context: function FillLinkMenulist(linkMenulist, headingsArray){  var editor = GetCurrentEditor();  try {    var NamedAnchorNodeList = editor.document.anchors;    var NamedAnchorCount = NamedAnchorNodeList.length;    if (NamedAnchorCount > 0)    {      for (var i = 0; i < NamedAnchorCount; i++)        linkMenulist.appendItem("#" + NamedAnchorNodeList.item(i).name);    }     for (var j = 1; j <= 6; j++)    {      var headingList = editor.document.getElementsByTagName("h" + j);      for (var k = 0; k < headingList.length; k++)      {        var heading = headingList.item(k);        // Skip headings that already have a named anchor as their first child        //  (this may miss nearby anchors, but at least we don't insert another        //   under the same heading)        var child = heading.firstChild;        if (child && child.nodeName == "A" && child.name && (child.name.length>0))          continue;        var range = editor.document.createRange();        range.setStart(heading,0);        var lastChildIndex = heading.childNodes.length;        range.setEnd(heading,lastChildIndex);        var text = range.toString();        if (text)        {          // Use just first 40 characters, don't add "...",          //  and replace whitespace with "_" and strip non-word characters          text = "#" + ConvertToCDATAString(TruncateStringAtWordEnd(text, 40, false));          // Append "_" to any name already in the list          while (linkMenulist.getElementsByAttribute("label", text).length)            text += "_";          linkMenulist.appendItem(text);          // Save nodes in an array so we can create anchor node under it later          headingsArray[text] = heading;        }      }    }    if (!linkMenulist.firstChild.hasChildNodes())     {      var item = linkMenulist.appendItem(GetString("NoNamedAnchorsOrHeadings"));      item.setAttribute("disabled", "true");    }  } catch (e) {}}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/aa816e6f1f3a27519fbec0e58a439c2e841b6ac5/EdDialogCommon.js/buggy/editor/ui/dialogs/content/EdDialogCommon.js