bookmarksPanel.js 988 B

1234567891011121314151617181920212223242526
  1. /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. function init() {
  6. document.getElementById("bookmarks-view").place =
  7. "place:queryType=1&folder=" + window.top.PlacesUIUtils.allBookmarksFolderId;
  8. }
  9. function searchBookmarks(aSearchString) {
  10. var tree = document.getElementById('bookmarks-view');
  11. if (!aSearchString)
  12. tree.place = tree.place;
  13. else
  14. tree.applyFilter(aSearchString,
  15. [PlacesUtils.bookmarksMenuFolderId,
  16. PlacesUtils.unfiledBookmarksFolderId,
  17. PlacesUtils.toolbarFolderId]);
  18. }
  19. window.addEventListener("SidebarFocused",
  20. function()
  21. document.getElementById("search-box").focus(),
  22. false);