rem: var index = 0; while (allTags.hasMore()) 
add: for (var i = 0; i < tagCount; ++i) 
context: function InitMessageTags(menuPopup){  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 menuseparator = menuPopup.lastChild.previousSibling;  for (var i = menuPopup.childNodes.length; i > 4; --i)    menuPopup.removeChild(menuseparator.previousSibling);  // hide double menuseparator  menuseparator.previousSibling.hidden = !allTags.hasMore();  // create label and accesskey for the static remove item  var tagRemoveLabel = gMessengerBundle.getString("mailnews.tags.remove");  SetMessageTagLabel(menuPopup.firstChild, 0, tagRemoveLabel);  // now rebuild the list  var msgHdr = gDBView.hdrForFirstSelectedMessage;  var curKeys = msgHdr.getStringProperty("keywords");  if (msgHdr.label)    curKeys += " $label" + msgHdr.label;  var index = 0;  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");    SetMessageTagLabel(newMenuItem, ++index, tag);    newMenuItem.setAttribute("value", key);    newMenuItem.setAttribute("type", "checkbox");    newMenuItem.style.color = tagService.getColorForKey(key);    var removeKey = (" " + curKeys + " ").indexOf(" " + key + " ") > -1;    newMenuItem.setAttribute('checked', removeKey);    newMenuItem.setAttribute('oncommand', 'ToggleMessageTagMenu(event.target);');    menuPopup.insertBefore(newMenuItem, menuseparator);  }}
meta: 8395	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/8395/c0bf344d92aa97e4d89f2f062f2fc27bb4d23399/mailWindowOverlay.js/clean/mail/base/content/mailWindowOverlay.js