rem: if (!IsDocumentModified() && !gHTMLSourceChanged) 
add: if (!IsDocumentModified() && !IsHTMLSourceChanged()) 
context: function CheckAndSaveDocument(command, allowDontSave){  var document;  try {    // if we don't have an editor or an document, bail    var editor = GetCurrentEditor();    document = editor.document;    if (!document)      return true;  } catch (e) { return true; }  if (!IsDocumentModified() && !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 = document.title;  if (!title)    title = GetString("untitled");  var dialogTitle = GetString(doPublish ? "PublishPage" : "SaveDocument");  var dialogMsg = GetString(doPublish ? "PublishPrompt" : "SaveFilePrompt");  dialogMsg = (dialogMsg.replace(/%title%/,title)).replace(/%reason%/,reasonToSave);  var promptService = GetPromptService();  if (!promptService)    return false;  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);    result = promptService.confirmEx(window, dialogTitle, dialogMsg, promptFlags,                          button1Title, null, button3Title, null, {value:0});  if (result == 0)  {    // Save, but first finish HTML source mode    if (gHTMLSourceChanged) {      try {        FinishHTMLSource();      } catch (e) { return false;}    }    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 contentsMIMEType;    if (IsHTMLEditor())      contentsMIMEType = kHTMLMimeType;    else      contentsMIMEType = kTextMimeType;    var success = SaveDocument(false, false, contentsMIMEType);    return success;  }  if (result == 2) // "Don't Save"    return true;  // Default or result == 1 (Cancel)  return false;}
meta: 8395	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/8395/da612cac58dcb7e9f3602cece16f98855cac775c/editor.js/buggy/editor/ui/composer/content/editor.js