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 / icqAuthorization.js < prev    next >
Encoding:
Text File  |  2005-07-29  |  4.8 KB  |  163 lines

  1. var processedauth=false;
  2. function onIcqSendMsg()
  3. {
  4.   var user=document.getElementById('icqnumber').getAttribute("value");
  5.   aimIMInvokeIMForm(user);
  6. }
  7.  
  8. function onIcqDecline()
  9. {
  10.   var user=document.getElementById('icqnumber').getAttribute("value");
  11.   var auth_msg=document.getElementById('authMsg').value;
  12.   aimFeedbagManager().RejectAuthorization(user,auth_msg)
  13.   top.window.close();
  14. }
  15.  
  16. function onIcqAuthorize()
  17. {
  18.   var user=document.getElementById('icqnumber').getAttribute("value");
  19.   aimFeedbagManager().AcceptAuthorization(user);
  20.   top.window.close();
  21. }
  22.  
  23. function onIcqRequestAuth()
  24. {
  25.   // Close the request window and open a new window with authorization sent notice
  26.   var user=document.getElementById('icqnumber').getAttribute("value");
  27.   var auth_msg=document.getElementById('reason').value;
  28.   try {
  29.     aimFeedbagManager().SendAuthorizationRequest(user,auth_msg);
  30.   } catch (e) {
  31.     //alert(e);
  32.   } 
  33.   if (document.getElementById('preauth').checked)
  34.     aimFeedbagManager().SendPreAuthorizationGrant(user,auth_msg);
  35.   processedauth=true;
  36.   top.window.close();
  37.  
  38.   window.open("chrome://aim/content/icqAuthSent.xul", "", "chrome,titlebar,dialog,modal");
  39. }
  40.  
  41. function onIcqCancel()
  42. {
  43.   top.window.close();
  44. }
  45.  
  46. function onIcqCancelAuth()
  47. {
  48.   // User chose not to send an authorization request after all. Remove the added buddy in this case.
  49.   var user=document.getElementById('icqnumber').getAttribute("value");
  50.   aimBuddyManager().RemoveBuddyAll(user);
  51.   aimFeedbagManager().ClearAuthorization(user);
  52.   top.window.close();
  53. }
  54.  
  55. function OnUnloadAuthMsg()
  56. {
  57.   if (processedauth == false)
  58.     onIcqCancelAuth(); 
  59. }
  60.  
  61.  
  62. function OnLoadAuthRequest()
  63. {
  64.   
  65.   var icqnumber=document.getElementById('icqnumber');
  66.   if (icqnumber) {
  67.     icqnumber.setAttribute("value",window.arguments[0]);
  68.     icqnumber.setAttribute("disabled","true");
  69.     }
  70.   var auth_msg=document.getElementById('authMsg');
  71.   if (auth_msg && window.arguments[1]) {
  72.     auth_msg.value = window.arguments[1];
  73.     }
  74.   
  75.   //var nickname=document.getElementById('nickname');
  76.   //nickname.setAttribute("value",getNickName(icqnumber));
  77.   //nickname.setAttribute("disabled","true");
  78.   //var email=document.getElementById('email');
  79.   //email.setAttribute("value",getEmail(icqnumber));
  80.  // email.setAttribute("disabled","true");
  81.   
  82. }
  83.  
  84. function OnLoadAuthMsg()
  85. {
  86.   //Get user values - as user obj from one of parameters to window.open?
  87.   var icqnumber=document.getElementById('icqnumber');
  88.   if (icqnumber) {
  89.     icqnumber.setAttribute("value",window.arguments[0]);
  90.     icqnumber.setAttribute("disabled","true");
  91.     }
  92.   
  93.   var isinlist = new Object();
  94.   aimFeedbagManager().IsInAuthList(window.arguments[0], isinlist);
  95.   if (isinlist.value == true) {
  96.       // this is during rerequest at this point , so authrequest has already been processes
  97.       processedauth=true;
  98.   }
  99.  
  100.   //var disp_name=document.getElementById('displayname');
  101.   //disp_name.setAttribute("value",--);
  102.   //var email=document.getElementById('email');
  103.   //email.setAttribute("value",--);
  104.   //email.setAttribute("disabled","true");
  105.   var msg=document.getElementById('reason');
  106.   if (msg) {
  107.     var reason_msg=msg.getAttribute("value");
  108.     //reason_msg=reason_msg+cur_user_data;
  109.     msg.value=reason_msg;
  110.     }
  111.   if (window.arguments[1]) {
  112.      var auth=document.getElementById('authlabel');
  113.      auth.value=window.arguments[1];
  114.      }
  115. }
  116.  
  117.  
  118. function OnLoadAuthReject()
  119. {
  120.   
  121.   var icqnumber=document.getElementById('icqnumber');
  122.   if (icqnumber) {
  123.     icqnumber.setAttribute("value",window.arguments[0]);
  124.     icqnumber.setAttribute("disabled","true");
  125.     }
  126.   var msg=document.getElementById('declineMsg');
  127.     var decline_msg=msg.getAttribute("value");
  128.   if (window.arguments[1]) 
  129.     msg.value=decline_msg+"\n"+window.arguments[1];
  130.   else
  131.        msg.value=decline_msg;
  132.   //var nickname=document.getElementById('nickname');
  133.   //nickname.setAttribute("value",getNickName(icqnumber));
  134.   //nickname.setAttribute("disabled","true");
  135.   //var email=document.getElementById('email');
  136.   //email.setAttribute("value",getEmail(icqnumber));
  137.   //email.setAttribute("disabled","true");
  138.   
  139. }       
  140.  
  141. function OnLoadAuthAccept()
  142. {
  143.   
  144.   var icqnumber=document.getElementById('icqnumber');
  145.   if (icqnumber) {
  146.     icqnumber.setAttribute("value",window.arguments[0]);
  147.     icqnumber.setAttribute("disabled","true");
  148.     }
  149.   var msg=document.getElementById('acceptMsg');
  150.   if (msg) {
  151.     var accept_msg=msg.getAttribute("value");
  152.     msg.value=accept_msg;
  153.     }
  154.   
  155.  
  156.   //var nickname=document.getElementById('nickname');
  157.   //nickname.setAttribute("value",getNickName(icqnumber));
  158.   //nickname.setAttribute("disabled","true");
  159.   //var email=document.getElementById('email');
  160.   //email.setAttribute("value",getEmail(icqnumber));
  161.   //email.setAttribute("disabled","true");
  162.   
  163. }