First, I have to say that I really really like this module. I've been wanting to do something like this for a while and I'm excited that you've done such a great job with it already.

One thing that seems valuable would be to create a default set of hotkeys.

I think one for "submit" would be good at a minimum. If I think of any others I could certainly help provide them, but I imagine you know of several already.

CommentFileSizeAuthor
#5 hotkey.install.txt538 bytesgreggles

Comments

shawn conn’s picture

I might have not mentioned this but the Drupal form element name can usually be found in the id attribute in the format "edit-NAME" where NAME is the Drupal form element name. I think a set of rules would be much cleaner since (type of element, name of element, etc...), as it stands right now, this version requires a user to know a little about inner workings of Drupal. Ideally, a module should be as transparent to a user as possible.

greggles’s picture

I generally agree with your comments, but I think a few default rules would be a nice simple way to make this module more useful to users and easier for them to understand how to configure. An example is often easier to understand than a long set of instructions.

I'm not complaining about the install instructions or UI - they were fine.

shawn conn’s picture

I understand what you mean now. I've created CVS head version that now includes examples in the admin settings page (for Save, Delete, Previews buttons on a node editing page).

shawn conn’s picture

Status: Active » Closed (fixed)
greggles’s picture

Title: provide default hotkeys » provide default hotkeys and an uninstall
Status: Closed (fixed) » Needs review
StatusFileSize
new538 bytes

That seems pretty good. I was thinking more along the lines of having it automatically insert those values into the variable table.

So that when the module is enabled no configuration is necessary to get it working right out of the box.

The attached file provides this feature and also provides a hook uninstall to remove the variable (helpful for testing).

I'm respectfully setting this back to patch (code needs review). If you disagree with the idea feel free to move it back "closed".

Note that you'll need to remove the .txt from the filename.

BrightLoudNoise’s picture

How about adding "insert" as a hotkey for adding instances of a field which allows multiple values?

After a brief look, it appears that the submit buttons that handle adding more instances all have an id suffix of "-more" in ahah forms.

greggles’s picture

@BrightLoudNoise - are you suggesting that as another default? I personally don't use that button so I don't see the benefit of it as a default.

Did you test this new file? This issue is "needs review" so your help reviewing the code is appreciated.

shawn conn’s picture

Version: 5.x-1.0 » 5.x-2.1
Status: Needs review » Closed (fixed)

Greggles, I've taken your ideas for .install file and implemented them in the 2.x version of hotkey. You can now assign hotkeys to form buttons by their label rather than the form id (which can be cryptic for non-Drupal devs). Also, hotkey now provides default keys for "Submit","Preview", and "Delete" buttons.