home *** CD-ROM | disk | FTP | other *** search
/ GameStar 2005 October / Gamestar_77_2005-10_dvd.iso / Programy / nsb-install-8-0.exe / chrome / aim.jar / content / aim / pref-IM_notification.js < prev    next >
Encoding:
Text File  |  2005-07-29  |  4.8 KB  |  106 lines

  1. function Startup()
  2. {
  3.   checkAll();
  4. }
  5.  
  6. function checkAll()
  7. {
  8.   var IMPlayAll = document.getElementById("IMPlayAll");
  9.   var playSoundSignon = document.getElementById("playSoundSignon");
  10.   var sndPlaySignOff = document.getElementById("sndPlaySignOff");
  11.   var sndPlayFirstIncoming = document.getElementById("sndPlayFirstIncoming");
  12.   var sndPlayIncoming = document.getElementById("sndPlayIncoming");
  13.   var sndPlayOutgoing = document.getElementById("sndPlayOutgoing");
  14.   var sndChat = document.getElementById("sndChat");
  15.   var rcvChat = document.getElementById("rcvChat");
  16.  
  17.   if(IMPlayAll.checked)
  18.   {
  19.     playSoundSignon.removeAttribute("disabled");
  20.     sndPlaySignOff.removeAttribute("disabled");
  21.     sndPlayFirstIncoming.removeAttribute("disabled");
  22.     sndPlayIncoming.removeAttribute("disabled");
  23.     sndPlayOutgoing.removeAttribute("disabled");
  24.     sndChat.removeAttribute("disabled");
  25.     rcvChat.removeAttribute("disabled");
  26.  
  27.     //buttons
  28.     document.getElementById("tbSound").setAttribute("disabled","false");
  29.     document.getElementById("btnsndPlaySignOff").setAttribute("disabled","false");
  30.     document.getElementById("btnsndPlayFirstIncoming").setAttribute("disabled","false");
  31.     document.getElementById("btnsndPlayIncoming").setAttribute("disabled","false");
  32.     document.getElementById("btnsndPlayOutgoing").setAttribute("disabled","false");
  33.     document.getElementById("btnsndChat").setAttribute("disabled","false");
  34.     document.getElementById("btnrcvChat").setAttribute("disabled","false");
  35.  
  36.     //browse buttons
  37.     document.getElementById("SndSignOnChooseFile").setAttribute("disabled","false");
  38.     document.getElementById("SndSignOffChooseFile").setAttribute("disabled","false");
  39.     document.getElementById("SndFirstIncomingChooseFile").setAttribute("disabled","false");
  40.     document.getElementById("SndIncomingChooseFile").setAttribute("disabled","false");
  41.     document.getElementById("SndOutgoingChooseFile").setAttribute("disabled","false");
  42.     document.getElementById("SndChatOutgoingChooseFile").setAttribute("disabled","false");
  43.     document.getElementById("SndChatIncomingChooseFile").setAttribute("disabled","false");
  44.   }
  45.   else
  46.   {
  47.     playSoundSignon.setAttribute("disabled", "true");
  48.     sndPlaySignOff.setAttribute("disabled", "true");
  49.     sndPlayFirstIncoming.setAttribute("disabled", "true");
  50.     sndPlayIncoming.setAttribute("disabled", "true");
  51.     sndPlayOutgoing.setAttribute("disabled", "true");
  52.     sndChat.setAttribute("disabled", "true");
  53.     rcvChat.setAttribute("disabled", "true");
  54.  
  55.     //buttons
  56.     document.getElementById("tbSound").setAttribute("disabled","true");
  57.     document.getElementById("btnsndPlaySignOff").setAttribute("disabled","true");
  58.     document.getElementById("btnsndPlayFirstIncoming").setAttribute("disabled","true");
  59.     document.getElementById("btnsndPlayIncoming").setAttribute("disabled","true");
  60.     document.getElementById("btnsndPlayOutgoing").setAttribute("disabled","true");
  61.     document.getElementById("btnsndChat").setAttribute("disabled","true");
  62.     document.getElementById("btnrcvChat").setAttribute("disabled","true");
  63.  
  64.     //browse buttons
  65.     document.getElementById("SndSignOnChooseFile").setAttribute("disabled","true");
  66.     document.getElementById("SndSignOffChooseFile").setAttribute("disabled","true");
  67.     document.getElementById("SndFirstIncomingChooseFile").setAttribute("disabled","true");
  68.     document.getElementById("SndIncomingChooseFile").setAttribute("disabled","true");
  69.     document.getElementById("SndOutgoingChooseFile").setAttribute("disabled","true");
  70.     document.getElementById("SndChatOutgoingChooseFile").setAttribute("disabled","true");
  71.     document.getElementById("SndChatIncomingChooseFile").setAttribute("disabled","true");
  72.   }
  73. }
  74.  
  75.  
  76. /*
  77.  * Function: selectFile(pref)
  78.  *
  79.  * Arguments: prefs.
  80.  * 
  81.  * Return: none
  82.  *
  83.  * Description: Called when Browse is clicked in Pref Notification Pabel.
  84.  *   Opens the filepicker window and sets the pref.
  85.  *
  86.  * Author: Suresh Kasinathan<suresh@netscape.com> 12/10/01
  87.  *              
  88. */
  89.  
  90. function selectFile(prefs) {
  91.   var fp = Components.classes["@mozilla.org/filepicker;1"].createInstance(Components.interfaces.nsIFilePicker);
  92.   if (!fp) {
  93.     dump("Unable to create file picker...\n");
  94.     return;
  95.   }
  96.   fp.init(window, aimString("cn.title"),  Components.interfaces.nsIFilePicker.modeOpen);
  97.   fp.appendFilter(aimString("cn.filetypes"), "*.wav");
  98.   var ret = fp.show();
  99.   if (ret == Components.interfaces.nsIFilePicker.returnOK && fp.fileURL.spec) {
  100.     var fileurl = fp.fileURL.spec;
  101.     // we need to write immediately to pref on OK. The 'normal' prefs are written to prefs.js
  102.     // only on OK'ing the pref window. This is a special case.
  103.     aimPrefsManager().SetCharPref(prefs, fileurl, null, false);
  104.   }
  105.  
  106. }