diff --git a/suite/common/pref/pref-colors.xul b/suite/common/pref/pref-colors.xul index 5d7ec7c9bc8d..8b40b0f69dd3 100644 --- a/suite/common/pref/pref-colors.xul +++ b/suite/common/pref/pref-colors.xul @@ -31,20 +31,6 @@ - - function setColorWell(menu) - { - // Find the colorWell and colorPicker in the hierarchy. - var colorWell = menu.firstChild.nextSibling; - var colorPicker = menu.firstChild.nextSibling.nextSibling.firstChild; - - // Extract color from colorPicker and assign to colorWell. - var color = colorPicker.getAttribute('color'); - colorWell.style.backgroundColor = color; - } - - - @@ -62,9 +48,9 @@ - + - + @@ -72,9 +58,9 @@ - + - + @@ -94,18 +80,18 @@ - + - + - + - + diff --git a/xpfe/components/prefwindow/resources/content/pref-colors.xul b/xpfe/components/prefwindow/resources/content/pref-colors.xul index 5d7ec7c9bc8d..8b40b0f69dd3 100644 --- a/xpfe/components/prefwindow/resources/content/pref-colors.xul +++ b/xpfe/components/prefwindow/resources/content/pref-colors.xul @@ -31,20 +31,6 @@ - - function setColorWell(menu) - { - // Find the colorWell and colorPicker in the hierarchy. - var colorWell = menu.firstChild.nextSibling; - var colorPicker = menu.firstChild.nextSibling.nextSibling.firstChild; - - // Extract color from colorPicker and assign to colorWell. - var color = colorPicker.getAttribute('color'); - colorWell.style.backgroundColor = color; - } - - - @@ -62,9 +48,9 @@ - + - + @@ -72,9 +58,9 @@ - + - + @@ -94,18 +80,18 @@ - + - + - + - + diff --git a/xpfe/components/prefwindow/resources/content/pref-composer.xul b/xpfe/components/prefwindow/resources/content/pref-composer.xul index 11afeb5184ce..1a8a3ee6b697 100644 --- a/xpfe/components/prefwindow/resources/content/pref-composer.xul +++ b/xpfe/components/prefwindow/resources/content/pref-composer.xul @@ -28,24 +28,32 @@ + onload="StartUp('Composer'); return InitColors();" align="vertical" title="&title.label;"> - - function setColorWell(menu) - { - // Find the colorWell and colorPicker in the hierarchy. - var colorWell = menu.firstChild.nextSibling; - var colorPicker = menu.firstChild.nextSibling.nextSibling.firstChild; + - // Extract color from colorPicker and assign to colorWell. - var color = colorPicker.getAttribute('color'); - colorWell.style.backgroundColor = color; - } +function getColorFromWellAndSetValue(menuid,otherId,setbackground) +{ + var menu=document.getElementById(menuid); + var colorWell = menu.firstChild.nextSibling; + var color=colorWell.style.backgroundColor; + setColorFromPicker(null,color,otherId,setbackground); +} + +function InitColors() +{ + getColorFromWellAndSetValue('normaltextmenu','normaltext',false); + getColorFromWellAndSetValue('linktextmenu','linktext',false); + getColorFromWellAndSetValue('activelinktextmenu','activelinktext',false); + getColorFromWellAndSetValue('followedlinktextmenu','followedlinktext',false); + getColorFromWellAndSetValue('colorpreviewmenu','colorpreview',true); + + return true; +} - @@ -118,46 +126,43 @@ - - + - - - - - + + + + + - - + - - - + + + - + - - + - - - + + + - + @@ -165,32 +170,30 @@ - - + - - - + + + - + - - + &colorPick; &BackgroundColor.label; - - - + + + - + @@ -198,11 +201,11 @@ - - &NormalText.label; - &LinkText.label; - &ActiveLinkText.label; - &FollowedLinkText.label; + + &NormalText.label; + &LinkText.label; + &ActiveLinkText.label; + &FollowedLinkText.label;