AesopInteractive / lasso

Code Repository for Editus (formerly Lasso) Commercial Plugin
https://edituswp.com
GNU General Public License v2.0
147 stars 25 forks source link

Search for post #72

Closed bearded-avenger closed 9 years ago

bearded-avenger commented 9 years ago

add ability to search for a post in the all posts modal

Shelob9 commented 9 years ago

@bearded-avenger Question would this be built with the S query var in WP_Query (should be able to create a client-js view based on s query var very easily BTW) or would it be a custom search system?

bearded-avenger commented 9 years ago

my first thought was a return with the JSON API since it's there wp-json/p/XX. Simple query could definitely work for that if not done with the API.

Shelob9 commented 9 years ago

Seems like if we're going JSON API, this could get built into the existing all post modal pretty easily. Just modify the current view on key up a search form.

JoshPress.net http://joshpress.net/ CalderaWP.com http://calderawp.com/ @Josh412 http://twitter.com/Josh412

On 25 May 2015 at 15:35, Nick Haskins notifications@github.com wrote:

my first thought was a return with the JSON API since it's there wp-json/p/XX. Simple query could definitely work for that if not done with the API.

— Reply to this email directly or view it on GitHub https://github.com/AesopInteractive/lasso/issues/72#issuecomment-105295397 .

bearded-avenger commented 9 years ago

ref https://github.com/AesopInteractive/lasso/commit/5c73ac37dd8d2d19ca89c502f70316a7fe74d738 https://github.com/AesopInteractive/lasso/commit/413d616e343b4daef8001c65c25896c3eea54baf https://github.com/AesopInteractive/lasso/commit/3bedc74f5934e4b837fe3344546110d86c8af3ef https://github.com/AesopInteractive/lasso/commit/316857e2ada43087500fe5a8d78bc369dc5be951 https://github.com/AesopInteractive/lasso/commit/22afc7247807bcc15ddcaf346d506c371bb4bef3

bearded-avenger commented 9 years ago

kinda torn on keyup vs change

michaelbeil commented 9 years ago

both?

$("#element").on('keyup change', function (){
   // Your stuff...
});
bearded-avenger commented 9 years ago

I like suggestions, but don't start searching until I ask you to. Good UX is like a butler...polite, helpful and invisible...

https://twitter.com/ci_chrisford/status/604326603858968576

bearded-avenger commented 9 years ago

after I press enter. Results as I type are distracting, and subconsciously a bit presumptuous. https://twitter.com/christinebpc/status/604327064456417280

michaelbeil commented 9 years ago

Yes, very true.

bearded-avenger commented 9 years ago

kinda buggy, and this gif is janky the colors are all off screen recording 2015-05-29 at 11 45 am

bearded-avenger commented 9 years ago

I think I personally prefer change instead of keyup

michaelbeil commented 9 years ago

yea, weird coloration going on. anyways, what do you like better about change?

bearded-avenger commented 9 years ago

I think it's more predictable, and my thoughts are along the lines of Christine.

michaelbeil commented 9 years ago

I think that's the better route then. Her thought seemed most pertinent.

bearded-avenger commented 9 years ago

In this context, it's not a user searching for some article on how to widdle wood on the logged out view of a website, so I think the predictive nature in that context is great. But here the user likely knows what part of the post is titled, so I wonder if predictive wouldn't be great in this context.

michaelbeil commented 9 years ago

I mean predictive can make the process faster. Contextually, the user will most likely be going about their site with speed and efficiency in mind.

bearded-avenger commented 9 years ago

alright here's latest, gotta shift focus to actual work now ;)

http://cl.ly/0G1t0N0j340z

bearded-avenger commented 9 years ago

The only thing stopping this from being fully complete is pagination, which I can't find the endpoint for in the REST API (V1). wp-json/posts?filter[s]=test?page=2 should be working but it's returning empty.

None of these work either: wp-json/posts?filter[s]=test?[page]=2 wp-json/posts?filter[s]=test?[paged]=2

bearded-avenger commented 9 years ago

pushed out a first version that returns 50 results, lazy load to come