Every time the user selects something in a facet, then just update the 
URL but do not navigate away from the current page.

Take a look in
    
http://api.simile-widgets.org/exhibit/2.2.0/scripts/ui/facets/list-facet.js
Find the function
    Exhibit.ListFacet.prototype.applyRestrictions
That's what you want to override:
    <script>
       var oldApplyRestrictions = 
Exhibit.ListFacet.prototype.applyRestrictions;
       Exhibit.ListFacet.prototype.applyRestrictions = 
function(restrictions) {
          oldApplyRestrictions.call(this, restrictions);

          var facetID = this._div.id;
          // change the # part of the current URL, given facetID and 
restrictions
       }
    </script>

David

Francois wrote:
> Thanks for the suggestion. What event may I use to change the facet ?
>  With # in the url the onload event or the SimileAjax.jQuery
> (document).ready(function() {  ... } are not called
>
> Francois
>
> On Mar 6, 10:29 pm, David Huynh <[email protected]> wrote:
>   
>> Francois wrote:
>>     
>>> Now, a naive question, but anyway:  if I use the facets to change the
>>> selection, the page is relatively quickly made. It takes much longer
>>> if I called the page again with the url and pass the parameter to
>>> modify the facets selections. I suppose it's because the page is made
>>> again from nothing on each call. Would it be possible to load the page
>>> on the first url and to have the same mecanism that is used in the
>>> facet selection with the second or third url ?
>>>       
>> You can, by encoding the selection with # instead of ?.
>>
>>    http://foo.com/my-example.html#facetX_choiceA
>>
>> rather than
>>
>>    http://foo.com/my-example.html?facetX=choiceA
>>
>> To the browser, pages with different things after ? are considered
>> different, whereas pages with different things after # are considered
>> the same.
>>
>> David
>>     
> >
>   


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"SIMILE Widgets" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/simile-widgets?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to