home *** CD-ROM | disk | FTP | other *** search
/ ftp.swcp.com / ftp.swcp.com.zip / ftp.swcp.com / mac / mozilla-macos9-1.3.1.sea.bin / Mozilla1.3.1 / Chrome / comm.jar / content / communicator / bookmarks / pref-bookmarks.xul < prev   
Extensible Markup Language  |  2003-06-08  |  5KB  |  117 lines

  1. <?xml version="1.0"?> 
  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 Communicator client code, released
  14.    March 31, 1998.
  15.    
  16.    The Initial Developer of the Original Code is Netscape
  17.    Communications Corporation. Portions created by Netscape are
  18.    Copyright (C) 1998-1999 Netscape Communications Corporation. All
  19.    Rights Reserved.
  20.    
  21.    Contributor(s): 
  22.   -->
  23. <?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
  24.  
  25. <!DOCTYPE page [
  26. <!ENTITY % brandDTD SYSTEM "chrome://global/locale/brand.dtd" >
  27. %brandDTD;
  28. <!ENTITY % prefBookmarkDTD SYSTEM "chrome://communicator/locale/bookmarks/pref-bookmarks.dtd">
  29. %prefBookmarkDTD;
  30. ]>
  31.  
  32. <page xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
  33.       onload="parent.initPanel('chrome://communicator/content/bookmarks/pref-bookmarks.xul');"
  34.       headertitle="&lHeader;">
  35.  
  36.   <script type="application/x-javascript">
  37.   <![CDATA[
  38.     var _elementIDs = ["enableAutoFile", "showExtendedData"];
  39.  
  40.     var gCreateInFolder = "NC:NewBookmarkFolder";
  41.     function Startup ()
  42.     {
  43.       const kDisplay = document.getElementById("defaultFolder");
  44.       const kRDFSvcContractID = "@mozilla.org/rdf/rdf-service;1";
  45.       const kRDFSvcIID = Components.interfaces.nsIRDFService;
  46.       const kRDFSvc = Components.classes[kRDFSvcContractID].getService(kRDFSvcIID);
  47.       const kBMDS = kRDFSvc.GetDataSource("rdf:bookmarks");
  48.       const krDefaultFolder = kRDFSvc.GetResource("NC:NewBookmarkFolder");
  49.       const krType = kRDFSvc.GetResource("http://www.w3.org/1999/02/22-rdf-syntax-ns#type");
  50.       const krFolder = kRDFSvc.GetResource("http://home.netscape.com/NC-rdf#Folder");
  51.       const isFolder = kBMDS.HasAssertion(krDefaultFolder, krType, krFolder, true);
  52.       const krNameArc = kRDFSvc.GetResource("http://home.netscape.com/NC-rdf#Name");
  53.       if (!isFolder) {
  54.         const krRoot = kRDFSvc.GetResource("NC:BookmarksRoot");
  55.         gCreateInFolder = "NC:BookmarksRoot";
  56.       }
  57.       var rName = kBMDS.GetTarget(isFolder ? krDefaultFolder : krRoot, krNameArc, true);
  58.       rName = rName.QueryInterface(Components.interfaces.nsIRDFLiteral);
  59.       kDisplay.value = rName.Value;
  60.     }
  61.   
  62.     function chooseDefaultFolder ()
  63.     {
  64.       var rv = { selectedFolder: null };
  65.       openDialog("chrome://communicator/content/bookmarks/addBookmark.xul", "", 
  66.                  "centerscreen,chrome,dialog=no,resizable=no", 
  67.                  null, null, gCreateInFolder, null, "selectFolder", rv);
  68.       if (rv && rv.selectedFolder) {
  69.         const kRDFSvcContractID = "@mozilla.org/rdf/rdf-service;1";
  70.         const kRDFSvcIID = Components.interfaces.nsIRDFService;
  71.         const kRDFSvc = Components.classes[kRDFSvcContractID].getService(kRDFSvcIID);
  72.         const kBMDS = kRDFSvc.GetDataSource("rdf:bookmarks");
  73.         const krDefaultFolder = kRDFSvc.GetResource(rv.selectedFolder);
  74.         const krNameArc = kRDFSvc.GetResource("http://home.netscape.com/NC-rdf#Name");
  75.         rName = kBMDS.GetTarget(krDefaultFolder, krNameArc, true);
  76.         rName = rName.QueryInterface(Components.interfaces.nsIRDFLiteral);
  77.         document.getElementById("defaultFolder").value = rName.Value;
  78.       }  
  79.         
  80.     }
  81.   ]]>
  82.   </script>
  83.         
  84.   <groupbox>
  85.     <caption label="&filingBookmarks.label;"/>
  86.     <description flex="1">&autoFile.label;</description>
  87.     <hbox align="center">
  88.       <checkbox id="enableAutoFile" label="&enableAutoFile.label;"
  89.                 preftype="bool" prefstring="browser.bookmarks.add_without_dialog"
  90.                 prefattribute="checked"/>
  91.     </hbox>
  92.     <separator/>
  93.     <description flex="1">&defaultFolder.label;</description>
  94.     <hbox align="center">
  95.       <textbox readonly="true" id="defaultFolder" crop="right" flex="1"/>
  96.       <button label="&chooseDefaultFolder.label;" accesskey="&chooseDefaultFolder.accesskey;"
  97.               oncommand="chooseDefaultFolder();"
  98.               id="browser.bookmarks.choosefolder" preftype="bool"
  99.               prefstring="pref.browser.homepage.disable_button.choose_folder" prefattribute="disabled"/>
  100.     </hbox>
  101.   </groupbox>
  102.  
  103.   <groupbox>
  104.     <caption label="&extendedDataViews.label;"/>
  105.     <vbox align="start">
  106.       <description>&extendedDataExplanation.label;</description>
  107.       <checkbox id="showExtendedData" label="&showExtendedData.label;"
  108.                 accesskey="&showExtendedData.accesskey;"
  109.                 preftype="bool" prefstring="browser.bookmarks.show_extended_data"
  110.                 prefattribute="checked"/>
  111.     </vbox>
  112.   </groupbox>              
  113.  
  114.  
  115. </page>
  116.  
  117.