rem
stringlengths
0
126k
add
stringlengths
0
441k
context
stringlengths
15
136k
if (pref.lockCol == PREF_IS_DEFAULT_VALUE)
if (pref.lockCol == PREF_IS_DEFAULT_VALUE && /^chrome:\/\/.+\/locale\/.+\.properties/.test(pref.valueCol))
function fetchPref(prefName, prefIndex){ var pref = new prefObject(prefName); gPrefHash[prefName] = pref; gPrefArray[prefIndex] = pref; if (gPrefBranch.prefIsLocked(prefName)) pref.lockCol = PREF_IS_LOCKED; else if (gPrefBranch.prefHasUserValue(prefName)) pref.lockCol = PREF_IS_USER_SET; try { switch (gPrefBranch.getPrefType(prefName)) { case gPrefBranch.PREF_BOOL: pref.typeCol = gPrefBranch.PREF_BOOL; // convert to a string pref.valueCol = gPrefBranch.getBoolPref(prefName).toString(); break; case gPrefBranch.PREF_INT: pref.typeCol = gPrefBranch.PREF_INT; // convert to a string pref.valueCol = gPrefBranch.getIntPref(prefName).toString(); break; default: case gPrefBranch.PREF_STRING: pref.valueCol = gPrefBranch.getComplexValue(prefName, nsISupportsString).data; // Try in case it's a localized string (will throw an exception if not) if (pref.lockCol == PREF_IS_DEFAULT_VALUE) pref.valueCol = gPrefBranch.getComplexValue(prefName, nsIPrefLocalizedString).data; break; } } catch (e) { // Also catch obscure cases in which you can't tell in advance // that the pref exists but has no user or default value... }}
if (!gMessengerBundle) gMessengerBundle = document.getElementById("bundle_messenger");
function file_init(){ file_attachments();/* file_attachments() can return false to indicate a load failure, but if you return false to oncreate then the popup menu will not display which is not a good thing. */}
var detachAllMenu = document.getElementById('file-detachAllAttachments'); var deleteAllMenu = document.getElementById('file-deleteAllAttachments'); if (CanDetachAttachments()) { detachAllMenu.removeAttribute('disabled'); deleteAllMenu.removeAttribute('disabled'); } else { detachAllMenu.setAttribute('disabled', 'true'); deleteAllMenu.setAttribute('disabled', 'true'); }
function FillAttachmentListPopup(popup){ // the FE sometimes call this routine TWICE...I haven't been able to figure out why yet... // protect against it... if (!gBuildAttachmentPopupForCurrentMsg) return; var attachmentIndex = 0; // otherwise we need to build the attachment view... // First clear out the old view... ClearAttachmentMenu(popup); for (index in currentAttachments) { ++attachmentIndex; addAttachmentToPopup(popup, currentAttachments[index], attachmentIndex); } gBuildAttachmentPopupForCurrentMsg = false;}
menuItem.setAttribute("value","Insert Image");
menuItem.setAttribute("label","Insert Image");
function fillContextMenu(name,node){ if (!name) return(false); var popupNode = document.getElementById(name); if (!popupNode) return(false); var url = GetFileURL(node); var ext = getFileExtension(url); // remove the menu node (which tosses all of its kids); // do this in case any old command nodes are hanging around var menuNode = popupNode.childNodes[0]; popupNode.removeChild(menuNode); // create a new menu node menuNode = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "menu"); popupNode.appendChild(menuNode); dump("mwa"); if(ext == "gif") { // note: deleted all the doContextCmd stuff from bookmarks. menuItem = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "menuitem"); menuItem.setAttribute("value","Insert Image"); // menuItem.setAttribute("onaction","AutoInsertImage(\'" + url + "\')"); parent.appendChild(menuItem); } return(true);}
dialog.findKey.value = data.searchString; dialog.caseSensitive.checked = data.caseSensitive; dialog.wrap.checked = data.wrapSearch; dialog.searchBackwards.checked = data.searchBackwards;
dialog.findKey.value = findService.searchString; dialog.caseSensitive.checked = findService.matchCase; dialog.wrap.checked = findService.wrapFind; dialog.searchBackwards.checked = findService.findBackwards;
function fillDialog(){ // Set initial dialog field contents. dialog.findKey.value = data.searchString; dialog.caseSensitive.checked = data.caseSensitive; dialog.wrap.checked = data.wrapSearch; dialog.searchBackwards.checked = data.searchBackwards;}
ClearList(DictionaryList);
ClearTreelist(DictionaryList);
function FillDictionaryList(){ selIndex = DictionaryList.selectedIndex; // Clear the current contents of the list ClearList(DictionaryList); // Get the list from the spell checker spellChecker.GetPersonalDictionary() // Get words until an empty string is returned do { word = spellChecker.GetPersonalDictionaryWord(); if (word != "") { AppendStringToTreelist(DictionaryList, word); } } while (word != ""); ResetSelectedItem(selIndex);}
if (word != "") {
if (word != "")
function FillDictionaryList(){ selIndex = DictionaryList.selectedIndex; // Clear the current contents of the list ClearList(DictionaryList); // Get the list from the spell checker spellChecker.GetPersonalDictionary() // Get words until an empty string is returned do { word = spellChecker.GetPersonalDictionaryWord(); if (word != "") { AppendStringToTreelist(DictionaryList, word); } } while (word != ""); ResetSelectedItem(selIndex);}
}
function FillDictionaryList(){ selIndex = DictionaryList.selectedIndex; // Clear the current contents of the list ClearList(DictionaryList); // Get the list from the spell checker spellChecker.GetPersonalDictionary() // Get words until an empty string is returned do { word = spellChecker.GetPersonalDictionaryWord(); if (word != "") { AppendStringToTreelist(DictionaryList, word); } } while (word != ""); ResetSelectedItem(selIndex);}
selIndex = DictionaryList.selectedIndex;
var selIndex = dialog.DictionaryList.selectedIndex;
function FillDictionaryList(){ selIndex = DictionaryList.selectedIndex; // Clear the current contents of the list ClearTreelist(DictionaryList); // Get the list from the spell checker spellChecker.GetPersonalDictionary() // Get words until an empty string is returned do { word = spellChecker.GetPersonalDictionaryWord(); if (word != "") AppendStringToTreelist(DictionaryList, word); } while (word != ""); ResetSelectedItem(selIndex);}
ClearTreelist(DictionaryList);
ClearTreelist(dialog.DictionaryList);
function FillDictionaryList(){ selIndex = DictionaryList.selectedIndex; // Clear the current contents of the list ClearTreelist(DictionaryList); // Get the list from the spell checker spellChecker.GetPersonalDictionary() // Get words until an empty string is returned do { word = spellChecker.GetPersonalDictionaryWord(); if (word != "") AppendStringToTreelist(DictionaryList, word); } while (word != ""); ResetSelectedItem(selIndex);}
spellChecker.GetPersonalDictionary()
gSpellChecker.GetPersonalDictionary() var haveList = false;
function FillDictionaryList(){ selIndex = DictionaryList.selectedIndex; // Clear the current contents of the list ClearTreelist(DictionaryList); // Get the list from the spell checker spellChecker.GetPersonalDictionary() // Get words until an empty string is returned do { word = spellChecker.GetPersonalDictionaryWord(); if (word != "") AppendStringToTreelist(DictionaryList, word); } while (word != ""); ResetSelectedItem(selIndex);}
word = spellChecker.GetPersonalDictionaryWord();
var word = gSpellChecker.GetPersonalDictionaryWord();
function FillDictionaryList(){ selIndex = DictionaryList.selectedIndex; // Clear the current contents of the list ClearTreelist(DictionaryList); // Get the list from the spell checker spellChecker.GetPersonalDictionary() // Get words until an empty string is returned do { word = spellChecker.GetPersonalDictionaryWord(); if (word != "") AppendStringToTreelist(DictionaryList, word); } while (word != ""); ResetSelectedItem(selIndex);}
AppendStringToTreelist(DictionaryList, word);
{ AppendStringToTreelist(dialog.DictionaryList, word); haveList = true; }
function FillDictionaryList(){ selIndex = DictionaryList.selectedIndex; // Clear the current contents of the list ClearTreelist(DictionaryList); // Get the list from the spell checker spellChecker.GetPersonalDictionary() // Get words until an empty string is returned do { word = spellChecker.GetPersonalDictionaryWord(); if (word != "") AppendStringToTreelist(DictionaryList, word); } while (word != ""); ResetSelectedItem(selIndex);}
if (!haveList) AppendStringToTreelist(dialog.DictionaryList, " ");
function FillDictionaryList(){ selIndex = DictionaryList.selectedIndex; // Clear the current contents of the list ClearTreelist(DictionaryList); // Get the list from the spell checker spellChecker.GetPersonalDictionary() // Get words until an empty string is returned do { word = spellChecker.GetPersonalDictionaryWord(); if (word != "") AppendStringToTreelist(DictionaryList, word); } while (word != ""); ResetSelectedItem(selIndex);}
var showSendUnsentMessages = (numSelected <= 1) && (specialFolder == 'Unsent Messages');
var showSendUnsentMessages = (numSelected <= 1) && (specialFolder == 'Unsent Messages' || specialFolder == 'Unsent');
function fillFolderPaneContextMenu(){ if (IsFakeAccount()) return false; var folderTree = GetFolderTree(); var startIndex = {}; var endIndex = {}; folderTree.view.selection.getRangeAt(0, startIndex, endIndex); if (startIndex.value < 0) return false; var numSelected = endIndex.value - startIndex.value + 1; var folderResource = GetFolderResource(folderTree, startIndex.value); var folder = GetMsgFolderFromUri(folderResource.Value, false); var isVirtualFolder = folder ? folder.flags & MSG_FOLDER_FLAG_VIRTUAL : false; var isServer = GetFolderAttribute(folderTree, folderResource, "IsServer") == 'true'; var serverType = GetFolderAttribute(folderTree, folderResource, "ServerType"); var specialFolder = GetFolderAttribute(folderTree, folderResource, "SpecialFolder"); var canSubscribeToFolder = (serverType == "nntp") || (serverType == "imap"); var isNewsgroup = !isServer && serverType == 'nntp'; var isMailFolder = !isServer && serverType != 'nntp'; var canGetMessages = (isServer && (serverType != "nntp") && (serverType !="none")) || isNewsgroup; EnableMenuItem("folderPaneContext-properties", true); ShowMenuItem("folderPaneContext-getMessages", (numSelected <= 1) && canGetMessages); EnableMenuItem("folderPaneContext-getMessages", true); ShowMenuItem("folderPaneContext-openNewWindow", (numSelected <= 1) && !isServer); EnableMenuItem("folderPaneContext-openNewWindow", true); SetupRenameMenuItem(folderResource, numSelected, isServer, serverType, specialFolder); SetupRemoveMenuItem(folderResource, numSelected, isServer, serverType, specialFolder); SetupCompactMenuItem(folderResource, numSelected); ShowMenuItem("folderPaneContext-copy-location", !isServer && !isVirtualFolder); ShowMenuItem("folderPaneContext-emptyTrash", (numSelected <= 1) && (specialFolder == 'Trash')); EnableMenuItem("folderPaneContext-emptyTrash", true); var showSendUnsentMessages = (numSelected <= 1) && (specialFolder == 'Unsent Messages'); ShowMenuItem("folderPaneContext-sendUnsentMessages", showSendUnsentMessages); if (showSendUnsentMessages) { EnableMenuItem("folderPaneContext-sendUnsentMessages", IsSendUnsentMsgsEnabled(folderResource)); } ShowMenuItem("folderPaneContext-sep-edit", (numSelected <= 1)); SetupNewMenuItem(folderResource, numSelected, isServer, serverType, specialFolder); ShowMenuItem("folderPaneContext-subscribe", (numSelected <= 1) && canSubscribeToFolder && !isVirtualFolder); EnableMenuItem("folderPaneContext-subscribe", !isVirtualFolder); // XXX: Hack for RSS servers... ShowMenuItem("folderPaneContext-rssSubscribe", (numSelected <= 1) && (serverType == "rss")); EnableMenuItem("folderPaneContext-rssSubscribe", true); ShowMenuItem("folderPaneContext-sep1", (numSelected <= 1) && !isServer);// News folder context menu ============================================= ShowMenuItem("folderPaneContext-newsUnsubscribe", (numSelected <= 1) && canSubscribeToFolder && isNewsgroup); EnableMenuItem("folderPaneContext-newsUnsubscribe", true); ShowMenuItem("folderPaneContext-markNewsgroupAllRead", (numSelected <= 1) && isNewsgroup); EnableMenuItem("folderPaneContext-markNewsgroupAllRead", true);// End of News folder context menu ======================================= ShowMenuItem("folderPaneContext-markMailFolderAllRead", (numSelected <= 1) && isMailFolder && !isVirtualFolder); EnableMenuItem("folderPaneContext-markMailFolderAllRead", !isVirtualFolder); ShowMenuItem("folderPaneContext-searchMessages", (numSelected<=1) && !isVirtualFolder); EnableMenuItem("folderPaneContext-searchMessages", IsCanSearchMessagesEnabled() && !isVirtualFolder); return(true);}
EnableMenuItem("folderPaneContext-searchMessages", IsCanSearchMessagesEnabled());
goUpdateCommand('cmd_search');
function fillFolderPaneContextMenu(){ if (IsFakeAccount()) return false; var folderTree = GetFolderTree(); var startIndex = {}; var endIndex = {}; folderTree.view.selection.getRangeAt(0, startIndex, endIndex); if (startIndex.value < 0) return false; var numSelected = endIndex.value - startIndex.value + 1; var folderResource = GetFolderResource(folderTree, startIndex.value); var isServer = GetFolderAttribute(folderTree, folderResource, "IsServer") == 'true'; var serverType = GetFolderAttribute(folderTree, folderResource, "ServerType"); var specialFolder = GetFolderAttribute(folderTree, folderResource, "SpecialFolder"); var canSubscribeToFolder = (serverType == "nntp") || (serverType == "imap"); var isNewsgroup = !isServer && serverType == 'nntp'; var isMailFolder = !isServer && serverType != 'nntp'; var canGetMessages = (isServer && (serverType != "nntp") && (serverType !="none")) || isNewsgroup; EnableMenuItem("folderPaneContext-properties", true); ShowMenuItem("folderPaneContext-getMessages", (numSelected <= 1) && canGetMessages); EnableMenuItem("folderPaneContext-getMessages", true); ShowMenuItem("folderPaneContext-openNewWindow", (numSelected <= 1) && !isServer); EnableMenuItem("folderPaneContext-openNewWindow", true); SetupRenameMenuItem(folderResource, numSelected, isServer, serverType, specialFolder); SetupRemoveMenuItem(folderResource, numSelected, isServer, serverType, specialFolder); SetupCompactMenuItem(folderResource, numSelected); ShowMenuItem("folderPaneContext-copy-location", !isServer); ShowMenuItem("folderPaneContext-emptyTrash", (numSelected <= 1) && (specialFolder == 'Trash')); EnableMenuItem("folderPaneContext-emptyTrash", true); var showSendUnsentMessages = (numSelected <= 1) && (specialFolder == 'Unsent Messages'); ShowMenuItem("folderPaneContext-sendUnsentMessages", showSendUnsentMessages); if (showSendUnsentMessages) { EnableMenuItem("folderPaneContext-sendUnsentMessages", IsSendUnsentMsgsEnabled(folderResource)); } ShowMenuItem("folderPaneContext-sep-edit", (numSelected <= 1)); SetupNewMenuItem(folderResource, numSelected, isServer, serverType, specialFolder); ShowMenuItem("folderPaneContext-subscribe", (numSelected <= 1) && canSubscribeToFolder); EnableMenuItem("folderPaneContext-subscribe", true); ShowMenuItem("folderPaneContext-sep1", (numSelected <= 1) && !isServer);// News folder context menu ============================================= ShowMenuItem("folderPaneContext-newsUnsubscribe", (numSelected <= 1) && canSubscribeToFolder && isNewsgroup); EnableMenuItem("folderPaneContext-newsUnsubscribe", true); ShowMenuItem("folderPaneContext-markNewsgroupAllRead", (numSelected <= 1) && isNewsgroup); EnableMenuItem("folderPaneContext-markNewsgroupAllRead", true);// End of News folder context menu ======================================= ShowMenuItem("folderPaneContext-markMailFolderAllRead", (numSelected <= 1) && isMailFolder); EnableMenuItem("folderPaneContext-markMailFolderAllRead", true); ShowMenuItem("folderPaneContext-searchMessages", (numSelected<=1)); EnableMenuItem("folderPaneContext-searchMessages", IsCanSearchMessagesEnabled()); return(true);}
function FillHistoryMenu(aParent, aMenu, aAdjacentElement)
function FillHistoryMenu(aParent, aMenu)
function FillHistoryMenu(aParent, aMenu, aAdjacentElement) { // Remove old entries if any deleteHistoryItems(aParent); var sessionHistory = getWebNavigation().sessionHistory; var count = sessionHistory.count; var index = sessionHistory.index; var end; var j; var entry; switch (aMenu) { case "back": end = (index > MAX_HISTORY_MENU_ITEMS) ? index - MAX_HISTORY_MENU_ITEMS : 0; if ((index - 1) < end) return false; for (j = index - 1; j >= end; j--) { entry = sessionHistory.getEntryAtIndex(j, false); if (entry) createMenuItem(aParent, j, entry.title); } break; case "forward": end = ((count-index) > MAX_HISTORY_MENU_ITEMS) ? index + MAX_HISTORY_MENU_ITEMS : count; if ((index + 1) >= end) return false; for (j = index + 1; j < end; j++) { entry = sessionHistory.getEntryAtIndex(j, false); if (entry) createMenuItem(aParent, j, entry.title); } break; case "go": if (count > 0) { if (aAdjacentElement) aAdjacentElement.removeAttribute( "hidden" ); } end = count > MAX_HISTORY_MENU_ITEMS ? count - MAX_HISTORY_MENU_ITEMS : 0; for (j = count - 1; j >= end; j--) { entry = sessionHistory.getEntryAtIndex(j, false); if (entry) createCheckboxMenuItem(aParent, j, entry.title, j == index, aAdjacentElement); } break; } return true; }
if (count > 0) { if (aAdjacentElement) aAdjacentElement.removeAttribute( "hidden" ); }
if (count > 0) aParent.lastChild.removeAttribute( "hidden" );
function FillHistoryMenu(aParent, aMenu, aAdjacentElement) { // Remove old entries if any deleteHistoryItems(aParent); var sessionHistory = getWebNavigation().sessionHistory; var count = sessionHistory.count; var index = sessionHistory.index; var end; var j; var entry; switch (aMenu) { case "back": end = (index > MAX_HISTORY_MENU_ITEMS) ? index - MAX_HISTORY_MENU_ITEMS : 0; if ((index - 1) < end) return false; for (j = index - 1; j >= end; j--) { entry = sessionHistory.getEntryAtIndex(j, false); if (entry) createMenuItem(aParent, j, entry.title); } break; case "forward": end = ((count-index) > MAX_HISTORY_MENU_ITEMS) ? index + MAX_HISTORY_MENU_ITEMS : count; if ((index + 1) >= end) return false; for (j = index + 1; j < end; j++) { entry = sessionHistory.getEntryAtIndex(j, false); if (entry) createMenuItem(aParent, j, entry.title); } break; case "go": if (count > 0) { if (aAdjacentElement) aAdjacentElement.removeAttribute( "hidden" ); } end = count > MAX_HISTORY_MENU_ITEMS ? count - MAX_HISTORY_MENU_ITEMS : 0; for (j = count - 1; j >= end; j--) { entry = sessionHistory.getEntryAtIndex(j, false); if (entry) createCheckboxMenuItem(aParent, j, entry.title, j == index, aAdjacentElement); } break; } return true; }
createCheckboxMenuItem(aParent, j, entry.title, j == index, aAdjacentElement);
createCheckboxMenuItem(aParent, j, entry.title, j==index);
function FillHistoryMenu(aParent, aMenu, aAdjacentElement) { // Remove old entries if any deleteHistoryItems(aParent); var sessionHistory = getWebNavigation().sessionHistory; var count = sessionHistory.count; var index = sessionHistory.index; var end; var j; var entry; switch (aMenu) { case "back": end = (index > MAX_HISTORY_MENU_ITEMS) ? index - MAX_HISTORY_MENU_ITEMS : 0; if ((index - 1) < end) return false; for (j = index - 1; j >= end; j--) { entry = sessionHistory.getEntryAtIndex(j, false); if (entry) createMenuItem(aParent, j, entry.title); } break; case "forward": end = ((count-index) > MAX_HISTORY_MENU_ITEMS) ? index + MAX_HISTORY_MENU_ITEMS : count; if ((index + 1) >= end) return false; for (j = index + 1; j < end; j++) { entry = sessionHistory.getEntryAtIndex(j, false); if (entry) createMenuItem(aParent, j, entry.title); } break; case "go": if (count > 0) { if (aAdjacentElement) aAdjacentElement.removeAttribute( "hidden" ); } end = count > MAX_HISTORY_MENU_ITEMS ? count - MAX_HISTORY_MENU_ITEMS : 0; for (j = count - 1; j >= end; j--) { entry = sessionHistory.getEntryAtIndex(j, false); if (entry) createCheckboxMenuItem(aParent, j, entry.title, j == index, aAdjacentElement); } break; } return true; }
function FillHistoryMenu(aParent, aMenu)
function FillHistoryMenu(aParent, aMenu, aAdjacentElement)
function FillHistoryMenu(aParent, aMenu) { // Remove old entries if any deleteHistoryItems(aParent); var sessionHistory = getWebNavigation().sessionHistory; var count = sessionHistory.count; var index = sessionHistory.index; var end; var j; var entry; switch (aMenu) { case "back": end = (index > MAX_HISTORY_MENU_ITEMS) ? index - MAX_HISTORY_MENU_ITEMS : 0; if ((index - 1) < end) return false; for (j = index - 1; j >= end; j--) { entry = sessionHistory.getEntryAtIndex(j, false); if (entry) createMenuItem(aParent, j, entry.title); } break; case "forward": end = ((count-index) > MAX_HISTORY_MENU_ITEMS) ? index + MAX_HISTORY_MENU_ITEMS : count; if ((index + 1) >= end) return false; for (j = index + 1; j < end; j++) { entry = sessionHistory.getEntryAtIndex(j, false); if (entry) createMenuItem(aParent, j, entry.title); } break; case "go": if (count > 0) aParent.lastChild.removeAttribute( "hidden" ); end = count > MAX_HISTORY_MENU_ITEMS ? count - MAX_HISTORY_MENU_ITEMS : 0; for (j = count - 1; j >= end; j--) { entry = sessionHistory.getEntryAtIndex(j, false); if (entry) createCheckboxMenuItem(aParent, j, entry.title, j==index); } break; } return true; }
if (count > 0) aParent.lastChild.removeAttribute( "hidden" );
if (count > 0) { if (aAdjacentElement) aAdjacentElement.removeAttribute( "hidden" ); }
function FillHistoryMenu(aParent, aMenu) { // Remove old entries if any deleteHistoryItems(aParent); var sessionHistory = getWebNavigation().sessionHistory; var count = sessionHistory.count; var index = sessionHistory.index; var end; var j; var entry; switch (aMenu) { case "back": end = (index > MAX_HISTORY_MENU_ITEMS) ? index - MAX_HISTORY_MENU_ITEMS : 0; if ((index - 1) < end) return false; for (j = index - 1; j >= end; j--) { entry = sessionHistory.getEntryAtIndex(j, false); if (entry) createMenuItem(aParent, j, entry.title); } break; case "forward": end = ((count-index) > MAX_HISTORY_MENU_ITEMS) ? index + MAX_HISTORY_MENU_ITEMS : count; if ((index + 1) >= end) return false; for (j = index + 1; j < end; j++) { entry = sessionHistory.getEntryAtIndex(j, false); if (entry) createMenuItem(aParent, j, entry.title); } break; case "go": if (count > 0) aParent.lastChild.removeAttribute( "hidden" ); end = count > MAX_HISTORY_MENU_ITEMS ? count - MAX_HISTORY_MENU_ITEMS : 0; for (j = count - 1; j >= end; j--) { entry = sessionHistory.getEntryAtIndex(j, false); if (entry) createCheckboxMenuItem(aParent, j, entry.title, j==index); } break; } return true; }
createCheckboxMenuItem(aParent, j, entry.title, j==index);
createCheckboxMenuItem(aParent, j, entry.title, j == index, aAdjacentElement);
function FillHistoryMenu(aParent, aMenu) { // Remove old entries if any deleteHistoryItems(aParent); var sessionHistory = getWebNavigation().sessionHistory; var count = sessionHistory.count; var index = sessionHistory.index; var end; var j; var entry; switch (aMenu) { case "back": end = (index > MAX_HISTORY_MENU_ITEMS) ? index - MAX_HISTORY_MENU_ITEMS : 0; if ((index - 1) < end) return false; for (j = index - 1; j >= end; j--) { entry = sessionHistory.getEntryAtIndex(j, false); if (entry) createMenuItem(aParent, j, entry.title); } break; case "forward": end = ((count-index) > MAX_HISTORY_MENU_ITEMS) ? index + MAX_HISTORY_MENU_ITEMS : count; if ((index + 1) >= end) return false; for (j = index + 1; j < end; j++) { entry = sessionHistory.getEntryAtIndex(j, false); if (entry) createMenuItem(aParent, j, entry.title); } break; case "go": if (count > 0) aParent.lastChild.removeAttribute( "hidden" ); end = count > MAX_HISTORY_MENU_ITEMS ? count - MAX_HISTORY_MENU_ITEMS : 0; for (j = count - 1; j >= end; j--) { entry = sessionHistory.getEntryAtIndex(j, false); if (entry) createCheckboxMenuItem(aParent, j, entry.title, j==index); } break; } return true; }
if (this.alarmRelated == this.ALARM_RELATED_END)
if (this.alarmRelated == Components.interfaces.calIItemBase.ALARM_RELATED_END)
fillIcalComponentFromBase: function (icalcomp) { // Make sure that the LMT and ST are updated this.updateStampTime(); this.ensureNotDirty(); this.mapPropsToICS(icalcomp, this.icsBasePropMap); if (this.mOrganizer) icalcomp.addProperty(this.mOrganizer.icalProperty); if (this.mAttendees) { for (var i = 0; i < this.mAttendees.length; i++) icalcomp.addProperty(this.mAttendees[i].icalProperty); } if (this.mGeneration) { var genprop = icalProp("X-MOZILLA-GENERATION"); genprop.value = String(this.mGeneration); icalcomp.addProperty(genprop); } if (this.mRecurrenceInfo) { var ritems = this.mRecurrenceInfo.getRecurrenceItems({}); for (i in ritems) { icalcomp.addProperty(ritems[i].icalProperty); } } if (this.alarmOffset) { const icssvc = Components.classes["@mozilla.org/calendar/ics-service;1"] .getService(Components.interfaces.calIICSService); var alarmComp = icssvc.createIcalComponent("VALARM"); var triggerProp = icssvc.createIcalProperty("TRIGGER"); triggerProp.valueAsIcalString = this.alarmOffset.icalString; if (this.alarmRelated == this.ALARM_RELATED_END) triggerProp.setParameter("RELATED", "END"); alarmComp.addProperty(triggerProp); if (this.alarmLastAck) { var lastAck = icssvc.createIcalProperty("X-MOZ-LASTACK"); lastAck.valueAsIcalString = this.alarmLastAck.icalString; alarmComp.addProperty(lastAck); } // We don't use this, but the ics-spec requires it var descProp = icssvc.createIcalProperty("DESCRIPTION"); descProp.value = "Mozilla Alarm: "+ this.title; alarmComp.addProperty(descProp); var actionProp = icssvc.createIcalProperty("ACTION"); actionProp.value = "DISPLAY"; if (this.getProperty("alarmEmailAddress")) { var emailProp = icssvc.createIcalProperty("X-EMAILADDRESS"); emailProp.value = this.getProperty("alarmEmailAddress"); actionProp.value = "EMAIL"; alarmComp.addProperty(emailProp); } alarmComp.addProperty(actionProp); icalcomp.addSubcomponent(alarmComp); } },
if (this.mAttendees) { for (var i = 0; i < this.mAttendees.length; i++) icalcomp.addProperty(this.mAttendees[i].icalProperty);
var attendees = this.getAttendees({}); if (attendees.length > 0) { for (var i = 0; i < attendees.length; i++) { icalcomp.addProperty(attendees[i].icalProperty); }
fillIcalComponentFromBase: function (icalcomp) { // Make sure that the LMT and ST are updated this.updateStampTime(); this.ensureNotDirty(); this.mapPropsToICS(icalcomp, this.icsBasePropMap); if (this.mOrganizer) icalcomp.addProperty(this.mOrganizer.icalProperty); if (this.mAttendees) { for (var i = 0; i < this.mAttendees.length; i++) icalcomp.addProperty(this.mAttendees[i].icalProperty); } if (this.mGeneration) { var genprop = icalProp("X-MOZILLA-GENERATION"); genprop.value = String(this.mGeneration); icalcomp.addProperty(genprop); } if (this.mRecurrenceInfo) { var ritems = this.mRecurrenceInfo.getRecurrenceItems({}); for (i in ritems) { icalcomp.addProperty(ritems[i].icalProperty); } } if (this.alarmOffset) { const icssvc = Components.classes["@mozilla.org/calendar/ics-service;1"] .getService(Components.interfaces.calIICSService); var alarmComp = icssvc.createIcalComponent("VALARM"); var triggerProp = icssvc.createIcalProperty("TRIGGER"); triggerProp.valueAsIcalString = this.alarmOffset.icalString; if (this.alarmRelated == Components.interfaces.calIItemBase.ALARM_RELATED_END) triggerProp.setParameter("RELATED", "END"); alarmComp.addProperty(triggerProp); if (this.alarmLastAck) { var lastAck = icssvc.createIcalProperty("X-MOZ-LASTACK"); lastAck.valueAsIcalString = this.alarmLastAck.icalString; alarmComp.addProperty(lastAck); } // We don't use this, but the ics-spec requires it var descProp = icssvc.createIcalProperty("DESCRIPTION"); descProp.value = "Mozilla Alarm: "+ this.title; alarmComp.addProperty(descProp); var actionProp = icssvc.createIcalProperty("ACTION"); actionProp.value = "DISPLAY"; if (this.getProperty("alarmEmailAddress")) { var emailProp = icssvc.createIcalProperty("X-EMAILADDRESS"); emailProp.value = this.getProperty("alarmEmailAddress"); actionProp.value = "EMAIL"; alarmComp.addProperty(emailProp); } alarmComp.addProperty(actionProp); icalcomp.addSubcomponent(alarmComp); } },
var accountName = " - < "+result.prettyName+">";
var accountName = " - "+result.prettyName;
function fillIdentityListPopup(popup){ var identities = GetIdentities(); for (var i=0; i<identities.length; i++) { var identity = identities[i]; //dump(i + " = " + identity.identityName + "," +identity.key + "\n"); //Get server prettyName for each identity var serverSupports = accountManager.GetServersForIdentity(identity); //dump(i + " = " + identity.identityName + "," +identity.key + "\n"); if(serverSupports.GetElementAt(0)) var result = serverSupports.GetElementAt(0).QueryInterface(Components.interfaces.nsIMsgIncomingServer); //dump ("The account name is = "+result.prettyName+ "\n"); var accountName = " - < "+result.prettyName+">"; var item=document.createElement('menuitem'); item.setAttribute('value', identity.identityName); item.setAttribute('class', 'identity-popup-item'); item.setAttribute('accountname', accountName); item.setAttribute('id', identity.key); popup.appendChild(item); }}
var titleText = "&" + err + ".title;"; document.title = titleText;
var et = document.getElementById("et_" + err); if (et) { et.className = "et_visible"; }
function fillIn(){ var err = getErrorCode(); var duffUrl = getDuffUrl(); var i; // Fill in the title var titleText = "&" + err + ".title;"; document.title = titleText;// document.getElementById("title").innerHTML = "<p>bbb</p>";// for (i = 0; i < t.childNodes.length; i++)// {// var n = t.childNodes.item(i);// if (n.nodeType == Node.TEXT_NODE)// {// n.nodeValue = titleText;// break;// }// } // Fill in the short description var sd = document.getElementById("shortDesc"); for (i = 0; i < sd.childNodes.length; i++) { var n = sd.childNodes.item(i); if (n.nodeType == Node.TEXT_NODE) { n.nodeValue = getDescription(); break; } } // Long description var d = document.getElementById(err); d.setAttribute("style", "display: block;");}
var d = document.getElementById(err); d.setAttribute("style", "display: block;");
var ld = document.getElementById("ld_" + err); if (ld) { ld.className = "ld_visible"; }
function fillIn(){ var err = getErrorCode(); var duffUrl = getDuffUrl(); var i; // Fill in the title var titleText = "&" + err + ".title;"; document.title = titleText;// document.getElementById("title").innerHTML = "<p>bbb</p>";// for (i = 0; i < t.childNodes.length; i++)// {// var n = t.childNodes.item(i);// if (n.nodeType == Node.TEXT_NODE)// {// n.nodeValue = titleText;// break;// }// } // Fill in the short description var sd = document.getElementById("shortDesc"); for (i = 0; i < sd.childNodes.length; i++) { var n = sd.childNodes.item(i); if (n.nodeType == Node.TEXT_NODE) { n.nodeValue = getDescription(); break; } } // Long description var d = document.getElementById(err); d.setAttribute("style", "display: block;");}
var HTMLNS = "http: var XULNS = "http: var XLinkNS = "http:
const HTMLNS = "http: const XULNS = "http: const XLinkNS = "http: const Node = Components.interfaces.Node;
function FillInHTMLTooltip ( tipElement ){ var HTMLNS = "http://www.w3.org/1999/xhtml"; var XULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; var XLinkNS = "http://www.w3.org/1999/xlink"; var retVal = false; var tipNode = document.getElementById("HTML_TOOLTIP_tooltipBox"); if ( tipNode ) { try { while ( tipNode.hasChildNodes() ) tipNode.removeChild( tipNode.firstChild ); var titleText = ""; var XLinkTitleText = ""; while ( !titleText && !XLinkTitleText && tipElement ) { if ( tipElement.nodeType == 1 ) { titleText = tipElement.getAttributeNS(HTMLNS, "title"); XLinkTitleText = tipElement.getAttributeNS(XLinkNS, "title"); } tipElement = tipElement.parentNode; } var texts = [ titleText, XLinkTitleText ]; for (var i = 0; i < texts.length; i++) { var t = texts[i]; if ( t.search(/\S/) >= 0 ) { var tipLineElem = tipNode.ownerDocument.createElementNS(XULNS, "text"); tipLineElem.setAttribute("value", t); tipNode.appendChild(tipLineElem); retVal = true; } } } catch (e) { retVal = false; } } return retVal;}
if ( tipNode ) { try { while ( tipNode.hasChildNodes() ) tipNode.removeChild( tipNode.firstChild ); var titleText = ""; var XLinkTitleText = ""; while ( !titleText && !XLinkTitleText && tipElement ) { if ( tipElement.nodeType == 1 ) { titleText = tipElement.getAttributeNS(HTMLNS, "title"); XLinkTitleText = tipElement.getAttributeNS(XLinkNS, "title"); } tipElement = tipElement.parentNode;
try { while (tipNode.hasChildNodes()) tipNode.removeChild(tipNode.firstChild); var titleText = ""; var XLinkTitleText = ""; while (!titleText && !XLinkTitleText && tipElement) { if (tipElement.nodeType == Node.ELEMENT_NODE) { titleText = tipElement.getAttributeNS(HTMLNS, "title"); XLinkTitleText = tipElement.getAttributeNS(XLinkNS, "title");
function FillInHTMLTooltip ( tipElement ){ var HTMLNS = "http://www.w3.org/1999/xhtml"; var XULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; var XLinkNS = "http://www.w3.org/1999/xlink"; var retVal = false; var tipNode = document.getElementById("HTML_TOOLTIP_tooltipBox"); if ( tipNode ) { try { while ( tipNode.hasChildNodes() ) tipNode.removeChild( tipNode.firstChild ); var titleText = ""; var XLinkTitleText = ""; while ( !titleText && !XLinkTitleText && tipElement ) { if ( tipElement.nodeType == 1 ) { titleText = tipElement.getAttributeNS(HTMLNS, "title"); XLinkTitleText = tipElement.getAttributeNS(XLinkNS, "title"); } tipElement = tipElement.parentNode; } var texts = [ titleText, XLinkTitleText ]; for (var i = 0; i < texts.length; i++) { var t = texts[i]; if ( t.search(/\S/) >= 0 ) { var tipLineElem = tipNode.ownerDocument.createElementNS(XULNS, "text"); tipLineElem.setAttribute("value", t); tipNode.appendChild(tipLineElem); retVal = true; } } } catch (e) { retVal = false; } } return retVal;}
var texts = [ titleText, XLinkTitleText ]; for (var i = 0; i < texts.length; i++) { var t = texts[i]; if ( t.search(/\S/) >= 0 ) { var tipLineElem = tipNode.ownerDocument.createElementNS(XULNS, "text"); tipLineElem.setAttribute("value", t); tipNode.appendChild(tipLineElem); retVal = true; }
tipElement = tipElement.parentNode; } var texts = [titleText, XLinkTitleText]; for (var i = 0; i < texts.length; ++i) { var t = texts[i]; if (t.search(/\S/) >= 0) { var tipLineElem = tipNode.ownerDocument.createElementNS(XULNS, "text"); tipLineElem.setAttribute("value", t); tipNode.appendChild(tipLineElem); retVal = true;
function FillInHTMLTooltip ( tipElement ){ var HTMLNS = "http://www.w3.org/1999/xhtml"; var XULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; var XLinkNS = "http://www.w3.org/1999/xlink"; var retVal = false; var tipNode = document.getElementById("HTML_TOOLTIP_tooltipBox"); if ( tipNode ) { try { while ( tipNode.hasChildNodes() ) tipNode.removeChild( tipNode.firstChild ); var titleText = ""; var XLinkTitleText = ""; while ( !titleText && !XLinkTitleText && tipElement ) { if ( tipElement.nodeType == 1 ) { titleText = tipElement.getAttributeNS(HTMLNS, "title"); XLinkTitleText = tipElement.getAttributeNS(XLinkNS, "title"); } tipElement = tipElement.parentNode; } var texts = [ titleText, XLinkTitleText ]; for (var i = 0; i < texts.length; i++) { var t = texts[i]; if ( t.search(/\S/) >= 0 ) { var tipLineElem = tipNode.ownerDocument.createElementNS(XULNS, "text"); tipLineElem.setAttribute("value", t); tipNode.appendChild(tipLineElem); retVal = true; } } } catch (e) { retVal = false; } } return retVal;}
catch (e) { retVal = false; }
} catch (e) {
function FillInHTMLTooltip ( tipElement ){ var HTMLNS = "http://www.w3.org/1999/xhtml"; var XULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; var XLinkNS = "http://www.w3.org/1999/xlink"; var retVal = false; var tipNode = document.getElementById("HTML_TOOLTIP_tooltipBox"); if ( tipNode ) { try { while ( tipNode.hasChildNodes() ) tipNode.removeChild( tipNode.firstChild ); var titleText = ""; var XLinkTitleText = ""; while ( !titleText && !XLinkTitleText && tipElement ) { if ( tipElement.nodeType == 1 ) { titleText = tipElement.getAttributeNS(HTMLNS, "title"); XLinkTitleText = tipElement.getAttributeNS(XLinkNS, "title"); } tipElement = tipElement.parentNode; } var texts = [ titleText, XLinkTitleText ]; for (var i = 0; i < texts.length; i++) { var t = texts[i]; if ( t.search(/\S/) >= 0 ) { var tipLineElem = tipNode.ownerDocument.createElementNS(XULNS, "text"); tipLineElem.setAttribute("value", t); tipNode.appendChild(tipLineElem); retVal = true; } } } catch (e) { retVal = false; } } return retVal;}
tipNode.setAttribute("label", t);
tipNode.setAttribute("label", t.replace(/\s+/g, " ") );
function FillInHTMLTooltip(tipElement){ var retVal = false; if (tipElement.namespaceURI == "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul") return retVal; const XLinkNS = "http://www.w3.org/1999/xlink"; var titleText = null; var XLinkTitleText = null; while (!titleText && !XLinkTitleText && tipElement) { if (tipElement.nodeType == Node.ELEMENT_NODE) { titleText = tipElement.getAttribute("title"); XLinkTitleText = tipElement.getAttributeNS(XLinkNS, "title"); } tipElement = tipElement.parentNode; } var texts = [titleText, XLinkTitleText]; var tipNode = document.getElementById("aHTMLTooltip"); for (var i = 0; i < texts.length; ++i) { var t = texts[i]; if (t && t.search(/\S/) >= 0) { tipNode.setAttribute("label", t); retVal = true; } } return retVal;}
debug(e);
function FillInHTMLTooltip(tipElement){ const XULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; const XLinkNS = "http://www.w3.org/1999/xlink"; const Node = { ELEMENT_NODE : 1 }; // XXX Components.interfaces.Node; var retVal = false; var tipNode = document.getElementById("HTML_TOOLTIP_tooltipBox"); try { while (tipNode.hasChildNodes()) tipNode.removeChild(tipNode.firstChild); var titleText = ""; var XLinkTitleText = ""; while (!titleText && !XLinkTitleText && tipElement) { if (tipElement.nodeType == Node.ELEMENT_NODE) { titleText = tipElement.getAttribute("title"); XLinkTitleText = tipElement.getAttributeNS(XLinkNS, "title"); } tipElement = tipElement.parentNode; } var texts = [titleText, XLinkTitleText]; for (var i = 0; i < texts.length; ++i) { var t = texts[i]; if (t.search(/\S/) >= 0) { var tipLineElem = tipNode.ownerDocument.createElementNS(XULNS, "text"); tipLineElem.setAttribute("value", t); tipNode.appendChild(tipLineElem); retVal = true; } } } catch (e) { debug(e); } return retVal;}
button.setAttribute('value', tipText);
button.label = tipText;
function FillInTooltip ( tipElement ){ var retVal = false; var button = document.getElementById('replaceMe'); if ( button ) { var tipText = tipElement.getAttribute('tooltiptext'); if ( tipText != "" ) { button.setAttribute('value', tipText); retVal = true; } } return retVal;}
dump(child.nodeName+" = Heading's first child nodeName\n"); if (child && child.nodeName == "a" && child.name && child.name.length > 0)
dump(child.name+" = Child.name. Length="+child.name.length+"\n"); if (child && child.nodeName == "A" && child.name && (child.name.length>0)) {
function FillListboxes(){ NamedAnchorNodeList = editorShell.editorDocument.anchors; var NamedAnchorCount = NamedAnchorNodeList.length; if (NamedAnchorCount > 0) { for (var i = 0; i < NamedAnchorCount; i++) { AppendStringToList(NamedAnchorList,NamedAnchorNodeList.item(i).name); } haveNamedAnchors = true; } else { // Message to tell user there are none AppendStringToList(NamedAnchorList,GetString("NoNamedAnchors")); } var firstHeading = true; for (var j = 1; j <= 6; j++) { var headingList = editorShell.editorDocument.getElementsByTagName("h"+String(j)); dump(headingList+" Count= "+headingList.length+"\n"); if (headingList.length > 0) { dump("HELLO\n"); var heading = headingList.item(0); // Skip headings that already have a named anchor as their first child // (this may miss nearby anchors, but at least we don't insert another // under the same heading) var child = heading.firstChild; dump(child.nodeName+" = Heading's first child nodeName\n"); if (child && child.nodeName == "a" && child.name && child.name.length > 0) continue; var range = editorShell.editorDocument.createRange(); range.setStart(heading,0); var lastChildIndex = heading.childNodes.length; range.setEnd(heading,lastChildIndex); var text = range.toString(); if (text) { // Use just first 40 characters, don't add "...", // and replace whitespace with "_" and strip non-word characters text = PrepareStringForURL(TruncateStringAtWordEnd(text, 40, false)); // Append "_" to any name already in the list if (GetExistingHeadingIndex(text) > -1) text += "_"; AppendStringToList(HeadingsList, text); // Save nodes in an array so we can create anchor node under it later if (!HNodeArray) HNodeArray = new Array(heading) else HNodeArray[HNodeArray.length] = heading; } } } if (HNodeArray) { haveHeadings = true; } else { // Message to tell user there are none AppendStringToList(HeadingsList,GetString("NoHeadings")); }}
}
function FillListboxes(){ NamedAnchorNodeList = editorShell.editorDocument.anchors; var NamedAnchorCount = NamedAnchorNodeList.length; if (NamedAnchorCount > 0) { for (var i = 0; i < NamedAnchorCount; i++) { AppendStringToList(NamedAnchorList,NamedAnchorNodeList.item(i).name); } haveNamedAnchors = true; } else { // Message to tell user there are none AppendStringToList(NamedAnchorList,GetString("NoNamedAnchors")); } var firstHeading = true; for (var j = 1; j <= 6; j++) { var headingList = editorShell.editorDocument.getElementsByTagName("h"+String(j)); dump(headingList+" Count= "+headingList.length+"\n"); if (headingList.length > 0) { dump("HELLO\n"); var heading = headingList.item(0); // Skip headings that already have a named anchor as their first child // (this may miss nearby anchors, but at least we don't insert another // under the same heading) var child = heading.firstChild; dump(child.nodeName+" = Heading's first child nodeName\n"); if (child && child.nodeName == "a" && child.name && child.name.length > 0) continue; var range = editorShell.editorDocument.createRange(); range.setStart(heading,0); var lastChildIndex = heading.childNodes.length; range.setEnd(heading,lastChildIndex); var text = range.toString(); if (text) { // Use just first 40 characters, don't add "...", // and replace whitespace with "_" and strip non-word characters text = PrepareStringForURL(TruncateStringAtWordEnd(text, 40, false)); // Append "_" to any name already in the list if (GetExistingHeadingIndex(text) > -1) text += "_"; AppendStringToList(HeadingsList, text); // Save nodes in an array so we can create anchor node under it later if (!HNodeArray) HNodeArray = new Array(heading) else HNodeArray[HNodeArray.length] = heading; } } } if (HNodeArray) { haveHeadings = true; } else { // Message to tell user there are none AppendStringToList(HeadingsList,GetString("NoHeadings")); }}
if (NamedAnchorCount > 0) { for (var i = 0; i < NamedAnchorCount; i++) { AppendStringToList(dialog.NamedAnchorList,NamedAnchorNodeList.item(i).name);
if (NamedAnchorCount > 0) { for (var i = 0; i < NamedAnchorCount; i++) { var item = AppendStringToTreelist(dialog.NamedAnchorList, NamedAnchorNodeList.item(i).name);
function FillListboxes(){ var NamedAnchorNodeList = editorShell.editorDocument.anchors; var NamedAnchorCount = NamedAnchorNodeList.length; if (NamedAnchorCount > 0) { for (var i = 0; i < NamedAnchorCount; i++) { AppendStringToList(dialog.NamedAnchorList,NamedAnchorNodeList.item(i).name); } haveNamedAnchors = true; } else { // Message to tell user there are none AppendStringToList(dialog.NamedAnchorList,GetString("NoNamedAnchors")); dialog.NamedAnchorList.setAttribute("disabled", "true"); } var firstHeading = true; for (var j = 1; j <= 6; j++) { var headingList = editorShell.editorDocument.getElementsByTagName("h"+String(j)); if (headingList.length > 0) { var heading = headingList.item(0); // Skip headings that already have a named anchor as their first child // (this may miss nearby anchors, but at least we don't insert another // under the same heading) var child = heading.firstChild;// if( child && child.name )// dump(child.name+" = Child.name. Length="+child.name.length+"\n"); if (child && child.nodeName == "A" && child.name && (child.name.length>0)) { continue; } var range = editorShell.editorDocument.createRange(); range.setStart(heading,0); var lastChildIndex = heading.childNodes.length; range.setEnd(heading,lastChildIndex); var text = range.toString(); if (text) { // Use just first 40 characters, don't add "...", // and replace whitespace with "_" and strip non-word characters text = PrepareStringForURL(TruncateStringAtWordEnd(text, 40, false)); // Append "_" to any name already in the list if (GetExistingHeadingIndex(text) > -1) text += "_"; AppendStringToList(dialog.HeadingsList, text); // Save nodes in an array so we can create anchor node under it later if (!HNodeArray) HNodeArray = new Array(heading) else HNodeArray[HNodeArray.length] = heading; } } } if (HNodeArray) { haveHeadings = true; } else { // Message to tell user there are none AppendStringToList(dialog.HeadingsList,GetString("NoHeadings")); dialog.HeadingsList.setAttribute("disabled", "true"); }}
AppendStringToList(dialog.NamedAnchorList,GetString("NoNamedAnchors")); dialog.NamedAnchorList.setAttribute("disabled", "true");
var item = AppendStringToTreelistById(dialog.NamedAnchorList, "NoNamedAnchors"); if (item) item.setAttribute("disabled", "true");
function FillListboxes(){ var NamedAnchorNodeList = editorShell.editorDocument.anchors; var NamedAnchorCount = NamedAnchorNodeList.length; if (NamedAnchorCount > 0) { for (var i = 0; i < NamedAnchorCount; i++) { AppendStringToList(dialog.NamedAnchorList,NamedAnchorNodeList.item(i).name); } haveNamedAnchors = true; } else { // Message to tell user there are none AppendStringToList(dialog.NamedAnchorList,GetString("NoNamedAnchors")); dialog.NamedAnchorList.setAttribute("disabled", "true"); } var firstHeading = true; for (var j = 1; j <= 6; j++) { var headingList = editorShell.editorDocument.getElementsByTagName("h"+String(j)); if (headingList.length > 0) { var heading = headingList.item(0); // Skip headings that already have a named anchor as their first child // (this may miss nearby anchors, but at least we don't insert another // under the same heading) var child = heading.firstChild;// if( child && child.name )// dump(child.name+" = Child.name. Length="+child.name.length+"\n"); if (child && child.nodeName == "A" && child.name && (child.name.length>0)) { continue; } var range = editorShell.editorDocument.createRange(); range.setStart(heading,0); var lastChildIndex = heading.childNodes.length; range.setEnd(heading,lastChildIndex); var text = range.toString(); if (text) { // Use just first 40 characters, don't add "...", // and replace whitespace with "_" and strip non-word characters text = PrepareStringForURL(TruncateStringAtWordEnd(text, 40, false)); // Append "_" to any name already in the list if (GetExistingHeadingIndex(text) > -1) text += "_"; AppendStringToList(dialog.HeadingsList, text); // Save nodes in an array so we can create anchor node under it later if (!HNodeArray) HNodeArray = new Array(heading) else HNodeArray[HNodeArray.length] = heading; } } } if (HNodeArray) { haveHeadings = true; } else { // Message to tell user there are none AppendStringToList(dialog.HeadingsList,GetString("NoHeadings")); dialog.HeadingsList.setAttribute("disabled", "true"); }}
if (child && child.nodeName == "A" && child.name && (child.name.length>0)) {
if (child && child.nodeName == "A" && child.name && (child.name.length>0))
function FillListboxes(){ var NamedAnchorNodeList = editorShell.editorDocument.anchors; var NamedAnchorCount = NamedAnchorNodeList.length; if (NamedAnchorCount > 0) { for (var i = 0; i < NamedAnchorCount; i++) { AppendStringToList(dialog.NamedAnchorList,NamedAnchorNodeList.item(i).name); } haveNamedAnchors = true; } else { // Message to tell user there are none AppendStringToList(dialog.NamedAnchorList,GetString("NoNamedAnchors")); dialog.NamedAnchorList.setAttribute("disabled", "true"); } var firstHeading = true; for (var j = 1; j <= 6; j++) { var headingList = editorShell.editorDocument.getElementsByTagName("h"+String(j)); if (headingList.length > 0) { var heading = headingList.item(0); // Skip headings that already have a named anchor as their first child // (this may miss nearby anchors, but at least we don't insert another // under the same heading) var child = heading.firstChild;// if( child && child.name )// dump(child.name+" = Child.name. Length="+child.name.length+"\n"); if (child && child.nodeName == "A" && child.name && (child.name.length>0)) { continue; } var range = editorShell.editorDocument.createRange(); range.setStart(heading,0); var lastChildIndex = heading.childNodes.length; range.setEnd(heading,lastChildIndex); var text = range.toString(); if (text) { // Use just first 40 characters, don't add "...", // and replace whitespace with "_" and strip non-word characters text = PrepareStringForURL(TruncateStringAtWordEnd(text, 40, false)); // Append "_" to any name already in the list if (GetExistingHeadingIndex(text) > -1) text += "_"; AppendStringToList(dialog.HeadingsList, text); // Save nodes in an array so we can create anchor node under it later if (!HNodeArray) HNodeArray = new Array(heading) else HNodeArray[HNodeArray.length] = heading; } } } if (HNodeArray) { haveHeadings = true; } else { // Message to tell user there are none AppendStringToList(dialog.HeadingsList,GetString("NoHeadings")); dialog.HeadingsList.setAttribute("disabled", "true"); }}
}
function FillListboxes(){ var NamedAnchorNodeList = editorShell.editorDocument.anchors; var NamedAnchorCount = NamedAnchorNodeList.length; if (NamedAnchorCount > 0) { for (var i = 0; i < NamedAnchorCount; i++) { AppendStringToList(dialog.NamedAnchorList,NamedAnchorNodeList.item(i).name); } haveNamedAnchors = true; } else { // Message to tell user there are none AppendStringToList(dialog.NamedAnchorList,GetString("NoNamedAnchors")); dialog.NamedAnchorList.setAttribute("disabled", "true"); } var firstHeading = true; for (var j = 1; j <= 6; j++) { var headingList = editorShell.editorDocument.getElementsByTagName("h"+String(j)); if (headingList.length > 0) { var heading = headingList.item(0); // Skip headings that already have a named anchor as their first child // (this may miss nearby anchors, but at least we don't insert another // under the same heading) var child = heading.firstChild;// if( child && child.name )// dump(child.name+" = Child.name. Length="+child.name.length+"\n"); if (child && child.nodeName == "A" && child.name && (child.name.length>0)) { continue; } var range = editorShell.editorDocument.createRange(); range.setStart(heading,0); var lastChildIndex = heading.childNodes.length; range.setEnd(heading,lastChildIndex); var text = range.toString(); if (text) { // Use just first 40 characters, don't add "...", // and replace whitespace with "_" and strip non-word characters text = PrepareStringForURL(TruncateStringAtWordEnd(text, 40, false)); // Append "_" to any name already in the list if (GetExistingHeadingIndex(text) > -1) text += "_"; AppendStringToList(dialog.HeadingsList, text); // Save nodes in an array so we can create anchor node under it later if (!HNodeArray) HNodeArray = new Array(heading) else HNodeArray[HNodeArray.length] = heading; } } } if (HNodeArray) { haveHeadings = true; } else { // Message to tell user there are none AppendStringToList(dialog.HeadingsList,GetString("NoHeadings")); dialog.HeadingsList.setAttribute("disabled", "true"); }}
AppendStringToList(dialog.HeadingsList, text);
AppendStringToTreelist(dialog.HeadingsList, text);
function FillListboxes(){ var NamedAnchorNodeList = editorShell.editorDocument.anchors; var NamedAnchorCount = NamedAnchorNodeList.length; if (NamedAnchorCount > 0) { for (var i = 0; i < NamedAnchorCount; i++) { AppendStringToList(dialog.NamedAnchorList,NamedAnchorNodeList.item(i).name); } haveNamedAnchors = true; } else { // Message to tell user there are none AppendStringToList(dialog.NamedAnchorList,GetString("NoNamedAnchors")); dialog.NamedAnchorList.setAttribute("disabled", "true"); } var firstHeading = true; for (var j = 1; j <= 6; j++) { var headingList = editorShell.editorDocument.getElementsByTagName("h"+String(j)); if (headingList.length > 0) { var heading = headingList.item(0); // Skip headings that already have a named anchor as their first child // (this may miss nearby anchors, but at least we don't insert another // under the same heading) var child = heading.firstChild;// if( child && child.name )// dump(child.name+" = Child.name. Length="+child.name.length+"\n"); if (child && child.nodeName == "A" && child.name && (child.name.length>0)) { continue; } var range = editorShell.editorDocument.createRange(); range.setStart(heading,0); var lastChildIndex = heading.childNodes.length; range.setEnd(heading,lastChildIndex); var text = range.toString(); if (text) { // Use just first 40 characters, don't add "...", // and replace whitespace with "_" and strip non-word characters text = PrepareStringForURL(TruncateStringAtWordEnd(text, 40, false)); // Append "_" to any name already in the list if (GetExistingHeadingIndex(text) > -1) text += "_"; AppendStringToList(dialog.HeadingsList, text); // Save nodes in an array so we can create anchor node under it later if (!HNodeArray) HNodeArray = new Array(heading) else HNodeArray[HNodeArray.length] = heading; } } } if (HNodeArray) { haveHeadings = true; } else { // Message to tell user there are none AppendStringToList(dialog.HeadingsList,GetString("NoHeadings")); dialog.HeadingsList.setAttribute("disabled", "true"); }}
AppendStringToList(dialog.HeadingsList,GetString("NoHeadings")); dialog.HeadingsList.setAttribute("disabled", "true");
var item = AppendStringToTreelistById(dialog.HeadingsList, "NoHeadings"); if (item) item.setAttribute("disabled", "true");
function FillListboxes(){ var NamedAnchorNodeList = editorShell.editorDocument.anchors; var NamedAnchorCount = NamedAnchorNodeList.length; if (NamedAnchorCount > 0) { for (var i = 0; i < NamedAnchorCount; i++) { AppendStringToList(dialog.NamedAnchorList,NamedAnchorNodeList.item(i).name); } haveNamedAnchors = true; } else { // Message to tell user there are none AppendStringToList(dialog.NamedAnchorList,GetString("NoNamedAnchors")); dialog.NamedAnchorList.setAttribute("disabled", "true"); } var firstHeading = true; for (var j = 1; j <= 6; j++) { var headingList = editorShell.editorDocument.getElementsByTagName("h"+String(j)); if (headingList.length > 0) { var heading = headingList.item(0); // Skip headings that already have a named anchor as their first child // (this may miss nearby anchors, but at least we don't insert another // under the same heading) var child = heading.firstChild;// if( child && child.name )// dump(child.name+" = Child.name. Length="+child.name.length+"\n"); if (child && child.nodeName == "A" && child.name && (child.name.length>0)) { continue; } var range = editorShell.editorDocument.createRange(); range.setStart(heading,0); var lastChildIndex = heading.childNodes.length; range.setEnd(heading,lastChildIndex); var text = range.toString(); if (text) { // Use just first 40 characters, don't add "...", // and replace whitespace with "_" and strip non-word characters text = PrepareStringForURL(TruncateStringAtWordEnd(text, 40, false)); // Append "_" to any name already in the list if (GetExistingHeadingIndex(text) > -1) text += "_"; AppendStringToList(dialog.HeadingsList, text); // Save nodes in an array so we can create anchor node under it later if (!HNodeArray) HNodeArray = new Array(heading) else HNodeArray[HNodeArray.length] = heading; } } } if (HNodeArray) { haveHeadings = true; } else { // Message to tell user there are none AppendStringToList(dialog.HeadingsList,GetString("NoHeadings")); dialog.HeadingsList.setAttribute("disabled", "true"); }}
ShowMenuItem( "context-addemail", gContextMenu.onMailtoLink ); ShowMenuItem( "context-composeemailto", gContextMenu.onMailtoLink );
ShowMenuItem("context-addemail", gContextMenu.onMailtoLink ); ShowMenuItem("context-composeemailto", gContextMenu.onMailtoLink ); ShowMenuItem("reportPhishingURL", gContextMenu.onLink && !gContextMenu.onMailtoLink);
function fillMessagePaneContextMenu(){ var message = GetLoadedMessage(); var numSelected = (message) ? 1 : 0; var isNewsgroup = false; if (numSelected == 1) isNewsgroup = IsNewsMessage(message); // don't show mail items for links/images, just show related items. var hideMailItems = gContextMenu.onImage || gContextMenu.onLink; SetupEditAsNewMenuItem("messagePaneContext-editAsNew", numSelected, (numSelected == 0 || hideMailItems)); SetupReplyToSenderMenuItem("messagePaneContext-replySender", numSelected, (numSelected == 0 || hideMailItems)); SetupReplyToNewsgroupMenuItem("messagePaneContext-replyNewsgroup", numSelected, isNewsgroup, (numSelected == 0 || hideMailItems)); SetupReplyAllMenuItem("messagePaneContext-replyAll" , numSelected, (numSelected == 0 || hideMailItems)); SetupForwardMenuItem("messagePaneContext-forward", numSelected, (numSelected == 0 || hideMailItems)); SetupCopyMessageUrlMenuItem("messagePaneContext-copyMessageUrl", numSelected, isNewsgroup, (numSelected == 0 || hideMailItems)); SetupCopyMenuItem("messagePaneContext-copyMenu", numSelected, (numSelected == 0 || hideMailItems)); SetupMoveMenuItem("messagePaneContext-moveMenu", numSelected, isNewsgroup, (numSelected == 0 || hideMailItems)); SetupMoveToFolderAgainMenuItem("messagePaneContext-moveToFolderAgain", numSelected, (numSelected == 0 || hideMailItems)); SetupLabelsMenuItem("messagePaneContext-labels", numSelected, (numSelected == 0 || hideMailItems)); SetupMarkMenuItem("messagePaneContext-mark", numSelected, (numSelected == 0 || hideMailItems)); SetupTagMenuItem("messagePaneContext-tags", numSelected, (numSelected == 0 || hideMailItems)); SetupSaveAsMenuItem("messagePaneContext-saveAs", numSelected, (numSelected == 0 || hideMailItems));#ifdef XP_MACOSX SetupPrintPreviewMenuItem("messagePaneContext-printpreview", numSelected, true);#else SetupPrintPreviewMenuItem("messagePaneContext-printpreview", numSelected, (numSelected == 0 || hideMailItems));#endif SetupPrintMenuItem("messagePaneContext-print", numSelected, (numSelected == 0 || hideMailItems)); if (numSelected == 0 || hideMailItems) ShowMenuItem("messagePaneContext-delete", false) else { goUpdateCommand('cmd_delete'); ShowMenuItem("messagePaneContext-delete", true) } SetupAddSenderToABMenuItem("messagePaneContext-addSenderToAddressBook", numSelected, (numSelected == 0 || hideMailItems)); SetupAddAllToABMenuItem("messagePaneContext-addAllToAddressBook", numSelected, (numSelected == 0 || hideMailItems)); ShowMenuItem( "context-addemail", gContextMenu.onMailtoLink ); ShowMenuItem( "context-composeemailto", gContextMenu.onMailtoLink ); // if we are on an image, go ahead and show this separator //if (gContextMenu.onLink && !gContextMenu.onMailtoLink)// ShowMenuItem("messagePaneContext-sep-edit", false); //Figure out separators ShowMenuItem("messagePaneContext-sep-link", shouldShowSeparator("messagePaneContext-sep-link")); ShowMenuItem("messagePaneContext-sep-open", shouldShowSeparator("messagePaneContext-sep-open")); ShowMenuItem("messagePaneContext-sep-reply", shouldShowSeparator("messagePaneContext-sep-reply")); ShowMenuItem("messagePaneContext-sep-tags-1", shouldShowSeparator("messagePaneContext-sep-tags-1")); ShowMenuItem("messagePaneContext-sep-saveAs", shouldShowSeparator("messagePaneContext-sep-saveAs")); ShowMenuItem("messagePaneContext-sep-edit", shouldShowSeparator("messagePaneContext-sep-edit")); ShowMenuItem("messagePaneContext-sep-copy", shouldShowSeparator("messagePaneContext-sep-copy"));}
ShowMenuItem("messagePaneContext-sep-reportPhishing", shouldShowSeparator("messagePaneContext-sep-reportPhishing"));
function fillMessagePaneContextMenu(){ var message = GetLoadedMessage(); var numSelected = (message) ? 1 : 0; var isNewsgroup = false; if (numSelected == 1) isNewsgroup = IsNewsMessage(message); // don't show mail items for links/images, just show related items. var hideMailItems = gContextMenu.onImage || gContextMenu.onLink; SetupEditAsNewMenuItem("messagePaneContext-editAsNew", numSelected, (numSelected == 0 || hideMailItems)); SetupReplyToSenderMenuItem("messagePaneContext-replySender", numSelected, (numSelected == 0 || hideMailItems)); SetupReplyToNewsgroupMenuItem("messagePaneContext-replyNewsgroup", numSelected, isNewsgroup, (numSelected == 0 || hideMailItems)); SetupReplyAllMenuItem("messagePaneContext-replyAll" , numSelected, (numSelected == 0 || hideMailItems)); SetupForwardMenuItem("messagePaneContext-forward", numSelected, (numSelected == 0 || hideMailItems)); SetupCopyMessageUrlMenuItem("messagePaneContext-copyMessageUrl", numSelected, isNewsgroup, (numSelected == 0 || hideMailItems)); SetupCopyMenuItem("messagePaneContext-copyMenu", numSelected, (numSelected == 0 || hideMailItems)); SetupMoveMenuItem("messagePaneContext-moveMenu", numSelected, isNewsgroup, (numSelected == 0 || hideMailItems)); SetupMoveToFolderAgainMenuItem("messagePaneContext-moveToFolderAgain", numSelected, (numSelected == 0 || hideMailItems)); SetupLabelsMenuItem("messagePaneContext-labels", numSelected, (numSelected == 0 || hideMailItems)); SetupMarkMenuItem("messagePaneContext-mark", numSelected, (numSelected == 0 || hideMailItems)); SetupTagMenuItem("messagePaneContext-tags", numSelected, (numSelected == 0 || hideMailItems)); SetupSaveAsMenuItem("messagePaneContext-saveAs", numSelected, (numSelected == 0 || hideMailItems));#ifdef XP_MACOSX SetupPrintPreviewMenuItem("messagePaneContext-printpreview", numSelected, true);#else SetupPrintPreviewMenuItem("messagePaneContext-printpreview", numSelected, (numSelected == 0 || hideMailItems));#endif SetupPrintMenuItem("messagePaneContext-print", numSelected, (numSelected == 0 || hideMailItems)); if (numSelected == 0 || hideMailItems) ShowMenuItem("messagePaneContext-delete", false) else { goUpdateCommand('cmd_delete'); ShowMenuItem("messagePaneContext-delete", true) } SetupAddSenderToABMenuItem("messagePaneContext-addSenderToAddressBook", numSelected, (numSelected == 0 || hideMailItems)); SetupAddAllToABMenuItem("messagePaneContext-addAllToAddressBook", numSelected, (numSelected == 0 || hideMailItems)); ShowMenuItem( "context-addemail", gContextMenu.onMailtoLink ); ShowMenuItem( "context-composeemailto", gContextMenu.onMailtoLink ); // if we are on an image, go ahead and show this separator //if (gContextMenu.onLink && !gContextMenu.onMailtoLink)// ShowMenuItem("messagePaneContext-sep-edit", false); //Figure out separators ShowMenuItem("messagePaneContext-sep-link", shouldShowSeparator("messagePaneContext-sep-link")); ShowMenuItem("messagePaneContext-sep-open", shouldShowSeparator("messagePaneContext-sep-open")); ShowMenuItem("messagePaneContext-sep-reply", shouldShowSeparator("messagePaneContext-sep-reply")); ShowMenuItem("messagePaneContext-sep-tags-1", shouldShowSeparator("messagePaneContext-sep-tags-1")); ShowMenuItem("messagePaneContext-sep-saveAs", shouldShowSeparator("messagePaneContext-sep-saveAs")); ShowMenuItem("messagePaneContext-sep-edit", shouldShowSeparator("messagePaneContext-sep-edit")); ShowMenuItem("messagePaneContext-sep-copy", shouldShowSeparator("messagePaneContext-sep-copy"));}
#endif
function fillMessagePaneContextMenu(){ var message = GetLoadedMessage(); var numSelected = (message) ? 1 : 0; var isNewsgroup = false; if (numSelected == 1) isNewsgroup = IsNewsMessage(message); // don't show mail items for links/images, just show related items. var hideMailItems = gContextMenu.onImage || gContextMenu.onLink; SetupEditAsNewMenuItem("messagePaneContext-editAsNew", numSelected, (numSelected == 0 || hideMailItems)); SetupReplyToSenderMenuItem("messagePaneContext-replySender", numSelected, (numSelected == 0 || hideMailItems)); SetupReplyToNewsgroupMenuItem("messagePaneContext-replyNewsgroup", numSelected, isNewsgroup, (numSelected == 0 || hideMailItems)); SetupReplyAllMenuItem("messagePaneContext-replyAll" , numSelected, (numSelected == 0 || hideMailItems)); SetupForwardMenuItem("messagePaneContext-forward", numSelected, (numSelected == 0 || hideMailItems)); SetupCopyMessageUrlMenuItem("messagePaneContext-copyMessageUrl", numSelected, isNewsgroup, (numSelected == 0 || hideMailItems)); SetupCopyMenuItem("messagePaneContext-copyMenu", numSelected, (numSelected == 0 || hideMailItems)); SetupMoveMenuItem("messagePaneContext-moveMenu", numSelected, isNewsgroup, (numSelected == 0 || hideMailItems)); SetupLabelsMenuItem("messagePaneContext-labels", numSelected, (numSelected == 0 || hideMailItems)); SetupMarkMenuItem("messagePaneContext-mark", numSelected, (numSelected == 0 || hideMailItems)); SetupSaveAsMenuItem("messagePaneContext-saveAs", numSelected, (numSelected == 0 || hideMailItems)); SetupPrintPreviewMenuItem("messagePaneContext-printpreview", numSelected, (numSelected == 0 || hideMailItems)); SetupPrintMenuItem("messagePaneContext-print", numSelected, (numSelected == 0 || hideMailItems)); if (numSelected == 0 || hideMailItems) ShowMenuItem("messagePaneContext-delete", false) else { goUpdateCommand('cmd_delete'); ShowMenuItem("messagePaneContext-delete", true) } SetupAddSenderToABMenuItem("messagePaneContext-addSenderToAddressBook", numSelected, (numSelected == 0 || hideMailItems)); SetupAddAllToABMenuItem("messagePaneContext-addAllToAddressBook", numSelected, (numSelected == 0 || hideMailItems)); //Figure out separators ShowMenuItem("messagePaneContext-sep-open", ShowSeparator("messagePaneContext-sep-open")); ShowMenuItem("messagePaneContext-sep-reply", ShowSeparator("messagePaneContext-sep-reply")); ShowMenuItem("messagePaneContext-sep-edit", ShowSeparator("messagePaneContext-sep-edit") || gContextMenu.onMailtoLink); ShowMenuItem("messagePaneContext-sep-link", ShowSeparator("messagePaneContext-sep-link")); ShowMenuItem("messagePaneContext-sep-copy", ShowSeparator("messagePaneContext-sep-copy")); ShowMenuItem("messagePaneContext-sep-labels-1", ShowSeparator("messagePaneContext-sep-labels-1")); ShowMenuItem("messagePaneContext-sep-labels-2", ShowSeparator("messagePaneContext-sep-labels-2")); ShowMenuItem( "context-addemail", gContextMenu.onMailtoLink ); ShowMenuItem( "context-composeemailto", gContextMenu.onMailtoLink ); // if we are on an image, go ahead and show this separator if (gContextMenu.onLink && !gContextMenu.onMailtoLink) ShowMenuItem("messagePaneContext-sep-edit", false);}
var headingList = editorShell.editorDocument.getElementsByTagName("h2"); dump(headingList+" Count= "+headingList.length+"\n"); if (headingList.length > 0) { dump("HELLO\n"); var heading = headingList.item(0);
var NamedAnchorCount = NamedAnchorNodeList.length; if (NamedAnchorCount > 0) { NamedAnchorsIndex = 0; AppendStringToListByID(NamedAnchorList,"NamedAnchorsCaption"); for (var i = 0; i < NamedAnchorCount; i++) { AppendStringToList(NamedAnchorList," "+NamedAnchorNodeList.item(i).name); } } var firstHeading = true; for (var j = 1; j <= 6; j++) { var headingList = editorShell.editorDocument.getElementsByTagName("h"+String(j)); dump(headingList+" Count= "+headingList.length+"\n"); if (headingList.length > 0) { dump("HELLO\n"); var heading = headingList.item(0);
function FillNamedAnchorList(){ NamedAnchorNodeList = editorShell.editorDocument.anchors; var headingList = editorShell.editorDocument.getElementsByTagName("h2"); dump(headingList+" Count= "+headingList.length+"\n"); if (headingList.length > 0) { dump("HELLO\n"); var heading = headingList.item(0); var range = editorShell.editorDocument.createRange(); range.setStart(heading,0); var lastChildIndex = heading.childNodes.length; range.setEnd(heading,lastChildIndex); var text = range.toString(); dump("Range:"+range+" LastChildIndex = "+lastChildIndex+"\nText: "+text+"\n"); }}
var range = editorShell.editorDocument.createRange(); range.setStart(heading,0); var lastChildIndex = heading.childNodes.length; range.setEnd(heading,lastChildIndex); var text = range.toString(); dump("Range:"+range+" LastChildIndex = "+lastChildIndex+"\nText: "+text+"\n");
var child = heading.firstChild; dump(child.nodeName+" = Heading's first child nodeName\n"); if (child && child.nodeName == "a" && child.name && child.name.length > 0) continue; var range = editorShell.editorDocument.createRange(); range.setStart(heading,0); var lastChildIndex = heading.childNodes.length; range.setEnd(heading,lastChildIndex); var text = range.toString(); if (text) { if (firstHeading) { HeadingsIndex = NamedAnchorList.length; AppendStringToListByID(NamedAnchorList,"HeadingsCaption"); firstHeading = false; } text = PrepareStringForURL(TruncateStringAtWordEnd(text, 40, false)); if (GetExistingAnchorIndex(text) > -1) text += "_"; AppendStringToList(NamedAnchorList," "+text); dump("Heading text for Named Anchor: "+text+"\n"); if (!HNodeArray) HNodeArray = new Array(heading) else HNodeArray[HNodeArray.length] = heading; } }
function FillNamedAnchorList(){ NamedAnchorNodeList = editorShell.editorDocument.anchors; var headingList = editorShell.editorDocument.getElementsByTagName("h2"); dump(headingList+" Count= "+headingList.length+"\n"); if (headingList.length > 0) { dump("HELLO\n"); var heading = headingList.item(0); var range = editorShell.editorDocument.createRange(); range.setStart(heading,0); var lastChildIndex = heading.childNodes.length; range.setEnd(heading,lastChildIndex); var text = range.toString(); dump("Range:"+range+" LastChildIndex = "+lastChildIndex+"\nText: "+text+"\n"); }}
var blockedPopupsSeparator = document.getElementById("blockedPopupsSeparator");
blockedPopupsSeparator = document.getElementById("blockedPopupsSeparator");
fillPopupList: function (aEvent) { var bundle_browser = document.getElementById("bundle_browser"); // XXXben - rather than using |currentURI| here, which breaks down on multi-framed sites // we should really walk the pageReport and create a list of "allow for <host>" // menuitems for the common subset of hosts present in the report, this will // make us frame-safe. var uri = gBrowser.selectedBrowser.webNavigation.currentURI; var blockedPopupAllowSite = document.getElementById("blockedPopupAllowSite"); try { blockedPopupAllowSite.removeAttribute("hidden"); var pm = Components.classes["@mozilla.org/permissionmanager;1"] .getService(this._kIPM); if (pm.testPermission(uri, "popup") == this._kIPM.ALLOW_ACTION) { // Offer an item to block popups for this site, if a whitelist entry exists // already for it. var blockString = bundle_browser.getFormattedString("popupBlock", [uri.host]); blockedPopupAllowSite.setAttribute("label", blockString); blockedPopupAllowSite.setAttribute("block", "true"); } else { // Offer an item to allow popups for this site var allowString = bundle_browser.getFormattedString("popupAllow", [uri.host]); blockedPopupAllowSite.setAttribute("label", allowString); blockedPopupAllowSite.removeAttribute("block"); } } catch (e) { blockedPopupAllowSite.setAttribute("hidden", "true"); } var item = aEvent.target.lastChild; while (item && item.getAttribute("observes") != "blockedPopupsSeparator") { var next = item.previousSibling; item.parentNode.removeChild(item); item = next; } var pageReport = gBrowser.selectedBrowser.pageReport; if (pageReport && pageReport.length > 0) { var blockedPopupsSeparator = document.getElementById("blockedPopupsSeparator"); blockedPopupsSeparator.removeAttribute("hidden"); for (var i = 0; i < pageReport.length; ++i) { var popupURIspec = pageReport[i].popupWindowURI.spec; if (popupURIspec == "" || popupURIspec == "about:blank" || popupURIspec == uri.spec) continue; var menuitem = document.createElement("menuitem"); var label = bundle_browser.getFormattedString("popupShowPopupPrefix", [popupURIspec]); menuitem.setAttribute("label", label); menuitem.setAttribute("requestingWindowURI", pageReport[i].requestingWindowURI.spec); menuitem.setAttribute("popupWindowURI", popupURIspec); menuitem.setAttribute("popupWindowFeatures", pageReport[i].popupWindowFeatures); menuitem.setAttribute("oncommand", "gPopupBlockerObserver.showBlockedPopup(event);"); aEvent.target.appendChild(menuitem); } } else { var blockedPopupsSeparator = document.getElementById("blockedPopupsSeparator"); blockedPopupsSeparator.setAttribute("hidden", "true"); } var blockedPopupDontShowMessage = document.getElementById("blockedPopupDontShowMessage"); var showMessage = gPrefService.getBoolPref("privacy.popups.showBrowserMessage"); blockedPopupDontShowMessage.setAttribute("checked", !showMessage); if (aEvent.target.localName == "popup") blockedPopupDontShowMessage.setAttribute("label", bundle_browser.getString("popupWarningDontShowFromMessage")); else blockedPopupDontShowMessage.setAttribute("label", bundle_browser.getString("popupWarningDontShowFromStatusbar")); },
DisableUriFields(gCurrentDirectoryString + ".uri"); DisableElementIfPrefIsLocked(gCurrentDirectoryString + ".description", "description"); DisableElementIfPrefIsLocked(gCurrentDirectoryString + ".disable_button_download", "download"); DisableElementIfPrefIsLocked(gCurrentDirectoryString + ".maxHits", "results"); DisableElementIfPrefIsLocked(gCurrentDirectoryString + ".auth.dn", "login");
function fillSettings(){ gPrefInt = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); var ldapUrl = Components.classes["@mozilla.org/network/ldap-url;1"]; ldapUrl = ldapUrl.createInstance(). QueryInterface(Components.interfaces.nsILDAPURL); try { var prefValue = gPrefInt.getComplexValue(gCurrentDirectoryString + ".description", Components.interfaces.nsISupportsWString).data; } catch(ex) { prefValue=""; } document.getElementById("description").value = prefValue; ldapUrl.spec = gPrefInt.getComplexValue(gCurrentDirectoryString +".uri", Components.interfaces. nsISupportsWString).data; document.getElementById("hostname").value = ldapUrl.host; document.getElementById("port").value = ldapUrl.port; document.getElementById("basedn").value = gLdapService.UTF8toUCS2(ldapUrl.dn); document.getElementById("search").value = gLdapService.UTF8toUCS2(ldapUrl.filter); var sub = document.getElementById("sub"); switch(ldapUrl.scope) { case Components.interfaces.nsILDAPURL.SCOPE_ONELEVEL: sub.radioGroup.selectedItem = document.getElementById("one"); break; default: sub.radioGroup.selectedItem = sub; break; } if (ldapUrl.options & ldapUrl.OPT_SECURE) { document.getElementById("secure").setAttribute("checked", "true"); } try { prefValue = gPrefInt.getIntPref(gCurrentDirectoryString + ".maxHits"); } catch(ex) { prefValue = kDefaultMaxHits; } document.getElementById("results").value = prefValue; try { prefValue = gPrefInt.getComplexValue(gCurrentDirectoryString + ".auth.dn", Components.interfaces.nsISupportsWString).data; } catch(ex) { prefValue=""; } document.getElementById("login").value = prefValue;}
gPrefInt = Components.classes["@mozilla.org/preferences;1"]; gPrefInt = gPrefInt.getService(Components.interfaces.nsIPref);
gPrefInt = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch);
function fillSettings(){ try { gPrefInt = Components.classes["@mozilla.org/preferences;1"]; gPrefInt = gPrefInt.getService(Components.interfaces.nsIPref); } catch (ex) { dump("failed to get prefs service!\n"); gPrefInt = null; } try { var ldapUrl = Components.classes["@mozilla.org/network/ldap-url;1"]; ldapUrl = ldapUrl.createInstance(). QueryInterface(Components.interfaces.nsILDAPURL); } catch (ex) { dump("failed to get ldap url service!\n"); ldapUrl = null; } try{ var prefValue = gPrefInt.CopyUnicharPref(gCurrentDirectoryString +".description"); } catch(ex){ prefValue=""; } if (ldapUrl && prefValue) { document.getElementById("description").value = prefValue; try{ prefValue = gPrefInt.CopyCharPref(gCurrentDirectoryString +".uri"); } catch(ex){ prefValue=""; } if (prefValue) { ldapUrl.spec = prefValue; document.getElementById("hostname").value = ldapUrl.host; document.getElementById("port").value = ldapUrl.port; try { gLdapService = Components.classes[ "@mozilla.org/network/ldap-service;1"]. getService(Components.interfaces.nsILDAPService); } catch (ex) { dump("failed to get ldapService \n"); gLdapService = null; } if (gLdapService) { document.getElementById("basedn").value = gLdapService. UTF8toUCS2(ldapUrl.dn); document.getElementById("search").value = gLdapService. UTF8toUCS2(ldapUrl.filter); } switch(ldapUrl.scope) { case 1: document.getElementById("one").checked = true; break; default: document.getElementById("sub").checked = true; break; } } try { prefValue = gPrefInt.GetIntPref(gCurrentDirectoryString+ ".maxHits"); } catch(ex) { prefValue = gMaxHits; } document.getElementById("results").value = prefValue; }}
var prefValue = gPrefInt.CopyUnicharPref(gCurrentDirectoryString +".description");
var prefValue = gPrefInt.getComplexValue(gCurrentDirectoryString +".description", Components.interfaces.nsISupportsWString);
function fillSettings(){ try { gPrefInt = Components.classes["@mozilla.org/preferences;1"]; gPrefInt = gPrefInt.getService(Components.interfaces.nsIPref); } catch (ex) { dump("failed to get prefs service!\n"); gPrefInt = null; } try { var ldapUrl = Components.classes["@mozilla.org/network/ldap-url;1"]; ldapUrl = ldapUrl.createInstance(). QueryInterface(Components.interfaces.nsILDAPURL); } catch (ex) { dump("failed to get ldap url service!\n"); ldapUrl = null; } try{ var prefValue = gPrefInt.CopyUnicharPref(gCurrentDirectoryString +".description"); } catch(ex){ prefValue=""; } if (ldapUrl && prefValue) { document.getElementById("description").value = prefValue; try{ prefValue = gPrefInt.CopyCharPref(gCurrentDirectoryString +".uri"); } catch(ex){ prefValue=""; } if (prefValue) { ldapUrl.spec = prefValue; document.getElementById("hostname").value = ldapUrl.host; document.getElementById("port").value = ldapUrl.port; try { gLdapService = Components.classes[ "@mozilla.org/network/ldap-service;1"]. getService(Components.interfaces.nsILDAPService); } catch (ex) { dump("failed to get ldapService \n"); gLdapService = null; } if (gLdapService) { document.getElementById("basedn").value = gLdapService. UTF8toUCS2(ldapUrl.dn); document.getElementById("search").value = gLdapService. UTF8toUCS2(ldapUrl.filter); } switch(ldapUrl.scope) { case 1: document.getElementById("one").checked = true; break; default: document.getElementById("sub").checked = true; break; } } try { prefValue = gPrefInt.GetIntPref(gCurrentDirectoryString+ ".maxHits"); } catch(ex) { prefValue = gMaxHits; } document.getElementById("results").value = prefValue; }}
prefValue = gPrefInt.CopyCharPref(gCurrentDirectoryString +".uri");
prefValue = gPrefInt.getCharPref(gCurrentDirectoryString +".uri");
function fillSettings(){ try { gPrefInt = Components.classes["@mozilla.org/preferences;1"]; gPrefInt = gPrefInt.getService(Components.interfaces.nsIPref); } catch (ex) { dump("failed to get prefs service!\n"); gPrefInt = null; } try { var ldapUrl = Components.classes["@mozilla.org/network/ldap-url;1"]; ldapUrl = ldapUrl.createInstance(). QueryInterface(Components.interfaces.nsILDAPURL); } catch (ex) { dump("failed to get ldap url service!\n"); ldapUrl = null; } try{ var prefValue = gPrefInt.CopyUnicharPref(gCurrentDirectoryString +".description"); } catch(ex){ prefValue=""; } if (ldapUrl && prefValue) { document.getElementById("description").value = prefValue; try{ prefValue = gPrefInt.CopyCharPref(gCurrentDirectoryString +".uri"); } catch(ex){ prefValue=""; } if (prefValue) { ldapUrl.spec = prefValue; document.getElementById("hostname").value = ldapUrl.host; document.getElementById("port").value = ldapUrl.port; try { gLdapService = Components.classes[ "@mozilla.org/network/ldap-service;1"]. getService(Components.interfaces.nsILDAPService); } catch (ex) { dump("failed to get ldapService \n"); gLdapService = null; } if (gLdapService) { document.getElementById("basedn").value = gLdapService. UTF8toUCS2(ldapUrl.dn); document.getElementById("search").value = gLdapService. UTF8toUCS2(ldapUrl.filter); } switch(ldapUrl.scope) { case 1: document.getElementById("one").checked = true; break; default: document.getElementById("sub").checked = true; break; } } try { prefValue = gPrefInt.GetIntPref(gCurrentDirectoryString+ ".maxHits"); } catch(ex) { prefValue = gMaxHits; } document.getElementById("results").value = prefValue; }}
prefValue = gPrefInt.GetIntPref(gCurrentDirectoryString+ ".maxHits");
prefValue = gPrefInt.getIntPref(gCurrentDirectoryString+ ".maxHits");
function fillSettings(){ try { gPrefInt = Components.classes["@mozilla.org/preferences;1"]; gPrefInt = gPrefInt.getService(Components.interfaces.nsIPref); } catch (ex) { dump("failed to get prefs service!\n"); gPrefInt = null; } try { var ldapUrl = Components.classes["@mozilla.org/network/ldap-url;1"]; ldapUrl = ldapUrl.createInstance(). QueryInterface(Components.interfaces.nsILDAPURL); } catch (ex) { dump("failed to get ldap url service!\n"); ldapUrl = null; } try{ var prefValue = gPrefInt.CopyUnicharPref(gCurrentDirectoryString +".description"); } catch(ex){ prefValue=""; } if (ldapUrl && prefValue) { document.getElementById("description").value = prefValue; try{ prefValue = gPrefInt.CopyCharPref(gCurrentDirectoryString +".uri"); } catch(ex){ prefValue=""; } if (prefValue) { ldapUrl.spec = prefValue; document.getElementById("hostname").value = ldapUrl.host; document.getElementById("port").value = ldapUrl.port; try { gLdapService = Components.classes[ "@mozilla.org/network/ldap-service;1"]. getService(Components.interfaces.nsILDAPService); } catch (ex) { dump("failed to get ldapService \n"); gLdapService = null; } if (gLdapService) { document.getElementById("basedn").value = gLdapService. UTF8toUCS2(ldapUrl.dn); document.getElementById("search").value = gLdapService. UTF8toUCS2(ldapUrl.filter); } switch(ldapUrl.scope) { case 1: document.getElementById("one").checked = true; break; default: document.getElementById("sub").checked = true; break; } } try { prefValue = gPrefInt.GetIntPref(gCurrentDirectoryString+ ".maxHits"); } catch(ex) { prefValue = gMaxHits; } document.getElementById("results").value = prefValue; }}
function FillSuggestedList(firstWord)
function FillSuggestedList()
function FillSuggestedList(firstWord){ list = dialog.suggestedList; // Clear the current contents of the list ClearList(list); // We may have the initial word if (firstWord && firstWord != "") { dump("First Word = "+firstWord+"\n"); AppendStringToList(list, firstWord); } // Get suggested words until an empty string is returned do { word = spellChecker.GetSuggestedWord(); dump("Suggested Word = "+word+"\n"); if (word != "") { AppendStringToList(list, word); } } while (word != ""); if (list.length == 0) { // No suggestions - show a message but don't let user select it AppendStringToList(list, GetString("NoSuggestedWords")); allowSelectWord = false; } else { allowSelectWord = true; }}
list = dialog.suggestedList;
list = dialog.SuggestedList;
function FillSuggestedList(firstWord){ list = dialog.suggestedList; // Clear the current contents of the list ClearList(list); // We may have the initial word if (firstWord && firstWord != "") { dump("First Word = "+firstWord+"\n"); AppendStringToList(list, firstWord); } // Get suggested words until an empty string is returned do { word = spellChecker.GetSuggestedWord(); dump("Suggested Word = "+word+"\n"); if (word != "") { AppendStringToList(list, word); } } while (word != ""); if (list.length == 0) { // No suggestions - show a message but don't let user select it AppendStringToList(list, GetString("NoSuggestedWords")); allowSelectWord = false; } else { allowSelectWord = true; }}
if (firstWord && firstWord != "") { dump("First Word = "+firstWord+"\n"); AppendStringToList(list, firstWord); } do { word = spellChecker.GetSuggestedWord(); dump("Suggested Word = "+word+"\n"); if (word != "") { AppendStringToList(list, word);
if (MisspelledWord.length > 0) { do { word = spellChecker.GetSuggestedWord(); dump("Suggested Word = "+word+"\n"); if (word != "") { AppendStringToList(list, word); } } while (word != ""); if (list.length == 0) { AppendStringToList(list, GetString("NoSuggestedWords")); allowSelectWord = false; } else { allowSelectWord = true;
function FillSuggestedList(firstWord){ list = dialog.suggestedList; // Clear the current contents of the list ClearList(list); // We may have the initial word if (firstWord && firstWord != "") { dump("First Word = "+firstWord+"\n"); AppendStringToList(list, firstWord); } // Get suggested words until an empty string is returned do { word = spellChecker.GetSuggestedWord(); dump("Suggested Word = "+word+"\n"); if (word != "") { AppendStringToList(list, word); } } while (word != ""); if (list.length == 0) { // No suggestions - show a message but don't let user select it AppendStringToList(list, GetString("NoSuggestedWords")); allowSelectWord = false; } else { allowSelectWord = true; }}
} while (word != ""); if (list.length == 0) { AppendStringToList(list, GetString("NoSuggestedWords")); allowSelectWord = false; } else { allowSelectWord = true;
function FillSuggestedList(firstWord){ list = dialog.suggestedList; // Clear the current contents of the list ClearList(list); // We may have the initial word if (firstWord && firstWord != "") { dump("First Word = "+firstWord+"\n"); AppendStringToList(list, firstWord); } // Get suggested words until an empty string is returned do { word = spellChecker.GetSuggestedWord(); dump("Suggested Word = "+word+"\n"); if (word != "") { AppendStringToList(list, word); } } while (word != ""); if (list.length == 0) { // No suggestions - show a message but don't let user select it AppendStringToList(list, GetString("NoSuggestedWords")); allowSelectWord = false; } else { allowSelectWord = true; }}
dump(len+"=number of words in list\n");
function FillSuggestedList(){ list = dialog.SuggestedList; // Clear the current contents of the list ClearTreelist(list); if (MisspelledWord.length > 0) { // Get suggested words until an empty string is returned var count = 0; do { word = spellChecker.GetSuggestedWord(); dump("Suggested Word="+word+"|\n"); if (word.length > 0) { AppendStringToTreelist(list, word); count++; } } while (word.length > 0); var len = list.getAttribute("length");dump(len+"=number of words in list\n"); if (count == 0) { // No suggestions - show a message but don't let user select it var item = AppendStringToTreelistById(list, "NoSuggestedWords"); if (item) item.setAttribute("disabled", "true"); allowSelectWord = false; } else { allowSelectWord = true; } }}
SetReplaceEnable();
function FillSuggestedList(){ list = dialog.SuggestedList; // Clear the current contents of the list ClearTreelist(list); if (MisspelledWord.length > 0) { // Get suggested words until an empty string is returned var count = 0; do { word = spellChecker.GetSuggestedWord(); dump("Suggested Word="+word+"|\n"); if (word.length > 0) { AppendStringToTreelist(list, word); count++; } } while (word.length > 0); var len = list.getAttribute("length");dump(len+"=number of words in list\n"); if (count == 0) { // No suggestions - show a message but don't let user select it var item = AppendStringToTreelistById(list, "NoSuggestedWords"); if (item) item.setAttribute("disabled", "true"); allowSelectWord = false; } else { allowSelectWord = true; } }}
ClearList(list);
ClearTreelist(list);
function FillSuggestedList(){ list = dialog.SuggestedList; // Clear the current contents of the list ClearList(list); if (MisspelledWord.length > 0) { // Get suggested words until an empty string is returned do { word = spellChecker.GetSuggestedWord(); dump("Suggested Word = "+word+"\n"); if (word != "") { AppendStringToList(list, word); } } while (word != ""); if (list.length == 0) { // No suggestions - show a message but don't let user select it AppendStringToList(list, GetString("NoSuggestedWords")); allowSelectWord = false; } else { allowSelectWord = true; } }}
dump("Suggested Word = "+word+"\n"); if (word != "") { AppendStringToList(list, word);
dump("Suggested Word="+word+"|\n"); if (word.length > 0) { AppendStringToTreelist(list, word);
function FillSuggestedList(){ list = dialog.SuggestedList; // Clear the current contents of the list ClearList(list); if (MisspelledWord.length > 0) { // Get suggested words until an empty string is returned do { word = spellChecker.GetSuggestedWord(); dump("Suggested Word = "+word+"\n"); if (word != "") { AppendStringToList(list, word); } } while (word != ""); if (list.length == 0) { // No suggestions - show a message but don't let user select it AppendStringToList(list, GetString("NoSuggestedWords")); allowSelectWord = false; } else { allowSelectWord = true; } }}
} while (word != ""); if (list.length == 0) {
} while (word.length > 0); if (list.getAttribute("length") == 0) {
function FillSuggestedList(){ list = dialog.SuggestedList; // Clear the current contents of the list ClearList(list); if (MisspelledWord.length > 0) { // Get suggested words until an empty string is returned do { word = spellChecker.GetSuggestedWord(); dump("Suggested Word = "+word+"\n"); if (word != "") { AppendStringToList(list, word); } } while (word != ""); if (list.length == 0) { // No suggestions - show a message but don't let user select it AppendStringToList(list, GetString("NoSuggestedWords")); allowSelectWord = false; } else { allowSelectWord = true; } }}
AppendStringToList(list, GetString("NoSuggestedWords"));
var item = AppendStringToTreelistById(list, "NoSuggestedWords"); if (item) item.setAttribute("disabled", "true");
function FillSuggestedList(){ list = dialog.SuggestedList; // Clear the current contents of the list ClearList(list); if (MisspelledWord.length > 0) { // Get suggested words until an empty string is returned do { word = spellChecker.GetSuggestedWord(); dump("Suggested Word = "+word+"\n"); if (word != "") { AppendStringToList(list, word); } } while (word != ""); if (list.length == 0) { // No suggestions - show a message but don't let user select it AppendStringToList(list, GetString("NoSuggestedWords")); allowSelectWord = false; } else { allowSelectWord = true; } }}
EnableMenuItem('downloadSelected', GetNumSelectedMessages() > 0);
function fillThreadPaneContextMenu(){ var numSelected = GetNumSelectedMessages(); var isNewsgroup = false; var selectedMessage = null; // Clear the global var used to keep track if a 'Delete Message' or 'Move // To' command has been triggered via the thread pane context menu. gThreadPaneDeleteOrMoveOccurred = false; if(numSelected >= 0) { selectedMessage = GetFirstSelectedMessage(); isNewsgroup = IsNewsMessage(selectedMessage); } SetupNewMessageWindowMenuItem("threadPaneContext-openNewWindow", numSelected, false); SetupEditAsNewMenuItem("threadPaneContext-editAsNew", numSelected, false); ShowMenuItem("threadPaneContext-sep-open", (numSelected <= 1)); SetupReplyToSenderMenuItem("threadPaneContext-replySender", numSelected, false); SetupReplyToNewsgroupMenuItem("threadPaneContext-replyNewsgroup", numSelected, isNewsgroup, false); SetupReplyAllMenuItem("threadPaneContext-replyAll", numSelected, false); SetupForwardMenuItem("threadPaneContext-forward", numSelected, false); SetupForwardAsAttachmentMenuItem("threadPaneContext-forwardAsAttachment", numSelected, false); ShowMenuItem("threadPaneContext-sep-reply", true); SetupCopyMessageUrlMenuItem("threadPaneContext-copyMessageUrl", numSelected, isNewsgroup, numSelected != 1); SetupCopyMenuItem("threadPaneContext-copyMenu", numSelected, false); SetupMoveMenuItem("threadPaneContext-moveMenu", numSelected, isNewsgroup, false); SetupMoveToFolderAgainMenuItem("threadPaneContext-moveToFolderAgain", numSelected, false); EnableMenuItem("threadPaneContext-labels", (numSelected >= 1)); EnableMenuItem("threadPaneContext-mark", (numSelected >= 1)); SetupSaveAsMenuItem("threadPaneContext-saveAs", numSelected, false);#ifdef XP_MACOSX SetupPrintPreviewMenuItem("threadPaneContext-printpreview", numSelected, true);#else SetupPrintPreviewMenuItem("threadPaneContext-printpreview", numSelected, false);#endif SetupPrintMenuItem("threadPaneContext-print", numSelected, false); SetupDeleteMenuItem("threadPaneContext-delete", numSelected, false); SetupAddSenderToABMenuItem("threadPaneContext-addSenderToAddressBook", numSelected, false); SetupAddAllToABMenuItem("threadPaneContext-addAllToAddressBook", numSelected, false); ShowMenuItem("threadPaneContext-sep-edit", (numSelected <= 1)); return(true);}
#endif
function fillThreadPaneContextMenu(){ var numSelected = GetNumSelectedMessages(); var isNewsgroup = false; var selectedMessage = null; // Clear the global var used to keep track if a 'Delete Message' or 'Move // To' command has been triggered via the thread pane context menu. gThreadPaneDeleteOrMoveOccurred = false; if(numSelected >= 0) { selectedMessage = GetFirstSelectedMessage(); isNewsgroup = IsNewsMessage(selectedMessage); } SetupNewMessageWindowMenuItem("threadPaneContext-openNewWindow", numSelected, false); SetupEditAsNewMenuItem("threadPaneContext-editAsNew", numSelected, false); ShowMenuItem("threadPaneContext-sep-open", (numSelected <= 1)); SetupReplyToSenderMenuItem("threadPaneContext-replySender", numSelected, false); SetupReplyToNewsgroupMenuItem("threadPaneContext-replyNewsgroup", numSelected, isNewsgroup, false); SetupReplyAllMenuItem("threadPaneContext-replyAll", numSelected, false); SetupForwardMenuItem("threadPaneContext-forward", numSelected, false); SetupForwardAsAttachmentMenuItem("threadPaneContext-forwardAsAttachment", numSelected, false); ShowMenuItem("threadPaneContext-sep-reply", true); SetupCopyMessageUrlMenuItem("threadPaneContext-copyMessageUrl", numSelected, isNewsgroup, numSelected != 1); SetupCopyMenuItem("threadPaneContext-copyMenu", numSelected, false); SetupMoveMenuItem("threadPaneContext-moveMenu", numSelected, isNewsgroup, false); EnableMenuItem("threadPaneContext-labels", (numSelected >= 1)); EnableMenuItem("threadPaneContext-mark", (numSelected >= 1)); SetupSaveAsMenuItem("threadPaneContext-saveAs", numSelected, false); SetupPrintPreviewMenuItem("threadPaneContext-printpreview", numSelected, false); SetupPrintMenuItem("threadPaneContext-print", numSelected, false); SetupDeleteMenuItem("threadPaneContext-delete", numSelected, false); SetupAddSenderToABMenuItem("threadPaneContext-addSenderToAddressBook", numSelected, false); SetupAddAllToABMenuItem("threadPaneContext-addAllToAddressBook", numSelected, false); ShowMenuItem("threadPaneContext-sep-edit", (numSelected <= 1)); return(true);}
if (column_accesskey) item.setAttribute("accesskey", column_accesskey);
function fillViewMenu(popup){ var fill_after = document.getElementById('fill_after_this_node'); var fill_before = document.getElementById('fill_before_this_node'); var strBundle = document.getElementById('sortBundle'); var sortString; if (strBundle) sortString = strBundle.getString('SortMenuItems'); if (!sortString) sortString = "Sorted by %COLNAME%"; var firstTime = (fill_after.nextSibling == fill_before); if (firstTime) { var columns = document.getElementsByTagName('treecol'); for (var i = 0; i < columns.length; ++i) { var column = columns[i]; // Construct an entry for each cell in the row. var column_name = column.getAttribute("label"); var item = document.createElement("menuitem"); item.setAttribute("type", "radio"); item.setAttribute("name", "sort_column"); if (column_name == "") column_name = column.getAttribute("display"); var name = sortString.replace(/%COLNAME%/g, column_name); item.setAttribute("label", name); item.setAttribute("oncommand", "SortColumn('" + column.id + "');"); item.setAttribute("column_id", column.id); popup.insertBefore(item, fill_before); } } var sort_column = find_sort_column(); var sort_direction = find_sort_direction(sort_column); update_sort_menuitems(sort_column, sort_direction);}
var column_name = tree_column.getAttribute("value");
var column_name = tree_column.getAttribute("label");
function fillViewMenu(popup){ var fill_after = document.getElementById('fill_after_this_node'); var fill_before = document.getElementById('fill_before_this_node'); var columns = document.getElementById('theColumns'); var head = document.getElementById('headRow'); var skip_column = document.getElementById('popupCell'); var name_template = get_localized_string("SortMenuItem"); var tree_column = head.firstChild; var column_node = columns.firstChild; var popupChild = popup.firstChild.nextSibling.nextSibling; var firstTime = (fill_after.nextSibling == fill_before); while (tree_column) { if (firstTime) { if (skip_column != tree_column && tree_column.getAttribute("collapsed") != "true") { // Construct an entry for each cell in the row. var column_name = tree_column.getAttribute("value"); var item = document.createElement("menuitem"); item.setAttribute("type", "radio"); item.setAttribute("name", "sort_column"); if (column_name == "") column_name = tree_column.getAttribute("display"); var name = name_template.replace(/%NAME%/g, column_name); var id = column_node.id; item.setAttribute("value", name); item.setAttribute("oncommand", "SetSortColumn('"+id+"', true);"); item.setAttribute("column_id", id); popup.insertBefore(item, fill_before); } } else { if (column_node.getAttribute("collapsed") == "true") popupChild.setAttribute("hidden", "true"); else popupChild.removeAttribute("hidden"); popupChild = popupChild.nextSibling; } tree_column = tree_column.nextSibling; column_node = column_node.nextSibling; if (column_node && column_node.tagName == "splitter") column_node = column_node.nextSibling; } var sort_column = find_sort_column(); var sort_direction = find_sort_direction(sort_column); update_sort_menuitems(sort_column, sort_direction);}
item.setAttribute("value", name);
item.setAttribute("label", name);
function fillViewMenu(popup){ var fill_after = document.getElementById('fill_after_this_node'); var fill_before = document.getElementById('fill_before_this_node'); var columns = document.getElementById('theColumns'); var head = document.getElementById('headRow'); var skip_column = document.getElementById('popupCell'); var name_template = get_localized_string("SortMenuItem"); var tree_column = head.firstChild; var column_node = columns.firstChild; var popupChild = popup.firstChild.nextSibling.nextSibling; var firstTime = (fill_after.nextSibling == fill_before); while (tree_column) { if (firstTime) { if (skip_column != tree_column && tree_column.getAttribute("collapsed") != "true") { // Construct an entry for each cell in the row. var column_name = tree_column.getAttribute("value"); var item = document.createElement("menuitem"); item.setAttribute("type", "radio"); item.setAttribute("name", "sort_column"); if (column_name == "") column_name = tree_column.getAttribute("display"); var name = name_template.replace(/%NAME%/g, column_name); var id = column_node.id; item.setAttribute("value", name); item.setAttribute("oncommand", "SetSortColumn('"+id+"', true);"); item.setAttribute("column_id", id); popup.insertBefore(item, fill_before); } } else { if (column_node.getAttribute("collapsed") == "true") popupChild.setAttribute("hidden", "true"); else popupChild.removeAttribute("hidden"); popupChild = popupChild.nextSibling; } tree_column = tree_column.nextSibling; column_node = column_node.nextSibling; if (column_node && column_node.tagName == "splitter") column_node = column_node.nextSibling; } var sort_column = find_sort_column(); var sort_direction = find_sort_direction(sort_column); update_sort_menuitems(sort_column, sort_direction);}
view.selection.select(0);
if (view.rowCount > 0) view.selection.select(0);
function filterActions() { var filter = document.getElementById("filter").value; if (filter == "") { gDownloadActionsWindow.clearFilter(); return; } var view = gDownloadActionsWindow._view; view._filterSet = gDownloadActionsWindow._filterActions(filter); if (!view._filtered) { // Save Display Info for the Non-Filtered mode when we first // enter Filtered mode. gDownloadActionsWindow._saveState(); view._filtered = true; } // Clear the display gDownloadActionsWindow._updateRowCount(view._filterSet.length); view.selection.select(0); document.getElementById("actionsIntro").value = gDownloadActionsWindow._bundle.getString("actionsFiltered"); document.getElementById("clearFilter").disabled = false; }
view.selection.select(0);
if (view.rowCount > 0) view.selection.select(0);
function filterCookies() { var filter = document.getElementById("filter").value; if (filter == "") { gCookiesWindow.clearFilter(); return; } var view = gCookiesWindow._view; view._filterSet = gCookiesWindow._filterCookies(filter); if (!view._filtered) { // Save Display Info for the Non-Filtered mode when we first // enter Filtered mode. gCookiesWindow._saveState(); view._filtered = true; } // Move to multi-select in the tree gCookiesWindow._tree.setAttribute("seltype", "multiple"); // Clear the display var oldCount = view._rowCount; view._rowCount = 0; gCookiesWindow._tree.treeBoxObject.rowCountChanged(0, -oldCount); // Set up the filtered display view._rowCount = view._filterSet.length; gCookiesWindow._tree.treeBoxObject.rowCountChanged(0, view.rowCount); view.selection.select(0); document.getElementById("cookiesIntro").value = gCookiesWindow._bundle.getString("cookiesFiltered"); document.getElementById("clearFilter").disabled = false; }
onMore(null);
onMore(null, 0);
function filterEditorOnLoad(){ initializeSearchWidgets(); initializeFilterWidgets(); gPrefBranch = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService).getBranch(null); gFilterBundle = document.getElementById("bundle_filter"); InitMessageLabel(); if ("arguments" in window && window.arguments[0]) { var args = window.arguments[0]; if ("filterList" in args) { gFilterList = args.filterList; } if ("filter" in args) { // editing a filter gFilter = window.arguments[0].filter; initializeDialog(gFilter); } else { if (gFilterList) setSearchScope(getScopeFromFilterList(gFilterList)); // if doing prefill filter create a new filter and populate it. if ("filterName" in args) { gPreFillName = args.filterName; gFilter = gFilterList.createFilter(gPreFillName); var term = gFilter.createTerm(); term.attrib = Components.interfaces.nsMsgSearchAttrib.Sender; term.op = Components.interfaces.nsMsgSearchOp.Is; var termValue = term.value; termValue.attrib = term.attrib; termValue.str = gPreFillName; term.value = termValue; gFilter.appendTerm(term); // the default action for news filters is Delete // for everything else, it's MoveToFolder var filterAction = gFilter.createAction(); filterAction.type = (getScopeFromFilterList(gFilterList) == Components.interfaces.nsMsgSearchScope.newsFilter) ? nsMsgFilterAction.Delete : nsMsgFilterAction.MoveToFolder; gFilter.appendAction(filterAction); initializeDialog(gFilter); // Clear the default action added above now that the dialog is initialized. gFilter.clearActionList(); } else{ // fake the first more button press onMore(null); } } } if (!gFilter) { var stub = gFilterBundle.getString("untitledFilterName"); var count = 1; var name = stub; // Set the default filter name to be "Untitled Filter" while (duplicateFilterNameExists(name)) { count++; name = stub + " " + count.toString(); } gFilterNameElement.value = name; SetUpFilterActionList(getScopeFromFilterList(gFilterList)); } gFilterNameElement.select(); // This call is required on mac and linux. It has no effect // under win32. See bug 94800. gFilterNameElement.focus(); moveToAlertPosition();}
if ("filterList" in args) { gFilterList = args.filterList; }
if ("filterList" in args) gFilterList = args.filterList;
function filterEditorOnLoad(){ initializeSearchWidgets(); initializeFilterWidgets(); gPrefBranch = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService).getBranch(null); gFilterBundle = document.getElementById("bundle_filter"); InitMessageLabel(); if ("arguments" in window && window.arguments[0]) { var args = window.arguments[0]; if ("filterList" in args) { gFilterList = args.filterList; } if ("filter" in args) { // editing a filter gFilter = window.arguments[0].filter; initializeDialog(gFilter); PopulateTemplateMenu(); } else { if (gFilterList) setSearchScope(getScopeFromFilterList(gFilterList)); PopulateTemplateMenu(); // if doing prefill filter create a new filter and populate it. if ("filterName" in args) { gPreFillName = args.filterName; gFilter = gFilterList.createFilter(gPreFillName); var term = gFilter.createTerm(); term.attrib = Components.interfaces.nsMsgSearchAttrib.Sender; term.op = Components.interfaces.nsMsgSearchOp.Is; var termValue = term.value; termValue.attrib = term.attrib; termValue.str = gPreFillName; term.value = termValue; gFilter.appendTerm(term); // the default action for news filters is Delete // for everything else, it's MoveToFolder var filterAction = gFilter.createAction(); filterAction.type = (getScopeFromFilterList(gFilterList) == Components.interfaces.nsMsgSearchScope.newsFilter) ? nsMsgFilterAction.Delete : nsMsgFilterAction.MoveToFolder; gFilter.appendAction(filterAction); initializeDialog(gFilter); // Clear the default action added above now that the dialog is initialized. gFilter.clearActionList(); } else{ // fake the first more button press onMore(null); } } } if (!gFilter) { var stub = gFilterBundle.getString("untitledFilterName"); var count = 1; var name = stub; // Set the default filter name to be "Untitled Filter" while (duplicateFilterNameExists(name)) { count++; name = stub + " " + count.toString(); } gFilterNameElement.value = name; SetUpFilterActionList(getScopeFromFilterList(gFilterList)); } gFilterNameElement.select(); // This call is required on mac and linux. It has no effect // under win32. See bug 94800. gFilterNameElement.focus(); moveToAlertPosition();}
if ("filter" in args) { gFilter = window.arguments[0].filter; initializeDialog(gFilter); PopulateTemplateMenu(); } else { if (gFilterList) setSearchScope(getScopeFromFilterList(gFilterList));
if ("filter" in args) { gFilter = window.arguments[0].filter; initializeDialog(gFilter); } else { if (gFilterList) setSearchScope(getScopeFromFilterList(gFilterList)); if ("filterName" in args) { gPreFillName = args.filterName; gFilter = gFilterList.createFilter(gPreFillName); var term = gFilter.createTerm();
function filterEditorOnLoad(){ initializeSearchWidgets(); initializeFilterWidgets(); gPrefBranch = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService).getBranch(null); gFilterBundle = document.getElementById("bundle_filter"); InitMessageLabel(); if ("arguments" in window && window.arguments[0]) { var args = window.arguments[0]; if ("filterList" in args) { gFilterList = args.filterList; } if ("filter" in args) { // editing a filter gFilter = window.arguments[0].filter; initializeDialog(gFilter); PopulateTemplateMenu(); } else { if (gFilterList) setSearchScope(getScopeFromFilterList(gFilterList)); PopulateTemplateMenu(); // if doing prefill filter create a new filter and populate it. if ("filterName" in args) { gPreFillName = args.filterName; gFilter = gFilterList.createFilter(gPreFillName); var term = gFilter.createTerm(); term.attrib = Components.interfaces.nsMsgSearchAttrib.Sender; term.op = Components.interfaces.nsMsgSearchOp.Is; var termValue = term.value; termValue.attrib = term.attrib; termValue.str = gPreFillName; term.value = termValue; gFilter.appendTerm(term); // the default action for news filters is Delete // for everything else, it's MoveToFolder var filterAction = gFilter.createAction(); filterAction.type = (getScopeFromFilterList(gFilterList) == Components.interfaces.nsMsgSearchScope.newsFilter) ? nsMsgFilterAction.Delete : nsMsgFilterAction.MoveToFolder; gFilter.appendAction(filterAction); initializeDialog(gFilter); // Clear the default action added above now that the dialog is initialized. gFilter.clearActionList(); } else{ // fake the first more button press onMore(null); } } } if (!gFilter) { var stub = gFilterBundle.getString("untitledFilterName"); var count = 1; var name = stub; // Set the default filter name to be "Untitled Filter" while (duplicateFilterNameExists(name)) { count++; name = stub + " " + count.toString(); } gFilterNameElement.value = name; SetUpFilterActionList(getScopeFromFilterList(gFilterList)); } gFilterNameElement.select(); // This call is required on mac and linux. It has no effect // under win32. See bug 94800. gFilterNameElement.focus(); moveToAlertPosition();}
PopulateTemplateMenu(); if ("filterName" in args) { gPreFillName = args.filterName; gFilter = gFilterList.createFilter(gPreFillName); var term = gFilter.createTerm();
term.attrib = Components.interfaces.nsMsgSearchAttrib.Sender; term.op = Components.interfaces.nsMsgSearchOp.Is;
function filterEditorOnLoad(){ initializeSearchWidgets(); initializeFilterWidgets(); gPrefBranch = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService).getBranch(null); gFilterBundle = document.getElementById("bundle_filter"); InitMessageLabel(); if ("arguments" in window && window.arguments[0]) { var args = window.arguments[0]; if ("filterList" in args) { gFilterList = args.filterList; } if ("filter" in args) { // editing a filter gFilter = window.arguments[0].filter; initializeDialog(gFilter); PopulateTemplateMenu(); } else { if (gFilterList) setSearchScope(getScopeFromFilterList(gFilterList)); PopulateTemplateMenu(); // if doing prefill filter create a new filter and populate it. if ("filterName" in args) { gPreFillName = args.filterName; gFilter = gFilterList.createFilter(gPreFillName); var term = gFilter.createTerm(); term.attrib = Components.interfaces.nsMsgSearchAttrib.Sender; term.op = Components.interfaces.nsMsgSearchOp.Is; var termValue = term.value; termValue.attrib = term.attrib; termValue.str = gPreFillName; term.value = termValue; gFilter.appendTerm(term); // the default action for news filters is Delete // for everything else, it's MoveToFolder var filterAction = gFilter.createAction(); filterAction.type = (getScopeFromFilterList(gFilterList) == Components.interfaces.nsMsgSearchScope.newsFilter) ? nsMsgFilterAction.Delete : nsMsgFilterAction.MoveToFolder; gFilter.appendAction(filterAction); initializeDialog(gFilter); // Clear the default action added above now that the dialog is initialized. gFilter.clearActionList(); } else{ // fake the first more button press onMore(null); } } } if (!gFilter) { var stub = gFilterBundle.getString("untitledFilterName"); var count = 1; var name = stub; // Set the default filter name to be "Untitled Filter" while (duplicateFilterNameExists(name)) { count++; name = stub + " " + count.toString(); } gFilterNameElement.value = name; SetUpFilterActionList(getScopeFromFilterList(gFilterList)); } gFilterNameElement.select(); // This call is required on mac and linux. It has no effect // under win32. See bug 94800. gFilterNameElement.focus(); moveToAlertPosition();}
term.attrib = Components.interfaces.nsMsgSearchAttrib.Sender; term.op = Components.interfaces.nsMsgSearchOp.Is;
var termValue = term.value; termValue.attrib = term.attrib; termValue.str = gPreFillName;
function filterEditorOnLoad(){ initializeSearchWidgets(); initializeFilterWidgets(); gPrefBranch = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService).getBranch(null); gFilterBundle = document.getElementById("bundle_filter"); InitMessageLabel(); if ("arguments" in window && window.arguments[0]) { var args = window.arguments[0]; if ("filterList" in args) { gFilterList = args.filterList; } if ("filter" in args) { // editing a filter gFilter = window.arguments[0].filter; initializeDialog(gFilter); PopulateTemplateMenu(); } else { if (gFilterList) setSearchScope(getScopeFromFilterList(gFilterList)); PopulateTemplateMenu(); // if doing prefill filter create a new filter and populate it. if ("filterName" in args) { gPreFillName = args.filterName; gFilter = gFilterList.createFilter(gPreFillName); var term = gFilter.createTerm(); term.attrib = Components.interfaces.nsMsgSearchAttrib.Sender; term.op = Components.interfaces.nsMsgSearchOp.Is; var termValue = term.value; termValue.attrib = term.attrib; termValue.str = gPreFillName; term.value = termValue; gFilter.appendTerm(term); // the default action for news filters is Delete // for everything else, it's MoveToFolder var filterAction = gFilter.createAction(); filterAction.type = (getScopeFromFilterList(gFilterList) == Components.interfaces.nsMsgSearchScope.newsFilter) ? nsMsgFilterAction.Delete : nsMsgFilterAction.MoveToFolder; gFilter.appendAction(filterAction); initializeDialog(gFilter); // Clear the default action added above now that the dialog is initialized. gFilter.clearActionList(); } else{ // fake the first more button press onMore(null); } } } if (!gFilter) { var stub = gFilterBundle.getString("untitledFilterName"); var count = 1; var name = stub; // Set the default filter name to be "Untitled Filter" while (duplicateFilterNameExists(name)) { count++; name = stub + " " + count.toString(); } gFilterNameElement.value = name; SetUpFilterActionList(getScopeFromFilterList(gFilterList)); } gFilterNameElement.select(); // This call is required on mac and linux. It has no effect // under win32. See bug 94800. gFilterNameElement.focus(); moveToAlertPosition();}
var termValue = term.value; termValue.attrib = term.attrib; termValue.str = gPreFillName;
term.value = termValue;
function filterEditorOnLoad(){ initializeSearchWidgets(); initializeFilterWidgets(); gPrefBranch = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService).getBranch(null); gFilterBundle = document.getElementById("bundle_filter"); InitMessageLabel(); if ("arguments" in window && window.arguments[0]) { var args = window.arguments[0]; if ("filterList" in args) { gFilterList = args.filterList; } if ("filter" in args) { // editing a filter gFilter = window.arguments[0].filter; initializeDialog(gFilter); PopulateTemplateMenu(); } else { if (gFilterList) setSearchScope(getScopeFromFilterList(gFilterList)); PopulateTemplateMenu(); // if doing prefill filter create a new filter and populate it. if ("filterName" in args) { gPreFillName = args.filterName; gFilter = gFilterList.createFilter(gPreFillName); var term = gFilter.createTerm(); term.attrib = Components.interfaces.nsMsgSearchAttrib.Sender; term.op = Components.interfaces.nsMsgSearchOp.Is; var termValue = term.value; termValue.attrib = term.attrib; termValue.str = gPreFillName; term.value = termValue; gFilter.appendTerm(term); // the default action for news filters is Delete // for everything else, it's MoveToFolder var filterAction = gFilter.createAction(); filterAction.type = (getScopeFromFilterList(gFilterList) == Components.interfaces.nsMsgSearchScope.newsFilter) ? nsMsgFilterAction.Delete : nsMsgFilterAction.MoveToFolder; gFilter.appendAction(filterAction); initializeDialog(gFilter); // Clear the default action added above now that the dialog is initialized. gFilter.clearActionList(); } else{ // fake the first more button press onMore(null); } } } if (!gFilter) { var stub = gFilterBundle.getString("untitledFilterName"); var count = 1; var name = stub; // Set the default filter name to be "Untitled Filter" while (duplicateFilterNameExists(name)) { count++; name = stub + " " + count.toString(); } gFilterNameElement.value = name; SetUpFilterActionList(getScopeFromFilterList(gFilterList)); } gFilterNameElement.select(); // This call is required on mac and linux. It has no effect // under win32. See bug 94800. gFilterNameElement.focus(); moveToAlertPosition();}
term.value = termValue;
gFilter.appendTerm(term);
function filterEditorOnLoad(){ initializeSearchWidgets(); initializeFilterWidgets(); gPrefBranch = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService).getBranch(null); gFilterBundle = document.getElementById("bundle_filter"); InitMessageLabel(); if ("arguments" in window && window.arguments[0]) { var args = window.arguments[0]; if ("filterList" in args) { gFilterList = args.filterList; } if ("filter" in args) { // editing a filter gFilter = window.arguments[0].filter; initializeDialog(gFilter); PopulateTemplateMenu(); } else { if (gFilterList) setSearchScope(getScopeFromFilterList(gFilterList)); PopulateTemplateMenu(); // if doing prefill filter create a new filter and populate it. if ("filterName" in args) { gPreFillName = args.filterName; gFilter = gFilterList.createFilter(gPreFillName); var term = gFilter.createTerm(); term.attrib = Components.interfaces.nsMsgSearchAttrib.Sender; term.op = Components.interfaces.nsMsgSearchOp.Is; var termValue = term.value; termValue.attrib = term.attrib; termValue.str = gPreFillName; term.value = termValue; gFilter.appendTerm(term); // the default action for news filters is Delete // for everything else, it's MoveToFolder var filterAction = gFilter.createAction(); filterAction.type = (getScopeFromFilterList(gFilterList) == Components.interfaces.nsMsgSearchScope.newsFilter) ? nsMsgFilterAction.Delete : nsMsgFilterAction.MoveToFolder; gFilter.appendAction(filterAction); initializeDialog(gFilter); // Clear the default action added above now that the dialog is initialized. gFilter.clearActionList(); } else{ // fake the first more button press onMore(null); } } } if (!gFilter) { var stub = gFilterBundle.getString("untitledFilterName"); var count = 1; var name = stub; // Set the default filter name to be "Untitled Filter" while (duplicateFilterNameExists(name)) { count++; name = stub + " " + count.toString(); } gFilterNameElement.value = name; SetUpFilterActionList(getScopeFromFilterList(gFilterList)); } gFilterNameElement.select(); // This call is required on mac and linux. It has no effect // under win32. See bug 94800. gFilterNameElement.focus(); moveToAlertPosition();}
gFilter.appendTerm(term);
var filterAction = gFilter.createAction(); filterAction.type = (getScopeFromFilterList(gFilterList) == Components.interfaces.nsMsgSearchScope.newsFilter) ? nsMsgFilterAction.Delete : nsMsgFilterAction.MoveToFolder; gFilter.appendAction(filterAction); initializeDialog(gFilter); gFilter.clearActionList(); } else { onMore(null); } } }
function filterEditorOnLoad(){ initializeSearchWidgets(); initializeFilterWidgets(); gPrefBranch = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService).getBranch(null); gFilterBundle = document.getElementById("bundle_filter"); InitMessageLabel(); if ("arguments" in window && window.arguments[0]) { var args = window.arguments[0]; if ("filterList" in args) { gFilterList = args.filterList; } if ("filter" in args) { // editing a filter gFilter = window.arguments[0].filter; initializeDialog(gFilter); PopulateTemplateMenu(); } else { if (gFilterList) setSearchScope(getScopeFromFilterList(gFilterList)); PopulateTemplateMenu(); // if doing prefill filter create a new filter and populate it. if ("filterName" in args) { gPreFillName = args.filterName; gFilter = gFilterList.createFilter(gPreFillName); var term = gFilter.createTerm(); term.attrib = Components.interfaces.nsMsgSearchAttrib.Sender; term.op = Components.interfaces.nsMsgSearchOp.Is; var termValue = term.value; termValue.attrib = term.attrib; termValue.str = gPreFillName; term.value = termValue; gFilter.appendTerm(term); // the default action for news filters is Delete // for everything else, it's MoveToFolder var filterAction = gFilter.createAction(); filterAction.type = (getScopeFromFilterList(gFilterList) == Components.interfaces.nsMsgSearchScope.newsFilter) ? nsMsgFilterAction.Delete : nsMsgFilterAction.MoveToFolder; gFilter.appendAction(filterAction); initializeDialog(gFilter); // Clear the default action added above now that the dialog is initialized. gFilter.clearActionList(); } else{ // fake the first more button press onMore(null); } } } if (!gFilter) { var stub = gFilterBundle.getString("untitledFilterName"); var count = 1; var name = stub; // Set the default filter name to be "Untitled Filter" while (duplicateFilterNameExists(name)) { count++; name = stub + " " + count.toString(); } gFilterNameElement.value = name; SetUpFilterActionList(getScopeFromFilterList(gFilterList)); } gFilterNameElement.select(); // This call is required on mac and linux. It has no effect // under win32. See bug 94800. gFilterNameElement.focus(); moveToAlertPosition();}
var filterAction = gFilter.createAction(); filterAction.type = (getScopeFromFilterList(gFilterList) == Components.interfaces.nsMsgSearchScope.newsFilter) ? nsMsgFilterAction.Delete : nsMsgFilterAction.MoveToFolder; gFilter.appendAction(filterAction); initializeDialog(gFilter); gFilter.clearActionList(); } else{ onMore(null); } }
ensureActionRow(); if (!gFilter) { var stub = gFilterBundle.getString("untitledFilterName"); var count = 1; var name = stub; while (duplicateFilterNameExists(name)) { count++; name = stub + " " + count.toString();
function filterEditorOnLoad(){ initializeSearchWidgets(); initializeFilterWidgets(); gPrefBranch = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService).getBranch(null); gFilterBundle = document.getElementById("bundle_filter"); InitMessageLabel(); if ("arguments" in window && window.arguments[0]) { var args = window.arguments[0]; if ("filterList" in args) { gFilterList = args.filterList; } if ("filter" in args) { // editing a filter gFilter = window.arguments[0].filter; initializeDialog(gFilter); PopulateTemplateMenu(); } else { if (gFilterList) setSearchScope(getScopeFromFilterList(gFilterList)); PopulateTemplateMenu(); // if doing prefill filter create a new filter and populate it. if ("filterName" in args) { gPreFillName = args.filterName; gFilter = gFilterList.createFilter(gPreFillName); var term = gFilter.createTerm(); term.attrib = Components.interfaces.nsMsgSearchAttrib.Sender; term.op = Components.interfaces.nsMsgSearchOp.Is; var termValue = term.value; termValue.attrib = term.attrib; termValue.str = gPreFillName; term.value = termValue; gFilter.appendTerm(term); // the default action for news filters is Delete // for everything else, it's MoveToFolder var filterAction = gFilter.createAction(); filterAction.type = (getScopeFromFilterList(gFilterList) == Components.interfaces.nsMsgSearchScope.newsFilter) ? nsMsgFilterAction.Delete : nsMsgFilterAction.MoveToFolder; gFilter.appendAction(filterAction); initializeDialog(gFilter); // Clear the default action added above now that the dialog is initialized. gFilter.clearActionList(); } else{ // fake the first more button press onMore(null); } } } if (!gFilter) { var stub = gFilterBundle.getString("untitledFilterName"); var count = 1; var name = stub; // Set the default filter name to be "Untitled Filter" while (duplicateFilterNameExists(name)) { count++; name = stub + " " + count.toString(); } gFilterNameElement.value = name; SetUpFilterActionList(getScopeFromFilterList(gFilterList)); } gFilterNameElement.select(); // This call is required on mac and linux. It has no effect // under win32. See bug 94800. gFilterNameElement.focus(); moveToAlertPosition();}
if (!gFilter) { var stub = gFilterBundle.getString("untitledFilterName"); var count = 1; var name = stub; while (duplicateFilterNameExists(name)) { count++; name = stub + " " + count.toString(); } gFilterNameElement.value = name; SetUpFilterActionList(getScopeFromFilterList(gFilterList)); } gFilterNameElement.select(); gFilterNameElement.focus(); moveToAlertPosition();
gFilterNameElement.select(); gFilterNameElement.focus(); moveToAlertPosition();
function filterEditorOnLoad(){ initializeSearchWidgets(); initializeFilterWidgets(); gPrefBranch = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService).getBranch(null); gFilterBundle = document.getElementById("bundle_filter"); InitMessageLabel(); if ("arguments" in window && window.arguments[0]) { var args = window.arguments[0]; if ("filterList" in args) { gFilterList = args.filterList; } if ("filter" in args) { // editing a filter gFilter = window.arguments[0].filter; initializeDialog(gFilter); PopulateTemplateMenu(); } else { if (gFilterList) setSearchScope(getScopeFromFilterList(gFilterList)); PopulateTemplateMenu(); // if doing prefill filter create a new filter and populate it. if ("filterName" in args) { gPreFillName = args.filterName; gFilter = gFilterList.createFilter(gPreFillName); var term = gFilter.createTerm(); term.attrib = Components.interfaces.nsMsgSearchAttrib.Sender; term.op = Components.interfaces.nsMsgSearchOp.Is; var termValue = term.value; termValue.attrib = term.attrib; termValue.str = gPreFillName; term.value = termValue; gFilter.appendTerm(term); // the default action for news filters is Delete // for everything else, it's MoveToFolder var filterAction = gFilter.createAction(); filterAction.type = (getScopeFromFilterList(gFilterList) == Components.interfaces.nsMsgSearchScope.newsFilter) ? nsMsgFilterAction.Delete : nsMsgFilterAction.MoveToFolder; gFilter.appendAction(filterAction); initializeDialog(gFilter); // Clear the default action added above now that the dialog is initialized. gFilter.clearActionList(); } else{ // fake the first more button press onMore(null); } } } if (!gFilter) { var stub = gFilterBundle.getString("untitledFilterName"); var count = 1; var name = stub; // Set the default filter name to be "Untitled Filter" while (duplicateFilterNameExists(name)) { count++; name = stub + " " + count.toString(); } gFilterNameElement.value = name; SetUpFilterActionList(getScopeFromFilterList(gFilterList)); } gFilterNameElement.select(); // This call is required on mac and linux. It has no effect // under win32. See bug 94800. gFilterNameElement.focus(); moveToAlertPosition();}
getJunkmailComponent(); gJunkmailComponent.startBatch();
function filterFolderForJunk(){ MsgJunkMailInfo(true); var view = GetDBView(); // need to expand all threads, so we analyze everything view.doCommand(nsMsgViewCommandType.expandAll); var treeView = view.QueryInterface(Components.interfaces.nsITreeView); var count = treeView.rowCount; if (!count) return; var junkMsgsArray = new Array; var tmpMsgURI = view.getURIForViewIndex(0); var tmpMsgHdr = messenger.messageServiceFromURI(tmpMsgURI).messageURIToMsgHdr(tmpMsgURI); var spamSettings = tmpMsgHdr.folder.server.spamSettings; var whiteListDirectory; if (spamSettings.useWhiteList && spamSettings.whiteListAbURI) whiteListDirectory = RDF.GetResource(spamSettings.whiteListAbURI).QueryInterface(Components.interfaces.nsIAbMDBDirectory); getJunkmailComponent(); gJunkmailComponent.startBatch(); for (var i = 0; i < count; i++) { var msgIndex = i; var msgURI = view.getURIForViewIndex(i); var msgHdr = messenger.messageServiceFromURI(msgURI).messageURIToMsgHdr(msgURI); analyzeMessageForJunk(msgHdr,msgIndex,junkMsgsArray,(i == count-1),whiteListDirectory); }}
return ucConvertOutgoingMessage(msg);
return msg;
function filterOutput (msg, msgtype){ if ("outputFilters" in client) { for (var f in client.outputFilters) { if (client.outputFilters[f].enabled) msg = client.outputFilters[f].func(msg, msgtype); } } return ucConvertOutgoingMessage(msg);}
var substring = document.getElementById("textbox").value.toString();
var substring = document.getElementById("textbox").value.toLowerCase();
function FilterPrefs(){ var substring = document.getElementById("textbox").value.toString(); var prefCol = view.selection.currentIndex < 0 ? null : gPrefView[view.selection.currentIndex].prefCol; var array = gPrefView; gPrefView = gPrefArray; if (substring) { gPrefView = []; for (var i = 0; i < gPrefArray.length; ++i) if (gPrefArray[i].prefCol.toLowerCase().indexOf(substring) >= 0) gPrefView.push(gPrefArray[i]); if (gFastIndex < gPrefArray.length) gPrefView.sort(gSortFunction); } view.treebox.invalidate(); view.treebox.rowCountChanged(array.length, gPrefView.length - array.length); gotoPref(prefCol); document.getElementById("button").disabled = !substring;}
var substring = document.getElementById("textbox").value.toLowerCase();
var substring = document.getElementById("textbox").value; var rex; if (substring.charAt(0) == '/') { var r = substring.match(/^\/(.*)\/(i?)$/); try { rex = RegExp(r[1], r[2]); } catch (e) { return; } }
function FilterPrefs(){ var substring = document.getElementById("textbox").value.toLowerCase(); var prefCol = view.selection.currentIndex < 0 ? null : gPrefView[view.selection.currentIndex].prefCol; var array = gPrefView; gPrefView = gPrefArray; if (substring) { gPrefView = []; for (var i = 0; i < gPrefArray.length; ++i) if (gPrefArray[i].prefCol.toLowerCase().indexOf(substring) >= 0) gPrefView.push(gPrefArray[i]); if (gFastIndex < gPrefArray.length) gPrefView.sort(gSortFunction); } view.treebox.invalidate(); view.treebox.rowCountChanged(array.length, gPrefView.length - array.length); gotoPref(prefCol); document.getElementById("button").disabled = !substring;}
var array = gPrefView;
var oldlen = gPrefView.length;
function FilterPrefs(){ var substring = document.getElementById("textbox").value.toLowerCase(); var prefCol = view.selection.currentIndex < 0 ? null : gPrefView[view.selection.currentIndex].prefCol; var array = gPrefView; gPrefView = gPrefArray; if (substring) { gPrefView = []; for (var i = 0; i < gPrefArray.length; ++i) if (gPrefArray[i].prefCol.toLowerCase().indexOf(substring) >= 0) gPrefView.push(gPrefArray[i]); if (gFastIndex < gPrefArray.length) gPrefView.sort(gSortFunction); } view.treebox.invalidate(); view.treebox.rowCountChanged(array.length, gPrefView.length - array.length); gotoPref(prefCol); document.getElementById("button").disabled = !substring;}
if (gPrefArray[i].prefCol.toLowerCase().indexOf(substring) >= 0)
if (rex.test(gPrefArray[i].prefCol + ";" + gPrefArray[i].valueCol))
function FilterPrefs(){ var substring = document.getElementById("textbox").value.toLowerCase(); var prefCol = view.selection.currentIndex < 0 ? null : gPrefView[view.selection.currentIndex].prefCol; var array = gPrefView; gPrefView = gPrefArray; if (substring) { gPrefView = []; for (var i = 0; i < gPrefArray.length; ++i) if (gPrefArray[i].prefCol.toLowerCase().indexOf(substring) >= 0) gPrefView.push(gPrefArray[i]); if (gFastIndex < gPrefArray.length) gPrefView.sort(gSortFunction); } view.treebox.invalidate(); view.treebox.rowCountChanged(array.length, gPrefView.length - array.length); gotoPref(prefCol); document.getElementById("button").disabled = !substring;}
view.treebox.rowCountChanged(array.length, gPrefView.length - array.length);
view.treebox.rowCountChanged(oldlen, gPrefView.length - oldlen);
function FilterPrefs(){ var substring = document.getElementById("textbox").value.toLowerCase(); var prefCol = view.selection.currentIndex < 0 ? null : gPrefView[view.selection.currentIndex].prefCol; var array = gPrefView; gPrefView = gPrefArray; if (substring) { gPrefView = []; for (var i = 0; i < gPrefArray.length; ++i) if (gPrefArray[i].prefCol.toLowerCase().indexOf(substring) >= 0) gPrefView.push(gPrefArray[i]); if (gFastIndex < gPrefArray.length) gPrefView.sort(gSortFunction); } view.treebox.invalidate(); view.treebox.rowCountChanged(array.length, gPrefView.length - array.length); gotoPref(prefCol); document.getElementById("button").disabled = !substring;}
gUpdatingBatch = false;
function FinalizeCookieDeletions() { for (var c=0; c<deletedCookies.length; c++) { cookiemanager.remove(deletedCookies[c].host, deletedCookies[c].name, deletedCookies[c].path, document.getElementById("checkbox").checked); } deletedCookies.length = 0;}
gUpdatingBatch = false;
function FinalizePermissionDeletions() { var ioService = Components.classes["@mozilla.org/network/io-service;1"] .getService(Components.interfaces.nsIIOService); for (var p=0; p<deletedPermissions.length; p++) { if (deletedPermissions[p].type == popupType) { // we lost the URI's original scheme, but this will do because the scheme // is stripped later anyway. var uri = ioService.newURI("http://"+deletedPermissions[p].host, null, null); popupmanager.remove(uri); } else permissionmanager.remove(deletedPermissions[p].host, deletedPermissions[p].type); } deletedPermissions.length = 0;}
bmWindow.document.getElementById("bookmarks-view").outlinerBody.setAttribute("ref", searchURI);
bmWindow.document.getElementById("bookmarks-view").outliner.setAttribute("ref", searchURI);
function find(){ // Build up a find URI from the search fields and open a new window // rooted on the URI. var match = document.getElementById("matchList"); var method = document.getElementById("methodList"); var searchURI = "find:datasource=rdf:bookmarks" searchURI += "&match=" + match.selectedItem.value; searchURI += "&method=" + method.selectedItem.value; searchURI += "&text=" + escape(gSearchField.value); var bmWindow = findMostRecentWindow("bookmarks:searchresults", "chrome://communicator/content/bookmarks/bookmarks.xul", searchURI); // Update the root of the tree if we're using an existing search window. if (!gCreatingNewWindow) bmWindow.document.getElementById("bookmarks-view").outlinerBody.setAttribute("ref", searchURI); bmWindow.focus(); return true;}
if (item.getAttribute('iframe-src') == target) {
if (item.getAttribute('id') == target) {
function find_panel(panels, target) { if (target && target != '') { // Find the index of the selected panel for (var ii=1; ii < panels.childNodes.length; ii += 2) { var item = panels.childNodes.item(ii); if (item.getAttribute('iframe-src') == target) { if (is_excluded(item)) { debug("find_panel: Found panel at index, "+ii+", but it is excluded"); return 0; } else { // Found it! debug("find_panel: Found panel at index, "+ii); return ii; } } } } return 0;}
function findAgainInPage(browser, rootSearchWindow, startSearchWindow, reverse)
function findAgainInPage(findInstData, reverse)
function findAgainInPage(browser, rootSearchWindow, startSearchWindow, reverse){ if ("findDialog" in window && window.findDialog) window.findDialog.focus(); else { var findInst = browser.webBrowserFind; // set up the find to search the focussedWindow, bounded by the content window. var findInFrames = findInst.QueryInterface(Components.interfaces.nsIWebBrowserFindInFrames); findInFrames.rootSearchFrame = rootSearchWindow; findInFrames.currentSearchFrame = startSearchWindow; // always search in frames for now. We could add a checkbox to the dialog for this. findInst.searchFrames = true; // get the find service, which stores global find state, and init the // nsIWebBrowser find with it. We don't assume that there was a previous // Find that set this up. var findService = Components.classes["@mozilla.org/find/find_service;1"] .getService(Components.interfaces.nsIFindService); findInst.searchString = findService.searchString; findInst.matchCase = findService.matchCase; findInst.wrapFind = findService.wrapFind; findInst.entireWord = findService.entireWord; findInst.findBackwards = findService.findBackwards ^ reverse; var found = false; if (findInst.searchString.length == 0) { // no previous find text findInPage(browser, rootSearchWindow, startSearchWindow); return; } found = findInst.findNext(); if (!found) { if (!gPromptService) gPromptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService() .QueryInterface(Components.interfaces.nsIPromptService); if (!gFindBundle) gFindBundle = document.getElementById("findBundle"); gPromptService.alert(window, gFindBundle.getString("notFoundTitle"), gFindBundle.getString("notFoundWarning")); } // Reset to normal value, otherwise setting can get changed in find dialog findInst.findBackwards = findService.findBackwards; }}
var findInst = browser.webBrowserFind; var findInFrames = findInst.QueryInterface(Components.interfaces.nsIWebBrowserFindInFrames); findInFrames.rootSearchFrame = rootSearchWindow; findInFrames.currentSearchFrame = startSearchWindow; findInst.searchFrames = true;
function findAgainInPage(browser, rootSearchWindow, startSearchWindow, reverse){ if ("findDialog" in window && window.findDialog) window.findDialog.focus(); else { var findInst = browser.webBrowserFind; // set up the find to search the focussedWindow, bounded by the content window. var findInFrames = findInst.QueryInterface(Components.interfaces.nsIWebBrowserFindInFrames); findInFrames.rootSearchFrame = rootSearchWindow; findInFrames.currentSearchFrame = startSearchWindow; // always search in frames for now. We could add a checkbox to the dialog for this. findInst.searchFrames = true; // get the find service, which stores global find state, and init the // nsIWebBrowser find with it. We don't assume that there was a previous // Find that set this up. var findService = Components.classes["@mozilla.org/find/find_service;1"] .getService(Components.interfaces.nsIFindService); findInst.searchString = findService.searchString; findInst.matchCase = findService.matchCase; findInst.wrapFind = findService.wrapFind; findInst.entireWord = findService.entireWord; findInst.findBackwards = findService.findBackwards ^ reverse; var found = false; if (findInst.searchString.length == 0) { // no previous find text findInPage(browser, rootSearchWindow, startSearchWindow); return; } found = findInst.findNext(); if (!found) { if (!gPromptService) gPromptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService() .QueryInterface(Components.interfaces.nsIPromptService); if (!gFindBundle) gFindBundle = document.getElementById("findBundle"); gPromptService.alert(window, gFindBundle.getString("notFoundTitle"), gFindBundle.getString("notFoundWarning")); } // Reset to normal value, otherwise setting can get changed in find dialog findInst.findBackwards = findService.findBackwards; }}
findInst.searchString = findService.searchString;
var searchString = findService.searchString; if (searchString.length == 0) { findInPage(findInstData); return; } findInstData.init(); var findInst = findInstData.webBrowserFind; findInst.searchString = searchString;
function findAgainInPage(browser, rootSearchWindow, startSearchWindow, reverse){ if ("findDialog" in window && window.findDialog) window.findDialog.focus(); else { var findInst = browser.webBrowserFind; // set up the find to search the focussedWindow, bounded by the content window. var findInFrames = findInst.QueryInterface(Components.interfaces.nsIWebBrowserFindInFrames); findInFrames.rootSearchFrame = rootSearchWindow; findInFrames.currentSearchFrame = startSearchWindow; // always search in frames for now. We could add a checkbox to the dialog for this. findInst.searchFrames = true; // get the find service, which stores global find state, and init the // nsIWebBrowser find with it. We don't assume that there was a previous // Find that set this up. var findService = Components.classes["@mozilla.org/find/find_service;1"] .getService(Components.interfaces.nsIFindService); findInst.searchString = findService.searchString; findInst.matchCase = findService.matchCase; findInst.wrapFind = findService.wrapFind; findInst.entireWord = findService.entireWord; findInst.findBackwards = findService.findBackwards ^ reverse; var found = false; if (findInst.searchString.length == 0) { // no previous find text findInPage(browser, rootSearchWindow, startSearchWindow); return; } found = findInst.findNext(); if (!found) { if (!gPromptService) gPromptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService() .QueryInterface(Components.interfaces.nsIPromptService); if (!gFindBundle) gFindBundle = document.getElementById("findBundle"); gPromptService.alert(window, gFindBundle.getString("notFoundTitle"), gFindBundle.getString("notFoundWarning")); } // Reset to normal value, otherwise setting can get changed in find dialog findInst.findBackwards = findService.findBackwards; }}
var found = false; if (findInst.searchString.length == 0) { findInPage(browser, rootSearchWindow, startSearchWindow); return; } found = findInst.findNext();
var found = findInst.findNext();
function findAgainInPage(browser, rootSearchWindow, startSearchWindow, reverse){ if ("findDialog" in window && window.findDialog) window.findDialog.focus(); else { var findInst = browser.webBrowserFind; // set up the find to search the focussedWindow, bounded by the content window. var findInFrames = findInst.QueryInterface(Components.interfaces.nsIWebBrowserFindInFrames); findInFrames.rootSearchFrame = rootSearchWindow; findInFrames.currentSearchFrame = startSearchWindow; // always search in frames for now. We could add a checkbox to the dialog for this. findInst.searchFrames = true; // get the find service, which stores global find state, and init the // nsIWebBrowser find with it. We don't assume that there was a previous // Find that set this up. var findService = Components.classes["@mozilla.org/find/find_service;1"] .getService(Components.interfaces.nsIFindService); findInst.searchString = findService.searchString; findInst.matchCase = findService.matchCase; findInst.wrapFind = findService.wrapFind; findInst.entireWord = findService.entireWord; findInst.findBackwards = findService.findBackwards ^ reverse; var found = false; if (findInst.searchString.length == 0) { // no previous find text findInPage(browser, rootSearchWindow, startSearchWindow); return; } found = findInst.findNext(); if (!found) { if (!gPromptService) gPromptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService() .QueryInterface(Components.interfaces.nsIPromptService); if (!gFindBundle) gFindBundle = document.getElementById("findBundle"); gPromptService.alert(window, gFindBundle.getString("notFoundTitle"), gFindBundle.getString("notFoundWarning")); } // Reset to normal value, otherwise setting can get changed in find dialog findInst.findBackwards = findService.findBackwards; }}
function findAgainInPage(browser, rootSearchWindow, startSearchWindow)
function findAgainInPage(browser, rootSearchWindow, startSearchWindow, reverse)
function findAgainInPage(browser, rootSearchWindow, startSearchWindow){ if ("findDialog" in window && window.findDialog) window.findDialog.focus(); else { var findInst = browser.webBrowserFind; // set up the find to search the focussedWindow, bounded by the content window. var findInFrames = findInst.QueryInterface(Components.interfaces.nsIWebBrowserFindInFrames); findInFrames.rootSearchFrame = rootSearchWindow; findInFrames.currentSearchFrame = startSearchWindow; // always search in frames for now. We could add a checkbox to the dialog for this. findInst.searchFrames = true; // get the find service, which stores global find state, and init the // nsIWebBrowser find with it. We don't assume that there was a previous // Find that set this up. var findService = Components.classes["@mozilla.org/find/find_service;1"] .getService(Components.interfaces.nsIFindService); findInst.searchString = findService.searchString; findInst.matchCase = findService.matchCase; findInst.wrapFind = findService.wrapFind; findInst.entireWord = findService.entireWord; findInst.findBackwards = findService.findBackwards; var found = false; if (findInst.searchString.length == 0) { // no previous find text findInPage(browser, rootSearchWindow, startSearchWindow); return; } found = findInst.findNext(); if (!found) { if (!gPromptService) gPromptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService() .QueryInterface(Components.interfaces.nsIPromptService); if (!gFindBundle) gFindBundle = document.getElementById("findBundle"); gPromptService.alert(window, gFindBundle.getString("notFoundTitle"), gFindBundle.getString("notFoundWarning")); } }}
findInst.findBackwards = findService.findBackwards;
findInst.findBackwards = findService.findBackwards ^ reverse;
function findAgainInPage(browser, rootSearchWindow, startSearchWindow){ if ("findDialog" in window && window.findDialog) window.findDialog.focus(); else { var findInst = browser.webBrowserFind; // set up the find to search the focussedWindow, bounded by the content window. var findInFrames = findInst.QueryInterface(Components.interfaces.nsIWebBrowserFindInFrames); findInFrames.rootSearchFrame = rootSearchWindow; findInFrames.currentSearchFrame = startSearchWindow; // always search in frames for now. We could add a checkbox to the dialog for this. findInst.searchFrames = true; // get the find service, which stores global find state, and init the // nsIWebBrowser find with it. We don't assume that there was a previous // Find that set this up. var findService = Components.classes["@mozilla.org/find/find_service;1"] .getService(Components.interfaces.nsIFindService); findInst.searchString = findService.searchString; findInst.matchCase = findService.matchCase; findInst.wrapFind = findService.wrapFind; findInst.entireWord = findService.entireWord; findInst.findBackwards = findService.findBackwards; var found = false; if (findInst.searchString.length == 0) { // no previous find text findInPage(browser, rootSearchWindow, startSearchWindow); return; } found = findInst.findNext(); if (!found) { if (!gPromptService) gPromptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService() .QueryInterface(Components.interfaces.nsIPromptService); if (!gFindBundle) gFindBundle = document.getElementById("findBundle"); gPromptService.alert(window, gFindBundle.getString("notFoundTitle"), gFindBundle.getString("notFoundWarning")); } }}
findInst.findBackwards = findService.findBackwards;
function findAgainInPage(browser, rootSearchWindow, startSearchWindow){ if ("findDialog" in window && window.findDialog) window.findDialog.focus(); else { var findInst = browser.webBrowserFind; // set up the find to search the focussedWindow, bounded by the content window. var findInFrames = findInst.QueryInterface(Components.interfaces.nsIWebBrowserFindInFrames); findInFrames.rootSearchFrame = rootSearchWindow; findInFrames.currentSearchFrame = startSearchWindow; // always search in frames for now. We could add a checkbox to the dialog for this. findInst.searchFrames = true; // get the find service, which stores global find state, and init the // nsIWebBrowser find with it. We don't assume that there was a previous // Find that set this up. var findService = Components.classes["@mozilla.org/find/find_service;1"] .getService(Components.interfaces.nsIFindService); findInst.searchString = findService.searchString; findInst.matchCase = findService.matchCase; findInst.wrapFind = findService.wrapFind; findInst.entireWord = findService.entireWord; findInst.findBackwards = findService.findBackwards; var found = false; if (findInst.searchString.length == 0) { // no previous find text findInPage(browser, rootSearchWindow, startSearchWindow); return; } found = findInst.findNext(); if (!found) { if (!gPromptService) gPromptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService() .QueryInterface(Components.interfaces.nsIPromptService); if (!gFindBundle) gFindBundle = document.getElementById("findBundle"); gPromptService.alert(window, gFindBundle.getString("notFoundTitle"), gFindBundle.getString("notFoundWarning")); } }}
if (findInst.searchString.length > 0) found = findInst.findNext();
if (findInst.searchString.length == 0) return findInPage(browser, rootSearchWindow, startSearchWindow); found = findInst.findNext();
function findAgainInPage(browser, rootSearchWindow, startSearchWindow){ if ("findDialog" in window && window.findDialog) window.findDialog.focus(); else { var findInst = browser.webBrowserFind; // set up the find to search the focussedWindow, bounded by the content window. var findInFrames = findInst.QueryInterface(Components.interfaces.nsIWebBrowserFindInFrames); findInFrames.rootSearchFrame = rootSearchWindow; findInFrames.currentSearchFrame = startSearchWindow; // always search in frames for now. We could add a checkbox to the dialog for this. findInst.searchFrames = true; // get the find service, which stores global find state, and init the // nsIWebBrowser find with it. We don't assume that there was a previous // Find that set this up. var findService = Components.classes["@mozilla.org/find/find_service;1"] .getService(Components.interfaces.nsIFindService); findInst.searchString = findService.searchString; findInst.matchCase = findService.matchCase; findInst.wrapFind = findService.wrapFind; findInst.entireWord = findService.entireWord; findInst.findBackwards = findService.findBackwards; var found = false; if (findInst.searchString.length > 0) // should never happen if command updating works found = findInst.findNext(); if (!found) { if (!gPromptService) gPromptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService() .QueryInterface(Components.interfaces.nsIPromptService); if (!gFindBundle) gFindBundle = document.getElementById("findBundle"); gPromptService.alert(window, gFindBundle.getString("notFoundTitle"), gFindBundle.getString("notFoundWarning")); } }}
url = Components.classes["@mozilla.org/network/standard-url;1"]. createInstance(Components.interfaces.nsIURI); url.spec = alink.baseURI;
var ioService = Components.classes["@mozilla.org/network/io-service;1"] .getService(Components.interfaces.nsIIOService); url = ioService.newURI(alink.baseURI, null, null);
findAtomLink: function(linkRel, linkElements) { // XXX Need to check for MIME type and hreflang for ( var j=0 ; j<linkElements.length ; j++ ) { var alink = linkElements[j]; if (alink && //if there's a link rel ((alink.getAttribute('rel') && alink.getAttribute('rel') == linkRel) || //if there isn't, assume 'alternate' (!alink.getAttribute('rel') && (linkRel=="alternate"))) && alink.getAttribute('href')) { // Atom links are interpreted relative to xml:base url = Components.classes["@mozilla.org/network/standard-url;1"]. createInstance(Components.interfaces.nsIURI); url.spec = alink.baseURI; return url.resolve(alink.getAttribute('href')); } } return null; },