rem: if (gTransactionMgr.numberOfUndoItems) document.getElementById('undo_command').removeAttribute('disabled'); else document.getElementById('undo_command').setAttribute('disabled', true); 
add:  var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"] .getService(Components.interfaces.nsIWindowMediator); var enumerator = wm.getEnumerator('calendarMainWindow'); while (enumerator.hasMoreElements()) { var doc = enumerator.getNext().document; 
context: function updateUndoRedoMenu() {    if (gTransactionMgr.numberOfUndoItems)        document.getElementById('undo_command').removeAttribute('disabled');    else            document.getElementById('undo_command').setAttribute('disabled', true);    if (gTransactionMgr.numberOfRedoItems)        document.getElementById('redo_command').removeAttribute('disabled');    else            document.getElementById('redo_command').setAttribute('disabled', true);}
meta: 8395	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/8395/8f557b6620a7ffd0ae2bbc6b245ea6cb9b7a0fff/calendar.js/buggy/calendar/resources/content/calendar.js