ad-code-manager
ad-code-manager copied to clipboard
Feature: Autocomplete/dropdown or any other assisted input with generic conditionals
Per @jeremyfelt: it would be cool if we could modify the input fields for each conditional either through filters or just by default. For example – If is_category() is selected as the conditional, a drop down list of existing categories would be more pleasant than a text field.
I started tackling this last night and made some decent progress. I'm going to try and have it ready for some testing by next week.
Cool, assigned this to you and the v0.3 milestone
@jeremyfelt still want to try to swing this for v0.4?
This got pretty ugly pretty quick. I'm guessing it's a no go for v0.4, but deserves future thought. I'll take a peek soon.
Brainstorming here... Ignoring quick edit for the moment, just focusing on new ad code.
- Check a JS global for options to prefill when
onchangeofacm-conditionals[]select field is triggered - If the JS global has a matching key -
is_category- replace theacm-arguments[]input field with a select menu - Loop through the matching key's array in the JS global to build the possible selections in
acm-arguments[]
So...
- This seems straight forward at first, but what if you're working with
is_tagas your conditional and have 70,000 tags? - Rather than a new select menu, we can use jQuery UI's chosen to corral a massive list.
- Generating the massive list would be expensive, though we are in the admin. Would an ajax search interface make sense instead?
- Would it make more sense as a filter that let themes or providers decide what should show?
See, ugly. :)
Thoughts @danielbachhuber @rinatkhaziev?
This seems straight forward at first, but what if you're working with is_tag as your conditional and have 70,000 tags?
Start autocompleting at 3 chars, limit to 100 items. This way we won't do any expensive queries.
Rather than a new select menu, we can use jQuery UI's chosen to corral a massive lis
Makes sense
Generating the massive list would be expensive, though we are in the admin. Would an ajax search interface make sense instead?
See the first bullet point
Would it make more sense as a filter that let themes or providers decide what should show?
Filter would definitely be nice.
Not that ugly :)
Good point. With Chosen, the user could just finish typing if it doesn't match one of the 100. Much less ugly.
@jeremyfelt will you be able to finish this up in the next day or so?
I'm going to try and toss some time at it this evening or tomorrow, but the outlook is unlikely at finishing it up for 0.4.
Let's just put it in v0.5 then, and we can keep the momentum going by releasing in a month or so. Please do the work on a feature branch when you do work on it.
Awesome, sounds good.
No branch apparently existing in GitHub for this work.