rem: function CheckAndSaveDocument(reasonToSave, allowDontSave) 
add: function CheckAndSaveDocument(command, allowDontSave) 
context: function CheckAndSaveDocument(reasonToSave, allowDontSave){  // if we don't have an editorShell or an editorDocument, bail  if (!window.editorShell && !window.editorShell.editorDocument)    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 title = window.editorShell.editorDocument.title;  if (!title)    title = GetString("untitled");  var dialogTitle = GetString("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_SAVE * promptService.BUTTON_POS_0) +    (promptService.BUTTON_TITLE_CANCEL * promptService.BUTTON_POS_1) +    (allowDontSave    ? (promptService.BUTTON_TITLE_DONT_SAVE * promptService.BUTTON_POS_2)    : 0);  promptService.confirmEx(    window, dialogTitle, dialogMsg, promptFlags,    null, null, null, null, {value:0}, result  );  if (result.value == 0)  {    // Save, but first finish HTML source mode    if (gHTMLSourceChanged)      FinishHTMLSource();    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: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/d91b053f419d4d0175bdb25deed21f7800ac5c27/editor.js/clean/editor/ui/composer/content/editor.js