rem
stringlengths
0
126k
add
stringlengths
0
441k
context
stringlengths
15
136k
function con_ondt ()
function con_ondt (type)
function con_ondt (){ var frame = getCurrentFrame(); var url = frame.script.fileName; var sourceRec = console.scripts[url]; enableDebugCommands()}
var frame = getCurrentFrame(); var url = frame.script.fileName; var sourceRec = console.scripts[url];
var frame = setCurrentFrameByIndex(0); if (type != jsdIExecutionHook.TYPE_INTERRUPTED || console._lastStackDepth != console.frames.length) { display (formatFrame(frame)); } displaySource (frame.script.fileName, frame.line, (type == jsdIExecutionHook.TYPE_INTERRUPTED) ? 0 : 2); console._lastStackDepth = console.frames.length;
function con_ondt (){ var frame = getCurrentFrame(); var url = frame.script.fileName; var sourceRec = console.scripts[url]; enableDebugCommands()}
focusSource (frame.script.fileName, frame.line);
var url = frame.script.fileName; if (!console._sources[url]) { function loaded () { focusSource (url, frame.line); } loadSource (url, loaded); } else focusSource (url, frame.line);
function con_ondt (){ var frame = getCurrentFrame(); focusSource (frame.script.fileName, frame.line); console._stackOutlinerView.setStack(console.frames); console._stackOutlinerView.setCurrentFrame (getCurrentFrameIndex()); enableDebugCommands()}
if (rowIndex == -1 || rowIndex > console.projectView.visualFootprint)
if (rowIndex == -1 || rowIndex > console.projectView.rowCount)
function con_projsel (e){ var rowIndex = console.projectView.selectedIndex; if (rowIndex == -1 || rowIndex > console.projectView.visualFootprint) return; var row = console.projectView.childData.locateChildByVisualRow(rowIndex); if (!row) { ASSERT (0, "bogus row index " + rowIndex); return; } if (row instanceof BPRecord) { var scriptRec = console.scripts[row.fileName]; if (!scriptRec) { dd ("breakpoint in unknown source"); return; } var sourceView = console.sourceView; sourceView.displaySource (scriptRec); sourceView.scrollTo (row.line - 3, -1); if (sourceView.childData && sourceView.childData.isLoaded) { sourceView.outliner.selection.timedSelect (row.line - 1, 500); } else { sourceView.pendingSelect = row.line - 1; } } else dd ("not a bp record");}
dd ("rowindex is " + rowIndex); if (rowIndex == -1 || rowIndex > console.stackView.childData.length)
if (rowIndex == -1 || rowIndex > console.scriptsView.rowCount)
function con_scptsel (e){ var rowIndex = console.scriptsView.selectedIndex; dd ("rowindex is " + rowIndex); if (rowIndex == -1 || rowIndex > console.stackView.childData.length) return; var row = console.scriptsView.childData.locateChildByVisualRow(rowIndex); ASSERT (row, "bogus row"); row.makeCurrent();}
case 9: e.preventDefault(); console.onTabCompleteRequest(e); break;
function con_slkeypress (e){ switch (e.keyCode) { case 13: if (!e.target.value) return; ev = new Object(); ev.keyEvent = e; ev.line = e.target.value; console.onInputCompleteLine (ev); e.target.value = ""; break; case 38: /* up */ if (console._lastHistoryReferenced < console._inputHistory.length - 1) e.target.value = console._inputHistory[++console._lastHistoryReferenced]; break; case 40: /* down */ if (console._lastHistoryReferenced > 0) e.target.value = console._inputHistory[--console._lastHistoryReferenced]; else { console._lastHistoryReferenced = -1; e.target.value = console._incompleteLine; } break; default: console._incompleteLine = e.target.value; break; }}
if (target.localName == "outlinerbody")
if (target.localName == "outlinerchildren")
function con_sourceclick (e){ var target = e.originalTarget; if (target.localName == "outlinerbody") { var row = new Object(); var colID = new Object(); var childElt = new Object(); var outliner = console.sourceView.outliner; outliner.getCellAt(e.clientX, e.clientY, row, colID, childElt); if (row.value == -1) return; colID = colID.value; row = row.value; if (!console.sourceView.prettyPrint && colID == "breakpoint-col") { var line = row + 1; var url = console.sourceView.childData.fileName; if (url) { if (getBreakpoint(url, line)) { clearBreakpoint (url, line); } else { setBreakpoint (url, line); } outliner.invalidateRow(row); } } }}
if (rowIndex == -1 || rowIndex > console.stackView.visualFootprint)
if (rowIndex == -1 || rowIndex > console.stackView.rowCount)
function con_stacksel (e){ var rowIndex = console.stackView.selectedIndex; if (rowIndex == -1 || rowIndex > console.stackView.visualFootprint) return; var row = console.stackView.childData.locateChildByVisualRow(rowIndex); if (!row) { ASSERT (0, "bogus row index " + rowIndex); return; } var source; var sourceView = console.sourceView; if (row instanceof FrameRecord) { var index = row.childIndex; if (index != getCurrentFrameIndex()) { setCurrentFrameByIndex(index); displayFrame (console.frames[index], index, false); } source = console.scripts[row.frame.script.fileName]; if (!source) { dd ("frame from unknown source"); return; } sourceView.displaySource(source); sourceView.softScrollTo(row.frame.line); } else if (row instanceof ValueRecord && row.jsType == jsdIValue.TYPE_OBJECT) { var objVal = row.value.objectValue; if (!objVal.creatorURL) { dd ("object with no creator"); return; } source = console.scripts[objVal.creatorURL]; if (!source) { dd ("object from unknown source"); return; } sourceView.displaySource(source); sourceView.scrollTo (objVal.creatorLine); if (sourceView.childData && sourceView.childData.isLoaded) { sourceView.outliner.selection.timedSelect (objVal.creatorLine - 1, 500); } else { sourceView.pendingSelect = objVal.creatorLine - 1; } }}
source = console.scripts[objVal.creatorURL]; if (!source)
if (!(objVal.creatorURL in console.scripts))
function con_stacksel (e){ var rowIndex = console.stackView.selectedIndex; if (rowIndex == -1 || rowIndex > console.stackView.visualFootprint) return; var row = console.stackView.childData.locateChildByVisualRow(rowIndex); if (!row) { ASSERT (0, "bogus row index " + rowIndex); return; } var source; var sourceView = console.sourceView; if (row instanceof FrameRecord) { var index = row.childIndex; if (index != getCurrentFrameIndex()) { setCurrentFrameByIndex(index); displayFrame (console.frames[index], index, false); } source = console.scripts[row.frame.script.fileName]; if (!source) { dd ("frame from unknown source"); return; } sourceView.displaySource(source); sourceView.softScrollTo(row.frame.line); } else if (row instanceof ValueRecord && row.jsType == jsdIValue.TYPE_OBJECT) { var objVal = row.value.objectValue; if (!objVal.creatorURL) { dd ("object with no creator"); return; } source = console.scripts[objVal.creatorURL]; if (!source) { dd ("object from unknown source"); return; } sourceView.displaySource(source); sourceView.scrollTo (objVal.creatorLine); if (sourceView.childData && sourceView.childData.isLoaded) { sourceView.outliner.selection.timedSelect (objVal.creatorLine - 1, 500); } else { sourceView.pendingSelect = objVal.creatorLine - 1; } }}
sourceView.displaySource(source);
sourceView.displaySource(console.scripts[objVal.creatorURL]);
function con_stacksel (e){ var rowIndex = console.stackView.selectedIndex; if (rowIndex == -1 || rowIndex > console.stackView.visualFootprint) return; var row = console.stackView.childData.locateChildByVisualRow(rowIndex); if (!row) { ASSERT (0, "bogus row index " + rowIndex); return; } var source; var sourceView = console.sourceView; if (row instanceof FrameRecord) { var index = row.childIndex; if (index != getCurrentFrameIndex()) { setCurrentFrameByIndex(index); displayFrame (console.frames[index], index, false); } source = console.scripts[row.frame.script.fileName]; if (!source) { dd ("frame from unknown source"); return; } sourceView.displaySource(source); sourceView.softScrollTo(row.frame.line); } else if (row instanceof ValueRecord && row.jsType == jsdIValue.TYPE_OBJECT) { var objVal = row.value.objectValue; if (!objVal.creatorURL) { dd ("object with no creator"); return; } source = console.scripts[objVal.creatorURL]; if (!source) { dd ("object from unknown source"); return; } sourceView.displaySource(source); sourceView.scrollTo (objVal.creatorLine); if (sourceView.childData && sourceView.childData.isLoaded) { sourceView.outliner.selection.timedSelect (objVal.creatorLine - 1, 500); } else { sourceView.pendingSelect = objVal.creatorLine - 1; } }}
document.getElementById("moveTargetMode1").disabled = !enabled || (choice == 0);
function conditionallyEnableUI(id){ if (!document.getElementById("level").checked) { document.getElementById("useWhiteList").disabled = true; document.getElementById("whiteListAbURI").disabled = true; document.getElementById("moveOnSpam").disabled = true; document.getElementById("moveTargetMode0").disabled = true; document.getElementById("actionTargetAccount").disabled = true; document.getElementById("moveTargetMode1").disabled = true; document.getElementById("actionTargetFolder").disabled = true; document.getElementById("purge").disabled = true; document.getElementById("purgeInterval").disabled = true; document.getElementById("purgeLabel").disabled = true; return; } document.getElementById("useWhiteList").disabled = false; document.getElementById("moveOnSpam").disabled = false; var enabled; if (!id || id == "moveOnSpam") { enabled = document.getElementById("moveOnSpam").checked; var choice = document.getElementById("moveTargetMode").selectedItem.getAttribute("value"); document.getElementById("actionTargetAccount").disabled = !enabled || (choice == 1); document.getElementById("actionTargetFolder").disabled = !enabled || (choice == 0); var checked = document.getElementById("purge").checked; document.getElementById("purge").disabled = !enabled; document.getElementById("purgeInterval").disabled = !enabled || !checked; document.getElementById("purgeLabel").disabled = !enabled || !checked; } if (!id || id == "purge") { enabled = document.getElementById("purge").checked; document.getElementById("purgeInterval").disabled = !enabled; document.getElementById("purgeLabel").disabled = !enabled; } if (!id || id == "useWhiteList") { enabled = document.getElementById("useWhiteList").checked; document.getElementById("whiteListAbURI").disabled = !enabled; }}
if ( plugin.NeedReboot() == true ) { globals.forceReboot( "1step.htm" ); return; } if ( plugin.DialerConnect() == false ) { plugin.DialerHangup(); window.location.replace( "error2.htm" ); return; }
function configureDialer( configFolder, acctSetupIni, regFile ){// globals.debug( "Configuring dialer" ); var intlFlag = globals.GetNameValuePair( acctSetupIni, "Mode Selection", "IntlMode" ); intlFlag = intlFlag.toLowerCase(); // * determine name of scripting file var scriptEnabledFlag = "FALSE"; var scriptFile = globals.GetNameValuePair( regFile, "Dial-In Configuration", "ScriptFileName" ); if ( scriptFile != null && scriptFile != "" ) { scriptFile = configFolder + scriptFile; scriptEnabledFlag = "TRUE"; } else { scriptFile = ""; scriptEnabledFlag = "FALSE"; } // * determine tty var ttyFlag = globals.GetNameValuePair( regFile, "Security", "SecurityDevice" ); ttyFlag = ttyFlag.toLowerCase(); if ( ttyFlag == "yes" ) ttyFlag = "TRUE"; else ttyFlag = "FALSE"; // * determine outside line access string var outsideLineAccessStr = ""; if ( documentVars.prefixData.value != "" ) { outsideLineAccessStr = documentVars.prefixData.value; x = outsideLineAccessStr.indexOf( "," ); if ( x < 0 ) outsideLineAccessStr = outsideLineAccessStr + ","; } // * configure dialer for Registration Server dialerData = plugin.newStringArray( 28 ); // increment this # as new dialer strings are added dialerData[ 0 ] = "FileName=" + regFile; dialerData[ 1 ] = "AccountName=" + globals.GetNameValuePair( regFile, "Dial-In Configuration", "SiteName" ); dialerData[ 2 ] = "ISPPhoneNum=" + globals.GetNameValuePair( regFile, "Dial-In Configuration", "Phone" ); dialerData[ 3 ] = "LoginName=" + globals.GetNameValuePair( regFile, "Dial-In Configuration", "Name" ); dialerData[ 4 ] = "Password=" + globals.GetNameValuePair( regFile, "Dial-In Configuration", "Password" ); dialerData[ 5 ] = "DNSAddress=" + globals.GetNameValuePair( regFile, "IP", "DNSAddress" ); dialerData[ 6 ] = "DNSAddress2=" + globals.GetNameValuePair( regFile, "IP", "DNSAddress2" ); dialerData[ 7 ] = "DomainName=" + globals.GetNameValuePair( regFile, "IP", "DomainName" ); dialerData[ 8 ] = "IPAddress=" + globals.GetNameValuePair( regFile, "IP", "IPAddress" ); dialerData[ 9 ] = "IntlMode=" + ( ( intlFlag == "yes" ) ? "TRUE" : "FALSE" ); dialerData[ 10 ] = "DialOnDemand=TRUE"; dialerData[ 11 ] = "ModemName=" + globals.document.vars.modem.value; dialerData[ 12 ] = "ModemType=" + plugin.GetModemType( documentVars.modem.value ); dialerData[ 13 ] = "DialType=" + documentVars.dialMethod.value; dialerData[ 14 ] = "OutsideLineAccess=" + outsideLineAccessStr; dialerData[ 15 ] = "DisableCallWaiting=" + ( ( documentVars.cwData.value != "" ) ? "TRUE" : "FALSE" ); dialerData[ 16 ] = "DisableCallWaitingCode=" + documentVars.cwData.value; dialerData[ 17 ] = "UserAreaCode=" + documentVars.modemAreaCode.value; // XXX what to do if international mode? dialerData[ 18 ] = "CountryCode=" + documentVars.countryCode.value; dialerData[ 19 ] = "LongDistanceAccess=1"; // XXX dialerData[ 20 ] = "DialAsLongDistance=TRUE"; // XXX dialerData[ 21 ] = "DialAreaCode=TRUE"; // XXX dialerData[ 22 ] = "ScriptEnabled=" + scriptEnabledFlag; dialerData[ 23 ] = "ScriptFileName=" + scriptFile; dialerData[ 24 ] = "NeedsTTYWindow=" + ttyFlag; dialerData[ 25 ] = "Location=Home"; dialerData[ 26 ] = "DisconnectTime=" + globals.GetNameValuePair( acctSetupIni, "Mode Selection", "Dialer_Disconnect_After" ); dialerData[ 27 ] = "Path=Server"; // * write out dialer data to Java Console if ( documentVars.debugMode.value.toLowerCase() == "yes" ) { globals.debug( "\nDialer data (for Registration Server): " ); var numElements = dialerData.length; for ( var x = 0; x < numElements; x++ ) globals.debug( " " + x + ": " + dialerData[ x ] ); } // * configure the dialer plugin.DialerConfig( dialerData, true ); // * check if we need to reboot if ( plugin.NeedReboot() == true ) { // XXX hardcode in name of next screen??? globals.forceReboot( "1step.htm" ); return; } if ( plugin.DialerConnect() == false ) { plugin.DialerHangup(); // XXX hardcode in name of next screen??? window.location.replace( "error2.htm" ); return; }}
mysqlin = mysqlin.replace("@MYSQL_TCP_PORT@", GetValue(configureIn, "MYSQL_TCP_PORT_DEFAULT"));
if (server_port == '') { server_port = GetValue(configureIn, "MYSQL_TCP_PORT_DEFAULT"); } mysqlin = mysqlin.replace("@MYSQL_TCP_PORT@", server_port);
function ConfigureMySqlVersion(){ // read in the Unix configure.in file var configureInTS = fso.OpenTextFile("..\\configure.in", ForReading); var configureIn = configureInTS.ReadAll(); configureInTS.Close(); // read in the mysql_version.h.in file var mysqlTS = fso.OpenTextFile("..\\include\\mysql_version.h.in", ForReading); var mysqlin = mysqlTS.ReadAll(); mysqlTS.Close(); mysqlin = mysqlin.replace("@PROTOCOL_VERSION@", GetValue(configureIn, "PROTOCOL_VERSION")); mysqlin = mysqlin.replace("@DOT_FRM_VERSION@", GetValue(configureIn, "DOT_FRM_VERSION")); mysqlin = mysqlin.replace("@MYSQL_TCP_PORT@", GetValue(configureIn, "MYSQL_TCP_PORT_DEFAULT")); mysqlin = mysqlin.replace("@MYSQL_UNIX_ADDR@", GetValue(configureIn, "MYSQL_UNIX_ADDR_DEFAULT")); mysqlin = mysqlin.replace("@MYSQL_SERVER_SUFFIX@", ''); mysqlin = mysqlin.replace("@COMPILATION_COMMENT@", 'Source distribution'); var version = GetVersion(configureIn); mysqlin = mysqlin.replace("@VERSION@", version); mysqlin = mysqlin.replace("@MYSQL_BASE_VERSION@", GetBaseVersion(version)); mysqlin = mysqlin.replace("@MYSQL_VERSION_ID@", GetVersionId(version)); var mysqlfile = fso.CreateTextFile("..\\include\\mysql_version.h", true); mysqlfile.Write(mysqlin); mysqlfile.Close();}
mysqlin = mysqlin.replace("@MYSQL_SERVER_SUFFIX@", ''); mysqlin = mysqlin.replace("@COMPILATION_COMMENT@", 'Source distribution');
mysqlin = mysqlin.replace("@MYSQL_SERVER_SUFFIX@", server_suffix); mysqlin = mysqlin.replace("@COMPILATION_COMMENT@", server_comment);
function ConfigureMySqlVersion(){ // read in the Unix configure.in file var configureInTS = fso.OpenTextFile("..\\configure.in", ForReading); var configureIn = configureInTS.ReadAll(); configureInTS.Close(); // read in the mysql_version.h.in file var mysqlTS = fso.OpenTextFile("..\\include\\mysql_version.h.in", ForReading); var mysqlin = mysqlTS.ReadAll(); mysqlTS.Close(); mysqlin = mysqlin.replace("@PROTOCOL_VERSION@", GetValue(configureIn, "PROTOCOL_VERSION")); mysqlin = mysqlin.replace("@DOT_FRM_VERSION@", GetValue(configureIn, "DOT_FRM_VERSION")); mysqlin = mysqlin.replace("@MYSQL_TCP_PORT@", GetValue(configureIn, "MYSQL_TCP_PORT_DEFAULT")); mysqlin = mysqlin.replace("@MYSQL_UNIX_ADDR@", GetValue(configureIn, "MYSQL_UNIX_ADDR_DEFAULT")); mysqlin = mysqlin.replace("@MYSQL_SERVER_SUFFIX@", ''); mysqlin = mysqlin.replace("@COMPILATION_COMMENT@", 'Source distribution'); var version = GetVersion(configureIn); mysqlin = mysqlin.replace("@VERSION@", version); mysqlin = mysqlin.replace("@MYSQL_BASE_VERSION@", GetBaseVersion(version)); mysqlin = mysqlin.replace("@MYSQL_VERSION_ID@", GetVersionId(version)); var mysqlfile = fso.CreateTextFile("..\\include\\mysql_version.h", true); mysqlfile.Write(mysqlin); mysqlfile.Close();}
promptServ.confirmEx(window, dlgTitle, text, nsIPromptService.STD_OK_CANCEL_BUTTONS, "", "", "", checkBoxLabel, checkObj, outButtonPressed);
outButtonPressed = promptServ.confirmEx(window, dlgTitle, text, nsIPromptService.STD_OK_CANCEL_BUTTONS, "", "", "", checkBoxLabel, checkObj);
confirmCheck : function(dlgTitle, text, checkBoxLabel, checkObj) { var promptServ = GetPromptService(); if (!promptServ) return; promptServ.confirmEx(window, dlgTitle, text, nsIPromptService.STD_OK_CANCEL_BUTTONS, "", "", "", checkBoxLabel, checkObj, outButtonPressed); },
(promptService.BUTTON_TITLE_IS_STRING * promptService.BUTTON_POS_1) + (promptService.BUTTON_TITLE_CANCEL * promptService.BUTTON_POS_2),
(promptService.BUTTON_TITLE_CANCEL * promptService.BUTTON_POS_1) + (promptService.BUTTON_TITLE_IS_STRING * promptService.BUTTON_POS_2),
function ConfirmDelete(){ deleteButton = document.getElementById("delbutton"); if( deleteButton.getAttribute("disabled") == "true" ) return; var profileTree = document.getElementById( "profiles" ); var selected = profileTree.selectedItems[0]; var name = selected.getAttribute("rowName"); var dialogTitle = gProfileManagerBundle.getString("deletetitle"); var dialogText; if( selected.firstChild.firstChild.getAttribute("rowMigrate") == "no" ) { var brandName = gBrandBundle.getString("brandShortName"); dialogText = gProfileManagerBundle.getFormattedString("delete4xprofile", [brandName]); dialogText = dialogText.replace(/\s*<html:br\/>/g,"\n"); if (promptService.confirm(window, dialogTitle, dialogText)) { profile.deleteProfile( name, false ); var profileKids = document.getElementById( "profilekids" ) profileKids.removeChild( selected ); } return; } else { var pathExists = true; try { var path = profile.getProfilePath(name); } catch (ex) { pathExists = false; } if (pathExists) { dialogText = gProfileManagerBundle.getFormattedString("deleteprofile", [path]); dialogText = dialogText.replace(/\s*<html:br\/>/g,"\n"); var buttonPressed = {value:0} promptService.confirmEx(window, dialogTitle, dialogText, (promptService.BUTTON_TITLE_IS_STRING * promptService.BUTTON_POS_0) + (promptService.BUTTON_TITLE_IS_STRING * promptService.BUTTON_POS_1) + (promptService.BUTTON_TITLE_CANCEL * promptService.BUTTON_POS_2), gProfileManagerBundle.getString("dontDeleteFiles"), gProfileManagerBundle.getString("deleteFiles"), null, null, {value:0}, buttonPressed); if (buttonPressed.value != 2) DeleteProfile(buttonPressed.value == 1); } else DeleteProfile(false); }}
null, null, {value:0}, buttonPressed); if (buttonPressed.value != 2) DeleteProfile(buttonPressed.value == 1);
null, {value:0}, buttonPressed); if (buttonPressed.value != 1) DeleteProfile(buttonPressed.value == 2);
function ConfirmDelete(){ deleteButton = document.getElementById("delbutton"); if( deleteButton.getAttribute("disabled") == "true" ) return; var profileTree = document.getElementById( "profiles" ); var selected = profileTree.selectedItems[0]; var name = selected.getAttribute("rowName"); var dialogTitle = gProfileManagerBundle.getString("deletetitle"); var dialogText; if( selected.firstChild.firstChild.getAttribute("rowMigrate") == "no" ) { var brandName = gBrandBundle.getString("brandShortName"); dialogText = gProfileManagerBundle.getFormattedString("delete4xprofile", [brandName]); dialogText = dialogText.replace(/\s*<html:br\/>/g,"\n"); if (promptService.confirm(window, dialogTitle, dialogText)) { profile.deleteProfile( name, false ); var profileKids = document.getElementById( "profilekids" ) profileKids.removeChild( selected ); } return; } else { var pathExists = true; try { var path = profile.getProfilePath(name); } catch (ex) { pathExists = false; } if (pathExists) { dialogText = gProfileManagerBundle.getFormattedString("deleteprofile", [path]); dialogText = dialogText.replace(/\s*<html:br\/>/g,"\n"); var buttonPressed = {value:0} promptService.confirmEx(window, dialogTitle, dialogText, (promptService.BUTTON_TITLE_IS_STRING * promptService.BUTTON_POS_0) + (promptService.BUTTON_TITLE_IS_STRING * promptService.BUTTON_POS_1) + (promptService.BUTTON_TITLE_CANCEL * promptService.BUTTON_POS_2), gProfileManagerBundle.getString("dontDeleteFiles"), gProfileManagerBundle.getString("deleteFiles"), null, null, {value:0}, buttonPressed); if (buttonPressed.value != 2) DeleteProfile(buttonPressed.value == 1); } else DeleteProfile(false); }}
if (commonDialogService.Confirm(window, title, lString)) {
if (promptService.Confirm(window, title, lString)) {
function ConfirmDelete(){ deleteButton = document.getElementById("delbutton"); if( deleteButton.getAttribute("disabled") == "true" ) return; var profileTree = document.getElementById( "profiles" ); var selected = profileTree.selectedItems[0]; var name = selected.getAttribute("rowName"); if( selected.firstChild.firstChild.getAttribute("rowMigrate") == "no" ) { // auto migrate if the user wants to. THIS IS REALLY REALLY DUMB PLEASE FIX THE BACK END. var lString = gProfileManagerBundle.getString("migratebeforedelete"); lString = lString.replace(/\s*<html:br\/>/g,"\n"); lString = lString.replace(/%brandShortName%/, gBrandBundle.getString("brandShortName")); var title = gProfileManagerBundle.getString("deletetitle"); if (commonDialogService.Confirm(window, title, lString)) { profile.deleteProfile( name, false ); var profileKids = document.getElementById( "profilekids" ) profileKids.removeChild( selected ); } return; } var win = window.openDialog('chrome://communicator/content/profile/deleteProfile.xul', 'Deleter', 'chrome,modal=yes,titlebar=yes'); return win;}
var buttonPressed = {value:0} promptService.confirmEx(window, dialogTitle, dialogText,
var buttonPressed = promptService.confirmEx(window, dialogTitle, dialogText,
function ConfirmDelete(){ deleteButton = document.getElementById("delbutton"); if( deleteButton.getAttribute("disabled") == "true" ) return; var profileList = document.getElementById( "profiles" ); var selected = profileList.selectedItems[0]; var name = selected.getAttribute("rowName"); var dialogTitle = gProfileManagerBundle.getString("deletetitle"); var dialogText; if( selected.getAttribute("rowMigrate") == "no" ) { var brandName = gBrandBundle.getString("brandShortName"); dialogText = gProfileManagerBundle.getFormattedString("delete4xprofile", [brandName]); dialogText = dialogText.replace(/\s*<html:br\/>/g,"\n"); if (promptService.confirm(window, dialogTitle, dialogText)) { profile.deleteProfile( name, false ); profileList.removeChild( selected ); } return; } else { var pathExists = true; try { var path = profile.getProfilePath(name); } catch (ex) { pathExists = false; } if (pathExists) { dialogText = gProfileManagerBundle.getFormattedString("deleteprofile", [path]); dialogText = dialogText.replace(/\s*<html:br\/>/g,"\n"); var buttonPressed = {value:0} promptService.confirmEx(window, dialogTitle, dialogText, (promptService.BUTTON_TITLE_IS_STRING * promptService.BUTTON_POS_0) + (promptService.BUTTON_TITLE_CANCEL * promptService.BUTTON_POS_1) + (promptService.BUTTON_TITLE_IS_STRING * promptService.BUTTON_POS_2), gProfileManagerBundle.getString("dontDeleteFiles"), null, gProfileManagerBundle.getString("deleteFiles"), null, {value:0}, buttonPressed); if (buttonPressed.value != 1) DeleteProfile(buttonPressed.value == 2); } else DeleteProfile(false); }}
null, {value:0}, buttonPressed); if (buttonPressed.value != 1) DeleteProfile(buttonPressed.value == 2);
null, {value:0}); if (buttonPressed != 1) DeleteProfile(buttonPressed == 2);
function ConfirmDelete(){ deleteButton = document.getElementById("delbutton"); if( deleteButton.getAttribute("disabled") == "true" ) return; var profileList = document.getElementById( "profiles" ); var selected = profileList.selectedItems[0]; var name = selected.getAttribute("rowName"); var dialogTitle = gProfileManagerBundle.getString("deletetitle"); var dialogText; if( selected.getAttribute("rowMigrate") == "no" ) { var brandName = gBrandBundle.getString("brandShortName"); dialogText = gProfileManagerBundle.getFormattedString("delete4xprofile", [brandName]); dialogText = dialogText.replace(/\s*<html:br\/>/g,"\n"); if (promptService.confirm(window, dialogTitle, dialogText)) { profile.deleteProfile( name, false ); profileList.removeChild( selected ); } return; } else { var pathExists = true; try { var path = profile.getProfilePath(name); } catch (ex) { pathExists = false; } if (pathExists) { dialogText = gProfileManagerBundle.getFormattedString("deleteprofile", [path]); dialogText = dialogText.replace(/\s*<html:br\/>/g,"\n"); var buttonPressed = {value:0} promptService.confirmEx(window, dialogTitle, dialogText, (promptService.BUTTON_TITLE_IS_STRING * promptService.BUTTON_POS_0) + (promptService.BUTTON_TITLE_CANCEL * promptService.BUTTON_POS_1) + (promptService.BUTTON_TITLE_IS_STRING * promptService.BUTTON_POS_2), gProfileManagerBundle.getString("dontDeleteFiles"), null, gProfileManagerBundle.getString("deleteFiles"), null, {value:0}, buttonPressed); if (buttonPressed.value != 1) DeleteProfile(buttonPressed.value == 2); } else DeleteProfile(false); }}
confirmEx : function(dlgTitle, text, btnFlags, btn0Title, btn1Title, btn2Title, checkBoxLabel, checkVal, outBtnPressed)
confirmEx : function(dlgTitle, text, btnFlags, btn0Title, btn1Title, btn2Title, checkBoxLabel, checkVal)
confirmEx : function(dlgTitle, text, btnFlags, btn0Title, btn1Title, btn2Title, checkBoxLabel, checkVal, outBtnPressed) { var promptServ = GetPromptService(); if (!promptServ) return; promptServ.confirmEx(window, dlgTitle, text, btnFlags, btn0Title, btn1Title, btn2Title, checkBoxLabel, checkVal, outBtnPressed); },
promptServ.confirmEx(window, dlgTitle, text, btnFlags,
return promptServ.confirmEx(window, dlgTitle, text, btnFlags,
confirmEx : function(dlgTitle, text, btnFlags, btn0Title, btn1Title, btn2Title, checkBoxLabel, checkVal, outBtnPressed) { var promptServ = GetPromptService(); if (!promptServ) return; promptServ.confirmEx(window, dlgTitle, text, btnFlags, btn0Title, btn1Title, btn2Title, checkBoxLabel, checkVal, outBtnPressed); },
checkBoxLabel, checkVal, outBtnPressed);
checkBoxLabel, checkVal);
confirmEx : function(dlgTitle, text, btnFlags, btn0Title, btn1Title, btn2Title, checkBoxLabel, checkVal, outBtnPressed) { var promptServ = GetPromptService(); if (!promptServ) return; promptServ.confirmEx(window, dlgTitle, text, btnFlags, btn0Title, btn1Title, btn2Title, checkBoxLabel, checkVal, outBtnPressed); },
if (commonDialogService.Confirm(window, title, string))
if (promptService.Confirm(window, title, string))
function ConfirmMigrateAll(){ var string = gProfileManagerBundle.getString("migrateallprofiles"); var title = gProfileManagerBundle.getString("migrateallprofilestitle"); if (commonDialogService.Confirm(window, title, string)) return true; else return false;}
var brandShortName = gBrandBundle.getString("brandRealShortName");
var brandShortName = gBrandBundle.getString("brandShortName");
function confirmSuspiciousURL(aPhishingType, aSuspiciousHostName){ var brandShortName = gBrandBundle.getString("brandRealShortName"); var titleMsg = gMessengerBundle.getString("confirmPhishingTitle"); var dialogMsg; switch (aPhishingType) { case kPhishingWithIPAddress: case kPhishingWithMismatchedHosts: dialogMsg = gMessengerBundle.getFormattedString("confirmPhishingUrl" + aPhishingType, [brandShortName, aSuspiciousHostName], 2); break; default: return false; } const nsIPS = Components.interfaces.nsIPromptService; var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(nsIPS); var buttons = nsIPS.STD_YES_NO_BUTTONS + nsIPS.BUTTON_POS_1_DEFAULT; return promptService.confirmEx(window, titleMsg, dialogMsg, buttons, "", "", "", "", {}); /* the yes button is in position 0 */}
function confirmSuspiciousURL(phishingType, hrefURL, linkNodeURL)
function confirmSuspiciousURL(phishingType, hrefURL)
function confirmSuspiciousURL(phishingType, hrefURL, linkNodeURL){ var brandShortName = gBrandBundle.getString("brandRealShortName"); var titleMsg = gMessengerBundle.getString("confirmPhishingTitle"); var dialogMsg; switch (phishingType) { case kPhishingWithIPAddress: dialogMsg = gMessengerBundle.getFormattedString("confirmPhishingUrl" + phishingType, [brandShortName, hrefURL.host], 2); break; case kPhishingWithMismatchedHosts: dialogMsg = gMessengerBundle.getFormattedString("confirmPhishingUrl" + phishingType, [brandShortName, hrefURL.host, linkNodeURL.host], 3); break; default: return false; } const nsIPS = Components.interfaces.nsIPromptService; var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(nsIPS); var buttons = nsIPS.STD_YES_NO_BUTTONS + nsIPS.BUTTON_POS_1_DEFAULT; return promptService.confirmEx(window, titleMsg, dialogMsg, buttons, "", "", "", "", {}); /* the yes button is in position 0 */}
break; case kPhishingWithMismatchedHosts: dialogMsg = gMessengerBundle.getFormattedString("confirmPhishingUrl" + phishingType, [brandShortName, hrefURL.host, linkNodeURL.host], 3);
function confirmSuspiciousURL(phishingType, hrefURL, linkNodeURL){ var brandShortName = gBrandBundle.getString("brandRealShortName"); var titleMsg = gMessengerBundle.getString("confirmPhishingTitle"); var dialogMsg; switch (phishingType) { case kPhishingWithIPAddress: dialogMsg = gMessengerBundle.getFormattedString("confirmPhishingUrl" + phishingType, [brandShortName, hrefURL.host], 2); break; case kPhishingWithMismatchedHosts: dialogMsg = gMessengerBundle.getFormattedString("confirmPhishingUrl" + phishingType, [brandShortName, hrefURL.host, linkNodeURL.host], 3); break; default: return false; } const nsIPS = Components.interfaces.nsIPromptService; var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(nsIPS); var buttons = nsIPS.STD_YES_NO_BUTTONS + nsIPS.BUTTON_POS_1_DEFAULT; return promptService.confirmEx(window, titleMsg, dialogMsg, buttons, "", "", "", "", {}); /* the yes button is in position 0 */}
var commonDialogService = nsJSComponentManager.getService("@mozilla.org/appshell/commonDialogs;1", "nsICommonDialogs"); return commonDialogService.Confirm(window, titleMsg, dialogMsg);
var promptService = nsJSComponentManager.getService("@mozilla.org/embedcomp/prompt-service;1", "nsIPromptService"); return promptService.Confirm(window, titleMsg, dialogMsg);
function ConfirmUnsubscribe(folder){ if (!gMessengerBundle) gMessengerBundle = document.getElementById("bundle_messenger"); var titleMsg = gMessengerBundle.getString("confirmUnsubscribeTitle"); var dialogMsg = gMessengerBundle.getFormattedString("confirmUnsubscribeText", [folder.name], 1); var commonDialogService = nsJSComponentManager.getService("@mozilla.org/appshell/commonDialogs;1", "nsICommonDialogs"); return commonDialogService.Confirm(window, titleMsg, dialogMsg);}
var result = {value:0};
function ConfirmWithTitle(title, message, okButtonText, cancelButtonText){ var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(); promptService = promptService.QueryInterface(Components.interfaces.nsIPromptService); if (promptService) { var result = {value:0}; var okFlag = okButtonText ? promptService.BUTTON_TITLE_IS_STRING : promptService.BUTTON_TITLE_OK; var cancelFlag = cancelButtonText ? promptService.BUTTON_TITLE_IS_STRING : promptService.BUTTON_TITLE_CANCEL; promptService.confirmEx(window, title, message, (okFlag * promptService.BUTTON_POS_0) + (cancelFlag * promptService.BUTTON_POS_1), okButtonText, cancelButtonText, null, null, {value:0}, result); return (result.value == 0); } return false;}
promptService.confirmEx(window, title, message,
return promptService.confirmEx(window, title, message,
function ConfirmWithTitle(title, message, okButtonText, cancelButtonText){ var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(); promptService = promptService.QueryInterface(Components.interfaces.nsIPromptService); if (promptService) { var result = {value:0}; var okFlag = okButtonText ? promptService.BUTTON_TITLE_IS_STRING : promptService.BUTTON_TITLE_OK; var cancelFlag = cancelButtonText ? promptService.BUTTON_TITLE_IS_STRING : promptService.BUTTON_TITLE_CANCEL; promptService.confirmEx(window, title, message, (okFlag * promptService.BUTTON_POS_0) + (cancelFlag * promptService.BUTTON_POS_1), okButtonText, cancelButtonText, null, null, {value:0}, result); return (result.value == 0); } return false;}
okButtonText, cancelButtonText, null, null, {value:0}, result); return (result.value == 0);
okButtonText, cancelButtonText, null, null, {value:0}) == 0;
function ConfirmWithTitle(title, message, okButtonText, cancelButtonText){ var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(); promptService = promptService.QueryInterface(Components.interfaces.nsIPromptService); if (promptService) { var result = {value:0}; var okFlag = okButtonText ? promptService.BUTTON_TITLE_IS_STRING : promptService.BUTTON_TITLE_OK; var cancelFlag = cancelButtonText ? promptService.BUTTON_TITLE_IS_STRING : promptService.BUTTON_TITLE_CANCEL; promptService.confirmEx(window, title, message, (okFlag * promptService.BUTTON_POS_0) + (cancelFlag * promptService.BUTTON_POS_1), okButtonText, cancelButtonText, null, null, {value:0}, result); return (result.value == 0); } return false;}
var child = treeCellChildren[i]; dump("Appended a " + child.localName + "\n");
function constructRow(treeCellChildren){ var treeitem = document.createElement("treeitem"); var row = document.createElement("treerow"); for (var i = 0; i<treeCellChildren.length; i++) { var treecell = document.createElement("treecell"); // it's ok to have empty cells if (treeCellChildren[i]) { treecell.setAttribute("allowevents", "true"); treeCellChildren[i].setAttribute("flex", "1"); treecell.appendChild(treeCellChildren[i]); } row.appendChild(treecell); } treeitem.appendChild(row); return treeitem;}
treeCellChildren[i].setAttribute("flex", "1"); treecell.appendChild(treeCellChildren[i]);
if (treeCellChildren[i]) { treeCellChildren[i].setAttribute("flex", "1"); treecell.appendChild(treeCellChildren[i]); }
function constructRow(treeCellChildren){ var treeitem = document.createElement("treeitem"); var row = document.createElement("treerow"); for (var i = 0; i<treeCellChildren.length; i++) { var treecell = document.createElement("treecell"); treecell.setAttribute("allowevents", "true"); treeCellChildren[i].setAttribute("flex", "1"); treecell.appendChild(treeCellChildren[i]); row.appendChild(treecell); } treeitem.appendChild(row); return treeitem;}
return row;
treeitem.appendChild(row); return treeitem;
function constructRow(treeCellChildren){ var row = document.createElement("treerow"); for (var i = 0; i<treeCellChildren.length; i++) { var treecell = document.createElement("treecell"); treecell.appendChild(treeCellChildren[i]); row.appendChild(treecell); } return row;}
return false;
return true;
function contentAreaClick(event) { var target = event.originalTarget; var linkNode; switch (target.localName.toLowerCase()) { case "a": linkNode = event.target; break; case "area": if (event.target.href) linkNode = event.target; break; default: linkNode = findParentNode(target, "a"); break; } if (linkNode) return handleLinkClick(event, linkNode); if (event.button == 2 && !findParentNode(target, "scrollbar") && pref.GetBoolPref("middlemouse.paste")) { return middleMousePaste(event); } return false; }
var href = hrefForClickEvent(event);
var ceParams = {event: event, href: "", linkNode: null}; hrefAndLinkNodeForClickEvent(ceParams); var href = ceParams.href;
function contentAreaClick(event) { if (!event.isTrusted) { return true; } var isKeyPress = (event.type == "keypress"); var href = hrefForClickEvent(event); if (href) { if (isKeyPress) { openNewTabWith(href, true, event.shiftKey); event.preventBubble(); } else { handleLinkClick(event, href, null); } return true; } if (pref && !isKeyPress && event.button == 1 && !event.getPreventDefault() && pref.getBoolPref("middlemouse.contentLoadURL")) { if (middleMousePaste(event)) { event.preventBubble(); } } return true; }
if ("gMessengerBundle" in this && !event.button) return !isPhishingURL(ceParams.linkNode, false);
function contentAreaClick(event) { if (!event.isTrusted) { return true; } var isKeyPress = (event.type == "keypress"); var href = hrefForClickEvent(event); if (href) { if (isKeyPress) { openNewTabWith(href, true, event.shiftKey); event.preventBubble(); } else { handleLinkClick(event, href, null); } return true; } if (pref && !isKeyPress && event.button == 1 && !event.getPreventDefault() && pref.getBoolPref("middlemouse.contentLoadURL")) { if (middleMousePaste(event)) { event.preventBubble(); } } return true; }
!event.getPreventDefault() &&
function contentAreaClick(event) { var isKeyPress = (event.type == "keypress"); var href = hrefForClickEvent(event); if (href) { if (isKeyPress) { openNewTabWith(href, true, event.shiftKey); event.preventBubble(); } else { handleLinkClick(event, href, null); } return true; } if (pref && !isKeyPress && event.button == 1 && !findParentNode(event.originalTarget, "scrollbar") && pref.getBoolPref("middlemouse.contentLoadURL")) { if (middleMousePaste(event)) { event.preventBubble(); } } return true; }
prefillTextField(target);
prefillTextBox(target);
function contentAreaClick(event) { var target = event.target; var linkNode; switch (target.localName.toLowerCase()) { case "a": linkNode = target; break; case "area": if (target.href) linkNode = target; break; case "input": if ((event.target.type.toLowerCase() == "text" || event.target.type == "") // text field && event.detail == 2 // double click && event.button == 0 // left mouse button && event.target.value.length == 0) { // no text has been entered prefillTextField(target); // prefill the empty text field if possible } break; default: linkNode = findParentNode(event.originalTarget, "a"); break; } if (linkNode) { handleLinkClick(event, linkNode.href); return true; } if (pref && event.button == 1 && !findParentNode(event.originalTarget, "scrollbar") && pref.GetBoolPref("middlemouse.contentLoadURL")) { if (middleMousePaste()) { event.preventBubble(); } } return true; }
var ceParams = {event: event, href: "", linkNode: null}; hrefAndLinkNodeForClickEvent(ceParams); var href = ceParams.href; if (href) {
var ceParams = hrefAndLinkNodeForClickEvent(event); if (ceParams) { var href = ceParams.href;
function contentAreaClick(event) { if (!event.isTrusted) { return true; } var isKeyPress = (event.type == "keypress"); var ceParams = {event: event, href: "", linkNode: null}; hrefAndLinkNodeForClickEvent(ceParams); var href = ceParams.href; if (href) { if (isKeyPress) { openNewTabWith(href, true, event.shiftKey); event.preventBubble(); } else { handleLinkClick(event, href, null); // if in mailnews block the link left click if we determine // that this URL is phishy (i.e. a potential email scam) if ("gMessengerBundle" in this && !event.button) return !isPhishingURL(ceParams.linkNode, false); } return true; } if (pref && !isKeyPress && event.button == 1 && !event.getPreventDefault() && pref.getBoolPref("middlemouse.contentLoadURL")) { if (middleMousePaste(event)) { event.preventBubble(); } } return true; }
handleLinkClick(event, href, null);
handleLinkClick(event, href, ceParams.linkNode);
function contentAreaClick(event) { if (!event.isTrusted) { return true; } var isKeyPress = (event.type == "keypress"); var ceParams = {event: event, href: "", linkNode: null}; hrefAndLinkNodeForClickEvent(ceParams); var href = ceParams.href; if (href) { if (isKeyPress) { openNewTabWith(href, true, event.shiftKey); event.preventBubble(); } else { handleLinkClick(event, href, null); // if in mailnews block the link left click if we determine // that this URL is phishy (i.e. a potential email scam) if ("gMessengerBundle" in this && !event.button) return !isPhishingURL(ceParams.linkNode, false); } return true; } if (pref && !isKeyPress && event.button == 1 && !event.getPreventDefault() && pref.getBoolPref("middlemouse.contentLoadURL")) { if (middleMousePaste(event)) { event.preventBubble(); } } return true; }
return !isPhishingURL(ceParams.linkNode, false);
return !isPhishingURL(ceParams.linkNode, false, href);
function contentAreaClick(event) { if (!event.isTrusted) { return true; } var isKeyPress = (event.type == "keypress"); var ceParams = {event: event, href: "", linkNode: null}; hrefAndLinkNodeForClickEvent(ceParams); var href = ceParams.href; if (href) { if (isKeyPress) { openNewTabWith(href, true, event.shiftKey); event.preventBubble(); } else { handleLinkClick(event, href, null); // if in mailnews block the link left click if we determine // that this URL is phishy (i.e. a potential email scam) if ("gMessengerBundle" in this && !event.button) return !isPhishingURL(ceParams.linkNode, false); } return true; } if (pref && !isKeyPress && event.button == 1 && !event.getPreventDefault() && pref.getBoolPref("middlemouse.contentLoadURL")) { if (middleMousePaste(event)) { event.preventBubble(); } } return true; }
if (fieldNormalClicks && !event.ctrlKey && !event.shiftKey &&
if (fieldNormalClicks && event.button == 0 && !event.ctrlKey && !event.shiftKey &&
function contentAreaClick(event, fieldNormalClicks) { var target = event.target; var linkNode; var local_name = target.localName; if (local_name) { local_name = local_name.toLowerCase(); } switch (local_name) { case "a": case "area": case "link": if (target.hasAttribute("href")) linkNode = target; break; default: linkNode = findParentNode(event.originalTarget, "a"); // <a> cannot be nested. So if we find an anchor without an // href, there is no useful <a> around the target if (linkNode && !linkNode.hasAttribute("href")) linkNode = null; break; } if (linkNode) { if (fieldNormalClicks && !event.ctrlKey && !event.shiftKey && !event.altKey && !event.metaKey && !linkNode.getAttribute("target")) { var url = getShortcutOrURI(linkNode.href); if (!url) return false; loadURI(url); event.preventDefault(); return false; } else handleLinkClick(event, linkNode.href, linkNode); return true; } else { // Try simple XLink var href; linkNode = target; while (linkNode) { if (linkNode.nodeType == Node.ELEMENT_NODE) { href = linkNode.getAttributeNS("http://www.w3.org/1999/xlink", "href"); break; } linkNode = linkNode.parentNode; } if (href && href != "") { href = makeURLAbsolute(target.baseURI,href); handleLinkClick(event, href, null); return true; } } if (event.button == 1 && !findParentNode(event.originalTarget, "scrollbar") && gPrefService.getBoolPref("middlemouse.contentLoadURL")) { if (middleMousePaste(event)) { event.preventBubble(); } } return true; }
var target = linkNode.getAttribute("target");
target = linkNode.getAttribute("target");
function contentAreaClick(event, fieldNormalClicks) { var target = event.target; var linkNode; var local_name = target.localName; if (local_name) { local_name = local_name.toLowerCase(); } switch (local_name) { case "a": case "area": case "link": if (target.hasAttribute("href")) linkNode = target; break; default: linkNode = findParentNode(event.originalTarget, "a"); // <a> cannot be nested. So if we find an anchor without an // href, there is no useful <a> around the target if (linkNode && !linkNode.hasAttribute("href")) linkNode = null; break; } if (linkNode) { if (event.button == 0 && !event.ctrlKey && !event.shiftKey && !event.altKey && !event.metaKey) { // A Web panel's links should target the main content area. Do this // if no modifier keys are down and if there's no target or the target equals // _main (the IE convention) or _content (the Mozilla convention). // The only reason we field _main and _content here is for the markLinkVisited // hack. var target = linkNode.getAttribute("target"); if (fieldNormalClicks && (!target || target == "_content" || target == "_main")) // IE uses _main, SeaMonkey uses _content, we support both { if (!linkNode.href) return true; if (linkNode.getAttribute("onclick")) return true; var url = getShortcutOrURI(linkNode.href); if (!url) return true; markLinkVisited(linkNode.href, linkNode); loadURI(url); event.preventDefault(); return false; } else if (linkNode.getAttribute("rel") == "sidebar") { // This is the Opera convention for a special link that - when clicked - allows // you to add a sidebar panel. We support the Opera convention here. The link's // title attribute contains the title that should be used for the sidebar panel. openDialog("chrome://browser/content/bookmarks/addBookmark2.xul", "", "centerscreen,chrome,dialog=yes,resizable=no,dependent", linkNode.getAttribute("title"), linkNode.href, null, null, null, null, true); event.preventDefault(); return false; } else if (target == "_search") { // Used in WinIE as a way of transiently loading pages in a sidebar. We // mimic that WinIE functionality here and also load the page transiently. openWebPanel(gNavigatorBundle.getString("webPanels"), linkNode.href); event.preventDefault(); return false; } } else handleLinkClick(event, linkNode.href, linkNode); return true; } else { // Try simple XLink var href; linkNode = target; while (linkNode) { if (linkNode.nodeType == Node.ELEMENT_NODE) { href = linkNode.getAttributeNS("http://www.w3.org/1999/xlink", "href"); break; } linkNode = linkNode.parentNode; } if (href && href != "") { href = makeURLAbsolute(target.baseURI,href); handleLinkClick(event, href, null); return true; } } if (event.button == 1 && !findParentNode(event.originalTarget, "scrollbar") && gPrefService.getBoolPref("middlemouse.contentLoadURL")) { if (middleMousePaste(event)) { event.preventBubble(); } } return true; }
handleLinkClick(event, linkNode.href);
handleLinkClick(event, linkNode.href, linkNode);
function contentAreaClick(event) { var target = event.target; var linkNode; var local_name = target.localName; if (local_name) { local_name = local_name.toLowerCase(); } switch (local_name) { case "a": case "area": case "link": if (target.hasAttribute("href")) linkNode = target; break; case "input": if ((event.target.type.toLowerCase() == "text" || event.target.type == "") // text field && event.detail == 2 // double click && event.button == 0 // left mouse button && event.target.value.length == 0) { // no text has been entered prefillTextBox(target); // prefill the empty text field if possible } break; default: linkNode = findParentNode(event.originalTarget, "a"); // <a> cannot be nested. So if we find an anchor without an // href, there is no useful <a> around the target if (linkNode && !linkNode.hasAttribute("href")) linkNode = null; break; } if (linkNode) { handleLinkClick(event, linkNode.href); return true; } else { // Try simple XLink var href; linkNode = target; while (linkNode) { if (linkNode.nodeType == Node.ELEMENT_NODE) { href = linkNode.getAttributeNS("http://www.w3.org/1999/xlink", "href"); break; } linkNode = linkNode.parentNode; } if (href && href != "") { href = makeURLAbsolute(target.baseURI,href); handleLinkClick(event, href); return true; } } if (pref && event.button == 1 && !findParentNode(event.originalTarget, "scrollbar") && pref.getBoolPref("middlemouse.contentLoadURL")) { if (middleMousePaste()) { event.preventBubble(); } } return true; }
handleLinkClick(event, href);
handleLinkClick(event, href, null);
function contentAreaClick(event) { var target = event.target; var linkNode; var local_name = target.localName; if (local_name) { local_name = local_name.toLowerCase(); } switch (local_name) { case "a": case "area": case "link": if (target.hasAttribute("href")) linkNode = target; break; case "input": if ((event.target.type.toLowerCase() == "text" || event.target.type == "") // text field && event.detail == 2 // double click && event.button == 0 // left mouse button && event.target.value.length == 0) { // no text has been entered prefillTextBox(target); // prefill the empty text field if possible } break; default: linkNode = findParentNode(event.originalTarget, "a"); // <a> cannot be nested. So if we find an anchor without an // href, there is no useful <a> around the target if (linkNode && !linkNode.hasAttribute("href")) linkNode = null; break; } if (linkNode) { handleLinkClick(event, linkNode.href); return true; } else { // Try simple XLink var href; linkNode = target; while (linkNode) { if (linkNode.nodeType == Node.ELEMENT_NODE) { href = linkNode.getAttributeNS("http://www.w3.org/1999/xlink", "href"); break; } linkNode = linkNode.parentNode; } if (href && href != "") { href = makeURLAbsolute(target.baseURI,href); handleLinkClick(event, href); return true; } } if (pref && event.button == 1 && !findParentNode(event.originalTarget, "scrollbar") && pref.getBoolPref("middlemouse.contentLoadURL")) { if (middleMousePaste()) { event.preventBubble(); } } return true; }
if (isDocumentFrame(focusedWindow)) { gFocusedURL = focusedWindow.location.href;
if (isContentFrame(focusedWindow)) { gFocusedURL = Components.lookupMethod(focusedWindow, 'location').call(focusedWindow).href;
function contentAreaFrameFocus(){ var focusedWindow = document.commandDispatcher.focusedWindow; if (isDocumentFrame(focusedWindow)) { gFocusedURL = focusedWindow.location.href; gFocusedDocument = focusedWindow.document; }}
function contextChangePriority( Priority, event )
function contextChangePriority( event, Priority )
function contextChangePriority( Priority, event ){ if (tree.treeBoxObject.selection.count > 0) { var treeitem = tree.treeBoxObject.view.getItemAtIndex( tree.currentIndex ); if(treeitem) { var todoId = treeitem.getAttribute("toDoID"); var ToDoItem = gICalLib.fetchToDo( todoId ); ToDoItem.priority = Priority; gICalLib.modifyTodo( ToDoItem ); } }}
var ToDoItem = gICalLib.fetchToDo( todoId );
var ToDoItem = gICalLib.fetchTodo( todoId );
function contextChangePriority( Priority, event ){ if (tree.treeBoxObject.selection.count > 0) { var treeitem = tree.treeBoxObject.view.getItemAtIndex( tree.currentIndex ); if(treeitem) { var todoId = treeitem.getAttribute("toDoID"); var ToDoItem = gICalLib.fetchToDo( todoId ); ToDoItem.priority = Priority; gICalLib.modifyTodo( ToDoItem ); } }}
var isMail = false;
var isMail = info.importType == 'mail' ? true : false; var clear = true;
function ContinueImport( info) { var isMail = false; /* dump( "*** ContinueImport\n"); */ if (info.importType == 'mail') isMail = true; else isMail = false; var clear = true; if (info.importInterface) { if (!info.importInterface.ContinueImport()) { info.importSuccess = false; clearInterval( info.intervalState); if (info.progressWindow != null) { info.progressWindow.close(); info.progressWindow = null; } if (isMail == true) ShowMailComplete( false); else ShowAddressComplete( false); } else if ((pcnt = info.importInterface.GetProgress()) < 100) { clear = false; if (info.progressWindow != null) { if (pcnt < 5) pcnt = 5; info.progressWindow.SetProgress( pcnt); if (isMail == true) { var mailName = info.importInterface.GetData( "currentMailbox"); if (mailName != null) { mailName = mailName.QueryInterface( Components.interfaces.nsISupportsWString); if (mailName != null) info.progressWindow.SetStatusText( mailName.data); } } } } else { clearInterval( info.intervalState); info.importSuccess = true; if (info.progressWindow != null) { info.progressWindow.close(); info.progressWindow = null; } if (isMail == true) ShowMailComplete( true); else ShowAddressComplete( true); } } else { dump( "*** ERROR: info.importInterface is null\n"); } if (clear == true) { info.intervalState = null; info.importInterface = null; }}
if (info.importType == 'mail') isMail = true; else isMail = false; var clear = true;
function ContinueImport( info) { var isMail = false; /* dump( "*** ContinueImport\n"); */ if (info.importType == 'mail') isMail = true; else isMail = false; var clear = true; if (info.importInterface) { if (!info.importInterface.ContinueImport()) { info.importSuccess = false; clearInterval( info.intervalState); if (info.progressWindow != null) { info.progressWindow.close(); info.progressWindow = null; } if (isMail == true) ShowMailComplete( false); else ShowAddressComplete( false); } else if ((pcnt = info.importInterface.GetProgress()) < 100) { clear = false; if (info.progressWindow != null) { if (pcnt < 5) pcnt = 5; info.progressWindow.SetProgress( pcnt); if (isMail == true) { var mailName = info.importInterface.GetData( "currentMailbox"); if (mailName != null) { mailName = mailName.QueryInterface( Components.interfaces.nsISupportsWString); if (mailName != null) info.progressWindow.SetStatusText( mailName.data); } } } } else { clearInterval( info.intervalState); info.importSuccess = true; if (info.progressWindow != null) { info.progressWindow.close(); info.progressWindow = null; } if (isMail == true) ShowMailComplete( true); else ShowAddressComplete( true); } } else { dump( "*** ERROR: info.importInterface is null\n"); } if (clear == true) { info.intervalState = null; info.importInterface = null; }}
info.progressWindow.close();
var deck = document.getElementById("stateDeck"); deck.setAttribute("index", "3");
function ContinueImport( info) { var isMail = false; /* dump( "*** ContinueImport\n"); */ if (info.importType == 'mail') isMail = true; else isMail = false; var clear = true; if (info.importInterface) { if (!info.importInterface.ContinueImport()) { info.importSuccess = false; clearInterval( info.intervalState); if (info.progressWindow != null) { info.progressWindow.close(); info.progressWindow = null; } if (isMail == true) ShowMailComplete( false); else ShowAddressComplete( false); } else if ((pcnt = info.importInterface.GetProgress()) < 100) { clear = false; if (info.progressWindow != null) { if (pcnt < 5) pcnt = 5; info.progressWindow.SetProgress( pcnt); if (isMail == true) { var mailName = info.importInterface.GetData( "currentMailbox"); if (mailName != null) { mailName = mailName.QueryInterface( Components.interfaces.nsISupportsWString); if (mailName != null) info.progressWindow.SetStatusText( mailName.data); } } } } else { clearInterval( info.intervalState); info.importSuccess = true; if (info.progressWindow != null) { info.progressWindow.close(); info.progressWindow = null; } if (isMail == true) ShowMailComplete( true); else ShowAddressComplete( true); } } else { dump( "*** ERROR: info.importInterface is null\n"); } if (clear == true) { info.intervalState = null; info.importInterface = null; }}
if (isMail == true) ShowMailComplete( false); else ShowAddressComplete( false);
ShowImportResults(false, isMail ? 'Mail' : 'Address');
function ContinueImport( info) { var isMail = false; /* dump( "*** ContinueImport\n"); */ if (info.importType == 'mail') isMail = true; else isMail = false; var clear = true; if (info.importInterface) { if (!info.importInterface.ContinueImport()) { info.importSuccess = false; clearInterval( info.intervalState); if (info.progressWindow != null) { info.progressWindow.close(); info.progressWindow = null; } if (isMail == true) ShowMailComplete( false); else ShowAddressComplete( false); } else if ((pcnt = info.importInterface.GetProgress()) < 100) { clear = false; if (info.progressWindow != null) { if (pcnt < 5) pcnt = 5; info.progressWindow.SetProgress( pcnt); if (isMail == true) { var mailName = info.importInterface.GetData( "currentMailbox"); if (mailName != null) { mailName = mailName.QueryInterface( Components.interfaces.nsISupportsWString); if (mailName != null) info.progressWindow.SetStatusText( mailName.data); } } } } else { clearInterval( info.intervalState); info.importSuccess = true; if (info.progressWindow != null) { info.progressWindow.close(); info.progressWindow = null; } if (isMail == true) ShowMailComplete( true); else ShowAddressComplete( true); } } else { dump( "*** ERROR: info.importInterface is null\n"); } if (clear == true) { info.intervalState = null; info.importInterface = null; }}
info.progressWindow.SetProgress( pcnt); if (isMail == true) {
SetProgress( pcnt); if (isMail) {
function ContinueImport( info) { var isMail = false; /* dump( "*** ContinueImport\n"); */ if (info.importType == 'mail') isMail = true; else isMail = false; var clear = true; if (info.importInterface) { if (!info.importInterface.ContinueImport()) { info.importSuccess = false; clearInterval( info.intervalState); if (info.progressWindow != null) { info.progressWindow.close(); info.progressWindow = null; } if (isMail == true) ShowMailComplete( false); else ShowAddressComplete( false); } else if ((pcnt = info.importInterface.GetProgress()) < 100) { clear = false; if (info.progressWindow != null) { if (pcnt < 5) pcnt = 5; info.progressWindow.SetProgress( pcnt); if (isMail == true) { var mailName = info.importInterface.GetData( "currentMailbox"); if (mailName != null) { mailName = mailName.QueryInterface( Components.interfaces.nsISupportsWString); if (mailName != null) info.progressWindow.SetStatusText( mailName.data); } } } } else { clearInterval( info.intervalState); info.importSuccess = true; if (info.progressWindow != null) { info.progressWindow.close(); info.progressWindow = null; } if (isMail == true) ShowMailComplete( true); else ShowAddressComplete( true); } } else { dump( "*** ERROR: info.importInterface is null\n"); } if (clear == true) { info.intervalState = null; info.importInterface = null; }}
if (mailName != null) {
if (mailName) {
function ContinueImport( info) { var isMail = false; /* dump( "*** ContinueImport\n"); */ if (info.importType == 'mail') isMail = true; else isMail = false; var clear = true; if (info.importInterface) { if (!info.importInterface.ContinueImport()) { info.importSuccess = false; clearInterval( info.intervalState); if (info.progressWindow != null) { info.progressWindow.close(); info.progressWindow = null; } if (isMail == true) ShowMailComplete( false); else ShowAddressComplete( false); } else if ((pcnt = info.importInterface.GetProgress()) < 100) { clear = false; if (info.progressWindow != null) { if (pcnt < 5) pcnt = 5; info.progressWindow.SetProgress( pcnt); if (isMail == true) { var mailName = info.importInterface.GetData( "currentMailbox"); if (mailName != null) { mailName = mailName.QueryInterface( Components.interfaces.nsISupportsWString); if (mailName != null) info.progressWindow.SetStatusText( mailName.data); } } } } else { clearInterval( info.intervalState); info.importSuccess = true; if (info.progressWindow != null) { info.progressWindow.close(); info.progressWindow = null; } if (isMail == true) ShowMailComplete( true); else ShowAddressComplete( true); } } else { dump( "*** ERROR: info.importInterface is null\n"); } if (clear == true) { info.intervalState = null; info.importInterface = null; }}
if (mailName != null) info.progressWindow.SetStatusText( mailName.data);
if (mailName) SetStatusText( mailName.data);
function ContinueImport( info) { var isMail = false; /* dump( "*** ContinueImport\n"); */ if (info.importType == 'mail') isMail = true; else isMail = false; var clear = true; if (info.importInterface) { if (!info.importInterface.ContinueImport()) { info.importSuccess = false; clearInterval( info.intervalState); if (info.progressWindow != null) { info.progressWindow.close(); info.progressWindow = null; } if (isMail == true) ShowMailComplete( false); else ShowAddressComplete( false); } else if ((pcnt = info.importInterface.GetProgress()) < 100) { clear = false; if (info.progressWindow != null) { if (pcnt < 5) pcnt = 5; info.progressWindow.SetProgress( pcnt); if (isMail == true) { var mailName = info.importInterface.GetData( "currentMailbox"); if (mailName != null) { mailName = mailName.QueryInterface( Components.interfaces.nsISupportsWString); if (mailName != null) info.progressWindow.SetStatusText( mailName.data); } } } } else { clearInterval( info.intervalState); info.importSuccess = true; if (info.progressWindow != null) { info.progressWindow.close(); info.progressWindow = null; } if (isMail == true) ShowMailComplete( true); else ShowAddressComplete( true); } } else { dump( "*** ERROR: info.importInterface is null\n"); } if (clear == true) { info.intervalState = null; info.importInterface = null; }}
if (info.progressWindow != null) { info.progressWindow.close();
if (info.progressWindow) { var deck = document.getElementById("stateDeck"); deck.setAttribute("index", "3");
function ContinueImport( info) { var isMail = false; /* dump( "*** ContinueImport\n"); */ if (info.importType == 'mail') isMail = true; else isMail = false; var clear = true; if (info.importInterface) { if (!info.importInterface.ContinueImport()) { info.importSuccess = false; clearInterval( info.intervalState); if (info.progressWindow != null) { info.progressWindow.close(); info.progressWindow = null; } if (isMail == true) ShowMailComplete( false); else ShowAddressComplete( false); } else if ((pcnt = info.importInterface.GetProgress()) < 100) { clear = false; if (info.progressWindow != null) { if (pcnt < 5) pcnt = 5; info.progressWindow.SetProgress( pcnt); if (isMail == true) { var mailName = info.importInterface.GetData( "currentMailbox"); if (mailName != null) { mailName = mailName.QueryInterface( Components.interfaces.nsISupportsWString); if (mailName != null) info.progressWindow.SetStatusText( mailName.data); } } } } else { clearInterval( info.intervalState); info.importSuccess = true; if (info.progressWindow != null) { info.progressWindow.close(); info.progressWindow = null; } if (isMail == true) ShowMailComplete( true); else ShowAddressComplete( true); } } else { dump( "*** ERROR: info.importInterface is null\n"); } if (clear == true) { info.intervalState = null; info.importInterface = null; }}
if (isMail == true) ShowMailComplete( true); else ShowAddressComplete( true);
ShowImportResults(true, isMail ? 'Mail' : 'Address');
function ContinueImport( info) { var isMail = false; /* dump( "*** ContinueImport\n"); */ if (info.importType == 'mail') isMail = true; else isMail = false; var clear = true; if (info.importInterface) { if (!info.importInterface.ContinueImport()) { info.importSuccess = false; clearInterval( info.intervalState); if (info.progressWindow != null) { info.progressWindow.close(); info.progressWindow = null; } if (isMail == true) ShowMailComplete( false); else ShowAddressComplete( false); } else if ((pcnt = info.importInterface.GetProgress()) < 100) { clear = false; if (info.progressWindow != null) { if (pcnt < 5) pcnt = 5; info.progressWindow.SetProgress( pcnt); if (isMail == true) { var mailName = info.importInterface.GetData( "currentMailbox"); if (mailName != null) { mailName = mailName.QueryInterface( Components.interfaces.nsISupportsWString); if (mailName != null) info.progressWindow.SetStatusText( mailName.data); } } } } else { clearInterval( info.intervalState); info.importSuccess = true; if (info.progressWindow != null) { info.progressWindow.close(); info.progressWindow = null; } if (isMail == true) ShowMailComplete( true); else ShowAddressComplete( true); } } else { dump( "*** ERROR: info.importInterface is null\n"); } if (clear == true) { info.intervalState = null; info.importInterface = null; }}
else { dump( "*** ERROR: info.importInterface is null\n"); } if (clear == true) {
if (clear) {
function ContinueImport( info) { var isMail = false; /* dump( "*** ContinueImport\n"); */ if (info.importType == 'mail') isMail = true; else isMail = false; var clear = true; if (info.importInterface) { if (!info.importInterface.ContinueImport()) { info.importSuccess = false; clearInterval( info.intervalState); if (info.progressWindow != null) { info.progressWindow.close(); info.progressWindow = null; } if (isMail == true) ShowMailComplete( false); else ShowAddressComplete( false); } else if ((pcnt = info.importInterface.GetProgress()) < 100) { clear = false; if (info.progressWindow != null) { if (pcnt < 5) pcnt = 5; info.progressWindow.SetProgress( pcnt); if (isMail == true) { var mailName = info.importInterface.GetData( "currentMailbox"); if (mailName != null) { mailName = mailName.QueryInterface( Components.interfaces.nsISupportsWString); if (mailName != null) info.progressWindow.SetStatusText( mailName.data); } } } } else { clearInterval( info.intervalState); info.importSuccess = true; if (info.progressWindow != null) { info.progressWindow.close(); info.progressWindow = null; } if (isMail == true) ShowMailComplete( true); else ShowAddressComplete( true); } } else { dump( "*** ERROR: info.importInterface is null\n"); } if (clear == true) { info.intervalState = null; info.importInterface = null; }}
case "attachmentCol": sortKey = nsMsgViewSortType.byAttachments; break;
function ConvertColumnIDToSortType(columnID){ var sortKey; switch (columnID) { case "dateCol": sortKey = nsMsgViewSortType.byDate; break; case "senderCol": sortKey = nsMsgViewSortType.byAuthor; break; case "recipientCol": sortKey = nsMsgViewSortType.byRecipient; break; case "subjectCol": sortKey = nsMsgViewSortType.bySubject; break; case "locationCol": sortKey = nsMsgViewSortType.byLocation; break; case "accountCol": sortKey = nsMsgViewSortType.byAccount; break; case "unreadButtonColHeader": sortKey = nsMsgViewSortType.byUnread; break; case "statusCol": sortKey = nsMsgViewSortType.byStatus; break; case "sizeCol": sortKey = nsMsgViewSortType.bySize; break; case "priorityCol": sortKey = nsMsgViewSortType.byPriority; break; case "flaggedCol": sortKey = nsMsgViewSortType.byFlagged; break; case "threadCol": sortKey = nsMsgViewSortType.byThread; break; case "labelCol": sortKey = nsMsgViewSortType.byLabel; break; case "junkStatusCol": sortKey = nsMsgViewSortType.byJunkStatus; break; case "idCol": sortKey = nsMsgViewSortType.byId; break; default: dump("unsupported sort column: " + columnID + "\n"); sortKey = 0; break; } return sortKey;}
var result = Components.classes["component:
var result = Components.classes["@mozilla.org/supports-array;1"].createInstance(Components.interfaces.nsISupportsArray);
function ConvertDOMListToResourceArray(nodeList){ var result = Components.classes["component://netscape/supports-array"].createInstance(Components.interfaces.nsISupportsArray); for (var i=0; i<nodeList.length; i++) { result.AppendElement(nodeList[i].resource); } return result;}
language = gLangBundle.getString(language);
language = gLangBundle.getString(language.toLowerCase());
function convertLanguageCode(abbr){ if (!abbr) return ""; var result; var region = ""; var tokens = abbr.split("-"); var language = tokens.shift(); if (language == "x" || language == "i") { // x and i prefixes mean unofficial ones. So we proper-case the next // word and leave the rest. if (tokens.length > 0) { // Upper-case first letter language = tokens[0].substr(0, 1).toUpperCase() + tokens[0].substr(1); tokens.shift(); // Add on the rest as space-separated strings inside the brackets region = tokens.join(" "); } } else { // Otherwise we treat the first as a lang, the second as a region // and the rest as strings. try { language = gLangBundle.getString(language); } catch (e) { } if (tokens.length > 0) { try { tokens[0] = gRegionBundle.getString(tokens[0].toLowerCase()); } catch (e) { } region = tokens.join(" "); } } if (region) { result = gMetadataBundle.getFormattedString("languageRegionFormat", [language, region]); } else { result = language; } return result;}
result = tokens[0].substr(0, 1).toUpperCase() + tokens[0].substr(1);
language = tokens[0].substr(0, 1).toUpperCase() + tokens[0].substr(1);
function convertLanguageCode(abbr){ if (!abbr) return ""; var result; var tokens = abbr.split("-"); if (tokens[0] === "x" || tokens[0] === "i") { // x and i prefixes mean unofficial ones. So we upper-case the first // word and leave the rest. tokens.shift(); if (tokens[0]) { // Upper-case first letter result = tokens[0].substr(0, 1).toUpperCase() + tokens[0].substr(1); tokens.shift(); if (tokens[0]) { // Add on the rest as space-separated strings inside the brackets result += " (" + tokens.join(" ") + ")"; } } } else { // Otherwise we treat the first as a lang, the second as a region // and the rest as strings. try { result = gLangBundle.getString(tokens[0]); } catch (e) { // Language not present in lang bundle result = tokens[0]; } tokens.shift(); if (tokens[0]) { try { // We don't add it on to the result immediately // because we want to get the spacing right. tokens[0] = gRegionBundle.getString(tokens[0].toLowerCase()); } catch (e) { // Region not present in region bundle } result += " (" + tokens.join(" ") + ")"; } } return result;}
result += " (" + tokens.join(" ") + ")";
region = tokens.join(" "); is_region_set = true;
function convertLanguageCode(abbr){ if (!abbr) return ""; var result; var tokens = abbr.split("-"); if (tokens[0] === "x" || tokens[0] === "i") { // x and i prefixes mean unofficial ones. So we upper-case the first // word and leave the rest. tokens.shift(); if (tokens[0]) { // Upper-case first letter result = tokens[0].substr(0, 1).toUpperCase() + tokens[0].substr(1); tokens.shift(); if (tokens[0]) { // Add on the rest as space-separated strings inside the brackets result += " (" + tokens.join(" ") + ")"; } } } else { // Otherwise we treat the first as a lang, the second as a region // and the rest as strings. try { result = gLangBundle.getString(tokens[0]); } catch (e) { // Language not present in lang bundle result = tokens[0]; } tokens.shift(); if (tokens[0]) { try { // We don't add it on to the result immediately // because we want to get the spacing right. tokens[0] = gRegionBundle.getString(tokens[0].toLowerCase()); } catch (e) { // Region not present in region bundle } result += " (" + tokens.join(" ") + ")"; } } return result;}
result = gLangBundle.getString(tokens[0]);
language = gLangBundle.getString(tokens[0]);
function convertLanguageCode(abbr){ if (!abbr) return ""; var result; var tokens = abbr.split("-"); if (tokens[0] === "x" || tokens[0] === "i") { // x and i prefixes mean unofficial ones. So we upper-case the first // word and leave the rest. tokens.shift(); if (tokens[0]) { // Upper-case first letter result = tokens[0].substr(0, 1).toUpperCase() + tokens[0].substr(1); tokens.shift(); if (tokens[0]) { // Add on the rest as space-separated strings inside the brackets result += " (" + tokens.join(" ") + ")"; } } } else { // Otherwise we treat the first as a lang, the second as a region // and the rest as strings. try { result = gLangBundle.getString(tokens[0]); } catch (e) { // Language not present in lang bundle result = tokens[0]; } tokens.shift(); if (tokens[0]) { try { // We don't add it on to the result immediately // because we want to get the spacing right. tokens[0] = gRegionBundle.getString(tokens[0].toLowerCase()); } catch (e) { // Region not present in region bundle } result += " (" + tokens.join(" ") + ")"; } } return result;}
result = tokens[0];
language = tokens[0];
function convertLanguageCode(abbr){ if (!abbr) return ""; var result; var tokens = abbr.split("-"); if (tokens[0] === "x" || tokens[0] === "i") { // x and i prefixes mean unofficial ones. So we upper-case the first // word and leave the rest. tokens.shift(); if (tokens[0]) { // Upper-case first letter result = tokens[0].substr(0, 1).toUpperCase() + tokens[0].substr(1); tokens.shift(); if (tokens[0]) { // Add on the rest as space-separated strings inside the brackets result += " (" + tokens.join(" ") + ")"; } } } else { // Otherwise we treat the first as a lang, the second as a region // and the rest as strings. try { result = gLangBundle.getString(tokens[0]); } catch (e) { // Language not present in lang bundle result = tokens[0]; } tokens.shift(); if (tokens[0]) { try { // We don't add it on to the result immediately // because we want to get the spacing right. tokens[0] = gRegionBundle.getString(tokens[0].toLowerCase()); } catch (e) { // Region not present in region bundle } result += " (" + tokens.join(" ") + ")"; } } return result;}
tokens[0] = gRegionBundle.getString(tokens[0].toLowerCase());
region = gRegionBundle.getString(tokens[0].toLowerCase()); tokens.shift(); if (tokens[0]) { region += " " + tokens.join(" "); }
function convertLanguageCode(abbr){ if (!abbr) return ""; var result; var tokens = abbr.split("-"); if (tokens[0] === "x" || tokens[0] === "i") { // x and i prefixes mean unofficial ones. So we upper-case the first // word and leave the rest. tokens.shift(); if (tokens[0]) { // Upper-case first letter result = tokens[0].substr(0, 1).toUpperCase() + tokens[0].substr(1); tokens.shift(); if (tokens[0]) { // Add on the rest as space-separated strings inside the brackets result += " (" + tokens.join(" ") + ")"; } } } else { // Otherwise we treat the first as a lang, the second as a region // and the rest as strings. try { result = gLangBundle.getString(tokens[0]); } catch (e) { // Language not present in lang bundle result = tokens[0]; } tokens.shift(); if (tokens[0]) { try { // We don't add it on to the result immediately // because we want to get the spacing right. tokens[0] = gRegionBundle.getString(tokens[0].toLowerCase()); } catch (e) { // Region not present in region bundle } result += " (" + tokens.join(" ") + ")"; } } return result;}
result += " (" + tokens.join(" ") + ")";
is_region_set = true;
function convertLanguageCode(abbr){ if (!abbr) return ""; var result; var tokens = abbr.split("-"); if (tokens[0] === "x" || tokens[0] === "i") { // x and i prefixes mean unofficial ones. So we upper-case the first // word and leave the rest. tokens.shift(); if (tokens[0]) { // Upper-case first letter result = tokens[0].substr(0, 1).toUpperCase() + tokens[0].substr(1); tokens.shift(); if (tokens[0]) { // Add on the rest as space-separated strings inside the brackets result += " (" + tokens.join(" ") + ")"; } } } else { // Otherwise we treat the first as a lang, the second as a region // and the rest as strings. try { result = gLangBundle.getString(tokens[0]); } catch (e) { // Language not present in lang bundle result = tokens[0]; } tokens.shift(); if (tokens[0]) { try { // We don't add it on to the result immediately // because we want to get the spacing right. tokens[0] = gRegionBundle.getString(tokens[0].toLowerCase()); } catch (e) { // Region not present in region bundle } result += " (" + tokens.join(" ") + ")"; } } return result;}
if (is_region_set) { result = gMetadataBundle.getFormattedString("languageRegionFormat", [language, region]); } else { result = language; }
function convertLanguageCode(abbr){ if (!abbr) return ""; var result; var tokens = abbr.split("-"); if (tokens[0] === "x" || tokens[0] === "i") { // x and i prefixes mean unofficial ones. So we upper-case the first // word and leave the rest. tokens.shift(); if (tokens[0]) { // Upper-case first letter result = tokens[0].substr(0, 1).toUpperCase() + tokens[0].substr(1); tokens.shift(); if (tokens[0]) { // Add on the rest as space-separated strings inside the brackets result += " (" + tokens.join(" ") + ")"; } } } else { // Otherwise we treat the first as a lang, the second as a region // and the rest as strings. try { result = gLangBundle.getString(tokens[0]); } catch (e) { // Language not present in lang bundle result = tokens[0]; } tokens.shift(); if (tokens[0]) { try { // We don't add it on to the result immediately // because we want to get the spacing right. tokens[0] = gRegionBundle.getString(tokens[0].toLowerCase()); } catch (e) { // Region not present in region bundle } result += " (" + tokens.join(" ") + ")"; } } return result;}
resourceArray = Components.classes["component:
resourceArray = Components.classes["@mozilla.org/supports-array;1"].createInstance(Components.interfaces.nsISupportsArray);
function ConvertMessagesToResourceArray(messages, resourceArray){ if(!resourceArray) resourceArray = Components.classes["component://netscape/supports-array"].createInstance(Components.interfaces.nsISupportsArray); for (var i=0; i<messages.length; i++) { var messageResource = messages[i].QueryInterface(Components.interfaces.nsIRDFResource); resourceArray.AppendElement(messageResource); } return resourceArray;}
case nsMsgViewSortType.byAttachments: columnID = "attachmentCol"; break;
function ConvertSortTypeToColumnID(sortKey){ var columnID; // hack to turn this into an integer, if it was a string // it would be a string if it came from localStore.rdf sortKey = sortKey - 0; switch (sortKey) { case nsMsgViewSortType.byDate: columnID = "dateCol"; break; case nsMsgViewSortType.byAuthor: columnID = "senderCol"; break; case nsMsgViewSortType.byRecipient: columnID = "recipientCol"; break; case nsMsgViewSortType.bySubject: columnID = "subjectCol"; break; case nsMsgViewSortType.byLocation: columnID = "locationCol"; break; case nsMsgViewSortType.byAccount: columnID = "accountCol"; break; case nsMsgViewSortType.byUnread: columnID = "unreadButtonColHeader"; break; case nsMsgViewSortType.byStatus: columnID = "statusCol"; break; case nsMsgViewSortType.byLabel: columnID = "labelCol"; break; case nsMsgViewSortType.bySize: columnID = "sizeCol"; break; case nsMsgViewSortType.byPriority: columnID = "priorityCol"; break; case nsMsgViewSortType.byFlagged: columnID = "flaggedCol"; break; case nsMsgViewSortType.byThread: columnID = "threadCol"; break; case nsMsgViewSortType.byId: columnID = "idCol"; break; case nsMsgViewSortType.byJunkStatus: columnID = "junkStatusCol"; break; default: dump("unsupported sort key: " + sortKey + "\n"); columnID = null; break; } return columnID;}
this.number = (arguments.length) ? number : null; this.name = (arguments.length) ? name : null; this.value = (arguments.length) ? value : null; this.domaintype = (arguments.length) ? domaintype : null; this.domain = (arguments.length) ? domain : null; this.path = (arguments.length) ? path : null; this.secure = (arguments.length) ? secure : null; this.expire = (arguments.length) ? expire : null;
this.number = ( number ) ? number : null; this.name = ( name ) ? name : null; this.value = ( value ) ? value : null; this.domaintype = ( domaintype ) ? domaintype : null; this.domain = ( domain ) ? domain : null; this.path = ( path ) ? path : null; this.secure = ( secure ) ? secure : null; this.expire = ( expire ) ? expire : null;
function Cookie(number,name,value,domaintype,domain,path,secure,expire){ this.number = (arguments.length) ? number : null; this.name = (arguments.length) ? name : null; this.value = (arguments.length) ? value : null; this.domaintype = (arguments.length) ? domaintype : null; this.domain = (arguments.length) ? domain : null; this.path = (arguments.length) ? path : null; this.secure = (arguments.length) ? secure : null; this.expire = (arguments.length) ? expire : null;}
var nodes = this._activeView.getCopyableSelection();
var nodes = this._view.getCopyableSelection();
copy: function() { var nodes = this._activeView.getCopyableSelection(); var xferable = Cc["@mozilla.org/widget/transferable;1"]. createInstance(Ci.nsITransferable); var foundFolder = false, foundLink = false; var pcString = psString = placeString = mozURLString = htmlString = unicodeString = ""; for (var i = 0; i < nodes.length; ++i) { var node = nodes[i]; var self = this; function generateChunk(type) { var suffix = i < (nodes.length - 1) ? NEWLINE : ""; return self.wrapNode(node, type) + suffix; } if (this.nodeIsFolder(node) || this.nodeIsQuery(node)) { pcString += generateChunk(TYPE_X_MOZ_PLACE_CONTAINER); } else if (this.nodeIsSeparator(node)) { psString += generateChunk(TYPE_X_MOZ_PLACE_SEPARATOR); } else { placeString += generateChunk(TYPE_X_MOZ_PLACE); mozURLString += generateChunk(TYPE_X_MOZ_URL); htmlString += generateChunk(TYPE_HTML); unicodeString += generateChunk(TYPE_UNICODE); } } var self = this; function addData(type, data) { xferable.addDataFlavor(type); xferable.setTransferData(type, self._wrapString(data), data.length * 2); } // This order is _important_! It controls how this and other applications // select data to be inserted based on type. if (pcString) addData(TYPE_X_MOZ_PLACE_CONTAINER, pcString); if (psString) addData(TYPE_X_MOZ_PLACE_SEPARATOR, psString); if (placeString) addData(TYPE_X_MOZ_PLACE, placeString); if (mozURLString) addData(TYPE_X_MOZ_URL, mozURLString); if (unicodeString) addData(TYPE_UNICODE, unicodeString); if (htmlString) addData(TYPE_HTML, htmlString); if (pcString || psString || placeString || unicodeString || htmlString || mozURLString) { var clipboard = Cc["@mozilla.org/widget/clipboard;1"].getService(Ci.nsIClipboard); clipboard.setData(xferable, null, Ci.nsIClipboard.kGlobalClipboard); } },
var self = this;
copy: function() { var nodes = this._activeView.getCopyableSelection(); var xferable = Cc["@mozilla.org/widget/transferable;1"]. createInstance(Ci.nsITransferable); var foundFolder = false, foundLink = false; var pcString = psString = placeString = mozURLString = htmlString = unicodeString = ""; for (var i = 0; i < nodes.length; ++i) { var node = nodes[i]; var self = this; function generateChunk(type) { var suffix = i < (nodes.length - 1) ? NEWLINE : ""; return self.wrapNode(node, type) + suffix; } if (this.nodeIsFolder(node) || this.nodeIsQuery(node)) { pcString += generateChunk(TYPE_X_MOZ_PLACE_CONTAINER); } else if (this.nodeIsSeparator(node)) { psString += generateChunk(TYPE_X_MOZ_PLACE_SEPARATOR); } else { placeString += generateChunk(TYPE_X_MOZ_PLACE); mozURLString += generateChunk(TYPE_X_MOZ_URL); htmlString += generateChunk(TYPE_HTML); unicodeString += generateChunk(TYPE_UNICODE); } } var self = this; function addData(type, data) { xferable.addDataFlavor(type); xferable.setTransferData(type, self._wrapString(data), data.length * 2); } // This order is _important_! It controls how this and other applications // select data to be inserted based on type. if (pcString) addData(TYPE_X_MOZ_PLACE_CONTAINER, pcString); if (psString) addData(TYPE_X_MOZ_PLACE_SEPARATOR, psString); if (placeString) addData(TYPE_X_MOZ_PLACE, placeString); if (mozURLString) addData(TYPE_X_MOZ_URL, mozURLString); if (unicodeString) addData(TYPE_UNICODE, unicodeString); if (htmlString) addData(TYPE_HTML, htmlString); if (pcString || psString || placeString || unicodeString || htmlString || mozURLString) { var clipboard = Cc["@mozilla.org/widget/clipboard;1"].getService(Ci.nsIClipboard); clipboard.setData(xferable, null, Ci.nsIClipboard.kGlobalClipboard); } },
return self.wrapNode(node, type) + suffix;
return PlacesUtils.wrapNode(node, type) + suffix;
copy: function() { var nodes = this._activeView.getCopyableSelection(); var xferable = Cc["@mozilla.org/widget/transferable;1"]. createInstance(Ci.nsITransferable); var foundFolder = false, foundLink = false; var pcString = psString = placeString = mozURLString = htmlString = unicodeString = ""; for (var i = 0; i < nodes.length; ++i) { var node = nodes[i]; var self = this; function generateChunk(type) { var suffix = i < (nodes.length - 1) ? NEWLINE : ""; return self.wrapNode(node, type) + suffix; } if (this.nodeIsFolder(node) || this.nodeIsQuery(node)) { pcString += generateChunk(TYPE_X_MOZ_PLACE_CONTAINER); } else if (this.nodeIsSeparator(node)) { psString += generateChunk(TYPE_X_MOZ_PLACE_SEPARATOR); } else { placeString += generateChunk(TYPE_X_MOZ_PLACE); mozURLString += generateChunk(TYPE_X_MOZ_URL); htmlString += generateChunk(TYPE_HTML); unicodeString += generateChunk(TYPE_UNICODE); } } var self = this; function addData(type, data) { xferable.addDataFlavor(type); xferable.setTransferData(type, self._wrapString(data), data.length * 2); } // This order is _important_! It controls how this and other applications // select data to be inserted based on type. if (pcString) addData(TYPE_X_MOZ_PLACE_CONTAINER, pcString); if (psString) addData(TYPE_X_MOZ_PLACE_SEPARATOR, psString); if (placeString) addData(TYPE_X_MOZ_PLACE, placeString); if (mozURLString) addData(TYPE_X_MOZ_URL, mozURLString); if (unicodeString) addData(TYPE_UNICODE, unicodeString); if (htmlString) addData(TYPE_HTML, htmlString); if (pcString || psString || placeString || unicodeString || htmlString || mozURLString) { var clipboard = Cc["@mozilla.org/widget/clipboard;1"].getService(Ci.nsIClipboard); clipboard.setData(xferable, null, Ci.nsIClipboard.kGlobalClipboard); } },
if (this.nodeIsFolder(node) || this.nodeIsQuery(node)) {
if (PlacesUtils.nodeIsFolder(node) || PlacesUtils.nodeIsQuery(node)) {
copy: function() { var nodes = this._activeView.getCopyableSelection(); var xferable = Cc["@mozilla.org/widget/transferable;1"]. createInstance(Ci.nsITransferable); var foundFolder = false, foundLink = false; var pcString = psString = placeString = mozURLString = htmlString = unicodeString = ""; for (var i = 0; i < nodes.length; ++i) { var node = nodes[i]; var self = this; function generateChunk(type) { var suffix = i < (nodes.length - 1) ? NEWLINE : ""; return self.wrapNode(node, type) + suffix; } if (this.nodeIsFolder(node) || this.nodeIsQuery(node)) { pcString += generateChunk(TYPE_X_MOZ_PLACE_CONTAINER); } else if (this.nodeIsSeparator(node)) { psString += generateChunk(TYPE_X_MOZ_PLACE_SEPARATOR); } else { placeString += generateChunk(TYPE_X_MOZ_PLACE); mozURLString += generateChunk(TYPE_X_MOZ_URL); htmlString += generateChunk(TYPE_HTML); unicodeString += generateChunk(TYPE_UNICODE); } } var self = this; function addData(type, data) { xferable.addDataFlavor(type); xferable.setTransferData(type, self._wrapString(data), data.length * 2); } // This order is _important_! It controls how this and other applications // select data to be inserted based on type. if (pcString) addData(TYPE_X_MOZ_PLACE_CONTAINER, pcString); if (psString) addData(TYPE_X_MOZ_PLACE_SEPARATOR, psString); if (placeString) addData(TYPE_X_MOZ_PLACE, placeString); if (mozURLString) addData(TYPE_X_MOZ_URL, mozURLString); if (unicodeString) addData(TYPE_UNICODE, unicodeString); if (htmlString) addData(TYPE_HTML, htmlString); if (pcString || psString || placeString || unicodeString || htmlString || mozURLString) { var clipboard = Cc["@mozilla.org/widget/clipboard;1"].getService(Ci.nsIClipboard); clipboard.setData(xferable, null, Ci.nsIClipboard.kGlobalClipboard); } },
else if (this.nodeIsSeparator(node)) {
else if (PlacesUtils.nodeIsSeparator(node)) {
copy: function() { var nodes = this._activeView.getCopyableSelection(); var xferable = Cc["@mozilla.org/widget/transferable;1"]. createInstance(Ci.nsITransferable); var foundFolder = false, foundLink = false; var pcString = psString = placeString = mozURLString = htmlString = unicodeString = ""; for (var i = 0; i < nodes.length; ++i) { var node = nodes[i]; var self = this; function generateChunk(type) { var suffix = i < (nodes.length - 1) ? NEWLINE : ""; return self.wrapNode(node, type) + suffix; } if (this.nodeIsFolder(node) || this.nodeIsQuery(node)) { pcString += generateChunk(TYPE_X_MOZ_PLACE_CONTAINER); } else if (this.nodeIsSeparator(node)) { psString += generateChunk(TYPE_X_MOZ_PLACE_SEPARATOR); } else { placeString += generateChunk(TYPE_X_MOZ_PLACE); mozURLString += generateChunk(TYPE_X_MOZ_URL); htmlString += generateChunk(TYPE_HTML); unicodeString += generateChunk(TYPE_UNICODE); } } var self = this; function addData(type, data) { xferable.addDataFlavor(type); xferable.setTransferData(type, self._wrapString(data), data.length * 2); } // This order is _important_! It controls how this and other applications // select data to be inserted based on type. if (pcString) addData(TYPE_X_MOZ_PLACE_CONTAINER, pcString); if (psString) addData(TYPE_X_MOZ_PLACE_SEPARATOR, psString); if (placeString) addData(TYPE_X_MOZ_PLACE, placeString); if (mozURLString) addData(TYPE_X_MOZ_URL, mozURLString); if (unicodeString) addData(TYPE_UNICODE, unicodeString); if (htmlString) addData(TYPE_HTML, htmlString); if (pcString || psString || placeString || unicodeString || htmlString || mozURLString) { var clipboard = Cc["@mozilla.org/widget/clipboard;1"].getService(Ci.nsIClipboard); clipboard.setData(xferable, null, Ci.nsIClipboard.kGlobalClipboard); } },
xferable.setTransferData(type, self._wrapString(data), data.length * 2);
xferable.setTransferData(type, PlacesUtils._wrapString(data), data.length * 2);
copy: function() { var nodes = this._activeView.getCopyableSelection(); var xferable = Cc["@mozilla.org/widget/transferable;1"]. createInstance(Ci.nsITransferable); var foundFolder = false, foundLink = false; var pcString = psString = placeString = mozURLString = htmlString = unicodeString = ""; for (var i = 0; i < nodes.length; ++i) { var node = nodes[i]; var self = this; function generateChunk(type) { var suffix = i < (nodes.length - 1) ? NEWLINE : ""; return self.wrapNode(node, type) + suffix; } if (this.nodeIsFolder(node) || this.nodeIsQuery(node)) { pcString += generateChunk(TYPE_X_MOZ_PLACE_CONTAINER); } else if (this.nodeIsSeparator(node)) { psString += generateChunk(TYPE_X_MOZ_PLACE_SEPARATOR); } else { placeString += generateChunk(TYPE_X_MOZ_PLACE); mozURLString += generateChunk(TYPE_X_MOZ_URL); htmlString += generateChunk(TYPE_HTML); unicodeString += generateChunk(TYPE_UNICODE); } } var self = this; function addData(type, data) { xferable.addDataFlavor(type); xferable.setTransferData(type, self._wrapString(data), data.length * 2); } // This order is _important_! It controls how this and other applications // select data to be inserted based on type. if (pcString) addData(TYPE_X_MOZ_PLACE_CONTAINER, pcString); if (psString) addData(TYPE_X_MOZ_PLACE_SEPARATOR, psString); if (placeString) addData(TYPE_X_MOZ_PLACE, placeString); if (mozURLString) addData(TYPE_X_MOZ_URL, mozURLString); if (unicodeString) addData(TYPE_UNICODE, unicodeString); if (htmlString) addData(TYPE_HTML, htmlString); if (pcString || psString || placeString || unicodeString || htmlString || mozURLString) { var clipboard = Cc["@mozilla.org/widget/clipboard;1"].getService(Ci.nsIClipboard); clipboard.setData(xferable, null, Ci.nsIClipboard.kGlobalClipboard); } },
if (mozURLString) addData(TYPE_X_MOZ_URL, mozURLString);
copy: function() { var nodes = this._activeView.getCopyableSelection(); var xferable = Cc["@mozilla.org/widget/transferable;1"]. createInstance(Ci.nsITransferable); var foundFolder = false, foundLink = false; var pcString = psString = placeString = mozURLString = htmlString = unicodeString = ""; for (var i = 0; i < nodes.length; ++i) { var node = nodes[i]; var self = this; function generateChunk(type) { var suffix = i < (nodes.length - 1) ? NEWLINE : ""; return self.wrapNode(node, type) + suffix; } if (this.nodeIsFolder(node) || this.nodeIsQuery(node)) { pcString += generateChunk(TYPE_X_MOZ_PLACE_CONTAINER); } else if (this.nodeIsSeparator(node)) { psString += generateChunk(TYPE_X_MOZ_PLACE_SEPARATOR); } else { placeString += generateChunk(TYPE_X_MOZ_PLACE); mozURLString += generateChunk(TYPE_X_MOZ_URL); htmlString += generateChunk(TYPE_HTML); unicodeString += generateChunk(TYPE_UNICODE); } } var self = this; function addData(type, data) { xferable.addDataFlavor(type); xferable.setTransferData(type, self._wrapString(data), data.length * 2); } // This order is _important_! It controls how this and other applications // select data to be inserted based on type. if (pcString) addData(TYPE_X_MOZ_PLACE_CONTAINER, pcString); if (psString) addData(TYPE_X_MOZ_PLACE_SEPARATOR, psString); if (placeString) addData(TYPE_X_MOZ_PLACE, placeString); if (unicodeString) addData(TYPE_UNICODE, unicodeString); if (htmlString) addData(TYPE_HTML, htmlString); if (mozURLString) addData(TYPE_X_MOZ_URL, mozURLString); if (pcString || psString || placeString || unicodeString || htmlString || mozURLString) { var clipboard = Cc["@mozilla.org/widget/clipboard;1"].getService(Ci.nsIClipboard); clipboard.setData(xferable, null, Ci.nsIClipboard.kGlobalClipboard); } },
if ( qmark > 7 ) { addresses = url.substring( 7, qmark ); } else { addresses = url.substr( 7 ); }
if ( qmark > mailtolength ) addresses = url.substring( mailtolength, qmark ); else addresses = url.substr( mailtolength );
copyEmail : function () { // Copy the comma-separated list of email addresses only. // There are other ways of embedding email addresses in a mailto: // link, but such complex parsing is beyond us. var url = this.linkURL(); var qmark = url.indexOf( "?" ); var addresses; if ( qmark > 7 ) { // 7 == length of "mailto:" addresses = url.substring( 7, qmark ); } else { addresses = url.substr( 7 ); } var clipboard = this.getService( "@mozilla.org/widget/clipboardhelper;1", Components.interfaces.nsIClipboardHelper ); clipboard.copyString(addresses); },
var url = this.linkURL(); var qmark = url.indexOf( "?" ); var addresses; if ( qmark > 7 ) { addresses = url.substring( 7, qmark ); } else { addresses = url.substr( 7 ); } try { var characterSet = this.target.ownerDocument.characterSet; const textToSubURI = Components.classes["@mozilla.org/intl/texttosuburi;1"] .getService(Components.interfaces.nsITextToSubURI); addresses = textToSubURI.unEscapeURIForUI(characterSet, addresses); } catch(ex) { }
copyEmail : function () { // Copy the comma-separated list of email addresses only. // There are other ways of embedding email addresses in a mailto: // link, but such complex parsing is beyond us. var url = this.linkURL(); var qmark = url.indexOf( "?" ); var addresses; if ( qmark > 7 ) { // 7 == length of "mailto:" addresses = url.substring( 7, qmark ); } else { addresses = url.substr( 7 ); } // Let's try to unescape it using a character set try { var characterSet = this.target.ownerDocument.characterSet; const textToSubURI = Components.classes["@mozilla.org/intl/texttosuburi;1"] .getService(Components.interfaces.nsITextToSubURI); addresses = textToSubURI.unEscapeURIForUI(characterSet, addresses); } catch(ex) { // Do nothing. } var clipboard = this.getService( "@mozilla.org/widget/clipboardhelper;1", Components.interfaces.nsIClipboardHelper ); clipboard.copyString(addresses); },
clipboard.copyString(addresses);
clipboard.copyString(this.getEmail());
copyEmail : function () { // Copy the comma-separated list of email addresses only. // There are other ways of embedding email addresses in a mailto: // link, but such complex parsing is beyond us. var url = this.linkURL(); var qmark = url.indexOf( "?" ); var addresses; if ( qmark > 7 ) { // 7 == length of "mailto:" addresses = url.substring( 7, qmark ); } else { addresses = url.substr( 7 ); } // Let's try to unescape it using a character set try { var characterSet = this.target.ownerDocument.characterSet; const textToSubURI = Components.classes["@mozilla.org/intl/texttosuburi;1"] .getService(Components.interfaces.nsITextToSubURI); addresses = textToSubURI.unEscapeURIForUI(characterSet, addresses); } catch(ex) { // Do nothing. } var clipboard = this.getService( "@mozilla.org/widget/clipboardhelper;1", Components.interfaces.nsIClipboardHelper ); clipboard.copyString(addresses); },
var characterSet = Components.lookupMethod(this.target.ownerDocument, "characterSet") .call(this.target.ownerDocument);
var characterSet = this.target.ownerDocument.characterSet;
copyEmail : function () { // Copy the comma-separated list of email addresses only. // There are other ways of embedding email addresses in a mailto: // link, but such complex parsing is beyond us. var url = this.linkURL(); var qmark = url.indexOf( "?" ); var addresses; if ( qmark > 7 ) { // 7 == length of "mailto:" addresses = url.substring( 7, qmark ); } else { addresses = url.substr( 7 ); } // Let's try to unescape it using a character set // in case the address is not ASCII. try { var characterSet = Components.lookupMethod(this.target.ownerDocument, "characterSet") .call(this.target.ownerDocument); const textToSubURI = Components.classes["@mozilla.org/intl/texttosuburi;1"] .getService(Components.interfaces.nsITextToSubURI); addresses = textToSubURI.unEscapeURIForUI(characterSet, addresses); } catch(ex) { // Do nothing. } var clipboard = this.getService( "@mozilla.org/widget/clipboardhelper;1", Components.interfaces.nsIClipboardHelper ); clipboard.copyString(addresses); },
if (emailAddress) { var iid = Components.interfaces[ "nsIClipboard" ]; var clipboard = Components.classes[ "@mozilla.org/widget/clipboard;1" ].getService( iid );
function CopyEmailAddress(emailAddressNode){ if (emailAddressNode) { var emailAddress = emailAddressNode.getAttribute("emailAddress"); if (emailAddress) { // This code stolen from nsContextMenu.js. // Get clipboard. var iid = Components.interfaces[ "nsIClipboard" ]; var clipboard = Components.classes[ "@mozilla.org/widget/clipboard;1" ].getService( iid ); // Create tranferable that will transfer the text. iid = Components.interfaces[ "nsITransferable" ]; var transferable = Components.classes[ "@mozilla.org/widget/transferable;1" ].createInstance( iid ); if ( clipboard && transferable ) { transferable.addDataFlavor( "text/unicode" ); // Create wrapper for text. iid = Components.interfaces[ "nsISupportsWString" ]; var data = Components.classes[ "@mozilla.org/supports-wstring;1" ].createInstance( iid ); if ( data ) { data.data = emailAddress; transferable.setTransferData( "text/unicode", data, emailAddress.length * 2 ); // Put on clipboard. clipboard.setData( transferable, null, Components.interfaces.nsIClipboard.kGlobalClipboard ); } } } }}
iid = Components.interfaces[ "nsITransferable" ]; var transferable = Components.classes[ "@mozilla.org/widget/transferable;1" ].createInstance( iid ); if ( clipboard && transferable ) { transferable.addDataFlavor( "text/unicode" ); iid = Components.interfaces[ "nsISupportsWString" ]; var data = Components.classes[ "@mozilla.org/supports-wstring;1" ].createInstance( iid ); if ( data ) { data.data = emailAddress; transferable.setTransferData( "text/unicode", data, emailAddress.length * 2 ); clipboard.setData( transferable, null, Components.interfaces.nsIClipboard.kGlobalClipboard ); } } }
var contractid = "@mozilla.org/widget/clipboardhelper;1"; var iid = Components.interfaces.nsIClipboardHelper; var clipboard = Components.classes[contractid].getService(iid); clipboard.copyString(emailAddress);
function CopyEmailAddress(emailAddressNode){ if (emailAddressNode) { var emailAddress = emailAddressNode.getAttribute("emailAddress"); if (emailAddress) { // This code stolen from nsContextMenu.js. // Get clipboard. var iid = Components.interfaces[ "nsIClipboard" ]; var clipboard = Components.classes[ "@mozilla.org/widget/clipboard;1" ].getService( iid ); // Create tranferable that will transfer the text. iid = Components.interfaces[ "nsITransferable" ]; var transferable = Components.classes[ "@mozilla.org/widget/transferable;1" ].createInstance( iid ); if ( clipboard && transferable ) { transferable.addDataFlavor( "text/unicode" ); // Create wrapper for text. iid = Components.interfaces[ "nsISupportsWString" ]; var data = Components.classes[ "@mozilla.org/supports-wstring;1" ].createInstance( iid ); if ( data ) { data.data = emailAddress; transferable.setTransferData( "text/unicode", data, emailAddress.length * 2 ); // Put on clipboard. clipboard.setData( transferable, null, Components.interfaces.nsIClipboard.kGlobalClipboard ); } } } }}
}
function CopyFolderUrl(){ try { var folderResource = GetSelectedFolderResource(); if (folderResource) CopyString(msgFolder.folderURL); } catch (ex) { dump("ex="+ex+"\n"); }}
var folderArray = Components.classes["component:
var folderArray = Components.classes["@mozilla.org/supports-array;1"].createInstance(Components.interfaces.nsISupportsArray);
function CopyMessages(compositeDataSource, srcFolder, destFolder, messages, isMove){ if(compositeDataSource) { var destFolderResource = destFolder.QueryInterface(Components.interfaces.nsIRDFResource); var folderArray = Components.classes["component://netscape/supports-array"].createInstance(Components.interfaces.nsISupportsArray); folderArray.AppendElement(destFolderResource); var argumentArray = Components.classes["component://netscape/supports-array"].createInstance(Components.interfaces.nsISupportsArray); var srcFolderResource = srcFolder.QueryInterface(Components.interfaces.nsIRDFResource); argumentArray.AppendElement(srcFolderResource); ConvertMessagesToResourceArray(messages, argumentArray); var command; if(isMove) command = "http://home.netscape.com/NC-rdf#Move" else command = "http://home.netscape.com/NC-rdf#Copy"; DoRDFCommand(compositeDataSource, command, folderArray, argumentArray); }}
var argumentArray = Components.classes["component:
var argumentArray = Components.classes["@mozilla.org/supports-array;1"].createInstance(Components.interfaces.nsISupportsArray);
function CopyMessages(compositeDataSource, srcFolder, destFolder, messages, isMove){ if(compositeDataSource) { var destFolderResource = destFolder.QueryInterface(Components.interfaces.nsIRDFResource); var folderArray = Components.classes["component://netscape/supports-array"].createInstance(Components.interfaces.nsISupportsArray); folderArray.AppendElement(destFolderResource); var argumentArray = Components.classes["component://netscape/supports-array"].createInstance(Components.interfaces.nsISupportsArray); var srcFolderResource = srcFolder.QueryInterface(Components.interfaces.nsIRDFResource); argumentArray.AppendElement(srcFolderResource); ConvertMessagesToResourceArray(messages, argumentArray); var command; if(isMove) command = "http://home.netscape.com/NC-rdf#Move" else command = "http://home.netscape.com/NC-rdf#Copy"; DoRDFCommand(compositeDataSource, command, folderArray, argumentArray); }}
this.mClipboardHelper.writeStringToClipboard(text, kGlobalClipboard);
this.mClipboardHelper.copyString(text);
copySearchItemAll: function() { var text = this.getAllSearchItemText(); this.mClipboardHelper.writeStringToClipboard(text, kGlobalClipboard); },
ClipboardUtils.writeString(text);
this.mClipboardHelper.writeStringToClipboard(text, kGlobalClipboard);
copySearchItemAll: function() { var text = this.getAllSearchItemText(); ClipboardUtils.writeString(text); },
ClipboardUtils.writeString(text);
this.mClipboardHelper.writeStringToClipboard(text, kGlobalClipboard);
copySearchItemLine: function() { var mod = this.mSearchService.currentModule; var idx = this.mSearchService.getSelectedIndex(0); var text = mod.getItemText(idx); ClipboardUtils.writeString(text); },
var clipboard = Components .classes["component: .getService ( Components.interfaces.nsIClipboard );
var clipboard = this.getService( "component: "nsIClipboard" );
copyToClipboard : function ( text ) { // Get clipboard. var clipboard = Components .classes["component://netscape/widget/clipboard"] .getService ( Components.interfaces.nsIClipboard ); // Create tranferable that will transfer the text. var transferable = Components .classes["component://netscape/widget/transferable"] .createInstance( Components.interfaces.nsITransferable ); if ( clipboard && transferable ) { transferable.addDataFlavor( "text/unicode" ); // Create wrapper for text. var data = createInstance( "component://netscape/supports-wstring", "nsISupportsWString" ); if ( data ) { data.data = text ; transferable.setTransferData( "text/unicode", data, text.length * 2 ); // Put on clipboard. clipboard.setData( transferable, null ); } } },
var transferable = Components .classes["component: .createInstance( Components.interfaces.nsITransferable );
var transferable = this.createInstance( "component: "nsITransferable" );
copyToClipboard : function ( text ) { // Get clipboard. var clipboard = Components .classes["component://netscape/widget/clipboard"] .getService ( Components.interfaces.nsIClipboard ); // Create tranferable that will transfer the text. var transferable = Components .classes["component://netscape/widget/transferable"] .createInstance( Components.interfaces.nsITransferable ); if ( clipboard && transferable ) { transferable.addDataFlavor( "text/unicode" ); // Create wrapper for text. var data = createInstance( "component://netscape/supports-wstring", "nsISupportsWString" ); if ( data ) { data.data = text ; transferable.setTransferData( "text/unicode", data, text.length * 2 ); // Put on clipboard. clipboard.setData( transferable, null ); } } },
var data = createInstance( "component: "nsISupportsWString" );
var data = this.createInstance( "component: "nsISupportsWString" );
copyToClipboard : function ( text ) { // Get clipboard. var clipboard = Components .classes["component://netscape/widget/clipboard"] .getService ( Components.interfaces.nsIClipboard ); // Create tranferable that will transfer the text. var transferable = Components .classes["component://netscape/widget/transferable"] .createInstance( Components.interfaces.nsITransferable ); if ( clipboard && transferable ) { transferable.addDataFlavor( "text/unicode" ); // Create wrapper for text. var data = createInstance( "component://netscape/supports-wstring", "nsISupportsWString" ); if ( data ) { data.data = text ; transferable.setTransferData( "text/unicode", data, text.length * 2 ); // Put on clipboard. clipboard.setData( transferable, null ); } } },
var clipboard = this.getService( "component:
var clipboard = this.getService( "@mozilla.org/widget/clipboard;1",
copyToClipboard : function ( text ) { // Get clipboard. var clipboard = this.getService( "component://netscape/widget/clipboard", "nsIClipboard" ); // Create tranferable that will transfer the text. var transferable = this.createInstance( "component://netscape/widget/transferable", "nsITransferable" ); if ( clipboard && transferable ) { transferable.addDataFlavor( "text/unicode" ); // Create wrapper for text. var data = this.createInstance( "component://netscape/supports-wstring", "nsISupportsWString" ); if ( data ) { data.data = text; transferable.setTransferData( "text/unicode", data, text.length * 2 ); // Put on clipboard. clipboard.setData( transferable, null, Components.interfaces.nsIClipboard.kGlobalClipboard ); } } // Create a second transferable to copy selection. Unix needs this, // other OS's will probably map to a no-op. var transferableForSelection = this.createInstance( "component://netscape/widget/transferable", "nsITransferable" ); if ( clipboard && transferableForSelection ) { transferableForSelection.addDataFlavor( "text/unicode" ); // Create wrapper for text. var selectionData = this.createInstance( "component://netscape/supports-wstring", "nsISupportsWString" ); if ( selectionData ) { selectionData.data = text; transferableForSelection.setTransferData( "text/unicode", selectionData, text.length * 2 ); // Put on clipboard. clipboard.setData( transferableForSelection, null, Components.interfaces.nsIClipboard.kSelectionClipboard ); } } },
var transferable = this.createInstance( "component:
var transferable = this.createInstance( "@mozilla.org/widget/transferable;1",
copyToClipboard : function ( text ) { // Get clipboard. var clipboard = this.getService( "component://netscape/widget/clipboard", "nsIClipboard" ); // Create tranferable that will transfer the text. var transferable = this.createInstance( "component://netscape/widget/transferable", "nsITransferable" ); if ( clipboard && transferable ) { transferable.addDataFlavor( "text/unicode" ); // Create wrapper for text. var data = this.createInstance( "component://netscape/supports-wstring", "nsISupportsWString" ); if ( data ) { data.data = text; transferable.setTransferData( "text/unicode", data, text.length * 2 ); // Put on clipboard. clipboard.setData( transferable, null, Components.interfaces.nsIClipboard.kGlobalClipboard ); } } // Create a second transferable to copy selection. Unix needs this, // other OS's will probably map to a no-op. var transferableForSelection = this.createInstance( "component://netscape/widget/transferable", "nsITransferable" ); if ( clipboard && transferableForSelection ) { transferableForSelection.addDataFlavor( "text/unicode" ); // Create wrapper for text. var selectionData = this.createInstance( "component://netscape/supports-wstring", "nsISupportsWString" ); if ( selectionData ) { selectionData.data = text; transferableForSelection.setTransferData( "text/unicode", selectionData, text.length * 2 ); // Put on clipboard. clipboard.setData( transferableForSelection, null, Components.interfaces.nsIClipboard.kSelectionClipboard ); } } },
var data = this.createInstance( "component:
var data = this.createInstance( "@mozilla.org/supports-wstring;1",
copyToClipboard : function ( text ) { // Get clipboard. var clipboard = this.getService( "component://netscape/widget/clipboard", "nsIClipboard" ); // Create tranferable that will transfer the text. var transferable = this.createInstance( "component://netscape/widget/transferable", "nsITransferable" ); if ( clipboard && transferable ) { transferable.addDataFlavor( "text/unicode" ); // Create wrapper for text. var data = this.createInstance( "component://netscape/supports-wstring", "nsISupportsWString" ); if ( data ) { data.data = text; transferable.setTransferData( "text/unicode", data, text.length * 2 ); // Put on clipboard. clipboard.setData( transferable, null, Components.interfaces.nsIClipboard.kGlobalClipboard ); } } // Create a second transferable to copy selection. Unix needs this, // other OS's will probably map to a no-op. var transferableForSelection = this.createInstance( "component://netscape/widget/transferable", "nsITransferable" ); if ( clipboard && transferableForSelection ) { transferableForSelection.addDataFlavor( "text/unicode" ); // Create wrapper for text. var selectionData = this.createInstance( "component://netscape/supports-wstring", "nsISupportsWString" ); if ( selectionData ) { selectionData.data = text; transferableForSelection.setTransferData( "text/unicode", selectionData, text.length * 2 ); // Put on clipboard. clipboard.setData( transferableForSelection, null, Components.interfaces.nsIClipboard.kSelectionClipboard ); } } },
var transferableForSelection = this.createInstance( "component:
var transferableForSelection = this.createInstance( "@mozilla.org/widget/transferable;1",
copyToClipboard : function ( text ) { // Get clipboard. var clipboard = this.getService( "component://netscape/widget/clipboard", "nsIClipboard" ); // Create tranferable that will transfer the text. var transferable = this.createInstance( "component://netscape/widget/transferable", "nsITransferable" ); if ( clipboard && transferable ) { transferable.addDataFlavor( "text/unicode" ); // Create wrapper for text. var data = this.createInstance( "component://netscape/supports-wstring", "nsISupportsWString" ); if ( data ) { data.data = text; transferable.setTransferData( "text/unicode", data, text.length * 2 ); // Put on clipboard. clipboard.setData( transferable, null, Components.interfaces.nsIClipboard.kGlobalClipboard ); } } // Create a second transferable to copy selection. Unix needs this, // other OS's will probably map to a no-op. var transferableForSelection = this.createInstance( "component://netscape/widget/transferable", "nsITransferable" ); if ( clipboard && transferableForSelection ) { transferableForSelection.addDataFlavor( "text/unicode" ); // Create wrapper for text. var selectionData = this.createInstance( "component://netscape/supports-wstring", "nsISupportsWString" ); if ( selectionData ) { selectionData.data = text; transferableForSelection.setTransferData( "text/unicode", selectionData, text.length * 2 ); // Put on clipboard. clipboard.setData( transferableForSelection, null, Components.interfaces.nsIClipboard.kSelectionClipboard ); } } },
var selectionData = this.createInstance( "component:
var selectionData = this.createInstance( "@mozilla.org/supports-wstring;1",
copyToClipboard : function ( text ) { // Get clipboard. var clipboard = this.getService( "component://netscape/widget/clipboard", "nsIClipboard" ); // Create tranferable that will transfer the text. var transferable = this.createInstance( "component://netscape/widget/transferable", "nsITransferable" ); if ( clipboard && transferable ) { transferable.addDataFlavor( "text/unicode" ); // Create wrapper for text. var data = this.createInstance( "component://netscape/supports-wstring", "nsISupportsWString" ); if ( data ) { data.data = text; transferable.setTransferData( "text/unicode", data, text.length * 2 ); // Put on clipboard. clipboard.setData( transferable, null, Components.interfaces.nsIClipboard.kGlobalClipboard ); } } // Create a second transferable to copy selection. Unix needs this, // other OS's will probably map to a no-op. var transferableForSelection = this.createInstance( "component://netscape/widget/transferable", "nsITransferable" ); if ( clipboard && transferableForSelection ) { transferableForSelection.addDataFlavor( "text/unicode" ); // Create wrapper for text. var selectionData = this.createInstance( "component://netscape/supports-wstring", "nsISupportsWString" ); if ( selectionData ) { selectionData.data = text; transferableForSelection.setTransferData( "text/unicode", selectionData, text.length * 2 ); // Put on clipboard. clipboard.setData( transferableForSelection, null, Components.interfaces.nsIClipboard.kSelectionClipboard ); } } },
var calendarEventArray = new Array();
var calendarEventArray = new Array( 0 );
function copyToClipboard( calendarEventArray ){ if( !calendarEventArray) { var calendarEventArray = new Array(); calendarEventArray = gCalendarWindow.EventSelection.selectedEvents; } if(calendarEventArray.length == 0) alert("No events selected"); var calendarEvent; var sTextiCalendar = eventArrayToICalString( calendarEventArray ); var sTextiCalendarExport = eventArrayToICalString( calendarEventArray, true ); var sTextHTML = eventArrayToHTML( calendarEventArray ); // 1. get the clipboard service var clipboard = getClipboard(); // 2. create the transferable var trans = createTransferable(); if ( trans && clipboard) { // 3. register the data flavors trans.addDataFlavor("text/calendar"); trans.addDataFlavor("text/unicode"); trans.addDataFlavor("text/html"); // 4. create the data objects var icalWrapper = createSupportsString(); var textWrapper = createSupportsString(); var htmlWrapper = createSupportsString(); if ( icalWrapper && textWrapper && htmlWrapper ) { // get the data icalWrapper.data = sTextiCalendar; // plainTextRepresentation; textWrapper.data = sTextiCalendarExport; // plainTextRepresentation; htmlWrapper.data = sTextHTML; // htmlRepresentation; // 5. add data objects to transferable // Both Outlook 2000 client and Lotus Organizer use text/unicode when pasting iCalendar data trans.setTransferData ( "text/calendar", icalWrapper, icalWrapper.data.length*2 ); // double byte data trans.setTransferData ( "text/unicode", textWrapper, textWrapper.data.length*2 ); trans.setTransferData ( "text/html", htmlWrapper, htmlWrapper.data.length*2 ); clipboard.setData( trans, null, Components.interfaces.nsIClipboard.kGlobalClipboard ); return true; } }}