rem
stringlengths
0
126k
add
stringlengths
0
441k
context
stringlengths
15
136k
var ignore1 = new Object; var ignore2 = new Object; var tmpFile = this.mLauncher.getDownloadInfo( ignore1, ignore2 ); if ( tmpFile.isExecutable() ) { this.mLauncher.saveToDisk( null, false ); this.mDialog.close(); return; }
initDialog : function() { // Put product brand short name in prompt. var prompt = this.dialogElement( "prompt" ); var modified = this.replaceInsert( prompt.firstChild.nodeValue, 1, this.getString( "brandShortName" ) ); prompt.firstChild.nodeValue = modified; // Put file name in window title. var win = this.dialogElement( "nsHelperAppDlg" ); var url = this.mLauncher.source.QueryInterface( Components.interfaces.nsIURL ); var fname = ""; this.mSourcePath = url.prePath; if ( url ) { // A url, use file name from it. fname = url.fileName; this.mSourcePath += url.directory; } else { // A generic uri, use path. fname = this.mLauncher.source.path; this.mSourcePath += url.path; } var title = this.replaceInsert( win.getAttribute( "title" ), 1, fname ); win.setAttribute( "title", title ); // Put content type and location into intro. this.initIntro(); // Add special debug hook. if ( this.debug ) { var prompt = this.dialogElement( "prompt" ); prompt.setAttribute( "onclick", "dialog.doDebug()" ); } // Put explanation of default action into text box. this.initExplanation(); // Set default selection (always the "default"). this.dialogElement( "default" ).checked = true; // If default is not to save to disk, then make that the alternative. if ( this.mLauncher.MIMEInfo.preferredAction != Components.interfaces.nsIMIMEInfo.saveToDisk ) { this.dialogElement( "saveToDisk" ).checked = true; } else { this.dialogElement( "openUsing" ).checked = true; } // Disable selection under "different action". this.option(); // Set up dialog button callbacks. var object = this; // "this.onOK()" doesn't work! this.mDialog.doSetOKCancel( function () { return object.onOK(); }, function () { return object.onCancel(); } ); // Position it. if ( this.mDialog.opener ) { this.mDialog.moveToAlertPosition(); } else { this.mDialog.centerWindowOnScreen(); } },
var prompt = this.dialogElement( "prompt" );
initDialog : function() { // Check if file is executable (in which case, we will go straight to // "save to disk"). var ignore1 = new Object; var ignore2 = new Object; var tmpFile = this.mLauncher.getDownloadInfo( ignore1, ignore2 ); if ( tmpFile.isExecutable() ) { this.mLauncher.saveToDisk( null, false ); this.mDialog.close(); return; } // Put product brand short name in prompt. var prompt = this.dialogElement( "prompt" ); var modified = this.replaceInsert( prompt.firstChild.nodeValue, 1, this.getString( "brandShortName" ) ); prompt.firstChild.nodeValue = modified; // Put file name in window title. var win = this.dialogElement( "nsHelperAppDlg" ); var url = this.mLauncher.source.QueryInterface( Components.interfaces.nsIURL ); var fname = ""; this.mSourcePath = url.prePath; if ( url ) { // A url, use file name from it. fname = url.fileName; this.mSourcePath += url.directory; } else { // A generic uri, use path. fname = this.mLauncher.source.path; this.mSourcePath += url.path; } var title = this.replaceInsert( win.getAttribute( "title" ), 1, fname); win.setAttribute( "title", title ); // Put content type and location into intro. this.initIntro(url); var iconString = "moz-icon://" + fname + "?size=32&contentType=" + this.mLauncher.MIMEInfo.MIMEType; this.dialogElement("contentTypeImage").setAttribute("src", iconString); this.initAppAndSaveToDiskValues(); // always make sure the window starts off with this checked.... this.dialogElement( "alwaysAskMe" ).checked = true; // Add special debug hook. if ( this.debug ) { var prompt = this.dialogElement( "prompt" ); prompt.setAttribute( "onclick", "dialog.doDebug()" ); } // Set up dialog button callbacks. var object = this; // "this.onOK()" doesn't work! this.mDialog.doSetOKCancel( function () { return object.onOK(); }, function () { return object.onCancel(); } ); // Position it. if ( this.mDialog.opener ) { this.mDialog.moveToAlertPosition(); } else { this.mDialog.centerWindowOnScreen(); } // Set initial focus this.dialogElement( "mode" ).focus(); },
alignpopup = document.getElementById("image.alignType");
alignpopup = document.getElementById("image.alignType"); /********************* removed, some things are better said without words ******************
function initDialog() { // Get a single selected anchor element imageElement = editorShell.GetSelectedElement(tagName); if (imageElement) { // We found an element and don't need to insert one insertNew = false; } else { insertNew = true; // We don't have an element selected, // so create one with default attributes dump("Element not selected - calling createElementWithDefaults\n"); imageElement = editorShell.CreateElementWithDefaults(tagName); if( !imageElement ) { dump("Failed to get selected element or create a new one!\n"); window.close(); } } // Set the controls to the image's attributes str = imageElement.getAttribute("src"); if ( str == "null" ) { str = ""; } dialog.srcInput.value = str; str = imageElement.getAttribute("alt"); if ( str == "null" ) { str = ""; } dialog.altTextInput.value = str; // we want to force an update so initialize "wasEnabledAll" to be the opposite of what the actual state is wasEnabledAll = !((dialog.srcInput.value.length > 0) && (dialog.altTextInput.value.length > 0)); // set height and width // note: need to set actual image size if no attributes dimvalue = imageElement.getAttribute("width"); if ( dimvalue == "null" ) { dimvalue = ""; } dialog.imagewidthInput.value = dimvalue; dimvalue = imageElement.getAttribute("height"); if ( dimvalue == "null" ) { dimvalue = ""; } dialog.imageheightInput.value = dimvalue; // Mods Brian King XML Workshop // Set H & W pop-up on start-up if (insertNew == false) { var wdh = imageElement.getAttribute("width"); var hgt = imageElement.getAttribute("height"); ispercentw = wdh.substr(wdh.length-1, 1); ispercenth = hgt.substr(hgt.length-1, 1); if (ispercentw == "%") setPopup("w"); if (ispercenth == "%") setPopup("h"); } // End Mods BK // this is not the correct way to determine if custom or original if ( dimvalue != "" ) { dialog.customsizeRadio.checked = true; } alignpopup = document.getElementById("image.alignType"); if ( alignpopup ) { alignvalue = imageElement.getAttribute("align"); if ( alignvalue == "" ) { alignvalue = "at the bottom"; } dump( "popup value = " + alignvalue + "\n" ); alignpopup.setAttribute( "value", alignvalue ); } // set spacing editfields sizevalue = imageElement.getAttribute("hspace"); dialog.imagelrInput.value = sizevalue; sizevalue = imageElement.getAttribute("vspace"); dialog.imagetbInput.value = sizevalue; sizevalue = imageElement.getAttribute("border"); dialog.imageborderInput.value = sizevalue; // force wasEnableAll to be different so everything gets updated wasEnableAll = !(dialog.srcInput.value.length > 0); doOverallEnabling(); checkForImage( "image.srcInput" );}
if (gBackgroundImage.match( /url\((.*)\)/ ))
if (/url\((.*)\)/.test( gBackgroundImage ))
function InitDialog(){ // Get image from document gBackgroundImage = GetHTMLOrCSSStyleValue(globalElement, backgroundStr, cssBackgroundImageStr); if (gBackgroundImage.match( /url\((.*)\)/ )) gBackgroundImage = RegExp.$1; gDialog.BackgroundImageInput.value = gBackgroundImage; if (gBackgroundImage) gDialog.ColorPreview.setAttribute(styleStr, backImageStyle+gBackgroundImage+");"); SetRelativeCheckbox(); customTextColor = GetHTMLOrCSSStyleValue(globalElement, textStr, cssColorStr); customTextColor = ConvertRGBColorIntoHEXColor(customTextColor); customLinkColor = globalElement.getAttribute(linkStr); customActiveColor = globalElement.getAttribute(alinkStr); customVisitedColor = globalElement.getAttribute(vlinkStr); customBackgroundColor = GetHTMLOrCSSStyleValue(globalElement, bgcolorStr, cssBackgroundColorStr); customBackgroundColor = ConvertRGBColorIntoHEXColor(customBackgroundColor); var haveCustomColor = customTextColor || customLinkColor || customVisitedColor || customActiveColor || customBackgroundColor; // Set default color explicitly for any that are missing // PROBLEM: We are using "windowtext" and "window" for the Windows OS // default color values. This works with CSS in preview window, // but we should NOT use these as values for HTML attributes! if (!customTextColor) customTextColor = defaultTextColor; if (!customLinkColor) customLinkColor = defaultLinkColor; if (!customActiveColor) customActiveColor = defaultActiveColor; if (!customVisitedColor) customVisitedColor = defaultVisitedColor; if (!customBackgroundColor) customBackgroundColor = defaultBackgroundColor; if (haveCustomColor) { // If any colors are set, then check the "Custom" radio button gDialog.PageColorGroup.selectedItem = gDialog.CustomColorsRadio; UseCustomColors(); } else { gDialog.PageColorGroup.selectedItem = gDialog.DefaultColorsRadio; UseDefaultColors(); }}
dialog.widthInput.value = InitPixelOrPercentCombobox(globalElement, "width", "widthUnitsSelect"); dialog.heightInput.value = InitPixelOrPercentCombobox(globalElement, "height", "heightUnitsSelect"); if ( dialog.widthInput.value.length && dialog.heightInput.value.length ) dialog.customsizeRadio.checked = true; else dialog.originalsizeRadio.checked = true;
if ( SeeMore ) { dialog.widthInput.value = InitPixelOrPercentCombobox(globalElement, "width", "widthUnitsSelect"); dialog.heightInput.value = InitPixelOrPercentCombobox(globalElement, "height", "heightUnitsSelect"); if ( dialog.widthInput.value.length && dialog.heightInput.value.length ) { dialog.isCustomSize = true; dialog.customsizeRadio.checked = true; } else { dialog.isCustomSize = false; dialog.originalsizeRadio.checked = true; }
function InitDialog(){ // Set the controls to the image's attributes str = globalElement.getAttribute("src"); if (str) dialog.srcInput.value = str; str = globalElement.getAttribute("alt"); if (str) dialog.altTextInput.value = str; // setup the height and width widgets dialog.widthInput.value = InitPixelOrPercentCombobox(globalElement, "width", "widthUnitsSelect"); dialog.heightInput.value = InitPixelOrPercentCombobox(globalElement, "height", "heightUnitsSelect"); // TODO: We need to get the actual image dimensions. // If different from attribute dimensions, then "custom" is checked. // For now, always check custom, so we don't trash existing values if ( dialog.widthInput.value.length && dialog.heightInput.value.length ) dialog.customsizeRadio.checked = true; else dialog.originalsizeRadio.checked = true; // set spacing editfields dialog.imagelrInput.value = globalElement.getAttribute("hspace"); dialog.imagetbInput.value = globalElement.getAttribute("vspace"); dialog.border.value = globalElement.getAttribute("border"); // Get alignment setting var align = globalElement.getAttribute("align"); if (align) { align.toLowerCase();dump("Image Align exists = "+align+"\n"); }dump("Image Align="+align+"\n"); switch ( align ) { case "top": dialog.alignTypeSelect.selectedIndex = 0; break; case "center": dialog.alignTypeSelect.selectedIndex = 1; break; case "left": dialog.alignTypeSelect.selectedIndex = 3; break; case "right": dialog.alignTypeSelect.selectedIndex = 4; break; default: // Default or "bottom" dialog.alignTypeSelect.selectedIndex = 2; break; }dump( "Image Align Select Index after setting="+dialog.alignTypeSelect.selectedIndex+"\n"); imageTypeExtension = checkForImage(); // we want to force an update so initialize "wasEnableAll" to be the opposite of what the actual state is wasEnableAll = !imageTypeExtension; doOverallEnabling();}
var align = globalElement.getAttribute("align"); if (align) { align.toLowerCase(); dump("Image Align exists = "+align+"\n");
var align = globalElement.getAttribute("align"); if (align) { align = align.toLowerCase(); } switch ( align ) { case "top": dialog.alignTypeSelect.selectedIndex = 0; break; case "center": dialog.alignTypeSelect.selectedIndex = 1; break; case "left": dialog.alignTypeSelect.selectedIndex = 3; break; case "right": dialog.alignTypeSelect.selectedIndex = 4; break; default: dialog.alignTypeSelect.selectedIndex = 2; break; }
function InitDialog(){ // Set the controls to the image's attributes str = globalElement.getAttribute("src"); if (str) dialog.srcInput.value = str; str = globalElement.getAttribute("alt"); if (str) dialog.altTextInput.value = str; // setup the height and width widgets dialog.widthInput.value = InitPixelOrPercentCombobox(globalElement, "width", "widthUnitsSelect"); dialog.heightInput.value = InitPixelOrPercentCombobox(globalElement, "height", "heightUnitsSelect"); // TODO: We need to get the actual image dimensions. // If different from attribute dimensions, then "custom" is checked. // For now, always check custom, so we don't trash existing values if ( dialog.widthInput.value.length && dialog.heightInput.value.length ) dialog.customsizeRadio.checked = true; else dialog.originalsizeRadio.checked = true; // set spacing editfields dialog.imagelrInput.value = globalElement.getAttribute("hspace"); dialog.imagetbInput.value = globalElement.getAttribute("vspace"); dialog.border.value = globalElement.getAttribute("border"); // Get alignment setting var align = globalElement.getAttribute("align"); if (align) { align.toLowerCase();dump("Image Align exists = "+align+"\n"); }dump("Image Align="+align+"\n"); switch ( align ) { case "top": dialog.alignTypeSelect.selectedIndex = 0; break; case "center": dialog.alignTypeSelect.selectedIndex = 1; break; case "left": dialog.alignTypeSelect.selectedIndex = 3; break; case "right": dialog.alignTypeSelect.selectedIndex = 4; break; default: // Default or "bottom" dialog.alignTypeSelect.selectedIndex = 2; break; }dump( "Image Align Select Index after setting="+dialog.alignTypeSelect.selectedIndex+"\n"); imageTypeExtension = checkForImage(); // we want to force an update so initialize "wasEnableAll" to be the opposite of what the actual state is wasEnableAll = !imageTypeExtension; doOverallEnabling();}
dump("Image Align="+align+"\n"); switch ( align ) { case "top": dialog.alignTypeSelect.selectedIndex = 0; break; case "center": dialog.alignTypeSelect.selectedIndex = 1; break; case "left": dialog.alignTypeSelect.selectedIndex = 3; break; case "right": dialog.alignTypeSelect.selectedIndex = 4; break; default: dialog.alignTypeSelect.selectedIndex = 2; break; } dump( "Image Align Select Index after setting="+dialog.alignTypeSelect.selectedIndex+"\n");
function InitDialog(){ // Set the controls to the image's attributes str = globalElement.getAttribute("src"); if (str) dialog.srcInput.value = str; str = globalElement.getAttribute("alt"); if (str) dialog.altTextInput.value = str; // setup the height and width widgets dialog.widthInput.value = InitPixelOrPercentCombobox(globalElement, "width", "widthUnitsSelect"); dialog.heightInput.value = InitPixelOrPercentCombobox(globalElement, "height", "heightUnitsSelect"); // TODO: We need to get the actual image dimensions. // If different from attribute dimensions, then "custom" is checked. // For now, always check custom, so we don't trash existing values if ( dialog.widthInput.value.length && dialog.heightInput.value.length ) dialog.customsizeRadio.checked = true; else dialog.originalsizeRadio.checked = true; // set spacing editfields dialog.imagelrInput.value = globalElement.getAttribute("hspace"); dialog.imagetbInput.value = globalElement.getAttribute("vspace"); dialog.border.value = globalElement.getAttribute("border"); // Get alignment setting var align = globalElement.getAttribute("align"); if (align) { align.toLowerCase();dump("Image Align exists = "+align+"\n"); }dump("Image Align="+align+"\n"); switch ( align ) { case "top": dialog.alignTypeSelect.selectedIndex = 0; break; case "center": dialog.alignTypeSelect.selectedIndex = 1; break; case "left": dialog.alignTypeSelect.selectedIndex = 3; break; case "right": dialog.alignTypeSelect.selectedIndex = 4; break; default: // Default or "bottom" dialog.alignTypeSelect.selectedIndex = 2; break; }dump( "Image Align Select Index after setting="+dialog.alignTypeSelect.selectedIndex+"\n"); imageTypeExtension = checkForImage(); // we want to force an update so initialize "wasEnableAll" to be the opposite of what the actual state is wasEnableAll = !imageTypeExtension; doOverallEnabling();}
dialog.fontsGroup = document.getElementById("fontsGroup"); dialog.downloadFonts = document.getElementById("downloadFonts");
function initDialog(){ dialog = new Object; dialog.paperList = document.getElementById("paperList"); dialog.paperGroup = document.getElementById("paperGroup"); dialog.plexList = document.getElementById("plexList"); dialog.plexGroup = document.getElementById("plexGroup"); dialog.cmdLabel = document.getElementById("cmdLabel"); dialog.cmdGroup = document.getElementById("cmdGroup"); dialog.cmdInput = document.getElementById("cmdInput"); dialog.colorGroup = document.getElementById("colorGroup"); dialog.colorRadio = document.getElementById("colorRadio"); dialog.grayRadio = document.getElementById("grayRadio"); dialog.topInput = document.getElementById("topInput"); dialog.bottomInput = document.getElementById("bottomInput"); dialog.leftInput = document.getElementById("leftInput"); dialog.rightInput = document.getElementById("rightInput");}
srcInput = window.opener.document.getElementById("srcInput"); widthInput = window.opener.document.getElementById("widthInput"); heightInput = window.opener.document.getElementById("heightInput"); borderInput = window.opener.document.getElementById("border");
var srcInput = window.opener.document.getElementById("srcInput"); var widthInput = window.opener.document.getElementById("widthInput"); var heightInput = window.opener.document.getElementById("heightInput");
function initDialog(){ //Get image element from parent imageElement = window.arguments[0]; if (!imageElement) //If not an image close window window.close(); //Get image map from parent imageMap = window.arguments[1]; if (!imageMap) //If no image map close window window.close(); //find parent inputs srcInput = window.opener.document.getElementById("srcInput"); widthInput = window.opener.document.getElementById("widthInput"); heightInput = window.opener.document.getElementById("heightInput"); borderInput = window.opener.document.getElementById("border"); //check for relative url if (!((srcInput.value.indexOf("http://") != -1) || (srcInput.value.indexOf("file://") != -1))){ if (editorShell.editorDocument.location == "about:blank"){ alert("Relative URLs can only be used on documents which have been saved"); window.close(); //TODO: add option to save document now } else{ edDoc = new String(editorShell.editorDocument.location); imgDoc = new String(srcInput.value); imgDoc = imgDoc.split("../"); len = imgDoc.length; for (i=0; i<len; i++){ if (edDoc.length > (String(editorShell.editorDocument.location.protocol).length+2)) edDoc = edDoc.substring(0, edDoc.lastIndexOf("/")); } imgDoc = edDoc+"/"+imgDoc[imgDoc.length-1]; srcInputValue = imgDoc; } } else{ srcInputValue = srcInput.value; } //Set iframe pointer frameDoc = window.frames[0].document; //Fill button array buttonArray[0] = document.getElementById("pointerButton"); buttonArray[1] = document.getElementById("rectButton"); buttonArray[2] = document.getElementById("cirButton"); buttonArray[3] = document.getElementById("polyButton"); //Create marquee var marquee = frameDoc.createElement("div"); marquee.setAttribute("id", "marquee"); frameDoc.body.appendChild(marquee); //Create background div var bgDiv = frameDoc.createElement("div"); if ( bgDiv ) { bgDiv.setAttribute("id", "bgDiv"); frameDoc.body.appendChild(bgDiv); } //Place Image var newImg = frameDoc.createElement("img"); if ( newImg ) { newImg.setAttribute("src", srcInputValue); if (parseInt(widthInput.value) > 0) newImg.setAttribute("width", widthInput.value); if (parseInt(heightInput.value) > 0) newImg.setAttribute("height", heightInput.value); newImg.setAttribute("id", "mainImg"); imageEl = frameDoc.getElementById("bgDiv").appendChild(newImg); imageEl.addEventListener("error", imgError, false); } //Resize background DIV to fit image fixBgDiv(); //Recreate Image Map if it exists recreateMap();}
edDoc = new String(editorShell.editorDocument.location); imgDoc = new String(srcInput.value);
var edDoc = new String(editorShell.editorDocument.location); var imgDoc = new String(srcInput.value);
function initDialog(){ //Get image element from parent imageElement = window.arguments[0]; if (!imageElement) //If not an image close window window.close(); //Get image map from parent imageMap = window.arguments[1]; if (!imageMap) //If no image map close window window.close(); //find parent inputs srcInput = window.opener.document.getElementById("srcInput"); widthInput = window.opener.document.getElementById("widthInput"); heightInput = window.opener.document.getElementById("heightInput"); borderInput = window.opener.document.getElementById("border"); //check for relative url if (!((srcInput.value.indexOf("http://") != -1) || (srcInput.value.indexOf("file://") != -1))){ if (editorShell.editorDocument.location == "about:blank"){ alert("Relative URLs can only be used on documents which have been saved"); window.close(); //TODO: add option to save document now } else{ edDoc = new String(editorShell.editorDocument.location); imgDoc = new String(srcInput.value); imgDoc = imgDoc.split("../"); len = imgDoc.length; for (i=0; i<len; i++){ if (edDoc.length > (String(editorShell.editorDocument.location.protocol).length+2)) edDoc = edDoc.substring(0, edDoc.lastIndexOf("/")); } imgDoc = edDoc+"/"+imgDoc[imgDoc.length-1]; srcInputValue = imgDoc; } } else{ srcInputValue = srcInput.value; } //Set iframe pointer frameDoc = window.frames[0].document; //Fill button array buttonArray[0] = document.getElementById("pointerButton"); buttonArray[1] = document.getElementById("rectButton"); buttonArray[2] = document.getElementById("cirButton"); buttonArray[3] = document.getElementById("polyButton"); //Create marquee var marquee = frameDoc.createElement("div"); marquee.setAttribute("id", "marquee"); frameDoc.body.appendChild(marquee); //Create background div var bgDiv = frameDoc.createElement("div"); if ( bgDiv ) { bgDiv.setAttribute("id", "bgDiv"); frameDoc.body.appendChild(bgDiv); } //Place Image var newImg = frameDoc.createElement("img"); if ( newImg ) { newImg.setAttribute("src", srcInputValue); if (parseInt(widthInput.value) > 0) newImg.setAttribute("width", widthInput.value); if (parseInt(heightInput.value) > 0) newImg.setAttribute("height", heightInput.value); newImg.setAttribute("id", "mainImg"); imageEl = frameDoc.getElementById("bgDiv").appendChild(newImg); imageEl.addEventListener("error", imgError, false); } //Resize background DIV to fit image fixBgDiv(); //Recreate Image Map if it exists recreateMap();}
len = imgDoc.length; for (i=0; i<len; i++){
var len = imgDoc.length; for (var i=0; i<len; i++){
function initDialog(){ //Get image element from parent imageElement = window.arguments[0]; if (!imageElement) //If not an image close window window.close(); //Get image map from parent imageMap = window.arguments[1]; if (!imageMap) //If no image map close window window.close(); //find parent inputs srcInput = window.opener.document.getElementById("srcInput"); widthInput = window.opener.document.getElementById("widthInput"); heightInput = window.opener.document.getElementById("heightInput"); borderInput = window.opener.document.getElementById("border"); //check for relative url if (!((srcInput.value.indexOf("http://") != -1) || (srcInput.value.indexOf("file://") != -1))){ if (editorShell.editorDocument.location == "about:blank"){ alert("Relative URLs can only be used on documents which have been saved"); window.close(); //TODO: add option to save document now } else{ edDoc = new String(editorShell.editorDocument.location); imgDoc = new String(srcInput.value); imgDoc = imgDoc.split("../"); len = imgDoc.length; for (i=0; i<len; i++){ if (edDoc.length > (String(editorShell.editorDocument.location.protocol).length+2)) edDoc = edDoc.substring(0, edDoc.lastIndexOf("/")); } imgDoc = edDoc+"/"+imgDoc[imgDoc.length-1]; srcInputValue = imgDoc; } } else{ srcInputValue = srcInput.value; } //Set iframe pointer frameDoc = window.frames[0].document; //Fill button array buttonArray[0] = document.getElementById("pointerButton"); buttonArray[1] = document.getElementById("rectButton"); buttonArray[2] = document.getElementById("cirButton"); buttonArray[3] = document.getElementById("polyButton"); //Create marquee var marquee = frameDoc.createElement("div"); marquee.setAttribute("id", "marquee"); frameDoc.body.appendChild(marquee); //Create background div var bgDiv = frameDoc.createElement("div"); if ( bgDiv ) { bgDiv.setAttribute("id", "bgDiv"); frameDoc.body.appendChild(bgDiv); } //Place Image var newImg = frameDoc.createElement("img"); if ( newImg ) { newImg.setAttribute("src", srcInputValue); if (parseInt(widthInput.value) > 0) newImg.setAttribute("width", widthInput.value); if (parseInt(heightInput.value) > 0) newImg.setAttribute("height", heightInput.value); newImg.setAttribute("id", "mainImg"); imageEl = frameDoc.getElementById("bgDiv").appendChild(newImg); imageEl.addEventListener("error", imgError, false); } //Resize background DIV to fit image fixBgDiv(); //Recreate Image Map if it exists recreateMap();}
if (ListElement) ListType = ListElement.nodeName.toLowerCase();
if (gListElement) gListType = gListElement.nodeName.toLowerCase();
function InitDialog(){ // Note that if mixed, we we pay attention // only to the anchor node's list type // (i.e., don't confuse user with "mixed" designation) if (ListElement) ListType = ListElement.nodeName.toLowerCase(); else ListType = ""; BuildBulletStyleList(); gDialog.StartingNumberInput.value = ""; var type = globalElement ? GetHTMLOrCSSStyleValue(globalElement, "type", "list-style-type") : null; if (type) type = type.toLowerCase(); var index = 0; if (ListType == "ul") { if (type) { if (type == "disc") index = 1; else if (type == "circle") index = 2; else if (type == "square") index = 3; } } else if (ListType == "ol") { switch (type) { case "1": case "decimal": index = 1; break; case "I": case "upper-roman": index = 2; break; case "i": case "lower-roman": index = 3; break; case "A": case "upper-alpha": index = 4; break; case "a": case "lower-alpha": index = 5; break; } gDialog.StartingNumberInput.value = globalElement.getAttribute("start"); } gDialog.BulletStyleList.selectedIndex = index; originalBulletStyleType = type;}
ListType = "";
gListType = "";
function InitDialog(){ // Note that if mixed, we we pay attention // only to the anchor node's list type // (i.e., don't confuse user with "mixed" designation) if (ListElement) ListType = ListElement.nodeName.toLowerCase(); else ListType = ""; BuildBulletStyleList(); gDialog.StartingNumberInput.value = ""; var type = globalElement ? GetHTMLOrCSSStyleValue(globalElement, "type", "list-style-type") : null; if (type) type = type.toLowerCase(); var index = 0; if (ListType == "ul") { if (type) { if (type == "disc") index = 1; else if (type == "circle") index = 2; else if (type == "square") index = 3; } } else if (ListType == "ol") { switch (type) { case "1": case "decimal": index = 1; break; case "I": case "upper-roman": index = 2; break; case "i": case "lower-roman": index = 3; break; case "A": case "upper-alpha": index = 4; break; case "a": case "lower-alpha": index = 5; break; } gDialog.StartingNumberInput.value = globalElement.getAttribute("start"); } gDialog.BulletStyleList.selectedIndex = index; originalBulletStyleType = type;}
if (type) type = type.toLowerCase();
function InitDialog(){ // Note that if mixed, we we pay attention // only to the anchor node's list type // (i.e., don't confuse user with "mixed" designation) if (ListElement) ListType = ListElement.nodeName.toLowerCase(); else ListType = ""; BuildBulletStyleList(); gDialog.StartingNumberInput.value = ""; var type = globalElement ? GetHTMLOrCSSStyleValue(globalElement, "type", "list-style-type") : null; if (type) type = type.toLowerCase(); var index = 0; if (ListType == "ul") { if (type) { if (type == "disc") index = 1; else if (type == "circle") index = 2; else if (type == "square") index = 3; } } else if (ListType == "ol") { switch (type) { case "1": case "decimal": index = 1; break; case "I": case "upper-roman": index = 2; break; case "i": case "lower-roman": index = 3; break; case "A": case "upper-alpha": index = 4; break; case "a": case "lower-alpha": index = 5; break; } gDialog.StartingNumberInput.value = globalElement.getAttribute("start"); } gDialog.BulletStyleList.selectedIndex = index; originalBulletStyleType = type;}
if (ListType == "ul")
if (gListType == "ul")
function InitDialog(){ // Note that if mixed, we we pay attention // only to the anchor node's list type // (i.e., don't confuse user with "mixed" designation) if (ListElement) ListType = ListElement.nodeName.toLowerCase(); else ListType = ""; BuildBulletStyleList(); gDialog.StartingNumberInput.value = ""; var type = globalElement ? GetHTMLOrCSSStyleValue(globalElement, "type", "list-style-type") : null; if (type) type = type.toLowerCase(); var index = 0; if (ListType == "ul") { if (type) { if (type == "disc") index = 1; else if (type == "circle") index = 2; else if (type == "square") index = 3; } } else if (ListType == "ol") { switch (type) { case "1": case "decimal": index = 1; break; case "I": case "upper-roman": index = 2; break; case "i": case "lower-roman": index = 3; break; case "A": case "upper-alpha": index = 4; break; case "a": case "lower-alpha": index = 5; break; } gDialog.StartingNumberInput.value = globalElement.getAttribute("start"); } gDialog.BulletStyleList.selectedIndex = index; originalBulletStyleType = type;}
else if (ListType == "ol")
else if (gListType == "ol")
function InitDialog(){ // Note that if mixed, we we pay attention // only to the anchor node's list type // (i.e., don't confuse user with "mixed" designation) if (ListElement) ListType = ListElement.nodeName.toLowerCase(); else ListType = ""; BuildBulletStyleList(); gDialog.StartingNumberInput.value = ""; var type = globalElement ? GetHTMLOrCSSStyleValue(globalElement, "type", "list-style-type") : null; if (type) type = type.toLowerCase(); var index = 0; if (ListType == "ul") { if (type) { if (type == "disc") index = 1; else if (type == "circle") index = 2; else if (type == "square") index = 3; } } else if (ListType == "ol") { switch (type) { case "1": case "decimal": index = 1; break; case "I": case "upper-roman": index = 2; break; case "i": case "lower-roman": index = 3; break; case "A": case "upper-alpha": index = 4; break; case "a": case "lower-alpha": index = 5; break; } gDialog.StartingNumberInput.value = globalElement.getAttribute("start"); } gDialog.BulletStyleList.selectedIndex = index; originalBulletStyleType = type;}
gDialog.StartingNumberInput.value = globalElement.getAttribute("start");
gNumberStyleIndex = index;
function InitDialog(){ // Note that if mixed, we we pay attention // only to the anchor node's list type // (i.e., don't confuse user with "mixed" designation) if (ListElement) ListType = ListElement.nodeName.toLowerCase(); else ListType = ""; BuildBulletStyleList(); gDialog.StartingNumberInput.value = ""; var type = globalElement ? GetHTMLOrCSSStyleValue(globalElement, "type", "list-style-type") : null; if (type) type = type.toLowerCase(); var index = 0; if (ListType == "ul") { if (type) { if (type == "disc") index = 1; else if (type == "circle") index = 2; else if (type == "square") index = 3; } } else if (ListType == "ol") { switch (type) { case "1": case "decimal": index = 1; break; case "I": case "upper-roman": index = 2; break; case "i": case "lower-roman": index = 3; break; case "A": case "upper-alpha": index = 4; break; case "a": case "lower-alpha": index = 5; break; } gDialog.StartingNumberInput.value = globalElement.getAttribute("start"); } gDialog.BulletStyleList.selectedIndex = index; originalBulletStyleType = type;}
originalBulletStyleType = type;
gDialog.StartingNumberInput.value = ConvertStartAttrToUserString(globalElement.getAttribute("start"), index); gOriginalBulletStyleType = type;
function InitDialog(){ // Note that if mixed, we we pay attention // only to the anchor node's list type // (i.e., don't confuse user with "mixed" designation) if (ListElement) ListType = ListElement.nodeName.toLowerCase(); else ListType = ""; BuildBulletStyleList(); gDialog.StartingNumberInput.value = ""; var type = globalElement ? GetHTMLOrCSSStyleValue(globalElement, "type", "list-style-type") : null; if (type) type = type.toLowerCase(); var index = 0; if (ListType == "ul") { if (type) { if (type == "disc") index = 1; else if (type == "circle") index = 2; else if (type == "square") index = 3; } } else if (ListType == "ol") { switch (type) { case "1": case "decimal": index = 1; break; case "I": case "upper-roman": index = 2; break; case "i": case "lower-roman": index = 3; break; case "A": case "upper-alpha": index = 4; break; case "a": case "lower-alpha": index = 5; break; } gDialog.StartingNumberInput.value = globalElement.getAttribute("start"); } gDialog.BulletStyleList.selectedIndex = index; originalBulletStyleType = type;}
else smallIconsCheckbox.checked = gToolboxIconSize == "small";
function initDialog(){ var mode = gToolbox.getAttribute("mode"); document.getElementById("modelist").value = mode; gToolboxIconSize = gToolbox.getAttribute("iconsize"); var smallIconsCheckbox = document.getElementById("smallicons"); if (mode == "text") smallIconsCheckbox.disabled = true; else smallIconsCheckbox.checked = gToolboxIconSize == "small"; // Build up the palette of other items. buildPalette(); // Wrap all the items on the toolbar in toolbarpaletteitems. wrapToolbarItems();}
dialog.bundle = document.getElementById("findBundle");
function initDialog() { // Create dialog object and initialize. dialog = new Object; dialog.findKey = document.getElementById("dialog.findKey"); dialog.caseSensitive = document.getElementById("dialog.caseSensitive"); dialog.wrap = document.getElementById("dialog.wrap"); dialog.searchBackwards = document.getElementById("dialog.searchBackwards"); dialog.find = document.getElementById("ok"); dialog.cancel = document.getElementById("cancel"); dialog.enabled = false; }
case "left":
case "right":
function InitDialog(){ // Set the controls to the image's attributes str = globalElement.getAttribute("src"); if (str) dialog.srcInput.value = str; str = globalElement.getAttribute("alt"); if (str) dialog.altTextInput.value = str; if ( SeeMore ) { // setup the height and width widgets dialog.widthInput.value = InitPixelOrPercentCombobox(globalElement, "width", "widthUnitsSelect"); dialog.heightInput.value = InitPixelOrPercentCombobox(globalElement, "height", "heightUnitsSelect"); // TODO: We need to get the actual image dimensions. // If different from attribute dimensions, then "custom" is checked. // For now, always check custom, so we don't trash existing values if ( dialog.widthInput.value.length && dialog.heightInput.value.length ) { dialog.isCustomSize = true; dialog.customsizeRadio.checked = true; } else { dialog.isCustomSize = false; dialog.originalsizeRadio.checked = true; } // set spacing editfields dialog.imagelrInput.value = globalElement.getAttribute("hspace"); dialog.imagetbInput.value = globalElement.getAttribute("vspace"); dialog.border.value = globalElement.getAttribute("border"); // Get alignment setting var align = globalElement.getAttribute("align"); if (align) { align = align.toLowerCase(); } switch ( align ) { case "top": dialog.alignTypeSelect.selectedIndex = 0; break; case "center": dialog.alignTypeSelect.selectedIndex = 1; break; case "left": dialog.alignTypeSelect.selectedIndex = 3; break; case "right": dialog.alignTypeSelect.selectedIndex = 4; break; default: // Default or "bottom" dialog.alignTypeSelect.selectedIndex = 2; break; } } imageTypeExtension = checkForImage(); // we want to force an update so initialize "wasEnableAll" to be the opposite of what the actual state is wasEnableAll = !imageTypeExtension; doOverallEnabling();}
case "right":
case "left":
function InitDialog(){ // Set the controls to the image's attributes str = globalElement.getAttribute("src"); if (str) dialog.srcInput.value = str; str = globalElement.getAttribute("alt"); if (str) dialog.altTextInput.value = str; if ( SeeMore ) { // setup the height and width widgets dialog.widthInput.value = InitPixelOrPercentCombobox(globalElement, "width", "widthUnitsSelect"); dialog.heightInput.value = InitPixelOrPercentCombobox(globalElement, "height", "heightUnitsSelect"); // TODO: We need to get the actual image dimensions. // If different from attribute dimensions, then "custom" is checked. // For now, always check custom, so we don't trash existing values if ( dialog.widthInput.value.length && dialog.heightInput.value.length ) { dialog.isCustomSize = true; dialog.customsizeRadio.checked = true; } else { dialog.isCustomSize = false; dialog.originalsizeRadio.checked = true; } // set spacing editfields dialog.imagelrInput.value = globalElement.getAttribute("hspace"); dialog.imagetbInput.value = globalElement.getAttribute("vspace"); dialog.border.value = globalElement.getAttribute("border"); // Get alignment setting var align = globalElement.getAttribute("align"); if (align) { align = align.toLowerCase(); } switch ( align ) { case "top": dialog.alignTypeSelect.selectedIndex = 0; break; case "center": dialog.alignTypeSelect.selectedIndex = 1; break; case "left": dialog.alignTypeSelect.selectedIndex = 3; break; case "right": dialog.alignTypeSelect.selectedIndex = 4; break; default: // Default or "bottom" dialog.alignTypeSelect.selectedIndex = 2; break; } } imageTypeExtension = checkForImage(); // we want to force an update so initialize "wasEnableAll" to be the opposite of what the actual state is wasEnableAll = !imageTypeExtension; doOverallEnabling();}
dialog.descText = document.getElementById("descText");
function initDialog(){ dialog = new Object; dialog.propertiesButton = document.getElementById("properties"); dialog.destGroup = document.getElementById("destGroup"); dialog.fileRadio = document.getElementById("fileRadio"); dialog.printerRadio = document.getElementById("printerRadio"); dialog.printrangeGroup = document.getElementById("printrangeGroup"); dialog.allpagesRadio = document.getElementById("allpagesRadio"); dialog.rangeRadio = document.getElementById("rangeRadio"); dialog.selectionRadio = document.getElementById("selectionRadio"); dialog.frompageInput = document.getElementById("frompageInput"); dialog.frompageLabel = document.getElementById("frompageLabel"); dialog.topageInput = document.getElementById("topageInput"); dialog.topageLabel = document.getElementById("topageLabel"); dialog.numCopiesInput = document.getElementById("numCopiesInput"); dialog.printframeGroup = document.getElementById("printframeGroup"); dialog.aslaidoutRadio = document.getElementById("aslaidoutRadio"); dialog.selectedframeRadio = document.getElementById("selectedframeRadio"); dialog.eachframesepRadio = document.getElementById("eachframesepRadio"); dialog.printframeGroupLabel = document.getElementById("printframeGroupLabel"); dialog.fileInput = document.getElementById("fileInput"); dialog.fileLabel = document.getElementById("fileLabel"); dialog.printerLabel = document.getElementById("printerLabel"); dialog.chooseButton = document.getElementById("chooseFile"); dialog.printerList = document.getElementById("printerList"); dialog.printButton = document.documentElement.getButton("accept"); // <data> elements dialog.printName = document.getElementById("printButton"); dialog.fpDialog = document.getElementById("fpDialog"); dialog.enabled = false;}
height = StripPxUnit(height);
if (/px/.test(height)) { height = RegExp.leftContext; }
function InitDialog(){ // Just to be confusing, "size" is used instead of height because it does // not accept % values, only pixels var height = GetHTMLOrCSSStyleValue(globalElement, "size", "height") height = StripPxUnit(height); if(!height) { height = 2; //Default value } // We will use "height" here and in UI gDialog.heightInput.value = height; // Get the width attribute of the element, stripping out "%" // This sets contents of menulist (adds pixel and percent menuitems elements) gDialog.widthInput.value = InitPixelOrPercentMenulist(globalElement, hLineElement, "width","pixelOrPercentMenulist"); var marginLeft = GetHTMLOrCSSStyleValue(globalElement, "align", "margin-left").toLowerCase(); var marginRight = GetHTMLOrCSSStyleValue(globalElement, "align", "margin-right").toLowerCase(); align = marginLeft + " " + marginRight; gDialog.leftAlign.checked = (align == "left left" || align == "0px auto"); gDialog.centerAlign.checked = (align == "center center" || align == "auto auto" || align == " "); gDialog.rightAlign.checked = (align == "right right" || align == "auto 0px"); if (gDialog.centerAlign.checked) { gDialog.alignGroup.selectedItem = gDialog.centerAlign; } else if (gDialog.rightAlign.checked) { gDialog.alignGroup.selectedItem = gDialog.rightAlign; } else { gDialog.alignGroup.selectedItem = gDialog.leftAlign; } gDialog.shading.checked = !globalElement.hasAttribute("noshade");}
return; }
function initDialog(){ //Get image element from parent imageElement = window.arguments[0]; if (!imageElement) //If not an image close window window.close(); //Get image map from parent imageMap = window.arguments[1]; if (!imageMap) //If no image map close window window.close(); //find parent inputs var srcInput = window.opener.document.getElementById("srcInput"); var widthInput = window.opener.document.getElementById("widthInput"); var heightInput = window.opener.document.getElementById("heightInput"); //check for relative url if (!((srcInput.value.indexOf("http://") != -1) || (srcInput.value.indexOf("file://") != -1))){ if (editorShell.editorDocument.location == "about:blank"){ alert(GetString("ImapRelative")); window.close(); //TODO: add option to save document now } else{ var edDoc = new String(editorShell.editorDocument.location); var imgDoc = new String(srcInput.value); imgDoc = imgDoc.split("../"); var len = imgDoc.length; for (var i=0; i<len; i++){ if (edDoc.length > (String(editorShell.editorDocument.location.protocol).length+2)) edDoc = edDoc.substring(0, edDoc.lastIndexOf("/")); } imgDoc = edDoc+"/"+imgDoc[imgDoc.length-1]; srcInputValue = imgDoc; } } else{ srcInputValue = srcInput.value; } //Set iframe pointer frameDoc = window.frames[0].document; //Fill button array buttonArray[0] = document.getElementById("pointerButton"); buttonArray[1] = document.getElementById("rectButton"); buttonArray[2] = document.getElementById("cirButton"); buttonArray[3] = document.getElementById("polyButton"); //Create marquee var marquee = frameDoc.createElement("div"); marquee.setAttribute("id", "marquee"); frameDoc.body.appendChild(marquee); //Create background div var bgDiv = frameDoc.createElement("div"); if ( bgDiv ) { bgDiv.setAttribute("id", "bgDiv"); frameDoc.body.appendChild(bgDiv); } //Place Image var newImg = frameDoc.createElement("img"); if ( newImg ) { newImg.setAttribute("src", srcInputValue); if (parseInt(widthInput.value) > 0) newImg.setAttribute("width", widthInput.value); if (parseInt(heightInput.value) > 0) newImg.setAttribute("height", heightInput.value); newImg.setAttribute("id", "mainImg"); imageEl = frameDoc.getElementById("bgDiv").appendChild(newImg); imageEl.addEventListener("error", imgError, false); } //Resize background DIV to fit image fixBgDiv(); //Recreate Image Map if it exists recreateMap();}
dump("dialog.contentType="+dialog.contentType+"\n");
function initDialog() { // Create dialog object and initialize. dialog = new Object; dialog.contentType = document.getElementById("dialog.contentType");dump("dialog.contentType="+dialog.contentType+"\n"); dialog.more = document.getElementById("dialog.more"); dialog.pick = document.getElementById("dialog.pick"); dialog.save = document.getElementById("dialog.save"); dialog.cancel = document.getElementById("dialog.cancel");}
var prefs = Components.classes["component:
var prefs = Components.classes["@mozilla.org/preferences;1"];
function InitEditCard(){ // create editCard object that contains global variables for editCard.js editCard = new Object; // get pointer to nsIPref object var prefs = Components.classes["component://netscape/preferences"]; if ( prefs ) { prefs = prefs.getService(); if ( prefs ) { prefs = prefs.QueryInterface(Components.interfaces.nsIPref); editCard.prefs = prefs; } } // get specific prefs that editCard will need if ( prefs ) { try { editCard.displayLastNameFirst = prefs.GetBoolPref("mail.addr_book.displayName.lastnamefirst"); editCard.generateDisplayName = prefs.GetBoolPref("mail.addr_book.displayName.autoGeneration"); editCard.lastFirstSeparator = ", "; editCard.firstLastSeparator = " "; } catch (ex) { dump("failed to get pref\n"); } }}
InitPhoneticFields();
function InitEditCard(){ gAddressBookBundle = document.getElementById("bundle_addressBook"); // create editCard object that contains global variables for editCard.js editCard = new Object; editCard.prefs = gPrefs; // get specific prefs that editCard will need try { editCard.displayLastNameFirst = gPrefs.getBoolPref("mail.addr_book.displayName.lastnamefirst"); editCard.generateDisplayName = gPrefs.getBoolPref("mail.addr_book.displayName.autoGeneration"); } catch (ex) { dump("ex: failed to get pref" + ex + "\n"); }}
gEditCard = new Object;
gEditCard = new Object();
function InitEditCard(){ InitPhoneticFields(); InitCommonJS(); // Create gEditCard object that contains global variables for the current js // file. gEditCard = new Object; gEditCard.prefs = gPrefs; // get specific prefs that gEditCard will need try { var displayLastNameFirst = gPrefs.getComplexValue("mail.addr_book.displayName.lastnamefirst", Components.interfaces.nsIPrefLocalizedString).data; gEditCard.displayLastNameFirst = (displayLastNameFirst == "true"); gEditCard.generateDisplayName = gPrefs.getBoolPref("mail.addr_book.displayName.autoGeneration"); } catch (ex) { dump("ex: failed to get pref" + ex + "\n"); }}
expl.value = this.getString( "explanation.saveToDisk" );
text = this.getString( "explanation.saveToDisk" );
initExplanation: function() { var expl = this.dialogElement( "explanation" ); if ( this.mLauncher.MIMEInfo.preferredAction == Components.interfaces.nsIMIMEInfo.saveToDisk ) { expl.value = this.getString( "explanation.saveToDisk" ); } else { // Default is to "open with system default." var appDesc = this.getString( "explanation.defaultApp" ); if ( this.mLauncher.MIMEInfo.preferredAction != Components.interfaces.nsIMIMEInfo.useSystemDefault ) { // If opening using the app, we prefer to use the app description. appDesc = this.mLauncher.MIMEInfo.applicationDescription; if ( appDesc != "" ) { // Use application description. expl.value= this.replaceInsert( this.getString( "explanation.openUsing" ), 1, appDesc ); } else { // If no description, use the app executable name. var app = this.mLauncher.MIMEInfo.preferredApplicationHandler; if ( app ) { // Use application path. expl.value = this.replaceInsert( this.getString( "explanation.openUsing" ), 1, app.unicodePath ); } } } } },
var appDesc = this.getString( "explanation.defaultApp" );
text = this.getString( "explanation.defaultApp" );
initExplanation: function() { var expl = this.dialogElement( "explanation" ); if ( this.mLauncher.MIMEInfo.preferredAction == Components.interfaces.nsIMIMEInfo.saveToDisk ) { expl.value = this.getString( "explanation.saveToDisk" ); } else { // Default is to "open with system default." var appDesc = this.getString( "explanation.defaultApp" ); if ( this.mLauncher.MIMEInfo.preferredAction != Components.interfaces.nsIMIMEInfo.useSystemDefault ) { // If opening using the app, we prefer to use the app description. appDesc = this.mLauncher.MIMEInfo.applicationDescription; if ( appDesc != "" ) { // Use application description. expl.value= this.replaceInsert( this.getString( "explanation.openUsing" ), 1, appDesc ); } else { // If no description, use the app executable name. var app = this.mLauncher.MIMEInfo.preferredApplicationHandler; if ( app ) { // Use application path. expl.value = this.replaceInsert( this.getString( "explanation.openUsing" ), 1, app.unicodePath ); } } } } },
appDesc = this.mLauncher.MIMEInfo.applicationDescription;
var appDesc = this.mLauncher.MIMEInfo.applicationDescription;
initExplanation: function() { var expl = this.dialogElement( "explanation" ); if ( this.mLauncher.MIMEInfo.preferredAction == Components.interfaces.nsIMIMEInfo.saveToDisk ) { expl.value = this.getString( "explanation.saveToDisk" ); } else { // Default is to "open with system default." var appDesc = this.getString( "explanation.defaultApp" ); if ( this.mLauncher.MIMEInfo.preferredAction != Components.interfaces.nsIMIMEInfo.useSystemDefault ) { // If opening using the app, we prefer to use the app description. appDesc = this.mLauncher.MIMEInfo.applicationDescription; if ( appDesc != "" ) { // Use application description. expl.value= this.replaceInsert( this.getString( "explanation.openUsing" ), 1, appDesc ); } else { // If no description, use the app executable name. var app = this.mLauncher.MIMEInfo.preferredApplicationHandler; if ( app ) { // Use application path. expl.value = this.replaceInsert( this.getString( "explanation.openUsing" ), 1, app.unicodePath ); } } } } },
expl.value= this.replaceInsert( this.getString( "explanation.openUsing" ), 1, appDesc );
text = this.replaceInsert( this.getString( "explanation.openUsing" ), 1, appDesc );
initExplanation: function() { var expl = this.dialogElement( "explanation" ); if ( this.mLauncher.MIMEInfo.preferredAction == Components.interfaces.nsIMIMEInfo.saveToDisk ) { expl.value = this.getString( "explanation.saveToDisk" ); } else { // Default is to "open with system default." var appDesc = this.getString( "explanation.defaultApp" ); if ( this.mLauncher.MIMEInfo.preferredAction != Components.interfaces.nsIMIMEInfo.useSystemDefault ) { // If opening using the app, we prefer to use the app description. appDesc = this.mLauncher.MIMEInfo.applicationDescription; if ( appDesc != "" ) { // Use application description. expl.value= this.replaceInsert( this.getString( "explanation.openUsing" ), 1, appDesc ); } else { // If no description, use the app executable name. var app = this.mLauncher.MIMEInfo.preferredApplicationHandler; if ( app ) { // Use application path. expl.value = this.replaceInsert( this.getString( "explanation.openUsing" ), 1, app.unicodePath ); } } } } },
expl.value = this.replaceInsert( this.getString( "explanation.openUsing" ), 1, app.unicodePath );
text = this.replaceInsert( this.getString( "explanation.openUsing" ), 1, app.unicodePath );
initExplanation: function() { var expl = this.dialogElement( "explanation" ); if ( this.mLauncher.MIMEInfo.preferredAction == Components.interfaces.nsIMIMEInfo.saveToDisk ) { expl.value = this.getString( "explanation.saveToDisk" ); } else { // Default is to "open with system default." var appDesc = this.getString( "explanation.defaultApp" ); if ( this.mLauncher.MIMEInfo.preferredAction != Components.interfaces.nsIMIMEInfo.useSystemDefault ) { // If opening using the app, we prefer to use the app description. appDesc = this.mLauncher.MIMEInfo.applicationDescription; if ( appDesc != "" ) { // Use application description. expl.value= this.replaceInsert( this.getString( "explanation.openUsing" ), 1, appDesc ); } else { // If no description, use the app executable name. var app = this.mLauncher.MIMEInfo.preferredApplicationHandler; if ( app ) { // Use application path. expl.value = this.replaceInsert( this.getString( "explanation.openUsing" ), 1, app.unicodePath ); } } } } },
expl.value = text;
initExplanation: function() { var expl = this.dialogElement( "explanation" ); if ( this.mLauncher.MIMEInfo.preferredAction == Components.interfaces.nsIMIMEInfo.saveToDisk ) { expl.value = this.getString( "explanation.saveToDisk" ); } else { // Default is to "open with system default." var appDesc = this.getString( "explanation.defaultApp" ); if ( this.mLauncher.MIMEInfo.preferredAction != Components.interfaces.nsIMIMEInfo.useSystemDefault ) { // If opening using the app, we prefer to use the app description. appDesc = this.mLauncher.MIMEInfo.applicationDescription; if ( appDesc != "" ) { // Use application description. expl.value= this.replaceInsert( this.getString( "explanation.openUsing" ), 1, appDesc ); } else { // If no description, use the app executable name. var app = this.mLauncher.MIMEInfo.preferredApplicationHandler; if ( app ) { // Use application path. expl.value = this.replaceInsert( this.getString( "explanation.openUsing" ), 1, app.unicodePath ); } } } } },
function initFileInfo(aFI, aURL, aDocument, aContentType)
function initFileInfo(aFI, aURL, aDocument, aContentType, aContentDisposition)
function initFileInfo(aFI, aURL, aDocument, aContentType){ var docCharset = (aDocument ? aDocument.characterSet : null); try { // Get an nsIURI object from aURL if possible: try { aFI.uri = makeURI(aURL, docCharset); // Assuming nsiUri is valid, calling QueryInterface(...) on it will // populate extra object fields (eg filename and file extension). var url = aFI.uri.QueryInterface(Components.interfaces.nsIURL); aFI.fileExt = url.fileExtension; } catch (e) { } // Get the default filename: aFI.fileName = getDefaultFileName((aFI.suggestedFileName || aFI.fileName), aFI.uri, aDocument); // If aFI.fileExt is still blank, consider: aFI.suggestedFileName is supplied // if saveURL(...) was the original caller (hence both aContentType and // aDocument are blank). If they were saving a link to a website then make // the extension .htm . if (!aFI.fileExt && !aDocument && !aContentType && (/^http(s?):\/\//i.test(aURL))) { aFI.fileExt = "htm"; aFI.fileBaseName = aFI.fileName; } else { aFI.fileExt = getDefaultExtension(aFI.fileName, aFI.uri, aContentType); aFI.fileBaseName = getFileBaseName(aFI.fileName, aFI.fileExt); } } catch (e) { }}
aFI.uri, aDocument);
aFI.uri, aDocument, aContentDisposition);
function initFileInfo(aFI, aURL, aDocument, aContentType){ var docCharset = (aDocument ? aDocument.characterSet : null); try { // Get an nsIURI object from aURL if possible: try { aFI.uri = makeURI(aURL, docCharset); // Assuming nsiUri is valid, calling QueryInterface(...) on it will // populate extra object fields (eg filename and file extension). var url = aFI.uri.QueryInterface(Components.interfaces.nsIURL); aFI.fileExt = url.fileExtension; } catch (e) { } // Get the default filename: aFI.fileName = getDefaultFileName((aFI.suggestedFileName || aFI.fileName), aFI.uri, aDocument); // If aFI.fileExt is still blank, consider: aFI.suggestedFileName is supplied // if saveURL(...) was the original caller (hence both aContentType and // aDocument are blank). If they were saving a link to a website then make // the extension .htm . if (!aFI.fileExt && !aDocument && !aContentType && (/^http(s?):\/\//i.test(aURL))) { aFI.fileExt = "htm"; aFI.fileBaseName = aFI.fileName; } else { aFI.fileExt = getDefaultExtension(aFI.fileName, aFI.uri, aContentType); aFI.fileBaseName = getFileBaseName(aFI.fileName, aFI.fileExt); } } catch (e) { }}
if (!aFI.fileExt && !aDocument && !aContentType && (aURL.length > 7) && aURL.substring(0,7).toUpperCase() == "HTTP:
if (!aFI.fileExt && !aDocument && !aContentType && (/^http(s?):\/\
function initFileInfo(aFI, aURL, aDocument, aContentType){ var docCharset = (aDocument ? aDocument.characterSet : null); try { // Get an nsIURI object from aURL if possible: try { aFI.uri = makeURI(aURL, docCharset); // Assuming nsiUri is valid, calling QueryInterface(...) on it will // populate extra object fields (eg filename and file extension). var url = aFI.uri.QueryInterface(Components.interfaces.nsIURL); aFI.fileExt = url.fileExtension; } catch (e) { } // Get the default filename: aFI.fileName = getDefaultFileName((aFI.suggestedFileName || aFI.fileName), aFI.uri, aDocument); // If aFI.fileExt is still blank, consider: aFI.suggestedFileName is supplied // if saveURL(...) was the original caller (hence both aContentType and // aDocument are blank). If they were saving a link to a website then make // the extension .htm . if (!aFI.fileExt && !aDocument && !aContentType && (aURL.length > 7) && aURL.substring(0,7).toUpperCase() == "HTTP://") { aFI.fileExt = "htm"; aFI.fileBaseName = aFI.fileName; } else { aFI.fileExt = getDefaultExtension(aFI.fileName, aFI.uri, aContentType); aFI.fileBaseName = getFileBaseName(aFI.fileName, aFI.fileExt); } } catch (e) { }}
document.getElementById("problem_type").focus();
function initForm() { var strbundle=document.getElementById("strings"); var reportWizard = document.getElementById('reportWizard'); reportWizard.canRewind = false; document.getElementById('url').value = gURL; // Change next button to "submit report" reportWizard.getButton('next').label = strbundle.getString("submitReport"); reportWizard.getButton('next').setAttribute("accesskey", strbundle.getString("submitReport.accesskey")); // Set the privacy policy link href var url = getCharPref("privacyURL", "http://reporter.mozilla.org/privacy/"); var privacyLink = document.getElementById("privacyPolicy"); privacyLink.setAttribute("href", url); // We don't let the user go forward until they fufill certain requirements - see validateform() reportWizard.canAdvance = false;}
reportWizard.getButton('next').label = strbundle.getString("submitReport") + ">";
reportWizard.getButton('next').label = strbundle.getString("submitReport");
function initForm() { var strbundle=document.getElementById("strings"); var reportWizard = document.getElementById('reportWizard'); reportWizard.canRewind = false; document.getElementById('url').value = gURL; // Change next button to "submit report" reportWizard.getButton('next').label = strbundle.getString("submitReport") + ">"; reportWizard.getButton('next').setAttribute("accesskey", strbundle.getString("submitReport.accesskey")); // Set the privacy policy link href var url = getCharPref("privacyURL", "http://reporter.mozilla.org/privacy/"); var privacyLink = document.getElementById("privacyPolicy"); privacyLink.setAttribute("href", url); // We don't let the user go forward until they fufill certain requirements - see validateform() reportWizard.canAdvance = false;}
client.inputPopup = null;
function initHandlers(){ var node; node = document.getElementById("input"); node.addEventListener("keypress", onInputKeyPress, false); node = document.getElementById("multiline-input"); node.addEventListener("keypress", onMultilineInputKeyPress, false); node.active = false; window.onkeypress = onWindowKeyPress;}
new CIRCNetwork ("efnet", [{name: "irc.mcs.net", port: 6667}, {name: "irc.magic.ca", port: 6667}, {name: "irc.freei.net", port: 6667}, {name: "irc.cs.cmu.edu", port: 6667}],
new CIRCNetwork ("efnet", [{name: "irc.mcs.net", port: 6667}, {name: "irc.prison.net", port: 6667}, {name: "irc.freei.net", port: 6667}, {name: "irc.magic.ca", port: 6667}],
function initHost(obj){ client.commands = new CCommandManager(); addCommands (obj.commands); obj.networks = new Object(); obj.eventPump = new CEventPump (200); obj.networks["efnet"] = new CIRCNetwork ("efnet", [{name: "irc.mcs.net", port: 6667}, {name: "irc.magic.ca", port: 6667}, {name: "irc.freei.net", port: 6667}, {name: "irc.cs.cmu.edu", port: 6667}], obj.eventPump); obj.networks["moznet"] = new CIRCNetwork ("moznet", [{name: "irc.mozilla.org", port: 6667}], obj.eventPump); obj.networks["hybridnet"] = new CIRCNetwork ("hybridnet", [{name: "irc.ssc.net", port: 6667}], obj.eventPump); obj.networks["slashnet"] = new CIRCNetwork ("slashnet", [{name: "irc.slashnet.org", port:6667}], obj.eventPump); obj.networks["dalnet"] = new CIRCNetwork ("dalnet", [{name: "irc.dal.net", port:6667}], obj.eventPump); obj.networks["undernet"] = new CIRCNetwork ("undernet", [{name: "irc.undernet.org", port:6667}], obj.eventPump); obj.networks["webbnet"] = new CIRCNetwork ("webbnet", [{name: "irc.webbnet.org", port:6667}], obj.eventPump); obj.primNet = obj.networks["efnet"]; if (DEBUG) /* hook all events EXCEPT server.poll and *.event-end types * (the 4th param inverts the match) */ obj.eventPump.addHook ([{type: "poll", set: /^(server|dcc-chat)$/}, {type: "event-end"}], event_tracer, "event-tracer", true /* negate */, false /* disable */); obj.munger = new CMunger(); obj.munger.enabled = true; obj.munger.addRule ("you-talking-to-me?", matchMyNick, ""); obj.munger.addRule ("link", /((\w+):\/\/[^<>()\'\"\s]+|www(\.[^.<>()\'\"\s]+){2,})/, insertLink); obj.munger.addRule ("face", /((^|\s)[\<\>]?[\;\=\:\8]\~?[\-\^\v]?[\)\|\(pP\<\>oO0\[\]\/\\](\s|$))/, insertSmiley); obj.munger.addRule ("ear", /(\(\*)/, insertEar); obj.munger.addRule ("rheet", /(rhee+t\!*)/i, insertRheet); obj.munger.addRule ("bold", /(\*[^\*]*\*)/, "bold"); obj.munger.addRule ("italic", /[^sS\<](\/[^\/][^\>]*\/)/, "italic"); obj.munger.addRule ("teletype", /(\|[^|]*\|)/, "teletype"); obj.munger.addRule ("underline1", /^(\_[^\_]*\_)/, "underline"); obj.munger.addRule ("underline2", /\W(\_[^\_]*\_)/, "underline"); //obj.munger.addRule ("strikethrough", /(\-.*\-)/, "strikethrough"); obj.munger.addRule ("smallcap", /(\#[^\#]*\#)/, "smallcap"); obj.munger.addRule ("word-hyphenator", new RegExp ("(\\S{" + client.MAX_WORD_DISPLAY + ",})"), insertHyphenatedWord); obj.rdf = new RDFHelper(); obj.rdf.initTree("user-list"); obj.rdf.setTreeRoot("user-list", obj.rdf.resNullChan); }
obj.networks["opennet"] = new CIRCNetwork ("opennet", [{name:"irc.openprojects.net", port:6667}, {name: "eu.opirc.nu", port:6667}, {name: "au.opirc.nu", port:6667}, {name: "us.opirc.nu", port:6667}], obj.eventPump);
function initHost(obj){ client.commands = new CCommandManager(); addCommands (obj.commands); obj.networks = new Object(); obj.eventPump = new CEventPump (200); obj.networks["efnet"] = new CIRCNetwork ("efnet", [{name: "irc.mcs.net", port: 6667}, {name: "irc.magic.ca", port: 6667}, {name: "irc.freei.net", port: 6667}, {name: "irc.cs.cmu.edu", port: 6667}], obj.eventPump); obj.networks["moznet"] = new CIRCNetwork ("moznet", [{name: "irc.mozilla.org", port: 6667}], obj.eventPump); obj.networks["hybridnet"] = new CIRCNetwork ("hybridnet", [{name: "irc.ssc.net", port: 6667}], obj.eventPump); obj.networks["slashnet"] = new CIRCNetwork ("slashnet", [{name: "irc.slashnet.org", port:6667}], obj.eventPump); obj.networks["dalnet"] = new CIRCNetwork ("dalnet", [{name: "irc.dal.net", port:6667}], obj.eventPump); obj.networks["undernet"] = new CIRCNetwork ("undernet", [{name: "irc.undernet.org", port:6667}], obj.eventPump); obj.networks["webbnet"] = new CIRCNetwork ("webbnet", [{name: "irc.webbnet.org", port:6667}], obj.eventPump); obj.primNet = obj.networks["efnet"]; if (DEBUG) /* hook all events EXCEPT server.poll and *.event-end types * (the 4th param inverts the match) */ obj.eventPump.addHook ([{type: "poll", set: /^(server|dcc-chat)$/}, {type: "event-end"}], event_tracer, "event-tracer", true /* negate */, false /* disable */); obj.munger = new CMunger(); obj.munger.enabled = true; obj.munger.addRule ("you-talking-to-me?", matchMyNick, ""); obj.munger.addRule ("link", /((\w+):\/\/[^<>()\'\"\s]+|www(\.[^.<>()\'\"\s]+){2,})/, insertLink); obj.munger.addRule ("face", /((^|\s)[\<\>]?[\;\=\:\8]\~?[\-\^\v]?[\)\|\(pP\<\>oO0\[\]\/\\](\s|$))/, insertSmiley); obj.munger.addRule ("ear", /(\(\*)/, insertEar); obj.munger.addRule ("rheet", /(rhee+t\!*)/i, insertRheet); obj.munger.addRule ("bold", /(\*[^\*]*\*)/, "bold"); obj.munger.addRule ("italic", /[^sS\<](\/[^\/][^\>]*\/)/, "italic"); obj.munger.addRule ("teletype", /(\|[^|]*\|)/, "teletype"); obj.munger.addRule ("underline1", /^(\_[^\_]*\_)/, "underline"); obj.munger.addRule ("underline2", /\W(\_[^\_]*\_)/, "underline"); //obj.munger.addRule ("strikethrough", /(\-.*\-)/, "strikethrough"); obj.munger.addRule ("smallcap", /(\#[^\#]*\#)/, "smallcap"); obj.munger.addRule ("word-hyphenator", new RegExp ("(\\S{" + client.MAX_WORD_DISPLAY + ",})"), insertHyphenatedWord); obj.rdf = new RDFHelper(); obj.rdf.initTree("user-list"); obj.rdf.setTreeRoot("user-list", obj.rdf.resNullChan); }
obj.munger.addRule ("you-talking-to-me?", matchMyNick, "");
function initHost(obj){ client.commands = new CCommandManager(); addCommands (obj.commands); obj.networks = new Object(); obj.eventPump = new CEventPump (200); obj.networks["efnet"] = new CIRCNetwork ("efnet", [{name: "irc.mcs.net", port: 6667}, {name: "irc.magic.ca", port: 6667}, {name: "irc.freei.net", port: 6667}, {name: "irc.cs.cmu.edu", port: 6667}], obj.eventPump); obj.networks["moznet"] = new CIRCNetwork ("moznet", [{name: "irc.mozilla.org", port: 6667}], obj.eventPump); obj.networks["hybridnet"] = new CIRCNetwork ("hybridnet", [{name: "irc.ssc.net", port: 6667}], obj.eventPump); obj.networks["slashnet"] = new CIRCNetwork ("slashnet", [{name: "irc.slashnet.org", port:6667}], obj.eventPump); obj.networks["dalnet"] = new CIRCNetwork ("dalnet", [{name: "irc.dal.net", port:6667}], obj.eventPump); obj.networks["undernet"] = new CIRCNetwork ("undernet", [{name: "irc.undernet.org", port:6667}], obj.eventPump); obj.networks["webbnet"] = new CIRCNetwork ("webbnet", [{name: "irc.webbnet.org", port:6667}], obj.eventPump); obj.primNet = obj.networks["efnet"]; if (DEBUG) /* hook all events EXCEPT server.poll and *.event-end types * (the 4th param inverts the match) */ obj.eventPump.addHook ([{type: "poll", set: /^(server|dcc-chat)$/}, {type: "event-end"}], event_tracer, "event-tracer", true /* negate */, false /* disable */); obj.munger = new CMunger(); obj.munger.enabled = true; obj.munger.addRule ("you-talking-to-me?", matchMyNick, ""); obj.munger.addRule ("link", /((\w+):\/\/[^<>()\'\"\s]+|www(\.[^.<>()\'\"\s]+){2,})/, insertLink); obj.munger.addRule ("face", /((^|\s)[\<\>]?[\;\=\:\8]\~?[\-\^\v]?[\)\|\(pP\<\>oO0\[\]\/\\](\s|$))/, insertSmiley); obj.munger.addRule ("ear", /(\(\*)/, insertEar); obj.munger.addRule ("rheet", /(rhee+t\!*)/i, insertRheet); obj.munger.addRule ("bold", /(\*[^\*]*\*)/, "bold"); obj.munger.addRule ("italic", /[^sS\<](\/[^\/][^\>]*\/)/, "italic"); obj.munger.addRule ("teletype", /(\|[^|]*\|)/, "teletype"); obj.munger.addRule ("underline1", /^(\_[^\_]*\_)/, "underline"); obj.munger.addRule ("underline2", /\W(\_[^\_]*\_)/, "underline"); //obj.munger.addRule ("strikethrough", /(\-.*\-)/, "strikethrough"); obj.munger.addRule ("smallcap", /(\#[^\#]*\#)/, "smallcap"); obj.munger.addRule ("word-hyphenator", new RegExp ("(\\S{" + client.MAX_WORD_DISPLAY + ",})"), insertHyphenatedWord); obj.rdf = new RDFHelper(); obj.rdf.initTree("user-list"); obj.rdf.setTreeRoot("user-list", obj.rdf.resNullChan); }
/((^|\s)[\<\>]?[\;\=\:\8]\~?[\-\^\v]?[\)\|\(pP\<\>oO0\[\]\/\\](\s|$))/,
/((^|\s)[\<\>]?[\;\=\:]\~?[\-\^\v]?[\)\|\(pP\<\>oO0\[\]\/\\](\s|$))/,
function initHost(obj){ client.commands = new CCommandManager(); addCommands (obj.commands); obj.networks = new Object(); obj.eventPump = new CEventPump (200); obj.networks["efnet"] = new CIRCNetwork ("efnet", [{name: "irc.mcs.net", port: 6667}, {name: "irc.magic.ca", port: 6667}, {name: "irc.freei.net", port: 6667}, {name: "irc.cs.cmu.edu", port: 6667}], obj.eventPump); obj.networks["moznet"] = new CIRCNetwork ("moznet", [{name: "irc.mozilla.org", port: 6667}], obj.eventPump); obj.networks["hybridnet"] = new CIRCNetwork ("hybridnet", [{name: "irc.ssc.net", port: 6667}], obj.eventPump); obj.networks["slashnet"] = new CIRCNetwork ("slashnet", [{name: "irc.slashnet.org", port:6667}], obj.eventPump); obj.networks["dalnet"] = new CIRCNetwork ("dalnet", [{name: "irc.dal.net", port:6667}], obj.eventPump); obj.networks["undernet"] = new CIRCNetwork ("undernet", [{name: "irc.undernet.org", port:6667}], obj.eventPump); obj.networks["webbnet"] = new CIRCNetwork ("webbnet", [{name: "irc.webbnet.org", port:6667}], obj.eventPump); obj.primNet = obj.networks["efnet"]; if (DEBUG) /* hook all events EXCEPT server.poll and *.event-end types * (the 4th param inverts the match) */ obj.eventPump.addHook ([{type: "poll", set: /^(server|dcc-chat)$/}, {type: "event-end"}], event_tracer, "event-tracer", true /* negate */, false /* disable */); obj.munger = new CMunger(); obj.munger.enabled = true; obj.munger.addRule ("you-talking-to-me?", matchMyNick, ""); obj.munger.addRule ("link", /((\w+):\/\/[^<>()\'\"\s]+|www(\.[^.<>()\'\"\s]+){2,})/, insertLink); obj.munger.addRule ("face", /((^|\s)[\<\>]?[\;\=\:\8]\~?[\-\^\v]?[\)\|\(pP\<\>oO0\[\]\/\\](\s|$))/, insertSmiley); obj.munger.addRule ("ear", /(\(\*)/, insertEar); obj.munger.addRule ("rheet", /(rhee+t\!*)/i, insertRheet); obj.munger.addRule ("bold", /(\*[^\*]*\*)/, "bold"); obj.munger.addRule ("italic", /[^sS\<](\/[^\/][^\>]*\/)/, "italic"); obj.munger.addRule ("teletype", /(\|[^|]*\|)/, "teletype"); obj.munger.addRule ("underline1", /^(\_[^\_]*\_)/, "underline"); obj.munger.addRule ("underline2", /\W(\_[^\_]*\_)/, "underline"); //obj.munger.addRule ("strikethrough", /(\-.*\-)/, "strikethrough"); obj.munger.addRule ("smallcap", /(\#[^\#]*\#)/, "smallcap"); obj.munger.addRule ("word-hyphenator", new RegExp ("(\\S{" + client.MAX_WORD_DISPLAY + ",})"), insertHyphenatedWord); obj.rdf = new RDFHelper(); obj.rdf.initTree("user-list"); obj.rdf.setTreeRoot("user-list", obj.rdf.resNullChan); }
obj.munger.addRule ("ear", /(\(\*)/, insertEar); obj.munger.addRule ("rheet", /(rhee+t\!*)/i, insertRheet); obj.munger.addRule ("bold", /(\*[^\*]*\*)/, "bold"); obj.munger.addRule ("italic", /[^sS\<](\/[^\/][^\>]*\/)/, "italic"); obj.munger.addRule ("teletype", /(\|[^|]*\|)/, "teletype"); obj.munger.addRule ("underline1", /^(\_[^\_]*\_)/, "underline"); obj.munger.addRule ("underline2", /\W(\_[^\_]*\_)/, "underline"); obj.munger.addRule ("smallcap", /(\#[^\#]*\#)/, "smallcap");
obj.munger.addRule ("ear", /(?:\s|^)(\(\*)(?:\s|$)/, insertEar); obj.munger.addRule ("rheet", /(?:\s|^)(rhee+t\!*)(?:\s|$)/i, insertRheet); obj.munger.addRule ("bold", /(?:\s|^)(\*[^*,.()]*\*)(?:[\s.,]|$)/, "chatzilla-bold"); obj.munger.addRule ("italic", /(?:\s|^)(\/[^\/,.()]*\/)(?:[\s.,]|$)/, "chatzilla-italic"); obj.munger.addRule ("teletype", /(?:\s|^)(\|[^|,.]*\|)(?:[\s.,]|$)/, "chatzilla-teletype"); obj.munger.addRule ("underline", /(?:\s|^)(\_[^_,.()]*\_)(?:[\s.,]|$)/, "chatzilla-underline"); obj.munger.addRule ("smallcap", /(?:\s|^)(\#[^#,.()]*\#)(?:[\s.,]|$)/, "chatzilla-smallcap");
function initHost(obj){ client.commands = new CCommandManager(); addCommands (obj.commands); obj.networks = new Object(); obj.eventPump = new CEventPump (200); obj.networks["efnet"] = new CIRCNetwork ("efnet", [{name: "irc.mcs.net", port: 6667}, {name: "irc.magic.ca", port: 6667}, {name: "irc.freei.net", port: 6667}, {name: "irc.cs.cmu.edu", port: 6667}], obj.eventPump); obj.networks["moznet"] = new CIRCNetwork ("moznet", [{name: "irc.mozilla.org", port: 6667}], obj.eventPump); obj.networks["hybridnet"] = new CIRCNetwork ("hybridnet", [{name: "irc.ssc.net", port: 6667}], obj.eventPump); obj.networks["slashnet"] = new CIRCNetwork ("slashnet", [{name: "irc.slashnet.org", port:6667}], obj.eventPump); obj.networks["dalnet"] = new CIRCNetwork ("dalnet", [{name: "irc.dal.net", port:6667}], obj.eventPump); obj.networks["undernet"] = new CIRCNetwork ("undernet", [{name: "irc.undernet.org", port:6667}], obj.eventPump); obj.networks["webbnet"] = new CIRCNetwork ("webbnet", [{name: "irc.webbnet.org", port:6667}], obj.eventPump); obj.primNet = obj.networks["efnet"]; if (DEBUG) /* hook all events EXCEPT server.poll and *.event-end types * (the 4th param inverts the match) */ obj.eventPump.addHook ([{type: "poll", set: /^(server|dcc-chat)$/}, {type: "event-end"}], event_tracer, "event-tracer", true /* negate */, false /* disable */); obj.munger = new CMunger(); obj.munger.enabled = true; obj.munger.addRule ("you-talking-to-me?", matchMyNick, ""); obj.munger.addRule ("link", /((\w+):\/\/[^<>()\'\"\s]+|www(\.[^.<>()\'\"\s]+){2,})/, insertLink); obj.munger.addRule ("face", /((^|\s)[\<\>]?[\;\=\:\8]\~?[\-\^\v]?[\)\|\(pP\<\>oO0\[\]\/\\](\s|$))/, insertSmiley); obj.munger.addRule ("ear", /(\(\*)/, insertEar); obj.munger.addRule ("rheet", /(rhee+t\!*)/i, insertRheet); obj.munger.addRule ("bold", /(\*[^\*]*\*)/, "bold"); obj.munger.addRule ("italic", /[^sS\<](\/[^\/][^\>]*\/)/, "italic"); obj.munger.addRule ("teletype", /(\|[^|]*\|)/, "teletype"); obj.munger.addRule ("underline1", /^(\_[^\_]*\_)/, "underline"); obj.munger.addRule ("underline2", /\W(\_[^\_]*\_)/, "underline"); //obj.munger.addRule ("strikethrough", /(\-.*\-)/, "strikethrough"); obj.munger.addRule ("smallcap", /(\#[^\#]*\#)/, "smallcap"); obj.munger.addRule ("word-hyphenator", new RegExp ("(\\S{" + client.MAX_WORD_DISPLAY + ",})"), insertHyphenatedWord); obj.rdf = new RDFHelper(); obj.rdf.initTree("user-list"); obj.rdf.setTreeRoot("user-list", obj.rdf.resNullChan); }
var cmd = document.getElementById("cmd:toggleAccessibleNodes"); if (cmd) { if (!("@mozilla.org/accessibilityService;1" in Components.classes)) cmd.setAttribute("disabled", "true"); }
initialize: function(aTarget, aURI) { this.mInitTarget = aTarget; //this.initSearch(); var el = document.getElementById("bxBrowser"); el.addEventListener("pageshow", BrowserPageShowListener, true); this.setBrowser(false, true); //this.setSearch(false, true); this.mClipboardHelper = XPCU.getService(kClipboardHelperCID, "nsIClipboardHelper"); this.mPromptService = XPCU.getService(kPromptServiceCID, "nsIPromptService"); this.mPanelSet = document.getElementById("bxPanelSet"); this.mPanelSet.addObserver("panelsetready", this, false); this.mPanelSet.initialize(); this.mInspectDocumentMenu = document.getElementById("listDocuments-popup"); document.getElementById("cmdToggleChrome").setAttribute("checked", PrefUtils.getPref("inspector.showChrome")); if (aURI) { this.gotoURL(aURI); } },
this.setAccessibleNodes(PrefUtils.getPref("inspector.dom.showAccessibleNodes"), false);
initialize: function(aPane) { //this.initColumns(); this.mPanel = aPane; aPane.notifyViewerReady(this); this.setAnonContent(PrefUtils.getPref("inspector.dom.showAnon"), false); this.setWhitespaceNodes(PrefUtils.getPref("inspector.dom.showWhitespaceNodes")); this.setFlashSelected(PrefUtils.getPref("inspector.blink.on")); },
this.mInspectDocumentMenu = document.getElementById("listDocuments-popup"); document.getElementById("cmdToggleChrome").setAttribute("checked", PrefUtils.getPref("inspector.showChrome"));
initialize: function(aTarget, aURI) { this.mInitTarget = aTarget; //this.initSearch(); var el = document.getElementById("bxBrowser"); el.addEventListener("pageshow", BrowserPageShowListener, true); this.setBrowser(false, true); //this.setSearch(false, true); this.mClipboardHelper = XPCU.getService(kClipboardHelperCID, "nsIClipboardHelper"); this.mPromptService = XPCU.getService(kPromptServiceCID, "nsIPromptService"); this.mPanelSet = document.getElementById("bxPanelSet"); this.mPanelSet.addObserver("panelsetready", this, false); this.mPanelSet.initialize(); this.mInspectDocumentMenu = document.getElementById("listDocuments-popup"); document.getElementById("cmdToggleChrome").setAttribute("checked", PrefUtils.getPref("inspector.showChrome")); if (aURI) { this.gotoURL(aURI); } },
this.mClipboardHelper = XPCU.getService(kClipboardHelperCID, "nsIClipboardHelper");
initialize: function() { this.initPrefs(); this.loadViewerRegistry(); this.loadHistory(); this.initSearch(); var el = document.getElementById("bxBrowser"); el.addEventListener("load", BrowserLoadListener, true); this.toggleBrowser(true, false); this.toggleSearch(true, false); this.setFlashSelected(PrefUtils.getPref("inspector.blink.on")); },
this.mPromptService = XPCU.getService(kPromptServiceCID, "nsIPromptService");
initialize: function(aTarget) { this.mInitTarget = aTarget; //this.initSearch(); var el = document.getElementById("bxBrowser"); el.addEventListener("load", BrowserLoadListener, true); this.setBrowser(false, true); //this.setSearch(false, true); this.mClipboardHelper = XPCU.getService(kClipboardHelperCID, "nsIClipboardHelper"); this.mPanelSet = document.getElementById("bxPanelSet"); this.mPanelSet.addObserver("panelsetready", this, false); this.mPanelSet.initialize(); },
this.mPane = aPane;
this.mPanel = aPane;
initialize: function(aPane) { this.mPane = aPane; aPane.notifyViewerReady(this); },
el.addEventListener("PageShow", BrowserPageShowListener, true);
el.addEventListener("pageshow", BrowserPageShowListener, true);
initialize: function(aTarget, aURI) { this.mInitTarget = aTarget; //this.initSearch(); var el = document.getElementById("bxBrowser"); el.addEventListener("PageShow", BrowserPageShowListener, true); this.setBrowser(false, true); //this.setSearch(false, true); this.mClipboardHelper = XPCU.getService(kClipboardHelperCID, "nsIClipboardHelper"); this.mPromptService = XPCU.getService(kPromptServiceCID, "nsIPromptService"); this.mPanelSet = document.getElementById("bxPanelSet"); this.mPanelSet.addObserver("panelsetready", this, false); this.mPanelSet.initialize(); if (aURI) { this.gotoURL(aURI); } },
var firstTerm = gSearchTermContainer.firstChild;
var firstTerm = gSearchTerms[0];
function initializeBooleanWidgets() { var booleanAnd = true; // get the boolean value from the first term var firstTerm = gSearchTermContainer.firstChild; if (firstTerm) booleanAnd = firstTerm.booleanAnd; // target radio items have data="and" or data="or" targetValue = "or"; if (booleanAnd) targetValue = "and"; targetElement = gSearchBooleanRadiogroup.getElementsByAttribute("data", targetValue)[0]; gSearchBooleanRadiogroup.selectedItem = targetElement;}
for (var i=1; i<gSearchTerms.length; i++) { if (booleanAnd) document.getElementById('boolOp' + i).setAttribute('value', gBooleanAndText); else document.getElementById('boolOp' + i).setAttribute('value', gBooleanOrText); }
function initializeBooleanWidgets() { var booleanAnd = true; // get the boolean value from the first term var firstTerm = gSearchTerms[0].searchTerm; if (firstTerm) booleanAnd = firstTerm.booleanAnd; // target radio items have value="and" or value="or" var targetValue = "or"; if (booleanAnd) targetValue = "and"; var targetElement = gSearchBooleanRadiogroup.getElementsByAttribute("value", targetValue)[0]; gSearchBooleanRadiogroup.selectedItem = targetElement;}
var targetValue = "or"; if (booleanAnd) targetValue = "and";
var targetValue = booleanAnd ? "and" : "or";
function initializeBooleanWidgets() { var booleanAnd = true; // get the boolean value from the first term var firstTerm = gSearchTerms[0].searchTerm; if (firstTerm) booleanAnd = firstTerm.booleanAnd; // target radio items have value="and" or value="or" var targetValue = "or"; if (booleanAnd) targetValue = "and"; var targetElement = gSearchBooleanRadiogroup.getElementsByAttribute("value", targetValue)[0]; gSearchBooleanRadiogroup.selectedItem = targetElement; for (var i=1; i<gSearchTerms.length; i++) { if (booleanAnd) document.getElementById('boolOp' + i).setAttribute('value', gBooleanAndText); else document.getElementById('boolOp' + i).setAttribute('value', gBooleanOrText); }}
if (booleanAnd) document.getElementById('boolOp' + i).setAttribute('value', gBooleanAndText); else document.getElementById('boolOp' + i).setAttribute('value', gBooleanOrText);
document.getElementById('boolOp' + i).setAttribute('value', booleanAnd ? gBooleanAndText : gBooleanOrText);
function initializeBooleanWidgets() { var booleanAnd = true; // get the boolean value from the first term var firstTerm = gSearchTerms[0].searchTerm; if (firstTerm) booleanAnd = firstTerm.booleanAnd; // target radio items have value="and" or value="or" var targetValue = "or"; if (booleanAnd) targetValue = "and"; var targetElement = gSearchBooleanRadiogroup.getElementsByAttribute("value", targetValue)[0]; gSearchBooleanRadiogroup.selectedItem = targetElement; for (var i=1; i<gSearchTerms.length; i++) { if (booleanAnd) document.getElementById('boolOp' + i).setAttribute('value', gBooleanAndText); else document.getElementById('boolOp' + i).setAttribute('value', gBooleanOrText); }}
var numTerms = filter.numTerms;
var searchTerms = filter.searchTerms; var numTerms = searchTerms.Count();
function initializeDialog(filter){ var filterName = document.getElementById("filterName"); filterName.value = filter.filterName; var actionElement = document.getElementById("actionMenu"); actionElement.selectedItem=actionElement.getElementsByAttribute("data", filter.action)[0]; // now test by initializing the psuedo <searchterm> var scope = getScope(filter); var filterRowContainer = document.getElementById("filterTermList"); var numTerms = filter.numTerms; for (var i=0; i<numTerms; i++) { var filterRow = createFilterRow(i); filterRowContainer.appendChild(filterRow); // now that it's been added to the document, we can initialize it. var filterTermObject = document.getElementById("searchTerm" + i); if (filterTermObject) { filterTermObject.searchScope = scope; var searchTerm = filter.searchTerms.QueryElementAt(i, Components.interfaces.nsIMsgSearchTerm); if (searchTerm) filterTermObject.searchTerm = searchTerm; } else { dump("Ack! Can't find searchTerm" + i + "!\n"); } }}
var scope = getScope(filter);
function initializeDialog(filter){ var filterName = document.getElementById("filterName"); filterName.value = filter.filterName; // now test by initializing the psuedo <searchterm> var searchTerm = document.getElementById("searchTerm"); var filterRowContainer = document.getElementById("filterTermList"); var numTerms = filter.numTerms; for (var i=0; i<numTerms; i++) { var filterRow = createFilterRow(filter, i); filterRowContainer.appendChild(filterRow); // now that it's been added to the document, we can initialize it. initializeFilterRow(filter, i); }}
initializeFilterRow(filter, i);
var filterTermObject = document.getElementById("searchTerm" + i); filterTermObject.searchScope = scope; var searchTerm = filter.searchTerms.QueryElementAt(i, Components.interfaces.nsIMsgSearchTerm); if (searchTerm) filterTermObject.searchTerm = searchTerm;
function initializeDialog(filter){ var filterName = document.getElementById("filterName"); filterName.value = filter.filterName; // now test by initializing the psuedo <searchterm> var searchTerm = document.getElementById("searchTerm"); var filterRowContainer = document.getElementById("filterTermList"); var numTerms = filter.numTerms; for (var i=0; i<numTerms; i++) { var filterRow = createFilterRow(filter, i); filterRowContainer.appendChild(filterRow); // now that it's been added to the document, we can initialize it. initializeFilterRow(filter, i); }}
dump("pre-selecting target folder: " + filter.actionTargetFolderUri + "\n");
function initializeDialog(filter){ gFilterNameElement.value = filter.filterName; gActionElement.selectedItem=gActionElement.getElementsByAttribute("data", filter.action)[0]; showActionElementFor(gActionElement.selectedItem); if (filter.action == nsMsgFilterAction.MoveToFolder) { // there are multiple sub-items that have given attribute var targets = gActionTargetElement.getElementsByAttribute("data", filter.actionTargetFolderUri); if (targets && targets.length > 0) { var target = targets[0]; if (target.localName == "menuitem") gActionTargetElement.selectedItem = target; } } else if (filter.action == nsMsgFilterAction.ChangePriority) { dump("initializing priority..\n"); var selectedPriority = gActionPriority.getElementsByAttribute("data", filter.actionPriority); if (selectedPriority && selectedPriority.length > 0) { var selectedPriority = selectedPriority[0]; gActionPriority.selectedItem = selectedPriority; } } var scope = getScope(filter); setSearchScope(scope); initializeSearchRows(scope, filter.searchTerms)}
if (target.localName == "menuitem")
if (target.localName == "menuitem"){
function initializeDialog(filter){ gFilterNameElement.value = filter.filterName; gActionElement.selectedItem=gActionElement.getElementsByAttribute("data", filter.action)[0]; showActionElementFor(gActionElement.selectedItem); if (filter.action == nsMsgFilterAction.MoveToFolder) { dump("pre-selecting target folder: " + filter.actionTargetFolderUri + "\n"); // there are multiple sub-items that have given attribute var targets = gActionTargetElement.getElementsByAttribute("data", filter.actionTargetFolderUri); if (targets && targets.length > 0) { var target = targets[0]; if (target.localName == "menuitem") gActionTargetElement.selectedItem = target; } } else if (filter.action == nsMsgFilterAction.ChangePriority) { dump("initializing priority..\n"); var selectedPriority = gActionPriority.getElementsByAttribute("data", filter.actionPriority); if (selectedPriority && selectedPriority.length > 0) { var selectedPriority = selectedPriority[0]; gActionPriority.selectedItem = selectedPriority; } } var scope = getScope(filter); setSearchScope(scope); initializeSearchRows(scope, filter.searchTerms); if (filter.searchTerms.Count() > 1) gSearchLessButton.removeAttribute("disabled", "false");}
var selectedPriority = gActionPriority.getElementsByAttribute("data", filter.actionPriority);
selectedPriority = gActionPriority.getElementsByAttribute("data", filter.actionPriority);
function initializeDialog(filter){ gFilterNameElement.value = filter.filterName; gActionElement.selectedItem=gActionElement.getElementsByAttribute("data", filter.action)[0]; showActionElementFor(gActionElement.selectedItem); if (filter.action == nsMsgFilterAction.MoveToFolder) { dump("pre-selecting target folder: " + filter.actionTargetFolderUri + "\n"); // there are multiple sub-items that have given attribute var targets = gActionTargetElement.getElementsByAttribute("data", filter.actionTargetFolderUri); if (targets && targets.length > 0) { var target = targets[0]; if (target.localName == "menuitem") gActionTargetElement.selectedItem = target; } } else if (filter.action == nsMsgFilterAction.ChangePriority) { dump("initializing priority..\n"); var selectedPriority = gActionPriority.getElementsByAttribute("data", filter.actionPriority); if (selectedPriority && selectedPriority.length > 0) { var selectedPriority = selectedPriority[0]; gActionPriority.selectedItem = selectedPriority; } } var scope = getScope(filter); setSearchScope(scope); initializeSearchRows(scope, filter.searchTerms); if (filter.searchTerms.Count() > 1) gSearchLessButton.removeAttribute("disabled", "false");}
var selectedPriority = selectedPriority[0];
selectedPriority = selectedPriority[0];
function initializeDialog(filter){ gFilterNameElement.value = filter.filterName; gActionElement.selectedItem=gActionElement.getElementsByAttribute("data", filter.action)[0]; showActionElementFor(gActionElement.selectedItem); if (filter.action == nsMsgFilterAction.MoveToFolder) { dump("pre-selecting target folder: " + filter.actionTargetFolderUri + "\n"); // there are multiple sub-items that have given attribute var targets = gActionTargetElement.getElementsByAttribute("data", filter.actionTargetFolderUri); if (targets && targets.length > 0) { var target = targets[0]; if (target.localName == "menuitem") gActionTargetElement.selectedItem = target; } } else if (filter.action == nsMsgFilterAction.ChangePriority) { dump("initializing priority..\n"); var selectedPriority = gActionPriority.getElementsByAttribute("data", filter.actionPriority); if (selectedPriority && selectedPriority.length > 0) { var selectedPriority = selectedPriority[0]; gActionPriority.selectedItem = selectedPriority; } } var scope = getScope(filter); setSearchScope(scope); initializeSearchRows(scope, filter.searchTerms); if (filter.searchTerms.Count() > 1) gSearchLessButton.removeAttribute("disabled", "false");}
dump("initializing " + searchTerm + "\n");
function initializeDialog(filter){ var filterName = document.getElementById("filterName"); filterName.value = filter.filterName; setScope(getScope(filter)); // now test by initializing the psuedo <searchterm> var searchTerm = document.getElementById("searchTerm"); dump("initializing " + searchTerm + "\n"); var filterRowContainer = document.getElementById("filterListItem"); var numTerms = filter.numTerms; for (var i=0; i<numTerms; i++) { var filterRow = createFilterRow(filter, i); filterRowContainer.appendChild(filterRow); }}
var filterRowContainer = document.getElementById("filterListItem");
var filterRowContainer = document.getElementById("filterTermList");
function initializeDialog(filter){ var filterName = document.getElementById("filterName"); filterName.value = filter.filterName; setScope(getScope(filter)); // now test by initializing the psuedo <searchterm> var searchTerm = document.getElementById("searchTerm"); dump("initializing " + searchTerm + "\n"); var filterRowContainer = document.getElementById("filterListItem"); var numTerms = filter.numTerms; for (var i=0; i<numTerms; i++) { var filterRow = createFilterRow(filter, i); filterRowContainer.appendChild(filterRow); }}
else if (filterAction.type == nsMsgFilterAction.FetchBodyFromPop3Server) gFetchBodyFromServerCheckbox.checked = true;
function initializeDialog(filter){ gFilterNameElement.value = filter.filterName; var actionList = filter.actionList; var numActions = actionList.Count(); for (var actionIndex=0; actionIndex < numActions; actionIndex++) { var filterAction = actionList.QueryElementAt(actionIndex, Components.interfaces.nsIMsgRuleAction); if (filterAction.type == nsMsgFilterAction.MoveToFolder) { // preselect target folder gMoveToFolderCheckbox.checked = true; var target = filterAction.targetFolderUri; if (target) SetFolderPicker(target, gActionTargetElement.id); } else if (filterAction.type == nsMsgFilterAction.ChangePriority) { gChangePriorityCheckbox.checked = true; // initialize priority var selectedPriority = gActionPriority.getElementsByAttribute("value", filterAction.priority).item(0); if (selectedPriority) { gActionPriority.selectedItem = selectedPriority; } } else if (filterAction.type == nsMsgFilterAction.Label) { gLabelCheckbox.checked = true; // initialize label var selectedLabel = gActionLabel.getElementsByAttribute("value", filterAction.label).item(0); if (selectedLabel) { gActionLabel.selectedItem = selectedLabel; } } else if (filterAction.type == nsMsgFilterAction.JunkScore) { gChangeJunkScoreCheckbox.checked = true; // initialize junk score var selectedJunkScore = gActionJunkScore.getElementsByAttribute("value", filterAction.junkScore).item(0); if (selectedJunkScore) { gActionJunkScore.selectedItem = selectedJunkScore; } } else if (filterAction.type == nsMsgFilterAction.MarkRead) gMarkReadCheckbox.checked = true; else if (filterAction.type == nsMsgFilterAction.MarkFlagged) gMarkFlaggedCheckbox.checked = true; else if (filterAction.type == nsMsgFilterAction.Delete) gDeleteCheckbox.checked = true; else if (filterAction.type == nsMsgFilterAction.WatchThread) gWatchCheckbox.checked = true; else if (filterAction.type == nsMsgFilterAction.KillThread) gKillCheckbox.checked = true; else if (filterAction.type == nsMsgFilterAction.DeleteFromPop3Server) gDeleteFromServerCheckbox.checked = true; SetUpFilterActionList(getScope(filter)); } var scope = getScope(filter); setSearchScope(scope); initializeSearchRows(scope, filter.searchTerms); if (filter.searchTerms.Count() > 1) gSearchLessButton.removeAttribute("disabled", "false");}
gFetchBodyFromServerCheckbox = document.getElementById("fetchBodyFromServer");
function initializeFilterWidgets(){ gFilterNameElement = document.getElementById("filterName"); gActionTargetElement = document.getElementById("actionTargetFolder"); gActionValueDeck = document.getElementById("actionValueDeck"); gActionPriority = document.getElementById("actionValuePriority"); gActionJunkScore = document.getElementById("actionValueJunkScore"); gActionLabel = document.getElementById("actionValueLabel"); gMoveToFolderCheckbox = document.getElementById("moveToFolder"); gChangePriorityCheckbox = document.getElementById("changePriority"); gChangeJunkScoreCheckbox = document.getElementById("setJunkScore"); gLabelCheckbox = document.getElementById("label"); gJunkScoreCheckbox = document.getElementById("setJunkScore"); gMarkReadCheckbox = document.getElementById("markRead"); gMarkFlaggedCheckbox = document.getElementById("markFlagged"); gDeleteCheckbox = document.getElementById("delete"); gKillCheckbox = document.getElementById("kill"); gWatchCheckbox = document.getElementById("watch"); gDeleteFromServerCheckbox = document.getElementById("deleteFromServer"); gFilterActionList = document.getElementById("filterActionList");}
gReceiptOptionChanged = false;
function InitializeGlobalVariables(){ gAccountManager = Components.classes["@mozilla.org/messenger/account-manager;1"].getService(Components.interfaces.nsIMsgAccountManager); gIOService = Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService); gPromptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(Components.interfaces.nsIPromptService); //This migrates the LDAPServer Preferences from 4.x to mozilla format. try { gLDAPPrefsService = Components.classes["@mozilla.org/ldapprefs-service;1"].getService(); gLDAPPrefsService = gLDAPPrefsService.QueryInterface( Components.interfaces.nsILDAPPrefsService); } catch (ex) {dump ("ERROR: Cannot get the LDAP service\n" + ex + "\n");} gMsgCompose = null; gWindowLocked = false; gContentChanged = false; gCurrentIdentity = null; defaultSaveOperation = "draft"; gSendOrSaveOperationInProgress = false; gCloseWindowAfterSave = false; gIsOffline = false; gSessionAdded = false; gCurrentAutocompleteDirectory = null; gAutocompleteSession = null; gSetupLdapAutocomplete = false; gLDAPSession = null; gSavedSendNowKey = null; gSendFormat = nsIMsgCompSendFormat.AskUser; gCurrentMailSendCharset = null; gSendDefaultCharset = null; gCharsetTitle = null; gCharsetConvertManager = Components.classes['@mozilla.org/charset-converter-manager;1'].getService(Components.interfaces.nsICharsetConverterManager2); // We are storing the value of the bool logComposePerformance inorder to avoid logging unnecessarily. if (sMsgComposeService) gLogComposePerformance = sMsgComposeService.logComposePerformance; gLastElementToHaveFocus = null; gSuppressCommandUpdating = false;}
gHideMenus = false;
function InitializeGlobalVariables(){ gAccountManager = Components.classes["@mozilla.org/messenger/account-manager;1"].getService(Components.interfaces.nsIMsgAccountManager); gIOService = Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService); gPromptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(Components.interfaces.nsIPromptService); //This migrates the LDAPServer Preferences from 4.x to mozilla format. try { gLDAPPrefsService = Components.classes["@mozilla.org/ldapprefs-service;1"].getService(); gLDAPPrefsService = gLDAPPrefsService.QueryInterface( Components.interfaces.nsILDAPPrefsService); } catch (ex) {dump ("ERROR: Cannot get the LDAP service\n" + ex + "\n");} gMsgCompose = null; gWindowLocked = false; gContentChanged = false; gCurrentIdentity = null; defaultSaveOperation = "draft"; gSendOrSaveOperationInProgress = false; gCloseWindowAfterSave = false; gIsOffline = gIOService.offline; gSessionAdded = false; gCurrentAutocompleteDirectory = null; gAutocompleteSession = null; gSetupLdapAutocomplete = false; gLDAPSession = null; gSavedSendNowKey = null; gSendFormat = nsIMsgCompSendFormat.AskUser; gCurrentMailSendCharset = null; gSendDefaultCharset = null; gCharsetTitle = null; gCharsetConvertManager = Components.classes['@mozilla.org/charset-converter-manager;1'].getService(Components.interfaces.nsICharsetConverterManager2); gMailSession = Components.classes["@mozilla.org/messenger/services/session;1"].getService(Components.interfaces.nsIMsgMailSession); // We are storing the value of the bool logComposePerformance inorder to avoid logging unnecessarily. if (sMsgComposeService) gLogComposePerformance = sMsgComposeService.logComposePerformance; gLastElementToHaveFocus = null; gSuppressCommandUpdating = false; gReceiptOptionChanged = false;}
if (gSearchDateFormat < 1 || gSearchDateFormat > 6) gSearchDateFormat = 3;
function initializeSearchDateFormat(){ if (gSearchDateFormat) return; // get a search date format option and a seprator try { var pref = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); gSearchDateFormat = pref.getComplexValue("mailnews.search_date_format", Components.interfaces.nsIPrefLocalizedString); gSearchDateFormat = parseInt(gSearchDateFormat); if (gSearchDateFormat < 1 || gSearchDateFormat > 6) gSearchDateFormat = 3; gSearchDateSeparator = pref.getComplexValue("mailnews.search_date_separator", Components.interfaces.nsIPrefLocalizedString); } catch (ex) { // set to mm/dd/yyyy in case of error gSearchDateFormat = 3; gSearchDateSeparator = "/"; }}
gSearchDateSeparator = pref.getComplexValue("mailnews.search_date_separator", Components.interfaces.nsIPrefLocalizedString);
if (gSearchDateFormat == 0) getLocaleShortDateFormat(); else { if (gSearchDateFormat < 1 || gSearchDateFormat > 6) gSearchDateFormat = 3; gSearchDateSeparator = pref.getComplexValue("mailnews.search_date_separator", Components.interfaces.nsIPrefLocalizedString); }
function initializeSearchDateFormat(){ if (gSearchDateFormat) return; // get a search date format option and a seprator try { var pref = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); gSearchDateFormat = pref.getComplexValue("mailnews.search_date_format", Components.interfaces.nsIPrefLocalizedString); gSearchDateFormat = parseInt(gSearchDateFormat); if (gSearchDateFormat < 1 || gSearchDateFormat > 6) gSearchDateFormat = 3; gSearchDateSeparator = pref.getComplexValue("mailnews.search_date_separator", Components.interfaces.nsIPrefLocalizedString); } catch (ex) { // set to mm/dd/yyyy in case of error gSearchDateFormat = 3; gSearchDateSeparator = "/"; }}
gSearchTermContainer = document.getElementById("searchterms");
function initializeSearchWidgets() { gSearchBooleanRadiogroup = document.getElementById("booleanAndGroup"); gSearchRowContainer = document.getElementById("searchTermList"); gSearchTermContainer = document.getElementById("searchterms"); gSearchLessButton = document.getElementById("less"); if (!gSearchLessButton) dump("I couldn't find less button!");}
var bundle = document.getElementById('bundle_search'); gBooleanOrText = bundle.getString('orSearchText'); gBooleanAndText = bundle.getString('andSearchText'); gBooleanInitialText = bundle.getString('initialSearchText');
function initializeSearchWidgets() { gSearchBooleanRadiogroup = document.getElementById("booleanAndGroup"); gSearchTermList = document.getElementById("searchTermList"); gSearchLessButton = document.getElementById("less"); if (!gSearchLessButton) dump("I couldn't find less button!");}
msgWindow = Components.classes[msgWindowProgID].createInstance(nsIMsgWindow);
msgWindow = Components.classes[msgWindowContractID].createInstance(nsIMsgWindow);
function initializeSearchWindowWidgets(){ gFolderPicker = document.getElementById("searchableFolders"); gThreadTree = document.getElementById("threadTree"); msgWindow = Components.classes[msgWindowProgID].createInstance(nsIMsgWindow); msgWindow.statusFeedback = gStatusFeedback; msgWindow.SetDOMWindow(window);}
gResultsTree = document.getElementById("threadTree");
gThreadTree = document.getElementById("threadTree");
function initializeSearchWindowWidgets(){ gFolderPicker = document.getElementById("searchableFolders"); gResultsTree = document.getElementById("threadTree"); msgWindow = Components.classes[msgWindowProgID].createInstance(Components.interfaces.nsIMsgWindow); msgWindow.statusFeedback = gStatusFeedback;}
msgWindow = Components.classes[msgWindowProgID].createInstance(Components.interfaces.nsIMsgWindow);
msgWindow = Components.classes[msgWindowProgID].createInstance(nsIMsgWindow);
function initializeSearchWindowWidgets(){ gFolderPicker = document.getElementById("searchableFolders"); gResultsTree = document.getElementById("threadTree"); msgWindow = Components.classes[msgWindowProgID].createInstance(Components.interfaces.nsIMsgWindow); msgWindow.statusFeedback = gStatusFeedback;}
msgWindow.SetDOMWindow(window);
function initializeSearchWindowWidgets(){ gFolderPicker = document.getElementById("searchableFolders"); gResultsTree = document.getElementById("threadTree"); msgWindow = Components.classes[msgWindowProgID].createInstance(Components.interfaces.nsIMsgWindow); msgWindow.statusFeedback = gStatusFeedback;}
var pxIndex = bv.search(/px/); if (pxIndex > 0)
if (/px/.test(bv))
function InitImage(){ // Set the controls to the image's attributes gDialog.srcInput.value = globalElement.getAttribute("src"); // Set "Relativize" checkbox according to current URL state SetRelativeCheckbox(); // Force loading of image from its source and show preview image LoadPreviewImage(); var hasAltText = globalElement.hasAttribute("alt"); if (hasAltText) gDialog.altTextInput.value = globalElement.getAttribute("alt"); if (gInsertNewImage || !hasAltText || (hasAltText && gDialog.altTextInput.value)) { SetAltTextDisabled(false); gDialog.altTextRadioGroup.selectedItem = gDialog.altTextRadio; } else { SetAltTextDisabled(true); gDialog.altTextRadioGroup.selectedItem = gDialog.noAltTextRadio; } // setup the height and width widgets var width = InitPixelOrPercentMenulist(globalElement, gInsertNewImage ? null : imageElement, "width", "widthUnitsMenulist", gPixel); var height = InitPixelOrPercentMenulist(globalElement, gInsertNewImage ? null : imageElement, "height", "heightUnitsMenulist", gPixel); // Set actual radio button if both set values are the same as actual SetSizeWidgets(width, height); gDialog.widthInput.value = gConstrainWidth = width ? width : (gActualWidth ? gActualWidth : ""); gDialog.heightInput.value = gConstrainHeight = height ? height : (gActualHeight ? gActualHeight : ""); // set spacing editfields gDialog.imagelrInput.value = globalElement.getAttribute("hspace"); gDialog.imagetbInput.value = globalElement.getAttribute("vspace"); // dialog.border.value = globalElement.getAttribute("border"); var bv = GetHTMLOrCSSStyleValue(globalElement, "border", "border-top-width"); var pxIndex = bv.search(/px/); if (pxIndex > 0) { // Strip out the px bv = bv.substr(0, pxIndex); } else if (bv == "thin") { bv = "1"; } else if (bv == "medium") { bv = "3"; } else if (bv == "thick") { bv = "5"; } gDialog.border.value = bv; // Get alignment setting var align = globalElement.getAttribute("align"); if (align) align = align.toLowerCase(); var imgClass; var textID; switch ( align ) { case "top": case "middle": case "right": case "left": gDialog.alignTypeSelect.value = align; break; default: // Default or "bottom" gDialog.alignTypeSelect.value = "bottom"; } // Get image map for image gImageMap = GetImageMap(); doOverallEnabling(); doDimensionEnabling();}
bv = bv.substr(0, pxIndex);
bv = RegExp.leftContext;
function InitImage(){ // Set the controls to the image's attributes gDialog.srcInput.value = globalElement.getAttribute("src"); // Set "Relativize" checkbox according to current URL state SetRelativeCheckbox(); // Force loading of image from its source and show preview image LoadPreviewImage(); var hasAltText = globalElement.hasAttribute("alt"); if (hasAltText) gDialog.altTextInput.value = globalElement.getAttribute("alt"); if (gInsertNewImage || !hasAltText || (hasAltText && gDialog.altTextInput.value)) { SetAltTextDisabled(false); gDialog.altTextRadioGroup.selectedItem = gDialog.altTextRadio; } else { SetAltTextDisabled(true); gDialog.altTextRadioGroup.selectedItem = gDialog.noAltTextRadio; } // setup the height and width widgets var width = InitPixelOrPercentMenulist(globalElement, gInsertNewImage ? null : imageElement, "width", "widthUnitsMenulist", gPixel); var height = InitPixelOrPercentMenulist(globalElement, gInsertNewImage ? null : imageElement, "height", "heightUnitsMenulist", gPixel); // Set actual radio button if both set values are the same as actual SetSizeWidgets(width, height); gDialog.widthInput.value = gConstrainWidth = width ? width : (gActualWidth ? gActualWidth : ""); gDialog.heightInput.value = gConstrainHeight = height ? height : (gActualHeight ? gActualHeight : ""); // set spacing editfields gDialog.imagelrInput.value = globalElement.getAttribute("hspace"); gDialog.imagetbInput.value = globalElement.getAttribute("vspace"); // dialog.border.value = globalElement.getAttribute("border"); var bv = GetHTMLOrCSSStyleValue(globalElement, "border", "border-top-width"); var pxIndex = bv.search(/px/); if (pxIndex > 0) { // Strip out the px bv = bv.substr(0, pxIndex); } else if (bv == "thin") { bv = "1"; } else if (bv == "medium") { bv = "3"; } else if (bv == "thick") { bv = "5"; } gDialog.border.value = bv; // Get alignment setting var align = globalElement.getAttribute("align"); if (align) align = align.toLowerCase(); var imgClass; var textID; switch ( align ) { case "top": case "middle": case "right": case "left": gDialog.alignTypeSelect.value = align; break; default: // Default or "bottom" gDialog.alignTypeSelect.value = "bottom"; } // Get image map for image gImageMap = GetImageMap(); doOverallEnabling(); doDimensionEnabling();}
name = document.images[i].name; if (name == 'collapse') {
if (document.images[i].alt == 'switch') {
function initImg(size) { for(var i =0; i < document.images.length; i++) { name = document.images[i].name; if (name == 'collapse') { switchimg = document.images[i]; id = switchimg.id.replace("img_","") boxes[i] = id; part = FetchElement("part_"+id) if(document.cookie && part.style.display != 'none') { hide = GetCookie(id) if(hide != '') { switchimg.src = box_img_plus part.style.display = 'none' } } HandCursor(switchimg) Switch(switchimg) } else if (name = 'resize') { ResizeImg(document.images[i],size); } }}
id = switchimg.id.replace("img_","")
id = switchimg.id.replace("img_","");
function initImg(size) { for(var i =0; i < document.images.length; i++) { name = document.images[i].name; if (name == 'collapse') { switchimg = document.images[i]; id = switchimg.id.replace("img_","") boxes[i] = id; part = FetchElement("part_"+id) if(document.cookie && part.style.display != 'none') { hide = GetCookie(id) if(hide != '') { switchimg.src = box_img_plus part.style.display = 'none' } } HandCursor(switchimg) Switch(switchimg) } else if (name = 'resize') { ResizeImg(document.images[i],size); } }}
part = FetchElement("part_"+id)
part = FetchElement("part_"+id);
function initImg(size) { for(var i =0; i < document.images.length; i++) { name = document.images[i].name; if (name == 'collapse') { switchimg = document.images[i]; id = switchimg.id.replace("img_","") boxes[i] = id; part = FetchElement("part_"+id) if(document.cookie && part.style.display != 'none') { hide = GetCookie(id) if(hide != '') { switchimg.src = box_img_plus part.style.display = 'none' } } HandCursor(switchimg) Switch(switchimg) } else if (name = 'resize') { ResizeImg(document.images[i],size); } }}
hide = GetCookie(id)
hide = GetCookie(id);
function initImg(size) { for(var i =0; i < document.images.length; i++) { name = document.images[i].name; if (name == 'collapse') { switchimg = document.images[i]; id = switchimg.id.replace("img_","") boxes[i] = id; part = FetchElement("part_"+id) if(document.cookie && part.style.display != 'none') { hide = GetCookie(id) if(hide != '') { switchimg.src = box_img_plus part.style.display = 'none' } } HandCursor(switchimg) Switch(switchimg) } else if (name = 'resize') { ResizeImg(document.images[i],size); } }}
switchimg.src = box_img_plus part.style.display = 'none'
switchimg.src = box_img_plus; part.style.display = 'none';
function initImg(size) { for(var i =0; i < document.images.length; i++) { name = document.images[i].name; if (name == 'collapse') { switchimg = document.images[i]; id = switchimg.id.replace("img_","") boxes[i] = id; part = FetchElement("part_"+id) if(document.cookie && part.style.display != 'none') { hide = GetCookie(id) if(hide != '') { switchimg.src = box_img_plus part.style.display = 'none' } } HandCursor(switchimg) Switch(switchimg) } else if (name = 'resize') { ResizeImg(document.images[i],size); } }}
HandCursor(switchimg) Switch(switchimg)
HandCursor(switchimg); Switch(switchimg);
function initImg(size) { for(var i =0; i < document.images.length; i++) { name = document.images[i].name; if (name == 'collapse') { switchimg = document.images[i]; id = switchimg.id.replace("img_","") boxes[i] = id; part = FetchElement("part_"+id) if(document.cookie && part.style.display != 'none') { hide = GetCookie(id) if(hide != '') { switchimg.src = box_img_plus part.style.display = 'none' } } HandCursor(switchimg) Switch(switchimg) } else if (name = 'resize') { ResizeImg(document.images[i],size); } }}
else if (name = 'resize') {
else if (document.images[i].name = 'resize') {
function initImg(size) { for(var i =0; i < document.images.length; i++) { name = document.images[i].name; if (name == 'collapse') { switchimg = document.images[i]; id = switchimg.id.replace("img_","") boxes[i] = id; part = FetchElement("part_"+id) if(document.cookie && part.style.display != 'none') { hide = GetCookie(id) if(hide != '') { switchimg.src = box_img_plus part.style.display = 'none' } } HandCursor(switchimg) Switch(switchimg) } else if (name = 'resize') { ResizeImg(document.images[i],size); } }}
var modified;
initIntro: function() { var intro = this.dialogElement( "intro" ); var desc = this.mLauncher.MIMEInfo.Description; if ( desc != "" ) { // Use intro with descriptive text. modified = this.replaceInsert( this.getString( "intro.withDesc" ), 1, this.mLauncher.MIMEInfo.Description ); } else { // Use intro without descriptive text. modified = this.getString( "intro.noDesc" ); } modified = this.replaceInsert( modified, 2, this.mLauncher.MIMEInfo.MIMEType ); modified = this.replaceInsert( modified, 3, this.mSourcePath ); intro.firstChild.nodeValue = ""; intro.firstChild.nodeValue = modified; },
intro.firstChild.nodeValue = "";
initIntro: function() { var intro = this.dialogElement( "intro" ); var desc = this.mLauncher.MIMEInfo.Description; if ( desc != "" ) { // Use intro with descriptive text. modified = this.replaceInsert( this.getString( "intro.withDesc" ), 1, this.mLauncher.MIMEInfo.Description ); } else { // Use intro without descriptive text. modified = this.getString( "intro.noDesc" ); } modified = this.replaceInsert( modified, 2, this.mLauncher.MIMEInfo.MIMEType ); modified = this.replaceInsert( modified, 3, this.mSourcePath ); intro.firstChild.nodeValue = modified; },
this.mAttachments = Components.classes["@mozilla.org/array;1"]. createInstance(Components.interfaces.nsIArray);
initItemBase: function () { this.mCreationDate = new CalDateTime(); this.mAlarmTime = new CalDateTime(); this.mLastModifiedTime = new CalDateTime(); this.mStampTime = new CalDateTime(); this.mCreationDate.jsDate = new Date(); this.mLastModifiedTime.jsDate = new Date(); this.mStampTime.jsDate = new Date(); this.mProperties = Components.classes["@mozilla.org/hash-property-bag;1"]. createInstance(Components.interfaces.nsIWritablePropertyBag); this.mAttendees = []; this.mRecurrenceInfo = null; this.mAttachments = null; },
this.mAttendees = [];
initItemBase: function () { this.mCreationDate = createCalDateTime(); this.mAlarmTime = createCalDateTime(); this.mProperties = Components.classes["@mozilla.org/hash-property-bag;1"]. createInstance(Components.interfaces.nsIWritablePropertyBag); this.mRecurrenceInfo = null; this.mAttachments = null; this.mContacts = null; },
ClearMenulist(dialog.LanguageMenulist);
function InitLanguageMenu(curLang){ ClearMenulist(dialog.LanguageMenulist); var o1 = {}; var o2 = {}; // Get the list of dictionaries from // the spellchecker. try { spellChecker.GetDictionaryList(o1, o2); } catch(ex) { dump("Failed to get DictionaryList!\n"); return; } var dictList = o1.value; var count = o2.value; // Load the string bundles that will help us map // RFC 1766 strings to UI strings. var languageBundle; var regionBundle; var menuStr; var menuStr2; var isoStrArray; var defaultIndex = 0; // Try to load the language string bundle. try { languageBundle = srGetStrBundle("chrome://global/locale/languageNames.properties"); } catch(ex) { languageBundle = null; } // If we have a language string bundle, try to load the region string bundle. if (languageBundle) { try { regionBundle = srGetStrBundle("chrome://global/locale/regionNames.properties"); } catch(ex) { regionBundle = null; } } for (var i = 0; i < dictList.length; i++) { try { isoStrArray = dictList[i].split("-"); if (languageBundle && isoStrArray[0]) menuStr = languageBundle.GetStringFromName(isoStrArray[0].toLowerCase()); if (regionBundle && menuStr && isoStrArray.length > 1 && isoStrArray[1]) { menuStr2 = regionBundle.GetStringFromName(isoStrArray[1].toLowerCase()); if (menuStr2) menuStr = menuStr + "/" + menuStr2; } if (!menuStr) menuStr = dictList[i]; } catch (ex) { // GetStringFromName throws an exception when // a key is not found in the bundle. In that // case, just use the original dictList string. menuStr = dictList[i]; } if (curLang && dictList[i] == curLang) defaultIndex = i; AppendLabelAndValueToMenulist(dialog.LanguageMenulist, menuStr, dictList[i]); } // Now make sure the correct item in the menu list is selected. if (dictList.length > 0) dialog.LanguageMenulist.selectedIndex = defaultIndex;}
var menuStr;
function InitLanguageMenu(curLang){ ClearMenulist(dialog.LanguageMenulist); var o1 = {}; var o2 = {}; // Get the list of dictionaries from // the spellchecker. try { spellChecker.GetDictionaryList(o1, o2); } catch(ex) { dump("Failed to get DictionaryList!\n"); return; } var dictList = o1.value; var count = o2.value; // Load the string bundles that will help us map // RFC 1766 strings to UI strings. var languageBundle; var regionBundle; var menuStr; var menuStr2; var isoStrArray; var defaultIndex = 0; // Try to load the language string bundle. try { languageBundle = srGetStrBundle("chrome://global/locale/languageNames.properties"); } catch(ex) { languageBundle = null; } // If we have a language string bundle, try to load the region string bundle. if (languageBundle) { try { regionBundle = srGetStrBundle("chrome://global/locale/regionNames.properties"); } catch(ex) { regionBundle = null; } } for (var i = 0; i < dictList.length; i++) { try { isoStrArray = dictList[i].split("-"); if (languageBundle && isoStrArray[0]) menuStr = languageBundle.GetStringFromName(isoStrArray[0].toLowerCase()); if (regionBundle && menuStr && isoStrArray.length > 1 && isoStrArray[1]) { menuStr2 = regionBundle.GetStringFromName(isoStrArray[1].toLowerCase()); if (menuStr2) menuStr = menuStr + "/" + menuStr2; } if (!menuStr) menuStr = dictList[i]; } catch (ex) { // GetStringFromName throws an exception when // a key is not found in the bundle. In that // case, just use the original dictList string. menuStr = dictList[i]; } if (curLang && dictList[i] == curLang) defaultIndex = i; AppendLabelAndValueToMenulist(dialog.LanguageMenulist, menuStr, dictList[i]); } // Now make sure the correct item in the menu list is selected. if (dictList.length > 0) dialog.LanguageMenulist.selectedIndex = defaultIndex;}
menuStr = languageBundle.GetStringFromName(isoStrArray[0].toLowerCase());
dictList[i][0] = languageBundle.GetStringFromName(isoStrArray[0].toLowerCase());
function InitLanguageMenu(curLang){ ClearMenulist(dialog.LanguageMenulist); var o1 = {}; var o2 = {}; // Get the list of dictionaries from // the spellchecker. try { spellChecker.GetDictionaryList(o1, o2); } catch(ex) { dump("Failed to get DictionaryList!\n"); return; } var dictList = o1.value; var count = o2.value; // Load the string bundles that will help us map // RFC 1766 strings to UI strings. var languageBundle; var regionBundle; var menuStr; var menuStr2; var isoStrArray; var defaultIndex = 0; // Try to load the language string bundle. try { languageBundle = srGetStrBundle("chrome://global/locale/languageNames.properties"); } catch(ex) { languageBundle = null; } // If we have a language string bundle, try to load the region string bundle. if (languageBundle) { try { regionBundle = srGetStrBundle("chrome://global/locale/regionNames.properties"); } catch(ex) { regionBundle = null; } } for (var i = 0; i < dictList.length; i++) { try { isoStrArray = dictList[i].split("-"); if (languageBundle && isoStrArray[0]) menuStr = languageBundle.GetStringFromName(isoStrArray[0].toLowerCase()); if (regionBundle && menuStr && isoStrArray.length > 1 && isoStrArray[1]) { menuStr2 = regionBundle.GetStringFromName(isoStrArray[1].toLowerCase()); if (menuStr2) menuStr = menuStr + "/" + menuStr2; } if (!menuStr) menuStr = dictList[i]; } catch (ex) { // GetStringFromName throws an exception when // a key is not found in the bundle. In that // case, just use the original dictList string. menuStr = dictList[i]; } if (curLang && dictList[i] == curLang) defaultIndex = i; AppendLabelAndValueToMenulist(dialog.LanguageMenulist, menuStr, dictList[i]); } // Now make sure the correct item in the menu list is selected. if (dictList.length > 0) dialog.LanguageMenulist.selectedIndex = defaultIndex;}
if (regionBundle && menuStr && isoStrArray.length > 1 && isoStrArray[1])
if (regionBundle && dictList[i][0] && isoStrArray.length > 1 && isoStrArray[1])
function InitLanguageMenu(curLang){ ClearMenulist(dialog.LanguageMenulist); var o1 = {}; var o2 = {}; // Get the list of dictionaries from // the spellchecker. try { spellChecker.GetDictionaryList(o1, o2); } catch(ex) { dump("Failed to get DictionaryList!\n"); return; } var dictList = o1.value; var count = o2.value; // Load the string bundles that will help us map // RFC 1766 strings to UI strings. var languageBundle; var regionBundle; var menuStr; var menuStr2; var isoStrArray; var defaultIndex = 0; // Try to load the language string bundle. try { languageBundle = srGetStrBundle("chrome://global/locale/languageNames.properties"); } catch(ex) { languageBundle = null; } // If we have a language string bundle, try to load the region string bundle. if (languageBundle) { try { regionBundle = srGetStrBundle("chrome://global/locale/regionNames.properties"); } catch(ex) { regionBundle = null; } } for (var i = 0; i < dictList.length; i++) { try { isoStrArray = dictList[i].split("-"); if (languageBundle && isoStrArray[0]) menuStr = languageBundle.GetStringFromName(isoStrArray[0].toLowerCase()); if (regionBundle && menuStr && isoStrArray.length > 1 && isoStrArray[1]) { menuStr2 = regionBundle.GetStringFromName(isoStrArray[1].toLowerCase()); if (menuStr2) menuStr = menuStr + "/" + menuStr2; } if (!menuStr) menuStr = dictList[i]; } catch (ex) { // GetStringFromName throws an exception when // a key is not found in the bundle. In that // case, just use the original dictList string. menuStr = dictList[i]; } if (curLang && dictList[i] == curLang) defaultIndex = i; AppendLabelAndValueToMenulist(dialog.LanguageMenulist, menuStr, dictList[i]); } // Now make sure the correct item in the menu list is selected. if (dictList.length > 0) dialog.LanguageMenulist.selectedIndex = defaultIndex;}
menuStr = menuStr + "/" + menuStr2;
dictList[i][0] = dictList[i][0] + "/" + menuStr2;
function InitLanguageMenu(curLang){ ClearMenulist(dialog.LanguageMenulist); var o1 = {}; var o2 = {}; // Get the list of dictionaries from // the spellchecker. try { spellChecker.GetDictionaryList(o1, o2); } catch(ex) { dump("Failed to get DictionaryList!\n"); return; } var dictList = o1.value; var count = o2.value; // Load the string bundles that will help us map // RFC 1766 strings to UI strings. var languageBundle; var regionBundle; var menuStr; var menuStr2; var isoStrArray; var defaultIndex = 0; // Try to load the language string bundle. try { languageBundle = srGetStrBundle("chrome://global/locale/languageNames.properties"); } catch(ex) { languageBundle = null; } // If we have a language string bundle, try to load the region string bundle. if (languageBundle) { try { regionBundle = srGetStrBundle("chrome://global/locale/regionNames.properties"); } catch(ex) { regionBundle = null; } } for (var i = 0; i < dictList.length; i++) { try { isoStrArray = dictList[i].split("-"); if (languageBundle && isoStrArray[0]) menuStr = languageBundle.GetStringFromName(isoStrArray[0].toLowerCase()); if (regionBundle && menuStr && isoStrArray.length > 1 && isoStrArray[1]) { menuStr2 = regionBundle.GetStringFromName(isoStrArray[1].toLowerCase()); if (menuStr2) menuStr = menuStr + "/" + menuStr2; } if (!menuStr) menuStr = dictList[i]; } catch (ex) { // GetStringFromName throws an exception when // a key is not found in the bundle. In that // case, just use the original dictList string. menuStr = dictList[i]; } if (curLang && dictList[i] == curLang) defaultIndex = i; AppendLabelAndValueToMenulist(dialog.LanguageMenulist, menuStr, dictList[i]); } // Now make sure the correct item in the menu list is selected. if (dictList.length > 0) dialog.LanguageMenulist.selectedIndex = defaultIndex;}
if (!menuStr) menuStr = dictList[i];
if (!dictList[i][0]) dictList[i][0] = dictList[i][1];
function InitLanguageMenu(curLang){ ClearMenulist(dialog.LanguageMenulist); var o1 = {}; var o2 = {}; // Get the list of dictionaries from // the spellchecker. try { spellChecker.GetDictionaryList(o1, o2); } catch(ex) { dump("Failed to get DictionaryList!\n"); return; } var dictList = o1.value; var count = o2.value; // Load the string bundles that will help us map // RFC 1766 strings to UI strings. var languageBundle; var regionBundle; var menuStr; var menuStr2; var isoStrArray; var defaultIndex = 0; // Try to load the language string bundle. try { languageBundle = srGetStrBundle("chrome://global/locale/languageNames.properties"); } catch(ex) { languageBundle = null; } // If we have a language string bundle, try to load the region string bundle. if (languageBundle) { try { regionBundle = srGetStrBundle("chrome://global/locale/regionNames.properties"); } catch(ex) { regionBundle = null; } } for (var i = 0; i < dictList.length; i++) { try { isoStrArray = dictList[i].split("-"); if (languageBundle && isoStrArray[0]) menuStr = languageBundle.GetStringFromName(isoStrArray[0].toLowerCase()); if (regionBundle && menuStr && isoStrArray.length > 1 && isoStrArray[1]) { menuStr2 = regionBundle.GetStringFromName(isoStrArray[1].toLowerCase()); if (menuStr2) menuStr = menuStr + "/" + menuStr2; } if (!menuStr) menuStr = dictList[i]; } catch (ex) { // GetStringFromName throws an exception when // a key is not found in the bundle. In that // case, just use the original dictList string. menuStr = dictList[i]; } if (curLang && dictList[i] == curLang) defaultIndex = i; AppendLabelAndValueToMenulist(dialog.LanguageMenulist, menuStr, dictList[i]); } // Now make sure the correct item in the menu list is selected. if (dictList.length > 0) dialog.LanguageMenulist.selectedIndex = defaultIndex;}
menuStr = dictList[i];
dictList[i][0] = dictList[i][1];
function InitLanguageMenu(curLang){ ClearMenulist(dialog.LanguageMenulist); var o1 = {}; var o2 = {}; // Get the list of dictionaries from // the spellchecker. try { spellChecker.GetDictionaryList(o1, o2); } catch(ex) { dump("Failed to get DictionaryList!\n"); return; } var dictList = o1.value; var count = o2.value; // Load the string bundles that will help us map // RFC 1766 strings to UI strings. var languageBundle; var regionBundle; var menuStr; var menuStr2; var isoStrArray; var defaultIndex = 0; // Try to load the language string bundle. try { languageBundle = srGetStrBundle("chrome://global/locale/languageNames.properties"); } catch(ex) { languageBundle = null; } // If we have a language string bundle, try to load the region string bundle. if (languageBundle) { try { regionBundle = srGetStrBundle("chrome://global/locale/regionNames.properties"); } catch(ex) { regionBundle = null; } } for (var i = 0; i < dictList.length; i++) { try { isoStrArray = dictList[i].split("-"); if (languageBundle && isoStrArray[0]) menuStr = languageBundle.GetStringFromName(isoStrArray[0].toLowerCase()); if (regionBundle && menuStr && isoStrArray.length > 1 && isoStrArray[1]) { menuStr2 = regionBundle.GetStringFromName(isoStrArray[1].toLowerCase()); if (menuStr2) menuStr = menuStr + "/" + menuStr2; } if (!menuStr) menuStr = dictList[i]; } catch (ex) { // GetStringFromName throws an exception when // a key is not found in the bundle. In that // case, just use the original dictList string. menuStr = dictList[i]; } if (curLang && dictList[i] == curLang) defaultIndex = i; AppendLabelAndValueToMenulist(dialog.LanguageMenulist, menuStr, dictList[i]); } // Now make sure the correct item in the menu list is selected. if (dictList.length > 0) dialog.LanguageMenulist.selectedIndex = defaultIndex;}
if (curLang && dictList[i] == curLang) defaultIndex = i; AppendLabelAndValueToMenulist(dialog.LanguageMenulist, menuStr, dictList[i]);
for (var i = 0; i < dictList.length; i++) { AppendLabelAndValueToMenulist(dialog.LanguageMenulist, dictList[i][0], dictList[i][1]); if (curLang && dictList[i][1] == curLang) defaultIndex = i+2;
function InitLanguageMenu(curLang){ ClearMenulist(dialog.LanguageMenulist); var o1 = {}; var o2 = {}; // Get the list of dictionaries from // the spellchecker. try { spellChecker.GetDictionaryList(o1, o2); } catch(ex) { dump("Failed to get DictionaryList!\n"); return; } var dictList = o1.value; var count = o2.value; // Load the string bundles that will help us map // RFC 1766 strings to UI strings. var languageBundle; var regionBundle; var menuStr; var menuStr2; var isoStrArray; var defaultIndex = 0; // Try to load the language string bundle. try { languageBundle = srGetStrBundle("chrome://global/locale/languageNames.properties"); } catch(ex) { languageBundle = null; } // If we have a language string bundle, try to load the region string bundle. if (languageBundle) { try { regionBundle = srGetStrBundle("chrome://global/locale/regionNames.properties"); } catch(ex) { regionBundle = null; } } for (var i = 0; i < dictList.length; i++) { try { isoStrArray = dictList[i].split("-"); if (languageBundle && isoStrArray[0]) menuStr = languageBundle.GetStringFromName(isoStrArray[0].toLowerCase()); if (regionBundle && menuStr && isoStrArray.length > 1 && isoStrArray[1]) { menuStr2 = regionBundle.GetStringFromName(isoStrArray[1].toLowerCase()); if (menuStr2) menuStr = menuStr + "/" + menuStr2; } if (!menuStr) menuStr = dictList[i]; } catch (ex) { // GetStringFromName throws an exception when // a key is not found in the bundle. In that // case, just use the original dictList string. menuStr = dictList[i]; } if (curLang && dictList[i] == curLang) defaultIndex = i; AppendLabelAndValueToMenulist(dialog.LanguageMenulist, menuStr, dictList[i]); } // Now make sure the correct item in the menu list is selected. if (dictList.length > 0) dialog.LanguageMenulist.selectedIndex = defaultIndex;}
var languageBundle;
var languageBundle = document.getElementById("languageBundle");
function InitLanguageMenu(curLang){ var o1 = {}; var o2 = {}; // Get the list of dictionaries from // the spellchecker. try { gSpellChecker.GetDictionaryList(o1, o2); } catch(ex) { dump("Failed to get DictionaryList!\n"); return; } var dictList = o1.value; var count = o2.value; // Load the string bundles that will help us map // RFC 1766 strings to UI strings. var languageBundle; var regionBundle; var menuStr2; var isoStrArray; var defaultIndex = 0; var langId; // Try to load the language string bundle. try { languageBundle = srGetStrBundle("chrome://global/locale/languageNames.properties"); } catch(ex) { languageBundle = null; } // If we have a language string bundle, try to load the region string bundle. if (languageBundle) { try { regionBundle = srGetStrBundle("chrome://global/locale/regionNames.properties"); } catch(ex) { regionBundle = null; } } var i; for (i = 0; i < dictList.length; i++) { try { langId = dictList[i]; isoStrArray = dictList[i].split("-"); dictList[i] = new Array(2); // first subarray element - pretty name dictList[i][1] = langId; // second subarray element - language ID if (languageBundle && isoStrArray[0]) dictList[i][0] = languageBundle.GetStringFromName(isoStrArray[0].toLowerCase()); if (regionBundle && dictList[i][0] && isoStrArray.length > 1 && isoStrArray[1]) { menuStr2 = regionBundle.GetStringFromName(isoStrArray[1].toLowerCase()); if (menuStr2) dictList[i][0] = dictList[i][0] + "/" + menuStr2; } if (!dictList[i][0]) dictList[i][0] = dictList[i][1]; } catch (ex) { // GetStringFromName throws an exception when // a key is not found in the bundle. In that // case, just use the original dictList string. dictList[i][0] = dictList[i][1]; } } // note this is not locale-aware collation, just simple ASCII-based sorting // we really need to add loacel-aware JS collation, see bug XXXXX dictList.sort(); for (i = 0; i < dictList.length; i++) { AppendLabelAndValueToMenulist(gDialog.LanguageMenulist, dictList[i][0], dictList[i][1]); if (curLang && dictList[i][1] == curLang) defaultIndex = i+2; //first two items are pre-populated and fixed } // Now make sure the correct item in the menu list is selected. if (dictList.length > 0) gDialog.LanguageMenulist.selectedIndex = defaultIndex;}