rem
stringlengths 0
126k
| add
stringlengths 0
441k
| context
stringlengths 15
136k
|
---|---|---|
else { outlinerSelection.clearSelection(); setTitleFromFolder(folder,null); ClearMessagePane(); }
|
function HandleDeleteOrMoveMsgCompleted(folder){ gDBView.onDeleteCompleted(true); if (gNextMessageViewIndexAfterDelete != -2) { if (IsCurrentLoadedFolder(folder)) { var outlinerView = gDBView.QueryInterface(Components.interfaces.nsIOutlinerView); var outlinerSelection = outlinerView.selection; if (gNextMessageViewIndexAfterDelete != -1) { viewSize = outlinerView.rowCount; if (gNextMessageViewIndexAfterDelete >= viewSize) { if (viewSize > 0) gNextMessageViewIndexAfterDelete = viewSize - 1; else gNextMessageViewIndexAfterDelete = -1; } } // if we are about to set the selection with a new element then DON'T clear // the selection then add the next message to select. This just generates // an extra round of command updating notifications that we are trying to // optimize away. if (gNextMessageViewIndexAfterDelete != -1) { // when deleting a message we don't update the commands when the selection goes to 0 // (we have a hack in nsMsgDBView which prevents that update) so there is no need to // update commands when we select the next message after the delete; the commands already // have the right update state... gDBView.suppressCommandUpdating = true; outlinerSelection.select(gNextMessageViewIndexAfterDelete); // if gNextMessageViewIndexAfterDelete has the same value // as the last index we had selected, the outliner won't generate a // selectionChanged notification for the outliner view. So force a manual // selection changed call. (don't worry it's cheap if we end up calling it twice). if (outlinerView) outlinerView.selectionChanged(); EnsureRowInThreadOutlinerIsVisible(gNextMessageViewIndexAfterDelete); gDBView.suppressCommandUpdating = false; } else { outlinerSelection.clearSelection(); /* clear selection in either case */ setTitleFromFolder(folder,null); ClearMessagePane(); } } gNextMessageViewIndexAfterDelete = -2; //default value after delete/move/copy is over }}
|
|
if (gNextMessageViewIndexAfterDelete != -2) { if (IsCurrentLoadedFolder(folder))
|
if (!IsCurrentLoadedFolder(folder)) { gNextMessageViewIndexAfterDelete = -2; return; } var treeView = gDBView.QueryInterface(Components.interfaces.nsITreeView); var treeSelection = treeView.selection; if (gNextMessageViewIndexAfterDelete == -2) { if (treeSelection.count == 0) { treeSelection.clearSelection(); setTitleFromFolder(folder, null); ClearMessagePane(); UpdateMailToolbar("delete from another view, 0 rows now selected"); } else if (treeSelection.count == 1) { var startIndex = {}; var endIndex = {}; treeSelection.getRangeAt(0, startIndex, endIndex); treeSelection.select(startIndex.value); treeView.selectionChanged(); EnsureRowInThreadTreeIsVisible(startIndex.value); UpdateMailToolbar("delete from another view, 1 row now selected"); } else { } } else { if (gNextMessageViewIndexAfterDelete != nsMsgViewIndex_None)
|
function HandleDeleteOrMoveMsgCompleted(folder){ // you might not have a db view. this can happen if // biff fires when the 3 pane is set to account central. if (!gDBView) return; gDBView.onDeleteCompleted(true); if (gNextMessageViewIndexAfterDelete != -2) { if (IsCurrentLoadedFolder(folder)) { var treeView = gDBView.QueryInterface(Components.interfaces.nsITreeView); var treeSelection = treeView.selection; if (gNextMessageViewIndexAfterDelete != nsMsgViewIndex_None) { viewSize = treeView.rowCount; if (gNextMessageViewIndexAfterDelete >= viewSize) { if (viewSize > 0) gNextMessageViewIndexAfterDelete = viewSize - 1; else { gNextMessageViewIndexAfterDelete = nsMsgViewIndex_None; //there is nothing to select viewSize is 0 treeSelection.clearSelection(); setTitleFromFolder(folder,null); ClearMessagePane(); } } } // if we are about to set the selection with a new element then DON'T clear // the selection then add the next message to select. This just generates // an extra round of command updating notifications that we are trying to // optimize away. if (gNextMessageViewIndexAfterDelete != nsMsgViewIndex_None) { // when deleting a message we don't update the commands when the selection goes to 0 // (we have a hack in nsMsgDBView which prevents that update) so there is no need to // update commands when we select the next message after the delete; the commands already // have the right update state... gDBView.suppressCommandUpdating = true; // This check makes sure that the tree does not perform a // selection on a non selected row (row < 0), else assertions will // be thrown. if (gNextMessageViewIndexAfterDelete >= 0) treeSelection.select(gNextMessageViewIndexAfterDelete); // if gNextMessageViewIndexAfterDelete has the same value // as the last index we had selected, the tree won't generate a // selectionChanged notification for the tree view. So force a manual // selection changed call. (don't worry it's cheap if we end up calling it twice). if (treeView) treeView.selectionChanged(); EnsureRowInThreadTreeIsVisible(gNextMessageViewIndexAfterDelete); gDBView.suppressCommandUpdating = false; // hook for extra toolbar items // XXX I think there is a bug in the suppression code above. // what if I have two rows selected, and I hit delete, and so we load the next row. // what if I have commands that only enable where exactly one row is selected? NotifyObservers(window, "mail:updateToolbarItems", null); } } gNextMessageViewIndexAfterDelete = -2; //default value after delete/move/copy is over }}
|
var treeView = gDBView.QueryInterface(Components.interfaces.nsITreeView); var treeSelection = treeView.selection; if (gNextMessageViewIndexAfterDelete != nsMsgViewIndex_None)
|
viewSize = treeView.rowCount; if (gNextMessageViewIndexAfterDelete >= viewSize)
|
function HandleDeleteOrMoveMsgCompleted(folder){ // you might not have a db view. this can happen if // biff fires when the 3 pane is set to account central. if (!gDBView) return; gDBView.onDeleteCompleted(true); if (gNextMessageViewIndexAfterDelete != -2) { if (IsCurrentLoadedFolder(folder)) { var treeView = gDBView.QueryInterface(Components.interfaces.nsITreeView); var treeSelection = treeView.selection; if (gNextMessageViewIndexAfterDelete != nsMsgViewIndex_None) { viewSize = treeView.rowCount; if (gNextMessageViewIndexAfterDelete >= viewSize) { if (viewSize > 0) gNextMessageViewIndexAfterDelete = viewSize - 1; else { gNextMessageViewIndexAfterDelete = nsMsgViewIndex_None; //there is nothing to select viewSize is 0 treeSelection.clearSelection(); setTitleFromFolder(folder,null); ClearMessagePane(); } } } // if we are about to set the selection with a new element then DON'T clear // the selection then add the next message to select. This just generates // an extra round of command updating notifications that we are trying to // optimize away. if (gNextMessageViewIndexAfterDelete != nsMsgViewIndex_None) { // when deleting a message we don't update the commands when the selection goes to 0 // (we have a hack in nsMsgDBView which prevents that update) so there is no need to // update commands when we select the next message after the delete; the commands already // have the right update state... gDBView.suppressCommandUpdating = true; // This check makes sure that the tree does not perform a // selection on a non selected row (row < 0), else assertions will // be thrown. if (gNextMessageViewIndexAfterDelete >= 0) treeSelection.select(gNextMessageViewIndexAfterDelete); // if gNextMessageViewIndexAfterDelete has the same value // as the last index we had selected, the tree won't generate a // selectionChanged notification for the tree view. So force a manual // selection changed call. (don't worry it's cheap if we end up calling it twice). if (treeView) treeView.selectionChanged(); EnsureRowInThreadTreeIsVisible(gNextMessageViewIndexAfterDelete); gDBView.suppressCommandUpdating = false; // hook for extra toolbar items // XXX I think there is a bug in the suppression code above. // what if I have two rows selected, and I hit delete, and so we load the next row. // what if I have commands that only enable where exactly one row is selected? NotifyObservers(window, "mail:updateToolbarItems", null); } } gNextMessageViewIndexAfterDelete = -2; //default value after delete/move/copy is over }}
|
viewSize = treeView.rowCount; if (gNextMessageViewIndexAfterDelete >= viewSize) { if (viewSize > 0) gNextMessageViewIndexAfterDelete = viewSize - 1; else { gNextMessageViewIndexAfterDelete = nsMsgViewIndex_None;
|
if (viewSize > 0) gNextMessageViewIndexAfterDelete = viewSize - 1; else { gNextMessageViewIndexAfterDelete = nsMsgViewIndex_None;
|
function HandleDeleteOrMoveMsgCompleted(folder){ // you might not have a db view. this can happen if // biff fires when the 3 pane is set to account central. if (!gDBView) return; gDBView.onDeleteCompleted(true); if (gNextMessageViewIndexAfterDelete != -2) { if (IsCurrentLoadedFolder(folder)) { var treeView = gDBView.QueryInterface(Components.interfaces.nsITreeView); var treeSelection = treeView.selection; if (gNextMessageViewIndexAfterDelete != nsMsgViewIndex_None) { viewSize = treeView.rowCount; if (gNextMessageViewIndexAfterDelete >= viewSize) { if (viewSize > 0) gNextMessageViewIndexAfterDelete = viewSize - 1; else { gNextMessageViewIndexAfterDelete = nsMsgViewIndex_None; //there is nothing to select viewSize is 0 treeSelection.clearSelection(); setTitleFromFolder(folder,null); ClearMessagePane(); } } } // if we are about to set the selection with a new element then DON'T clear // the selection then add the next message to select. This just generates // an extra round of command updating notifications that we are trying to // optimize away. if (gNextMessageViewIndexAfterDelete != nsMsgViewIndex_None) { // when deleting a message we don't update the commands when the selection goes to 0 // (we have a hack in nsMsgDBView which prevents that update) so there is no need to // update commands when we select the next message after the delete; the commands already // have the right update state... gDBView.suppressCommandUpdating = true; // This check makes sure that the tree does not perform a // selection on a non selected row (row < 0), else assertions will // be thrown. if (gNextMessageViewIndexAfterDelete >= 0) treeSelection.select(gNextMessageViewIndexAfterDelete); // if gNextMessageViewIndexAfterDelete has the same value // as the last index we had selected, the tree won't generate a // selectionChanged notification for the tree view. So force a manual // selection changed call. (don't worry it's cheap if we end up calling it twice). if (treeView) treeView.selectionChanged(); EnsureRowInThreadTreeIsVisible(gNextMessageViewIndexAfterDelete); gDBView.suppressCommandUpdating = false; // hook for extra toolbar items // XXX I think there is a bug in the suppression code above. // what if I have two rows selected, and I hit delete, and so we load the next row. // what if I have commands that only enable where exactly one row is selected? NotifyObservers(window, "mail:updateToolbarItems", null); } } gNextMessageViewIndexAfterDelete = -2; //default value after delete/move/copy is over }}
|
treeSelection.clearSelection(); setTitleFromFolder(folder,null); ClearMessagePane(); }
|
treeSelection.clearSelection(); setTitleFromFolder(folder, null); ClearMessagePane(); UpdateMailToolbar("delete from current view, 0 rows left");
|
function HandleDeleteOrMoveMsgCompleted(folder){ // you might not have a db view. this can happen if // biff fires when the 3 pane is set to account central. if (!gDBView) return; gDBView.onDeleteCompleted(true); if (gNextMessageViewIndexAfterDelete != -2) { if (IsCurrentLoadedFolder(folder)) { var treeView = gDBView.QueryInterface(Components.interfaces.nsITreeView); var treeSelection = treeView.selection; if (gNextMessageViewIndexAfterDelete != nsMsgViewIndex_None) { viewSize = treeView.rowCount; if (gNextMessageViewIndexAfterDelete >= viewSize) { if (viewSize > 0) gNextMessageViewIndexAfterDelete = viewSize - 1; else { gNextMessageViewIndexAfterDelete = nsMsgViewIndex_None; //there is nothing to select viewSize is 0 treeSelection.clearSelection(); setTitleFromFolder(folder,null); ClearMessagePane(); } } } // if we are about to set the selection with a new element then DON'T clear // the selection then add the next message to select. This just generates // an extra round of command updating notifications that we are trying to // optimize away. if (gNextMessageViewIndexAfterDelete != nsMsgViewIndex_None) { // when deleting a message we don't update the commands when the selection goes to 0 // (we have a hack in nsMsgDBView which prevents that update) so there is no need to // update commands when we select the next message after the delete; the commands already // have the right update state... gDBView.suppressCommandUpdating = true; // This check makes sure that the tree does not perform a // selection on a non selected row (row < 0), else assertions will // be thrown. if (gNextMessageViewIndexAfterDelete >= 0) treeSelection.select(gNextMessageViewIndexAfterDelete); // if gNextMessageViewIndexAfterDelete has the same value // as the last index we had selected, the tree won't generate a // selectionChanged notification for the tree view. So force a manual // selection changed call. (don't worry it's cheap if we end up calling it twice). if (treeView) treeView.selectionChanged(); EnsureRowInThreadTreeIsVisible(gNextMessageViewIndexAfterDelete); gDBView.suppressCommandUpdating = false; // hook for extra toolbar items // XXX I think there is a bug in the suppression code above. // what if I have two rows selected, and I hit delete, and so we load the next row. // what if I have commands that only enable where exactly one row is selected? NotifyObservers(window, "mail:updateToolbarItems", null); } } gNextMessageViewIndexAfterDelete = -2; //default value after delete/move/copy is over }}
|
NotifyObservers(window, "mail:updateToolbarItems", null); }
|
UpdateMailToolbar("delete from current view, at least one row selected");
|
function HandleDeleteOrMoveMsgCompleted(folder){ // you might not have a db view. this can happen if // biff fires when the 3 pane is set to account central. if (!gDBView) return; gDBView.onDeleteCompleted(true); if (gNextMessageViewIndexAfterDelete != -2) { if (IsCurrentLoadedFolder(folder)) { var treeView = gDBView.QueryInterface(Components.interfaces.nsITreeView); var treeSelection = treeView.selection; if (gNextMessageViewIndexAfterDelete != nsMsgViewIndex_None) { viewSize = treeView.rowCount; if (gNextMessageViewIndexAfterDelete >= viewSize) { if (viewSize > 0) gNextMessageViewIndexAfterDelete = viewSize - 1; else { gNextMessageViewIndexAfterDelete = nsMsgViewIndex_None; //there is nothing to select viewSize is 0 treeSelection.clearSelection(); setTitleFromFolder(folder,null); ClearMessagePane(); } } } // if we are about to set the selection with a new element then DON'T clear // the selection then add the next message to select. This just generates // an extra round of command updating notifications that we are trying to // optimize away. if (gNextMessageViewIndexAfterDelete != nsMsgViewIndex_None) { // when deleting a message we don't update the commands when the selection goes to 0 // (we have a hack in nsMsgDBView which prevents that update) so there is no need to // update commands when we select the next message after the delete; the commands already // have the right update state... gDBView.suppressCommandUpdating = true; // This check makes sure that the tree does not perform a // selection on a non selected row (row < 0), else assertions will // be thrown. if (gNextMessageViewIndexAfterDelete >= 0) treeSelection.select(gNextMessageViewIndexAfterDelete); // if gNextMessageViewIndexAfterDelete has the same value // as the last index we had selected, the tree won't generate a // selectionChanged notification for the tree view. So force a manual // selection changed call. (don't worry it's cheap if we end up calling it twice). if (treeView) treeView.selectionChanged(); EnsureRowInThreadTreeIsVisible(gNextMessageViewIndexAfterDelete); gDBView.suppressCommandUpdating = false; // hook for extra toolbar items // XXX I think there is a bug in the suppression code above. // what if I have two rows selected, and I hit delete, and so we load the next row. // what if I have commands that only enable where exactly one row is selected? NotifyObservers(window, "mail:updateToolbarItems", null); } } gNextMessageViewIndexAfterDelete = -2; //default value after delete/move/copy is over }}
|
gNextMessageViewIndexAfterDelete = -2;
|
function HandleDeleteOrMoveMsgCompleted(folder){ // you might not have a db view. this can happen if // biff fires when the 3 pane is set to account central. if (!gDBView) return; gDBView.onDeleteCompleted(true); if (gNextMessageViewIndexAfterDelete != -2) { if (IsCurrentLoadedFolder(folder)) { var treeView = gDBView.QueryInterface(Components.interfaces.nsITreeView); var treeSelection = treeView.selection; if (gNextMessageViewIndexAfterDelete != nsMsgViewIndex_None) { viewSize = treeView.rowCount; if (gNextMessageViewIndexAfterDelete >= viewSize) { if (viewSize > 0) gNextMessageViewIndexAfterDelete = viewSize - 1; else { gNextMessageViewIndexAfterDelete = nsMsgViewIndex_None; //there is nothing to select viewSize is 0 treeSelection.clearSelection(); setTitleFromFolder(folder,null); ClearMessagePane(); } } } // if we are about to set the selection with a new element then DON'T clear // the selection then add the next message to select. This just generates // an extra round of command updating notifications that we are trying to // optimize away. if (gNextMessageViewIndexAfterDelete != nsMsgViewIndex_None) { // when deleting a message we don't update the commands when the selection goes to 0 // (we have a hack in nsMsgDBView which prevents that update) so there is no need to // update commands when we select the next message after the delete; the commands already // have the right update state... gDBView.suppressCommandUpdating = true; // This check makes sure that the tree does not perform a // selection on a non selected row (row < 0), else assertions will // be thrown. if (gNextMessageViewIndexAfterDelete >= 0) treeSelection.select(gNextMessageViewIndexAfterDelete); // if gNextMessageViewIndexAfterDelete has the same value // as the last index we had selected, the tree won't generate a // selectionChanged notification for the tree view. So force a manual // selection changed call. (don't worry it's cheap if we end up calling it twice). if (treeView) treeView.selectionChanged(); EnsureRowInThreadTreeIsVisible(gNextMessageViewIndexAfterDelete); gDBView.suppressCommandUpdating = false; // hook for extra toolbar items // XXX I think there is a bug in the suppression code above. // what if I have two rows selected, and I hit delete, and so we load the next row. // what if I have commands that only enable where exactly one row is selected? NotifyObservers(window, "mail:updateToolbarItems", null); } } gNextMessageViewIndexAfterDelete = -2; //default value after delete/move/copy is over }}
|
|
gNextMessageViewIndexAfterDelete = -2;
|
function HandleDeleteOrMoveMsgCompleted(folder){ // you might not have a db view. this can happen if // biff fires when the 3 pane is set to account central. if (!gDBView) return; gDBView.onDeleteCompleted(true); if (gNextMessageViewIndexAfterDelete != -2) { if (IsCurrentLoadedFolder(folder)) { var treeView = gDBView.QueryInterface(Components.interfaces.nsITreeView); var treeSelection = treeView.selection; if (gNextMessageViewIndexAfterDelete != nsMsgViewIndex_None) { viewSize = treeView.rowCount; if (gNextMessageViewIndexAfterDelete >= viewSize) { if (viewSize > 0) gNextMessageViewIndexAfterDelete = viewSize - 1; else { gNextMessageViewIndexAfterDelete = nsMsgViewIndex_None; //there is nothing to select viewSize is 0 treeSelection.clearSelection(); setTitleFromFolder(folder,null); ClearMessagePane(); } } } // if we are about to set the selection with a new element then DON'T clear // the selection then add the next message to select. This just generates // an extra round of command updating notifications that we are trying to // optimize away. if (gNextMessageViewIndexAfterDelete != nsMsgViewIndex_None) { // when deleting a message we don't update the commands when the selection goes to 0 // (we have a hack in nsMsgDBView which prevents that update) so there is no need to // update commands when we select the next message after the delete; the commands already // have the right update state... gDBView.suppressCommandUpdating = true; // This check makes sure that the tree does not perform a // selection on a non selected row (row < 0), else assertions will // be thrown. if (gNextMessageViewIndexAfterDelete >= 0) treeSelection.select(gNextMessageViewIndexAfterDelete); // if gNextMessageViewIndexAfterDelete has the same value // as the last index we had selected, the tree won't generate a // selectionChanged notification for the tree view. So force a manual // selection changed call. (don't worry it's cheap if we end up calling it twice). if (treeView) treeView.selectionChanged(); EnsureRowInThreadTreeIsVisible(gNextMessageViewIndexAfterDelete); gDBView.suppressCommandUpdating = false; // hook for extra toolbar items // XXX I think there is a bug in the suppression code above. // what if I have two rows selected, and I hit delete, and so we load the next row. // what if I have commands that only enable where exactly one row is selected? NotifyObservers(window, "mail:updateToolbarItems", null); } } gNextMessageViewIndexAfterDelete = -2; //default value after delete/move/copy is over }}
|
|
var languageName = node.getAttribute('value');
|
var languageName = node.getAttribute('label');
|
function HandleDoubleClick(node){ var languageId = node.id; var languageName = node.getAttribute('value'); if (languageName && languageName.length > 0) { if (!LangAlreadyActive(languageId)) { AddTreeItem(window.opener.document, active_languages_treeroot, languageId, languageName); } window.close(); }//if} //HandleDoubleClick
|
AddTreeItem(window.opener.document, active_languages_treeroot, languageId, languageName);
|
AddListItem(window.opener.document, active_languages, languageId, languageName);
|
function HandleDoubleClick(node){ var languageId = node.id; var languageName = node.getAttribute('label'); if (languageName && languageName.length > 0) { if (!LangAlreadyActive(languageId)) { AddTreeItem(window.opener.document, active_languages_treeroot, languageId, languageName); } window.close(); }//if} //HandleDoubleClick
|
if (!this._window) { return; }
|
handleEvent: function(event) { if (event.target.ownerDocument != this._document) { LOG("FeedWriter.handleEvent: Someone passed the feed writer as a listener to the events of another document!"); return; } switch(event.type) { case "command" : { switch(event.target.id) { case "subscribeButton": this.subscribe(); break; case "chooseApplicationMenuItem": // For keyboard-only users, we only show the file picker once the // subscribe button is pressed. See click event handling for the // mouse-case. break; default: this._setAlwaysUseLabel(); } break; } case "click": { if (event.target.id == "chooseApplicationMenuItem") { if (!this._chooseClientApp()) { // Select the (per-prefs) selected handler if no application was selected this._setSelectedHandler(); } } } } },
|
|
if (!this._window) { return; }
|
event = new XPCNativeWrapper(event);
|
handleEvent: function(event) { if (!this._window) { // this._window is null unless this.write was called with a trusted // window object. return; } if (event.target.ownerDocument != this._document) { LOG("FeedWriter.handleEvent: Someone passed the feed writer as a listener to the events of another document!"); return; } switch (event.type) { case "command" : { switch (event.target.id) { case "subscribeButton": this.subscribe(); break; case "chooseApplicationMenuItem": // For keyboard-only users, we only show the file picker once the // subscribe button is pressed. See click event handling for the // mouse-case. break; default: this._setAlwaysUseLabel(); } break; } case "click": { if (event.target.id == "chooseApplicationMenuItem") { if (!this._chooseClientApp()) { // Select the (per-prefs) selected handler if no application was // selected this._setSelectedHandler(); } } } } },
|
lowerCaseHeaderName = headerName.toLowerCase();
|
var lowerCaseHeaderName = headerName.toLowerCase();
|
handleHeader: function(headerName, headerValue) { // WARNING: if you are modifying this function, make sure you do not do *ANY* // dom manipulations which would trigger a reflow. This method gets called // for every rfc822 header in the message being displayed. If you introduce a reflow // you'll be introducing a reflow for every time we are told about a header. And msgs have // a lot of headers. Don't do it =)....Move your code into OnEndHeaders which is only called // once per message view. // for consistancy sake, let's force all header names to be lower case so // we don't have to worry about looking for: Cc and CC, etc. lowerCaseHeaderName = headerName.toLowerCase(); var foo = new Object; foo.headerValue = headerValue; foo.headerName = headerName; currentHeaderData[lowerCaseHeaderName] = foo; if (lowerCaseHeaderName == "from") { var collectIncoming = pref.GetBoolPref("mail.collect_email_address_incoming"); if (collectIncoming && headerValue && abAddressCollector) abAddressCollector.collectUnicodeAddress(headerValue); } },
|
case 13: onStart(); break;
|
function HandleKeyEvent( aEvent ){ switch( aEvent.keyCode ) { case 13: onStart(); break; case 46: if( profileManagerMode != "manager" ) return; ConfirmDelete(); break; case "VK_F2": if( profileManagerMode != "manager" ) return; RenameProfile(); break; }}
|
|
d.textContent = r[2].replace(/[\n\r]$/, '');
|
d.textContent = r[2];
|
handleLog: function(aLog, aDlg, aLocale) { var df = document.createDocumentFragment(); for each (var r in aLog) { var d = document.createElement('pre'); d.className = 'log-row ' + r[1]; // XXX filter on r[0:1] d.textContent = r[2].replace(/[\n\r]$/, ''); df.appendChild(d); } aDlg.setBody(df); },
|
if (SelectedMessagesAreJunk()) return;
|
function HandleMDNResponse(aUrl){ if (!aUrl) return; var msgFolder = aUrl.folder; var msgURI = GetLoadedMessage(); if (!msgFolder || !msgURI) return; if (IsNewsMessage(msgURI)) return; var msgHdr = messenger.messageServiceFromURI(msgURI).messageURIToMsgHdr(msgURI); var mimeHdr = aUrl.mimeHeaders; // If we didn't get the message id when we downloaded the message header, // we cons up an md5: message id. If we've done that, we'll try to extract // the message id out of the mime headers for the whole message. var msgId = msgHdr.messageId; if (msgId.split(":")[0] == "md5") { var mimeMsgId = mimeHdr.extractHeader("Message-Id", false); if (mimeMsgId) msgHdr.messageId = mimeMsgId; } // After a msg is downloaded it's already marked READ at this point so we must check if // the msg has a "Disposition-Notification-To" header and no MDN report has been sent yet. var msgFlags = msgHdr.flags; if ((msgFlags & MSG_FLAG_IMAP_DELETED) || (msgFlags & MSG_FLAG_MDN_REPORT_SENT)) return; var DNTHeader = mimeHdr.extractHeader("Disposition-Notification-To", false); if (!DNTHeader) return; // Everything looks good so far, let's generate the MDN response. var mdnGenerator = Components.classes["@mozilla.org/messenger-mdn/generator;1"]. createInstance(Components.interfaces.nsIMsgMdnGenerator); mdnGenerator.process(MDN_DISPOSE_TYPE_DISPLAYED, msgWindow, msgFolder, msgHdr.messageKey, mimeHdr, false); // Reset mark msg MDN "Sent" and "Not Needed". msgHdr.flags = (msgFlags & ~MSG_FLAG_MDN_REPORT_NEEDED); msgHdr.OrFlags(MSG_FLAG_MDN_REPORT_SENT); // Commit db changes. var msgdb = msgFolder.getMsgDatabase(msgWindow); if (msgdb) msgdb.Commit(ADDR_DB_LARGE_COMMIT);}
|
|
this.cache.put(o._mURL, obj);
|
handleSuccess : function(o) { if (o.responseText === undefined) throw "expected response text in handleSuccess"; if (o.callback) { var obj = eval('('+o.responseText+')'); o.callback(obj); delete o.callback; } },
|
|
addToUrlbarHistory();
|
addToUrlbarHistory(gURLBar.value);
|
function handleURLBarCommand(aUserAction, aTriggeringEvent){ try { addToUrlbarHistory(); } catch (ex) { // Things may go wrong when adding url to session history, // but don't let that interfere with the loading of the url. } BrowserLoadURL(aTriggeringEvent); }
|
addToUrlbarHistory();
|
addToUrlbarHistory(gURLBar.value);
|
function handleURLBarCommand(aTriggeringEvent){ var postData = { }; canonizeUrl(aTriggeringEvent, postData); try { addToUrlbarHistory(); } catch (ex) { // Things may go wrong when adding url to session history, // but don't let that interfere with the loading of the url. } BrowserLoadURL(aTriggeringEvent, postData.value);}
|
SetPageProxyState("valid");
|
function handleURLBarRevert(){ var url = _content.location.href; var throbberElement = document.getElementById("navigator-throbber"); var isScrolling = gURLBar.userAction == "scrolling"; // don't revert to last valid url unless page is NOT loading // and user is NOT key-scrolling through autocomplete list if (!throbberElement.getAttribute("busy") && !isScrolling) { if (url != "about:blank") { gURLBar.value = url; gURLBar.select(); } else { //if about:blank, urlbar becomes "" gURLBar.value = ""; } SetPageProxyState("valid"); } // tell widget to revert to last typed text only if the user // was scrolling when they hit escape return isScrolling; }
|
|
SetPageProxyState("valid");
|
SetPageProxyState("valid", null);
|
function handleURLBarRevert(){ var url = _content.location.href; var throbberElement = document.getElementById("navigator-throbber"); var isScrolling = gURLBar.userAction == "scrolling"; // don't revert to last valid url unless page is NOT loading // and user is NOT key-scrolling through autocomplete list if (!throbberElement.getAttribute("busy") && !isScrolling) { if (url != "about:blank") { gURLBar.value = url; gURLBar.select(); SetPageProxyState("valid"); } else { //if about:blank, urlbar becomes "" gURLBar.value = ""; } } // tell widget to revert to last typed text only if the user // was scrolling when they hit escape return isScrolling; }
|
if (aArc.EqualsNode(this.kNC_child)) {
|
if (aArc.EqualsNode(this.kNC_child) || aArc.EqualsNode(this.kNC_recursiveChild)) { var listType = (aArc.EqualsNode(this.kNC_child) ? "flat.messagelist.ldap" : "recursive.messagelist.ldap");
|
hasArcOut: function(aSource, aArc) { if (DEBUG) { dump("hasArcOut() called with args: \n\t" + aSource.Value + "\n\t" + aArc.Value + "\n\n"); } var delegate; if (aArc.EqualsNode(this.kNC_child)) { try { delegate = aSource.GetDelegate("messagelist.ldap", Components.interfaces.nsISupportsArray); } catch (e) { } if (delegate != null) { return true; } } else { var refStart = aArc.Value.indexOf("#"); if (aArc.Value.slice(0, refStart + 1) == LDAPATTR_NAMESPACE_URI) { try { delegate = aSource.GetDelegate("message.ldap", Components.interfaces.nsILDAPMessage); } catch (e) { } if (delegate != null) { var attributeName = aArc.Value.slice(refStart + 1); var attributeArray = this.getAttributeArray(delegate, attributeName); if (attributeArray.length > 0) { return true; } } } } return false; },
|
delegate = aSource.GetDelegate("messagelist.ldap", Components.interfaces.nsISupportsArray); } catch (e) {
|
delegate = aSource.GetDelegate(listType, Components.interfaces.nsISupportsArray); } catch (e) {
|
hasArcOut: function(aSource, aArc) { if (DEBUG) { dump("hasArcOut() called with args: \n\t" + aSource.Value + "\n\t" + aArc.Value + "\n\n"); } var delegate; if (aArc.EqualsNode(this.kNC_child)) { try { delegate = aSource.GetDelegate("messagelist.ldap", Components.interfaces.nsISupportsArray); } catch (e) { } if (delegate != null) { return true; } } else { var refStart = aArc.Value.indexOf("#"); if (aArc.Value.slice(0, refStart + 1) == LDAPATTR_NAMESPACE_URI) { try { delegate = aSource.GetDelegate("message.ldap", Components.interfaces.nsILDAPMessage); } catch (e) { } if (delegate != null) { var attributeName = aArc.Value.slice(refStart + 1); var attributeArray = this.getAttributeArray(delegate, attributeName); if (attributeArray.length > 0) { return true; } } } } return false; },
|
else { var refStart = aArc.Value.indexOf("#"); if (aArc.Value.slice(0, refStart + 1) == LDAPATTR_NAMESPACE_URI) { try { delegate = aSource.GetDelegate("message.ldap", Components.interfaces.nsILDAPMessage); } catch (e) { } if (delegate != null) { var attributeName = aArc.Value.slice(refStart + 1); var attributeArray = this.getAttributeArray(delegate, attributeName); if (attributeArray.length > 0) { return true; } }
|
else if (aArc.EqualsNode(this.kNC_DN)) { try { delegate = aSource.GetDelegate("message.ldap", Components.interfaces.nsILDAPMessage);
|
hasArcOut: function(aSource, aArc) { if (DEBUG) { dump("hasArcOut() called with args: \n\t" + aSource.Value + "\n\t" + aArc.Value + "\n\n"); } var delegate; if (aArc.EqualsNode(this.kNC_child)) { try { delegate = aSource.GetDelegate("messagelist.ldap", Components.interfaces.nsISupportsArray); } catch (e) { } if (delegate != null) { return true; } } else { var refStart = aArc.Value.indexOf("#"); if (aArc.Value.slice(0, refStart + 1) == LDAPATTR_NAMESPACE_URI) { try { delegate = aSource.GetDelegate("message.ldap", Components.interfaces.nsILDAPMessage); } catch (e) { } if (delegate != null) { var attributeName = aArc.Value.slice(refStart + 1); var attributeArray = this.getAttributeArray(delegate, attributeName); if (attributeArray.length > 0) { return true; } } } } return false; },
|
return false;
|
var refStart = aArc.Value.indexOf("#"); if (aArc.Value.slice(0, refStart + 1) == LDAPATTR_NAMESPACE_URI) { try { delegate = aSource.GetDelegate("message.ldap", Components.interfaces.nsILDAPMessage); } catch (e) { } if (delegate != null) { var attributeName = aArc.Value.slice(refStart + 1); var attributeArray = this.getAttributeArray(delegate, attributeName); if (attributeArray.length > 0) { return true; } } }
|
hasArcOut: function(aSource, aArc) { if (DEBUG) { dump("hasArcOut() called with args: \n\t" + aSource.Value + "\n\t" + aArc.Value + "\n\n"); } var delegate; if (aArc.EqualsNode(this.kNC_child)) { try { delegate = aSource.GetDelegate("messagelist.ldap", Components.interfaces.nsISupportsArray); } catch (e) { } if (delegate != null) { return true; } } else { var refStart = aArc.Value.indexOf("#"); if (aArc.Value.slice(0, refStart + 1) == LDAPATTR_NAMESPACE_URI) { try { delegate = aSource.GetDelegate("message.ldap", Components.interfaces.nsILDAPMessage); } catch (e) { } if (delegate != null) { var attributeName = aArc.Value.slice(refStart + 1); var attributeArray = this.getAttributeArray(delegate, attributeName); if (attributeArray.length > 0) { return true; } } } } return false; },
|
var refStart = aArc.Value.indexOf("#"); if (aArc.Value.slice(0, refStart + 1) == LDAPATTR_NAMESPACE_URI) { try { delegate = aSource.GetDelegate("message.ldap", Components.interfaces.nsILDAPMessage); } catch (e) { } if (delegate != null) { var attributeName = aArc.Value.slice(refStart + 1); var attributeArray = this.getAttributeArray(delegate, attributeName); if (attributeArray.length > 0) { return true; } } }
|
var refStart = aArc.Value.indexOf("#"); if (aArc.Value.slice(0, refStart + 1) == LDAPATTR_NAMESPACE_URI) { try { delegate = aSource.GetDelegate("message.ldap", Components.interfaces.nsILDAPMessage); } catch (e) { } if (delegate != null) { var attributeName = aArc.Value.slice(refStart + 1); var attributeArray = this.getAttributeArray(delegate, attributeName); if (attributeArray.length > 0) { return true; } } } return false;
|
hasArcOut: function(aSource, aArc) { if (DEBUG) { dump("hasArcOut() called with args: \n\t" + aSource.Value + "\n\t" + aArc.Value + "\n\n"); } var delegate; if (aArc.EqualsNode(this.kNC_child) || aArc.EqualsNode(this.kNC_recursiveChild)) { // Find children or recursiveChildren. Get the messagelist delegate // (flat for child, recursive for recursiveChild) for aSource and // return true if we have one. var listType = (aArc.EqualsNode(this.kNC_child) ? "flat.messagelist.ldap" : "recursive.messagelist.ldap"); try { delegate = aSource.GetDelegate(listType, Components.interfaces.nsISupportsArray); } catch (e) { } if (delegate != null) { return true; } } else if (aArc.EqualsNode(this.kNC_DN)) { // Find the DN arc. Get the message delegate for aSource // and return true if we have a delegate and its dn // attribute is non-null. try { delegate = aSource.GetDelegate("message.ldap", Components.interfaces.nsILDAPMessage); } catch (e) { } return (delegate != null); } // Find a different arc. See if we're looking for an LDAP attribute // arc. If so, get the message delegate for aSource, if we find one // get the attribute array for the specified LDAP attribute and // return true if it contains at least one value. var refStart = aArc.Value.indexOf("#"); if (aArc.Value.slice(0, refStart + 1) == LDAPATTR_NAMESPACE_URI) { try { delegate = aSource.GetDelegate("message.ldap", Components.interfaces.nsILDAPMessage); } catch (e) { } if (delegate != null) { var attributeName = aArc.Value.slice(refStart + 1); var attributeArray = this.getAttributeArray(delegate, attributeName); if (attributeArray.length > 0) { return true; } } } },
|
if (aSource.EqualsNode(this.kRasputin) && aProperty.EqualsNode(this.kNC_child) && aTarget.EqualsNode(this.kElvis) && aTruthValue) { return true; }
|
HasAssertion: function(aSource, aProperty, aTarget, aTruthValue) { // figure out what kind of nsIRDFNode aTarget is // XXXdmose: code incomplete // aTarget = aTarget.QueryInterface(Components.interfaces.nsIRDFResource); // spew debugging info // if (DEBUG) { dump("HasAssertion() called with args: \n\t" + aSource.Value + "\n\t" + aProperty.Value + "\n\t" + aTarget.Value + "\n\t" + aTruthValue + "\n\n"); // XXXdmose debugging cruft if (aSource.EqualsNode(this.kRasputin) && aProperty.EqualsNode(this.kNC_child) && aTarget.EqualsNode(this.kElvis) && aTruthValue) { return true; } } // the datasource doesn't currently use any sort of containers // if (aProperty.EqualsNode(this.kRDF_instanceOf)) { return false; } // XXXdmose: real processing should happen here // var myMessage = aSource.GetDelegate("ldapmessage", Components. interfaces.nsILDAPMessage); // if we haven't returned true yet, there's nothing here // return false; },
|
|
#if PLUGIN_TYPE_MANAGER var plugins = { }; var catman = Components.classes["@mozilla.org/categorymanager;1"].getService(Components.interfaces.nsICategoryManager); var types = catman.enumerateCategory("Gecko-Content-Viewers"); while (types.hasMoreElements()) { var currType = types.getNext().QueryInterface(Components.interfaces.nsISupportsCString).data; var contractid = catman.getCategoryEntry("Gecko-Content-Viewers", currType); if (contractid == "@mozilla.org/content/plugin/document-loader-factory;1") plugins[currType] = "@mozilla.org/content/plugin/document-loader-factory;1"; } #endif
|
function HelperApps(){ if (!gRDF) gRDF = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(Components.interfaces.nsIRDFService); const mimeTypes = "UMimTyp"; var fileLocator = Components.classes["@mozilla.org/file/directory_service;1"].getService(Components.interfaces.nsIProperties); var file = fileLocator.get(mimeTypes, Components.interfaces.nsIFile); var ioService = Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService); var fileHandler = ioService.getProtocolHandler("file").QueryInterface(Components.interfaces.nsIFileProtocolHandler); this._inner = gRDF.GetDataSourceBlocking(fileHandler.getURLSpecFromFile(file)); this._inner.AddObserver(this); this._fileTypeArc = gRDF.GetResource(NC_URI("FileType")); this._fileHandlerArc = gRDF.GetResource(NC_URI("FileHandler")); this._fileIconArc = gRDF.GetResource(NC_URI("FileIcon")); this._fileExtensionArc = gRDF.GetResource(NC_URI("FileExtension")); this._fileExtensionsArc = gRDF.GetResource(NC_URI("FileExtensions")); this._handleAutoArc = gRDF.GetResource(NC_URI("FileHandleAuto")); this._valueArc = gRDF.GetResource(NC_URI("value")); this._handlerPropArc = gRDF.GetResource(NC_URI("handlerProp")); this._externalAppArc = gRDF.GetResource(NC_URI("externalApplication")); #if PLUGIN_TYPE_MANAGER // Initialize Plugins var plugins = { }; var catman = Components.classes["@mozilla.org/categorymanager;1"].getService(Components.interfaces.nsICategoryManager); var types = catman.enumerateCategory("Gecko-Content-Viewers"); while (types.hasMoreElements()) { var currType = types.getNext().QueryInterface(Components.interfaces.nsISupportsCString).data; var contractid = catman.getCategoryEntry("Gecko-Content-Viewers", currType); if (contractid == "@mozilla.org/content/plugin/document-loader-factory;1") plugins[currType] = "@mozilla.org/content/plugin/document-loader-factory;1"; }#endif}
|
|
this.fileName = MSG_HELP_TITLE;
|
this.fileName = "x-jsd:help";
|
function HelpText (){ this.tabWidth = console.prefs["sourcetext.tab.width"]; this.fileName = MSG_HELP_TITLE; this.reloadSource();}
|
var disabledItems = ['cmd_close', 'Browser:SendPage', 'Browser:EditPage',
|
var disabledItems = ['cmd_close', 'Browser:SendPage', 'Browser:EditPage', 'Browser:PrintSetup',
|
function hiddenWindowStartup(){ // focus the hidden window window.focus(); // Disable menus which are not appropriate var disabledItems = ['cmd_close', 'Browser:SendPage', 'Browser:EditPage', /*'Browser:PrintSetup', 'Browser:PrintPreview',*/ 'Browser:Print', 'canGoBack', 'canGoForward', 'Browser:Home', 'Browser:AddBookmark', 'cmd_undo', 'cmd_redo', 'cmd_cut', 'cmd_copy','cmd_paste', 'cmd_delete', 'cmd_selectAll']; for (id in disabledItems) { var broadcaster = document.getElementById(disabledItems[id]); if (broadcaster) broadcaster.setAttribute("disabled", "true"); }}
|
'viewThreaded', 'viewAll', 'viewUnread', 'viewLabelMenuItem1',
|
'viewThreaded', 'viewMessageViewMenu', 'viewAll', 'viewUnread', 'viewLabelMenuItem1',
|
function hiddenWindowStartup(){ // focus the hidden window window.focus(); // Disable menus which are not appropriate var disabledItems = ['newNewMsgCmd', 'menu_newFolder', 'newAccountMenuItem', 'menu_close', 'menu_sendunsentmsgs', 'menu_subscribe', 'menu_renameFolder', 'menu_selectAll', 'menu_showMessengerToolbar', 'menu_showSearchToolbar', 'menu_showTaskbar', 'menu_customizeToolbar', 'messagePaneClassic', 'messagePaneWide', 'messagePaneVertical', 'menu_showMessage', 'sortByDateMenuitem', 'sortByFlagMenuitem', 'sortByOrderReceivedMenuitem', 'sortByPriorityMenuitem', 'sortBySenderMenuitem', 'sortByRecipientMenuitem', 'sortBySenderOrRecipientMenuitem', 'sortBySizeMenuitem', 'sortByStatusMenuitem', 'sortBySubjectMenuitem', 'sortByThreadMenuitem', 'sortByUnreadMenuitem', 'sortByLabelMenuitem', 'sortByJunkStatusMenuitem', 'sortByAttachmentsMenuitem', 'sortAscending', 'sortDescending', 'viewThreaded', 'viewAll', 'viewUnread', 'viewLabelMenuItem1', 'viewUnread', 'viewLabelMenuItem1', 'viewLabelMenuItem2', 'viewLabelMenuItem3', 'viewLabelMenuItem4', 'viewLabelMenuItem5', 'viewCreateCustomView', 'viewallheaders', 'viewnormalheaders', 'bodyAllowHTML', 'bodySanitized', 'bodyAsPlaintext', 'viewAttachmentsInlineMenuitem', 'goStartPage', 'newMsgCmd', 'searchMailCmd', 'searchAddressesCmd', 'filtersCmd', 'junkMailCmd']; for (var id in disabledItems) { var broadcaster = document.getElementById(disabledItems[id]); if (broadcaster) broadcaster.setAttribute("disabled", "true"); }}
|
window.focus();
|
function hiddenWindowStartup(){ // Disable menus which are not appropriate var disabledItems = ['cmd_close', 'Browser:SendPage', 'Browser:EditPage', /*'Browser:PrintSetup', 'Browser:PrintPreview',*/ 'Browser:Print', 'canGoBack', 'canGoForward', 'Browser:Home', 'Browser:AddBookmark', 'cmd_undo', 'cmd_redo', 'cmd_cut', 'cmd_copy','cmd_paste', 'cmd_delete', 'cmd_selectAll']; for (id in disabledItems) { var broadcaster = document.getElementById(disabledItems[id]); if (broadcaster) broadcaster.setAttribute("disabled", "true"); }}
|
|
'cmd_printSetup',
|
'Browser:SavePage', 'cmd_printSetup',
|
function hiddenWindowStartup(){ // focus the hidden window window.focus(); // Disable menus which are not appropriate var disabledItems = ['cmd_close', 'Browser:SendPage', 'Browser:EditPage', 'cmd_printSetup', /*'Browser:PrintPreview',*/ 'Browser:Print', 'canGoBack', 'canGoForward', 'Browser:Home', 'Browser:AddBookmark', 'Browser:AddBookmarkAs', 'Browser:AddGroupmarkAs', 'cmd_undo', 'cmd_redo', 'cmd_cut', 'cmd_copy', 'cmd_paste', 'cmd_delete', 'cmd_selectAll', 'menu_textZoom', 'cmd_minimizeWindow', 'cmd_zoomWindow']; var broadcaster; for (var id in disabledItems) { broadcaster = document.getElementById(disabledItems[id]); if (broadcaster) broadcaster.setAttribute("disabled", "true"); } // also hide the window list separator var separator = document.getElementById("sep-window-list"); if (separator) separator.setAttribute("hidden", "true"); // Get the preferences service var prefService = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefService); pref = prefService.getBranch(null); // init global strings bundle gNavigatorBundle = document.getElementById("bundle_navigator"); // now load bookmarks after a delay setTimeout(hiddenWindowLoadBookmarksCallback, 0);}
|
if (this.mTarget.localName == "menuitem" || this.mTarget.localName == "menu") {
|
if (this.mTarget.localName == "menu" || this.mTarget.localName == "menuitem" || this.mTarget.localName == "menuseparator") {
|
hide: function () { if (!this.mTarget) return; // special case for the menu items... if (this.mTarget.localName == "menuitem" || this.mTarget.localName == "menu") { this.hideMenuitem(); return; } var insertion = document.getElementById("insertion-feedback"); insertion.hidden = true; this.mTarget = null; this.mOrientation = null; },
|
window.frames["accountCentralPane"].location = "about:blank"; accountCentralBox.setAttribute("collapsed", "true"); gSearchBox.removeAttribute("collapsed"); messagesBox.removeAttribute("collapsed"); gAccountCentralLoaded = false;
|
function HideAccountCentral(){ try { switch (gPaneConfig) { case 0: window.frames["accountCentralPane"].location = "about:blank"; accountCentralBox.setAttribute("collapsed", "true"); gSearchBox.removeAttribute("collapsed"); messagesBox.removeAttribute("collapsed"); gAccountCentralLoaded = false; break; case 1: window.frames["accountCentralPane"].location = "about:blank"; accountCentralBox.setAttribute("collapsed", "true"); // XXX todo // the code below that always removes the collapsed attribute // makes it so in this pane config, you can't keep the message pane hidden // see bug #188393 var messagePaneBox = document.getElementById("messagepanebox"); messagePaneBox.removeAttribute("collapsed"); var searchAndThreadPaneBox = document.getElementById("searchAndthreadpaneBox"); searchAndThreadPaneBox.removeAttribute("collapsed"); var threadPaneSplitter = document.getElementById("threadpane-splitter"); threadPaneSplitter.removeAttribute("collapsed"); gAccountCentralLoaded = false; break; } } catch (ex) { dump("Error hiding AccountCentral page -> " + ex + "\n"); return; }}
|
|
window.frames["accountCentralPane"].location = "about:blank"; accountCentralBox.setAttribute("collapsed", "true"); var messagePaneBox = document.getElementById("messagepanebox"); messagePaneBox.removeAttribute("collapsed"); var searchAndThreadPaneBox = document.getElementById("searchAndthreadpaneBox"); searchAndThreadPaneBox.removeAttribute("collapsed"); var threadPaneSplitter = document.getElementById("threadpane-splitter"); threadPaneSplitter.removeAttribute("collapsed"); gAccountCentralLoaded = false;
|
gThreadPaneSplitter.removeAttribute("collapsed");
|
function HideAccountCentral(){ try { switch (gPaneConfig) { case 0: window.frames["accountCentralPane"].location = "about:blank"; accountCentralBox.setAttribute("collapsed", "true"); gSearchBox.removeAttribute("collapsed"); messagesBox.removeAttribute("collapsed"); gAccountCentralLoaded = false; break; case 1: window.frames["accountCentralPane"].location = "about:blank"; accountCentralBox.setAttribute("collapsed", "true"); // XXX todo // the code below that always removes the collapsed attribute // makes it so in this pane config, you can't keep the message pane hidden // see bug #188393 var messagePaneBox = document.getElementById("messagepanebox"); messagePaneBox.removeAttribute("collapsed"); var searchAndThreadPaneBox = document.getElementById("searchAndthreadpaneBox"); searchAndThreadPaneBox.removeAttribute("collapsed"); var threadPaneSplitter = document.getElementById("threadpane-splitter"); threadPaneSplitter.removeAttribute("collapsed"); gAccountCentralLoaded = false; break; } } catch (ex) { dump("Error hiding AccountCentral page -> " + ex + "\n"); return; }}
|
document.getElementById("key_toggleMessagePane").removeAttribute("disabled");
|
function HideAccountCentral(){ try { window.frames["accountCentralPane"].location.href = "about:blank"; document.getElementById("accountCentralBox").collapsed = true; GetThreadTree().collapsed = false; gSearchBox.collapsed = false; var threadPaneSplitter = document.getElementById("threadpane-splitter"); threadPaneSplitter.collapsed = false; if (!threadPaneSplitter.hidden && threadPaneSplitter.getAttribute("state") != "collapsed") GetMessagePane().collapsed = false; gAccountCentralLoaded = false; } catch (ex) { dump("Error hiding AccountCentral page -> " + ex + "\n"); return; }}
|
|
debug("hideElement: hiding " + elementId);
|
function hideElement(elementId){ try { debug("hideElement: hiding " + elementId); document.getElementById(elementId).setAttribute("hidden", "true"); } catch (e) { dump("hideElement: Couldn't set hidden attribute on " + elementId + "\n"); }}
|
|
var goStartPageSeparator = document.getElementById('goStartPageSeparator');
|
var goStartPageSeparator = document.getElementById('goNextSeparator');
|
function HideMenus(){ var message_menuitem=document.getElementById('menu_showMessage'); if (message_menuitem) message_menuitem.setAttribute("hidden", "true"); var showSearchToolbar = document.getElementById('menu_showSearchToolbar'); if (showSearchToolbar) showSearchToolbar.setAttribute("hidden", "true"); var showSearch_showMessage_Separator = document.getElementById('menu_showSearch_showMessage_Separator'); if (showSearch_showMessage_Separator) showSearch_showMessage_Separator.setAttribute("hidden", "true"); var expandOrCollapseMenu = document.getElementById('menu_expandOrCollapse'); if (expandOrCollapseMenu) expandOrCollapseMenu.setAttribute("hidden", "true"); var renameFolderMenu = document.getElementById('menu_renameFolder'); if (renameFolderMenu) renameFolderMenu.setAttribute("hidden", "true"); var viewMessagesMenu = document.getElementById('viewMessagesMenu'); if (viewMessagesMenu) viewMessagesMenu.setAttribute("hidden", "true"); var viewMessageViewMenu = document.getElementById('viewMessageViewMenu'); if (viewMessageViewMenu) viewMessageViewMenu.setAttribute("hidden", "true"); var viewMessagesMenuSeparator = document.getElementById('viewMessagesMenuSeparator'); if (viewMessagesMenuSeparator) viewMessagesMenuSeparator.setAttribute("hidden", "true"); var openMessageMenu = document.getElementById('openMessageWindowMenuitem'); if (openMessageMenu) openMessageMenu.setAttribute("hidden", "true"); var viewSortMenu = document.getElementById('viewSortMenu'); if (viewSortMenu) viewSortMenu.setAttribute("hidden", "true"); var emptryTrashMenu = document.getElementById('menu_emptyTrash'); if (emptryTrashMenu) emptryTrashMenu.setAttribute("hidden", "true"); var menuProperties = document.getElementById('menu_properties'); if (menuProperties) menuProperties.setAttribute("hidden", "true"); var compactFolderMenu = document.getElementById('menu_compactFolder'); if (compactFolderMenu) compactFolderMenu.setAttribute("hidden", "true"); var trashSeparator = document.getElementById('trashMenuSeparator'); if (trashSeparator) trashSeparator.setAttribute("hidden", "true"); var goStartPageSeparator = document.getElementById('goStartPageSeparator'); if (goStartPageSeparator) goStartPageSeparator.hidden = true; var goStartPage = document.getElementById('goStartPage'); if (goStartPage) goStartPage.hidden = true;}
|
var showSearchToolbar = document.getElementById('menu_showSearchToolbar'); if(showSearchToolbar) showSearchToolbar.setAttribute("hidden", "true"); var showSearch_showMessage_Separator = document.getElementById('menu_showSearch_showMessage_Separator'); if(showSearch_showMessage_Separator) showSearch_showMessage_Separator.setAttribute("hidden", "true");
|
function HideMenus(){ var message_menuitem=document.getElementById('menu_showMessage'); if(message_menuitem) message_menuitem.setAttribute("hidden", "true"); var expandOrCollapseMenu = document.getElementById('menu_expandOrCollapse'); if(expandOrCollapseMenu) expandOrCollapseMenu.setAttribute("hidden", "true"); var renameFolderMenu = document.getElementById('menu_renameFolder'); if(renameFolderMenu) renameFolderMenu.setAttribute("hidden", "true"); var viewMessagesMenu = document.getElementById('viewMessagesMenu'); if(viewMessagesMenu) viewMessagesMenu.setAttribute("hidden", "true"); var openMessageMenu = document.getElementById('openMessageWindowMenuitem'); if(openMessageMenu) openMessageMenu.setAttribute("hidden", "true"); var viewSortMenu = document.getElementById('viewSortMenu'); if(viewSortMenu) viewSortMenu.setAttribute("hidden", "true"); var viewThreadedMenu = document.getElementById('menu_showThreads'); if(viewThreadedMenu) viewThreadedMenu.setAttribute("hidden", "true"); var emptryTrashMenu = document.getElementById('menu_emptyTrash'); if(emptryTrashMenu) emptryTrashMenu.setAttribute("hidden", "true"); var menuProperties = document.getElementById('menu_properties'); if(menuProperties) menuProperties.setAttribute("hidden", "true"); var compactFolderMenu = document.getElementById('menu_compactFolder'); if(compactFolderMenu) compactFolderMenu.setAttribute("hidden", "true"); var trashSeparator = document.getElementById('trashMenuSeparator'); if(trashSeparator) trashSeparator.setAttribute("hidden", "true");}
|
|
var renameFolderMenu = document.getElementById('menu_renameFolder'); if(renameFolderMenu) renameFolderMenu.setAttribute("hidden", "true");
|
function HideMenus(){ var message_menuitem=document.getElementById('menu_showMessage'); if(message_menuitem) message_menuitem.setAttribute("hidden", "true"); var expandOrCollapseMenu = document.getElementById('menu_expandOrCollapse'); if(expandOrCollapseMenu) expandOrCollapseMenu.setAttribute("hidden", "true");}
|
|
boxToHide.style.visibility = "collapse";
|
boxToHide.setAttribute("hidden", "true");
|
function hideShowSmtpSettings(smtpServer) { var noSmtpBox = document.getElementById("noSmtp"); var haveSmtpBox = document.getElementById("haveSmtp"); var boxToHide; var boxToShow; if (smtpServer && smtpServer.hostname && smtpServer.hostname != "") { // we have a hostname, so show the static text boxToShow = haveSmtpBox; boxToHide = noSmtpBox; } else { // no default hostname yet boxToShow = noSmtpBox; boxToHide = haveSmtpBox; } if (boxToHide) boxToHide.style.visibility = "collapse"; if (boxToShow) boxToShow.style.visibility = "visible";}
|
boxToShow.style.visibility = "visible";
|
boxToShow.removeAttribute("hidden");
|
function hideShowSmtpSettings(smtpServer) { var noSmtpBox = document.getElementById("noSmtp"); var haveSmtpBox = document.getElementById("haveSmtp"); var boxToHide; var boxToShow; if (smtpServer && smtpServer.hostname && smtpServer.hostname != "") { // we have a hostname, so show the static text boxToShow = haveSmtpBox; boxToHide = noSmtpBox; } else { // no default hostname yet boxToShow = noSmtpBox; boxToHide = haveSmtpBox; } if (boxToHide) boxToHide.style.visibility = "collapse"; if (boxToShow) boxToShow.style.visibility = "visible";}
|
document.getElementById("view_hidetoolbar").setAttribute("value", GetString("HideToolbar"));
|
document.getElementById("view_hidetoolbar").setAttribute("label", GetString("HideToolbar"));
|
function hideToolbar(){ // Check to see if toolbar is already hidden if (tHide){ // If it is show it document.getElementById("toolbar").setAttribute("collapsed", "false"); // Set the menu items text back to "Hide Toolbar" document.getElementById("view_hidetoolbar").setAttribute("value", GetString("HideToolbar")); tHide = false } else{ // If not hide it document.getElementById("toolbar").setAttribute("collapsed", "true"); //Set the menu items text to "Show Toolbar" document.getElementById("view_hidetoolbar").setAttribute("value", GetString("ShowToolbar")); tHide = true; }}
|
document.getElementById("view_hidetoolbar").setAttribute("value", GetString("ShowToolbar"));
|
document.getElementById("view_hidetoolbar").setAttribute("label", GetString("ShowToolbar"));
|
function hideToolbar(){ // Check to see if toolbar is already hidden if (tHide){ // If it is show it document.getElementById("toolbar").setAttribute("collapsed", "false"); // Set the menu items text back to "Hide Toolbar" document.getElementById("view_hidetoolbar").setAttribute("value", GetString("HideToolbar")); tHide = false } else{ // If not hide it document.getElementById("toolbar").setAttribute("collapsed", "true"); //Set the menu items text to "Show Toolbar" document.getElementById("view_hidetoolbar").setAttribute("value", GetString("ShowToolbar")); tHide = true; }}
|
defaultSet = defaultSet.replace(/mailviews-container/i, "");
|
function HideToolbarButtons(){ // How can we remove these two items from the palette as well? var mailToolbar = document.getElementById('mail-bar2'); if (mailToolbar) { var defaultSet = mailToolbar.getAttribute("defaultset"); defaultSet = defaultSet.replace(/search-container/i, ""); defaultSet = defaultSet.replace(/mailviews-container/i, ""); mailToolbar.setAttribute('defaultset', defaultSet); }}
|
|
var searchContainer = document.getElementById('search-container'); if (searchContainer) searchContainer.parentNode.removeChild(searchContainer); var toolbarPalette = document.getElementById('mail-toolbox').palette; toolbarPalette.removeChild(toolbarPalette.getElementsByAttribute('id', 'search-container')[0]); toolbarPalette.removeChild(toolbarPalette.getElementsByAttribute('id', 'mailviews-container')[0]); toolbarPalette.removeChild(toolbarPalette.getElementsByAttribute('id', 'folder-location-container')[0]);
|
function HideToolbarButtons(){ // How can we remove these two items from the palette as well? var mailToolbar = document.getElementById('mail-bar2'); if (mailToolbar) { var defaultSet = mailToolbar.getAttribute("defaultset"); defaultSet = defaultSet.replace(/search-container/i, ""); defaultSet = defaultSet.replace(/mailviews-container/i, ""); mailToolbar.setAttribute('defaultset', defaultSet); }}
|
|
imageEl.style.setProperty("-moz-opacity", "1.0", true);
|
imageEl.style.setProperty("opacity", "1.0", true);
|
function highContrast(){ if (highCont == true){ frameDoc.getElementById("bgDiv").style.background = "url('chrome://editor/skin/images/Map_checker.gif')"; frameDoc.getElementById("bgDiv").style.backgroundColor = "white"; imageEl.style.setProperty("-moz-opacity", "1.0", true); document.getElementById("Map:Contrast").setAttribute("checked", "false"); document.getElementById("Map:Contrast").setAttribute("toggled", "false"); highCont = false; } else{ frameDoc.getElementById("bgDiv").style.background = "url('')"; frameDoc.getElementById("bgDiv").style.backgroundColor = "#D2D2D2"; imageEl.style.setProperty("-moz-opacity", ".3", true); document.getElementById("Map:Contrast").setAttribute("checked", "true"); document.getElementById("Map:Contrast").setAttribute("toggled", "true"); highCont = true; }}
|
imageEl.style.setProperty("-moz-opacity", ".3", true);
|
imageEl.style.setProperty("opacity", ".3", true);
|
function highContrast(){ if (highCont == true){ frameDoc.getElementById("bgDiv").style.background = "url('chrome://editor/skin/images/Map_checker.gif')"; frameDoc.getElementById("bgDiv").style.backgroundColor = "white"; imageEl.style.setProperty("-moz-opacity", "1.0", true); document.getElementById("Map:Contrast").setAttribute("checked", "false"); document.getElementById("Map:Contrast").setAttribute("toggled", "false"); highCont = false; } else{ frameDoc.getElementById("bgDiv").style.background = "url('')"; frameDoc.getElementById("bgDiv").style.backgroundColor = "#D2D2D2"; imageEl.style.setProperty("-moz-opacity", ".3", true); document.getElementById("Map:Contrast").setAttribute("checked", "true"); document.getElementById("Map:Contrast").setAttribute("toggled", "true"); highCont = true; }}
|
GroupBy(gHistoryGrouping);
|
UpdateTreeGrouping();
|
function HistoryCommonInit(){ gHistoryTree = document.getElementById("historyTree"); gDeleteByHostname = document.getElementById("menu_deleteByHostname"); gDeleteByDomain = document.getElementById("menu_deleteByDomain"); gHistoryBundle = document.getElementById("historyBundle"); gHistoryStatus = document.getElementById("statusbar-display"); var treeController = new nsTreeController(gHistoryTree); var historyController = new nsHistoryController; gHistoryTree.controllers.appendController(historyController); if ("arguments" in window && window.arguments[0] && window.arguments.length >= 1) { // We have been supplied a resource URI to root the tree on var uri = window.arguments[0]; gHistoryTree.setAttribute("ref", uri); if (uri.substring(0,5) == "find:" && !(window.arguments.length > 1 && window.arguments[1] == "newWindow")) { // Update the windowtype so that future searches are directed // there and the window is not re-used for bookmarks. var windowNode = document.getElementById("history-window"); windowNode.setAttribute("windowtype", "history:searchresults"); windowNode.setAttribute("title", gHistoryBundle.getString("search_results_title")); } document.getElementById("groupingMenu").setAttribute("hidden", "true"); } else { gPrefService = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); try { gHistoryGrouping = gPrefService.getCharPref("browser.history.grouping"); } catch(e) { gHistoryGrouping = "day"; } GroupBy(gHistoryGrouping); if (gHistoryStatus) { // must be the window switch(gHistoryGrouping) { case "none": document.getElementById("groupByNone").setAttribute("checked", "true"); break; case "site": document.getElementById("groupBySite").setAttribute("checked", "true"); break; case "day": default: document.getElementById("groupByDay").setAttribute("checked", "true"); } } else { // must be the sidebar panel var pb = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch); var pbi = pb.QueryInterface(Components.interfaces.nsIPrefBranchInternal); pbi.addObserver("browser.history.grouping", groupObserver, false); } } SortInNewDirection(find_sort_direction(find_sort_column())); gHistoryTree.treeBoxObject.view.selection.select(0);}
|
if (gHistoryStatus) gHistoryTree.focus();
|
function HistoryCommonInit(){ gHistoryTree = document.getElementById("historyTree"); gDeleteByHostname = document.getElementById("menu_deleteByHostname"); gDeleteByDomain = document.getElementById("menu_deleteByDomain"); gHistoryBundle = document.getElementById("historyBundle"); gHistoryStatus = document.getElementById("statusbar-display"); var treeController = new nsTreeController(gHistoryTree); var historyController = new nsHistoryController; gHistoryTree.controllers.appendController(historyController); if ("arguments" in window && window.arguments[0] && window.arguments.length >= 1) { // We have been supplied a resource URI to root the tree on var uri = window.arguments[0]; gHistoryTree.setAttribute("ref", uri); if (uri.substring(0,5) == "find:" && !(window.arguments.length > 1 && window.arguments[1] == "newWindow")) { // Update the windowtype so that future searches are directed // there and the window is not re-used for bookmarks. var windowNode = document.getElementById("history-window"); windowNode.setAttribute("windowtype", "history:searchresults"); windowNode.setAttribute("title", gHistoryBundle.getString("search_results_title")); } document.getElementById("groupingMenu").setAttribute("hidden", "true"); } else { gPrefService = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); try { gHistoryGrouping = gPrefService.getCharPref("browser.history.grouping"); } catch(e) { gHistoryGrouping = "day"; } UpdateTreeGrouping(); if (gHistoryStatus) { // must be the window switch(gHistoryGrouping) { case "none": document.getElementById("groupByNone").setAttribute("checked", "true"); break; case "site": document.getElementById("groupBySite").setAttribute("checked", "true"); break; case "day": default: document.getElementById("groupByDay").setAttribute("checked", "true"); } } else { // must be the sidebar panel var pb = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch); var pbi = pb.QueryInterface(Components.interfaces.nsIPrefBranchInternal); pbi.addObserver("browser.history.grouping", groupObserver, false); } } SortInNewDirection(find_sort_direction(find_sort_column())); gHistoryTree.treeBoxObject.view.selection.select(0);}
|
|
if ("arguments" in window && window.arguments[0] && window.arguments.length >= 1) { var uri = window.arguments[0]; gHistoryTree.setAttribute("ref", uri); if (uri.substring(0,5) == "find:" && !(window.arguments.length > 1 && window.arguments[1] == "newWindow")) { var windowNode = document.getElementById("history-window"); windowNode.setAttribute("windowtype", "history:searchresults"); windowNode.setAttribute("title", gHistoryBundle.getString("search_results_title")); } document.getElementById("groupingMenu").setAttribute("hidden", "true"); } else { gPrefService = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); try { gHistoryGrouping = gPrefService.getCharPref("browser.history.grouping"); } catch(e) { gHistoryGrouping = "day"; } GroupBy(gHistoryGrouping); if (gHistoryStatus) { switch(gHistoryGrouping) { case "none": document.getElementById("groupByNone").setAttribute("checked", "true"); break; case "day": default: document.getElementById("groupByDay").setAttribute("checked", "true"); } } else { var pb = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch); var pbi = pb.QueryInterface(Components.interfaces.nsIPrefBranchInternal); pbi.addObserver("browser.history.grouping", groupObserver, false); } }
|
var mode = document.getElementById("viewButton").getAttribute("selectedsort"); if (mode == "site") document.getElementById("bysite").setAttribute("checked", "true"); else if (mode == "visited") document.getElementById("byvisited").setAttribute("checked", "true"); else document.getElementById("byday").setAttribute("checked", "true"); gHistoryTree.focus();
|
function HistoryCommonInit(){ gHistoryTree = document.getElementById("historyTree"); gDeleteByHostname = document.getElementById("menu_deleteByHostname"); gDeleteByDomain = document.getElementById("menu_deleteByDomain"); gHistoryBundle = document.getElementById("historyBundle"); gSearchBox = document.getElementById("search-box"); var treeController = new nsTreeController(gHistoryTree); if ("arguments" in window && window.arguments[0] && window.arguments.length >= 1) { // We have been supplied a resource URI to root the tree on var uri = window.arguments[0]; gHistoryTree.setAttribute("ref", uri); if (uri.substring(0,5) == "find:" && !(window.arguments.length > 1 && window.arguments[1] == "newWindow")) { // Update the windowtype so that future searches are directed // there and the window is not re-used for bookmarks. var windowNode = document.getElementById("history-window"); windowNode.setAttribute("windowtype", "history:searchresults"); windowNode.setAttribute("title", gHistoryBundle.getString("search_results_title")); } document.getElementById("groupingMenu").setAttribute("hidden", "true"); } else { gPrefService = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); try { gHistoryGrouping = gPrefService.getCharPref("browser.history.grouping"); } catch(e) { gHistoryGrouping = "day"; } GroupBy(gHistoryGrouping); if (gHistoryStatus) { // must be the window switch(gHistoryGrouping) { case "none": document.getElementById("groupByNone").setAttribute("checked", "true"); break; case "day": default: document.getElementById("groupByDay").setAttribute("checked", "true"); } } else { // must be the sidebar panel var pb = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch); var pbi = pb.QueryInterface(Components.interfaces.nsIPrefBranchInternal); pbi.addObserver("browser.history.grouping", groupObserver, false); } } gHistoryTree.treeBoxObject.view.selection.select(0);}
|
gPrefService = Components.classes["@mozilla.org/preferences;1"] .getService(Components.interfaces.nsIPref);
|
gPrefService = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch);
|
function HistoryInit(){ gHistoryOutliner = document.getElementById("historyOutliner"); gDeleteByHostname = document.getElementById("menu_deleteByHostname"); gDeleteByDomain = document.getElementById("menu_deleteByDomain"); gHistoryBundle = document.getElementById("historyBundle"); gHistoryStatus = document.getElementById("statusbar-display"); var outlinerController = new nsOutlinerController(gHistoryOutliner, document.getElementById('historyOutlinerBody')); var historyController = new nsHistoryController; gHistoryOutliner.controllers.appendController(historyController); if ("arguments" in window && window.arguments[0] && window.arguments.length >= 1) { // We have been supplied a resource URI to root the tree on var uri = window.arguments[0]; setRoot(uri); if (uri.substring(0,5) == "find:") { // Update the windowtype so that future searches are directed // there and the window is not re-used for bookmarks. var windowNode = document.getElementById("history-window"); windowNode.setAttribute("windowtype", "history:searchresults"); } document.getElementById("groupingMenu").setAttribute("hidden", "true"); } else { gPrefService = Components.classes["@mozilla.org/preferences;1"] .getService(Components.interfaces.nsIPref); try { var grouping = gPrefService.GetCharPref("browser.history.grouping"); } catch(e) { grouping = ""; } GroupBy(grouping); if (gHistoryStatus) { // must be the window switch(grouping) { case "site": document.getElementById("groupBySite").setAttribute("checked", "true"); break; case "none": document.getElementById("groupByNone").setAttribute("checked", "true"); break; case "day": default: document.getElementById("groupByDay").setAttribute("checked", "true"); } } } gHistoryOutliner.focus(); gHistoryOutliner.outlinerBoxObject.view.selection.select(0);}
|
var grouping = gPrefService.GetCharPref("browser.history.grouping");
|
var grouping = gPrefService.getCharPref("browser.history.grouping");
|
function HistoryInit(){ gHistoryOutliner = document.getElementById("historyOutliner"); gDeleteByHostname = document.getElementById("menu_deleteByHostname"); gDeleteByDomain = document.getElementById("menu_deleteByDomain"); gHistoryBundle = document.getElementById("historyBundle"); gHistoryStatus = document.getElementById("statusbar-display"); var outlinerController = new nsOutlinerController(gHistoryOutliner, document.getElementById('historyOutlinerBody')); var historyController = new nsHistoryController; gHistoryOutliner.controllers.appendController(historyController); if ("arguments" in window && window.arguments[0] && window.arguments.length >= 1) { // We have been supplied a resource URI to root the tree on var uri = window.arguments[0]; setRoot(uri); if (uri.substring(0,5) == "find:") { // Update the windowtype so that future searches are directed // there and the window is not re-used for bookmarks. var windowNode = document.getElementById("history-window"); windowNode.setAttribute("windowtype", "history:searchresults"); } document.getElementById("groupingMenu").setAttribute("hidden", "true"); } else { gPrefService = Components.classes["@mozilla.org/preferences;1"] .getService(Components.interfaces.nsIPref); try { var grouping = gPrefService.GetCharPref("browser.history.grouping"); } catch(e) { grouping = ""; } GroupBy(grouping); if (gHistoryStatus) { // must be the window switch(grouping) { case "site": document.getElementById("groupBySite").setAttribute("checked", "true"); break; case "none": document.getElementById("groupByNone").setAttribute("checked", "true"); break; case "day": default: document.getElementById("groupByDay").setAttribute("checked", "true"); } } } gHistoryOutliner.focus(); gHistoryOutliner.outlinerBoxObject.view.selection.select(0);}
|
if (!gHistoryStatus) { var currentIndex = gHistoryTree.currentIndex;
|
if (!gHistoryStatus && aEvent.button == 0) {
|
function historyOnClick(aEvent){ // This is kind of a hack but matches the currently implemented behaviour. // If a status bar is not present, assume we're in sidebar mode, and thus single clicks on containers // will open the container. Single clicks on non-containers are handled below in historyOnSelect. if (!gHistoryStatus) { var currentIndex = gHistoryTree.currentIndex; var row = { }; var col = { }; var elt = { }; gHistoryTree.treeBoxObject.getCellAt(aEvent.clientX, aEvent.clientY, row, col, elt); if (row.value >= 0 && isContainer(gHistoryTree, row.value)) gHistoryTree.treeBoxObject.view.toggleOpenState(row.value); }}
|
if (row.value >= 0 && isContainer(gHistoryTree, row.value))
|
if (row.value >= 0 && col.value && elt.value != "twisty" && isContainer(gHistoryTree, row.value))
|
function historyOnClick(aEvent){ // This is kind of a hack but matches the currently implemented behaviour. // If a status bar is not present, assume we're in sidebar mode, and thus single clicks on containers // will open the container. Single clicks on non-containers are handled below in historyOnSelect. if (!gHistoryStatus) { var currentIndex = gHistoryTree.currentIndex; var row = { }; var col = { }; var elt = { }; gHistoryTree.treeBoxObject.getCellAt(aEvent.clientX, aEvent.clientY, row, col, elt); if (row.value >= 0 && isContainer(gHistoryTree, row.value)) gHistoryTree.treeBoxObject.view.toggleOpenState(row.value); }}
|
OpenURL(false);
|
OpenURL("current");
|
function historyOnClick(aEvent){ // This is kind of a hack but matches the currently implemented behaviour. // If a status bar is not present, assume we're in sidebar mode, and thus single clicks on containers // will open the container. Single clicks on non-containers are handled below in historyOnSelect. if (!gHistoryStatus && aEvent.button == 0) { var row = { }; var col = { }; var elt = { }; gHistoryTree.treeBoxObject.getCellAt(aEvent.clientX, aEvent.clientY, row, col, elt); if (row.value >= 0 && col.value) { if (!isContainer(gHistoryTree, row.value)) OpenURL(false); else if (elt.value != "twisty") gHistoryTree.treeBoxObject.view.toggleOpenState(row.value); } }}
|
var url = rowIsContainer ? gHistoryTree.treeBoxObject.view.getCellText(currentIndex, "URL") : null;
|
var url = rowIsContainer ? "" : gHistoryTree.treeBoxObject.view.getCellText(currentIndex, "URL");
|
function historyOnSelect(){ // every time selection changes, save the last hostname gLastHostname = ""; gLastDomain = ""; var match; var currentIndex = gHistoryTree.currentIndex; var rowIsContainer = gHistoryGrouping != "none" && currentIndex >= 0 && isContainer(gHistoryTree, currentIndex); var url = rowIsContainer ? gHistoryTree.treeBoxObject.view.getCellText(currentIndex, "URL") : null; if (url) { // matches scheme://(hostname)... match = url.match(/^.*?:\/\/(?:([^\/:]*)(?::([^\/:]*))?@)?([^\/:]*)(?::([^\/:]*))?(.*)$/); if (match && match.length>1) gLastHostname = match[3]; gHistoryStatus.label = url; } else { gHistoryStatus.label = ""; } if (gLastHostname) { // matches the last foo.bar in foo.bar or baz.foo.bar match = gLastHostname.match(/([^.]+\.[^.]+$)/); if (match) gLastDomain = match[1]; } document.commandDispatcher.updateCommands("select");}
|
match = url.match(/^.*?:\/\/(?:([^\/:]*)(?::([^\/:]*))?@)?([^\/:]*)(?::([^\/:]*))?(.*)$/); if (match && match.length>1) gLastHostname = match[3]; gHistoryStatus.label = url; } else { gHistoryStatus.label = "";
|
if (!gIOService) gIOService = Components.classes['@mozilla.org/network/io-service;1'] .getService(Components.interfaces.nsIIOService); try { gLastHostname = gIOService.newURI(url, null, null).host; match = gLastHostname.match(/([^.]+\.[^.]+$)/); if (match) gLastDomain = match[1]; } catch (e) {}
|
function historyOnSelect(){ // every time selection changes, save the last hostname gLastHostname = ""; gLastDomain = ""; var match; var currentIndex = gHistoryTree.currentIndex; var rowIsContainer = gHistoryGrouping != "none" && currentIndex >= 0 && isContainer(gHistoryTree, currentIndex); var url = rowIsContainer ? gHistoryTree.treeBoxObject.view.getCellText(currentIndex, "URL") : null; if (url) { // matches scheme://(hostname)... match = url.match(/^.*?:\/\/(?:([^\/:]*)(?::([^\/:]*))?@)?([^\/:]*)(?::([^\/:]*))?(.*)$/); if (match && match.length>1) gLastHostname = match[3]; gHistoryStatus.label = url; } else { gHistoryStatus.label = ""; } if (gLastHostname) { // matches the last foo.bar in foo.bar or baz.foo.bar match = gLastHostname.match(/([^.]+\.[^.]+$)/); if (match) gLastDomain = match[1]; } document.commandDispatcher.updateCommands("select");}
|
if (gLastHostname) { match = gLastHostname.match(/([^.]+\.[^.]+$)/); if (match) gLastDomain = match[1]; }
|
if (gHistoryStatus) gHistoryStatus.label = url;
|
function historyOnSelect(){ // every time selection changes, save the last hostname gLastHostname = ""; gLastDomain = ""; var match; var currentIndex = gHistoryTree.currentIndex; var rowIsContainer = gHistoryGrouping != "none" && currentIndex >= 0 && isContainer(gHistoryTree, currentIndex); var url = rowIsContainer ? gHistoryTree.treeBoxObject.view.getCellText(currentIndex, "URL") : null; if (url) { // matches scheme://(hostname)... match = url.match(/^.*?:\/\/(?:([^\/:]*)(?::([^\/:]*))?@)?([^\/:]*)(?::([^\/:]*))?(.*)$/); if (match && match.length>1) gLastHostname = match[3]; gHistoryStatus.label = url; } else { gHistoryStatus.label = ""; } if (gLastHostname) { // matches the last foo.bar in foo.bar or baz.foo.bar match = gLastHostname.match(/([^.]+\.[^.]+$)/); if (match) gLastDomain = match[1]; } document.commandDispatcher.updateCommands("select");}
|
}
|
function hookScriptSealed (e){ if (!("componentPath" in console)) { var ary = e.scriptInstance.url.match (/(.*)venkman-service\.js$/); if (ary) console.componentPath = ary[1]; } for (var fbp in console.fbreaks) { if (console.fbreaks[fbp].enabled && e.scriptInstance.url.search(console.fbreaks[fbp].url) != -1) { e.scriptInstance.setBreakpoint(console.fbreaks[fbp].lineNumber, console.fbreaks[fbp]); } }}
|
|
function hostNameIsIPAddress(aHostName, aUnobscuredHostName) {
|
hostNameIsIPAddress: function(aHostName, aUnobscuredHostName) { var index;
|
function hostNameIsIPAddress(aHostName, aUnobscuredHostName){ // TODO: Add Support for IPv6 var index; // scammers frequently obscure the IP address by encoding each component as octal, hex // or in some cases a mix match of each. The IP address could also be represented as a DWORD. // break the IP address down into individual components. var ipComponents = aHostName.split("."); // if we didn't find at least 4 parts to our IP address it either isn't a numerical IP // or it is encoded as a dword if (ipComponents.length < 4) { // Convert to a binary to test for possible DWORD. var binaryDword = parseInt(aHostName).toString(2); if (isNaN(binaryDword)) return false; // convert the dword into its component IP parts. ipComponents = new Array; ipComponents[0] = (aHostName >> 24) & 255; ipComponents[1] = (aHostName >> 16) & 255; ipComponents[2] = (aHostName >> 8) & 255; ipComponents[3] = (aHostName & 255); } else { for (index = 0; index < ipComponents.length; ++index) { // by leaving the radix parameter blank, we can handle IP addresses // where one component is hex, another is octal, etc. ipComponents[index] = parseInt(ipComponents[index]); } } // make sure each part of the IP address is in fact a number for (index = 0; index < ipComponents.length; ++index) if (isNaN(ipComponents[index])) // if any part of the IP address is not a number, then we can safely return return false; var hostName = ipComponents[0] + '.' + ipComponents[1] + '.' + ipComponents[2] + '.' + ipComponents[3]; // only set aUnobscuredHostName if we are looking at an IPv4 host name if (isIPv4HostName(hostName)) { aUnobscuredHostName.value = hostName; return true; } return false;}
|
var index;
|
function hostNameIsIPAddress(aHostName, aUnobscuredHostName){ // TODO: Add Support for IPv6 var index; // scammers frequently obscure the IP address by encoding each component as octal, hex // or in some cases a mix match of each. The IP address could also be represented as a DWORD. // break the IP address down into individual components. var ipComponents = aHostName.split("."); // if we didn't find at least 4 parts to our IP address it either isn't a numerical IP // or it is encoded as a dword if (ipComponents.length < 4) { // Convert to a binary to test for possible DWORD. var binaryDword = parseInt(aHostName).toString(2); if (isNaN(binaryDword)) return false; // convert the dword into its component IP parts. ipComponents = new Array; ipComponents[0] = (aHostName >> 24) & 255; ipComponents[1] = (aHostName >> 16) & 255; ipComponents[2] = (aHostName >> 8) & 255; ipComponents[3] = (aHostName & 255); } else { for (index = 0; index < ipComponents.length; ++index) { // by leaving the radix parameter blank, we can handle IP addresses // where one component is hex, another is octal, etc. ipComponents[index] = parseInt(ipComponents[index]); } } // make sure each part of the IP address is in fact a number for (index = 0; index < ipComponents.length; ++index) if (isNaN(ipComponents[index])) // if any part of the IP address is not a number, then we can safely return return false; var hostName = ipComponents[0] + '.' + ipComponents[1] + '.' + ipComponents[2] + '.' + ipComponents[3]; // only set aUnobscuredHostName if we are looking at an IPv4 host name if (isIPv4HostName(hostName)) { aUnobscuredHostName.value = hostName; return true; } return false;}
|
|
var ipComponents = aHostName.split(".");
|
function hostNameIsIPAddress(aHostName, aUnobscuredHostName){ // TODO: Add Support for IPv6 var index; // scammers frequently obscure the IP address by encoding each component as octal, hex // or in some cases a mix match of each. The IP address could also be represented as a DWORD. // break the IP address down into individual components. var ipComponents = aHostName.split("."); // if we didn't find at least 4 parts to our IP address it either isn't a numerical IP // or it is encoded as a dword if (ipComponents.length < 4) { // Convert to a binary to test for possible DWORD. var binaryDword = parseInt(aHostName).toString(2); if (isNaN(binaryDword)) return false; // convert the dword into its component IP parts. ipComponents = new Array; ipComponents[0] = (aHostName >> 24) & 255; ipComponents[1] = (aHostName >> 16) & 255; ipComponents[2] = (aHostName >> 8) & 255; ipComponents[3] = (aHostName & 255); } else { for (index = 0; index < ipComponents.length; ++index) { // by leaving the radix parameter blank, we can handle IP addresses // where one component is hex, another is octal, etc. ipComponents[index] = parseInt(ipComponents[index]); } } // make sure each part of the IP address is in fact a number for (index = 0; index < ipComponents.length; ++index) if (isNaN(ipComponents[index])) // if any part of the IP address is not a number, then we can safely return return false; var hostName = ipComponents[0] + '.' + ipComponents[1] + '.' + ipComponents[2] + '.' + ipComponents[3]; // only set aUnobscuredHostName if we are looking at an IPv4 host name if (isIPv4HostName(hostName)) { aUnobscuredHostName.value = hostName; return true; } return false;}
|
|
var ipComponents = aHostName.split(".");
|
if (ipComponents.length < 4) { var binaryDword = parseInt(aHostName).toString(2); if (isNaN(binaryDword)) return false;
|
function hostNameIsIPAddress(aHostName, aUnobscuredHostName){ // TODO: Add Support for IPv6 var index; // scammers frequently obscure the IP address by encoding each component as octal, hex // or in some cases a mix match of each. The IP address could also be represented as a DWORD. // break the IP address down into individual components. var ipComponents = aHostName.split("."); // if we didn't find at least 4 parts to our IP address it either isn't a numerical IP // or it is encoded as a dword if (ipComponents.length < 4) { // Convert to a binary to test for possible DWORD. var binaryDword = parseInt(aHostName).toString(2); if (isNaN(binaryDword)) return false; // convert the dword into its component IP parts. ipComponents = new Array; ipComponents[0] = (aHostName >> 24) & 255; ipComponents[1] = (aHostName >> 16) & 255; ipComponents[2] = (aHostName >> 8) & 255; ipComponents[3] = (aHostName & 255); } else { for (index = 0; index < ipComponents.length; ++index) { // by leaving the radix parameter blank, we can handle IP addresses // where one component is hex, another is octal, etc. ipComponents[index] = parseInt(ipComponents[index]); } } // make sure each part of the IP address is in fact a number for (index = 0; index < ipComponents.length; ++index) if (isNaN(ipComponents[index])) // if any part of the IP address is not a number, then we can safely return return false; var hostName = ipComponents[0] + '.' + ipComponents[1] + '.' + ipComponents[2] + '.' + ipComponents[3]; // only set aUnobscuredHostName if we are looking at an IPv4 host name if (isIPv4HostName(hostName)) { aUnobscuredHostName.value = hostName; return true; } return false;}
|
if (ipComponents.length < 4) { var binaryDword = parseInt(aHostName).toString(2); if (isNaN(binaryDword)) return false;
|
ipComponents = new Array; ipComponents[0] = (aHostName >> 24) & 255; ipComponents[1] = (aHostName >> 16) & 255; ipComponents[2] = (aHostName >> 8) & 255; ipComponents[3] = (aHostName & 255); } else { for (index = 0; index < ipComponents.length; ++index) { ipComponents[index] = parseInt(ipComponents[index]); } }
|
function hostNameIsIPAddress(aHostName, aUnobscuredHostName){ // TODO: Add Support for IPv6 var index; // scammers frequently obscure the IP address by encoding each component as octal, hex // or in some cases a mix match of each. The IP address could also be represented as a DWORD. // break the IP address down into individual components. var ipComponents = aHostName.split("."); // if we didn't find at least 4 parts to our IP address it either isn't a numerical IP // or it is encoded as a dword if (ipComponents.length < 4) { // Convert to a binary to test for possible DWORD. var binaryDword = parseInt(aHostName).toString(2); if (isNaN(binaryDword)) return false; // convert the dword into its component IP parts. ipComponents = new Array; ipComponents[0] = (aHostName >> 24) & 255; ipComponents[1] = (aHostName >> 16) & 255; ipComponents[2] = (aHostName >> 8) & 255; ipComponents[3] = (aHostName & 255); } else { for (index = 0; index < ipComponents.length; ++index) { // by leaving the radix parameter blank, we can handle IP addresses // where one component is hex, another is octal, etc. ipComponents[index] = parseInt(ipComponents[index]); } } // make sure each part of the IP address is in fact a number for (index = 0; index < ipComponents.length; ++index) if (isNaN(ipComponents[index])) // if any part of the IP address is not a number, then we can safely return return false; var hostName = ipComponents[0] + '.' + ipComponents[1] + '.' + ipComponents[2] + '.' + ipComponents[3]; // only set aUnobscuredHostName if we are looking at an IPv4 host name if (isIPv4HostName(hostName)) { aUnobscuredHostName.value = hostName; return true; } return false;}
|
ipComponents = new Array; ipComponents[0] = (aHostName >> 24) & 255; ipComponents[1] = (aHostName >> 16) & 255; ipComponents[2] = (aHostName >> 8) & 255; ipComponents[3] = (aHostName & 255); } else {
|
function hostNameIsIPAddress(aHostName, aUnobscuredHostName){ // TODO: Add Support for IPv6 var index; // scammers frequently obscure the IP address by encoding each component as octal, hex // or in some cases a mix match of each. The IP address could also be represented as a DWORD. // break the IP address down into individual components. var ipComponents = aHostName.split("."); // if we didn't find at least 4 parts to our IP address it either isn't a numerical IP // or it is encoded as a dword if (ipComponents.length < 4) { // Convert to a binary to test for possible DWORD. var binaryDword = parseInt(aHostName).toString(2); if (isNaN(binaryDword)) return false; // convert the dword into its component IP parts. ipComponents = new Array; ipComponents[0] = (aHostName >> 24) & 255; ipComponents[1] = (aHostName >> 16) & 255; ipComponents[2] = (aHostName >> 8) & 255; ipComponents[3] = (aHostName & 255); } else { for (index = 0; index < ipComponents.length; ++index) { // by leaving the radix parameter blank, we can handle IP addresses // where one component is hex, another is octal, etc. ipComponents[index] = parseInt(ipComponents[index]); } } // make sure each part of the IP address is in fact a number for (index = 0; index < ipComponents.length; ++index) if (isNaN(ipComponents[index])) // if any part of the IP address is not a number, then we can safely return return false; var hostName = ipComponents[0] + '.' + ipComponents[1] + '.' + ipComponents[2] + '.' + ipComponents[3]; // only set aUnobscuredHostName if we are looking at an IPv4 host name if (isIPv4HostName(hostName)) { aUnobscuredHostName.value = hostName; return true; } return false;}
|
|
ipComponents[index] = parseInt(ipComponents[index]);
|
aUnobscuredHostName.value = hostName; return true;
|
function hostNameIsIPAddress(aHostName, aUnobscuredHostName){ // TODO: Add Support for IPv6 var index; // scammers frequently obscure the IP address by encoding each component as octal, hex // or in some cases a mix match of each. The IP address could also be represented as a DWORD. // break the IP address down into individual components. var ipComponents = aHostName.split("."); // if we didn't find at least 4 parts to our IP address it either isn't a numerical IP // or it is encoded as a dword if (ipComponents.length < 4) { // Convert to a binary to test for possible DWORD. var binaryDword = parseInt(aHostName).toString(2); if (isNaN(binaryDword)) return false; // convert the dword into its component IP parts. ipComponents = new Array; ipComponents[0] = (aHostName >> 24) & 255; ipComponents[1] = (aHostName >> 16) & 255; ipComponents[2] = (aHostName >> 8) & 255; ipComponents[3] = (aHostName & 255); } else { for (index = 0; index < ipComponents.length; ++index) { // by leaving the radix parameter blank, we can handle IP addresses // where one component is hex, another is octal, etc. ipComponents[index] = parseInt(ipComponents[index]); } } // make sure each part of the IP address is in fact a number for (index = 0; index < ipComponents.length; ++index) if (isNaN(ipComponents[index])) // if any part of the IP address is not a number, then we can safely return return false; var hostName = ipComponents[0] + '.' + ipComponents[1] + '.' + ipComponents[2] + '.' + ipComponents[3]; // only set aUnobscuredHostName if we are looking at an IPv4 host name if (isIPv4HostName(hostName)) { aUnobscuredHostName.value = hostName; return true; } return false;}
|
} for (index = 0; index < ipComponents.length; ++index) if (isNaN(ipComponents[index])) return false; var hostName = ipComponents[0] + '.' + ipComponents[1] + '.' + ipComponents[2] + '.' + ipComponents[3]; if (isIPv4HostName(hostName)) { aUnobscuredHostName.value = hostName; return true; } return false; }
|
return false; },
|
function hostNameIsIPAddress(aHostName, aUnobscuredHostName){ // TODO: Add Support for IPv6 var index; // scammers frequently obscure the IP address by encoding each component as octal, hex // or in some cases a mix match of each. The IP address could also be represented as a DWORD. // break the IP address down into individual components. var ipComponents = aHostName.split("."); // if we didn't find at least 4 parts to our IP address it either isn't a numerical IP // or it is encoded as a dword if (ipComponents.length < 4) { // Convert to a binary to test for possible DWORD. var binaryDword = parseInt(aHostName).toString(2); if (isNaN(binaryDword)) return false; // convert the dword into its component IP parts. ipComponents = new Array; ipComponents[0] = (aHostName >> 24) & 255; ipComponents[1] = (aHostName >> 16) & 255; ipComponents[2] = (aHostName >> 8) & 255; ipComponents[3] = (aHostName & 255); } else { for (index = 0; index < ipComponents.length; ++index) { // by leaving the radix parameter blank, we can handle IP addresses // where one component is hex, another is octal, etc. ipComponents[index] = parseInt(ipComponents[index]); } } // make sure each part of the IP address is in fact a number for (index = 0; index < ipComponents.length; ++index) if (isNaN(ipComponents[index])) // if any part of the IP address is not a number, then we can safely return return false; var hostName = ipComponents[0] + '.' + ipComponents[1] + '.' + ipComponents[2] + '.' + ipComponents[3]; // only set aUnobscuredHostName if we are looking at an IPv4 host name if (isIPv4HostName(hostName)) { aUnobscuredHostName.value = hostName; return true; } return false;}
|
for (index = 0; index < ipComponents.length; index++)
|
for (index = 0; index < ipComponents.length; ++index)
|
function hostNameIsIPAddress(aHostName, aUnobscuredHostName){ // TODO: Add Support for IPv6 var index; // scammers frequently obscure the IP address by encoding each component as octal, hex // or in some cases a mix match of each. The IP address could also be represented as a DWORD. // break the IP address down into individual components. var ipComponents = aHostName.split("."); // if we didn't find at least 4 parts to our IP address it either isn't a numerical IP // or it is encoded as a dword if (ipComponents.length < 4) { // Convert to a binary to test for possible DWORD. var binaryDword = parseInt(aHostName).toString(2); if (isNaN(binaryDword)) return false; // convert the dword into its component IP parts. ipComponents = [ (aHostName >> 24) & 255, (aHostName >> 16) & 255, (aHostName >> 8) & 255, (aHostName & 255) ]; } else { for (index = 0; index < ipComponents.length; index++) { // by leaving the radix parameter blank, we can handle IP addresses // where one component is hex, another is octal, etc. ipComponents[index] = parseInt(ipComponents[index]); } } // make sure each part of the IP address is in fact a number for (index = 0; index < ipComponents.length; index++) if (isNaN(ipComponents[index])) // if any part of the IP address is not a number, then we can safely return return false; // only set aUnobscuredHostName if we are looking at an IPv4 host name var hostName = ipComponents.join("."); if (isIPv4HostName(hostName)) { aUnobscuredHostName.value = hostName; return true; } return false;}
|
linkNode = event.originalTarget;
|
function hrefForClickEvent(event) { var target = event.target; var linkNode; var isKeyPress = (event.type == "keypress"); if ( target instanceof HTMLAnchorElement || target instanceof HTMLAreaElement || target instanceof HTMLLinkElement ) { if (target.hasAttribute("href")) linkNode = target; } else if ( target instanceof HTMLInputElement && (event.target.type == "text") // text field && !isKeyPress // not a key event && event.detail == 2 // double click && event.button == 0 // left mouse button && event.target.value.length == 0 // no text has been entered && "@mozilla.org/wallet/wallet-service;1" in Components.classes // wallet is available ) { prefillTextBox(target); // prefill the empty text field if possible } else { while (linkNode && !(linkNode instanceof HTMLAnchorElement)) linkNode = linkNode.parentNode; // <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; } var href; if (linkNode) { href = new XPCNativeWrapper(linkNode, "href").href; } else { // Try simple XLink 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 && href != "") { var baseURI = new XPCNativeWrapper(linkNode, "baseURI").baseURI; href = makeURLAbsolute(baseURI, href); } } return href; }
|
|
&& event.target.value.length == 0) {
|
&& event.target.value.length == 0 && "@mozilla.org/wallet/wallet-service;1" in Components.classes ) {
|
function hrefForClickEvent(event) { var target = event.target; var linkNode; var local_name = target.localName; if (local_name) { local_name = local_name.toLowerCase(); } var isKeyPress = (event.type == "keypress"); switch (local_name) { case "a": case "area": case "link": if (target.hasAttribute("href")) linkNode = target; break; case "input": if ((event.target.type == "text") // text field && !isKeyPress // not a key event && 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"); // <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; } var href; if (linkNode) { href = new XPCNativeWrapper(linkNode, "href").href; } else { // Try simple XLink 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 && href != "") { var baseURI = new XPCNativeWrapper(linkNode, "baseURI").baseURI; href = makeURLAbsolute(baseURI, href); } } return href; }
|
var local_name = target.localName; if (local_name) { local_name = local_name.toLowerCase(); }
|
function hrefForClickEvent(event) { var target = event.target; var linkNode; var local_name = target.localName; if (local_name) { local_name = local_name.toLowerCase(); } var isKeyPress = (event.type == "keypress"); switch (local_name) { case "a": case "area": case "link": if (target.hasAttribute("href")) linkNode = target; break; case "input": if ((event.target.type == "text") // text field && !isKeyPress // not a key event && event.detail == 2 // double click && event.button == 0 // left mouse button && event.target.value.length == 0 // no text has been entered && "@mozilla.org/wallet/wallet-service;1" in Components.classes // wallet is available ) { prefillTextBox(target); // prefill the empty text field if possible } 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; } var href; if (linkNode) { href = new XPCNativeWrapper(linkNode, "href").href; } else { // Try simple XLink 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 && href != "") { var baseURI = new XPCNativeWrapper(linkNode, "baseURI").baseURI; href = makeURLAbsolute(baseURI, href); } } return href; }
|
|
switch (local_name) { case "a": case "area": case "link": if (target.hasAttribute("href")) linkNode = target; break; case "input": if ((event.target.type == "text")
|
if ( target instanceof HTMLAnchorElement || target instanceof HTMLAreaElement || target instanceof HTMLLinkElement ) { if (target.hasAttribute("href")) linkNode = target; } else if ( target instanceof HTMLInputElement && (event.target.type == "text")
|
function hrefForClickEvent(event) { var target = event.target; var linkNode; var local_name = target.localName; if (local_name) { local_name = local_name.toLowerCase(); } var isKeyPress = (event.type == "keypress"); switch (local_name) { case "a": case "area": case "link": if (target.hasAttribute("href")) linkNode = target; break; case "input": if ((event.target.type == "text") // text field && !isKeyPress // not a key event && event.detail == 2 // double click && event.button == 0 // left mouse button && event.target.value.length == 0 // no text has been entered && "@mozilla.org/wallet/wallet-service;1" in Components.classes // wallet is available ) { prefillTextBox(target); // prefill the empty text field if possible } 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; } var href; if (linkNode) { href = new XPCNativeWrapper(linkNode, "href").href; } else { // Try simple XLink 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 && href != "") { var baseURI = new XPCNativeWrapper(linkNode, "baseURI").baseURI; href = makeURLAbsolute(baseURI, href); } } return href; }
|
) { prefillTextBox(target); } break; default: linkNode = findParentNode(event.originalTarget, "a"); if (linkNode && !linkNode.hasAttribute("href")) linkNode = null; break;
|
) { prefillTextBox(target); } else { linkNode = findParentNode(event.originalTarget, "a"); if (linkNode && !linkNode.hasAttribute("href")) linkNode = null;
|
function hrefForClickEvent(event) { var target = event.target; var linkNode; var local_name = target.localName; if (local_name) { local_name = local_name.toLowerCase(); } var isKeyPress = (event.type == "keypress"); switch (local_name) { case "a": case "area": case "link": if (target.hasAttribute("href")) linkNode = target; break; case "input": if ((event.target.type == "text") // text field && !isKeyPress // not a key event && event.detail == 2 // double click && event.button == 0 // left mouse button && event.target.value.length == 0 // no text has been entered && "@mozilla.org/wallet/wallet-service;1" in Components.classes // wallet is available ) { prefillTextBox(target); // prefill the empty text field if possible } 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; } var href; if (linkNode) { href = new XPCNativeWrapper(linkNode, "href").href; } else { // Try simple XLink 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 && href != "") { var baseURI = new XPCNativeWrapper(linkNode, "baseURI").baseURI; href = makeURLAbsolute(baseURI, href); } } return href; }
|
href = linkNode.href;
|
href = new XPCNativeWrapper(linkNode, "href").href;
|
function hrefForClickEvent(event) { var target = event.target; var linkNode; var local_name = target.localName; if (local_name) { local_name = local_name.toLowerCase(); } var isKeyPress = (event.type == "keypress"); switch (local_name) { case "a": case "area": case "link": if (target.hasAttribute("href")) linkNode = target; break; case "input": if ((event.target.type == "text") // text field && !isKeyPress // not a key event && 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"); // <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; } var href; if (linkNode) { href = linkNode.href; } else { // Try simple XLink 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); } } return href; }
|
href = linkNode.getAttributeNS("http:
|
var wrapper = new XPCNativeWrapper(linkNode, "getAttributeNS()"); href = wrapper.getAttributeNS("http:
|
function hrefForClickEvent(event) { var target = event.target; var linkNode; var local_name = target.localName; if (local_name) { local_name = local_name.toLowerCase(); } var isKeyPress = (event.type == "keypress"); switch (local_name) { case "a": case "area": case "link": if (target.hasAttribute("href")) linkNode = target; break; case "input": if ((event.target.type == "text") // text field && !isKeyPress // not a key event && 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"); // <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; } var href; if (linkNode) { href = linkNode.href; } else { // Try simple XLink 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); } } return href; }
|
href = makeURLAbsolute(target.baseURI,href);
|
var baseURI = new XPCNativeWrapper(linkNode, "baseURI").baseURI; href = makeURLAbsolute(baseURI, href);
|
function hrefForClickEvent(event) { var target = event.target; var linkNode; var local_name = target.localName; if (local_name) { local_name = local_name.toLowerCase(); } var isKeyPress = (event.type == "keypress"); switch (local_name) { case "a": case "area": case "link": if (target.hasAttribute("href")) linkNode = target; break; case "input": if ((event.target.type == "text") // text field && !isKeyPress // not a key event && 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"); // <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; } var href; if (linkNode) { href = linkNode.href; } else { // Try simple XLink 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); } } return href; }
|
this.mChannel = null;
|
function httpHooks() {}
|
|
var octetArray = ""; var scriptableInputStream = Components.classes["@mozilla.org/scriptableinputstream;1"] .createInstance(Components.interfaces.nsIScriptableInputStream); scriptableInputStream.init(aStream); octetArray = scriptableInputStream.read(-1);
|
var octetArray = []; var binaryInputStream = Components.classes["@mozilla.org/binaryinputstream;1"] .createInstance(Components.interfaces.nsIBinaryInputStream); binaryInputStream.setInputStream(aStream); octetArray = binaryInputStream.readByteArray(binaryInputStream.available());
|
function ics_importFromStream(aStream, aCount) { var items = new Array(); // Read in the string. Note that it isn't a real string at this point, because // likely, the file is utf8. The multibyte chars show up as multiple 'chars' // in this string. So call it an array of octets for now. var octetArray = ""; var scriptableInputStream = Components.classes["@mozilla.org/scriptableinputstream;1"] .createInstance(Components.interfaces.nsIScriptableInputStream); scriptableInputStream.init(aStream); octetArray = scriptableInputStream.read(-1); // Some other apps (most notably, sunbird 0.2) happily splits an utf8 character // between the octets, and adds a newline and space between them, for ics // folding. Unfold manually before parsing the file as utf8. // This is utf8 safe, because octets with the first bit 0 are always one-octet // characters. So the space or the newline never can be part of a multi-byte // char. octetArray = octetArray.replace(/\n /, ""); // Interpret the byte-array as an utf8 string, and convert into a // javascript string. var unicodeConverter = Components.classes["@mozilla.org/intl/scriptableunicodeconverter"] .createInstance(Components.interfaces.nsIScriptableUnicodeConverter); // ics files are always utf8 unicodeConverter.charset = "UTF-8"; var str = unicodeConverter.ConvertFromUnicode(octetArray); icssrv = Components.classes["@mozilla.org/calendar/ics-service;1"] .getService(Components.interfaces.calIICSService); var rootComp = icssrv.parseICS(str); var calComp; // libical returns the vcalendar component if there is just // one vcalendar. If there are multiple vcalendars, it returns // an xroot component, with those vcalendar childs. We need to // handle both. if (rootComp.componentType == 'VCALENDAR') { calComp = rootComp; } else { calComp = rootComp.getFirstSubcomponent('VCALENDAR'); } while (calComp) { var subComp = calComp.getFirstSubcomponent("ANY"); while (subComp) { switch (subComp.componentType) { case "VEVENT": var event = Components.classes["@mozilla.org/calendar/event;1"] .createInstance(Components.interfaces.calIEvent); event.icalComponent = subComp; items.push(event); break; case "VTODO": var todo = Components.classes["@mozilla.org/calendar/todo;1"] .createInstance(Components.interfaces.calITodo); todo.icalComponent = subComp; items.push(todo); break; default: // Nothing } subComp = calComp.getNextSubcomponent("ANY"); } calComp = rootComp.getNextSubcomponent('VCALENDAR'); } aCount.value = items.length; return items;};
|
octetArray = octetArray.replace(/\n /, "");
|
for (var i=octetArray.length-2; i>=0; i--) { if (octetArray[i] == "\n" && octetArray[i+1] == " ") { octetArray = octetArray.splice(i, 2); } }
|
function ics_importFromStream(aStream, aCount) { var items = new Array(); // Read in the string. Note that it isn't a real string at this point, because // likely, the file is utf8. The multibyte chars show up as multiple 'chars' // in this string. So call it an array of octets for now. var octetArray = ""; var scriptableInputStream = Components.classes["@mozilla.org/scriptableinputstream;1"] .createInstance(Components.interfaces.nsIScriptableInputStream); scriptableInputStream.init(aStream); octetArray = scriptableInputStream.read(-1); // Some other apps (most notably, sunbird 0.2) happily splits an utf8 character // between the octets, and adds a newline and space between them, for ics // folding. Unfold manually before parsing the file as utf8. // This is utf8 safe, because octets with the first bit 0 are always one-octet // characters. So the space or the newline never can be part of a multi-byte // char. octetArray = octetArray.replace(/\n /, ""); // Interpret the byte-array as an utf8 string, and convert into a // javascript string. var unicodeConverter = Components.classes["@mozilla.org/intl/scriptableunicodeconverter"] .createInstance(Components.interfaces.nsIScriptableUnicodeConverter); // ics files are always utf8 unicodeConverter.charset = "UTF-8"; var str = unicodeConverter.ConvertFromUnicode(octetArray); icssrv = Components.classes["@mozilla.org/calendar/ics-service;1"] .getService(Components.interfaces.calIICSService); var rootComp = icssrv.parseICS(str); var calComp; // libical returns the vcalendar component if there is just // one vcalendar. If there are multiple vcalendars, it returns // an xroot component, with those vcalendar childs. We need to // handle both. if (rootComp.componentType == 'VCALENDAR') { calComp = rootComp; } else { calComp = rootComp.getFirstSubcomponent('VCALENDAR'); } while (calComp) { var subComp = calComp.getFirstSubcomponent("ANY"); while (subComp) { switch (subComp.componentType) { case "VEVENT": var event = Components.classes["@mozilla.org/calendar/event;1"] .createInstance(Components.interfaces.calIEvent); event.icalComponent = subComp; items.push(event); break; case "VTODO": var todo = Components.classes["@mozilla.org/calendar/todo;1"] .createInstance(Components.interfaces.calITodo); todo.icalComponent = subComp; items.push(todo); break; default: // Nothing } subComp = calComp.getNextSubcomponent("ANY"); } calComp = rootComp.getNextSubcomponent('VCALENDAR'); } aCount.value = items.length; return items;};
|
var str = unicodeConverter.ConvertFromUnicode(octetArray);
|
var str = unicodeConverter.convertFromByteArray(octetArray, octetArray.length);
|
function ics_importFromStream(aStream, aCount) { var items = new Array(); // Read in the string. Note that it isn't a real string at this point, because // likely, the file is utf8. The multibyte chars show up as multiple 'chars' // in this string. So call it an array of octets for now. var octetArray = ""; var scriptableInputStream = Components.classes["@mozilla.org/scriptableinputstream;1"] .createInstance(Components.interfaces.nsIScriptableInputStream); scriptableInputStream.init(aStream); octetArray = scriptableInputStream.read(-1); // Some other apps (most notably, sunbird 0.2) happily splits an utf8 character // between the octets, and adds a newline and space between them, for ics // folding. Unfold manually before parsing the file as utf8. // This is utf8 safe, because octets with the first bit 0 are always one-octet // characters. So the space or the newline never can be part of a multi-byte // char. octetArray = octetArray.replace(/\n /, ""); // Interpret the byte-array as an utf8 string, and convert into a // javascript string. var unicodeConverter = Components.classes["@mozilla.org/intl/scriptableunicodeconverter"] .createInstance(Components.interfaces.nsIScriptableUnicodeConverter); // ics files are always utf8 unicodeConverter.charset = "UTF-8"; var str = unicodeConverter.ConvertFromUnicode(octetArray); icssrv = Components.classes["@mozilla.org/calendar/ics-service;1"] .getService(Components.interfaces.calIICSService); var rootComp = icssrv.parseICS(str); var calComp; // libical returns the vcalendar component if there is just // one vcalendar. If there are multiple vcalendars, it returns // an xroot component, with those vcalendar childs. We need to // handle both. if (rootComp.componentType == 'VCALENDAR') { calComp = rootComp; } else { calComp = rootComp.getFirstSubcomponent('VCALENDAR'); } while (calComp) { var subComp = calComp.getFirstSubcomponent("ANY"); while (subComp) { switch (subComp.componentType) { case "VEVENT": var event = Components.classes["@mozilla.org/calendar/event;1"] .createInstance(Components.interfaces.calIEvent); event.icalComponent = subComp; items.push(event); break; case "VTODO": var todo = Components.classes["@mozilla.org/calendar/todo;1"] .createInstance(Components.interfaces.calITodo); todo.icalComponent = subComp; items.push(todo); break; default: // Nothing } subComp = calComp.getNextSubcomponent("ANY"); } calComp = rootComp.getNextSubcomponent('VCALENDAR'); } aCount.value = items.length; return items;};
|
this.disconnect();
|
this.connection.disconnect();
|
function ident_listener_rawdata(e){ var ports = e.line.match(/(\d+) *, *(\d+)/); // <port-on-server> , <port-on-client> // (where "server" is the ident server) if (!ports) { this.disconnect(); // same meaning as "ERROR : UNKNOWN-ERROR" return; } e.type = "parsedrequest"; e.destObject = this; e.destMethod = "onParsedRequest"; e.localPort = ports[1]; e.remotePort = ports[2];}
|
this.disconnect();
|
this.connection.disconnect();
|
function ident_listener_request(e){ function response(str) { return e.localPort + " , " + e.remotePort + " : " + str + "\r\n"; }; function validPort(p) { return (p >= 1) && (p <= 65535); }; if (!validPort(e.localPort) || !validPort(e.remotePort)) { this.connection.sendData(response("ERROR : INVALID-PORT")); this.disconnect(); return; } var found, responses = this.server.responses; for (var i = 0; i < responses.length; ++i) { if ((e.remotePort == responses[i].port) && (this.connection._transport.host == responses[i].ip)) { // charset defaults to US-ASCII // anything except an OS username should use OTHER // however, ircu sucks, so we can't do that. this.connection.sendData(response("USERID : CHATZILLA :" + responses[i].username)); found = true; break; } } if (!found) this.connection.sendData(response("ERROR : NO-USER")); // Spec gives us a choice: drop the connection, or listen for more queries. // Since IRC servers will only ever want one name, we disconnect. this.disconnect();}
|
if(!idFromName.isValid() || !idFromIID.isValid()) { return (same && idFromName.isValid() == idFromIID.isValid()) || (!same && idFromName.isValid() != idFromIID.isValid());
|
if(!idFromName.valid || !idFromIID.valid) { return (same && idFromName.valid == idFromIID.valid) || (!same && idFromName.valid != idFromIID.valid);
|
function idTest(name, iid, same){ result = true; var idFromName = new nsID(name); var idFromIID = new nsID(iid); if(!idFromName.isValid() || !idFromIID.isValid()) { return (same && idFromName.isValid() == idFromIID.isValid()) || (!same && idFromName.isValid() != idFromIID.isValid()); } if(same != idFromName.equals(idFromIID) || same != idFromIID.equals(idFromName)) { print("iid equals test failed for "+name+" "+iid); result = false; } nameNormalized = name.toLowerCase(); iidNormalized = iid.toLowerCase(); idFromName_NameNormalized = idFromName.toName() ? idFromName.toName().toLowerCase() : idFromName.toName(); idFromIID_NameNormalized = idFromIID.toName() ? idFromIID.toName().toLowerCase() : idFromIID.toName(); idFromName_StringNormalized = idFromName.toString() ? idFromName.toString().toLowerCase() : idFromName.toString(); idFromIID_StringNormalized = idFromIID.toString() ? idFromIID.toString().toLowerCase() : idFromIID.toString(); if(idFromName_NameNormalized != nameNormalized || same != (idFromIID_NameNormalized == nameNormalized)) { print("iid toName test failed for "+name+" "+iid); result = false; } if(idFromIID_StringNormalized != iidNormalized || same != (idFromName_StringNormalized == iidNormalized)) { print("iid toString test failed for "+name+" "+iid); result = false; } if(!idFromName.equals(new nsID(idFromName)) || !idFromIID.equals(new nsID(idFromIID))) { print("new id from id test failed for "+name+" "+iid); result = false; } return result;}
|
idFromName_NameNormalized = idFromName.toName() ? idFromName.toName().toLowerCase() : idFromName.toName();
|
idFromName_NameNormalized = idFromName.name ? idFromName.name.toLowerCase() : idFromName.name;
|
function idTest(name, iid, same){ result = true; var idFromName = new nsID(name); var idFromIID = new nsID(iid); if(!idFromName.isValid() || !idFromIID.isValid()) { return (same && idFromName.isValid() == idFromIID.isValid()) || (!same && idFromName.isValid() != idFromIID.isValid()); } if(same != idFromName.equals(idFromIID) || same != idFromIID.equals(idFromName)) { print("iid equals test failed for "+name+" "+iid); result = false; } nameNormalized = name.toLowerCase(); iidNormalized = iid.toLowerCase(); idFromName_NameNormalized = idFromName.toName() ? idFromName.toName().toLowerCase() : idFromName.toName(); idFromIID_NameNormalized = idFromIID.toName() ? idFromIID.toName().toLowerCase() : idFromIID.toName(); idFromName_StringNormalized = idFromName.toString() ? idFromName.toString().toLowerCase() : idFromName.toString(); idFromIID_StringNormalized = idFromIID.toString() ? idFromIID.toString().toLowerCase() : idFromIID.toString(); if(idFromName_NameNormalized != nameNormalized || same != (idFromIID_NameNormalized == nameNormalized)) { print("iid toName test failed for "+name+" "+iid); result = false; } if(idFromIID_StringNormalized != iidNormalized || same != (idFromName_StringNormalized == iidNormalized)) { print("iid toString test failed for "+name+" "+iid); result = false; } if(!idFromName.equals(new nsID(idFromName)) || !idFromIID.equals(new nsID(idFromIID))) { print("new id from id test failed for "+name+" "+iid); result = false; } return result;}
|
idFromIID_NameNormalized = idFromIID.toName() ? idFromIID.toName().toLowerCase() : idFromIID.toName();
|
idFromIID_NameNormalized = idFromIID.name ? idFromIID.name.toLowerCase() : idFromIID.name;
|
function idTest(name, iid, same){ result = true; var idFromName = new nsID(name); var idFromIID = new nsID(iid); if(!idFromName.isValid() || !idFromIID.isValid()) { return (same && idFromName.isValid() == idFromIID.isValid()) || (!same && idFromName.isValid() != idFromIID.isValid()); } if(same != idFromName.equals(idFromIID) || same != idFromIID.equals(idFromName)) { print("iid equals test failed for "+name+" "+iid); result = false; } nameNormalized = name.toLowerCase(); iidNormalized = iid.toLowerCase(); idFromName_NameNormalized = idFromName.toName() ? idFromName.toName().toLowerCase() : idFromName.toName(); idFromIID_NameNormalized = idFromIID.toName() ? idFromIID.toName().toLowerCase() : idFromIID.toName(); idFromName_StringNormalized = idFromName.toString() ? idFromName.toString().toLowerCase() : idFromName.toString(); idFromIID_StringNormalized = idFromIID.toString() ? idFromIID.toString().toLowerCase() : idFromIID.toString(); if(idFromName_NameNormalized != nameNormalized || same != (idFromIID_NameNormalized == nameNormalized)) { print("iid toName test failed for "+name+" "+iid); result = false; } if(idFromIID_StringNormalized != iidNormalized || same != (idFromName_StringNormalized == iidNormalized)) { print("iid toString test failed for "+name+" "+iid); result = false; } if(!idFromName.equals(new nsID(idFromName)) || !idFromIID.equals(new nsID(idFromIID))) { print("new id from id test failed for "+name+" "+iid); result = false; } return result;}
|
idFromName_StringNormalized = idFromName.toString() ? idFromName.toString().toLowerCase() : idFromName.toString();
|
idFromName_StringNormalized = idFromName.number ? idFromName.number.toLowerCase() : idFromName.number;
|
function idTest(name, iid, same){ result = true; var idFromName = new nsID(name); var idFromIID = new nsID(iid); if(!idFromName.isValid() || !idFromIID.isValid()) { return (same && idFromName.isValid() == idFromIID.isValid()) || (!same && idFromName.isValid() != idFromIID.isValid()); } if(same != idFromName.equals(idFromIID) || same != idFromIID.equals(idFromName)) { print("iid equals test failed for "+name+" "+iid); result = false; } nameNormalized = name.toLowerCase(); iidNormalized = iid.toLowerCase(); idFromName_NameNormalized = idFromName.toName() ? idFromName.toName().toLowerCase() : idFromName.toName(); idFromIID_NameNormalized = idFromIID.toName() ? idFromIID.toName().toLowerCase() : idFromIID.toName(); idFromName_StringNormalized = idFromName.toString() ? idFromName.toString().toLowerCase() : idFromName.toString(); idFromIID_StringNormalized = idFromIID.toString() ? idFromIID.toString().toLowerCase() : idFromIID.toString(); if(idFromName_NameNormalized != nameNormalized || same != (idFromIID_NameNormalized == nameNormalized)) { print("iid toName test failed for "+name+" "+iid); result = false; } if(idFromIID_StringNormalized != iidNormalized || same != (idFromName_StringNormalized == iidNormalized)) { print("iid toString test failed for "+name+" "+iid); result = false; } if(!idFromName.equals(new nsID(idFromName)) || !idFromIID.equals(new nsID(idFromIID))) { print("new id from id test failed for "+name+" "+iid); result = false; } return result;}
|
idFromIID_StringNormalized = idFromIID.toString() ? idFromIID.toString().toLowerCase() : idFromIID.toString();
|
idFromIID_StringNormalized = idFromIID.number ? idFromIID.number.toLowerCase() : idFromIID.number;
|
function idTest(name, iid, same){ result = true; var idFromName = new nsID(name); var idFromIID = new nsID(iid); if(!idFromName.isValid() || !idFromIID.isValid()) { return (same && idFromName.isValid() == idFromIID.isValid()) || (!same && idFromName.isValid() != idFromIID.isValid()); } if(same != idFromName.equals(idFromIID) || same != idFromIID.equals(idFromName)) { print("iid equals test failed for "+name+" "+iid); result = false; } nameNormalized = name.toLowerCase(); iidNormalized = iid.toLowerCase(); idFromName_NameNormalized = idFromName.toName() ? idFromName.toName().toLowerCase() : idFromName.toName(); idFromIID_NameNormalized = idFromIID.toName() ? idFromIID.toName().toLowerCase() : idFromIID.toName(); idFromName_StringNormalized = idFromName.toString() ? idFromName.toString().toLowerCase() : idFromName.toString(); idFromIID_StringNormalized = idFromIID.toString() ? idFromIID.toString().toLowerCase() : idFromIID.toString(); if(idFromName_NameNormalized != nameNormalized || same != (idFromIID_NameNormalized == nameNormalized)) { print("iid toName test failed for "+name+" "+iid); result = false; } if(idFromIID_StringNormalized != iidNormalized || same != (idFromName_StringNormalized == iidNormalized)) { print("iid toString test failed for "+name+" "+iid); result = false; } if(!idFromName.equals(new nsID(idFromName)) || !idFromIID.equals(new nsID(idFromIID))) { print("new id from id test failed for "+name+" "+iid); result = false; } return result;}
|
if (misspelledWord != "") { spellChecker.IgnoreWordAllOccurrences(misspelledWord);
|
if (MisspelledWord != "") { spellChecker.IgnoreWordAllOccurrences(MisspelledWord);
|
function IgnoreAll(){ dump("SpellCheck: IgnoreAll\n"); if (misspelledWord != "") { spellChecker.IgnoreWordAllOccurrences(misspelledWord); } NextWord();}
|
var addInterface = module.GetImportInterface( "addressbook"); if (addInterface != null) addInterface = addInterface.QueryInterface( Components.interfaces.nsIImportGeneric); if (addInterface == null) { error.data = gImportMsgsBundle.getString('ImportAddressBadModule'); return( false); } var loc = addInterface.GetStatus( "autoFind"); if (loc == false) { loc = addInterface.GetData( "addressLocation"); if (loc != null) { loc = loc.QueryInterface( Components.interfaces.nsIFileSpec); if (loc != null) { if (!loc.exists) loc = null; } } } if (loc == null) { if (addInterface.GetStatus( "canUserSetLocation") == 0) { error.data = gImportMsgsBundle.getString('ImportAddressNotFound'); return( false); }
|
var addInterface = module.GetImportInterface( "addressbook"); if (addInterface != null) addInterface = addInterface.QueryInterface( Components.interfaces.nsIImportGeneric); if (addInterface == null) { error.data = gImportMsgsBundle.getString('ImportAddressBadModule'); return( false); }
|
function ImportAddress( module, success, error) { if (top.progressInfo.importInterface || top.progressInfo.intervalState) { error.data = gImportMsgsBundle.getString('ImportAlreadyInProgress'); return( false); } top.progressInfo.importSuccess = false; var addInterface = module.GetImportInterface( "addressbook"); if (addInterface != null) addInterface = addInterface.QueryInterface( Components.interfaces.nsIImportGeneric); if (addInterface == null) { error.data = gImportMsgsBundle.getString('ImportAddressBadModule'); return( false); } var loc = addInterface.GetStatus( "autoFind"); if (loc == false) { loc = addInterface.GetData( "addressLocation"); if (loc != null) { loc = loc.QueryInterface( Components.interfaces.nsIFileSpec); if (loc != null) { if (!loc.exists) loc = null; } } } if (loc == null) { // Couldn't find the address book, see if we can // as the user for the location or not? if (addInterface.GetStatus( "canUserSetLocation") == 0) { // an autofind address book that could not be found! error.data = gImportMsgsBundle.getString('ImportAddressNotFound'); return( false); } var filePicker = Components.classes["@mozilla.org/filepicker;1"].createInstance(); if (filePicker != null) { filePicker = filePicker.QueryInterface( Components.interfaces.nsIFilePicker); if (filePicker == null) { error.data = gImportMsgsBundle.getString('ImportAddressNotFound'); return( false); } } else { error.data = gImportMsgsBundle.getString('ImportAddressNotFound'); return( false); } // The address book location was not found. // Determine if we need to ask for a directory // or a single file. var file = null; if (addInterface.GetStatus( "supportsMultiple") != 0) { // ask for dir try { filePicker.init( top.window, gImportMsgsBundle.getString('ImportSelectAddrDir'), Components.interfaces.nsIFilePicker.modeGetFolder); filePicker.appendFilters( Components.interfaces.nsIFilePicker.filterAll); filePicker.show(); if (filePicker.file && (filePicker.file.path.length > 0)) file = filePicker.file.path; else file = null; } catch( ex) { file = null; } } else { // ask for file try { filePicker.init( top.window, gImportMsgsBundle.getString('ImportSelectAddrFile'), Components.interfaces.nsIFilePicker.modeOpen); filePicker.appendFilters( Components.interfaces.nsIFilePicker.filterAll); filePicker.show(); if (filePicker.file && (filePicker.file.path.length > 0)) file = filePicker.file.path; else file = null; } catch( ex) { file = null; } } if (file == null) { return( false); } file = CreateNewFileSpecFromPath( file); addInterface.SetData( "addressLocation", file); } var map = addInterface.GetData( "fieldMap"); if (map != null) { map = map.QueryInterface( Components.interfaces.nsIImportFieldMap); if (map != null) { var result = new Object(); result.ok = false; top.window.openDialog( "chrome://messenger/content/fieldMapImport.xul", "", "chrome,modal,titlebar", {fieldMap: map, addInterface: addInterface, result: result}); } if (result.ok == false) return( false); } if (addInterface.WantsProgress()) { if (addInterface.BeginImport( success, error)) { top.progressInfo.importInterface = addInterface; // top.intervalState = setInterval( "ContinueImport()", 100); return( true); } else { return( false); } } else { if (addInterface.BeginImport( success, error)) { return( true); } else { return( false); } }}
|
var filePicker = Components.classes["@mozilla.org/filepicker;1"].createInstance(); if (filePicker != null) { filePicker = filePicker.QueryInterface( Components.interfaces.nsIFilePicker); if (filePicker == null) { error.data = gImportMsgsBundle.getString('ImportAddressNotFound'); return( false); } } else { error.data = gImportMsgsBundle.getString('ImportAddressNotFound'); return( false); }
|
function ImportAddress( module, success, error) { if (top.progressInfo.importInterface || top.progressInfo.intervalState) { error.data = gImportMsgsBundle.getString('ImportAlreadyInProgress'); return( false); } top.progressInfo.importSuccess = false; var addInterface = module.GetImportInterface( "addressbook"); if (addInterface != null) addInterface = addInterface.QueryInterface( Components.interfaces.nsIImportGeneric); if (addInterface == null) { error.data = gImportMsgsBundle.getString('ImportAddressBadModule'); return( false); } var loc = addInterface.GetStatus( "autoFind"); if (loc == false) { loc = addInterface.GetData( "addressLocation"); if (loc != null) { loc = loc.QueryInterface( Components.interfaces.nsIFileSpec); if (loc != null) { if (!loc.exists) loc = null; } } } if (loc == null) { // Couldn't find the address book, see if we can // as the user for the location or not? if (addInterface.GetStatus( "canUserSetLocation") == 0) { // an autofind address book that could not be found! error.data = gImportMsgsBundle.getString('ImportAddressNotFound'); return( false); } var filePicker = Components.classes["@mozilla.org/filepicker;1"].createInstance(); if (filePicker != null) { filePicker = filePicker.QueryInterface( Components.interfaces.nsIFilePicker); if (filePicker == null) { error.data = gImportMsgsBundle.getString('ImportAddressNotFound'); return( false); } } else { error.data = gImportMsgsBundle.getString('ImportAddressNotFound'); return( false); } // The address book location was not found. // Determine if we need to ask for a directory // or a single file. var file = null; if (addInterface.GetStatus( "supportsMultiple") != 0) { // ask for dir try { filePicker.init( top.window, gImportMsgsBundle.getString('ImportSelectAddrDir'), Components.interfaces.nsIFilePicker.modeGetFolder); filePicker.appendFilters( Components.interfaces.nsIFilePicker.filterAll); filePicker.show(); if (filePicker.file && (filePicker.file.path.length > 0)) file = filePicker.file.path; else file = null; } catch( ex) { file = null; } } else { // ask for file try { filePicker.init( top.window, gImportMsgsBundle.getString('ImportSelectAddrFile'), Components.interfaces.nsIFilePicker.modeOpen); filePicker.appendFilters( Components.interfaces.nsIFilePicker.filterAll); filePicker.show(); if (filePicker.file && (filePicker.file.path.length > 0)) file = filePicker.file.path; else file = null; } catch( ex) { file = null; } } if (file == null) { return( false); } file = CreateNewFileSpecFromPath( file); addInterface.SetData( "addressLocation", file); } var map = addInterface.GetData( "fieldMap"); if (map != null) { map = map.QueryInterface( Components.interfaces.nsIImportFieldMap); if (map != null) { var result = new Object(); result.ok = false; top.window.openDialog( "chrome://messenger/content/fieldMapImport.xul", "", "chrome,modal,titlebar", {fieldMap: map, addInterface: addInterface, result: result}); } if (result.ok == false) return( false); } if (addInterface.WantsProgress()) { if (addInterface.BeginImport( success, error)) { top.progressInfo.importInterface = addInterface; // top.intervalState = setInterval( "ContinueImport()", 100); return( true); } else { return( false); } } else { if (addInterface.BeginImport( success, error)) { return( true); } else { return( false); } }}
|
|
var file = null; if (addInterface.GetStatus( "supportsMultiple") != 0) { try { filePicker.init( top.window, gImportMsgsBundle.getString('ImportSelectAddrDir'), Components.interfaces.nsIFilePicker.modeGetFolder); filePicker.appendFilters( Components.interfaces.nsIFilePicker.filterAll); filePicker.show(); if (filePicker.file && (filePicker.file.path.length > 0)) file = filePicker.file.path; else file = null; } catch( ex) { file = null; } } else { try { filePicker.init( top.window, gImportMsgsBundle.getString('ImportSelectAddrFile'), Components.interfaces.nsIFilePicker.modeOpen); filePicker.appendFilters( Components.interfaces.nsIFilePicker.filterAll); filePicker.show(); if (filePicker.file && (filePicker.file.path.length > 0)) file = filePicker.file.path; else file = null; } catch( ex) { file = null; } }
|
var loc = addInterface.GetStatus( "autoFind"); if (loc == false) { loc = addInterface.GetData( "addressLocation"); if (loc != null) { loc = loc.QueryInterface( Components.interfaces.nsIFileSpec); if (loc != null) { if (!loc.exists) loc = null; } } }
|
function ImportAddress( module, success, error) { if (top.progressInfo.importInterface || top.progressInfo.intervalState) { error.data = gImportMsgsBundle.getString('ImportAlreadyInProgress'); return( false); } top.progressInfo.importSuccess = false; var addInterface = module.GetImportInterface( "addressbook"); if (addInterface != null) addInterface = addInterface.QueryInterface( Components.interfaces.nsIImportGeneric); if (addInterface == null) { error.data = gImportMsgsBundle.getString('ImportAddressBadModule'); return( false); } var loc = addInterface.GetStatus( "autoFind"); if (loc == false) { loc = addInterface.GetData( "addressLocation"); if (loc != null) { loc = loc.QueryInterface( Components.interfaces.nsIFileSpec); if (loc != null) { if (!loc.exists) loc = null; } } } if (loc == null) { // Couldn't find the address book, see if we can // as the user for the location or not? if (addInterface.GetStatus( "canUserSetLocation") == 0) { // an autofind address book that could not be found! error.data = gImportMsgsBundle.getString('ImportAddressNotFound'); return( false); } var filePicker = Components.classes["@mozilla.org/filepicker;1"].createInstance(); if (filePicker != null) { filePicker = filePicker.QueryInterface( Components.interfaces.nsIFilePicker); if (filePicker == null) { error.data = gImportMsgsBundle.getString('ImportAddressNotFound'); return( false); } } else { error.data = gImportMsgsBundle.getString('ImportAddressNotFound'); return( false); } // The address book location was not found. // Determine if we need to ask for a directory // or a single file. var file = null; if (addInterface.GetStatus( "supportsMultiple") != 0) { // ask for dir try { filePicker.init( top.window, gImportMsgsBundle.getString('ImportSelectAddrDir'), Components.interfaces.nsIFilePicker.modeGetFolder); filePicker.appendFilters( Components.interfaces.nsIFilePicker.filterAll); filePicker.show(); if (filePicker.file && (filePicker.file.path.length > 0)) file = filePicker.file.path; else file = null; } catch( ex) { file = null; } } else { // ask for file try { filePicker.init( top.window, gImportMsgsBundle.getString('ImportSelectAddrFile'), Components.interfaces.nsIFilePicker.modeOpen); filePicker.appendFilters( Components.interfaces.nsIFilePicker.filterAll); filePicker.show(); if (filePicker.file && (filePicker.file.path.length > 0)) file = filePicker.file.path; else file = null; } catch( ex) { file = null; } } if (file == null) { return( false); } file = CreateNewFileSpecFromPath( file); addInterface.SetData( "addressLocation", file); } var map = addInterface.GetData( "fieldMap"); if (map != null) { map = map.QueryInterface( Components.interfaces.nsIImportFieldMap); if (map != null) { var result = new Object(); result.ok = false; top.window.openDialog( "chrome://messenger/content/fieldMapImport.xul", "", "chrome,modal,titlebar", {fieldMap: map, addInterface: addInterface, result: result}); } if (result.ok == false) return( false); } if (addInterface.WantsProgress()) { if (addInterface.BeginImport( success, error)) { top.progressInfo.importInterface = addInterface; // top.intervalState = setInterval( "ContinueImport()", 100); return( true); } else { return( false); } } else { if (addInterface.BeginImport( success, error)) { return( true); } else { return( false); } }}
|
if (file == null) { return( false); } file = CreateNewFileSpecFromPath( file);
|
if (loc == null) { if (addInterface.GetStatus( "canUserSetLocation") == 0) { error.data = gImportMsgsBundle.getString('ImportAddressNotFound'); return( false); }
|
function ImportAddress( module, success, error) { if (top.progressInfo.importInterface || top.progressInfo.intervalState) { error.data = gImportMsgsBundle.getString('ImportAlreadyInProgress'); return( false); } top.progressInfo.importSuccess = false; var addInterface = module.GetImportInterface( "addressbook"); if (addInterface != null) addInterface = addInterface.QueryInterface( Components.interfaces.nsIImportGeneric); if (addInterface == null) { error.data = gImportMsgsBundle.getString('ImportAddressBadModule'); return( false); } var loc = addInterface.GetStatus( "autoFind"); if (loc == false) { loc = addInterface.GetData( "addressLocation"); if (loc != null) { loc = loc.QueryInterface( Components.interfaces.nsIFileSpec); if (loc != null) { if (!loc.exists) loc = null; } } } if (loc == null) { // Couldn't find the address book, see if we can // as the user for the location or not? if (addInterface.GetStatus( "canUserSetLocation") == 0) { // an autofind address book that could not be found! error.data = gImportMsgsBundle.getString('ImportAddressNotFound'); return( false); } var filePicker = Components.classes["@mozilla.org/filepicker;1"].createInstance(); if (filePicker != null) { filePicker = filePicker.QueryInterface( Components.interfaces.nsIFilePicker); if (filePicker == null) { error.data = gImportMsgsBundle.getString('ImportAddressNotFound'); return( false); } } else { error.data = gImportMsgsBundle.getString('ImportAddressNotFound'); return( false); } // The address book location was not found. // Determine if we need to ask for a directory // or a single file. var file = null; if (addInterface.GetStatus( "supportsMultiple") != 0) { // ask for dir try { filePicker.init( top.window, gImportMsgsBundle.getString('ImportSelectAddrDir'), Components.interfaces.nsIFilePicker.modeGetFolder); filePicker.appendFilters( Components.interfaces.nsIFilePicker.filterAll); filePicker.show(); if (filePicker.file && (filePicker.file.path.length > 0)) file = filePicker.file.path; else file = null; } catch( ex) { file = null; } } else { // ask for file try { filePicker.init( top.window, gImportMsgsBundle.getString('ImportSelectAddrFile'), Components.interfaces.nsIFilePicker.modeOpen); filePicker.appendFilters( Components.interfaces.nsIFilePicker.filterAll); filePicker.show(); if (filePicker.file && (filePicker.file.path.length > 0)) file = filePicker.file.path; else file = null; } catch( ex) { file = null; } } if (file == null) { return( false); } file = CreateNewFileSpecFromPath( file); addInterface.SetData( "addressLocation", file); } var map = addInterface.GetData( "fieldMap"); if (map != null) { map = map.QueryInterface( Components.interfaces.nsIImportFieldMap); if (map != null) { var result = new Object(); result.ok = false; top.window.openDialog( "chrome://messenger/content/fieldMapImport.xul", "", "chrome,modal,titlebar", {fieldMap: map, addInterface: addInterface, result: result}); } if (result.ok == false) return( false); } if (addInterface.WantsProgress()) { if (addInterface.BeginImport( success, error)) { top.progressInfo.importInterface = addInterface; // top.intervalState = setInterval( "ContinueImport()", 100); return( true); } else { return( false); } } else { if (addInterface.BeginImport( success, error)) { return( true); } else { return( false); } }}
|
addInterface.SetData( "addressLocation", file); } var map = addInterface.GetData( "fieldMap"); if (map != null) { map = map.QueryInterface( Components.interfaces.nsIImportFieldMap); if (map != null) { var result = new Object(); result.ok = false; top.window.openDialog( "chrome: "", "chrome,modal,titlebar", {fieldMap: map, addInterface: addInterface, result: result}); } if (result.ok == false) return( false); }
|
var filePicker = Components.classes["@mozilla.org/filepicker;1"].createInstance(); if (filePicker != null) { filePicker = filePicker.QueryInterface( Components.interfaces.nsIFilePicker); if (filePicker == null) { error.data = gImportMsgsBundle.getString('ImportAddressNotFound'); return( false); } } else { error.data = gImportMsgsBundle.getString('ImportAddressNotFound'); return( false); }
|
function ImportAddress( module, success, error) { if (top.progressInfo.importInterface || top.progressInfo.intervalState) { error.data = gImportMsgsBundle.getString('ImportAlreadyInProgress'); return( false); } top.progressInfo.importSuccess = false; var addInterface = module.GetImportInterface( "addressbook"); if (addInterface != null) addInterface = addInterface.QueryInterface( Components.interfaces.nsIImportGeneric); if (addInterface == null) { error.data = gImportMsgsBundle.getString('ImportAddressBadModule'); return( false); } var loc = addInterface.GetStatus( "autoFind"); if (loc == false) { loc = addInterface.GetData( "addressLocation"); if (loc != null) { loc = loc.QueryInterface( Components.interfaces.nsIFileSpec); if (loc != null) { if (!loc.exists) loc = null; } } } if (loc == null) { // Couldn't find the address book, see if we can // as the user for the location or not? if (addInterface.GetStatus( "canUserSetLocation") == 0) { // an autofind address book that could not be found! error.data = gImportMsgsBundle.getString('ImportAddressNotFound'); return( false); } var filePicker = Components.classes["@mozilla.org/filepicker;1"].createInstance(); if (filePicker != null) { filePicker = filePicker.QueryInterface( Components.interfaces.nsIFilePicker); if (filePicker == null) { error.data = gImportMsgsBundle.getString('ImportAddressNotFound'); return( false); } } else { error.data = gImportMsgsBundle.getString('ImportAddressNotFound'); return( false); } // The address book location was not found. // Determine if we need to ask for a directory // or a single file. var file = null; if (addInterface.GetStatus( "supportsMultiple") != 0) { // ask for dir try { filePicker.init( top.window, gImportMsgsBundle.getString('ImportSelectAddrDir'), Components.interfaces.nsIFilePicker.modeGetFolder); filePicker.appendFilters( Components.interfaces.nsIFilePicker.filterAll); filePicker.show(); if (filePicker.file && (filePicker.file.path.length > 0)) file = filePicker.file.path; else file = null; } catch( ex) { file = null; } } else { // ask for file try { filePicker.init( top.window, gImportMsgsBundle.getString('ImportSelectAddrFile'), Components.interfaces.nsIFilePicker.modeOpen); filePicker.appendFilters( Components.interfaces.nsIFilePicker.filterAll); filePicker.show(); if (filePicker.file && (filePicker.file.path.length > 0)) file = filePicker.file.path; else file = null; } catch( ex) { file = null; } } if (file == null) { return( false); } file = CreateNewFileSpecFromPath( file); addInterface.SetData( "addressLocation", file); } var map = addInterface.GetData( "fieldMap"); if (map != null) { map = map.QueryInterface( Components.interfaces.nsIImportFieldMap); if (map != null) { var result = new Object(); result.ok = false; top.window.openDialog( "chrome://messenger/content/fieldMapImport.xul", "", "chrome,modal,titlebar", {fieldMap: map, addInterface: addInterface, result: result}); } if (result.ok == false) return( false); } if (addInterface.WantsProgress()) { if (addInterface.BeginImport( success, error)) { top.progressInfo.importInterface = addInterface; // top.intervalState = setInterval( "ContinueImport()", 100); return( true); } else { return( false); } } else { if (addInterface.BeginImport( success, error)) { return( true); } else { return( false); } }}
|
if (addInterface.WantsProgress()) { if (addInterface.BeginImport( success, error)) { top.progressInfo.importInterface = addInterface; return( true); } else { return( false); } } else { if (addInterface.BeginImport( success, error)) { return( true); } else { return( false); } }
|
var file = null; if (addInterface.GetStatus( "supportsMultiple") != 0) { try { filePicker.init( top.window, gImportMsgsBundle.getString('ImportSelectAddrDir'), Components.interfaces.nsIFilePicker.modeGetFolder); filePicker.appendFilters( Components.interfaces.nsIFilePicker.filterAll); filePicker.show(); if (filePicker.file && (filePicker.file.path.length > 0)) file = filePicker.file.path; else file = null; } catch( ex) { file = null; } } else { try { filePicker.init( top.window, gImportMsgsBundle.getString('ImportSelectAddrFile'), Components.interfaces.nsIFilePicker.modeOpen); filePicker.appendFilters( Components.interfaces.nsIFilePicker.filterAll); filePicker.show(); if (filePicker.file && (filePicker.file.path.length > 0)) file = filePicker.file.path; else file = null; } catch( ex) { file = null; } } if (file == null) { return( false); } file = CreateNewFileSpecFromPath( file); addInterface.SetData( "addressLocation", file); } var map = addInterface.GetData( "fieldMap"); if (map != null) { map = map.QueryInterface( Components.interfaces.nsIImportFieldMap); if (map != null) { var result = new Object(); result.ok = false; top.window.openDialog( "chrome: "", "chrome,modal,titlebar", {fieldMap: map, addInterface: addInterface, result: result}); } if (result.ok == false) return( false); } if (addInterface.WantsProgress()) { if (addInterface.BeginImport( success, error)) { top.progressInfo.importInterface = addInterface; return( true); } else { return( false); } } else { if (addInterface.BeginImport( success, error)) { return( true); } else { return( false); } }
|
function ImportAddress( module, success, error) { if (top.progressInfo.importInterface || top.progressInfo.intervalState) { error.data = gImportMsgsBundle.getString('ImportAlreadyInProgress'); return( false); } top.progressInfo.importSuccess = false; var addInterface = module.GetImportInterface( "addressbook"); if (addInterface != null) addInterface = addInterface.QueryInterface( Components.interfaces.nsIImportGeneric); if (addInterface == null) { error.data = gImportMsgsBundle.getString('ImportAddressBadModule'); return( false); } var loc = addInterface.GetStatus( "autoFind"); if (loc == false) { loc = addInterface.GetData( "addressLocation"); if (loc != null) { loc = loc.QueryInterface( Components.interfaces.nsIFileSpec); if (loc != null) { if (!loc.exists) loc = null; } } } if (loc == null) { // Couldn't find the address book, see if we can // as the user for the location or not? if (addInterface.GetStatus( "canUserSetLocation") == 0) { // an autofind address book that could not be found! error.data = gImportMsgsBundle.getString('ImportAddressNotFound'); return( false); } var filePicker = Components.classes["@mozilla.org/filepicker;1"].createInstance(); if (filePicker != null) { filePicker = filePicker.QueryInterface( Components.interfaces.nsIFilePicker); if (filePicker == null) { error.data = gImportMsgsBundle.getString('ImportAddressNotFound'); return( false); } } else { error.data = gImportMsgsBundle.getString('ImportAddressNotFound'); return( false); } // The address book location was not found. // Determine if we need to ask for a directory // or a single file. var file = null; if (addInterface.GetStatus( "supportsMultiple") != 0) { // ask for dir try { filePicker.init( top.window, gImportMsgsBundle.getString('ImportSelectAddrDir'), Components.interfaces.nsIFilePicker.modeGetFolder); filePicker.appendFilters( Components.interfaces.nsIFilePicker.filterAll); filePicker.show(); if (filePicker.file && (filePicker.file.path.length > 0)) file = filePicker.file.path; else file = null; } catch( ex) { file = null; } } else { // ask for file try { filePicker.init( top.window, gImportMsgsBundle.getString('ImportSelectAddrFile'), Components.interfaces.nsIFilePicker.modeOpen); filePicker.appendFilters( Components.interfaces.nsIFilePicker.filterAll); filePicker.show(); if (filePicker.file && (filePicker.file.path.length > 0)) file = filePicker.file.path; else file = null; } catch( ex) { file = null; } } if (file == null) { return( false); } file = CreateNewFileSpecFromPath( file); addInterface.SetData( "addressLocation", file); } var map = addInterface.GetData( "fieldMap"); if (map != null) { map = map.QueryInterface( Components.interfaces.nsIImportFieldMap); if (map != null) { var result = new Object(); result.ok = false; top.window.openDialog( "chrome://messenger/content/fieldMapImport.xul", "", "chrome,modal,titlebar", {fieldMap: map, addInterface: addInterface, result: result}); } if (result.ok == false) return( false); } if (addInterface.WantsProgress()) { if (addInterface.BeginImport( success, error)) { top.progressInfo.importInterface = addInterface; // top.intervalState = setInterval( "ContinueImport()", 100); return( true); } else { return( false); } } else { if (addInterface.BeginImport( success, error)) { return( true); } else { return( false); } }}
|
filePicker.chooseDirectory( "Select address book directory");
|
filePicker.chooseDirectory( GetBundleString( 'ImportSelectAddrDir'));
|
function ImportAddress( module, success, error) { if (top.progressInfo.importInterface || top.progressInfo.intervalState) { error.data = GetBundleString( 'ImportAlreadyInProgress'); return( false); } top.progressInfo.importSuccess = false; var addInterface = module.GetImportInterface( "addressbook"); if (addInterface != null) addInterface = addInterface.QueryInterface( Components.interfaces.nsIImportGeneric); if (addInterface == null) { error.data = GetBundleString( 'ImportAddressBadModule'); return( false); } var loc = addInterface.GetStatus( "autoFind"); if (loc == false) { loc = addInterface.GetData( "addressLocation"); if (loc != null) { loc = loc.QueryInterface( Components.interfaces.nsIFileSpec); if (loc != null) { if (!loc.exists) loc = null; } } } if (loc == null) { // Couldn't find the address book, see if we can // as the user for the location or not? if (addInterface.GetStatus( "canUserSetLocation") == 0) { // an autofind address book that could not be found! error.data = GetBundleString( 'ImportAddressNotFound'); return( false); } var filePicker = Components.classes["component://netscape/filespecwithui"].createInstance(); if (filePicker != null) { filePicker = filePicker.QueryInterface( Components.interfaces.nsIFileSpecWithUI); if (filePicker == null) { error.data = GetBundleString( 'ImportAddressNotFound'); return( false); } } else { error.data = GetBundleString( 'ImportAddressNotFound'); return( false); } // The address book location was not found. // Determine if we need to ask for a directory // or a single file. var file = null; if (addInterface.GetStatus( "supportsMultiple") != 0) { // ask for dir try { filePicker.chooseDirectory( "Select address book directory"); file = filePicker.QueryInterface( Components.interfaces.nsIFileSpec); } catch( ex) { file = null; } } else { // ask for file try { filePicker.chooseInputFile( "Select address book file", filePicker.eAllFiles, null, null); file = filePicker.QueryInterface( Components.interfaces.nsIFileSpec); } catch( ex) { file = null; } } if (file == null) { return( false); } file = CreateNewFileSpec( file); addInterface.SetData( "addressLocation", file); } var map = addInterface.GetData( "fieldMap"); if (map != null) { map = map.QueryInterface( Components.interfaces.nsIImportFieldMap); if (map != null) { var result = new Object(); result.ok = false; top.window.openDialog( "chrome://messenger/content/fieldMapImport.xul", "", "chrome,modal", {fieldMap: map, addInterface: addInterface, result: result}); } if (result.ok == false) return( false); } if (addInterface.WantsProgress()) { if (addInterface.BeginImport( success, error)) { top.progressInfo.importInterface = addInterface; // top.intervalState = setInterval( "ContinueImport()", 100); return( true); } else { return( false); } } else { if (addInterface.BeginImport( success, error)) { return( true); } else { return( false); } }}
|
filePicker.chooseInputFile( "Select address book file", filePicker.eAllFiles, null, null);
|
filePicker.chooseInputFile( GetBundleString( 'ImportSelectAddrFile'), filePicker.eAllFiles, null, null);
|
function ImportAddress( module, success, error) { if (top.progressInfo.importInterface || top.progressInfo.intervalState) { error.data = GetBundleString( 'ImportAlreadyInProgress'); return( false); } top.progressInfo.importSuccess = false; var addInterface = module.GetImportInterface( "addressbook"); if (addInterface != null) addInterface = addInterface.QueryInterface( Components.interfaces.nsIImportGeneric); if (addInterface == null) { error.data = GetBundleString( 'ImportAddressBadModule'); return( false); } var loc = addInterface.GetStatus( "autoFind"); if (loc == false) { loc = addInterface.GetData( "addressLocation"); if (loc != null) { loc = loc.QueryInterface( Components.interfaces.nsIFileSpec); if (loc != null) { if (!loc.exists) loc = null; } } } if (loc == null) { // Couldn't find the address book, see if we can // as the user for the location or not? if (addInterface.GetStatus( "canUserSetLocation") == 0) { // an autofind address book that could not be found! error.data = GetBundleString( 'ImportAddressNotFound'); return( false); } var filePicker = Components.classes["component://netscape/filespecwithui"].createInstance(); if (filePicker != null) { filePicker = filePicker.QueryInterface( Components.interfaces.nsIFileSpecWithUI); if (filePicker == null) { error.data = GetBundleString( 'ImportAddressNotFound'); return( false); } } else { error.data = GetBundleString( 'ImportAddressNotFound'); return( false); } // The address book location was not found. // Determine if we need to ask for a directory // or a single file. var file = null; if (addInterface.GetStatus( "supportsMultiple") != 0) { // ask for dir try { filePicker.chooseDirectory( "Select address book directory"); file = filePicker.QueryInterface( Components.interfaces.nsIFileSpec); } catch( ex) { file = null; } } else { // ask for file try { filePicker.chooseInputFile( "Select address book file", filePicker.eAllFiles, null, null); file = filePicker.QueryInterface( Components.interfaces.nsIFileSpec); } catch( ex) { file = null; } } if (file == null) { return( false); } file = CreateNewFileSpec( file); addInterface.SetData( "addressLocation", file); } var map = addInterface.GetData( "fieldMap"); if (map != null) { map = map.QueryInterface( Components.interfaces.nsIImportFieldMap); if (map != null) { var result = new Object(); result.ok = false; top.window.openDialog( "chrome://messenger/content/fieldMapImport.xul", "", "chrome,modal", {fieldMap: map, addInterface: addInterface, result: result}); } if (result.ok == false) return( false); } if (addInterface.WantsProgress()) { if (addInterface.BeginImport( success, error)) { top.progressInfo.importInterface = addInterface; // top.intervalState = setInterval( "ContinueImport()", 100); return( true); } else { return( false); } } else { if (addInterface.BeginImport( success, error)) { return( true); } else { return( false); } }}
|
var addInterface = module.GetImportInterface( "addressbook");
|
addInterface = module.GetImportInterface( "addressbook");
|
function ImportAddress( module, success, error) { if (top.progressInfo.importInterface || top.progressInfo.intervalState) { error.data = gImportMsgsBundle.getString('ImportAlreadyInProgress'); return( false); } top.progressInfo.importSuccess = false; var addInterface = module.GetImportInterface( "addressbook"); if (addInterface != null) addInterface = addInterface.QueryInterface( Components.interfaces.nsIImportGeneric); if (addInterface == null) { error.data = gImportMsgsBundle.getString('ImportAddressBadModule'); return( false); } var loc = addInterface.GetStatus( "autoFind"); if (loc == false) { loc = addInterface.GetData( "addressLocation"); if (loc != null) { loc = loc.QueryInterface( Components.interfaces.nsIFileSpec); if (loc != null) { if (!loc.exists) loc = null; } } } if (loc == null) { // Couldn't find the address book, see if we can // as the user for the location or not? if (addInterface.GetStatus( "canUserSetLocation") == 0) { // an autofind address book that could not be found! error.data = gImportMsgsBundle.getString('ImportAddressNotFound'); return( false); } var filePicker = Components.classes["@mozilla.org/filepicker;1"].createInstance(); if (filePicker != null) { filePicker = filePicker.QueryInterface( Components.interfaces.nsIFilePicker); if (filePicker == null) { error.data = gImportMsgsBundle.getString('ImportAddressNotFound'); return( false); } } else { error.data = gImportMsgsBundle.getString('ImportAddressNotFound'); return( false); } // The address book location was not found. // Determine if we need to ask for a directory // or a single file. var file = null; if (addInterface.GetStatus( "supportsMultiple") != 0) { // ask for dir try { filePicker.init( top.window, gImportMsgsBundle.getString('ImportSelectAddrDir'), Components.interfaces.nsIFilePicker.modeGetFolder); filePicker.appendFilters( Components.interfaces.nsIFilePicker.filterAll); filePicker.show(); if (filePicker.file && (filePicker.file.path.length > 0)) file = filePicker.file.path; else file = null; } catch( ex) { file = null; } } else { // ask for file try { filePicker.init( top.window, gImportMsgsBundle.getString('ImportSelectAddrFile'), Components.interfaces.nsIFilePicker.modeOpen); filePicker.appendFilters( Components.interfaces.nsIFilePicker.filterAll); filePicker.show(); if (filePicker.file && (filePicker.file.path.length > 0)) file = filePicker.file.path; else file = null; } catch( ex) { file = null; } } if (file == null) { return( false); } file = CreateNewFileSpecFromPath( file); addInterface.SetData( "addressLocation", file); } var map = addInterface.GetData( "fieldMap"); if (map != null) { map = map.QueryInterface( Components.interfaces.nsIImportFieldMap); if (map != null) { var result = new Object(); result.ok = false; top.window.openDialog( "chrome://messenger/content/fieldMapImport.xul", "", "chrome,modal,titlebar", {fieldMap: map, addInterface: addInterface, result: result}); } if (result.ok == false) return( false); } if (addInterface.WantsProgress()) { if (addInterface.BeginImport( success, error)) { top.progressInfo.importInterface = addInterface; // top.intervalState = setInterval( "ContinueImport()", 100); return( true); } else { return( false); } } else { if (addInterface.BeginImport( success, error)) { return( true); } else { return( false); } }}
|
var path ;
|
function ImportAddress( module, success, error) { if (top.progressInfo.importInterface || top.progressInfo.intervalState) { error.data = gImportMsgsBundle.getString('ImportAlreadyInProgress'); return( false); } top.progressInfo.importSuccess = false; var addInterface = module.GetImportInterface( "addressbook"); if (addInterface != null) addInterface = addInterface.QueryInterface( Components.interfaces.nsIImportGeneric); if (addInterface == null) { error.data = gImportMsgsBundle.getString('ImportAddressBadModule'); return( false); } var loc = addInterface.GetStatus( "autoFind"); if (loc == false) { loc = addInterface.GetData( "addressLocation"); if (loc != null) { loc = loc.QueryInterface( Components.interfaces.nsIFileSpec); if (loc != null) { if (!loc.exists) loc = null; } } } if (loc == null) { // Couldn't find the address book, see if we can // as the user for the location or not? if (addInterface.GetStatus( "canUserSetLocation") == 0) { // an autofind address book that could not be found! error.data = gImportMsgsBundle.getString('ImportAddressNotFound'); return( false); } var filePicker = Components.classes["@mozilla.org/filepicker;1"].createInstance(); if (filePicker != null) { filePicker = filePicker.QueryInterface( Components.interfaces.nsIFilePicker); if (filePicker == null) { error.data = gImportMsgsBundle.getString('ImportAddressNotFound'); return( false); } } else { error.data = gImportMsgsBundle.getString('ImportAddressNotFound'); return( false); } // The address book location was not found. // Determine if we need to ask for a directory // or a single file. var file = null; if (addInterface.GetStatus( "supportsMultiple") != 0) { // ask for dir try { filePicker.init( top.window, gImportMsgsBundle.getString('ImportSelectAddrDir'), Components.interfaces.nsIFilePicker.modeGetFolder); filePicker.appendFilters( Components.interfaces.nsIFilePicker.filterAll); filePicker.show(); if (filePicker.file && (filePicker.file.path.length > 0)) file = filePicker.file.path; else file = null; } catch( ex) { file = null; } } else { // ask for file try { filePicker.init( top.window, gImportMsgsBundle.getString('ImportSelectAddrFile'), Components.interfaces.nsIFilePicker.modeOpen); filePicker.appendFilters( Components.interfaces.nsIFilePicker.filterAll); filePicker.show(); if (filePicker.file && (filePicker.file.path.length > 0)) file = filePicker.file.path; else file = null; } catch( ex) { file = null; } } if (file == null) { return( false); } file = CreateNewFileSpecFromPath( file); addInterface.SetData( "addressLocation", file); } var map = addInterface.GetData( "fieldMap"); if (map != null) { map = map.QueryInterface( Components.interfaces.nsIImportFieldMap); if (map != null) { var result = new Object(); result.ok = false; top.window.openDialog( "chrome://messenger/content/fieldMapImport.xul", "", "chrome,modal,titlebar", {fieldMap: map, addInterface: addInterface, result: result}); } if (result.ok == false) return( false); } if (addInterface.WantsProgress()) { if (addInterface.BeginImport( success, error)) { top.progressInfo.importInterface = addInterface; // top.intervalState = setInterval( "ContinueImport()", 100); return( true); } else { return( false); } } else { if (addInterface.BeginImport( success, error)) { return( true); } else { return( false); } }}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.