Firefox/Projects/PlacesQueryAPIRedesign: Difference between revisions

Jump to navigation Jump to search
Line 160: Line 160:
  *                                      Removes redirects targets from results.
  *                                      Removes redirects targets from results.
  *                                      Default is false.
  *                                      Default is false.
  *              includeHiddenPages: boolean.
  *              includeHidden: boolean.
  *                                 Returns also pages marked as hidden.
  *                             Returns also pages marked as hidden.
  *                                 Default is false.
  *                             Default is false.
  *              includeVisits: boolean.
  *              includeVisits: boolean.
  *                            Returns all visits.
  *                            Returns all visits.
Line 176: Line 176:
  *        }
  *        }
  *  group: string.
  *  group: string.
  *          Either "tags", "folders", "day", "month", "year" or "domain".
  *          Either "tag", "folder", "day", "month", "year" or "domain".
*          Defaults to "none".
*  limit: number.
*          Maximum umber of results to return.  Defaults to all results.
*  merge: string.
*          How to merge this query's results with others in the same request.
*          Either "union", "intersect" or "except".
* }
*
*
/* QueryConf.prototype = {
*  phrase: string.
*          Show only pages containing this string in either title, uri or
*          tags.  Case insensitive.  Can use ^ and $ to match beginning or
*          end.
*  host: string.
*        Show only pages containing this string in the host.  Case
*        insensitive.  Can use ^ and $ to match beginning or end.
*  uri: string.
*        Show only pages containing this string in the uri.  Case
*        insensitive.  Can use ^ and $ to match beginning or end.
*  annotated: array of strings.
*          Show only pages with these annotations (Either page or item).
*  bookmarked: object {
*                tags: array of strings.
*                      Show only pages tagged with these tags.
*                folders: array of numbers.
*                          Show contents of these folders. (non-recursive)
*                id: number.
*                      Show only the bookmark with this id.
*                when: array of 2 Date objects.
*                      Show only bookmarks created between these times.
*                      Can use null beginning or end time to match till epoch
*                      or now.
*                modified: array of 2 Date objects.
*                          Show only bookmarks modified between these times.
*                          Can use null beginning or end time to match till
*                          epoch or now.
*                excludeNonContainers: boolean.
*                                      Removes any non-container from results.
*                                      Default is false.
*                excludeReadOnlyContainers: boolean.
*                                            Removes read only containers from
*                                            results.  Default is false.
*              }
*  visited: object {
*              count: array of numbers.
*                    Show only pages with these so many visits.
*                    Can use null minimum or maximum to match anything.
*              transitions: array fo transition types.
*                          Show only pages with at least one visit with these
*                          transitions.
*              when: array of 2 Date objects.
*                    Show only pages with visits between these times.
*                    Can use null beginning or end time to match till epoch
*                    or now.
*              excludeRedirectSources: boolean.
*                                      Removes redirects sources from results.
*                                      Default is false.
*              excludeRedirectTargets: boolean.
*                                      Removes redirects targets from results.
*                                      Default is false.
*              includeHiddenPages: boolean.
*                                  Returns also pages marked as hidden.
*                                  Default is false.
*              includeVisits: boolean.
*                            Returns all visits.
*                            Default is false, that means visits are grouped
*                            by uri, and no duplicates are returned.
*            }
*  sort: object {
*          by: string.
*              Either "none", "title", "time", "uri", "accessCount" or
*              "lastModified", "frecency".  Defaults to "none".
*          dir: string.
*                Either "asc" or "desc".  Defaults to "asc".
*        }
*  group: string.
*          Either "tags", "folders", "day", "month", "year" or "domain".
  *          Defaults to "none".
  *          Defaults to "none".
  *  limit: number.
  *  limit: number.
Line 299: Line 221:
                       folders: [PlacesUtils.bookmarksToolbarFolderId]
                       folders: [PlacesUtils.bookmarksToolbarFolderId]
                   },
                   },
                   group: "folder"
                   group: "container"
                 });
                 });


Line 320: Line 242:
                       excludeReadOnlyContainers: true
                       excludeReadOnlyContainers: true
                   },
                   },
                   group: "folder"
                   group: "container"
                 });
                 });


Line 331: Line 253:
// Most recent tags.
// Most recent tags.
new PlacesQuery({ bookmarked: {},
new PlacesQuery({ bookmarked: {},
                   group: "tags",
                   group: "tag",
                   limit: 5
                   limit: 5
                 });
                 });
Line 338: Line 260:
new PlacesQuery({ bookmarked: { folders: [PlacesUIUtils.leftPaneFolderId] },
new PlacesQuery({ bookmarked: { folders: [PlacesUIUtils.leftPaneFolderId] },
                   annotated: "Places/OrganizerQuery"
                   annotated: "Places/OrganizerQuery"
                   group: "folder"
                   group: "container"
                 });
                 });


// Downloads
// Downloads
new PlacesQuery({ visited: {
new PlacesQuery({ visited: {
                       transition: PlacesUtils.history.TRANSITION_DOWNLOAD,
                       transitions: [PlacesUtils.history.TRANSITION_DOWNLOAD],
                       includeHiddenPages: true,
                       includeHidden: true,
                       includeVisits: true
                       includeVisits: true
                   },
                   },
Confirmed users
595

edits

Navigation menu