home *** CD-ROM | disk | FTP | other *** search
/ GameStar 2004 May / Gamestar_62_2004-05_dvd.iso / Programy / openoffice / f_0051 / defaults / pref / initpref.js < prev    next >
Text File  |  2003-07-13  |  3KB  |  95 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
  4. // License Version 1.1 (the "License"); you may not use this file
  5. // except in compliance with the License. You may obtain a copy of
  6. // the License at http://www.mozilla.org/NPL/
  7. //
  8. // Software distributed under the License is distributed on an "AS
  9. // IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
  10. // implied. See the License for the specific language governing
  11. // rights and limitations under the License.
  12. //
  13. // The Original Code is mozilla.org code.
  14. //
  15. // The Initial Developer of the Original Code is Netscape
  16. // Communications Corporation.  Portions created by Netscape are
  17. // Copyright (C) 1998 Netscape Communications Corporation. All
  18. // Rights Reserved.
  19. //
  20. // Contributor(s): 
  21.  
  22. // Style note 3/3:
  23. // internal objects & functions are in under_score form.
  24. // public functions are in interCaps.
  25.  
  26. // Remove this -- but called in winpref.js :
  27. // platform.windows = true;
  28. function plat() {
  29.     this.windows=false;
  30.     this.mac=false;
  31.     this.unix=false;
  32. };
  33.  
  34. platform = new plat();
  35.  
  36. // --- Preference initialization functions ---
  37. //
  38. //    Moved to native functions:
  39. //    pref        -> pref_NativeDefaultPref
  40. //    defaultPref -> ""
  41. //    userPref    -> pref_NativeUserPref
  42. //    lockPref    -> pref_NativeLockPref
  43. //    unlockPref  -> pref_NativeUnlockPref
  44. //    getPref     -> pref_NativeGetPref
  45. //    config      -> pref_NativeDefaultPref   (?)
  46.  
  47. // stubs for compatibility
  48. var default_pref = defaultPref;
  49. var userPref = user_pref;
  50.  
  51. function mime_type(root, mimetype, extension, load_action, appname, appsig, filetype)
  52. {
  53.     // changed for prefbert
  54.     pref(root + ".mimetype", mimetype);
  55.     pref(root + ".extension", extension);
  56.     pref(root + ".load_action", load_action);
  57.     pref(root + ".mac_appname", appname);
  58.     pref(root + ".mac_appsig", appsig);
  59.     pref(root + ".mac_filetype", filetype);
  60.     pref(root + ".description", "");
  61.     pref(root + ".latent_plug_in", false);
  62. }
  63.  
  64. // LDAP
  65. // Searches for "key=value" in the given string and returns value.
  66. function getLDAPValue(str, key)
  67. {
  68.     if (str == null || key == null)
  69.         return null;
  70.  
  71.     var search_key = "\n" + key + "=";
  72.  
  73.     var start_pos = str.indexOf(search_key);
  74.     if (start_pos == -1)
  75.         return null;
  76.  
  77.     start_pos += search_key.length;
  78.  
  79.     var end_pos = str.indexOf("\n", start_pos);
  80.     if (end_pos == -1)
  81.         end_pos = str.length;
  82.  
  83.     return str.substring(start_pos, end_pos);
  84. }
  85.  
  86. function begin_mime_def()
  87. {
  88. }
  89.  
  90. function end_mime_def()
  91. {
  92.    var now = new Date();
  93.    pref("mime.types.all_defined", now.toString());
  94. }
  95.