Reddit Diabetes BG highlighter

By dosman711 Last update Apr 14, 2012 — Installed 617 times.

Script Summary: Highlights numbers in r/diabetes and gives the mg/dL <=> mmol/L conversion in the tooltip



Version: 0.97

Script homepage

This is a simple userscript that will look for numbers in the comments pages of r/diabetes to add a mouse-over tool tip of the mg/dL to mmol/L (and vice versa) conversion. Note: Firefox users will need to have GreaseMonkey installed/enabled.

0.95 screenshots:













Changelog:
version 0.97, 2012-04-14
-----------------------
- Fixed bug that would remove text if a user styled it

- Modified match regex so that it additionally ignores the following:
    per, am, pm, o'clock, oclock, test, g, %, $, cup, ounce, slice,
    other, ft, yo, of, lada, "or lada", pod, needle, pen, night,
    buck, euro, dollar, mph, place, vial, u, yard, meter, yd,
    injection

- Modified lookbehind function to ignore additional patterns:
    * day, hour, turned, for
    * T1.5
    * the phrase "catch-##"
    * Long-hand dates (January 13, 2012)

version 0.96, 2012-03-28
-----------------------
- Fixed style tag so that numbers properly hilight in Firefox

version 0.95, 2012-03-28
-----------------------
- Modified match regex so that it now ignores the following:
    year, yr, month, mo, week, day, hour, hr, minute, second, gram,
    carb, carbohydrate, unit, percent, time, lb, kg, mg, mcg, packet,
    bag, box, that, liter, litre, click, mile, kilometer, mi, km, ish,
    pound, kilo, kilogram, stone

- Modified match regex so that it will now match patterns like
    "## - ##", "## to ##", "##s - ##s", and "##s to ##s"

- Modified match regex to allow for "," as a decimal separator

- Modified lookbehind function to ignore additional patterns:
    * paradigm, minimed, mm, age
    * versions using "," as the separator, e.g. "1,2,3"
    * the phrase "other ## or"
    * Times ##:##

- Script now does not highlight 0 or numbers > 800