Confirmed users
595
edits
No edit summary |
No edit summary |
||
Line 225: | Line 225: | ||
*/ | */ | ||
// EXAMPLES (not all of them work, they are supposed to show the conf) | |||
// Bookmarks toolbar. | |||
new PlacesQuery({ bookmarked: { | |||
folders: [PlacesUtils.bookmarksToolbarFolderId] | |||
}, | |||
group: "folder" | |||
}); | |||
// History menu. | |||
new PlacesQuery({ visited: {}, | |||
sort: { by: "time", dir: "desc" }, | |||
limit: 10 | |||
}); | |||
// Start-of-awesomebar (still missing adaptive, keywords, ...). | |||
new PlacesQuery({ phrase: "someword", | |||
sort: { by: "frecency", dir: "desc" }, | |||
limit: 12 | |||
}); | |||
// Folder picker. | |||
new PlacesQuery({ bookmarked: { | |||
folders: [PlacesUIUtils.allBookmarksFolderId] | |||
excludeNonContainers: true, | |||
excludeReadOnlyContainers: true | |||
}, | |||
group: "folder" | |||
}); | |||
// Most recent bookmarks. | |||
new PlacesQuery({ bookmarked: {}, | |||
sort: { by: "lastModified", dir: "desc"} | |||
limit: 5 | |||
}); | |||
// Most recent tags. | |||
new PlacesQuery({ bookmarked: {}, | |||
group: "tags", | |||
limit: 5 | |||
}); | |||
// Left pane query. | |||
new PlacesQuery({ bookmarked: { folders: [PlacesUIUtils.leftPaneFolderId] }, | |||
annotated: "Places/OrganizerQuery" | |||
group: "folder" | |||
}); | |||
// Downloads | |||
new PlacesQuery({ visited: { | |||
transition: PlacesUtils.history.TRANSITION_DOWNLOAD, | |||
includeHiddenPages: true, | |||
includeVisits: true | |||
}, | |||
sort: { by: "time", dir: "desc" } | |||
}); | |||
// Visited bookmarks containing either "foo" or "bar". | |||
new PlacesQuery([ | |||
{ phrase: "foo", | |||
bookmarked: {}, | |||
visited: {} | |||
}, | |||
{ phrase: "bar", | |||
bookmarked: {}, | |||
visited: {} | |||
}, | |||
); | |||
// Visited bookmarks containing "foo", but not "bar". | |||
new PlacesQuery([ | |||
{ phrase: "foo", | |||
bookmarked: {}, | |||
visited: {} | |||
}, | |||
{ phrase: "bar", | |||
bookmarked: {}, | |||
visited: {}, | |||
merge: "except" | |||
}, | |||
); | |||
// Visited bookmarks containing "foo" but not "bar". | |||
new PlacesQuery([ | |||
{ phrase: "foo", | |||
bookmarked: {}, | |||
visited: {} | |||
}, | |||
{ phrase: "bar", | |||
bookmarked: {}, | |||
visited: {}, | |||
merge: "except" | |||
}, | |||
); | |||
</pre> | </pre> |