home *** CD-ROM | disk | FTP | other *** search
/ ftp.swcp.com / ftp.swcp.com.zip / ftp.swcp.com / mac / mozilla-macos9-1.3.1.sea.bin / Mozilla1.3.1 / Chrome / comm.jar / content / communicator / pref / pref-colors.js < prev    next >
Text File  |  2003-06-08  |  1KB  |  41 lines

  1. function setColorWell(aPicker)
  2. {
  3.   var colorRef = aPicker.nextSibling;                // colour value is held here
  4.   colorRef.setAttribute( "value", aPicker.color );
  5. }
  6.  
  7.   function setColorWellSr(menu,otherId,setbackground)
  8.   {
  9.     // Find the colorWell and colorPicker in the hierarchy.
  10.     var colorWell = menu.firstChild;
  11.     var colorPicker = menu.firstChild.nextSibling.nextSibling.firstChild;
  12.     var colorRef = menu.nextSibling;                // colour value is held here
  13.   
  14.     // Extract color from colorPicker and assign to colorWell.
  15.     var color = colorPicker.getAttribute('color');
  16.     // set colour values in the display 
  17.     setColorFromPicker( colorWell, color );
  18.     // set the colour value internally for use in prefwindow
  19.     colorRef.setAttribute( "value", color );
  20.   }
  21.  
  22.   function getColorFromWellAndSetValue(aPickerId)
  23.   {
  24.     var picker = document.getElementById(aPickerId);
  25.     var colorRef  = picker.nextSibling;
  26.     var color = colorRef.getAttribute("value");
  27.     picker.color = color;
  28.     return color;
  29.   }     
  30.  
  31.   function Startup()
  32.   {
  33.     getColorFromWellAndSetValue("foregroundtextmenu");
  34.     getColorFromWellAndSetValue("backgroundmenu");
  35.     getColorFromWellAndSetValue("unvisitedlinkmenu");
  36.     getColorFromWellAndSetValue("visitedlinkmenu");
  37.  
  38.     return true;
  39.   }                   
  40.   
  41.