rem
stringlengths 0
126k
| add
stringlengths 0
441k
| context
stringlengths 15
136k
|
---|---|---|
newvalue = dayRange + "|" + startHourRange + "-" + endHourRange + "|" + duration + "|" + method; | newValue = dayRange + "|" + startHourRange + "-" + endHourRange + "|" + duration + "|" + method; | function Commit(){ var changed = false; // Grovel through the fields to see if any of the values have // changed. If so, update the RDF graph and force them to be saved // to disk. for (var i = 0; i < gFields.length; ++i) { var field = document.getElementById(gFields[i]); if (field) { // Get the new value as a literal, using 'null' if the value is empty. var newvalue = field.value; if (gFields[i] == "webpanel") newvalue = field.checked ? "true" : undefined; var oldvalue = Bookmarks.GetTarget(RDF.GetResource(gBookmarkID), RDF.GetResource(gProperties[i]), true); if (oldvalue) oldvalue = oldvalue.QueryInterface(Components.interfaces.nsIRDFLiteral); if (newvalue && gProperties[i] == (NC_NS + "ShortcutURL")) { // shortcuts are always lowercased internally newvalue = newvalue.toLowerCase(); } else if (newvalue && gProperties[i] == (NC_NS + "URL")) { if (newvalue.indexOf(":") < 0) // we're dealing with the URL attribute; // if a scheme isn't specified, use "http://" newvalue = "http://" + newvalue; } if (newvalue) newvalue = RDF.GetLiteral(newvalue); if (updateAttribute(gProperties[i], oldvalue, newvalue)) { changed = true; } } } // Update bookmark schedule if necessary; // if the tab was removed, just skip it var scheduleTab = document.getElementById("ScheduleTab"); if (scheduleTab) { var scheduleRes = "http://home.netscape.com/WEB-rdf#Schedule"; oldvalue = Bookmarks.GetTarget(RDF.GetResource(gBookmarkID), RDF.GetResource(scheduleRes), true); newvalue = ""; var dayRangeNode = document.getElementById("dayRange"); var dayRange = dayRangeNode.selectedItem.getAttribute("value"); if (dayRange) { var startHourRangeNode = document.getElementById("startHourRange"); var startHourRange = startHourRangeNode.selectedItem.getAttribute("value"); var endHourRangeNode = document.getElementById("endHourRange"); var endHourRange = endHourRangeNode.selectedItem.getAttribute("value"); if (parseInt(startHourRange) > parseInt(endHourRange)) { var temp = startHourRange; startHourRange = endHourRange; endHourRange = temp; } var duration = document.getElementById("duration").value; if (!duration) { alert(BookmarksUtils.getLocaleString("pleaseEnterADuration")); return false; } var methods = []; if (document.getElementById("bookmarkIcon").checked) methods.push("icon"); if (document.getElementById("playSound").checked) methods.push("sound"); if (document.getElementById("showAlert").checked) methods.push("alert"); if (document.getElementById("openWindow").checked) methods.push("open"); if (methods.length == 0) { alert(BookmarksUtils.getLocaleString("pleaseSelectANotification")); return false; } var method = methods.join(); // join string in array with "," newvalue = dayRange + "|" + startHourRange + "-" + endHourRange + "|" + duration + "|" + method; } if (newvalue) newvalue = RDF.GetLiteral(newvalue); if (updateAttribute(scheduleRes, oldvalue, newvalue)) changed = true; } if (changed) { var remote = Bookmarks.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource); if (remote) remote.Flush(); } window.close(); return true;} |
if (newvalue) newvalue = RDF.GetLiteral(newvalue); | if (newValue) newValue = RDF.GetLiteral(newValue); | function Commit(){ var changed = false; // Grovel through the fields to see if any of the values have // changed. If so, update the RDF graph and force them to be saved // to disk. for (var i = 0; i < gFields.length; ++i) { var field = document.getElementById(gFields[i]); if (field) { // Get the new value as a literal, using 'null' if the value is empty. var newvalue = field.value; if (gFields[i] == "webpanel") newvalue = field.checked ? "true" : undefined; var oldvalue = Bookmarks.GetTarget(RDF.GetResource(gBookmarkID), RDF.GetResource(gProperties[i]), true); if (oldvalue) oldvalue = oldvalue.QueryInterface(Components.interfaces.nsIRDFLiteral); if (newvalue && gProperties[i] == (NC_NS + "ShortcutURL")) { // shortcuts are always lowercased internally newvalue = newvalue.toLowerCase(); } else if (newvalue && gProperties[i] == (NC_NS + "URL")) { if (newvalue.indexOf(":") < 0) // we're dealing with the URL attribute; // if a scheme isn't specified, use "http://" newvalue = "http://" + newvalue; } if (newvalue) newvalue = RDF.GetLiteral(newvalue); if (updateAttribute(gProperties[i], oldvalue, newvalue)) { changed = true; } } } // Update bookmark schedule if necessary; // if the tab was removed, just skip it var scheduleTab = document.getElementById("ScheduleTab"); if (scheduleTab) { var scheduleRes = "http://home.netscape.com/WEB-rdf#Schedule"; oldvalue = Bookmarks.GetTarget(RDF.GetResource(gBookmarkID), RDF.GetResource(scheduleRes), true); newvalue = ""; var dayRangeNode = document.getElementById("dayRange"); var dayRange = dayRangeNode.selectedItem.getAttribute("value"); if (dayRange) { var startHourRangeNode = document.getElementById("startHourRange"); var startHourRange = startHourRangeNode.selectedItem.getAttribute("value"); var endHourRangeNode = document.getElementById("endHourRange"); var endHourRange = endHourRangeNode.selectedItem.getAttribute("value"); if (parseInt(startHourRange) > parseInt(endHourRange)) { var temp = startHourRange; startHourRange = endHourRange; endHourRange = temp; } var duration = document.getElementById("duration").value; if (!duration) { alert(BookmarksUtils.getLocaleString("pleaseEnterADuration")); return false; } var methods = []; if (document.getElementById("bookmarkIcon").checked) methods.push("icon"); if (document.getElementById("playSound").checked) methods.push("sound"); if (document.getElementById("showAlert").checked) methods.push("alert"); if (document.getElementById("openWindow").checked) methods.push("open"); if (methods.length == 0) { alert(BookmarksUtils.getLocaleString("pleaseSelectANotification")); return false; } var method = methods.join(); // join string in array with "," newvalue = dayRange + "|" + startHourRange + "-" + endHourRange + "|" + duration + "|" + method; } if (newvalue) newvalue = RDF.GetLiteral(newvalue); if (updateAttribute(scheduleRes, oldvalue, newvalue)) changed = true; } if (changed) { var remote = Bookmarks.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource); if (remote) remote.Flush(); } window.close(); return true;} |
if (updateAttribute(scheduleRes, oldvalue, newvalue)) changed = true; | changed |= updateAttribute(scheduleArc, oldValue, newValue); | function Commit(){ var changed = false; // Grovel through the fields to see if any of the values have // changed. If so, update the RDF graph and force them to be saved // to disk. for (var i = 0; i < gFields.length; ++i) { var field = document.getElementById(gFields[i]); if (field) { // Get the new value as a literal, using 'null' if the value is empty. var newvalue = field.value; if (gFields[i] == "webpanel") newvalue = field.checked ? "true" : undefined; var oldvalue = Bookmarks.GetTarget(RDF.GetResource(gBookmarkID), RDF.GetResource(gProperties[i]), true); if (oldvalue) oldvalue = oldvalue.QueryInterface(Components.interfaces.nsIRDFLiteral); if (newvalue && gProperties[i] == (NC_NS + "ShortcutURL")) { // shortcuts are always lowercased internally newvalue = newvalue.toLowerCase(); } else if (newvalue && gProperties[i] == (NC_NS + "URL")) { if (newvalue.indexOf(":") < 0) // we're dealing with the URL attribute; // if a scheme isn't specified, use "http://" newvalue = "http://" + newvalue; } if (newvalue) newvalue = RDF.GetLiteral(newvalue); if (updateAttribute(gProperties[i], oldvalue, newvalue)) { changed = true; } } } // Update bookmark schedule if necessary; // if the tab was removed, just skip it var scheduleTab = document.getElementById("ScheduleTab"); if (scheduleTab) { var scheduleRes = "http://home.netscape.com/WEB-rdf#Schedule"; oldvalue = Bookmarks.GetTarget(RDF.GetResource(gBookmarkID), RDF.GetResource(scheduleRes), true); newvalue = ""; var dayRangeNode = document.getElementById("dayRange"); var dayRange = dayRangeNode.selectedItem.getAttribute("value"); if (dayRange) { var startHourRangeNode = document.getElementById("startHourRange"); var startHourRange = startHourRangeNode.selectedItem.getAttribute("value"); var endHourRangeNode = document.getElementById("endHourRange"); var endHourRange = endHourRangeNode.selectedItem.getAttribute("value"); if (parseInt(startHourRange) > parseInt(endHourRange)) { var temp = startHourRange; startHourRange = endHourRange; endHourRange = temp; } var duration = document.getElementById("duration").value; if (!duration) { alert(BookmarksUtils.getLocaleString("pleaseEnterADuration")); return false; } var methods = []; if (document.getElementById("bookmarkIcon").checked) methods.push("icon"); if (document.getElementById("playSound").checked) methods.push("sound"); if (document.getElementById("showAlert").checked) methods.push("alert"); if (document.getElementById("openWindow").checked) methods.push("open"); if (methods.length == 0) { alert(BookmarksUtils.getLocaleString("pleaseSelectANotification")); return false; } var method = methods.join(); // join string in array with "," newvalue = dayRange + "|" + startHourRange + "-" + endHourRange + "|" + duration + "|" + method; } if (newvalue) newvalue = RDF.GetLiteral(newvalue); if (updateAttribute(scheduleRes, oldvalue, newvalue)) changed = true; } if (changed) { var remote = Bookmarks.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource); if (remote) remote.Flush(); } window.close(); return true;} |
var remote = Bookmarks.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource); | var remote = BMDS.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource); | function Commit(){ var changed = false; // Grovel through the fields to see if any of the values have // changed. If so, update the RDF graph and force them to be saved // to disk. for (var i = 0; i < gFields.length; ++i) { var field = document.getElementById(gFields[i]); if (field) { // Get the new value as a literal, using 'null' if the value is empty. var newvalue = field.value; if (gFields[i] == "webpanel") newvalue = field.checked ? "true" : undefined; var oldvalue = Bookmarks.GetTarget(RDF.GetResource(gBookmarkID), RDF.GetResource(gProperties[i]), true); if (oldvalue) oldvalue = oldvalue.QueryInterface(Components.interfaces.nsIRDFLiteral); if (newvalue && gProperties[i] == (NC_NS + "ShortcutURL")) { // shortcuts are always lowercased internally newvalue = newvalue.toLowerCase(); } else if (newvalue && gProperties[i] == (NC_NS + "URL")) { if (newvalue.indexOf(":") < 0) // we're dealing with the URL attribute; // if a scheme isn't specified, use "http://" newvalue = "http://" + newvalue; } if (newvalue) newvalue = RDF.GetLiteral(newvalue); if (updateAttribute(gProperties[i], oldvalue, newvalue)) { changed = true; } } } // Update bookmark schedule if necessary; // if the tab was removed, just skip it var scheduleTab = document.getElementById("ScheduleTab"); if (scheduleTab) { var scheduleRes = "http://home.netscape.com/WEB-rdf#Schedule"; oldvalue = Bookmarks.GetTarget(RDF.GetResource(gBookmarkID), RDF.GetResource(scheduleRes), true); newvalue = ""; var dayRangeNode = document.getElementById("dayRange"); var dayRange = dayRangeNode.selectedItem.getAttribute("value"); if (dayRange) { var startHourRangeNode = document.getElementById("startHourRange"); var startHourRange = startHourRangeNode.selectedItem.getAttribute("value"); var endHourRangeNode = document.getElementById("endHourRange"); var endHourRange = endHourRangeNode.selectedItem.getAttribute("value"); if (parseInt(startHourRange) > parseInt(endHourRange)) { var temp = startHourRange; startHourRange = endHourRange; endHourRange = temp; } var duration = document.getElementById("duration").value; if (!duration) { alert(BookmarksUtils.getLocaleString("pleaseEnterADuration")); return false; } var methods = []; if (document.getElementById("bookmarkIcon").checked) methods.push("icon"); if (document.getElementById("playSound").checked) methods.push("sound"); if (document.getElementById("showAlert").checked) methods.push("alert"); if (document.getElementById("openWindow").checked) methods.push("open"); if (methods.length == 0) { alert(BookmarksUtils.getLocaleString("pleaseSelectANotification")); return false; } var method = methods.join(); // join string in array with "," newvalue = dayRange + "|" + startHourRange + "-" + endHourRange + "|" + duration + "|" + method; } if (newvalue) newvalue = RDF.GetLiteral(newvalue); if (updateAttribute(scheduleRes, oldvalue, newvalue)) changed = true; } if (changed) { var remote = Bookmarks.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource); if (remote) remote.Flush(); } window.close(); return true;} |
if ((newvalue) && (i == Fields.length-1)) { if (newvalue.indexOf(":") < 0) { dump("Setting default URL scheme to HTTP.\n"); newvalue = "http: } } | function Commit(){ var changed = false; // Grovel through the fields to see if any of the values have // changed. If so, update the RDF graph and force them to be saved // to disk. for (var i = 0; i < Fields.length; ++i) { var field = document.getElementById(Fields[i]); // Get the new value as a literal, using 'null' if the value is // empty. var newvalue = field.value; dump("field value = " + newvalue + "\n"); var oldvalue = Bookmarks.GetTarget(RDF.GetResource(bookmark_url), RDF.GetResource(Properties[i]), true); if (oldvalue) oldvalue = oldvalue.QueryInterface(Components.interfaces.nsIRDFLiteral); if (updateAttribute(Properties[i], oldvalue, newvalue) == true) { changed = true; } } // Update bookmark schedule if necessary var scheduleRes = "http://home.netscape.com/WEB-rdf#Schedule"; var oldvalue = Bookmarks.GetTarget(RDF.GetResource(bookmark_url), RDF.GetResource(scheduleRes), true); var newvalue = ""; var dayRange = ""; var dayRangeNode = document.getElementById("dayRange"); if (dayRangeNode) { dayRange = dayRangeNode.options[dayRangeNode.selectedIndex].value; } if (dayRange != "") { var startHourRange = ""; var startHourRangeNode = document.getElementById("startHourRange"); if (startHourRangeNode) { startHourRange = startHourRangeNode.options[startHourRangeNode.selectedIndex].value; } var endHourRange = ""; var endHourRangeNode = document.getElementById("endHourRange"); if (endHourRangeNode) { endHourRange = endHourRangeNode.options[endHourRangeNode.selectedIndex].value; } if (startHourRange > endHourRange) { var temp = startHourRange; startHourRange = endHourRange; endHourRange = temp; } var duration = document.getElementById("duration").value; if (duration == "") { alert("Please enter a duration."); return(false); } var method = ""; if (document.getElementById("bookmarkIcon").checked) method += ",icon"; if (document.getElementById("playSound").checked) method += ",sound"; if (document.getElementById("showAlert").checked) method += ",alert"; if (document.getElementById("openWindow").checked) method += ",open"; if (method.length < 1) { alert("Please select a notification method."); return(false); } method = method.substr(1, method.length - 1); // trim off the initial comma dump("dayRange: " + dayRange + "\n"); dump("startHourRange: " + startHourRange + "\n"); dump("endHourRange: " + endHourRange + "\n"); dump("duration: " + duration + "\n"); dump("method: " + method + "\n"); newvalue = dayRange + "|" + startHourRange + "-" + endHourRange + "|" + duration + "|" + method; } if (updateAttribute(scheduleRes, oldvalue, newvalue) == true) { changed = true; } if (changed == true) { dump("re-writing bookmarks.html\n"); var remote = Bookmarks.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource); if (remote) { remote.Flush(); } } window.close();} |
|
window.close(); | retun true; | function Commit(){ // flush if (catDS) { var flushableDS = catDS.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource); if (flushableDS) { flushableDS.Flush(); } } window.close();} |
param.SetInt(2, listBox.selectedIndex ); | for (var i=0; i<numItems; i++) { if (elements[i]) { param.SetInt(2, i ); break; } } | function commonDialogOnCancel() { dump("commonDialogOnCancel \n"); param.SetInt(2, listBox.selectedIndex ); param.SetInt(0, 1 ); return true;} |
#endif | function commonDialogOnLoad(){ // set the document title document.title = gCommonDialogParam.GetString(12); // set the number of command buttons var nButtons = gCommonDialogParam.GetInt(2); var dialog = document.documentElement; switch (nButtons) { case 1: dialog.getButton("cancel").hidden = true; break; case 4: dialog.getButton("extra2").hidden = false; case 3: dialog.getButton("extra1").hidden = false; } // display the main text var messageText = gCommonDialogParam.GetString(0); var messageParent = document.getElementById("info.box"); var messageParagraphs = messageText.split("\n"); for (var i = 0; i < messageParagraphs.length; i++) { var descriptionNode = document.createElement("description"); var text = document.createTextNode(messageParagraphs[i]); descriptionNode.appendChild(text); messageParent.appendChild(descriptionNode); } setElementText("info.header", gCommonDialogParam.GetString(3), true); // set the icon var iconElement = document.getElementById("info.icon"); var iconClass = gCommonDialogParam.GetString(2); if (!iconClass) iconClass = "message-icon"; iconElement.setAttribute("class", iconElement.getAttribute("class") + " " + iconClass); switch (nButtons) { case 4: setLabelForNode(document.documentElement.getButton("extra2"), gCommonDialogParam.GetString(11)); // fall through case 3: setLabelForNode(document.documentElement.getButton("extra1"), gCommonDialogParam.GetString(10)); // fall through default: case 2: var string = gCommonDialogParam.GetString(9); if (string) setLabelForNode(document.documentElement.getButton("cancel"), string); // fall through case 1: string = gCommonDialogParam.GetString(8); if (string) setLabelForNode(document.documentElement.getButton("accept"), string); break; } // set default result to cancelled gCommonDialogParam.SetInt(0, 1); // initialize the checkbox setCheckbox(gCommonDialogParam.GetString(1), gCommonDialogParam.GetInt(1)); if (gCommonDialogParam.GetInt(3) == 0) // If no text fields { var dButton; var defaultButton = gCommonDialogParam.GetInt(5); switch (defaultButton) { case 3: dButton = document.documentElement.getButton("extra2"); break; case 2: dButton = document.documentElement.getButton("extra1"); break; case 1: dButton = document.documentElement.getButton("cancel"); break; default: case 0: dButton = document.documentElement.getButton("accept"); break; } // move the default attribute and focus from the accept button // to the one specified in the dialog params document.documentElement.getButton("accept").setAttribute("default",false); dButton.setAttribute("default", true); dButton.focus(); } if (gCommonDialogParam.GetInt(6) != 0) // delay button enable { var delayInterval = 2000; try { var prefs = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); delayInterval = prefs.getIntPref("security.dialog_enable_delay"); } catch (e) {} document.documentElement.getButton("accept").disabled = true; document.documentElement.getButton("extra1").disabled = true; document.documentElement.getButton("extra2").disabled = true; setTimeout(commonDialogReenableButtons, delayInterval); addEventListener("blur", commonDialogBlur, false); addEventListener("focus", commonDialogFocus, false); } getAttention();} |
|
var prompt = (document.getElementById("checkboxLabel")); if ( prompt ) prompt.childNodes[1].nodeValue = checkMsg; | var checkMsgElement = document.getElementById("checkboxLabel"); SetElementText( "checkboxLabel", checkMsg ); | function commonDialogOnLoad(){ dump("commonDialogOnLoad \n"); doSetOKCancel( commonDialogOnOK, commonDialogOnCancel, commonDialogOnButton2, commonDialogOnButton3 ); param = window.arguments[0].QueryInterface( Components.interfaces.nsIDialogParamBlock ); if( !param ) dump( " error getting param block interface\n" ); var messageText = param.GetString( 0 ); var messageFragment; // Let the caller use "\n" to cause breaks // Translate these into <br> tags var messageParent = document.getElementById("info.txt"); var done = false; while (!done) { breakIndex = messageText.indexOf('\n'); if (breakIndex == 0) { // Ignore break at the first character messageText = messageText.slice(1); dump("Found break at begining\n"); messageFragment = ""; } else if (breakIndex > 0) { // The fragment up to the break messageFragment = messageText.slice(0, breakIndex); // Chop off fragment we just found from remaining string messageText = messageText.slice(breakIndex+1); } else { // "\n" not found. We're done done = true; messageFragment = messageText; } messageNode = document.createTextNode(messageFragment); if (messageNode) messageParent.appendChild(messageNode); // This is needed when the default namespace of the document is XUL breakNode = document.createElementWithNameSpace("BR", "http://www.w3.org/TR/REC-html40"); if (breakNode) messageParent.appendChild(breakNode); } // set a bold header message var msg = param.GetString( 3 ); SetElementText("info.header", msg ); // set the window title var windowTitle = param.GetString( 12 ); window.title = windowTitle; // set the icon. hm.. this is potentially unskinnable. var iconURL = param.GetString( 2 ); // hack around the unskinnable code by looking into the url and attempting to get something meaningful from it: var fileTag = iconURL.substring( ( iconURL.lastIndexOf("/") + 1 ), iconURL.lastIndexOf(".") ); // BAD BAD HACKERY EVIL ICK WRONG BAD switch ( fileTag ) { case "alert-icon": var iconClass = "alert-icon"; break; case "error-icon": var iconClass = "error-icon"; break; case "question-icon": var iconClass = "question-icon"; break; case "message-icon": default: var iconClass = "message-icon"; break; } var element = document.getElementById("icon"); if( element ) element.setAttribute( "class", iconClass ); // Set button names var buttonText = param.GetString( 8 ); if ( buttonText != "" ) { var okButton = document.getElementById("ok"); okButton.setAttribute("value", buttonText); } buttonText = param.GetString( 9 ); if ( buttonText != "" ) { var cancelButton = document.getElementById("cancel"); cancelButton.setAttribute( "value",buttonText); } // Adjust number buttons var numButtons = param.GetInt( 2 ); if ( numButtons == 1 ) ; switch ( numButtons ) { case 4: var button = document.getElementById("Button3"); button.setAttribute("style", "display:inline;"); var buttonText = param.GetString( 11 ); button.setAttribute( "value",buttonText); case 3: var button = document.getElementById("Button2"); button.setAttribute("style", "display:inline;"); var buttonText = param.GetString( 10 ); button.setAttribute( "value",buttonText); break; case 1: var element = document.getElementById("cancel"); if ( element ) element.setAttribute("style", "display:none;" ); break; default: break; } // Set the Checkbox var checkMsg = param.GetString( 1 ); if ( checkMsg != "" ) { var prompt = (document.getElementById("checkboxLabel")); if ( prompt ) prompt.childNodes[1].nodeValue = checkMsg; var checkValue = param.GetInt( 1 ); var element=document.getElementById("checkbox" ); var checkbool = checkValue > 0 ? true : false; element.checked = checkbool; } else { var element = document.getElementById("checkboxLabel"); element.setAttribute("style","display: none;" ); } // handle the edit fields var numEditfields = param.GetInt( 3 ); switch( numEditfields ) { case 2: var element = document.getElementById("dialog.password2"); element.value = param.GetString( 7 ); var editMsg = param.GetString( 5 ); if (editMsg) SetElementText("password2.text", editMsg ); var editfield1Password = param.GetInt( 4 ); if ( editfield1Password == 1 ) { var element = document.getElementById("dialog.password1"); element.value = param.GetString( 6 ); var editMsg1 = param.GetString( 4 ); if (editMsg1) SetElementText("password1.text", editMsg1 ); var element = document.getElementById("loginEditField"); element.setAttribute("style","display: none;" ); var element = document.getElementById("dialog.password1"); element.focus(); } else { var element = document.getElementById("dialog.loginname"); element.value = param.GetString( 6 ); var editMsg1 = param.GetString( 4 ); if (editMsg1) SetElementText("login.text", editMsg1 ); var element = document.getElementById("password1EditField"); element.setAttribute("style","display: none;" ); var element = document.getElementById("dialog.loginname"); element.focus(); } break; case 1: var editfield1Password = param.GetInt( 4 ); if ( editfield1Password == 1 ) { var element = document.getElementById("dialog.password1"); element.value = param.GetString( 6 );// var editMsg1 = param.GetString( 4 );// if (editMsg1) {// SetElementText("password1.text", editMsg1 ); // } // Now hide the meaningless text var element = document.getElementById("password1.text"); element.setAttribute("style", "display:none;" ); var element = document.getElementById("loginEditField"); element.setAttribute("style","display: none;" ); var element = document.getElementById("password2EditField"); element.setAttribute("style","display: none;" ); var element = document.getElementById("dialog.password1"); element.focus(); } else { var element = document.getElementById("dialog.loginname"); element.value = param.GetString( 6 ); var editMsg1 = param.GetString( 4 ); if (editMsg1) SetElementText("login.text", editMsg1 ); // Now hide the meaningless text var element = document.getElementById("login.text"); element.setAttribute("style", "display:none;" ); var element = document.getElementById("password1EditField"); element.setAttribute("style","display: none;" ); var element = document.getElementById("password2EditField"); element.setAttribute("style","display: none;" ); var element = document.getElementById("dialog.loginname"); element.focus(); } break; case 0: var element = document.getElementById("loginEditField"); element.setAttribute("style", "display:none;" ); var element = document.getElementById("password1EditField"); element.setAttribute("style","display: none;" ); var element = document.getElementById("password2EditField"); element.setAttribute("style","display: none;" ); break; } // set the pressed button to cancel to handle the case where the close box is pressed param.SetInt(0, 1 ); // resize the window to the content window.sizeToContent(); // Move to the right location moveToAlertPosition();} |
setElementText("password1.text", ""); | function commonDialogOnLoad(){ doSetOKCancel(commonDialogOnOK, commonDialogOnCancel, commonDialogOnButton2, commonDialogOnButton3); param = window.arguments[0].QueryInterface(Components.interfaces.nsIDialogParamBlock); // display the main text var messageText = param.GetString(0); var messageParent = document.getElementById("info.box"); var messageParagraphs = messageText.split("\n"); for (var i = 0; i < messageParagraphs.length; i++) { var htmlNode = document.createElement("html"); //htmlNode.setAttribute("style", "max-width: 45em;"); var text = document.createTextNode(messageParagraphs[i]); htmlNode.appendChild(text); messageParent.appendChild(htmlNode); } setElementText("info.header", param.GetString(3), true); // set the window title window.title = param.GetString(12); // set the icon var iconElement = document.getElementById("info.icon"); var iconURL = param.GetString(2); if (iconURL) iconElement.setAttribute("src", iconURL); // set the number of command buttons var nButtons = param.GetInt(2); if (nButtons == 1) hideElementById("cancel"); switch (nButtons) { case 4: unHideElementByID("Button3"); setElementText("Button3", param.GetString(11)); // fall through case 3: unHideElementByID("Button2"); setElementText("Button2", param.GetString(10)); // fall through default: case 2: var string = param.GetString(8); if (string) setElementText("ok", string); // fall through case 1: string = param.GetString(9); if (string) setElementText("cancel", string); break; } // initialize the checkbox setCheckbox(param.GetString(1), param.GetInt(1)); // initialize the edit fields var nEditFields = param.GetInt(3); switch (nEditFields) { case 2: var password2Container = document.getElementById("password2EditField"); password2Container.removeAttribute("hidden"); var password2Field = document.getElementById("dialog.password2"); password2Field.value = param.GetString(7); var password2Label = param.GetString(5); if (password2Label) setElementText("password2.text", password2Label); var containerID, fieldID, labelID; if (param.GetInt(4) == 1) { // two password fields ('password' and 'retype password') containerID = "password1EditField"; fieldID = "dialog.password1"; labelID = "password1.text"; } else { containerID = "loginEditField"; fieldID = "dialog.loginname"; labelID = "login.text"; } unHideElementByID(containerID); var field = document.getElementById(fieldID); field.value = param.GetString(6); var label = param.GetString(4); if (label) setElementText(labelID, label); field.focus(); break; case 1: var editFieldIsPassword = param.GetInt(4); var containerID, fieldID; if (editFieldIsPassword == 1) { containerID = "password1EditField"; fieldID = "dialog.password1"; } else { containerID = "loginEditField"; fieldID = "dialog.loginname"; setElementText("login.text", param.GetString(4)); } unHideElementByID(containerID); var field = document.getElementById(fieldID); field.value = param.GetString(6); field.focus(); break; } // set the pressed button to cancel to handle the case where the close box is pressed param.SetInt(0, 1);} |
|
var htmlNode = document.createElement("html"); | var descriptionNode = document.createElement("description"); | function commonDialogOnLoad(){ doSetOKCancel(commonDialogOnOK, commonDialogOnCancel, commonDialogOnButton2, commonDialogOnButton3); gCommonDialogParam = window.arguments[0].QueryInterface(Components.interfaces.nsIDialogParamBlock); // display the main text var messageText = gCommonDialogParam.GetString(0); var messageParent = document.getElementById("info.box"); var messageParagraphs = messageText.split("\n"); var i; for (i = 0; i < messageParagraphs.length; i++) { var htmlNode = document.createElement("html"); //htmlNode.setAttribute("style", "max-width: 45em;"); var text = document.createTextNode(messageParagraphs[i]); htmlNode.appendChild(text); messageParent.appendChild(htmlNode); } setElementText("info.header", gCommonDialogParam.GetString(3), true); // set the window title window.title = gCommonDialogParam.GetString(12); // set the icon var iconElement = document.getElementById("info.icon"); var iconClass = gCommonDialogParam.GetString(2); if (!iconClass) iconClass = "message-icon"; iconElement.setAttribute("class", iconElement.getAttribute("class") + " " + iconClass); // set the number of command buttons var nButtons = gCommonDialogParam.GetInt(2); if (nButtons == 1) hideElementById("cancel"); switch (nButtons) { case 4: unHideElementByID("Button3"); document.getElementById("Button3").label = gCommonDialogParam.GetString(11); // fall through case 3: unHideElementByID("Button2"); document.getElementById("Button2").label = gCommonDialogParam.GetString(10); // fall through default: case 2: var string = gCommonDialogParam.GetString(8); if (string) document.getElementById("ok").label = string; // fall through case 1: string = gCommonDialogParam.GetString(9); if (string) document.getElementById("cancel").label = string; break; } // initialize the checkbox setCheckbox(gCommonDialogParam.GetString(1), gCommonDialogParam.GetInt(1)); // initialize the edit fields var nEditFields = gCommonDialogParam.GetInt(3); switch (nEditFields) { case 2: var containerID, fieldID, labelID; if (gCommonDialogParam.GetInt(4) == 1) { // two password fields ('password' and 'retype password') var password2Container = document.getElementById("password2EditField"); password2Container.removeAttribute("collapsed"); var password2Field = document.getElementById("dialog.password2"); password2Field.value = gCommonDialogParam.GetString(7); var password2Label = gCommonDialogParam.GetString(5); if (password2Label) setElementText("password2.text", password2Label); containerID = "password1EditField"; fieldID = "dialog.password1"; labelID = "password1.text"; } else { // one login field and one password field var passwordContainer = document.getElementById("password1EditField"); passwordContainer.removeAttribute("collapsed"); var passwordField = document.getElementById("dialog.password1"); passwordField.value = gCommonDialogParam.GetString(7); var passwordLabel = gCommonDialogParam.GetString(5); if (passwordLabel) setElementText("password1.text", passwordLabel); containerID = "loginEditField"; fieldID = "dialog.loginname"; labelID = "login.text"; } unHideElementByID(containerID); var field = document.getElementById(fieldID); field.value = gCommonDialogParam.GetString(6); var label = gCommonDialogParam.GetString(4); if (label) setElementText(labelID, label); field.focus(); break; case 1: var editFieldIsPassword = gCommonDialogParam.GetInt(4); if (editFieldIsPassword == 1) { containerID = "password1EditField"; fieldID = "dialog.password1"; setElementText("password1.text", ""); // hide the meaningless text } else { containerID = "loginEditField"; fieldID = "dialog.loginname"; setElementText("login.text", gCommonDialogParam.GetString(4)); } unHideElementByID(containerID); field = document.getElementById(fieldID); field.value = gCommonDialogParam.GetString(6); field.focus(); break; } // set the pressed button to cancel to handle the case where the close box is pressed gCommonDialogParam.SetInt(0, 1); // set default focus // preferred order is textbox1, textbox2, textbox 3, OK, cancel, button2, button3 var visibilityList = ["loginEditField", "password1EditField", "password2EditField", "ok", "cancel", "Button2", "Button3"] var focusList = ["dialog.loginname", "dialog.password1", "dialog.password2", "ok", "cancel", "Button2", "Button3"] for (i = 0; i < visibilityList.length; i++) { if (isVisible(visibilityList[i])) { document.getElementById(focusList[i]).focus(); break; } }} |
htmlNode.appendChild(text); messageParent.appendChild(htmlNode); | descriptionNode.appendChild(text); messageParent.appendChild(descriptionNode); | function commonDialogOnLoad(){ doSetOKCancel(commonDialogOnOK, commonDialogOnCancel, commonDialogOnButton2, commonDialogOnButton3); gCommonDialogParam = window.arguments[0].QueryInterface(Components.interfaces.nsIDialogParamBlock); // display the main text var messageText = gCommonDialogParam.GetString(0); var messageParent = document.getElementById("info.box"); var messageParagraphs = messageText.split("\n"); var i; for (i = 0; i < messageParagraphs.length; i++) { var htmlNode = document.createElement("html"); //htmlNode.setAttribute("style", "max-width: 45em;"); var text = document.createTextNode(messageParagraphs[i]); htmlNode.appendChild(text); messageParent.appendChild(htmlNode); } setElementText("info.header", gCommonDialogParam.GetString(3), true); // set the window title window.title = gCommonDialogParam.GetString(12); // set the icon var iconElement = document.getElementById("info.icon"); var iconClass = gCommonDialogParam.GetString(2); if (!iconClass) iconClass = "message-icon"; iconElement.setAttribute("class", iconElement.getAttribute("class") + " " + iconClass); // set the number of command buttons var nButtons = gCommonDialogParam.GetInt(2); if (nButtons == 1) hideElementById("cancel"); switch (nButtons) { case 4: unHideElementByID("Button3"); document.getElementById("Button3").label = gCommonDialogParam.GetString(11); // fall through case 3: unHideElementByID("Button2"); document.getElementById("Button2").label = gCommonDialogParam.GetString(10); // fall through default: case 2: var string = gCommonDialogParam.GetString(8); if (string) document.getElementById("ok").label = string; // fall through case 1: string = gCommonDialogParam.GetString(9); if (string) document.getElementById("cancel").label = string; break; } // initialize the checkbox setCheckbox(gCommonDialogParam.GetString(1), gCommonDialogParam.GetInt(1)); // initialize the edit fields var nEditFields = gCommonDialogParam.GetInt(3); switch (nEditFields) { case 2: var containerID, fieldID, labelID; if (gCommonDialogParam.GetInt(4) == 1) { // two password fields ('password' and 'retype password') var password2Container = document.getElementById("password2EditField"); password2Container.removeAttribute("collapsed"); var password2Field = document.getElementById("dialog.password2"); password2Field.value = gCommonDialogParam.GetString(7); var password2Label = gCommonDialogParam.GetString(5); if (password2Label) setElementText("password2.text", password2Label); containerID = "password1EditField"; fieldID = "dialog.password1"; labelID = "password1.text"; } else { // one login field and one password field var passwordContainer = document.getElementById("password1EditField"); passwordContainer.removeAttribute("collapsed"); var passwordField = document.getElementById("dialog.password1"); passwordField.value = gCommonDialogParam.GetString(7); var passwordLabel = gCommonDialogParam.GetString(5); if (passwordLabel) setElementText("password1.text", passwordLabel); containerID = "loginEditField"; fieldID = "dialog.loginname"; labelID = "login.text"; } unHideElementByID(containerID); var field = document.getElementById(fieldID); field.value = gCommonDialogParam.GetString(6); var label = gCommonDialogParam.GetString(4); if (label) setElementText(labelID, label); field.focus(); break; case 1: var editFieldIsPassword = gCommonDialogParam.GetInt(4); if (editFieldIsPassword == 1) { containerID = "password1EditField"; fieldID = "dialog.password1"; setElementText("password1.text", ""); // hide the meaningless text } else { containerID = "loginEditField"; fieldID = "dialog.loginname"; setElementText("login.text", gCommonDialogParam.GetString(4)); } unHideElementByID(containerID); field = document.getElementById(fieldID); field.value = gCommonDialogParam.GetString(6); field.focus(); break; } // set the pressed button to cancel to handle the case where the close box is pressed gCommonDialogParam.SetInt(0, 1); // set default focus // preferred order is textbox1, textbox2, textbox 3, OK, cancel, button2, button3 var visibilityList = ["loginEditField", "password1EditField", "password2EditField", "ok", "cancel", "Button2", "Button3"] var focusList = ["dialog.loginname", "dialog.password1", "dialog.password2", "ok", "cancel", "Button2", "Button3"] for (i = 0; i < visibilityList.length; i++) { if (isVisible(visibilityList[i])) { document.getElementById(focusList[i]).focus(); break; } }} |
window.title = gCommonDialogParam.GetString(12); | document.title = gCommonDialogParam.GetString(12); | function commonDialogOnLoad(){ // set the window title window.title = gCommonDialogParam.GetString(12); // set the number of command buttons var nButtons = gCommonDialogParam.GetInt(2); var dialog = document.documentElement; switch (nButtons) { case 1: dialog.getButton("cancel").hidden = true; break; case 4: dialog.getButton("extra2").hidden = false; case 3: dialog.getButton("extra1").hidden = false; } // display the main text var messageText = gCommonDialogParam.GetString(0); var messageParent = document.getElementById("info.box"); var messageParagraphs = messageText.split("\n"); for (var i = 0; i < messageParagraphs.length; i++) { var descriptionNode = document.createElement("description"); var text = document.createTextNode(messageParagraphs[i]); descriptionNode.appendChild(text); messageParent.appendChild(descriptionNode); } setElementText("info.header", gCommonDialogParam.GetString(3), true); // set the icon var iconElement = document.getElementById("info.icon"); var iconClass = gCommonDialogParam.GetString(2); if (!iconClass) iconClass = "message-icon"; iconElement.setAttribute("class", iconElement.getAttribute("class") + " " + iconClass); switch (nButtons) { case 4: setLabelForNode(document.documentElement.getButton("extra2"), gCommonDialogParam.GetString(11)); // fall through case 3: setLabelForNode(document.documentElement.getButton("extra1"), gCommonDialogParam.GetString(10)); // fall through default: case 2: var string = gCommonDialogParam.GetString(9); if (string) setLabelForNode(document.documentElement.getButton("cancel"), string); // fall through case 1: string = gCommonDialogParam.GetString(8); if (string) setLabelForNode(document.documentElement.getButton("accept"), string); break; } // set default result to cancelled gCommonDialogParam.SetInt(0, 1); // initialize the checkbox setCheckbox(gCommonDialogParam.GetString(1), gCommonDialogParam.GetInt(1)); if (gCommonDialogParam.GetInt(3) == 0) // If no text fields { var dButton; var defaultButton = gCommonDialogParam.GetInt(5); switch (defaultButton) { case 3: dButton = document.documentElement.getButton("extra2"); break; case 2: dButton = document.documentElement.getButton("extra1"); break; case 1: dButton = document.documentElement.getButton("cancel"); break; default: case 0: dButton = document.documentElement.getButton("accept"); break; } // move the default attribute and focus from the accept button // to the one specified in the dialog params document.documentElement.getButton("accept").setAttribute("default",false); dButton.setAttribute("default", true); dButton.focus(); } if (gCommonDialogParam.GetInt(6) != 0) // delay button enable { var delayInterval = 2000; try { var prefs = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); delayInterval = prefs.getIntPref("security.dialog_enable_delay"); } catch (e) {} document.documentElement.getButton("accept").disabled = true; document.documentElement.getButton("extra1").disabled = true; document.documentElement.getButton("extra2").disabled = true; setTimeout(commonDialogReenableButtons, delayInterval); } getAttention();} |
param.SetInt(2, listBox.selectedIndex ); | for (var i=0; i<numItems; i++) { if (elements[i] == list.selectedItems[0]) { param.SetInt(2, i ); break; } } | function commonDialogOnOK() { dump("commonDialogOnOK \n"); param.SetInt(2, listBox.selectedIndex ); param.SetInt(0, 0 ); return true;} |
compareFunc = function compare(first, second) { return CompareLowerCase(second[column], first[column]); } | var compareFunc = function compare(first, second) { return first[column].toLowerCase().localeCompare(second[column].toLowerCase()); } | compareFunc = function compare(first, second) { return CompareLowerCase(second[column], first[column]); } |
a = dateToMilliseconds(a); b = dateToMilliseconds(b); return ((a < b) ? -1 : (a > b) ? 1 : 0); | if (!a) return 1; if (!b) return -1; return (a.compare(b)); | function compareDate(a, b) { a = dateToMilliseconds(a); b = dateToMilliseconds(b); return ((a < b) ? -1 : // avoid underflow problems of subtraction (a > b) ? 1 : 0); } |
return compareString(eventA.categories, eventB.categories) * modifier; | return compareString(eventA.getProperty("CATEGORIES"), eventB.getProperty("CATEGORIES")) * modifier; | function compareEvents( eventA, eventB ){ var modifier = 1; if (treeView.sortDirection == "descending") { modifier = -1; } switch(treeView.selectedColumn) { case "unifinder-search-results-tree-col-title": return compareString(eventA.title, eventB.title) * modifier; case "unifinder-search-results-tree-col-startdate": var msNextStartA = msNextOrPreviousRecurrenceStart(eventA); var msNextStartB = msNextOrPreviousRecurrenceStart(eventB); return compareMSTime(msNextStartA, msNextStartB) * modifier; case "unifinder-search-results-tree-col-enddate": var msNextEndA = msNextOrPreviousRecurrenceEnd(eventA); var msNextEndB = msNextOrPreviousRecurrenceEnd(eventB); return compareMSTime(msNextEndA, msNextEndB) * modifier; case "unifinder-search-results-tree-col-categories": return compareString(eventA.categories, eventB.categories) * modifier; case "unifinder-search-results-tree-col-location": return compareString(eventA.getProperty("LOCATION"), eventB.getProperty("LOCATION")) * modifier; case "unifinder-search-results-tree-col-status": return compareNumber(kEventStatusOrder.indexOf(eventA.status), kEventStatusOrder.indexOf(eventB.status)) * modifier; case "unifinder-search-results-tree-col-calendarname": return compareString(eventA.calendar.name, eventB.calendar.name) * modifier; default: return 0; }} |
return compareDate(taskA.start, taskB.start) * modifier; | return compareDate(taskA.entryDate, taskB.entryDate) * modifier; | function compareTasks( taskA, taskB ){ var modifier = 1; if (toDoTreeView.sortDirection == "descending") { modifier = -1; } switch(toDoTreeView.selectedColumn) { case "unifinder-todo-tree-col-priority": // 0-9 return compareNumber(taskA.priority, taskB.priority) * modifier; case "unifinder-todo-tree-col-title": return compareString(taskA.title, taskB.title) * modifier; case "unifinder-todo-tree-col-startdate": return compareDate(taskA.start, taskB.start) * modifier; case "unifinder-todo-tree-col-duedate": return compareDate(taskA.due, taskB.due) * modifier; case "unifinder-todo-tree-col-completed": // checkbox if date exists case "unifinder-todo-tree-col-completeddate": return compareDate(taskA.completedDate, taskB.completedDate) * modifier; case "unifinder-todo-tree-col-percentcomplete": return compareNumber(taskA.percent, taskB.percent) * modifier; case "unifinder-todo-tree-col-categories": return compareString(taskA.categories, taskB.categories) * modifier; case "unifinder-todo-tree-col-location": return compareString(taskA.getProperty("LOCATION"), taskB.getProperty("LOCATION")) * modifier; case "unifinder-todo-tree-col-status": return compareNumber(kStatusOrder.indexOf(taskA.status), kStatusOrder.indexOf(taskB.status)) * modifier; case "unifinder-todo-tree-col-calendarname": return compareString(taskA.calendar.name, taskB.calendar.name) * modifier; default: return 0; }} |
return compareDate(taskA.due, taskB.due) * modifier; | return compareDate(taskA.dueDate, taskB.dueDate) * modifier; | function compareTasks( taskA, taskB ){ var modifier = 1; if (toDoTreeView.sortDirection == "descending") { modifier = -1; } switch(toDoTreeView.selectedColumn) { case "unifinder-todo-tree-col-priority": // 0-9 return compareNumber(taskA.priority, taskB.priority) * modifier; case "unifinder-todo-tree-col-title": return compareString(taskA.title, taskB.title) * modifier; case "unifinder-todo-tree-col-startdate": return compareDate(taskA.start, taskB.start) * modifier; case "unifinder-todo-tree-col-duedate": return compareDate(taskA.due, taskB.due) * modifier; case "unifinder-todo-tree-col-completed": // checkbox if date exists case "unifinder-todo-tree-col-completeddate": return compareDate(taskA.completedDate, taskB.completedDate) * modifier; case "unifinder-todo-tree-col-percentcomplete": return compareNumber(taskA.percent, taskB.percent) * modifier; case "unifinder-todo-tree-col-categories": return compareString(taskA.categories, taskB.categories) * modifier; case "unifinder-todo-tree-col-location": return compareString(taskA.getProperty("LOCATION"), taskB.getProperty("LOCATION")) * modifier; case "unifinder-todo-tree-col-status": return compareNumber(kStatusOrder.indexOf(taskA.status), kStatusOrder.indexOf(taskB.status)) * modifier; case "unifinder-todo-tree-col-calendarname": return compareString(taskA.calendar.name, taskB.calendar.name) * modifier; default: return 0; }} |
return compareNumber(taskA.percent, taskB.percent) * modifier; | return compareNumber(taskA.percentComplete, taskB.percentComplete) * modifier; | function compareTasks( taskA, taskB ){ var modifier = 1; if (toDoTreeView.sortDirection == "descending") { modifier = -1; } switch(toDoTreeView.selectedColumn) { case "unifinder-todo-tree-col-priority": // 0-9 return compareNumber(taskA.priority, taskB.priority) * modifier; case "unifinder-todo-tree-col-title": return compareString(taskA.title, taskB.title) * modifier; case "unifinder-todo-tree-col-startdate": return compareDate(taskA.start, taskB.start) * modifier; case "unifinder-todo-tree-col-duedate": return compareDate(taskA.due, taskB.due) * modifier; case "unifinder-todo-tree-col-completed": // checkbox if date exists case "unifinder-todo-tree-col-completeddate": return compareDate(taskA.completedDate, taskB.completedDate) * modifier; case "unifinder-todo-tree-col-percentcomplete": return compareNumber(taskA.percent, taskB.percent) * modifier; case "unifinder-todo-tree-col-categories": return compareString(taskA.categories, taskB.categories) * modifier; case "unifinder-todo-tree-col-location": return compareString(taskA.getProperty("LOCATION"), taskB.getProperty("LOCATION")) * modifier; case "unifinder-todo-tree-col-status": return compareNumber(kStatusOrder.indexOf(taskA.status), kStatusOrder.indexOf(taskB.status)) * modifier; case "unifinder-todo-tree-col-calendarname": return compareString(taskA.calendar.name, taskB.calendar.name) * modifier; default: return 0; }} |
return compareString(taskA.categories, taskB.categories) * modifier; | return compareString(taskA.getProperty("CATEGORIES"), taskB.getProperty("CATEGORIES")) * modifier; | function compareTasks( taskA, taskB ){ var modifier = 1; if (toDoTreeView.sortDirection == "descending") { modifier = -1; } switch(toDoTreeView.selectedColumn) { case "unifinder-todo-tree-col-priority": // 0-9 return compareNumber(taskA.priority, taskB.priority) * modifier; case "unifinder-todo-tree-col-title": return compareString(taskA.title, taskB.title) * modifier; case "unifinder-todo-tree-col-startdate": return compareDate(taskA.start, taskB.start) * modifier; case "unifinder-todo-tree-col-duedate": return compareDate(taskA.due, taskB.due) * modifier; case "unifinder-todo-tree-col-completed": // checkbox if date exists case "unifinder-todo-tree-col-completeddate": return compareDate(taskA.completedDate, taskB.completedDate) * modifier; case "unifinder-todo-tree-col-percentcomplete": return compareNumber(taskA.percent, taskB.percent) * modifier; case "unifinder-todo-tree-col-categories": return compareString(taskA.categories, taskB.categories) * modifier; case "unifinder-todo-tree-col-location": return compareString(taskA.getProperty("LOCATION"), taskB.getProperty("LOCATION")) * modifier; case "unifinder-todo-tree-col-status": return compareNumber(kStatusOrder.indexOf(taskA.status), kStatusOrder.indexOf(taskB.status)) * modifier; case "unifinder-todo-tree-col-calendarname": return compareString(taskA.calendar.name, taskB.calendar.name) * modifier; default: return 0; }} |
top.MAX_RECIPIENTS = 0; | function CompFields2Recipients(msgCompFields, msgType){ if (msgCompFields) { var treeChildren = document.getElementById('addressWidgetBody'); var newTreeChildrenNode = treeChildren.cloneNode(false); var templateNode = treeChildren.firstChild; awSetInputAndPopupFromArray(msgCompFields.SplitRecipients(msgCompFields.GetReplyTo(), false), "addr_reply", newTreeChildrenNode, templateNode); awSetInputAndPopupFromArray(msgCompFields.SplitRecipients(msgCompFields.GetTo(), false), "addr_to", newTreeChildrenNode, templateNode); awSetInputAndPopupFromArray(msgCompFields.SplitRecipients(msgCompFields.GetCc(), false), "addr_cc", newTreeChildrenNode, templateNode); awSetInputAndPopupFromArray(msgCompFields.SplitRecipients(msgCompFields.GetBcc(), false), "addr_bcc", newTreeChildrenNode, templateNode); awSetInputAndPopup(msgCompFields.GetOtherRandomHeaders(), "addr_other", newTreeChildrenNode, templateNode); awSetInputAndPopup(msgCompFields.GetNewsgroups(), "addr_newsgroups", newTreeChildrenNode, templateNode); awSetInputAndPopup(msgCompFields.GetFollowupTo(), "addr_followup", newTreeChildrenNode, templateNode); if (top.MAX_RECIPIENTS == 0) top.MAX_RECIPIENTS = 1; else { //If it's a new message, we need to add an extrat empty recipient. var msgComposeType = Components.interfaces.nsIMsgCompType; if (msgType == msgComposeType.New) _awSetInputAndPopup("", "addr_to", newTreeChildrenNode, templateNode); var parent = treeChildren.parentNode; parent.replaceChild(newTreeChildrenNode, treeChildren); setTimeout("awFinishCopyNodes();", 0); } }} |
|
if (top.MAX_RECIPIENTS == 0) { top.MAX_RECIPIENTS = 1; awSetAutoComplete(top.MAX_RECIPIENTS); } else { var msgComposeType = Components.interfaces.nsIMsgCompType; if (msgType == msgComposeType.New) _awSetInputAndPopup("", "addr_to", newTreeChildrenNode, templateNode); var parent = treeChildren.parentNode; parent.replaceChild(newTreeChildrenNode, treeChildren); setTimeout("awFinishCopyNodes();", 0); } | var msgComposeType = Components.interfaces.nsIMsgCompType; if (msgType == msgComposeType.New || top.MAX_RECIPIENTS == 0) _awSetInputAndPopup("", "addr_to", newTreeChildrenNode, templateNode); dump("replacing child in comp fields 2 recips \n"); var parent = treeChildren.parentNode; parent.replaceChild(newTreeChildrenNode, treeChildren); setTimeout("awFinishCopyNodes();", 0); | function CompFields2Recipients(msgCompFields, msgType){ if (msgCompFields) { var treeChildren = document.getElementById('addressWidgetBody'); var newTreeChildrenNode = treeChildren.cloneNode(false); var templateNode = treeChildren.firstChild; top.MAX_RECIPIENTS = 0; awSetInputAndPopupFromArray(msgCompFields.SplitRecipients(msgCompFields.GetReplyTo(), false), "addr_reply", newTreeChildrenNode, templateNode); awSetInputAndPopupFromArray(msgCompFields.SplitRecipients(msgCompFields.GetTo(), false), "addr_to", newTreeChildrenNode, templateNode); awSetInputAndPopupFromArray(msgCompFields.SplitRecipients(msgCompFields.GetCc(), false), "addr_cc", newTreeChildrenNode, templateNode); awSetInputAndPopupFromArray(msgCompFields.SplitRecipients(msgCompFields.GetBcc(), false), "addr_bcc", newTreeChildrenNode, templateNode); awSetInputAndPopup(msgCompFields.GetOtherRandomHeaders(), "addr_other", newTreeChildrenNode, templateNode); awSetInputAndPopup(msgCompFields.GetNewsgroups(), "addr_newsgroups", newTreeChildrenNode, templateNode); awSetInputAndPopup(msgCompFields.GetFollowupTo(), "addr_followup", newTreeChildrenNode, templateNode); if (top.MAX_RECIPIENTS == 0) { top.MAX_RECIPIENTS = 1; awSetAutoComplete(top.MAX_RECIPIENTS); } else { //If it's a new message, we need to add an extrat empty recipient. var msgComposeType = Components.interfaces.nsIMsgCompType; if (msgType == msgComposeType.New) _awSetInputAndPopup("", "addr_to", newTreeChildrenNode, templateNode); var parent = treeChildren.parentNode; parent.replaceChild(newTreeChildrenNode, treeChildren); setTimeout("awFinishCopyNodes();", 0); } }} |
var templateNode = awGetTreeItem(1); | var templateNode = treeChildren.firstChild; | function CompFields2Recipients(msgCompFields, msgType){ if (msgCompFields) { var treeChildren = document.getElementById('addressWidgetBody'); var newTreeChildrenNode = treeChildren.cloneNode(false);// var templateNode = treeChildren.firstChild(); // doesn't work! var templateNode = awGetTreeItem(1); awSetInputAndPopupFromArray(msgCompFields.SplitRecipients(msgCompFields.GetReplyTo(), false), "addr_reply", newTreeChildrenNode, templateNode); awSetInputAndPopupFromArray(msgCompFields.SplitRecipients(msgCompFields.GetTo(), false), "addr_to", newTreeChildrenNode, templateNode); awSetInputAndPopupFromArray(msgCompFields.SplitRecipients(msgCompFields.GetCc(), false), "addr_cc", newTreeChildrenNode, templateNode); awSetInputAndPopupFromArray(msgCompFields.SplitRecipients(msgCompFields.GetBcc(), false), "addr_bcc", newTreeChildrenNode, templateNode); awSetInputAndPopup(msgCompFields.GetOtherRandomHeaders(), "addr_other", newTreeChildrenNode, templateNode); awSetInputAndPopup(msgCompFields.GetNewsgroups(), "addr_newsgroups", newTreeChildrenNode, templateNode); awSetInputAndPopup(msgCompFields.GetFollowupTo(), "addr_followup", newTreeChildrenNode, templateNode); if (top.MAX_RECIPIENTS == 0) top.MAX_RECIPIENTS = 1; else { //If it's a new message, we need to add an extrat empty recipient. var msgComposeType = Components.interfaces.nsIMsgCompType; if (msgType == msgComposeType.New) _awSetInputAndPopup("", "addr_to", newTreeChildrenNode, templateNode);// var parent = treeChildren.parentNode(); // doesn't work! var parent = document.getElementById('addressingWidgetTree') parent.replaceChild(newTreeChildrenNode, treeChildren); setTimeout("awFinishCopyNodes();", 0); } }} |
var parent = document.getElementById('addressingWidgetTree') | var parent = treeChildren.parentNode; | function CompFields2Recipients(msgCompFields, msgType){ if (msgCompFields) { var treeChildren = document.getElementById('addressWidgetBody'); var newTreeChildrenNode = treeChildren.cloneNode(false);// var templateNode = treeChildren.firstChild(); // doesn't work! var templateNode = awGetTreeItem(1); awSetInputAndPopupFromArray(msgCompFields.SplitRecipients(msgCompFields.GetReplyTo(), false), "addr_reply", newTreeChildrenNode, templateNode); awSetInputAndPopupFromArray(msgCompFields.SplitRecipients(msgCompFields.GetTo(), false), "addr_to", newTreeChildrenNode, templateNode); awSetInputAndPopupFromArray(msgCompFields.SplitRecipients(msgCompFields.GetCc(), false), "addr_cc", newTreeChildrenNode, templateNode); awSetInputAndPopupFromArray(msgCompFields.SplitRecipients(msgCompFields.GetBcc(), false), "addr_bcc", newTreeChildrenNode, templateNode); awSetInputAndPopup(msgCompFields.GetOtherRandomHeaders(), "addr_other", newTreeChildrenNode, templateNode); awSetInputAndPopup(msgCompFields.GetNewsgroups(), "addr_newsgroups", newTreeChildrenNode, templateNode); awSetInputAndPopup(msgCompFields.GetFollowupTo(), "addr_followup", newTreeChildrenNode, templateNode); if (top.MAX_RECIPIENTS == 0) top.MAX_RECIPIENTS = 1; else { //If it's a new message, we need to add an extrat empty recipient. var msgComposeType = Components.interfaces.nsIMsgCompType; if (msgType == msgComposeType.New) _awSetInputAndPopup("", "addr_to", newTreeChildrenNode, templateNode);// var parent = treeChildren.parentNode(); // doesn't work! var parent = document.getElementById('addressingWidgetTree') parent.replaceChild(newTreeChildrenNode, treeChildren); setTimeout("awFinishCopyNodes();", 0); } }} |
awFitDummyRows(); | awFitDummyRows(2); | function CompFields2Recipients(msgCompFields, msgType){ if (msgCompFields) { var treeChildren = document.getElementById('addressWidgetBody'); var newTreeChildrenNode = treeChildren.cloneNode(false); var templateNode = treeChildren.firstChild; top.MAX_RECIPIENTS = 0; var msgReplyTo = msgCompFields.replyTo; var msgTo = msgCompFields.to; var msgCC = msgCompFields.cc; var msgBCC = msgCompFields.bcc; var msgRandomHeaders = msgCompFields.otherRandomHeaders; var msgNewsgroups = msgCompFields.newsgroups; var msgFollowupTo = msgCompFields.followupTo; if(msgReplyTo) awSetInputAndPopupFromArray(msgCompFields.SplitRecipients(msgReplyTo, false), "addr_reply", newTreeChildrenNode, templateNode); if(msgTo) awSetInputAndPopupFromArray(msgCompFields.SplitRecipients(msgTo, false), "addr_to", newTreeChildrenNode, templateNode); if(msgCC) awSetInputAndPopupFromArray(msgCompFields.SplitRecipients(msgCC, false), "addr_cc", newTreeChildrenNode, templateNode); if(msgBCC) awSetInputAndPopupFromArray(msgCompFields.SplitRecipients(msgBCC, false), "addr_bcc", newTreeChildrenNode, templateNode); if(msgRandomHeaders) awSetInputAndPopup(msgRandomHeaders, "addr_other", newTreeChildrenNode, templateNode); if(msgNewsgroups) awSetInputAndPopup(msgNewsgroups, "addr_newsgroups", newTreeChildrenNode, templateNode); if(msgFollowupTo) awSetInputAndPopup(msgFollowupTo, "addr_followup", newTreeChildrenNode, templateNode); //If it's a new message, we need to add an extrat empty recipient. if (!msgTo && !msgNewsgroups) _awSetInputAndPopup("", "addr_to", newTreeChildrenNode, templateNode); // dump("replacing child in comp fields 2 recips \n"); var parent = treeChildren.parentNode; parent.replaceChild(newTreeChildrenNode, treeChildren); awFitDummyRows(); setTimeout("awFinishCopyNodes();", 0); }} |
.each( callback, [res.responseText, status] ); | .each( callback, [res.responseText, status, res] ); | complete: function(res, status){ if ( status == "success" || !ifModified && status == "notmodified" ) { // Inject the HTML into all the matched elements self.html(res.responseText) // Execute all the scripts inside of the newly-injected HTML .evalScripts() // Execute callback .each( callback, [res.responseText, status] ); } else callback.apply( self, [res.responseText, status] ); } |
callback.apply( self, [res.responseText, status] ); | callback.apply( self, [res.responseText, status, res] ); | complete: function(res, status){ if ( status == "success" || !ifModified && status == "notmodified" ) { // Inject the HTML into all the matched elements self.html(res.responseText) // Execute all the scripts inside of the newly-injected HTML .evalScripts() // Execute callback .each( callback, [res.responseText, status] ); } else callback.apply( self, [res.responseText, status] ); } |
$.ajax({url: "data/name.php?wait=5", global: false, success: success, error: error, complete: function() { | $.ajax({url: "data/name.php?wait=5", global: false, beforeSend: send, success: success, error: error, complete: function() { | $.ajax({url: "data/name.php?wait=5", global: false, success: success, error: error, complete: function() { ok( counter.error == 1, 'Check failed request without globals' ); ok( counter.success == 0, 'Check failed request without globals' ); ok( counter.complete == 0, 'Check failed request without globals' ); start(); }}); |
ok( counter.send == 1, 'Check failed request without globals' ); | $.ajax({url: "data/name.php?wait=5", global: false, success: success, error: error, complete: function() { ok( counter.error == 1, 'Check failed request without globals' ); ok( counter.success == 0, 'Check failed request without globals' ); ok( counter.complete == 0, 'Check failed request without globals' ); start(); }}); |
|
if (commonDialogsService) | if (promptService) | function ComposeCanClose(){ // Returns FALSE only if user cancels save action if (contentChanged || msgCompose.bodyModified) { // call window.focus, since we need to pop up a dialog // and therefore need to be visible (to prevent user confusion) window.focus(); if (commonDialogsService) { var result = {value:0}; commonDialogsService.UniversalDialog( window, null, gComposeMsgsBundle.getString("saveDlogTitle"), gComposeMsgsBundle.getString("saveDlogMessage"), null, gComposeMsgsBundle.getString("saveDlogSaveBtn"), gComposeMsgsBundle.getString("saveDlogCancelBtn"), gComposeMsgsBundle.getString("saveDlogDontSaveBtn"), null, null, null, {value:0}, {value:0}, "chrome://global/skin/question-icon.gif", {value:"false"}, 3, 0, 0, result ); if (result) { switch (result.value) { case 0: //Save if (LastToClose()) NotifyQuitApplication(); SaveAsDraft(); break; case 1: //Cancel return false; case 2: //Don't Save break; } } } msgCompose.bodyModified = false; contentChanged = false; } return true;} |
commonDialogsService.UniversalDialog( | promptService.UniversalDialog( | function ComposeCanClose(){ // Returns FALSE only if user cancels save action if (contentChanged || msgCompose.bodyModified) { // call window.focus, since we need to pop up a dialog // and therefore need to be visible (to prevent user confusion) window.focus(); if (commonDialogsService) { var result = {value:0}; commonDialogsService.UniversalDialog( window, null, gComposeMsgsBundle.getString("saveDlogTitle"), gComposeMsgsBundle.getString("saveDlogMessage"), null, gComposeMsgsBundle.getString("saveDlogSaveBtn"), gComposeMsgsBundle.getString("saveDlogCancelBtn"), gComposeMsgsBundle.getString("saveDlogDontSaveBtn"), null, null, null, {value:0}, {value:0}, "chrome://global/skin/question-icon.gif", {value:"false"}, 3, 0, 0, result ); if (result) { switch (result.value) { case 0: //Save if (LastToClose()) NotifyQuitApplication(); SaveAsDraft(); break; case 1: //Cancel return false; case 2: //Don't Save break; } } } msgCompose.bodyModified = false; contentChanged = false; } return true;} |
if (LastToClose()) NotifyQuitApplication(); | function ComposeCanClose(){ // Returns FALSE only if user cancels save action if (contentChanged || msgCompose.bodyModified) { if (commonDialogsService) { var result = {value:0}; commonDialogsService.UniversalDialog( window, null, Bundle.GetStringFromName("saveDlogTitle"), Bundle.GetStringFromName("saveDlogMessage"), null, Bundle.GetStringFromName("saveDlogSaveBtn"), Bundle.GetStringFromName("saveDlogCancelBtn"), Bundle.GetStringFromName("saveDlogDontSaveBtn"), null, null, null, {value:0}, {value:0}, "chrome://global/skin/question-icon.gif", {value:"false"}, 3, 0, 0, result ); if (result) { switch (result.value) { case 0: //Save SaveAsDraft(); break; case 1: //Cancel return false; case 2: //Don't Save break; } } } msgCompose.bodyModified = false; contentChanged = false; } return true;} |
|
result = {value:0}; gPromptService.confirmEx(window, promptTitle, promptMsg, | result = gPromptService.confirmEx(window, promptTitle, promptMsg, | function ComposeCanClose(){ if (gSendOrSaveOperationInProgress) { var result; if (gPromptService) { var promptTitle = sComposeMsgsBundle.getString("quitComposeWindowTitle"); var promptMsg = sComposeMsgsBundle.getString("quitComposeWindowMessage"); var quitButtonLabel = sComposeMsgsBundle.getString("quitComposeWindowQuitButtonLabel"); var waitButtonLabel = sComposeMsgsBundle.getString("quitComposeWindowWaitButtonLabel"); result = {value:0}; gPromptService.confirmEx(window, promptTitle, promptMsg, (gPromptService.BUTTON_TITLE_IS_STRING*gPromptService.BUTTON_POS_0) + (gPromptService.BUTTON_TITLE_IS_STRING*gPromptService.BUTTON_POS_1), waitButtonLabel, quitButtonLabel, null, null, {value:0}, result); if (result.value == 1) { gMsgCompose.abort(); return true; } else { return false; } } } dump("XXX changed? " + gContentChanged + "," + gMsgCompose.bodyModified + "\n"); // Returns FALSE only if user cancels save action if (gContentChanged || gMsgCompose.bodyModified) { // call window.focus, since we need to pop up a dialog // and therefore need to be visible (to prevent user confusion) window.focus(); if (gPromptService) { result = {value:0}; gPromptService.confirmEx(window, sComposeMsgsBundle.getString("saveDlogTitle"), sComposeMsgsBundle.getString("saveDlogMessage"), (gPromptService.BUTTON_TITLE_SAVE * gPromptService.BUTTON_POS_0) + (gPromptService.BUTTON_TITLE_CANCEL * gPromptService.BUTTON_POS_1) + (gPromptService.BUTTON_TITLE_DONT_SAVE * gPromptService.BUTTON_POS_2), null, null, null, null, {value:0}, result); if (result) { switch (result.value) { case 0: //Save if (LastToClose()) NotifyQuitApplication(); gCloseWindowAfterSave = true; SaveAsDraft(); return false; case 1: //Cancel return false; case 2: //Don't Save break; } } } SetContentAndBodyAsUnmodified(); } return true;} |
waitButtonLabel, quitButtonLabel, null, null, {value:0}, result); | waitButtonLabel, quitButtonLabel, null, null, {value:0}); | function ComposeCanClose(){ if (gSendOrSaveOperationInProgress) { var result; if (gPromptService) { var promptTitle = sComposeMsgsBundle.getString("quitComposeWindowTitle"); var promptMsg = sComposeMsgsBundle.getString("quitComposeWindowMessage"); var quitButtonLabel = sComposeMsgsBundle.getString("quitComposeWindowQuitButtonLabel"); var waitButtonLabel = sComposeMsgsBundle.getString("quitComposeWindowWaitButtonLabel"); result = {value:0}; gPromptService.confirmEx(window, promptTitle, promptMsg, (gPromptService.BUTTON_TITLE_IS_STRING*gPromptService.BUTTON_POS_0) + (gPromptService.BUTTON_TITLE_IS_STRING*gPromptService.BUTTON_POS_1), waitButtonLabel, quitButtonLabel, null, null, {value:0}, result); if (result.value == 1) { gMsgCompose.abort(); return true; } else { return false; } } } dump("XXX changed? " + gContentChanged + "," + gMsgCompose.bodyModified + "\n"); // Returns FALSE only if user cancels save action if (gContentChanged || gMsgCompose.bodyModified) { // call window.focus, since we need to pop up a dialog // and therefore need to be visible (to prevent user confusion) window.focus(); if (gPromptService) { result = {value:0}; gPromptService.confirmEx(window, sComposeMsgsBundle.getString("saveDlogTitle"), sComposeMsgsBundle.getString("saveDlogMessage"), (gPromptService.BUTTON_TITLE_SAVE * gPromptService.BUTTON_POS_0) + (gPromptService.BUTTON_TITLE_CANCEL * gPromptService.BUTTON_POS_1) + (gPromptService.BUTTON_TITLE_DONT_SAVE * gPromptService.BUTTON_POS_2), null, null, null, null, {value:0}, result); if (result) { switch (result.value) { case 0: //Save if (LastToClose()) NotifyQuitApplication(); gCloseWindowAfterSave = true; SaveAsDraft(); return false; case 1: //Cancel return false; case 2: //Don't Save break; } } } SetContentAndBodyAsUnmodified(); } return true;} |
if (result.value == 1) { gMsgCompose.abort(); return true; } else { return false; } | if (result == 1) { gMsgCompose.abort(); return true; | function ComposeCanClose(){ if (gSendOrSaveOperationInProgress) { var result; if (gPromptService) { var promptTitle = sComposeMsgsBundle.getString("quitComposeWindowTitle"); var promptMsg = sComposeMsgsBundle.getString("quitComposeWindowMessage"); var quitButtonLabel = sComposeMsgsBundle.getString("quitComposeWindowQuitButtonLabel"); var waitButtonLabel = sComposeMsgsBundle.getString("quitComposeWindowWaitButtonLabel"); result = {value:0}; gPromptService.confirmEx(window, promptTitle, promptMsg, (gPromptService.BUTTON_TITLE_IS_STRING*gPromptService.BUTTON_POS_0) + (gPromptService.BUTTON_TITLE_IS_STRING*gPromptService.BUTTON_POS_1), waitButtonLabel, quitButtonLabel, null, null, {value:0}, result); if (result.value == 1) { gMsgCompose.abort(); return true; } else { return false; } } } dump("XXX changed? " + gContentChanged + "," + gMsgCompose.bodyModified + "\n"); // Returns FALSE only if user cancels save action if (gContentChanged || gMsgCompose.bodyModified) { // call window.focus, since we need to pop up a dialog // and therefore need to be visible (to prevent user confusion) window.focus(); if (gPromptService) { result = {value:0}; gPromptService.confirmEx(window, sComposeMsgsBundle.getString("saveDlogTitle"), sComposeMsgsBundle.getString("saveDlogMessage"), (gPromptService.BUTTON_TITLE_SAVE * gPromptService.BUTTON_POS_0) + (gPromptService.BUTTON_TITLE_CANCEL * gPromptService.BUTTON_POS_1) + (gPromptService.BUTTON_TITLE_DONT_SAVE * gPromptService.BUTTON_POS_2), null, null, null, null, {value:0}, result); if (result) { switch (result.value) { case 0: //Save if (LastToClose()) NotifyQuitApplication(); gCloseWindowAfterSave = true; SaveAsDraft(); return false; case 1: //Cancel return false; case 2: //Don't Save break; } } } SetContentAndBodyAsUnmodified(); } return true;} |
result = {value:0}; gPromptService.confirmEx(window, | result = gPromptService.confirmEx(window, | function ComposeCanClose(){ if (gSendOrSaveOperationInProgress) { var result; if (gPromptService) { var promptTitle = sComposeMsgsBundle.getString("quitComposeWindowTitle"); var promptMsg = sComposeMsgsBundle.getString("quitComposeWindowMessage"); var quitButtonLabel = sComposeMsgsBundle.getString("quitComposeWindowQuitButtonLabel"); var waitButtonLabel = sComposeMsgsBundle.getString("quitComposeWindowWaitButtonLabel"); result = {value:0}; gPromptService.confirmEx(window, promptTitle, promptMsg, (gPromptService.BUTTON_TITLE_IS_STRING*gPromptService.BUTTON_POS_0) + (gPromptService.BUTTON_TITLE_IS_STRING*gPromptService.BUTTON_POS_1), waitButtonLabel, quitButtonLabel, null, null, {value:0}, result); if (result.value == 1) { gMsgCompose.abort(); return true; } else { return false; } } } dump("XXX changed? " + gContentChanged + "," + gMsgCompose.bodyModified + "\n"); // Returns FALSE only if user cancels save action if (gContentChanged || gMsgCompose.bodyModified) { // call window.focus, since we need to pop up a dialog // and therefore need to be visible (to prevent user confusion) window.focus(); if (gPromptService) { result = {value:0}; gPromptService.confirmEx(window, sComposeMsgsBundle.getString("saveDlogTitle"), sComposeMsgsBundle.getString("saveDlogMessage"), (gPromptService.BUTTON_TITLE_SAVE * gPromptService.BUTTON_POS_0) + (gPromptService.BUTTON_TITLE_CANCEL * gPromptService.BUTTON_POS_1) + (gPromptService.BUTTON_TITLE_DONT_SAVE * gPromptService.BUTTON_POS_2), null, null, null, null, {value:0}, result); if (result) { switch (result.value) { case 0: //Save if (LastToClose()) NotifyQuitApplication(); gCloseWindowAfterSave = true; SaveAsDraft(); return false; case 1: //Cancel return false; case 2: //Don't Save break; } } } SetContentAndBodyAsUnmodified(); } return true;} |
null, {value:0}, result); if (result) | null, {value:0}); switch (result) | function ComposeCanClose(){ if (gSendOrSaveOperationInProgress) { var result; if (gPromptService) { var promptTitle = sComposeMsgsBundle.getString("quitComposeWindowTitle"); var promptMsg = sComposeMsgsBundle.getString("quitComposeWindowMessage"); var quitButtonLabel = sComposeMsgsBundle.getString("quitComposeWindowQuitButtonLabel"); var waitButtonLabel = sComposeMsgsBundle.getString("quitComposeWindowWaitButtonLabel"); result = {value:0}; gPromptService.confirmEx(window, promptTitle, promptMsg, (gPromptService.BUTTON_TITLE_IS_STRING*gPromptService.BUTTON_POS_0) + (gPromptService.BUTTON_TITLE_IS_STRING*gPromptService.BUTTON_POS_1), waitButtonLabel, quitButtonLabel, null, null, {value:0}, result); if (result.value == 1) { gMsgCompose.abort(); return true; } else { return false; } } } dump("XXX changed? " + gContentChanged + "," + gMsgCompose.bodyModified + "\n"); // Returns FALSE only if user cancels save action if (gContentChanged || gMsgCompose.bodyModified) { // call window.focus, since we need to pop up a dialog // and therefore need to be visible (to prevent user confusion) window.focus(); if (gPromptService) { result = {value:0}; gPromptService.confirmEx(window, sComposeMsgsBundle.getString("saveDlogTitle"), sComposeMsgsBundle.getString("saveDlogMessage"), (gPromptService.BUTTON_TITLE_SAVE * gPromptService.BUTTON_POS_0) + (gPromptService.BUTTON_TITLE_CANCEL * gPromptService.BUTTON_POS_1) + (gPromptService.BUTTON_TITLE_DONT_SAVE * gPromptService.BUTTON_POS_2), null, null, null, null, {value:0}, result); if (result) { switch (result.value) { case 0: //Save if (LastToClose()) NotifyQuitApplication(); gCloseWindowAfterSave = true; SaveAsDraft(); return false; case 1: //Cancel return false; case 2: //Don't Save break; } } } SetContentAndBodyAsUnmodified(); } return true;} |
switch (result.value) { case 0: if (LastToClose()) NotifyQuitApplication(); gCloseWindowAfterSave = true; SaveAsDraft(); return false; case 1: return false; case 2: break; } | case 0: if (LastToClose()) NotifyQuitApplication(); gCloseWindowAfterSave = true; SaveAsDraft(); return false; case 1: return false; case 2: break; | function ComposeCanClose(){ if (gSendOrSaveOperationInProgress) { var result; if (gPromptService) { var promptTitle = sComposeMsgsBundle.getString("quitComposeWindowTitle"); var promptMsg = sComposeMsgsBundle.getString("quitComposeWindowMessage"); var quitButtonLabel = sComposeMsgsBundle.getString("quitComposeWindowQuitButtonLabel"); var waitButtonLabel = sComposeMsgsBundle.getString("quitComposeWindowWaitButtonLabel"); result = {value:0}; gPromptService.confirmEx(window, promptTitle, promptMsg, (gPromptService.BUTTON_TITLE_IS_STRING*gPromptService.BUTTON_POS_0) + (gPromptService.BUTTON_TITLE_IS_STRING*gPromptService.BUTTON_POS_1), waitButtonLabel, quitButtonLabel, null, null, {value:0}, result); if (result.value == 1) { gMsgCompose.abort(); return true; } else { return false; } } } dump("XXX changed? " + gContentChanged + "," + gMsgCompose.bodyModified + "\n"); // Returns FALSE only if user cancels save action if (gContentChanged || gMsgCompose.bodyModified) { // call window.focus, since we need to pop up a dialog // and therefore need to be visible (to prevent user confusion) window.focus(); if (gPromptService) { result = {value:0}; gPromptService.confirmEx(window, sComposeMsgsBundle.getString("saveDlogTitle"), sComposeMsgsBundle.getString("saveDlogMessage"), (gPromptService.BUTTON_TITLE_SAVE * gPromptService.BUTTON_POS_0) + (gPromptService.BUTTON_TITLE_CANCEL * gPromptService.BUTTON_POS_1) + (gPromptService.BUTTON_TITLE_DONT_SAVE * gPromptService.BUTTON_POS_2), null, null, null, null, {value:0}, result); if (result) { switch (result.value) { case 0: //Save if (LastToClose()) NotifyQuitApplication(); gCloseWindowAfterSave = true; SaveAsDraft(); return false; case 1: //Cancel return false; case 2: //Don't Save break; } } } SetContentAndBodyAsUnmodified(); } return true;} |
promptService.universalDialog( window, null, gComposeMsgsBundle.getString("saveDlogTitle"), gComposeMsgsBundle.getString("saveDlogMessage"), null, gComposeMsgsBundle.getString("saveDlogSaveBtn"), gComposeMsgsBundle.getString("saveDlogCancelBtn"), gComposeMsgsBundle.getString("saveDlogDontSaveBtn"), null, null, null, {value:0}, {value:0}, "question-icon", {value:"false"}, 3, 0, 0, result ); | promptService.confirmEx(window, gComposeMsgsBundle.getString("saveDlogTitle"), gComposeMsgsBundle.getString("saveDlogMessage"), (promptService.BUTTON_TITLE_SAVE * promptService.BUTTON_POS_0) + (promptService.BUTTON_TITLE_CANCEL * promptService.BUTTON_POS_1), gComposeMsgsBundle.getString("saveDlogDontSaveBtn"), null, {value:0}, result); | function ComposeCanClose(){ if (sendOrSaveOperationInProgress) return false; // Returns FALSE only if user cancels save action if (contentChanged || msgCompose.bodyModified) { // call window.focus, since we need to pop up a dialog // and therefore need to be visible (to prevent user confusion) window.focus(); if (promptService) { var result = {value:0}; promptService.universalDialog( window, null, gComposeMsgsBundle.getString("saveDlogTitle"), gComposeMsgsBundle.getString("saveDlogMessage"), null, gComposeMsgsBundle.getString("saveDlogSaveBtn"), gComposeMsgsBundle.getString("saveDlogCancelBtn"), gComposeMsgsBundle.getString("saveDlogDontSaveBtn"), null, null, null, {value:0}, {value:0}, "question-icon", {value:"false"}, 3, 0, 0, result ); if (result) { switch (result.value) { case 0: //Save if (LastToClose()) NotifyQuitApplication(); SaveAsDraft(); break; case 1: //Cancel return false; case 2: //Don't Save break; } } } msgCompose.bodyModified = false; contentChanged = false; } return true;} |
var result = {value:0}; | result = {value:0}; | function ComposeCanClose(){ if (!gPromptService) { gPromptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(); gPromptService = gPromptService.QueryInterface(Components.interfaces.nsIPromptService); } if (sendOrSaveOperationInProgress) { if (gPromptService) { var promptTitle = gComposeMsgsBundle.getString("quitComposeWindowTitle"); var promptMsg = gComposeMsgsBundle.getString("quitComposeWindowMessage"); var quitButtonLabel = gComposeMsgsBundle.getString("quitComposeWindowQuitButtonLabel"); var waitButtonLabel = gComposeMsgsBundle.getString("quitComposeWindowWaitButtonLabel"); var result = {value:0}; gPromptService.confirmEx(window, promptTitle, promptMsg, (gPromptService.BUTTON_TITLE_IS_STRING*gPromptService.BUTTON_POS_0) + (gPromptService.BUTTON_TITLE_IS_STRING*gPromptService.BUTTON_POS_1), waitButtonLabel, quitButtonLabel, null, null, {value:0}, result); if (result.value == 1) { msgCompose.abort(); return true; } else { return false; } } } // Returns FALSE only if user cancels save action if (contentChanged || msgCompose.bodyModified) { // call window.focus, since we need to pop up a dialog // and therefore need to be visible (to prevent user confusion) window.focus(); if (gPromptService) { var result = {value:0}; gPromptService.confirmEx(window, gComposeMsgsBundle.getString("saveDlogTitle"), gComposeMsgsBundle.getString("saveDlogMessage"), (gPromptService.BUTTON_TITLE_SAVE * gPromptService.BUTTON_POS_0) + (gPromptService.BUTTON_TITLE_CANCEL * gPromptService.BUTTON_POS_1) + (gPromptService.BUTTON_TITLE_DONT_SAVE * gPromptService.BUTTON_POS_2), null, null, null, null, {value:0}, result); if (result) { switch (result.value) { case 0: //Save if (LastToClose()) NotifyQuitApplication(); SaveAsDraft(); break; case 1: //Cancel return false; case 2: //Don't Save break; } } } msgCompose.bodyModified = false; contentChanged = false; } return true;} |
enableEditableFields(); | function ComposeFieldsReady(msgType){ //If we are in plain text, we need to set the wrap column if (! gMsgCompose.composeHTML) { try { gMsgCompose.editor.QueryInterface(nsIPlaintextEditorMail).wrapWidth = gMsgCompose.wrapLength; } catch (e) { dump("### textEditor.wrapWidth exception text: " + e + " - failed\n"); } } CompFields2Recipients(gMsgCompose.compFields, gMsgCompose.type); SetComposeWindowTitle(); AdjustFocus();} |
|
setupLdapAutocompleteSession(); | function ComposeFieldsReady(msgType){ //If we are in plain text, we nee to set the wrap column if (! msgCompose.composeHTML) try { window.editorShell.wrapColumn = msgCompose.wrapLength; } catch (e) { dump("### window.editorShell.wrapColumn exception text: " + e + " - failed\n"); } CompFields2Recipients(msgCompose.compFields, msgCompose.type); SetComposeWindowTitle(13); AdjustFocus(); try { window.updateCommands("create"); } catch(e) {}} |
|
if (commonDialogsService) commonDialogsService.Alert(window, errorTitle, errorMsg); | if (promptService) promptService.Alert(window, errorTitle, errorMsg); | function ComposeLoad(){ if (msgComposeService) msgComposeService.TimeStamp("Start Initializing the compose window (ComposeLoad)", false); gComposeMsgsBundle = document.getElementById("bundle_composeMsgs"); try { SetupCommandUpdateHandlers(); var wizardcallback = true; var state = verifyAccounts(wizardcallback); // this will do migration, or create a new account if we need to. if (other_header != "") { var selectNode = document.getElementById('msgRecipientType#1'); selectNode = selectNode.childNodes[0]; var opt = document.createElement('menuitem'); opt.setAttribute("value", "addr_other"); opt.setAttribute("label", other_header + ":"); selectNode.appendChild(opt); } if(state) ComposeStartup(); } catch (ex) { dump("###ERROR WHILE LOADING MESSAGE COMPOSE: " + ex + "\n"); var errorTitle = gComposeMsgsBundle.getString("initErrorDlogTitle"); var errorMsg = gComposeMsgsBundle.getString("initErrorDlogMessage"); errorMsg = errorMsg.replace(/%1\$s/, ex); if (commonDialogsService) commonDialogsService.Alert(window, errorTitle, errorMsg); else window.alert(errorMsg); if (msgCompose) msgCompose.CloseWindow(); else window.close(); return; } window.tryToClose=ComposeCanClose; if (msgComposeService) msgComposeService.TimeStamp("Done with the initialization (ComposeLoad). Waiting on editor to load about::blank", false);} |
if (sOther_headers != "") { | if (sOther_headers) { var selectNode = document.getElementById('addressCol1#1'); | function ComposeLoad(){ // First get the preferences service try { var prefService = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefService); sPrefs = prefService.getBranch(null); sPrefBranchInternal = sPrefs.QueryInterface(Components.interfaces.nsIPrefBranchInternal); } catch (ex) { dump("failed to preferences services\n"); } try { sOther_headers = sPrefs.getCharPref("mail.compose.other.header"); } catch (ex) { dump("failed to get the mail.compose.other.header pref\n"); } AddMessageComposeOfflineObserver(); AddDirectoryServerObserver(true); if (gLogComposePerformance) sMsgComposeService.TimeStamp("Start initializing the compose window (ComposeLoad)", false); try { SetupCommandUpdateHandlers(); var wizardcallback = true; var state = verifyAccounts(wizardcallback); // this will do migration, or create a new account if we need to. if (sOther_headers != "") { var sOther_headers_Array = sOther_headers.split(","); for (i = 0; i < sOther_headers_Array.length; i++) { var selectNode = document.getElementById('addressCol1#1'); selectNode = selectNode.childNodes[0]; var opt = document.createElement('menuitem'); opt.setAttribute("value", "addr_other"); opt.setAttribute("label", sOther_headers_Array[i] + ":"); selectNode.appendChild(opt); } } if (state) ComposeStartup(false, null); } catch (ex) { var errorTitle = sComposeMsgsBundle.getString("initErrorDlogTitle"); var errorMsg = sComposeMsgsBundle.getFormattedString("initErrorDlogMessage", [ex]); if (gPromptService) gPromptService.alert(window, errorTitle, errorMsg); else window.alert(errorMsg); if (gMsgCompose) gMsgCompose.CloseWindow(false); //Don't try to recycle a bogus window else window.close(); return; } window.tryToClose=ComposeCanClose; if (gLogComposePerformance) sMsgComposeService.TimeStamp("Done with the initialization (ComposeLoad). Waiting on editor to load about:blank", false);} |
for (i = 0; i < sOther_headers_Array.length; i++) { var selectNode = document.getElementById('addressCol1#1'); selectNode = selectNode.childNodes[0]; var opt = document.createElement('menuitem'); opt.setAttribute("value", "addr_other"); opt.setAttribute("label", sOther_headers_Array[i] + ":"); selectNode.appendChild(opt); } | for (var i = 0; i < sOther_headers_Array.length; i++) selectNode.appendItem(sOther_headers_Array[i] + ":", "addr_other"); | function ComposeLoad(){ // First get the preferences service try { var prefService = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefService); sPrefs = prefService.getBranch(null); sPrefBranchInternal = sPrefs.QueryInterface(Components.interfaces.nsIPrefBranchInternal); } catch (ex) { dump("failed to preferences services\n"); } try { sOther_headers = sPrefs.getCharPref("mail.compose.other.header"); } catch (ex) { dump("failed to get the mail.compose.other.header pref\n"); } AddMessageComposeOfflineObserver(); AddDirectoryServerObserver(true); if (gLogComposePerformance) sMsgComposeService.TimeStamp("Start initializing the compose window (ComposeLoad)", false); try { SetupCommandUpdateHandlers(); var wizardcallback = true; var state = verifyAccounts(wizardcallback); // this will do migration, or create a new account if we need to. if (sOther_headers != "") { var sOther_headers_Array = sOther_headers.split(","); for (i = 0; i < sOther_headers_Array.length; i++) { var selectNode = document.getElementById('addressCol1#1'); selectNode = selectNode.childNodes[0]; var opt = document.createElement('menuitem'); opt.setAttribute("value", "addr_other"); opt.setAttribute("label", sOther_headers_Array[i] + ":"); selectNode.appendChild(opt); } } if (state) ComposeStartup(false, null); } catch (ex) { var errorTitle = sComposeMsgsBundle.getString("initErrorDlogTitle"); var errorMsg = sComposeMsgsBundle.getFormattedString("initErrorDlogMessage", [ex]); if (gPromptService) gPromptService.alert(window, errorTitle, errorMsg); else window.alert(errorMsg); if (gMsgCompose) gMsgCompose.CloseWindow(false); //Don't try to recycle a bogus window else window.close(); return; } window.tryToClose=ComposeCanClose; if (gLogComposePerformance) sMsgComposeService.TimeStamp("Done with the initialization (ComposeLoad). Waiting on editor to load about:blank", false);} |
} try { sAccountManagerDataSource = Components.classes["@mozilla.org/rdf/datasource;1?name=msgaccountmanager"].createInstance(Components.interfaces.nsIRDFDataSource); sRDF = Components.classes['@mozilla.org/rdf/rdf-service;1'].getService(Components.interfaces.nsIRDFService); sNameProperty = sRDF.GetResource("http: } catch (ex) { dump("failed to get RDF\n"); | function ComposeLoad(){ // First get the preferences service try { var prefService = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefService); sPrefs = prefService.getBranch(null); sPrefBranchInternal = sPrefs.QueryInterface(Components.interfaces.nsIPrefBranchInternal); } catch (ex) { dump("failed to preferences services\n"); } try { sOther_headers = sPrefs.getCharPref("mail.compose.other.header"); } catch (ex) { dump("failed to get the mail.compose.other.header pref\n"); } AddMessageComposeOfflineObserver(); AddDirectoryServerObserver(true); if (gLogComposePerformance) sMsgComposeService.TimeStamp("Start initializing the compose window (ComposeLoad)", false); try { SetupCommandUpdateHandlers(); var wizardcallback = true; var state = verifyAccounts(wizardcallback); // this will do migration, or create a new account if we need to. if (sOther_headers) { var selectNode = document.getElementById('addressCol1#1'); var sOther_headers_Array = sOther_headers.split(","); for (var i = 0; i < sOther_headers_Array.length; i++) selectNode.appendItem(sOther_headers_Array[i] + ":", "addr_other"); } if (state) ComposeStartup(false, null); } catch (ex) { dump("EX: = " + ex + "\n"); var errorTitle = sComposeMsgsBundle.getString("initErrorDlogTitle"); var errorMsg = sComposeMsgsBundle.getFormattedString("initErrorDlogMessage", [""]); if (gPromptService) gPromptService.alert(window, errorTitle, errorMsg); else window.alert(errorMsg); if (gMsgCompose) gMsgCompose.CloseWindow(false); //Don't try to recycle a bogus window else window.close(); return; } window.tryToClose=ComposeCanClose; if (gLogComposePerformance) sMsgComposeService.TimeStamp("Done with the initialization (ComposeLoad). Waiting on editor to load about:blank", false);} |
|
var selectNode = document.getElementById('msgRecipientType#1'); | var selectNode = document.getElementById('addressCol1#1'); | function ComposeLoad(){ // First get the preferences service try { var prefService = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefService); sPrefs = prefService.getBranch(null); sPrefBranchInternal = sPrefs.QueryInterface(Components.interfaces.nsIPrefBranchInternal); } catch (ex) { dump("failed to preferences services\n"); } try { sOther_header = sPrefs.getCharPref("mail.compose.other.header"); } catch (ex) { dump("failed to get the mail.compose.other.header pref\n"); } AddMessageComposeOfflineObserver(); AddDirectoryServerObserver(true); if (gLogComposePerformance) sMsgComposeService.TimeStamp("Start initializing the compose window (ComposeLoad)", false); try { SetupCommandUpdateHandlers(); var wizardcallback = true; var state = verifyAccounts(wizardcallback); // this will do migration, or create a new account if we need to. if (sOther_header != "") { var selectNode = document.getElementById('msgRecipientType#1'); selectNode = selectNode.childNodes[0]; var opt = document.createElement('menuitem'); opt.setAttribute("value", "addr_other"); opt.setAttribute("label", sOther_header + ":"); selectNode.appendChild(opt); } if (state) ComposeStartup(false, null); } catch (ex) { var errorTitle = sComposeMsgsBundle.getString("initErrorDlogTitle"); var errorMsg = sComposeMsgsBundle.getFormattedString("initErrorDlogMessage", [ex]); if (gPromptService) gPromptService.alert(window, errorTitle, errorMsg); else window.alert(errorMsg); if (gMsgCompose) gMsgCompose.CloseWindow(false); //Don't try to recycle a bogus window else window.close(); return; } window.tryToClose=ComposeCanClose; if (gLogComposePerformance) sMsgComposeService.TimeStamp("Done with the initialization (ComposeLoad). Waiting on editor to load about:blank", false);} |
msgComposeService.TimeStamp("Start Initializing the compose window (ComposeLoad)", false); | msgComposeService.TimeStamp("Start initializing the compose window (ComposeLoad)", false); | function ComposeLoad(){ AddMessageComposeOfflineObserver(); AddDirectoryServerObserver(true); if (gLogComposePerformance) msgComposeService.TimeStamp("Start Initializing the compose window (ComposeLoad)", false); gComposeMsgsBundle = document.getElementById("bundle_composeMsgs"); try { SetupCommandUpdateHandlers(); var wizardcallback = true; var state = verifyAccounts(wizardcallback); // this will do migration, or create a new account if we need to. if (other_header != "") { var selectNode = document.getElementById('msgRecipientType#1'); selectNode = selectNode.childNodes[0]; var opt = document.createElement('menuitem'); opt.setAttribute("value", "addr_other"); opt.setAttribute("label", other_header + ":"); selectNode.appendChild(opt); } if (state) ComposeStartup(); } catch (ex) { var errorTitle = gComposeMsgsBundle.getString("initErrorDlogTitle"); var errorMsg = gComposeMsgsBundle.getFormattedString("initErrorDlogMessage", [ex]); if (!gPromptService) { gPromptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(); gPromptService = gPromptService.QueryInterface(Components.interfaces.nsIPromptService); } if (gPromptService) gPromptService.alert(window, errorTitle, errorMsg); else window.alert(errorMsg); if (msgCompose) msgCompose.CloseWindow(); else window.close(); return; } window.tryToClose=ComposeCanClose; if (gLogComposePerformance) msgComposeService.TimeStamp("Done with the initialization (ComposeLoad). Waiting on editor to load about::blank", false);} |
msgComposeService.TimeStamp("Done with the initialization (ComposeLoad). Waiting on editor to load about::blank", false); | msgComposeService.TimeStamp("Done with the initialization (ComposeLoad). Waiting on editor to load about:blank", false); | function ComposeLoad(){ AddMessageComposeOfflineObserver(); AddDirectoryServerObserver(true); if (gLogComposePerformance) msgComposeService.TimeStamp("Start Initializing the compose window (ComposeLoad)", false); gComposeMsgsBundle = document.getElementById("bundle_composeMsgs"); try { SetupCommandUpdateHandlers(); var wizardcallback = true; var state = verifyAccounts(wizardcallback); // this will do migration, or create a new account if we need to. if (other_header != "") { var selectNode = document.getElementById('msgRecipientType#1'); selectNode = selectNode.childNodes[0]; var opt = document.createElement('menuitem'); opt.setAttribute("value", "addr_other"); opt.setAttribute("label", other_header + ":"); selectNode.appendChild(opt); } if (state) ComposeStartup(); } catch (ex) { var errorTitle = gComposeMsgsBundle.getString("initErrorDlogTitle"); var errorMsg = gComposeMsgsBundle.getFormattedString("initErrorDlogMessage", [ex]); if (!gPromptService) { gPromptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(); gPromptService = gPromptService.QueryInterface(Components.interfaces.nsIPromptService); } if (gPromptService) gPromptService.alert(window, errorTitle, errorMsg); else window.alert(errorMsg); if (msgCompose) msgCompose.CloseWindow(); else window.close(); return; } window.tryToClose=ComposeCanClose; if (gLogComposePerformance) msgComposeService.TimeStamp("Done with the initialization (ComposeLoad). Waiting on editor to load about::blank", false);} |
AddDirectoryServerObserver(true); | function ComposeLoad(){ AddMessageComposeOfflineObserver(); if (msgComposeService) msgComposeService.TimeStamp("Start Initializing the compose window (ComposeLoad)", false); gComposeMsgsBundle = document.getElementById("bundle_composeMsgs"); try { SetupCommandUpdateHandlers(); var wizardcallback = true; var state = verifyAccounts(wizardcallback); // this will do migration, or create a new account if we need to. if (other_header != "") { var selectNode = document.getElementById('msgRecipientType#1'); selectNode = selectNode.childNodes[0]; var opt = document.createElement('menuitem'); opt.setAttribute("value", "addr_other"); opt.setAttribute("label", other_header + ":"); selectNode.appendChild(opt); } if(state) ComposeStartup(); } catch (ex) { dump("###ERROR WHILE LOADING MESSAGE COMPOSE: " + ex + "\n"); var errorTitle = gComposeMsgsBundle.getString("initErrorDlogTitle"); var errorMsg = gComposeMsgsBundle.getFormattedString("initErrorDlogMessage", [ex]); if (promptService) promptService.alert(window, errorTitle, errorMsg); else window.alert(errorMsg); if (msgCompose) msgCompose.CloseWindow(); else window.close(); return; } window.tryToClose=ComposeCanClose; if (msgComposeService) msgComposeService.TimeStamp("Done with the initialization (ComposeLoad). Waiting on editor to load about::blank", false);} |
|
newsgroup = uri; | var resource = RDF.GetResource(uri); var msgfolder = resource.QueryInterface(Components.interfaces.nsIMsgFolder); if (msgfolder.isServer) newsgroup = ""; else newsgroup = msgfolder.name; | function ComposeMessage(type, format) //type is a nsIMsgCompType and format is a nsIMsgCompFormat{ var msgComposeType = Components.interfaces.nsIMsgCompType; var identity = null; var newsgroup = null; try { var folderTree = GetFolderTree(); var selectedFolderList = folderTree.selectedItems; if(selectedFolderList.length > 0) { var selectedFolder = selectedFolderList[0]; var uri = selectedFolder.getAttribute('id'); // dump("selectedFolder uri = " + uri + "\n"); // get the incoming server associated with this uri var server = FindIncomingServer(uri); // if they hit new and they are reading a newsgroup // turn this into a new post, not a new mail message if (type == msgComposeType.New) { if (server.type == "nntp") { type = msgComposeType.NewsPost; newsgroup = uri; } } // dump("server = " + server + "\n"); // get the identity associated with this server var identities = accountManager.GetIdentitiesForServer(server); // dump("identities = " + identities + "\n"); // just get the first one if (identities.Count() > 0 ) { identity = identities.GetElementAt(0).QueryInterface(Components.interfaces.nsIMsgIdentity); } } // dump("identity = " + identity + "\n"); } catch (ex) { // dump("failed to get an identity to pre-select\n"); } dump("\nComposeMessage from XUL\n"); var uri = null; if (! msgComposeService) { dump("### msgComposeService is invalid\n"); return; } if (type == msgComposeType.New) //new message { //dump("OpenComposeWindow with " + identity + "\n"); msgComposeService.OpenComposeWindow(null, null, type, format, identity); return; } else if (type == msgComposeType.NewsPost) { //dump("OpenComposeWindow with " + identity + " and " + newsgroup + "\n"); msgComposeService.OpenComposeWindow(null, newsgroup, type, format, identity); return; } var tree = GetThreadTree(); if (tree) { var nodeList = tree.selectedItems; var appCore = FindMessenger(); if (appCore) appCore.SetWindow(window, msgWindow); var object = null; if (nodeList && nodeList.length > 0) { uri = ""; for (var i = 0; i < nodeList.length && i < 8; i ++) { dump('i = '+ i); dump('\n'); if (type == msgComposeType.Reply || type == msgComposeType.ReplyAll || type == msgComposeType.ForwardInline) { msgComposeService.OpenComposeWindow(null, nodeList[i].getAttribute('id'), type, format, identity); } else { if (i) uri += "," uri += nodeList[i].getAttribute('id'); } } if (type == msgComposeType.ForwardAsAttachment) { msgComposeService.OpenComposeWindow(null, uri, type, format, identity); } } else dump("### nodeList is invalid\n"); } else dump("### tree is invalid\n");} |
dump("OpenComposeWindow with " + identity + " and " + newsgroup + "\n"); | function ComposeMessage(type, format) //type is a nsIMsgCompType and format is a nsIMsgCompFormat{ var msgComposeType = Components.interfaces.nsIMsgCompType; var identity = null; var newsgroup = null; try { var folderTree = GetFolderTree(); var selectedFolderList = folderTree.selectedItems; if(selectedFolderList.length > 0) { var selectedFolder = selectedFolderList[0]; var uri = selectedFolder.getAttribute('id'); // dump("selectedFolder uri = " + uri + "\n"); // get the incoming server associated with this uri var server = FindIncomingServer(uri); // if they hit new and they are reading a newsgroup // turn this into a new post, not a new mail message if (type == msgComposeType.New) { if (server.type == "nntp") { type = msgComposeType.NewsPost; newsgroup = uri; } } // dump("server = " + server + "\n"); // get the identity associated with this server var identities = accountManager.GetIdentitiesForServer(server); // dump("identities = " + identities + "\n"); // just get the first one if (identities.Count() > 0 ) { identity = identities.GetElementAt(0).QueryInterface(Components.interfaces.nsIMsgIdentity); } } // dump("identity = " + identity + "\n"); } catch (ex) { // dump("failed to get an identity to pre-select\n"); } dump("\nComposeMessage from XUL\n"); var uri = null; if (! msgComposeService) { dump("### msgComposeService is invalid\n"); return; } if (type == msgComposeType.New) //new message { //dump("OpenComposeWindow with " + identity + "\n"); msgComposeService.OpenComposeWindow(null, null, type, format, identity); return; } else if (type == msgComposeType.NewsPost) { //dump("OpenComposeWindow with " + identity + " and " + newsgroup + "\n"); msgComposeService.OpenComposeWindow(null, newsgroup, type, format, identity); return; } var tree = GetThreadTree(); if (tree) { var nodeList = tree.selectedItems; var appCore = FindMessenger(); if (appCore) appCore.SetWindow(window, msgWindow); var object = null; if (nodeList && nodeList.length > 0) { uri = ""; for (var i = 0; i < nodeList.length && i < 8; i ++) { dump('i = '+ i); dump('\n'); if (type == msgComposeType.Reply || type == msgComposeType.ReplyAll || type == msgComposeType.ForwardInline) { msgComposeService.OpenComposeWindow(null, nodeList[i].getAttribute('id'), type, format, identity); } else { if (i) uri += "," uri += nodeList[i].getAttribute('id'); } } if (type == msgComposeType.ForwardAsAttachment) { msgComposeService.OpenComposeWindow(null, uri, type, format, identity); } } else dump("### nodeList is invalid\n"); } else dump("### tree is invalid\n");} |
|
if (! msgComposeService) { dump("### msgComposeService is invalid\n"); return; } if (type == msgComposeType.New) { | if (! msgComposeService) { dump("### msgComposeService is invalid\n"); return; } | function ComposeMessage(type, format, folder, messageArray) { var msgComposeType = Components.interfaces.nsIMsgCompType; var identity = null; var newsgroup = null; var server; //dump("ComposeMessage folder="+folder+"\n"); try { if(folder) { // get the incoming server associated with this uri server = folder.server; // if they hit new or reply and they are reading a newsgroup // turn this into a new post or a reply to group. if (!folder.isServer && server.type == "nntp" && type == msgComposeType.New) { type = msgComposeType.NewsPost; newsgroup = folder.folderURL; } // identity = getIdentityForServer(server); // dump("identity = " + identity + "\n"); } } catch (ex) { dump("failed to get an identity to pre-select: " + ex + "\n"); } //dump("\nComposeMessage from XUL: " + identity + "\n"); var uri = null; if (! msgComposeService) { dump("### msgComposeService is invalid\n"); return; } if (type == msgComposeType.New) //new message { //dump("OpenComposeWindow with " + identity + "\n"); // if the addressbook sidebar panel is open and has focus, get // the selected addresses from it if (document.commandDispatcher.focusedWindow.document.documentElement.hasAttribute("selectedaddresses")) NewMessageToSelectedAddresses(type, format, identity); else msgComposeService.OpenComposeWindow(null, null, type, format, identity, msgWindow); return; } else if (type == msgComposeType.NewsPost) { //dump("OpenComposeWindow with " + identity + " and " + newsgroup + "\n"); msgComposeService.OpenComposeWindow(null, newsgroup, type, format, identity, msgWindow); return; } messenger.SetWindow(window, msgWindow); var object = null; if (messageArray && messageArray.length > 0) { uri = ""; for (var i = 0; i < messageArray.length; i ++) { var messageUri = messageArray[i]; var hdr = messenger.messageServiceFromURI(messageUri).messageURIToMsgHdr(messageUri); var hintForIdentity = (type == msgComposeType.Template) ? hdr.author : hdr.recipients + hdr.ccList; var accountKey = hdr.accountKey; if (accountKey.length > 0) { var account = accountManager.getAccount(accountKey); if (account) server = account.incomingServer; } if (server) identity = getIdentityForServer(server, hintForIdentity); if (type == msgComposeType.Reply || type == msgComposeType.ReplyAll || type == msgComposeType.ForwardInline || type == msgComposeType.ReplyToGroup || type == msgComposeType.ReplyToSender || type == msgComposeType.ReplyToSenderAndGroup || type == msgComposeType.Template || type == msgComposeType.Draft) { msgComposeService.OpenComposeWindow(null, messageUri, type, format, identity, msgWindow); //limit the number of new compose windows to 8. Why 8? I like that number :-) if (i == 7) break; } else { if (i) uri += "," uri += messageUri; } } if (type == msgComposeType.ForwardAsAttachment) msgComposeService.OpenComposeWindow(null, uri, type, format, identity, msgWindow); } else dump("### nodeList is invalid\n");} |
if (document.commandDispatcher.focusedWindow.document.documentElement.hasAttribute("selectedaddresses")) NewMessageToSelectedAddresses(type, format, identity); | if (type == msgComposeType.New) { | function ComposeMessage(type, format, folder, messageArray) { var msgComposeType = Components.interfaces.nsIMsgCompType; var identity = null; var newsgroup = null; var server; //dump("ComposeMessage folder="+folder+"\n"); try { if(folder) { // get the incoming server associated with this uri server = folder.server; // if they hit new or reply and they are reading a newsgroup // turn this into a new post or a reply to group. if (!folder.isServer && server.type == "nntp" && type == msgComposeType.New) { type = msgComposeType.NewsPost; newsgroup = folder.folderURL; } // identity = getIdentityForServer(server); // dump("identity = " + identity + "\n"); } } catch (ex) { dump("failed to get an identity to pre-select: " + ex + "\n"); } //dump("\nComposeMessage from XUL: " + identity + "\n"); var uri = null; if (! msgComposeService) { dump("### msgComposeService is invalid\n"); return; } if (type == msgComposeType.New) //new message { //dump("OpenComposeWindow with " + identity + "\n"); // if the addressbook sidebar panel is open and has focus, get // the selected addresses from it if (document.commandDispatcher.focusedWindow.document.documentElement.hasAttribute("selectedaddresses")) NewMessageToSelectedAddresses(type, format, identity); else msgComposeService.OpenComposeWindow(null, null, type, format, identity, msgWindow); return; } else if (type == msgComposeType.NewsPost) { //dump("OpenComposeWindow with " + identity + " and " + newsgroup + "\n"); msgComposeService.OpenComposeWindow(null, newsgroup, type, format, identity, msgWindow); return; } messenger.SetWindow(window, msgWindow); var object = null; if (messageArray && messageArray.length > 0) { uri = ""; for (var i = 0; i < messageArray.length; i ++) { var messageUri = messageArray[i]; var hdr = messenger.messageServiceFromURI(messageUri).messageURIToMsgHdr(messageUri); var hintForIdentity = (type == msgComposeType.Template) ? hdr.author : hdr.recipients + hdr.ccList; var accountKey = hdr.accountKey; if (accountKey.length > 0) { var account = accountManager.getAccount(accountKey); if (account) server = account.incomingServer; } if (server) identity = getIdentityForServer(server, hintForIdentity); if (type == msgComposeType.Reply || type == msgComposeType.ReplyAll || type == msgComposeType.ForwardInline || type == msgComposeType.ReplyToGroup || type == msgComposeType.ReplyToSender || type == msgComposeType.ReplyToSenderAndGroup || type == msgComposeType.Template || type == msgComposeType.Draft) { msgComposeService.OpenComposeWindow(null, messageUri, type, format, identity, msgWindow); //limit the number of new compose windows to 8. Why 8? I like that number :-) if (i == 7) break; } else { if (i) uri += "," uri += messageUri; } } if (type == msgComposeType.ForwardAsAttachment) msgComposeService.OpenComposeWindow(null, uri, type, format, identity, msgWindow); } else dump("### nodeList is invalid\n");} |
else msgComposeService.OpenComposeWindow(null, null, type, format, identity, msgWindow); return; } else if (type == msgComposeType.NewsPost) { msgComposeService.OpenComposeWindow(null, newsgroup, type, format, identity, msgWindow); return; } messenger.SetWindow(window, msgWindow); var object = null; if (messageArray && messageArray.length > 0) { uri = ""; for (var i = 0; i < messageArray.length; i ++) { var messageUri = messageArray[i]; | if (document.commandDispatcher.focusedWindow.document.documentElement.hasAttribute("selectedaddresses")) NewMessageToSelectedAddresses(type, format, identity); else msgComposeService.OpenComposeWindow(null, null, type, format, identity, msgWindow); return; } else if (type == msgComposeType.NewsPost) { msgComposeService.OpenComposeWindow(null, newsgroup, type, format, identity, msgWindow); return; } | function ComposeMessage(type, format, folder, messageArray) { var msgComposeType = Components.interfaces.nsIMsgCompType; var identity = null; var newsgroup = null; var server; //dump("ComposeMessage folder="+folder+"\n"); try { if(folder) { // get the incoming server associated with this uri server = folder.server; // if they hit new or reply and they are reading a newsgroup // turn this into a new post or a reply to group. if (!folder.isServer && server.type == "nntp" && type == msgComposeType.New) { type = msgComposeType.NewsPost; newsgroup = folder.folderURL; } // identity = getIdentityForServer(server); // dump("identity = " + identity + "\n"); } } catch (ex) { dump("failed to get an identity to pre-select: " + ex + "\n"); } //dump("\nComposeMessage from XUL: " + identity + "\n"); var uri = null; if (! msgComposeService) { dump("### msgComposeService is invalid\n"); return; } if (type == msgComposeType.New) //new message { //dump("OpenComposeWindow with " + identity + "\n"); // if the addressbook sidebar panel is open and has focus, get // the selected addresses from it if (document.commandDispatcher.focusedWindow.document.documentElement.hasAttribute("selectedaddresses")) NewMessageToSelectedAddresses(type, format, identity); else msgComposeService.OpenComposeWindow(null, null, type, format, identity, msgWindow); return; } else if (type == msgComposeType.NewsPost) { //dump("OpenComposeWindow with " + identity + " and " + newsgroup + "\n"); msgComposeService.OpenComposeWindow(null, newsgroup, type, format, identity, msgWindow); return; } messenger.SetWindow(window, msgWindow); var object = null; if (messageArray && messageArray.length > 0) { uri = ""; for (var i = 0; i < messageArray.length; i ++) { var messageUri = messageArray[i]; var hdr = messenger.messageServiceFromURI(messageUri).messageURIToMsgHdr(messageUri); var hintForIdentity = (type == msgComposeType.Template) ? hdr.author : hdr.recipients + hdr.ccList; var accountKey = hdr.accountKey; if (accountKey.length > 0) { var account = accountManager.getAccount(accountKey); if (account) server = account.incomingServer; } if (server) identity = getIdentityForServer(server, hintForIdentity); if (type == msgComposeType.Reply || type == msgComposeType.ReplyAll || type == msgComposeType.ForwardInline || type == msgComposeType.ReplyToGroup || type == msgComposeType.ReplyToSender || type == msgComposeType.ReplyToSenderAndGroup || type == msgComposeType.Template || type == msgComposeType.Draft) { msgComposeService.OpenComposeWindow(null, messageUri, type, format, identity, msgWindow); //limit the number of new compose windows to 8. Why 8? I like that number :-) if (i == 7) break; } else { if (i) uri += "," uri += messageUri; } } if (type == msgComposeType.ForwardAsAttachment) msgComposeService.OpenComposeWindow(null, uri, type, format, identity, msgWindow); } else dump("### nodeList is invalid\n");} |
var hdr = messenger.messageServiceFromURI(messageUri).messageURIToMsgHdr(messageUri); var hintForIdentity = (type == msgComposeType.Template) ? hdr.author : hdr.recipients + hdr.ccList; var accountKey = hdr.accountKey; if (accountKey.length > 0) | messenger.SetWindow(window, msgWindow); var object = null; if (messageArray && messageArray.length > 0) { uri = ""; for (var i = 0; i < messageArray.length; i ++) | function ComposeMessage(type, format, folder, messageArray) { var msgComposeType = Components.interfaces.nsIMsgCompType; var identity = null; var newsgroup = null; var server; //dump("ComposeMessage folder="+folder+"\n"); try { if(folder) { // get the incoming server associated with this uri server = folder.server; // if they hit new or reply and they are reading a newsgroup // turn this into a new post or a reply to group. if (!folder.isServer && server.type == "nntp" && type == msgComposeType.New) { type = msgComposeType.NewsPost; newsgroup = folder.folderURL; } // identity = getIdentityForServer(server); // dump("identity = " + identity + "\n"); } } catch (ex) { dump("failed to get an identity to pre-select: " + ex + "\n"); } //dump("\nComposeMessage from XUL: " + identity + "\n"); var uri = null; if (! msgComposeService) { dump("### msgComposeService is invalid\n"); return; } if (type == msgComposeType.New) //new message { //dump("OpenComposeWindow with " + identity + "\n"); // if the addressbook sidebar panel is open and has focus, get // the selected addresses from it if (document.commandDispatcher.focusedWindow.document.documentElement.hasAttribute("selectedaddresses")) NewMessageToSelectedAddresses(type, format, identity); else msgComposeService.OpenComposeWindow(null, null, type, format, identity, msgWindow); return; } else if (type == msgComposeType.NewsPost) { //dump("OpenComposeWindow with " + identity + " and " + newsgroup + "\n"); msgComposeService.OpenComposeWindow(null, newsgroup, type, format, identity, msgWindow); return; } messenger.SetWindow(window, msgWindow); var object = null; if (messageArray && messageArray.length > 0) { uri = ""; for (var i = 0; i < messageArray.length; i ++) { var messageUri = messageArray[i]; var hdr = messenger.messageServiceFromURI(messageUri).messageURIToMsgHdr(messageUri); var hintForIdentity = (type == msgComposeType.Template) ? hdr.author : hdr.recipients + hdr.ccList; var accountKey = hdr.accountKey; if (accountKey.length > 0) { var account = accountManager.getAccount(accountKey); if (account) server = account.incomingServer; } if (server) identity = getIdentityForServer(server, hintForIdentity); if (type == msgComposeType.Reply || type == msgComposeType.ReplyAll || type == msgComposeType.ForwardInline || type == msgComposeType.ReplyToGroup || type == msgComposeType.ReplyToSender || type == msgComposeType.ReplyToSenderAndGroup || type == msgComposeType.Template || type == msgComposeType.Draft) { msgComposeService.OpenComposeWindow(null, messageUri, type, format, identity, msgWindow); //limit the number of new compose windows to 8. Why 8? I like that number :-) if (i == 7) break; } else { if (i) uri += "," uri += messageUri; } } if (type == msgComposeType.ForwardAsAttachment) msgComposeService.OpenComposeWindow(null, uri, type, format, identity, msgWindow); } else dump("### nodeList is invalid\n");} |
var account = accountManager.getAccount(accountKey); if (account) server = account.incomingServer; | var messageUri = messageArray[i]; var hdr = messenger.messageServiceFromURI(messageUri).messageURIToMsgHdr(messageUri); var hintForIdentity = (type == msgComposeType.Template) ? hdr.author : hdr.recipients + hdr.ccList; var accountKey = hdr.accountKey; if (accountKey.length > 0) { var account = accountManager.getAccount(accountKey); if (account) server = account.incomingServer; } if (server) identity = getIdentityForServer(server, hintForIdentity); if (!identity || hintForIdentity.search(identity.email) < 0) { server = folder.server; if (server) { var tmpIdentity = getIdentityForServer(server, hintForIdentity); if (tmpIdentity && hintForIdentity.search(tmpIdentity.email) >= 0) identity = tmpIdentity; } } if (type == msgComposeType.Reply || type == msgComposeType.ReplyAll || type == msgComposeType.ForwardInline || type == msgComposeType.ReplyToGroup || type == msgComposeType.ReplyToSender || type == msgComposeType.ReplyToSenderAndGroup || type == msgComposeType.Template || type == msgComposeType.Draft) { msgComposeService.OpenComposeWindow(null, messageUri, type, format, identity, msgWindow); if (i == 7) break; } else { if (i) uri += "," uri += messageUri; } | function ComposeMessage(type, format, folder, messageArray) { var msgComposeType = Components.interfaces.nsIMsgCompType; var identity = null; var newsgroup = null; var server; //dump("ComposeMessage folder="+folder+"\n"); try { if(folder) { // get the incoming server associated with this uri server = folder.server; // if they hit new or reply and they are reading a newsgroup // turn this into a new post or a reply to group. if (!folder.isServer && server.type == "nntp" && type == msgComposeType.New) { type = msgComposeType.NewsPost; newsgroup = folder.folderURL; } // identity = getIdentityForServer(server); // dump("identity = " + identity + "\n"); } } catch (ex) { dump("failed to get an identity to pre-select: " + ex + "\n"); } //dump("\nComposeMessage from XUL: " + identity + "\n"); var uri = null; if (! msgComposeService) { dump("### msgComposeService is invalid\n"); return; } if (type == msgComposeType.New) //new message { //dump("OpenComposeWindow with " + identity + "\n"); // if the addressbook sidebar panel is open and has focus, get // the selected addresses from it if (document.commandDispatcher.focusedWindow.document.documentElement.hasAttribute("selectedaddresses")) NewMessageToSelectedAddresses(type, format, identity); else msgComposeService.OpenComposeWindow(null, null, type, format, identity, msgWindow); return; } else if (type == msgComposeType.NewsPost) { //dump("OpenComposeWindow with " + identity + " and " + newsgroup + "\n"); msgComposeService.OpenComposeWindow(null, newsgroup, type, format, identity, msgWindow); return; } messenger.SetWindow(window, msgWindow); var object = null; if (messageArray && messageArray.length > 0) { uri = ""; for (var i = 0; i < messageArray.length; i ++) { var messageUri = messageArray[i]; var hdr = messenger.messageServiceFromURI(messageUri).messageURIToMsgHdr(messageUri); var hintForIdentity = (type == msgComposeType.Template) ? hdr.author : hdr.recipients + hdr.ccList; var accountKey = hdr.accountKey; if (accountKey.length > 0) { var account = accountManager.getAccount(accountKey); if (account) server = account.incomingServer; } if (server) identity = getIdentityForServer(server, hintForIdentity); if (type == msgComposeType.Reply || type == msgComposeType.ReplyAll || type == msgComposeType.ForwardInline || type == msgComposeType.ReplyToGroup || type == msgComposeType.ReplyToSender || type == msgComposeType.ReplyToSenderAndGroup || type == msgComposeType.Template || type == msgComposeType.Draft) { msgComposeService.OpenComposeWindow(null, messageUri, type, format, identity, msgWindow); //limit the number of new compose windows to 8. Why 8? I like that number :-) if (i == 7) break; } else { if (i) uri += "," uri += messageUri; } } if (type == msgComposeType.ForwardAsAttachment) msgComposeService.OpenComposeWindow(null, uri, type, format, identity, msgWindow); } else dump("### nodeList is invalid\n");} |
if (server) identity = getIdentityForServer(server, hintForIdentity); if (type == msgComposeType.Reply || type == msgComposeType.ReplyAll || type == msgComposeType.ForwardInline || type == msgComposeType.ReplyToGroup || type == msgComposeType.ReplyToSender || type == msgComposeType.ReplyToSenderAndGroup || type == msgComposeType.Template || type == msgComposeType.Draft) { msgComposeService.OpenComposeWindow(null, messageUri, type, format, identity, msgWindow); if (i == 7) break; } else { if (i) uri += "," uri += messageUri; } } if (type == msgComposeType.ForwardAsAttachment) msgComposeService.OpenComposeWindow(null, uri, type, format, identity, msgWindow); } else dump("### nodeList is invalid\n"); | if (type == msgComposeType.ForwardAsAttachment) msgComposeService.OpenComposeWindow(null, uri, type, format, identity, msgWindow); } else dump("### nodeList is invalid\n"); | function ComposeMessage(type, format, folder, messageArray) { var msgComposeType = Components.interfaces.nsIMsgCompType; var identity = null; var newsgroup = null; var server; //dump("ComposeMessage folder="+folder+"\n"); try { if(folder) { // get the incoming server associated with this uri server = folder.server; // if they hit new or reply and they are reading a newsgroup // turn this into a new post or a reply to group. if (!folder.isServer && server.type == "nntp" && type == msgComposeType.New) { type = msgComposeType.NewsPost; newsgroup = folder.folderURL; } // identity = getIdentityForServer(server); // dump("identity = " + identity + "\n"); } } catch (ex) { dump("failed to get an identity to pre-select: " + ex + "\n"); } //dump("\nComposeMessage from XUL: " + identity + "\n"); var uri = null; if (! msgComposeService) { dump("### msgComposeService is invalid\n"); return; } if (type == msgComposeType.New) //new message { //dump("OpenComposeWindow with " + identity + "\n"); // if the addressbook sidebar panel is open and has focus, get // the selected addresses from it if (document.commandDispatcher.focusedWindow.document.documentElement.hasAttribute("selectedaddresses")) NewMessageToSelectedAddresses(type, format, identity); else msgComposeService.OpenComposeWindow(null, null, type, format, identity, msgWindow); return; } else if (type == msgComposeType.NewsPost) { //dump("OpenComposeWindow with " + identity + " and " + newsgroup + "\n"); msgComposeService.OpenComposeWindow(null, newsgroup, type, format, identity, msgWindow); return; } messenger.SetWindow(window, msgWindow); var object = null; if (messageArray && messageArray.length > 0) { uri = ""; for (var i = 0; i < messageArray.length; i ++) { var messageUri = messageArray[i]; var hdr = messenger.messageServiceFromURI(messageUri).messageURIToMsgHdr(messageUri); var hintForIdentity = (type == msgComposeType.Template) ? hdr.author : hdr.recipients + hdr.ccList; var accountKey = hdr.accountKey; if (accountKey.length > 0) { var account = accountManager.getAccount(accountKey); if (account) server = account.incomingServer; } if (server) identity = getIdentityForServer(server, hintForIdentity); if (type == msgComposeType.Reply || type == msgComposeType.ReplyAll || type == msgComposeType.ForwardInline || type == msgComposeType.ReplyToGroup || type == msgComposeType.ReplyToSender || type == msgComposeType.ReplyToSenderAndGroup || type == msgComposeType.Template || type == msgComposeType.Draft) { msgComposeService.OpenComposeWindow(null, messageUri, type, format, identity, msgWindow); //limit the number of new compose windows to 8. Why 8? I like that number :-) if (i == 7) break; } else { if (i) uri += "," uri += messageUri; } } if (type == msgComposeType.ForwardAsAttachment) msgComposeService.OpenComposeWindow(null, uri, type, format, identity, msgWindow); } else dump("### nodeList is invalid\n");} |
msgComposeService.OpenComposeWindow(null, null, 0, format, null, identity); | msgComposeService.OpenComposeWindow(null, null, 0, format, identity); | function ComposeMessage(type, format)//type: 0=new message, 1=reply, 2=reply all,// 3=forward inline, 4=forward as attachment////format: 0=default (use preference), 1=HTML, 2=plain text{ var identity = null; try { var folderTree = GetFolderTree(); var selectedFolderList = folderTree.selectedItems; if(selectedFolderList.length > 0) { var selectedFolder = selectedFolderList[0]; var uri = selectedFolder.getAttribute('id'); // dump("selectedFolder uri = " + uri + "\n"); // get the incoming server associated with this uri var server = FindIncomingServer(uri); // dump("server = " + server + "\n"); // get the identity associated with this server var identities = accountManager.GetIdentitiesForServer(server); // dump("identities = " + identities + "\n"); // just get the first one if (identities.Count() > 0 ) { identity = identities.GetElementAt(0).QueryInterface(Components.interfaces.nsIMsgIdentity); } } // dump("identity = " + identity + "\n"); } catch (ex) { // dump("failed to get an identity to pre-select\n"); } dump("\nComposeMessage from XUL\n"); var uri = null; if (! msgComposeService) { dump("### msgComposeService is invalid\n"); return; } if (type == 0) //new message { //dump("OpenComposeWindow with " + identity + "\n"); msgComposeService.OpenComposeWindow(null, null, 0, format, null, identity); return; } var tree = GetThreadTree(); if (tree) { var nodeList = tree.selectedItems; var appCore = FindMessenger(); if (appCore) appCore.SetWindow(window, msgWindow); var object = null; if (nodeList && nodeList.length > 0) { uri = ""; for (var i = 0; i < nodeList.length && i < 8; i ++) { dump('i = '+ i); dump('\n'); if (type == 1 || type == 2) //reply or reply all { if (appCore) object = appCore.GetRDFResourceForMessage(tree, nodeList); //temporary msgComposeService.OpenComposeWindow(null, nodeList[i].getAttribute('id'), type, format, object, identity); } else { if (i) uri += " " uri += nodeList[i].getAttribute('id'); } } if (type == 3 || type == 4) //forward { if (appCore) object = appCore.GetRDFResourceForMessage(tree, nodeList); //temporary msgComposeService.OpenComposeWindow(null, uri, type, format, object, identity); } } else dump("### nodeList is invalid\n"); } else dump("### tree is invalid\n");} |
if (appCore) object = appCore.GetRDFResourceForMessage(tree, nodeList); msgComposeService.OpenComposeWindow(null, nodeList[i].getAttribute('id'), type, format, object, identity); | msgComposeService.OpenComposeWindow(null, nodeList[i].getAttribute('id'), type, format, identity); | function ComposeMessage(type, format)//type: 0=new message, 1=reply, 2=reply all,// 3=forward inline, 4=forward as attachment////format: 0=default (use preference), 1=HTML, 2=plain text{ var identity = null; try { var folderTree = GetFolderTree(); var selectedFolderList = folderTree.selectedItems; if(selectedFolderList.length > 0) { var selectedFolder = selectedFolderList[0]; var uri = selectedFolder.getAttribute('id'); // dump("selectedFolder uri = " + uri + "\n"); // get the incoming server associated with this uri var server = FindIncomingServer(uri); // dump("server = " + server + "\n"); // get the identity associated with this server var identities = accountManager.GetIdentitiesForServer(server); // dump("identities = " + identities + "\n"); // just get the first one if (identities.Count() > 0 ) { identity = identities.GetElementAt(0).QueryInterface(Components.interfaces.nsIMsgIdentity); } } // dump("identity = " + identity + "\n"); } catch (ex) { // dump("failed to get an identity to pre-select\n"); } dump("\nComposeMessage from XUL\n"); var uri = null; if (! msgComposeService) { dump("### msgComposeService is invalid\n"); return; } if (type == 0) //new message { //dump("OpenComposeWindow with " + identity + "\n"); msgComposeService.OpenComposeWindow(null, null, 0, format, null, identity); return; } var tree = GetThreadTree(); if (tree) { var nodeList = tree.selectedItems; var appCore = FindMessenger(); if (appCore) appCore.SetWindow(window, msgWindow); var object = null; if (nodeList && nodeList.length > 0) { uri = ""; for (var i = 0; i < nodeList.length && i < 8; i ++) { dump('i = '+ i); dump('\n'); if (type == 1 || type == 2) //reply or reply all { if (appCore) object = appCore.GetRDFResourceForMessage(tree, nodeList); //temporary msgComposeService.OpenComposeWindow(null, nodeList[i].getAttribute('id'), type, format, object, identity); } else { if (i) uri += " " uri += nodeList[i].getAttribute('id'); } } if (type == 3 || type == 4) //forward { if (appCore) object = appCore.GetRDFResourceForMessage(tree, nodeList); //temporary msgComposeService.OpenComposeWindow(null, uri, type, format, object, identity); } } else dump("### nodeList is invalid\n"); } else dump("### tree is invalid\n");} |
if (appCore) object = appCore.GetRDFResourceForMessage(tree, nodeList); msgComposeService.OpenComposeWindow(null, uri, type, format, object, identity); | msgComposeService.OpenComposeWindow(null, uri, type, format, identity); | function ComposeMessage(type, format)//type: 0=new message, 1=reply, 2=reply all,// 3=forward inline, 4=forward as attachment////format: 0=default (use preference), 1=HTML, 2=plain text{ var identity = null; try { var folderTree = GetFolderTree(); var selectedFolderList = folderTree.selectedItems; if(selectedFolderList.length > 0) { var selectedFolder = selectedFolderList[0]; var uri = selectedFolder.getAttribute('id'); // dump("selectedFolder uri = " + uri + "\n"); // get the incoming server associated with this uri var server = FindIncomingServer(uri); // dump("server = " + server + "\n"); // get the identity associated with this server var identities = accountManager.GetIdentitiesForServer(server); // dump("identities = " + identities + "\n"); // just get the first one if (identities.Count() > 0 ) { identity = identities.GetElementAt(0).QueryInterface(Components.interfaces.nsIMsgIdentity); } } // dump("identity = " + identity + "\n"); } catch (ex) { // dump("failed to get an identity to pre-select\n"); } dump("\nComposeMessage from XUL\n"); var uri = null; if (! msgComposeService) { dump("### msgComposeService is invalid\n"); return; } if (type == 0) //new message { //dump("OpenComposeWindow with " + identity + "\n"); msgComposeService.OpenComposeWindow(null, null, 0, format, null, identity); return; } var tree = GetThreadTree(); if (tree) { var nodeList = tree.selectedItems; var appCore = FindMessenger(); if (appCore) appCore.SetWindow(window, msgWindow); var object = null; if (nodeList && nodeList.length > 0) { uri = ""; for (var i = 0; i < nodeList.length && i < 8; i ++) { dump('i = '+ i); dump('\n'); if (type == 1 || type == 2) //reply or reply all { if (appCore) object = appCore.GetRDFResourceForMessage(tree, nodeList); //temporary msgComposeService.OpenComposeWindow(null, nodeList[i].getAttribute('id'), type, format, object, identity); } else { if (i) uri += " " uri += nodeList[i].getAttribute('id'); } } if (type == 3 || type == 4) //forward { if (appCore) object = appCore.GetRDFResourceForMessage(tree, nodeList); //temporary msgComposeService.OpenComposeWindow(null, uri, type, format, object, identity); } } else dump("### nodeList is invalid\n"); } else dump("### tree is invalid\n");} |
if (type == msgComposeType.Reply) type = msgComposeType.ReplyToGroup; else if (type == msgComposeType.New) { type = msgComposeType.NewsPost; | if (type == msgComposeType.New) { type = msgComposeType.NewsPost; | function ComposeMessage(type, format, folder, messageArray) //type is a nsIMsgCompType and format is a nsIMsgCompFormat{ var msgComposeType = Components.interfaces.nsIMsgCompType; var identity = null; var newsgroup = null; var server; dump("ComposeMessage folder="+folder+"\n"); try { if(folder) { // get the incoming server associated with this uri server = folder.server; // if they hit new or reply and they are reading a newsgroup // turn this into a new post or a reply to group. if (server.type == "nntp") { if (type == msgComposeType.Reply) type = msgComposeType.ReplyToGroup; else if (type == msgComposeType.New) { type = msgComposeType.NewsPost; if (folder.isServer) newsgroup = ""; else newsgroup = server.hostName + "/" + folder.name; } } identity = getIdentityForServer(server); // dump("identity = " + identity + "\n"); } } catch (ex) { dump("failed to get an identity to pre-select: " + ex + "\n"); } dump("\nComposeMessage from XUL: " + identity + "\n"); var uri = null; if (! msgComposeService) { dump("### msgComposeService is invalid\n"); return; } if (type == msgComposeType.New) //new message { //dump("OpenComposeWindow with " + identity + "\n"); msgComposeService.OpenComposeWindow(null, null, type, format, identity); return; } else if (type == msgComposeType.NewsPost) { dump("OpenComposeWindow with " + identity + " and " + newsgroup + "\n"); msgComposeService.OpenComposeWindow(null, newsgroup, type, format, identity); return; } messenger.SetWindow(window, msgWindow); var object = null; if (messageArray && messageArray.length > 0) { uri = ""; for (var i = 0; i < messageArray.length && i < 8; i ++) { var messageResource = messageArray[i].QueryInterface(Components.interfaces.nsIRDFResource); var messageUri = messageResource.Value; dump('i = '+ i); dump('\n'); if (type == msgComposeType.Reply || type == msgComposeType.ReplyAll || type == msgComposeType.ForwardInline || type == msgComposeType.ReplyToGroup || type == msgComposeType.ReplyToSenderAndGroup || type == msgComposeType.Template || type == msgComposeType.Draft) { msgComposeService.OpenComposeWindow(null, messageUri, type, format, identity); } else { if (i) uri += "," uri += messageUri; } } if (type == msgComposeType.ForwardAsAttachment) { msgComposeService.OpenComposeWindow(null, uri, type, format, identity); } } else dump("### nodeList is invalid\n");} |
return; } else if (type == msgComposeType.NewsPost) { msgComposeService.OpenComposeWindow(null, newsgroup, 5, format, identity); | function ComposeMessage(type, format) //type is a nsIMsgCompType and format is a nsIMsgCompFormat{ var msgComposeType = Components.interfaces.nsIMsgCompType; var identity = null; try { var folderTree = GetFolderTree(); var selectedFolderList = folderTree.selectedItems; if(selectedFolderList.length > 0) { var selectedFolder = selectedFolderList[0]; var uri = selectedFolder.getAttribute('id'); // dump("selectedFolder uri = " + uri + "\n"); // get the incoming server associated with this uri var server = FindIncomingServer(uri); // dump("server = " + server + "\n"); // get the identity associated with this server var identities = accountManager.GetIdentitiesForServer(server); // dump("identities = " + identities + "\n"); // just get the first one if (identities.Count() > 0 ) { identity = identities.GetElementAt(0).QueryInterface(Components.interfaces.nsIMsgIdentity); } } // dump("identity = " + identity + "\n"); } catch (ex) { // dump("failed to get an identity to pre-select\n"); } dump("\nComposeMessage from XUL\n"); var uri = null; if (! msgComposeService) { dump("### msgComposeService is invalid\n"); return; } if (type == msgComposeType.New) //new message { //dump("OpenComposeWindow with " + identity + "\n"); msgComposeService.OpenComposeWindow(null, null, 0, format, identity); return; } var tree = GetThreadTree(); if (tree) { var nodeList = tree.selectedItems; var appCore = FindMessenger(); if (appCore) appCore.SetWindow(window, msgWindow); var object = null; if (nodeList && nodeList.length > 0) { uri = ""; for (var i = 0; i < nodeList.length && i < 8; i ++) { dump('i = '+ i); dump('\n'); if (type == msgComposeType.Reply || type == msgComposeType.ReplyAll || type == msgComposeType.ForwardInline) { msgComposeService.OpenComposeWindow(null, nodeList[i].getAttribute('id'), type, format, identity); } else { if (i) uri += "," uri += nodeList[i].getAttribute('id'); } } if (type == msgComposeType.ForwardAsAttachment) { msgComposeService.OpenComposeWindow(null, uri, type, format, identity); } } else dump("### nodeList is invalid\n"); } else dump("### tree is invalid\n");} |
|
if (server.type == "nntp") | if (!folder.isServer && server.type == "nntp" && type == msgComposeType.New) | function ComposeMessage(type, format, folder, messageArray) { var msgComposeType = Components.interfaces.nsIMsgCompType; var identity = null; var newsgroup = null; var server; //dump("ComposeMessage folder="+folder+"\n"); try { if(folder) { // get the incoming server associated with this uri server = folder.server; // if they hit new or reply and they are reading a newsgroup // turn this into a new post or a reply to group. if (server.type == "nntp") { if (type == msgComposeType.New) { type = msgComposeType.NewsPost; if (folder.isServer) newsgroup = ""; else newsgroup = server.hostName + "/" + folder.name; } } identity = getIdentityForServer(server); // dump("identity = " + identity + "\n"); } } catch (ex) { dump("failed to get an identity to pre-select: " + ex + "\n"); } //dump("\nComposeMessage from XUL: " + identity + "\n"); var uri = null; if (! msgComposeService) { dump("### msgComposeService is invalid\n"); return; } if (type == msgComposeType.New) //new message { //dump("OpenComposeWindow with " + identity + "\n"); msgComposeService.OpenComposeWindow(null, null, type, format, identity, msgWindow); return; } else if (type == msgComposeType.NewsPost) { //dump("OpenComposeWindow with " + identity + " and " + newsgroup + "\n"); msgComposeService.OpenComposeWindow(null, newsgroup, type, format, identity, msgWindow); return; } messenger.SetWindow(window, msgWindow); var object = null; if (messageArray && messageArray.length > 0) { uri = ""; for (var i = 0; i < messageArray.length && i < 8; i ++) { var messageUri = messageArray[i]; //dump("XXX messageUri in ComposeMessage = " + messageUri + "\n"); //dump('i = '+ i); //dump('\n'); if (type == msgComposeType.Reply || type == msgComposeType.ReplyAll || type == msgComposeType.ForwardInline || type == msgComposeType.ReplyToGroup || type == msgComposeType.ReplyToSender || type == msgComposeType.ReplyToSenderAndGroup || type == msgComposeType.Template || type == msgComposeType.Draft) { msgComposeService.OpenComposeWindow(null, messageUri, type, format, identity, msgWindow); } else { if (i) uri += "," uri += messageUri; } } if (type == msgComposeType.ForwardAsAttachment) { msgComposeService.OpenComposeWindow(null, uri, type, format, identity, msgWindow); } } else dump("### nodeList is invalid\n");} |
if (type == msgComposeType.New) { type = msgComposeType.NewsPost; if (folder.isServer) newsgroup = ""; else newsgroup = server.hostName + "/" + folder.name; } | type = msgComposeType.NewsPost; newsgroup = server.hostName + "/" + folder.name; | function ComposeMessage(type, format, folder, messageArray) { var msgComposeType = Components.interfaces.nsIMsgCompType; var identity = null; var newsgroup = null; var server; //dump("ComposeMessage folder="+folder+"\n"); try { if(folder) { // get the incoming server associated with this uri server = folder.server; // if they hit new or reply and they are reading a newsgroup // turn this into a new post or a reply to group. if (server.type == "nntp") { if (type == msgComposeType.New) { type = msgComposeType.NewsPost; if (folder.isServer) newsgroup = ""; else newsgroup = server.hostName + "/" + folder.name; } } identity = getIdentityForServer(server); // dump("identity = " + identity + "\n"); } } catch (ex) { dump("failed to get an identity to pre-select: " + ex + "\n"); } //dump("\nComposeMessage from XUL: " + identity + "\n"); var uri = null; if (! msgComposeService) { dump("### msgComposeService is invalid\n"); return; } if (type == msgComposeType.New) //new message { //dump("OpenComposeWindow with " + identity + "\n"); msgComposeService.OpenComposeWindow(null, null, type, format, identity, msgWindow); return; } else if (type == msgComposeType.NewsPost) { //dump("OpenComposeWindow with " + identity + " and " + newsgroup + "\n"); msgComposeService.OpenComposeWindow(null, newsgroup, type, format, identity, msgWindow); return; } messenger.SetWindow(window, msgWindow); var object = null; if (messageArray && messageArray.length > 0) { uri = ""; for (var i = 0; i < messageArray.length && i < 8; i ++) { var messageUri = messageArray[i]; //dump("XXX messageUri in ComposeMessage = " + messageUri + "\n"); //dump('i = '+ i); //dump('\n'); if (type == msgComposeType.Reply || type == msgComposeType.ReplyAll || type == msgComposeType.ForwardInline || type == msgComposeType.ReplyToGroup || type == msgComposeType.ReplyToSender || type == msgComposeType.ReplyToSenderAndGroup || type == msgComposeType.Template || type == msgComposeType.Draft) { msgComposeService.OpenComposeWindow(null, messageUri, type, format, identity, msgWindow); } else { if (i) uri += "," uri += messageUri; } } if (type == msgComposeType.ForwardAsAttachment) { msgComposeService.OpenComposeWindow(null, uri, type, format, identity, msgWindow); } } else dump("### nodeList is invalid\n");} |
newsgroup = folder.name; | newsgroup = server.hostName + "/" + folder.name; | function ComposeMessage(type, format, folder, messageArray) //type is a nsIMsgCompType and format is a nsIMsgCompFormat{ var msgComposeType = Components.interfaces.nsIMsgCompType; var identity = null; var newsgroup = null; var server; dump("ComposeMessage folder="+folder+"\n"); try { if(folder) { // get the incoming server associated with this uri server = folder.server; // if they hit new or reply and they are reading a newsgroup // turn this into a new post or a reply to group. if (server.type == "nntp") { if (type == msgComposeType.Reply) type = msgComposeType.ReplyToGroup; else if (type == msgComposeType.New) { type = msgComposeType.NewsPost; if (folder.isServer) newsgroup = ""; else newsgroup = folder.name; } } identity = getIdentityForServer(server); // dump("identity = " + identity + "\n"); } } catch (ex) { dump("failed to get an identity to pre-select: " + ex + "\n"); } dump("\nComposeMessage from XUL: " + identity + "\n"); var uri = null; if (! msgComposeService) { dump("### msgComposeService is invalid\n"); return; } if (type == msgComposeType.New) //new message { //dump("OpenComposeWindow with " + identity + "\n"); msgComposeService.OpenComposeWindow(null, null, type, format, identity); return; } else if (type == msgComposeType.NewsPost) { dump("OpenComposeWindow with " + identity + " and " + newsgroup + "\n"); msgComposeService.OpenComposeWindow(null, newsgroup, type, format, identity); return; } messenger.SetWindow(window, msgWindow); var object = null; if (messageArray && messageArray.length > 0) { uri = ""; for (var i = 0; i < messageArray.length && i < 8; i ++) { var messageResource = messageArray[i].QueryInterface(Components.interfaces.nsIRDFResource); var messageUri = messageResource.Value; dump('i = '+ i); dump('\n'); if (type == msgComposeType.Reply || type == msgComposeType.ReplyAll || type == msgComposeType.ForwardInline || type == msgComposeType.ReplyToGroup || type == msgComposeType.ReplyToSenderAndGroup || type == msgComposeType.Template || type == msgComposeType.Draft) { msgComposeService.OpenComposeWindow(null, messageUri, type, format, identity); } else { if (i) uri += "," uri += messageUri; } } if (type == msgComposeType.ForwardAsAttachment) { msgComposeService.OpenComposeWindow(null, uri, type, format, identity); } } else dump("### nodeList is invalid\n");} |
window.openDialog("chrome: "_blank", "chrome,modal,resizable", "browser"); | function ComposerMultiplexHandler(event){ var node = event.target; var name = node.getAttribute('name'); if (name == 'detectorGroup') { ComposerSelectDetector(event, true); } else if (name == 'charsetGroup') { var charset = node.getAttribute('id'); charset = charset.substring('charset.'.length, charset.length) EditorSetDocumentCharacterSet(charset); } else if (name == 'charsetCustomize') { //do nothing - please remove this else statement, once the charset prefs moves to the pref window } else { SetForcedEditorCharset(node.getAttribute('id')); }} |
|
var pref = Components.classes['component: | var pref = Components.classes['@mozilla.org/preferences;1']; | function ComposerSelectDetector(event){ //dump("Charset Detector menu item pressed: " + event.target.getAttribute('id') + "\n"); var uri = event.target.getAttribute("id"); var prefvalue = uri.substring('chardet.'.length, uri.length); if("off" == prefvalue) { // "off" is special value to turn off the detectors prefvalue = ""; } var pref = Components.classes['component://netscape/preferences']; if (pref) { pref = pref.getService(); pref = pref.QueryInterface(Components.interfaces.nsIPref); } if (pref) { pref.SetCharPref("intl.charset.detector", prefvalue); editorShell.LoadUrl(editorShell.editorDocument.location); }} |
} catch(e) {} | function ComposeStartup(){ dump("Compose: ComposeStartup\n"); //dump("Get arguments\n"); var args = GetArgs(); //dump("fill in Identity menulist\n"); var identityList = document.getElementById("msgIdentity"); var identityListPopup = document.getElementById("msgIdentityPopup"); if (identityListPopup) { fillIdentityListPopup(identityListPopup); } var identity; if (args.preselectid) identity = getIdentityForKey(args.preselectid); else { // no preselect, so use the default account var identities = accountManager.defaultAccount.identities; identity = identities.QueryElementAt(0, Components.interfaces.nsIMsgIdentity); } for (i=0;i<identityListPopup.childNodes.length;i++) { var item = identityListPopup.childNodes[i]; var id = item.getAttribute('id'); if (id == identity.key) { identityList.selectedItem = item; break; } } LoadIdentity(true); if (msgComposeService) { // this is frustrating, we need to convert the preselect identity key // back to an identity, to pass to initcompose // it would be nice if there was some way to actually send the // identity through "args" msgCompose = msgComposeService.InitCompose(window, args.originalMsg, args.type, args.format, args.fieldsAddr, identity); if (msgCompose) { //Creating a Editor Shell var editorShell = Components.classes["component://netscape/editor/editorshell"].createInstance(); editorShell = editorShell.QueryInterface(Components.interfaces.nsIEditorShell); if (!editorShell) { dump("Failed to create editorShell!\n"); return; } // save the editorShell in the window. The editor JS expects to find it there. window.editorShell = editorShell; window.editorShell.Init(); dump("Created editorShell\n"); // setEditorType MUST be call before setContentWindow if (msgCompose.composeHTML) { window.editorShell.SetEditorType("htmlmail"); dump("editor initialized in HTML mode\n"); } else { //Remove HTML toolbar, format and insert menus as we are editing in plain text mode document.getElementById("FormatToolbar").setAttribute("hidden", true); document.getElementById("formatMenu").setAttribute("hidden", true); document.getElementById("insertMenu").setAttribute("hidden", true); document.getElementById("menu_showFormatToolbar").setAttribute("checked", false); window.editorShell.SetEditorType("textmail"); dump("editor initialized in PLAIN TEXT mode\n"); } window.editorShell.webShellWindow = window; window.editorShell.contentWindow = window._content; // Do setup common to Message Composer and Web Composer EditorSharedStartup(); var msgCompFields = msgCompose.compFields; if (msgCompFields) { if (args.body) //We need to set the body before setting //msgCompose.editor; { if (args.bodyislink == "true") { if (msgCompose.composeHTML) msgCompFields.SetBody("<BR><A HREF=\"" + args.body + "\">" + unescape(args.body) + "</A><BR>"); else msgCompFields.SetBody("\n<" + args.body + ">\n"); } else msgCompFields.SetBody(args.body); } if (args.to) msgCompFields.SetTo(args.to); if (args.cc) msgCompFields.SetCc(args.cc); if (args.bcc) msgCompFields.SetBcc(args.bcc); if (args.newsgroups) msgCompFields.SetNewsgroups(args.newsgroups); if (args.subject) msgCompFields.SetSubject(args.subject); if (args.attachment) msgCompFields.SetAttachments(args.attachment); dump("args newshost = " + args.newshost + "\n"); if (args.newshost) msgCompFields.SetNewshost(args.newshost); var subjectValue = msgCompFields.GetSubject(); if (subjectValue != "") { document.getElementById("msgSubject").value = subjectValue; } var attachmentValue = msgCompFields.GetAttachments(); if (attachmentValue != "") { var atts = attachmentValue.split(","); for (var i=0; i < atts.length; i++) { AddAttachment(atts[i]); } } } // Now that we have an Editor AppCore, we can finish to initialize the Compose AppCore msgCompose.editor = window.editorShell; msgCompose.RegisterStateListener(stateListener); // call updateCommands to disable while we're loading the page window.updateCommands("create"); // SetupCommandUpdateHandlers(); WaitFinishLoadingDocument(args.type); } }} |
|
var editorShell = Components.classes["component: | var editorShell = Components.classes["@mozilla.org/editor/editorshell;1"].createInstance(); | function ComposeStartup(){ dump("Compose: ComposeStartup\n"); //dump("Get arguments\n"); var args = GetArgs(); //dump("fill in Identity menulist\n"); var identityList = document.getElementById("msgIdentity"); var identityListPopup = document.getElementById("msgIdentityPopup"); if (identityListPopup) { fillIdentityListPopup(identityListPopup); } var identity = null; if (args.preselectid) identity = getIdentityForKey(args.preselectid); else { // no preselect, so use the default account var identities = accountManager.defaultAccount.identities; if (identities.Count() >= 1) identity = identities.QueryElementAt(0, Components.interfaces.nsIMsgIdentity); else { identities = GetIdentities(); identity = identities[0]; } } for (i=0;i<identityListPopup.childNodes.length;i++) { var item = identityListPopup.childNodes[i]; var id = item.getAttribute('id'); if (id == identity.key) { identityList.selectedItem = item; break; } } LoadIdentity(true); if (msgComposeService) { // this is frustrating, we need to convert the preselect identity key // back to an identity, to pass to initcompose // it would be nice if there was some way to actually send the // identity through "args" msgCompose = msgComposeService.InitCompose(window, args.originalMsg, args.type, args.format, args.fieldsAddr, identity); if (msgCompose) { //Creating a Editor Shell var editorShell = Components.classes["component://netscape/editor/editorshell"].createInstance(); editorShell = editorShell.QueryInterface(Components.interfaces.nsIEditorShell); if (!editorShell) { dump("Failed to create editorShell!\n"); return; } // save the editorShell in the window. The editor JS expects to find it there. window.editorShell = editorShell; window.editorShell.Init(); dump("Created editorShell\n"); // setEditorType MUST be call before setContentWindow if (msgCompose.composeHTML) { window.editorShell.editorType = "htmlmail"; dump("editor initialized in HTML mode\n"); } else { //Remove HTML toolbar, format and insert menus as we are editing in plain text mode document.getElementById("FormatToolbar").setAttribute("hidden", true); document.getElementById("formatMenu").setAttribute("hidden", true); document.getElementById("insertMenu").setAttribute("hidden", true); document.getElementById("menu_showFormatToolbar").setAttribute("checked", false); window.editorShell.editorType = "textmail"; dump("editor initialized in PLAIN TEXT mode\n"); } window.editorShell.webShellWindow = window; window.editorShell.contentWindow = window._content; // Do setup common to Message Composer and Web Composer EditorSharedStartup(); var msgCompFields = msgCompose.compFields; if (msgCompFields) { if (args.body) //We need to set the body before setting //msgCompose.editor; { if (args.bodyislink == "true") { if (msgCompose.composeHTML) msgCompFields.SetBody("<BR><A HREF=\"" + args.body + "\">" + unescape(args.body) + "</A><BR>"); else msgCompFields.SetBody("\n<" + args.body + ">\n"); } else msgCompFields.SetBody(args.body); } if (args.to) msgCompFields.SetTo(args.to); if (args.cc) msgCompFields.SetCc(args.cc); if (args.bcc) msgCompFields.SetBcc(args.bcc); if (args.newsgroups) msgCompFields.SetNewsgroups(args.newsgroups); if (args.subject) msgCompFields.SetSubject(args.subject); if (args.attachment) msgCompFields.SetAttachments(args.attachment); dump("args newshost = " + args.newshost + "\n"); if (args.newshost) msgCompFields.SetNewshost(args.newshost); var subjectValue = msgCompFields.GetSubject(); if (subjectValue != "") { document.getElementById("msgSubject").value = subjectValue; } var attachmentValue = msgCompFields.GetAttachments(); if (attachmentValue != "") { var atts = attachmentValue.split(","); for (var i=0; i < atts.length; i++) { AddAttachment(atts[i]); } } } // Now that we have an Editor AppCore, we can finish to initialize the Compose AppCore msgCompose.editor = window.editorShell; msgCompose.RegisterStateListener(stateListener); // call updateCommands to disable while we're loading the page try { window.updateCommands("create"); } catch(e) {} // SetupCommandUpdateHandlers(); WaitFinishLoadingDocument(args.type); } }} |
window.editorShell.contentWindow = window.content; | window.editorShell.contentWindow = window._content; | function ComposeStartup(){ dump("Compose: ComposeStartup\n"); //dump("Get arguments\n"); var args = GetArgs(); //dump("fill in Identity menulist\n"); var identityList = document.getElementById("msgIdentity"); var identityListPopup = document.getElementById("msgIdentityPopup"); if (identityListPopup) { fillIdentityListPopup(identityListPopup); } var identity; if (args.preselectid) identity = getIdentityForKey(args.preselectid); else { // no preselect, so use the default account var identities = accountManager.defaultAccount.identities; identity = identities.QueryElementAt(0, Components.interfaces.nsIMsgIdentity); } for (i=0;i<identityListPopup.childNodes.length;i++) { var item = identityListPopup.childNodes[i]; var id = item.getAttribute('id'); if (id == identity.key) { identityList.selectedItem = item; break; } } LoadIdentity(true); if (msgComposeService) { // this is frustrating, we need to convert the preselect identity key // back to an identity, to pass to initcompose // it would be nice if there was some way to actually send the // identity through "args" msgCompose = msgComposeService.InitCompose(window, args.originalMsg, args.type, args.format, args.fieldsAddr, identity); if (msgCompose) { //Creating a Editor Shell var editorShell = Components.classes["component://netscape/editor/editorshell"].createInstance(); editorShell = editorShell.QueryInterface(Components.interfaces.nsIEditorShell); if (!editorShell) { dump("Failed to create editorShell!\n"); return; } // save the editorShell in the window. The editor JS expects to find it there. window.editorShell = editorShell; window.editorShell.Init(); dump("Created editorShell\n"); // setEditorType MUST be call before setContentWindow if (msgCompose.composeHTML) { window.editorShell.SetEditorType("htmlmail"); dump("editor initialized in HTML mode\n"); } else { //Remove HTML toolbar, format and insert menus as we are editing in plain text mode document.getElementById("FormatToolbar").setAttribute("hidden", true); document.getElementById("formatMenu").setAttribute("hidden", true); document.getElementById("insertMenu").setAttribute("hidden", true); window.editorShell.SetEditorType("textmail"); dump("editor initialized in PLAIN TEXT mode\n"); } window.editorShell.webShellWindow = window; window.editorShell.contentWindow = window.content; // Do setup common to Message Composer and Web Composer EditorSharedStartup(); var msgCompFields = msgCompose.compFields; if (msgCompFields) { if (args.body) //We need to set the body before setting //msgCompose.editor; { if (args.bodyislink == "true") { if (msgCompose.composeHTML) msgCompFields.SetBody("<BR><A HREF=\"" + args.body + "\">" + unescape(args.body) + "</A><BR>"); else msgCompFields.SetBody("\n<" + args.body + ">\n"); } else msgCompFields.SetBody(args.body); } if (args.to) msgCompFields.SetTo(args.to); if (args.cc) msgCompFields.SetCc(args.cc); if (args.bcc) msgCompFields.SetBcc(args.bcc); if (args.newsgroups) msgCompFields.SetNewsgroups(args.newsgroups); if (args.subject) msgCompFields.SetSubject(args.subject); if (args.attachment) msgCompFields.SetAttachments(args.attachment); var subjectValue = msgCompFields.GetSubject(); if (subjectValue != "") { document.getElementById("msgSubject").value = subjectValue; } var attachmentValue = msgCompFields.GetAttachments(); if (attachmentValue != "") { var atts = attachmentValue.split(","); for (var i=0; i < atts.length; i++) { AddAttachment(atts[i]); } } } // Now that we have an Editor AppCore, we can finish to initialize the Compose AppCore msgCompose.editor = window.editorShell; msgCompose.RegisterStateListener(stateListener); // call updateCommands to disable while we're loading the page window.updateCommands("create"); WaitFinishLoadingDocument(args.type); } }} |
if (args.bodyislink == "true" && msgCompose.composeHTML) { msgCompFields.SetBody("<A HREF=\"" + args.body + "\">" + unescape(args.body) + "</A>"); } | if (args.bodyislink == "true") { if (msgCompose.composeHTML) { msgCompFields.SetBody("<BR><A HREF=\"" + args.body + "\">" + unescape(args.body) + "</A><BR>"); } else { msgCompFields.SetBody("\n" + args.body + "\n"); } } | function ComposeStartup(){ dump("Compose: ComposeStartup\n"); // Get arguments var args = GetArgs(); // fill in Identity combobox var identitySelect = document.getElementById("msgIdentity"); if (identitySelect) { fillIdentitySelect(identitySelect); } var identity; if (args.preselectid) identity = getIdentityForKey(args.preselectid); else { // no preselect, so use the default account var identities = accountManager.defaultAccount.identities; identity = identities.QueryElementAt(0, Components.interfaces.nsIMsgIdentity); } identitySelect.value = identity.key; // fill in Recipient type combobox FillRecipientTypeCombobox(); if (msgComposeService) { // this is frustrating, we need to convert the preselect identity key // back to an identity, to pass to initcompose // it would be nice if there was some way to actually send the // identity through "args" msgCompose = msgComposeService.InitCompose(window, args.originalMsg, args.type, args.format, args.fieldsAddr, identity); if (msgCompose) { //Creating a Editor Shell var editorShell = Components.classes["component://netscape/editor/editorshell"].createInstance(); editorShell = editorShell.QueryInterface(Components.interfaces.nsIEditorShell); if (!editorShell) { dump("Failed to create editorShell!\n"); return; } // save the editorShell in the window. The editor JS expects to find it there. window.editorShell = editorShell; window.editorShell.Init(); dump("Created editorShell\n"); contentWindow = window.content; // setEditorType MUST be call before setContentWindow if (msgCompose.composeHTML) { window.editorShell.SetEditorType("htmlmail"); dump("editor initialized in HTML mode\n"); } else { //Remove HTML toolbar as we are editing in plain text mode document.getElementById("FormatToolbar").setAttribute("hidden", true); window.editorShell.SetEditorType("text"); try { window.editorShell.wrapColumn = msgCompose.wrapLength; } catch (e) { dump("### window.editorShell.wrapColumn exception text: " + e + " - failed\n"); } dump("editor initialized in PLAIN TEXT mode\n"); } window.editorShell.SetContentWindow(contentWindow); window.editorShell.SetWebShellWindow(window); window.editorShell.SetToolbarWindow(window); var msgCompFields = msgCompose.compFields; if (msgCompFields) { if (args.body) //We need to set the body before setting //msgCompose.editor; { if (args.bodyislink == "true" && msgCompose.composeHTML) { msgCompFields.SetBody("<A HREF=\"" + args.body + "\">" + unescape(args.body) + "</A>"); } else { msgCompFields.SetBody(args.body); } } if (args.to) msgCompFields.SetTo(args.to); if (args.cc) msgCompFields.SetCc(args.cc); if (args.bcc) msgCompFields.SetBcc(args.bcc); if (args.newsgroups) msgCompFields.SetNewsgroups(args.newsgroups); if (args.subject) msgCompFields.SetSubject(args.subject); if (args.attachment) msgCompFields.SetAttachments(args.attachment); var subjectValue = msgCompFields.GetSubject(); if (subjectValue != "") { document.getElementById("msgSubject").value = subjectValue; } var attachmentValue = msgCompFields.GetAttachments(); if (attachmentValue != "") { var atts = attachmentValue.split(","); for (var i=0; i < atts.length; i++) { AddAttachment(atts[i]); } } } // Now that we have an Editor AppCore, we can finish to initialize the Compose AppCore msgCompose.editor = window.editorShell; msgCompose.RegisterStateListener(stateListener); WaitFinishLoadingDocument(); } }} |
document.getElementById("msgRecipient#1").focus(); | WaitFinishLoadingDocument(); | function ComposeStartup(){ dump("Compose: ComposeStartup\n"); // Get arguments var args = GetArgs(); // fill in Identity combobox var identitySelect = document.getElementById("msgIdentity"); if (identitySelect) { fillIdentitySelect(identitySelect); // because of bug #14312, a default option was in the select widget // remove it now identitySelect.remove(0); } if (args.preselectid) identitySelect.value = args.preselectid; else identitySelect.selectedIndex = 0; // fill in Recipient type combobox FillRecipientTypeCombobox(); if (msgComposeService) { // this is frustrating, we need to convert the preselect identity key // back to an identity, to pass to initcompose // it would be nice if there was some way to actually send the // identity through "args" var identity = getIdentityForKey(args.preselectid); msgCompose = msgComposeService.InitCompose(window, args.originalMsg, args.type, args.format, args.fieldsAddr, identity); if (msgCompose) { //Creating a Editor Shell var editorShell = Components.classes["component://netscape/editor/editorshell"].createInstance(); editorShell = editorShell.QueryInterface(Components.interfaces.nsIEditorShell); if (!editorShell) { dump("Failed to create editorShell!\n"); return; } // save the editorShell in the window. The editor JS expects to find it there. window.editorShell = editorShell; window.editorShell.Init(); dump("Created editorShell\n"); SetupToolbarElements(); //defined into EditorCommands.js contentWindow = window.content; // setEditorType MUST be call before setContentWindow if (msgCompose.composeHTML) { window.editorShell.SetEditorType("htmlmail"); dump("editor initialized in HTML mode\n"); } else { //Remove HTML toolbar as we are editing in plain text mode document.getElementById("FormatToolbar").setAttribute("hidden", true); window.editorShell.SetEditorType("text"); try { window.editorShell.wrapColumn = msgCompose.wrapLength; } catch (e) { dump("### window.editorShell.wrapColumn exception text: " + e + " - failed\n"); } dump("editor initialized in PLAIN TEXT mode\n"); } window.editorShell.SetContentWindow(contentWindow); window.editorShell.SetWebShellWindow(window); window.editorShell.SetToolbarWindow(window); window.editorShell.RegisterDocumentStateListener(editorDocumentListener); var msgCompFields = msgCompose.compFields; if (msgCompFields) { if (args.body) //We need to set the body before setting msgCompose.editor; msgCompFields.SetBody(args.body); if (args.to) msgCompFields.SetTo(args.to); if (args.cc) msgCompFields.SetCc(args.cc); if (args.bcc) msgCompFields.SetBcc(args.bcc); if (args.newsgroups) msgCompFields.SetNewsgroups(args.newsgroups); if (args.subject) msgCompFields.SetSubject(args.subject); if (args.attachment) msgCompFields.SetAttachments(args.attachment); var subjectValue = msgCompFields.GetSubject(); if (subjectValue != "") { document.getElementById("msgSubject").value = subjectValue; } var attachmentValue = msgCompFields.GetAttachments(); if (attachmentValue != "") { var atts = attachmentValue.split(","); for (var i=0; i < atts.length; i++) { AddAttachment(atts[i]); } } } // Now that we have an Editor AppCore, we can finish to initialize the Compose AppCore msgCompose.editor = window.editorShell; document.getElementById("msgRecipient#1").focus(); } }} |
StopInlineSpellChecker(); | function ComposeUnload(){ dump("\nComposeUnload from XUL\n"); EditorCleanup(); RemoveMessageComposeOfflineObserver(); RemoveDirectoryServerObserver(null); if (gCurrentIdentity) RemoveDirectoryServerObserver("mail.identity." + gCurrentIdentity.key); if (gCurrentAutocompleteDirectory) RemoveDirectorySettingsObserver(gCurrentAutocompleteDirectory); if (gMsgCompose) gMsgCompose.UnregisterStateListener(stateListener); if (gAutoSaveTimeout) clearTimeout(gAutoSaveTimeout);} |
|
RemoveDirectoryServerObserver(null); | RemoveDirectoryServerObserver(null); if (gCurrentIdentity) | function ComposeUnload(){ dump("\nComposeUnload from XUL\n"); RemoveMessageComposeOfflineObserver(); RemoveDirectoryServerObserver(null); RemoveDirectoryServerObserver("mail.identity." + gCurrentIdentity.key); if (gCurrentAutocompleteDirectory) RemoveDirectorySettingsObserver(gCurrentAutocompleteDirectory); gMsgCompose.UnregisterStateListener(stateListener);} |
if (gCurrentAutocompleteDirectory) RemoveDirectorySettingsObserver(gCurrentAutocompleteDirectory); gMsgCompose.UnregisterStateListener(stateListener); | if (gCurrentAutocompleteDirectory) RemoveDirectorySettingsObserver(gCurrentAutocompleteDirectory); if (gMsgCompose) gMsgCompose.UnregisterStateListener(stateListener); | function ComposeUnload(){ dump("\nComposeUnload from XUL\n"); RemoveMessageComposeOfflineObserver(); RemoveDirectoryServerObserver(null); RemoveDirectoryServerObserver("mail.identity." + gCurrentIdentity.key); if (gCurrentAutocompleteDirectory) RemoveDirectorySettingsObserver(gCurrentAutocompleteDirectory); gMsgCompose.UnregisterStateListener(stateListener);} |
RemoveDirectoryServerObserver(null); RemoveDirectoryServerObserver("mail.identity." + currentIdentity.key); | function ComposeUnload(){ dump("\nComposeUnload from XUL\n"); RemoveMessageComposeOfflineObserver(); msgCompose.UnregisterStateListener(stateListener);} |
|
var type = this.prefBranch.getPrefType (prefName); try { switch (type) | if (typeof realValue == "undefined") { var type = this.prefBranch.getPrefType (prefName); try | function con_addpref (prefName, defaultValue){ function prefGetter () { var type = this.prefBranch.getPrefType (prefName); try { switch (type) { case nsIPrefBranch.PREF_STRING: return this.prefBranch.getCharPref (prefName); case nsIPrefBranch.PREF_INT: return this.prefBranch.getIntPref (prefName); case nsIPrefBranch.PREF_BOOL: return this.prefBranch.getBoolPref (prefName); default: return defaultValue; } return null; } catch (ex) { dd ("caught exception reading pref ``" + prefName + "'' " + type + "\n" + ex); return defaultValue; } } function prefSetter (value) { try { switch (typeof value) { case "int": this.prefBranch.setIntPref (prefName, value); break; case "boolean": this.prefBranch.setBoolPref (prefName, value); break; default: this.prefBranch.setCharPref (prefName, value); break; } this.prefService.savePrefFile(null); } catch (ex) { dd ("caught exception writing pref ``" + prefName + "''\n" + ex); } return value; } if (prefName in console.prefs) return; console.prefs.prefNames.push(prefName); console.prefs.prefNames.sort(); console.prefs.__defineGetter__(prefName, prefGetter); console.prefs.__defineSetter__(prefName, prefSetter);} |
case nsIPrefBranch.PREF_STRING: return this.prefBranch.getCharPref (prefName); case nsIPrefBranch.PREF_INT: return this.prefBranch.getIntPref (prefName); case nsIPrefBranch.PREF_BOOL: return this.prefBranch.getBoolPref (prefName); default: return defaultValue; | switch (type) { case nsIPrefBranch.PREF_STRING: realValue = this.prefBranch.getCharPref (prefName); break; case nsIPrefBranch.PREF_INT: realValue = this.prefBranch.getIntPref (prefName); break; case nsIPrefBranch.PREF_BOOL: realValue = this.prefBranch.getBoolPref (prefName); break; default: realValue = defaultValue; } | function con_addpref (prefName, defaultValue){ function prefGetter () { var type = this.prefBranch.getPrefType (prefName); try { switch (type) { case nsIPrefBranch.PREF_STRING: return this.prefBranch.getCharPref (prefName); case nsIPrefBranch.PREF_INT: return this.prefBranch.getIntPref (prefName); case nsIPrefBranch.PREF_BOOL: return this.prefBranch.getBoolPref (prefName); default: return defaultValue; } return null; } catch (ex) { dd ("caught exception reading pref ``" + prefName + "'' " + type + "\n" + ex); return defaultValue; } } function prefSetter (value) { try { switch (typeof value) { case "int": this.prefBranch.setIntPref (prefName, value); break; case "boolean": this.prefBranch.setBoolPref (prefName, value); break; default: this.prefBranch.setCharPref (prefName, value); break; } this.prefService.savePrefFile(null); } catch (ex) { dd ("caught exception writing pref ``" + prefName + "''\n" + ex); } return value; } if (prefName in console.prefs) return; console.prefs.prefNames.push(prefName); console.prefs.prefNames.sort(); console.prefs.__defineGetter__(prefName, prefGetter); console.prefs.__defineSetter__(prefName, prefSetter);} |
return null; | catch (ex) { dd ("caught exception reading pref ``" + prefName + "'' " + type + "\n" + ex); realValue = defaultValue; } | function con_addpref (prefName, defaultValue){ function prefGetter () { var type = this.prefBranch.getPrefType (prefName); try { switch (type) { case nsIPrefBranch.PREF_STRING: return this.prefBranch.getCharPref (prefName); case nsIPrefBranch.PREF_INT: return this.prefBranch.getIntPref (prefName); case nsIPrefBranch.PREF_BOOL: return this.prefBranch.getBoolPref (prefName); default: return defaultValue; } return null; } catch (ex) { dd ("caught exception reading pref ``" + prefName + "'' " + type + "\n" + ex); return defaultValue; } } function prefSetter (value) { try { switch (typeof value) { case "int": this.prefBranch.setIntPref (prefName, value); break; case "boolean": this.prefBranch.setBoolPref (prefName, value); break; default: this.prefBranch.setCharPref (prefName, value); break; } this.prefService.savePrefFile(null); } catch (ex) { dd ("caught exception writing pref ``" + prefName + "''\n" + ex); } return value; } if (prefName in console.prefs) return; console.prefs.prefNames.push(prefName); console.prefs.prefNames.sort(); console.prefs.__defineGetter__(prefName, prefGetter); console.prefs.__defineSetter__(prefName, prefSetter);} |
catch (ex) { dd ("caught exception reading pref ``" + prefName + "'' " + type + "\n" + ex); return defaultValue; } | return realValue; | function con_addpref (prefName, defaultValue){ function prefGetter () { var type = this.prefBranch.getPrefType (prefName); try { switch (type) { case nsIPrefBranch.PREF_STRING: return this.prefBranch.getCharPref (prefName); case nsIPrefBranch.PREF_INT: return this.prefBranch.getIntPref (prefName); case nsIPrefBranch.PREF_BOOL: return this.prefBranch.getBoolPref (prefName); default: return defaultValue; } return null; } catch (ex) { dd ("caught exception reading pref ``" + prefName + "'' " + type + "\n" + ex); return defaultValue; } } function prefSetter (value) { try { switch (typeof value) { case "int": this.prefBranch.setIntPref (prefName, value); break; case "boolean": this.prefBranch.setBoolPref (prefName, value); break; default: this.prefBranch.setCharPref (prefName, value); break; } this.prefService.savePrefFile(null); } catch (ex) { dd ("caught exception writing pref ``" + prefName + "''\n" + ex); } return value; } if (prefName in console.prefs) return; console.prefs.prefNames.push(prefName); console.prefs.prefNames.sort(); console.prefs.__defineGetter__(prefName, prefGetter); console.prefs.__defineSetter__(prefName, prefSetter);} |
realValue = value; | function con_addpref (prefName, defaultValue){ function prefGetter () { var type = this.prefBranch.getPrefType (prefName); try { switch (type) { case nsIPrefBranch.PREF_STRING: return this.prefBranch.getCharPref (prefName); case nsIPrefBranch.PREF_INT: return this.prefBranch.getIntPref (prefName); case nsIPrefBranch.PREF_BOOL: return this.prefBranch.getBoolPref (prefName); default: return defaultValue; } return null; } catch (ex) { dd ("caught exception reading pref ``" + prefName + "'' " + type + "\n" + ex); return defaultValue; } } function prefSetter (value) { try { switch (typeof value) { case "int": this.prefBranch.setIntPref (prefName, value); break; case "boolean": this.prefBranch.setBoolPref (prefName, value); break; default: this.prefBranch.setCharPref (prefName, value); break; } this.prefService.savePrefFile(null); } catch (ex) { dd ("caught exception writing pref ``" + prefName + "''\n" + ex); } return value; } if (prefName in console.prefs) return; console.prefs.prefNames.push(prefName); console.prefs.prefNames.sort(); console.prefs.__defineGetter__(prefName, prefGetter); console.prefs.__defineSetter__(prefName, prefSetter);} |
|
switch (type) | try { switch (type) { case nsIPrefBranch.PREF_STRING: return this.prefBranch.getCharPref (prefName); case nsIPrefBranch.PREF_INT: return this.prefBranch.getIntPref (prefName); case nsIPrefBranch.PREF_BOOL: return this.prefBranch.getBoolPref (prefName); default: return defaultValue; } return null; } catch (ex) | function con_addpref (prefName, defaultValue){ function prefGetter () { var type = this.prefBranch.getPrefType (prefName); switch (type) { case nsIPrefBranch.PREF_STRING: return this.prefBranch.getCharPref (prefName); case nsIPrefBranch.PREF_INT: return this.prefBranch.getIntPref (prefName); case nsIPrefBranch.PREF_BOOL: return this.prefBranch.getCharPref (prefName); default: return defaultValue; } return null; } function prefSetter (value) { switch (typeof value) { case "int": this.prefBranch.setIntPref (prefName, value); break; case "boolean": this.prefBranch.setBoolPref (prefName, value); break; default: this.prefBranch.setCharPref (prefName, value); break; } this.prefService.savePrefFile(null); return value; } if (prefName in console.prefs) return; console.prefs.prefNames.push(prefName); console.prefs.prefNames.sort(); console.prefs.__defineGetter__(prefName, prefGetter); console.prefs.__defineSetter__(prefName, prefSetter);} |
case nsIPrefBranch.PREF_STRING: return this.prefBranch.getCharPref (prefName); case nsIPrefBranch.PREF_INT: return this.prefBranch.getIntPref (prefName); case nsIPrefBranch.PREF_BOOL: return this.prefBranch.getCharPref (prefName); default: return defaultValue; | dd ("caught exception reading pref ``" + prefName + "'' " + type + "\n" + ex); return defaultValue; | function con_addpref (prefName, defaultValue){ function prefGetter () { var type = this.prefBranch.getPrefType (prefName); switch (type) { case nsIPrefBranch.PREF_STRING: return this.prefBranch.getCharPref (prefName); case nsIPrefBranch.PREF_INT: return this.prefBranch.getIntPref (prefName); case nsIPrefBranch.PREF_BOOL: return this.prefBranch.getCharPref (prefName); default: return defaultValue; } return null; } function prefSetter (value) { switch (typeof value) { case "int": this.prefBranch.setIntPref (prefName, value); break; case "boolean": this.prefBranch.setBoolPref (prefName, value); break; default: this.prefBranch.setCharPref (prefName, value); break; } this.prefService.savePrefFile(null); return value; } if (prefName in console.prefs) return; console.prefs.prefNames.push(prefName); console.prefs.prefNames.sort(); console.prefs.__defineGetter__(prefName, prefGetter); console.prefs.__defineSetter__(prefName, prefSetter);} |
return null; | function con_addpref (prefName, defaultValue){ function prefGetter () { var type = this.prefBranch.getPrefType (prefName); switch (type) { case nsIPrefBranch.PREF_STRING: return this.prefBranch.getCharPref (prefName); case nsIPrefBranch.PREF_INT: return this.prefBranch.getIntPref (prefName); case nsIPrefBranch.PREF_BOOL: return this.prefBranch.getCharPref (prefName); default: return defaultValue; } return null; } function prefSetter (value) { switch (typeof value) { case "int": this.prefBranch.setIntPref (prefName, value); break; case "boolean": this.prefBranch.setBoolPref (prefName, value); break; default: this.prefBranch.setCharPref (prefName, value); break; } this.prefService.savePrefFile(null); return value; } if (prefName in console.prefs) return; console.prefs.prefNames.push(prefName); console.prefs.prefNames.sort(); console.prefs.__defineGetter__(prefName, prefGetter); console.prefs.__defineSetter__(prefName, prefSetter);} |
|
switch (typeof value) | try { switch (typeof value) { case "int": this.prefBranch.setIntPref (prefName, value); break; case "boolean": this.prefBranch.setBoolPref (prefName, value); break; default: this.prefBranch.setCharPref (prefName, value); break; } this.prefService.savePrefFile(null); } catch (ex) | function con_addpref (prefName, defaultValue){ function prefGetter () { var type = this.prefBranch.getPrefType (prefName); switch (type) { case nsIPrefBranch.PREF_STRING: return this.prefBranch.getCharPref (prefName); case nsIPrefBranch.PREF_INT: return this.prefBranch.getIntPref (prefName); case nsIPrefBranch.PREF_BOOL: return this.prefBranch.getCharPref (prefName); default: return defaultValue; } return null; } function prefSetter (value) { switch (typeof value) { case "int": this.prefBranch.setIntPref (prefName, value); break; case "boolean": this.prefBranch.setBoolPref (prefName, value); break; default: this.prefBranch.setCharPref (prefName, value); break; } this.prefService.savePrefFile(null); return value; } if (prefName in console.prefs) return; console.prefs.prefNames.push(prefName); console.prefs.prefNames.sort(); console.prefs.__defineGetter__(prefName, prefGetter); console.prefs.__defineSetter__(prefName, prefSetter);} |
case "int": this.prefBranch.setIntPref (prefName, value); break; case "boolean": this.prefBranch.setBoolPref (prefName, value); break; default: this.prefBranch.setCharPref (prefName, value); break; | dd ("caught exception writing pref ``" + prefName + "''\n" + ex); | function con_addpref (prefName, defaultValue){ function prefGetter () { var type = this.prefBranch.getPrefType (prefName); switch (type) { case nsIPrefBranch.PREF_STRING: return this.prefBranch.getCharPref (prefName); case nsIPrefBranch.PREF_INT: return this.prefBranch.getIntPref (prefName); case nsIPrefBranch.PREF_BOOL: return this.prefBranch.getCharPref (prefName); default: return defaultValue; } return null; } function prefSetter (value) { switch (typeof value) { case "int": this.prefBranch.setIntPref (prefName, value); break; case "boolean": this.prefBranch.setBoolPref (prefName, value); break; default: this.prefBranch.setCharPref (prefName, value); break; } this.prefService.savePrefFile(null); return value; } if (prefName in console.prefs) return; console.prefs.prefNames.push(prefName); console.prefs.prefNames.sort(); console.prefs.__defineGetter__(prefName, prefGetter); console.prefs.__defineSetter__(prefName, prefSetter);} |
this.prefService.savePrefFile(null); | function con_addpref (prefName, defaultValue){ function prefGetter () { var type = this.prefBranch.getPrefType (prefName); switch (type) { case nsIPrefBranch.PREF_STRING: return this.prefBranch.getCharPref (prefName); case nsIPrefBranch.PREF_INT: return this.prefBranch.getIntPref (prefName); case nsIPrefBranch.PREF_BOOL: return this.prefBranch.getCharPref (prefName); default: return defaultValue; } return null; } function prefSetter (value) { switch (typeof value) { case "int": this.prefBranch.setIntPref (prefName, value); break; case "boolean": this.prefBranch.setBoolPref (prefName, value); break; default: this.prefBranch.setCharPref (prefName, value); break; } this.prefService.savePrefFile(null); return value; } if (prefName in console.prefs) return; console.prefs.prefNames.push(prefName); console.prefs.prefNames.sort(); console.prefs.__defineGetter__(prefName, prefGetter); console.prefs.__defineSetter__(prefName, prefSetter);} |
|
if (console._inputHistory[0] != e.line) | if (console._inputHistory.length != 0 && console._inputHistory[0] != e.line) | function con_icline (e){ if (console._inputHistory[0] != e.line) console._inputHistory.unshift (e.line); if (console._inputHistory.length > console.prefs["input.history.max"]) console._inputHistory.pop(); console._lastHistoryReferenced = -1; console._incompleteLine = ""; var ary = e.line.match (/(\S+) ?(.*)/); var command = ary[1]; e.command = command; e.inputData = ary[2] ? stringTrim(ary[2]) : ""; e.line = e.line; console.onInputCommand (e);} |
dispatch (e.line, null, CMD_CONSOLE); | var ev = {isInteractive: true, initialEvent: e}; dispatch (e.line, ev, CMD_CONSOLE); | function con_icline (e){ if (console.inputHistory.length == 0 || console.inputHistory[0] != e.line) console.inputHistory.unshift (e.line); if (console.inputHistory.length > console.prefs["input.history.max"]) console.inputHistory.pop(); console.lastHistoryReferenced = -1; console.incompleteLine = ""; dispatch (e.line, null, CMD_CONSOLE);} |
{ e.inputData = e.line; console.onInputEval (e); } | evalInDebuggerScope (e.line); | function con_icline (e){ if (console._inputHistory[0] != e.line) console._inputHistory.unshift (e.line); if (console._inputHistory.length > console.prefs["input.history.max"]) console._inputHistory.pop(); console._lastHistoryReferenced = -1; console._incompleteLine = ""; if (e.line[0] == console.prefs["input.commandchar"]) { /* starts with a '/', look up the command */ var ary = e.line.substr(1, e.line.length).match (/(\S+)? ?(.*)/); var command = ary[1]; e.command = command; e.inputData = ary[2] ? stringTrim(ary[2]) : ""; e.line = e.line; console.onInputCommand (e); } else /* no command character */ { e.inputData = e.line; console.onInputEval (e); }} |
if (console._inputHistory.length != 0 && console._inputHistory[0] != e.line) | if (console._inputHistory.length == 0 || console._inputHistory[0] != e.line) | function con_icline (e){ if (console._inputHistory.length != 0 && console._inputHistory[0] != e.line) console._inputHistory.unshift (e.line); if (console._inputHistory.length > console.prefs["input.history.max"]) console._inputHistory.pop(); console._lastHistoryReferenced = -1; console._incompleteLine = ""; var ary = e.line.match (/(\S+) ?(.*)/); var command = ary[1]; e.command = command; e.inputData = ary[2] ? stringTrim(ary[2]) : ""; e.line = e.line; console.onInputCommand (e);} |
if (!console[ary[0].func](e)) display (ary[0].name + " " + ary[0].usage, MT_USAGE); | console[ary[0].func](e) | function con_icommand (e){ var ary = console._commands.list (e.command); switch (ary.length) { case 0: display (getMsg(MSN_ERR_NO_COMMAND, e.command), MT_ERROR); break; case 1: if (typeof console[ary[0].func] == "undefined") display (getMsg(MSN_ERR_NOTIMPLEMENTED, ary[0].name), MT_ERROR); else { e.commandEntry = ary[0]; if (!console[ary[0].func](e)) display (ary[0].name + " " + ary[0].usage, MT_USAGE); } break; default: var str = ""; for (var i in ary) str += str ? ", " + ary[i].name : ary[i].name; display (getMsg (MSN_ERR_AMBIGCOMMAND, [e.command, ary.length, str]), MT_ERROR); }} |
display ("$[" + l + "] = " + formatValue (rv), MT_FEVAL_OUT); | display (getMsg(MSN_FMT_TMP_ASSIGN, [l, formatValue (rv)]), MT_FEVAL_OUT); | function con_ieval (e){ if (e.inputData) { display (e.inputData, MT_FEVAL_IN); var rv = evalInTargetScope (e.inputData); if (typeof rv != "undefined") { if (rv != null) { refreshResultsArray(); var l = $.length; $[l] = rv; display ("$[" + l + "] = " + formatValue (rv), MT_FEVAL_OUT); } else display (formatValue (rv), MT_FEVAL_OUT); } } return true;} |
try { display (e.inputData, "EVAL-IN"); var rv = String(console.doEval (e.inputData)); if (typeof rv != "undefined") display (rv, "EVAL-OUT"); } catch (ex) { var str = ""; if (ex.fileName && ex.lineNumber && ex.message) { if (!ex.name) ex.name = "Error"; str = getMsg (MSN_EVAL_ERROR, [ex.name, ex.fileName, ex.lineNumber]); if (ex.functionName) str += " (" + ex.functionName + ")"; str += ": " + ex.message; } else str = getMsg (MSN_EVAL_THREW, String(ex)); display (str, MT_ERROR); } | if (e.inputData) evalInTargetScope (e.inputData) | function con_ieval (e){ try { display (e.inputData, "EVAL-IN"); var rv = String(console.doEval (e.inputData)); if (typeof rv != "undefined") display (rv, "EVAL-OUT"); } catch (ex) { var str = ""; if (ex.fileName && ex.lineNumber && ex.message) { if (!ex.name) ex.name = "Error"; /* if it looks like a normal exception, print all the bits */ str = getMsg (MSN_EVAL_ERROR, [ex.name, ex.fileName, ex.lineNumber]); if (ex.functionName) str += " (" + ex.functionName + ")"; str += ": " + ex.message; } else /* otherwise, just convert to a string */ str = getMsg (MSN_EVAL_THREW, String(ex)); display (str, MT_ERROR); } return true;} |
console.currentFrame = console.frames[idx]; | console.currentFrameIndex = idx; | function con_iframe (e){ if (!console.frames) { display (MSG_ERR_NO_STACK, MT_ERROR); return false; } var idx = parseInt(e.inputData); if (idx >= 0) { console.currentFrame = console.frames[idx]; displayFrame (console.frames[idx], idx); } else displayFrame (console.currentFrame); return true;} |
displayFrame (console.currentFrame); | displayFrame (console.frames[console.currentFrameIndex]); | function con_iframe (e){ if (!console.frames) { display (MSG_ERR_NO_STACK, MT_ERROR); return false; } var idx = parseInt(e.inputData); if (idx >= 0) { console.currentFrame = console.frames[idx]; displayFrame (console.frames[idx], idx); } else displayFrame (console.currentFrame); return true;} |
if (console.currentFrame.scope.propertyCount == 0) | if (console.frames[console.currentFrameIndex].scope.propertyCount == 0) | function con_iscope (e){ if (!console.frames) { display (MSG_ERR_NO_STACK, MT_ERROR); return false; } if (console.currentFrame.scope.propertyCount == 0) display (getMsg (MSN_NO_PROPERTIES, MSG_VAL_SCOPE + " 0")); else displayProperties (console.currentFrame.scope); return true;} |
displayProperties (console.currentFrame.scope); | displayProperties (console.frames[console.currentFrameIndex].scope); | function con_iscope (e){ if (!console.frames) { display (MSG_ERR_NO_STACK, MT_ERROR); return false; } if (console.currentFrame.scope.propertyCount == 0) display (getMsg (MSN_NO_PROPERTIES, MSG_VAL_SCOPE + " 0")); else displayProperties (console.currentFrame.scope); return true;} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.