home *** CD-ROM | disk | FTP | other *** search
/ Online Praxis 1998 March / Image.iso / CD-ROM / NETSCAPE / CCK / INSTBLDR.Z / asw.jar / servers.js < prev    next >
Encoding:
Text File  |  1998-02-27  |  7.9 KB  |  226 lines

  1. <!--  to hide script contents from old browsers
  2.  
  3.  
  4.  
  5. function go()
  6. {
  7.     if (parent.parent.globals.document.vars.editMode.value == "yes")
  8.         return true;
  9.     else
  10.         return(checkData());
  11. }
  12.  
  13.  
  14.  
  15. function checkData()
  16. {
  17.     return(true);
  18. }
  19.  
  20.  
  21.  
  22. function updateMailProtocols(theObject)
  23. {
  24.     var popServer="";
  25.     var imapServer="";
  26.  
  27.     netscape.security.PrivilegeManager.enablePrivilege("AccountSetup");
  28.     
  29.     var providerFilename = parent.parent.globals.document.vars.providerFilename.value;
  30.     if (providerFilename != "")    {
  31.         popServer = parent.parent.globals.document.setupPlugin.GetNameValuePair(providerFilename, "Services", "POP_Server");
  32.         imapServer = parent.parent.globals.document.setupPlugin.GetNameValuePair(providerFilename, "Services", "IMAP_Server");
  33.         }
  34.  
  35.     if (theObject.name == "IMAP")    {
  36.         document.forms[0].POP.checked = false;
  37.         document.forms[0].IMAP.checked = true;
  38.         if (document.forms[0].Mail_Server.value == popServer || document.forms[0].Mail_Server.value == "")    {
  39.             document.forms[0].Mail_Server.value = imapServer;
  40.             }
  41.         }
  42.     else    {
  43.         document.forms[0].POP.checked = true;
  44.         document.forms[0].IMAP.checked = false;
  45.         if (document.forms[0].Mail_Server.value == imapServer || document.forms[0].Mail_Server.value == "")    {
  46.             document.forms[0].Mail_Server.value = popServer;
  47.             }
  48.         }
  49. }
  50.  
  51.  
  52.  
  53. function loadData()
  54. {
  55.     netscape.security.PrivilegeManager.enablePrivilege("AccountSetup");
  56.  
  57.     // make sure all data objects/element exists and valid; otherwise, reload.  SUCKS!
  58.     if (((document.forms[0].SMTP == "undefined") || (document.forms[0].SMTP == "[object InputArray]")) ||
  59.         ((document.forms[0].Mail_Server == "undefined") || (document.forms[0].Mail_Server == "[object InputArray]")) ||
  60.         ((document.forms[0].IMAP == "undefined") || (document.forms[0].IMAP == "[object InputArray]")) ||
  61.         ((document.forms[0].NNTP == "undefined") || (document.forms[0].NNTP == "[object InputArray]")) ||
  62.         ((document.forms[0].POP == "undefined") || (document.forms[0].POP == "[object InputArray]")))
  63.     {
  64.         parent.controls.reloadDocument();
  65.         return;
  66.     }
  67.  
  68.     document.forms[0].SMTP.value = parent.parent.globals.document.vars.SMTP.value;
  69.     document.forms[0].Mail_Server.value = parent.parent.globals.document.vars.mailServer.value;
  70.  
  71.     var providerFilename = parent.parent.globals.document.vars.providerFilename.value;
  72.  
  73.     var mailProtocol = parent.parent.globals.document.vars.mailProtocol.value;
  74.     mailProtocol = mailProtocol.toUpperCase();
  75.     if (mailProtocol == "IMAP")    {
  76.         document.forms[0].POP.checked = false;
  77.         document.forms[0].IMAP.checked = true;
  78.  
  79.         if (providerFilename != "" && document.forms[0].Mail_Server.value == "")    {
  80.             document.forms[0].Mail_Server.value = parent.parent.globals.document.setupPlugin.GetNameValuePair(providerFilename, "Services", "IMAP_Server");
  81.             }
  82.  
  83.         }
  84.     else    {
  85.         document.forms[0].POP.checked = true;
  86.         document.forms[0].IMAP.checked = false;
  87.  
  88.         if (providerFilename != "" && document.forms[0].Mail_Server.value == "")    {
  89.             document.forms[0].Mail_Server.value = parent.parent.globals.document.setupPlugin.GetNameValuePair(providerFilename, "Services", "POP_Server");
  90.             }
  91.  
  92.         }
  93.  
  94.     document.forms[0].NNTP.value = parent.parent.globals.document.vars.NNTP.value;
  95.     parent.parent.globals.setFocus(document.forms[0].SMTP);
  96.  
  97. /*
  98.     var theFile = parent.parent.globals.getAcctSetupFilename(self);
  99.  
  100.     var theData = parent.parent.globals.document.setupPlugin.GetNameValuePair(theFile, "Existing Acct Mode", "AskIMAP");
  101.     if (theData != null)    {
  102.         theData = theData.toLowerCase();
  103.         if (theData == "yes")    {
  104.  
  105.             // make sure all data objects/element exists and valid; otherwise, reload.  SUCKS!
  106.             if ((document.forms[0].IMAP == "undefined") || (document.forms[0].IMAP == "[object InputArray]")) {
  107.                 parent.controls.reloadDocument();
  108.                 return;
  109.                 }
  110.  
  111.             document.forms[0].IMAP.value = parent.parent.globals.document.vars.IMAP.value;
  112.             }
  113.         }
  114.     theData = parent.parent.globals.document.setupPlugin.GetNameValuePair(theFile, "Existing Acct Mode", "AskLDAP");
  115.     if (theData != null)    {
  116.         theData = theData.toLowerCase();
  117.         if (theData == "yes")    {
  118.             // make sure all data objects/element exists and valid; otherwise, reload.  SUCKS!
  119.             if ((document.forms[0].LDAP == "undefined") || (document.forms[0].LDAP == "[object InputArray]")) {
  120.                 parent.controls.reloadDocument();
  121.                 return;
  122.                 }
  123.             document.forms[0].LDAP.value = parent.parent.globals.document.vars.LDAP.value;
  124.             }
  125.         }
  126. */
  127.     if (parent.controls.generateControls)    parent.controls.generateControls();
  128. }
  129.  
  130.  
  131.  
  132. function saveData()
  133. {
  134.     netscape.security.PrivilegeManager.enablePrivilege("AccountSetup");
  135.  
  136.     // make sure all form element are valid objects, otherwise just skip & return!
  137.     if (((document.forms[0].SMTP == "undefined") || (document.forms[0].SMTP == "[object InputArray]")) ||
  138.         ((document.forms[0].Mail_Server == "undefined") || (document.forms[0].Mail_Server == "[object InputArray]")) ||
  139.         ((document.forms[0].IMAP == "undefined") || (document.forms[0].IMAP == "[object InputArray]")) ||
  140.         ((document.forms[0].NNTP == "undefined") || (document.forms[0].NNTP == "[object InputArray]")) ||
  141.         ((document.forms[0].POP == "undefined") || (document.forms[0].POP == "[object InputArray]")))
  142.     {
  143.         parent.controls.reloadDocument();
  144.         return;
  145.     }
  146.  
  147.     parent.parent.globals.document.vars.SMTP.value = document.forms[0].SMTP.value;
  148. //    parent.parent.globals.document.vars.POP.value = document.forms[0].POP.value;
  149.     parent.parent.globals.document.vars.NNTP.value = document.forms[0].NNTP.value;
  150.  
  151.     if (document.forms[0].IMAP.checked == true)    {
  152.         parent.parent.globals.document.vars.mailProtocol.value = document.forms[0].IMAP.value;
  153.         }
  154.     else    {
  155.         parent.parent.globals.document.vars.mailProtocol.value = document.forms[0].POP.value;
  156.         }
  157.     parent.parent.globals.document.vars.mailServer.value = document.forms[0].Mail_Server.value;
  158.  
  159. /*
  160.     var theFile = parent.parent.globals.getAcctSetupFilename(self);
  161.     var theData;
  162.  
  163.     theData = parent.parent.globals.document.setupPlugin.GetNameValuePair(theFile, "Existing Acct Mode", "AskIMAP");
  164.     if (theData != null)    {
  165.         theData = theData.toLowerCase();
  166.         if (theData == "yes")    {
  167.             parent.parent.globals.document.vars.IMAP.value=document.forms[0].IMAP.value;
  168.             }
  169.         }
  170.     theData = parent.parent.globals.document.setupPlugin.GetNameValuePair(theFile, "Existing Acct Mode", "AskLDAP");
  171.     if (theData != null)    {
  172.         theData = theData.toLowerCase();
  173.         if (theData == "yes")    {
  174.             parent.parent.globals.document.vars.LDAP.value=document.forms[0].LDAP.value;
  175.             }
  176.         }
  177. */
  178. }
  179.  
  180.  
  181.  
  182. /*
  183. function IMAPOptions()
  184. {
  185.     netscape.security.PrivilegeManager.enablePrivilege("AccountSetup");
  186.  
  187.     var theFile = parent.parent.globals.getAcctSetupFilename(self);
  188.  
  189.     var theData = parent.parent.globals.document.setupPlugin.GetNameValuePair(theFile, "Existing Acct Mode", "AskIMAP");
  190.     if (theData != null)    {
  191.         theData = theData.toLowerCase();
  192.         if (theData == "yes")    {
  193.             document.writeln("<TR><TD COLSPAN='3'><spacer type=vertical size=0></TD></TR>");
  194.             document.writeln("<TR><TD VALIGN='BOTTOM' ALIGN='RIGHT'>");
  195.             document.writeln("<FONT FACE='Humnst777 LT,Helvetica,Arial' POINT-SIZE='10' COLOR='#000000'><B>");
  196.             document.writeln("IMAP Mail Server:");
  197.             document.writeln("</B><spacer type=vertical size=2></FONT></TD><TD ALIGN='LEFT' VALIGN='BOTTOM'>");
  198.             document.writeln("<INPUT NAME='IMAP' TYPE='text' SIZE=32 MAXLENGTH=40></TD><TD></TD></TR>");
  199.  
  200.             }
  201.         }
  202. }
  203.  
  204.  
  205.  
  206. function LDAPOptions()
  207. {
  208.     netscape.security.PrivilegeManager.enablePrivilege("AccountSetup");
  209.  
  210.     var theFile = parent.parent.globals.getAcctSetupFilename(self);
  211.  
  212.     var theData = parent.parent.globals.document.setupPlugin.GetNameValuePair(theFile, "Existing Acct Mode", "AskLDAP");
  213.     if (theData != null)    {
  214.         theData = theData.toLowerCase();
  215.         if (theData == "yes")    {
  216.             document.writeln("<TD ALIGN=right>LDAP server(s):</TD>");
  217.             document.writeln("<TD><TEXTAREA ROWS=3 COLS=40 NAME='LDAP' TYPE='text'></TEXTAREA></TD>");
  218.             }
  219.         }
  220. }
  221. */
  222.  
  223.  
  224.  
  225. // end hiding contents from old browsers  -->
  226.