rem:  promptService.confirmEx(window, dialogTitle, dialogMsg, promptFlags, button1Title, null, button3Title, null, {value:0}, result); 
add:  result = promptService.confirmEx( window, dialogTitle, dialogMsg, promptFlags, button1Title, null, button3Title, null, {value:0} ); 
context: function CheckAndSaveDocument(command, allowDontSave){  try {    // if we don't have an editorShell or an editorDocument, bail    if (!window.editorShell && !window.editorShell.editorDocument)      return true;  } catch (e) { return true; }  var document = editorShell.editorDocument;  if (!editorShell.documentModified && !gHTMLSourceChanged)    return true;  // call window.focus, since we need to pop up a dialog  // and therefore need to be visible (to prevent user confusion)  window.focus();    var scheme = GetScheme(GetDocumentUrl());  var doPublish = (scheme && scheme != "file");  var strID;  switch (command)  {    case "cmd_close":      strID = "BeforeClosing";      break;    case "cmd_preview":      strID = "BeforePreview";      break;    case "cmd_editSendPage":      strID = "SendPageReason";      break;    case "cmd_validate":      strID = "BeforeValidate";      break;  }      var reasonToSave = strID ? GetString(strID) : "";  var title = window.editorShell.editorDocument.title;  if (!title)    title = GetString("untitled");  var dialogTitle = GetString(doPublish ? "PublishPage" : "SaveDocument");  var dialogMsg = GetString("SaveFilePrompt");  dialogMsg = (dialogMsg.replace(/%title%/,title)).replace(/%reason%/,reasonToSave);  var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService();  promptService = promptService.QueryInterface(Components.interfaces.nsIPromptService);  var result = {value:0};  var promptFlags = promptService.BUTTON_TITLE_CANCEL * promptService.BUTTON_POS_1;  var button1Title = null;  var button3Title = null;  if (doPublish)  {    promptFlags += promptService.BUTTON_TITLE_IS_STRING * promptService.BUTTON_POS_0;    button1Title = GetString("Publish");    button3Title = GetString("DontPublish");      }  else  {    promptFlags += promptService.BUTTON_TITLE_SAVE * promptService.BUTTON_POS_0;  }  // If allowing "Don't..." button, add that  if (allowDontSave)    promptFlags += doPublish ?        (promptService.BUTTON_TITLE_IS_STRING * promptService.BUTTON_POS_2)        : (promptService.BUTTON_TITLE_DONT_SAVE * promptService.BUTTON_POS_2);      promptService.confirmEx(window, dialogTitle, dialogMsg, promptFlags,                          button1Title, null, button3Title, null, {value:0}, result);  if (result.value == 0)  {    // Save, but first finish HTML source mode    if (gHTMLSourceChanged)      FinishHTMLSource();    if (doPublish)    {      // We save the command the user wanted to do in a global      // and return as if user canceled because publishing is asynchronous      // This command will be fired when publishing finishes      gCommandAfterPublishing = command;      goDoCommand("cmd_publish");      return false;    }    // Save to local disk    var success = SaveDocument(false, false, editorShell.contentsMIMEType);    return success;  }  if (result.value == 2) // "Don't Save"    return true;  // Default or result.value == 1 (Cancel)  return false;}
meta: 8395	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/8395/c3b4db921a0ab444658a6af9e53ee67d1ebea5a0/editor.js/buggy/editor/ui/composer/content/editor.js