[Freeipa-devel] BA-BBQ

Adam Young ayoung at redhat.com
Mon Aug 23 02:12:59 UTC 2010


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.

The thing I have to figure out now is what this will do to navigation on 
the details, add and groups pages.




More information about the Freeipa-devel mailing list