home *** CD-ROM | disk | FTP | other *** search
/ Your Business Pak / BusinessPak2.iso / Netscape / CD / comm.z / resdll.dll / RCDATA / INIT_PREFS < prev    next >
Text File  |  1998-10-20  |  3KB  |  96 lines

  1. /* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  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.  
  19. // Style note 3/3:
  20. // internal objects & functions are in under_score form.
  21. // public functions are in interCaps.
  22.  
  23. // Remove this -- but called in winpref.js :
  24. // platform.windows = true;
  25. function plat() {
  26.     this.windows=false;
  27.     this.mac=false;
  28.     this.unix=false;
  29. };
  30. platform = new plat();
  31.  
  32. /* --- Preference initialization functions ---
  33.  
  34.     Moved to native functions:
  35.     pref        -> pref_NativeDefaultPref
  36.     defaultPref -> "
  37.     userPref    -> pref_NativeUserPref
  38.     lockPref    -> pref_NativeLockPref
  39.     unlockPref    -> pref_NativeUnlockPref
  40.     getPref        -> pref_NativeGetPref
  41.     config        -> pref_NativeDefaultPref    (?)
  42. */
  43.  
  44. // stubs for compatability
  45. var default_pref = defaultPref;
  46. var lock_pref = lockPref;
  47. var unlock_pref = unlockPref;
  48. var userPref = user_pref;
  49.  
  50. // -------------------------
  51.  
  52. function mime_type(root, mimetype, extension, load_action, appname, appsig, filetype)
  53. {
  54.     // changed for prefbert
  55.     pref(root + ".mimetype", mimetype);
  56.     pref(root + ".extension", extension);
  57.     pref(root + ".load_action", load_action);
  58.     pref(root + ".mac_appname", appname);
  59.     pref(root + ".mac_appsig", appsig);
  60.     pref(root + ".mac_filetype", filetype);
  61.     pref(root + ".description", "");
  62.     pref(root + ".latent_plug_in", false);
  63. }
  64.  
  65. // LDAP
  66. // Searches for "key=value" in the given string and returns value.
  67. function getLDAPValue(str, key)
  68. {
  69.     if (str == null || key == null)
  70.         return null;
  71.         
  72.     var search_key = "\n" + key + "=";
  73.  
  74.     var start_pos = str.indexOf(search_key);
  75.     if (start_pos == -1)
  76.         return null;
  77.         
  78.     start_pos += search_key.length;
  79.         
  80.     var end_pos = str.indexOf("\n", start_pos);
  81.     if (end_pos == -1)
  82.         end_pos = str.length;
  83.     
  84.     return str.substring(start_pos, end_pos);
  85. }
  86.  
  87. function begin_mime_def()
  88. {
  89. }
  90.  
  91. function end_mime_def()
  92. {
  93.    var now = new Date();
  94.    pref("mime.types.all_defined", now.toString());
  95. }