rem: var promptTitle = "Save Event"; var promptMessage = "Do you want to save changes?"; var buttonLabel1 = "Yes"; var buttonLabel2 = "No"; 
add: var promptTitle = calGetString("calendar", isEvent(window.calendarItem) ? "askSaveTitleEvent" : "askSaveTitleTask"); var promptMessage = calGetString("calendar", "askSaveMessage"); var buttonLabel1 = calGetString("calendar", "askSaveLabel1"); var buttonLabel2 = calGetString("calendar", "askSaveLabel2"); 
context: function onCommandCancel() {    // assume that new items need to be asked whether or    // not the newly created item wants to be saved.    var isNew = window.calendarItem.isMutable;    if (!isNew) {        var newItem = saveItem();        var oldItem = window.calendarItem.clone();        newItem.deleteProperty("DTSTAMP");        oldItem.deleteProperty("DTSTAMP");        // we need to guide the description text through the text-field since        // newlines are getting converted which would indicate changes to the        // text.        setElementValue("item-description", oldItem.getProperty("DESCRIPTION"));        setItemProperty(oldItem,                        "DESCRIPTION",                        getElementValue("item-description"));        var a = newItem.icalString;        var b = oldItem.icalString;        if (newItem.icalString == oldItem.icalString) {            return true;        }    }    // TODO: retrieve strings from dtd', etc.    var promptService = Cc["@mozilla.org/embedcomp/prompt-service;1"]                        .getService(Ci.nsIPromptService);    var promptTitle = "Save Event";    var promptMessage = "Do you want to save changes?";    var buttonLabel1 = "Yes";    var buttonLabel2 = "No";    var flags = promptService.BUTTON_TITLE_IS_STRING *                promptService.BUTTON_POS_0 +                promptService.BUTTON_TITLE_CANCEL *                promptService.BUTTON_POS_1 +                promptService.BUTTON_TITLE_IS_STRING *                promptService.BUTTON_POS_2;    var choice = promptService.confirmEx(null,                                         promptTitle,                                         promptMessage,                                         flags,                                         buttonLabel1,                                         null,                                         buttonLabel2,                                         null,                                         {});    switch (choice) {        case 0:            onCommandSave();            return true;        case 2:            return true;        default:            return false;    }}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/9421/c7d455cb539a9f413e9f4fdab3fd8d383f123816/sun-calendar-event-dialog.js/buggy/calendar/prototypes/wcap/sun-calendar-event-dialog.js