rem
stringlengths
0
126k
add
stringlengths
0
441k
context
stringlengths
15
136k
pref = pref.QueryInterface(Components.interfaces.nsIPref);
pref = pref.QueryInterface(Components.interfaces.nsIPrefBranch);
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['@mozilla.org/preferences;1']; if (pref) { pref = pref.getService(); pref = pref.QueryInterface(Components.interfaces.nsIPref); } if (pref) { pref.SetCharPref("intl.charset.detector", prefvalue); editorShell.LoadUrl(editorShell.editorDocument.location); }}
pref.SetCharPref("intl.charset.detector", prefvalue);
pref.setCharPref("intl.charset.detector", prefvalue);
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['@mozilla.org/preferences;1']; if (pref) { pref = pref.getService(); pref = pref.QueryInterface(Components.interfaces.nsIPref); } if (pref) { pref.SetCharPref("intl.charset.detector", prefvalue); editorShell.LoadUrl(editorShell.editorDocument.location); }}
LoadIdentity(true);
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; } } 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 and format menu as we are editing in plain text mode document.getElementById("FormatToolbar").setAttribute("hidden", true); document.getElementById("formatMenu").setAttribute("hidden", true); window.editorShell.SetEditorType("text"); 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") { 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); WaitFinishLoadingDocument(args.type); } }}
if (args.body) msgCompFields.SetBody(args.body);
if (args.body) { if (args.bodyislink == "true" && msgCompose.composeHTML) { msgCompFields.SetBody("<A HREF=\"" + args.body + "\">" + unescape(args.body) + "</A>"); } else { msgCompFields.SetBody(args.body); } }
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 { //TODO: what I need here is not the current selected identity but the default one. // For now GetCurrentIdentity gives back the first identity (not the selected one). identity = accountManager.currentIdentity; } 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"); 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); 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; msgCompose.RegisterStateListener(stateListener); WaitFinishLoadingDocument(); } }}
var editorShell = Components.classes["@mozilla.org/editor/editorshell;1"].createInstance(); editorShell = editorShell.QueryInterface(Components.interfaces.nsIEditorShell);
var editorElement = document.getElementById("content-frame"); if (!editorElement) { dump("Failed to get editor element!\n"); return; } var editorShell = editorElement.editorShell;
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["@mozilla.org/editor/editorshell;1"].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.Init();
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["@mozilla.org/editor/editorshell;1"].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); } }}
dump("Compose: ComposeStartup\n");
function ComposeStartup(){ dump("Compose: ComposeStartup\n"); var params = null; // New way to pass parameters to the compose window as a nsIMsgComposeParameters object var args = null; // old way, parameters are passed as a string if (window.arguments && window.arguments[0]) { try { params = window.arguments[0].QueryInterface(Components.interfaces.nsIMsgComposeParams); } catch(ex){} if (params == null) args = GetArgs(window.arguments[0]); } //dump("fill in Identity menulist\n"); var identityList = document.getElementById("msgIdentity"); var identityListPopup = document.getElementById("msgIdentityPopup"); if (identityListPopup) { fillIdentityListPopup(identityListPopup); } if (!params) { /* This code will go away soon as now arguments are passed to the window using a object of type nsMsgComposeParams instead of a string */ params = Components.classes["@mozilla.org/messengercompose/composeparams;1"].createInstance(Components.interfaces.nsIMsgComposeParams); params.composeFields = Components.classes["@mozilla.org/messengercompose/composefields;1"].createInstance(Components.interfaces.nsIMsgCompFields); if (args) //Convert old fashion arguments into params { var composeFields = params.composeFields; if (args.bodyislink == "true") params.bodyIsLink = true; if (args.type) params.type = args.type; if (args.format) params.format = args.format; if (args.originalMsg) params.originalMsgURI = args.originalMsg; if (args.preselectid) params.identity = getIdentityForKey(args.preselectid); if (args.to) composeFields.to = args.to; if (args.cc) composeFields.cc = args.cc; if (args.bcc) composeFields.bcc = args.bcc; if (args.newsgroups) composeFields.newsgroups = args.newsgroups; if (args.subject) composeFields.subject = args.subject; if (args.attachment) composeFields.attachments = args.attachment; if (args.newshost) composeFields.newshost = args.newshost; if (args.body) composeFields.body = args.body; } } if (params.identity == null) { // no pre selected identity, so use the default account var identities = accountManager.defaultAccount.identities; if (identities.Count() >= 1) params.identity = identities.QueryElementAt(0, Components.interfaces.nsIMsgIdentity); else { identities = GetIdentities(); params.identity = identities[0]; } } for (i = 0; i < identityListPopup.childNodes.length;i++) { var item = identityListPopup.childNodes[i]; var id = item.getAttribute('id'); if (id == params.identity.key) { identityList.selectedItem = item; break; } } LoadIdentity(true); if (msgComposeService) { msgCompose = msgComposeService.InitCompose(window, params); if (msgCompose) { //Creating a Editor Shell var editorElement = document.getElementById("content-frame"); if (!editorElement) { dump("Failed to get editor element!\n"); return; } var editorShell = editorElement.editorShell; 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;// 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("outputFormatMenu").setAttribute("hidden", true); document.getElementById("FormatToolbar").setAttribute("hidden", true); document.getElementById("formatMenu").setAttribute("hidden", true); document.getElementById("insertMenu").setAttribute("hidden", true); document.getElementById("menu_showFormatToolbar").setAttribute("hidden", true); 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 (params.bodyIsLink) { var body = msgCompFields.body; if (msgCompose.composeHTML) { var cleanBody; try { cleanBody = unescape(body); } catch(e) { cleanBody = body;} msgCompFields.body = "<BR><A HREF=\"" + body + "\">" + cleanBody + "</A><BR>"; } else msgCompFields.body = "\n<" + body + ">\n"; } var subjectValue = msgCompFields.subject; if (subjectValue != "") { document.getElementById("msgSubject").value = subjectValue; } var attachmentValue = msgCompFields.attachments; if (attachmentValue != "") { var atts = attachmentValue.split(","); for (var i=0; i < atts.length; i++) AddAttachment(atts[i], null); } } // 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) {} } }}
catch(ex){} if (params == null) args = GetArgs(window.arguments[0]);
catch(ex) { } if (!params) args = GetArgs(window.arguments[0]);
function ComposeStartup(){ dump("Compose: ComposeStartup\n"); var params = null; // New way to pass parameters to the compose window as a nsIMsgComposeParameters object var args = null; // old way, parameters are passed as a string if (window.arguments && window.arguments[0]) { try { params = window.arguments[0].QueryInterface(Components.interfaces.nsIMsgComposeParams); } catch(ex){} if (params == null) args = GetArgs(window.arguments[0]); } //dump("fill in Identity menulist\n"); var identityList = document.getElementById("msgIdentity"); var identityListPopup = document.getElementById("msgIdentityPopup"); if (identityListPopup) { fillIdentityListPopup(identityListPopup); } if (!params) { /* This code will go away soon as now arguments are passed to the window using a object of type nsMsgComposeParams instead of a string */ params = Components.classes["@mozilla.org/messengercompose/composeparams;1"].createInstance(Components.interfaces.nsIMsgComposeParams); params.composeFields = Components.classes["@mozilla.org/messengercompose/composefields;1"].createInstance(Components.interfaces.nsIMsgCompFields); if (args) //Convert old fashion arguments into params { var composeFields = params.composeFields; if (args.bodyislink == "true") params.bodyIsLink = true; if (args.type) params.type = args.type; if (args.format) params.format = args.format; if (args.originalMsg) params.originalMsgURI = args.originalMsg; if (args.preselectid) params.identity = getIdentityForKey(args.preselectid); if (args.to) composeFields.to = args.to; if (args.cc) composeFields.cc = args.cc; if (args.bcc) composeFields.bcc = args.bcc; if (args.newsgroups) composeFields.newsgroups = args.newsgroups; if (args.subject) composeFields.subject = args.subject; if (args.attachment) composeFields.attachments = args.attachment; if (args.newshost) composeFields.newshost = args.newshost; if (args.body) composeFields.body = args.body; } } if (params.identity == null) { // no pre selected identity, so use the default account var identities = accountManager.defaultAccount.identities; if (identities.Count() >= 1) params.identity = identities.QueryElementAt(0, Components.interfaces.nsIMsgIdentity); else { identities = GetIdentities(); params.identity = identities[0]; } } for (i = 0; i < identityListPopup.childNodes.length;i++) { var item = identityListPopup.childNodes[i]; var id = item.getAttribute('id'); if (id == params.identity.key) { identityList.selectedItem = item; break; } } LoadIdentity(true); if (msgComposeService) { msgCompose = msgComposeService.InitCompose(window, params); if (msgCompose) { //Creating a Editor Shell var editorElement = document.getElementById("content-frame"); if (!editorElement) { dump("Failed to get editor element!\n"); return; } var editorShell = editorElement.editorShell; 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;// 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("outputFormatMenu").setAttribute("hidden", true); document.getElementById("FormatToolbar").setAttribute("hidden", true); document.getElementById("formatMenu").setAttribute("hidden", true); document.getElementById("insertMenu").setAttribute("hidden", true); document.getElementById("menu_showFormatToolbar").setAttribute("hidden", true); 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 (params.bodyIsLink) { var body = msgCompFields.body; if (msgCompose.composeHTML) { var cleanBody; try { cleanBody = unescape(body); } catch(e) { cleanBody = body;} msgCompFields.body = "<BR><A HREF=\"" + body + "\">" + cleanBody + "</A><BR>"; } else msgCompFields.body = "\n<" + body + ">\n"; } var subjectValue = msgCompFields.subject; if (subjectValue != "") { document.getElementById("msgSubject").value = subjectValue; } var attachmentValue = msgCompFields.attachments; if (attachmentValue != "") { var atts = attachmentValue.split(","); for (var i=0; i < atts.length; i++) AddAttachment(atts[i], null); } } // 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) {} } }}
if (params.identity == null) {
if (!params.identity) {
function ComposeStartup(){ dump("Compose: ComposeStartup\n"); var params = null; // New way to pass parameters to the compose window as a nsIMsgComposeParameters object var args = null; // old way, parameters are passed as a string if (window.arguments && window.arguments[0]) { try { params = window.arguments[0].QueryInterface(Components.interfaces.nsIMsgComposeParams); } catch(ex){} if (params == null) args = GetArgs(window.arguments[0]); } //dump("fill in Identity menulist\n"); var identityList = document.getElementById("msgIdentity"); var identityListPopup = document.getElementById("msgIdentityPopup"); if (identityListPopup) { fillIdentityListPopup(identityListPopup); } if (!params) { /* This code will go away soon as now arguments are passed to the window using a object of type nsMsgComposeParams instead of a string */ params = Components.classes["@mozilla.org/messengercompose/composeparams;1"].createInstance(Components.interfaces.nsIMsgComposeParams); params.composeFields = Components.classes["@mozilla.org/messengercompose/composefields;1"].createInstance(Components.interfaces.nsIMsgCompFields); if (args) //Convert old fashion arguments into params { var composeFields = params.composeFields; if (args.bodyislink == "true") params.bodyIsLink = true; if (args.type) params.type = args.type; if (args.format) params.format = args.format; if (args.originalMsg) params.originalMsgURI = args.originalMsg; if (args.preselectid) params.identity = getIdentityForKey(args.preselectid); if (args.to) composeFields.to = args.to; if (args.cc) composeFields.cc = args.cc; if (args.bcc) composeFields.bcc = args.bcc; if (args.newsgroups) composeFields.newsgroups = args.newsgroups; if (args.subject) composeFields.subject = args.subject; if (args.attachment) composeFields.attachments = args.attachment; if (args.newshost) composeFields.newshost = args.newshost; if (args.body) composeFields.body = args.body; } } if (params.identity == null) { // no pre selected identity, so use the default account var identities = accountManager.defaultAccount.identities; if (identities.Count() >= 1) params.identity = identities.QueryElementAt(0, Components.interfaces.nsIMsgIdentity); else { identities = GetIdentities(); params.identity = identities[0]; } } for (i = 0; i < identityListPopup.childNodes.length;i++) { var item = identityListPopup.childNodes[i]; var id = item.getAttribute('id'); if (id == params.identity.key) { identityList.selectedItem = item; break; } } LoadIdentity(true); if (msgComposeService) { msgCompose = msgComposeService.InitCompose(window, params); if (msgCompose) { //Creating a Editor Shell var editorElement = document.getElementById("content-frame"); if (!editorElement) { dump("Failed to get editor element!\n"); return; } var editorShell = editorElement.editorShell; 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;// 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("outputFormatMenu").setAttribute("hidden", true); document.getElementById("FormatToolbar").setAttribute("hidden", true); document.getElementById("formatMenu").setAttribute("hidden", true); document.getElementById("insertMenu").setAttribute("hidden", true); document.getElementById("menu_showFormatToolbar").setAttribute("hidden", true); 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 (params.bodyIsLink) { var body = msgCompFields.body; if (msgCompose.composeHTML) { var cleanBody; try { cleanBody = unescape(body); } catch(e) { cleanBody = body;} msgCompFields.body = "<BR><A HREF=\"" + body + "\">" + cleanBody + "</A><BR>"; } else msgCompFields.body = "\n<" + body + ">\n"; } var subjectValue = msgCompFields.subject; if (subjectValue != "") { document.getElementById("msgSubject").value = subjectValue; } var attachmentValue = msgCompFields.attachments; if (attachmentValue != "") { var atts = attachmentValue.split(","); for (var i=0; i < atts.length; i++) AddAttachment(atts[i], null); } } // 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) {} } }}
try { window.updateCommands("create"); } catch(e) {}
function ComposeStartup(){ dump("Compose: ComposeStartup\n"); var params = null; // New way to pass parameters to the compose window as a nsIMsgComposeParameters object var args = null; // old way, parameters are passed as a string if (window.arguments && window.arguments[0]) { try { params = window.arguments[0].QueryInterface(Components.interfaces.nsIMsgComposeParams); } catch(ex){} if (params == null) args = GetArgs(window.arguments[0]); } //dump("fill in Identity menulist\n"); var identityList = document.getElementById("msgIdentity"); var identityListPopup = document.getElementById("msgIdentityPopup"); if (identityListPopup) { fillIdentityListPopup(identityListPopup); } if (!params) { /* This code will go away soon as now arguments are passed to the window using a object of type nsMsgComposeParams instead of a string */ params = Components.classes["@mozilla.org/messengercompose/composeparams;1"].createInstance(Components.interfaces.nsIMsgComposeParams); params.composeFields = Components.classes["@mozilla.org/messengercompose/composefields;1"].createInstance(Components.interfaces.nsIMsgCompFields); if (args) //Convert old fashion arguments into params { var composeFields = params.composeFields; if (args.bodyislink == "true") params.bodyIsLink = true; if (args.type) params.type = args.type; if (args.format) params.format = args.format; if (args.originalMsg) params.originalMsgURI = args.originalMsg; if (args.preselectid) params.identity = getIdentityForKey(args.preselectid); if (args.to) composeFields.to = args.to; if (args.cc) composeFields.cc = args.cc; if (args.bcc) composeFields.bcc = args.bcc; if (args.newsgroups) composeFields.newsgroups = args.newsgroups; if (args.subject) composeFields.subject = args.subject; if (args.attachment) composeFields.attachments = args.attachment; if (args.newshost) composeFields.newshost = args.newshost; if (args.body) composeFields.body = args.body; } } if (params.identity == null) { // no pre selected identity, so use the default account var identities = accountManager.defaultAccount.identities; if (identities.Count() >= 1) params.identity = identities.QueryElementAt(0, Components.interfaces.nsIMsgIdentity); else { identities = GetIdentities(); params.identity = identities[0]; } } for (i = 0; i < identityListPopup.childNodes.length;i++) { var item = identityListPopup.childNodes[i]; var id = item.getAttribute('id'); if (id == params.identity.key) { identityList.selectedItem = item; break; } } LoadIdentity(true); if (msgComposeService) { msgCompose = msgComposeService.InitCompose(window, params); if (msgCompose) { //Creating a Editor Shell var editorElement = document.getElementById("content-frame"); if (!editorElement) { dump("Failed to get editor element!\n"); return; } var editorShell = editorElement.editorShell; 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;// 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("outputFormatMenu").setAttribute("hidden", true); document.getElementById("FormatToolbar").setAttribute("hidden", true); document.getElementById("formatMenu").setAttribute("hidden", true); document.getElementById("insertMenu").setAttribute("hidden", true); document.getElementById("menu_showFormatToolbar").setAttribute("hidden", true); 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 (params.bodyIsLink) { var body = msgCompFields.body; if (msgCompose.composeHTML) { var cleanBody; try { cleanBody = unescape(body); } catch(e) { cleanBody = body;} msgCompFields.body = "<BR><A HREF=\"" + body + "\">" + cleanBody + "</A><BR>"; } else msgCompFields.body = "\n<" + body + ">\n"; } var subjectValue = msgCompFields.subject; if (subjectValue != "") { document.getElementById("msgSubject").value = subjectValue; } var attachmentValue = msgCompFields.attachments; if (attachmentValue != "") { var atts = attachmentValue.split(","); for (var i=0; i < atts.length; i++) AddAttachment(atts[i], null); } } // 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) {} } }}
window.editorShell.wrapColumn = msgCompose.wrapLength;
try { window.editorShell.wrapColumn = msgCompose.wrapLength; } catch (e) { dump("### window.editorShell.wrapColumn exception text: " + e + " - failed\n"); }
function ComposeStartup(){ dump("Compose: StartUp\n"); // Get arguments var args = GetArgs(); dump("[type=" + args.type + "]\n"); dump("[format=" + args.format + "]\n"); dump("[originalMsg=" + args.originalMsg + "]\n"); if (msgComposeService) { msgCompose = msgComposeService.InitCompose(window, args.originalMsg, args.type, args.format); if (msgCompose) { // Generate a unique number, do we have a better way? var date = new Date(); sessionID = date.getTime() + Math.random(); //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"); dump("initalizing the editor app core\n"); SetupToolbarElements(); //defined into EditorCommands.js // setEditorType MUST be call before setContentWindow if (msgCompose.composeHTML) { window.editorShell.SetEditorType("html"); dump("editor initialized in HTML mode\n"); } else { window.editorShell.SetEditorType("text"); window.editorShell.wrapColumn = msgCompose.wrapLength; dump("editor initialized in PLAIN TEXT mode\n"); } window.editorShell.SetContentWindow(window.frames[0]); window.editorShell.SetWebShellWindow(window); window.editorShell.SetToolbarWindow(window); // Now that we have an Editor AppCore, we can finish to initialize the Compose AppCore msgCompose.editor = window.editorShell; //Now we are ready to load all the fields (to, cc, subject, body, etc...) msgCompose.LoadFields();// document.getElementById("msgTo").focus();// If I call focus, Apprunner will crash later when closing this windows! } }}
window.editorShell.SetEditorType("htmlMail");
window.editorShell.SetEditorType("html");
function ComposeStartup(){ dump("Compose: ComposeStartup\n"); // Get arguments var args = GetArgs(); // fill in Identity combobox var identitySelect = document.getElementById("msgIdentity"); if (identitySelect) { fillIdentitySelect(identitySelect); } // fill in Recipient type combobox FillRecipientTypeCombobox(); if (msgComposeService) { msgCompose = msgComposeService.InitCompose(window, args.originalMsg, args.type, args.format, args.fieldsAddr); 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); // Now that we have an Editor AppCore, we can finish to initialize the Compose AppCore msgCompose.editor = window.editorShell; var msgCompFields = msgCompose.compFields; if (msgCompFields) { if (args.body) //We need to set the body before calling LoadFields(); msgCompFields.SetBody(args.body); //Now we are ready to load all the fields (to, cc, subject, body, etc...) depending of the type of the message msgCompose.LoadFields(); 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); CompFields2Recipients(msgCompFields); var subjectValue = msgCompFields.GetSubject(); if (subjectValue != "") { document.getElementById("msgSubject").value = subjectValue; } } document.getElementById("msgRecipient#1").focus(); } }}
identitySelect.value = args.preselectid;
identity = getIdentityForKey(args.preselectid);
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); 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; msgCompose.RegisterStateListener(stateListener); WaitFinishLoadingDocument(); } }}
identitySelect.selectedIndex = 0;
{ identity = msgService.currentIdentity; } identitySelect.value = identity.key;
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); 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; msgCompose.RegisterStateListener(stateListener); WaitFinishLoadingDocument(); } }}
var identity = getIdentityForKey(args.preselectid);
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); 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; msgCompose.RegisterStateListener(stateListener); WaitFinishLoadingDocument(); } }}
document.getElementById("FormatToolbar").setAttribute("hidden", true);
function ComposeStartup(){ dump("Compose: ComposeStartup\n"); // Get arguments var args = GetArgs(); // fill in Identity combobox var identitySelect = document.getElementById("msgIdentity"); if (identitySelect) { fillIdentitySelect(identitySelect); } // fill in Recipient type combobox FillRecipientTypeCombobox(); if (msgComposeService) { msgCompose = msgComposeService.InitCompose(window, args.originalMsg, args.type, args.format, args.fieldsAddr); 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("html"); dump("editor initialized in HTML mode\n"); } else { 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); // Now that we have an Editor AppCore, we can finish to initialize the Compose AppCore msgCompose.editor = window.editorShell; var msgCompFields = msgCompose.compFields; if (msgCompFields) { if (args.body) //We need to set the body before calling LoadFields(); msgCompFields.SetBody(args.body); //Now we are ready to load all the fields (to, cc, subject, body, etc...) depending of the type of the message msgCompose.LoadFields(); 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); CompFields2Recipients(msgCompFields); var subjectValue = msgCompFields.GetSubject(); if (subjectValue != "") { document.getElementById("msgSubject").value = subjectValue; } } document.getElementById("msgRecipient#1").focus(); } }}
msgCompFields.SetBody("<BR><A HREF=\"" + body + "\">" + cleanBody + "</A><BR>");
msgCompFields.SetBody('<a href="' + body + '">' + cleanBody + '</a><br>');
function ComposeStartup(){ dump("Compose: ComposeStartup\n"); var params = null; // New way to pass parameters to the compose window as a nsIMsgComposeParameters object var args = null; // old way, parameters are passed as a string if (window.arguments && window.arguments[0]) { try { params = window.arguments[0].QueryInterface(Components.interfaces.nsIMsgComposeParams); } catch(ex){} if (params == null) args = GetArgs(window.arguments[0]); } //dump("fill in Identity menulist\n"); var identityList = document.getElementById("msgIdentity"); var identityListPopup = document.getElementById("msgIdentityPopup"); if (identityListPopup) { fillIdentityListPopup(identityListPopup); } if (!params) { /* This code will go away soon as now arguments are passed to the window using a object of type nsMsgComposeParams instead of a string */ params = Components.classes["@mozilla.org/messengercompose/composeparams;1"].createInstance(Components.interfaces.nsIMsgComposeParams); params.composeFields = Components.classes["@mozilla.org/messengercompose/composefields;1"].createInstance(Components.interfaces.nsIMsgCompFields); if (args) //Convert old fashion arguments into params { var composeFields = params.composeFields; if (args.bodyislink == "true") params.bodyIsLink = true; if (args.type) params.type = args.type; if (args.format) params.format = args.format; if (args.originalMsg) params.originalMsgURI = args.originalMsg; if (args.preselectid) params.identity = getIdentityForKey(args.preselectid); if (args.to) composeFields.SetTo(args.to); if (args.cc) composeFields.SetCc(args.cc); if (args.bcc) composeFields.SetBcc(args.bcc); if (args.newsgroups) composeFields.SetNewsgroups(args.newsgroups); if (args.subject) composeFields.SetSubject(args.subject); if (args.attachment) composeFields.SetAttachments(args.attachment); if (args.newshost) composeFields.SetNewshost(args.newshost); if (args.body) composeFields.SetBody(args.body); } } if (params.identity == null) { // no pre selected identity, so use the default account var identities = accountManager.defaultAccount.identities; if (identities.Count() >= 1) params.identity = identities.QueryElementAt(0, Components.interfaces.nsIMsgIdentity); else { identities = GetIdentities(); params.identity = identities[0]; } } for (i = 0; i < identityListPopup.childNodes.length;i++) { var item = identityListPopup.childNodes[i]; var id = item.getAttribute('id'); if (id == params.identity.key) { identityList.selectedItem = item; break; } } LoadIdentity(true); if (msgComposeService) { msgCompose = msgComposeService.InitCompose(window, params); if (msgCompose) { //Creating a Editor Shell var editorElement = document.getElementById("content-frame"); if (!editorElement) { dump("Failed to get editor element!\n"); return; } var editorShell = editorElement.editorShell; 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;// 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 (params.bodyIsLink) { var body = msgCompFields.GetBody(); if (msgCompose.composeHTML) { var cleanBody; try { cleanBody = unescape(body); } catch(e) { cleanBody = body;} msgCompFields.SetBody("<BR><A HREF=\"" + body + "\">" + cleanBody + "</A><BR>"); } else msgCompFields.SetBody("\n<" + body + ">\n"); } 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], null); } } // 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) {} WaitFinishLoadingDocument(params.type); } }}
msgCompFields.SetBody("\n<" + body + ">\n");
msgCompFields.SetBody('<' + body + '>\n');
function ComposeStartup(){ dump("Compose: ComposeStartup\n"); var params = null; // New way to pass parameters to the compose window as a nsIMsgComposeParameters object var args = null; // old way, parameters are passed as a string if (window.arguments && window.arguments[0]) { try { params = window.arguments[0].QueryInterface(Components.interfaces.nsIMsgComposeParams); } catch(ex){} if (params == null) args = GetArgs(window.arguments[0]); } //dump("fill in Identity menulist\n"); var identityList = document.getElementById("msgIdentity"); var identityListPopup = document.getElementById("msgIdentityPopup"); if (identityListPopup) { fillIdentityListPopup(identityListPopup); } if (!params) { /* This code will go away soon as now arguments are passed to the window using a object of type nsMsgComposeParams instead of a string */ params = Components.classes["@mozilla.org/messengercompose/composeparams;1"].createInstance(Components.interfaces.nsIMsgComposeParams); params.composeFields = Components.classes["@mozilla.org/messengercompose/composefields;1"].createInstance(Components.interfaces.nsIMsgCompFields); if (args) //Convert old fashion arguments into params { var composeFields = params.composeFields; if (args.bodyislink == "true") params.bodyIsLink = true; if (args.type) params.type = args.type; if (args.format) params.format = args.format; if (args.originalMsg) params.originalMsgURI = args.originalMsg; if (args.preselectid) params.identity = getIdentityForKey(args.preselectid); if (args.to) composeFields.SetTo(args.to); if (args.cc) composeFields.SetCc(args.cc); if (args.bcc) composeFields.SetBcc(args.bcc); if (args.newsgroups) composeFields.SetNewsgroups(args.newsgroups); if (args.subject) composeFields.SetSubject(args.subject); if (args.attachment) composeFields.SetAttachments(args.attachment); if (args.newshost) composeFields.SetNewshost(args.newshost); if (args.body) composeFields.SetBody(args.body); } } if (params.identity == null) { // no pre selected identity, so use the default account var identities = accountManager.defaultAccount.identities; if (identities.Count() >= 1) params.identity = identities.QueryElementAt(0, Components.interfaces.nsIMsgIdentity); else { identities = GetIdentities(); params.identity = identities[0]; } } for (i = 0; i < identityListPopup.childNodes.length;i++) { var item = identityListPopup.childNodes[i]; var id = item.getAttribute('id'); if (id == params.identity.key) { identityList.selectedItem = item; break; } } LoadIdentity(true); if (msgComposeService) { msgCompose = msgComposeService.InitCompose(window, params); if (msgCompose) { //Creating a Editor Shell var editorElement = document.getElementById("content-frame"); if (!editorElement) { dump("Failed to get editor element!\n"); return; } var editorShell = editorElement.editorShell; 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;// 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 (params.bodyIsLink) { var body = msgCompFields.GetBody(); if (msgCompose.composeHTML) { var cleanBody; try { cleanBody = unescape(body); } catch(e) { cleanBody = body;} msgCompFields.SetBody("<BR><A HREF=\"" + body + "\">" + cleanBody + "</A><BR>"); } else msgCompFields.SetBody("\n<" + body + ">\n"); } 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], null); } } // 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) {} WaitFinishLoadingDocument(params.type); } }}
RemoveDirectoryServerObserver("mail.identity." + currentIdentity.key);
RemoveDirectoryServerObserver("mail.identity." + gCurrentIdentity.key);
function ComposeUnload(){ dump("\nComposeUnload from XUL\n"); RemoveMessageComposeOfflineObserver(); RemoveDirectoryServerObserver(null); RemoveDirectoryServerObserver("mail.identity." + currentIdentity.key); if (currentAutocompleteDirectory) RemoveDirectorySettingsObserver(currentAutocompleteDirectory); msgCompose.UnregisterStateListener(stateListener);}
RemoveMessageComposeOfflineObserver();
function ComposeUnload(){ dump("\nComposeUnload from XUL\n"); msgCompose.UnregisterStateListener(stateListener);}
msgCompose.UnregisterStateListener(stateListener);
function ComposeUnload(calledFromExit){ dump("\nComposeUnload from XUL\n"); if (msgCompose && msgComposeService) msgComposeService.DisposeCompose(msgCompose, false); //...and what's about the editor appcore, how can we release it?}
var rv;
function con_eval(__s, __o){ var __ex; try { if (__o && "eval" in __o) rv = __o.eval(__s); else rv = eval(__s); } catch (__ex) { dd ("doEval caught: " + __ex); if (__ex && typeof __ex == "object" && "fileName" in __ex && __ex.fileName.search (/venkman-eval.js$/) != -1) { __ex.fileName = MSG_VAL_CONSOLE; __ex.lineNumber = console.evalCount; } ++console.evalCount; throw __ex; } ++console.evalCount; return rv;}
if (__o && "eval" in __o) rv = __o.eval(__s);
if (__o) { rv = eval(__s, __o); }
function con_eval(__s, __o){ var __ex; try { if (__o && "eval" in __o) rv = __o.eval(__s); else rv = eval(__s); } catch (__ex) { dd ("doEval caught: " + __ex); if (__ex && typeof __ex == "object" && "fileName" in __ex && __ex.fileName.search (/venkman-eval.js$/) != -1) { __ex.fileName = MSG_VAL_CONSOLE; __ex.lineNumber = console.evalCount; } ++console.evalCount; throw __ex; } ++console.evalCount; return rv;}
}
function con_eval(__s, __o){ var __ex; try { if (__o && "eval" in __o) rv = __o.eval(__s); else rv = eval(__s); } catch (__ex) { dd ("doEval caught: " + __ex); if (__ex && typeof __ex == "object" && "fileName" in __ex && __ex.fileName.search (/venkman-eval.js$/) != -1) { __ex.fileName = MSG_VAL_CONSOLE; __ex.lineNumber = console.evalCount; } ++console.evalCount; throw __ex; } ++console.evalCount; return rv;}
if (__ex && __ex.fileName &&
if (__ex && typeof ex == "object" && "fileName" in __ex &&
function con_eval(__s){ var __ex; try { return eval(__s); } catch (__ex) { dd ("doEval caught: " + __ex); if (__ex && __ex.fileName && __ex.fileName.search (/venkman-eval.js$/) != -1) { __ex.fileName = MSG_VAL_CONSOLE; __ex.lineNumber = 1; } throw __ex; }}
dd ("doEval caught: " + __ex);
function con_eval(__s){ var __ex; try { return eval(__s); } catch (__ex) { if (__ex.fileName && __ex.fileName.search (/venkman-eval.js$/) != -1) { __ex.fileName = MSG_VAL_CONSOLE; __ex.lineNumber = 1; } throw __ex; } }
var source = console.scripts[currentFrame.script.fileName]; if (source)
var scriptRec = console.scripts[currentFrame.script.fileName]; if (scriptRec)
function con_fchanged (currentFrame, currentFrameIndex){ var stack = console.stackView.stack; if (currentFrame) { var frameRecord = stack.childData[currentFrameIndex]; var vr = frameRecord.calculateVisualRow(); console.stackView.selectedIndex = vr; console.stackView.scrollTo (vr, 0); var source = console.scripts[currentFrame.script.fileName]; if (source) { console.sourceView.displaySource(source); console.sourceView.softScrollTo(currentFrame.line); } else { dd ("frame from unknown source"); } } else { stack.close(); stack.childData = new Array(); stack.hide(); }}
console.sourceView.displaySource(source);
console.sourceView.setCurrentSourceProvider(scriptRec);
function con_fchanged (currentFrame, currentFrameIndex){ var stack = console.stackView.stack; if (currentFrame) { var frameRecord = stack.childData[currentFrameIndex]; var vr = frameRecord.calculateVisualRow(); console.stackView.selectedIndex = vr; console.stackView.scrollTo (vr, 0); var source = console.scripts[currentFrame.script.fileName]; if (source) { console.sourceView.displaySource(source); console.sourceView.softScrollTo(currentFrame.line); } else { dd ("frame from unknown source"); } } else { stack.close(); stack.childData = new Array(); stack.hide(); }}
console.onInputCommand (e);
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]; console[ary[0].func](e) } break; default: var str = ""; for (var i in ary) str += str ? MSG_COMMASP + ary[i].name : ary[i].name; display (getMsg (MSN_ERR_AMBIGCOMMAND, [e.command, ary.length, str]), MT_ERROR); }
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);}
str += str ? ", " + ary[i].name : ary[i].name;
str += str ? MSG_COMMASP + ary[i].name : ary[i].name;
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]; console[ary[0].func](e) } 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); }}
var idx = parseInt(e.inputData); if (idx < 0)
var idx = parseInt(e.inputData); if (isNaN(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) idx = getCurrentFrameIndex(); setCurrentFrameByIndex(idx); displayFrame (console.frames[idx], idx, true); focusSource (console.frames[idx].script.fileName, console.frames[idx].line); return true;}
display (getMsg(MSN_ERR_INVALID_PARAM, [MSG_VAL_EXPR, String(v)]),
var str = (v instanceof jsdIValue) ? formatValue(v) : String(v) display (getMsg(MSN_ERR_INVALID_PARAM, [MSG_VAL_EXPR, str]),
function con_iprops (e, forceDebuggerScope){ if (!e.inputData) { display (getMsg(MSN_ERR_REQUIRED_PARAM, MSG_VAL_EXPR)); return false; } var v; if (forceDebuggerScope) v = evalInDebuggerScope (e.inputData); else v = evalInTargetScope (e.inputData); if (!(v instanceof jsdIValue) || v.jsType != jsdIValue.TYPE_OBJECT) { display (getMsg(MSN_ERR_INVALID_PARAM, [MSG_VAL_EXPR, String(v)]), MT_ERROR); return false; } display (getMsg(forceDebuggerScope ? MSN_PROPSD_HEADER : MSN_PROPS_HEADER, e.inputData)); displayProperties(v); return true;}
init();
try { init(); } catch (ex) { window.alert (getMsg (MSN_ERR_STARTUP, formatException(ex))); }
function con_load (e){ dd ("Application venkman, 'JavaScript Debugger' loaded."); init(); }
sourceView.displaySource (scriptRec);
sourceView.setCurrentSourceProvider (scriptRec);
function con_projsel (e){ if (console.projectView.selectedIndex == -1) return; console.scriptsView.selectedIndex = -1; console.stackView.selectedIndex = -1; console.sourceView.selectedIndex = -1; var rowIndex = console.projectView.selectedIndex; if (rowIndex == -1 || rowIndex > console.projectView.rowCount) return; var row = console.projectView.childData.locateChildByVisualRow(rowIndex); if (!row) { ASSERT (0, "bogus row index " + rowIndex); return; } if (row instanceof BPRecord) { var scriptRec = console.scripts[row.fileName]; if (!scriptRec) { dd ("breakpoint in unknown source"); return; } var sourceView = console.sourceView; sourceView.displaySource (scriptRec); sourceView.scrollTo (row.line - 3, -1); if ("childData" in sourceView && sourceView.childData.isLoaded) { sourceView.outliner.selection.timedSelect (row.line - 1, 500); } else { sourceView.pendingSelect = row.line - 1; } } else dd ("not a bp record");}
}
function con_scptsel (e){ if (console.scriptsView.selectedIndex == -1) return; console.projectView.selectedIndex = -1; console.stackView.selectedIndex = -1; console.sourceView.selectedIndex = -1; var rowIndex = console.scriptsView.selectedIndex; if (rowIndex == -1 || rowIndex > console.scriptsView.rowCount) return; var row = console.scriptsView.childData.locateChildByVisualRow(rowIndex); ASSERT (row, "bogus row"); row.makeCurrent();}
console.ui["menu_initAtStartup"].setAttribute ("checked",
console.ui["menu_InitAtStartup"].setAttribute ("checked",
function con_showdebug (){ console.ui["menu_initAtStartup"].setAttribute ("checked", console.jsds.initAtStartup); var check; switch (getThrowMode()) { case TMODE_IGNORE: check = "menu_TModeIgnore"; break; case TMODE_TRACE: check = "menu_TModeTrace"; break; case TMODE_BREAK: check = "menu_TModeBreak"; break; } var menu = console.ui["menu_TModeIgnore"]; console.ui["menu_TModeIgnore"].setAttribute("checked", "menu_TModeIgnore" == check); console.ui["menu_TModeTrace"].setAttribute("checked", "menu_TModeTrace" == check); console.ui["menu_TModeBreak"].setAttribute("checked", "menu_TModeBreak" == check);}
if (colID == "breakpoint-col")
if (!console.sourceView.prettyPrint && colID == "breakpoint-col")
function con_sourceclick (e){ var target = e.originalTarget; if (target.localName == "outlinerbody") { var row = new Object(); var colID = new Object(); var childElt = new Object(); var outliner = console.sourceView.outliner; outliner.getCellAt(e.clientX, e.clientY, row, colID, childElt); if (row.value == -1) return; colID = colID.value; row = row.value; if (colID == "breakpoint-col") { var line = row + 1; var url = console.sourceView.childData.fileName; if (url) { if (getBreakpoint(url, line)) { clearBreakpoint (url, line); } else { setBreakpoint (url, line); } outliner.invalidateRow(row); } } }}
if (row.value == -1) return;
function con_sourceclick (e){ var target = e.originalTarget; if (target.localName == "outlinerbody") { var row = new Object(); var colID = new Object(); var childElt = new Object(); var outliner = console.sourceView.outliner; outliner.getCellAt(e.clientX, e.clientY, row, colID, childElt); colID = colID.value; row = row.value; if (colID == "breakpoint-col") { var line = row + 1; var url = console.sourceView.childData.fileName; if (url) { if (getBreakpoint(url, line)) { clearBreakpoint (url, line); } else { setBreakpoint (url, line); } outliner.invalidateRow(row); } } }}
if (row.value == -1) return;
function con_sourcesel (e){ if (console.sourceView.selectedIndex == -1) return; console.scriptsView.selectedIndex = -1; console.stackView.selectedIndex = -1; console.projectView.selectedIndex = -1; if (console.sourceView.outliner.selection.getRangeCount() > 1) { var row = new Object(); var colID = new Object(); var childElt = new Object(); var outliner = console.sourceView.outliner; outliner.getCellAt(e.clientX, e.clientY, row, colID, childElt); console.sourceView.selectedIndex = row.value; }}
source = console.scripts[row.frame.script.fileName]; if (!source)
var scriptContainer = console.scripts[row.frame.script.fileName]; if (!scriptContainer)
function con_stacksel (e){ if (console.stackView.selectedIndex == -1) return; console.scriptsView.selectedIndex = -1; console.projectView.selectedIndex = -1; console.sourceView.selectedIndex = -1; var rowIndex = console.stackView.selectedIndex; if (rowIndex == -1 || rowIndex > console.stackView.rowCount) return; var row = console.stackView.childData.locateChildByVisualRow(rowIndex); if (!row) { ASSERT (0, "bogus row index " + rowIndex); return; } var source; var sourceView = console.sourceView; if (row instanceof FrameRecord) { var index = row.childIndex; if (index != getCurrentFrameIndex()) { setCurrentFrameByIndex(index); displayFrame (console.frames[index], index, false); } source = console.scripts[row.frame.script.fileName]; if (!source) { dd ("frame from unknown source"); return; } sourceView.displaySource(source); sourceView.softScrollTo(row.frame.line); var script = row.frame.script; console.highlightFile = script.fileName; console.highlightStart = script.baseLineNumber - 1; console.highlightEnd = script.baseLineNumber - 1 + script.lineExtent; } else if (row instanceof ValueRecord && row.jsType == jsdIValue.TYPE_OBJECT) { if (row.parentRecord instanceof FrameRecord && row == row.parentRecord.scopeRec) return; var objVal = row.value.objectValue; var creatorURL = objVal.creatorURL; if (!creatorURL) { dd ("object with no creator"); return; } if (!(creatorURL in console.scripts)) { dd ("object from unknown source ``" + creatorURL + "''"); return; } sourceView.displaySource(console.scripts[creatorURL]); console.highlightFile = creatorURL; var creatorLine = objVal.creatorLine; sourceView.scrollTo (creatorLine); console.highlightStart = console.highlightEnd = creatorLine - 1; console.sourceView.outliner.invalidate(); }}
sourceView.displaySource(source);
var scriptRecord = scriptContainer.locateChildByScript (row.frame.script); if (!scriptRecord) { dd ("frame with unknown script"); return; } sourceView.setCurrentSourceProvider(scriptRecord);
function con_stacksel (e){ if (console.stackView.selectedIndex == -1) return; console.scriptsView.selectedIndex = -1; console.projectView.selectedIndex = -1; console.sourceView.selectedIndex = -1; var rowIndex = console.stackView.selectedIndex; if (rowIndex == -1 || rowIndex > console.stackView.rowCount) return; var row = console.stackView.childData.locateChildByVisualRow(rowIndex); if (!row) { ASSERT (0, "bogus row index " + rowIndex); return; } var source; var sourceView = console.sourceView; if (row instanceof FrameRecord) { var index = row.childIndex; if (index != getCurrentFrameIndex()) { setCurrentFrameByIndex(index); displayFrame (console.frames[index], index, false); } source = console.scripts[row.frame.script.fileName]; if (!source) { dd ("frame from unknown source"); return; } sourceView.displaySource(source); sourceView.softScrollTo(row.frame.line); var script = row.frame.script; console.highlightFile = script.fileName; console.highlightStart = script.baseLineNumber - 1; console.highlightEnd = script.baseLineNumber - 1 + script.lineExtent; } else if (row instanceof ValueRecord && row.jsType == jsdIValue.TYPE_OBJECT) { if (row.parentRecord instanceof FrameRecord && row == row.parentRecord.scopeRec) return; var objVal = row.value.objectValue; var creatorURL = objVal.creatorURL; if (!creatorURL) { dd ("object with no creator"); return; } if (!(creatorURL in console.scripts)) { dd ("object from unknown source ``" + creatorURL + "''"); return; } sourceView.displaySource(console.scripts[creatorURL]); console.highlightFile = creatorURL; var creatorLine = objVal.creatorLine; sourceView.scrollTo (creatorLine); console.highlightStart = console.highlightEnd = creatorLine - 1; console.sourceView.outliner.invalidate(); }}
console.highlightEnd = script.baseLineNumber - 1 + script.lineExtent;
console.highlightEnd = script.baseLineNumber + script.lineExtent - 2;
function con_stacksel (e){ if (console.stackView.selectedIndex == -1) return; console.scriptsView.selectedIndex = -1; console.projectView.selectedIndex = -1; console.sourceView.selectedIndex = -1; var rowIndex = console.stackView.selectedIndex; if (rowIndex == -1 || rowIndex > console.stackView.rowCount) return; var row = console.stackView.childData.locateChildByVisualRow(rowIndex); if (!row) { ASSERT (0, "bogus row index " + rowIndex); return; } var source; var sourceView = console.sourceView; if (row instanceof FrameRecord) { var index = row.childIndex; if (index != getCurrentFrameIndex()) { setCurrentFrameByIndex(index); displayFrame (console.frames[index], index, false); } source = console.scripts[row.frame.script.fileName]; if (!source) { dd ("frame from unknown source"); return; } sourceView.displaySource(source); sourceView.softScrollTo(row.frame.line); var script = row.frame.script; console.highlightFile = script.fileName; console.highlightStart = script.baseLineNumber - 1; console.highlightEnd = script.baseLineNumber - 1 + script.lineExtent; } else if (row instanceof ValueRecord && row.jsType == jsdIValue.TYPE_OBJECT) { if (row.parentRecord instanceof FrameRecord && row == row.parentRecord.scopeRec) return; var objVal = row.value.objectValue; var creatorURL = objVal.creatorURL; if (!creatorURL) { dd ("object with no creator"); return; } if (!(creatorURL in console.scripts)) { dd ("object from unknown source ``" + creatorURL + "''"); return; } sourceView.displaySource(console.scripts[creatorURL]); console.highlightFile = creatorURL; var creatorLine = objVal.creatorLine; sourceView.scrollTo (creatorLine); console.highlightStart = console.highlightEnd = creatorLine - 1; console.sourceView.outliner.invalidate(); }}
sourceView.displaySource(console.scripts[creatorURL]);
sourceView.setCurrentSourceProvider(console.scripts[creatorURL]);
function con_stacksel (e){ if (console.stackView.selectedIndex == -1) return; console.scriptsView.selectedIndex = -1; console.projectView.selectedIndex = -1; console.sourceView.selectedIndex = -1; var rowIndex = console.stackView.selectedIndex; if (rowIndex == -1 || rowIndex > console.stackView.rowCount) return; var row = console.stackView.childData.locateChildByVisualRow(rowIndex); if (!row) { ASSERT (0, "bogus row index " + rowIndex); return; } var source; var sourceView = console.sourceView; if (row instanceof FrameRecord) { var index = row.childIndex; if (index != getCurrentFrameIndex()) { setCurrentFrameByIndex(index); displayFrame (console.frames[index], index, false); } source = console.scripts[row.frame.script.fileName]; if (!source) { dd ("frame from unknown source"); return; } sourceView.displaySource(source); sourceView.softScrollTo(row.frame.line); var script = row.frame.script; console.highlightFile = script.fileName; console.highlightStart = script.baseLineNumber - 1; console.highlightEnd = script.baseLineNumber - 1 + script.lineExtent; } else if (row instanceof ValueRecord && row.jsType == jsdIValue.TYPE_OBJECT) { if (row.parentRecord instanceof FrameRecord && row == row.parentRecord.scopeRec) return; var objVal = row.value.objectValue; var creatorURL = objVal.creatorURL; if (!creatorURL) { dd ("object with no creator"); return; } if (!(creatorURL in console.scripts)) { dd ("object from unknown source ``" + creatorURL + "''"); return; } sourceView.displaySource(console.scripts[creatorURL]); console.highlightFile = creatorURL; var creatorLine = objVal.creatorLine; sourceView.scrollTo (creatorLine); console.highlightStart = console.highlightEnd = creatorLine - 1; console.sourceView.outliner.invalidate(); }}
[partialCommand, "[" + cmds.join(", ") + "]"]));
[partialCommand, "[" + cmds.join(MSG_COMMASP) + "]"]));
function con_tabcomplete (e){ var selStart = e.target.selectionStart; var selEnd = e.target.selectionEnd; var v = e.target.value; if (selStart != selEnd) { /* text is highlighted, just move caret to end and exit */ e.target.selectionStart = e.target.selectionEnd = v.length; return; } var firstSpace = v.indexOf(" "); if (firstSpace == -1) firstSpace = v.length; var pfx; var d; if ((selStart <= firstSpace)) { /* The cursor is positioned before the first space, so we're completing * a command */ var partialCommand = v.substring(0, firstSpace).toLowerCase(); var cmds = console._commands.listNames(partialCommand); if (!cmds) /* partial didn't match a thing */ display (getMsg(MSN_NO_CMDMATCH, partialCommand), MT_ERROR); else if (cmds.length == 1) { /* partial matched exactly one command */ pfx = cmds[0]; if (firstSpace == v.length) v = pfx + " "; else v = pfx + v.substr (firstSpace); e.target.value = v; e.target.selectionStart = e.target.selectionEnd = pfx.length + 1; } else if (cmds.length > 1) { /* partial matched more than one command */ d = new Date(); if ((d - console._lastTabUp) <= console.prefs["input.dtab.time"]) display (getMsg (MSN_CMDMATCH, [partialCommand, "[" + cmds.join(", ") + "]"])); else console._lastTabUp = d; pfx = getCommonPfx(cmds); if (firstSpace == v.length) v = pfx; else v = pfx + v.substr (firstSpace); e.target.value = v; e.target.selectionStart = e.target.selectionEnd = pfx.length; } }}
if (win.location.href == "about:blank" || win.location.href == "")
if ("ChromeWindow" in win && win instanceof win.ChromeWindow && (win.location.href == "about:blank" || win.location.href == ""))
function con_winopen (win){ if (win.location.href == "about:blank" || win.location.href == "") { //dd ("not loaded yet?"); setTimeout (con_winopen, 100, win); return; } //dd ("window opened: " + win); // + ", " + getInterfaces(win)); console.windows.appendChild (new WindowRecord(win)); win.addEventListener ("load", console.onWindowLoad, false); win.addEventListener ("unload", console.onWindowUnload, false); console.scriptsView.freeze();}
console.windows.appendChild (new WindowRecord(win));
console.windows.appendChild (new WindowRecord(win, "")); console.windows.hookedWindows.push(win);
function con_winopen (win){ if (win.location.href == "about:blank" || win.location.href == "") { //dd ("not loaded yet?"); setTimeout (con_winopen, 100, win); return; } //dd ("window opened: " + win); // + ", " + getInterfaces(win)); console.windows.appendChild (new WindowRecord(win)); win.addEventListener ("load", console.onWindowLoad, false); win.addEventListener ("unload", console.onWindowUnload, false); console.scriptsView.freeze();}
var winRecord = console.windows.locateChildByWindow(win); if (!ASSERT(winRecord, "onWindowClose: Can't find window record.")) return; console.windows.removeChildAtIndex(winRecord.childIndex);
if (win.location.href != "chrome: { var winRecord = console.windows.locateChildByWindow(win); if (!ASSERT(winRecord, "onWindowClose: Can't find window record.")) return; console.windows.removeChildAtIndex(winRecord.childIndex); var idx = arrayIndexOf(console.windows.hookedWindows, win); if (idx != -1) arrayRemoveAt(console.windows.hookedWindows, idx); }
function con_winunload (win){ //dd ("window closed: " + win); var winRecord = console.windows.locateChildByWindow(win); if (!ASSERT(winRecord, "onWindowClose: Can't find window record.")) return; console.windows.removeChildAtIndex(winRecord.childIndex); console.scriptsView.freeze();}
if (confirmedEntry) return (confirmedEntry == "1" ? true : false); var prompt = getWindowWatcher().getNewPrompter(null); var bundle = getWcapBundle(); var dontAskAgain = { value: false }; var bConfirmed = prompt.confirmCheck( bundle.GetStringFromName("noHttpsConfirmation.label"), bundle.formatStringFromName("noHttpsConfirmation.text", [host], 1), bundle.GetStringFromName("noHttpsConfirmation.check.text"), dontAskAgain ); if (dontAskAgain.value) { var confirmedHttpLogins = getPref( "calendar.wcap.confirmed_http_logins", ""); if (confirmedHttpLogins.length > 0) confirmedHttpLogins += ","; confirmedEntry = (bConfirmed ? "1" : "0"); confirmedHttpLogins += (encodedHost + ":" + confirmedEntry); setPref("calendar.wcap.confirmed_http_logins", confirmedHttpLogins); g_confirmedHttpLogins[encodedHost] = confirmedEntry;
if (confirmedEntry) { bConfirmed = (confirmedEntry == "1" ? true : false); } else { var prompt = getWindowWatcher().getNewPrompter(null); var bundle = getWcapBundle(); var dontAskAgain = { value: false }; var bConfirmed = prompt.confirmCheck( bundle.GetStringFromName("noHttpsConfirmation.label"), bundle.formatStringFromName("noHttpsConfirmation.text", [host], 1), bundle.GetStringFromName("noHttpsConfirmation.check.text"), dontAskAgain ); if (dontAskAgain.value) { var confirmedHttpLogins = getPref( "calendar.wcap.confirmed_http_logins", ""); if (confirmedHttpLogins.length > 0) confirmedHttpLogins += ","; confirmedEntry = (bConfirmed ? "1" : "0"); confirmedHttpLogins += (encodedHost + ":" + confirmedEntry); setPref("calendar.wcap.confirmed_http_logins", confirmedHttpLogins); g_confirmedHttpLogins[encodedHost] = confirmedEntry; }
function confirmInsecureLogin( uri ){ if (g_confirmedHttpLogins == null) { g_confirmedHttpLogins = {}; var confirmedHttpLogins = getPref( "calendar.wcap.confirmed_http_logins", ""); var tuples = confirmedHttpLogins.split(','); for each ( var tuple in tuples ) { var ar = tuple.split(':'); g_confirmedHttpLogins[ar[0]] = ar[1]; } } var host = uri.hostPort; var encodedHost = encodeURIComponent(host); var confirmedEntry = g_confirmedHttpLogins[encodedHost]; if (confirmedEntry) return (confirmedEntry == "1" ? true : false); var prompt = getWindowWatcher().getNewPrompter(null); var bundle = getWcapBundle(); var dontAskAgain = { value: false }; var bConfirmed = prompt.confirmCheck( bundle.GetStringFromName("noHttpsConfirmation.label"), bundle.formatStringFromName("noHttpsConfirmation.text", [host], 1), bundle.GetStringFromName("noHttpsConfirmation.check.text"), dontAskAgain ); if (dontAskAgain.value) { // save decision for all running calendars and all future confirmations: var confirmedHttpLogins = getPref( "calendar.wcap.confirmed_http_logins", ""); if (confirmedHttpLogins.length > 0) confirmedHttpLogins += ","; confirmedEntry = (bConfirmed ? "1" : "0"); confirmedHttpLogins += (encodedHost + ":" + confirmedEntry); setPref("calendar.wcap.confirmed_http_logins", confirmedHttpLogins); g_confirmedHttpLogins[encodedHost] = confirmedEntry; } return bConfirmed;}
logMessage("confirmInsecureLogin(" + host + ")", "returned: " + bConfirmed);
function confirmInsecureLogin( uri ){ if (g_confirmedHttpLogins == null) { g_confirmedHttpLogins = {}; var confirmedHttpLogins = getPref( "calendar.wcap.confirmed_http_logins", ""); var tuples = confirmedHttpLogins.split(','); for each ( var tuple in tuples ) { var ar = tuple.split(':'); g_confirmedHttpLogins[ar[0]] = ar[1]; } } var host = uri.hostPort; var encodedHost = encodeURIComponent(host); var confirmedEntry = g_confirmedHttpLogins[encodedHost]; if (confirmedEntry) return (confirmedEntry == "1" ? true : false); var prompt = getWindowWatcher().getNewPrompter(null); var bundle = getWcapBundle(); var dontAskAgain = { value: false }; var bConfirmed = prompt.confirmCheck( bundle.GetStringFromName("noHttpsConfirmation.label"), bundle.formatStringFromName("noHttpsConfirmation.text", [host], 1), bundle.GetStringFromName("noHttpsConfirmation.check.text"), dontAskAgain ); if (dontAskAgain.value) { // save decision for all running calendars and all future confirmations: var confirmedHttpLogins = getPref( "calendar.wcap.confirmed_http_logins", ""); if (confirmedHttpLogins.length > 0) confirmedHttpLogins += ","; confirmedEntry = (bConfirmed ? "1" : "0"); confirmedHttpLogins += (encodedHost + ":" + confirmedEntry); setPref("calendar.wcap.confirmed_http_logins", confirmedHttpLogins); g_confirmedHttpLogins[encodedHost] = confirmedEntry; } return bConfirmed;}
var dialogMsg = null;
var dialogMsg;
function confirmSuspiciousURL(aPhishingType, aSuspiciousHostName){ var brandShortName = gBrandBundle.getString("brandShortName"); var titleMsg = gMessengerBundle.getString("confirmPhishingTitle"); var dialogMsg = null; switch (aPhishingType) { case kPhishingWithIPAddress: case kPhishingWithMismatchedHosts: dialogMsg = gMessengerBundle.getFormattedString("confirmPhishingUrl" + aPhishingType, [brandShortName, aSuspiciousHostName], 2); break; default: return false; } const nsIPS = Components.interfaces.nsIPromptService; var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(nsIPS); var buttons = nsIPS.STD_YES_NO_BUTTONS + nsIPS.BUTTON_POS_1_DEFAULT; return promptService.confirmEx(window, titleMsg, dialogMsg, buttons, "", "", "", "", {}); /* the yes button is in position 0 */}
var bundle = getBundle();
var bundle = getWcapBundle();
function confirmUnsecureLogin( uri ){ var host = uri.hostPort; for each ( var hostEntry in g_httpHosts ) { if (hostEntry.m_host == host) { return hostEntry.m_bConfirmed; } } var prompt = getWindowWatcher().getNewPrompter(null); var bundle = getBundle(); var bConfirmed = prompt.confirm( bundle.GetStringFromName("noHttpsConfirmation.label"), bundle.formatStringFromName("noHttpsConfirmation.text", [host], 1) ); // save decision for all calendars: g_httpHosts.push( { m_host: host, m_bConfirmed: bConfirmed } ); return bConfirmed;}
var sBundle = srGetStrBundle("chrome: var titleMsg = sBundle.GetStringFromName("confirmUnsubscribeTitle"); var dialogMsg = sBundle.formatStringFromName("confirmUnsubscribeText", [ folder.name], 1);
var titleMsg = gMessengerBundle.getString("confirmUnsubscribeTitle"); var dialogMsg = gMessengerBundle.getFormattedString("confirmUnsubscribeText", [ folder.name]);
function ConfirmUnsubscribe(folder){ var sBundle = srGetStrBundle("chrome://messenger/locale/messenger.properties"); var titleMsg = sBundle.GetStringFromName("confirmUnsubscribeTitle"); var dialogMsg = sBundle.formatStringFromName("confirmUnsubscribeText", [ folder.name], 1); var commonDialogService = nsJSComponentManager.getService("@mozilla.org/appshell/commonDialogs;1", "nsICommonDialogs"); return commonDialogService.Confirm(window, titleMsg, dialogMsg); }
var sBundle = srGetStrBundle("chrome: var titleMsg = gMessengerBundle.GetStringFromName("confirmUnsubscribeTitle");
if (!gMessengerBundle) gMessengerBundle = document.getElementById("bundle_messenger"); var titleMsg = gMessengerBundle.getString("confirmUnsubscribeTitle");
function ConfirmUnsubscribe(folder){ var sBundle = srGetStrBundle("chrome://messenger/locale/messenger.properties"); var titleMsg = gMessengerBundle.GetStringFromName("confirmUnsubscribeTitle"); var dialogMsg = gMessengerBundle.getFormattedString("confirmUnsubscribeText", [folder.name], 1); var commonDialogService = nsJSComponentManager.getService("@mozilla.org/appshell/commonDialogs;1", "nsICommonDialogs"); return commonDialogService.Confirm(window, titleMsg, dialogMsg); }
return false;
function ConfirmWithTitle(title, message, okButtonText, cancelButtonText){ var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(); promptService = promptService.QueryInterface(Components.interfaces.nsIPromptService); if (promptService) { var result = {value:0}; var okFlag = okButtonText ? promptService.BUTTON_TITLE_IS_STRING : promptService.BUTTON_TITLE_OK; var cancelFlag = cancelButtonText ? promptService.BUTTON_TITLE_IS_STRING : promptService.BUTTON_TITLE_CANCEL; promptService.confirmEx(window, title, message, (okFlag * promptService.BUTTON_POS_0) + (cancelFlag * promptService.BUTTON_POS_1), okButtonText, cancelButtonText, null, null, {value:0}, result); return (result.value == 0); }}
constrainChecked = constrainChecked && !dialog.constrainCheckbox.disabled;
function constrainProportions( srcID, destID ){ srcElement = document.getElementById ( srcID ); if ( !srcElement ) return; forceInteger( srcID ); // now find out if we should be constraining or not var constrainChecked = (dialog.constrainCheckbox.checked); if ( !constrainChecked ) return; destElement = document.getElementById( destID ); if ( !destElement ) return; // set new value in the other edit field // src / dest ratio mantained // newDest = (newSrc * oldDest / oldSrc) if ( oldSourceInt == 0 ) destElement.value = srcElement.value; else destElement.value = Math.round( srcElement.value * destElement.value / oldSourceInt ); oldSourceInt = srcElement.value;}
disableDebugCommands()
disableDebugCommands(); --console._stopLevel;
function cont (){ console._stackOutlinerView.setStack(null); disableDebugCommands() console.jsds.exitNestedEventLoop(); return true;}
var href = hrefForClickEvent(event); if (href) { handleLinkClick(event, href, null); return true;
var linkNode = linkNodeForClickEvent(event); if (linkNode && linkNode.href) { handleLinkClick(event, linkNode.href, null); return isPhishingURL(linkNode, false);
function contentAreaClick(event) { var href = hrefForClickEvent(event); if (href) { handleLinkClick(event, href, null); return true; } return true; }
if (!linkNode.href) return true;
if (!wrapper.href) return true;
function contentAreaClick(event, fieldNormalClicks) { var target = event.target; var linkNode; var local_name = target.localName; if (local_name) { local_name = local_name.toLowerCase(); } switch (local_name) { case "a": case "area": case "link": if (target.hasAttribute("href")) linkNode = target; break; default: linkNode = findParentNode(event.originalTarget, "a"); // <a> cannot be nested. So if we find an anchor without an // href, there is no useful <a> around the target if (linkNode && !linkNode.hasAttribute("href")) linkNode = null; break; } if (linkNode) { if (event.button == 0 && !event.ctrlKey && !event.shiftKey && !event.altKey && !event.metaKey) { // A Web panel's links should target the main content area. Do this // if no modifier keys are down and if there's no target or the target equals // _main (the IE convention) or _content (the Mozilla convention). // The only reason we field _main and _content here is for the markLinkVisited // hack. target = linkNode.getAttribute("target"); if (fieldNormalClicks && (!target || target == "_content" || target == "_main")) // IE uses _main, SeaMonkey uses _content, we support both { if (!linkNode.href) return true; if (linkNode.getAttribute("onclick")) return true; var postData = { }; var url = getShortcutOrURI(linkNode.href, postData); if (!url) return true; markLinkVisited(linkNode.href, linkNode); loadURI(url, null, postData.value); event.preventDefault(); return false; } else if (linkNode.getAttribute("rel") == "sidebar") { // This is the Opera convention for a special link that - when clicked - allows // you to add a sidebar panel. We support the Opera convention here. The link's // title attribute contains the title that should be used for the sidebar panel. openDialog("chrome://browser/content/bookmarks/addBookmark2.xul", "", "centerscreen,chrome,dialog,resizable,dependent", linkNode.getAttribute("title"), linkNode.href, null, null, null, null, true); event.preventDefault(); return false; } else if (target == "_search") { // Used in WinIE as a way of transiently loading pages in a sidebar. We // mimic that WinIE functionality here and also load the page transiently. openWebPanel(gNavigatorBundle.getString("webPanels"), linkNode.href); event.preventDefault(); return false; } } else handleLinkClick(event, linkNode.href, linkNode); return true; } else { // Try simple XLink var href; linkNode = target; while (linkNode) { if (linkNode.nodeType == Node.ELEMENT_NODE) { href = linkNode.getAttributeNS("http://www.w3.org/1999/xlink", "href"); break; } linkNode = linkNode.parentNode; } if (href && href != "") { href = makeURLAbsolute(target.baseURI,href); handleLinkClick(event, href, null); return true; } } if (event.button == 1 && !findParentNode(event.originalTarget, "scrollbar") && gPrefService.getBoolPref("middlemouse.contentLoadURL")) { middleMousePaste(event); } return true; }
var url = getShortcutOrURI(linkNode.href, postData);
var url = getShortcutOrURI(wrapper.href, postData);
function contentAreaClick(event, fieldNormalClicks) { var target = event.target; var linkNode; var local_name = target.localName; if (local_name) { local_name = local_name.toLowerCase(); } switch (local_name) { case "a": case "area": case "link": if (target.hasAttribute("href")) linkNode = target; break; default: linkNode = findParentNode(event.originalTarget, "a"); // <a> cannot be nested. So if we find an anchor without an // href, there is no useful <a> around the target if (linkNode && !linkNode.hasAttribute("href")) linkNode = null; break; } if (linkNode) { if (event.button == 0 && !event.ctrlKey && !event.shiftKey && !event.altKey && !event.metaKey) { // A Web panel's links should target the main content area. Do this // if no modifier keys are down and if there's no target or the target equals // _main (the IE convention) or _content (the Mozilla convention). // The only reason we field _main and _content here is for the markLinkVisited // hack. target = linkNode.getAttribute("target"); if (fieldNormalClicks && (!target || target == "_content" || target == "_main")) // IE uses _main, SeaMonkey uses _content, we support both { if (!linkNode.href) return true; if (linkNode.getAttribute("onclick")) return true; var postData = { }; var url = getShortcutOrURI(linkNode.href, postData); if (!url) return true; markLinkVisited(linkNode.href, linkNode); loadURI(url, null, postData.value); event.preventDefault(); return false; } else if (linkNode.getAttribute("rel") == "sidebar") { // This is the Opera convention for a special link that - when clicked - allows // you to add a sidebar panel. We support the Opera convention here. The link's // title attribute contains the title that should be used for the sidebar panel. openDialog("chrome://browser/content/bookmarks/addBookmark2.xul", "", "centerscreen,chrome,dialog,resizable,dependent", linkNode.getAttribute("title"), linkNode.href, null, null, null, null, true); event.preventDefault(); return false; } else if (target == "_search") { // Used in WinIE as a way of transiently loading pages in a sidebar. We // mimic that WinIE functionality here and also load the page transiently. openWebPanel(gNavigatorBundle.getString("webPanels"), linkNode.href); event.preventDefault(); return false; } } else handleLinkClick(event, linkNode.href, linkNode); return true; } else { // Try simple XLink var href; linkNode = target; while (linkNode) { if (linkNode.nodeType == Node.ELEMENT_NODE) { href = linkNode.getAttributeNS("http://www.w3.org/1999/xlink", "href"); break; } linkNode = linkNode.parentNode; } if (href && href != "") { href = makeURLAbsolute(target.baseURI,href); handleLinkClick(event, href, null); return true; } } if (event.button == 1 && !findParentNode(event.originalTarget, "scrollbar") && gPrefService.getBoolPref("middlemouse.contentLoadURL")) { middleMousePaste(event); } return true; }
markLinkVisited(linkNode.href, linkNode);
markLinkVisited(wrapper.href, linkNode);
function contentAreaClick(event, fieldNormalClicks) { var target = event.target; var linkNode; var local_name = target.localName; if (local_name) { local_name = local_name.toLowerCase(); } switch (local_name) { case "a": case "area": case "link": if (target.hasAttribute("href")) linkNode = target; break; default: linkNode = findParentNode(event.originalTarget, "a"); // <a> cannot be nested. So if we find an anchor without an // href, there is no useful <a> around the target if (linkNode && !linkNode.hasAttribute("href")) linkNode = null; break; } if (linkNode) { if (event.button == 0 && !event.ctrlKey && !event.shiftKey && !event.altKey && !event.metaKey) { // A Web panel's links should target the main content area. Do this // if no modifier keys are down and if there's no target or the target equals // _main (the IE convention) or _content (the Mozilla convention). // The only reason we field _main and _content here is for the markLinkVisited // hack. target = linkNode.getAttribute("target"); if (fieldNormalClicks && (!target || target == "_content" || target == "_main")) // IE uses _main, SeaMonkey uses _content, we support both { if (!linkNode.href) return true; if (linkNode.getAttribute("onclick")) return true; var postData = { }; var url = getShortcutOrURI(linkNode.href, postData); if (!url) return true; markLinkVisited(linkNode.href, linkNode); loadURI(url, null, postData.value); event.preventDefault(); return false; } else if (linkNode.getAttribute("rel") == "sidebar") { // This is the Opera convention for a special link that - when clicked - allows // you to add a sidebar panel. We support the Opera convention here. The link's // title attribute contains the title that should be used for the sidebar panel. openDialog("chrome://browser/content/bookmarks/addBookmark2.xul", "", "centerscreen,chrome,dialog,resizable,dependent", linkNode.getAttribute("title"), linkNode.href, null, null, null, null, true); event.preventDefault(); return false; } else if (target == "_search") { // Used in WinIE as a way of transiently loading pages in a sidebar. We // mimic that WinIE functionality here and also load the page transiently. openWebPanel(gNavigatorBundle.getString("webPanels"), linkNode.href); event.preventDefault(); return false; } } else handleLinkClick(event, linkNode.href, linkNode); return true; } else { // Try simple XLink var href; linkNode = target; while (linkNode) { if (linkNode.nodeType == Node.ELEMENT_NODE) { href = linkNode.getAttributeNS("http://www.w3.org/1999/xlink", "href"); break; } linkNode = linkNode.parentNode; } if (href && href != "") { href = makeURLAbsolute(target.baseURI,href); handleLinkClick(event, href, null); return true; } } if (event.button == 1 && !findParentNode(event.originalTarget, "scrollbar") && gPrefService.getBoolPref("middlemouse.contentLoadURL")) { middleMousePaste(event); } return true; }
linkNode.getAttribute("title"), linkNode.href, null, null, null, null, true);
wrapper.getAttribute("title"), wrapper.href, null, null, null, null, true);
function contentAreaClick(event, fieldNormalClicks) { var target = event.target; var linkNode; var local_name = target.localName; if (local_name) { local_name = local_name.toLowerCase(); } switch (local_name) { case "a": case "area": case "link": if (target.hasAttribute("href")) linkNode = target; break; default: linkNode = findParentNode(event.originalTarget, "a"); // <a> cannot be nested. So if we find an anchor without an // href, there is no useful <a> around the target if (linkNode && !linkNode.hasAttribute("href")) linkNode = null; break; } if (linkNode) { if (event.button == 0 && !event.ctrlKey && !event.shiftKey && !event.altKey && !event.metaKey) { // A Web panel's links should target the main content area. Do this // if no modifier keys are down and if there's no target or the target equals // _main (the IE convention) or _content (the Mozilla convention). // The only reason we field _main and _content here is for the markLinkVisited // hack. target = linkNode.getAttribute("target"); if (fieldNormalClicks && (!target || target == "_content" || target == "_main")) // IE uses _main, SeaMonkey uses _content, we support both { if (!linkNode.href) return true; if (linkNode.getAttribute("onclick")) return true; var postData = { }; var url = getShortcutOrURI(linkNode.href, postData); if (!url) return true; markLinkVisited(linkNode.href, linkNode); loadURI(url, null, postData.value); event.preventDefault(); return false; } else if (linkNode.getAttribute("rel") == "sidebar") { // This is the Opera convention for a special link that - when clicked - allows // you to add a sidebar panel. We support the Opera convention here. The link's // title attribute contains the title that should be used for the sidebar panel. openDialog("chrome://browser/content/bookmarks/addBookmark2.xul", "", "centerscreen,chrome,dialog,resizable,dependent", linkNode.getAttribute("title"), linkNode.href, null, null, null, null, true); event.preventDefault(); return false; } else if (target == "_search") { // Used in WinIE as a way of transiently loading pages in a sidebar. We // mimic that WinIE functionality here and also load the page transiently. openWebPanel(gNavigatorBundle.getString("webPanels"), linkNode.href); event.preventDefault(); return false; } } else handleLinkClick(event, linkNode.href, linkNode); return true; } else { // Try simple XLink var href; linkNode = target; while (linkNode) { if (linkNode.nodeType == Node.ELEMENT_NODE) { href = linkNode.getAttributeNS("http://www.w3.org/1999/xlink", "href"); break; } linkNode = linkNode.parentNode; } if (href && href != "") { href = makeURLAbsolute(target.baseURI,href); handleLinkClick(event, href, null); return true; } } if (event.button == 1 && !findParentNode(event.originalTarget, "scrollbar") && gPrefService.getBoolPref("middlemouse.contentLoadURL")) { middleMousePaste(event); } return true; }
openWebPanel(gNavigatorBundle.getString("webPanels"), linkNode.href);
openWebPanel(gNavigatorBundle.getString("webPanels"), wrapper.href);
function contentAreaClick(event, fieldNormalClicks) { var target = event.target; var linkNode; var local_name = target.localName; if (local_name) { local_name = local_name.toLowerCase(); } switch (local_name) { case "a": case "area": case "link": if (target.hasAttribute("href")) linkNode = target; break; default: linkNode = findParentNode(event.originalTarget, "a"); // <a> cannot be nested. So if we find an anchor without an // href, there is no useful <a> around the target if (linkNode && !linkNode.hasAttribute("href")) linkNode = null; break; } if (linkNode) { if (event.button == 0 && !event.ctrlKey && !event.shiftKey && !event.altKey && !event.metaKey) { // A Web panel's links should target the main content area. Do this // if no modifier keys are down and if there's no target or the target equals // _main (the IE convention) or _content (the Mozilla convention). // The only reason we field _main and _content here is for the markLinkVisited // hack. target = linkNode.getAttribute("target"); if (fieldNormalClicks && (!target || target == "_content" || target == "_main")) // IE uses _main, SeaMonkey uses _content, we support both { if (!linkNode.href) return true; if (linkNode.getAttribute("onclick")) return true; var postData = { }; var url = getShortcutOrURI(linkNode.href, postData); if (!url) return true; markLinkVisited(linkNode.href, linkNode); loadURI(url, null, postData.value); event.preventDefault(); return false; } else if (linkNode.getAttribute("rel") == "sidebar") { // This is the Opera convention for a special link that - when clicked - allows // you to add a sidebar panel. We support the Opera convention here. The link's // title attribute contains the title that should be used for the sidebar panel. openDialog("chrome://browser/content/bookmarks/addBookmark2.xul", "", "centerscreen,chrome,dialog,resizable,dependent", linkNode.getAttribute("title"), linkNode.href, null, null, null, null, true); event.preventDefault(); return false; } else if (target == "_search") { // Used in WinIE as a way of transiently loading pages in a sidebar. We // mimic that WinIE functionality here and also load the page transiently. openWebPanel(gNavigatorBundle.getString("webPanels"), linkNode.href); event.preventDefault(); return false; } } else handleLinkClick(event, linkNode.href, linkNode); return true; } else { // Try simple XLink var href; linkNode = target; while (linkNode) { if (linkNode.nodeType == Node.ELEMENT_NODE) { href = linkNode.getAttributeNS("http://www.w3.org/1999/xlink", "href"); break; } linkNode = linkNode.parentNode; } if (href && href != "") { href = makeURLAbsolute(target.baseURI,href); handleLinkClick(event, href, null); return true; } } if (event.button == 1 && !findParentNode(event.originalTarget, "scrollbar") && gPrefService.getBoolPref("middlemouse.contentLoadURL")) { middleMousePaste(event); } return true; }
else handleLinkClick(event, linkNode.href, linkNode);
else { handleLinkClick(event, wrapper.href, linkNode); }
function contentAreaClick(event, fieldNormalClicks) { var target = event.target; var linkNode; var local_name = target.localName; if (local_name) { local_name = local_name.toLowerCase(); } switch (local_name) { case "a": case "area": case "link": if (target.hasAttribute("href")) linkNode = target; break; default: linkNode = findParentNode(event.originalTarget, "a"); // <a> cannot be nested. So if we find an anchor without an // href, there is no useful <a> around the target if (linkNode && !linkNode.hasAttribute("href")) linkNode = null; break; } if (linkNode) { if (event.button == 0 && !event.ctrlKey && !event.shiftKey && !event.altKey && !event.metaKey) { // A Web panel's links should target the main content area. Do this // if no modifier keys are down and if there's no target or the target equals // _main (the IE convention) or _content (the Mozilla convention). // The only reason we field _main and _content here is for the markLinkVisited // hack. target = linkNode.getAttribute("target"); if (fieldNormalClicks && (!target || target == "_content" || target == "_main")) // IE uses _main, SeaMonkey uses _content, we support both { if (!linkNode.href) return true; if (linkNode.getAttribute("onclick")) return true; var postData = { }; var url = getShortcutOrURI(linkNode.href, postData); if (!url) return true; markLinkVisited(linkNode.href, linkNode); loadURI(url, null, postData.value); event.preventDefault(); return false; } else if (linkNode.getAttribute("rel") == "sidebar") { // This is the Opera convention for a special link that - when clicked - allows // you to add a sidebar panel. We support the Opera convention here. The link's // title attribute contains the title that should be used for the sidebar panel. openDialog("chrome://browser/content/bookmarks/addBookmark2.xul", "", "centerscreen,chrome,dialog,resizable,dependent", linkNode.getAttribute("title"), linkNode.href, null, null, null, null, true); event.preventDefault(); return false; } else if (target == "_search") { // Used in WinIE as a way of transiently loading pages in a sidebar. We // mimic that WinIE functionality here and also load the page transiently. openWebPanel(gNavigatorBundle.getString("webPanels"), linkNode.href); event.preventDefault(); return false; } } else handleLinkClick(event, linkNode.href, linkNode); return true; } else { // Try simple XLink var href; linkNode = target; while (linkNode) { if (linkNode.nodeType == Node.ELEMENT_NODE) { href = linkNode.getAttributeNS("http://www.w3.org/1999/xlink", "href"); break; } linkNode = linkNode.parentNode; } if (href && href != "") { href = makeURLAbsolute(target.baseURI,href); handleLinkClick(event, href, null); return true; } } if (event.button == 1 && !findParentNode(event.originalTarget, "scrollbar") && gPrefService.getBoolPref("middlemouse.contentLoadURL")) { middleMousePaste(event); } return true; }
href = linkNode.getAttributeNS("http:
var wrapper = new XPCNativeWrapper(linkNode, "getAttributeNS()"); href = wrapper.getAttributeNS("http:
function contentAreaClick(event, fieldNormalClicks) { var target = event.target; var linkNode; var local_name = target.localName; if (local_name) { local_name = local_name.toLowerCase(); } switch (local_name) { case "a": case "area": case "link": if (target.hasAttribute("href")) linkNode = target; break; default: linkNode = findParentNode(event.originalTarget, "a"); // <a> cannot be nested. So if we find an anchor without an // href, there is no useful <a> around the target if (linkNode && !linkNode.hasAttribute("href")) linkNode = null; break; } if (linkNode) { if (event.button == 0 && !event.ctrlKey && !event.shiftKey && !event.altKey && !event.metaKey) { // A Web panel's links should target the main content area. Do this // if no modifier keys are down and if there's no target or the target equals // _main (the IE convention) or _content (the Mozilla convention). // The only reason we field _main and _content here is for the markLinkVisited // hack. target = linkNode.getAttribute("target"); if (fieldNormalClicks && (!target || target == "_content" || target == "_main")) // IE uses _main, SeaMonkey uses _content, we support both { if (!linkNode.href) return true; if (linkNode.getAttribute("onclick")) return true; var postData = { }; var url = getShortcutOrURI(linkNode.href, postData); if (!url) return true; markLinkVisited(linkNode.href, linkNode); loadURI(url, null, postData.value); event.preventDefault(); return false; } else if (linkNode.getAttribute("rel") == "sidebar") { // This is the Opera convention for a special link that - when clicked - allows // you to add a sidebar panel. We support the Opera convention here. The link's // title attribute contains the title that should be used for the sidebar panel. openDialog("chrome://browser/content/bookmarks/addBookmark2.xul", "", "centerscreen,chrome,dialog,resizable,dependent", linkNode.getAttribute("title"), linkNode.href, null, null, null, null, true); event.preventDefault(); return false; } else if (target == "_search") { // Used in WinIE as a way of transiently loading pages in a sidebar. We // mimic that WinIE functionality here and also load the page transiently. openWebPanel(gNavigatorBundle.getString("webPanels"), linkNode.href); event.preventDefault(); return false; } } else handleLinkClick(event, linkNode.href, linkNode); return true; } else { // Try simple XLink var href; linkNode = target; while (linkNode) { if (linkNode.nodeType == Node.ELEMENT_NODE) { href = linkNode.getAttributeNS("http://www.w3.org/1999/xlink", "href"); break; } linkNode = linkNode.parentNode; } if (href && href != "") { href = makeURLAbsolute(target.baseURI,href); handleLinkClick(event, href, null); return true; } } if (event.button == 1 && !findParentNode(event.originalTarget, "scrollbar") && gPrefService.getBoolPref("middlemouse.contentLoadURL")) { middleMousePaste(event); } return true; }
href = makeURLAbsolute(target.baseURI,href);
var baseURI = new XPCNativeWrapper(linkNode, "baseURI").baseURI; href = makeURLAbsolute(baseURI, href);
function contentAreaClick(event, fieldNormalClicks) { var target = event.target; var linkNode; var local_name = target.localName; if (local_name) { local_name = local_name.toLowerCase(); } switch (local_name) { case "a": case "area": case "link": if (target.hasAttribute("href")) linkNode = target; break; default: linkNode = findParentNode(event.originalTarget, "a"); // <a> cannot be nested. So if we find an anchor without an // href, there is no useful <a> around the target if (linkNode && !linkNode.hasAttribute("href")) linkNode = null; break; } if (linkNode) { if (event.button == 0 && !event.ctrlKey && !event.shiftKey && !event.altKey && !event.metaKey) { // A Web panel's links should target the main content area. Do this // if no modifier keys are down and if there's no target or the target equals // _main (the IE convention) or _content (the Mozilla convention). // The only reason we field _main and _content here is for the markLinkVisited // hack. target = linkNode.getAttribute("target"); if (fieldNormalClicks && (!target || target == "_content" || target == "_main")) // IE uses _main, SeaMonkey uses _content, we support both { if (!linkNode.href) return true; if (linkNode.getAttribute("onclick")) return true; var postData = { }; var url = getShortcutOrURI(linkNode.href, postData); if (!url) return true; markLinkVisited(linkNode.href, linkNode); loadURI(url, null, postData.value); event.preventDefault(); return false; } else if (linkNode.getAttribute("rel") == "sidebar") { // This is the Opera convention for a special link that - when clicked - allows // you to add a sidebar panel. We support the Opera convention here. The link's // title attribute contains the title that should be used for the sidebar panel. openDialog("chrome://browser/content/bookmarks/addBookmark2.xul", "", "centerscreen,chrome,dialog,resizable,dependent", linkNode.getAttribute("title"), linkNode.href, null, null, null, null, true); event.preventDefault(); return false; } else if (target == "_search") { // Used in WinIE as a way of transiently loading pages in a sidebar. We // mimic that WinIE functionality here and also load the page transiently. openWebPanel(gNavigatorBundle.getString("webPanels"), linkNode.href); event.preventDefault(); return false; } } else handleLinkClick(event, linkNode.href, linkNode); return true; } else { // Try simple XLink var href; linkNode = target; while (linkNode) { if (linkNode.nodeType == Node.ELEMENT_NODE) { href = linkNode.getAttributeNS("http://www.w3.org/1999/xlink", "href"); break; } linkNode = linkNode.parentNode; } if (href && href != "") { href = makeURLAbsolute(target.baseURI,href); handleLinkClick(event, href, null); return true; } } if (event.button == 1 && !findParentNode(event.originalTarget, "scrollbar") && gPrefService.getBoolPref("middlemouse.contentLoadURL")) { middleMousePaste(event); } return true; }
"centerscreen,chrome,dialog,resizable,dependent", wrapper.getAttribute("title"), wrapper.href, null, null, null, null, true);
"centerscreen,chrome,dialog,resizable,dependent", dialogArgs);
function contentAreaClick(event, fieldNormalClicks) { if (!event.isTrusted) { return true; } var target = event.target; var linkNode; var local_name = target.localName; if (local_name) { local_name = local_name.toLowerCase(); } switch (local_name) { case "a": case "area": case "link": if (target.hasAttribute("href")) linkNode = target; break; default: linkNode = findParentNode(event.originalTarget, "a"); // <a> cannot be nested. So if we find an anchor without an // href, there is no useful <a> around the target if (linkNode && !linkNode.hasAttribute("href")) linkNode = null; break; } if (linkNode) { var wrapper = new XPCNativeWrapper(linkNode, "href", "getAttribute()"); if (event.button == 0 && !event.ctrlKey && !event.shiftKey && !event.altKey && !event.metaKey) { // A Web panel's links should target the main content area. Do this // if no modifier keys are down and if there's no target or the target equals // _main (the IE convention) or _content (the Mozilla convention). // The only reason we field _main and _content here is for the markLinkVisited // hack. target = linkNode.getAttribute("target"); if (fieldNormalClicks && (!target || target == "_content" || target == "_main")) // IE uses _main, SeaMonkey uses _content, we support both { if (!wrapper.href) return true; if (linkNode.getAttribute("onclick")) return true; var postData = { }; var url = getShortcutOrURI(wrapper.href, postData); if (!url) return true; markLinkVisited(wrapper.href, linkNode); loadURI(url, null, postData.value); event.preventDefault(); return false; } else if (linkNode.getAttribute("rel") == "sidebar") { // This is the Opera convention for a special link that - when clicked - allows // you to add a sidebar panel. We support the Opera convention here. The link's // title attribute contains the title that should be used for the sidebar panel. openDialog("chrome://browser/content/bookmarks/addBookmark2.xul", "", "centerscreen,chrome,dialog,resizable,dependent", wrapper.getAttribute("title"), wrapper.href, null, null, null, null, true); event.preventDefault(); return false; } else if (target == "_search") { // Used in WinIE as a way of transiently loading pages in a sidebar. We // mimic that WinIE functionality here and also load the page transiently. openWebPanel(gNavigatorBundle.getString("webPanels"), wrapper.href); event.preventDefault(); return false; } } else { handleLinkClick(event, wrapper.href, linkNode); } return true; } else { // Try simple XLink var href; linkNode = target; while (linkNode) { if (linkNode.nodeType == Node.ELEMENT_NODE) { var wrapper = new XPCNativeWrapper(linkNode, "getAttributeNS()"); href = wrapper.getAttributeNS("http://www.w3.org/1999/xlink", "href"); break; } linkNode = linkNode.parentNode; } if (href) { var baseURI = new XPCNativeWrapper(linkNode, "baseURI").baseURI; href = makeURLAbsolute(baseURI, href); handleLinkClick(event, href, null); return true; } } if (event.button == 1 && !findParentNode(event.originalTarget, "scrollbar") && gPrefService.getBoolPref("middlemouse.contentLoadURL")) { middleMousePaste(event); } return true; }
switch (target.localName.toLowerCase()) {
var local_name = target.localName; if (local_name) { local_name.toLowerCase(); } switch (local_name) {
function contentAreaClick(event) { var target = event.target; var linkNode; switch (target.localName.toLowerCase()) { case "a": linkNode = target; break; case "area": if (target.href) linkNode = target; break; case "input": if ((event.target.type.toLowerCase() == "text" || event.target.type == "") // text field && event.detail == 2 // double click && event.button == 0 // left mouse button && event.target.value.length == 0) { // no text has been entered prefillTextBox(target); // prefill the empty text field if possible } break; default: linkNode = findParentNode(event.originalTarget, "a"); break; } if (linkNode) { handleLinkClick(event, linkNode.href); return true; } if (pref && event.button == 1 && !findParentNode(event.originalTarget, "scrollbar") && pref.getBoolPref("middlemouse.contentLoadURL")) { if (middleMousePaste()) { event.preventBubble(); } } return true; }
"centerscreen,chrome,dialog=yes,resizable=no,dependent",
"centerscreen,chrome,dialog,resizable,dependent",
function contentAreaClick(event, fieldNormalClicks) { var target = event.target; var linkNode; var local_name = target.localName; if (local_name) { local_name = local_name.toLowerCase(); } switch (local_name) { case "a": case "area": case "link": if (target.hasAttribute("href")) linkNode = target; break; default: linkNode = findParentNode(event.originalTarget, "a"); // <a> cannot be nested. So if we find an anchor without an // href, there is no useful <a> around the target if (linkNode && !linkNode.hasAttribute("href")) linkNode = null; break; } if (linkNode) { if (event.button == 0 && !event.ctrlKey && !event.shiftKey && !event.altKey && !event.metaKey) { // A Web panel's links should target the main content area. Do this // if no modifier keys are down and if there's no target or the target equals // _main (the IE convention) or _content (the Mozilla convention). // The only reason we field _main and _content here is for the markLinkVisited // hack. target = linkNode.getAttribute("target"); if (fieldNormalClicks && (!target || target == "_content" || target == "_main")) // IE uses _main, SeaMonkey uses _content, we support both { if (!linkNode.href) return true; if (linkNode.getAttribute("onclick")) return true; var url = getShortcutOrURI(linkNode.href); if (!url) return true; markLinkVisited(linkNode.href, linkNode); loadURI(url); event.preventDefault(); return false; } else if (linkNode.getAttribute("rel") == "sidebar") { // This is the Opera convention for a special link that - when clicked - allows // you to add a sidebar panel. We support the Opera convention here. The link's // title attribute contains the title that should be used for the sidebar panel. openDialog("chrome://browser/content/bookmarks/addBookmark2.xul", "", "centerscreen,chrome,dialog=yes,resizable=no,dependent", linkNode.getAttribute("title"), linkNode.href, null, null, null, null, true); event.preventDefault(); return false; } else if (target == "_search") { // Used in WinIE as a way of transiently loading pages in a sidebar. We // mimic that WinIE functionality here and also load the page transiently. openWebPanel(gNavigatorBundle.getString("webPanels"), linkNode.href); event.preventDefault(); return false; } } else handleLinkClick(event, linkNode.href, linkNode); return true; } else { // Try simple XLink var href; linkNode = target; while (linkNode) { if (linkNode.nodeType == Node.ELEMENT_NODE) { href = linkNode.getAttributeNS("http://www.w3.org/1999/xlink", "href"); break; } linkNode = linkNode.parentNode; } if (href && href != "") { href = makeURLAbsolute(target.baseURI,href); handleLinkClick(event, href, null); return true; } } if (event.button == 1 && !findParentNode(event.originalTarget, "scrollbar") && gPrefService.getBoolPref("middlemouse.contentLoadURL")) { if (middleMousePaste(event)) { event.preventBubble(); } } return true; }
if (middleMousePaste(event)) { event.preventBubble(); }
middleMousePaste(event);
function contentAreaClick(event, fieldNormalClicks) { var target = event.target; var linkNode; var local_name = target.localName; if (local_name) { local_name = local_name.toLowerCase(); } switch (local_name) { case "a": case "area": case "link": if (target.hasAttribute("href")) linkNode = target; break; default: linkNode = findParentNode(event.originalTarget, "a"); // <a> cannot be nested. So if we find an anchor without an // href, there is no useful <a> around the target if (linkNode && !linkNode.hasAttribute("href")) linkNode = null; break; } if (linkNode) { if (event.button == 0 && !event.ctrlKey && !event.shiftKey && !event.altKey && !event.metaKey) { // A Web panel's links should target the main content area. Do this // if no modifier keys are down and if there's no target or the target equals // _main (the IE convention) or _content (the Mozilla convention). // The only reason we field _main and _content here is for the markLinkVisited // hack. target = linkNode.getAttribute("target"); if (fieldNormalClicks && (!target || target == "_content" || target == "_main")) // IE uses _main, SeaMonkey uses _content, we support both { if (!linkNode.href) return true; if (linkNode.getAttribute("onclick")) return true; var postData = { }; var url = getShortcutOrURI(linkNode.href, postData); if (!url) return true; markLinkVisited(linkNode.href, linkNode); loadURI(url, null, postData.value); event.preventDefault(); return false; } else if (linkNode.getAttribute("rel") == "sidebar") { // This is the Opera convention for a special link that - when clicked - allows // you to add a sidebar panel. We support the Opera convention here. The link's // title attribute contains the title that should be used for the sidebar panel. openDialog("chrome://browser/content/bookmarks/addBookmark2.xul", "", "centerscreen,chrome,dialog,resizable,dependent", linkNode.getAttribute("title"), linkNode.href, null, null, null, null, true); event.preventDefault(); return false; } else if (target == "_search") { // Used in WinIE as a way of transiently loading pages in a sidebar. We // mimic that WinIE functionality here and also load the page transiently. openWebPanel(gNavigatorBundle.getString("webPanels"), linkNode.href); event.preventDefault(); return false; } } else handleLinkClick(event, linkNode.href, linkNode); return true; } else { // Try simple XLink var href; linkNode = target; while (linkNode) { if (linkNode.nodeType == Node.ELEMENT_NODE) { href = linkNode.getAttributeNS("http://www.w3.org/1999/xlink", "href"); break; } linkNode = linkNode.parentNode; } if (href && href != "") { href = makeURLAbsolute(target.baseURI,href); handleLinkClick(event, href, null); return true; } } if (event.button == 1 && !findParentNode(event.originalTarget, "scrollbar") && gPrefService.getBoolPref("middlemouse.contentLoadURL")) { if (middleMousePaste(event)) { event.preventBubble(); } } return true; }
var linkNode = linkNodeForClickEvent(event); if (linkNode && linkNode.href)
var href = hRefForClickEvent(event); if (href)
function contentAreaClick(event) { var linkNode = linkNodeForClickEvent(event); if (linkNode && linkNode.href) { handleLinkClick(event, linkNode.href, null); // block the link click if we determine that this URL // is phishy (i.e. a potential email scam) if (!event.button) // left click only return !isPhishingURL(linkNode, false); } return true; }
handleLinkClick(event, linkNode.href, null);
handleLinkClick(event, href, null);
function contentAreaClick(event) { var linkNode = linkNodeForClickEvent(event); if (linkNode && linkNode.href) { handleLinkClick(event, linkNode.href, null); // block the link click if we determine that this URL // is phishy (i.e. a potential email scam) if (!event.button) // left click only return !isPhishingURL(linkNode, false); } return true; }
return !isPhishingURL(linkNode, false);
return gPhishingDetector.warnOnSuspiciousLinkClick(href);
function contentAreaClick(event) { var linkNode = linkNodeForClickEvent(event); if (linkNode && linkNode.href) { handleLinkClick(event, linkNode.href, null); // block the link click if we determine that this URL // is phishy (i.e. a potential email scam) if (!event.button) // left click only return !isPhishingURL(linkNode, false); } return true; }
local_name.toLowerCase();
local_name = local_name.toLowerCase();
function contentAreaClick(event) { var target = event.target; var linkNode; var local_name = target.localName; if (local_name) { local_name.toLowerCase(); } switch (local_name) { case "a": linkNode = target; break; case "area": if (target.href) linkNode = target; break; case "input": if ((event.target.type.toLowerCase() == "text" || event.target.type == "") // text field && event.detail == 2 // double click && event.button == 0 // left mouse button && event.target.value.length == 0) { // no text has been entered prefillTextBox(target); // prefill the empty text field if possible } break; default: linkNode = findParentNode(event.originalTarget, "a"); break; } if (linkNode) { handleLinkClick(event, linkNode.href); return true; } if (pref && event.button == 1 && !findParentNode(event.originalTarget, "scrollbar") && pref.getBoolPref("middlemouse.contentLoadURL")) { if (middleMousePaste()) { event.preventBubble(); } } return true; }
var saveFrameItem = document.getElementById("savepage"); var focusedWindow = document.commandDispatcher.focusedWindow; if (isDocumentFrame(focusedWindow)) {
if (isDocumentFrame(document.commandDispatcher.focusedWindow)) {
function contentAreaFrameFocus(){ var saveFrameItem = document.getElementById("savepage"); var focusedWindow = document.commandDispatcher.focusedWindow; if (isDocumentFrame(focusedWindow)) { gFocusedURL = focusedWindow.location.href; saveFrameItem.removeAttribute("hidden"); }}
var saveFrameItem = document.getElementById("savepage");
function contentAreaFrameFocus(){ var saveFrameItem = document.getElementById("savepage"); var focusedWindow = document.commandDispatcher.focusedWindow; if (isDocumentFrame(focusedWindow)) { gFocusedURL = focusedWindow.location.href; saveFrameItem.removeAttribute("hidden"); }}
gFocusedDocument = focusedWindow.document;
function contentAreaFrameFocus(){ var focusedWindow = document.commandDispatcher.focusedWindow; if (isDocumentFrame(focusedWindow)) { gFocusedURL = focusedWindow.location.href; }}
helpExternal.webNavigation.loadURI(target.href, loadFlags, null, null, null);
helpExternal.webNavigation.loadURI(uri, loadFlags, null, null, null);
function contentClick(event) { // is this a left click on a link? if (event.shiftKey || event.ctrlKey || event.altKey || event.metaKey || event.button != 0) return true; // is this a link? var target = event.target; while (!(target instanceof HTMLAnchorElement)) if (!(target = target.parentNode)) return true; // is this an internal link? if (target.href.lastIndexOf("chrome:", 0) == 0) return true; const loadFlags = Components.interfaces.nsIWebNavigation.LOAD_FLAGS_IS_LINK; try { helpExternal.webNavigation.loadURI(target.href, loadFlags, null, null, null); } catch (e) {} return false;}
newItem.status = "NONE";
newItem.isCompleted = false;
function contextChangeProgress( event, Progress ){ var tree = document.getElementById( ToDoUnifinderTreeName ); var start = new Object(); var end = new Object(); var numRanges = tree.view.selection.getRangeCount(); var toDoItem; if(numRanges == 0) return; startBatchTransaction(); for (var t = 0; t < numRanges; t++) { tree.view.selection.getRangeAt(t, start, end); for (var v = start.value; v <= end.value; v++) { toDoItem = tree.taskView.getCalendarTaskAtRow( v ); var newItem = toDoItem.clone().QueryInterface( Components.interfaces.calITodo ); newItem.percentComplete = Progress; switch (Progress) { case 0: newItem.status = "NONE"; break; case 100: newItem.status = "COMPLETED"; break; default: newItem.status = "IN-PROCESS"; break; } doTransaction('modify', newItem, newItem.calendar, toDoItem, null); } } endBatchTransaction();}
newItem.status = "COMPLETED";
newItem.isCompleted = true;
function contextChangeProgress( event, Progress ){ var tree = document.getElementById( ToDoUnifinderTreeName ); var start = new Object(); var end = new Object(); var numRanges = tree.view.selection.getRangeCount(); var toDoItem; if(numRanges == 0) return; startBatchTransaction(); for (var t = 0; t < numRanges; t++) { tree.view.selection.getRangeAt(t, start, end); for (var v = start.value; v <= end.value; v++) { toDoItem = tree.taskView.getCalendarTaskAtRow( v ); var newItem = toDoItem.clone().QueryInterface( Components.interfaces.calITodo ); newItem.percentComplete = Progress; switch (Progress) { case 0: newItem.status = "NONE"; break; case 100: newItem.status = "COMPLETED"; break; default: newItem.status = "IN-PROCESS"; break; } doTransaction('modify', newItem, newItem.calendar, toDoItem, null); } } endBatchTransaction();}
newItem.completedDate = null;
function contextChangeProgress( event, Progress ){ var tree = document.getElementById( ToDoUnifinderTreeName ); var start = new Object(); var end = new Object(); var numRanges = tree.view.selection.getRangeCount(); var toDoItem; if(numRanges == 0) return; startBatchTransaction(); for (var t = 0; t < numRanges; t++) { tree.view.selection.getRangeAt(t, start, end); for (var v = start.value; v <= end.value; v++) { toDoItem = tree.taskView.getCalendarTaskAtRow( v ); var newItem = toDoItem.clone().QueryInterface( Components.interfaces.calITodo ); newItem.percentComplete = Progress; switch (Progress) { case 0: newItem.status = "NONE"; break; case 100: newItem.status = "COMPLETED"; break; default: newItem.status = "IN-PROCESS"; break; } doTransaction('modify', newItem, newItem.calendar, toDoItem, null); } } endBatchTransaction();}
case "senderCol": sortKey = nsMsgViewSortType.byAuthor;
case "senderOrRecipientCol": if (IsSpecialFolderSelected(MSG_FOLDER_FLAG_SENTMAIL | MSG_FOLDER_FLAG_DRAFTS | MSG_FOLDER_FLAG_QUEUE)) { sortKey = nsMsgViewSortType.byRecipient; } else { sortKey = nsMsgViewSortType.byAuthor; }
function ConvertColumnIDToSortType(columnID){ var sortKey; switch (columnID) { case "dateCol": sortKey = nsMsgViewSortType.byDate; break; case "senderCol": sortKey = nsMsgViewSortType.byAuthor; break; case "subjectCol": sortKey = nsMsgViewSortType.bySubject; break; case "unreadButtonColHeader": sortKey = nsMsgViewSortType.byUnread; break; case "statusCol": sortKey = nsMsgViewSortType.byStatus; break; case "sizeCol": sortKey = nsMsgViewSortType.bySize; break; case "priorityCol": sortKey = nsMsgViewSortType.byPriority; break; case "flaggedCol": sortKey = nsMsgViewSortType.byFlagged; break; case "threadCol": sortKey = nsMsgViewSortType.byThread; break; default: dump("unsupported sort column: " + columnID + "\n"); sortKey = 0; break; } return sortKey;}
case "scoreCol": sortKey = nsMsgViewSortType.byScore;
case "junkStatusCol": sortKey = nsMsgViewSortType.byJunkStatus;
function ConvertColumnIDToSortType(columnID){ var sortKey; switch (columnID) { case "dateCol": sortKey = nsMsgViewSortType.byDate; break; case "senderCol": sortKey = nsMsgViewSortType.byAuthor; break; case "recipientCol": sortKey = nsMsgViewSortType.byRecipient; break; case "subjectCol": sortKey = nsMsgViewSortType.bySubject; break; case "locationCol": sortKey = nsMsgViewSortType.byLocation; break; case "unreadButtonColHeader": sortKey = nsMsgViewSortType.byUnread; break; case "statusCol": sortKey = nsMsgViewSortType.byStatus; break; case "sizeCol": sortKey = nsMsgViewSortType.bySize; break; case "priorityCol": sortKey = nsMsgViewSortType.byPriority; break; case "flaggedCol": sortKey = nsMsgViewSortType.byFlagged; break; case "threadCol": sortKey = nsMsgViewSortType.byThread; break; case "labelCol": sortKey = nsMsgViewSortType.byLabel; break; case "scoreCol": sortKey = nsMsgViewSortType.byScore; break; case "idCol": sortKey = nsMsgViewSortType.byId; break; default: dump("unsupported sort column: " + columnID + "\n"); sortKey = 0; break; } return sortKey;}
case "scoreCol": sortKey = nsMsgViewSortType.byScore; break;
function ConvertColumnIDToSortType(columnID){ var sortKey; switch (columnID) { case "dateCol": sortKey = nsMsgViewSortType.byDate; break; case "senderOrRecipientCol": if (IsSpecialFolderSelected(MSG_FOLDER_FLAG_SENTMAIL | MSG_FOLDER_FLAG_DRAFTS | MSG_FOLDER_FLAG_QUEUE)) { sortKey = nsMsgViewSortType.byRecipient; } else { sortKey = nsMsgViewSortType.byAuthor; } break; case "subjectCol": sortKey = nsMsgViewSortType.bySubject; break; case "locationCol": sortKey = nsMsgViewSortType.byLocation; break; case "unreadButtonColHeader": sortKey = nsMsgViewSortType.byUnread; break; case "statusCol": sortKey = nsMsgViewSortType.byStatus; break; case "sizeCol": sortKey = nsMsgViewSortType.bySize; break; case "priorityCol": sortKey = nsMsgViewSortType.byPriority; break; case "flaggedCol": sortKey = nsMsgViewSortType.byFlagged; break; case "threadCol": sortKey = nsMsgViewSortType.byThread; break; case "labelCol": sortKey = nsMsgViewSortType.byLabel; break; default: dump("unsupported sort column: " + columnID + "\n"); sortKey = 0; break; } return sortKey;}
var year, month, date;
function convertDateToString(time){ var year, month, date; initializeSearchDateFormat(); year = 1900 + time.getYear(); month = time.getMonth() + 1; // since js month is 0-11 date = time.getDate(); var dateStr; var sep = gSearchDateSeparator; switch (gSearchDateFormat) { case 1: dateStr = year + sep + month + sep + date; break; case 2: dateStr = year + sep + date + sep + month; break; case 3: dateStr = month + sep + date + sep + year; break; case 4: dateStr = month + sep + year + sep + date; break; case 5: dateStr = date + sep + month + sep + year; break; case 6: dateStr = date + sep + year + sep + month; break; default: dump("valid search date format option is 1-6\n"); } return dateStr;}
year = 1900 + time.getYear(); month = time.getMonth() + 1; date = time.getDate();
var year = time.getFullYear(); var month = time.getMonth() + 1; if ( gSearchDateLeadingZeros && month < 10 ) month = "0" + month; var date = time.getDate(); if ( gSearchDateLeadingZeros && date < 10 ) date = "0" + date;
function convertDateToString(time){ var year, month, date; initializeSearchDateFormat(); year = 1900 + time.getYear(); month = time.getMonth() + 1; // since js month is 0-11 date = time.getDate(); var dateStr; var sep = gSearchDateSeparator; switch (gSearchDateFormat) { case 1: dateStr = year + sep + month + sep + date; break; case 2: dateStr = year + sep + date + sep + month; break; case 3: dateStr = month + sep + date + sep + year; break; case 4: dateStr = month + sep + year + sep + date; break; case 5: dateStr = date + sep + month + sep + year; break; case 6: dateStr = date + sep + year + sep + month; break; default: dump("valid search date format option is 1-6\n"); } return dateStr;}
return aVal * 254;
return aVal * 25.4;
function convertMarginInchesToUnits(aVal, aIsMetric){ if (aIsMetric) { return aVal * 254; } else { return aVal; }}
columnID = "senderCol";
case nsMsgViewSortType.byRecipient: columnID = "senderOrRecipientCol";
function ConvertSortTypeToColumnID(sortKey){ var columnID; // hack to turn this into an integer, if it was a string // it would be a string if it came from localStore.rdf sortKey = sortKey - 0; switch (sortKey) { case nsMsgViewSortType.byDate: columnID = "dateCol"; break; case nsMsgViewSortType.byAuthor: columnID = "senderCol"; break; case nsMsgViewSortType.bySubject: columnID = "subjectCol"; break; case nsMsgViewSortType.byUnread: columnID = "unreadButtonColHeader"; break; case nsMsgViewSortType.byStatus: columnID = "statusCol"; break; case nsMsgViewSortType.bySize: columnID = "sizeCol"; break; case nsMsgViewSortType.byPriority: columnID = "priorityCol"; break; case nsMsgViewSortType.byFlagged: columnID = "flaggedCol"; break; case nsMsgViewSortType.byThread: columnID = "threadCol"; break; case nsMsgViewSortType.byId: // there is no orderReceivedCol, so return null columnID = null; break; default: dump("unsupported sort key: " + sortKey + "\n"); columnID = null; break; } return columnID;}
case nsMsgViewSortType.byScore: columnID = "scoreCol";
case nsMsgViewSortType.byJunkStatus: columnID = "junkStatusCol";
function ConvertSortTypeToColumnID(sortKey){ var columnID; // hack to turn this into an integer, if it was a string // it would be a string if it came from localStore.rdf sortKey = sortKey - 0; switch (sortKey) { case nsMsgViewSortType.byDate: columnID = "dateCol"; break; case nsMsgViewSortType.byAuthor: columnID = "senderCol"; break; case nsMsgViewSortType.byRecipient: columnID = "recipientCol"; break; case nsMsgViewSortType.bySubject: columnID = "subjectCol"; break; case nsMsgViewSortType.byLocation: columnID = "locationCol"; break; case nsMsgViewSortType.byUnread: columnID = "unreadButtonColHeader"; break; case nsMsgViewSortType.byStatus: columnID = "statusCol"; break; case nsMsgViewSortType.byLabel: columnID = "labelCol"; break; case nsMsgViewSortType.bySize: columnID = "sizeCol"; break; case nsMsgViewSortType.byPriority: columnID = "priorityCol"; break; case nsMsgViewSortType.byFlagged: columnID = "flaggedCol"; break; case nsMsgViewSortType.byThread: columnID = "threadCol"; break; case nsMsgViewSortType.byId: // there is no orderReceivedCol, so return null columnID = null; break; case nsMsgViewSortType.byScore: columnID = "scoreCol"; break; default: dump("unsupported sort key: " + sortKey + "\n"); columnID = null; break; } return columnID;}
case nsMsgViewSortType.byScore: columnID = "scoreCol"; break;
function ConvertSortTypeToColumnID(sortKey){ var columnID; // hack to turn this into an integer, if it was a string // it would be a string if it came from localStore.rdf sortKey = sortKey - 0; switch (sortKey) { case nsMsgViewSortType.byDate: columnID = "dateCol"; break; case nsMsgViewSortType.byAuthor: case nsMsgViewSortType.byRecipient: columnID = "senderOrRecipientCol"; break; case nsMsgViewSortType.bySubject: columnID = "subjectCol"; break; case nsMsgViewSortType.byLocation: columnID = "locationCol"; break; case nsMsgViewSortType.byUnread: columnID = "unreadButtonColHeader"; break; case nsMsgViewSortType.byStatus: columnID = "statusCol"; break; case nsMsgViewSortType.byLabel: columnID = "labelCol"; break; case nsMsgViewSortType.bySize: columnID = "sizeCol"; break; case nsMsgViewSortType.byPriority: columnID = "priorityCol"; break; case nsMsgViewSortType.byFlagged: columnID = "flaggedCol"; break; case nsMsgViewSortType.byThread: columnID = "threadCol"; break; case nsMsgViewSortType.byId: // there is no orderReceivedCol, so return null columnID = null; break; default: dump("unsupported sort key: " + sortKey + "\n"); columnID = null; break; } return columnID;}
itipItem.initialize(data);
itipItem.init(data);
convertToHTML: function(contentType, data) { var event = Cc["@mozilla.org/calendar/event;1"] .createInstance(Ci.calIEvent); event.icalString = data; var html = createHtml(event); try { // Bug 351610: This mechanism is a little flawed var itipItem = Cc["@mozilla.org/calendar/itip-item;1"] .createInstance(Ci.calIItipItem); itipItem.initialize(data); var observer = Cc["@mozilla.org/observer-service;1"] .getService(Ci.nsIObserverService); if (observer) { observer.notifyObservers(itipItem, "onITipItemCreation", 0); } } catch (e) { Components.utils.reportError("Cannot Create iTIP Item: " + e); } return html; }
observer.notifyObservers(itipItem, "onITipItemCreation", 0);
observer.notifyObservers(itipItem, "onItipItemCreation", 0);
convertToHTML: function(contentType, data) { var event = Cc["@mozilla.org/calendar/event;1"] .createInstance(Ci.calIEvent); event.icalString = data; var html = createHtml(event); try { // Bug 351610: This mechanism is a little flawed var itipItem = Cc["@mozilla.org/calendar/itip-item;1"] .createInstance(Ci.calIItipItem); itipItem.initialize(data); var observer = Cc["@mozilla.org/observer-service;1"] .getService(Ci.nsIObserverService); if (observer) { observer.notifyObservers(itipItem, "onITipItemCreation", 0); } } catch (e) { Components.utils.reportError("Cannot Create iTIP Item: " + e); } return html; }
return aVal / 254;
return aVal / 25.4;
function convertUnitsMarginToInches(aVal, aIsMetric){ if (aIsMetric) { return aVal / 254; } else { return aVal; }}
params.SetInt(nsICookieAcceptDialog.ACCEPT_COOKIE, 1);
if (document.getElementById('acceptSession').checked) params.SetInt(nsICookieAcceptDialog.ACCEPT_COOKIE, nsICookiePromptService.ACCEPT_SESSION_COOKIE); else params.SetInt(nsICookieAcceptDialog.ACCEPT_COOKIE, nsICookiePromptService.ACCEPT_COOKIE);
function cookieAccept(){ // say that the cookie was accepted params.SetInt(nsICookieAcceptDialog.ACCEPT_COOKIE, 1); // And remember that when needed params.SetInt(nsICookieAcceptDialog.REMEMBER_DECISION, document.getElementById('persistDomainAcceptance').checked); window.close();}
var number;
var number, cookie, id;
function CookieColumnSort(column) { var number; var cookietree = document.getElementById("cookietree"); var selected = cookietree.selectedIndex; var cookielist = document.getElementById('cookieList'); var childnodes = cookielist.childNodes; if (selected >= 0) { var cookie = childnodes[selected]; var id = cookie.getAttribute("id"); number = parseInt(id.substring("cookietree_".length,id.length)); } Wallet_ColumnSort(column, 'cookieList'); var length = childnodes.length; if (selected >= 0) { for (i=0; i<length; i++){ var cookie = childnodes[i]; var id = cookie.getAttribute("id"); var thisNumber = parseInt(id.substring("cookietree_".length,id.length)); if (thisNumber == number) { cookietree.selectedIndex = i; break; } } }}
var cookie = childnodes[selected]; var id = cookie.getAttribute("id");
cookie = childnodes[selected]; id = cookie.getAttribute("id");
function CookieColumnSort(column) { var number; var cookietree = document.getElementById("cookietree"); var selected = cookietree.selectedIndex; var cookielist = document.getElementById('cookieList'); var childnodes = cookielist.childNodes; if (selected >= 0) { var cookie = childnodes[selected]; var id = cookie.getAttribute("id"); number = parseInt(id.substring("cookietree_".length,id.length)); } Wallet_ColumnSort(column, 'cookieList'); var length = childnodes.length; if (selected >= 0) { for (i=0; i<length; i++){ var cookie = childnodes[i]; var id = cookie.getAttribute("id"); var thisNumber = parseInt(id.substring("cookietree_".length,id.length)); if (thisNumber == number) { cookietree.selectedIndex = i; break; } } }}
var cookie = childnodes[i]; var id = cookie.getAttribute("id");
cookie = childnodes[i]; id = cookie.getAttribute("id");
function CookieColumnSort(column) { var number; var cookietree = document.getElementById("cookietree"); var selected = cookietree.selectedIndex; var cookielist = document.getElementById('cookieList'); var childnodes = cookielist.childNodes; if (selected >= 0) { var cookie = childnodes[selected]; var id = cookie.getAttribute("id"); number = parseInt(id.substring("cookietree_".length,id.length)); } Wallet_ColumnSort(column, 'cookieList'); var length = childnodes.length; if (selected >= 0) { for (i=0; i<length; i++){ var cookie = childnodes[i]; var id = cookie.getAttribute("id"); var thisNumber = parseInt(id.substring("cookietree_".length,id.length)); if (thisNumber == number) { cookietree.selectedIndex = i; break; } } }}
params.SetInt(nsICookieAcceptDialog.ACCEPT_COOKIE, 0);
params.SetInt(nsICookieAcceptDialog.ACCEPT_COOKIE, nsICookiePromptService.DENY_COOKIE);
function cookieDeny(){ // say that the cookie was rejected params.SetInt(nsICookieAcceptDialog.ACCEPT_COOKIE, 0); // And remember that when needed params.SetInt(nsICookieAcceptDialog.REMEMBER_DECISION, document.getElementById('persistDomainAcceptance').checked); window.close();}
document.getElementById("removeCookie").setAttribute("disabled", "true");
function CookieSelected() { var selections = GetTreeSelections(cookiesTree); if (selections.length) { document.getElementById("removeCookie").removeAttribute("disabled"); } else { ClearCookieProperties(); return true; } var idx = selections[0]; if (idx >= cookies.length) { // Something got out of synch. See bug 119812 for details dump("Tree and viewer state are out of sync! " + "Help us figure out the problem in bug 119812"); return; } var props = [ {id: "ifl_name", value: cookies[idx].name}, {id: "ifl_value", value: cookies[idx].value}, {id: "ifl_isDomain", value: cookies[idx].isDomain ? cookieBundle.getString("domainColon") : cookieBundle.getString("hostColon")}, {id: "ifl_host", value: cookies[idx].host}, {id: "ifl_path", value: cookies[idx].path}, {id: "ifl_isSecure", value: cookies[idx].isSecure ? cookieBundle.getString("yes") : cookieBundle.getString("no")}, {id: "ifl_expires", value: GetExpiresString(cookies[idx].expires)}, {id: "ifl_policy", value: GetPolicyString(cookies[idx].policy)} ]; var value; var field; for (var i = 0; i < props.length; i++) { field = document.getElementById(props[i].id); if ((selections.length > 1) && (props[i].id != "ifl_isDomain")) { value = ""; // clear field if multiple selections } else { value = props[i].value; } field.value = value; } return true;}
cookieBundle.getString("yes") : cookieBundle.getString("no")},
cookieBundle.getString("forSecureOnly") : cookieBundle.getString("forAnyConnection")},
function CookieSelected() { var selections = GetTreeSelections(cookiesTree); if (selections.length) { document.getElementById("removeCookie").removeAttribute("disabled"); } else { document.getElementById("removeCookie").setAttribute("disabled", "true"); ClearCookieProperties(); return true; } var idx = selections[0]; if (idx >= cookies.length) { // Something got out of synch. See bug 119812 for details dump("Tree and viewer state are out of sync! " + "Help us figure out the problem in bug 119812"); return; } var props = [ {id: "ifl_name", value: cookies[idx].name}, {id: "ifl_value", value: cookies[idx].value}, {id: "ifl_isDomain", value: cookies[idx].isDomain ? cookieBundle.getString("domainColon") : cookieBundle.getString("hostColon")}, {id: "ifl_host", value: cookies[idx].host}, {id: "ifl_path", value: cookies[idx].path}, {id: "ifl_isSecure", value: cookies[idx].isSecure ? cookieBundle.getString("yes") : cookieBundle.getString("no")}, {id: "ifl_expires", value: GetExpiresString(cookies[idx].expires)}, {id: "ifl_policy", value: GetPolicyString(cookies[idx].policy)} ]; var value; var field; for (var i = 0; i < props.length; i++) { field = document.getElementById(props[i].id); if ((selections.length > 1) && (props[i].id != "ifl_isDomain")) { value = ""; // clear field if multiple selections } else { value = props[i].value; } field.value = value; } return true;}
dest_container.AppendElement(resource);
function copy_resource_deeply(source_datasource, resource, dest_container) { dest_container.AppendElement(resource); var arcs = source_datasource.ArcLabelsOut(resource); while (arcs.HasMoreElements()) { var arc = arcs.GetNext(); var targets = source_datasource.GetTargets(resource, arc, true); while (targets.HasMoreElements()) { var target = targets.GetNext(); dest_container.DataSource.Assert(resource, arc, target, true); } }}