home *** CD-ROM | disk | FTP | other *** search
/ PC World 2003 May / PCWorld_2003-05_cd.bin / Komunik / phoenix / chrome / browser.jar / content / browser / bookmarks / selectBookmark.js < prev    next >
Text File  |  2002-11-16  |  776b  |  35 lines

  1.  
  2. var gBookmarkTree;
  3. var gOK;
  4.  
  5. function Startup()
  6. {
  7.   initServices();
  8.   initBMService();
  9.   gBookmarkTree = document.getElementById("bookmarks-view");  
  10.   gBookmarkTree.treeBoxObject.selection.select(0);
  11.   gBookmarkTree.tree.focus();
  12.   gOK = document.documentElement.getButton("accept");
  13. }
  14.  
  15. function onDblClick()
  16. {
  17.   if (!gOK.disabled)
  18.     document.documentElement.acceptDialog();
  19.  
  20. }
  21.  
  22. function updateOK()
  23. {
  24.   var selection = gBookmarkTree._selection;
  25.   gOK.disabled = selection.length != 1 || 
  26.                 (selection.type[0] != "Bookmark" && selection.type[0] != "")
  27. }
  28.  
  29. function onOK(aEvent)
  30. {
  31.   var selection = gBookmarkTree._selection;
  32.   var url = BookmarksUtils.getProperty(selection.item[0], NC_NS+"URL", gBookmarkTree.tree.database);
  33.   window.arguments[0].url = url;
  34. }
  35.