shawnchin / jquery-cron

A jQuery plugin to provide a simplified interface for users to specify cron entries
http://shawnchin.github.io/jquery-cron
MIT License
177 stars 118 forks source link

extraValues & readonly #3

Closed tfforums closed 12 years ago

tfforums commented 13 years ago

Hi - just added the abilty to specify custom top-level options. would be nice if this could be done for 2nd level options or ranges... ie add "5 minutes" etc... in options for the create:

extraValues:[["5 Minutes","/5 * * * *"],["15 Minutes","/15 * * * *"]]

note the format is nested arrays - less than ideal / could be better

Also added a brute-force readonly method... which converts the value to text without the controls... pretty harshe but works.

I just thought that this stuff may be the start of doing this properly rather than my hacks :)

shawnchin commented 12 years ago

Thanks for the changes. Allowing extra custom values is a great idea, but I'm not sure if that's the cleanest approach.

I'll digest your edits when I get a chance to and try to integrate the feature.

shawnchin commented 12 years ago

I'm just committed an implementation of this (bef27d9). Hopefully this meets your requirements as well. Do feel free to suggest improvements to updates.

I'll wrap the changes up and release it under a new version once it's properly tested.

Many thanks for your contribution.

tfforums commented 12 years ago

yes - i just did this as a once off for myself... would be nice to have an "other" period menu with configurable pre-set crons but I got to the point of it doing what i needed... and then gave up... sorry.

Tom

On Wed, Oct 19, 2011 at 2:53 AM, Shawn Chin < reply@reply.github.com>wrote:

Thanks for the changes. Allowing extra custom values is a great idea, but I'm not sure if that's the cleanest approach.

I'll digest your edits when I get a chance to and try to integrate the feature.

Reply to this email directly or view it on GitHub: https://github.com/shawnchin/jquery-cron/pull/3#issuecomment-2443505

shawnchin commented 12 years ago

Yup. An "other" menu item with a secondary menu showing the custom entries would be also be nice, however that requires a much bigger change to the code.

The current scheme reads well ("Every [5 minutes]" instead of "Every [others] [5 minutes]") and requires only one selection. But this can get quite messy when you have lots of custom entries, so the other scheme would definitely scale better.

I can't decide on which is more user friendly so I'll stick to the simpler implementation for now. Will keep that in mind for future updates.

Many thanks.

Shawn