falsandtru / pjax-api

The advanced PJAX superior to SPA.
https://falsandtru.github.io/pjax-api/
Apache License 2.0
318 stars 28 forks source link

Work with laravel #19

Closed hugofabricio closed 8 years ago

hugofabricio commented 8 years ago

How to work with laravel, i define script but not work.

falsandtru commented 8 years ago

Can you show me the repro or error messages?

hugofabricio commented 8 years ago

no error message displays took a console.log and it returns the object normally.

hugofabricio commented 8 years ago

Its possible check in url: http://rpnonline.com.br

falsandtru commented 8 years ago

Thanks. The cause is default url validation. The current definition is

  public filter(el: HTMLAnchorElement): boolean {
    if (typeof el.href !== 'string') return false;
    const dest = new Url(el.href);
    return /^https?:$/.test(dest.protocol)
        && /^$|\.(html?|php)$/.test(dest.file);
  }

This validation rejects /dir pattern urls. So I'll fix it to allow its pattern.

hugofabricio commented 8 years ago

Thanks man :D

falsandtru commented 8 years ago

Now I unable to release the patched version because travis is broken. You can instantly fix this bug by setting the filter function instead of update.

new Pjax({
  filter: () => true
});
falsandtru commented 8 years ago

Fixed, and released now.