David,
Thanks for the advice. I believe I was not clear enough, since your
code update the url when one clicks on a link. I am looking for the
other direction: how to modify the exhibit when a link with # in it,
is used.

Using
"javascript:window.location='exhibit.html#fp_pub=Elsevier';applyRestrictions
();" in href attribute of an "a" link do what I search. But I was
wondering if I could have normal url in href and have an exhibit event
which would call the applyRestrictions function.

See http://www.unifr.ch/dokpe/paperj/exhibit.html

So is there a cleaner way to use the # trick ?

Francois

On Mar 12, 7:40 pm, David Huynh <[email protected]> wrote:
> 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-fa...
> 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