Remember the Milk: Tag Cloud Restructurer

By emalminator Last update Apr 6, 2012 — Installed 2,138 times.

Script Summary: A script to restructure the tag cloud in Remember the Milk. Based off of masnare's Tag Cloud Colorizer script, jgallen23's RememberTheMilkEnhanced script, and ideas in the Tag Cloud post in the RTM forums.



Version: 1.1

Overview

Based on masnare's Tag Cloud Colorizer script (http://userscripts.org/scripts/show/25046) and jgallen23's RememberTheMilkEnhanced (http://userscripts.org/scripts/show/26057), as well as ideas from the Tag Cloud post in the Remember the Milk forums (http://www.rememberthemilk.com/forums/tips/2943/).

This script provides a fairly general framework for restructuring the items in the tag cloud in Remember the Milk. Specifically, one can:

  • Group related lists, locations, and tags by prefix
  • Generate a hierarchy of tags dynamically, to arbitrary depth
  • Give a single tag its own section
  • Rename individual tags anywhere in the tag cloud (ex: 'P' to 'Personal')
  • Recolor tag sections
  • Reorder sections arbitrarily
  • Hide ordinary list tabs

Here's an example of what the script can produce (the full list of tags, lists, and locations generating it is below):

Image and video hosting by TinyPic

(To turn on the cloud, go to Settings, then General, and check the Task Cloud box.)

The script also includes some stylistic tweaks, such as removing the cow graphic from the RTM page and fixing the sidebar at the top of the page (which becomes crucial if the tag cloud is long enough to scroll past the bottom of the page). These can easily be commented out if they are not desired.

The hierarchy-style section in particular makes it easy to have projects with subprojects, as these can be stored in their own individual lists. This also reduces the tagging and list redundancy, as long as the user is willing to partition their tasks between project lists.

It is likely that other users will need to adjust the default configuration to their own needs. Changes should be made to the Configuration section of the script, at the top of the Tag Cloud Restructurer section. In that part of the script, users can change the global preferences for the script and define their tag sections with their per-section preferences. Full details of the section types are given below, in 'Section Types and Preferences'.

If users are familiar with masnare's script, this script differs from it in several ways:

  • masnare's sections are now the sectionFlat objects.
  • No additional "system" tags (such as @__context) are needed, as the header tags are created by the script itself.
  • There is now a dictionary-based system for global and per-section preferences.

So far, as of April 2012, this script has been tested under Firefox 11 + Greasemonkey and under Google Chrome 18 with the built-in userscript support. I would appreciate feedback and testing on other browsers. Also, any feature requests or suggestions more generally are appreciated, although I am by no means an experienced JavaScript programmer.

Tags, Lists, and Locations for Example Tag Cloud

Here are the active lists, locations, and tags that generate the example tag cloud above:

Ordinary Lists:

  • Inbox
  • -P
  • -P/Apartment
  • -P/Apartment/Cleaning
  • -P/Apartment/Repairs
  • -P/Computer
  • -P/Computer/iPad
  • -P/Computer/iPhone
  • -P/Computer/OSX
  • -P/Computer/RTM Tag Cloud
  • -P/Computer/TeX
  • -P/Maintenance
  • -P/Maintenance/Health
  • -P/Maintenance/Vehicles
  • -P/Recreation
  • -P/Recreation/Games
  • -P/Recreation/Music
  • -P/Recreation/Reading
  • -W
  • -W/Reports
  • -W/Reports/Quarterly
  • -W/Reports/TPS
  • Lent/Borrowed
  • Sent

Tags (each of which is associated to at least one active task, so that it is displayed in the cloud):

  • @email
  • @errand
  • @phone
  • _chores
  • financial
  • gifts
  • goal
  • maybe
  • next

Locations (as with tags, associated to at least one active task):

  • @home
  • @office

Section Types and Preferences

sectionSingle

The sectionSingle section matches a single tag in the cloud and renames it. The original tag can also be displayed in the header if desired.

sectionFlat

The sectionSingle section groups all tags starting with the specified prefix together in a single section, prefaced by the specified header text. The tags can be displayed run-in, as in the Contexts section, or as a block, as in the Miscellaneous section. Other options control how to resize tags, whether to keep the prefix in the tags or to display it in the header, and whether to convert underscores to spaces and to capitalize the words in the tags.

sectionHierarchy

The sectionSingle section groups all tags starting with the specified prefix together in a tree-like hierarchy, as in a file system. In the example above, the - prefix acts like the root of the file system (e.g., C:\ on Windows or / on Linux or Mac OS X), and the words between the separators act like the folder names. The character / is a good choice for a separator in list names, but is not allowed in tags, for which + or - are better options.

General Preferences

Use the globalprefs dictionary to set global preferences for the scripts, including whether to show borders around sections, which tags to hide or rename, and whether to match case when identifying tags to hide or rename.

In addition to the renameTags dictionary, you can rename a list 'on the fly' by appending the desired name to the list name in double square brackets. For example, changing 'Lent/Borrowed' to 'Lent/Borrowed [[Library]]' causes the item to 'library' (lowercased because of RTM's tag processing). To circumvent the lowercasing, use an HTML entity (e.g., '[[Library]]' gives 'Library').

Changes in Version 1.1

  • Fixed: Hierarchy section with depth: 2 now displays correctly
  • Fixed:displayOrder preference now orders sections correctly
  • Fixed:sectionFlat header search now searches for lists with spaces correctly
  • Changed: Renamed sectionRename section type to sectionSingle
  • Changed: Moved section definitions to right after global preferences
  • Changed: Renamed sectionFlat preference renameTags to capAndSpaceTags
  • New: Global dictionary (renameTags) of tags to rename
  • New: Global preference (matchTagCase) for case sensitivity when matching tags to rename or hide
  • New:sectionFlat preference (minChildSize) to set lower limit for tag size
  • New:sectionFlat preference (runinText) to display flat section as HEADER: tag tag ...
  • New: Default color preferences for all sections
  • New: Hovering over flat section header displays section prefix