My Beeminder browser extension

I’ve released a new version! Get the Firefox extension, or download a zip file you can use with Chrome.

Features:

  • There’s a new icon in the header with my take on sorting by urgency; it simply sorts by how many days you’ve got to make progress on the goal. Goals due on the same day are sorted alphabetically, and thus have a consistent order. (Following on the discussion earlier in this thread.)
  • Collapsed goals now stick properly to the bottom even when you resort.
  • If you add a sorting query parameter to the dashboard’s URL (one of ?sorting=urgency, ?sorting=slug, ?sorting=pledge, ?sorting=lasttouch, or ?sorting=simple) that will control the sort order the page starts out using. (As requested in this thread.)
  • For those who want to write user scripts (or extensions of their own) that interface with this extension, I now expose a programmatic interface. Documentation below.
  • Likewise, user scripts or extensions can listen to the beebrowse:sorted event to be notified of changes to the sort order.
Programmatic interface documentation

These methods are exposed within a BeeBrowse namespace on the global window.

Beebrowse.collapse(slug)

Collapses a goal with the specified slug.

Parameters:

  • slug (string): The unique identifier of the goal to collapse.

Throws:

  • Error if the slug is not a string or is empty.
  • Error if no goal with the specified slug exists.

Note: Does nothing if the goal is already collapsed.

Beebrowse.uncollapse(slug)

Uncollapses a goal with the specified slug.

Parameters:

  • slug (string): The unique identifier of the goal to uncollapse.

Throws:

  • Error if the slug is not a string or is empty.
  • Error if no goal with the specified slug exists.

Note: Does nothing if the goal is already uncollapsed.

Beebrowse.toggleCollapse(slug)

Toggles the collapse state of a goal with the specified slug.

Parameters:

  • slug (string): The unique identifier of the goal to toggle.

Throws:

  • Error if the slug is not a string or is empty.
  • Error if no goal with the specified slug exists.

Beebrowse.setCollapse(slug, value)

Sets the collapse state of a goal with the specified slug.

Parameters:

  • slug (string): The unique identifier of the goal.
  • value (boolean): true to collapse the goal, false to uncollapse it.

Throws:

  • Error if the slug is not a string or is empty.
  • Error if no goal with the specified slug exists.

Note: Does nothing if the goal is already in the requested state.

Beebrowse.uncollapseAll()

Uncollapses all currently collapsed goals.

Beebrowse.isCollapsed(slug)

Checks if a goal is collapsed.

Parameters:

  • slug (string): The unique identifier of the goal to check.

Returns:

  • boolean: true if the goal is collapsed, false otherwise.

Throws:

  • Error if the slug is not a string or is empty.
  • Error if no goal with the specified slug exists.

Sorting

Beebrowse.getSort()

Gets the current sort method.

Returns:

  • string: The current sort method. One of: ‘slug’, ‘pledge’, ‘lasttouch’, ‘urgency’, or ‘simple’.

Beebrowse.setSort(value)

Sets the sort method for goals.

Parameters:

  • value (string): The sort method to use. Must be one of: ‘slug’, ‘pledge’, ‘lasttouch’, ‘urgency’, or ‘simple’.

Throws:

  • Error if the value is not one of the allowed sort values.

Goal Listing

Beebrowse.listGoals()

Lists all goals on the dashboard.

Returns:

  • Array<string>: An array of goal slugs.

Beebrowse.listGoalsWithTag(tag)

Lists all goals that have a specific tag.

Parameters:

  • tag (string): The tag to filter goals by.

Returns:

  • Array<string>: An array of goal slugs that have the specified tag.

Throws:

  • Error if the tag is not a string or is empty.
3 Likes