rem:    SetTextColorButton(gColorObj.TextColor); 
add:  broadcaster = document.getElementById("cmd_fontColor"); if (broadcaster) broadcaster.setAttribute("state",gColorObj.TextColor);   
context: function EditorSelectColor(colorType){  if (!gColorObj)   gColorObj = new Object;  var element;  var table;  var currentColor = "";  if (!colorType)    colorType = "";  if (colorType == "Text")  {    gColorObj.Type = colorType;    // Get color from command node state    var commandNode = document.getElementById("cmd_fontColor");    currentColor = commandNode.getAttribute("state");    gColorObj.TextColor = currentColor;  }  else  {    element = GetBackgroundElementWithColor();    if (!element)      return;    // Get the table if we found a cell    if (gColorObj.Type == "Table")      table = element;    else if (gColorObj.Type == "Cell")      table = GetParentTable(element);    // Save to avoid resetting if not necessary    currentColor = gColorObj.BackgroundColor;    if (colorType == "TableOrCell" || colorType == "Cell")    {      if (gColorObj.Type == "Cell")        gColorObj.Type = colorType;      else if (gColorObj.Type != "Table")        return;    }    else if (colorType == "Table" && gColorObj.Type == "Page")      return;        if (colorType == "" && gColorObj.Type == "Cell")    {      // Using empty string for requested type means      //  we can let user select cell or table      gColorObj.Type = "TableOrCell";    }  }  // Save the type we are really requesting  colorType = gColorObj.Type;  // Launch the ColorPicker dialog  // TODO: Figure out how to position this under the color buttons on the toolbar  window.openDialog("chrome://editor/content/EdColorPicker.xul", "_blank", "chrome,close,titlebar,modal", "", gColorObj);    if (colorType == "Text")  {    if (currentColor != gColorObj.TextColor)      window.editorShell.SetTextProperty("font", "color", gColorObj.TextColor);      // Trying to force updating of "state" in command node    //  so next caret move updates color button, but not working!    //goUpdateCommand("cmd_fontColor");    SetTextColorButton(gColorObj.TextColor);  }  else if (element)  {    if (gColorObj.Type == "Table")    {      // Set background on a table      // Note that we shouldn't trust "currentColor" because of "TableOrCell" behavior      if (table)      {        var bgcolor = table.getAttribute("bgcolor");        if (bgcolor != gColorObj.BackgroundColor)        {          if (gColorObj.BackgroundColor.length > 0)            window.editorShell.SetAttribute(table, "bgcolor", gColorObj.BackgroundColor);          else            window.editorShell.RemoveAttribute(table, "bgcolor");        }      }    }     else if (currentColor != gColorObj.BackgroundColor)      window.editorShell.SetBackgroundColor(gColorObj.BackgroundColor);  //    goUpdateCommand("cmd_backgroundColor");    SetBackgroundColorButton(gColorObj.BackgroundColor);  }  window._content.focus();}
meta: 5459	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/5459/7789da1eb003f85e6cc18242751db9096e6cfc90/editor.js/buggy/editor/ui/composer/content/editor.js