rem: var menuItemId = menuType + "-tagpopup"; var menupopupNode = document.getElementById(menuItemId); for (var i = menupopupNode.childNodes.length; i > 2; --i) menupopupNode.removeChild(menupopupNode.firstChild); var menuseparator = menupopupNode.firstChild; 
add: var menuseparator = menuPopup.lastChild.previousSibling; for (var i = menuPopup.childNodes.length; i > 4; --i) menuPopup.removeChild(menuseparator.previousSibling);   menuseparator.previousSibling.hidden = !allTags.hasMore();   var tagRemoveLabel = gMessengerBundle.getString("mailnews.tags.remove"); SetMessageTagLabel(menuPopup.firstChild, 0, tagRemoveLabel);  
context: function InitMessageTags(menuType){  var tagService = Components.classes["@mozilla.org/messenger/tagservice;1"]                             .getService(Components.interfaces.nsIMsgTagService);  var allTags = tagService.tagEnumerator;  var allKeys = tagService.keyEnumerator;  // remove any existing non-static entries...  var menuItemId = menuType + "-tagpopup";  var menupopupNode = document.getElementById(menuItemId);  for (var i = menupopupNode.childNodes.length; i > 2; --i)    menupopupNode.removeChild(menupopupNode.firstChild);  var menuseparator = menupopupNode.firstChild;  // now rebuild the list  var msgHdr = gDBView.hdrForFirstSelectedMessage;  var curKeys = msgHdr.getStringProperty("keywords");  while (allTags.hasMore())  {    var tag = allTags.getNext();    var key = allKeys.getNext();    // TODO we want to either remove or "check" the tags that already exist    var newMenuItem = document.createElement("menuitem");    newMenuItem.setAttribute("label", tag);    newMenuItem.setAttribute("value", key);    newMenuItem.setAttribute("type", "checkbox");    var removeKey = (" " + curKeys + " ").indexOf(" " + key + " ") > -1;    newMenuItem.setAttribute('checked', removeKey);    newMenuItem.setAttribute('oncommand', 'ToggleMessageTagCmd(event.target)');    menupopupNode.insertBefore(newMenuItem, menuseparator);  }}
meta: 5872	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/5872/78b043e7d257a64e5165004c5a976561c6749b4d/mailWindowOverlay.js/clean/mailnews/base/resources/content/mailWindowOverlay.js