home *** CD-ROM | disk | FTP | other *** search
/ Your Business Pak / BusinessPak2.iso / Netscape / CD / as.z / asw.jar / publish.js < prev    next >
Text File  |  1998-10-15  |  3KB  |  80 lines

  1. /* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil -*-
  2.  *
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  *
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  *
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18. <!--  to hide script contents from old browsers
  19.  
  20.  
  21.  
  22. function go(msg)
  23. {
  24.     if (parent.parent.globals.document.vars.editMode.value == "yes")
  25.         return true;
  26.     else
  27.         return(checkData());
  28. }
  29.  
  30.  
  31.  
  32. function checkData()
  33. {
  34.     return(true);
  35. }
  36.  
  37.  
  38.  
  39. function loadData()
  40. {
  41.  
  42.     // make sure all data objects/element exists and valid; otherwise, reload.  SUCKS!
  43.     if (((document.forms[0].publishURL == "undefined") || (document.forms[0].publishURL == "[object InputArray]")) ||
  44.         ((document.forms[0].publishPassword == "undefined") || (document.forms[0].publishPassword == "[object InputArray]")) ||
  45.         ((document.forms[0].viewURL == "undefined") || (document.forms[0].viewURL == "[object InputArray]")))
  46.     {
  47.         parent.controls.reloadDocument();
  48.         return;
  49.     }
  50.  
  51.     document.forms[0].publishURL.value = parent.parent.globals.document.vars.publishURL.value;
  52.     document.forms[0].publishPassword.value = parent.parent.globals.document.vars.publishPassword.value;
  53.     document.forms[0].viewURL.value = parent.parent.globals.document.vars.viewURL.value;
  54.     parent.parent.globals.setFocus(document.forms[0].publishURL);
  55.     if (parent.controls.generateControls)   parent.controls.generateControls();
  56. }
  57.  
  58.  
  59.  
  60. function saveData()
  61. {
  62.     // make sure all form element are valid objects, otherwise just skip & return!
  63.     if (((document.forms[0].publishURL == "undefined") || (document.forms[0].publishURL == "[object InputArray]")) ||
  64.         ((document.forms[0].publishPassword == "undefined") || (document.forms[0].publishPassword == "[object InputArray]")) ||
  65.         ((document.forms[0].viewURL == "undefined") || (document.forms[0].viewURL == "[object InputArray]")))
  66.     {
  67.         parent.controls.reloadDocument();
  68.         return(true);
  69.     }
  70.  
  71.     parent.parent.globals.document.vars.publishURL.value = document.forms[0].publishURL.value;
  72.     parent.parent.globals.document.vars.publishPassword.value = document.forms[0].publishPassword.value;
  73.     parent.parent.globals.document.vars.viewURL.value = document.forms[0].viewURL.value;
  74.     return(true);
  75. }
  76.  
  77.  
  78.  
  79. // end hiding contents from old browsers  -->
  80.