diff --git a/mozilla/editor/ui/dialogs/content/EdAECSSAttributes.js b/mozilla/editor/ui/dialogs/content/EdAECSSAttributes.js index 374392c00bb..433c38307bb 100644 --- a/mozilla/editor/ui/dialogs/content/EdAECSSAttributes.js +++ b/mozilla/editor/ui/dialogs/content/EdAECSSAttributes.js @@ -82,7 +82,7 @@ function ClearCSSInputWidgets() gDialog.AddCSSAttributeTree.clearSelection(); gDialog.AddCSSAttributeNameInput.value =""; gDialog.AddCSSAttributeValueInput.value = ""; - gDialog.AddCSSAttributeNameInput.inputField.focus(); + SetTextboxFocus(gDialog.AddCSSAttributeNameInput); } function onSelectCSSTreeItem() diff --git a/mozilla/editor/ui/dialogs/content/EdAEHTMLAttributes.js b/mozilla/editor/ui/dialogs/content/EdAEHTMLAttributes.js index 5ebf457e824..8527e4d2081 100644 --- a/mozilla/editor/ui/dialogs/content/EdAEHTMLAttributes.js +++ b/mozilla/editor/ui/dialogs/content/EdAEHTMLAttributes.js @@ -104,9 +104,6 @@ function BuildHTMLAttributeNameList() } } } - - // Always start with empty input fields - ClearHTMLInputWidgets(); } // build attribute list in tree form from element attributes @@ -156,7 +153,7 @@ function ClearHTMLInputWidgets() gDialog.AddHTMLAttributeTree.clearSelection(); gDialog.AddHTMLAttributeNameInput.value =""; gDialog.AddHTMLAttributeValueInput.value = ""; - gDialog.AddHTMLAttributeNameInput.inputField.focus(); + SetTextboxFocus(gDialog.AddHTMLAttributeNameInput); } function onSelectHTMLTreeItem() diff --git a/mozilla/editor/ui/dialogs/content/EdAEJSEAttributes.js b/mozilla/editor/ui/dialogs/content/EdAEJSEAttributes.js index 3297aeb7511..ba963e0c589 100644 --- a/mozilla/editor/ui/dialogs/content/EdAEJSEAttributes.js +++ b/mozilla/editor/ui/dialogs/content/EdAEJSEAttributes.js @@ -81,8 +81,6 @@ function BuildJSEAttributeNameList() // Use current name and value of first tree item if it exists onSelectJSETreeItem(); - - gDialog.AddJSEAttributeNameList.focus(); } // build attribute list in tree form from element attributes diff --git a/mozilla/editor/ui/dialogs/content/EdAdvancedEdit.js b/mozilla/editor/ui/dialogs/content/EdAdvancedEdit.js index 5e7266639c4..c56db0becd8 100644 --- a/mozilla/editor/ui/dialogs/content/EdAdvancedEdit.js +++ b/mozilla/editor/ui/dialogs/content/EdAdvancedEdit.js @@ -93,12 +93,11 @@ function Startup() // Build attribute name arrays for menulists BuildJSEAttributeNameList(); - - // No menulists for CSS panel (yet), so just clear input fields - ClearCSSInputWidgets(); - - // Do this last -- sets focus to HTML Name menulist BuildHTMLAttributeNameList(); + // No menulists for CSS panel (yet) + + // Set focus to Name editable menulist in HTML panel + SetTextboxFocus(gDialog.AddHTMLAttributeNameInput); // size the dialog properly window.sizeToContent(); diff --git a/mozilla/editor/ui/dialogs/content/EdColorProps.js b/mozilla/editor/ui/dialogs/content/EdColorProps.js index 4ba71b363d1..6508ed0bf7b 100644 --- a/mozilla/editor/ui/dialogs/content/EdColorProps.js +++ b/mozilla/editor/ui/dialogs/content/EdColorProps.js @@ -34,7 +34,7 @@ var BodyElement; var prefs; -var backgroundImage; +var gBackgroundImage; // Initialize in case we can't get them from prefs??? const defaultTextColor="#000000"; @@ -116,17 +116,14 @@ function Startup() function InitDialog() { // Get image from document - backgroundImage = GetHTMLOrCSSStyleValue(globalElement, backgroundStr, cssBackgroundImageStr); - var innerURL = backgroundImage.match( /url\((.*)\)/ ) ; - if (innerURL) - { - backgroundImage = RegExp.$1; - } - if (backgroundImage) - { - gDialog.BackgroundImageInput.value = backgroundImage; - gDialog.ColorPreview.setAttribute(styleStr, backImageStyle+backgroundImage+");"); - } + 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(); @@ -254,8 +251,8 @@ function SetColorPreview(ColorWellID, color) case "backgroundCW": // Must combine background color and image style values var styleValue = backColorStyle+color; - if (backgroundImage) - styleValue += ";"+backImageStyle+backgroundImage+");"; + if (gBackgroundImage) + styleValue += ";"+backImageStyle+gBackgroundImage+");"; gDialog.ColorPreview.setAttribute(styleStr,styleValue); previewBGColor = color; @@ -352,13 +349,13 @@ function ValidateAndPreviewImage(ShowErrorMessage) var image = TrimString(gDialog.BackgroundImageInput.value); if (image) { - backgroundImage = image; + gBackgroundImage = image; // Display must use absolute URL if possible var displayImage = gHaveDocumentUrl ? MakeAbsoluteUrl(image) : image; styleValue += backImageStyle+displayImage+");"; } - else backgroundImage = null; + else gBackgroundImage = null; // Set style on preview (removes image if not valid) gDialog.ColorPreview.setAttribute(styleStr, styleValue); @@ -403,8 +400,8 @@ function ValidateData() if (ValidateAndPreviewImage(true)) { // A valid image may be null for no image - if (backgroundImage) - globalElement.setAttribute(backgroundStr, backgroundImage); + if (gBackgroundImage) + globalElement.setAttribute(backgroundStr, gBackgroundImage); else globalElement.removeAttribute(backgroundStr);