rem
stringlengths
0
126k
add
stringlengths
0
441k
context
stringlengths
15
136k
var windowManager = Components.classes['@mozilla.org/rdf/datasource;1?name=window-mediator'].getService();
var windowManager = Components.classes['@mozilla.org/appshell/window-mediator;1'].getService();
function GetWindowMediator(){ if (gWindowManagerInterface) return gWindowManagerInterface; var windowManager = Components.classes['@mozilla.org/rdf/datasource;1?name=window-mediator'].getService(); return (gWindowManagerInterface = windowManager.QueryInterface(Components.interfaces.nsIWindowMediator));}
parent.parent.globals.debug( "download go" );
function go( msg ){ parent.parent.globals.debug( "download go" ); netscape.security.PrivilegeManager.enablePrivilege( "AccountSetup" ); // * skip if we're in edit mode if ( parent.parent.globals.document.vars.editMode.value != "yes" ) { // * if "RegServer" specified in ACCTSET.INI, use it var theFile = parent.parent.globals.getAcctSetupFilename( self ); var intlFlag = parent.parent.globals.GetNameValuePair( theFile, "Mode Selection", "IntlMode" ); intlFlag = intlFlag.toLowerCase(); var theRegFile = parent.parent.globals.GetNameValuePair( theFile, "New Acct Mode", "RegServer" ); if ( theRegFile != null && theRegFile != "" ) { parent.parent.globals.document.vars.regServer.value = theRegFile; } else { // * otherwise, if multiple .IAS files exist, get list selection and determine appropriate .IAS file var pathName = parent.parent.globals.getConfigFolder( self ); var theList = parent.parent.globals.document.setupPlugin.GetFolderContents( pathName,".IAS" ); if ( theList != null ) { if ( theList.length > 1 ) { if ( document.forms[ 0 ].regServerList.selectedIndex < 0 ) { alert( "Please select an Internet account server." ); return false; } for ( var x = 0; x < theList.length; x++ ) { var file = parent.parent.globals.getConfigFolder( self ) + theList[ x ]; var name = parent.parent.globals.document.setupPlugin.GetNameValuePair( file, "Dial-In Configuration", "SiteName" ); if ( name == document.forms[ 0 ].regServerList.options[ document.forms[ 0 ].regServerList.selectedIndex ].text ) { parent.parent.globals.document.vars.regServer.value = theList[ x ]; break; } } if ( parent.parent.globals.document.vars.regServer.value == "" ) { alert( "Internal problem locating appropriate registration server file." ); return false; } } else if ( theList.length == 1 ) { parent.parent.globals.document.vars.regServer.value = theList[ 0 ]; } else { alert( "Internal problem locating a registration server file." ); return false; } } else { alert( "Internal problem locating appropriate registration server file." ); return false; } } return true; } else { return false; }}
parent.parent.globals.debug( compare.ispRadio );
function go( msg ){ parent.parent.globals.debug( "compwrap go" ); parent.parent.globals.debug( compare.ispRadio ); if ( compare.ispRadio != null && compare.ispRadio != "" ) { parent.parent.globals.selectedISP = compare.ispRadio; return true; } alert( "You haven't selected an ISP" ); return false;}
parent.parent.globals.debug( compare.ispRadio );
function go( msg ){ parent.parent.globals.debug( "compwrap go" ); parent.parent.globals.debug( compare.ispRadio ); if ( compare.ispRadio != null && compare.ispRadio != "" ) { parent.parent.globals.selectedISP = compare.ispRadio; return true; } alert( "You haven't selected an ISP" ); return false;}
if (isinstance(ex, Error) || ((typeof ex == "object") && ("filename" in ex)))
if (isinstance(ex, Error) || ((typeof ex == "object") && ("filename" in ex))) {
function go(){ if (!loadDeps()) return false; // The utils.js formatException relies on localization, we can't. Fix: formatException = function formatException(ex) { if (isinstance(ex, Error) || ((typeof ex == "object") && ("filename" in ex))) return [ex.name, ex.message, ex.fileName, ex.lineNumber].join(", "); return String(ex); }; initStatic(); init(bot); if (DEBUG) /* hook all events EXCEPT server.poll and *.event-end types * (the 4th param inverts the match) */ bot.eventPump.addHook ([{type: "poll", set: /^(server|dcc-chat)$/}, {type: "event-end"}], event_tracer, "event-tracer", true /* negate */); if (typeof initPersonality == "function") initPersonality(); bot.primNet.connect(); rego(); return true;}
bot.eventPump.addHook ([{type: "poll", set: /^(server|dcc-chat)$/}, {type: "event-end"}], event_tracer, "event-tracer", true );
bot.eventPump.addHook([{type: "poll", set: /^(server|dcc-chat)$/}, {type: "event-end"}], event_tracer, "event-tracer", true ); }
function go(){ if (!loadDeps()) return false; // The utils.js formatException relies on localization, we can't. Fix: formatException = function formatException(ex) { if (isinstance(ex, Error) || ((typeof ex == "object") && ("filename" in ex))) return [ex.name, ex.message, ex.fileName, ex.lineNumber].join(", "); return String(ex); }; initStatic(); init(bot); if (DEBUG) /* hook all events EXCEPT server.poll and *.event-end types * (the 4th param inverts the match) */ bot.eventPump.addHook ([{type: "poll", set: /^(server|dcc-chat)$/}, {type: "event-end"}], event_tracer, "event-tracer", true /* negate */); if (typeof initPersonality == "function") initPersonality(); bot.primNet.connect(); rego(); return true;}
var pref = Components.classes["@mozilla.org/preferences;1"].getService(); if( pref ) pref = pref.QueryInterface( Components.interfaces.nsIPref ); defaultAboutState = pref.GetBoolPref("browser.show_about_as_stupid_modal_window");
var pref = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); defaultAboutState = pref.getBoolPref("browser.show_about_as_stupid_modal_window");
function goAboutDialog(){ var defaultAboutState = false; try { var pref = Components.classes["@mozilla.org/preferences;1"].getService(); if( pref ) pref = pref.QueryInterface( Components.interfaces.nsIPref ); defaultAboutState = pref.GetBoolPref("browser.show_about_as_stupid_modal_window"); } catch(e) { defaultAboutState = false; } if( defaultAboutState ) window.openDialog("chrome:global/content/about.xul", "About", "modal,chrome,resizable=yes,height=450,width=550"); else window.openDialog( getBrowserURL(), "_blank", "chrome,all,dialog=no", 'about:' );}
window.openDialog("chrome:global/content/about.xul", "About", "modal,chrome,resizable=yes,height=450,width=550");
window.openDialog("chrome:
function goAboutDialog(){ var defaultAboutState = false; try { var pref = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); defaultAboutState = pref.getBoolPref("browser.show_about_as_stupid_modal_window"); } catch(e) { defaultAboutState = false; } if( defaultAboutState ) window.openDialog("chrome:global/content/about.xul", "About", "modal,chrome,resizable=yes,height=450,width=550"); else window.openDialog( getBrowserURL(), "_blank", "chrome,all,dialog=no", 'about:' );}
url = pref.getComplexValue(urlPref, Components.interfaces.nsIPrefLocalizedString);
url = pref.getComplexValue(urlPref, Components.interfaces.nsIPrefLocalizedString).data;
function goClickThrobber( urlPref ){ var url; try { var pref = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); url = pref.getComplexValue(urlPref, Components.interfaces.nsIPrefLocalizedString); } catch(e) { url = null; } if ( url ) openTopWin(url);}
var pref = Components.classes["@mozilla.org/preferences;1"].getService(); if( pref ) pref = pref.QueryInterface( Components.interfaces.nsIPref ); url = pref.getLocalizedUnicharPref(urlPref);
var pref = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); url = pref.getComplexValue(urlPref, Components.interfaces.nsIPrefLocalizedString);
function goClickThrobber( urlPref ){ var url; try { var pref = Components.classes["@mozilla.org/preferences;1"].getService(); if( pref ) pref = pref.QueryInterface( Components.interfaces.nsIPref ); url = pref.getLocalizedUnicharPref(urlPref); } catch(e) { url = null; } if ( url ) openTopWin(url);}
function goClickThrobber( urlPref )
function goClickThrobber( urlPref, e )
function goClickThrobber( urlPref ){ var url; try { var pref = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); url = pref.getComplexValue(urlPref, Components.interfaces.nsIPrefLocalizedString).data; } catch(e) { url = null; } if ( url ) openTopWin(url);}
openTopWin(url);
openUILink(url, e);
function goClickThrobber( urlPref ){ var url; try { var pref = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); url = pref.getComplexValue(urlPref, Components.interfaces.nsIPrefLocalizedString).data; } catch(e) { url = null; } if ( url ) openTopWin(url);}
return;
function goEditListDialog(abURI, listURI){ window.openDialog("chrome://messenger/content/addressbook/abEditListDialog.xul", "", "chrome,resizeable=no", {abURI:abURI, listURI:listURI});}
loadURI("chrome:
displayTopic(defaultTopic);
function goHome() { // Load "Welcome" page loadURI("chrome://help/locale/firefox_welcome.xhtml");}
function GoNextMessage(nextFunction, nextResourceFunction, startFromBeginning)
function GoNextMessage(nextFunction, nextResourceFunction, nextThreadFunction, startFromBeginning)
function GoNextMessage(nextFunction, nextResourceFunction, startFromBeginning){ var tree = GetThreadTree(); var selArray = tree.selectedItems; var length = selArray.length; if ( selArray && ((length == 0) || (length == 1)) ) { var currentMessage; if(length == 0) currentMessage = null; else currentMessage = selArray[0]; var nextMessage; if(messageView.showThreads) { nextMessage = GetNextMessageInThreads(tree, currentMessage, nextFunction, nextResourceFunction, startFromBeginning); } else { nextMessage = GetNextMessage(tree, currentMessage, nextFunction, startFromBeginning); } //Only change the selection if there's a valid nextMessage if(nextMessage && (nextMessage != currentMessage)) ChangeSelection(tree, nextMessage); }}
nextMessage = GetNextMessageInThreads(tree, currentMessage, nextFunction, nextResourceFunction, startFromBeginning);
nextMessage = GetNextMessageInThreads(tree, currentMessage, nextFunction, nextResourceFunction, nextThreadFunction, startFromBeginning);
function GoNextMessage(nextFunction, nextResourceFunction, startFromBeginning){ var tree = GetThreadTree(); var selArray = tree.selectedItems; var length = selArray.length; if ( selArray && ((length == 0) || (length == 1)) ) { var currentMessage; if(length == 0) currentMessage = null; else currentMessage = selArray[0]; var nextMessage; if(messageView.showThreads) { nextMessage = GetNextMessageInThreads(tree, currentMessage, nextFunction, nextResourceFunction, startFromBeginning); } else { nextMessage = GetNextMessage(tree, currentMessage, nextFunction, startFromBeginning); } //Only change the selection if there's a valid nextMessage if(nextMessage && (nextMessage != currentMessage)) ChangeSelection(tree, nextMessage); }}
var outlinerView = gDBView.QueryInterface(Components.interfaces.nsIOutlinerView); var outlinerSelection = outlinerView.selection; var currentIndex = outlinerSelection.currentIndex; var status = gDBView.navigateStatus(type); var resultId = new Object; var resultIndex = new Object; var threadIndex = new Object; gDBView.viewNavigate(type, resultId, resultIndex, threadIndex, true ); if ((resultId.value != -1) && (resultIndex.value != -1)) { outlinerSelection.select(resultIndex.value); EnsureRowInThreadOutlinerIsVisible(resultIndex.value); return;
var succeeded = ScrollToMessage(type, startFromBeginning, true); if (!succeeded) { CrossFolderNavigation(type, true);
function GoNextMessage(type, startFromBeginning){ try { var outlinerView = gDBView.QueryInterface(Components.interfaces.nsIOutlinerView); var outlinerSelection = outlinerView.selection; var currentIndex = outlinerSelection.currentIndex; var status = gDBView.navigateStatus(type); var resultId = new Object; var resultIndex = new Object; var threadIndex = new Object; gDBView.viewNavigate(type, resultId, resultIndex, threadIndex, true /* wrap */); // only scroll and select if we found something if ((resultId.value != -1) && (resultIndex.value != -1)) { outlinerSelection.select(resultIndex.value); EnsureRowInThreadOutlinerIsVisible(resultIndex.value); return; } CrossFolderNavigation(type, true); } catch (ex) { dump("GoNextMessage ex = " + ex + "\n"); }}
CrossFolderNavigation(type, true);
function GoNextMessage(type, startFromBeginning){ try { var outlinerView = gDBView.QueryInterface(Components.interfaces.nsIOutlinerView); var outlinerSelection = outlinerView.selection; var currentIndex = outlinerSelection.currentIndex; var status = gDBView.navigateStatus(type); var resultId = new Object; var resultIndex = new Object; var threadIndex = new Object; gDBView.viewNavigate(type, resultId, resultIndex, threadIndex, true /* wrap */); // only scroll and select if we found something if ((resultId.value != -1) && (resultIndex.value != -1)) { outlinerSelection.select(resultIndex.value); EnsureRowInThreadOutlinerIsVisible(resultIndex.value); return; } CrossFolderNavigation(type, true); } catch (ex) { dump("GoNextMessage ex = " + ex + "\n"); }}
if(nextMessage && (nextMessage != currentMessage))
if(nextMessage && (nextMessage != currentMessage)) {
function GoNextMessage(type, startFromBeginning ){ var beforeGoNextMessage = new Date(); var tree = GetThreadTree(); var selArray = tree.selectedItems; var length = selArray.length; if ( selArray && ((length == 0) || (length == 1)) ) { var currentMessage; if(length == 0) currentMessage = null; else currentMessage = selArray[0]; var nextMessage = msgNavigationService.FindNextMessage(type, tree, currentMessage, RDF, document, startFromBeginning, messageView.showThreads); //Only change the selection if there's a valid nextMessage if(nextMessage && (nextMessage != currentMessage)) ChangeSelection(tree, nextMessage); } var afterGoNextMessage = new Date(); var timeToGetNext = (afterGoNextMessage.getTime() - beforeGoNextMessage.getTime())/1000; dump("time to GoNextMessage is " + timeToGetNext + "seconds\n");}
} else if (type == navigateUnread) { var treeFolder = GetThreadTreeFolder(); var originalFolderURI = treeFolder.getAttribute('ref'); var nextFolderURI = FindNextFolder(originalFolderURI); if (nextFolderURI && (originalFolderURI != nextFolderURI)) { var nextFolderResource = RDF.GetResource(nextFolderURI); var nextFolder = nextFolderResource.QueryInterface(Components.interfaces.nsIMsgFolder); var promptText = Bundle.formatStringFromName("advanceNextPrompt", [ nextFolder.name ], 1); if (commonDialogs.Confirm(window, promptText, promptText)) { gNextMessageAfterLoad = true; SelectFolder(nextFolderURI); } } }
function GoNextMessage(type, startFromBeginning ){ var beforeGoNextMessage = new Date(); var tree = GetThreadTree(); var selArray = tree.selectedItems; var length = selArray.length; if ( selArray && ((length == 0) || (length == 1)) ) { var currentMessage; if(length == 0) currentMessage = null; else currentMessage = selArray[0]; var nextMessage = msgNavigationService.FindNextMessage(type, tree, currentMessage, RDF, document, startFromBeginning, messageView.showThreads); //Only change the selection if there's a valid nextMessage if(nextMessage && (nextMessage != currentMessage)) ChangeSelection(tree, nextMessage); } var afterGoNextMessage = new Date(); var timeToGetNext = (afterGoNextMessage.getTime() - beforeGoNextMessage.getTime())/1000; dump("time to GoNextMessage is " + timeToGetNext + "seconds\n");}
debug("EMURL: "+EMURL+"\n");
function goOpenExtensions(aOpenMode){ const EMTYPE = "Extension:Manager"; var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"] .getService(Components.interfaces.nsIWindowMediator); var needToOpen = true; var windowType = EMTYPE + "-" + aOpenMode; var windows = wm.getEnumerator(windowType); while (windows.hasMoreElements()) { var theEM = windows.getNext().QueryInterface(Components.interfaces.nsIDOMWindowInternal); if (theEM.document.documentElement.getAttribute("windowtype") == windowType) { theEM.focus(); needToOpen = false; break; } } if (needToOpen) { const EMURL = "chrome://mozapps/content/extensions/extensions.xul?type=" + aOpenMode; const EMFEATURES = "chrome,dialog=no,resizable"; debug("EMURL: "+EMURL+"\n"); window.openDialog(EMURL, "", EMFEATURES); }}
var printOptionsService = Components.classes["@mozilla.org/gfx/printoptions;1"] .getService(Components.interfaces.nsIPrintOptions); printOptionsService.ReadPrefs(); printOptionsService.ShowNativeDialog(); printOptionsService.WritePrefs();
function goPageSetup(){}
window.openDialog("chrome:
var printOptionsService = Components.classes["@mozilla.org/gfx/printoptions;1"] .getService(Components.interfaces.nsIPrintOptions); printOptionsService.ShowPrintSetupDialog(printSettings);
function goPageSetup(printSettings){ if (printSettings == null) { alert("PrintSettings arg is null!"); } // This code brings up the native page setup dialog (for platforms that // implement nsIPrintOptions.ShowNativeDialog()). window.openDialog("chrome://communicator/content/printPageSetup.xul","PageSetup", "chrome,modal,centerscreen", printSettings);}
var modal, resizable;
var resizable;
function goPreferences(containerID, paneURL, itemID){ var modal, resizable; var pref = Components.classes["@mozilla.org/preferences;1"].getService(Components.interfaces.nsIPref); try { modal = pref.GetBoolPref( "browser.prefWindowModal"); } catch (e) { modal = true; } try { // We are resizable ONLY if in box debugging mode, because in // this special debug mode it is often impossible to see the // content of the debug panel in order to disable debug mode. resizable = pref.GetBoolPref("xul.debug.box"); } catch (e) { resizable = false; } //check for an existing pref window and focus it; it's not application modal const kWindowMediatorContractID = "@mozilla.org/rdf/datasource;1?name=window-mediator"; const kWindowMediatorIID = Components.interfaces.nsIWindowMediator; const kWindowMediator = Components.classes[kWindowMediatorContractID].getService(kWindowMediatorIID); var lastPrefWindow = kWindowMediator.getMostRecentWindow("mozilla:preferences"); if (lastPrefWindow) lastPrefWindow.focus(); else { var modality = modal ? "yes" : "no"; var resizability = resizable ? "yes" : "no"; var features = "chrome,titlebar,modal=" + modality + ",resizable=" + resizability; openDialog("chrome://communicator/content/pref/pref.xul","PrefWindow", features, paneURL, containerID, itemID); }}
try { modal = pref.GetBoolPref( "browser.prefWindowModal"); } catch (e) { modal = true; }
function goPreferences(containerID, paneURL, itemID){ var modal, resizable; var pref = Components.classes["@mozilla.org/preferences;1"].getService(Components.interfaces.nsIPref); try { modal = pref.GetBoolPref( "browser.prefWindowModal"); } catch (e) { modal = true; } try { // We are resizable ONLY if in box debugging mode, because in // this special debug mode it is often impossible to see the // content of the debug panel in order to disable debug mode. resizable = pref.GetBoolPref("xul.debug.box"); } catch (e) { resizable = false; } //check for an existing pref window and focus it; it's not application modal const kWindowMediatorContractID = "@mozilla.org/rdf/datasource;1?name=window-mediator"; const kWindowMediatorIID = Components.interfaces.nsIWindowMediator; const kWindowMediator = Components.classes[kWindowMediatorContractID].getService(kWindowMediatorIID); var lastPrefWindow = kWindowMediator.getMostRecentWindow("mozilla:preferences"); if (lastPrefWindow) lastPrefWindow.focus(); else { var modality = modal ? "yes" : "no"; var resizability = resizable ? "yes" : "no"; var features = "chrome,titlebar,modal=" + modality + ",resizable=" + resizability; openDialog("chrome://communicator/content/pref/pref.xul","PrefWindow", features, paneURL, containerID, itemID); }}
var modality = modal ? "yes" : "no";
function goPreferences(containerID, paneURL, itemID){ var modal, resizable; var pref = Components.classes["@mozilla.org/preferences;1"].getService(Components.interfaces.nsIPref); try { modal = pref.GetBoolPref( "browser.prefWindowModal"); } catch (e) { modal = true; } try { // We are resizable ONLY if in box debugging mode, because in // this special debug mode it is often impossible to see the // content of the debug panel in order to disable debug mode. resizable = pref.GetBoolPref("xul.debug.box"); } catch (e) { resizable = false; } //check for an existing pref window and focus it; it's not application modal const kWindowMediatorContractID = "@mozilla.org/rdf/datasource;1?name=window-mediator"; const kWindowMediatorIID = Components.interfaces.nsIWindowMediator; const kWindowMediator = Components.classes[kWindowMediatorContractID].getService(kWindowMediatorIID); var lastPrefWindow = kWindowMediator.getMostRecentWindow("mozilla:preferences"); if (lastPrefWindow) lastPrefWindow.focus(); else { var modality = modal ? "yes" : "no"; var resizability = resizable ? "yes" : "no"; var features = "chrome,titlebar,modal=" + modality + ",resizable=" + resizability; openDialog("chrome://communicator/content/pref/pref.xul","PrefWindow", features, paneURL, containerID, itemID); }}
var features = "chrome,titlebar,modal=" + modality + ",resizable=" + resizability;
var features = "chrome,titlebar,resizable=" + resizability;
function goPreferences(containerID, paneURL, itemID){ var modal, resizable; var pref = Components.classes["@mozilla.org/preferences;1"].getService(Components.interfaces.nsIPref); try { modal = pref.GetBoolPref( "browser.prefWindowModal"); } catch (e) { modal = true; } try { // We are resizable ONLY if in box debugging mode, because in // this special debug mode it is often impossible to see the // content of the debug panel in order to disable debug mode. resizable = pref.GetBoolPref("xul.debug.box"); } catch (e) { resizable = false; } //check for an existing pref window and focus it; it's not application modal const kWindowMediatorContractID = "@mozilla.org/rdf/datasource;1?name=window-mediator"; const kWindowMediatorIID = Components.interfaces.nsIWindowMediator; const kWindowMediator = Components.classes[kWindowMediatorContractID].getService(kWindowMediatorIID); var lastPrefWindow = kWindowMediator.getMostRecentWindow("mozilla:preferences"); if (lastPrefWindow) lastPrefWindow.focus(); else { var modality = modal ? "yes" : "no"; var resizability = resizable ? "yes" : "no"; var features = "chrome,titlebar,modal=" + modality + ",resizable=" + resizability; openDialog("chrome://communicator/content/pref/pref.xul","PrefWindow", features, paneURL, containerID, itemID); }}
const kWindowMediatorContractID = "@mozilla.org/rdf/datasource;1?name=window-mediator";
const kWindowMediatorContractID = "@mozilla.org/appshell/window-mediator;1";
function goPreferences(containerID, paneURL, itemID){ var resizable; var pref = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); try { // We are resizable ONLY if in box debugging mode, because in // this special debug mode it is often impossible to see the // content of the debug panel in order to disable debug mode. resizable = pref.getBoolPref("xul.debug.box"); } catch (e) { resizable = false; } //check for an existing pref window and focus it; it's not application modal const kWindowMediatorContractID = "@mozilla.org/rdf/datasource;1?name=window-mediator"; const kWindowMediatorIID = Components.interfaces.nsIWindowMediator; const kWindowMediator = Components.classes[kWindowMediatorContractID].getService(kWindowMediatorIID); var lastPrefWindow = kWindowMediator.getMostRecentWindow("mozilla:preferences"); if (lastPrefWindow) lastPrefWindow.focus(); else { var resizability = resizable ? "yes" : "no"; var features = "chrome,titlebar,resizable=" + resizability; openDialog("chrome://communicator/content/pref/pref.xul","PrefWindow", features, paneURL, containerID, itemID); }}
var pref = Components.classes["@mozilla.org/preferences;1"].getService(Components.interfaces.nsIPref);
var pref = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch);
function goPreferences(containerID, paneURL, itemID){ var resizable; var pref = Components.classes["@mozilla.org/preferences;1"].getService(Components.interfaces.nsIPref); try { // We are resizable ONLY if in box debugging mode, because in // this special debug mode it is often impossible to see the // content of the debug panel in order to disable debug mode. resizable = pref.GetBoolPref("xul.debug.box"); } catch (e) { resizable = false; } //check for an existing pref window and focus it; it's not application modal const kWindowMediatorContractID = "@mozilla.org/rdf/datasource;1?name=window-mediator"; const kWindowMediatorIID = Components.interfaces.nsIWindowMediator; const kWindowMediator = Components.classes[kWindowMediatorContractID].getService(kWindowMediatorIID); var lastPrefWindow = kWindowMediator.getMostRecentWindow("mozilla:preferences"); if (lastPrefWindow) lastPrefWindow.focus(); else { var resizability = resizable ? "yes" : "no"; var features = "chrome,titlebar,resizable=" + resizability; openDialog("chrome://communicator/content/pref/pref.xul","PrefWindow", features, paneURL, containerID, itemID); }}
resizable = pref.GetBoolPref("xul.debug.box");
resizable = pref.getBoolPref("xul.debug.box");
function goPreferences(containerID, paneURL, itemID){ var resizable; var pref = Components.classes["@mozilla.org/preferences;1"].getService(Components.interfaces.nsIPref); try { // We are resizable ONLY if in box debugging mode, because in // this special debug mode it is often impossible to see the // content of the debug panel in order to disable debug mode. resizable = pref.GetBoolPref("xul.debug.box"); } catch (e) { resizable = false; } //check for an existing pref window and focus it; it's not application modal const kWindowMediatorContractID = "@mozilla.org/rdf/datasource;1?name=window-mediator"; const kWindowMediatorIID = Components.interfaces.nsIWindowMediator; const kWindowMediator = Components.classes[kWindowMediatorContractID].getService(kWindowMediatorIID); var lastPrefWindow = kWindowMediator.getMostRecentWindow("mozilla:preferences"); if (lastPrefWindow) lastPrefWindow.focus(); else { var resizability = resizable ? "yes" : "no"; var features = "chrome,titlebar,resizable=" + resizability; openDialog("chrome://communicator/content/pref/pref.xul","PrefWindow", features, paneURL, containerID, itemID); }}
var windowManager = Components.classes['@mozilla.org/rdf/datasource;1?name=window-mediator'].getService();
var windowManager = Components.classes['@mozilla.org/appshell/window-mediator;1'].getService();
function goQuitApplication(){ var ObserverService = Components.classes["@mozilla.org/observer-service;1"].getService(); ObserverService = ObserverService.QueryInterface(Components.interfaces.nsIObserverService); if (ObserverService) { try { ObserverService.notifyObservers(null, "quit-application", null); } catch (ex) { // dump("no observer found \n"); } } var windowManager = Components.classes['@mozilla.org/rdf/datasource;1?name=window-mediator'].getService(); var windowManagerInterface = windowManager.QueryInterface( Components.interfaces.nsIWindowMediator); var enumerator = windowManagerInterface.getEnumerator( null ); var appShell = Components.classes['@mozilla.org/appshell/appShellService;1'].getService(); appShell = appShell.QueryInterface( Components.interfaces.nsIAppShellService ); var nativeAppSupport = null; try { nativeAppSupport = appShell.nativeAppSupport; } catch ( ex ) { } while ( enumerator.hasMoreElements() ) { var domWindow = enumerator.getNext(); if (("tryToClose" in domWindow) && !domWindow.tryToClose()) return false; domWindow.close(); }; if (!nativeAppSupport || !nativeAppSupport.isServerMode) appShell.quit(); return true;}
var ObserverService = Components.classes["@mozilla.org/observer-service;1"].getService(); ObserverService = ObserverService.QueryInterface(Components.interfaces.nsIObserverService); if (ObserverService) { try { ObserverService.Notify(null, "quit-application", null); } catch (ex) { } } var windowManager = Components.classes['@mozilla.org/rdf/datasource;1?name=window-mediator'].getService(); var windowManagerInterface = windowManager.QueryInterface( Components.interfaces.nsIWindowMediator); var enumerator = windowManagerInterface.getEnumerator( null );
var ObserverService = Components.classes["@mozilla.org/observer-service;1"].getService(); ObserverService = ObserverService.QueryInterface(Components.interfaces.nsIObserverService); if (ObserverService) { try { ObserverService.Notify(null, "quit-application", null); } catch (ex) { } }
function goQuitApplication(){ var ObserverService = Components.classes["@mozilla.org/observer-service;1"].getService(); ObserverService = ObserverService.QueryInterface(Components.interfaces.nsIObserverService); if (ObserverService) { try { ObserverService.Notify(null, "quit-application", null); } catch (ex) { // dump("no observer found \n"); } } var windowManager = Components.classes['@mozilla.org/rdf/datasource;1?name=window-mediator'].getService(); var windowManagerInterface = windowManager.QueryInterface( Components.interfaces.nsIWindowMediator); var enumerator = windowManagerInterface.getEnumerator( null ); while ( enumerator.hasMoreElements() ) { var windowToClose = enumerator.getNext(); var domWindow = windowManagerInterface.convertISupportsToDOMWindow( windowToClose ); domWindow.focus(); if (!("tryToClose" in domWindow)) { // dump(" window.close \n"); domWindow.close(); } else { // dump(" try to close \n" ); if ( !domWindow.tryToClose() ) return false; } }; // call appshell exit var appShell = Components.classes['@mozilla.org/appshell/appShellService;1'].getService(); appShell = appShell.QueryInterface( Components.interfaces.nsIAppShellService ); appShell.Quit(); return true;}
while ( enumerator.hasMoreElements() ) { var windowToClose = enumerator.getNext(); var domWindow = windowManagerInterface.convertISupportsToDOMWindow( windowToClose ); domWindow.focus(); if (!("tryToClose" in domWindow)) { domWindow.close(); } else { if ( !domWindow.tryToClose() ) return false; } }; var appShell = Components.classes['@mozilla.org/appshell/appShellService;1'].getService(); appShell = appShell.QueryInterface( Components.interfaces.nsIAppShellService ); appShell.Quit(); return true;
var windowManager = Components.classes['@mozilla.org/rdf/datasource;1?name=window-mediator'].getService(); var windowManagerInterface = windowManager.QueryInterface( Components.interfaces.nsIWindowMediator); var enumerator = windowManagerInterface.getEnumerator( null ); while ( enumerator.hasMoreElements() ) { var windowToClose = enumerator.getNext(); var domWindow = windowManagerInterface.convertISupportsToDOMWindow( windowToClose ); domWindow.focus(); if (!("tryToClose" in domWindow)) { domWindow.close(); } else { if ( !domWindow.tryToClose() ) return false; } }; var appShell = Components.classes['@mozilla.org/appshell/appShellService;1'].getService(); appShell = appShell.QueryInterface( Components.interfaces.nsIAppShellService ); appShell.Quit(); return true;
function goQuitApplication(){ var ObserverService = Components.classes["@mozilla.org/observer-service;1"].getService(); ObserverService = ObserverService.QueryInterface(Components.interfaces.nsIObserverService); if (ObserverService) { try { ObserverService.Notify(null, "quit-application", null); } catch (ex) { // dump("no observer found \n"); } } var windowManager = Components.classes['@mozilla.org/rdf/datasource;1?name=window-mediator'].getService(); var windowManagerInterface = windowManager.QueryInterface( Components.interfaces.nsIWindowMediator); var enumerator = windowManagerInterface.getEnumerator( null ); while ( enumerator.hasMoreElements() ) { var windowToClose = enumerator.getNext(); var domWindow = windowManagerInterface.convertISupportsToDOMWindow( windowToClose ); domWindow.focus(); if (!("tryToClose" in domWindow)) { // dump(" window.close \n"); domWindow.close(); } else { // dump(" try to close \n" ); if ( !domWindow.tryToClose() ) return false; } }; // call appshell exit var appShell = Components.classes['@mozilla.org/appshell/appShellService;1'].getService(); appShell = appShell.QueryInterface( Components.interfaces.nsIAppShellService ); appShell.Quit(); return true;}
ObserverService.notifyObservers(null, "quit-application", null);
ObserverService.notifyObservers(null, "quit-application-requested", null);
function goQuitApplication(){ var ObserverService = Components.classes["@mozilla.org/observer-service;1"].getService(); ObserverService = ObserverService.QueryInterface(Components.interfaces.nsIObserverService); if (ObserverService) { try { ObserverService.notifyObservers(null, "quit-application", null); } catch (ex) { // dump("no observer found \n"); } } var windowManager = Components.classes['@mozilla.org/appshell/window-mediator;1'].getService(); var windowManagerInterface = windowManager.QueryInterface( Components.interfaces.nsIWindowMediator); var enumerator = windowManagerInterface.getEnumerator( null ); var appShell = Components.classes['@mozilla.org/appshell/appShellService;1'].getService(); appShell = appShell.QueryInterface( Components.interfaces.nsIAppShellService ); var nativeAppSupport = null; try { nativeAppSupport = appShell.nativeAppSupport; } catch ( ex ) { } while ( enumerator.hasMoreElements() ) { var domWindow = enumerator.getNext(); if (("tryToClose" in domWindow) && !domWindow.tryToClose()) return false; domWindow.close(); }; if (!nativeAppSupport || !nativeAppSupport.isServerMode) appShell.quit(Components.interfaces.nsIAppShellService.eAttemptQuit); return true;}
function goSetMenuValue(command, valueAttribute)
function goSetMenuValue(command, labelAttribute)
function goSetMenuValue(command, valueAttribute){ var commandNode = top.document.getElementById(command); if ( commandNode ) { var value = commandNode.getAttribute(valueAttribute); if ( value ) commandNode.setAttribute('value', value); }}
var commandNode = top.document.getElementById(command); if ( commandNode ) { var value = commandNode.getAttribute(valueAttribute); if ( value ) commandNode.setAttribute('value', value); }
var commandNode = top.document.getElementById(command); if ( commandNode ) { var label = commandNode.getAttribute(labelAttribute); if ( label ) commandNode.setAttribute('label', label); }
function goSetMenuValue(command, valueAttribute){ var commandNode = top.document.getElementById(command); if ( commandNode ) { var value = commandNode.getAttribute(valueAttribute); if ( value ) commandNode.setAttribute('value', value); }}
try { getWebNavigation().gotoIndex(index); } catch(ex) { return false;
if (index == "back") gBrowser.goBackGroup(); else if (index == "forward") gBrowser.goForwardGroup(); else { try { getWebNavigation().gotoIndex(index); } catch(ex) { return false; }
function gotoHistoryIndex(aEvent){ var index = aEvent.target.getAttribute("index"); if (!index) return false; try { getWebNavigation().gotoIndex(index); } catch(ex) { return false; } return true;}
try { getWebNavigation().gotoIndex(index);
var where = whereToOpenLink(aEvent); if (where == "current") { try { getWebNavigation().gotoIndex(index); } catch(ex) { return false; } return true;
function gotoHistoryIndex(aEvent){ var index = aEvent.target.getAttribute("index"); if (!index) return false; try { getWebNavigation().gotoIndex(index); } catch(ex) { return false; } return true;}
catch(ex) { return false;
else { var sessionHistory = getWebNavigation().sessionHistory; var entry = sessionHistory.getEntryAtIndex(index, false); var url = entry.URI.spec; openUILinkIn(url, where); return true;
function gotoHistoryIndex(aEvent){ var index = aEvent.target.getAttribute("index"); if (!index) return false; try { getWebNavigation().gotoIndex(index); } catch(ex) { return false; } return true;}
return true;
function gotoHistoryIndex(aEvent){ var index = aEvent.target.getAttribute("index"); if (!index) return false; try { getWebNavigation().gotoIndex(index); } catch(ex) { return false; } return true;}
var index = aEvent.target.getAttribute("index"); if (index) { appCore.gotoHistoryIndex(index); return true; } else { var id = aEvent.target.getAttribute("id"); if (id == "menuitem-back") BrowserBack(); else if (id == "menuitem-forward") BrowserForward(); } return false;
var index = aEvent.target.getAttribute("index"); if (index) { appCore.gotoHistoryIndex(index); return true; } return false;
function gotoHistoryIndex( aEvent ) { var index = aEvent.target.getAttribute("index"); if (index) { appCore.gotoHistoryIndex(index); return true; } else { var id = aEvent.target.getAttribute("id"); if (id == "menuitem-back") BrowserBack(); else if (id == "menuitem-forward") BrowserForward(); } return false; }
document.getElementById("statusbar-line-col").label = getViewSourceBundle().getFormattedString("statusBarLineCol", [line, 1]);
function goToLine(line){ var viewsource = window._content.document.body; // // The source document is made up of a number of pre elements with // id attributes in the format <pre id="line123">, meaning that // the first line in the pre element is number 123. // Do binary search to find the pre element containing the line. // var pre; for (var lbound = 0, ubound = viewsource.childNodes.length; ; ) { var middle = (lbound + ubound) >> 1; pre = viewsource.childNodes[middle]; var firstLine = parseInt(pre.id.substring(4)); if (lbound == ubound - 1) { break; } if (line >= firstLine) { lbound = middle; } else { ubound = middle; } } var result = {}; var found = findLocation(pre, line, null, -1, false, result); if (!found) { return false; } var selection = window._content.getSelection(); selection.removeAllRanges(); // In our case, the range's startOffset is after "\n" on the previous line. // Tune the selection at the beginning of the next line and do some tweaking // to position the focusNode and the caret at the beginning of the line. selection.QueryInterface(nsISelectionPrivate) .interlinePosition = true; selection.addRange(result.range); if (!selection.isCollapsed) { selection.collapseToEnd(); var offset = result.range.startOffset; var node = result.range.startContainer; if (offset < node.data.length) { // The same text node spans across the "\n", just focus where we were. selection.extend(node, offset); } else { // There is another tag just after the "\n", hook there. We need // to focus a safe point because there are edgy cases such as // <span>...\n</span><span>...</span> vs. // <span>...\n<span>...</span></span><span>...</span> node = node.nextSibling ? node.nextSibling : node.parentNode.nextSibling; selection.extend(node, 0); } } var selCon = getSelectionController(); selCon.setDisplaySelection(nsISelectionController.SELECTION_ON); selCon.setCaretEnabled(true); selCon.setCaretVisibilityDuringSelection(true); // Scroll the beginning of the line into view. selCon.scrollSelectionIntoView( nsISelectionController.SELECTION_NORMAL, nsISelectionController.SELECTION_FOCUS_REGION, true); gLastLineFound = line; //pch: don't update the status bar for now //document.getElementById("statusbar-line-col").label = getViewSourceBundle() // .getFormattedString("statusBarLineCol", [line, 1]); return true;}
var viewsource = window._content.document.body;
var viewsource = window.content.document.body;
function goToLine(line){ var viewsource = window._content.document.body; // // The source document is made up of a number of pre elements with // id attributes in the format <pre id="line123">, meaning that // the first line in the pre element is number 123. // Do binary search to find the pre element containing the line. // var pre; for (var lbound = 0, ubound = viewsource.childNodes.length; ; ) { var middle = (lbound + ubound) >> 1; pre = viewsource.childNodes[middle]; var firstLine = parseInt(pre.id.substring(4)); if (lbound == ubound - 1) { break; } if (line >= firstLine) { lbound = middle; } else { ubound = middle; } } var result = {}; var found = findLocation(pre, line, null, -1, false, result); if (!found) { return false; } var selection = window._content.getSelection(); selection.removeAllRanges(); // In our case, the range's startOffset is after "\n" on the previous line. // Tune the selection at the beginning of the next line and do some tweaking // to position the focusNode and the caret at the beginning of the line. selection.QueryInterface(nsISelectionPrivate) .interlinePosition = true; selection.addRange(result.range); if (!selection.isCollapsed) { selection.collapseToEnd(); var offset = result.range.startOffset; var node = result.range.startContainer; if (offset < node.data.length) { // The same text node spans across the "\n", just focus where we were. selection.extend(node, offset); } else { // There is another tag just after the "\n", hook there. We need // to focus a safe point because there are edgy cases such as // <span>...\n</span><span>...</span> vs. // <span>...\n<span>...</span></span><span>...</span> node = node.nextSibling ? node.nextSibling : node.parentNode.nextSibling; selection.extend(node, 0); } } var selCon = getSelectionController(); selCon.setDisplaySelection(nsISelectionController.SELECTION_ON); selCon.setCaretEnabled(true); selCon.setCaretVisibilityDuringSelection(true); // Scroll the beginning of the line into view. selCon.scrollSelectionIntoView( nsISelectionController.SELECTION_NORMAL, nsISelectionController.SELECTION_FOCUS_REGION, true); gLastLineFound = line; document.getElementById("statusbar-line-col").label = getViewSourceBundle() .getFormattedString("statusBarLineCol", [line, 1]); return true;}
var selection = window._content.getSelection();
var selection = window.content.getSelection();
function goToLine(line){ var viewsource = window._content.document.body; // // The source document is made up of a number of pre elements with // id attributes in the format <pre id="line123">, meaning that // the first line in the pre element is number 123. // Do binary search to find the pre element containing the line. // var pre; for (var lbound = 0, ubound = viewsource.childNodes.length; ; ) { var middle = (lbound + ubound) >> 1; pre = viewsource.childNodes[middle]; var firstLine = parseInt(pre.id.substring(4)); if (lbound == ubound - 1) { break; } if (line >= firstLine) { lbound = middle; } else { ubound = middle; } } var result = {}; var found = findLocation(pre, line, null, -1, false, result); if (!found) { return false; } var selection = window._content.getSelection(); selection.removeAllRanges(); // In our case, the range's startOffset is after "\n" on the previous line. // Tune the selection at the beginning of the next line and do some tweaking // to position the focusNode and the caret at the beginning of the line. selection.QueryInterface(nsISelectionPrivate) .interlinePosition = true; selection.addRange(result.range); if (!selection.isCollapsed) { selection.collapseToEnd(); var offset = result.range.startOffset; var node = result.range.startContainer; if (offset < node.data.length) { // The same text node spans across the "\n", just focus where we were. selection.extend(node, offset); } else { // There is another tag just after the "\n", hook there. We need // to focus a safe point because there are edgy cases such as // <span>...\n</span><span>...</span> vs. // <span>...\n<span>...</span></span><span>...</span> node = node.nextSibling ? node.nextSibling : node.parentNode.nextSibling; selection.extend(node, 0); } } var selCon = getSelectionController(); selCon.setDisplaySelection(nsISelectionController.SELECTION_ON); selCon.setCaretEnabled(true); selCon.setCaretVisibilityDuringSelection(true); // Scroll the beginning of the line into view. selCon.scrollSelectionIntoView( nsISelectionController.SELECTION_NORMAL, nsISelectionController.SELECTION_FOCUS_REGION, true); gLastLineFound = line; document.getElementById("statusbar-line-col").label = getViewSourceBundle() .getFormattedString("statusBarLineCol", [line, 1]); return true;}
var status = message.getAttribute('Status'); return(status == ' ' || status == 'New');
var isUnread = message.getAttribute('IsUnread'); return(isUnread == 'true');
function GoUnreadMessage(message){ var status = message.getAttribute('Status'); return(status == ' ' || status == 'New');}
else goSetMenuValue(command, 'valueDefault');
function goUpdateCommand(command){ var controller = top.document.commandDispatcher.getControllerForCommand(command); var enabled = false; if ( controller ) enabled = controller.isCommandEnabled(command); else goSetMenuValue(command, 'valueDefault'); goSetCommandEnabled(command, enabled);}
var controller = top.document.commandDispatcher.getControllerForCommand(command); var enabled = false; if ( controller ) enabled = controller.isCommandEnabled(command);
var controller = top.document.commandDispatcher.getControllerForCommand(command);
function goUpdateCommand(command){ try { var controller = top.document.commandDispatcher.getControllerForCommand(command); var enabled = false; if ( controller ) enabled = controller.isCommandEnabled(command); goSetCommandEnabled(command, enabled); } catch (e) { dump("An error occurred updating the "+command+" command\n"); } }
goSetCommandEnabled(command, enabled);
var enabled = false; if ( controller ) enabled = controller.isCommandEnabled(command); goSetCommandEnabled(command, enabled);
function goUpdateCommand(command){ try { var controller = top.document.commandDispatcher.getControllerForCommand(command); var enabled = false; if ( controller ) enabled = controller.isCommandEnabled(command); goSetCommandEnabled(command, enabled); } catch (e) { dump("An error occurred updating the "+command+" command\n"); } }
goUpdateCommand(commandID);
goUpdateCommand(commandID); goUpdateCommandState(commandID);
function goUpdateComposerMenuItems(commandset){ // dump("Updating commands for " + commandset.id + "\n"); for (var i = 0; i < commandset.childNodes.length; i++) { var commandID = commandset.childNodes[i].getAttribute("id"); if (commandID) { goUpdateCommand(commandID); } }}
document.getElementById('cmd_SwitchTextDirection').setAttribute('disabled', !document.commandDispatcher.focusedElement);
var changer = document.getElementById('cmd_SwitchTextDirection'); if (changer) changer.setAttribute('disabled', !document.commandDispatcher.focusedElement);
function goUpdateGlobalEditMenuItems(){ goUpdateCommand('cmd_undo'); goUpdateCommand('cmd_redo'); goUpdateCommand('cmd_cut'); goUpdateCommand('cmd_copy'); goUpdateCommand('cmd_paste'); goUpdateCommand('cmd_selectAll'); goUpdateCommand('cmd_delete'); try { // XXX: implement controller for cmd_SwitchTextDirection document.getElementById('cmd_SwitchTextDirection').setAttribute('disabled', !document.commandDispatcher.focusedElement); } catch (e) {}}
dump("Updating edit menu items\n");
function goUpdateGlobalEditMenuItems(){ dump("Updating edit menu items\n"); goUpdateCommand('cmd_undo'); goUpdateCommand('cmd_redo'); goUpdateCommand('cmd_cut'); goUpdateCommand('cmd_copy'); goUpdateCommand('cmd_paste'); goUpdateCommand('cmd_pasteQuote'); goUpdateCommand('cmd_selectAll'); goUpdateCommand('cmd_delete');}
goUpdateCommand('cmd_pasteQuote');
function goUpdateGlobalEditMenuItems(){ //dump("Updating edit menu items\n"); goUpdateCommand('cmd_undo'); goUpdateCommand('cmd_redo'); goUpdateCommand('cmd_cut'); goUpdateCommand('cmd_copy'); goUpdateCommand('cmd_paste'); goUpdateCommand('cmd_pasteQuote'); goUpdateCommand('cmd_selectAll'); goUpdateCommand('cmd_delete');}
dump("Updating select menu items\n");
function goUpdateSelectEditMenuItems(){ dump("Updating select menu items\n"); goUpdateCommand('cmd_cut'); goUpdateCommand('cmd_copy'); goUpdateCommand('cmd_delete');}
commandID == "cmd_editTable" ||
function goUpdateTableMenuItems(commandset){ var enabled = false; var enabledIfTable = false; if (window.editorShell && window.editorShell.documentEditable) { var selectedCountObj = new Object(); var tagNameObj = new Object(); var element = editorShell.GetSelectedOrParentTableElement(tagNameObj, selectedCountObj); if (element) { // Value when we need to have a selected table or inside a table enabledIfTable = true; // All others require being inside a cell or selected cell enabled = (tagNameObj.value == "td"); } } // Loop through command nodes for (var i = 0; i < commandset.childNodes.length; i++) { var commandID = commandset.childNodes[i].getAttribute("id"); if (commandID) { if (commandID == "cmd_InsertTable" || commandID == "cmd_JoinTableCells" || commandID == "cmd_SplitTableCell") { // Call the update method in the command class goUpdateCommand(commandID); } // Directly set with the values calculated here else if (commandID == "cmd_DeleteTable" || commandID == "cmd_NormalizeTable" || commandID == "cmd_TableOrCellColor") { goSetCommandEnabled(commandID, enabledIfTable); } else { goSetCommandEnabled(commandID, enabled); } } }}
commandID == "cmd_tableJoinCells" || commandID == "cmd_tableSplitCell")
commandID == "cmd_JoinTableCells" || commandID == "cmd_SplitTableCell")
function goUpdateTableMenuItems(commandset){ var enabled = false; var enabledIfTable = false; if (window.editorShell && window.editorShell.documentEditable) { var selectedCountObj = new Object(); var tagNameObj = new Object(); var element = editorShell.GetSelectedOrParentTableElement(tagNameObj, selectedCountObj); if (element) { // Value when we need to have a selected table or inside a table enabledIfTable = true; // All others require being inside a cell or selected cell enabled = (tagNameObj.value == "td"); } } // Loop through command nodes for (var i = 0; i < commandset.childNodes.length; i++) { var commandID = commandset.childNodes[i].getAttribute("id"); if (commandID) { if (commandID == "cmd_InsertTable" || commandID == "cmd_tableJoinCells" || commandID == "cmd_tableSplitCell") { // Call the update method in the command class goUpdateCommand(commandID); } // Directly set with the values calculated here else if (commandID == "cmd_DeleteTable" || commandID == "cmd_NormalizeTable") { goSetCommandEnabled(commandID, enabledIfTable); } else { goSetCommandEnabled(commandID, enabled); } } }}
commandID == "cmd_NormalizeTable")
commandID == "cmd_NormalizeTable" || commandID == "cmd_TableOrCellColor")
function goUpdateTableMenuItems(commandset){ var enabled = false; var enabledIfTable = false; if (window.editorShell && window.editorShell.documentEditable) { var selectedCountObj = new Object(); var tagNameObj = new Object(); var element = editorShell.GetSelectedOrParentTableElement(tagNameObj, selectedCountObj); if (element) { // Value when we need to have a selected table or inside a table enabledIfTable = true; // All others require being inside a cell or selected cell enabled = (tagNameObj.value == "td"); } } // Loop through command nodes for (var i = 0; i < commandset.childNodes.length; i++) { var commandID = commandset.childNodes[i].getAttribute("id"); if (commandID) { if (commandID == "cmd_InsertTable" || commandID == "cmd_tableJoinCells" || commandID == "cmd_tableSplitCell") { // Call the update method in the command class goUpdateCommand(commandID); } // Directly set with the values calculated here else if (commandID == "cmd_DeleteTable" || commandID == "cmd_NormalizeTable") { goSetCommandEnabled(commandID, enabledIfTable); } else { goSetCommandEnabled(commandID, enabled); } } }}
dump("Updating undo/redo menu items\n");
function goUpdateUndoEditMenuItems(){ dump("Updating undo/redo menu items\n"); goUpdateCommand('cmd_undo'); goUpdateCommand('cmd_redo'); // we shouldn't really do this here, but we don't get the right notifications now goUpdateCommand('cmd_paste'); goUpdateCommand('cmd_pasteQuote');}
goUpdateCommand('cmd_paste'); goUpdateCommand('cmd_pasteQuote');
function goUpdateUndoEditMenuItems(){ //dump("Updating undo/redo menu items\n"); goUpdateCommand('cmd_undo'); goUpdateCommand('cmd_redo'); // we shouldn't really do this here, but we don't get the right notifications now goUpdateCommand('cmd_paste'); goUpdateCommand('cmd_pasteQuote');}
imageView.addRow([getAbsoluteURL(elem.src, elem), gStrings.mediaImg, (elem.hasAttribute("alt")) ? elem.alt : gStrings.notSet, elem]);
imageView.addRow([getAbsoluteURL(elem.src, elem), gStrings.mediaImg, (elem.hasAttribute("alt")) ? elem.alt : gStrings.notSet, elem, false]);
function grabAll(elem){ var linktext; // check for background images, any node may have one var url = elem.ownerDocument.defaultView.getComputedStyle(elem, "").getPropertyCSSValue("background-image"); if (url && url.primitiveType == CSSPrimitiveValue.CSS_URI) imageView.addRow([url.getStringValue(), gStrings.mediaBGImg, gStrings.notSet, elem, true]); // one swi^H^H^Hif-else to rule them all // XXX: these tests should use regexes to be a little more lenient wrt whitespace, see bug 177047 if (elem instanceof nsIAnchorElement) { linktext = getValueText(elem); linkView.addRow([linktext, getAbsoluteURL(elem.href, elem), gStrings.linkAnchor, elem.target]); } else if (elem instanceof nsIImageElement) { imageView.addRow([getAbsoluteURL(elem.src, elem), gStrings.mediaImg, (elem.hasAttribute("alt")) ? elem.alt : gStrings.notSet, elem]); } else if (elem instanceof nsIAreaElement) { linkView.addRow([elem.alt, getAbsoluteURL(elem.href, elem), gStrings.linkArea, elem.target]); } else if (elem instanceof nsILinkElement) { if (elem.rel) { var rel = elem.rel; if (/\bicon\b/i.test(rel)) imageView.addRow([getAbsoluteURL(elem.href, elem), gStrings.mediaLink, "", elem]); else if (/\bstylesheet\b/i.test(rel)) linkView.addRow([elem.rel, getAbsoluteURL(elem.href, elem), gStrings.linkStylesheet, elem.target]); else linkView.addRow([elem.rel, getAbsoluteURL(elem.href, elem), gStrings.linkRel, elem.target]); } else linkView.addRow([elem.rev, getAbsoluteURL(elem.href, elem), gStrings.linkRev, elem.target]); } else if (elem instanceof nsIInputElement) { if (/^image$/i.test(elem.type)) imageView.addRow([getAbsoluteURL(elem.src, elem), gStrings.mediaInput, (elem.hasAttribute("alt")) ? elem.alt : gStrings.notSet, elem]); else if (/^submit$/i.test(elem.type)) linkView.addRow([elem.value || gStrings.linkSubmit, getAbsoluteURL(elem.form.getAttribute("action"), elem), gStrings.linkSubmission, elem.form.getAttribute("target")]); // use getAttribute() due to bug 122128 } else if (elem instanceof nsIFormElement) { formView.addRow([elem.name, elem.method, getAbsoluteURL(elem.getAttribute("action"), elem), elem]); // use getAttribute() because of bug 122128 } else if (elem instanceof nsIAppletElement) { //XXX When Java is enabled, the DOM model for <APPLET> is broken. Bug #59686. // Also, some reports of a crash with Java in Media tab (bug 136535), and mixed // content from two hosts (bug 136539) so just drop applets from Page Info when // Java is on. For the 1.0.1 branch; get a real fix on the trunk. if (!navigator.javaEnabled()) imageView.addRow([getAbsoluteURL(elem.code || elem.object, elem), gStrings.mediaApplet, "", elem]); } else if (elem instanceof nsIObjectElement) { imageView.addRow([getAbsoluteURL(elem.data, elem), gStrings.mediaObject, getValueText(elem), elem]); } else if (elem instanceof nsIEmbedElement) { imageView.addRow([getAbsoluteURL(elem.src, elem), gStrings.mediaEmbed, "", elem]); } else if (elem.hasAttributeNS(XLinkNS, "href")) { linktext = getValueText(elem); linkView.addRow([linktext, getAbsoluteURL(elem.href, elem), gStrings.linkX, ""]); } return NodeFilter.FILTER_SKIP;}
imageView.addRow([getAbsoluteURL(elem.href, elem), gStrings.mediaLink, "", elem]);
imageView.addRow([getAbsoluteURL(elem.href, elem), gStrings.mediaLink, "", elem, false]);
function grabAll(elem){ var linktext; // check for background images, any node may have one var url = elem.ownerDocument.defaultView.getComputedStyle(elem, "").getPropertyCSSValue("background-image"); if (url && url.primitiveType == CSSPrimitiveValue.CSS_URI) imageView.addRow([url.getStringValue(), gStrings.mediaBGImg, gStrings.notSet, elem, true]); // one swi^H^H^Hif-else to rule them all // XXX: these tests should use regexes to be a little more lenient wrt whitespace, see bug 177047 if (elem instanceof nsIAnchorElement) { linktext = getValueText(elem); linkView.addRow([linktext, getAbsoluteURL(elem.href, elem), gStrings.linkAnchor, elem.target]); } else if (elem instanceof nsIImageElement) { imageView.addRow([getAbsoluteURL(elem.src, elem), gStrings.mediaImg, (elem.hasAttribute("alt")) ? elem.alt : gStrings.notSet, elem]); } else if (elem instanceof nsIAreaElement) { linkView.addRow([elem.alt, getAbsoluteURL(elem.href, elem), gStrings.linkArea, elem.target]); } else if (elem instanceof nsILinkElement) { if (elem.rel) { var rel = elem.rel; if (/\bicon\b/i.test(rel)) imageView.addRow([getAbsoluteURL(elem.href, elem), gStrings.mediaLink, "", elem]); else if (/\bstylesheet\b/i.test(rel)) linkView.addRow([elem.rel, getAbsoluteURL(elem.href, elem), gStrings.linkStylesheet, elem.target]); else linkView.addRow([elem.rel, getAbsoluteURL(elem.href, elem), gStrings.linkRel, elem.target]); } else linkView.addRow([elem.rev, getAbsoluteURL(elem.href, elem), gStrings.linkRev, elem.target]); } else if (elem instanceof nsIInputElement) { if (/^image$/i.test(elem.type)) imageView.addRow([getAbsoluteURL(elem.src, elem), gStrings.mediaInput, (elem.hasAttribute("alt")) ? elem.alt : gStrings.notSet, elem]); else if (/^submit$/i.test(elem.type)) linkView.addRow([elem.value || gStrings.linkSubmit, getAbsoluteURL(elem.form.getAttribute("action"), elem), gStrings.linkSubmission, elem.form.getAttribute("target")]); // use getAttribute() due to bug 122128 } else if (elem instanceof nsIFormElement) { formView.addRow([elem.name, elem.method, getAbsoluteURL(elem.getAttribute("action"), elem), elem]); // use getAttribute() because of bug 122128 } else if (elem instanceof nsIAppletElement) { //XXX When Java is enabled, the DOM model for <APPLET> is broken. Bug #59686. // Also, some reports of a crash with Java in Media tab (bug 136535), and mixed // content from two hosts (bug 136539) so just drop applets from Page Info when // Java is on. For the 1.0.1 branch; get a real fix on the trunk. if (!navigator.javaEnabled()) imageView.addRow([getAbsoluteURL(elem.code || elem.object, elem), gStrings.mediaApplet, "", elem]); } else if (elem instanceof nsIObjectElement) { imageView.addRow([getAbsoluteURL(elem.data, elem), gStrings.mediaObject, getValueText(elem), elem]); } else if (elem instanceof nsIEmbedElement) { imageView.addRow([getAbsoluteURL(elem.src, elem), gStrings.mediaEmbed, "", elem]); } else if (elem.hasAttributeNS(XLinkNS, "href")) { linktext = getValueText(elem); linkView.addRow([linktext, getAbsoluteURL(elem.href, elem), gStrings.linkX, ""]); } return NodeFilter.FILTER_SKIP;}
imageView.addRow([getAbsoluteURL(elem.src, elem), gStrings.mediaInput, (elem.hasAttribute("alt")) ? elem.alt : gStrings.notSet, elem]);
imageView.addRow([getAbsoluteURL(elem.src, elem), gStrings.mediaInput, (elem.hasAttribute("alt")) ? elem.alt : gStrings.notSet, elem, false]);
function grabAll(elem){ var linktext; // check for background images, any node may have one var url = elem.ownerDocument.defaultView.getComputedStyle(elem, "").getPropertyCSSValue("background-image"); if (url && url.primitiveType == CSSPrimitiveValue.CSS_URI) imageView.addRow([url.getStringValue(), gStrings.mediaBGImg, gStrings.notSet, elem, true]); // one swi^H^H^Hif-else to rule them all // XXX: these tests should use regexes to be a little more lenient wrt whitespace, see bug 177047 if (elem instanceof nsIAnchorElement) { linktext = getValueText(elem); linkView.addRow([linktext, getAbsoluteURL(elem.href, elem), gStrings.linkAnchor, elem.target]); } else if (elem instanceof nsIImageElement) { imageView.addRow([getAbsoluteURL(elem.src, elem), gStrings.mediaImg, (elem.hasAttribute("alt")) ? elem.alt : gStrings.notSet, elem]); } else if (elem instanceof nsIAreaElement) { linkView.addRow([elem.alt, getAbsoluteURL(elem.href, elem), gStrings.linkArea, elem.target]); } else if (elem instanceof nsILinkElement) { if (elem.rel) { var rel = elem.rel; if (/\bicon\b/i.test(rel)) imageView.addRow([getAbsoluteURL(elem.href, elem), gStrings.mediaLink, "", elem]); else if (/\bstylesheet\b/i.test(rel)) linkView.addRow([elem.rel, getAbsoluteURL(elem.href, elem), gStrings.linkStylesheet, elem.target]); else linkView.addRow([elem.rel, getAbsoluteURL(elem.href, elem), gStrings.linkRel, elem.target]); } else linkView.addRow([elem.rev, getAbsoluteURL(elem.href, elem), gStrings.linkRev, elem.target]); } else if (elem instanceof nsIInputElement) { if (/^image$/i.test(elem.type)) imageView.addRow([getAbsoluteURL(elem.src, elem), gStrings.mediaInput, (elem.hasAttribute("alt")) ? elem.alt : gStrings.notSet, elem]); else if (/^submit$/i.test(elem.type)) linkView.addRow([elem.value || gStrings.linkSubmit, getAbsoluteURL(elem.form.getAttribute("action"), elem), gStrings.linkSubmission, elem.form.getAttribute("target")]); // use getAttribute() due to bug 122128 } else if (elem instanceof nsIFormElement) { formView.addRow([elem.name, elem.method, getAbsoluteURL(elem.getAttribute("action"), elem), elem]); // use getAttribute() because of bug 122128 } else if (elem instanceof nsIAppletElement) { //XXX When Java is enabled, the DOM model for <APPLET> is broken. Bug #59686. // Also, some reports of a crash with Java in Media tab (bug 136535), and mixed // content from two hosts (bug 136539) so just drop applets from Page Info when // Java is on. For the 1.0.1 branch; get a real fix on the trunk. if (!navigator.javaEnabled()) imageView.addRow([getAbsoluteURL(elem.code || elem.object, elem), gStrings.mediaApplet, "", elem]); } else if (elem instanceof nsIObjectElement) { imageView.addRow([getAbsoluteURL(elem.data, elem), gStrings.mediaObject, getValueText(elem), elem]); } else if (elem instanceof nsIEmbedElement) { imageView.addRow([getAbsoluteURL(elem.src, elem), gStrings.mediaEmbed, "", elem]); } else if (elem.hasAttributeNS(XLinkNS, "href")) { linktext = getValueText(elem); linkView.addRow([linktext, getAbsoluteURL(elem.href, elem), gStrings.linkX, ""]); } return NodeFilter.FILTER_SKIP;}
imageView.addRow([getAbsoluteURL(elem.code || elem.object, elem), gStrings.mediaApplet, "", elem]);
imageView.addRow([getAbsoluteURL(elem.code || elem.object, elem), gStrings.mediaApplet, "", elem, false]);
function grabAll(elem){ var linktext; // check for background images, any node may have one var url = elem.ownerDocument.defaultView.getComputedStyle(elem, "").getPropertyCSSValue("background-image"); if (url && url.primitiveType == CSSPrimitiveValue.CSS_URI) imageView.addRow([url.getStringValue(), gStrings.mediaBGImg, gStrings.notSet, elem, true]); // one swi^H^H^Hif-else to rule them all // XXX: these tests should use regexes to be a little more lenient wrt whitespace, see bug 177047 if (elem instanceof nsIAnchorElement) { linktext = getValueText(elem); linkView.addRow([linktext, getAbsoluteURL(elem.href, elem), gStrings.linkAnchor, elem.target]); } else if (elem instanceof nsIImageElement) { imageView.addRow([getAbsoluteURL(elem.src, elem), gStrings.mediaImg, (elem.hasAttribute("alt")) ? elem.alt : gStrings.notSet, elem]); } else if (elem instanceof nsIAreaElement) { linkView.addRow([elem.alt, getAbsoluteURL(elem.href, elem), gStrings.linkArea, elem.target]); } else if (elem instanceof nsILinkElement) { if (elem.rel) { var rel = elem.rel; if (/\bicon\b/i.test(rel)) imageView.addRow([getAbsoluteURL(elem.href, elem), gStrings.mediaLink, "", elem]); else if (/\bstylesheet\b/i.test(rel)) linkView.addRow([elem.rel, getAbsoluteURL(elem.href, elem), gStrings.linkStylesheet, elem.target]); else linkView.addRow([elem.rel, getAbsoluteURL(elem.href, elem), gStrings.linkRel, elem.target]); } else linkView.addRow([elem.rev, getAbsoluteURL(elem.href, elem), gStrings.linkRev, elem.target]); } else if (elem instanceof nsIInputElement) { if (/^image$/i.test(elem.type)) imageView.addRow([getAbsoluteURL(elem.src, elem), gStrings.mediaInput, (elem.hasAttribute("alt")) ? elem.alt : gStrings.notSet, elem]); else if (/^submit$/i.test(elem.type)) linkView.addRow([elem.value || gStrings.linkSubmit, getAbsoluteURL(elem.form.getAttribute("action"), elem), gStrings.linkSubmission, elem.form.getAttribute("target")]); // use getAttribute() due to bug 122128 } else if (elem instanceof nsIFormElement) { formView.addRow([elem.name, elem.method, getAbsoluteURL(elem.getAttribute("action"), elem), elem]); // use getAttribute() because of bug 122128 } else if (elem instanceof nsIAppletElement) { //XXX When Java is enabled, the DOM model for <APPLET> is broken. Bug #59686. // Also, some reports of a crash with Java in Media tab (bug 136535), and mixed // content from two hosts (bug 136539) so just drop applets from Page Info when // Java is on. For the 1.0.1 branch; get a real fix on the trunk. if (!navigator.javaEnabled()) imageView.addRow([getAbsoluteURL(elem.code || elem.object, elem), gStrings.mediaApplet, "", elem]); } else if (elem instanceof nsIObjectElement) { imageView.addRow([getAbsoluteURL(elem.data, elem), gStrings.mediaObject, getValueText(elem), elem]); } else if (elem instanceof nsIEmbedElement) { imageView.addRow([getAbsoluteURL(elem.src, elem), gStrings.mediaEmbed, "", elem]); } else if (elem.hasAttributeNS(XLinkNS, "href")) { linktext = getValueText(elem); linkView.addRow([linktext, getAbsoluteURL(elem.href, elem), gStrings.linkX, ""]); } return NodeFilter.FILTER_SKIP;}
imageView.addRow([getAbsoluteURL(elem.data, elem), gStrings.mediaObject, getValueText(elem), elem]);
imageView.addRow([getAbsoluteURL(elem.data, elem), gStrings.mediaObject, getValueText(elem), elem, false]);
function grabAll(elem){ var linktext; // check for background images, any node may have one var url = elem.ownerDocument.defaultView.getComputedStyle(elem, "").getPropertyCSSValue("background-image"); if (url && url.primitiveType == CSSPrimitiveValue.CSS_URI) imageView.addRow([url.getStringValue(), gStrings.mediaBGImg, gStrings.notSet, elem, true]); // one swi^H^H^Hif-else to rule them all // XXX: these tests should use regexes to be a little more lenient wrt whitespace, see bug 177047 if (elem instanceof nsIAnchorElement) { linktext = getValueText(elem); linkView.addRow([linktext, getAbsoluteURL(elem.href, elem), gStrings.linkAnchor, elem.target]); } else if (elem instanceof nsIImageElement) { imageView.addRow([getAbsoluteURL(elem.src, elem), gStrings.mediaImg, (elem.hasAttribute("alt")) ? elem.alt : gStrings.notSet, elem]); } else if (elem instanceof nsIAreaElement) { linkView.addRow([elem.alt, getAbsoluteURL(elem.href, elem), gStrings.linkArea, elem.target]); } else if (elem instanceof nsILinkElement) { if (elem.rel) { var rel = elem.rel; if (/\bicon\b/i.test(rel)) imageView.addRow([getAbsoluteURL(elem.href, elem), gStrings.mediaLink, "", elem]); else if (/\bstylesheet\b/i.test(rel)) linkView.addRow([elem.rel, getAbsoluteURL(elem.href, elem), gStrings.linkStylesheet, elem.target]); else linkView.addRow([elem.rel, getAbsoluteURL(elem.href, elem), gStrings.linkRel, elem.target]); } else linkView.addRow([elem.rev, getAbsoluteURL(elem.href, elem), gStrings.linkRev, elem.target]); } else if (elem instanceof nsIInputElement) { if (/^image$/i.test(elem.type)) imageView.addRow([getAbsoluteURL(elem.src, elem), gStrings.mediaInput, (elem.hasAttribute("alt")) ? elem.alt : gStrings.notSet, elem]); else if (/^submit$/i.test(elem.type)) linkView.addRow([elem.value || gStrings.linkSubmit, getAbsoluteURL(elem.form.getAttribute("action"), elem), gStrings.linkSubmission, elem.form.getAttribute("target")]); // use getAttribute() due to bug 122128 } else if (elem instanceof nsIFormElement) { formView.addRow([elem.name, elem.method, getAbsoluteURL(elem.getAttribute("action"), elem), elem]); // use getAttribute() because of bug 122128 } else if (elem instanceof nsIAppletElement) { //XXX When Java is enabled, the DOM model for <APPLET> is broken. Bug #59686. // Also, some reports of a crash with Java in Media tab (bug 136535), and mixed // content from two hosts (bug 136539) so just drop applets from Page Info when // Java is on. For the 1.0.1 branch; get a real fix on the trunk. if (!navigator.javaEnabled()) imageView.addRow([getAbsoluteURL(elem.code || elem.object, elem), gStrings.mediaApplet, "", elem]); } else if (elem instanceof nsIObjectElement) { imageView.addRow([getAbsoluteURL(elem.data, elem), gStrings.mediaObject, getValueText(elem), elem]); } else if (elem instanceof nsIEmbedElement) { imageView.addRow([getAbsoluteURL(elem.src, elem), gStrings.mediaEmbed, "", elem]); } else if (elem.hasAttributeNS(XLinkNS, "href")) { linktext = getValueText(elem); linkView.addRow([linktext, getAbsoluteURL(elem.href, elem), gStrings.linkX, ""]); } return NodeFilter.FILTER_SKIP;}
imageView.addRow([getAbsoluteURL(elem.src, elem), gStrings.mediaEmbed, "", elem]);
imageView.addRow([getAbsoluteURL(elem.src, elem), gStrings.mediaEmbed, "", elem, false]);
function grabAll(elem){ var linktext; // check for background images, any node may have one var url = elem.ownerDocument.defaultView.getComputedStyle(elem, "").getPropertyCSSValue("background-image"); if (url && url.primitiveType == CSSPrimitiveValue.CSS_URI) imageView.addRow([url.getStringValue(), gStrings.mediaBGImg, gStrings.notSet, elem, true]); // one swi^H^H^Hif-else to rule them all // XXX: these tests should use regexes to be a little more lenient wrt whitespace, see bug 177047 if (elem instanceof nsIAnchorElement) { linktext = getValueText(elem); linkView.addRow([linktext, getAbsoluteURL(elem.href, elem), gStrings.linkAnchor, elem.target]); } else if (elem instanceof nsIImageElement) { imageView.addRow([getAbsoluteURL(elem.src, elem), gStrings.mediaImg, (elem.hasAttribute("alt")) ? elem.alt : gStrings.notSet, elem]); } else if (elem instanceof nsIAreaElement) { linkView.addRow([elem.alt, getAbsoluteURL(elem.href, elem), gStrings.linkArea, elem.target]); } else if (elem instanceof nsILinkElement) { if (elem.rel) { var rel = elem.rel; if (/\bicon\b/i.test(rel)) imageView.addRow([getAbsoluteURL(elem.href, elem), gStrings.mediaLink, "", elem]); else if (/\bstylesheet\b/i.test(rel)) linkView.addRow([elem.rel, getAbsoluteURL(elem.href, elem), gStrings.linkStylesheet, elem.target]); else linkView.addRow([elem.rel, getAbsoluteURL(elem.href, elem), gStrings.linkRel, elem.target]); } else linkView.addRow([elem.rev, getAbsoluteURL(elem.href, elem), gStrings.linkRev, elem.target]); } else if (elem instanceof nsIInputElement) { if (/^image$/i.test(elem.type)) imageView.addRow([getAbsoluteURL(elem.src, elem), gStrings.mediaInput, (elem.hasAttribute("alt")) ? elem.alt : gStrings.notSet, elem]); else if (/^submit$/i.test(elem.type)) linkView.addRow([elem.value || gStrings.linkSubmit, getAbsoluteURL(elem.form.getAttribute("action"), elem), gStrings.linkSubmission, elem.form.getAttribute("target")]); // use getAttribute() due to bug 122128 } else if (elem instanceof nsIFormElement) { formView.addRow([elem.name, elem.method, getAbsoluteURL(elem.getAttribute("action"), elem), elem]); // use getAttribute() because of bug 122128 } else if (elem instanceof nsIAppletElement) { //XXX When Java is enabled, the DOM model for <APPLET> is broken. Bug #59686. // Also, some reports of a crash with Java in Media tab (bug 136535), and mixed // content from two hosts (bug 136539) so just drop applets from Page Info when // Java is on. For the 1.0.1 branch; get a real fix on the trunk. if (!navigator.javaEnabled()) imageView.addRow([getAbsoluteURL(elem.code || elem.object, elem), gStrings.mediaApplet, "", elem]); } else if (elem instanceof nsIObjectElement) { imageView.addRow([getAbsoluteURL(elem.data, elem), gStrings.mediaObject, getValueText(elem), elem]); } else if (elem instanceof nsIEmbedElement) { imageView.addRow([getAbsoluteURL(elem.src, elem), gStrings.mediaEmbed, "", elem]); } else if (elem.hasAttributeNS(XLinkNS, "href")) { linktext = getValueText(elem); linkView.addRow([linktext, getAbsoluteURL(elem.href, elem), gStrings.linkX, ""]); } return NodeFilter.FILTER_SKIP;}
var linktext;
function grabAll(elem){ // one switch to rule them all // XXX: these tests should use regexes to be a little more lenient wrt whitespace, see bug 177047 var linktext; switch (elem.nodeName.toLowerCase()) { // form tab case "form": formView.addRow([elem.name, elem.method, elem.getAttribute("action"), elem]); // use getAttribute() because of bug 122128 break; // link tab case "a": linktext = getValueText(elem); linkView.addRow([linktext, elem.href, gStrings.linkAnchor, elem.target]); break; case "area": linkView.addRow([elem.alt, elem.href, gStrings.linkArea, elem.target]); break; case "input": linkView.addRow([elem.value || gStrings.linkSubmit, elem.form.getAttribute("action"), gStrings.linkSubmission, elem.form.getAttribute("target")]); // use getAttribute() due to bug 122128 break; case "link": if (elem.rel) { var rel = elem.rel.toLowerCase(); // should this test use regexes to be a little more lenient wrt whitespace? if (rel == "icon") { imageView.addRow([elem.href, gStrings.mediaLink, "", elem]); break; } if (rel == "stylesheet" || rel == "alternate stylesheet") linktext = gStrings.linkStylesheet; else linktext = gStrings.linkRel; } else linktext = gStrings.linkRev; linkView.addRow([elem.rel || elem.rev, elem.href, linktext, elem.target]); break; // media tab case "img": imageView.addRow([elem.src, gStrings.mediaImg, (elem.hasAttribute("alt")) ? elem.alt : gStrings.notSet, elem]); break; case "input": if (elem.type == "image") imageView.addRow([elem.src, gStrings.mediaInput, (elem.hasAttribute("alt")) ? elem.alt : gStrings.notSet, elem]); break; case "applet": //XXX When Java is enabled, the DOM model for <APPLET> is broken. Bug #59686. // Also, some reports of a crash with Java in Media tab (bug 136535), and mixed // content from two hosts (bug 136539) so just drop applets from Page Info when // Java is on. For the 1.0.1 branch; get a real fix on the trunk. if (!navigator.javaEnabled()) imageView.addRow([elem.code || elem.object, gStrings.mediaApplet, "",elem]); break; case "object": imageView.addRow([elem.data, gStrings.mediaObject, getValueText(elem), elem]); break; case "embed": imageView.addRow([elem.src, gStrings.mediaEmbed, "", elem]); break; default: if (elem.hasAttributeNS(XLinkNS, "href")) { linktext = getValueText(elem); linkView.addRow([linktext, elem.href, gStrings.linkX, ""]); } break; } return NodeFilter.FILTER_SKIP;}
theList = theList.concat(grabAllXLinks(aDocument));
function grabAllLinks(aWindow,aDocument){ var theList = []; if (aWindow && aWindow.frames.length > 0) { var num = aWindow.frames.length; for (var i = 0; i < num; i++) { var frame = aWindow.frames[i]; theList = theList.concat(grabAllLinks(frame, frame.document)); } } theList = theList.concat(aDocument.getElementsByTagName("link")); var inputList = aDocument.getElementsByTagName("input"); var length = inputList.length; for (i = 0; i < length; i++) if (inputList[i].type.toLowerCase() == "submit") theList = theList.concat(inputList[i]); if ("links" in aDocument) return theList.concat(aDocument.links); else return theList.concat(aDocument.getElementsByTagNameNS(XHTMLNS, "a"));}
gPrefService.SetCharPref("browser.history.grouping", groupingType);
gPrefService.setCharPref("browser.history.grouping", groupingType);
function GroupBy(groupingType){ var outlinerBody = document.getElementById("historyOutlinerBody"); switch(groupingType) { case "day": outlinerBody.setAttribute("ref", "NC:HistoryByDate"); break; case "site": outlinerBody.setAttribute("ref", "find:groupby=hostname"); break; case "none": outlinerBody.setAttribute("ref", "NC:HistoryRoot"); break; } gPrefService.SetCharPref("browser.history.grouping", groupingType);}
function GroupBy(groupingType)
function GroupBy(aGroupingType)
function GroupBy(groupingType){ var tree = document.getElementById("historyTree"); switch(groupingType) { case "none": tree.setAttribute("ref", "NC:HistoryRoot"); break; case "site": tree.setAttribute("ref", "find:datasource=history&groupby=Hostname"); break; case "day": default: tree.setAttribute("ref", "NC:HistoryByDate"); break; } gPrefService.setCharPref("browser.history.grouping", groupingType);}
var tree = document.getElementById("historyTree"); switch(groupingType) { case "none": tree.setAttribute("ref", "NC:HistoryRoot"); break; case "site": tree.setAttribute("ref", "find:datasource=history&groupby=Hostname"); break; case "day": default: tree.setAttribute("ref", "NC:HistoryByDate"); break; } gPrefService.setCharPref("browser.history.grouping", groupingType);
gHistoryGrouping = aGroupingType; UpdateTreeGrouping(); gPrefService.setCharPref("browser.history.grouping", aGroupingType);
function GroupBy(groupingType){ var tree = document.getElementById("historyTree"); switch(groupingType) { case "none": tree.setAttribute("ref", "NC:HistoryRoot"); break; case "site": tree.setAttribute("ref", "find:datasource=history&groupby=Hostname"); break; case "day": default: tree.setAttribute("ref", "NC:HistoryByDate"); break; } gPrefService.setCharPref("browser.history.grouping", groupingType);}
gPrefService.setCharPref("browser.history.grouping", groupingType);
function GroupBy(groupingType){ gHistoryGrouping = groupingType; switch(groupingType) { case "none": gHistoryTree.setAttribute("ref", "NC:HistoryRoot"); break; case "site": // xxx for now gHistoryTree.setAttribute("ref", "NC:HistoryByDate"); break; case "day": default: gHistoryTree.setAttribute("ref", "NC:HistoryByDate"); break; } gPrefService.setCharPref("browser.history.grouping", groupingType);}
if (!mSaveHdr) mSaveHdr = messenger.messageServiceFromURI(uri).messageURIToMsgHdr(uri);
try { if (!mSaveHdr) this.mSaveHdr = messenger.messageServiceFromURI(uri).messageURIToMsgHdr(uri); } catch (ex) {}
handleAttachment: function(contentType, url, displayName, uri, isExternalAttachment) { // presentation level change....don't show vcards as external attachments in the UI. // libmime already renders them inline. if (!mSaveHdr) mSaveHdr = messenger.messageServiceFromURI(uri).messageURIToMsgHdr(uri); if (contentType == "text/x-vcard") { var inlineAttachments = pref.getBoolPref("mail.inline_attachments"); var displayHtmlAs = pref.getIntPref("mailnews.display.html_as"); if (inlineAttachments && !displayHtmlAs) { return; } } currentAttachments.push (new createNewAttachmentInfo(contentType, url, displayName, uri, isExternalAttachment)); // if we have an attachment, set the MSG_FLAG_ATTACH flag on the hdr // this will cause the "message with attachment" icon to show up // in the thread pane // we only need to do this on the first attachment var numAttachments = currentAttachments.length; if (numAttachments == 1) { // we also have to enable the File/Attachments menuitem var node = document.getElementById("fileAttachmentMenu"); if (node) node.removeAttribute("disabled"); try { // convert the uri into a hdr mSaveHdr.markHasAttachments(true); } catch (ex) { dump("ex = " + ex + "\n"); } } },
mSaveHdr.markHasAttachments(true);
this.mSaveHdr.markHasAttachments(true);
handleAttachment: function(contentType, url, displayName, uri, isExternalAttachment) { // presentation level change....don't show vcards as external attachments in the UI. // libmime already renders them inline. if (!mSaveHdr) mSaveHdr = messenger.messageServiceFromURI(uri).messageURIToMsgHdr(uri); if (contentType == "text/x-vcard") { var inlineAttachments = pref.getBoolPref("mail.inline_attachments"); var displayHtmlAs = pref.getIntPref("mailnews.display.html_as"); if (inlineAttachments && !displayHtmlAs) { return; } } currentAttachments.push (new createNewAttachmentInfo(contentType, url, displayName, uri, isExternalAttachment)); // if we have an attachment, set the MSG_FLAG_ATTACH flag on the hdr // this will cause the "message with attachment" icon to show up // in the thread pane // we only need to do this on the first attachment var numAttachments = currentAttachments.length; if (numAttachments == 1) { // we also have to enable the File/Attachments menuitem var node = document.getElementById("fileAttachmentMenu"); if (node) node.removeAttribute("disabled"); try { // convert the uri into a hdr mSaveHdr.markHasAttachments(true); } catch (ex) { dump("ex = " + ex + "\n"); } } },
currentAttachments.push (new createNewAttachmentInfo(contentType, url, displayName, uri, notDownloaded));
if (numAttachments == 1) { try { var hdr = messenger.messageServiceFromURI(uri).messageURIToMsgHdr(uri); hdr.markHasAttachments(true); } catch (ex) { dump("ex = " + ex + "\n"); } }
handleAttachment: function(contentType, url, displayName, uri, notDownloaded) { var numAttachments = currentAttachments.length; currentAttachments.push (new createNewAttachmentInfo(contentType, url, displayName, uri, notDownloaded)); },
screenDisplayName += " " + Bundle.GetStringFromName("notDownloaded");
screenDisplayName += " " + gMessengerBundle.getString("notDownloaded");
handleAttachment: function(contentType, url, displayName, uri, notDownloaded) { // be sure to escape the display name before we insert it into the // method var commandString = "OpenAttachURL('" + contentType + "', '" + url + "', '" + escape(displayName) + "', '" + uri + "')"; var screenDisplayName = displayName; if (notDownloaded) { screenDisplayName += " " + Bundle.GetStringFromName("notDownloaded"); } AddAttachmentToMenu(screenDisplayName, commandString); var count = attachmentUrlArray.length; // dump ("** attachment count**" + count + "\n"); if (count < 0) count = 0; attachmentUrlArray[count] = url; attachmentDisplayNameArray[count] = escape(displayName); attachmentMessageUriArray[count] = uri; },
mSaveHdr = messenger.messageServiceFromURI(uri).messageURIToMsgHdr(uri);
handleAttachment: function(contentType, url, displayName, uri, notDownloaded) { // presentation level change....don't show vcards as external attachments in the UI. // libmime already renders them inline. if (contentType == "text/x-vcard") { var inlineAttachments = pref.getBoolPref("mail.inline_attachments"); var displayHtmlAs = pref.getIntPref("mailnews.display.html_as"); if (inlineAttachments && !displayHtmlAs) { mSaveHdr = messenger.messageServiceFromURI(uri).messageURIToMsgHdr(uri); return; } } currentAttachments.push (new createNewAttachmentInfo(contentType, url, displayName, uri, notDownloaded)); // if we have an attachment, set the MSG_FLAG_ATTACH flag on the hdr // this will cause the "message with attachment" icon to show up // in the thread pane // we only need to do this on the first attachment var numAttachments = currentAttachments.length; if (numAttachments == 1) { // we also have to enable the File/Attachments menuitem var node = document.getElementById("fileAttachmentMenu"); if (node) node.removeAttribute("disabled"); try { // convert the uri into a hdr var hdr = messenger.messageServiceFromURI(uri).messageURIToMsgHdr(uri); hdr.markHasAttachments(true); } catch (ex) { dump("ex = " + ex + "\n"); } } },
var hdr = messenger.messageServiceFromURI(uri).messageURIToMsgHdr(uri); hdr.markHasAttachments(true);
mSaveHdr.markHasAttachments(true);
handleAttachment: function(contentType, url, displayName, uri, notDownloaded) { // presentation level change....don't show vcards as external attachments in the UI. // libmime already renders them inline. if (contentType == "text/x-vcard") { var inlineAttachments = pref.getBoolPref("mail.inline_attachments"); var displayHtmlAs = pref.getIntPref("mailnews.display.html_as"); if (inlineAttachments && !displayHtmlAs) { mSaveHdr = messenger.messageServiceFromURI(uri).messageURIToMsgHdr(uri); return; } } currentAttachments.push (new createNewAttachmentInfo(contentType, url, displayName, uri, notDownloaded)); // if we have an attachment, set the MSG_FLAG_ATTACH flag on the hdr // this will cause the "message with attachment" icon to show up // in the thread pane // we only need to do this on the first attachment var numAttachments = currentAttachments.length; if (numAttachments == 1) { // we also have to enable the File/Attachments menuitem var node = document.getElementById("fileAttachmentMenu"); if (node) node.removeAttribute("disabled"); try { // convert the uri into a hdr var hdr = messenger.messageServiceFromURI(uri).messageURIToMsgHdr(uri); hdr.markHasAttachments(true); } catch (ex) { dump("ex = " + ex + "\n"); } } },
if (contentType == "text/x-vcard") { var inlineAttachments = pref.getBoolPref("mail.inline_attachments"); var displayHtmlAs = pref.getIntPref("mailnews.display.html_as"); if (inlineAttachments && !displayHtmlAs) { mSaveHdr = messenger.messageServiceFromURI(uri).messageURIToMsgHdr(uri); return; } }
handleAttachment: function(contentType, url, displayName, uri, notDownloaded) { currentAttachments.push (new createNewAttachmentInfo(contentType, url, displayName, uri, notDownloaded)); // if we have an attachment, set the MSG_FLAG_ATTACH flag on the hdr // this will cause the "message with attachment" icon to show up // in the thread pane // we only need to do this on the first attachment var numAttachments = currentAttachments.length; if (numAttachments == 1) { // we also have to enable the File/Attachments menuitem var node = document.getElementById("fileAttachmentMenu"); if (node) node.removeAttribute("disabled"); try { // convert the uri into a hdr var hdr = messenger.messageServiceFromURI(uri).messageURIToMsgHdr(uri); hdr.markHasAttachments(true); } catch (ex) { dump("ex = " + ex + "\n"); } } },
return false;
function HandleClickEvent( aEvent ){ if( aEvent.detail == 2 && aEvent.button == 0 && aEvent.target.localName == "listitem") { if (!onStart()) return false; window.close(); return true; }}
aEvent.target.parentNode.parentNode.nodeName.toLowerCase() != "treehead" ) return onStart();
aEvent.target.parentNode.parentNode.nodeName.toLowerCase() != "treehead" ) { if (!onStart()) return false; window.close(); return true; }
function HandleClickEvent( aEvent ){ if( aEvent.detail == 2 && aEvent.button == 0 ) { if( aEvent.target.nodeName.toLowerCase() == "treecell" && aEvent.target.parentNode.parentNode.nodeName.toLowerCase() != "treehead" ) return onStart(); }}
dump("XXX fix UpdateSortMenu()\n");
function HandleColumnClick(columnID){ // if they click on the "threadCol", we need to show the threaded-only columns if ((columnID[0] == 't') && (columnID[1] == 'h')) { SetHiddenAttributeOnThreadOnlyColumns(""); // this will show them } else { SetHiddenAttributeOnThreadOnlyColumns("true"); // this will hide them } dump("XXX fix UpdateSortMenu()\n"); //UpdateSortMenu(columnID); ShowAppropriateColumns(); PersistViewAttributesOnFolder();}
dbview.viewFlags &= ~nsMsgViewFlagsType.kThreadedDisplay;
function HandleColumnClick(columnID){ var sortType = ConvertColumnIDToSortType(columnID); // if sortType is 0, this is an unsupported sort type // return, since we can't sort by that column. if (sortType == 0) return; var dbview = GetDBView(); var simpleColumns = false; try { simpleColumns = !pref.getBoolPref("mailnews.thread_pane_column_unthreads"); } catch (ex) { } if (sortType == nsMsgViewSortType.byThread) { if (!dbview.supportsThreading) return; if (simpleColumns) MsgToggleThreaded(); else if (dbview.viewFlags & nsMsgViewFlagsType.kThreadedDisplay) MsgReverseSortThreadPane(); else MsgSortByThread(); } else { if (!simpleColumns && (dbview.viewFlags & nsMsgViewFlagsType.kThreadedDisplay)) { MsgSortThreadPane(sortType); } else if (dbview.sortType == sortType) { MsgReverseSortThreadPane(); } else { MsgSortThreadPane(sortType); } }}
var currCol = document.getElementById("directoryOutliner").firstChild;
var currCol = sortedColumn.parentNode.firstChild;
function handleColumnClick(columnID) { var sortType = convertColumnIDtoSortType(columnID); var sortOrder = (outlinerView.sortType == sortType) ? !outlinerView.reverseSort : false; outlinerView.sort(sortType, sortOrder); // set the sort indicator on the column we are sorted by var sortedColumn = document.getElementById(columnID); if (outlinerView.reverseSort) { sortedColumn.setAttribute("sortDirection", "descending"); } else { sortedColumn.setAttribute("sortDirection", "ascending"); } // remove the sort indicator from the rest of the columns var currCol = document.getElementById("directoryOutliner").firstChild; while (currCol) { while (currCol && currCol.localName != "outlinercol") currCol = currCol.nextSibling; if (currCol) { if (currCol != sortedColumn) { currCol.removeAttribute("sortDirection"); } currCol = currCol.nextSibling; } }}
while (currCol && currCol.localName != "outlinercol") currCol = currCol.nextSibling; if (currCol) { if (currCol != sortedColumn) { currCol.removeAttribute("sortDirection"); } currCol = currCol.nextSibling; }
if (currCol != sortedColumn && currCol.localName == "outlinercol") currCol.removeAttribute("sortDirection"); currCol = currCol.nextSibling;
function handleColumnClick(columnID) { var sortType = convertColumnIDtoSortType(columnID); var sortOrder = (outlinerView.sortType == sortType) ? !outlinerView.reverseSort : false; outlinerView.sort(sortType, sortOrder); // set the sort indicator on the column we are sorted by var sortedColumn = document.getElementById(columnID); if (outlinerView.reverseSort) { sortedColumn.setAttribute("sortDirection", "descending"); } else { sortedColumn.setAttribute("sortDirection", "ascending"); } // remove the sort indicator from the rest of the columns var currCol = document.getElementById("directoryOutliner").firstChild; while (currCol) { while (currCol && currCol.localName != "outlinercol") currCol = currCol.nextSibling; if (currCol) { if (currCol != sortedColumn) { currCol.removeAttribute("sortDirection"); } currCol = currCol.nextSibling; } }}
var viewFlags = dbview.viewFlags; dbview.viewFlags &= ~ (nsMsgViewFlagsType.kThreadedDisplay | nsMsgViewFlagsType.kGroupBySort); if (viewFlags & nsMsgViewFlagsType.kGroupBySort) { dbview.sortType = sortType; viewDebug("switching view to all msgs\n"); return SwitchView("cmd_viewAllMsgs"); }
function HandleColumnClick(columnID){ var sortType = ConvertColumnIDToSortType(columnID); // if sortType is 0, this is an unsupported sort type // return, since we can't sort by that column. if (sortType == 0) return; var dbview = GetDBView(); var simpleColumns = false; try { simpleColumns = !pref.getBoolPref("mailnews.thread_pane_column_unthreads"); } catch (ex) { } if (sortType == nsMsgViewSortType.byThread) { if (!dbview.supportsThreading) return; if (simpleColumns) MsgToggleThreaded(); else if (dbview.viewFlags & nsMsgViewFlagsType.kThreadedDisplay) MsgReverseSortThreadPane(); else MsgSortByThread(); } else { if (!simpleColumns && (dbview.viewFlags & nsMsgViewFlagsType.kThreadedDisplay)) { var viewFlags = dbview.viewFlags; dbview.viewFlags &= ~ (nsMsgViewFlagsType.kThreadedDisplay | nsMsgViewFlagsType.kGroupBySort); if (viewFlags & nsMsgViewFlagsType.kGroupBySort) { dbview.sortType = sortType; // save sort in current view viewDebug("switching view to all msgs\n"); return SwitchView("cmd_viewAllMsgs"); } MsgSortThreadPane(sortType); } else if (dbview.sortType == sortType) { MsgReverseSortThreadPane(); } else { MsgSortThreadPane(sortType); } }}
if (gNextMessageViewIndexAfterDelete >= viewSize)
if (gNextMessageViewIndexAfterDelete != nsMsgViewIndex_None && gNextMessageViewIndexAfterDelete >= viewSize)
function HandleDeleteOrMoveMessageCompleted(folder){ var outlinerView = gSearchView.QueryInterface(Components.interfaces.nsIOutlinerView); var outlinerSelection = outlinerView.selection; viewSize = outlinerView.rowCount; if (gNextMessageViewIndexAfterDelete >= viewSize) { if (viewSize > 0) gNextMessageViewIndexAfterDelete = viewSize - 1; else gNextMessageViewIndexAfterDelete = -1; } // if we are about to set the selection with a new element then DON'T clear // the selection then add the next message to select. This just generates // an extra round of command updating notifications that we are trying to // optimize away. if (gNextMessageViewIndexAfterDelete != -1) { outlinerSelection.select(gNextMessageViewIndexAfterDelete); // since gNextMessageViewIndexAfterDelete probably has the same value // as the last index we had selected, the outliner isn't generating a new // selectionChanged notification for the outliner view. So we aren't loading the // next message. to fix this, force the selection changed update. if (outlinerView) outlinerView.selectionChanged(); EnsureRowInThreadOutlinerIsVisible(gNextMessageViewIndexAfterDelete); } else outlinerSelection.clearSelection(); /* clear selection in either case */}
gNextMessageViewIndexAfterDelete = -1;
{ gNextMessageViewIndexAfterDelete = nsMsgViewIndex_None; outlinerSelection.clearSelection(); }
function HandleDeleteOrMoveMessageCompleted(folder){ var outlinerView = gSearchView.QueryInterface(Components.interfaces.nsIOutlinerView); var outlinerSelection = outlinerView.selection; viewSize = outlinerView.rowCount; if (gNextMessageViewIndexAfterDelete >= viewSize) { if (viewSize > 0) gNextMessageViewIndexAfterDelete = viewSize - 1; else gNextMessageViewIndexAfterDelete = -1; } // if we are about to set the selection with a new element then DON'T clear // the selection then add the next message to select. This just generates // an extra round of command updating notifications that we are trying to // optimize away. if (gNextMessageViewIndexAfterDelete != -1) { outlinerSelection.select(gNextMessageViewIndexAfterDelete); // since gNextMessageViewIndexAfterDelete probably has the same value // as the last index we had selected, the outliner isn't generating a new // selectionChanged notification for the outliner view. So we aren't loading the // next message. to fix this, force the selection changed update. if (outlinerView) outlinerView.selectionChanged(); EnsureRowInThreadOutlinerIsVisible(gNextMessageViewIndexAfterDelete); } else outlinerSelection.clearSelection(); /* clear selection in either case */}
if (gNextMessageViewIndexAfterDelete != -1) {
if (gNextMessageViewIndexAfterDelete != nsMsgViewIndex_None) {
function HandleDeleteOrMoveMessageCompleted(folder){ var outlinerView = gSearchView.QueryInterface(Components.interfaces.nsIOutlinerView); var outlinerSelection = outlinerView.selection; viewSize = outlinerView.rowCount; if (gNextMessageViewIndexAfterDelete >= viewSize) { if (viewSize > 0) gNextMessageViewIndexAfterDelete = viewSize - 1; else gNextMessageViewIndexAfterDelete = -1; } // if we are about to set the selection with a new element then DON'T clear // the selection then add the next message to select. This just generates // an extra round of command updating notifications that we are trying to // optimize away. if (gNextMessageViewIndexAfterDelete != -1) { outlinerSelection.select(gNextMessageViewIndexAfterDelete); // since gNextMessageViewIndexAfterDelete probably has the same value // as the last index we had selected, the outliner isn't generating a new // selectionChanged notification for the outliner view. So we aren't loading the // next message. to fix this, force the selection changed update. if (outlinerView) outlinerView.selectionChanged(); EnsureRowInThreadOutlinerIsVisible(gNextMessageViewIndexAfterDelete); } else outlinerSelection.clearSelection(); /* clear selection in either case */}
else outlinerSelection.clearSelection();
function HandleDeleteOrMoveMessageCompleted(folder){ var outlinerView = gSearchView.QueryInterface(Components.interfaces.nsIOutlinerView); var outlinerSelection = outlinerView.selection; viewSize = outlinerView.rowCount; if (gNextMessageViewIndexAfterDelete >= viewSize) { if (viewSize > 0) gNextMessageViewIndexAfterDelete = viewSize - 1; else gNextMessageViewIndexAfterDelete = -1; } // if we are about to set the selection with a new element then DON'T clear // the selection then add the next message to select. This just generates // an extra round of command updating notifications that we are trying to // optimize away. if (gNextMessageViewIndexAfterDelete != -1) { outlinerSelection.select(gNextMessageViewIndexAfterDelete); // since gNextMessageViewIndexAfterDelete probably has the same value // as the last index we had selected, the outliner isn't generating a new // selectionChanged notification for the outliner view. So we aren't loading the // next message. to fix this, force the selection changed update. if (outlinerView) outlinerView.selectionChanged(); EnsureRowInThreadOutlinerIsVisible(gNextMessageViewIndexAfterDelete); } else outlinerSelection.clearSelection(); /* clear selection in either case */}
var treeView = gSearchView.QueryInterface(Components.interfaces.nsITreeView); var treeSelection = treeView.selection; viewSize = treeView.rowCount;
var treeView = gSearchView.QueryInterface(Components.interfaces.nsITreeView); var treeSelection = treeView.selection; var viewSize = treeView.rowCount;
function HandleDeleteOrMoveMessageCompleted(folder){ var treeView = gSearchView.QueryInterface(Components.interfaces.nsITreeView); var treeSelection = treeView.selection; viewSize = treeView.rowCount; if (gNextMessageViewIndexAfterDelete != nsMsgViewIndex_None && gNextMessageViewIndexAfterDelete >= viewSize) { if (viewSize > 0) gNextMessageViewIndexAfterDelete = viewSize - 1; else { gNextMessageViewIndexAfterDelete = nsMsgViewIndex_None; //clear the selection treeSelection.clearSelection(); } } // if we are about to set the selection with a new element then DON'T clear // the selection then add the next message to select. This just generates // an extra round of command updating notifications that we are trying to // optimize away. if (gNextMessageViewIndexAfterDelete != nsMsgViewIndex_None) { treeSelection.select(gNextMessageViewIndexAfterDelete); // since gNextMessageViewIndexAfterDelete probably has the same value // as the last index we had selected, the tree isn't generating a new // selectionChanged notification for the tree view. So we aren't loading the // next message. to fix this, force the selection changed update. if (treeView) treeView.selectionChanged(); EnsureRowInThreadTreeIsVisible(gNextMessageViewIndexAfterDelete); }}
if (gNextMessageViewIndexAfterDelete != nsMsgViewIndex_None && gNextMessageViewIndexAfterDelete >= viewSize) { if (viewSize > 0) gNextMessageViewIndexAfterDelete = viewSize - 1; else { gNextMessageViewIndexAfterDelete = nsMsgViewIndex_None; treeSelection.clearSelection(); } }
if (gNextMessageViewIndexAfterDelete == -2) { if (treeSelection.count == 0) { treeSelection.clearSelection();
function HandleDeleteOrMoveMessageCompleted(folder){ var treeView = gSearchView.QueryInterface(Components.interfaces.nsITreeView); var treeSelection = treeView.selection; viewSize = treeView.rowCount; if (gNextMessageViewIndexAfterDelete != nsMsgViewIndex_None && gNextMessageViewIndexAfterDelete >= viewSize) { if (viewSize > 0) gNextMessageViewIndexAfterDelete = viewSize - 1; else { gNextMessageViewIndexAfterDelete = nsMsgViewIndex_None; //clear the selection treeSelection.clearSelection(); } } // if we are about to set the selection with a new element then DON'T clear // the selection then add the next message to select. This just generates // an extra round of command updating notifications that we are trying to // optimize away. if (gNextMessageViewIndexAfterDelete != nsMsgViewIndex_None) { treeSelection.select(gNextMessageViewIndexAfterDelete); // since gNextMessageViewIndexAfterDelete probably has the same value // as the last index we had selected, the tree isn't generating a new // selectionChanged notification for the tree view. So we aren't loading the // next message. to fix this, force the selection changed update. if (treeView) treeView.selectionChanged(); EnsureRowInThreadTreeIsVisible(gNextMessageViewIndexAfterDelete); }}
if (gNextMessageViewIndexAfterDelete != nsMsgViewIndex_None) { treeSelection.select(gNextMessageViewIndexAfterDelete); if (treeView) treeView.selectionChanged();
UpdateMailSearch("delete from another view, 0 rows now selected"); } else if (treeSelection.count == 1) { var startIndex = {}; var endIndex = {}; treeSelection.getRangeAt(0, startIndex, endIndex); treeSelection.select(startIndex.value); treeView.selectionChanged();
function HandleDeleteOrMoveMessageCompleted(folder){ var treeView = gSearchView.QueryInterface(Components.interfaces.nsITreeView); var treeSelection = treeView.selection; viewSize = treeView.rowCount; if (gNextMessageViewIndexAfterDelete != nsMsgViewIndex_None && gNextMessageViewIndexAfterDelete >= viewSize) { if (viewSize > 0) gNextMessageViewIndexAfterDelete = viewSize - 1; else { gNextMessageViewIndexAfterDelete = nsMsgViewIndex_None; //clear the selection treeSelection.clearSelection(); } } // if we are about to set the selection with a new element then DON'T clear // the selection then add the next message to select. This just generates // an extra round of command updating notifications that we are trying to // optimize away. if (gNextMessageViewIndexAfterDelete != nsMsgViewIndex_None) { treeSelection.select(gNextMessageViewIndexAfterDelete); // since gNextMessageViewIndexAfterDelete probably has the same value // as the last index we had selected, the tree isn't generating a new // selectionChanged notification for the tree view. So we aren't loading the // next message. to fix this, force the selection changed update. if (treeView) treeView.selectionChanged(); EnsureRowInThreadTreeIsVisible(gNextMessageViewIndexAfterDelete); }}
EnsureRowInThreadTreeIsVisible(gNextMessageViewIndexAfterDelete); }
EnsureRowInThreadTreeIsVisible(startIndex.value); UpdateMailSearch("delete from another view, 1 row now selected"); } else { } } else { if (gNextMessageViewIndexAfterDelete != nsMsgViewIndex_None && gNextMessageViewIndexAfterDelete >= viewSize) { if (viewSize > 0) gNextMessageViewIndexAfterDelete = viewSize - 1; else { gNextMessageViewIndexAfterDelete = nsMsgViewIndex_None;
function HandleDeleteOrMoveMessageCompleted(folder){ var treeView = gSearchView.QueryInterface(Components.interfaces.nsITreeView); var treeSelection = treeView.selection; viewSize = treeView.rowCount; if (gNextMessageViewIndexAfterDelete != nsMsgViewIndex_None && gNextMessageViewIndexAfterDelete >= viewSize) { if (viewSize > 0) gNextMessageViewIndexAfterDelete = viewSize - 1; else { gNextMessageViewIndexAfterDelete = nsMsgViewIndex_None; //clear the selection treeSelection.clearSelection(); } } // if we are about to set the selection with a new element then DON'T clear // the selection then add the next message to select. This just generates // an extra round of command updating notifications that we are trying to // optimize away. if (gNextMessageViewIndexAfterDelete != nsMsgViewIndex_None) { treeSelection.select(gNextMessageViewIndexAfterDelete); // since gNextMessageViewIndexAfterDelete probably has the same value // as the last index we had selected, the tree isn't generating a new // selectionChanged notification for the tree view. So we aren't loading the // next message. to fix this, force the selection changed update. if (treeView) treeView.selectionChanged(); EnsureRowInThreadTreeIsVisible(gNextMessageViewIndexAfterDelete); }}
treeSelection.clearSelection(); UpdateMailSearch("delete from current view, 0 rows left"); } } if (gNextMessageViewIndexAfterDelete != nsMsgViewIndex_None) { treeSelection.select(gNextMessageViewIndexAfterDelete); if (treeView) treeView.selectionChanged(); EnsureRowInThreadTreeIsVisible(gNextMessageViewIndexAfterDelete); UpdateMailSearch("delete from current view, at least one row selected"); } } gNextMessageViewIndexAfterDelete = -2; SetAdvancedSearchStatusText(viewSize);
function HandleDeleteOrMoveMessageCompleted(folder){ var treeView = gSearchView.QueryInterface(Components.interfaces.nsITreeView); var treeSelection = treeView.selection; viewSize = treeView.rowCount; if (gNextMessageViewIndexAfterDelete != nsMsgViewIndex_None && gNextMessageViewIndexAfterDelete >= viewSize) { if (viewSize > 0) gNextMessageViewIndexAfterDelete = viewSize - 1; else { gNextMessageViewIndexAfterDelete = nsMsgViewIndex_None; //clear the selection treeSelection.clearSelection(); } } // if we are about to set the selection with a new element then DON'T clear // the selection then add the next message to select. This just generates // an extra round of command updating notifications that we are trying to // optimize away. if (gNextMessageViewIndexAfterDelete != nsMsgViewIndex_None) { treeSelection.select(gNextMessageViewIndexAfterDelete); // since gNextMessageViewIndexAfterDelete probably has the same value // as the last index we had selected, the tree isn't generating a new // selectionChanged notification for the tree view. So we aren't loading the // next message. to fix this, force the selection changed update. if (treeView) treeView.selectionChanged(); EnsureRowInThreadTreeIsVisible(gNextMessageViewIndexAfterDelete); }}
if (treeSelection.count == 0) {
if (!treeSelection) { return; } else if (treeSelection.count == 0) {
function HandleDeleteOrMoveMessageCompleted(folder){ var treeView = gSearchView.QueryInterface(Components.interfaces.nsITreeView); var treeSelection = treeView.selection; var viewSize = treeView.rowCount; if (gNextMessageViewIndexAfterDelete == -2) { // a move or delete can cause our selection can change underneath us. // this can happen when the user // deletes message from the stand alone msg window // or the three pane if (treeSelection.count == 0) { // this can happen if you double clicked a message // in the thread pane, and deleted it from the stand alone msg window // see bug #185147 treeSelection.clearSelection(); UpdateMailSearch("delete from another view, 0 rows now selected"); } else if (treeSelection.count == 1) { // this can happen if you had two messages selected // in the search results pane, and you deleted one of them from another view // (like the view in the stand alone msg window or the three pane) // since one item is selected, we should load it. var startIndex = {}; var endIndex = {}; treeSelection.getRangeAt(0, startIndex, endIndex); // select the selected item, so we'll load it treeSelection.select(startIndex.value); treeView.selectionChanged(); EnsureRowInThreadTreeIsVisible(startIndex.value); UpdateMailSearch("delete from another view, 1 row now selected"); } else { // this can happen if you have more than 2 messages selected // in the search results pane, and you deleted one of them from another view // (like the view in the stand alone msg window or the three pane) // since multiple messages are still selected, do nothing. } } else { if (gNextMessageViewIndexAfterDelete != nsMsgViewIndex_None && gNextMessageViewIndexAfterDelete >= viewSize) { if (viewSize > 0) gNextMessageViewIndexAfterDelete = viewSize - 1; else { gNextMessageViewIndexAfterDelete = nsMsgViewIndex_None; // there is nothing to select since viewSize is 0 treeSelection.clearSelection(); UpdateMailSearch("delete from current view, 0 rows left"); } } // if we are about to set the selection with a new element then DON'T clear // the selection then add the next message to select. This just generates // an extra round of command updating notifications that we are trying to // optimize away. if (gNextMessageViewIndexAfterDelete != nsMsgViewIndex_None) { treeSelection.select(gNextMessageViewIndexAfterDelete); // since gNextMessageViewIndexAfterDelete probably has the same value // as the last index we had selected, the tree isn't generating a new // selectionChanged notification for the tree view. So we aren't loading the // next message. to fix this, force the selection changed update. if (treeView) treeView.selectionChanged(); EnsureRowInThreadTreeIsVisible(gNextMessageViewIndexAfterDelete); // XXX TODO // I think there is a bug in the suppression code above. // what if I have two rows selected, and I hit delete, // and so we load the next row. // what if I have commands that only enable where // exactly one row is selected? UpdateMailSearch("delete from current view, at least one row selected"); } } // default value after delete/move/copy is over gNextMessageViewIndexAfterDelete = -2; // something might have been deleted, so update the status text SetAdvancedSearchStatusText(viewSize);}
gNextMessageViewIndexAfterDelete = -1;
gNextMessageViewIndexAfterDelete = nsMsgViewIndex_None;
function HandleDeleteOrMoveMessageFailed(folder){ gNextMessageViewIndexAfterDelete = -1;}
gNextMessageViewIndexAfterDelete = nsMsgViewIndex_None;
gNextMessageViewIndexAfterDelete = -2;
function HandleDeleteOrMoveMessageFailed(folder){ gNextMessageViewIndexAfterDelete = nsMsgViewIndex_None;}
if (outlinerView) outlinerView.selectionChanged();
function HandleDeleteOrMoveMsgCompleted(folder){ if (gNextMessageViewIndexAfterDelete != -2) { if (IsCurrentLoadedFolder(folder)) { var outlinerView = gDBView.QueryInterface(Components.interfaces.nsIOutlinerView); var outlinerSelection = outlinerView.selection; if (gNextMessageViewIndexAfterDelete != -1) { viewSize = outlinerView.rowCount; if (gNextMessageViewIndexAfterDelete >= viewSize) { if (viewSize > 0) gNextMessageViewIndexAfterDelete = viewSize - 1; else gNextMessageViewIndexAfterDelete = -1; } } // if we are about to set the selection with a new element then DON'T clear // the selection then add the next message to select. This just generates // an extra round of command updating notifications that we are trying to // optimize away. if (gNextMessageViewIndexAfterDelete != -1) { outlinerSelection.select(gNextMessageViewIndexAfterDelete); // since gNextMessageViewIndexAfterDelete probably has the same value // as the last index we had selected, the outliner isn't generating a new // selectionChanged notification for the outliner view. So we aren't loading the // next message. to fix this, force the selection changed update. if (outlinerView) outlinerView.selectionChanged(); EnsureRowInThreadOutlinerIsVisible(gNextMessageViewIndexAfterDelete); } else { outlinerSelection.clearSelection(); /* clear selection in either case */ setTitleFromFolder(folder,null); ClearMessagePane(); } } gNextMessageViewIndexAfterDelete = -2; //default value after delete/move/copy is over }}
gDBView.suppressCommandUpdating = false;
function HandleDeleteOrMoveMsgCompleted(folder){ if (gNextMessageViewIndexAfterDelete != -2) { if (IsCurrentLoadedFolder(folder)) { var outlinerView = gDBView.QueryInterface(Components.interfaces.nsIOutlinerView); var outlinerSelection = outlinerView.selection; if (gNextMessageViewIndexAfterDelete != -1) { viewSize = outlinerView.rowCount; if (gNextMessageViewIndexAfterDelete >= viewSize) { if (viewSize > 0) gNextMessageViewIndexAfterDelete = viewSize - 1; else gNextMessageViewIndexAfterDelete = -1; } } // if we are about to set the selection with a new element then DON'T clear // the selection then add the next message to select. This just generates // an extra round of command updating notifications that we are trying to // optimize away. if (gNextMessageViewIndexAfterDelete != -1) { outlinerSelection.select(gNextMessageViewIndexAfterDelete); // since gNextMessageViewIndexAfterDelete probably has the same value // as the last index we had selected, the outliner isn't generating a new // selectionChanged notification for the outliner view. So we aren't loading the // next message. to fix this, force the selection changed update. if (outlinerView) outlinerView.selectionChanged(); EnsureRowInThreadOutlinerIsVisible(gNextMessageViewIndexAfterDelete); } else { outlinerSelection.clearSelection(); /* clear selection in either case */ setTitleFromFolder(folder,null); ClearMessagePane(); } } gNextMessageViewIndexAfterDelete = -2; //default value after delete/move/copy is over }}
if (gNextMessageViewIndexAfterDelete != -1)
if (gNextMessageViewIndexAfterDelete != nsMsgViewIndex_None)
function HandleDeleteOrMoveMsgCompleted(folder){ gDBView.onDeleteCompleted(true); if (gNextMessageViewIndexAfterDelete != -2) { if (IsCurrentLoadedFolder(folder)) { var outlinerView = gDBView.QueryInterface(Components.interfaces.nsIOutlinerView); var outlinerSelection = outlinerView.selection; if (gNextMessageViewIndexAfterDelete != -1) { viewSize = outlinerView.rowCount; if (gNextMessageViewIndexAfterDelete >= viewSize) { if (viewSize > 0) gNextMessageViewIndexAfterDelete = viewSize - 1; else gNextMessageViewIndexAfterDelete = -1; } } // if we are about to set the selection with a new element then DON'T clear // the selection then add the next message to select. This just generates // an extra round of command updating notifications that we are trying to // optimize away. if (gNextMessageViewIndexAfterDelete != -1) { // when deleting a message we don't update the commands when the selection goes to 0 // (we have a hack in nsMsgDBView which prevents that update) so there is no need to // update commands when we select the next message after the delete; the commands already // have the right update state... gDBView.suppressCommandUpdating = true; outlinerSelection.select(gNextMessageViewIndexAfterDelete); // if gNextMessageViewIndexAfterDelete has the same value // as the last index we had selected, the outliner won't generate a // selectionChanged notification for the outliner view. So force a manual // selection changed call. (don't worry it's cheap if we end up calling it twice). if (outlinerView) outlinerView.selectionChanged(); EnsureRowInThreadOutlinerIsVisible(gNextMessageViewIndexAfterDelete); gDBView.suppressCommandUpdating = false; } else { outlinerSelection.clearSelection(); /* clear selection in either case */ setTitleFromFolder(folder,null); ClearMessagePane(); } } gNextMessageViewIndexAfterDelete = -2; //default value after delete/move/copy is over }}
gNextMessageViewIndexAfterDelete = -1;
{ gNextMessageViewIndexAfterDelete = nsMsgViewIndex_None; outlinerSelection.clearSelection(); setTitleFromFolder(folder,null); ClearMessagePane(); }
function HandleDeleteOrMoveMsgCompleted(folder){ gDBView.onDeleteCompleted(true); if (gNextMessageViewIndexAfterDelete != -2) { if (IsCurrentLoadedFolder(folder)) { var outlinerView = gDBView.QueryInterface(Components.interfaces.nsIOutlinerView); var outlinerSelection = outlinerView.selection; if (gNextMessageViewIndexAfterDelete != -1) { viewSize = outlinerView.rowCount; if (gNextMessageViewIndexAfterDelete >= viewSize) { if (viewSize > 0) gNextMessageViewIndexAfterDelete = viewSize - 1; else gNextMessageViewIndexAfterDelete = -1; } } // if we are about to set the selection with a new element then DON'T clear // the selection then add the next message to select. This just generates // an extra round of command updating notifications that we are trying to // optimize away. if (gNextMessageViewIndexAfterDelete != -1) { // when deleting a message we don't update the commands when the selection goes to 0 // (we have a hack in nsMsgDBView which prevents that update) so there is no need to // update commands when we select the next message after the delete; the commands already // have the right update state... gDBView.suppressCommandUpdating = true; outlinerSelection.select(gNextMessageViewIndexAfterDelete); // if gNextMessageViewIndexAfterDelete has the same value // as the last index we had selected, the outliner won't generate a // selectionChanged notification for the outliner view. So force a manual // selection changed call. (don't worry it's cheap if we end up calling it twice). if (outlinerView) outlinerView.selectionChanged(); EnsureRowInThreadOutlinerIsVisible(gNextMessageViewIndexAfterDelete); gDBView.suppressCommandUpdating = false; } else { outlinerSelection.clearSelection(); /* clear selection in either case */ setTitleFromFolder(folder,null); ClearMessagePane(); } } gNextMessageViewIndexAfterDelete = -2; //default value after delete/move/copy is over }}