There are several words that are commonly used in Drupal but which are not supposed to be used in the user interface. For example, developers will often say "node type" when the more user friendly term is "content type." Sometimes the use of "node type" will slip into the documentation or UI of Drupal which makes it even more confusing because the user has to learn two words for the same concept.
This is a Greasemonkey script for Firefox which alerts you when the page you are viewing contains one of these undesirable phrases like "node". If you have this turned on when developing UI related code, and when creating/reviewing documentation, then such phrases will not accidently slip into your work unnoticed.
Firstly, you will need to be using the Firefox browser with the Greasemonkey extension installed.
Next, follow this link to install the latest version of the undesirable string script. By default this script is turned on only for pages on drupal.org, and only picks up the phrase "node". You can turn it on for additional sites through the Greasemonkey management dialog; Tools -> Greasemonkey -> Manage user scripts... and then select "Drupal Undesirable String Bar" from the script list and use the "Included Pages" / "Excluded Pages" to control which sites to use it on. If you want to change which phrases it picks up on, see the advanced configuration section below.
Once activated for a site, whenever a page on that site contains an undesirable string, a black bar will appear at the bottom of your Firefox window, like this:
Every occurance of the string in the page will be highlighted, and also placed in the bar at the bottom. Hovering the mouse over one of the matches in the bar will give the location of that occurance in CSS selector style. Furthermore, clicking on one of the occurances in the bar will take you to where it occurs in the page. Note that some of these occurances may be within dropdown list boxes, in which case the aforementioned highlighting and click behaviour will not occur, but the hover text will start with "option" (the HTML tag used for dropdown list box options).
Initial public release, done for GHOP Task #84.
Should you have any comments, suggestions or queries, then post them to the GHOP Issue, or email them directly to [email protected].
You may want to:
bad_phrases.push('(^|\\W)nodes?($|\\W)');
". To add more
phrases for the bar to pick up on, duplicate this line and change the regexp.
Just after this are three lines which begin with "var bar_colour_back
"
, "var bar_colour_fore
" and "var highlight_colour
".
Changing the latter part of any of these will change the colour of the bar's
background, the text on the bar and the highlighting done to phrases in the page.
If you plan larger changes than these, then delve into the rest of the script.