On Sat, Aug 8, 2009 at 11:30 AM, TonyV<[email protected]> wrote:
>
> I have a nifty script that I would like to add user options to. I've
> been playing around with the GM_registerMenuCommand function to add
> some user options, but it seems very, very limited currently. Most of
> the options are toggles, so I would love the ability to tell the menu
> command to be able to have a checkmark beside it. Barring that, I
> would like the ability to have something like a
> GM_unregisterMenuCommand so that I could toggle the text back and
> forth depending on the setting. Am I missing something that would
> enable one of these two options?
Here's a toggle from one of my scripts (it doesn't matter what 'biyus'
is, this is just illustrative):
var biyus = GM_getValue("biyus", true);
biyus == true ? biyusToggle = "On" : biyusToggle = "Off";
GM_registerMenuCommand("Toggle BIYUS (" + biyusToggle + ")", toggleBIYUS);
function toggleBIYUS() {
biyus == true ? biyus = false : biyus = true;
GM_setValue("biyus", biyus);
document.location.reload();
}
In the menu, you see "Toggle BIYUS On" if it's off, and vice versa.
Patrick
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"greasemonkey-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/greasemonkey-users?hl=en
-~----------~----~----~----~------~----~------~--~---