[Freeipa-devel] BA-BBQ

Pavel Zuna pzuna at redhat.com
Mon Aug 23 11:51:00 UTC 2010


On 08/23/2010 04:12 AM, Adam Young wrote:
> Pavel,
>
>
> Thoughts of jquery.ba-bbq have been marinating in the back of my brain.
> I know that the Back button doesn't work so well with hjashparams, and
> that BBQ purports to fix this, but I had some sort of mental shift I had
> to make. I think I have it now.
>
> BBQ, and in fact the whole AJAX approach works off of client side code,
> which means the whole hash params approach. What I didn't get was that
> the best approach to dealing with this was to drive the site off of the
> event that happens when the url hash changes. We need to do this.
>
> Bascially, navigation.js registers:
>
> $(window).bind( 'hashchange', function(e) {
> ...
> }
>
> This function gets called each time the URL hash changes, which happens
> on either a tab click or on a back button (lets start with those two,
> there will be more)
>
>
> So bascially, this function is our dispatach. Instead of having to
> register the onclick functions for each of the tabs, we know that they
> will all end up in this function, and then we let it parse the params
> for us.
>
> BBQ has the concept of a stack, where we can push and pop state. Thyis
> might be useful for pushing a query, going to the details page, and then
> popping the query afterwards. I'm still mulling this over.
>
>
> Note, we will want to replace the custom hash param working we are doing
> with JQuery.deparam and JQuery.param calls, as they are much more
> mature, and it is less code we have to debug.
Sure, from what I've read in jQuery docs, it looks more powerful than what we 
currently have.

> The thing I have to figure out now is what this will do to navigation on
> the details, add and groups pages.
I don't think it will be a problem. Functional links (such as Reset, Update, 
Add, Remove) are only used to run javascript functions - the URL, query string 
or hash doesn't change. Most of these action are also "one way" only. We don't 
want the user to be able to go Back after he updated an entry. (Going back in 
this case should probably bring him back to the search page).

Pavel




More information about the Freeipa-devel mailing list